hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c3f4ce11391295ce698b0c6e4455c5e0de17368 | 11,558 | py | Python | config.py | aimakerspace/synergos_director | c4b10502d7ffa6da4fc29fe675a5042590657996 | [
"Apache-2.0"
] | null | null | null | config.py | aimakerspace/synergos_director | c4b10502d7ffa6da4fc29fe675a5042590657996 | [
"Apache-2.0"
] | null | null | null | config.py | aimakerspace/synergos_director | c4b10502d7ffa6da4fc29fe675a5042590657996 | [
"Apache-2.0"
] | 2 | 2022-01-21T00:57:00.000Z | 2022-01-26T01:11:12.000Z | #!/usr/bin/env python
####################
# Required Modules #
####################
# Generic
import json
import logging
import os
import random
import subprocess
from collections import defaultdict, OrderedDict
from glob import glob
from pathlib import Path
from string import Template
# Libs
import numpy as np
imp... | 31.069892 | 89 | 0.655304 |
import json
import logging
import os
import random
import subprocess
from collections import defaultdict, OrderedDict
from glob import glob
from pathlib import Path
from string import Template
import numpy as np
import psutil
import torch as th
from synlogger.general import DirectorLogger, SysmetricLogger
SRC_DIR... | true | true |
1c3f4e2283a2ca09974785f1d9bc5acbdf5ae2f9 | 2,448 | py | Python | config.py | Jackson-Kang/VQVC-Pytorch | d2267b5c52253b6ae11a5767963a65320ae335c2 | [
"MIT"
] | 13 | 2021-02-11T17:48:40.000Z | 2022-02-08T06:37:12.000Z | config.py | Jackson-Kang/VQVC-Pytorch | d2267b5c52253b6ae11a5767963a65320ae335c2 | [
"MIT"
] | 1 | 2022-01-17T17:07:22.000Z | 2022-01-18T06:51:21.000Z | config.py | Jackson-Kang/VQVC-Pytorch | d2267b5c52253b6ae11a5767963a65320ae335c2 | [
"MIT"
] | 3 | 2021-03-10T08:40:00.000Z | 2022-01-17T17:08:48.000Z | import torch
from utils.path import get_path
class Arguments:
"""
path configurations
"""
dataset_name = "VCTK-Corpus"
dataset_path = get_path("/home/minsu/dataset/VCTK/", dataset_name)
converted_sample_dir = "results"
prepro_dir = "preprocessed"
model_log_dir = "logs"
model_checkpoint_dir = "ckpts"
... | 23.76699 | 128 | 0.747549 | import torch
from utils.path import get_path
class Arguments:
dataset_name = "VCTK-Corpus"
dataset_path = get_path("/home/minsu/dataset/VCTK/", dataset_name)
converted_sample_dir = "results"
prepro_dir = "preprocessed"
model_log_dir = "logs"
model_checkpoint_dir = "ckpts"
wav_dir = get_path(dataset_path,... | true | true |
1c3f4e978bc8466505b3f34142a058a11b694f7f | 56,611 | py | Python | theano/gof/op.py | canyon289/Theano-PyMC | 1a9b04bfe480b758ddfa54ba49c88bee3bec419c | [
"BSD-3-Clause"
] | null | null | null | theano/gof/op.py | canyon289/Theano-PyMC | 1a9b04bfe480b758ddfa54ba49c88bee3bec419c | [
"BSD-3-Clause"
] | null | null | null | theano/gof/op.py | canyon289/Theano-PyMC | 1a9b04bfe480b758ddfa54ba49c88bee3bec419c | [
"BSD-3-Clause"
] | null | null | null | """
Defines base classes `Op`, `PureOp`, and `CLinkerOp`.
The `Op` class is the base interface for all operations
compatible with `gof`'s :doc:`graph` routines.
"""
import copy
import inspect
import logging
import os
import re
import sys
import warnings
import numpy as np
import theano
import theano.gof.cc
from the... | 34.309697 | 108 | 0.584639 | import copy
import inspect
import logging
import os
import re
import sys
import warnings
import numpy as np
import theano
import theano.gof.cc
from theano import config
from theano.gof import graph
from theano.gof.cmodule import GCC_compiler
from theano.gof.fg import FunctionGraph
from theano.gof.utils import (
M... | true | true |
1c3f4ea74f0df3431f7567da5cfc25b5846263c0 | 904 | py | Python | WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/projects-DS/Data-Structures/lru_cache/lru_cache.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 5 | 2021-06-02T23:44:25.000Z | 2021-12-27T16:21:57.000Z | WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/projects-DS/Data-Structures/lru_cache/lru_cache.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 22 | 2021-05-31T01:33:25.000Z | 2021-10-18T18:32:39.000Z | WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/projects-DS/Data-Structures/lru_cache/lru_cache.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 3 | 2021-06-19T03:37:47.000Z | 2021-08-31T00:49:51.000Z | class LRUCache:
def __init__(self, limit=10):
pass
"""
Retrieves the value associated with the given key. Also
needs to move the key-value pair to the top of the order
such that the pair is considered most-recently used.
Returns the value associated with the key or None if the
key-value pair ... | 31.172414 | 62 | 0.702434 | class LRUCache:
def __init__(self, limit=10):
pass
def get(self, key):
pass
def set(self, key, value):
pass
| true | true |
1c3f4f64643e9db00643465b6d7976dc2f3815f0 | 23,787 | py | Python | code/run_fewrel.py | Riroaki/ERNIE | ad59b5e7cbad83247a123705ef2d64f65d0cfbf7 | [
"MIT"
] | 1,382 | 2019-05-17T07:55:01.000Z | 2022-03-30T02:47:06.000Z | all_exp/ernie/code/code/run_fewrel.py | yifan-h/GCS_KI | 5d5c68832aa37cefb1d01723c35fc3d74482c8c2 | [
"MIT"
] | 80 | 2019-05-20T01:45:37.000Z | 2022-02-17T14:33:17.000Z | all_exp/ernie/code/code/run_fewrel.py | yifan-h/GCS_KI | 5d5c68832aa37cefb1d01723c35fc3d74482c8c2 | [
"MIT"
] | 257 | 2019-05-18T10:39:18.000Z | 2022-03-21T15:23:41.000Z | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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... | 42.859459 | 130 | 0.59213 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import os
import logging
import argparse
import random
from tqdm import tqdm, trange
import simplejson as json
import numpy as np
import torch
from torch.utils.data import TensorDataset, DataLoader... | true | true |
1c3f505cbd7250fbf9f886f196440d28e9b05cca | 572 | py | Python | 00-modules/builtin_modules/shutil_examples.py | cccaaannn/useful_functions | 1570cda8c642a39f04ed9f22ebeeab2bfb9e9424 | [
"MIT"
] | null | null | null | 00-modules/builtin_modules/shutil_examples.py | cccaaannn/useful_functions | 1570cda8c642a39f04ed9f22ebeeab2bfb9e9424 | [
"MIT"
] | null | null | null | 00-modules/builtin_modules/shutil_examples.py | cccaaannn/useful_functions | 1570cda8c642a39f04ed9f22ebeeab2bfb9e9424 | [
"MIT"
] | null | null | null | import shutil
# https://docs.python.org/2/library/shutil.html
src = ""
dst = ""
# move
shutil.move(src, dst)
# copy
shutil.copy(src, dst)
# copy2 also copies metadata
shutil.copy2(src, dst)
# copy file works faster but it only copies files
shutil.copyfile(src, dst)
# copies metadata
shutil.copystat(src, dst)
#... | 17.875 | 49 | 0.729021 | import shutil
src = ""
dst = ""
shutil.move(src, dst)
shutil.copy(src, dst)
shutil.copy2(src, dst)
shutil.copyfile(src, dst)
shutil.copystat(src, dst)
ignore = shutil.ignore_patterns('*.pyc', 'tmp*')
shutil.copytree(src, dst, ignore=ignore)
shutil.rmtree(src)
shutil.make_archive(dst+".zip", 'zip', src) | true | true |
1c3f51f3327cf445677987a7a1e883c763e01bb9 | 82,241 | py | Python | mindspore/python/mindspore/train/serialization.py | glucklichste/mindspore | 9df63697af663836fc18d03fef40715f093a3fa1 | [
"Apache-2.0"
] | null | null | null | mindspore/python/mindspore/train/serialization.py | glucklichste/mindspore | 9df63697af663836fc18d03fef40715f093a3fa1 | [
"Apache-2.0"
] | null | null | null | mindspore/python/mindspore/train/serialization.py | glucklichste/mindspore | 9df63697af663836fc18d03fef40715f093a3fa1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020-2021 Huawei 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 agre... | 47.156537 | 120 | 0.640398 |
import copy
import json
import os
import shutil
import stat
import threading
from threading import Thread, Lock
from collections import defaultdict
import math
import sys
import time
import numpy as np
from mindspore.train.checkpoint_pb2 import Checkpoint
from mindspore.train.mind_ir_pb2 import ModelProto as mindir... | true | true |
1c3f5220100276b5490f58e7a181978bffecebdd | 12,233 | py | Python | gplearn/_programparser.py | vossjo/gplearn | 105181fd020da11bc36b7e31c95f115dd7f05c21 | [
"BSD-3-Clause"
] | null | null | null | gplearn/_programparser.py | vossjo/gplearn | 105181fd020da11bc36b7e31c95f115dd7f05c21 | [
"BSD-3-Clause"
] | null | null | null | gplearn/_programparser.py | vossjo/gplearn | 105181fd020da11bc36b7e31c95f115dd7f05c21 | [
"BSD-3-Clause"
] | 1 | 2022-03-08T22:42:00.000Z | 2022-03-08T22:42:00.000Z | """Genetic Programming in Python, with a scikit-learn inspired API
The :mod:`gplearn._programparser` module implements symbolic simplification
of programs via sympy and optimization of numerical parameters via scipy.
"""
# Author: Johannes Voss <https://stanford.edu/~vossj/main/>
#
# Additions to and based on gplearn... | 31.609819 | 171 | 0.575738 |
from .functions import _Function, _protected_division
import numpy as np
from scipy import optimize
from sympy import symbols, simplify
import ast
def parseexpr(x, fun_list, params):
if isinstance(x, ast.BinOp):
l = parseexpr(x.left, fun_list, params)
r = parseexpr(x.right, fun_list, params)
... | true | true |
1c3f528e021aeacde8c3005be959336163200770 | 1,347 | py | Python | designer_family/tests/unit/objects/base.py | guishaowu/designer_family | c89e16c6649c181f3262aa65fa97a457abdc2eb2 | [
"Apache-2.0"
] | null | null | null | designer_family/tests/unit/objects/base.py | guishaowu/designer_family | c89e16c6649c181f3262aa65fa97a457abdc2eb2 | [
"Apache-2.0"
] | null | null | null | designer_family/tests/unit/objects/base.py | guishaowu/designer_family | c89e16c6649c181f3262aa65fa97a457abdc2eb2 | [
"Apache-2.0"
] | null | null | null | # 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
# d... | 37.416667 | 78 | 0.724573 |
from oslo_config import cfg
from oslo_config import fixture as config_fixture
from designer_family import conf
from designer_family import context
from designer_family.tests.unit import base as unit_base
class TestCase(unit_base.ContextTestCase):
def setUp(self):
super(TestCase, self).setUp()
s... | true | true |
1c3f52e0ce89f75b895b86619db16ae1c51d37bb | 1,129 | py | Python | Configuration/Generator/python/QCD_Pt_170_230_8TeV_TuneCUETP8M1_cfi.py | Purva-Chaudhari/cmssw | 32e5cbfe54c4d809d60022586cf200b7c3020bcf | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | Configuration/Generator/python/QCD_Pt_170_230_8TeV_TuneCUETP8M1_cfi.py | Purva-Chaudhari/cmssw | 32e5cbfe54c4d809d60022586cf200b7c3020bcf | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | Configuration/Generator/python/QCD_Pt_170_230_8TeV_TuneCUETP8M1_cfi.py | Purva-Chaudhari/cmssw | 32e5cbfe54c4d809d60022586cf200b7c3020bcf | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
from Configuration.Generator.Pythia8CommonSettings_cfi import *
from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import *
generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter",
pythiaPylistVerbosity = cms.untracked.int32(0),
... | 45.16 | 74 | 0.54473 | import FWCore.ParameterSet.Config as cms
from Configuration.Generator.Pythia8CommonSettings_cfi import *
from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import *
generator = cms.EDFilter("Pythia8ConcurrentGeneratorFilter",
pythiaPylistVerbosity = cms.untracked.int32(0),
... | true | true |
1c3f5306df67d7a75fd8af47523e27b24b36c9e1 | 46,386 | py | Python | testing/shell_script_testing/shell_script_testing.py | ncsa/NCSA-Genomics_MGC_GenomeGPS_CromwelWDL | 4611896ea1bb50df50120752712e8d4b32a6d023 | [
"MIT"
] | null | null | null | testing/shell_script_testing/shell_script_testing.py | ncsa/NCSA-Genomics_MGC_GenomeGPS_CromwelWDL | 4611896ea1bb50df50120752712e8d4b32a6d023 | [
"MIT"
] | null | null | null | testing/shell_script_testing/shell_script_testing.py | ncsa/NCSA-Genomics_MGC_GenomeGPS_CromwelWDL | 4611896ea1bb50df50120752712e8d4b32a6d023 | [
"MIT"
] | null | null | null | import sys
import os
import subprocess
import unittest
import time
import glob
import copy
class Script:
"""
Trim_sequences is done, and the other scripts will have similar setups that have the flags as attributes so tests
can step through the list of attributes.
"""
__cwd = os.getcwd()
def _... | 48.87882 | 165 | 0.587246 | import sys
import os
import subprocess
import unittest
import time
import glob
import copy
class Script:
__cwd = os.getcwd()
def __init__(self):
self.path = self.__cwd
self.shell_path = '{}/MayomicsVC/src/shell'.format(self.__cwd)
self.test_path = '{}/MayomicsVC/testing/shell_script_t... | true | true |
1c3f53db2528a3e9ce469c7860b1e1d14e83ccaa | 4,237 | py | Python | setup.py | taesko/fst | e95b0d45ef1c181831c741604893bdc26753e551 | [
"MIT"
] | null | null | null | setup.py | taesko/fst | e95b0d45ef1c181831c741604893bdc26753e551 | [
"MIT"
] | null | null | null | setup.py | taesko/fst | e95b0d45ef1c181831c741604893bdc26753e551 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Note: To use the 'upload' functionality of this file, you must:
# $ pip install twine
import io
import os
import sys
from shutil import rmtree
from setuptools import find_packages, setup, Command
# Package meta-data.
NAME = "fst"
DESCRIPTION = "FIle System Templates... | 28.436242 | 81 | 0.632287 |
import io
import os
import sys
from shutil import rmtree
from setuptools import find_packages, setup, Command
NAME = "fst"
DESCRIPTION = "FIle System Templates"
URL = "https://github.com/taesko/{}".format(NAME)
EMAIL = "taeskow@gmail.com"
AUTHOR = "Antonio Todorov"
REQUIRED = ["watchdog"]
# ----------------------... | true | true |
1c3f5460a679d91aa7db89a2dd12f4a382a12cda | 5,474 | py | Python | CaloOnlineTools/EcalTools/python/ecalTPGAnalyzer_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | CaloOnlineTools/EcalTools/python/ecalTPGAnalyzer_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | CaloOnlineTools/EcalTools/python/ecalTPGAnalyzer_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
process = cms.Process("ANALYSEMIP")
# Trigger ###
process.load("L1TriggerConfig.L1GtConfigProducers.L1GtConfig_cff")
process.load("L1TriggerConfig.L1GtConfigProducers.Luminosity.startup.L1Menu_startup_v3_Unprescaled_cff")
process.load("L1TriggerConfig.L1GtConfigProducers.L1GtB... | 35.545455 | 162 | 0.744611 | import FWCore.ParameterSet.Config as cms
process = cms.Process("ANALYSEMIP")
process.load("L1TriggerConfig.L1GtConfigProducers.L1GtConfig_cff")
process.load("L1TriggerConfig.L1GtConfigProducers.Luminosity.startup.L1Menu_startup_v3_Unprescaled_cff")
process.load("L1TriggerConfig.L1GtConfigProducers.L1GtBoardMapsConfig... | true | true |
1c3f5487bb649785d318fed288f3c338b2157c1a | 529 | py | Python | testplan/runnable/interactive/resource_loader.py | Morgan-Stanley/Testplan | 9374d6e0da6ae9aa7a1b5e08b42cd21993485837 | [
"Apache-2.0"
] | null | null | null | testplan/runnable/interactive/resource_loader.py | Morgan-Stanley/Testplan | 9374d6e0da6ae9aa7a1b5e08b42cd21993485837 | [
"Apache-2.0"
] | null | null | null | testplan/runnable/interactive/resource_loader.py | Morgan-Stanley/Testplan | 9374d6e0da6ae9aa7a1b5e08b42cd21993485837 | [
"Apache-2.0"
] | null | null | null | """Import classes on runtime."""
class ResourceLoader:
"""Load logic."""
def load(self, name, kwargs):
"""Load the registered object for the given name."""
target_class = getattr(self, "_load_{}".format(name))()
return target_class(**kwargs)
def _load_TCPServer(self):
fro... | 25.190476 | 67 | 0.661626 |
class ResourceLoader:
def load(self, name, kwargs):
target_class = getattr(self, "_load_{}".format(name))()
return target_class(**kwargs)
def _load_TCPServer(self):
from testplan.testing.multitest.driver.tcp import TCPServer
return TCPServer
def _load_TCPClient(self):
... | true | true |
1c3f55051364d029230f8d099b1f020f5fee8e45 | 13,587 | py | Python | escola/tests/test_functional.py | vini84200/medusa2 | 37cf33d05be8b0195b10845061ca893ba5e814dd | [
"MIT"
] | 1 | 2019-03-15T18:04:24.000Z | 2019-03-15T18:04:24.000Z | escola/tests/test_functional.py | vini84200/medusa2 | 37cf33d05be8b0195b10845061ca893ba5e814dd | [
"MIT"
] | 22 | 2019-03-17T21:53:50.000Z | 2021-03-31T19:12:19.000Z | escola/tests/test_functional.py | vini84200/medusa2 | 37cf33d05be8b0195b10845061ca893ba5e814dd | [
"MIT"
] | 1 | 2018-11-25T03:05:23.000Z | 2018-11-25T03:05:23.000Z | # Developed by Vinicius José Fritzen
# Last Modified 16/05/19 16:44.
# Copyright (c) 2019 Vinicius José Fritzen and Albert Angel Lanzarini
import logging
import time
import pytest
from django.test import TestCase
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
TIME_LOAD = 2
logger ... | 44.841584 | 138 | 0.707294 | import logging
import time
import pytest
from django.test import TestCase
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
TIME_LOAD = 2
logger = logging.getLogger(__name__)
def HeaderWrongMsg(expected, recieved):
return f"O titulo no HEAD da pagina não é '{expected}', e sim '{r... | true | true |
1c3f558452fe4d4e193c488525a9e64c73a76bd9 | 855 | py | Python | googler/utils/compat.py | commx/googler | 6b834a3248ac297f1e1a75af3c622a0f37b34a0a | [
"Apache-2.0"
] | 2 | 2016-01-13T09:12:20.000Z | 2016-03-13T10:42:21.000Z | googler/utils/compat.py | commx/googler | 6b834a3248ac297f1e1a75af3c622a0f37b34a0a | [
"Apache-2.0"
] | 1 | 2018-11-11T16:40:41.000Z | 2018-11-11T16:40:41.000Z | googler/utils/compat.py | commx/googler | 6b834a3248ac297f1e1a75af3c622a0f37b34a0a | [
"Apache-2.0"
] | 1 | 2017-12-26T08:53:40.000Z | 2017-12-26T08:53:40.000Z | ##
# Copyright (C) 2015 Christian Jurk <commx@commx.ws>
#
# 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... | 27.580645 | 74 | 0.729825 |
import sys
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
if PY2:
text_type = unicode
bytes_type = str
from urllib import urlencode
else:
text_type = str
bytes_type = bytes
from urllib.parse import urlencode | true | true |
1c3f55ec18411adfef510553a7c3bbc52d63deba | 4,221 | py | Python | setup.py | Rippling/mongoengine | c3b6fa6ffdfe05fcf6f49857c1a89fee0175a05f | [
"MIT"
] | null | null | null | setup.py | Rippling/mongoengine | c3b6fa6ffdfe05fcf6f49857c1a89fee0175a05f | [
"MIT"
] | 28 | 2016-11-30T03:15:18.000Z | 2022-02-25T15:57:02.000Z | setup.py | Rippling/mongoengine | c3b6fa6ffdfe05fcf6f49857c1a89fee0175a05f | [
"MIT"
] | 1 | 2021-11-10T05:33:18.000Z | 2021-11-10T05:33:18.000Z | from __future__ import absolute_import
import os
import sys
from setuptools import setup, find_packages
# Hack to silence atexit traceback in newer python versions
try:
import multiprocessing
except ImportError:
pass
DESCRIPTION = 'MongoEngine is a Python Object-Document ' + \
'Mapper for working with MongoDB... | 37.6875 | 119 | 0.664534 | from __future__ import absolute_import
import os
import sys
from setuptools import setup, find_packages
try:
import multiprocessing
except ImportError:
pass
DESCRIPTION = 'MongoEngine is a Python Object-Document ' + \
'Mapper for working with MongoDB.'
try:
with open('README.rst') as fin:
LONG_DE... | true | true |
1c3f560d6e75286729123a801fbff679f21bbc87 | 7,466 | py | Python | django/db/migrations/migration.py | xia0AL/baby_two | 70244363024a36463dfaeda64e9e95ac118e1934 | [
"BSD-3-Clause"
] | 1 | 2016-02-13T15:40:02.000Z | 2016-02-13T15:40:02.000Z | django/db/migrations/migration.py | ojengwa/django-1 | f6b09a7f85c3b67b2011553838b079788c413432 | [
"BSD-3-Clause"
] | null | null | null | django/db/migrations/migration.py | ojengwa/django-1 | f6b09a7f85c3b67b2011553838b079788c413432 | [
"BSD-3-Clause"
] | 1 | 2022-03-26T09:05:09.000Z | 2022-03-26T09:05:09.000Z | from __future__ import unicode_literals
from django.db.transaction import atomic
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Migration(object):
"""
The base class for all migrations.
Migration files will import this from django.db.migrations.Migration... | 41.709497 | 109 | 0.648674 | from __future__ import unicode_literals
from django.db.transaction import atomic
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Migration(object):
operations = []
dependencies = []
run_before = []
# Migration names in this ... | true | true |
1c3f566ac5de92909c6d445e415ff2cdc4cd53d2 | 2,184 | py | Python | main.py | rnoguer22/Ejercicios_Herencia_POO | 0e18fe1edf262f20b95cc0b40d7e61c4be31ec0d | [
"Apache-2.0"
] | null | null | null | main.py | rnoguer22/Ejercicios_Herencia_POO | 0e18fe1edf262f20b95cc0b40d7e61c4be31ec0d | [
"Apache-2.0"
] | null | null | null | main.py | rnoguer22/Ejercicios_Herencia_POO | 0e18fe1edf262f20b95cc0b40d7e61c4be31ec0d | [
"Apache-2.0"
] | null | null | null | from Clases.ejercicio1 import *
from Clases.Puzzle import *
from Clases.Herencia_multiple_caso_real import *
if __name__ == "__main__":
#EJERCICIO 1
punto1 = Punto2D(3,2)
punto1.traslacion(1,1)
print("El nuevo valor de punto1 es ({},{})".format(punto1.x,punto1.y))
punto2 = Punto3D(1,1,1)
... | 36.4 | 111 | 0.625916 | from Clases.ejercicio1 import *
from Clases.Puzzle import *
from Clases.Herencia_multiple_caso_real import *
if __name__ == "__main__":
punto1 = Punto2D(3,2)
punto1.traslacion(1,1)
print("El nuevo valor de punto1 es ({},{})".format(punto1.x,punto1.y))
punto2 = Punto3D(1,1,1)
punto2.trasla... | true | true |
1c3f571eacb5844d4f1d6425820e62fc84c1eb66 | 1,739 | py | Python | beginning-game-development/Chapter 7/7-4.py | CrtomirJuren/pygame-projects | f710f36050bfe3ece866bbda7d570caa1e037d7a | [
"MIT"
] | 43 | 2015-09-20T02:05:48.000Z | 2022-03-01T22:00:43.000Z | beginning-game-development/Chapter 7/7-4.py | CrtomirJuren/pygame-projects | f710f36050bfe3ece866bbda7d570caa1e037d7a | [
"MIT"
] | null | null | null | beginning-game-development/Chapter 7/7-4.py | CrtomirJuren/pygame-projects | f710f36050bfe3ece866bbda7d570caa1e037d7a | [
"MIT"
] | 40 | 2015-05-19T06:51:13.000Z | 2022-03-27T18:11:16.000Z | class World(object):
def __init__(self):
self.entities = {} # Store all the entities
self.entity_id = 0 # Last entity id assigned
# Draw the nest (a circle) on the background
self.background = pygame.surface.Surface(SCREEN_SIZE).convert()
self.background.fill((255, 255, 255... | 31.053571 | 91 | 0.626797 | class World(object):
def __init__(self):
self.entities = {} self.entity_id = 0 self.background = pygame.surface.Surface(SCREEN_SIZE).convert()
self.background.fill((255, 255, 255))
pygame.draw.circle(self.background, (200, 255, 200), NEST_POSITION, int(NEST_SIZE))
... | true | true |
1c3f581920ca6d909ea815a12c43b203410bfd34 | 1,113 | py | Python | bluelog/extensions.py | meizhaohui/bluelog | e4ea274cec5abe78b142f23f99675d3fdf5f1170 | [
"MIT"
] | null | null | null | bluelog/extensions.py | meizhaohui/bluelog | e4ea274cec5abe78b142f23f99675d3fdf5f1170 | [
"MIT"
] | null | null | null | bluelog/extensions.py | meizhaohui/bluelog | e4ea274cec5abe78b142f23f99675d3fdf5f1170 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
"""
@Author : Zhaohui Mei(梅朝辉)
@Email : mzh.whut@gmail.com
@Time : 2018/11/18 20:53
@File : extensions.py
@Version : 1.0
@Interpreter: Python3.6.2
@Software: PyCharm
@Description: 扩展类实例化
"""
from flask_bootstrap import Bootstrap
from flask_sqlalchemy import SQLAlchemy
from ... | 25.295455 | 73 | 0.728661 | from flask_bootstrap import Bootstrap
from flask_sqlalchemy import SQLAlchemy
from flask_moment import Moment
from flask_ckeditor import CKEditor
from flask_mail import Mail
from flask_login import LoginManager
from flask_wtf.csrf import CSRFProtect
bootstrap = Bootstrap()
db = SQLAlchemy()
moment = Moment()... | true | true |
1c3f596687b3a50588950fdfed39db230aa16475 | 470 | py | Python | apps/fhir/bluebutton/migrations/0004_auto_20191220_2327.py | dtisza1/bluebutton-web-server | 6322f28d75bd9e00f8dc4b5988a0cd5f7c6c80cb | [
"Apache-2.0"
] | 25 | 2017-12-10T00:48:31.000Z | 2022-03-25T01:29:13.000Z | apps/fhir/bluebutton/migrations/0004_auto_20191220_2327.py | dtisza1/bluebutton-web-server | 6322f28d75bd9e00f8dc4b5988a0cd5f7c6c80cb | [
"Apache-2.0"
] | 298 | 2017-12-05T05:53:32.000Z | 2022-03-21T19:29:03.000Z | apps/fhir/bluebutton/migrations/0004_auto_20191220_2327.py | dtisza1/bluebutton-web-server | 6322f28d75bd9e00f8dc4b5988a0cd5f7c6c80cb | [
"Apache-2.0"
] | 31 | 2017-12-04T16:01:12.000Z | 2021-09-26T22:34:55.000Z | # Generated by Django 2.1.11 on 2019-12-20 23:27
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bluebutton', '0003_auto_20191208_0010'),
]
operations = [
migrations.AlterField(
model_name='crosswalk',
name='_fhi... | 24.736842 | 125 | 0.634043 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bluebutton', '0003_auto_20191208_0010'),
]
operations = [
migrations.AlterField(
model_name='crosswalk',
name='_fhir_id',
field=models.CharField(db_colu... | true | true |
1c3f59d5dbbbcbb7939d11d02a3a33cb0fbdc48a | 1,374 | py | Python | lib/cogs/commands/Utility.py | Aqua-Solutions2/Aqua-Solutions-Partner | dfc27c77560c2e209b9aef003694641d07027950 | [
"MIT"
] | null | null | null | lib/cogs/commands/Utility.py | Aqua-Solutions2/Aqua-Solutions-Partner | dfc27c77560c2e209b9aef003694641d07027950 | [
"MIT"
] | null | null | null | lib/cogs/commands/Utility.py | Aqua-Solutions2/Aqua-Solutions-Partner | dfc27c77560c2e209b9aef003694641d07027950 | [
"MIT"
] | null | null | null | from discord.ext.commands import Cog, command, cooldown, BucketType
import time
start_time = time.time()
class Stats(Cog):
def __init__(self, bot):
self.bot = bot
@staticmethod
def calculate_uptime():
current_time = time.time()
uptime = current_time - start_time
if uptim... | 32.714286 | 134 | 0.597525 | from discord.ext.commands import Cog, command, cooldown, BucketType
import time
start_time = time.time()
class Stats(Cog):
def __init__(self, bot):
self.bot = bot
@staticmethod
def calculate_uptime():
current_time = time.time()
uptime = current_time - start_time
if uptim... | true | true |
1c3f5a0a335de8091c3d9ea5a205053cffc9b8b6 | 861 | py | Python | generaImagenTile/test/ph1.py | alffore/tileimagen | baf7321d9e9c002ef8ec10d4c52883ef8e4f18ed | [
"MIT"
] | null | null | null | generaImagenTile/test/ph1.py | alffore/tileimagen | baf7321d9e9c002ef8ec10d4c52883ef8e4f18ed | [
"MIT"
] | null | null | null | generaImagenTile/test/ph1.py | alffore/tileimagen | baf7321d9e9c002ef8ec10d4c52883ef8e4f18ed | [
"MIT"
] | null | null | null | """
Prueba para obtencion de histograma
"""
import sys
import numpy as np
import skimage.color
import skimage.io
import skimage.viewer
from matplotlib import pyplot as plt
# read image, based on command line filename argument;
# read the image as grayscale from the outset
image = skimage.io.imread(fname=sys.argv[1],... | 22.657895 | 58 | 0.710801 | import sys
import numpy as np
import skimage.color
import skimage.io
import skimage.viewer
from matplotlib import pyplot as plt
image = skimage.io.imread(fname=sys.argv[1], as_gray=True)
colors = ("r", "g", "b")
channel_ids = (0, 1, 2)
plt.xlim([0, 256])
for channel_id, c in zip(channel_ids, colors):
histogra... | true | true |
1c3f5c46615ce0f7a4be0e013b2441f34d4bcb1e | 19,070 | py | Python | pylib/gna/env.py | gnafit/gna | c1a58dac11783342c97a2da1b19c97b85bce0394 | [
"MIT"
] | 5 | 2019-10-14T01:06:57.000Z | 2021-02-02T16:33:06.000Z | pylib/gna/env.py | gnafit/gna | c1a58dac11783342c97a2da1b19c97b85bce0394 | [
"MIT"
] | null | null | null | pylib/gna/env.py | gnafit/gna | c1a58dac11783342c97a2da1b19c97b85bce0394 | [
"MIT"
] | null | null | null | from collections import defaultdict, deque, Mapping, OrderedDict
from contextlib import contextmanager
import ROOT
import cppyy
from gna.config import cfg
from . import parameters
provided_precisions = list(map(str, ROOT.GNA.provided_precisions()))
expressionproviders = tuple(ROOT.GNA.GNAObjectTemplates.ExpressionsPro... | 30.857605 | 141 | 0.549816 | from collections import defaultdict, deque, Mapping, OrderedDict
from contextlib import contextmanager
import ROOT
import cppyy
from gna.config import cfg
from . import parameters
provided_precisions = list(map(str, ROOT.GNA.provided_precisions()))
expressionproviders = tuple(ROOT.GNA.GNAObjectTemplates.ExpressionsPro... | true | true |
1c3f5d6c78ec809aa195b52895b4074229d46b61 | 1,644 | py | Python | players/migrations/0001_initial.py | dbisdorf/cortex-roller | 888d4dba8f4f407660b84e12fc8e2ed9874f0b7e | [
"MIT"
] | 5 | 2019-10-14T11:01:00.000Z | 2021-02-08T08:39:35.000Z | players/migrations/0001_initial.py | dbisdorf/cortex-roller | 888d4dba8f4f407660b84e12fc8e2ed9874f0b7e | [
"MIT"
] | 1 | 2022-02-17T22:17:21.000Z | 2022-03-01T14:33:46.000Z | players/migrations/0001_initial.py | dbisdorf/cortex-roller | 888d4dba8f4f407660b84e12fc8e2ed9874f0b7e | [
"MIT"
] | 1 | 2019-10-15T21:17:07.000Z | 2019-10-15T21:17:07.000Z | # Generated by Django 2.1.3 on 2018-11-20 16:25
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Die',
fields=[
('uuid', models.... | 35.73913 | 114 | 0.552311 |
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Die',
fields=[
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, pr... | true | true |
1c3f5e1d3a3d9ed47f92c3618cd6b6010f4c812d | 2,589 | py | Python | pikuli/input/helper_types.py | NVoronchev/pikuli | b67e33fa51a7bb7252c5ac11651e2f005542f955 | [
"MIT"
] | null | null | null | pikuli/input/helper_types.py | NVoronchev/pikuli | b67e33fa51a7bb7252c5ac11651e2f005542f955 | [
"MIT"
] | 1 | 2021-05-11T13:40:52.000Z | 2021-05-13T19:42:26.000Z | pikuli/input/helper_types.py | NVoronchev/pikuli | b67e33fa51a7bb7252c5ac11651e2f005542f955 | [
"MIT"
] | 2 | 2021-03-31T14:10:15.000Z | 2022-01-24T02:16:04.000Z | # -*- coding: utf-8 -*-
import os
import traceback
from collections import namedtuple
from pikuli import logger
from pikuli._helpers import NotImplemetedDummyFactory
WindowsButtonCode = namedtuple('WindowsButtonCode', ['event_down', 'event_up'])
class _HookedClassInitMeta(type):
HOOKED_INIT_CLASS_METHODNAME ... | 36.464789 | 112 | 0.68791 |
import os
import traceback
from collections import namedtuple
from pikuli import logger
from pikuli._helpers import NotImplemetedDummyFactory
WindowsButtonCode = namedtuple('WindowsButtonCode', ['event_down', 'event_up'])
class _HookedClassInitMeta(type):
HOOKED_INIT_CLASS_METHODNAME = '__hooked_class_init'
... | true | true |
1c3f5fe83b71fe65cd77563bf2e2591a4743c7df | 463 | py | Python | mkt/users/migrations/0003_userprofile_shown_dev_agreement.py | Witia1/zamboni | b1e2d5d475abff2fa5d4990415a06adee33bd647 | [
"BSD-3-Clause"
] | null | null | null | mkt/users/migrations/0003_userprofile_shown_dev_agreement.py | Witia1/zamboni | b1e2d5d475abff2fa5d4990415a06adee33bd647 | [
"BSD-3-Clause"
] | null | null | null | mkt/users/migrations/0003_userprofile_shown_dev_agreement.py | Witia1/zamboni | b1e2d5d475abff2fa5d4990415a06adee33bd647 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0002_auto_20150826_0807'),
]
operations = [
migrations.AddField(
model_name='userprofile',
... | 22.047619 | 62 | 0.617711 | from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0002_auto_20150826_0807'),
]
operations = [
migrations.AddField(
model_name='userprofile',
name='shown_dev_agreemen... | true | true |
1c3f607124fede9bd7a78b6a7d1b13b66bac75fa | 5,374 | py | Python | croissant/output/base.py | v-legoff/croissant | ec45f530d22d98503182b0dcf635e552c72df831 | [
"BSD-3-Clause"
] | null | null | null | croissant/output/base.py | v-legoff/croissant | ec45f530d22d98503182b0dcf635e552c72df831 | [
"BSD-3-Clause"
] | null | null | null | croissant/output/base.py | v-legoff/croissant | ec45f530d22d98503182b0dcf635e552c72df831 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2013 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and th... | 33.798742 | 79 | 0.676219 |
from abc import *
import argparse
import sys
import traceback
from croissant.language.exceptions.syntax import LanguageSyntaxError
from croissant.step.exceptions import *
from croissant.story.story_set import StorySet
class BaseOutput(metaclass=ABCMeta):
def __init__(self):
self.set = StorySet()
... | true | true |
1c3f60c2bbe712b82221105cad6428fa3a7f9b19 | 23 | py | Python | proclist/scripts/scythe/proclist/__init__.py | scythe-io/community-modules | bc0d16e30a928f3ba11aecfa6cbac760b1de529b | [
"MIT"
] | 2 | 2022-03-14T18:48:04.000Z | 2022-03-25T14:37:23.000Z | proclist/scripts/scythe/proclist/__init__.py | scythe-io/community-modules | bc0d16e30a928f3ba11aecfa6cbac760b1de529b | [
"MIT"
] | null | null | null | proclist/scripts/scythe/proclist/__init__.py | scythe-io/community-modules | bc0d16e30a928f3ba11aecfa6cbac760b1de529b | [
"MIT"
] | null | null | null | from .proclist import * | 23 | 23 | 0.782609 | from .proclist import * | true | true |
1c3f61758a2bea75a69023c5d49c913db0bf27eb | 4,747 | py | Python | PyOpenGL/GLUT/ex10 - ProjectionMatrix - A MESS/main.py | hoppfull/Legacy-Python | 43f465bfdb76c91f2ac16aabb0783fdf5f459adb | [
"MIT"
] | null | null | null | PyOpenGL/GLUT/ex10 - ProjectionMatrix - A MESS/main.py | hoppfull/Legacy-Python | 43f465bfdb76c91f2ac16aabb0783fdf5f459adb | [
"MIT"
] | null | null | null | PyOpenGL/GLUT/ex10 - ProjectionMatrix - A MESS/main.py | hoppfull/Legacy-Python | 43f465bfdb76c91f2ac16aabb0783fdf5f459adb | [
"MIT"
] | null | null | null | import utils_engine, utils_math, utils_resource
import OpenGL.GL as GL
import OpenGL.GL.shaders as GL_shaders
import numpy as np
import ctypes as c
class MyApp(utils_engine.GameEngine):
def __init__(self, name, width, height):
utils_engine.GameEngine.__init__(self, name, width, height)
def set... | 43.154545 | 139 | 0.552138 | import utils_engine, utils_math, utils_resource
import OpenGL.GL as GL
import OpenGL.GL.shaders as GL_shaders
import numpy as np
import ctypes as c
class MyApp(utils_engine.GameEngine):
def __init__(self, name, width, height):
utils_engine.GameEngine.__init__(self, name, width, height)
def set... | true | true |
1c3f645e30bcabf29bc1edf77a2662965cc28fd6 | 655 | py | Python | functional_tests/factory/__init__.py | vindeolal/pari | 8c69d15101480c3e803d6d74f8007cefee20c350 | [
"BSD-3-Clause"
] | null | null | null | functional_tests/factory/__init__.py | vindeolal/pari | 8c69d15101480c3e803d6d74f8007cefee20c350 | [
"BSD-3-Clause"
] | null | null | null | functional_tests/factory/__init__.py | vindeolal/pari | 8c69d15101480c3e803d6d74f8007cefee20c350 | [
"BSD-3-Clause"
] | null | null | null | from author_factory import AuthorFactory
from page_factory import PageFactory
from page_factory import ContentTypeFactory
from home_page_factory import HomePageFactory
from article_factory import ArticleFactory
from category_factory import CategoryFactory
from location_factory import LocationFactory
from album_factory ... | 43.666667 | 60 | 0.90687 | from author_factory import AuthorFactory
from page_factory import PageFactory
from page_factory import ContentTypeFactory
from home_page_factory import HomePageFactory
from article_factory import ArticleFactory
from category_factory import CategoryFactory
from location_factory import LocationFactory
from album_factory ... | true | true |
1c3f66e91094f62aa9f4d2795bd6a5c95d2780dd | 381 | py | Python | 1f_http_server/python/fastapi_srv.py | pjuangph/python2rust | cc99abe8738e5d1d7d9a34debb2892186ff77965 | [
"CC0-1.0"
] | 24 | 2021-07-09T13:56:45.000Z | 2022-03-26T19:44:00.000Z | 1f_http_server/python/fastapi_srv.py | pjuangph/python2rust | cc99abe8738e5d1d7d9a34debb2892186ff77965 | [
"CC0-1.0"
] | null | null | null | 1f_http_server/python/fastapi_srv.py | pjuangph/python2rust | cc99abe8738e5d1d7d9a34debb2892186ff77965 | [
"CC0-1.0"
] | 3 | 2021-07-09T17:16:31.000Z | 2022-03-24T15:44:44.000Z | from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
app = FastAPI()
app.mount("/static", StaticFiles(directory="../static"), name="static")
@app.get("/")
@app.get("/hello/{name}")
async def root(name: str = "World"):
return {"message": f"Hello, {name}!"}
@app.get("/items/{item_id}")
async ... | 21.166667 | 71 | 0.671916 | from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
app = FastAPI()
app.mount("/static", StaticFiles(directory="../static"), name="static")
@app.get("/")
@app.get("/hello/{name}")
async def root(name: str = "World"):
return {"message": f"Hello, {name}!"}
@app.get("/items/{item_id}")
async ... | true | true |
1c3f6817d7d24807136393dde05bea0604f29c9c | 18,102 | py | Python | tests/test_isoparser.py | cccntu/dateutil | 86ab39008e6eddce2b0837553d9ff42aee25c783 | [
"Apache-2.0"
] | null | null | null | tests/test_isoparser.py | cccntu/dateutil | 86ab39008e6eddce2b0837553d9ff42aee25c783 | [
"Apache-2.0"
] | null | null | null | tests/test_isoparser.py | cccntu/dateutil | 86ab39008e6eddce2b0837553d9ff42aee25c783 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import datetime, timedelta, date, time
import itertools as it
from bs_dateutil import tz
from bs_dateutil.tz import UTC
from bs_dateutil.parser import isoparser, isoparse
import pytest
import six
def _generate_tzoffsets(limited):
def... | 30.270903 | 88 | 0.610872 | from __future__ import unicode_literals
from datetime import datetime, timedelta, date, time
import itertools as it
from bs_dateutil import tz
from bs_dateutil.tz import UTC
from bs_dateutil.parser import isoparser, isoparse
import pytest
import six
def _generate_tzoffsets(limited):
def _mkoffset(hmtuple, fmt)... | true | true |
1c3f6935c2fe92c6a0e7e7de5c115dad5830b9da | 1,414 | py | Python | examples/resnet_app.py | yaoxuefeng6/FleetX | 4e1a77789b76eccc20154a7e2ad2b120ffc512c4 | [
"Apache-2.0"
] | null | null | null | examples/resnet_app.py | yaoxuefeng6/FleetX | 4e1a77789b76eccc20154a7e2ad2b120ffc512c4 | [
"Apache-2.0"
] | null | null | null | examples/resnet_app.py | yaoxuefeng6/FleetX | 4e1a77789b76eccc20154a7e2ad2b120ffc512c4 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 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... | 36.25641 | 74 | 0.7843 | import fleetx as X
import paddle
import paddle.distributed.fleet as fleet
configs = X.parse_train_configs()
fleet.init(is_collective=True)
model = X.applications.Resnet50()
imagenet_downloader = X.utils.ImageNetDownloader()
local_path = imagenet_downloader.download_from_bos(local_path='./data')
loader = model.load_im... | true | true |
1c3f693af9e7d5604a693ebf041c5169a43922a3 | 12,733 | py | Python | sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content.py | detienne20/azure-sdk-for-python | f3522cd897ca6adf113b1a1204a2627d8ba76a6b | [
"MIT"
] | null | null | null | sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content.py | detienne20/azure-sdk-for-python | f3522cd897ca6adf113b1a1204a2627d8ba76a6b | [
"MIT"
] | 15 | 2019-07-12T18:18:04.000Z | 2019-07-25T20:55:51.000Z | sdk/formrecognizer/azure-ai-formrecognizer/tests/test_content.py | detienne20/azure-sdk-for-python | f3522cd897ca6adf113b1a1204a2627d8ba76a6b | [
"MIT"
] | 1 | 2020-07-05T21:13:37.000Z | 2020-07-05T21:13:37.000Z | # coding=utf-8
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import pytest
import functools
from io import BytesIO
from azure.core.exceptions import ServiceRequestError, ClientAuthenticationError, HttpResponseError... | 41.074194 | 130 | 0.693317 |
import pytest
import functools
from io import BytesIO
from azure.core.exceptions import ServiceRequestError, ClientAuthenticationError, HttpResponseError
from azure.core.credentials import AzureKeyCredential
from azure.ai.formrecognizer._generated.models import AnalyzeOperationResult
from azure.ai.formrecognizer._resp... | true | true |
1c3f6a5f08afd75c67f920ff05c9b729750be194 | 35 | py | Python | TechAdoption/__init__.py | Epeiffer1/TechAdoption | 54dcdf95ba19699f6fc901e92551fb71557d2f23 | [
"MIT"
] | 15 | 2021-08-05T17:58:38.000Z | 2022-03-29T22:16:37.000Z | TechAdoption/__init__.py | Epeiffer1/TechAdoption | 54dcdf95ba19699f6fc901e92551fb71557d2f23 | [
"MIT"
] | null | null | null | TechAdoption/__init__.py | Epeiffer1/TechAdoption | 54dcdf95ba19699f6fc901e92551fb71557d2f23 | [
"MIT"
] | 1 | 2020-06-12T18:07:52.000Z | 2020-06-12T18:07:52.000Z | # Dummy file to make this a package | 35 | 35 | 0.771429 | true | true | |
1c3f6ad824ec4cf4650b2b94fd15be8fa9305a23 | 21,915 | py | Python | dist_filter_torch.py | ShansanChu/filter_pruning_fpgm | ea24a5a8aaa2642937a7655eddb5b0c8c8328d3f | [
"MIT"
] | 4 | 2021-02-01T15:08:09.000Z | 2021-07-15T08:47:33.000Z | dist_filter_torch.py | ShansanChu/filter_pruning_fpgm | ea24a5a8aaa2642937a7655eddb5b0c8c8328d3f | [
"MIT"
] | null | null | null | dist_filter_torch.py | ShansanChu/filter_pruning_fpgm | ea24a5a8aaa2642937a7655eddb5b0c8c8328d3f | [
"MIT"
] | 2 | 2021-01-11T12:54:44.000Z | 2021-01-17T13:01:32.000Z | '''
filter pruners with FPGM
'''
import argparse
import os
import json
import torch
import sys
import numpy as np
import torch.nn.parallel
import torch.utils.data.distributed
from torch.optim.lr_scheduler import StepLR, MultiStepLR
from torchvision import datasets, transforms
import time
from models.mnist.lenet import... | 43.310277 | 145 | 0.630116 |
import argparse
import os
import json
import torch
import sys
import numpy as np
import torch.nn.parallel
import torch.utils.data.distributed
from torch.optim.lr_scheduler import StepLR, MultiStepLR
from torchvision import datasets, transforms
import time
from models.mnist.lenet import LeNet
from models.cifar10.vgg im... | true | true |
1c3f6b75a0f5defb105eb5e2aee525e5912bf9b8 | 35,124 | py | Python | pytrx/async_tron.py | Connor-Holmes/PyTRX | 7d129f27a6e87c1f1bdad93a7ae9503390b2ec70 | [
"MIT"
] | null | null | null | pytrx/async_tron.py | Connor-Holmes/PyTRX | 7d129f27a6e87c1f1bdad93a7ae9503390b2ec70 | [
"MIT"
] | null | null | null | pytrx/async_tron.py | Connor-Holmes/PyTRX | 7d129f27a6e87c1f1bdad93a7ae9503390b2ec70 | [
"MIT"
] | null | null | null | from typing import Union, Tuple, Optional
import asyncio
from typing import Union, Tuple
import time
from pprint import pprint
import json
from decimal import Decimal
from pytrx import keys
from pytrx.async_contract import AsyncContract, ShieldedTRC20, AsyncContractMethod
from pytrx.keys import PrivateKey
from pytrx.a... | 38.428884 | 120 | 0.607875 | from typing import Union, Tuple, Optional
import asyncio
from typing import Union, Tuple
import time
from pprint import pprint
import json
from decimal import Decimal
from pytrx import keys
from pytrx.async_contract import AsyncContract, ShieldedTRC20, AsyncContractMethod
from pytrx.keys import PrivateKey
from pytrx.a... | true | true |
1c3f6d28293ce3580e61d89bb0ac676e5899d742 | 1,247 | py | Python | conanfile.py | jkleinecke/util | 8dab223de686e15165b11e56deabdc21d0f063ab | [
"MIT"
] | null | null | null | conanfile.py | jkleinecke/util | 8dab223de686e15165b11e56deabdc21d0f063ab | [
"MIT"
] | null | null | null | conanfile.py | jkleinecke/util | 8dab223de686e15165b11e56deabdc21d0f063ab | [
"MIT"
] | null | null | null | from conans import ConanFile, CMake, tools
import os
class UtilConan(ConanFile):
name = "util"
version = "0.1"
license = "<Put the package license here>"
url = "<Package recipe repository url here, for issues about the package>"
settings = "os", "compiler", "build_type", "arch"
generators = "c... | 34.638889 | 91 | 0.588613 | from conans import ConanFile, CMake, tools
import os
class UtilConan(ConanFile):
name = "util"
version = "0.1"
license = "<Put the package license here>"
url = "<Package recipe repository url here, for issues about the package>"
settings = "os", "compiler", "build_type", "arch"
generators = "c... | true | true |
1c3f6f00a36362626b78c0c97b85523d99e1c6cc | 3,042 | py | Python | corehq/messaging/smsbackends/apposit/models.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 1 | 2020-07-14T13:00:23.000Z | 2020-07-14T13:00:23.000Z | corehq/messaging/smsbackends/apposit/models.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 94 | 2020-12-11T06:57:31.000Z | 2022-03-15T10:24:06.000Z | corehq/messaging/smsbackends/apposit/models.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | null | null | null | import json
import requests
from corehq.apps.sms.models import SMS, SQLSMSBackend
from corehq.apps.sms.util import strip_plus
from corehq.messaging.smsbackends.apposit.forms import AppositBackendForm
from django.conf import settings
ETHIOPIA_COUNTRY_CODE = '251'
class AppositException(Exception):
pass
class S... | 28.971429 | 114 | 0.636752 | import json
import requests
from corehq.apps.sms.models import SMS, SQLSMSBackend
from corehq.apps.sms.util import strip_plus
from corehq.messaging.smsbackends.apposit.forms import AppositBackendForm
from django.conf import settings
ETHIOPIA_COUNTRY_CODE = '251'
class AppositException(Exception):
pass
class S... | true | true |
1c3f6f55e0cfc68d9078c041efbc80f1919db067 | 924 | py | Python | apis/nb/clients/network_plug_and_play_client/models/ZtdDefaultImageListResult.py | CiscoDevNet/APIC-EM-Generic-Scripts- | 74211d9488f1e77cf56ef86dba20ec8e8eb49cc1 | [
"ECL-2.0",
"Apache-2.0"
] | 45 | 2016-06-09T15:41:25.000Z | 2019-08-06T17:13:11.000Z | apis/nb/clients/network_plug_and_play_client/models/ZtdDefaultImageListResult.py | CiscoDevNet/APIC-EM-Generic-Scripts | 74211d9488f1e77cf56ef86dba20ec8e8eb49cc1 | [
"ECL-2.0",
"Apache-2.0"
] | 36 | 2016-06-12T03:03:56.000Z | 2017-03-13T18:20:11.000Z | apis/nb/clients/network_plug_and_play_client/models/ZtdDefaultImageListResult.py | CiscoDevNet/APIC-EM-Generic-Scripts | 74211d9488f1e77cf56ef86dba20ec8e8eb49cc1 | [
"ECL-2.0",
"Apache-2.0"
] | 15 | 2016-06-22T03:51:37.000Z | 2019-07-10T10:06:02.000Z | #!/usr/bin/env python
#pylint: skip-file
# This source code is licensed under the Apache license found in the
# LICENSE file in the root directory of this project.
class ZtdDefaultImageListResult(object):
def __init__(self):
"""
Attributes:
swaggerTypes (dict): The key is attribute nam... | 23.1 | 97 | 0.50974 |
class ZtdDefaultImageListResult(object):
def __init__(self):
self.swaggerTypes = {
'version': 'str',
'response': 'list[ZtdDefaultImage]'
}
self.attributeMap = {
'version': 'version',
... | true | true |
1c3f6f7dd3a5fc91947f13b25f2556617e624240 | 2,433 | py | Python | linky_note/adapters/markdown/marko_ext/marko_builder.py | jb-delafosse/linky-note | 51249414531bab98e45465aab695285698d59d80 | [
"MIT"
] | 14 | 2021-02-26T16:21:02.000Z | 2022-01-17T20:30:40.000Z | linky_note/adapters/markdown/marko_ext/marko_builder.py | jb-delafosse/linky-note | 51249414531bab98e45465aab695285698d59d80 | [
"MIT"
] | 76 | 2021-02-25T06:34:58.000Z | 2022-03-30T19:06:26.000Z | linky_note/adapters/markdown/marko_ext/marko_builder.py | jb-delafosse/marko-backlinks | e7798ed49874a784b71e2a2a0ce0a1e7a1204389 | [
"MIT"
] | null | null | null | from typing import List, Optional, Union
from marko.block import BlankLine, Heading
from marko.block import List as MdList
from marko.block import ListItem, Paragraph
from marko.inline import Link, RawText
class MarkoBuilder:
@staticmethod
def build_raw_element(label: str) -> RawText:
raw_text = obje... | 31.192308 | 78 | 0.64776 | from typing import List, Optional, Union
from marko.block import BlankLine, Heading
from marko.block import List as MdList
from marko.block import ListItem, Paragraph
from marko.inline import Link, RawText
class MarkoBuilder:
@staticmethod
def build_raw_element(label: str) -> RawText:
raw_text = obje... | true | true |
1c3f70d650130584622f48491aba3dd16d3a1053 | 3,873 | py | Python | paper/notebooks/util/kfac.py | npshub/last_layer_laplace | 31ec9b70a292e9783e9005425793199a8830bf01 | [
"BSD-3-Clause"
] | 60 | 2020-07-05T05:31:19.000Z | 2022-02-07T05:05:40.000Z | paper/notebooks/util/kfac.py | npshub/last_layer_laplace | 31ec9b70a292e9783e9005425793199a8830bf01 | [
"BSD-3-Clause"
] | 8 | 2020-07-15T18:27:53.000Z | 2021-10-18T07:53:22.000Z | paper/notebooks/util/kfac.py | npshub/last_layer_laplace | 31ec9b70a292e9783e9005425793199a8830bf01 | [
"BSD-3-Clause"
] | 12 | 2020-07-14T11:44:10.000Z | 2021-11-06T03:10:15.000Z | ##########################################################################
#
# Taken with modifications from
# https://github.com/wjmaddox/swa_gaussian/
#
##########################################################################
import torch
import torch.nn.functional as F
from torch.optim.optimizer import Optimi... | 33.678261 | 77 | 0.506584 |
import torch
import torch.nn.functional as F
from torch.optim.optimizer import Optimizer
class KFAC(Optimizer):
def __init__(self, net, alpha=0.95):
self.alpha = alpha
self.params = []
self._fwd_handles = []
self._bwd_handles = []
self._iteration_counter = 0
fo... | true | true |
1c3f7124803e580cd7296463519e07f704c99418 | 1,728 | py | Python | anchore_engine/subsys/discovery.py | roachmd/anchore-engine | 521d6796778139a95f51542670714205c2735a81 | [
"Apache-2.0"
] | null | null | null | anchore_engine/subsys/discovery.py | roachmd/anchore-engine | 521d6796778139a95f51542670714205c2735a81 | [
"Apache-2.0"
] | null | null | null | anchore_engine/subsys/discovery.py | roachmd/anchore-engine | 521d6796778139a95f51542670714205c2735a81 | [
"Apache-2.0"
] | null | null | null | """
Utilities for service discovery. Basic methods are lookup and return of a list of endpoints given a service name.
Will use the local config as authority if entry is found or defer to the database for a lookup if necessary.
"""
import re
from anchore_engine.configuration import localconfig
from anchore_engine.db i... | 38.4 | 117 | 0.624421 |
import re
from anchore_engine.configuration import localconfig
from anchore_engine.db import db_services, session_scope
from anchore_engine.subsys import logger
def get_endpoints(service_name):
local_conf = localconfig.get_config()
urls = []
try:
if service_name + '_endpoint' in local_conf:
... | true | true |
1c3f7196de24de8454c0187dbe0a0fbd829d34ed | 630 | py | Python | setup.py | hsph/micropython-ili9341 | 1924159a32cf685812bd372d02b4ec2cb9c8e381 | [
"MIT"
] | null | null | null | setup.py | hsph/micropython-ili9341 | 1924159a32cf685812bd372d02b4ec2cb9c8e381 | [
"MIT"
] | null | null | null | setup.py | hsph/micropython-ili9341 | 1924159a32cf685812bd372d02b4ec2cb9c8e381 | [
"MIT"
] | null | null | null | import sys
sys.path.pop(0)
from setuptools import setup
setup(
name="micropython-ili9341",
py_modules=["ili934xnew"],
version="0.1.0",
description="Micropython Driver for ILI9341 display",
long_description="",
keywords="micropython tft lcd",
url="https://github.com/jeffmer/micropython-ili93... | 26.25 | 74 | 0.644444 | import sys
sys.path.pop(0)
from setuptools import setup
setup(
name="micropython-ili9341",
py_modules=["ili934xnew"],
version="0.1.0",
description="Micropython Driver for ILI9341 display",
long_description="",
keywords="micropython tft lcd",
url="https://github.com/jeffmer/micropython-ili93... | true | true |
1c3f7306637cd8a61fde0fb2b8d72c8f272b725a | 4,680 | py | Python | tasks/cron.py | jeeysie/site | f136050635cac9cc0174387ea60249f5e26e45a3 | [
"MIT"
] | 66 | 2019-05-13T11:45:14.000Z | 2020-11-02T11:58:52.000Z | tasks/cron.py | jeeysie/site | f136050635cac9cc0174387ea60249f5e26e45a3 | [
"MIT"
] | 9 | 2019-04-26T02:05:13.000Z | 2020-10-06T03:49:29.000Z | tasks/cron.py | jeeyshe/site | f136050635cac9cc0174387ea60249f5e26e45a3 | [
"MIT"
] | 20 | 2019-12-30T06:23:17.000Z | 2020-10-06T01:48:58.000Z | # coding: utf-8
"""
Created by Jeyrce.Lu 2020/4/4 下午5:16, contact with jeyrce@gmail.com or website https://www.lujianxin.com
---------------------------------------------------------------------------------------------------------
>>> 项目中的一些定时任务
"""
import logging
import datetime
import time
from django.core.mail impo... | 32.5 | 112 | 0.562179 | import logging
import datetime
import time
from django.core.mail import send_mail
from django.core.cache import caches
from django.contrib.auth import get_user_model
from django.template import loader
from tasks import app
from blog.models import Expand, Blog, Link
from tasks.mail import add_prefix, supervisor_receiv... | true | true |
1c3f74c3c64a04ce73e6cd9f4b7d8a0af43690df | 3,035 | py | Python | 18.Web Scraping with Python Scrapy - RM/03_Advanced_Techniques/form/form/settings.py | ptyadana/python-dojo | 98c7234b84f0afea99a091c7198342d66bbdff5b | [
"MIT"
] | 3 | 2020-06-01T04:17:18.000Z | 2020-12-18T03:05:55.000Z | 18.Web Scraping with Python Scrapy - RM/03_Advanced_Techniques/form/form/settings.py | ptyadana/python-dojo | 98c7234b84f0afea99a091c7198342d66bbdff5b | [
"MIT"
] | 1 | 2020-04-25T08:01:59.000Z | 2020-04-25T08:01:59.000Z | 18.Web Scraping with Python Scrapy - RM/03_Advanced_Techniques/form/form/settings.py | ptyadana/python-dojo | 98c7234b84f0afea99a091c7198342d66bbdff5b | [
"MIT"
] | 7 | 2020-04-26T10:02:36.000Z | 2021-06-08T05:12:46.000Z | # Scrapy settings for form project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# https://docs.scrapy.org/en/latest/topics/settings.html
# https://docs.scrapy.org/en/latest/topics/downloader-middleware.ht... | 34.101124 | 103 | 0.774629 |
BOT_NAME = 'form'
SPIDER_MODULES = ['form.spiders']
NEWSPIDER_MODULE = 'form.spiders'
ROBOTSTXT_OBEY = True
| true | true |
1c3f76c215b4fd57915de3ea39d046dee571fc8d | 859 | py | Python | LeetCode/0695. Max Area of Island/solution.py | InnoFang/oh-my-algorithms | f559dba371ce725a926725ad28d5e1c2facd0ab2 | [
"Apache-2.0"
] | 1 | 2017-03-31T15:24:01.000Z | 2017-03-31T15:24:01.000Z | LeetCode/0695. Max Area of Island/solution.py | InnoFang/Algorithm-Library | 1896b9d8b1fa4cd73879aaecf97bc32d13ae0169 | [
"Apache-2.0"
] | null | null | null | LeetCode/0695. Max Area of Island/solution.py | InnoFang/Algorithm-Library | 1896b9d8b1fa4cd73879aaecf97bc32d13ae0169 | [
"Apache-2.0"
] | null | null | null | """
728 / 728 test cases passed.
Runtime: 64 ms
Memory Usage: 15.3 MB
"""
class Solution:
def maxAreaOfIsland(self, grid: List[List[int]]) -> int:
ans, m, n = 0, len(grid), len(grid[0])
for i in range(m):
for j in range(n):
if grid[i][j] == 1:
que = co... | 35.791667 | 87 | 0.351572 | class Solution:
def maxAreaOfIsland(self, grid: List[List[int]]) -> int:
ans, m, n = 0, len(grid), len(grid[0])
for i in range(m):
for j in range(n):
if grid[i][j] == 1:
que = collections.deque([(i, j)])
grid[i][j] = 0
... | true | true |
1c3f784e25e1d1d8e3ba8a230dd11355ebb201ce | 52,836 | py | Python | second/pytorch/models/middle.py | robertkarklinsh/faster-more-furious | 2a5e34f829488acfa6fec84d800f409d590bd03c | [
"MIT"
] | 1 | 2019-05-20T03:43:18.000Z | 2019-05-20T03:43:18.000Z | second/pytorch/models/middle.py | pflab-ut/second.pytorch | c7bb659a7937ee62aef8049aeb055a457fcd8fa7 | [
"MIT"
] | null | null | null | second/pytorch/models/middle.py | pflab-ut/second.pytorch | c7bb659a7937ee62aef8049aeb055a457fcd8fa7 | [
"MIT"
] | null | null | null | import time
import numpy as np
import spconv
import torch
from torch import nn
from torch.nn import functional as F
from second.pytorch.models.resnet import SparseBasicBlock
from torchplus.nn import Empty, GroupNorm, Sequential
from torchplus.ops.array_ops import gather_nd, scatter_nd
from torchplus.tools import chan... | 39.577528 | 100 | 0.521557 | import time
import numpy as np
import spconv
import torch
from torch import nn
from torch.nn import functional as F
from second.pytorch.models.resnet import SparseBasicBlock
from torchplus.nn import Empty, GroupNorm, Sequential
from torchplus.ops.array_ops import gather_nd, scatter_nd
from torchplus.tools import chan... | true | true |
1c3f78da7320a443287010f3c5804dafaf315c80 | 11,094 | py | Python | pymatgen/io/tests/test_zeopp.py | Chessmag/pymatgen | 61a4bb7a1792e1ea2379abd45b3c40efb816fd64 | [
"MIT"
] | 1 | 2021-10-18T01:26:50.000Z | 2021-10-18T01:26:50.000Z | pymatgen/io/tests/test_zeopp.py | Chessmag/pymatgen | 61a4bb7a1792e1ea2379abd45b3c40efb816fd64 | [
"MIT"
] | null | null | null | pymatgen/io/tests/test_zeopp.py | Chessmag/pymatgen | 61a4bb7a1792e1ea2379abd45b3c40efb816fd64 | [
"MIT"
] | null | null | null | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
__author__ = "Bharat Medasani"
__copyright__ = "Copyright 2013, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "bkmedasani@lbl.gov"
__date__ = "Aug 2, 2013"
import un... | 39.06338 | 79 | 0.651343 |
__author__ = "Bharat Medasani"
__copyright__ = "Copyright 2013, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "bkmedasani@lbl.gov"
__date__ = "Aug 2, 2013"
import unittest
import os
import re
from pymatgen.core.periodic_table import Species
from pymatgen.core.structure imp... | true | true |
1c3f796b9f5638396fc79a7e1e9a7954890167dc | 523 | py | Python | tests/conftest.py | erlep/PyTest | 5524c2d684ee47ce75f76cf828c755cda23df73c | [
"MIT"
] | null | null | null | tests/conftest.py | erlep/PyTest | 5524c2d684ee47ce75f76cf828c755cda23df73c | [
"MIT"
] | null | null | null | tests/conftest.py | erlep/PyTest | 5524c2d684ee47ce75f76cf828c755cda23df73c | [
"MIT"
] | null | null | null | # In pytest, what is the use of conftest.py files? - https://bit.ly/3EVB7yn
import pytest
import sys
@pytest.fixture
def capture_stdout(monkeypatch):
buffer = {"stdout": "", "write_calls": 0}
def fake_write(s):
buffer["stdout"] += s
buffer["write_calls"] += 1
monkeypatch.setattr(sys.stdout, 'write', ... | 20.92 | 86 | 0.674952 |
import pytest
import sys
@pytest.fixture
def capture_stdout(monkeypatch):
buffer = {"stdout": "", "write_calls": 0}
def fake_write(s):
buffer["stdout"] += s
buffer["write_calls"] += 1
monkeypatch.setattr(sys.stdout, 'write', fake_write)
return buffer
@pytest.fixture(scope="session")
def db_conn()... | true | true |
1c3f79f859edbcb9220e7e3ffe94558764672e95 | 762 | py | Python | bokeh_app/data/synthetic_data_generator.py | goodteamname/spino | aa8c6cfa9f94a639c306d85ca6df2483108fda37 | [
"MIT"
] | null | null | null | bokeh_app/data/synthetic_data_generator.py | goodteamname/spino | aa8c6cfa9f94a639c306d85ca6df2483108fda37 | [
"MIT"
] | 9 | 2020-10-26T10:57:00.000Z | 2020-11-01T14:48:21.000Z | bokeh_app/data/synthetic_data_generator.py | goodteamname/spino | aa8c6cfa9f94a639c306d85ca6df2483108fda37 | [
"MIT"
] | 1 | 2020-10-26T10:41:31.000Z | 2020-10-26T10:41:31.000Z | import numpy as np
import matplotlib.pyplot as plt
t = np.linspace(0, 20, 1001)
noise = np.random.randn(1001)
T = np.pi # period
# Fourier series coefficients
a_0 = 1.
a_1 = 1.
a_2 = 2.
a_3 = 3.
b_1 = 4.
b_2 = 5.
b_3 = 6.
timeseries = a_0 \
+ a_1*np.cos(1*np.pi*t/T) \
+ a_2*np.cos(2*np.pi*t/T) \
+ a_... | 19.538462 | 68 | 0.635171 | import numpy as np
import matplotlib.pyplot as plt
t = np.linspace(0, 20, 1001)
noise = np.random.randn(1001)
T = np.pi
a_0 = 1.
a_1 = 1.
a_2 = 2.
a_3 = 3.
b_1 = 4.
b_2 = 5.
b_3 = 6.
timeseries = a_0 \
+ a_1*np.cos(1*np.pi*t/T) \
+ a_2*np.cos(2*np.pi*t/T) \
+ a_3*np.cos(3*np.pi*t/T) \
+ b_1*np.si... | true | true |
1c3f7a392ac2a8f3459f0a2fa8a65f80aba96efe | 285 | py | Python | renovation_logging/config/desktop.py | leam-tech/renovation_logging | 172be47b9b5f7a49590efcda3cf189687e514069 | [
"MIT"
] | 1 | 2021-06-19T12:10:12.000Z | 2021-06-19T12:10:12.000Z | renovation_logging/config/desktop.py | leam-tech/renovation_logging | 172be47b9b5f7a49590efcda3cf189687e514069 | [
"MIT"
] | null | null | null | renovation_logging/config/desktop.py | leam-tech/renovation_logging | 172be47b9b5f7a49590efcda3cf189687e514069 | [
"MIT"
] | 1 | 2021-06-19T12:10:15.000Z | 2021-06-19T12:10:15.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"module_name": "Renovation Logging",
"color": "grey",
"icon": "octicon octicon-file-directory",
"type": "module",
"label": _("Renovation Logging")
}
]
| 19 | 44 | 0.635088 | from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"module_name": "Renovation Logging",
"color": "grey",
"icon": "octicon octicon-file-directory",
"type": "module",
"label": _("Renovation Logging")
}
]
| true | true |
1c3f7ad4ef6b9d9d18d44be2d896e43eed4b7b8b | 66,169 | py | Python | workers/pull_request_worker/pull_request_worker.py | jnqqq/augur | c42306f656637bd0cd7e2a7e76b15dd232e76ad5 | [
"MIT"
] | 2 | 2021-08-31T06:54:27.000Z | 2021-11-15T03:18:50.000Z | workers/pull_request_worker/pull_request_worker.py | NToepke/augur | aef5edca1c8cea2698b6800ced68fa64acae4d76 | [
"MIT"
] | null | null | null | workers/pull_request_worker/pull_request_worker.py | NToepke/augur | aef5edca1c8cea2698b6800ced68fa64acae4d76 | [
"MIT"
] | null | null | null | #SPDX-License-Identifier: MIT
import ast
import json
import logging
import os
import sys
import time
import traceback
from workers.worker_git_integration import WorkerGitInterfaceable
from numpy.lib.utils import source
import requests
import copy
from datetime import datetime
from multiprocessing import Process, Queue
... | 45.760028 | 192 | 0.534344 | import ast
import json
import logging
import os
import sys
import time
import traceback
from workers.worker_git_integration import WorkerGitInterfaceable
from numpy.lib.utils import source
import requests
import copy
from datetime import datetime
from multiprocessing import Process, Queue
import pandas as pd
import sql... | true | true |
1c3f7b58800d085db2e92f96db154a84a24c2a7d | 1,168 | py | Python | plotly/validators/scattercarpet/stream/__init__.py | piyush1301/plotly.py | 50cd5c4cd4732042422751c7760acbab8dd8a50d | [
"MIT"
] | 6 | 2019-05-03T02:12:04.000Z | 2020-03-01T06:33:21.000Z | plotly/validators/scattercarpet/stream/__init__.py | piyush1301/plotly.py | 50cd5c4cd4732042422751c7760acbab8dd8a50d | [
"MIT"
] | null | null | null | plotly/validators/scattercarpet/stream/__init__.py | piyush1301/plotly.py | 50cd5c4cd4732042422751c7760acbab8dd8a50d | [
"MIT"
] | 5 | 2019-05-18T16:50:11.000Z | 2021-07-06T21:14:36.000Z |
import _plotly_utils.basevalidators
class TokenValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name='token',
parent_name='scattercarpet.stream',
**kwargs
):
super(TokenValidator, self).__init__(
plotly_name=plotly_name,... | 25.955556 | 71 | 0.590753 |
import _plotly_utils.basevalidators
class TokenValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name='token',
parent_name='scattercarpet.stream',
**kwargs
):
super(TokenValidator, self).__init__(
plotly_name=plotly_name,... | true | true |
1c3f7b8f6dcb7dec90206974a40dcaca5fa5ba83 | 1,131 | py | Python | migrations/versions/efeb5cce78ac_users_table.py | danisaleem/Flask_App | bb3709fedd1cb40d36f2b91964b54875c55e9091 | [
"MIT"
] | null | null | null | migrations/versions/efeb5cce78ac_users_table.py | danisaleem/Flask_App | bb3709fedd1cb40d36f2b91964b54875c55e9091 | [
"MIT"
] | 1 | 2020-05-14T16:31:48.000Z | 2021-04-27T01:19:46.000Z | migrations/versions/efeb5cce78ac_users_table.py | danisaleem/Flask_App | bb3709fedd1cb40d36f2b91964b54875c55e9091 | [
"MIT"
] | null | null | null | """users table
Revision ID: efeb5cce78ac
Revises:
Create Date: 2020-03-23 00:01:22.028648
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'efeb5cce78ac'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto genera... | 29 | 80 | 0.678161 | from alembic import op
import sqlalchemy as sa
revision = 'efeb5cce78ac'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
op.create_table('user',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('username', sa.String(length=64), nullable=True),
sa.Column('email'... | true | true |
1c3f7bdad58bdc7300886175b27dda17fa0bda59 | 374 | py | Python | JiYouMCC/0016/0016.py | hooting/show-me-the-code-python | 0026ee495eade7c28aa5a1249716b1fdc20a141c | [
"MIT"
] | null | null | null | JiYouMCC/0016/0016.py | hooting/show-me-the-code-python | 0026ee495eade7c28aa5a1249716b1fdc20a141c | [
"MIT"
] | null | null | null | JiYouMCC/0016/0016.py | hooting/show-me-the-code-python | 0026ee495eade7c28aa5a1249716b1fdc20a141c | [
"MIT"
] | null | null | null | import xlwt
import json
import sys
reload(sys)
sys.setdefaultencoding('utf8')
file = xlwt.Workbook(encoding='utf-8')
table = file.add_sheet('numbers', cell_overwrite_ok=True)
txt = open('numbers.txt').read()
json_txt = json.loads(txt)
for x in range(len(json_txt)):
for y in range(len(json_txt[x])):
table... | 22 | 57 | 0.703209 | import xlwt
import json
import sys
reload(sys)
sys.setdefaultencoding('utf8')
file = xlwt.Workbook(encoding='utf-8')
table = file.add_sheet('numbers', cell_overwrite_ok=True)
txt = open('numbers.txt').read()
json_txt = json.loads(txt)
for x in range(len(json_txt)):
for y in range(len(json_txt[x])):
table... | true | true |
1c3f7d2811a924f7d780fcfee57f6ad8a841e5a7 | 39,337 | py | Python | mesh_tensorflow/bert/run_classifier.py | jinoobaek-qz/mesh | 99a7c089bd6c3919dce898b1c77a4e2f7b4cf275 | [
"Apache-2.0"
] | 1 | 2021-04-18T08:25:31.000Z | 2021-04-18T08:25:31.000Z | mesh_tensorflow/bert/run_classifier.py | jinoobaek-qz/mesh | 99a7c089bd6c3919dce898b1c77a4e2f7b4cf275 | [
"Apache-2.0"
] | null | null | null | mesh_tensorflow/bert/run_classifier.py | jinoobaek-qz/mesh | 99a7c089bd6c3919dce898b1c77a4e2f7b4cf275 | [
"Apache-2.0"
] | 1 | 2021-07-06T23:06:05.000Z | 2021-07-06T23:06:05.000Z | # coding=utf-8
# Copyright 2019 The Mesh TensorFlow Authors.
#
# 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 applicab... | 36.155331 | 82 | 0.67237 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import csv
import os
import mesh_tensorflow as mtf
import mesh_tensorflow.bert.bert as bert_lib
import mesh_tensorflow.bert.optimization as optimization_lib
import mesh_tensorflow.bert.tok... | true | true |
1c3f7e11db8df3b681d8d8f066e13f183429620e | 262 | py | Python | tests/artificial/transf_Logit/trend_PolyTrend/cycle_7/ar_12/test_artificial_128_Logit_PolyTrend_7_12_100.py | shaido987/pyaf | b9afd089557bed6b90b246d3712c481ae26a1957 | [
"BSD-3-Clause"
] | 377 | 2016-10-13T20:52:44.000Z | 2022-03-29T18:04:14.000Z | tests/artificial/transf_Logit/trend_PolyTrend/cycle_7/ar_12/test_artificial_128_Logit_PolyTrend_7_12_100.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 160 | 2016-10-13T16:11:53.000Z | 2022-03-28T04:21:34.000Z | tests/artificial/transf_Logit/trend_PolyTrend/cycle_7/ar_12/test_artificial_128_Logit_PolyTrend_7_12_100.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 63 | 2017-03-09T14:51:18.000Z | 2022-03-27T20:52:57.000Z | import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "PolyTrend", cycle_length = 7, transform = "Logit", sigma = 0.0, exog_count = 100, ar_order = 12); | 37.428571 | 162 | 0.729008 | import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "PolyTrend", cycle_length = 7, transform = "Logit", sigma = 0.0, exog_count = 100, ar_order = 12); | true | true |
1c3f7f0265ab655f120e105f8a3c29e9c4dc37c2 | 8,752 | py | Python | FuzzingTool_Dialog_ObjectFileChoose_Child.py | Ryu-Miyaki/Fuzz4B | 8546f165d4dbdd97eb6ab5a6f4c445ee81ec364b | [
"MIT"
] | 16 | 2020-06-25T11:56:59.000Z | 2022-02-05T14:00:12.000Z | FuzzingTool_Dialog_ObjectFileChoose_Child.py | Ryu-Miyaki/Fuzz4B | 8546f165d4dbdd97eb6ab5a6f4c445ee81ec364b | [
"MIT"
] | null | null | null | FuzzingTool_Dialog_ObjectFileChoose_Child.py | Ryu-Miyaki/Fuzz4B | 8546f165d4dbdd97eb6ab5a6f4c445ee81ec364b | [
"MIT"
] | null | null | null | import wx
import FuzzingTool
import pyperclip
# Implementing Dialog_ObjectFileChoose
class FuzzingTool_Dialog_ObjectFileChoose_Child( wx.Dialog ):
def __init__( self, parent ):
wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = wx.EmptyString, pos = wx.DefaultPosition, size = wx.DefaultSize, style = 0 )
... | 46.802139 | 305 | 0.776165 | import wx
import FuzzingTool
import pyperclip
class FuzzingTool_Dialog_ObjectFileChoose_Child( wx.Dialog ):
def __init__( self, parent ):
wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = wx.EmptyString, pos = wx.DefaultPosition, size = wx.DefaultSize, style = 0 )
self.SetSizeHints( wx.DefaultSize, wx.D... | true | true |
1c3f7feb8162ecf2c73e47b82f212ad4cf57200f | 13,530 | py | Python | orcid_api/models/work.py | jpeerz/NZ-ORCID-Hub | ba412d49cff0158842878753b65fc60731df158c | [
"MIT"
] | null | null | null | orcid_api/models/work.py | jpeerz/NZ-ORCID-Hub | ba412d49cff0158842878753b65fc60731df158c | [
"MIT"
] | null | null | null | orcid_api/models/work.py | jpeerz/NZ-ORCID-Hub | ba412d49cff0158842878753b65fc60731df158c | [
"MIT"
] | null | null | null | # coding: utf-8
"""
ORCID Member
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: Latest
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import r... | 26.425781 | 690 | 0.566593 |
from pprint import pformat
from six import iteritems
import re
class Work(object):
def __init__(self, created_date=None, last_modified_date=None, source=None, put_code=None, path=None, title=None, journal_title=None, short_description=None, citation=None, type=None, publication_date=None, external_ids=None, ur... | true | true |
1c3f804e9ac4240a15574562410b12ae5fd62227 | 1,472 | py | Python | train.py | train255/Silent-Face-Anti-Spoofing | e2137cde55ba4c7b43c2a7d6340d827a106b7404 | [
"Apache-2.0"
] | null | null | null | train.py | train255/Silent-Face-Anti-Spoofing | e2137cde55ba4c7b43c2a7d6340d827a106b7404 | [
"Apache-2.0"
] | null | null | null | train.py | train255/Silent-Face-Anti-Spoofing | e2137cde55ba4c7b43c2a7d6340d827a106b7404 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# @Time : 20-6-3 下午5:39
# @Author : zhuying
# @Company : Minivision
# @File : train.py
# @Software : PyCharm
import argparse
import os
from src.train_main import TrainMain
from src.default_config import get_default_config, update_config
def parse_args():
"""parsing and configuration"""
... | 36.8 | 90 | 0.683424 |
import argparse
import os
from src.train_main import TrainMain
from src.default_config import get_default_config, update_config
def parse_args():
desc = "Silence-FAS"
parser = argparse.ArgumentParser(description=desc)
parser.add_argument("--device_ids", type=str, default="1", help="which gpu id, 0123")
... | true | true |
1c3f8190c1626094869fa84261e62d28256a508c | 126,857 | py | Python | tests/models/layoutlmv2/test_tokenization_layoutlmv2.py | manuelciosici/transformers | c33f6046c3dab8f41bedf893404e6469dea3bce8 | [
"Apache-2.0"
] | 8,028 | 2018-11-05T15:19:44.000Z | 2019-07-16T09:14:59.000Z | tests/models/layoutlmv2/test_tokenization_layoutlmv2.py | ymwangg/transformers | 4a419d4995111c22d6842ee1bcd2d3f500150845 | [
"Apache-2.0"
] | 731 | 2018-11-05T21:35:52.000Z | 2019-07-16T09:51:26.000Z | tests/models/layoutlmv2/test_tokenization_layoutlmv2.py | ymwangg/transformers | 4a419d4995111c22d6842ee1bcd2d3f500150845 | [
"Apache-2.0"
] | 2,106 | 2018-11-05T15:29:15.000Z | 2019-07-16T08:51:57.000Z | # coding=utf-8
# Copyright 2021 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 52.312165 | 1,398 | 0.5848 |
import inspect
import os
import re
import shutil
import tempfile
import unittest
from typing import List
from transformers import AddedToken, LayoutLMv2TokenizerFast, SpecialTokensMixin, is_tf_available, is_torch_available
from transformers.models.layoutlmv2.tokenization_layoutlmv2 import (
VOCAB_FILES_NAMES,
... | true | true |
1c3f81fd472f006da3853fb2058fb95fb3cbadc3 | 371 | py | Python | hw/python/count_hi.py | petrroll/npfl104 | 241646b02e91c14ac885dd6cc981b5bb63d4561c | [
"MIT"
] | null | null | null | hw/python/count_hi.py | petrroll/npfl104 | 241646b02e91c14ac885dd6cc981b5bb63d4561c | [
"MIT"
] | null | null | null | hw/python/count_hi.py | petrroll/npfl104 | 241646b02e91c14ac885dd6cc981b5bb63d4561c | [
"MIT"
] | null | null | null | #!/usr/bin/python3
def count_hi(str):
return str.count("hi")
def assert_eq(a, b):
print(f"\tAct:{a}==Exp:{b}")
assert(a == b)
def test():
print(f"Test ({__file__}):")
assert_eq(count_hi(''), 0)
assert_eq(count_hi('hsi'), 0)
assert_eq(count_hi('hi'), 1)
assert_eq(count_hi('hihiqhi'), 3)
print(f"\tTes... | 19.526316 | 35 | 0.619946 | def count_hi(str):
return str.count("hi")
def assert_eq(a, b):
print(f"\tAct:{a}==Exp:{b}")
assert(a == b)
def test():
print(f"Test ({__file__}):")
assert_eq(count_hi(''), 0)
assert_eq(count_hi('hsi'), 0)
assert_eq(count_hi('hi'), 1)
assert_eq(count_hi('hihiqhi'), 3)
print(f"\tTests success.")
if ... | true | true |
1c3f82c9379220d89b5659c7a977fc50f113c0fe | 1,202 | py | Python | module4-software-testing-documentation-and-licensing/lambdata/lambdata_chancedurr/mod.py | ChanceDurr/DS-Unit-3-Sprint-1-Software-Engineering | 842b0fd9364964b9efa0ca06dfae37f07c1e8947 | [
"MIT"
] | null | null | null | module4-software-testing-documentation-and-licensing/lambdata/lambdata_chancedurr/mod.py | ChanceDurr/DS-Unit-3-Sprint-1-Software-Engineering | 842b0fd9364964b9efa0ca06dfae37f07c1e8947 | [
"MIT"
] | null | null | null | module4-software-testing-documentation-and-licensing/lambdata/lambdata_chancedurr/mod.py | ChanceDurr/DS-Unit-3-Sprint-1-Software-Engineering | 842b0fd9364964b9efa0ca06dfae37f07c1e8947 | [
"MIT"
] | null | null | null | import pandas as pd
import unittest
def checkNulls(dataframe):
df = dataframe
nulls = df.isnull().sum()
for col, null in nulls.items():
print(f"'{col}' has {null} null value(s).")
def addListToDataframe(alist, dataframe, colName='new_column'):
newCol = pd.DataFrame(alist, columns=[colName])
... | 23.115385 | 85 | 0.593178 | import pandas as pd
import unittest
def checkNulls(dataframe):
df = dataframe
nulls = df.isnull().sum()
for col, null in nulls.items():
print(f"'{col}' has {null} null value(s).")
def addListToDataframe(alist, dataframe, colName='new_column'):
newCol = pd.DataFrame(alist, columns=[colName])
... | true | true |
1c3f82ffb5f32873bb236afb3842f2862405b217 | 2,219 | py | Python | trustpay/__init__.py | RomanMelnyk113/trustpay-python | 2cf67469edcae3059c78bff83db9408c54b93f7f | [
"MIT"
] | null | null | null | trustpay/__init__.py | RomanMelnyk113/trustpay-python | 2cf67469edcae3059c78bff83db9408c54b93f7f | [
"MIT"
] | null | null | null | trustpay/__init__.py | RomanMelnyk113/trustpay-python | 2cf67469edcae3059c78bff83db9408c54b93f7f | [
"MIT"
] | null | null | null | class PaymentException(Exception):
pass
order_xml_string = '''<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03">
<CstmrCdtTrfInitn>
... | 31.253521 | 66 | 0.394322 | class PaymentException(Exception):
pass
order_xml_string = '''<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03">
<CstmrCdtTrfInitn>
... | true | true |
1c3f843b8d1393644c09337a3cb41a16c2b48573 | 1,048 | py | Python | jupyter_contrib_nbextensions/__init__.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | jupyter_contrib_nbextensions/__init__.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | jupyter_contrib_nbextensions/__init__.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import jupyter_nbextensions_configurator
__version__ = '0.3.0'
def _jupyter_server_extension_paths():
"""Magically-named function for jupyter extension installations."""
return []
def _jupyter_nbextension_paths():
"""Magically-named function for jupyter extension ins... | 29.942857 | 76 | 0.669847 |
import os
import jupyter_nbextensions_configurator
__version__ = '0.3.0'
def _jupyter_server_extension_paths():
return []
def _jupyter_nbextension_paths():
nbextension_dirs = [
os.path.join(os.path.dirname(__file__), 'nbextensions')]
specs = jupyter_nbextensions_configurator.get_configurable_... | true | true |
1c3f85598d6d10f7ad9295935ad03bf15f07982d | 5,117 | py | Python | Pheme5MainResponseWAE4Early.py | zperfet/PathFake | fe09e5f6d872d682ef9e27384edabdb9e2ee27e9 | [
"MIT"
] | null | null | null | Pheme5MainResponseWAE4Early.py | zperfet/PathFake | fe09e5f6d872d682ef9e27384edabdb9e2ee27e9 | [
"MIT"
] | null | null | null | Pheme5MainResponseWAE4Early.py | zperfet/PathFake | fe09e5f6d872d682ef9e27384edabdb9e2ee27e9 | [
"MIT"
] | 1 | 2022-01-03T15:26:06.000Z | 2022-01-03T15:26:06.000Z | # 相比MainPathVoting的不同之处:random使用全部路径文本;wae使用response path,即除去了源文本
# 二者使用不同的id编码,即每一条路径对应random path ids和wae response path ids
from models.PathBased import ResponseWAE, ResponseCatWAE, ResponseWAECat
from torch import optim
import datetime
from evaluate import *
from get_args import _args, print_args
from data_io... | 43 | 96 | 0.522767 | from models.PathBased import ResponseWAE, ResponseCatWAE, ResponseWAECat
from torch import optim
import datetime
from evaluate import *
from get_args import _args, print_args
from data_io import *
import sys
from torch.optim.lr_scheduler import StepLR
def main():
print_args(_args)
setup_seed(_... | true | true |
1c3f85e1028366c5f6c8a26ba5ec68082c8dc435 | 602 | py | Python | tools/gui_patch.py | facelessuser/Rummage | 74f0ce1b078eef40c3ba683dbc4638112f3b9bb7 | [
"MIT"
] | 55 | 2015-02-15T08:17:55.000Z | 2022-03-11T11:55:39.000Z | tools/gui_patch.py | facelessuser/Rummage | 74f0ce1b078eef40c3ba683dbc4638112f3b9bb7 | [
"MIT"
] | 264 | 2015-01-29T20:27:40.000Z | 2022-03-03T04:08:48.000Z | tools/gui_patch.py | facelessuser/Rummage | 74f0ce1b078eef40c3ba683dbc4638112f3b9bb7 | [
"MIT"
] | 12 | 2017-08-30T22:54:20.000Z | 2022-03-21T01:05:50.000Z | """Patch graphical user interface file."""
import codecs
import re
filename = 'rummage/lib/gui/gui.py'
with codecs.open(filename, 'r', encoding='utf-8') as f:
text = f.read()
# Add collapsible pane replacement
text = re.sub(
r'^((?:import|from)(?! \.controls\.collapsible_pane).*?)(\r?\n){2}',
r'\1\2from ... | 22.296296 | 92 | 0.646179 | import codecs
import re
filename = 'rummage/lib/gui/gui.py'
with codecs.open(filename, 'r', encoding='utf-8') as f:
text = f.read()
text = re.sub(
r'^((?:import|from)(?! \.controls\.collapsible_pane).*?)(\r?\n){2}',
r'\1\2from .controls.collapsible_pane import CollapsiblePane\2\2GUI_PATCHED = True\2\2',
... | true | true |
1c3f860e591eb1e16d50348d24e86f6ad56138e5 | 5,434 | py | Python | tests/test_parser.py | KyleRConway/knack | 73d76bae6fe4996f3ffea4bd24cf487b0263da85 | [
"MIT"
] | null | null | null | tests/test_parser.py | KyleRConway/knack | 73d76bae6fe4996f3ffea4bd24cf487b0263da85 | [
"MIT"
] | null | null | null | tests/test_parser.py | KyleRConway/knack | 73d76bae6fe4996f3ffea4bd24cf487b0263da85 | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 35.986755 | 94 | 0.645749 |
import unittest
from six import StringIO
from knack.parser import CLICommandParser
from knack.commands import CLICommand
from knack.arguments import enum_choice_list
from tests.util import MockContext
class TestParser(unittest.TestCase):
def setUp(self):
self.io = StringIO()
self.mock_ctx = Mock... | true | true |
1c3f863d25b01378b7e621472637297beaefc32f | 489 | py | Python | fonolo/api/realtime.py | Fonolo/fonolo-python | 2bc8b5bbdaea60f1fad34ead154a1804dcf73746 | [
"MIT"
] | null | null | null | fonolo/api/realtime.py | Fonolo/fonolo-python | 2bc8b5bbdaea60f1fad34ead154a1804dcf73746 | [
"MIT"
] | null | null | null | fonolo/api/realtime.py | Fonolo/fonolo-python | 2bc8b5bbdaea60f1fad34ead154a1804dcf73746 | [
"MIT"
] | null | null | null | #
# This file is part of the Fonolo Python Wrapper package.
#
# (c) Foncloud, Inc.
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
import re
from .requesthandler import RequestHandler
from ..exception.exception import FonoloException
cl... | 22.227273 | 73 | 0.728016 |
import re
from .requesthandler import RequestHandler
from ..exception.exception import FonoloException
class Realtime(object):
def __init__(self, _handler):
self.handler = _handler;
def get(self, _params=None):
return self.handler.get('realtime');
| true | true |
1c3f868dc109dce702dfbec5695442853f06239d | 2,740 | py | Python | exercises/4.0/ros2/src/myworkcell_support/launch/workcell.launch.py | Lrk114/industrial_training | 82070ab18e64410abbe1b8e02dd3d183177ebd0e | [
"Apache-2.0"
] | 1 | 2021-08-22T15:25:10.000Z | 2021-08-22T15:25:10.000Z | exercises/4.0/ros2/src/myworkcell_support/launch/workcell.launch.py | Lrk114/industrial_training | 82070ab18e64410abbe1b8e02dd3d183177ebd0e | [
"Apache-2.0"
] | null | null | null | exercises/4.0/ros2/src/myworkcell_support/launch/workcell.launch.py | Lrk114/industrial_training | 82070ab18e64410abbe1b8e02dd3d183177ebd0e | [
"Apache-2.0"
] | null | null | null | import os
import yaml
import launch
import launch_ros
from ament_index_python import get_package_share_directory
def get_package_file(package, file_path):
"""Get the location of a file installed in an ament package"""
package_path = get_package_share_directory(package)
absolute_file_path = os.path.join(pac... | 36.052632 | 99 | 0.654745 | import os
import yaml
import launch
import launch_ros
from ament_index_python import get_package_share_directory
def get_package_file(package, file_path):
package_path = get_package_share_directory(package)
absolute_file_path = os.path.join(package_path, file_path)
return absolute_file_path
def load_file(... | true | true |
1c3f86e294b56fda20f934bafc73878611a8c271 | 1,585 | py | Python | kiosk/views.py | leonrenkema/makerspaceleiden-crm | 36ea20f5b9e263e8f30b1831ae4a2b1d5b926d3c | [
"Apache-2.0"
] | 5 | 2019-03-12T21:38:32.000Z | 2021-11-06T15:26:56.000Z | kiosk/views.py | leonrenkema/makerspaceleiden-crm | 36ea20f5b9e263e8f30b1831ae4a2b1d5b926d3c | [
"Apache-2.0"
] | 33 | 2019-01-21T15:54:50.000Z | 2021-05-18T17:54:52.000Z | kiosk/views.py | leonrenkema/makerspaceleiden-crm | 36ea20f5b9e263e8f30b1831ae4a2b1d5b926d3c | [
"Apache-2.0"
] | 5 | 2019-01-21T15:47:26.000Z | 2021-09-22T07:14:34.000Z | import os
import logging
import json
from django.shortcuts import render
from django.contrib.sites.shortcuts import get_current_site
from django.utils.encoding import force_bytes, force_text
from django.utils.http import urlsafe_base64_encode, urlsafe_base64_decode
from django.template.loader import render_to_string
f... | 34.456522 | 86 | 0.828391 | import os
import logging
import json
from django.shortcuts import render
from django.contrib.sites.shortcuts import get_current_site
from django.utils.encoding import force_bytes, force_text
from django.utils.http import urlsafe_base64_encode, urlsafe_base64_decode
from django.template.loader import render_to_string
f... | true | true |
1c3f87d26f8903e3b82e12e48ff535ce57b1bf43 | 4,964 | py | Python | api/generated/python/azure-iiot-opc-registry/models/application_info_api_model.py | jaz230/Industrial-IoT | bd4c5abfe579cbb7086a621e8381978e6c70a563 | [
"MIT"
] | 1 | 2020-01-22T12:03:08.000Z | 2020-01-22T12:03:08.000Z | api/generated/python/azure-iiot-opc-registry/models/application_info_api_model.py | likithadt/Industrial-IoT | d4ea7b330eff08455ca0556fed76aa74d2034da5 | [
"MIT"
] | null | null | null | api/generated/python/azure-iiot-opc-registry/models/application_info_api_model.py | likithadt/Industrial-IoT | d4ea7b330eff08455ca0556fed76aa74d2034da5 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator 2.3.33.0
# ... | 47.27619 | 380 | 0.6666 |
from msrest.serialization import Model
class ApplicationInfoApiModel(Model):
_validation = {
'capabilities': {'unique': True},
'discovery_urls': {'unique': True},
'host_addresses': {'unique': True},
}
_attribute_map = {
'application_id': {'key': 'applicationId', 'type': ... | true | true |
1c3f89924bdc6392502c884a1fd372283dfdd904 | 9,069 | py | Python | yt/frontends/nc4_cm1/data_structures.py | Ronan-Hix/yt | 5ca4ab65e7486ee392577b0f24dbf2b56b892679 | [
"BSD-3-Clause-Clear"
] | 360 | 2017-04-24T05:06:04.000Z | 2022-03-31T10:47:07.000Z | yt/frontends/nc4_cm1/data_structures.py | chrishavlin/yt | 023680e3a7bd1000d601727e02a55e72b4cbdc75 | [
"BSD-3-Clause-Clear"
] | 2,077 | 2017-04-20T20:36:07.000Z | 2022-03-31T16:39:43.000Z | yt/frontends/nc4_cm1/data_structures.py | chrishavlin/yt | 023680e3a7bd1000d601727e02a55e72b4cbdc75 | [
"BSD-3-Clause-Clear"
] | 257 | 2017-04-19T20:52:28.000Z | 2022-03-29T12:23:52.000Z | import os
import stat
import weakref
from collections import OrderedDict
import numpy as np
from yt.data_objects.index_subobjects.grid_patch import AMRGridPatch
from yt.data_objects.static_output import Dataset
from yt.geometry.grid_geometry_handler import GridIndex
from yt.utilities.file_handler import NetCDF4FileHa... | 41.792627 | 88 | 0.603705 | import os
import stat
import weakref
from collections import OrderedDict
import numpy as np
from yt.data_objects.index_subobjects.grid_patch import AMRGridPatch
from yt.data_objects.static_output import Dataset
from yt.geometry.grid_geometry_handler import GridIndex
from yt.utilities.file_handler import NetCDF4FileHa... | true | true |
1c3f8a0bddd83d58c92ba7505f302d4e5c9c1774 | 353 | py | Python | python/example_from_ray_website.py | viper7882/binance-public-data | 94c77de455338b9a6b9bd03aeacbfd637e36c38a | [
"MIT"
] | null | null | null | python/example_from_ray_website.py | viper7882/binance-public-data | 94c77de455338b9a6b9bd03aeacbfd637e36c38a | [
"MIT"
] | null | null | null | python/example_from_ray_website.py | viper7882/binance-public-data | 94c77de455338b9a6b9bd03aeacbfd637e36c38a | [
"MIT"
] | null | null | null | import ray
import pandas as pd
import dask.dataframe as dd
# Create a Dataset from a list of Pandas DataFrame objects.
pdf = pd.DataFrame({"one": [1, 2, 3], "two": ["a", "b", "c"]})
ds = ray.data.from_pandas([ray.put(pdf)])
# Create a Dataset from a Dask-on-Ray DataFrame.
dask_df = dd.from_pandas(pdf, npartitions=10)... | 32.090909 | 62 | 0.70255 | import ray
import pandas as pd
import dask.dataframe as dd
pdf = pd.DataFrame({"one": [1, 2, 3], "two": ["a", "b", "c"]})
ds = ray.data.from_pandas([ray.put(pdf)])
dask_df = dd.from_pandas(pdf, npartitions=10)
ds = ray.data.from_dask(dask_df) | true | true |
1c3f8cb06461a4156bf8d23f4172c14cff4e6bf2 | 598 | py | Python | src/jk_utils/RandomStateID.py | jkpubsrc/python-module-jk-utils | 6bf97b3dcde7a970c20ca43323e2eb0dda8fbfb3 | [
"Apache-1.1"
] | null | null | null | src/jk_utils/RandomStateID.py | jkpubsrc/python-module-jk-utils | 6bf97b3dcde7a970c20ca43323e2eb0dda8fbfb3 | [
"Apache-1.1"
] | null | null | null | src/jk_utils/RandomStateID.py | jkpubsrc/python-module-jk-utils | 6bf97b3dcde7a970c20ca43323e2eb0dda8fbfb3 | [
"Apache-1.1"
] | null | null | null |
import os
import string
import random
class RandomStateID(object):
def __init__(self):
self.__randomStateID = self.__randomString()
#
def __randomString(self, stringLength:int = 32) -> str:
letters = string.ascii_letters + string.digits
return "".join(random.choice(letters) for i in range(str... | 8.794118 | 69 | 0.687291 |
import os
import string
import random
class RandomStateID(object):
def __init__(self):
self.__randomStateID = self.__randomString()
def __randomString(self, stringLength:int = 32) -> str:
letters = string.ascii_letters + string.digits
return "".join(random.choice(letters) for i in range(strin... | true | true |
1c3f8dbdef82b91ec5509d0b222966b281d8b193 | 3,943 | py | Python | ugrd-assistance-tools_win/[mr]-11_string-data-too-large.py | jungheum/cfreds-2017-winreg | ebdfc6a60849f1b8f0e9f2d35551cc1dfc012036 | [
"Apache-2.0"
] | 1 | 2020-04-11T15:33:13.000Z | 2020-04-11T15:33:13.000Z | ugrd-assistance-tools_win/[mr]-11_string-data-too-large.py | jungheum/cfreds-2017-winreg | ebdfc6a60849f1b8f0e9f2d35551cc1dfc012036 | [
"Apache-2.0"
] | null | null | null | ugrd-assistance-tools_win/[mr]-11_string-data-too-large.py | jungheum/cfreds-2017-winreg | ebdfc6a60849f1b8f0e9f2d35551cc1dfc012036 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
=============================================================================
* Description
MR (manipulated registry hives) category
> Primary class 3
: Invalid data size
> Secondary class 3.1
: String data too large
* Autho... | 36.509259 | 100 | 0.57824 | import sys
import os
from cftt_hive import *
assert len(sys.argv) == 2
BASE_ADJUST = 2
def mr_pc3_sc3_1(buffer, filesize):
hive = cftt_hive(buffer)
# get the offset of root cell (0x24 from the beginning of hive file)
header = hive.get_header(0)
offset = hive.calc_hive_offset(header.root_cell... | true | true |
1c3f8e91170c92d95f17968976a23f206f129654 | 633 | py | Python | backend/manage.py | crowdbotics-apps/trouble-32410 | 969cdd6acba7c469990763e99022c635463c0551 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/manage.py | crowdbotics-apps/trouble-32410 | 969cdd6acba7c469990763e99022c635463c0551 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/manage.py | crowdbotics-apps/trouble-32410 | 969cdd6acba7c469990763e99022c635463c0551 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'trouble_32410.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ... | 28.772727 | 77 | 0.685624 | import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'trouble_32410.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
1c3f8ead23fae09ca5bdafd4306caae855595ccc | 3,551 | py | Python | src/cryptocom/exchange/coins.py | stopkaya/cryptocom-exchange | 7518767682d574474f1ba90578e88044dde416a0 | [
"MIT"
] | null | null | null | src/cryptocom/exchange/coins.py | stopkaya/cryptocom-exchange | 7518767682d574474f1ba90578e88044dde416a0 | [
"MIT"
] | null | null | null | src/cryptocom/exchange/coins.py | stopkaya/cryptocom-exchange | 7518767682d574474f1ba90578e88044dde416a0 | [
"MIT"
] | null | null | null | from .structs import Coin
AAVE = Coin("AAVE")
ADA = Coin("ADA")
AGLD = Coin("AGLD")
ALGO = Coin("ALGO")
ALICE = Coin("ALICE")
AMP = Coin("AMP")
ANKR = Coin("ANKR")
ANY = Coin("ANY")
AR = Coin("AR")
ARPA = Coin("ARPA")
ATOM = Coin("ATOM")
AUDIO = Coin("AUDIO")
AVAX = Coin("AVAX")
AXS = Coin("AXS")
BADGER = Coin("BADGER... | 18.888298 | 50 | 0.58209 | from .structs import Coin
AAVE = Coin("AAVE")
ADA = Coin("ADA")
AGLD = Coin("AGLD")
ALGO = Coin("ALGO")
ALICE = Coin("ALICE")
AMP = Coin("AMP")
ANKR = Coin("ANKR")
ANY = Coin("ANY")
AR = Coin("AR")
ARPA = Coin("ARPA")
ATOM = Coin("ATOM")
AUDIO = Coin("AUDIO")
AVAX = Coin("AVAX")
AXS = Coin("AXS")
BADGER = Coin("BADGER... | true | true |
1c3f8ede1e1aadd1f25a41230d9299e775ebf67c | 4,257 | py | Python | src/commercetools/platform/client/in_store/by_project_key_in_store_key_by_store_key_request_builder.py | labd/commercetools-python-sdk | d8ec285f08d56ede2e4cad45c74833f5b609ab5c | [
"MIT"
] | 15 | 2018-11-02T14:35:52.000Z | 2022-03-16T07:51:44.000Z | src/commercetools/platform/client/in_store/by_project_key_in_store_key_by_store_key_request_builder.py | labd/commercetools-python-sdk | d8ec285f08d56ede2e4cad45c74833f5b609ab5c | [
"MIT"
] | 84 | 2018-11-02T12:50:32.000Z | 2022-03-22T01:25:54.000Z | src/commercetools/platform/client/in_store/by_project_key_in_store_key_by_store_key_request_builder.py | labd/commercetools-python-sdk | d8ec285f08d56ede2e4cad45c74833f5b609ab5c | [
"MIT"
] | 13 | 2019-01-03T09:16:50.000Z | 2022-02-15T18:37:19.000Z | # This file is automatically generated by the rmf-codegen project.
#
# The Python code generator is maintained by Lab Digital. If you want to
# contribute to this project then please do not edit this file directly
# but send a pull request to the Lab Digital fork of rmf-codegen at
# https://github.com/labd/rmf-codegen
... | 38.008929 | 106 | 0.742072 | import typing
import warnings
from ..carts.by_project_key_in_store_key_by_store_key_carts_request_builder import (
ByProjectKeyInStoreKeyByStoreKeyCartsRequestBuilder,
)
from ..customers.by_project_key_in_store_key_by_store_key_customers_request_builder import (
ByProjectKeyInStoreKeyByStoreKeyCustomersRequest... | true | true |
1c3f8ee1dd9402086a363d8ccd669aa80cb0fa94 | 9,101 | py | Python | test/functional/wallet_import_rescan.py | foxdproject/foxdcoin | 9db505f6f32bd3e51bd2b2da533744c98cee23af | [
"MIT"
] | 7 | 2020-06-19T20:49:02.000Z | 2022-01-31T09:12:18.000Z | test/functional/wallet_import_rescan.py | foxdproject/foxdcoin | 9db505f6f32bd3e51bd2b2da533744c98cee23af | [
"MIT"
] | 1 | 2021-02-26T19:14:11.000Z | 2021-02-26T19:14:11.000Z | test/functional/wallet_import_rescan.py | foxdproject/foxdcoin | 9db505f6f32bd3e51bd2b2da533744c98cee23af | [
"MIT"
] | 12 | 2020-05-02T20:01:44.000Z | 2022-03-03T11:02:13.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2017-2019 The Raven Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
Test wallet import RPCs.
Test rescan behavior of... | 46.912371 | 116 | 0.659048 |
import collections
import enum
import itertools
from test_framework.test_framework import FoxdcoinTestFramework
from test_framework.util import assert_raises_rpc_error, connect_nodes, sync_blocks, assert_equal, set_node_times
Call = enum.Enum("Call", "single multi")
Data = enum.Enum("Data", "address pub priv")
Resca... | true | true |
1c3f8f46878befe5b6837e93e3a1642a73da1eb5 | 30 | py | Python | mplib/__init__.py | 0000duck/MPlib | f5111db952a9ff1f712ef04b6c5ac3b8da8f1184 | [
"MIT"
] | 20 | 2021-09-15T05:06:25.000Z | 2022-03-21T13:37:44.000Z | mplib/__init__.py | 0000duck/MPlib | f5111db952a9ff1f712ef04b6c5ac3b8da8f1184 | [
"MIT"
] | 3 | 2021-09-27T22:04:41.000Z | 2022-03-07T05:15:34.000Z | mplib/__init__.py | haosulab/MPlib | f5111db952a9ff1f712ef04b6c5ac3b8da8f1184 | [
"MIT"
] | 4 | 2021-08-02T05:33:37.000Z | 2021-12-15T02:23:51.000Z | from .planner import Planner
| 10 | 28 | 0.8 | from .planner import Planner
| true | true |
1c3f8f46ce106fcbd00ff7ff44983e1404f53e64 | 5,922 | py | Python | kit_django/userAccount/models.py | safakoner/kit | aec36a70137febfb5f3e3a9205ea58879736eea4 | [
"MIT"
] | 6 | 2020-06-29T20:36:15.000Z | 2021-09-08T23:34:01.000Z | kit_django/userAccount/models.py | safakoner/kit | aec36a70137febfb5f3e3a9205ea58879736eea4 | [
"MIT"
] | 9 | 2021-03-30T13:46:29.000Z | 2022-03-12T00:38:27.000Z | kit_django/userAccount/models.py | safakoner/kit | aec36a70137febfb5f3e3a9205ea58879736eea4 | [
"MIT"
] | 1 | 2020-07-20T18:40:24.000Z | 2020-07-20T18:40:24.000Z | #
# ----------------------------------------------------------------------------------------------------
# DESCRIPTION
# ----------------------------------------------------------------------------------------------------
#
# --------------------------------------------------------------------------------------------... | 37.245283 | 127 | 0.465552 |
from django.db import models
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
from rest_framework.authtoken.models import Token
from core.randomValue import createRandomFileName
from userAccount.apps import UserAccount... | true | true |
1c3f8fbf9d1244edc2a9631eb825360a52a8b713 | 920 | py | Python | forms-flow-data-analysis-api/tests/unit/utils/test_logging.py | sreehari-aot/forms-flow-ai | 11e2fdd6da792aaa9dd46c0cec38564fe5916b58 | [
"Apache-2.0"
] | null | null | null | forms-flow-data-analysis-api/tests/unit/utils/test_logging.py | sreehari-aot/forms-flow-ai | 11e2fdd6da792aaa9dd46c0cec38564fe5916b58 | [
"Apache-2.0"
] | null | null | null | forms-flow-data-analysis-api/tests/unit/utils/test_logging.py | sreehari-aot/forms-flow-ai | 11e2fdd6da792aaa9dd46c0cec38564fe5916b58 | [
"Apache-2.0"
] | null | null | null | """Tests to assure the logging utilities.
Test-Suite to ensure that the logging setup is working as expected.
"""
import os
from api.utils.logging import log_error, log_info, setup_logging
def test_logging_with_file(capsys):
"""Assert that logging is setup with the configuration file."""
file_path = os.pat... | 28.75 | 88 | 0.736957 |
import os
from api.utils.logging import log_error, log_info, setup_logging
def test_logging_with_file(capsys):
file_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), "logging.conf")
setup_logging(file_path)
captured = capsys.readouterr()
assert captured.out.startswith("Configure log... | true | true |
1c3f8fd38b0665f47857eca6f549cdb202bf5080 | 5,283 | py | Python | Lib/ctypes/macholib/dyld.py | pxeger/cpython | 959580bd9ff8824590e8b24895bc2276f3f10b35 | [
"0BSD"
] | 52,316 | 2015-01-01T15:56:25.000Z | 2022-03-31T23:19:01.000Z | Lib/ctypes/macholib/dyld.py | dalakatt/cpython | 2f49b97cc5426087b46515254b9a97a22ee8c807 | [
"0BSD"
] | 25,286 | 2015-03-03T23:18:02.000Z | 2022-03-31T23:17:27.000Z | Lib/ctypes/macholib/dyld.py | dalakatt/cpython | 2f49b97cc5426087b46515254b9a97a22ee8c807 | [
"0BSD"
] | 31,623 | 2015-01-01T13:29:37.000Z | 2022-03-31T19:55:06.000Z | """
dyld emulation
"""
import os
from ctypes.macholib.framework import framework_info
from ctypes.macholib.dylib import dylib_info
from itertools import *
try:
from _ctypes import _dyld_shared_cache_contains_path
except ImportError:
def _dyld_shared_cache_contains_path(*args):
raise NotImplementedError... | 30.362069 | 103 | 0.671588 |
import os
from ctypes.macholib.framework import framework_info
from ctypes.macholib.dylib import dylib_info
from itertools import *
try:
from _ctypes import _dyld_shared_cache_contains_path
except ImportError:
def _dyld_shared_cache_contains_path(*args):
raise NotImplementedError
__all__ = [
'dyld... | true | true |
1c3f90839acedeb4b9a5d478f2e55f5b2a78c281 | 45,047 | py | Python | proofwallet.py | RCasatta/proof-wallet | 7dc27a7618ce8a1124975562ed8fa679eadee6b4 | [
"MIT"
] | 1 | 2021-01-30T19:42:09.000Z | 2021-01-30T19:42:09.000Z | proofwallet.py | RCasatta/proof-wallet | 7dc27a7618ce8a1124975562ed8fa679eadee6b4 | [
"MIT"
] | null | null | null | proofwallet.py | RCasatta/proof-wallet | 7dc27a7618ce8a1124975562ed8fa679eadee6b4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
################################################################################################
#
# GlacierScript: Part of the Glacier Protocol (http://glacierprotocol.org)
#
# GlacierScript is designed specifically for use in the context of executing the broader Glacier
# Protocol, a step-by-... | 38.305272 | 170 | 0.61609 |
import argparse
import json
import os
import shlex
import subprocess
import sys
import time
import re
import glob
from decimal import Decimal
from hashlib import sha256, md5, new as hashlib_new
from binascii import unhexlify, hexlify
from mnemonic import Mnemonic
from base58 import b58encode_check, b58decode
SATOSH... | true | true |
1c3f91818350f40735892d2d47b1ccb5f5d2f5d9 | 359 | py | Python | tests/import/import02.py | ktok07b6/polyphony | 657c5c7440520db6b4985970bd50547407693ac4 | [
"MIT"
] | 83 | 2015-11-30T09:59:13.000Z | 2021-08-03T09:12:28.000Z | tests/import/import02.py | jesseclin/polyphony | 657c5c7440520db6b4985970bd50547407693ac4 | [
"MIT"
] | 4 | 2017-02-10T01:43:11.000Z | 2020-07-14T03:52:25.000Z | tests/import/import02.py | jesseclin/polyphony | 657c5c7440520db6b4985970bd50547407693ac4 | [
"MIT"
] | 11 | 2016-11-18T14:39:15.000Z | 2021-02-23T10:05:20.000Z | import polyphony
from polyphony import io as io_
from polyphony import timing as ti_
from polyphony import typing as ty_
def import02():
return (io_.__name__ == 'polyphony.io' and
ti_.__name__ == 'polyphony.timing' and
ty_.__name__ == 'polyphony.typing')
@polyphony.testbench
def test():
... | 18.894737 | 50 | 0.682451 | import polyphony
from polyphony import io as io_
from polyphony import timing as ti_
from polyphony import typing as ty_
def import02():
return (io_.__name__ == 'polyphony.io' and
ti_.__name__ == 'polyphony.timing' and
ty_.__name__ == 'polyphony.typing')
@polyphony.testbench
def test():
... | true | true |
1c3f91d806b5845c36c6292a0a25f9d4cbab9821 | 28,266 | py | Python | sdk/python/pulumi_azure/datafactory/factory.py | aangelisc/pulumi-azure | 71dd9c75403146e16f7480e5a60b08bc0329660e | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure/datafactory/factory.py | aangelisc/pulumi-azure | 71dd9c75403146e16f7480e5a60b08bc0329660e | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure/datafactory/factory.py | aangelisc/pulumi-azure | 71dd9c75403146e16f7480e5a60b08bc0329660e | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # 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... | 49.851852 | 276 | 0.679615 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs
from ._inputs import *
__all__ = ['FactoryArgs', 'Factory']
@pulumi.input_type
class FactoryArgs:
def __init__(__self__, *,
res... | true | true |
1c3f92052a683c5775b5e40afe7aeb1e5fe16842 | 1,786 | py | Python | OSMtools/utils/configmanager.py | Benni5K/orstools-qgis-plugin | d255cccd4be71b63321c68178e7111d27f2660fa | [
"MIT"
] | null | null | null | OSMtools/utils/configmanager.py | Benni5K/orstools-qgis-plugin | d255cccd4be71b63321c68178e7111d27f2660fa | [
"MIT"
] | null | null | null | OSMtools/utils/configmanager.py | Benni5K/orstools-qgis-plugin | d255cccd4be71b63321c68178e7111d27f2660fa | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
/***************************************************************************
OSMtools
A QGIS plugin
falk
-------------------
begin : 2017-02-01
git sha : $Format:%H$
... | 37.208333 | 78 | 0.416573 | import os.path
import yaml
from OSMtools import BASE_DIR, CONFIG
def read():
with open(os.path.join(BASE_DIR, CONFIG)) as f:
doc = yaml.safe_load(f)
return doc
def write(key, value):
doc = read()
doc[key] = value
with open(os.path.join(BASE_DIR, CONFIG), 'w') as f:
... | true | true |
1c3f920f5859c8fbcfe7d3f2e78549e10c915289 | 11,465 | py | Python | qrl/services/PublicAPIService.py | michael-go/QRL | 591dfa60acca68e3ef6b4a09e393907939ae92b0 | [
"MIT"
] | null | null | null | qrl/services/PublicAPIService.py | michael-go/QRL | 591dfa60acca68e3ef6b4a09e393907939ae92b0 | [
"MIT"
] | null | null | null | qrl/services/PublicAPIService.py | michael-go/QRL | 591dfa60acca68e3ef6b4a09e393907939ae92b0 | [
"MIT"
] | null | null | null | # coding=utf-8
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
from grpc import StatusCode
from qrl.core import logger
from qrl.core.StakeValidator import StakeValidator
from qrl.core.Transaction import Transaction
from qrl.core.q... | 48.172269 | 122 | 0.665329 | from grpc import StatusCode
from qrl.core import logger
from qrl.core.StakeValidator import StakeValidator
from qrl.core.Transaction import Transaction
from qrl.core.qrlnode import QRLNode
from qrl.generated import qrl_pb2
from qrl.generated.qrl_pb2_grpc import PublicAPIServicer
from qrl.services.grpcHelper import grp... | true | true |
1c3f92cfca5a1aef1e8f513f32a79c2defedb9f5 | 570 | py | Python | load_cifarlt.py | caisarl76/classifier-balancing | b381279dc29539afb92fe40f7ca917e352aff9c6 | [
"BSD-3-Clause"
] | null | null | null | load_cifarlt.py | caisarl76/classifier-balancing | b381279dc29539afb92fe40f7ca917e352aff9c6 | [
"BSD-3-Clause"
] | null | null | null | load_cifarlt.py | caisarl76/classifier-balancing | b381279dc29539afb92fe40f7ca917e352aff9c6 | [
"BSD-3-Clause"
] | null | null | null | from data.dataloader import *
from utils import source_import, get_value
splits = ['train', 'test', 'val']
data_root ='/home/vision/jihun/fb_decouple/dataset/cifar-100',
from data import dataloader
from data.CIFAR100_LT.imbalance_cifar import IMBALANCECIFAR100
data = {x: dataloader.load_data(data_root=data_root,
... | 38 | 67 | 0.575439 | from data.dataloader import *
from utils import source_import, get_value
splits = ['train', 'test', 'val']
data_root ='/home/vision/jihun/fb_decouple/dataset/cifar-100',
from data import dataloader
from data.CIFAR100_LT.imbalance_cifar import IMBALANCECIFAR100
data = {x: dataloader.load_data(data_root=data_root,
... | true | true |
1c3f932c52cedfb81cad9a204332c60ff26b80d7 | 754 | py | Python | scripts/sqlite3_sqlalchemy_core.py | scianand/Programming-With-Databases | 4b4363be91f066f2852d78ae2a9240731c46f3b9 | [
"Apache-2.0"
] | null | null | null | scripts/sqlite3_sqlalchemy_core.py | scianand/Programming-With-Databases | 4b4363be91f066f2852d78ae2a9240731c46f3b9 | [
"Apache-2.0"
] | null | null | null | scripts/sqlite3_sqlalchemy_core.py | scianand/Programming-With-Databases | 4b4363be91f066f2852d78ae2a9240731c46f3b9 | [
"Apache-2.0"
] | null | null | null | """
SQLite3 database connection using SQL Alchemy Core
"""
import sqlalchemy as db
# connect to the database
engine = db.create_engine('sqlite:///movies1.db')
connection = engine.connect()
# access the metadata of the database
metadata = db.MetaData()
movies = db.Table('Movies', metadata, autoload=True, autoload_wit... | 25.133333 | 87 | 0.754642 |
import sqlalchemy as db
engine = db.create_engine('sqlite:///movies1.db')
connection = engine.connect()
metadata = db.MetaData()
movies = db.Table('Movies', metadata, autoload=True, autoload_with=engine)
query = movies.insert().values(Title='Lust Stories', Director='Karan Johar', Year=2018)
connection.execute(query... | true | true |
1c3f93b1daae20653f905fd1cfa594de85ec6a73 | 1,786 | py | Python | contenido/tests/test_HU036_models.py | slinan/border | 682bed850b3ed48d4f9e817dc9c2938388dd2181 | [
"MIT"
] | null | null | null | contenido/tests/test_HU036_models.py | slinan/border | 682bed850b3ed48d4f9e817dc9c2938388dd2181 | [
"MIT"
] | null | null | null | contenido/tests/test_HU036_models.py | slinan/border | 682bed850b3ed48d4f9e817dc9c2938388dd2181 | [
"MIT"
] | null | null | null | from django.test import TestCase
from contenido.models import Audio, Ratings, Artista
from django.contrib.auth.models import User
MODELS = [Ratings, Audio, Artista, User]
class CalificacionTest(TestCase):
def setUp(self):
# Se elimina el contenido de las tablas del modelo
for model in MODELS:
... | 47 | 131 | 0.631579 | from django.test import TestCase
from contenido.models import Audio, Ratings, Artista
from django.contrib.auth.models import User
MODELS = [Ratings, Audio, Artista, User]
class CalificacionTest(TestCase):
def setUp(self):
for model in MODELS:
if len(model.objects.all()):
... | true | true |
1c3f9460874cf861368978c0c3c74262daced354 | 234 | py | Python | Kivy/cap01-layouts.py | fotavio16/PycharmProjects | f5be49db941de69159ec543e8a6dde61f9f94d86 | [
"MIT"
] | null | null | null | Kivy/cap01-layouts.py | fotavio16/PycharmProjects | f5be49db941de69159ec543e8a6dde61f9f94d86 | [
"MIT"
] | null | null | null | Kivy/cap01-layouts.py | fotavio16/PycharmProjects | f5be49db941de69159ec543e8a6dde61f9f94d86 | [
"MIT"
] | null | null | null | from kivy.app import App
from kivy.uix.gridlayout import GridLayout
class MyGridLayout(GridLayout):
pass
class LayoutsApp(App):
def build(self):
return MyGridLayout()
if __name__=="__main__":
LayoutsApp().run()
| 18 | 42 | 0.713675 | from kivy.app import App
from kivy.uix.gridlayout import GridLayout
class MyGridLayout(GridLayout):
pass
class LayoutsApp(App):
def build(self):
return MyGridLayout()
if __name__=="__main__":
LayoutsApp().run()
| true | true |
1c3f94a07566d83bff0daa7b693c9b2ca1ca88a3 | 1,506 | py | Python | scoutingserver/users/tests/test_views.py | MichianaYouthRobotics/2019ScoutingServer | 29a58e566851da97d78c49ef9a581ec3c540c14a | [
"MIT"
] | null | null | null | scoutingserver/users/tests/test_views.py | MichianaYouthRobotics/2019ScoutingServer | 29a58e566851da97d78c49ef9a581ec3c540c14a | [
"MIT"
] | null | null | null | scoutingserver/users/tests/test_views.py | MichianaYouthRobotics/2019ScoutingServer | 29a58e566851da97d78c49ef9a581ec3c540c14a | [
"MIT"
] | null | null | null | import pytest
from django.conf import settings
from django.test import RequestFactory
from scoutingserver.users.views import UserRedirectView, UserUpdateView
pytestmark = pytest.mark.django_db
class TestUserUpdateView:
"""
TODO:
extracting view initialization code as class-scoped fixture
wou... | 27.888889 | 77 | 0.675963 | import pytest
from django.conf import settings
from django.test import RequestFactory
from scoutingserver.users.views import UserRedirectView, UserUpdateView
pytestmark = pytest.mark.django_db
class TestUserUpdateView:
def test_get_success_url(
self, user: settings.AUTH_USER_MODEL, request_factory: Req... | true | true |
1c3f94b3dd671d7cda82e3c5019659a1f8b39409 | 1,544 | py | Python | tiger/urls.py | JingLinkai/tiger | ac54d0df2cc5d4f2a90cc59720762b28a1e9e2fa | [
"MIT"
] | null | null | null | tiger/urls.py | JingLinkai/tiger | ac54d0df2cc5d4f2a90cc59720762b28a1e9e2fa | [
"MIT"
] | 1 | 2020-06-06T00:46:19.000Z | 2020-06-06T00:46:19.000Z | tiger/urls.py | linkay3601/social-tiger | ac54d0df2cc5d4f2a90cc59720762b28a1e9e2fa | [
"MIT"
] | null | null | null | """tiger URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-base... | 38.6 | 79 | 0.707902 | from django.conf.urls import url
from user import api as user_api
from social import api as social_api
from vip import api as vip_api
urlpatterns = [
url(r'^api/user/vcode$', user_api.get_verify_code),
url(r'^api/user/login$', user_api.login),
url(r'^api/user/profile/show$', user_api.show_profile),
u... | true | true |
1c3f94bbab2f7cb9a67414113db5135aefc0a1fb | 45 | py | Python | src/deutschland/handelsregister/__init__.py | andreasbossard/deutschland | 6f561256c707e21f81b54b139b9acb745b901298 | [
"Apache-2.0"
] | 445 | 2021-07-26T22:00:26.000Z | 2022-03-31T08:31:08.000Z | src/deutschland/handelsregister/__init__.py | andreasbossard/deutschland | 6f561256c707e21f81b54b139b9acb745b901298 | [
"Apache-2.0"
] | 30 | 2021-07-27T15:42:23.000Z | 2022-03-26T16:14:11.000Z | src/deutschland/handelsregister/__init__.py | andreasbossard/deutschland | 6f561256c707e21f81b54b139b9acb745b901298 | [
"Apache-2.0"
] | 28 | 2021-07-27T10:48:43.000Z | 2022-03-26T14:31:30.000Z | from .handelsregister import Handelsregister
| 22.5 | 44 | 0.888889 | from .handelsregister import Handelsregister
| true | true |
1c3f94db5fa48ef5bb72826fe800d6a9515e1d59 | 3,288 | py | Python | f5/bigip/tm/cm/test/functional/test_trust.py | nghia-tran/f5-common-python | acb23a6e5830a119b460c19a578654113419f5c3 | [
"Apache-2.0"
] | 272 | 2016-02-23T06:05:44.000Z | 2022-02-20T02:09:32.000Z | f5/bigip/tm/cm/test/functional/test_trust.py | nghia-tran/f5-common-python | acb23a6e5830a119b460c19a578654113419f5c3 | [
"Apache-2.0"
] | 1,103 | 2016-02-11T17:48:03.000Z | 2022-02-15T17:13:37.000Z | f5/bigip/tm/cm/test/functional/test_trust.py | nghia-tran/f5-common-python | acb23a6e5830a119b460c19a578654113419f5c3 | [
"Apache-2.0"
] | 167 | 2016-02-11T17:48:21.000Z | 2022-01-17T20:13:05.000Z | # Copyright 2016 F5 Networks Inc.
#
# 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 writi... | 36.533333 | 75 | 0.630474 |
from f5.sdk_exception import InvalidCommand
import pytest
def set_trust(request, mgmt_root, name, device, dev_name, usr, passwd):
dvcs = mgmt_root.tm.cm
trust = dvcs.add_to_trust.exec_cmd('run', name=name, device=device,
deviceName=dev_name, username=usr,
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.