This file contains hidden or 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
| # behavior/store.py | |
| class TaskStoreInMemory(TaskStore): | |
| def __init__(self): | |
| self._tasks = [] | |
| def add_task(self, task: Task) -> None: | |
| self._tasks.append(task) | |
| def list_tasks(self) -> list[Task]: |
This file contains hidden or 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
| # behavior/models.py | |
| from dataclasses import dataclass | |
| from enum import Enum | |
| class TaskStatus(str, Enum): | |
| OPEN = "OPEN" | |
| CLOSED = "CLOSED" | |
This file contains hidden or 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
| # implementation_details/models.py | |
| from dataclasses import dataclass | |
| from enum import Enum | |
| class TaskStatus(str, Enum): | |
| OPEN = "OPEN" | |
| CLOSED = "CLOSED" | |
This file contains hidden or 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
| class Stick: | |
| def __init__(self, color, length, weight): | |
| self.color = color | |
| self.length = length | |
| self.weight = weight | |
| stick = Stick('yellow', 1, 0.324) | |
This file contains hidden or 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
| def my_function(): | |
| print('Hi') | |
| print(my_function) | |
| # <function my_function at 0x7efea5c36050> | |
| def send_email_ses(email_message): | |
| print(f'Send email using AWS SES: {email_message}') |
This file contains hidden or 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 datetime | |
| class User: | |
| def __init__(self, username, banned_until): | |
| self.username = username | |
| self.banned_until = banned_until | |
| def save(self): | |
| print('I am saving to PostgreSQL') |
This file contains hidden or 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
| with open('example.txt') as file: | |
| lines = file.readlines() | |
| for line in lines: | |
| if line.lower().startswith('t'): | |
| print(line) |
This file contains hidden or 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
| service: my-service | |
| provider: | |
| name: aws | |
| region: ${opt:region, 'eu-west-1'} | |
| stage: ${opt:stage, 'development'} | |
| plugins: | |
| - serverless-s3-sync |
This file contains hidden or 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 datetime | |
| from fastapi import FastAPI | |
| from pydantic.main import BaseModel | |
| app = FastAPI() | |
| class CreateTodo(BaseModel): | |
| name: str |
This file contains hidden or 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
| <script> | |
| import Auth from '@aws-amplify/auth'; | |
| import { onMount } from 'svelte'; | |
| import axios from 'axios'; | |
| Auth.configure( | |
| { | |
| Auth: { | |
| region: 'region', | |
| userPoolId: 'pool_id', | |
| userPoolWebClientId: 'client_id' |