edited_code stringlengths 17 978k | original_code stringlengths 17 978k |
|---|---|
from __future__ import unicode_literals
import os
import asyncio
import subprocess
import youtube_dl
from Python_ARQ import ARQ
from pytgcalls import GroupCall
from sys import version as pyver
from pyrogram import Client, filters
from misc import HELP_TEXT, START_TEXT, REPO_TEXT
from functions import (
t... | from __future__ import unicode_literals
import os
import asyncio
import subprocess
import youtube_dl
from Python_ARQ import ARQ
from pytgcalls import GroupCall
from sys import version as pyver
from pyrogram import Client, filters
from misc import HELP_TEXT, START_TEXT, REPO_TEXT
from functions import (
t... |
"""
SPDX-License-Identifier: MIT
Copyright (c) 2021, SCANOSS
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, c... | """
SPDX-License-Identifier: MIT
Copyright (c) 2021, SCANOSS
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, c... |
#!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Copyright (c) DeFi Blockchain Developers
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
"""Test Futures contract RPC."""
from test_framework.test_fram... | #!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Copyright (c) DeFi Blockchain Developers
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
"""Test Futures contract RPC."""
from test_framework.test_fram... |
""" manage PyTables query interface via Expressions """
from __future__ import annotations
import ast
from functools import partial
from typing import Any
import numpy as np
from pandas._libs.tslibs import (
Timedelta,
Timestamp,
)
from pandas.compat.chainmap import DeepChainMap
from pandas.core.dtypes.comm... | """ manage PyTables query interface via Expressions """
from __future__ import annotations
import ast
from functools import partial
from typing import Any
import numpy as np
from pandas._libs.tslibs import (
Timedelta,
Timestamp,
)
from pandas.compat.chainmap import DeepChainMap
from pandas.core.dtypes.comm... |
"""
The typing module: Support for gradual typing as defined by PEP 484.
At large scale, the structure of the module is following:
* Imports and exports, all public names should be explicitly added to __all__.
* Internal helper functions: these should never be used in code outside this module.
* _SpecialForm and its i... | """
The typing module: Support for gradual typing as defined by PEP 484.
At large scale, the structure of the module is following:
* Imports and exports, all public names should be explicitly added to __all__.
* Internal helper functions: these should never be used in code outside this module.
* _SpecialForm and its i... |
# coding=utf-8
# Copyright 2021 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | # coding=utf-8
# Copyright 2021 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... |
import random
import string
from typing import Callable, List, Optional
import discord
from redbot.core import Config
from redbot.core.commands import Context
from redbot.core.bot import Red
from redbot.core.utils.menus import start_adding_reactions
from redbot.core.utils.predicates import MessagePredicate, ReactionPr... | import random
import string
from typing import Callable, List, Optional
import discord
from redbot.core import Config
from redbot.core.commands import Context
from redbot.core.bot import Red
from redbot.core.utils.menus import start_adding_reactions
from redbot.core.utils.predicates import MessagePredicate, ReactionPr... |
# -*- coding: utf-8 -*-
"""
------------------------------------
@Project : uiTest
@Time : 2021/3/9 14:17
@Auth : wrc
@Email : wrcyyy@126.com
@File : base.py
@IDE : PyCharm
------------------------------------
"""
import logging
import os
from selenium.webdriver.support.wait import WebDriverWait
from se... | # -*- coding: utf-8 -*-
"""
------------------------------------
@Project : uiTest
@Time : 2021/3/9 14:17
@Auth : wrc
@Email : wrcyyy@126.com
@File : base.py
@IDE : PyCharm
------------------------------------
"""
import logging
import os
from selenium.webdriver.support.wait import WebDriverWait
from se... |
# -*- coding: utf-8 -*-
'''
Author: TJUZQC
Date: 2020-10-26 10:26:51
LastEditors: TJUZQC
LastEditTime: 2020-11-20 19:23:55
Description: None
'''
import argparse
import logging
import os
import sys
import numpy as np
import torch
import torch.nn as nn
import yaml
from torch import optim
from torch.utils.data import Dat... | # -*- coding: utf-8 -*-
'''
Author: TJUZQC
Date: 2020-10-26 10:26:51
LastEditors: TJUZQC
LastEditTime: 2020-11-20 19:23:55
Description: None
'''
import argparse
import logging
import os
import sys
import numpy as np
import torch
import torch.nn as nn
import yaml
from torch import optim
from torch.utils.data import Dat... |
import json
import logging
from typing import Any, Callable, List
import paho.mqtt.client as mqtt
from paho.mqtt.client import MQTTMessage, SubscribeOptions
from paho.mqtt.properties import Properties
from paho.mqtt.reasoncodes import PacketTypes, ReasonCodes
class MqttClient:
def __init__(
self,
... | import json
import logging
from typing import Any, Callable, List
import paho.mqtt.client as mqtt
from paho.mqtt.client import MQTTMessage, SubscribeOptions
from paho.mqtt.properties import Properties
from paho.mqtt.reasoncodes import PacketTypes, ReasonCodes
class MqttClient:
def __init__(
self,
... |
# Copyright (C) databricks-cicd 2021 man40 (man40dev@gmail.com)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | # Copyright (C) databricks-cicd 2021 man40 (man40dev@gmail.com)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... |
import json
import time
from typing import Callable, Optional, List, Any, Dict
import aiohttp
from blspy import AugSchemeMPL, G2Element, PrivateKey
import chia.server.ws_connection as ws
from chia.consensus.pot_iterations import calculate_iterations_quality, calculate_sp_interval_iters
from chia.farmer.farmer import ... | import json
import time
from typing import Callable, Optional, List, Any, Dict
import aiohttp
from blspy import AugSchemeMPL, G2Element, PrivateKey
import chia.server.ws_connection as ws
from chia.consensus.pot_iterations import calculate_iterations_quality, calculate_sp_interval_iters
from chia.farmer.farmer import ... |
#!/usr/bin/env python3
"""
@author T. Paysan-Lafosse
@brief This script searches unintegrated proteins for a given organism or taxid
in InterPro signatures, if they are not found in signatures, they are clustered based on UniRef clusters
@arguments [-u USER]: database user
[-p PASSWORD]: database... | #!/usr/bin/env python3
"""
@author T. Paysan-Lafosse
@brief This script searches unintegrated proteins for a given organism or taxid
in InterPro signatures, if they are not found in signatures, they are clustered based on UniRef clusters
@arguments [-u USER]: database user
[-p PASSWORD]: database... |
import json
import inspect
import requests
import os
import boto3
from urllib import parse
ASYNC = 'async'
token = None
slash_handlers = []
event_handlers = []
def slash(command, conditional=lambda text: True):
def fn(f):
slash_handlers.append([conditional, command, f, None])
return f
return f... | import json
import inspect
import requests
import os
import boto3
from urllib import parse
ASYNC = 'async'
token = None
slash_handlers = []
event_handlers = []
def slash(command, conditional=lambda text: True):
def fn(f):
slash_handlers.append([conditional, command, f, None])
return f
return f... |
from Utilities import MENU, resources
from art import logo
print(logo)
shop_open_and_ingredients_available = True
pay = 0
Water = resources["water"]
Milk = resources["milk"]
Coffee = resources["coffee"]
espresso_water = MENU["espresso"]["ingredients"]["water"]
espresso_coffee = MENU["espresso"]["ingredie... | from Utilities import MENU, resources
from art import logo
print(logo)
shop_open_and_ingredients_available = True
pay = 0
Water = resources["water"]
Milk = resources["milk"]
Coffee = resources["coffee"]
espresso_water = MENU["espresso"]["ingredients"]["water"]
espresso_coffee = MENU["espresso"]["ingredie... |
import sys
import selectors
import json
import io
import struct
request_search = {
"morpheus": "Follow the white rabbit. \U0001f430",
"ring": "In the caves beneath the Misty Mountains. \U0001f48d",
"\U0001f436": "\U0001f43e Playing ball! \U0001f3d0",
}
class Message:
def __init__(self, selector, sock... | import sys
import selectors
import json
import io
import struct
request_search = {
"morpheus": "Follow the white rabbit. \U0001f430",
"ring": "In the caves beneath the Misty Mountains. \U0001f48d",
"\U0001f436": "\U0001f43e Playing ball! \U0001f3d0",
}
class Message:
def __init__(self, selector, sock... |
""" Entry point for evaluating/rendering a trained policy. """
import argparse
import json
import os
import numpy as np
import time
import datetime
from rltime.general.config import load_config
from rltime.general.utils import deep_dictionary_update
from rltime.general.type_registry import get_registered_type
from rl... | """ Entry point for evaluating/rendering a trained policy. """
import argparse
import json
import os
import numpy as np
import time
import datetime
from rltime.general.config import load_config
from rltime.general.utils import deep_dictionary_update
from rltime.general.type_registry import get_registered_type
from rl... |
import os
import logging
import asyncio
import sqlite3
import platform
from binascii import hexlify
from collections import defaultdict
from dataclasses import dataclass
from contextvars import ContextVar
from typing import Tuple, List, Union, Callable, Any, Awaitable, Iterable, Dict, Optional
from datetime import date... | import os
import logging
import asyncio
import sqlite3
import platform
from binascii import hexlify
from collections import defaultdict
from dataclasses import dataclass
from contextvars import ContextVar
from typing import Tuple, List, Union, Callable, Any, Awaitable, Iterable, Dict, Optional
from datetime import date... |
"""
Provides logging utilities.
"""
import argparse
import difflib
import os
from dataclasses import dataclass
import sys
from types import TracebackType
from typing import Any, Optional, Type, cast
import fora
@dataclass
class State:
"""Global state for logging."""
indentation_level: int = 0
"""The cur... | """
Provides logging utilities.
"""
import argparse
import difflib
import os
from dataclasses import dataclass
import sys
from types import TracebackType
from typing import Any, Optional, Type, cast
import fora
@dataclass
class State:
"""Global state for logging."""
indentation_level: int = 0
"""The cur... |
# Aula 19 Dicionarios. É assim que tratamos os dicionarios
pessoas = {'nome': 'Gustavo', 'sexo': 'M', 'idade': 22}
print(pessoas['nome'])
print(pessoas['idade'])
print(pessoas['sexo'])
print(f'{pessoas['nome']} tem {pessoas['idade']} anos') # Utilizar aspas duplas para a localização [" "]
print(pessoas.keys()) ... | # Aula 19 Dicionarios. É assim que tratamos os dicionarios
pessoas = {'nome': 'Gustavo', 'sexo': 'M', 'idade': 22}
print(pessoas['nome'])
print(pessoas['idade'])
print(pessoas['sexo'])
print(f'{pessoas["nome"]} tem {pessoas["idade"]} anos') # Utilizar aspas duplas para a localização [" "]
print(pessoas.keys()) ... |
# flake8: noqa
import csv
def model_name(table_name):
if table_name in ["vtm", "vpi", "vmp", "vmpp", "amp", "ampp", "gtin"]:
return table_name.upper()
else:
return "".join(tok.title() for tok in table_name.split("_"))
def quote(s):
assert '"' not in s
return '"' + s + '"'
with open... | # flake8: noqa
import csv
def model_name(table_name):
if table_name in ["vtm", "vpi", "vmp", "vmpp", "amp", "ampp", "gtin"]:
return table_name.upper()
else:
return "".join(tok.title() for tok in table_name.split("_"))
def quote(s):
assert '"' not in s
return '"' + s + '"'
with open... |
import os
from nonebot.adapters.cqhttp import MessageSegment, Message
import nonebot
import random
from .update_game_info import update_info
from .util import generate_img, init_star_rst, BaseData, set_list, get_star, init_up_char
from .config import GENSHIN_FIVE_P, GENSHIN_FOUR_P, GENSHIN_G_FIVE_P, GENSHIN_G_FOU... | import os
from nonebot.adapters.cqhttp import MessageSegment, Message
import nonebot
import random
from .update_game_info import update_info
from .util import generate_img, init_star_rst, BaseData, set_list, get_star, init_up_char
from .config import GENSHIN_FIVE_P, GENSHIN_FOUR_P, GENSHIN_G_FIVE_P, GENSHIN_G_FOU... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
"""RAMSES RF - Protocol/Transport layer.
Helper functions.
"""
import ctypes
import sys
import time
from datetime import datetime as dt
from typing import Optional, Union
from .const import DEVICE_TYPES, NON_DEVICE_ID, NUL_DEVICE_ID
class FILETIME(ctypes.Structure):... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
"""RAMSES RF - Protocol/Transport layer.
Helper functions.
"""
import ctypes
import sys
import time
from datetime import datetime as dt
from typing import Optional, Union
from .const import DEVICE_TYPES, NON_DEVICE_ID, NUL_DEVICE_ID
class FILETIME(ctypes.Structure):... |
# %%
import gc
import itertools
import math
import typing as ty
from copy import deepcopy
from pathlib import Path
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim.swa_utils as swa_utils
import zero
from torch import Tensor
import wandb
import lib
import lib.nod... | # %%
import gc
import itertools
import math
import typing as ty
from copy import deepcopy
from pathlib import Path
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim.swa_utils as swa_utils
import zero
from torch import Tensor
import wandb
import lib
import lib.nod... |
import argparse
import torch
import os
from transformers import AutoTokenizer, AutoModelForMaskedLM
from utils import load_data, write_to_file
from metric import compute_metrics
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--model_name_or_path", default="model/chinese_be... | import argparse
import torch
import os
from transformers import AutoTokenizer, AutoModelForMaskedLM
from utils import load_data, write_to_file
from metric import compute_metrics
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--model_name_or_path", default="model/chinese_be... |
from datetime import datetime
import os
from bson.objectid import ObjectId
from girder import logger
from girder.models.folder import Folder
from girder.models.item import Item
from girder.models.setting import Setting
from girder.models.user import User
from girder.settings import SettingKey
from girder.utility.mail_... | from datetime import datetime
import os
from bson.objectid import ObjectId
from girder import logger
from girder.models.folder import Folder
from girder.models.item import Item
from girder.models.setting import Setting
from girder.models.user import User
from girder.settings import SettingKey
from girder.utility.mail_... |
import os
from pathlib import Path, PurePosixPath
from typing import Any, Dict, Iterable, Optional, Union
from ..client import Client, register_client_class
from ..cloudpath import implementation_registry
from .s3path import S3Path
try:
from boto3.session import Session
from boto3.s3.transfer import Transfer... | import os
from pathlib import Path, PurePosixPath
from typing import Any, Dict, Iterable, Optional, Union
from ..client import Client, register_client_class
from ..cloudpath import implementation_registry
from .s3path import S3Path
try:
from boto3.session import Session
from boto3.s3.transfer import Transfer... |
import json
import re
import requests
from django.conf import settings
from cathie.exceptions import CatsAnswerCodeException
from cathie import authorization
def cats_check_status():
pass
@authorization.check_authorization_for_cats
def cats_submit_solution(source_text: str, problem_id: int, de_id: int, source... | import json
import re
import requests
from django.conf import settings
from cathie.exceptions import CatsAnswerCodeException
from cathie import authorization
def cats_check_status():
pass
@authorization.check_authorization_for_cats
def cats_submit_solution(source_text: str, problem_id: int, de_id: int, source... |
import validators
import requests
import base64
from app import app
def intelixlookup(ioc):
#Get a token
token = get_token()
# use Validators to redirect the IOC to the correct Intelix endpoint
if validators.ipv4(ioc):
u = f"https://de.api.labs.sophos.com/lookup/ips/v1/{ioc}"
elif validator... | import validators
import requests
import base64
from app import app
def intelixlookup(ioc):
#Get a token
token = get_token()
# use Validators to redirect the IOC to the correct Intelix endpoint
if validators.ipv4(ioc):
u = f"https://de.api.labs.sophos.com/lookup/ips/v1/{ioc}"
elif validator... |
import requests
from flask import current_app
from notifications_utils.statsd_decorators import statsd
from app import notify_celery
from app.dao.broadcast_message_dao import dao_get_broadcast_event_by_id
@notify_celery.task(name="send-broadcast-event")
@statsd(namespace="tasks")
def send_broadcast_event(broadcast_... | import requests
from flask import current_app
from notifications_utils.statsd_decorators import statsd
from app import notify_celery
from app.dao.broadcast_message_dao import dao_get_broadcast_event_by_id
@notify_celery.task(name="send-broadcast-event")
@statsd(namespace="tasks")
def send_broadcast_event(broadcast_... |
import pytest
import os
import logging
logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
from pathlib import Path
from dselib.context import DSEContext
from dselib.ntpx import NTPX
def context(varfile=None):
"""returns the DSE context object for this script."""
try:
... | import pytest
import os
import logging
logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
from pathlib import Path
from dselib.context import DSEContext
from dselib.ntpx import NTPX
def context(varfile=None):
"""returns the DSE context object for this script."""
try:
... |
import json
import os
import re
import sys
import time
import unittest
import click
import vmraid
import requests
from .test_runner import (SLOW_TEST_THRESHOLD, make_test_records, set_test_email_config)
click_ctx = click.get_current_context(True)
if click_ctx:
click_ctx.color = True
class ParallelTestRunner():
def... | import json
import os
import re
import sys
import time
import unittest
import click
import vmraid
import requests
from .test_runner import (SLOW_TEST_THRESHOLD, make_test_records, set_test_email_config)
click_ctx = click.get_current_context(True)
if click_ctx:
click_ctx.color = True
class ParallelTestRunner():
def... |
import rlp
from typing import (
Iterable,
Optional,
Tuple,
)
from eth_utils.toolz import (
curry,
)
from eth_utils import (
to_tuple,
ValidationError,
)
from eth.rlp.blocks import (
BaseBlock,
)
@to_tuple
def diff_rlp_object(left: BaseBlock,
right: BaseBlock) -> Opti... | import rlp
from typing import (
Iterable,
Optional,
Tuple,
)
from eth_utils.toolz import (
curry,
)
from eth_utils import (
to_tuple,
ValidationError,
)
from eth.rlp.blocks import (
BaseBlock,
)
@to_tuple
def diff_rlp_object(left: BaseBlock,
right: BaseBlock) -> Opti... |
from dataTool import ReadLabels, ReadXYZ, VisualizePointCloudClassesAsync, modelPath, DataTool
from imports import *
import math
import numpy as np
from time import time
import tensorflow as tf
from tensorflow.keras.models import Model
from tensorflow.keras.utils import Sequence
from tensorflow.keras.layers impor... | from dataTool import ReadLabels, ReadXYZ, VisualizePointCloudClassesAsync, modelPath, DataTool
from imports import *
import math
import numpy as np
from time import time
import tensorflow as tf
from tensorflow.keras.models import Model
from tensorflow.keras.utils import Sequence
from tensorflow.keras.layers impor... |
#!python3
import sys
# Used to generate output that my gnuplot will accept
lines = iter(sys.stdin)
next(lines)
lines = map(lambda s: s.split(), lines)
#0 Graph_name vertices edges g_phi h_phi timed_out
#6 spent_time allowed_time read_as_multi CASE best_cut_conductance
#11 best_cut_expansion edges_crossing size1 si... | #!python3
import sys
# Used to generate output that my gnuplot will accept
lines = iter(sys.stdin)
next(lines)
lines = map(lambda s: s.split(), lines)
#0 Graph_name vertices edges g_phi h_phi timed_out
#6 spent_time allowed_time read_as_multi CASE best_cut_conductance
#11 best_cut_expansion edges_crossing size1 si... |
#!/usr/bin/python
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | #!/usr/bin/python
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
"""
Functions to help with calculating batch properties for experiments objects.
"""
from __future__ import annotations
import logging
from dials.array_family import flex
logger = logging.getLogger("dials")
class batch_manager:
def __init__(self, batches, batch_params):
# batch params is a list of dic... | """
Functions to help with calculating batch properties for experiments objects.
"""
from __future__ import annotations
import logging
from dials.array_family import flex
logger = logging.getLogger("dials")
class batch_manager:
def __init__(self, batches, batch_params):
# batch params is a list of dic... |
import time
import e2e.clickhouse as clickhouse
import e2e.kubectl as kubectl
import e2e.yaml_manifest as yaml_manifest
import e2e.settings as settings
import e2e.util as util
from testflows.core import *
from testflows.asserts import error
@TestScenario
@Name("test_ch_001. Insert quorum")
def test_ch_001(self):
... | import time
import e2e.clickhouse as clickhouse
import e2e.kubectl as kubectl
import e2e.yaml_manifest as yaml_manifest
import e2e.settings as settings
import e2e.util as util
from testflows.core import *
from testflows.asserts import error
@TestScenario
@Name("test_ch_001. Insert quorum")
def test_ch_001(self):
... |
#! /usr/bin/env python3
import argparse
from pathlib import Path
import subprocess
import sys
import scripts.templates
from scripts.templates import P2020, MPC5777M, CORES, TOP_DIR, PSY_DIR, STUBS_DIR, SRC_DIR, CFG_DIR, Help, AGENT_CONFIG_HJSON_TEMPLATE, CORUNNER_CONFIG_HJSON_TEMPLATE, CORUNNER_KMEMORY_JSON_TEMPLATE, ... | #! /usr/bin/env python3
import argparse
from pathlib import Path
import subprocess
import sys
import scripts.templates
from scripts.templates import P2020, MPC5777M, CORES, TOP_DIR, PSY_DIR, STUBS_DIR, SRC_DIR, CFG_DIR, Help, AGENT_CONFIG_HJSON_TEMPLATE, CORUNNER_CONFIG_HJSON_TEMPLATE, CORUNNER_KMEMORY_JSON_TEMPLATE, ... |
import logging
import time
from relation_engine_bulk_update.loader import RELoader
WS_OBJ_DELIMITER = ":"
def _timestamp_to_epoch(timestamp):
return int(time.mktime(time.strptime(timestamp, "%Y-%m-%dT%H:%M:%S%z")))
def update_ws_object_collections(ws_client, re_api_url, token, params):
"""Update all works... | import logging
import time
from relation_engine_bulk_update.loader import RELoader
WS_OBJ_DELIMITER = ":"
def _timestamp_to_epoch(timestamp):
return int(time.mktime(time.strptime(timestamp, "%Y-%m-%dT%H:%M:%S%z")))
def update_ws_object_collections(ws_client, re_api_url, token, params):
"""Update all works... |
import os
import hashlib
import hmac
import time
import orjson
import requests
import extra_math
URL = "https://api.valr.com"
VERSION = "/v1"
previous_signatures = set()
# As copied from VALR API example
def gen_signature(api_key_secret, timestamp, verb, path, body=""):
"""
Signs the request payload using... | import os
import hashlib
import hmac
import time
import orjson
import requests
import extra_math
URL = "https://api.valr.com"
VERSION = "/v1"
previous_signatures = set()
# As copied from VALR API example
def gen_signature(api_key_secret, timestamp, verb, path, body=""):
"""
Signs the request payload using... |
import json
from urllib.request import urlopen
import atexit
import datetime
import dateutil
import sys
import tda
API_KEY = 'FON1HLNGRN0KOVR6UDTCF4RPEMPYIXOB@AMER.OAUTHAP'
REDIRECT_URI = 'http://localhost:8080/'
TOKEN_PATH = '../access_token'
def save_to_file(data):
"""
Save to file for testing
"""
with... | import json
from urllib.request import urlopen
import atexit
import datetime
import dateutil
import sys
import tda
API_KEY = 'FON1HLNGRN0KOVR6UDTCF4RPEMPYIXOB@AMER.OAUTHAP'
REDIRECT_URI = 'http://localhost:8080/'
TOKEN_PATH = '../access_token'
def save_to_file(data):
"""
Save to file for testing
"""
with... |
"""APPLY PYTHAGOREAN THEOREM IN LEARNING DATA + SMOOTH VELOCITIES"""
import os
import itertools
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import savgol_filter
from helper import img_id, sub_id, TRIALS_PATH
# Apply PT into smoothed learning data to find sample-to-sample d... | """APPLY PYTHAGOREAN THEOREM IN LEARNING DATA + SMOOTH VELOCITIES"""
import os
import itertools
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import savgol_filter
from helper import img_id, sub_id, TRIALS_PATH
# Apply PT into smoothed learning data to find sample-to-sample d... |
import os
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import ConvModule, build_conv_layer, build_upsample_layer
from mmcv.ops.carafe import CARAFEPack
from mmcv.runner import BaseModule, ModuleList, auto_fp16, force_fp32
from torch.nn.modules.utils import _pair
... | import os
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import ConvModule, build_conv_layer, build_upsample_layer
from mmcv.ops.carafe import CARAFEPack
from mmcv.runner import BaseModule, ModuleList, auto_fp16, force_fp32
from torch.nn.modules.utils import _pair
... |
# YOLOv5 common modules
import math
from copy import copy
from pathlib import Path
import numpy as np
import pandas as pd
import requests
import torch
import torch.nn as nn
from PIL import Image
from torch.cuda import amp
from utils.datasets import letterbox
from utils.general import non_max_suppression, make_divisi... | # YOLOv5 common modules
import math
from copy import copy
from pathlib import Path
import numpy as np
import pandas as pd
import requests
import torch
import torch.nn as nn
from PIL import Image
from torch.cuda import amp
from utils.datasets import letterbox
from utils.general import non_max_suppression, make_divisi... |
import os
import platform
import subprocess
import sys
from pathlib import Path
from core.management.commands.utils import Utils
from django.apps import apps
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = """Manager responsável por analisar as classes de modelos do projeto... | import os
import platform
import subprocess
import sys
from pathlib import Path
from core.management.commands.utils import Utils
from django.apps import apps
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = """Manager responsável por analisar as classes de modelos do projeto... |
import os.path
import typing
import subprocess
import base64
from django.conf import settings
from django.core.files.storage import default_storage
from django.http import HttpResponse
from django.urls.base import resolve
from django.views.decorators.csrf import csrf_exempt
from drf_yasg.openapi import Parameter
from d... | import os.path
import typing
import subprocess
import base64
from django.conf import settings
from django.core.files.storage import default_storage
from django.http import HttpResponse
from django.urls.base import resolve
from django.views.decorators.csrf import csrf_exempt
from drf_yasg.openapi import Parameter
from d... |
import argparse
import os
import time
from typing import List, Optional
import glob
from multiprocessing import Process
import numpy as np
from astropy.io import fits
from pkg_resources import resource_filename
from pypeit.pypeitsetup import PypeItSetup
from pypeit.core import framematch
from pypeit import pypeit
fr... | import argparse
import os
import time
from typing import List, Optional
import glob
from multiprocessing import Process
import numpy as np
from astropy.io import fits
from pkg_resources import resource_filename
from pypeit.pypeitsetup import PypeItSetup
from pypeit.core import framematch
from pypeit import pypeit
fr... |
# Importando funções.
from random import randint
from time import sleep
from operator import itemgetter
# Declarando os dicionários.
jogadores = dict()
colocacao = list()
# Colocando os jogadores e seus valores no dicionário, e mostrando eles na tela.
for r in range(1, 5):
jogadores[f'jogador{r}'] = randint(1, 6)... | # Importando funções.
from random import randint
from time import sleep
from operator import itemgetter
# Declarando os dicionários.
jogadores = dict()
colocacao = list()
# Colocando os jogadores e seus valores no dicionário, e mostrando eles na tela.
for r in range(1, 5):
jogadores[f'jogador{r}'] = randint(1, 6)... |
import asyncio
import json
import logging
import time
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, Tuple
import traceback
import aiohttp
from blspy import AugSchemeMPL, G1Element, G2Element, PrivateKey
import inan.server.ws_connection as ws # lgtm [py/import-and-import-from]
from ... | import asyncio
import json
import logging
import time
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, Tuple
import traceback
import aiohttp
from blspy import AugSchemeMPL, G1Element, G2Element, PrivateKey
import inan.server.ws_connection as ws # lgtm [py/import-and-import-from]
from ... |
"""Demonstrates how an application might use the barcode_wheel library"""
import sys
import barcode_wheel
import svgwrite
import pathlib
import logging
import tempfile
import csv
from time import sleep
demo_contents = (
"""
22001,Money Order (Principal),
22101,Money Order (Fee),
10502,Club Card Savings,
12345678901,T... | """Demonstrates how an application might use the barcode_wheel library"""
import sys
import barcode_wheel
import svgwrite
import pathlib
import logging
import tempfile
import csv
from time import sleep
demo_contents = (
"""
22001,Money Order (Principal),
22101,Money Order (Fee),
10502,Club Card Savings,
12345678901,T... |
import numpy as np
import time
import tempfile
import os
import importlib.util
import argparse
from typing import Sequence
import subprocess
import re
import oneflow as flow
import oneflow._oneflow_internal as oneflow_internal
DEFAULT_TIMES = 20
gpu_memory_used_by_oneflow = 0
def import_file(path):
spec = im... | import numpy as np
import time
import tempfile
import os
import importlib.util
import argparse
from typing import Sequence
import subprocess
import re
import oneflow as flow
import oneflow._oneflow_internal as oneflow_internal
DEFAULT_TIMES = 20
gpu_memory_used_by_oneflow = 0
def import_file(path):
spec = im... |
from abc import abstractmethod
import PIL
import pytorch_lightning as pl
import torch
import torch.nn as nn
import torchvision.transforms as transforms
from torch.hub import load_state_dict_from_url
from torchvision.models import DenseNet as _DenseNet
from torchvision.models import ResNet as _ResNet
from torchvision.m... | from abc import abstractmethod
import PIL
import pytorch_lightning as pl
import torch
import torch.nn as nn
import torchvision.transforms as transforms
from torch.hub import load_state_dict_from_url
from torchvision.models import DenseNet as _DenseNet
from torchvision.models import ResNet as _ResNet
from torchvision.m... |
from ciscosupportsdk.apisession import ApiSession
SERVICE_BASE_URL = "/software/v4.0"
class AutomatedSoftwareDistributionApi(object):
"""
Cisco Automated Software Distribution service provides software
information and download URLs to assist you in upgrading your
device/application to the latest vers... | from ciscosupportsdk.apisession import ApiSession
SERVICE_BASE_URL = "/software/v4.0"
class AutomatedSoftwareDistributionApi(object):
"""
Cisco Automated Software Distribution service provides software
information and download URLs to assist you in upgrading your
device/application to the latest vers... |
# Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
# Credits to Hitalo-Sama and FTG Modules
from datetime import datetime
from emoji import emojize
from math import sqrt... | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
# Credits to Hitalo-Sama and FTG Modules
from datetime import datetime
from emoji import emojize
from math import sqrt... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import gzip
import json
import re
import logging
import sys
import datetime as dt
import os
from operator import itemgetter
from statistics import median, mean
import argparse
from time import time, sleep
from itertools import groupby
from collections import namedtuple
from... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import gzip
import json
import re
import logging
import sys
import datetime as dt
import os
from operator import itemgetter
from statistics import median, mean
import argparse
from time import time, sleep
from itertools import groupby
from collections import namedtuple
from... |
'''
This Module is One to Make Your Code Shorter.
High API Will Make You Feel You're Ordering And Machine Is Doing!
Also There is Collection of most usefull function and methods from popular modules of python.
(Read Help of Functions)
Official Documention Will Be Added Soon.
'''
'''
Written By RX
Last Update: 1-15-2021... | '''
This Module is One to Make Your Code Shorter.
High API Will Make You Feel You're Ordering And Machine Is Doing!
Also There is Collection of most usefull function and methods from popular modules of python.
(Read Help of Functions)
Official Documention Will Be Added Soon.
'''
'''
Written By RX
Last Update: 1-15-2021... |
'''
Excited States software: qFit 3.0
Contributors: Saulo H. P. de Oliveira, Gydo van Zundert, and Henry van den Bedem.
Contact: vdbedem@stanford.edu
Copyright (C) 2009-2019 Stanford University
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation f... | '''
Excited States software: qFit 3.0
Contributors: Saulo H. P. de Oliveira, Gydo van Zundert, and Henry van den Bedem.
Contact: vdbedem@stanford.edu
Copyright (C) 2009-2019 Stanford University
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation f... |
import hashlib
import sys
import getpass
import argparse
import rx7 as rx
from LIB.Functions import pause, cls
from LIB.Hash import sa
def print_hashes(word, file=None, Print=True):
word=bytes(word, encoding='utf-8')
LIST = []
for name,func in sa.items():
try:
result = func(word).he... | import hashlib
import sys
import getpass
import argparse
import rx7 as rx
from LIB.Functions import pause, cls
from LIB.Hash import sa
def print_hashes(word, file=None, Print=True):
word=bytes(word, encoding='utf-8')
LIST = []
for name,func in sa.items():
try:
result = func(word).he... |
#!/usr/bin/env python
# Copyright (c) 2021, Farid Rashidi Mehrabadi All rights reserved.
# ======================================================================================
# Author : Farid Rashidi Mehrabadi (farid.rashidimehrabadi@nih.gov)
# Last Update: Aug 14, 2020
# Description: cleaning
# ==============... | #!/usr/bin/env python
# Copyright (c) 2021, Farid Rashidi Mehrabadi All rights reserved.
# ======================================================================================
# Author : Farid Rashidi Mehrabadi (farid.rashidimehrabadi@nih.gov)
# Last Update: Aug 14, 2020
# Description: cleaning
# ==============... |
"""Collection of admin utility functions"""
import os
import sys
import logging
from nvp.nvp_component import NVPComponent
from nvp.nvp_context import NVPContext
logger = logging.getLogger(__name__)
# Default .editorconfig content:
DEFAULT_EDITORCONFIG_CONTENT = """# Autogenerated .editorconfig file
# Update as need... | """Collection of admin utility functions"""
import os
import sys
import logging
from nvp.nvp_component import NVPComponent
from nvp.nvp_context import NVPContext
logger = logging.getLogger(__name__)
# Default .editorconfig content:
DEFAULT_EDITORCONFIG_CONTENT = """# Autogenerated .editorconfig file
# Update as need... |
import dataclasses
import enum
import inspect
import json
import struct
import sys
import typing
from abc import ABC
from base64 import b64decode, b64encode
from datetime import datetime, timedelta, timezone
from dateutil.parser import isoparse
from typing import (
Any,
Callable,
Dict,
Generator,
Li... | import dataclasses
import enum
import inspect
import json
import struct
import sys
import typing
from abc import ABC
from base64 import b64decode, b64encode
from datetime import datetime, timedelta, timezone
from dateutil.parser import isoparse
from typing import (
Any,
Callable,
Dict,
Generator,
Li... |
# Module for running CNN-BiLSTM vad model,
# may also be run directly as a script
# Author: Nick Wilkinson 2021
import argparse
import os
import numpy as np
import pandas as pd
import tensorflow as tf
from typing import Tuple
from tensorflow.keras import models
from voxseg import utils
from scipy.signal import medfilt
... | # Module for running CNN-BiLSTM vad model,
# may also be run directly as a script
# Author: Nick Wilkinson 2021
import argparse
import os
import numpy as np
import pandas as pd
import tensorflow as tf
from typing import Tuple
from tensorflow.keras import models
from voxseg import utils
from scipy.signal import medfilt
... |
# plot.py
# --------------- #
# Import Packages #
# --------------- #
import os
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# Set seaborn as default plot config
sns.set()
sns.set_style("whitegrid")
from itertools import cycle
# ---------------------------------- #
# Define Subdirectories... | # plot.py
# --------------- #
# Import Packages #
# --------------- #
import os
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# Set seaborn as default plot config
sns.set()
sns.set_style("whitegrid")
from itertools import cycle
# ---------------------------------- #
# Define Subdirectories... |
# -*- coding: utf-8 -*-
#
# VPP test framework documentation build configuration file, created by
# sphinx-quickstart on Thu Oct 13 08:45:03 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated ... | # -*- coding: utf-8 -*-
#
# VPP test framework documentation build configuration file, created by
# sphinx-quickstart on Thu Oct 13 08:45:03 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated ... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2021 The NiPreps Developers <nipreps@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2021 The NiPreps Developers <nipreps@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... |
"""
This module contains the code for the interactive conversion
of units at the command line.
@author: tgwoodcock
"""
from . import convmag_functions as cm
# interactive conversion
def main():
CONVERTING = True
print("*****Conversion between magnetic units.*****")
print("\nAt the 'Input:' promt, enter:... | """
This module contains the code for the interactive conversion
of units at the command line.
@author: tgwoodcock
"""
from . import convmag_functions as cm
# interactive conversion
def main():
CONVERTING = True
print("*****Conversion between magnetic units.*****")
print("\nAt the 'Input:' promt, enter:... |
import argparse
import os
import sys
import io
import time
import json
from bson.json_util import dumps
import traceback
import confluent_kafka
from ast import literal_eval
import avro.schema
import fastavro
import subprocess
import datetime
import multiprocessing
# import threading
import pymongo
import pytz
from nu... | import argparse
import os
import sys
import io
import time
import json
from bson.json_util import dumps
import traceback
import confluent_kafka
from ast import literal_eval
import avro.schema
import fastavro
import subprocess
import datetime
import multiprocessing
# import threading
import pymongo
import pytz
from nu... |
#! python3
# randomQuizGenerator.py - Creates quizzes with questions and answers in
# random order, along with the answer key.
from pathlib import Path
import random
# The quiz data. Keys are states and values are their capitals
capitals = {'Alabama': 'Montgomery', 'Alaska': 'Juneau', 'Arizona': 'Phoenix',
... | #! python3
# randomQuizGenerator.py - Creates quizzes with questions and answers in
# random order, along with the answer key.
from pathlib import Path
import random
# The quiz data. Keys are states and values are their capitals
capitals = {'Alabama': 'Montgomery', 'Alaska': 'Juneau', 'Arizona': 'Phoenix',
... |
#!/usr/bin/env python3
# Copyright (c) 2019-2020 The Widecoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the importdescriptors RPC.
Test importdescriptors by generating keys on node0, importing the cor... | #!/usr/bin/env python3
# Copyright (c) 2019-2020 The Widecoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the importdescriptors RPC.
Test importdescriptors by generating keys on node0, importing the cor... |
# coding=utf-8
# Copyright 2020-present the HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | # coding=utf-8
# Copyright 2020-present the HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... |
"""variants_process main command."""
import timeit
import re
from datetime import datetime
from os.path import join
import pandas as pd
import numpy as np
import pybedtools as pyb
START = timeit.default_timer()
## IMPORT VARIANTS FILE
def import_variants(path):
"""
Determine filetype and import, returns pand... | """variants_process main command."""
import timeit
import re
from datetime import datetime
from os.path import join
import pandas as pd
import numpy as np
import pybedtools as pyb
START = timeit.default_timer()
## IMPORT VARIANTS FILE
def import_variants(path):
"""
Determine filetype and import, returns pand... |
import os
import torch
import glob
import numpy as np
import scipy.sparse as sp
import yaml
from sklearn.preprocessing import StandardScaler
from shaDow.globals import git_rev, timestamp, Logger
from torch_scatter import scatter
from copy import deepcopy
from typing import List, Union
from shaDow import TRAIN, VALI... | import os
import torch
import glob
import numpy as np
import scipy.sparse as sp
import yaml
from sklearn.preprocessing import StandardScaler
from shaDow.globals import git_rev, timestamp, Logger
from torch_scatter import scatter
from copy import deepcopy
from typing import List, Union
from shaDow import TRAIN, VALI... |
#!/usr/bin/env python
# coding: utf-8
"""
tests
~~~~~
Provides the tests for opts.
:copyright: 2010 by Daniel Neuhäuser
:license: BSD, see LICENSE for details
"""
import unittest
import sys
from decimal import Decimal
from StringIO import StringIO
from opts import (Node, Option, BooleanOption, In... | #!/usr/bin/env python
# coding: utf-8
"""
tests
~~~~~
Provides the tests for opts.
:copyright: 2010 by Daniel Neuhäuser
:license: BSD, see LICENSE for details
"""
import unittest
import sys
from decimal import Decimal
from StringIO import StringIO
from opts import (Node, Option, BooleanOption, In... |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import ast
import glob
import re
def list_functions(source_glob):
"""
List all of the funct... | #!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import ast
import glob
import re
def list_functions(source_glob):
"""
List all of the funct... |
import argparse
from enum import Enum
from random import random
import re
import input
import debug
import math
import util
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from solve import Premise
def display_start() -> None:
p = argparse.ArgumentParser()
p.add_argument("--file", help="Parse from a fil... | import argparse
from enum import Enum
from random import random
import re
import input
import debug
import math
import util
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from solve import Premise
def display_start() -> None:
p = argparse.ArgumentParser()
p.add_argument("--file", help="Parse from a fil... |
from transformers import LongformerTokenizer, EncoderDecoderModel
from .base_single_doc_model import SingleDocSummModel
class LongformerModel(SingleDocSummModel):
# static variables
model_name = "Longformer"
is_extractive = False
is_neural = True
def __init__(self):
super(LongformerModel... | from transformers import LongformerTokenizer, EncoderDecoderModel
from .base_single_doc_model import SingleDocSummModel
class LongformerModel(SingleDocSummModel):
# static variables
model_name = "Longformer"
is_extractive = False
is_neural = True
def __init__(self):
super(LongformerModel... |
# -*- coding: utf-8 -*-
import asyncio
import aiofiles
import aiohttp
import orjson
from pathlib import Path
from cmyui import log, Ansi
from constants.gamemodes import GameMode
from constants.mods import Mods
__all__ = 'PPCalculator',
BEATMAPS_PATH = Path.cwd() / '.data/osu'
class PPCalculator:
"""Asynchronou... | # -*- coding: utf-8 -*-
import asyncio
import aiofiles
import aiohttp
import orjson
from pathlib import Path
from cmyui import log, Ansi
from constants.gamemodes import GameMode
from constants.mods import Mods
__all__ = 'PPCalculator',
BEATMAPS_PATH = Path.cwd() / '.data/osu'
class PPCalculator:
"""Asynchronou... |
# Copyright The IETF Trust 2007-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# old meeting models can be found in ../proceedings/models.py
import datetime
import io
import os
import pytz
import random
import re
import string
from collections import namedtuple
from pathlib import Path
from urllib.parse import u... | # Copyright The IETF Trust 2007-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# old meeting models can be found in ../proceedings/models.py
import datetime
import io
import os
import pytz
import random
import re
import string
from collections import namedtuple
from pathlib import Path
from urllib.parse import u... |
import functools
import time
import weakref
from enum import IntFlag
from itertools import count
from logging import LoggerAdapter, getLogger
from typing import ClassVar, FrozenSet
from .log import control_layer_logger
def select_version(cls, version):
"""Select closest compatible version to requested version
... | import functools
import time
import weakref
from enum import IntFlag
from itertools import count
from logging import LoggerAdapter, getLogger
from typing import ClassVar, FrozenSet
from .log import control_layer_logger
def select_version(cls, version):
"""Select closest compatible version to requested version
... |
import base64
import os
import random
import re
import shutil
import string
import subprocess
import sys
import traceback
from datetime import datetime, timedelta
from random import randint
from subprocess import PIPE
from time import sleep
import colorama
from colorama import Fore, Style, AnsiToWin32
import insomnia... | import base64
import os
import random
import re
import shutil
import string
import subprocess
import sys
import traceback
from datetime import datetime, timedelta
from random import randint
from subprocess import PIPE
from time import sleep
import colorama
from colorama import Fore, Style, AnsiToWin32
import insomnia... |
import datetime
import discord
import math
import random
from discord.ext import commands
from utils import crud
from utils.checks import is_staff
class Memes(commands.Cog):
"""
Meme commands
"""
def __init__(self, bot):
self.bot = bot
async def _meme(self, ctx, msg, directed: bool = Fal... | import datetime
import discord
import math
import random
from discord.ext import commands
from utils import crud
from utils.checks import is_staff
class Memes(commands.Cog):
"""
Meme commands
"""
def __init__(self, bot):
self.bot = bot
async def _meme(self, ctx, msg, directed: bool = Fal... |
import re
class BasicPreprocessing:
def __init__(self):
self.name = "basic"
def __call__(self, text: str):
return clean_text(text)
def clean_text(text):
text = text.lower()
text = replace_all(text, [
("n't ", " not "),
("'ve ", " have "),
("'ll ", " will "),
... | import re
class BasicPreprocessing:
def __init__(self):
self.name = "basic"
def __call__(self, text: str):
return clean_text(text)
def clean_text(text):
text = text.lower()
text = replace_all(text, [
("n't ", " not "),
("'ve ", " have "),
("'ll ", " will "),
... |
# /usr/bin/python
# -*- coding: utf-8 -*-
"""
MongoDB logger module
"""
import datetime
import logging
import os
import json
import inspect
import random
from typing import Optional
from pymongo import MongoClient
class MongoLogger:
"""
MongoDB logger class.\n
"""
LEVELS = {'crit': 50, 'err': 40, 'wa... | # /usr/bin/python
# -*- coding: utf-8 -*-
"""
MongoDB logger module
"""
import datetime
import logging
import os
import json
import inspect
import random
from typing import Optional
from pymongo import MongoClient
class MongoLogger:
"""
MongoDB logger class.\n
"""
LEVELS = {'crit': 50, 'err': 40, 'wa... |
import tkinter as tk
import subprocess
import json
import os
import re
class PingAnalysis:
def __init__(self):
self.settings_file = open("settings.json", "r")
self.settings_json = json.load(self.settings_file)
self.settings_file.close()
self.FONT_SMALL = (f"{self.settings_json["FO... | import tkinter as tk
import subprocess
import json
import os
import re
class PingAnalysis:
def __init__(self):
self.settings_file = open("settings.json", "r")
self.settings_json = json.load(self.settings_file)
self.settings_file.close()
self.FONT_SMALL = (f"{self.settings_json['FO... |
import os
import subprocess
import logging
import filecmp
import copy
import base64
import json
import pykube
import kubernetes_validate
from kubernetes_validate.utils import (
SchemaNotFoundError,
VersionNotSupportedError,
InvalidSchemaError,
ValidationError,
)
from toscaparser.tosca_template import T... | import os
import subprocess
import logging
import filecmp
import copy
import base64
import json
import pykube
import kubernetes_validate
from kubernetes_validate.utils import (
SchemaNotFoundError,
VersionNotSupportedError,
InvalidSchemaError,
ValidationError,
)
from toscaparser.tosca_template import T... |
# fmt: off
import json
import logging
import threading
import time
from collections import OrderedDict
from datetime import timedelta
from enum import Enum
from inspect import signature
from pathlib import Path
from typing import Any, Dict, get_type_hints
import requests
from ipywidgets import (HTML, Button, Checkbox... | # fmt: off
import json
import logging
import threading
import time
from collections import OrderedDict
from datetime import timedelta
from enum import Enum
from inspect import signature
from pathlib import Path
from typing import Any, Dict, get_type_hints
import requests
from ipywidgets import (HTML, Button, Checkbox... |
from .units import Quantity, units
from .common import (
invert_dict,
CP_symbUpper_to_units,
preferred_units_from_type,
preferred_units_from_symbol,
)
from .realfluid import Properties as rfprop
from .plotting import PropertyPlot, plt
import CoolProp
from CoolProp.CoolProp import HAPropsSI,set_reference... | from .units import Quantity, units
from .common import (
invert_dict,
CP_symbUpper_to_units,
preferred_units_from_type,
preferred_units_from_symbol,
)
from .realfluid import Properties as rfprop
from .plotting import PropertyPlot, plt
import CoolProp
from CoolProp.CoolProp import HAPropsSI,set_reference... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import itertools
from collections import defaultdict
from json import dumps as json_dumps
from typing import (
Any,
DefaultDict,
Dict,
List,
NamedTuple,
Optional,
Sequence,
Tuple,
Union,
)
... | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import itertools
from collections import defaultdict
from json import dumps as json_dumps
from typing import (
Any,
DefaultDict,
Dict,
List,
NamedTuple,
Optional,
Sequence,
Tuple,
Union,
)
... |
"""Requires Python 3"""
# General imports
import os, sys, shutil
# Third-Party imports
from PySide2 import QtCore
import maya.cmds as cmds
from maya.app.startup import basic
import maya.utils
# Base path definitions
MODULENAME = "depthOfFieldTool"
DRAGGEDFROMPATH = os.path.dirname(__file__)
DEFAULTMODULEPATH = f"... | """Requires Python 3"""
# General imports
import os, sys, shutil
# Third-Party imports
from PySide2 import QtCore
import maya.cmds as cmds
from maya.app.startup import basic
import maya.utils
# Base path definitions
MODULENAME = "depthOfFieldTool"
DRAGGEDFROMPATH = os.path.dirname(__file__)
DEFAULTMODULEPATH = f"... |
import re
import os
from typing import Optional, Union, List, Dict
from os.path import expandvars
from itertools import chain
from pathlib import Path
from pydantic import (
BaseModel,
SecretStr,
BaseSettings,
PositiveInt,
FilePath,
Field,
validator,
root_validator,
)
from . import co... | import re
import os
from typing import Optional, Union, List, Dict
from os.path import expandvars
from itertools import chain
from pathlib import Path
from pydantic import (
BaseModel,
SecretStr,
BaseSettings,
PositiveInt,
FilePath,
Field,
validator,
root_validator,
)
from . import co... |
"""
## Pump curve fitting and drawing
- Establish an equation for the pump curve from measured points on the curve in the pump's data sheet
- Get the coefficients of the 2nd order polynomial describing the pump curve and determined via curve fitting
- Draw the pump curve in a diagram
"""
from typing import List, Tupl... | """
## Pump curve fitting and drawing
- Establish an equation for the pump curve from measured points on the curve in the pump's data sheet
- Get the coefficients of the 2nd order polynomial describing the pump curve and determined via curve fitting
- Draw the pump curve in a diagram
"""
from typing import List, Tupl... |
# Native
import os
from math import *
from cmath import *
from time import time
# Installed
import cv2 as cv
# Custom Modules
from assets.utils import float_range
from JuliaSet.core import JuliaSet
class Animation:
def __init__(self, range_from: float or int, range_to: float or int, range_step: f... | # Native
import os
from math import *
from cmath import *
from time import time
# Installed
import cv2 as cv
# Custom Modules
from assets.utils import float_range
from JuliaSet.core import JuliaSet
class Animation:
def __init__(self, range_from: float or int, range_to: float or int, range_step: f... |
# Copyright © 2019 Province of British Columbia
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | # Copyright © 2019 Province of British Columbia
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
import datetime
from pathlib import Path
import numpy as np
import scipy.io
class CameraCalibration(object):
"""Camera calibration saved in .mat file and method to assemble Projective (P) martrix.
Notes:
- Inspired by example code + notes from CiRC which are derived from Hartley and Zisserman (20030... | import datetime
from pathlib import Path
import numpy as np
import scipy.io
class CameraCalibration(object):
"""Camera calibration saved in .mat file and method to assemble Projective (P) martrix.
Notes:
- Inspired by example code + notes from CiRC which are derived from Hartley and Zisserman (20030... |
# -*- coding: utf-8 -*-
import datetime
import pytest
from flask import url_for
from flask_login import current_user
from scout.server.extensions import store
TEST_SUBPANEL = dict(
title="Subp title",
subtitle="Subp subtitle",
created=datetime.datetime.now(),
updated=datetime.datetime.now(),
)
def ... | # -*- coding: utf-8 -*-
import datetime
import pytest
from flask import url_for
from flask_login import current_user
from scout.server.extensions import store
TEST_SUBPANEL = dict(
title="Subp title",
subtitle="Subp subtitle",
created=datetime.datetime.now(),
updated=datetime.datetime.now(),
)
def ... |
#!/usr/bin/env python
"""
desc goes here
"""
import json
import logging
import os
import time
import uuid
from urllib.parse import urljoin, quote
import requests
from requests import HTTPError
from ingest.api.requests_utils import optimistic_session
class IngestApi:
def __init__(self, url=None, ingest_api_root=... | #!/usr/bin/env python
"""
desc goes here
"""
import json
import logging
import os
import time
import uuid
from urllib.parse import urljoin, quote
import requests
from requests import HTTPError
from ingest.api.requests_utils import optimistic_session
class IngestApi:
def __init__(self, url=None, ingest_api_root=... |
from typing import Any, Text, Dict, List
from rasa_sdk import Action, Tracker
from rasa_sdk.executor import CollectingDispatcher
from utils import convert_timestamp
from rasa_sdk.events import AllSlotsReset
import datetime
from datetime import timedelta, date
import dateutil.parser
import boto3
from boto3.dynamodb.cond... | from typing import Any, Text, Dict, List
from rasa_sdk import Action, Tracker
from rasa_sdk.executor import CollectingDispatcher
from utils import convert_timestamp
from rasa_sdk.events import AllSlotsReset
import datetime
from datetime import timedelta, date
import dateutil.parser
import boto3
from boto3.dynamodb.cond... |
from logging import log
import dash
import dash_leaflet as dl
import dash_leaflet.express as dlx
from dash.dependencies import Input, Output
from dash_extensions.javascript import assign, arrow_function
import pandas as pd
import dash_html_components as html
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWL... | from logging import log
import dash
import dash_leaflet as dl
import dash_leaflet.express as dlx
from dash.dependencies import Input, Output
from dash_extensions.javascript import assign, arrow_function
import pandas as pd
import dash_html_components as html
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWL... |
#!/usr/bin/python
import sys
import macro_compiler as mc
import os
import app_ui as ui
import terminal_colors as tc
import argparse
import led_command as lc
import math
import utils as u
import datetime
global app_description, verbose_mode, random_seed
app_description = None
verbose_mode = None
random_seed = 1
glob... | #!/usr/bin/python
import sys
import macro_compiler as mc
import os
import app_ui as ui
import terminal_colors as tc
import argparse
import led_command as lc
import math
import utils as u
import datetime
global app_description, verbose_mode, random_seed
app_description = None
verbose_mode = None
random_seed = 1
glob... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.