edited_code stringlengths 17 978k | original_code stringlengths 17 978k |
|---|---|
#!/usr/bin/env python
import argparse
import random
import subprocess
import sys
import time
from pathlib import Path
from typing import List
import numpy as np
def _get_args() -> dict:
parser = argparse.ArgumentParser()
parser.add_argument('mode', choices=["train", "evaluate"])
parser.add_argument('--d... | #!/usr/bin/env python
import argparse
import random
import subprocess
import sys
import time
from pathlib import Path
from typing import List
import numpy as np
def _get_args() -> dict:
parser = argparse.ArgumentParser()
parser.add_argument('mode', choices=["train", "evaluate"])
parser.add_argument('--d... |
"""
`canarydecoder.Processor`
-------------------------
Processor object for data loading and feature extraction.
"""
import os
import joblib
import numpy as np
from .extract import extract_features, load_all_waves, load_wave
class Processor(object):
def __init__(self, sampling_rate: int, n_fft: int,
... | """
`canarydecoder.Processor`
-------------------------
Processor object for data loading and feature extraction.
"""
import os
import joblib
import numpy as np
from .extract import extract_features, load_all_waves, load_wave
class Processor(object):
def __init__(self, sampling_rate: int, n_fft: int,
... |
from typing import Iterable
from bot.rules import burst
from tests.bot.rules import DisallowedCase, RuleTest
from tests.helpers import MockMessage
def make_msg(author: str) -> MockMessage:
"""
Init a MockMessage instance with author set to `author`.
This serves as a shorthand / alias to keep the test ca... | from typing import Iterable
from bot.rules import burst
from tests.bot.rules import DisallowedCase, RuleTest
from tests.helpers import MockMessage
def make_msg(author: str) -> MockMessage:
"""
Init a MockMessage instance with author set to `author`.
This serves as a shorthand / alias to keep the test ca... |
import matplotlib.pyplot as plt
import os
import pandas as pd
import plotly.express as px
from src.datasets.get_dataset import get_dataset
from src.parser.visualize import parser
from src.visualize.visualize import viz_dataset
plt.switch_backend('agg')
def build_dataset_dist(dataset):
frames_by_class = zip(data... | import matplotlib.pyplot as plt
import os
import pandas as pd
import plotly.express as px
from src.datasets.get_dataset import get_dataset
from src.parser.visualize import parser
from src.visualize.visualize import viz_dataset
plt.switch_backend('agg')
def build_dataset_dist(dataset):
frames_by_class = zip(data... |
# Copyright 2021 Uber Technologies, Inc. All Rights Reserved.
#
# 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 applica... | # Copyright 2021 Uber Technologies, Inc. All Rights Reserved.
#
# 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 applica... |
import os
import sys
sys.path.insert(1, os.path.join(sys.path[0], '..'))
from myconfigparser import UnitParser, load_unit_data, Decoration
file_path = '../../development/table/unit.ini'
def do(file_path=file_path):
with open(file_path) as f:
data = load_unit_data(f, parser=UnitParser)
for unit in d... | import os
import sys
sys.path.insert(1, os.path.join(sys.path[0], '..'))
from myconfigparser import UnitParser, load_unit_data, Decoration
file_path = '../../development/table/unit.ini'
def do(file_path=file_path):
with open(file_path) as f:
data = load_unit_data(f, parser=UnitParser)
for unit in d... |
from displayarray import read_updates
with read_updates(0) as a, read_updates(0) as b:
for i in range(1000):
a.update()
b.update()
try:
print(a.frames == b.frames)
except ValueError:
print(f"frame comparison: {(a.frames["0"][0] == b.frames["0"][0]).all()}")
| from displayarray import read_updates
with read_updates(0) as a, read_updates(0) as b:
for i in range(1000):
a.update()
b.update()
try:
print(a.frames == b.frames)
except ValueError:
print(f"frame comparison: {(a.frames['0'][0] == b.frames['0'][0]).all()}")
|
# ***************************************************************
# Copyright (c) 2020 Jittor. Authors: Dun Liang <randonlang@gmail.com>. All Rights Reserved.
# This file is subject to the terms and conditions defined in
# file 'LICENSE.txt', which is part of this source code package.
# ********************************... | # ***************************************************************
# Copyright (c) 2020 Jittor. Authors: Dun Liang <randonlang@gmail.com>. All Rights Reserved.
# This file is subject to the terms and conditions defined in
# file 'LICENSE.txt', which is part of this source code package.
# ********************************... |
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/02_showdoc.ipynb (unless otherwise specified).
__all__ = ['is_enum', 'is_lib_module', 're_digits_first', 'try_external_doc_link', 'is_doc_name', 'doc_link',
'add_doc_links', 'get_source_link', 'colab_link', 'get_nb_source_link', 'nb_source_link', 'type_repr',
... | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/02_showdoc.ipynb (unless otherwise specified).
__all__ = ['is_enum', 'is_lib_module', 're_digits_first', 'try_external_doc_link', 'is_doc_name', 'doc_link',
'add_doc_links', 'get_source_link', 'colab_link', 'get_nb_source_link', 'nb_source_link', 'type_repr',
... |
import numpy as np
import pandas as pd
import hail as hl
from hail.linalg import BlockMatrix
from hail.linalg.utils import _check_dims
from hail.table import Table
from hail.typecheck import typecheck_method, nullable, tupleof, oneof, numeric
from hail.utils.java import Env, info
from hail.utils.misc import plural
c... | import numpy as np
import pandas as pd
import hail as hl
from hail.linalg import BlockMatrix
from hail.linalg.utils import _check_dims
from hail.table import Table
from hail.typecheck import typecheck_method, nullable, tupleof, oneof, numeric
from hail.utils.java import Env, info
from hail.utils.misc import plural
c... |
from typing import Optional, Callable, Type, Union, List, Any, Iterable
from types import TracebackType
from io import BytesIO
import asyncio
import concurrent
import dill
import functools
import sys
from hailtop.utils import secret_alnum_string, partition
import hailtop.batch_client.aioclient as low_level_batch_clien... | from typing import Optional, Callable, Type, Union, List, Any, Iterable
from types import TracebackType
from io import BytesIO
import asyncio
import concurrent
import dill
import functools
import sys
from hailtop.utils import secret_alnum_string, partition
import hailtop.batch_client.aioclient as low_level_batch_clien... |
import json
import uuid
import pytest
from flask import url_for
from notifications_python_client.errors import HTTPError
from notifications_utils.url_safe_token import generate_token
from app.models.webauthn_credential import (
WebAuthnCredential,
WebAuthnCredentials,
)
from tests.conftest import (
create... | import json
import uuid
import pytest
from flask import url_for
from notifications_python_client.errors import HTTPError
from notifications_utils.url_safe_token import generate_token
from app.models.webauthn_credential import (
WebAuthnCredential,
WebAuthnCredentials,
)
from tests.conftest import (
create... |
import logging
import uuid
from datetime import datetime, timedelta
from enum import Enum, auto
from json import JSONEncoder
from AllInOneInstagramBot.core.utils import get_value
logger = logging.getLogger(__name__)
class SessionState:
id = None
args = {}
my_username = None
my_posts_count = None
... | import logging
import uuid
from datetime import datetime, timedelta
from enum import Enum, auto
from json import JSONEncoder
from AllInOneInstagramBot.core.utils import get_value
logger = logging.getLogger(__name__)
class SessionState:
id = None
args = {}
my_username = None
my_posts_count = None
... |
"""Indy ledger implementation."""
import asyncio
import json
import logging
import tempfile
from datetime import datetime, date
from hashlib import sha256
from os import path
from time import time
from typing import Sequence, Tuple
import indy.ledger
import indy.pool
from indy.error import IndyError, ErrorCode
from... | """Indy ledger implementation."""
import asyncio
import json
import logging
import tempfile
from datetime import datetime, date
from hashlib import sha256
from os import path
from time import time
from typing import Sequence, Tuple
import indy.ledger
import indy.pool
from indy.error import IndyError, ErrorCode
from... |
import asyncio
import aiohttp # type: ignore
import math
import os
import datetime
import re
# import boto3 # type: ignore
import json
import io
import argparse
import gzip
from pathlib import Path
import os
# from cryptography.hazmat.backends import default_backend
# import jwt
# import requests
import time
import r... | import asyncio
import aiohttp # type: ignore
import math
import os
import datetime
import re
# import boto3 # type: ignore
import json
import io
import argparse
import gzip
from pathlib import Path
import os
# from cryptography.hazmat.backends import default_backend
# import jwt
# import requests
import time
import r... |
import json
import shutil
import argparse
from tqdm import tqdm
from utils import get_current_time
from tools.supervisely_utils import *
os.makedirs('logs', exist_ok=True)
logging.basicConfig(
format='%(asctime)s - %(levelname)s - %(message)s',
datefmt='%d.%m.%Y %I:%M:%S',
filename='logs/{:s}.log'.format... | import json
import shutil
import argparse
from tqdm import tqdm
from utils import get_current_time
from tools.supervisely_utils import *
os.makedirs('logs', exist_ok=True)
logging.basicConfig(
format='%(asctime)s - %(levelname)s - %(message)s',
datefmt='%d.%m.%Y %I:%M:%S',
filename='logs/{:s}.log'.format... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# pyre-unsafe
import json
import textwrap
import unittest
from typing import Dict, List, Optional, Tuple
from unittest.mock import call, patc... | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# pyre-unsafe
import json
import textwrap
import unittest
from typing import Dict, List, Optional, Tuple
from unittest.mock import call, patc... |
class Ast:
def __init__(self):
self.nodes = []
def __repr__(self):
return ''.join([str(n) for n in self.nodes])
class Node:
def __init__(self, node_type, **kwargs):
self.node_type = node_type
self.indent = 0
class Comment(Node):
def __init__(self, text, **kwargs):
... | class Ast:
def __init__(self):
self.nodes = []
def __repr__(self):
return ''.join([str(n) for n in self.nodes])
class Node:
def __init__(self, node_type, **kwargs):
self.node_type = node_type
self.indent = 0
class Comment(Node):
def __init__(self, text, **kwargs):
... |
# -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.11.3
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# %% [raw] raw_mimetype="tex... | # -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.11.3
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# %% [raw] raw_mimetype="tex... |
import configparser
import os
import secrets
from pathlib import Path
import click
import click_spinner
import shortuuid
from git import Repo
from git.exc import InvalidGitRepositoryError
from .github import GitHub
CONFIG_FILE = 'config.ini'
QQQ = 'qqq'
@click.group()
def cli():
"""
QQQ allows you to easil... | import configparser
import os
import secrets
from pathlib import Path
import click
import click_spinner
import shortuuid
from git import Repo
from git.exc import InvalidGitRepositoryError
from .github import GitHub
CONFIG_FILE = 'config.ini'
QQQ = 'qqq'
@click.group()
def cli():
"""
QQQ allows you to easil... |
from datetime import datetime, timedelta
from typing import Optional, Iterator
import databases
import enum
import jwt
import sqlalchemy
import uvicorn
from databases.backends.postgres import Record
from email_validator import EmailNotValidError, validate_email as ve
from fastapi import FastAPI, HTTPException, Depen... | from datetime import datetime, timedelta
from typing import Optional, Iterator
import databases
import enum
import jwt
import sqlalchemy
import uvicorn
from databases.backends.postgres import Record
from email_validator import EmailNotValidError, validate_email as ve
from fastapi import FastAPI, HTTPException, Depen... |
import streamlit as st
import time
import requests
def main():
st.set_page_config( # Alternate names: setup_page, page, layout
layout="wide", # Can be "centered" or "wide". In the future also "dashboard", etc.
initial_sidebar_state="auto", # Can be "auto", "expanded", "collapsed"
page_t... | import streamlit as st
import time
import requests
def main():
st.set_page_config( # Alternate names: setup_page, page, layout
layout="wide", # Can be "centered" or "wide". In the future also "dashboard", etc.
initial_sidebar_state="auto", # Can be "auto", "expanded", "collapsed"
page_t... |
from telegram import InlineKeyboardButton
def get_products_keyboard(products):
keyboard = []
for product in products:
keyboard.append(
[
InlineKeyboardButton(product['description'], callback_data=product['id'])
]
)
return keyboard
def get_purchase_... | from telegram import InlineKeyboardButton
def get_products_keyboard(products):
keyboard = []
for product in products:
keyboard.append(
[
InlineKeyboardButton(product['description'], callback_data=product['id'])
]
)
return keyboard
def get_purchase_... |
# coding: utf-8
import os
import re
import sys
import time
import datetime
import numpy as np
from collections import defaultdict
def flatten_dual(lst):
return [e for sublist in lst for e in sublist]
def get_varname(var, scope_=globals()):
for varname,val in scope_.items():
if id(val)==id(var):
... | # coding: utf-8
import os
import re
import sys
import time
import datetime
import numpy as np
from collections import defaultdict
def flatten_dual(lst):
return [e for sublist in lst for e in sublist]
def get_varname(var, scope_=globals()):
for varname,val in scope_.items():
if id(val)==id(var):
... |
import requests
import json
import os
import urllib3
from wakeonlan import send_magic_packet
# REFERENCE: https://github.com/exiva/Vizio_SmartCast_API
class VizioController(object):
def __init__(self):
# Vizio's API is completely insecure, but it's also local only, so...
urllib3.disable_warnings(... | import requests
import json
import os
import urllib3
from wakeonlan import send_magic_packet
# REFERENCE: https://github.com/exiva/Vizio_SmartCast_API
class VizioController(object):
def __init__(self):
# Vizio's API is completely insecure, but it's also local only, so...
urllib3.disable_warnings(... |
from utils import config, files
class Source:
def __init__(self, name, roles=True):
"""
Template for source classes.
The source should implement the methods described below, with the correct return values.
Parameters:
- name (str): Name of source. Gets used in... | from utils import config, files
class Source:
def __init__(self, name, roles=True):
"""
Template for source classes.
The source should implement the methods described below, with the correct return values.
Parameters:
- name (str): Name of source. Gets used in... |
import subprocess
import sys
from abc import ABC
from collections import OrderedDict
from hashlib import sha256
from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Type, Union
from packaging import version
import base64
import fnmatch
import functools
import inspect
import json
import os
import p... | import subprocess
import sys
from abc import ABC
from collections import OrderedDict
from hashlib import sha256
from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Type, Union
from packaging import version
import base64
import fnmatch
import functools
import inspect
import json
import os
import p... |
"""
Enable card counting.
Shuffle logic:
Continuous Shuffle Machine?
Shuffle every half deck?
Shuffle on before using last 52 cards.
rename Game.sink to Game.discard_tray
"""
import random
import sys
import time
from ttblackjack.card import Card
from ttblackjack import INSTRUCT... | """
Enable card counting.
Shuffle logic:
Continuous Shuffle Machine?
Shuffle every half deck?
Shuffle on before using last 52 cards.
rename Game.sink to Game.discard_tray
"""
import random
import sys
import time
from ttblackjack.card import Card
from ttblackjack import INSTRUCT... |
#!/usr/bin python3
# Imports
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Python:
import logging
from json import loads
from itertools import chain
# 3rd party:
from azure.durable_functions import (
DurableOrchestrationContext, Orchestrator, RetryOptions
)
# Intern... | #!/usr/bin python3
# Imports
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Python:
import logging
from json import loads
from itertools import chain
# 3rd party:
from azure.durable_functions import (
DurableOrchestrationContext, Orchestrator, RetryOptions
)
# Intern... |
""" Helps with running Pylint tests on different modules """
import subprocess
AUTODETECT = 0
def assert_pylint_is_passing(pylintrc, package_dir, number_of_jobs: int = AUTODETECT):
"""Runs Pylint with given inputs. In case of error some helpful Pylint messages are displayed
This is used in different packag... | """ Helps with running Pylint tests on different modules """
import subprocess
AUTODETECT = 0
def assert_pylint_is_passing(pylintrc, package_dir, number_of_jobs: int = AUTODETECT):
"""Runs Pylint with given inputs. In case of error some helpful Pylint messages are displayed
This is used in different packag... |
# The MIT License (MIT)
# Copyright (c) 2021-present EQUENOS
# 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, copy, mod... | # The MIT License (MIT)
# Copyright (c) 2021-present EQUENOS
# 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, copy, mod... |
# Licensed under the MIT License
# https://github.com/craigahobbs/chisel/blob/main/LICENSE
"""
Chisel action class
"""
from cgi import parse_header
from functools import partial
from http import HTTPStatus
from json import loads as json_loads
from schema_markdown import SchemaMarkdownParser, ValidationError, decode_... | # Licensed under the MIT License
# https://github.com/craigahobbs/chisel/blob/main/LICENSE
"""
Chisel action class
"""
from cgi import parse_header
from functools import partial
from http import HTTPStatus
from json import loads as json_loads
from schema_markdown import SchemaMarkdownParser, ValidationError, decode_... |
import asyncio
import subprocess
import concurrent
import click
import aiohttp
from pyartcd.cli import cli, click_coroutine, pass_runtime
from pyartcd.runtime import Runtime
BASE_URL = 'https://api.openshift.com/api/upgrades_info/v1/graph?arch=amd64&channel=fast'
ELLIOTT_BIN = 'elliott'
async def is_ga(version: st... | import asyncio
import subprocess
import concurrent
import click
import aiohttp
from pyartcd.cli import cli, click_coroutine, pass_runtime
from pyartcd.runtime import Runtime
BASE_URL = 'https://api.openshift.com/api/upgrades_info/v1/graph?arch=amd64&channel=fast'
ELLIOTT_BIN = 'elliott'
async def is_ga(version: st... |
# type: ignore
import logging
import warnings
from typing import Union, List, Any, Tuple, Dict
from urllib.parse import urlparse
import requests
from pymisp import ExpandedPyMISP, PyMISPError, MISPObject
from pymisp.tools import EMailObject, GenericObjectGenerator
from CommonServerPython import *
logging.getLogger(... | # type: ignore
import logging
import warnings
from typing import Union, List, Any, Tuple, Dict
from urllib.parse import urlparse
import requests
from pymisp import ExpandedPyMISP, PyMISPError, MISPObject
from pymisp.tools import EMailObject, GenericObjectGenerator
from CommonServerPython import *
logging.getLogger(... |
import json, sys, os, re
from os.path import isfile, isdir, join, splitext, dirname, basename
from src.configuration import config, process_config, get_mini_config
from src.globals import config_ext, json_ext, jtree_ext
from src import gui
from src.jtree import build_jtree
resource_path = './resources'
jtree_path = '.... | import json, sys, os, re
from os.path import isfile, isdir, join, splitext, dirname, basename
from src.configuration import config, process_config, get_mini_config
from src.globals import config_ext, json_ext, jtree_ext
from src import gui
from src.jtree import build_jtree
resource_path = './resources'
jtree_path = '.... |
"""Test classes."""
# pyright: basic, reportIncompatibleMethodOverride=none
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Dict, List, MutableMapping, Optional, Tuple
import boto3
import yaml
from botocore.client import BaseClient
from botocore.stub import Stubber
from mock import MagicMock... | """Test classes."""
# pyright: basic, reportIncompatibleMethodOverride=none
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Dict, List, MutableMapping, Optional, Tuple
import boto3
import yaml
from botocore.client import BaseClient
from botocore.stub import Stubber
from mock import MagicMock... |
import numpy as np
import xarray as xr
from IPython.display import display_html
from xarray.core.formatting_html import dataset_repr
from xarray.core.options import OPTIONS as XR_OPTIONS
from .alignment import return_inits_and_verif_dates
from .bias_removal import mean_bias_removal
from .bootstrap import (
bootstr... | import numpy as np
import xarray as xr
from IPython.display import display_html
from xarray.core.formatting_html import dataset_repr
from xarray.core.options import OPTIONS as XR_OPTIONS
from .alignment import return_inits_and_verif_dates
from .bias_removal import mean_bias_removal
from .bootstrap import (
bootstr... |
import pandas as pd
import numpy as np
import os.path
from unittest import TestCase
from tsgen.gen import TimeSerieGenerator
class TimeSerieGeneratorTestCase(TestCase):
def test_generate_df_freq(self):
ts_gen = TimeSerieGenerator(
date_start="1990-01-01",
date_end="1990-01-02",
... | import pandas as pd
import numpy as np
import os.path
from unittest import TestCase
from tsgen.gen import TimeSerieGenerator
class TimeSerieGeneratorTestCase(TestCase):
def test_generate_df_freq(self):
ts_gen = TimeSerieGenerator(
date_start="1990-01-01",
date_end="1990-01-02",
... |
"""Tests for the link user flow."""
from http import HTTPStatus
from unittest.mock import patch
from . import async_setup_auth
from tests.common import CLIENT_ID, CLIENT_REDIRECT_URI
async def async_get_code(hass, aiohttp_client):
"""Return authorization code for link user tests."""
config = [
{
... | """Tests for the link user flow."""
from http import HTTPStatus
from unittest.mock import patch
from . import async_setup_auth
from tests.common import CLIENT_ID, CLIENT_REDIRECT_URI
async def async_get_code(hass, aiohttp_client):
"""Return authorization code for link user tests."""
config = [
{
... |
"""Programmatic control over the TWS/gateway client software."""
import asyncio
import configparser
import logging
import os
from contextlib import suppress
from dataclasses import dataclass
from typing import ClassVar, Union
from eventkit import Event
import ib_insync.util as util
from ib_insync.contract import For... | """Programmatic control over the TWS/gateway client software."""
import asyncio
import configparser
import logging
import os
from contextlib import suppress
from dataclasses import dataclass
from typing import ClassVar, Union
from eventkit import Event
import ib_insync.util as util
from ib_insync.contract import For... |
"""API functionality for websites"""
import logging
import os
from typing import Dict, List, Optional
from uuid import UUID
from django.conf import settings
from django.core.files.uploadedfile import UploadedFile
from django.db.models import Q, QuerySet
from magic import Magic
from mitol.common.utils import max_or_non... | """API functionality for websites"""
import logging
import os
from typing import Dict, List, Optional
from uuid import UUID
from django.conf import settings
from django.core.files.uploadedfile import UploadedFile
from django.db.models import Q, QuerySet
from magic import Magic
from mitol.common.utils import max_or_non... |
"""
_______ __ _______ __ __ __
| _ .----.-----.--.--.--.--| | _ | |_.----|__| |--.-----.
|. 1___| _| _ | | | | _ | 1___| _| _| | <| -__|
|. |___|__| |_____|________|_____|____ |____|__| |__|__|__|_____|
|: 1 | |: 1 |
|::.. ... | """
_______ __ _______ __ __ __
| _ .----.-----.--.--.--.--| | _ | |_.----|__| |--.-----.
|. 1___| _| _ | | | | _ | 1___| _| _| | <| -__|
|. |___|__| |_____|________|_____|____ |____|__| |__|__|__|_____|
|: 1 | |: 1 |
|::.. ... |
"""
Base settings to build other settings files upon.
"""
import environ
from django.contrib import admin
ROOT_DIR = environ.Path(__file__) - 3 # (bootcamp/config/settings/base.py - 3 = bootcamp/)
APPS_DIR = ROOT_DIR.path('bootcamp')
env = environ.Env()
env.read_env(str(ROOT_DIR.path('.env')))
# READ_DOT_ENV_FILE ... | """
Base settings to build other settings files upon.
"""
import environ
from django.contrib import admin
ROOT_DIR = environ.Path(__file__) - 3 # (bootcamp/config/settings/base.py - 3 = bootcamp/)
APPS_DIR = ROOT_DIR.path('bootcamp')
env = environ.Env()
env.read_env(str(ROOT_DIR.path('.env')))
# READ_DOT_ENV_FILE ... |
import os
import glob
import numpy as np
import nibabel as nb
import os
import scipy.io as sio
from scipy.stats import pearsonr
PH_SERVER_ROOT = os.environ.get('PH_SERVER_ROOT')
def zscore(data, axis):
data -= data.mean(axis=axis, keepdims=True)
data /= data.std(axis=axis, keepdims=True)
return np.nan_to_... | import os
import glob
import numpy as np
import nibabel as nb
import os
import scipy.io as sio
from scipy.stats import pearsonr
PH_SERVER_ROOT = os.environ.get('PH_SERVER_ROOT')
def zscore(data, axis):
data -= data.mean(axis=axis, keepdims=True)
data /= data.std(axis=axis, keepdims=True)
return np.nan_to_... |
"""Indy SDK verifier implementation."""
import json
import logging
import indy.anoncreds
from indy.error import IndyError
from ...ledger.indy import IndySdkLedger
from ..verifier import IndyVerifier
LOGGER = logging.getLogger(__name__)
class IndySdkVerifier(IndyVerifier):
"""Indy-SDK verifier implementation.... | """Indy SDK verifier implementation."""
import json
import logging
import indy.anoncreds
from indy.error import IndyError
from ...ledger.indy import IndySdkLedger
from ..verifier import IndyVerifier
LOGGER = logging.getLogger(__name__)
class IndySdkVerifier(IndyVerifier):
"""Indy-SDK verifier implementation.... |
###
### Copyright (C) 2021 Intel Corporation
###
### SPDX-License-Identifier: BSD-3-Clause
###
import os
import slash
from ...lib.common import get_media, timefn, call, exe2os, filepath2os
from ...lib.ffmpeg.util import have_ffmpeg, BaseFormatMapper
from ...lib.parameters import format_value
from ...lib.util import s... | ###
### Copyright (C) 2021 Intel Corporation
###
### SPDX-License-Identifier: BSD-3-Clause
###
import os
import slash
from ...lib.common import get_media, timefn, call, exe2os, filepath2os
from ...lib.ffmpeg.util import have_ffmpeg, BaseFormatMapper
from ...lib.parameters import format_value
from ...lib.util import s... |
from dotenv import load_dotenv
import os
import requests
from bs4 import BeautifulSoup
import json
import re
load_dotenv()
def addConflicts(data):
for department in data:
for course in department["courses"]:
for section in course["sections"]:
section["conflicts"] = getConflict... | from dotenv import load_dotenv
import os
import requests
from bs4 import BeautifulSoup
import json
import re
load_dotenv()
def addConflicts(data):
for department in data:
for course in department["courses"]:
for section in course["sections"]:
section["conflicts"] = getConflict... |
from simple_websocket_server import WebSocketServer, WebSocket
from json import loads,dumps
from time import sleep
from dateutil import parser
from threading import Thread
from random import randint
from datetime import datetime,timedelta
from uuid import uuid4
import traceback
iso=lambda x:datetime.fromtimestamp(x).i... | from simple_websocket_server import WebSocketServer, WebSocket
from json import loads,dumps
from time import sleep
from dateutil import parser
from threading import Thread
from random import randint
from datetime import datetime,timedelta
from uuid import uuid4
import traceback
iso=lambda x:datetime.fromtimestamp(x).i... |
# https://github.com/facebookresearch/torchbeast/blob/master/torchbeast/core/environment.py
import numpy as np
from collections import deque
import gym
from gym import spaces
import cv2
cv2.ocl.setUseOpenCL(False)
class NoopResetEnv(gym.Wrapper):
def __init__(self, env, noop_max=30):
"""Sample initial st... | # https://github.com/facebookresearch/torchbeast/blob/master/torchbeast/core/environment.py
import numpy as np
from collections import deque
import gym
from gym import spaces
import cv2
cv2.ocl.setUseOpenCL(False)
class NoopResetEnv(gym.Wrapper):
def __init__(self, env, noop_max=30):
"""Sample initial st... |
""""
Copyright © Krypton 2021 - https://github.com/kkrypt0nn (https://krypt0n.co.uk)
Description:
This is a template to create your own discord bot in python.
Version: 4.0.1
"""
import json
import os
import platform
import random
import sys
import disnake
from disnake import ApplicationCommandInteraction
from disnak... | """"
Copyright © Krypton 2021 - https://github.com/kkrypt0nn (https://krypt0n.co.uk)
Description:
This is a template to create your own discord bot in python.
Version: 4.0.1
"""
import json
import os
import platform
import random
import sys
import disnake
from disnake import ApplicationCommandInteraction
from disnak... |
def metade(n, f=False):
if f:
return f'{moedas(n / 2)}'
else:
return n / 2
def dobro(n, f=False):
if f:
return f'{moedas(n * 2)}'
else:
return n * 2
def aumentar(n, p=10, f=False):
if f:
return f'{moedas(n + (n * p / 100))}'
else:
return n + (... | def metade(n, f=False):
if f:
return f'{moedas(n / 2)}'
else:
return n / 2
def dobro(n, f=False):
if f:
return f'{moedas(n * 2)}'
else:
return n * 2
def aumentar(n, p=10, f=False):
if f:
return f'{moedas(n + (n * p / 100))}'
else:
return n + (... |
import deluca.core
from deluca.lung.core import Controller, ControllerState
from deluca.lung.utils import BreathWaveform
from deluca.lung.controllers import Expiratory
from deluca.lung.environments._stitched_sim import StitchedSimObservation
from deluca.lung.utils.data.transform import ShiftScaleTransform
from deluca.l... | import deluca.core
from deluca.lung.core import Controller, ControllerState
from deluca.lung.utils import BreathWaveform
from deluca.lung.controllers import Expiratory
from deluca.lung.environments._stitched_sim import StitchedSimObservation
from deluca.lung.utils.data.transform import ShiftScaleTransform
from deluca.l... |
from pycamia import info_manager
__info__ = info_manager(
project = "PyZMyc",
package = "pyoverload",
fileinfo = "Useful tools for decorators."
)
__all__ = """
raw_function
return_type_wrapper
decorator
""".split()
import sys
from functools import wraps
def raw_function(func):
if hasatt... |
from pycamia import info_manager
__info__ = info_manager(
project = "PyZMyc",
package = "pyoverload",
fileinfo = "Useful tools for decorators."
)
__all__ = """
raw_function
return_type_wrapper
decorator
""".split()
import sys
from functools import wraps
def raw_function(func):
if hasatt... |
import inspect
import os
from unittest import TestCase
import boto3
from decouple import config
from loguru import logger
from moto.s3 import mock_s3
from constants import TEMP_FILE_FOLDER
from services.s3_service import S3Service
class TestS3Service(TestCase):
""" Test S3Service class """
@mock_s3
def... | import inspect
import os
from unittest import TestCase
import boto3
from decouple import config
from loguru import logger
from moto.s3 import mock_s3
from constants import TEMP_FILE_FOLDER
from services.s3_service import S3Service
class TestS3Service(TestCase):
""" Test S3Service class """
@mock_s3
def... |
import argparse
import base64
import json
import logging
import logging.handlers
import re
import requirements
import time
import http
import urllib.request
import xml.etree.ElementTree as ET
import os
import sys
from datetime import datetime
import github3
import warnings
import PyDigger.common
requirements_fields =... | import argparse
import base64
import json
import logging
import logging.handlers
import re
import requirements
import time
import http
import urllib.request
import xml.etree.ElementTree as ET
import os
import sys
from datetime import datetime
import github3
import warnings
import PyDigger.common
requirements_fields =... |
# 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... |
import argparse
import re
import sys
import boto3
from determined_deploy.aws import aws, constants
from determined_deploy.aws.deployment_types import secure, simple, vpc
def make_down_subparser(subparsers: argparse._SubParsersAction):
subparser = subparsers.add_parser("down", help="delete CloudFormation stack")... | import argparse
import re
import sys
import boto3
from determined_deploy.aws import aws, constants
from determined_deploy.aws.deployment_types import secure, simple, vpc
def make_down_subparser(subparsers: argparse._SubParsersAction):
subparser = subparsers.add_parser("down", help="delete CloudFormation stack")... |
""" manage PyTables query interface via Expressions """
import ast
from functools import partial
from typing import Any, Dict, Optional, Tuple
import numpy as np
from pandas._libs.tslibs import Timedelta, Timestamp
from pandas.compat.chainmap import DeepChainMap
from pandas.core.dtypes.common import is_l... | """ manage PyTables query interface via Expressions """
import ast
from functools import partial
from typing import Any, Dict, Optional, Tuple
import numpy as np
from pandas._libs.tslibs import Timedelta, Timestamp
from pandas.compat.chainmap import DeepChainMap
from pandas.core.dtypes.common import is_l... |
import os
import sys
sys.path.append(os.getcwd())
# Our infrastucture files
# from utils_data import *
# from utils_nn import *
from learn.utils.data import *
from learn.utils.nn import *
# neural nets
from learn.models.model_general_nn import GeneralNN
from learn.models.model_ensemble_nn import EnsembleNN
# Torch... | import os
import sys
sys.path.append(os.getcwd())
# Our infrastucture files
# from utils_data import *
# from utils_nn import *
from learn.utils.data import *
from learn.utils.nn import *
# neural nets
from learn.models.model_general_nn import GeneralNN
from learn.models.model_ensemble_nn import EnsembleNN
# Torch... |
import asyncio
import logging
from time import time
from typing import Dict, List, Optional, Tuple, Callable
import pytest
import covid.server.ws_connection as ws
from covid.full_node.mempool import Mempool
from covid.full_node.full_node_api import FullNodeAPI
from covid.protocols import full_node_protocol
from cov... | import asyncio
import logging
from time import time
from typing import Dict, List, Optional, Tuple, Callable
import pytest
import covid.server.ws_connection as ws
from covid.full_node.mempool import Mempool
from covid.full_node.full_node_api import FullNodeAPI
from covid.protocols import full_node_protocol
from cov... |
# -*- coding: utf-8 -*-
from typing import List
import pandas as pd
from zvt.api.utils import to_report_period_type, value_to_pct
from zvt.contract import ActorType
from zvt.contract.api import df_to_db
from zvt.contract.recorder import TimestampsDataRecorder
from zvt.domain import Stock, ActorMeta
from zvt.domain.ac... | # -*- coding: utf-8 -*-
from typing import List
import pandas as pd
from zvt.api.utils import to_report_period_type, value_to_pct
from zvt.contract import ActorType
from zvt.contract.api import df_to_db
from zvt.contract.recorder import TimestampsDataRecorder
from zvt.domain import Stock, ActorMeta
from zvt.domain.ac... |
import datetime
import keras
import numpy as np
import tokenization
import tensorflow as tf
import tensorflow_hub as hub
from config import *
def model_train(model_type, train, test, is_training=False):
if model_type == "bert":
bert_layer = hub.KerasLayer(mBERT_MODULE_URL, trainable=True)
else:
... | import datetime
import keras
import numpy as np
import tokenization
import tensorflow as tf
import tensorflow_hub as hub
from config import *
def model_train(model_type, train, test, is_training=False):
if model_type == "bert":
bert_layer = hub.KerasLayer(mBERT_MODULE_URL, trainable=True)
else:
... |
from utility_functions.date_period import date_period, bound_date_check
from utility_functions.benchmark import timer
from utility_functions.databricks_uf import clone
from utility_functions.custom_errors import *
from connect2Databricks.read2Databricks import redshift_cdw_read
from pyspark.sql.functions import split, ... | from utility_functions.date_period import date_period, bound_date_check
from utility_functions.benchmark import timer
from utility_functions.databricks_uf import clone
from utility_functions.custom_errors import *
from connect2Databricks.read2Databricks import redshift_cdw_read
from pyspark.sql.functions import split, ... |
# Copyright The PyTorch Lightning 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 law or agreed to i... | # Copyright The PyTorch Lightning 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 law or agreed to i... |
from dataclasses import dataclass
from datetime import datetime, timedelta
from enum import Enum
from typing import Dict, List, Optional, Union
from lxml import etree
from oadr2.schemas import EventSchema, SignalSchema
def format_duration(duration: Union[timedelta, None]) -> str:
if not duration:
return... | from dataclasses import dataclass
from datetime import datetime, timedelta
from enum import Enum
from typing import Dict, List, Optional, Union
from lxml import etree
from oadr2.schemas import EventSchema, SignalSchema
def format_duration(duration: Union[timedelta, None]) -> str:
if not duration:
return... |
from marshmallow import Schema, fields, post_load, pre_load
from models import Flight
# from parsers import Parser
from tortoise import Tortoise, run_async
import asyncio
import datetime
class SheremetievoCompanySchema(Schema):
code = fields.String(required=False, allow_none=True)
class SheremetievoSchema(Schem... | from marshmallow import Schema, fields, post_load, pre_load
from models import Flight
# from parsers import Parser
from tortoise import Tortoise, run_async
import asyncio
import datetime
class SheremetievoCompanySchema(Schema):
code = fields.String(required=False, allow_none=True)
class SheremetievoSchema(Schem... |
"""管理用户状态,包括但不限于查看签到状态,执行签到等"""
__all__ = ['apis_account_verify', 'check_display_state', 'stu_twqd']
import json
import requests
from src.BusinessCentralLayer.setting import OSH_STATUS_CODE, logger
from src.BusinessLogicLayer.cluster.osh_runner import runner
def apis_account_verify(user: dict):
"""
验证今日校园账... | """管理用户状态,包括但不限于查看签到状态,执行签到等"""
__all__ = ['apis_account_verify', 'check_display_state', 'stu_twqd']
import json
import requests
from src.BusinessCentralLayer.setting import OSH_STATUS_CODE, logger
from src.BusinessLogicLayer.cluster.osh_runner import runner
def apis_account_verify(user: dict):
"""
验证今日校园账... |
import csv
import json
import locale
import logging
import pathlib
import sys
import warnings
from typing import Any, Dict, Iterator, Optional, Set, Union
from requests.cookies import cookiejar_from_dict
from .constants import DEFAULT_REQUESTS_TIMEOUT
from .facebook_scraper import FacebookScraper
from .fb_types impor... | import csv
import json
import locale
import logging
import pathlib
import sys
import warnings
from typing import Any, Dict, Iterator, Optional, Set, Union
from requests.cookies import cookiejar_from_dict
from .constants import DEFAULT_REQUESTS_TIMEOUT
from .facebook_scraper import FacebookScraper
from .fb_types impor... |
from nbconvert import RSTExporter
from prose.io import get_files
import base64
import os
from os import path
import shutil
from traitlets.config import Config
c = Config()
c.RegexRemovePreprocessor.patterns = ["# hidden"]
rst = RSTExporter(config=c)
def save_image(destination, imstring):
open(destination, 'wb').... | from nbconvert import RSTExporter
from prose.io import get_files
import base64
import os
from os import path
import shutil
from traitlets.config import Config
c = Config()
c.RegexRemovePreprocessor.patterns = ["# hidden"]
rst = RSTExporter(config=c)
def save_image(destination, imstring):
open(destination, 'wb').... |
# stdlib
import json
# lib
from jnpr.junos import Device
from lxml import etree
import xmltodict
# local
from bin import Hosts
from bin.utils import (
colour_print,
error,
line_break,
)
import settings
class Learner(Hosts):
"""
Command: learner
Desc: inherits hosts from Hosts and learns about... | # stdlib
import json
# lib
from jnpr.junos import Device
from lxml import etree
import xmltodict
# local
from bin import Hosts
from bin.utils import (
colour_print,
error,
line_break,
)
import settings
class Learner(Hosts):
"""
Command: learner
Desc: inherits hosts from Hosts and learns about... |
import datetime
import tempfile
import copy
import boto3
import botocore
from rixtribute.helper import get_boto_session, generate_tags, get_external_ip, get_uuid_part_str
from rixtribute import aws_helper
import base64
import os
from typing import List, Optional, Tuple
from rixtribute import ssh
from rixtribute.configu... | import datetime
import tempfile
import copy
import boto3
import botocore
from rixtribute.helper import get_boto_session, generate_tags, get_external_ip, get_uuid_part_str
from rixtribute import aws_helper
import base64
import os
from typing import List, Optional, Tuple
from rixtribute import ssh
from rixtribute.configu... |
from functools import wraps, partial
from itertools import product, chain
import itertools
import collections
import copy
from enum import Enum
import operator
import random
import unittest
import math
import torch
import numpy as np
from torch._six import inf
import collections.abc
from typing import Any, Callable, ... | from functools import wraps, partial
from itertools import product, chain
import itertools
import collections
import copy
from enum import Enum
import operator
import random
import unittest
import math
import torch
import numpy as np
from torch._six import inf
import collections.abc
from typing import Any, Callable, ... |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
"""Initial... | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
"""Initial... |
"""
Combine, reformat and trim single simulation trajectories.
Output: tracjectoriesDat including all outcome channels, and trajectoriesDat_trim including key channels only
If number of trajectories exceeds a specified limit, multiple trajectories in chunks will be returned.
"""
import argparse
import subprocess
import... | """
Combine, reformat and trim single simulation trajectories.
Output: tracjectoriesDat including all outcome channels, and trajectoriesDat_trim including key channels only
If number of trajectories exceeds a specified limit, multiple trajectories in chunks will be returned.
"""
import argparse
import subprocess
import... |
import errno
import glob
import json
import os
from queue import Queue
import shlex
import shutil
import stat
import subprocess
import threading
import time
from typing import Callable
import webbrowser
import bpy
import arm.assets as assets
from arm.exporter import ArmoryExporter
import arm.lib.make_datas
import arm... | import errno
import glob
import json
import os
from queue import Queue
import shlex
import shutil
import stat
import subprocess
import threading
import time
from typing import Callable
import webbrowser
import bpy
import arm.assets as assets
from arm.exporter import ArmoryExporter
import arm.lib.make_datas
import arm... |
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import logging
import os.path
from abc import ABCMeta, abstractmethod
from collections.abc import MutableSequence, MutableSet
from dataclasses import dataclass
from typing import Any, Call... | # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import logging
import os.path
from abc import ABCMeta, abstractmethod
from collections.abc import MutableSequence, MutableSet
from dataclasses import dataclass
from typing import Any, Call... |
import os
from typing import Any
from search_run.context import Context
from search_run.exceptions import CommandDoNotMatchException
from search_run.interpreter.base import BaseInterpreter
from search_run.interpreter.cmd import CmdInterpreter
class FileInterpreter(BaseInterpreter):
def __init__(self, cmd: Any, c... | import os
from typing import Any
from search_run.context import Context
from search_run.exceptions import CommandDoNotMatchException
from search_run.interpreter.base import BaseInterpreter
from search_run.interpreter.cmd import CmdInterpreter
class FileInterpreter(BaseInterpreter):
def __init__(self, cmd: Any, c... |
# -*- coding: utf-8 -*-
"""Non-graphical part of the Loop step in a SEAMM flowchart"""
import logging
from pathlib import Path
import re
import sys
import traceback
import psutil
import pprint
import loop_step
import seamm
import seamm_util
import seamm_util.printing as printing
from seamm_util.printing import Form... | # -*- coding: utf-8 -*-
"""Non-graphical part of the Loop step in a SEAMM flowchart"""
import logging
from pathlib import Path
import re
import sys
import traceback
import psutil
import pprint
import loop_step
import seamm
import seamm_util
import seamm_util.printing as printing
from seamm_util.printing import Form... |
import glob
import json
import copy
import importlib
import threading
import logging
import pytz
#for tables
import numpy
import numpy as np
import datetime
import dateutil.parser
import sys
import os
import time
import uuid
import hashlib
import random
import traceback
from dates import *
# type hints
from typing im... | import glob
import json
import copy
import importlib
import threading
import logging
import pytz
#for tables
import numpy
import numpy as np
import datetime
import dateutil.parser
import sys
import os
import time
import uuid
import hashlib
import random
import traceback
from dates import *
# type hints
from typing im... |
import random
def busqueda_binaria(lista, comienzo, final, objetivo):
print(f"buscando {objetivo} entre {lista[comienzo]} y {lista[final - 1]}")
if comienzo > final:
return False
medio = (comienzo + final) // 2
if lista[medio] == objetivo:
return True
elif lista[medio] < objetivo... | import random
def busqueda_binaria(lista, comienzo, final, objetivo):
print(f"buscando {objetivo} entre {lista[comienzo]} y {lista[final - 1]}")
if comienzo > final:
return False
medio = (comienzo + final) // 2
if lista[medio] == objetivo:
return True
elif lista[medio] < objetivo... |
import psutil
import os
import re
from enum import Enum
from .logical import Logic
from .detect import DetectBase
class DiskDetectMode(Enum):
PERCENT = {"name": "percent", "logic": Logic.GT}
USAGE = {"name": "usage", "logic": Logic.GT}
FREE = {"name": "free", "logic": Logic.LT}
class DiskTypeError(TypeE... | import psutil
import os
import re
from enum import Enum
from .logical import Logic
from .detect import DetectBase
class DiskDetectMode(Enum):
PERCENT = {"name": "percent", "logic": Logic.GT}
USAGE = {"name": "usage", "logic": Logic.GT}
FREE = {"name": "free", "logic": Logic.LT}
class DiskTypeError(TypeE... |
import discord
from discord.ext import commands
import requests
import asyncio
from os import environ
class HyLink(commands.Cog):
def __init__(self, bot: commands.Bot):
self.bot = bot
@commands.command(name="verify")
async def verify_(self, ctx):
await ctx.send("✉️ Instructions sent in ... | import discord
from discord.ext import commands
import requests
import asyncio
from os import environ
class HyLink(commands.Cog):
def __init__(self, bot: commands.Bot):
self.bot = bot
@commands.command(name="verify")
async def verify_(self, ctx):
await ctx.send("✉️ Instructions sent in ... |
"""
Start from a directory of images and solve for all of the particle positions, orientations, and forces.
"""
import numpy as np
import os
import cv2
import time
import pickle
import inspect
import ast
import tqdm
import matplotlib.pyplot as plt
from PIL import Image, ImageDraw
from IPython.display import clear_ou... | """
Start from a directory of images and solve for all of the particle positions, orientations, and forces.
"""
import numpy as np
import os
import cv2
import time
import pickle
import inspect
import ast
import tqdm
import matplotlib.pyplot as plt
from PIL import Image, ImageDraw
from IPython.display import clear_ou... |
import re
from .base import MetricsLayerBase
from .field import Field
from .set import Set
class View(MetricsLayerBase):
def __init__(self, definition: dict = {}, project=None) -> None:
if "sql_table_name" in definition:
definition["sql_table_name"] = self.resolve_sql_table_name(
... | import re
from .base import MetricsLayerBase
from .field import Field
from .set import Set
class View(MetricsLayerBase):
def __init__(self, definition: dict = {}, project=None) -> None:
if "sql_table_name" in definition:
definition["sql_table_name"] = self.resolve_sql_table_name(
... |
import numpy as np
import logging
from typing import Any, Optional, Text, List, Type, Dict, Tuple
import rasa.core.utils
from rasa.nlu.config import RasaNLUModelConfig
from rasa.nlu.components import Component, UnsupportedLanguageError
from rasa.nlu.featurizers.featurizer import DenseFeaturizer
from rasa.nlu.model im... | import numpy as np
import logging
from typing import Any, Optional, Text, List, Type, Dict, Tuple
import rasa.core.utils
from rasa.nlu.config import RasaNLUModelConfig
from rasa.nlu.components import Component, UnsupportedLanguageError
from rasa.nlu.featurizers.featurizer import DenseFeaturizer
from rasa.nlu.model im... |
#!/usr/bin/env python3
import argparse
import copy
from datetime import datetime
import json
import modulefinder
import os
import shutil
import signal
import subprocess
import sys
import tempfile
import torch
from torch.utils import cpp_extension
from torch.testing._internal.common_utils import TEST_WITH_ROCM, shell,... | #!/usr/bin/env python3
import argparse
import copy
from datetime import datetime
import json
import modulefinder
import os
import shutil
import signal
import subprocess
import sys
import tempfile
import torch
from torch.utils import cpp_extension
from torch.testing._internal.common_utils import TEST_WITH_ROCM, shell,... |
import json
from nonebot import logger
from omega_miya.utils.Omega_plugin_utils import HttpFetcher
from omega_miya.utils.Omega_Base import Result
from .request_utils import BiliRequestUtils
from .data_classes import BiliInfo, BiliResult
class BiliDynamic(object):
__DYNAMIC_DETAIL_API_URL = 'https://api.vc.bilibil... | import json
from nonebot import logger
from omega_miya.utils.Omega_plugin_utils import HttpFetcher
from omega_miya.utils.Omega_Base import Result
from .request_utils import BiliRequestUtils
from .data_classes import BiliInfo, BiliResult
class BiliDynamic(object):
__DYNAMIC_DETAIL_API_URL = 'https://api.vc.bilibil... |
from datetime import datetime, timedelta
from typing import Optional, Sequence, Union, overload
from polars import internals as pli
from polars.datatypes import py_type_to_dtype
from polars.utils import _datetime_to_pl_timestamp, _timedelta_to_pl_duration
try:
from polars.polars import concat_df as _concat_df
... | from datetime import datetime, timedelta
from typing import Optional, Sequence, Union, overload
from polars import internals as pli
from polars.datatypes import py_type_to_dtype
from polars.utils import _datetime_to_pl_timestamp, _timedelta_to_pl_duration
try:
from polars.polars import concat_df as _concat_df
... |
import sys
import os
import re
from glob import glob
from shutil import rmtree
from subprocess import run
from tools.pdocs import console, pdoc3serve, pdoc3, shipDocs
ORG = "annotation"
REPO = "text-fabric"
PKG = "tf"
PACKAGE = "text-fabric"
SCRIPT = "/Library/Frameworks/Python.framework/Versions/Current/bin/{PACKAG... | import sys
import os
import re
from glob import glob
from shutil import rmtree
from subprocess import run
from tools.pdocs import console, pdoc3serve, pdoc3, shipDocs
ORG = "annotation"
REPO = "text-fabric"
PKG = "tf"
PACKAGE = "text-fabric"
SCRIPT = "/Library/Frameworks/Python.framework/Versions/Current/bin/{PACKAG... |
from typing import Optional, Union
import arrow
import discord
from dateutil import parser
from discord.ext import commands
from bot.bot import Bot
from bot.utils.extensions import invoke_help_command
# https://discord.com/developers/docs/reference#message-formatting-timestamp-styles
STYLES = {
"Epoch": ("",),
... | from typing import Optional, Union
import arrow
import discord
from dateutil import parser
from discord.ext import commands
from bot.bot import Bot
from bot.utils.extensions import invoke_help_command
# https://discord.com/developers/docs/reference#message-formatting-timestamp-styles
STYLES = {
"Epoch": ("",),
... |
"""Module for wrapping Jina Hub API calls."""
import argparse
import glob
import json
import time
import urllib.parse
import urllib.request
import webbrowser
from typing import Dict, Any, List
from .checker import *
from .helper import credentials_file
from .hubapi.local import _list_local, _load_local_hub_manifest
f... | """Module for wrapping Jina Hub API calls."""
import argparse
import glob
import json
import time
import urllib.parse
import urllib.request
import webbrowser
from typing import Dict, Any, List
from .checker import *
from .helper import credentials_file
from .hubapi.local import _list_local, _load_local_hub_manifest
f... |
import os
import pickle
import sys
from os.path import join
from pathlib import Path
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from tensorboard.backend.event_processing.event_accumulator import EventAccumulator
from plots.plot_utils import set_matplotlib_params
from utils.utils import log, ... | import os
import pickle
import sys
from os.path import join
from pathlib import Path
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from tensorboard.backend.event_processing.event_accumulator import EventAccumulator
from plots.plot_utils import set_matplotlib_params
from utils.utils import log, ... |
"""
Import and reconstruction of sketch and extrude designs
from the Reconstruction Subset
"""
import adsk.core
import adsk.fusion
import traceback
import json
import os
import sys
import time
import math
from pathlib import Path
from collections import OrderedDict
import deserialize
class SketchExtrudeImporter()... | """
Import and reconstruction of sketch and extrude designs
from the Reconstruction Subset
"""
import adsk.core
import adsk.fusion
import traceback
import json
import os
import sys
import time
import math
from pathlib import Path
from collections import OrderedDict
import deserialize
class SketchExtrudeImporter()... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from copy import deepcopy
import numpy as np
from numpy.fft import fft
from scipy.optimize import least_squares
from scipy.signal.lti_conversion import abcd_normalize
from scipy.signal.ltisys import dlsim
from pyvib.common import lm, mmul_weight, weightfcn
from .lti_c... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from copy import deepcopy
import numpy as np
from numpy.fft import fft
from scipy.optimize import least_squares
from scipy.signal.lti_conversion import abcd_normalize
from scipy.signal.ltisys import dlsim
from pyvib.common import lm, mmul_weight, weightfcn
from .lti_c... |
"""Tests related to the spending process.
This includes the Spend creation, announcement, broadcast, tracking, managers interaction,
etc..
"""
import pytest
import random
from fixtures import *
from test_framework import serializations
from test_framework.utils import (
COIN,
POSTGRES_IS_SETUP,
RpcError,... | """Tests related to the spending process.
This includes the Spend creation, announcement, broadcast, tracking, managers interaction,
etc..
"""
import pytest
import random
from fixtures import *
from test_framework import serializations
from test_framework.utils import (
COIN,
POSTGRES_IS_SETUP,
RpcError,... |
import js2py, re, asyncio, random
from pyquery import PyQuery as pq
from bs4 import BeautifulSoup
from aiohttp import ClientSession
data = []
def getData():
global data
return data
def infoCallback(future):
global data
result = future.result()
src = result[0]
title = result... | import js2py, re, asyncio, random
from pyquery import PyQuery as pq
from bs4 import BeautifulSoup
from aiohttp import ClientSession
data = []
def getData():
global data
return data
def infoCallback(future):
global data
result = future.result()
src = result[0]
title = result... |
from typing import Optional
from cleo.helpers import argument
from poetry.console.commands.command import Command
class SourceShowCommand(Command):
name = "source show"
description = "Show information about sources configured for the project."
arguments = [
argument(
"source",
... | from typing import Optional
from cleo.helpers import argument
from poetry.console.commands.command import Command
class SourceShowCommand(Command):
name = "source show"
description = "Show information about sources configured for the project."
arguments = [
argument(
"source",
... |
import torch
import torch.cuda
import logging
import numpy as np
import pandas as pd
import random
from datetime import datetime
import os
import sys
sys.path.append('../../')
import click
from src.datasets.MURADataset import MURA_TrainValidTestSplitter, MURA_Dataset
from src.models.AE_DMSAD import AE_DMSAD
from src.m... | import torch
import torch.cuda
import logging
import numpy as np
import pandas as pd
import random
from datetime import datetime
import os
import sys
sys.path.append('../../')
import click
from src.datasets.MURADataset import MURA_TrainValidTestSplitter, MURA_Dataset
from src.models.AE_DMSAD import AE_DMSAD
from src.m... |
"""Load metadata from CSV files and export in JSON format."""
import os
import logging
from collections import namedtuple
from functools import lru_cache
from ons_csv_to_ctb_json_bilingual import BilingualDict, Bilingual
from ons_csv_to_ctb_json_read import Reader, required, optional
from ons_csv_to_ctb_json_geo import... | """Load metadata from CSV files and export in JSON format."""
import os
import logging
from collections import namedtuple
from functools import lru_cache
from ons_csv_to_ctb_json_bilingual import BilingualDict, Bilingual
from ons_csv_to_ctb_json_read import Reader, required, optional
from ons_csv_to_ctb_json_geo import... |
from collections import OrderedDict
from datetime import datetime
from os import PathLike
from pathlib import Path
from typing import Collection
import fiona.crs
import numpy
import rasterio
from rasterio.crs import CRS
from rasterio.enums import Resampling
import rasterio.features
import shapely
import shapely.geomet... | from collections import OrderedDict
from datetime import datetime
from os import PathLike
from pathlib import Path
from typing import Collection
import fiona.crs
import numpy
import rasterio
from rasterio.crs import CRS
from rasterio.enums import Resampling
import rasterio.features
import shapely
import shapely.geomet... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.