edited_code stringlengths 17 978k | original_code stringlengths 17 978k |
|---|---|
# Author: Christian Brodbeck <christianbrodbeck@nyu.edu>
from collections import defaultdict
import difflib
from functools import reduce
from glob import glob
from itertools import chain, product
import operator
import os
import re
import shutil
import subprocess
from time import localtime, strftime
import traceback
i... | # Author: Christian Brodbeck <christianbrodbeck@nyu.edu>
from collections import defaultdict
import difflib
from functools import reduce
from glob import glob
from itertools import chain, product
import operator
import os
import re
import shutil
import subprocess
from time import localtime, strftime
import traceback
i... |
import sys
from CodeAnalysis.Syntax.syntaxkind import SyntaxKind
import colorama, termcolor
colorama.init()
class Parser:
def __init__(self, token_list, debug=False):
self.token_list = token_list
self.position = -1
self.debug = debug
# ----
self.symbols = set()
sel... | import sys
from CodeAnalysis.Syntax.syntaxkind import SyntaxKind
import colorama, termcolor
colorama.init()
class Parser:
def __init__(self, token_list, debug=False):
self.token_list = token_list
self.position = -1
self.debug = debug
# ----
self.symbols = set()
sel... |
"""
The :mod:`sklearnext.preprocessing.oversampling.kmeans_smote`
contains the implementation of the K-Means SMOTE oversampler.
"""
# Authors: Felix Last
# Georgios Douzas <gdouzas@icloud.com>
# License: BSD 3 clause
import warnings
import copy
import numpy as np
from sklearn.metrics.pairwise import euclidea... | """
The :mod:`sklearnext.preprocessing.oversampling.kmeans_smote`
contains the implementation of the K-Means SMOTE oversampler.
"""
# Authors: Felix Last
# Georgios Douzas <gdouzas@icloud.com>
# License: BSD 3 clause
import warnings
import copy
import numpy as np
from sklearn.metrics.pairwise import euclidea... |
# Owner(s): ["module: __torch_function__"]
import torch
import numpy as np
import inspect
import functools
import pprint
import pickle
import collections
import unittest
from torch.testing._internal.common_utils import TestCase, run_tests
from torch.overrides import (
handle_torch_function,
has_torch_function... | # Owner(s): ["module: __torch_function__"]
import torch
import numpy as np
import inspect
import functools
import pprint
import pickle
import collections
import unittest
from torch.testing._internal.common_utils import TestCase, run_tests
from torch.overrides import (
handle_torch_function,
has_torch_function... |
from bs4 import PageElement, Tag
from .options import Options
from .utils.soup_util import clone_element
def make_indexes(soup: PageElement, options: Options) -> None:
""" Generate ordered chapter number and TOC of document.
Arguments:
soup {BeautifulSoup} -- DOM object of Document.
options ... | from bs4 import PageElement, Tag
from .options import Options
from .utils.soup_util import clone_element
def make_indexes(soup: PageElement, options: Options) -> None:
""" Generate ordered chapter number and TOC of document.
Arguments:
soup {BeautifulSoup} -- DOM object of Document.
options ... |
import argparse
from datetime import datetime
import yfinance as yf
import pandas as pd
from gamestonk_terminal.dataframe_helpers import clean_df_index
from gamestonk_terminal.helper_funcs import (
long_number_format,
parse_known_args_and_warn,
)
def info(l_args, s_ticker):
parser = argparse.ArgumentParse... | import argparse
from datetime import datetime
import yfinance as yf
import pandas as pd
from gamestonk_terminal.dataframe_helpers import clean_df_index
from gamestonk_terminal.helper_funcs import (
long_number_format,
parse_known_args_and_warn,
)
def info(l_args, s_ticker):
parser = argparse.ArgumentParse... |
import logging
import os
import sys
import configargparse
import yaml
from GramAddict.core.plugin_loader import PluginLoader
logger = logging.getLogger(__name__)
class Config:
def __init__(self, first_run=False, **kwargs):
if kwargs:
self.args = kwargs
self.module = True
... | import logging
import os
import sys
import configargparse
import yaml
from GramAddict.core.plugin_loader import PluginLoader
logger = logging.getLogger(__name__)
class Config:
def __init__(self, first_run=False, **kwargs):
if kwargs:
self.args = kwargs
self.module = True
... |
import re
class Rule:
def __init__(self, line):
line = line.strip().split(" contain ")
line[1] = line[1].strip(".").split(", ")
self.contents = {}
for item in line[1]:
# Grab that number out in front
regex = re.compile(r"[0-9]+")
# If we didn't f... | import re
class Rule:
def __init__(self, line):
line = line.strip().split(" contain ")
line[1] = line[1].strip(".").split(", ")
self.contents = {}
for item in line[1]:
# Grab that number out in front
regex = re.compile(r"[0-9]+")
# If we didn't f... |
import glob
import os
import numpy as np
from unyt import dimensions, unyt_array
from unyt.unit_registry import UnitRegistry
from yt.data_objects.time_series import DatasetSeries, SimulationTimeSeries
from yt.funcs import only_on_root
from yt.loaders import load
from yt.utilities.cosmology import Cosmology
from yt.ut... | import glob
import os
import numpy as np
from unyt import dimensions, unyt_array
from unyt.unit_registry import UnitRegistry
from yt.data_objects.time_series import DatasetSeries, SimulationTimeSeries
from yt.funcs import only_on_root
from yt.loaders import load
from yt.utilities.cosmology import Cosmology
from yt.ut... |
from discord.ext import commands
import re
import discord
import random
import typing
import emoji
import unicodedata
import textwrap
import contextlib
import io
import asyncio
import async_tio
import itertools
import os
import base64
import secrets
import utils
from difflib import SequenceMatcher
from discord.ext.comm... | from discord.ext import commands
import re
import discord
import random
import typing
import emoji
import unicodedata
import textwrap
import contextlib
import io
import asyncio
import async_tio
import itertools
import os
import base64
import secrets
import utils
from difflib import SequenceMatcher
from discord.ext.comm... |
"""
Automatically document Augmax augmentations
including sample outputs
"""
from docutils import nodes
from sphinx.ext.autodoc.directive import AutodocDirective
import jax
import jax.numpy as jnp
import json
import augmax
from imageio import imread, imwrite
from pathlib import Path
import inspect
SEED = 42
N_IMGS =... | """
Automatically document Augmax augmentations
including sample outputs
"""
from docutils import nodes
from sphinx.ext.autodoc.directive import AutodocDirective
import jax
import jax.numpy as jnp
import json
import augmax
from imageio import imread, imwrite
from pathlib import Path
import inspect
SEED = 42
N_IMGS =... |
import sys
sys.path.append("components/summarizer/pointer-generator")
import components.summarizer.summarizer_utils as sutils
import components.summarizer.story_converter as sconv
import pickle
import nltk.tokenize as tokenize
import os
from nltk.tokenize.moses import MosesDetokenizer
# Define which articles you want... | import sys
sys.path.append("components/summarizer/pointer-generator")
import components.summarizer.summarizer_utils as sutils
import components.summarizer.story_converter as sconv
import pickle
import nltk.tokenize as tokenize
import os
from nltk.tokenize.moses import MosesDetokenizer
# Define which articles you want... |
import logging
from concurrent.futures import ThreadPoolExecutor
import pytest
from functools import partial
from ocs_ci.framework.testlib import ManageTest, tier4, tier4c
from ocs_ci.ocs import constants
from ocs_ci.ocs.resources.pod import (
get_mds_pods,
get_mon_pods,
get_mgr_pods,
get_osd_pods,
... | import logging
from concurrent.futures import ThreadPoolExecutor
import pytest
from functools import partial
from ocs_ci.framework.testlib import ManageTest, tier4, tier4c
from ocs_ci.ocs import constants
from ocs_ci.ocs.resources.pod import (
get_mds_pods,
get_mon_pods,
get_mgr_pods,
get_osd_pods,
... |
import os
import sys
__all__ = [
"load_module",
"mytest_the_file",
]
def load_module(file_path, module_name=None):
"""
Load a module by name and search path
This function should work with python 2.7 and 3.x
Returns None if Module could not be loaded.
"""
if module_name is None:
... | import os
import sys
__all__ = [
"load_module",
"mytest_the_file",
]
def load_module(file_path, module_name=None):
"""
Load a module by name and search path
This function should work with python 2.7 and 3.x
Returns None if Module could not be loaded.
"""
if module_name is None:
... |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... |
import asyncio
from aiovk.longpoll import BotsLongPoll
import os
from aiovk import TokenSession, API
from dotenv import load_dotenv
from utils.message import Message
from vk_bot.bot import VkBot
load_dotenv()
ses = TokenSession(access_token=str(os.getenv('BOT_VK_KEY')))
api = API(ses)
lp = BotsLongPoll(api, int(os.... | import asyncio
from aiovk.longpoll import BotsLongPoll
import os
from aiovk import TokenSession, API
from dotenv import load_dotenv
from utils.message import Message
from vk_bot.bot import VkBot
load_dotenv()
ses = TokenSession(access_token=str(os.getenv('BOT_VK_KEY')))
api = API(ses)
lp = BotsLongPoll(api, int(os.... |
import os
import subprocess
from utils import pColors, checkService, pullDockerImage, updateComposeFile, abort
def create_php_container(dockerClient):
print(f"{pColors.HEADER}Creating the {os.getenv("PHP_IMAGE")} container (2/4){pColors.ENDC}")
# Here' we're pulling the needed image from Docker Hub
# I... | import os
import subprocess
from utils import pColors, checkService, pullDockerImage, updateComposeFile, abort
def create_php_container(dockerClient):
print(f"{pColors.HEADER}Creating the {os.getenv('PHP_IMAGE')} container (2/4){pColors.ENDC}")
# Here' we're pulling the needed image from Docker Hub
# I... |
from functools import reduce
import numpy as np
import random as r
import socket
import struct
import subprocess as sp
import threading
from threading import Thread
import ast
import time
import datetime as dt
import os
import psutil
from netifaces import interfaces, ifaddresses, AF_INET
import paho.mqtt.client as mqtt... | from functools import reduce
import numpy as np
import random as r
import socket
import struct
import subprocess as sp
import threading
from threading import Thread
import ast
import time
import datetime as dt
import os
import psutil
from netifaces import interfaces, ifaddresses, AF_INET
import paho.mqtt.client as mqtt... |
import logging
from pathlib import Path
import re
import scipy.stats as ss
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import statsmodels.stats.multitest as multitest
import sklearn.metrics
from intermine.webservice import Service
import biclust_comp.utils as utils
def plot_sample_enrichm... | import logging
from pathlib import Path
import re
import scipy.stats as ss
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import statsmodels.stats.multitest as multitest
import sklearn.metrics
from intermine.webservice import Service
import biclust_comp.utils as utils
def plot_sample_enrichm... |
from src.dataToCode.languages.classToCode import ClassToCode
from src.dataToCode.dataClasses.classData import ClassData
from src.dataToCode.dataClasses.modifier import Modifier
from src.dataToCode.languages.ToJava.methodToJava import MethodToJava
from src.dataToCode.languages.ToJava.interfaceToJava import InterfaceToJa... | from src.dataToCode.languages.classToCode import ClassToCode
from src.dataToCode.dataClasses.classData import ClassData
from src.dataToCode.dataClasses.modifier import Modifier
from src.dataToCode.languages.ToJava.methodToJava import MethodToJava
from src.dataToCode.languages.ToJava.interfaceToJava import InterfaceToJa... |
import io
import uuid
import pytz
import json
import logging
import pandas as pd
from constance import config
from django.db import models
from django.contrib.postgres.fields import ArrayField, JSONField
from django.core.validators import (
int_list_validator,
MinValueValidator,
)
from django.db.models.signals ... | import io
import uuid
import pytz
import json
import logging
import pandas as pd
from constance import config
from django.db import models
from django.contrib.postgres.fields import ArrayField, JSONField
from django.core.validators import (
int_list_validator,
MinValueValidator,
)
from django.db.models.signals ... |
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Lin To and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class PurchaseInvoice(Document):
def validate(self):
self.validate_account_types()
... | # -*- coding: utf-8 -*-
# Copyright (c) 2021, Lin To and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class PurchaseInvoice(Document):
def validate(self):
self.validate_account_types()
... |
import json
import re
import string
from typing import List, Dict
import requests
from bs4 import BeautifulSoup
TG_CORE_TYPES = ["String", "Boolean", "Integer", "Float"]
API_URL = "https://core.telegram.org/bots/api"
METHODS = "methods"
TYPES = "types"
def retrieve_api_info() -> Dict:
r = requests.get(API_URL)... | import json
import re
import string
from typing import List, Dict
import requests
from bs4 import BeautifulSoup
TG_CORE_TYPES = ["String", "Boolean", "Integer", "Float"]
API_URL = "https://core.telegram.org/bots/api"
METHODS = "methods"
TYPES = "types"
def retrieve_api_info() -> Dict:
r = requests.get(API_URL)... |
import pandas as pd
import numpy as np
def write_lookup_function(name, x_key, y_key):
code = f"""
function {name}
input Real x;
output Real y;
algorithm
for i in 1:size({x_key}, 1) loop
if {x_key}[i+1] > x then
y := {y_key}[i] + (x - {x_key}[i]) * ({y_key}[i] - {y_key}[i + 1]) / ({x_key}[i] - {x_ke... | import pandas as pd
import numpy as np
def write_lookup_function(name, x_key, y_key):
code = f"""
function {name}
input Real x;
output Real y;
algorithm
for i in 1:size({x_key}, 1) loop
if {x_key}[i+1] > x then
y := {y_key}[i] + (x - {x_key}[i]) * ({y_key}[i] - {y_key}[i + 1]) / ({x_key}[i] - {x_ke... |
import argparse
import logging
import sys
from .fetch import download_fns
logger = logging.getLogger("mne")
AVAILABLE_DATASETS = set(download_fns.keys())
def download_dataset(output_dir, n_first=None, cohort="eegbci"):
download_fns[cohort](output_dir, n_first)
if __name__ == "__main__":
parser = argpa... | import argparse
import logging
import sys
from .fetch import download_fns
logger = logging.getLogger("mne")
AVAILABLE_DATASETS = set(download_fns.keys())
def download_dataset(output_dir, n_first=None, cohort="eegbci"):
download_fns[cohort](output_dir, n_first)
if __name__ == "__main__":
parser = argpa... |
import re
from collections import defaultdict
from datetime import date, timedelta
from operator import attrgetter
from cachetools import cachedmethod, keys
from ._provider import Provider
class CurrencyLayer(Provider):
"""
Real-time service with free plan for 250 requests per month.
Implicit base curre... | import re
from collections import defaultdict
from datetime import date, timedelta
from operator import attrgetter
from cachetools import cachedmethod, keys
from ._provider import Provider
class CurrencyLayer(Provider):
"""
Real-time service with free plan for 250 requests per month.
Implicit base curre... |
# 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.
import logging
import multiprocessing
from collections import deque
from contextlib import contextmanager
from enum import Enum
from itertools ... | # 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.
import logging
import multiprocessing
from collections import deque
from contextlib import contextmanager
from enum import Enum
from itertools ... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... |
#!/usr/bin/env python
#
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import json
import logging
import os
import tempfile
import time
from typing import Any, Dict, List, Optional, Tuple, Union
from urllib.parse import urlparse
from uuid import UUID
import jmespath
from azure.applicationins... | #!/usr/bin/env python
#
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import json
import logging
import os
import tempfile
import time
from typing import Any, Dict, List, Optional, Tuple, Union
from urllib.parse import urlparse
from uuid import UUID
import jmespath
from azure.applicationins... |
# SPDX-License-Identifier: MIT
# Copyright (c) 2019 Akumatic
#
# https://adventofcode.com/2019/day/5
import sys, os
sys.path.insert(1, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import intcode, intcode_test
def readFile() -> list:
with open(f"{__file__.rstrip("code.py")}input.txt", "r") as f:
... | # SPDX-License-Identifier: MIT
# Copyright (c) 2019 Akumatic
#
# https://adventofcode.com/2019/day/5
import sys, os
sys.path.insert(1, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import intcode, intcode_test
def readFile() -> list:
with open(f"{__file__.rstrip('code.py')}input.txt", "r") as f:
... |
from typing import Union, Dict, Optional, Any, IO, TYPE_CHECKING
from thinc.api import Config, fix_random_seed, set_gpu_allocator
from thinc.api import ConfigValidationError
from pathlib import Path
import srsly
import numpy
import tarfile
import gzip
import zipfile
import tqdm
from .pretrain import get_tok2vec_ref
fr... | from typing import Union, Dict, Optional, Any, IO, TYPE_CHECKING
from thinc.api import Config, fix_random_seed, set_gpu_allocator
from thinc.api import ConfigValidationError
from pathlib import Path
import srsly
import numpy
import tarfile
import gzip
import zipfile
import tqdm
from .pretrain import get_tok2vec_ref
fr... |
import copy
import json
import os
import re
import warnings
from collections import OrderedDict, UserDict
from contextlib import contextmanager
from dataclasses import dataclass, field
from typing import TYPE_CHECKING, Any, Dict, List, NamedTuple, Optional, Sequence, Tuple, Union
import numpy as np
from packaging impo... | import copy
import json
import os
import re
import warnings
from collections import OrderedDict, UserDict
from contextlib import contextmanager
from dataclasses import dataclass, field
from typing import TYPE_CHECKING, Any, Dict, List, NamedTuple, Optional, Sequence, Tuple, Union
import numpy as np
from packaging impo... |
#!/usr/bin/env python3
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
A script to check that the executables produced by gitian only contain
certain symbols and are only linked aga... | #!/usr/bin/env python3
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
A script to check that the executables produced by gitian only contain
certain symbols and are only linked aga... |
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license
"""
Common modules
"""
import logging
import math
import warnings
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 i... | # YOLOv5 🚀 by Ultralytics, GPL-3.0 license
"""
Common modules
"""
import logging
import math
import warnings
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 i... |
#!/usr/bin/env python
from __future__ import print_function
import utils
from accesslink import AccessLink
from datetime import datetime
try:
input = raw_input
except NameError:
pass
CONFIG_FILENAME = 'config.yml'
class PolarAccessLinkExample(object):
"""Example application for Polar Open AccessLink ... | #!/usr/bin/env python
from __future__ import print_function
import utils
from accesslink import AccessLink
from datetime import datetime
try:
input = raw_input
except NameError:
pass
CONFIG_FILENAME = 'config.yml'
class PolarAccessLinkExample(object):
"""Example application for Polar Open AccessLink ... |
# Copyright 2021 EMQ Technologies Co., Ltd.
#
# 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 a... | # Copyright 2021 EMQ Technologies Co., Ltd.
#
# 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 a... |
import subprocess
import click
import scphylo as scp
from scphylo.ul._servers import cmd, write_cmds_get_main
@click.command(short_help="Run MuTect2.")
@click.argument(
"outdir",
required=True,
type=click.Path(
exists=True, file_okay=False, dir_okay=True, readable=True, resolve_path=True
),
... | import subprocess
import click
import scphylo as scp
from scphylo.ul._servers import cmd, write_cmds_get_main
@click.command(short_help="Run MuTect2.")
@click.argument(
"outdir",
required=True,
type=click.Path(
exists=True, file_okay=False, dir_okay=True, readable=True, resolve_path=True
),
... |
#!/usr/bin/env python
import csv
import datetime
from argparse import Namespace
from pathlib import Path
from ignite.engine import Events, create_supervised_trainer, create_supervised_evaluator
from ignite.metrics import RunningAverage
from ignite.handlers import EarlyStopping, ModelCheckpoint, Timer
from ignite.cont... | #!/usr/bin/env python
import csv
import datetime
from argparse import Namespace
from pathlib import Path
from ignite.engine import Events, create_supervised_trainer, create_supervised_evaluator
from ignite.metrics import RunningAverage
from ignite.handlers import EarlyStopping, ModelCheckpoint, Timer
from ignite.cont... |
#! /usr/bin/python3
import logging
import multiprocessing
from concurrent.futures.thread import ThreadPoolExecutor
from multiprocessing import Process
import statsd
import Adafruit_DHT
import time
import boto3
import sys
import subprocess
import os
from timeit import default_timer as timer
from threading import Thread
... | #! /usr/bin/python3
import logging
import multiprocessing
from concurrent.futures.thread import ThreadPoolExecutor
from multiprocessing import Process
import statsd
import Adafruit_DHT
import time
import boto3
import sys
import subprocess
import os
from timeit import default_timer as timer
from threading import Thread
... |
# 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 output import log_qs_summary, log_query_results
from display import display_qs_summary, display_qs_results
from executors import ParallelQSExecutor, SerialQSExecutor
class TestMode():
def __init__(self,config, options):
self.config = config
self.options = options
self.verbose = options... | from output import log_qs_summary, log_query_results
from display import display_qs_summary, display_qs_results
from executors import ParallelQSExecutor, SerialQSExecutor
class TestMode():
def __init__(self,config, options):
self.config = config
self.options = options
self.verbose = options... |
"""
difference.py
Visualize the difference between the python and the cython file.
"""
import difflib
import os
# name, path to python file, path to cython file
files = [
('multi environment', 'environment/env_multi.py', 'environment/cy/env_multi_cy.pyx'),
('game', 'environment/entities/game.py', 'environment... | """
difference.py
Visualize the difference between the python and the cython file.
"""
import difflib
import os
# name, path to python file, path to cython file
files = [
('multi environment', 'environment/env_multi.py', 'environment/cy/env_multi_cy.pyx'),
('game', 'environment/entities/game.py', 'environment... |
# 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 in writing, software
# distributed under th... | # 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 in writing, software
# distributed under th... |
import typing
from werkzeug.serving import run_simple
from werkzeug.wrappers import Request, Response
from json import dumps
from warnings import warn
from .models import Node, APIRequest, APIResponse
__all__ = (
"API",
"HTTP_METHODS",
"ALLOWED_LIBS",
)
HTTP_METHODS = [
"GET",
"HEAD",
"POS... | import typing
from werkzeug.serving import run_simple
from werkzeug.wrappers import Request, Response
from json import dumps
from warnings import warn
from .models import Node, APIRequest, APIResponse
__all__ = (
"API",
"HTTP_METHODS",
"ALLOWED_LIBS",
)
HTTP_METHODS = [
"GET",
"HEAD",
"POS... |
import logging
from collections import defaultdict
from enum import Enum
from typing import Dict, List
from requests import Response
from requests.exceptions import RequestException
from dagster import Failure, RetryRequested
from dagster.core.execution.context.compute import SolidExecutionContext
def fmt_rpc_logs(... | import logging
from collections import defaultdict
from enum import Enum
from typing import Dict, List
from requests import Response
from requests.exceptions import RequestException
from dagster import Failure, RetryRequested
from dagster.core.execution.context.compute import SolidExecutionContext
def fmt_rpc_logs(... |
import copy
import os
import re
from textwrap import dedent
from typing import Any, Dict, List, Optional, Set, Tuple, cast
from unittest import mock
import orjson
from django.conf import settings
from django.test import override_settings
from markdown import Markdown
from zerver.lib.actions import (
change_user_i... | import copy
import os
import re
from textwrap import dedent
from typing import Any, Dict, List, Optional, Set, Tuple, cast
from unittest import mock
import orjson
from django.conf import settings
from django.test import override_settings
from markdown import Markdown
from zerver.lib.actions import (
change_user_i... |
import nix_ffi
import os
import pytest
def get_projects_to_test():
tests = nix_ffi.eval(
'subsystems.allTranslators',
wrapper_code = '''
{result}: let
lib = (import <nixpkgs> {}).lib;
l = lib // builtins;
in
l.flatten (
l.map
(
translator:
... | import nix_ffi
import os
import pytest
def get_projects_to_test():
tests = nix_ffi.eval(
'subsystems.allTranslators',
wrapper_code = '''
{result}: let
lib = (import <nixpkgs> {}).lib;
l = lib // builtins;
in
l.flatten (
l.map
(
translator:
... |
"""GraphQL base controller"""
from abc import ABCMeta, abstractmethod
import asyncio
from cgi import parse_multipart
from datetime import datetime
from functools import partial
import io
import logging
from typing import (
Any,
AsyncIterable,
Callable,
Dict,
List,
Mapping,
Optional,
Tup... | """GraphQL base controller"""
from abc import ABCMeta, abstractmethod
import asyncio
from cgi import parse_multipart
from datetime import datetime
from functools import partial
import io
import logging
from typing import (
Any,
AsyncIterable,
Callable,
Dict,
List,
Mapping,
Optional,
Tup... |
import re
import os
import json
import warnings
from sys import argv
from getopt import getopt
from typing import Union
from subprocess import Popen
DEVNULL = open(os.devnull, 'w')
CONFIG = {}
CONFIG_PATH = "config.json"
FORMAT_VIDEO_NAME = "{i}、{title}-{name}"
class BiLiVideoConvert:
def __init__(self, input_d... | import re
import os
import json
import warnings
from sys import argv
from getopt import getopt
from typing import Union
from subprocess import Popen
DEVNULL = open(os.devnull, 'w')
CONFIG = {}
CONFIG_PATH = "config.json"
FORMAT_VIDEO_NAME = "{i}、{title}-{name}"
class BiLiVideoConvert:
def __init__(self, input_d... |
#!/usr/bin/env python3
"""
Kim Brugger (25 Sep 2020), contact: kim@brugger.dk
"""
import socket
import subprocess
import argparse
import shlex
import json
import datetime
states = {'active': 1,
'inactive': 2,
'activating': 3,
'deactivating': 4,
'failed': 5,
'not-fo... | #!/usr/bin/env python3
"""
Kim Brugger (25 Sep 2020), contact: kim@brugger.dk
"""
import socket
import subprocess
import argparse
import shlex
import json
import datetime
states = {'active': 1,
'inactive': 2,
'activating': 3,
'deactivating': 4,
'failed': 5,
'not-fo... |
#!/usr/bin/env python
def parseBags(lines: list) -> dict:
lines = [l.split(' contain ') for l in lines]
bags = {}
for line in lines:
outer = line[0][:line[0].index('bags') - 1]
inner = {}
if 'no other' not in line[1]:
for each in line[1].split(','):
each... | #!/usr/bin/env python
def parseBags(lines: list) -> dict:
lines = [l.split(' contain ') for l in lines]
bags = {}
for line in lines:
outer = line[0][:line[0].index('bags') - 1]
inner = {}
if 'no other' not in line[1]:
for each in line[1].split(','):
each... |
#!/usr/bin/env python3
import itertools
import sys
from time import sleep, time
import numpy as np
import pygame
from pygame.colordict import THECOLORS as colors
def load_image(name):
image = pygame.image.load(name).convert_alpha()
return image
def get_food_sprite():
image = load_image("./renderer/spr... | #!/usr/bin/env python3
import itertools
import sys
from time import sleep, time
import numpy as np
import pygame
from pygame.colordict import THECOLORS as colors
def load_image(name):
image = pygame.image.load(name).convert_alpha()
return image
def get_food_sprite():
image = load_image("./renderer/spr... |
"""
Coding Bot v4
~~~~~~~~~~~~~~~~~~
This file contains elements that are under the following licenses:
Copyright (c) 2015 Rapptz
license MIT, see
https://github.com/Rapptz/RoboDanny/blob/e1c3c28fe20eb192463f7fc224a399141f0d915d/LICENSE.txt
for more details.
"""
import discord
import time
import asyncio
import datetim... | """
Coding Bot v4
~~~~~~~~~~~~~~~~~~
This file contains elements that are under the following licenses:
Copyright (c) 2015 Rapptz
license MIT, see
https://github.com/Rapptz/RoboDanny/blob/e1c3c28fe20eb192463f7fc224a399141f0d915d/LICENSE.txt
for more details.
"""
import discord
import time
import asyncio
import datetim... |
#!/usr/bin/python3
import json
import os
import copy
from collections import defaultdict
from distutils.version import LooseVersion
from pathlib import Path
from typing import Any, Dict, List, Tuple, Union, Optional
COLOR_VALUES = [
'#10a100',
'#7ead14',
'#bab73c',
'#e8c268',
'#e59838',
'#e36... | #!/usr/bin/python3
import json
import os
import copy
from collections import defaultdict
from distutils.version import LooseVersion
from pathlib import Path
from typing import Any, Dict, List, Tuple, Union, Optional
COLOR_VALUES = [
'#10a100',
'#7ead14',
'#bab73c',
'#e8c268',
'#e59838',
'#e36... |
# -*- coding: utf-8 -*-
# There are tests here with unicode string literals and
# identifiers. There's a code in ast.c that was added because of a
# failure with a non-ascii-only expression. So, I have tests for
# that. There are workarounds that would let me run tests for that
# code without unicode identifiers... | # -*- coding: utf-8 -*-
# There are tests here with unicode string literals and
# identifiers. There's a code in ast.c that was added because of a
# failure with a non-ascii-only expression. So, I have tests for
# that. There are workarounds that would let me run tests for that
# code without unicode identifiers... |
import json
import logging
from pathlib import Path
import re
import numpy as np
import mtscomp
from brainbox.core import Bunch
from ibllib.ephys import neuropixel as neuropixel
from ibllib.io import hashfile
SAMPLE_SIZE = 2 # int16
DEFAULT_BATCH_SIZE = 1e6
_logger = logging.getLogger('ibllib')
class Reader:
... | import json
import logging
from pathlib import Path
import re
import numpy as np
import mtscomp
from brainbox.core import Bunch
from ibllib.ephys import neuropixel as neuropixel
from ibllib.io import hashfile
SAMPLE_SIZE = 2 # int16
DEFAULT_BATCH_SIZE = 1e6
_logger = logging.getLogger('ibllib')
class Reader:
... |
from datetime import datetime, timedelta
from pathlib import Path
from pytils.translit import slugify
from appliances.data import (COMPANY_NAME, MANAGER_NAME, CONTACT_PHONE,
ADDRESS, CATEGORY, GOODS_TYPE, AD_TYPE,
get_description, CONDITION, PHOTO_STORAGE,
... | from datetime import datetime, timedelta
from pathlib import Path
from pytils.translit import slugify
from appliances.data import (COMPANY_NAME, MANAGER_NAME, CONTACT_PHONE,
ADDRESS, CATEGORY, GOODS_TYPE, AD_TYPE,
get_description, CONDITION, PHOTO_STORAGE,
... |
import os
import requests
import sqlite3,csv
import click
from flask import current_app
#from flask import cli (inutile ?)
from flask.cli import with_appcontext
'''
Mode BOURRIN
Je fais une connection globale pour l'application, contrairement au tuto qui fait une connexion dans g (donc si j'ai bien compris par reques... | import os
import requests
import sqlite3,csv
import click
from flask import current_app
#from flask import cli (inutile ?)
from flask.cli import with_appcontext
'''
Mode BOURRIN
Je fais une connection globale pour l'application, contrairement au tuto qui fait une connexion dans g (donc si j'ai bien compris par reques... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import os
from pathlib import Path
from typing import Any, Dict, cast
from unittest.case import TestCase
from lisa import secret, variable
from lisa.util import LisaException, constants
from lisa.util.logger import get_logger
class VariableTes... | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import os
from pathlib import Path
from typing import Any, Dict, cast
from unittest.case import TestCase
from lisa import secret, variable
from lisa.util import LisaException, constants
from lisa.util.logger import get_logger
class VariableTes... |
# -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2020-05-08 20:51
import functools
import os
from typing import Union, Any, List
import torch
from alnlp.modules.util import lengths_to_mask
from torch import nn
from torch.optim import Adam
from torch.optim.lr_scheduler import ExponentialLR
from torch.utils.data import D... | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2020-05-08 20:51
import functools
import os
from typing import Union, Any, List
import torch
from alnlp.modules.util import lengths_to_mask
from torch import nn
from torch.optim import Adam
from torch.optim.lr_scheduler import ExponentialLR
from torch.utils.data import D... |
from dataclasses import dataclass
from typing import Dict, List, Optional, Tuple
import aiosqlite
from chia.consensus.block_record import BlockRecord
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.types.blockchain_format.sub_epoch_summary import SubEpochSummary
from chia.types.coin_spend impor... | from dataclasses import dataclass
from typing import Dict, List, Optional, Tuple
import aiosqlite
from chia.consensus.block_record import BlockRecord
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.types.blockchain_format.sub_epoch_summary import SubEpochSummary
from chia.types.coin_spend impor... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
"""
To run this flow:
```python forecasting_flow.py --environment=conda run```
"""
from functools import partial
from metaflow import (
Flow,
FlowSpec,
IncludeFile,
Parameter,
batch,
conda,
conda_base,
get_metadata,
parallel_map,
step,
)
from pip_decorator import pip
from fore... | """
To run this flow:
```python forecasting_flow.py --environment=conda run```
"""
from functools import partial
from metaflow import (
Flow,
FlowSpec,
IncludeFile,
Parameter,
batch,
conda,
conda_base,
get_metadata,
parallel_map,
step,
)
from pip_decorator import pip
from fore... |
#!/bin/env python3
import feedparser
import argparse
import os
from os import path, getcwd
import xml.etree.ElementTree as ET
from io import IOBase
import json
import requests
import time
from configparser import ConfigParser
import re
import logging
# ----- ----- ----- ----- -----
class podqueue():... | #!/bin/env python3
import feedparser
import argparse
import os
from os import path, getcwd
import xml.etree.ElementTree as ET
from io import IOBase
import json
import requests
import time
from configparser import ConfigParser
import re
import logging
# ----- ----- ----- ----- -----
class podqueue():... |
# type: ignore
# flake8: noqa
"""Backport of Python3.7 dataclasses Library
Taken directly from here: https://github.com/ericvsmith/dataclasses
Licensed under the Apache License: https://github.com/ericvsmith/dataclasses/blob/master/LICENSE.txt
Needed due to isorts strict no non-optional requirements stance.
TODO: Re... | # type: ignore
# flake8: noqa
"""Backport of Python3.7 dataclasses Library
Taken directly from here: https://github.com/ericvsmith/dataclasses
Licensed under the Apache License: https://github.com/ericvsmith/dataclasses/blob/master/LICENSE.txt
Needed due to isorts strict no non-optional requirements stance.
TODO: Re... |
import discord
from discord import member
from discord.ext import commands
from mysqldb import *
import asyncio
from extra.useful_variables import list_of_commands
from extra.prompt.menu import Confirm
from extra.view import ReportSupportView
from typing import List, Dict, Optional
import os
case_cat_id = int(os.geten... | import discord
from discord import member
from discord.ext import commands
from mysqldb import *
import asyncio
from extra.useful_variables import list_of_commands
from extra.prompt.menu import Confirm
from extra.view import ReportSupportView
from typing import List, Dict, Optional
import os
case_cat_id = int(os.geten... |
from typing import TYPE_CHECKING, Dict, Any, Tuple, Callable, List, Optional, IO
from wasabi import Printer
import tqdm
import sys
from ..util import registry
from .. import util
from ..errors import Errors
if TYPE_CHECKING:
from ..language import Language # noqa: F401
def setup_table(
*, cols: List[str], ... | from typing import TYPE_CHECKING, Dict, Any, Tuple, Callable, List, Optional, IO
from wasabi import Printer
import tqdm
import sys
from ..util import registry
from .. import util
from ..errors import Errors
if TYPE_CHECKING:
from ..language import Language # noqa: F401
def setup_table(
*, cols: List[str], ... |
# 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... |
# Copyright (c) 2021 PaddlePaddle Authors. 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 appli... | # Copyright (c) 2021 PaddlePaddle Authors. 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 appli... |
"""JSON-rpc proxy model for BIG-Bench."""
# Copyright 2021 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 b... | """JSON-rpc proxy model for BIG-Bench."""
# Copyright 2021 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 b... |
import time
import fastapi
import uvicorn
import logging
import os
from process_doc import process_image
from models.document_model import DocumentModel
from pdf2jpg import pdf2jpg
from datetime import datetime
logs_folder_path = os.path.join(os.getcwd(), 'logs')
os.makedirs(logs_folder_path, exist_ok=True)
log_path ... | import time
import fastapi
import uvicorn
import logging
import os
from process_doc import process_image
from models.document_model import DocumentModel
from pdf2jpg import pdf2jpg
from datetime import datetime
logs_folder_path = os.path.join(os.getcwd(), 'logs')
os.makedirs(logs_folder_path, exist_ok=True)
log_path ... |
import logging
from ..functions import erase_lines
from ..questions import SettingsQuestions
from ...fsm import State, Transition
from ...constants import NO
from ...constants import (YES, SUCCESS)
from ...core.settings import SettingsManager
logger = logging.getLogger('gryphon')
def back_to_previous(history, **kwa... | import logging
from ..functions import erase_lines
from ..questions import SettingsQuestions
from ...fsm import State, Transition
from ...constants import NO
from ...constants import (YES, SUCCESS)
from ...core.settings import SettingsManager
logger = logging.getLogger('gryphon')
def back_to_previous(history, **kwa... |
import warnings
from collections import Counter
from dataclasses import dataclass
from datetime import datetime, date
from typing import Iterable, Optional, Set, Tuple, Union, List
import shapely
import shapely.ops
import structlog
from shapely.geometry import MultiPolygon
from shapely.geometry.base import BaseGeometr... | import warnings
from collections import Counter
from dataclasses import dataclass
from datetime import datetime, date
from typing import Iterable, Optional, Set, Tuple, Union, List
import shapely
import shapely.ops
import structlog
from shapely.geometry import MultiPolygon
from shapely.geometry.base import BaseGeometr... |
from types import GeneratorType
from typing import List, Mapping, Union
__all__ = [
'clean_picard_style_value',
'snakecase_to_kebab_case',
'clean_picard_style_key',
'format_bedtools_params',
'format_bwa_params',
'format_dwgsim_params',
'format_fgbio_params',
'format_kraken_params',
... | from types import GeneratorType
from typing import List, Mapping, Union
__all__ = [
'clean_picard_style_value',
'snakecase_to_kebab_case',
'clean_picard_style_key',
'format_bedtools_params',
'format_bwa_params',
'format_dwgsim_params',
'format_fgbio_params',
'format_kraken_params',
... |
from ortools.linear_solver import pywraplp
import pandas as pd
import numpy as np
def create_cost_matrix(distances, pref_big_school, pref_rural):
cost_matrix = distances + 10 * pref_big_school + 10 * pref_rural
return cost_matrix
def find_optimal_allocation(df_schools, distances, pref_big_school, pref_rural... | from ortools.linear_solver import pywraplp
import pandas as pd
import numpy as np
def create_cost_matrix(distances, pref_big_school, pref_rural):
cost_matrix = distances + 10 * pref_big_school + 10 * pref_rural
return cost_matrix
def find_optimal_allocation(df_schools, distances, pref_big_school, pref_rural... |
import logging
import psycopg2
from datetime import datetime, timezone
from django.conf import settings
from django.core.management import call_command
from pathlib import Path
from typing import Tuple
from usaspending_api.broker.helpers.last_load_date import get_last_load_date, update_last_load_date
from usaspending... | import logging
import psycopg2
from datetime import datetime, timezone
from django.conf import settings
from django.core.management import call_command
from pathlib import Path
from typing import Tuple
from usaspending_api.broker.helpers.last_load_date import get_last_load_date, update_last_load_date
from usaspending... |
# -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2021-01-06 16:12
from typing import List
from elit.common.dataset import SortingSamplerBuilder
from elit.common.transform import NormalizeToken
from elit.components.mtl.loss_balancer import MovingAverageBalancer
from elit.components.mtl.multi_task_learning import MultiTa... | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2021-01-06 16:12
from typing import List
from elit.common.dataset import SortingSamplerBuilder
from elit.common.transform import NormalizeToken
from elit.components.mtl.loss_balancer import MovingAverageBalancer
from elit.components.mtl.multi_task_learning import MultiTa... |
# -------------------------------------------------------------
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you unde... | # -------------------------------------------------------------
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you unde... |
#!/usr/bin/env python
"""
Rules for building C/API module with f2py2e.
Here is a skeleton of a new wrapper function (13Dec2001):
wrapper_function(args)
declarations
get_python_arguments, say, `a' and `b'
get_a_from_python
if (successful) {
get_b_from_python
if (successful) {
callfortran
... | #!/usr/bin/env python
"""
Rules for building C/API module with f2py2e.
Here is a skeleton of a new wrapper function (13Dec2001):
wrapper_function(args)
declarations
get_python_arguments, say, `a' and `b'
get_a_from_python
if (successful) {
get_b_from_python
if (successful) {
callfortran
... |
import json
import logging
import typing as t
import aiohttp
import discord.ext.commands as commands
import discord.utils as utils
import bot.bot_secrets as bot_secrets
import bot.extensions as ext
log = logging.getLogger(__name__)
HEADERS = {
'Content-type': 'application/json',
'Accept': 'application/json'... | import json
import logging
import typing as t
import aiohttp
import discord.ext.commands as commands
import discord.utils as utils
import bot.bot_secrets as bot_secrets
import bot.extensions as ext
log = logging.getLogger(__name__)
HEADERS = {
'Content-type': 'application/json',
'Accept': 'application/json'... |
# Copyright 2020-2021 Axis Communications AB.
#
# For a full list of individual contributors, please see the commit history.
#
# 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... | # Copyright 2020-2021 Axis Communications AB.
#
# For a full list of individual contributors, please see the commit history.
#
# 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... |
import atexit
import math
import queue
import threading
import requests
import json
import importlib
from readme_metrics import MetricsApiConfig
from readme_metrics.publisher import publish_batch
from readme_metrics.PayloadBuilder import PayloadBuilder
from readme_metrics.ResponseInfoWrapper import ResponseInfoWrapper... | import atexit
import math
import queue
import threading
import requests
import json
import importlib
from readme_metrics import MetricsApiConfig
from readme_metrics.publisher import publish_batch
from readme_metrics.PayloadBuilder import PayloadBuilder
from readme_metrics.ResponseInfoWrapper import ResponseInfoWrapper... |
'''
Add noise to audio files in TIMIT.
'''
import os
import glob
import random
from tqdm import tqdm
from create_mixed_audio_file_with_soundfile import mix_clean_with_noise
if __name__ == '__main__':
snr = 0 # in dB
timit_root = '/Users/goree/Desktop/cmu/datasets/timit/data' # change for user path struc... | '''
Add noise to audio files in TIMIT.
'''
import os
import glob
import random
from tqdm import tqdm
from create_mixed_audio_file_with_soundfile import mix_clean_with_noise
if __name__ == '__main__':
snr = 0 # in dB
timit_root = '/Users/goree/Desktop/cmu/datasets/timit/data' # change for user path struc... |
import pytz
import logging
import datetime
from typing import List
from pydantic import BaseModel
from sqlalchemy import func
from sqlalchemy.sql.functions import user
from dispatch.nlp import build_phrase_matcher, build_term_vocab, extract_terms_from_text
from dispatch.conversation import service as conversation_ser... | import pytz
import logging
import datetime
from typing import List
from pydantic import BaseModel
from sqlalchemy import func
from sqlalchemy.sql.functions import user
from dispatch.nlp import build_phrase_matcher, build_term_vocab, extract_terms_from_text
from dispatch.conversation import service as conversation_ser... |
import asyncio
import json
import logging
import traceback
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional
import aiohttp
from dogechia.server.outbound_message import NodeType
from dogechia.server.server import ssl_context_for_server
from dogechia.types.peer_info import PeerInfo
from d... | import asyncio
import json
import logging
import traceback
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional
import aiohttp
from dogechia.server.outbound_message import NodeType
from dogechia.server.server import ssl_context_for_server
from dogechia.types.peer_info import PeerInfo
from d... |
#!/usr/bin/env python3
from logging import debug, info, warning, error
from time import sleep
import traceback
class DeviceExample():
def __init__(self):
self.io = None
self.trajectory = None
self.idle_value = 0.0
def init(self):
from time import sleep
"""
orde... | #!/usr/bin/env python3
from logging import debug, info, warning, error
from time import sleep
import traceback
class DeviceExample():
def __init__(self):
self.io = None
self.trajectory = None
self.idle_value = 0.0
def init(self):
from time import sleep
"""
orde... |
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.network_type import NetworkType
from chia.consensus.pot_iterations import calculate_iterations_quality, calcula... | 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.network_type import NetworkType
from chia.consensus.pot_iterations import calculate_iterations_quality, calcula... |
import numpy as np
import trimesh
import pyrender
import matplotlib.pyplot as plt
import math
from tqdm import tqdm
import os
import torch
import torchvision
import glob
def render_one(mesh_list, steps, save_name, save_path, resolution, need_video=False):
"""
mesh: pyrender.mesh.Mesh
A pyrender.mesh.Me... | import numpy as np
import trimesh
import pyrender
import matplotlib.pyplot as plt
import math
from tqdm import tqdm
import os
import torch
import torchvision
import glob
def render_one(mesh_list, steps, save_name, save_path, resolution, need_video=False):
"""
mesh: pyrender.mesh.Mesh
A pyrender.mesh.Me... |
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Copyright (c) 2021. Jason Cameron +
# All rights reserved. +
# This file is p... | # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Copyright (c) 2021. Jason Cameron +
# All rights reserved. +
# This file is p... |
#!/usr/bin/env python3
# Copyright 2016-2017 The Meson development 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 ... | #!/usr/bin/env python3
# Copyright 2016-2017 The Meson development 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 ... |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
import os
import easypost
# Builds a file containing every cURL request to add a Carrier Account via EasyPost
# USAGE: API_KEY=123... venv/bin/python build_carrier_curl_requests.py > carrier_curl_requests.sh
URL = os.getenv('URL', 'https://api.easypost.com/v2')
API_KEY = os.getenv('API_KEY')
def main():
carrie... | import os
import easypost
# Builds a file containing every cURL request to add a Carrier Account via EasyPost
# USAGE: API_KEY=123... venv/bin/python build_carrier_curl_requests.py > carrier_curl_requests.sh
URL = os.getenv('URL', 'https://api.easypost.com/v2')
API_KEY = os.getenv('API_KEY')
def main():
carrie... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import threading
import maya
from auto_everything.base import IO
from telegram.ext import Updater, CommandHandler, CallbackQueryHandler, MessageHandler, Filters
from telegram import InlineKeyboardButton, InlineKeyboardMarkup
import os
import time
"""
export ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import threading
import maya
from auto_everything.base import IO
from telegram.ext import Updater, CommandHandler, CallbackQueryHandler, MessageHandler, Filters
from telegram import InlineKeyboardButton, InlineKeyboardMarkup
import os
import time
"""
export ... |
# https://nachtimwald.com/2019/11/14/python-self-signed-cert-gen/
import socket
import logging
import datetime
from typing import cast
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.asymmetric i... | # https://nachtimwald.com/2019/11/14/python-self-signed-cert-gen/
import socket
import logging
import datetime
from typing import cast
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.asymmetric i... |
import datetime
from typing import Optional
from BinanceWatch.storage.DataBase import DataBase, SQLConditionEnum
from BinanceWatch.storage import tables
from BinanceWatch.utils.time_utils import datetime_to_millistamp
class BinanceDataBase(DataBase):
"""
Handles the recording of the binance account in a loca... | import datetime
from typing import Optional
from BinanceWatch.storage.DataBase import DataBase, SQLConditionEnum
from BinanceWatch.storage import tables
from BinanceWatch.utils.time_utils import datetime_to_millistamp
class BinanceDataBase(DataBase):
"""
Handles the recording of the binance account in a loca... |
from BiblioAlly import catalog as cat, domain, translator as bibtex
class ScopusTranslator(bibtex.Translator):
def _document_from_proto_document(self, proto_document):
bibtex.Translator._translate_kind(proto_document)
kind = proto_document['type']
fields = proto_document['field']
... | from BiblioAlly import catalog as cat, domain, translator as bibtex
class ScopusTranslator(bibtex.Translator):
def _document_from_proto_document(self, proto_document):
bibtex.Translator._translate_kind(proto_document)
kind = proto_document['type']
fields = proto_document['field']
... |
import csv
import datetime
from crawler.models import Medicine, Generic, DosageForm, DrugClass, Indication, Manufacturer
from django.core.management import BaseCommand
from django.utils.autoreload import logger
class Command(BaseCommand): # see https://gist.github.com/2724472
help = "Mapping the generics with ... | import csv
import datetime
from crawler.models import Medicine, Generic, DosageForm, DrugClass, Indication, Manufacturer
from django.core.management import BaseCommand
from django.utils.autoreload import logger
class Command(BaseCommand): # see https://gist.github.com/2724472
help = "Mapping the generics with ... |
import os
import pickle
import numpy as np
from sklearn.model_selection import train_test_split
from .seq2seq_model import Seq2SeqModel
from .vectorizer import TokenVectorizer
class WhatWhyPredictor():
"""
Predicts a sequence of text which answers the question 'why?' given some input 'what'.
The predi... | import os
import pickle
import numpy as np
from sklearn.model_selection import train_test_split
from .seq2seq_model import Seq2SeqModel
from .vectorizer import TokenVectorizer
class WhatWhyPredictor():
"""
Predicts a sequence of text which answers the question 'why?' given some input 'what'.
The predi... |
import multiprocessing
import os
accesslog = '-'
bind = f'{os.getenv('GUNICORN_HOST', '0.0.0.0')}:{os.getenv('GUNICORN_PORT', '8000')}' # noqa
capture_output = True
syslog = os.getenv('LOG_SYSLOG', 'false').lower() in ['true', '1', 'yes', 'on']
threads = int(os.getenv('GUNICORN_THREADS', multiprocessing.cpu_coun... | import multiprocessing
import os
accesslog = '-'
bind = f'{os.getenv("GUNICORN_HOST", "0.0.0.0")}:{os.getenv("GUNICORN_PORT", "8000")}' # noqa
capture_output = True
syslog = os.getenv('LOG_SYSLOG', 'false').lower() in ['true', '1', 'yes', 'on']
threads = int(os.getenv('GUNICORN_THREADS', multiprocessing.cpu_coun... |
"""
MIT License
Copyright (c) 2021-present Obi-Wan3
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, modify, merge, publi... | """
MIT License
Copyright (c) 2021-present Obi-Wan3
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, modify, merge, publi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.