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
from .. import some_module | |
# or | |
from foo.bar import some_module | |
# another example | |
from foo.bar.some_module import * | |
# or | |
from foo.bar.some_module import specific_variable |
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
if (is_valid(a) && b == 0 || s == 1) | |
# or | |
if is_valid(a) and not b or s |
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
from flask import Flask | |
from dotenv import load_dotenv | |
from config import settings | |
load_dotenv() # take environment variables from .env. | |
app = Flask(__name__) |
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 os | |
from typing import Union | |
from pydantic import BaseSettings, Field | |
class Base(BaseSettings): | |
secret_key: str = Field('random_string', env='ANOTHER_SECRET_KEY') | |
port: int = 5050 | |
username: str = "ANAND" |
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
from flask import Flask | |
app = Flask(__name__) | |
@app.get('/hello') | |
def hello(): | |
return 'Hello' | |
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
version: "3" | |
services: | |
jenkins: | |
image: jenkins/jenkins:lts | |
container_name: jenkins | |
hostname: jenkins | |
environment: | |
- HTTP_PROXY=http://localhost:8080 | |
- http_proxy=http://localhost:8080 |
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
version: "3" | |
services: | |
sonarqube: | |
image: sonarqube:8.5.1-community | |
container_name: sonarqube | |
hostname: sonarqube | |
ports: | |
- 9000:9000 | |
environment: |
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 asyncio | |
import time | |
from random import randint | |
import httpx | |
from flask import Flask | |
app = Flask(__name__) | |
# function converted to coroutine |
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 time | |
from random import randint | |
import requests as requests | |
from flask import Flask | |
app = Flask(__name__) | |
def get_xkcd_image(): |
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 time | |
from random import randint | |
import requests as requests | |
from flask import Flask | |
app = Flask(__name__) | |
def get_xkcd_image(): |