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 functools import lru_cache | |
from typing import Any, List | |
import pandas as pd | |
def lev_dist(a: str, b: str) -> float: | |
""" | |
Calculate the Levenshtein distance between two input strings. | |
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 typing import Callable, List | |
def control_point_decorator(control_points: List['BaseControl']) -> Callable: | |
""" | |
Decorator function to apply control point checks before executing a function. | |
Args: | |
control_points (List[BaseControl]): A list of control point objects which will be used to check the data | |
before passing it to the decorated function. |
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 pprint | |
from typing import Any, Dict, Iterable, List, Optional, Union | |
import re | |
import mimetypes | |
import pathlib | |
from tika import parser | |
import requests | |
import nltk | |
import inflect |
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 functools import wraps | |
from typing import Any, List, Dict, Union, Callable, Type, Optional, get_type_hints | |
from dataclasses import dataclass | |
import inspect | |
import re | |
import json | |
import attr | |
# Global dictionary to store function and class details grouped by namespace | |
DETAILS: Dict[str, List[Dict[str, Any]]] = {} |
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
curl -X POST \ | |
http://127.0.0.1:5000/api/cars \ | |
-H 'cache-control: no-cache' \ | |
-H 'content-type: application/json' \ | |
-H 'postman-token: e4839424-9e84-ff89-51fe-6202bf7f0c65' \ | |
-d '{ | |
"id": 1, | |
"make":"renault", | |
"model":"cleo" | |
}' |
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 typing import Any, List, Tuple, Dict, Optional | |
import subprocess | |
import sys | |
from determine_bump import determine_highest_bump | |
def bump_version( | |
schema_pairs: List[Tuple[Optional[Dict[Any, Any]], Optional[Dict[Any, Any]]]] | |
) -> None: |
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 typing import Any, get_args, get_origin, Type, Dict, Optional, List | |
import random | |
from datetime import date, datetime | |
import attr | |
from faker import Faker | |
def data_factory( | |
cls: Type, |
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 sys | |
import socket | |
import argparse | |
from datetime import datetime | |
from typing import Any, List, Set | |
import asyncio | |
import pyfiglet | |
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 os | |
import re | |
import sys | |
import argparse | |
from datetime import datetime | |
from concurrent.futures import as_completed | |
# from concurrent.futures.thread import ThreadPoolExecutor as PoolExecutor | |
from concurrent.futures.process import ProcessPoolExecutor as PoolExecutor | |
from typing import List |
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 typing import List, Dict, Tuple, Set, Optional, Union, Any, Type | |
import json | |
import attr | |
import jsonschema | |
class ClassCreator: | |
"""A class to create and manage custom classes from JSON definitions.""" |
NewerOlder