This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
import os | |
import csv | |
import argparse | |
from tqdm import tqdm | |
from zenpy import Zenpy | |
def main(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
S3_BUCKET := cf-templates-1wwumiwcx5krz-ap-southeast-2 | |
S3_PREFIX := 8b87ca7b-869e-4401-baa0-ad0522e32f21 | |
AWSCLI := .venv/bin/aws | |
all: parent.pyaml | |
parent.pyaml: child.pyaml | |
child.pyaml: grandchild.pyaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import tempfile | |
import boto3 | |
from uuid import uuid4 | |
# Comprehend constant | |
REGION = 'us-west-2' | |
# Function for detecting the dominant language |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import boto3 | |
# Comprehend constant | |
REGION = 'us-west-2' | |
# Function for detecting sentiment | |
def detect_sentiment(text, language_code): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Comment": "A Hello World example of the Amazon States Language using Pass states", | |
"StartAt": "DetectLanguageJob", | |
"States": { | |
"DetectLanguageJob": { | |
"Type": "Task", | |
"Resource": "arn:aws:states:::lambda:invoke", | |
"Parameters": { | |
"FunctionName": "arn:aws:lambda:ap-northeast-1:012345678901:function:InvokeDetectLanguageFunctionName:$LATEST", | |
"Payload": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# wrong answer... | |
import string | |
# 1千兆 + 1 | |
N = int(input()) | |
n_digits = len(str(1000000000000001)) | |
letters = string.ascii_lowercase | |
x = N - 1 | |
ans = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider: | |
name: aws | |
runtime: python3.8 | |
profile: ${opt:profile, default} | |
stage: ${opt:stage, dev} | |
region: ${opt:region, us-east-1} | |
timeout: 30 | |
environment: | |
# To tell lambda function to AWS AccountId by use pseudo-parameters plugin. | |
# AccountId is used to construct SQS Queue URL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Declare all environment variables defined in .env.<stage-name> and serverless.yml as python variables. | |
If you would like to use environment variables in your code, you import this module then reference as constants of python variable. | |
By use this technique, you are able to use IDE auto-completion effectively when you writing python code. | |
It is useful to reduce miss-typing of environment variables. | |
""" | |
import os | |
import pathlib | |
import json | |
import dotenv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# WA | |
H, W, K = map(int, input().split()) | |
C = [] | |
for _ in range(H): | |
C.append(input()) | |
from pprint import pprint | |
# pprint(C) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pprint import pprint | |
# pprint(C) | |
import sys | |
from collections import Counter | |
from itertools import product, combinations | |
H, W, K = map(int, input().split()) | |
C = [] | |
for _ in range(H): |