Here's a summary of common Python time conversions
Some methods drop fractions of seconds, and are marked with (s).
| # Starting with Django 4.1+ we need to pick which template loaders to use | |
| # based on our environment since 4.1+ will cache templates by default. | |
| default_loaders = [ | |
| "django.template.loaders.filesystem.Loader", | |
| "django.template.loaders.app_directories.Loader", | |
| ] | |
| cached_loaders = [("django.template.loaders.cached.Loader", default_loaders)] | 
| "workbench.colorCustomizations": { | |
| // Contrast Colors - The contrast colors are typically only set for high contrast themes. If set, they add an additional border around items across the UI to increase the contrast. | |
| "contrastActiveBorder": "", | |
| "contrastBorder": "", | |
| // Base Colors | |
| "focusBorder": "", | |
| "foreground": "", | |
| "widget.shadow": "", | |
| "selection.background": "", | |
| "descriptionForeground": "", | 
| import asyncio | |
| from confluent_kafka import Consumer, Producer | |
| from confluent_kafka.admin import AdminClient, NewTopic | |
| BROKER_URL = "PLAINTEXT://localhost:9092" | |
| TOPIC_NAME = "my-first-python-topic" | 
| from confluent_kafka import Consumer, Producer, KafkaError, KafkaException | |
| class Kafka: | |
| def __init__(self, bootstrap_server, topic, timeout=1.0): | |
| self.__bootstrap_server = bootstrap_server | |
| self.__topic = topic | |
| self.__timeout = timeout | |
| @staticmethod | 
Here's a summary of common Python time conversions
Some methods drop fractions of seconds, and are marked with (s).
| """ | |
| This script will: | |
| - open a Firefox browser | |
| - navigate to the form page | |
| - fill out the form and submit it | |
| - navigate to the results page | |
| - scrape the data from the page and close the browser | |
| """ | |
| import json | 
Before we look at some common commands, I just want to note a few keyboard commands that are very helpful:
Up Arrow: Will show your last commandDown Arrow: Will show your next commandTab: Will auto-complete your commandCtrl + L: Will clear the screen| import asyncio | |
| from typing import Optional, Type, Union | |
| from aio_pika import Message, RobustConnection, connect_robust | |
| from aio_pika.connection import ConnectionType | |
| from aio_pika.exchange import ExchangeType | |
| from aio_pika.types import TimeoutType | |
| from aiormq.types import ConfirmationFrameType | |
| import asyncio | |
| from typing import Type | |
| from aio_pika import RobustConnection, connect_robust | |
| from aio_pika.connection import ConnectionType | |
| from aio_pika.types import TimeoutType | |
| class RabbitMQClient: | |
| def __init__( | 
| """ | |
| Script to export the ReDoc documentation page into a standalone HTML file. | |
| Created by https://github.com/pawamoy on https://github.com/Redocly/redoc/issues/726#issuecomment-645414239 | |
| """ | |
| import json | |
| from my_app.app import app | |
| HTML_TEMPLATE = """<!DOCTYPE html> |