edited_code stringlengths 17 978k | original_code stringlengths 17 978k |
|---|---|
# -*- encoding: utf-8 -*-
#
# Copyright © 2020 Mergify SAS
#
# 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 applicabl... | # -*- encoding: utf-8 -*-
#
# Copyright © 2020 Mergify SAS
#
# 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 applicabl... |
from django.shortcuts import render, redirect
from django.http import HttpResponse
from django.contrib.auth.forms import AuthenticationForm
from .forms import *
from django.contrib.auth import login, logout, authenticate
from django.contrib import messages
from django.apps import apps
from django.conf import settings
f... | from django.shortcuts import render, redirect
from django.http import HttpResponse
from django.contrib.auth.forms import AuthenticationForm
from .forms import *
from django.contrib.auth import login, logout, authenticate
from django.contrib import messages
from django.apps import apps
from django.conf import settings
f... |
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import json
import os
import shlex
import unittest.mock
from enum import Enum
from functools import partial
from textwrap import dedent
from typing import Any, Dict, List, Optional, Union,... | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import json
import os
import shlex
import unittest.mock
from enum import Enum
from functools import partial
from textwrap import dedent
from typing import Any, Dict, List, Optional, Union,... |
from antlr4 import *
from antlr4.TokenStreamRewriter import TokenStreamRewriter
from gen.java.JavaLexer import JavaLexer
from gen.javaLabeled.JavaParserLabeled import JavaParserLabeled
from gen.javaLabeled.JavaParserLabeledListener import JavaParserLabeledListener
# get method parameters with formalParameters().forma... | from antlr4 import *
from antlr4.TokenStreamRewriter import TokenStreamRewriter
from gen.java.JavaLexer import JavaLexer
from gen.javaLabeled.JavaParserLabeled import JavaParserLabeled
from gen.javaLabeled.JavaParserLabeledListener import JavaParserLabeledListener
# get method parameters with formalParameters().forma... |
import csv
import matplotlib.pyplot as plt
import numpy as np
from collections import OrderedDict
import matplotlib as mpl
# import matplotlib.gridspec as gridspec
from matplotlib.ticker import MaxNLocator
from matplotlib.ticker import StrMethodFormatter
import matplotlib.font_manager as font_manager
from matplotlib.pa... | import csv
import matplotlib.pyplot as plt
import numpy as np
from collections import OrderedDict
import matplotlib as mpl
# import matplotlib.gridspec as gridspec
from matplotlib.ticker import MaxNLocator
from matplotlib.ticker import StrMethodFormatter
import matplotlib.font_manager as font_manager
from matplotlib.pa... |
#!/d/users/turner/tools/anaconda3/bin/python
"""
big 'ole python script that (hopefully) goes through the entire science procedure for give band 4 and band 7 fits files
notes are given in science.md
**python3**
to run:
ipython
exec(open('science.py').read())
"""
import numpy as np
import matplotlib.pyplot as plt
imp... | #!/d/users/turner/tools/anaconda3/bin/python
"""
big 'ole python script that (hopefully) goes through the entire science procedure for give band 4 and band 7 fits files
notes are given in science.md
**python3**
to run:
ipython
exec(open('science.py').read())
"""
import numpy as np
import matplotlib.pyplot as plt
imp... |
# Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot module for kanging stickers or making new ones. Thanks @rupansh"""
import io
import math
import urllib.req... | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot module for kanging stickers or making new ones. Thanks @rupansh"""
import io
import math
import urllib.req... |
# 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... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import cv2
import rospy
import rospkg
import numpy as np
from joblib import load
from sklearn import svm
from std_msgs.msg import Empty, String
from sensor_msgs.msg import CompressedImage
from cv_bridge import CvBridge
from ecs.srv import Descriptor
class Imag... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import cv2
import rospy
import rospkg
import numpy as np
from joblib import load
from sklearn import svm
from std_msgs.msg import Empty, String
from sensor_msgs.msg import CompressedImage
from cv_bridge import CvBridge
from ecs.srv import Descriptor
class Imag... |
import copy
from enum import Enum, unique
import logging
import json
from collections import OrderedDict
from collections_extended import bag
from EntranceShuffle import door_addresses
from Utils import int16_as_bytes
class World(object):
def __init__(self, players, shuffle, logic, mode, swords, difficulty, diffi... | import copy
from enum import Enum, unique
import logging
import json
from collections import OrderedDict
from collections_extended import bag
from EntranceShuffle import door_addresses
from Utils import int16_as_bytes
class World(object):
def __init__(self, players, shuffle, logic, mode, swords, difficulty, diffi... |
from asyncio import Lock
from collections import defaultdict, namedtuple
from functools import partial
from http import HTTPStatus
from kafka import KafkaConsumer
from kafka.errors import IllegalStateError, KafkaConfigurationError, KafkaError
from kafka.structs import OffsetAndMetadata, TopicPartition
from karapace.kaf... | from asyncio import Lock
from collections import defaultdict, namedtuple
from functools import partial
from http import HTTPStatus
from kafka import KafkaConsumer
from kafka.errors import IllegalStateError, KafkaConfigurationError, KafkaError
from kafka.structs import OffsetAndMetadata, TopicPartition
from karapace.kaf... |
import sys
import os
import inspect
import appdirs
import platform
import subprocess
import pipes
import colorama
from colorama import Fore, Back, Style
from .settings import Settings
class GlobalCommon(object):
"""
The GlobalCommon class is a singleton of shared functionality throughout the app
"""
... | import sys
import os
import inspect
import appdirs
import platform
import subprocess
import pipes
import colorama
from colorama import Fore, Back, Style
from .settings import Settings
class GlobalCommon(object):
"""
The GlobalCommon class is a singleton of shared functionality throughout the app
"""
... |
import sys
import os
import argparse
from typing import List
from flask_script import Manager
from flask_migrate import init, migrate, upgrade, Migrate, MigrateCommand
from deekoo_auth import create_app, db, DEFAULT_CONFIG_PATH
from deekoo_auth.models import User
from deekoo_auth.database import check_database_avail... | import sys
import os
import argparse
from typing import List
from flask_script import Manager
from flask_migrate import init, migrate, upgrade, Migrate, MigrateCommand
from deekoo_auth import create_app, db, DEFAULT_CONFIG_PATH
from deekoo_auth.models import User
from deekoo_auth.database import check_database_avail... |
"""
"""
from datetime import datetime
from vnpy.api.mini import (
THOST_FTDC_OAS_Submitted,
THOST_FTDC_OAS_Accepted,
THOST_FTDC_OAS_Rejected,
THOST_FTDC_OST_NoTradeQueueing,
THOST_FTDC_OST_PartTradedQueueing,
THOST_FTDC_OST_AllTraded,
THOST_FTDC_OST_Canceled,
THOST_FTDC_D_Buy,
THOS... | """
"""
from datetime import datetime
from vnpy.api.mini import (
THOST_FTDC_OAS_Submitted,
THOST_FTDC_OAS_Accepted,
THOST_FTDC_OAS_Rejected,
THOST_FTDC_OST_NoTradeQueueing,
THOST_FTDC_OST_PartTradedQueueing,
THOST_FTDC_OST_AllTraded,
THOST_FTDC_OST_Canceled,
THOST_FTDC_D_Buy,
THOS... |
import io
import logging
from collections import defaultdict
import requests
import urllib3
from django.utils import dateparse
from django.utils.dateparse import parse_datetime
from rest_framework.exceptions import ValidationError
from waldur_client import WaldurClient, WaldurClientException
from waldur_core.core.uti... | import io
import logging
from collections import defaultdict
import requests
import urllib3
from django.utils import dateparse
from django.utils.dateparse import parse_datetime
from rest_framework.exceptions import ValidationError
from waldur_client import WaldurClient, WaldurClientException
from waldur_core.core.uti... |
"""
This is plugin for all the plugins/hooks related to OCS-CI and its
configuration.
The basic configuration is done in run_ocsci.py module casue we need to load
all the config before pytest run. This run_ocsci.py is just a wrapper for
pytest which proccess config and passes all params to pytest.
"""
import logging
i... | """
This is plugin for all the plugins/hooks related to OCS-CI and its
configuration.
The basic configuration is done in run_ocsci.py module casue we need to load
all the config before pytest run. This run_ocsci.py is just a wrapper for
pytest which proccess config and passes all params to pytest.
"""
import logging
i... |
"""
This script is executed from within the ``upload`` rule
to upload files to Zenodo.
"""
import sys
from pathlib import Path
# Hack to import our custom functions
sys.path.insert(0, str(Path(__file__).parents[1]))
from helpers.exceptions import ShowyourworkException, ShowyourworkWarning
from helpers.zenodo import u... | """
This script is executed from within the ``upload`` rule
to upload files to Zenodo.
"""
import sys
from pathlib import Path
# Hack to import our custom functions
sys.path.insert(0, str(Path(__file__).parents[1]))
from helpers.exceptions import ShowyourworkException, ShowyourworkWarning
from helpers.zenodo import u... |
# STD python packages
import copy
import hashlib
import io
import json
import logging
import os
import platform
import time
import traceback
from copy import deepcopy
from typing import Any, Dict, List, Optional, Tuple
# 3-rd party packages
import docker
import docker.errors
import docker.models.containers
import requ... | # STD python packages
import copy
import hashlib
import io
import json
import logging
import os
import platform
import time
import traceback
from copy import deepcopy
from typing import Any, Dict, List, Optional, Tuple
# 3-rd party packages
import docker
import docker.errors
import docker.models.containers
import requ... |
import sys
import time
import h5py
import argparse
import numpy as np
from skimage.metrics import peak_signal_noise_ratio as psnr
from spectra_utils import split_radionuclide_name, plot_data
def load_data(datafile, det, show_data=False):
with h5py.File(datafile, 'r') as h5f:
assert h5f[det]["spectrum"].s... | import sys
import time
import h5py
import argparse
import numpy as np
from skimage.metrics import peak_signal_noise_ratio as psnr
from spectra_utils import split_radionuclide_name, plot_data
def load_data(datafile, det, show_data=False):
with h5py.File(datafile, 'r') as h5f:
assert h5f[det]["spectrum"].s... |
#############################################################################
##
## Copyright (C) 2018 The Qt Company Ltd.
## Contact: https://www.qt.io/licensing/
##
## This file is part of the plugins of the Qt Toolkit.
##
## $QT_BEGIN_LICENSE:GPL-EXCEPT$
## Commercial License Usage
## Licensees holding valid commerc... | #############################################################################
##
## Copyright (C) 2018 The Qt Company Ltd.
## Contact: https://www.qt.io/licensing/
##
## This file is part of the plugins of the Qt Toolkit.
##
## $QT_BEGIN_LICENSE:GPL-EXCEPT$
## Commercial License Usage
## Licensees holding valid commerc... |
# -*- coding: utf-8 -*-
"""
test-txtrader.py
--------------
TxTrader unit/regression test script
Copyright (c) 2016 Reliance Systems Inc. <mkrueger@rstms.net>
Licensed under the MIT license. See LICENSE for details.
"""
from txtrader_client import API
import subprocess
import os
import signal
import time
... | # -*- coding: utf-8 -*-
"""
test-txtrader.py
--------------
TxTrader unit/regression test script
Copyright (c) 2016 Reliance Systems Inc. <mkrueger@rstms.net>
Licensed under the MIT license. See LICENSE for details.
"""
from txtrader_client import API
import subprocess
import os
import signal
import time
... |
import datetime
import json
from json import JSONEncoder
from typing import Any, Dict, Optional
from pygments import highlight, lexers
from pygments.formatters import Terminal256Formatter
from .graphql_lexer import GraphQLLexer
class StrawberryJSONEncoder(JSONEncoder):
def default(self, o: Any) -> Any:
... | import datetime
import json
from json import JSONEncoder
from typing import Any, Dict, Optional
from pygments import highlight, lexers
from pygments.formatters import Terminal256Formatter
from .graphql_lexer import GraphQLLexer
class StrawberryJSONEncoder(JSONEncoder):
def default(self, o: Any) -> Any:
... |
import glob
import os
from pathlib import Path
import subprocess as sub
import sys
import time
from typing import Any, Dict, List
from unittest.mock import patch
import graphviz
import networkx as nx
import json
from jsonschema import Draft202012Validator
"""from watchdog.observers import Observer
from watchdog.obser... | import glob
import os
from pathlib import Path
import subprocess as sub
import sys
import time
from typing import Any, Dict, List
from unittest.mock import patch
import graphviz
import networkx as nx
import json
from jsonschema import Draft202012Validator
"""from watchdog.observers import Observer
from watchdog.obser... |
import anndata
from IPython.display import display_javascript, display_html
import json
import os
import pathlib
import pickle
import requests
from typing import List, Union
import uuid
from sfaira.data.dataloaders.base import DatasetBase
from sfaira.consts import AdataIdsCellxgene, AdataIdsCellxgene_v2_0_0
from sfair... | import anndata
from IPython.display import display_javascript, display_html
import json
import os
import pathlib
import pickle
import requests
from typing import List, Union
import uuid
from sfaira.data.dataloaders.base import DatasetBase
from sfaira.consts import AdataIdsCellxgene, AdataIdsCellxgene_v2_0_0
from sfair... |
# YOLOv3 PyTorch utils
import datetime
import logging
import math
import os
import platform
import subprocess
import time
from contextlib import contextmanager
from copy import deepcopy
from pathlib import Path
import torch
import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.nn.functional as F
imp... | # YOLOv3 PyTorch utils
import datetime
import logging
import math
import os
import platform
import subprocess
import time
from contextlib import contextmanager
from copy import deepcopy
from pathlib import Path
import torch
import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.nn.functional as F
imp... |
from arche.readers.schema import TaggedFields
from arche.rules.result import Result
from arche.tools.helpers import is_number, ratio_diff
import pandas as pd
def compare_was_now(df: pd.DataFrame, tagged_fields: TaggedFields):
"""Compare price_was and price_now tagged fields"""
price_was_fields = tagged_field... | from arche.readers.schema import TaggedFields
from arche.rules.result import Result
from arche.tools.helpers import is_number, ratio_diff
import pandas as pd
def compare_was_now(df: pd.DataFrame, tagged_fields: TaggedFields):
"""Compare price_was and price_now tagged fields"""
price_was_fields = tagged_field... |
'''
Módulo para captura dos dados abertos da Câmara dos Deputados do Brasil.
Mini-Tutorial
-------------
1. Importe o módulo `camara`.
>>> from DadosAbertosBrasil import camara
2. Busque o código do objeto de estudo utilizando as funções `lista`.
>>> camara.lista_deputados( ... )
3. Instancie o objeto de estudo util... | '''
Módulo para captura dos dados abertos da Câmara dos Deputados do Brasil.
Mini-Tutorial
-------------
1. Importe o módulo `camara`.
>>> from DadosAbertosBrasil import camara
2. Busque o código do objeto de estudo utilizando as funções `lista`.
>>> camara.lista_deputados( ... )
3. Instancie o objeto de estudo util... |
# Reference: https://www.loc.gov/catdir/cpso/romanization/amharic.pdf
_transliteration = {
# Syllables
'ሀ': ['ha'],
'ሁ': ['hu'],
'ሂ': ['hi'],
'ሃ': ['hā'],
'ሄ': ['hé'],
'ህ': ['he', 'h'],
'ሆ': ['ho'],
'ለ': ['la'],
'ሉ': ['lu'],
'ሊ': ['li'],
'ላ': ['lā'],
'ሌ': ['lé'],
... | # Reference: https://www.loc.gov/catdir/cpso/romanization/amharic.pdf
_transliteration = {
# Syllables
'ሀ': ['ha'],
'ሁ': ['hu'],
'ሂ': ['hi'],
'ሃ': ['hā'],
'ሄ': ['hé'],
'ህ': ['he', 'h'],
'ሆ': ['ho'],
'ለ': ['la'],
'ሉ': ['lu'],
'ሊ': ['li'],
'ላ': ['lā'],
'ሌ': ['lé'],
... |
from bs4 import BeautifulSoup,Tag
import requests
import json
import sys
from datetime import datetime
import re
import time
import yagmail
from config import CITY_NAMES
from config import WGZIMMER_HEADERS
from config import SENDER_EMAIL_ACCOUNT
from config import FREQUENCY
from config import RECEIVER_EMAIL
from conf... | from bs4 import BeautifulSoup,Tag
import requests
import json
import sys
from datetime import datetime
import re
import time
import yagmail
from config import CITY_NAMES
from config import WGZIMMER_HEADERS
from config import SENDER_EMAIL_ACCOUNT
from config import FREQUENCY
from config import RECEIVER_EMAIL
from conf... |
import warnings
warnings.simplefilter("ignore")
import offshoot
import subprocess
import signal
import shlex
import time
import os, os.path
import atexit
from serpent.game_agent import GameAgent
from serpent.game_launchers import *
from serpent.window_controller import WindowController
from serpent.input_controll... | import warnings
warnings.simplefilter("ignore")
import offshoot
import subprocess
import signal
import shlex
import time
import os, os.path
import atexit
from serpent.game_agent import GameAgent
from serpent.game_launchers import *
from serpent.window_controller import WindowController
from serpent.input_controll... |
#PyBank
#imports
import pathlib
import csv
#input/output paths
input_path = pathlib.Path("Resources/budget_data.csv")
output_path = pathlib.Path("Analysis/results.txt")
#make dictionary for result values
result_values = {
"total_months": 0,
"total": 0,
"average_chang... | #PyBank
#imports
import pathlib
import csv
#input/output paths
input_path = pathlib.Path("Resources/budget_data.csv")
output_path = pathlib.Path("Analysis/results.txt")
#make dictionary for result values
result_values = {
"total_months": 0,
"total": 0,
"average_chang... |
# Copyright (c) OpenMMLab. All rights reserved.
import itertools
import logging
import os.path as osp
import tempfile
import warnings
from collections import OrderedDict
import mmcv
import numpy as np
from mmcv.utils import print_log
from terminaltables import AsciiTable
from mmdet.core import eval_recalls
from .api_... | # Copyright (c) OpenMMLab. All rights reserved.
import itertools
import logging
import os.path as osp
import tempfile
import warnings
from collections import OrderedDict
import mmcv
import numpy as np
from mmcv.utils import print_log
from terminaltables import AsciiTable
from mmdet.core import eval_recalls
from .api_... |
import argparse
from pathlib import Path
IMAGE_STORE_INIT = "image_store = ImageStore(provider=PROVIDER)"
AUDIO_STORE_INIT = "audio_store = AudioStore(provider=PROVIDER)"
TEMPLATES_PATH = Path(__file__).parent
REPO_PATH = TEMPLATES_PATH.parents[1]
PROJECT_PATH = REPO_PATH.parent
def _get_filled_template(template_pa... | import argparse
from pathlib import Path
IMAGE_STORE_INIT = "image_store = ImageStore(provider=PROVIDER)"
AUDIO_STORE_INIT = "audio_store = AudioStore(provider=PROVIDER)"
TEMPLATES_PATH = Path(__file__).parent
REPO_PATH = TEMPLATES_PATH.parents[1]
PROJECT_PATH = REPO_PATH.parent
def _get_filled_template(template_pa... |
import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import NoSuchElementException
import json
from datetime import datetime
from jsonReport import GeneratejsonReport
class AmazonAPI:
def __init__(self, search_term, filters, base_url,... | import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import NoSuchElementException
import json
from datetime import datetime
from jsonReport import GeneratejsonReport
class AmazonAPI:
def __init__(self, search_term, filters, base_url,... |
import os
import json
config_path = '/home/work/PycharmProjects/mmsegmentation/configs'
path2drafts = '/home/work/PycharmProjects/mmsegmentation/supervisely/train/src_backup'
txt_ = os.path.join(path2drafts, 'cleared_tables')
os.makedirs(txt_, exist_ok=True)
json_ = os.path.join(path2drafts, 'dirty_json')
os.makedirs... | import os
import json
config_path = '/home/work/PycharmProjects/mmsegmentation/configs'
path2drafts = '/home/work/PycharmProjects/mmsegmentation/supervisely/train/src_backup'
txt_ = os.path.join(path2drafts, 'cleared_tables')
os.makedirs(txt_, exist_ok=True)
json_ = os.path.join(path2drafts, 'dirty_json')
os.makedirs... |
from utils.update_hparams import update_hparams
from utils.logger import Logger
import yaml
import os
from experiments.segmentation.adversarial_network_train_val_early.data_generator import Dataset_train
from experiments.segmentation.adversarial_network_train_val_early.train_pipeline import TrainPipeline
from models.... | from utils.update_hparams import update_hparams
from utils.logger import Logger
import yaml
import os
from experiments.segmentation.adversarial_network_train_val_early.data_generator import Dataset_train
from experiments.segmentation.adversarial_network_train_val_early.train_pipeline import TrainPipeline
from models.... |
import logging
import sys
from typing import List, Dict
import numpy as np
import pandas as pd
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
logger = logging.getLogger(__name__)
def aggregate_paper(
data: List[Dict[str, str]],
start_year: int = 2016,
bins_per_year: int = 4,
filtering: ... | import logging
import sys
from typing import List, Dict
import numpy as np
import pandas as pd
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
logger = logging.getLogger(__name__)
def aggregate_paper(
data: List[Dict[str, str]],
start_year: int = 2016,
bins_per_year: int = 4,
filtering: ... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from collections import defaultdict
import copy
import json
import os
from os.path import join, isdir
import sys
import tqdm
import re
import requests
import pkg_resources
from get_license_family import get_license_family
CHANNE... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from collections import defaultdict
import copy
import json
import os
from os.path import join, isdir
import sys
import tqdm
import re
import requests
import pkg_resources
from get_license_family import get_license_family
CHANNE... |
# -*- encoding: utf8 -*-
# noqa: D205,D400
"""
Spatial analogs
===============
Spatial analogues are maps showing which areas have a present-day climate that is analogous
to the future climate of a given place. This type of map can be useful for climate adaptation
to see how well regions are coping today under specifi... | # -*- encoding: utf8 -*-
# noqa: D205,D400
"""
Spatial analogs
===============
Spatial analogues are maps showing which areas have a present-day climate that is analogous
to the future climate of a given place. This type of map can be useful for climate adaptation
to see how well regions are coping today under specifi... |
# Copyright Materialize, Inc. and contributors. All rights reserved.
#
# Use of this software is governed by the Business Source License
# included in the LICENSE file at the root of this repository.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software... | # Copyright Materialize, Inc. and contributors. All rights reserved.
#
# Use of this software is governed by the Business Source License
# included in the LICENSE file at the root of this repository.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software... |
import logging, json, os, sys
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
import pandas as pd
from tqdm import tqdm
tqdm.pandas()
from ffsc.flow.recipes import recipes
def get_edges(df,dup_1, dup_2, reverse):
edges = ['START','END']
if dup_1:
edges[0] = 'START_B'
if dup_2:
... | import logging, json, os, sys
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
import pandas as pd
from tqdm import tqdm
tqdm.pandas()
from ffsc.flow.recipes import recipes
def get_edges(df,dup_1, dup_2, reverse):
edges = ['START','END']
if dup_1:
edges[0] = 'START_B'
if dup_2:
... |
"""Label syncing."""
import asyncio
from collections import namedtuple
import re
import traceback
import sys
from . import util
RE_VALID_COLOR = re.compile('#[a-fA-F0-9]{6}')
class LabelEdit(namedtuple('LabelEdit', ['old', 'new', 'color', 'description', 'modified'])):
"""Label Edit tuple."""
def _validate_str(... | """Label syncing."""
import asyncio
from collections import namedtuple
import re
import traceback
import sys
from . import util
RE_VALID_COLOR = re.compile('#[a-fA-F0-9]{6}')
class LabelEdit(namedtuple('LabelEdit', ['old', 'new', 'color', 'description', 'modified'])):
"""Label Edit tuple."""
def _validate_str(... |
from pytest import raises as assert_raises
from bundlebuilder.constants import (
DESCRIPTION_MAX_LENGTH,
COLUMN_TYPE_CHOICES,
SHORT_DESCRIPTION_LENGTH,
)
from bundlebuilder.exceptions import ValidationError
from bundlebuilder.models import ColumnDefinition
def test_column_definition_validation_fails():
... | from pytest import raises as assert_raises
from bundlebuilder.constants import (
DESCRIPTION_MAX_LENGTH,
COLUMN_TYPE_CHOICES,
SHORT_DESCRIPTION_LENGTH,
)
from bundlebuilder.exceptions import ValidationError
from bundlebuilder.models import ColumnDefinition
def test_column_definition_validation_fails():
... |
from vk_api.longpoll import VkLongPoll, VkEventType
from time import gmtime, strftime
from importlib import reload
import vk_api
import sys
import os
import osu.calc as calc
import osucommands
import sessionhandler as sh
import utils as ut
import random
import urllib.request
import versions as ver
import commands as co... | from vk_api.longpoll import VkLongPoll, VkEventType
from time import gmtime, strftime
from importlib import reload
import vk_api
import sys
import os
import osu.calc as calc
import osucommands
import sessionhandler as sh
import utils as ut
import random
import urllib.request
import versions as ver
import commands as co... |
from os import path
from docusign_admin.apis import BulkImportsApi
from flask import session, Response
import time
from app.admin.utils import create_admin_api_client, get_organization_id
from app.ds_config import DS_CONFIG
class Eg004AddUsersViaBulkImportController:
@staticmethod
def worker(self, request):... | from os import path
from docusign_admin.apis import BulkImportsApi
from flask import session, Response
import time
from app.admin.utils import create_admin_api_client, get_organization_id
from app.ds_config import DS_CONFIG
class Eg004AddUsersViaBulkImportController:
@staticmethod
def worker(self, request):... |
import json
import os
from dataclasses import dataclass
from os import path
from typing import Callable, Dict, Generator, Sequence
import pytest
import tests.functional.services.catalog.utils.api as catalog_api
import tests.functional.services.policy_engine.utils.api as policy_engine_api
from anchore_engine.db import... | import json
import os
from dataclasses import dataclass
from os import path
from typing import Callable, Dict, Generator, Sequence
import pytest
import tests.functional.services.catalog.utils.api as catalog_api
import tests.functional.services.policy_engine.utils.api as policy_engine_api
from anchore_engine.db import... |
import asyncio
from decimal import Decimal
import logging
import time
from typing import (
AsyncIterable,
Dict,
Optional
)
import json
import simplejson
import websockets
from hummingbot.core.data_type.user_stream_tracker_data_source import UserStreamTrackerDataSource
from hummingbot.logger import Hummingbo... | import asyncio
from decimal import Decimal
import logging
import time
from typing import (
AsyncIterable,
Dict,
Optional
)
import json
import simplejson
import websockets
from hummingbot.core.data_type.user_stream_tracker_data_source import UserStreamTrackerDataSource
from hummingbot.logger import Hummingbo... |
import sys
import io
class Calcifier:
def __init__(self):
self.root = "root"
self.lang = "calcifier_calc"
self.rules = {}
self.rules_by_priority = {}
self.node_type = ""
def priorities(self):
return self.rules_by_priority.keys()
@staticmethod
def crang... | import sys
import io
class Calcifier:
def __init__(self):
self.root = "root"
self.lang = "calcifier_calc"
self.rules = {}
self.rules_by_priority = {}
self.node_type = ""
def priorities(self):
return self.rules_by_priority.keys()
@staticmethod
def crang... |
import gc
import os
import time
import tracemalloc
from math import ceil
from shutil import rmtree
from sys import exit as exit_ex
from sys import platform
from time import time as time_now
from tkinter import Label, Tk
from tkinter.messagebox import showerror, showinfo, showwarning
from typing import Union
from webbro... | import gc
import os
import time
import tracemalloc
from math import ceil
from shutil import rmtree
from sys import exit as exit_ex
from sys import platform
from time import time as time_now
from tkinter import Label, Tk
from tkinter.messagebox import showerror, showinfo, showwarning
from typing import Union
from webbro... |
import importlib
import threading
import socket
import logging
import time
import redis
import exceptions
from client import Client
from inventory import Inventory
from parser import Parser
modules = ["client_error", "house", "outside", "user_rating", "mail", "avatar",
"location_game", "relations", "social_... | import importlib
import threading
import socket
import logging
import time
import redis
import exceptions
from client import Client
from inventory import Inventory
from parser import Parser
modules = ["client_error", "house", "outside", "user_rating", "mail", "avatar",
"location_game", "relations", "social_... |
import numpy as np
import torch
from einops import rearrange
from padertorch.base import Model
from padertorch.contrib.je.modules.conv import CNN1d, CNNTranspose1d
from padertorch.contrib.je.modules.gmm import GMM
from padertorch.contrib.je.modules.hmm import HMM
from padertorch.contrib.je.modules.features import Norma... | import numpy as np
import torch
from einops import rearrange
from padertorch.base import Model
from padertorch.contrib.je.modules.conv import CNN1d, CNNTranspose1d
from padertorch.contrib.je.modules.gmm import GMM
from padertorch.contrib.je.modules.hmm import HMM
from padertorch.contrib.je.modules.features import Norma... |
"""Common test functions."""
from pathlib import Path
import re
from unittest.mock import AsyncMock, MagicMock, PropertyMock, patch
from uuid import uuid4
from aiohttp import web
from aiohttp.test_utils import TestClient
import pytest
from supervisor.api import RestAPI
from supervisor.bootstrap import initialize_core... | """Common test functions."""
from pathlib import Path
import re
from unittest.mock import AsyncMock, MagicMock, PropertyMock, patch
from uuid import uuid4
from aiohttp import web
from aiohttp.test_utils import TestClient
import pytest
from supervisor.api import RestAPI
from supervisor.bootstrap import initialize_core... |
from os import getuid, system, mkdir, popen, setuid, setgid
from pathlib import Path
def run_command(command: str):
status = system(command)
if status != 0:
exit(status)
if getuid() != 0:
print("You must run it as root")
exit(1)
if Path("/etc/debian_version").exists():
# Ubuntu/Debian
... | from os import getuid, system, mkdir, popen, setuid, setgid
from pathlib import Path
def run_command(command: str):
status = system(command)
if status != 0:
exit(status)
if getuid() != 0:
print("You must run it as root")
exit(1)
if Path("/etc/debian_version").exists():
# Ubuntu/Debian
... |
from functools import partial
import numpy as np
from qcodes import VisaInstrument
from qcodes.instrument.parameter import ArrayParameter
from qcodes.utils.validators import Numbers, Ints, Enum, Strings
from typing import Tuple
class ChannelBuffer(ArrayParameter):
"""
Parameter class for the two channel buf... | from functools import partial
import numpy as np
from qcodes import VisaInstrument
from qcodes.instrument.parameter import ArrayParameter
from qcodes.utils.validators import Numbers, Ints, Enum, Strings
from typing import Tuple
class ChannelBuffer(ArrayParameter):
"""
Parameter class for the two channel buf... |
from unittest.mock import Mock
from ward import test
from cosmospy import Transaction
@test("sign transaction")
def _():
private_key = bytes.fromhex("2afc5a66b30e7521d553ec8e6f7244f906df97477248c30c103d7b3f2c671fef")
unordered_sign_message = {
"chain_id": "tendermint_test",
"account_number":... | from unittest.mock import Mock
from ward import test
from cosmospy import Transaction
@test("sign transaction")
def _():
private_key = bytes.fromhex("2afc5a66b30e7521d553ec8e6f7244f906df97477248c30c103d7b3f2c671fef")
unordered_sign_message = {
"chain_id": "tendermint_test",
"account_number":... |
import pandas as pd
import logging
from sklearn.feature_selection import SelectKBest, chi2
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import GridSearchCV
import pickle
from sklearn.metrics import classification_report
logger = logging.getLogger(__name__)
def columns_to_dummies(d... | import pandas as pd
import logging
from sklearn.feature_selection import SelectKBest, chi2
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import GridSearchCV
import pickle
from sklearn.metrics import classification_report
logger = logging.getLogger(__name__)
def columns_to_dummies(d... |
# coding: utf-8
import copy
import itertools
import math
import pickle
import platform
import random
from pathlib import Path
import numpy as np
import psutil
import pytest
from scipy.sparse import csr_matrix, isspmatrix_csc, isspmatrix_csr
from sklearn.datasets import load_svmlight_file, make_multilabel_classificatio... | # coding: utf-8
import copy
import itertools
import math
import pickle
import platform
import random
from pathlib import Path
import numpy as np
import psutil
import pytest
from scipy.sparse import csr_matrix, isspmatrix_csc, isspmatrix_csr
from sklearn.datasets import load_svmlight_file, make_multilabel_classificatio... |
import argparse
import logging
import sys
import socket
from typing import ByteString
import select
import time
import re
from urllib import request
import scapy
import getmac
from getmac import get_mac_address
from scapy.all import *
def getArgs():
# Parse command-line arguments
argsParser = argparse.Argument... | import argparse
import logging
import sys
import socket
from typing import ByteString
import select
import time
import re
from urllib import request
import scapy
import getmac
from getmac import get_mac_address
from scapy.all import *
def getArgs():
# Parse command-line arguments
argsParser = argparse.Argument... |
# Copyright 2020 Quentin Gliech
# Copyright 2020-2021 The Matrix.org Foundation C.I.C.
#
# 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
#
# U... | # Copyright 2020 Quentin Gliech
# Copyright 2020-2021 The Matrix.org Foundation C.I.C.
#
# 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
#
# U... |
import asyncio
import json
import logging
import time
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, Tuple
import traceback
import aiohttp
from blspy import AugSchemeMPL, G1Element, G2Element, PrivateKey
import chia.server.ws_connection as ws # lgtm [py/import-and-import-from]
from ... | import asyncio
import json
import logging
import time
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, Tuple
import traceback
import aiohttp
from blspy import AugSchemeMPL, G1Element, G2Element, PrivateKey
import chia.server.ws_connection as ws # lgtm [py/import-and-import-from]
from ... |
__all__ = ['UserNotification']
import json
import sqlalchemy as sa
from sqlalchemy.orm import relationship
from sqlalchemy import event
import requests
from baselayer.app.models import DBSession, Base, User, AccessibleIfUserMatches
from baselayer.app.env import load_env
from baselayer.app.flow import Flow
from ..a... | __all__ = ['UserNotification']
import json
import sqlalchemy as sa
from sqlalchemy.orm import relationship
from sqlalchemy import event
import requests
from baselayer.app.models import DBSession, Base, User, AccessibleIfUserMatches
from baselayer.app.env import load_env
from baselayer.app.flow import Flow
from ..a... |
import numpy as np
import pandas as pd
from sklearn.preprocessing import LabelBinarizer
from sklearn.model_selection import StratifiedKFold
from sklearn.preprocessing import StandardScaler
from joblib import parallel_backend
from multiprocessing import cpu_count
import os, gc, joblib
from tqdm import tqdm
from collec... | import numpy as np
import pandas as pd
from sklearn.preprocessing import LabelBinarizer
from sklearn.model_selection import StratifiedKFold
from sklearn.preprocessing import StandardScaler
from joblib import parallel_backend
from multiprocessing import cpu_count
import os, gc, joblib
from tqdm import tqdm
from collec... |
import sys
import os
from qtpy.QtWidgets import QApplication
from bioimageit_framework.theme import BiThemeAccess, BiThemeSheets
from bioimageit_framework.widgets import BiWidget, BiTable, showInfoBox
class MyExampleTable(BiWidget):
"""Create a table with an open button in the first row
Parameters
-----... | import sys
import os
from qtpy.QtWidgets import QApplication
from bioimageit_framework.theme import BiThemeAccess, BiThemeSheets
from bioimageit_framework.widgets import BiWidget, BiTable, showInfoBox
class MyExampleTable(BiWidget):
"""Create a table with an open button in the first row
Parameters
-----... |
import json
import logging
import os
import requests
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def notify_horoscope_success_to_slack(event: dict, context) -> dict:
logger.info(f"event={event}")
title = "storing horoscope is success:smile:"
messages = [
f"job_id: {event["job_id"]}... | import json
import logging
import os
import requests
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def notify_horoscope_success_to_slack(event: dict, context) -> dict:
logger.info(f"event={event}")
title = "storing horoscope is success:smile:"
messages = [
f"job_id: {event['job_id']}... |
import os,sys
import signal
import paramiko
import configparser
from functools import partial
from multiprocessing import Process
from watchdog.observers import Observer
from lib.JournalSyncing import JournalSyncing
from lib.WorkspaceWatchDog import WorkspaceWatchDog
from lib.connections import select_server, get_serve... | import os,sys
import signal
import paramiko
import configparser
from functools import partial
from multiprocessing import Process
from watchdog.observers import Observer
from lib.JournalSyncing import JournalSyncing
from lib.WorkspaceWatchDog import WorkspaceWatchDog
from lib.connections import select_server, get_serve... |
banner = '''
___ _ _ _
| _ \ (_) __ __ (_) __ __ (_) _ __ __ _ _ __ _ _
| _/ | | \ \ / | | \ V / | | | ' ... | banner = '''
___ _ _ _
| _ \ (_) __ __ (_) __ __ (_) _ __ __ _ _ __ _ _
| _/ | | \ \ / | | \ V / | | | ' ... |
# Dmitry Kisler © 2020-present
# www.dkisler.com
import os
import pathlib
import time
import importlib
import argparse
import json
from typing import Tuple, Union
from tagger_framework.utils.logger import getLogger
import warnings
warnings.simplefilter(action='ignore',
category=FutureWarning)
... | # Dmitry Kisler © 2020-present
# www.dkisler.com
import os
import pathlib
import time
import importlib
import argparse
import json
from typing import Tuple, Union
from tagger_framework.utils.logger import getLogger
import warnings
warnings.simplefilter(action='ignore',
category=FutureWarning)
... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import glob
import os
import re
from typing import List
from confidential_ml_utils.exceptions import (
PublicValueError,
print_prefixed_stack_trace_and_raise,
)
class StackTraceExtractor:
"""
A class to perform extraction of sta... | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import glob
import os
import re
from typing import List
from confidential_ml_utils.exceptions import (
PublicValueError,
print_prefixed_stack_trace_and_raise,
)
class StackTraceExtractor:
"""
A class to perform extraction of sta... |
""" https://adventofcode.com/2018/day/3 """
def readFile():
l = []
with open(f"{__file__.rstrip("code.py")}input.txt", "r") as f:
line = f.readline()
while line:
s = line.split(" ")
dist = s[2].split(",")
size = s[3].split("x")
fields = []
... | """ https://adventofcode.com/2018/day/3 """
def readFile():
l = []
with open(f"{__file__.rstrip('code.py')}input.txt", "r") as f:
line = f.readline()
while line:
s = line.split(" ")
dist = s[2].split(",")
size = s[3].split("x")
fields = []
... |
# Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
""" Userbot module for having some fun with people. """
from asyncio import sleep
from random import choice, getr... | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
""" Userbot module for having some fun with people. """
from asyncio import sleep
from random import choice, getr... |
# Adapted from Bittrex Python WS client example
#
# Last tested 2020/09/24 on Python 3.8.5
# Note: This file is intended solely for testing purposes and may only be used
# as an example to debug and compare with your code. The 3rd party libraries
# used in this example may not be suitable for your production use ca... | # Adapted from Bittrex Python WS client example
#
# Last tested 2020/09/24 on Python 3.8.5
# Note: This file is intended solely for testing purposes and may only be used
# as an example to debug and compare with your code. The 3rd party libraries
# used in this example may not be suitable for your production use ca... |
import xarray
from datetime import datetime
import numpy as np
import subprocess
import shutil
import os
from pathlib import Path
import importlib.resources
from .utils import mag_vector2incl_decl, datetime2yeardec
def cmake(setup_file: Path):
"""
attempt to build using CMake
"""
exe = shutil.which("... | import xarray
from datetime import datetime
import numpy as np
import subprocess
import shutil
import os
from pathlib import Path
import importlib.resources
from .utils import mag_vector2incl_decl, datetime2yeardec
def cmake(setup_file: Path):
"""
attempt to build using CMake
"""
exe = shutil.which("... |
from discord.ext import commands
import datetime
from discord.ext.commands.errors import MissingRequiredArgument, CommandNotFound
class Manager(commands.Cog):
""" Manage the bot """
def __init__(self, bot):
self.bot = bot
@commands.Cog.listener()
async def on_ready(self):
print(f'E... | from discord.ext import commands
import datetime
from discord.ext.commands.errors import MissingRequiredArgument, CommandNotFound
class Manager(commands.Cog):
""" Manage the bot """
def __init__(self, bot):
self.bot = bot
@commands.Cog.listener()
async def on_ready(self):
print(f'E... |
import random
import time
import sys
numeros = []
def juntar(lst, string):
lst = str(string).join(str(x) for x in lst)
return lst
def sortear(lista):
print('A gerar valores para a lista: ', end='')
for c1 in range(0, 5):
n = random.randint(0, 100)
lista += [n]
sys.stdout.flus... | import random
import time
import sys
numeros = []
def juntar(lst, string):
lst = str(string).join(str(x) for x in lst)
return lst
def sortear(lista):
print('A gerar valores para a lista: ', end='')
for c1 in range(0, 5):
n = random.randint(0, 100)
lista += [n]
sys.stdout.flus... |
import asyncio
# driver = webdriver.Chrome(executable_path=r"chromedriver.exe")
import json
from io import BytesIO
# import aiohttp
# import bs4
# import html5lib
# from bs4 import BeautifulSoup
# from selenium import webdriver
URL = "https://pokemondb.net/pokedex/all"
CDNURL = "https://assets.pokemon.com/assets/cms... | import asyncio
# driver = webdriver.Chrome(executable_path=r"chromedriver.exe")
import json
from io import BytesIO
# import aiohttp
# import bs4
# import html5lib
# from bs4 import BeautifulSoup
# from selenium import webdriver
URL = "https://pokemondb.net/pokedex/all"
CDNURL = "https://assets.pokemon.com/assets/cms... |
from unittest import skipIf
from decouple import config
from django.test import TestCase, override_settings
from google.api_core.client_options import ClientOptions
from google.auth.credentials import AnonymousCredentials
from google.cloud.exceptions import NotFound
from google.cloud.storage import Blob, Bucket, Clien... | from unittest import skipIf
from decouple import config
from django.test import TestCase, override_settings
from google.api_core.client_options import ClientOptions
from google.auth.credentials import AnonymousCredentials
from google.cloud.exceptions import NotFound
from google.cloud.storage import Blob, Bucket, Clien... |
#!/usr/bin/env python3
# Copyright (c) 2019 Teradici Corporation
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import base64
import datetime
import importlib
import json
import os
import re
import shutil
import site
import... | #!/usr/bin/env python3
# Copyright (c) 2019 Teradici Corporation
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import base64
import datetime
import importlib
import json
import os
import re
import shutil
import site
import... |
import glob
from icu import Collator, Locale
import os
import re
import yaml
import shutil
with_sorting = False
outdir = "words"
if os.path.exists(outdir):
shutil.rmtree(outdir)
os.makedirs(outdir)
collator = Collator.createInstance(Locale("pl_PL.UTF-8"))
separator = re.compile("[\W\d]+")
for path in glob.glob("... | import glob
from icu import Collator, Locale
import os
import re
import yaml
import shutil
with_sorting = False
outdir = "words"
if os.path.exists(outdir):
shutil.rmtree(outdir)
os.makedirs(outdir)
collator = Collator.createInstance(Locale("pl_PL.UTF-8"))
separator = re.compile("[\W\d]+")
for path in glob.glob("... |
import inspect
import unittest
from datetime import datetime
import requests
import yaml
import io
from contextlib import redirect_stdout
from quokka_server.device_monitor import discovery as device_discovery
from quokka_server.service_monitor import discovery as service_discovery
# Note: these tests require the quok... | import inspect
import unittest
from datetime import datetime
import requests
import yaml
import io
from contextlib import redirect_stdout
from quokka_server.device_monitor import discovery as device_discovery
from quokka_server.service_monitor import discovery as service_discovery
# Note: these tests require the quok... |
" Implementation of the softplus cost function"
from typing import List
import numpy as np
from rxn_network.core import CostFunction
from rxn_network.reactions import ComputedReaction
class Softplus(CostFunction):
"""
The softplus cost function is a smooth version of the Rectified Linear Unit (
ReLU) fu... | " Implementation of the softplus cost function"
from typing import List
import numpy as np
from rxn_network.core import CostFunction
from rxn_network.reactions import ComputedReaction
class Softplus(CostFunction):
"""
The softplus cost function is a smooth version of the Rectified Linear Unit (
ReLU) fu... |
from typing import Optional
from datetime import datetime
from collections import Counter
import discord
from discord.ext import commands
from utils.global_utils import bright_color
from utils.converters import CaseInsensitiveMember, CaseInsensitiveChannel
class GuildCog(commands.Cog, name='Server'):
def __init... | from typing import Optional
from datetime import datetime
from collections import Counter
import discord
from discord.ext import commands
from utils.global_utils import bright_color
from utils.converters import CaseInsensitiveMember, CaseInsensitiveChannel
class GuildCog(commands.Cog, name='Server'):
def __init... |
from typing import Dict, List, Optional, Union, TYPE_CHECKING
import json
import logging
import re
import urllib.parse
from multi import multi
from ..config import Config
from ..utils import RichStatus
from .irresource import IRResource
from .irtlscontext import IRTLSContext
if TYPE_CHECKING:
from .ir import I... | from typing import Dict, List, Optional, Union, TYPE_CHECKING
import json
import logging
import re
import urllib.parse
from multi import multi
from ..config import Config
from ..utils import RichStatus
from .irresource import IRResource
from .irtlscontext import IRTLSContext
if TYPE_CHECKING:
from .ir import I... |
"""GOMC's setup for signac, signac-flow, signac-dashboard for this study."""
# project.py
import flow
# from flow.environment import StandardEnvironment
import mbuild as mb
import mbuild.formats.charmm_writer as mf_charmm
import mbuild.formats.gomc_conf_writer as gomc_control
import numpy as np
from alchemlyb.parsin... | """GOMC's setup for signac, signac-flow, signac-dashboard for this study."""
# project.py
import flow
# from flow.environment import StandardEnvironment
import mbuild as mb
import mbuild.formats.charmm_writer as mf_charmm
import mbuild.formats.gomc_conf_writer as gomc_control
import numpy as np
from alchemlyb.parsin... |
# (C) Datadog, Inc. 2020-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from copy import deepcopy
import yaml
from ...utils import file_exists, path_join, read_file
VALID_EXTENSIONS = ('yaml', 'yml')
class BaseTemplate(object):
# Override in subclass with path to temp... | # (C) Datadog, Inc. 2020-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from copy import deepcopy
import yaml
from ...utils import file_exists, path_join, read_file
VALID_EXTENSIONS = ('yaml', 'yml')
class BaseTemplate(object):
# Override in subclass with path to temp... |
TEST_DATA_OBJECTIV = [
('12b55ed5-4295-4fc1-bf1f-88d64d1ac301','2021-11-30','2021-11-30 10:23:36.287','b2df75d2-d7ca-48ac-9747-af47d7a4a2b2','{"_type": "ClickEvent", "location_stack": [{"_type": "WebDocumentContext", "id": "#document", "url": "https://objectiv.io/", "_types": ["AbstractContext", "AbstractLocationCo... | TEST_DATA_OBJECTIV = [
('12b55ed5-4295-4fc1-bf1f-88d64d1ac301','2021-11-30','2021-11-30 10:23:36.287','b2df75d2-d7ca-48ac-9747-af47d7a4a2b2','{"_type": "ClickEvent", "location_stack": [{"_type": "WebDocumentContext", "id": "#document", "url": "https://objectiv.io/", "_types": ["AbstractContext", "AbstractLocationCo... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
''' Align a list of molecules using `super` command in PyMol. The first item
in the list is considered as the reference.
'''
import pymolPy3
import pyrotein as pr
import os
import colorsimple as cs
from loaddata import load_xlsx
# Specify chains to process...
fl... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
''' Align a list of molecules using `super` command in PyMol. The first item
in the list is considered as the reference.
'''
import pymolPy3
import pyrotein as pr
import os
import colorsimple as cs
from loaddata import load_xlsx
# Specify chains to process...
fl... |
#!/usr/bin/env python3
"""This utility compares pod resource requests and limits against actual usage"""
import subprocess
import argparse
from kubernetes import client, config
from bytes2human import human2bytes, bytes2human
def get_pods(kube, namespace):
"""Return a list of pods in a namespace"""
return... | #!/usr/bin/env python3
"""This utility compares pod resource requests and limits against actual usage"""
import subprocess
import argparse
from kubernetes import client, config
from bytes2human import human2bytes, bytes2human
def get_pods(kube, namespace):
"""Return a list of pods in a namespace"""
return... |
##> Imports
import math
import sys
# > 3rd party dependencies
import pandas as pd
import gspread
import gspread_dataframe as gd
from urllib.request import urlopen
from PIL import Image
from io import BytesIO
# > Discord dependencies
import discord
from discord.ext import commands
from discord.ext.tasks import loop
#... | ##> Imports
import math
import sys
# > 3rd party dependencies
import pandas as pd
import gspread
import gspread_dataframe as gd
from urllib.request import urlopen
from PIL import Image
from io import BytesIO
# > Discord dependencies
import discord
from discord.ext import commands
from discord.ext.tasks import loop
#... |
# Advanced histogramming & automated plotting functions
#
# (c) 2021 Mikael Mieskolainen
# Licensed under the MIT License <http://opensource.org/licenses/MIT>.
import pathlib
import matplotlib
matplotlib.use('Agg') # Important for multithreaded applications
from matplotlib import pyplot as plt
import numpy as np
im... | # Advanced histogramming & automated plotting functions
#
# (c) 2021 Mikael Mieskolainen
# Licensed under the MIT License <http://opensource.org/licenses/MIT>.
import pathlib
import matplotlib
matplotlib.use('Agg') # Important for multithreaded applications
from matplotlib import pyplot as plt
import numpy as np
im... |
import re
from django import forms
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.contrib.postgres.forms.array import SimpleArrayField
from django.core.exceptions import ObjectDoesNotExist
from django.utils.safestring import mark_safe
from netaddr imp... | import re
from django import forms
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.contrib.postgres.forms.array import SimpleArrayField
from django.core.exceptions import ObjectDoesNotExist
from django.utils.safestring import mark_safe
from netaddr imp... |
import collections
from datetime import timedelta
import functools
import gc
import json
import operator
import pickle
import re
from textwrap import dedent
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
FrozenSet,
Hashable,
List,
Mapping,
Optional,
Sequence,
Set,
... | import collections
from datetime import timedelta
import functools
import gc
import json
import operator
import pickle
import re
from textwrap import dedent
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
FrozenSet,
Hashable,
List,
Mapping,
Optional,
Sequence,
Set,
... |
# Copyright (C) 2019 The Raphielscape Company LLC.
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
""" Userbot module for kanging stickers or making new ones. Thanks @rupansh"""
import io
import math
import urllib.request... | # Copyright (C) 2019 The Raphielscape Company LLC.
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
""" Userbot module for kanging stickers or making new ones. Thanks @rupansh"""
import io
import math
import urllib.request... |
from __future__ import annotations
import datetime
import os
from typing import Type
import asyncpg
import discord
from discord.ext import commands
from ..utils import Config
__all__ = ("TemplateBot",)
class TemplateBot(commands.AutoShardedBot):
"""
A template bot, comes with dynamic prefixes
Attrib... | from __future__ import annotations
import datetime
import os
from typing import Type
import asyncpg
import discord
from discord.ext import commands
from ..utils import Config
__all__ = ("TemplateBot",)
class TemplateBot(commands.AutoShardedBot):
"""
A template bot, comes with dynamic prefixes
Attrib... |
import json
import os
import re
import time
import urllib.request
class VimeoScraper:
'''
Scraping Vimeo videos
Args:
out_path: [Optional] str, Path to output directory. If unspecified, current directory will be used
'''
def __init__(self, out_path=None):
if out_path is not None:... | import json
import os
import re
import time
import urllib.request
class VimeoScraper:
'''
Scraping Vimeo videos
Args:
out_path: [Optional] str, Path to output directory. If unspecified, current directory will be used
'''
def __init__(self, out_path=None):
if out_path is not None:... |
from .Platform import Platform
from ..Table import Table
class MSSQLPlatform(Platform):
types_without_lengths = [
"integer",
"big_integer",
"tiny_integer",
"small_integer",
"medium_integer",
]
type_map = {
"string": "VARCHAR",
"char": "CHAR",
... | from .Platform import Platform
from ..Table import Table
class MSSQLPlatform(Platform):
types_without_lengths = [
"integer",
"big_integer",
"tiny_integer",
"small_integer",
"medium_integer",
]
type_map = {
"string": "VARCHAR",
"char": "CHAR",
... |
import json
import requests
# curl -X GET -H "Authorization: Bearer [token]" https://[databricks url]/api/2.0/clusters/list
with open('config.json') as f:
config = json.load(f)
secrets = config["secrets"]["databricks"]
cluster_name = config["configuration"]["cluster_name"]
response = requests.post(
f"{s... | import json
import requests
# curl -X GET -H "Authorization: Bearer [token]" https://[databricks url]/api/2.0/clusters/list
with open('config.json') as f:
config = json.load(f)
secrets = config["secrets"]["databricks"]
cluster_name = config["configuration"]["cluster_name"]
response = requests.post(
f"{s... |
# This is an automatically generated file.
# DO NOT EDIT or your changes may be overwritten
import base64
from xdrlib import Packer, Unpacker
from .asset import Asset
from .int64 import Int64
from .muxed_account import MuxedAccount
__all__ = ["PaymentOp"]
class PaymentOp:
"""
XDR Source Code
-----------... | # This is an automatically generated file.
# DO NOT EDIT or your changes may be overwritten
import base64
from xdrlib import Packer, Unpacker
from .asset import Asset
from .int64 import Int64
from .muxed_account import MuxedAccount
__all__ = ["PaymentOp"]
class PaymentOp:
"""
XDR Source Code
-----------... |
import chars2vec
import csv
from sklearn.cluster import SpectralClustering
def spectralClustering():
words=[]
with open('./datasetFit.csv') as csv_file:
csv_reader = csv.reader(csv_file, delimiter=',')
line_count = 0
for row in csv_reader:
if line_count == 0:
... | import chars2vec
import csv
from sklearn.cluster import SpectralClustering
def spectralClustering():
words=[]
with open('./datasetFit.csv') as csv_file:
csv_reader = csv.reader(csv_file, delimiter=',')
line_count = 0
for row in csv_reader:
if line_count == 0:
... |
import os
import inspect
from lib.apirequest import ApiRequest
class ApiCotoha():
def __init__(self, clientId, clientSecret):
self.__clientId = clientId
self.__clientSecret = clientSecret
def __access(self):
at = ApiRequest('https://api.ce-cotoha.com/v1/oauth/accesstokens', 'POST')
... | import os
import inspect
from lib.apirequest import ApiRequest
class ApiCotoha():
def __init__(self, clientId, clientSecret):
self.__clientId = clientId
self.__clientSecret = clientSecret
def __access(self):
at = ApiRequest('https://api.ce-cotoha.com/v1/oauth/accesstokens', 'POST')
... |
from django.db.models import Q
from rest_framework import status
from rest_framework.exceptions import NotAuthenticated, PermissionDenied
from rest_framework.permissions import AllowAny, IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView
from bumblebee.buzzes.utils im... | from django.db.models import Q
from rest_framework import status
from rest_framework.exceptions import NotAuthenticated, PermissionDenied
from rest_framework.permissions import AllowAny, IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView
from bumblebee.buzzes.utils im... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.