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 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f76868d7ce4a3ef8a37ba5be145eaca661a83a87 | 4,461 | py | Python | app/main/camera.py | alkaren/MaskDetector | e992796823e5d7b6941cdd9dd5df6e5c4f9e1ee4 | [
"MIT"
] | null | null | null | app/main/camera.py | alkaren/MaskDetector | e992796823e5d7b6941cdd9dd5df6e5c4f9e1ee4 | [
"MIT"
] | null | null | null | app/main/camera.py | alkaren/MaskDetector | e992796823e5d7b6941cdd9dd5df6e5c4f9e1ee4 | [
"MIT"
] | null | null | null | import time
import threading
import cv2
try:
from greenlet import getcurrent as get_ident
except ImportError:
try:
from thread import get_ident
except ImportError:
from _thread import get_ident
class CameraEvent(object):
"""An Event-like class that signals all active clients when a ne... | 32.801471 | 82 | 0.593365 | import time
import threading
import cv2
try:
from greenlet import getcurrent as get_ident
except ImportError:
try:
from thread import get_ident
except ImportError:
from _thread import get_ident
class CameraEvent(object):
def __init__(self):
self.events = {}
def wait(self... | true | true |
f76869e4780919f2c9ecfec6a27d6f3ac2dcb348 | 2,526 | py | Python | python_bindings/source/conf.py | mit-commit/taco | cb00a908865e7122031375622617d9ba65668005 | [
"MIT"
] | null | null | null | python_bindings/source/conf.py | mit-commit/taco | cb00a908865e7122031375622617d9ba65668005 | [
"MIT"
] | null | null | null | python_bindings/source/conf.py | mit-commit/taco | cb00a908865e7122031375622617d9ba65668005 | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# If extensions (or module... | 32.384615 | 79 | 0.659145 |
import os
import sys
sys.path.insert(0, os.path.abspath('../../build/lib/'))
project = 'TACO Python API Reference'
copyright = '2022 TACO Development Team'
author = 'TACO Development Team'
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.doctest',
'sphinx.ext.intersphin... | true | true |
f7686a84429d80b96d34b27cfc25fc3c7f179b73 | 444 | py | Python | test/common.py | kajal-puri/torchgeometry | 36c4992d5f741a65a1f558266c588e37c24462da | [
"Apache-2.0"
] | 1 | 2020-08-14T04:09:30.000Z | 2020-08-14T04:09:30.000Z | test/common.py | kajal-puri/torchgeometry | 36c4992d5f741a65a1f558266c588e37c24462da | [
"Apache-2.0"
] | null | null | null | test/common.py | kajal-puri/torchgeometry | 36c4992d5f741a65a1f558266c588e37c24462da | [
"Apache-2.0"
] | 1 | 2020-05-21T12:35:10.000Z | 2020-05-21T12:35:10.000Z | import torch
def get_test_devices():
"""Creates a string list with the devices type to test the source code.
CUDA devices will be test only in case the current hardware supports it.
Return:
list(str): list with devices names.
"""
devices = ["cpu"]
if torch.cuda.is_available():
... | 22.2 | 76 | 0.68018 | import torch
def get_test_devices():
devices = ["cpu"]
if torch.cuda.is_available():
devices.append("cuda")
return devices
TEST_DEVICES = get_test_devices()
| true | true |
f7686ab22366666a26312f2a38ee02b5d39fd0fd | 1,170 | py | Python | romodel/tests/test_uncparam.py | tsaycal/romodel | 0d9bd0616dad41b1683452a0c7ff8e31caf47742 | [
"MIT"
] | null | null | null | romodel/tests/test_uncparam.py | tsaycal/romodel | 0d9bd0616dad41b1683452a0c7ff8e31caf47742 | [
"MIT"
] | null | null | null | romodel/tests/test_uncparam.py | tsaycal/romodel | 0d9bd0616dad41b1683452a0c7ff8e31caf47742 | [
"MIT"
] | null | null | null | import pyomo.environ as pe
import pyutilib.th as unittest
import romodel as ro
class TestUncParam(unittest.TestCase):
def test_simple_uncparam(self):
m = pe.ConcreteModel()
m.p = ro.UncParam()
m.pnom = ro.UncParam(nominal=3)
self.assertEqual(m.pnom.nominal, 3)
self.assertEq... | 36.5625 | 57 | 0.642735 | import pyomo.environ as pe
import pyutilib.th as unittest
import romodel as ro
class TestUncParam(unittest.TestCase):
def test_simple_uncparam(self):
m = pe.ConcreteModel()
m.p = ro.UncParam()
m.pnom = ro.UncParam(nominal=3)
self.assertEqual(m.pnom.nominal, 3)
self.assertEq... | true | true |
f7686b028cc474742a427389192f953e9810c1fd | 4,454 | py | Python | train.py | BogiHsu/Tacotron2-PyTorch | aafde3845828fc3b9df796e60607e0de67873409 | [
"MIT"
] | 125 | 2019-06-09T12:58:40.000Z | 2022-03-31T17:54:46.000Z | train.py | Tubbz-alt/Tacotron2-PyTorch | aafde3845828fc3b9df796e60607e0de67873409 | [
"MIT"
] | 9 | 2019-06-21T10:33:59.000Z | 2022-03-10T09:34:13.000Z | train.py | Tubbz-alt/Tacotron2-PyTorch | aafde3845828fc3b9df796e60607e0de67873409 | [
"MIT"
] | 26 | 2019-06-15T19:02:37.000Z | 2022-03-10T20:02:49.000Z | import os
import time
import torch
import argparse
import numpy as np
from inference import infer
from utils.util import mode
from hparams import hparams as hps
from torch.utils.data import DataLoader
from utils.logger import Tacotron2Logger
from utils.dataset import ljdataset, ljcollate
from model.model import Tacotro... | 30.717241 | 94 | 0.696453 | import os
import time
import torch
import argparse
import numpy as np
from inference import infer
from utils.util import mode
from hparams import hparams as hps
from torch.utils.data import DataLoader
from utils.logger import Tacotron2Logger
from utils.dataset import ljdataset, ljcollate
from model.model import Tacotro... | true | true |
f7686b5aa917c6246a37fed9eaea4f27bb311310 | 30,937 | py | Python | hls4ml/writer/vivado_writer.py | cors/hls4ml | d75e350b788a1114f4b50377f89bacf98dd99138 | [
"Apache-2.0"
] | null | null | null | hls4ml/writer/vivado_writer.py | cors/hls4ml | d75e350b788a1114f4b50377f89bacf98dd99138 | [
"Apache-2.0"
] | null | null | null | hls4ml/writer/vivado_writer.py | cors/hls4ml | d75e350b788a1114f4b50377f89bacf98dd99138 | [
"Apache-2.0"
] | 2 | 2021-02-16T21:15:53.000Z | 2021-04-01T03:51:52.000Z | from __future__ import print_function
import tarfile
import yaml
from shutil import copyfile, copytree, rmtree
import numpy as np
import os
import re
import glob
from collections import OrderedDict
from hls4ml.writer.writers import Writer
from hls4ml.model.hls_layers import XnorPrecisionType
config_filename = 'hls4ml... | 47.08828 | 193 | 0.545172 | from __future__ import print_function
import tarfile
import yaml
from shutil import copyfile, copytree, rmtree
import numpy as np
import os
import re
import glob
from collections import OrderedDict
from hls4ml.writer.writers import Writer
from hls4ml.model.hls_layers import XnorPrecisionType
config_filename = 'hls4ml... | true | true |
f7686b700c26e60c0cb417e98b6ab72b28302546 | 1,060 | py | Python | load_data.py | SincereJoy/SSAH_CVPR2018 | 82ada6db1048e51e14cd1c98469b837c78b7584e | [
"MIT"
] | null | null | null | load_data.py | SincereJoy/SSAH_CVPR2018 | 82ada6db1048e51e14cd1c98469b837c78b7584e | [
"MIT"
] | null | null | null | load_data.py | SincereJoy/SSAH_CVPR2018 | 82ada6db1048e51e14cd1c98469b837c78b7584e | [
"MIT"
] | null | null | null | import h5py
import numpy as np
def loading_data(path):
print('******************************************************')
print('dataset:{0}'.format(path))
print('******************************************************')
file = h5py.File(path,'r')
images = file['images'][:].transpose(0,3,2,1)
labels = file['LAll'][... | 26.5 | 79 | 0.573585 | import h5py
import numpy as np
def loading_data(path):
print('******************************************************')
print('dataset:{0}'.format(path))
print('******************************************************')
file = h5py.File(path,'r')
images = file['images'][:].transpose(0,3,2,1)
labels = file['LAll'][... | true | true |
f7686b8e62b20ecdd3121f48047ce3b86c9ebd0e | 1,145 | py | Python | labs/super_test.py | turing4ever/illustrated-python-3-course | d1faff57590713fcd1c6a9215529d6f9c629b046 | [
"MIT"
] | 57 | 2018-04-25T21:57:07.000Z | 2021-12-21T19:09:00.000Z | labs/super_test.py | radovankavicky/illustrated-python-3-course | d1faff57590713fcd1c6a9215529d6f9c629b046 | [
"MIT"
] | 4 | 2018-04-30T05:32:46.000Z | 2021-12-06T17:55:36.000Z | labs/super_test.py | radovankavicky/illustrated-python-3-course | d1faff57590713fcd1c6a9215529d6f9c629b046 | [
"MIT"
] | 26 | 2018-04-27T06:11:35.000Z | 2021-04-11T12:07:37.000Z |
def test_mario():
"""
======= ====== ====== ===== =====================
Name Mario Luigi Toad Princess Toadstool
======= ====== ====== ===== =====================
Speed 4 3 5 2
Jump 4 5 2 3
Power 4 3 5 2
======= ====== ====== ===== ======... | 27.926829 | 53 | 0.48821 |
def test_mario():
from py3code import Character, Luigi, Mario
m = Mario()
sp = m.speed()
assert Character in Mario.__bases__
assert sp == 4
def speed(self):
return 5
Character.speed = speed
assert m.speed() == 7
assert Luigi().s... | true | true |
f7686beb9cf80d0dc4ae040c107009ad91602ab7 | 534 | py | Python | sanity/management/commands/update_index.py | TIBHannover/arxiv_preserver | aefdacaa9d1c4c13b51e1812e6218c0025ab0a11 | [
"MIT"
] | null | null | null | sanity/management/commands/update_index.py | TIBHannover/arxiv_preserver | aefdacaa9d1c4c13b51e1812e6218c0025ab0a11 | [
"MIT"
] | null | null | null | sanity/management/commands/update_index.py | TIBHannover/arxiv_preserver | aefdacaa9d1c4c13b51e1812e6218c0025ab0a11 | [
"MIT"
] | null | null | null | from django.core.management.base import BaseCommand, CommandError
import sanity.models as models
import re
import time
import datetime
import os
from django.db.models import Max
class Command(BaseCommand):
help = "Closes the specified poll for voting"
def add_arguments(self, parser):
pass
def h... | 22.25 | 89 | 0.692884 | from django.core.management.base import BaseCommand, CommandError
import sanity.models as models
import re
import time
import datetime
import os
from django.db.models import Max
class Command(BaseCommand):
help = "Closes the specified poll for voting"
def add_arguments(self, parser):
pass
def h... | true | true |
f7686cb4ac2cc80823739ec297c9111fcd554255 | 79 | py | Python | python/201.bitwise-and-of-numbers-range.py | stavanmehta/leetcode | 1224e43ce29430c840e65daae3b343182e24709c | [
"Apache-2.0"
] | null | null | null | python/201.bitwise-and-of-numbers-range.py | stavanmehta/leetcode | 1224e43ce29430c840e65daae3b343182e24709c | [
"Apache-2.0"
] | null | null | null | python/201.bitwise-and-of-numbers-range.py | stavanmehta/leetcode | 1224e43ce29430c840e65daae3b343182e24709c | [
"Apache-2.0"
] | null | null | null | class Solution:
def rangeBitwiseAnd(self, m: int, n: int) -> int:
| 19.75 | 53 | 0.582278 | class Solution:
def rangeBitwiseAnd(self, m: int, n: int) -> int:
| false | true |
f7686d6d0a085270c920b5c777545b3cdd4a6fcb | 48,953 | py | Python | src/sage/geometry/ribbon_graph.py | Blues1998/sage | b5c9cf037cbce672101725f269470135b9b2c5c4 | [
"BSL-1.0"
] | null | null | null | src/sage/geometry/ribbon_graph.py | Blues1998/sage | b5c9cf037cbce672101725f269470135b9b2c5c4 | [
"BSL-1.0"
] | null | null | null | src/sage/geometry/ribbon_graph.py | Blues1998/sage | b5c9cf037cbce672101725f269470135b9b2c5c4 | [
"BSL-1.0"
] | null | null | null | r"""
Ribbon Graphs
This file implements objects called *ribbon graphs*. These are graphs
together with a cyclic ordering of the darts adjacent to each
vertex. This data allows us to unambiguously "thicken" the ribbon
graph to an orientable surface with boundary. Also, every orientable
surface with non-empty boundar... | 39.702352 | 195 | 0.56115 |
from sage.structure.sage_object import SageObject
from sage.structure.unique_representation import UniqueRepresentation
from sage.groups.perm_gps.permgroup_element import PermutationGroupElement
from sage.rings.integer_ring import ZZ
from sage.misc.cachefunc import cached_method
from sage.misc.flatten import flatten
... | true | true |
f7686dacaee98356a7e32ce11d9279c8e75c6834 | 2,734 | py | Python | reports/indexing.py | hoover/reports | 7113222664832915380efbb94aee87d09565d624 | [
"MIT"
] | null | null | null | reports/indexing.py | hoover/reports | 7113222664832915380efbb94aee87d09565d624 | [
"MIT"
] | null | null | null | reports/indexing.py | hoover/reports | 7113222664832915380efbb94aee87d09565d624 | [
"MIT"
] | null | null | null | from pathlib import Path
import json
from django.conf import settings
from elasticsearch import Elasticsearch, helpers as es_helpers
metrics = Path(settings.METRICS_PATH)
es = Elasticsearch(settings.ELASTICSEARCH_URL)
def reset_index():
es.indices.delete(settings.ELASTICSEARCH_INDEX, ignore=[400, 404])
es.ind... | 30.719101 | 74 | 0.524872 | from pathlib import Path
import json
from django.conf import settings
from elasticsearch import Elasticsearch, helpers as es_helpers
metrics = Path(settings.METRICS_PATH)
es = Elasticsearch(settings.ELASTICSEARCH_URL)
def reset_index():
es.indices.delete(settings.ELASTICSEARCH_INDEX, ignore=[400, 404])
es.ind... | true | true |
f7686e21e6ac849d5b7cd9c41bcbd78b6a93d0b8 | 2,094 | py | Python | results/rabi_and_lmg_optimizations_crossingcriticalphase_20190305/insufficient_tf_optimizations/script_lmg_doublebang_powell_50spins_bound04.py | lucainnocenti/ultrafast-critical-ground-state-preparation-2007.07381 | 29f80dcf914096555cee9bc2e18249a2c95d6a50 | [
"MIT"
] | 1 | 2020-07-21T02:31:41.000Z | 2020-07-21T02:31:41.000Z | results/rabi_and_lmg_optimizations_crossingcriticalphase_20190305/insufficient_tf_optimizations/script_lmg_doublebang_powell_50spins_bound04.py | lucainnocenti/ultrafast-critical-ground-state-preparation-2007.07381 | 29f80dcf914096555cee9bc2e18249a2c95d6a50 | [
"MIT"
] | null | null | null | results/rabi_and_lmg_optimizations_crossingcriticalphase_20190305/insufficient_tf_optimizations/script_lmg_doublebang_powell_50spins_bound04.py | lucainnocenti/ultrafast-critical-ground-state-preparation-2007.07381 | 29f80dcf914096555cee9bc2e18249a2c95d6a50 | [
"MIT"
] | null | null | null | import os
import sys
import numpy as np
import pandas as pd
import logging
if '../../' not in sys.path:
sys.path.append('../../')
import src.optimization as optimization
model = 'lmg'
model_parameters = dict(num_spins=50)
protocol = 'doublebang'
optimization_method = 'Powell'
parameters_constraints = [-4, 4]
ta... | 29.914286 | 70 | 0.706304 | import os
import sys
import numpy as np
import pandas as pd
import logging
if '../../' not in sys.path:
sys.path.append('../../')
import src.optimization as optimization
model = 'lmg'
model_parameters = dict(num_spins=50)
protocol = 'doublebang'
optimization_method = 'Powell'
parameters_constraints = [-4, 4]
ta... | true | true |
f7686ed4a13f8cece3aada71280737a8c6f2e1a9 | 802 | py | Python | social_django/__init__.py | boyd-bit-io/social-app-django | b62dbc4cbe3622a527be0d8961954ecc5bc4c619 | [
"BSD-3-Clause"
] | 1 | 2017-01-28T11:20:06.000Z | 2017-01-28T11:20:06.000Z | social_django/__init__.py | boyd-bit-io/social-app-django | b62dbc4cbe3622a527be0d8961954ecc5bc4c619 | [
"BSD-3-Clause"
] | null | null | null | social_django/__init__.py | boyd-bit-io/social-app-django | b62dbc4cbe3622a527be0d8961954ecc5bc4c619 | [
"BSD-3-Clause"
] | 2 | 2020-08-05T11:23:01.000Z | 2020-11-07T00:06:03.000Z | __version__ = '4.0.0'
from social_core.backends.base import BaseAuth
# django.contrib.auth.load_backend() will import and instanciate the
# authentication backend ignoring the possibility that it might
# require more arguments. Here we set a monkey patch to
# BaseAuth.__init__ to ignore the mandatory strategy argume... | 32.08 | 73 | 0.773067 | __version__ = '4.0.0'
from social_core.backends.base import BaseAuth
def baseauth_init_workaround(original_init):
def fake_init(self, strategy=None, *args, **kwargs):
from .utils import load_strategy
original_init(self, strategy or load_strategy(), *args, **kwargs)
return fake_init
if not... | true | true |
f7686efb0e898e3d7dbfb520429978ec5d602dec | 116 | py | Python | new_patient_cxr/mask_float/__init__.py | dgattiwsu/g_CXR-Net | 684a736b5bb0bf9961ccf9046481a7e561b66893 | [
"Apache-2.0"
] | 2 | 2021-05-25T14:05:24.000Z | 2021-11-10T07:19:27.000Z | run_CXR-Net/__init__.py | dgattiwsu/CXR-Net | d6ee3e7a5642242f9581b7747e79813d20785ec8 | [
"Apache-2.0"
] | null | null | null | run_CXR-Net/__init__.py | dgattiwsu/CXR-Net | d6ee3e7a5642242f9581b7747e79813d20785ec8 | [
"Apache-2.0"
] | null | null | null | # MODULES
# import Blocks
# import Constants
# import Generators
# import Losses
# import Networks
# import Utils
| 11.6 | 19 | 0.75 | true | true | |
f7686f8b61834f611c455ff3de3ad89934c5e50a | 751 | py | Python | build/copy_sources.py | kapkic/native_client | 51c8bc8c249d55606232ae011bdfc8b4cab3d794 | [
"BSD-3-Clause"
] | 1 | 2021-12-23T00:36:43.000Z | 2021-12-23T00:36:43.000Z | build/copy_sources.py | kapkic/native_client | 51c8bc8c249d55606232ae011bdfc8b4cab3d794 | [
"BSD-3-Clause"
] | null | null | null | build/copy_sources.py | kapkic/native_client | 51c8bc8c249d55606232ae011bdfc8b4cab3d794 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python2
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import shutil
import sys
"""Copy Sources
Copy from a source file or directory to a new file or directory. This
suppo... | 20.297297 | 72 | 0.691079 |
import os
import shutil
import sys
"""Copy Sources
Copy from a source file or directory to a new file or directory. This
supports renaming of the file.
"""
def MakeDir(outdir):
if outdir and not os.path.exists(outdir):
os.makedirs(outdir)
def Main(argv):
if len(argv) != 3:
print 'Expecting: copy_sou... | false | true |
f7687173e86537d5d10581aebdada15604cecbf8 | 2,967 | py | Python | test.py | kaching-out-of-ammo/Excel_Weighbridge | 3d5ccd52fa659df313bed0624e05d7fda353c1a9 | [
"Apache-2.0"
] | null | null | null | test.py | kaching-out-of-ammo/Excel_Weighbridge | 3d5ccd52fa659df313bed0624e05d7fda353c1a9 | [
"Apache-2.0"
] | null | null | null | test.py | kaching-out-of-ammo/Excel_Weighbridge | 3d5ccd52fa659df313bed0624e05d7fda353c1a9 | [
"Apache-2.0"
] | null | null | null | from picamera.array import PiRGBArray
from picamera import PiCamera
import cv2
import time
from threading import Thread
import imutils
import numpy as np
from pyzbar.pyzbar import decode
camera = PiCamera()
camera.resolution = (800, 608)
camera.framerate = 32
rawCapture1 = PiRGBArray(camera, size=(800, 6... | 30.27551 | 92 | 0.584766 | from picamera.array import PiRGBArray
from picamera import PiCamera
import cv2
import time
from threading import Thread
import imutils
import numpy as np
from pyzbar.pyzbar import decode
camera = PiCamera()
camera.resolution = (800, 608)
camera.framerate = 32
rawCapture1 = PiRGBArray(camera, size=(800, 6... | true | true |
f768717c84fb4ad38988cdb5dad156caf16eaf18 | 2,053 | py | Python | home/views.py | macs03/autoservicio | 5c51af0a991ac40534974d74c3c9aa1b20f02293 | [
"MIT"
] | null | null | null | home/views.py | macs03/autoservicio | 5c51af0a991ac40534974d74c3c9aa1b20f02293 | [
"MIT"
] | null | null | null | home/views.py | macs03/autoservicio | 5c51af0a991ac40534974d74c3c9aa1b20f02293 | [
"MIT"
] | null | null | null | from django.shortcuts import render, get_object_or_404
from django.http.response import HttpResponse, HttpResponseRedirect
from vehiculos.models import Vehiculos, Vehiculo_Clientes
from clientes.models import Clientes
from servicios.models import Servicios, Servicios_Realizados
import json
# Create your views here.
d... | 39.480769 | 123 | 0.643936 | from django.shortcuts import render, get_object_or_404
from django.http.response import HttpResponse, HttpResponseRedirect
from vehiculos.models import Vehiculos, Vehiculo_Clientes
from clientes.models import Clientes
from servicios.models import Servicios, Servicios_Realizados
import json
def home(request):
temp... | false | true |
f768729953eda0776fd681f5e1a59a92fae3549e | 12,664 | py | Python | peripheral/nvm_00761/config/nvm.py | Unitek-KL/csp | 2ac7ba59465f23959e51d2f16a5712b57b79ef5f | [
"0BSD"
] | null | null | null | peripheral/nvm_00761/config/nvm.py | Unitek-KL/csp | 2ac7ba59465f23959e51d2f16a5712b57b79ef5f | [
"0BSD"
] | null | null | null | peripheral/nvm_00761/config/nvm.py | Unitek-KL/csp | 2ac7ba59465f23959e51d2f16a5712b57b79ef5f | [
"0BSD"
] | null | null | null | """*****************************************************************************
* Copyright (C) 2019 Microchip Technology Inc. and its subsidiaries.
*
* Subject to your compliance with these terms, you may use Microchip software
* and any derivatives exclusively with Microchip products. It is your
* responsibility to ... | 45.228571 | 172 | 0.712887 |
global nvmInstanceName
global interruptsChildren
interruptsChildren = ATDF.getNode('/avr-tools-device-file/devices/device/interrupts').getChildren()
def nvmSetMemoryDependency(symbol, event):
symbol.setVisible(event["value"])
def setNVMInterruptData(status):
Database.setSymbolValue("core", nvmInterruptVect... | true | true |
f76872ae2eca33a419b99253650efa59fd983c66 | 18,264 | py | Python | seispy/stream.py | obsmax/seispy | 1ed5064dbcfeb4ceebf20b59b97e588609c5b8ab | [
"MIT"
] | 1 | 2020-06-15T23:12:45.000Z | 2020-06-15T23:12:45.000Z | seispy/stream.py | obsmax/seispy | 1ed5064dbcfeb4ceebf20b59b97e588609c5b8ab | [
"MIT"
] | null | null | null | seispy/stream.py | obsmax/seispy | 1ed5064dbcfeb4ceebf20b59b97e588609c5b8ab | [
"MIT"
] | null | null | null | from copy import deepcopy
import numpy as np
from numpy.lib.npyio import _savez
from matplotlib.collections import LineCollection
import matplotlib.pyplot as plt
from seispy.trace import Trace, FourierDomainTrace
from seispy.errors import EmptyStreamError, DataTypeError, \
SamplingError, SamplingRateError, NptsErro... | 32.440497 | 99 | 0.536739 | from copy import deepcopy
import numpy as np
from numpy.lib.npyio import _savez
from matplotlib.collections import LineCollection
import matplotlib.pyplot as plt
from seispy.trace import Trace, FourierDomainTrace
from seispy.errors import EmptyStreamError, DataTypeError, \
SamplingError, SamplingRateError, NptsErro... | true | true |
f76872fcd0de69639e6d053163d86132a4b2663a | 8,382 | py | Python | app/unit_test_selectable.py | 0xPrateek/ci_edit | 6abc609a8f1b5f85f0ca1af11cebc77ece80fc99 | [
"Apache-2.0"
] | 5 | 2019-10-09T08:01:32.000Z | 2020-01-01T18:17:21.000Z | app/unit_test_selectable.py | 0xPrateek/ci_edit | 6abc609a8f1b5f85f0ca1af11cebc77ece80fc99 | [
"Apache-2.0"
] | 1 | 2019-11-01T02:16:28.000Z | 2019-11-01T02:16:28.000Z | app/unit_test_selectable.py | 0xPrateek/ci_edit | 6abc609a8f1b5f85f0ca1af11cebc77ece80fc99 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Google 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 writing, ... | 40.105263 | 80 | 0.658554 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import unittest
import app.log
import app.ci_program
import app.selectable
class SelectableTestCases(unittest.TestCase):
def setUp(self):
self.selectable = app.selectable.Selectable(app.ci_prog... | true | true |
f7687399771663102114cdcad67b2205043538a3 | 526 | py | Python | mainapp/urls.py | Raistlin11123/inquiry-soso | 380d27219a5855f9e25da90db47f85e46e5e8b5d | [
"MIT"
] | null | null | null | mainapp/urls.py | Raistlin11123/inquiry-soso | 380d27219a5855f9e25da90db47f85e46e5e8b5d | [
"MIT"
] | null | null | null | mainapp/urls.py | Raistlin11123/inquiry-soso | 380d27219a5855f9e25da90db47f85e46e5e8b5d | [
"MIT"
] | null | null | null | from . import views
from django.urls import path
urlpatterns = [
#Maybe a generic view?
path('historic', views.historic_view, name='historic'),
path('map', views.map_view, name='map'),
path('list_clues', views.list_clues_view, name='list_clues'),
path('content_clue/<int:id_clue>', views.content_clu... | 43.833333 | 105 | 0.722433 | from . import views
from django.urls import path
urlpatterns = [
path('historic', views.historic_view, name='historic'),
path('map', views.map_view, name='map'),
path('list_clues', views.list_clues_view, name='list_clues'),
path('content_clue/<int:id_clue>', views.content_clue, name='content_clue')... | true | true |
f76874132d5c0caa9c33db7b246d8560b0a1f593 | 864 | py | Python | tplbuild/hashing.py | msg555/tplbuild | 1517fa97b17df4883f6885a7fb3ccfe017576e53 | [
"BSD-3-Clause"
] | null | null | null | tplbuild/hashing.py | msg555/tplbuild | 1517fa97b17df4883f6885a7fb3ccfe017576e53 | [
"BSD-3-Clause"
] | null | null | null | tplbuild/hashing.py | msg555/tplbuild | 1517fa97b17df4883f6885a7fb3ccfe017576e53 | [
"BSD-3-Clause"
] | null | null | null | import hashlib
import json
# The default hashing algorithm used by tplbuild.
HASHER = hashlib.sha256
class HashWriter:
"""
File-like writable object that passed all writes through to the supplied
hasher. It will automatically encode str data using the supplied encoding.
"""
def __init__(self, hs... | 26.181818 | 78 | 0.646991 | import hashlib
import json
HASHER = hashlib.sha256
class HashWriter:
def __init__(self, hsh, *, encoding="utf-8") -> None:
self.hsh = hsh
self.encoding = encoding
def write(self, data):
if isinstance(data, bytes):
self.hsh.update(data)
else:
self.hsh.... | true | true |
f76874d880c31361c4f41f878a8ab5a3fd4f6d02 | 74 | py | Python | ejercicio10.py | acasasaez/Warm-up | 9b97ee8d7d4a1c6e0b577b392c5fd62d5e1727f3 | [
"Apache-2.0"
] | null | null | null | ejercicio10.py | acasasaez/Warm-up | 9b97ee8d7d4a1c6e0b577b392c5fd62d5e1727f3 | [
"Apache-2.0"
] | null | null | null | ejercicio10.py | acasasaez/Warm-up | 9b97ee8d7d4a1c6e0b577b392c5fd62d5e1727f3 | [
"Apache-2.0"
] | null | null | null | import datetime
curent_time = datetime.datetime.now()
print(curent_time)
| 14.8 | 37 | 0.810811 | import datetime
curent_time = datetime.datetime.now()
print(curent_time)
| true | true |
f76875a7c2cbcee3b18dc353aaed4d6f10bb45ad | 5,629 | py | Python | ple/games/base/pygamewrapper.py | MatheusZickuhr/PyGame-Learning-Environment | b82c7a335481df59d2764f24718b6784c00b6471 | [
"MIT"
] | 959 | 2016-02-26T04:42:41.000Z | 2022-03-27T03:04:02.000Z | ple/games/base/pygamewrapper.py | MatheusZickuhr/PyGame-Learning-Environment | b82c7a335481df59d2764f24718b6784c00b6471 | [
"MIT"
] | 293 | 2019-04-11T08:43:19.000Z | 2022-03-15T01:20:49.000Z | ple/games/base/pygamewrapper.py | MatheusZickuhr/PyGame-Learning-Environment | b82c7a335481df59d2764f24718b6784c00b6471 | [
"MIT"
] | 256 | 2016-04-12T23:39:54.000Z | 2022-03-14T13:26:29.000Z | import pygame
import numpy as np
from pygame.constants import KEYDOWN, KEYUP, K_F15
class PyGameWrapper(object):
"""PyGameWrapper class
ple.games.base.PyGameWrapper(width, height, actions={})
This :class:`PyGameWrapper` class sets methods all games require. It should be subclassed when creating new gam... | 25.821101 | 157 | 0.558359 | import pygame
import numpy as np
from pygame.constants import KEYDOWN, KEYUP, K_F15
class PyGameWrapper(object):
def __init__(self, width, height, actions={}):
self.actions = actions
self.score = 0.0 self.lives = 0 self.screen = None self.clock = None ... | true | true |
f7687790498bc5459d4ff5fab019792e96526e34 | 869 | py | Python | tests/tests_fields/tests_fields_types/tests_field_positive_integer.py | kimgea/ontosqlson | 5229ef0512a0db68afbf3a3b27f43149cca01389 | [
"MIT"
] | null | null | null | tests/tests_fields/tests_fields_types/tests_field_positive_integer.py | kimgea/ontosqlson | 5229ef0512a0db68afbf3a3b27f43149cca01389 | [
"MIT"
] | 6 | 2020-11-19T11:06:37.000Z | 2020-11-19T11:18:02.000Z | tests/tests_fields/tests_fields_types/tests_field_positive_integer.py | kimgea/python-entity-schema | 5229ef0512a0db68afbf3a3b27f43149cca01389 | [
"MIT"
] | null | null | null | import unittest
from entschema.schema import Schema
from entschema.field import (TextField,
PositiveIntegerField,
RelationField)
from entschema.field.field_types import (RelationFieldType)
class TestFieldPositiveInteger(unittest.TestCase):
def test_field_... | 29.965517 | 59 | 0.639816 | import unittest
from entschema.schema import Schema
from entschema.field import (TextField,
PositiveIntegerField,
RelationField)
from entschema.field.field_types import (RelationFieldType)
class TestFieldPositiveInteger(unittest.TestCase):
def test_field_... | true | true |
f76877adad34938f7aaa9555847c0fdda0cb5826 | 1,330 | py | Python | tests/test_conn_comp.py | mintar/mseg-api | df7b899b47b33ad82dcbf17c289856a1f1abea22 | [
"CC-BY-4.0"
] | 213 | 2020-04-25T02:51:42.000Z | 2022-03-25T09:57:26.000Z | tests/test_conn_comp.py | mintar/mseg-api | df7b899b47b33ad82dcbf17c289856a1f1abea22 | [
"CC-BY-4.0"
] | 19 | 2020-04-28T05:47:50.000Z | 2022-03-18T03:05:07.000Z | tests/test_conn_comp.py | mintar/mseg-api | df7b899b47b33ad82dcbf17c289856a1f1abea22 | [
"CC-BY-4.0"
] | 35 | 2020-04-29T16:11:43.000Z | 2022-03-28T15:50:15.000Z | #!/usr/bin/python3
import numpy as np
from mseg.utils.conn_comp import scipy_conn_comp
def test_scipy_conn_comp():
""" Make sure we can recover a dictionary of binary masks for each conn. component"""
# toy semantic label map / label image
img = np.array(
[
[1,1,2,3],
[1,4,5,3],
[0,0,1,1]
])
clas... | 20.461538 | 86 | 0.545865 |
import numpy as np
from mseg.utils.conn_comp import scipy_conn_comp
def test_scipy_conn_comp():
img = np.array(
[
[1,1,2,3],
[1,4,5,3],
[0,0,1,1]
])
class_to_conncomps_dict = scipy_conn_comp(img)
print(class_to_conncomps_dict)
gt_class_to_conncomps_dict = {
0: [
np.array([[0, 0, 0, 0],
... | true | true |
f7687aafb44261f671d79a9a8f1e3a0e7b913de1 | 4,194 | py | Python | week4/create_labeled_queries.py | mihaichris/search_with_machine_learning_course | 17134e63862dd65906012acb2b326f54d06de761 | [
"Apache-2.0"
] | null | null | null | week4/create_labeled_queries.py | mihaichris/search_with_machine_learning_course | 17134e63862dd65906012acb2b326f54d06de761 | [
"Apache-2.0"
] | null | null | null | week4/create_labeled_queries.py | mihaichris/search_with_machine_learning_course | 17134e63862dd65906012acb2b326f54d06de761 | [
"Apache-2.0"
] | null | null | null | import os
import argparse
import xml.etree.ElementTree as ET
import pandas as pd
import numpy as np
import csv
import string
from nltk.stem.snowball import SnowballStemmer
# Useful if you want to perform stemming.
import nltk
stemmer = nltk.stem.PorterStemmer()
def prepare_word(word):
word = word.lower()
tra... | 38.127273 | 127 | 0.733429 | import os
import argparse
import xml.etree.ElementTree as ET
import pandas as pd
import numpy as np
import csv
import string
from nltk.stem.snowball import SnowballStemmer
import nltk
stemmer = nltk.stem.PorterStemmer()
def prepare_word(word):
word = word.lower()
translator = str.maketrans(string.punctuation... | true | true |
f7687afe70c0f16502bb64613aafa071e0e4cd76 | 9,206 | py | Python | ruuvitag/ruuvitag.py | kipe/ruuvitag | 0ff82b8bdfd2a3dd64f872db05dbb1ccbcaaa673 | [
"MIT"
] | 5 | 2019-03-10T11:35:11.000Z | 2020-05-04T08:15:56.000Z | ruuvitag/ruuvitag.py | kipe/ruuvitag | 0ff82b8bdfd2a3dd64f872db05dbb1ccbcaaa673 | [
"MIT"
] | 1 | 2019-02-08T15:48:39.000Z | 2019-02-08T15:57:46.000Z | ruuvitag/ruuvitag.py | kipe/ruuvitag | 0ff82b8bdfd2a3dd64f872db05dbb1ccbcaaa673 | [
"MIT"
] | 2 | 2019-05-16T10:41:55.000Z | 2019-08-31T07:27:19.000Z | import arrow
from threading import Event
from bluepy import btle
from bitstring import BitArray
class RuuviTag(object):
'''An instance of RuuviTag. Usually created by RuuviTag.scan().'''
def __init__(self, address, protocol, temperature=float('nan'),
humidity=float('nan'), pressure=float('na... | 40.734513 | 99 | 0.57658 | import arrow
from threading import Event
from bluepy import btle
from bitstring import BitArray
class RuuviTag(object):
def __init__(self, address, protocol, temperature=float('nan'),
humidity=float('nan'), pressure=float('nan'),
acceleration_x=float('nan'), acceleration_y=float... | true | true |
f7687b4d1b8ba7bee163851fabb2d5c8dea7ff2d | 2,882 | py | Python | Cap05/Lab03/forca_v1.py | vntborgesjr/Python-fundamentos | e8acea3966fea7baf208d5137587d54adf88c04d | [
"MIT"
] | null | null | null | Cap05/Lab03/forca_v1.py | vntborgesjr/Python-fundamentos | e8acea3966fea7baf208d5137587d54adf88c04d | [
"MIT"
] | null | null | null | Cap05/Lab03/forca_v1.py | vntborgesjr/Python-fundamentos | e8acea3966fea7baf208d5137587d54adf88c04d | [
"MIT"
] | null | null | null | # Hangman Game (Jogo da Forca)
# Programação Orientada a Objetos
# Import
import random
# Board (tabuleiro)
board = ['''
>>>>>>>>>>Hangman<<<<<<<<<<
+---+
| |
|
|
|
|
=========''', '''
+---+
| |
O |
|
|
|
=========''', '''
+---+
| |
O |
| |
|
|
=========''', '''
... | 18.593548 | 103 | 0.592644 |
import random
board = ['''
>>>>>>>>>>Hangman<<<<<<<<<<
+---+
| |
|
|
|
|
=========''', '''
+---+
| |
O |
|
|
|
=========''', '''
+---+
| |
O |
| |
|
|
=========''', '''
+---+
| |
O |
/| |
|
|
=========''', '''
+---+
| |
O |
/|\ |
|
... | true | true |
f7687bd9797fa27db2d4da4567ccaf18c89207ba | 4,294 | py | Python | fish.py | zhanqxun/cv_fish | f78f4f5bdafb070c179efee8b9276719dfaef1d7 | [
"Apache-2.0"
] | null | null | null | fish.py | zhanqxun/cv_fish | f78f4f5bdafb070c179efee8b9276719dfaef1d7 | [
"Apache-2.0"
] | null | null | null | fish.py | zhanqxun/cv_fish | f78f4f5bdafb070c179efee8b9276719dfaef1d7 | [
"Apache-2.0"
] | null | null | null | #-*- coding:UTF-8 -*-
from image_grab import grab_wnd, put_foreground
import PIL
import cv2
import numpy
import math
import time
from mouse_key_event import key_input
from mouse_key_event import mouse_click, mouse_move
from SimpleLogger import logger
import core
"""空闲状态"""
STATE_IDLE = 1
"""上鱼饵状态"""
S... | 24.820809 | 91 | 0.634606 |
from image_grab import grab_wnd, put_foreground
import PIL
import cv2
import numpy
import math
import time
from mouse_key_event import key_input
from mouse_key_event import mouse_click, mouse_move
from SimpleLogger import logger
import core
"""空闲状态"""
STATE_IDLE = 1
"""上鱼饵状态"""
STATE_BAIT = 2
"""甩杆状态"... | false | true |
f7687c063df1cc79f09b0430c3d7da28c348ebe0 | 854 | py | Python | fixture/mail.py | aakulich/python_training_mantis | 878d2c0355186dc3f0846ba6d71ff89656b49e2d | [
"Apache-2.0"
] | null | null | null | fixture/mail.py | aakulich/python_training_mantis | 878d2c0355186dc3f0846ba6d71ff89656b49e2d | [
"Apache-2.0"
] | null | null | null | fixture/mail.py | aakulich/python_training_mantis | 878d2c0355186dc3f0846ba6d71ff89656b49e2d | [
"Apache-2.0"
] | null | null | null | import poplib
import email
import time
class MailHelper:
def __init__(self, app):
self.app = app
def get_mail(self, username, password, subject):
for i in range(5):
pop = poplib.POP3(self.app.config['james']['host'])
pop.user(username)
pop.pass_(password)... | 28.466667 | 83 | 0.471897 | import poplib
import email
import time
class MailHelper:
def __init__(self, app):
self.app = app
def get_mail(self, username, password, subject):
for i in range(5):
pop = poplib.POP3(self.app.config['james']['host'])
pop.user(username)
pop.pass_(password)... | true | true |
f7687db4282dd448bf2969e537162d81afd9d614 | 2,801 | py | Python | event/duncan_house_wor.py | HansGR/WorldsCollide | af227be553e120ee004b130598360c61daf7df59 | [
"MIT"
] | null | null | null | event/duncan_house_wor.py | HansGR/WorldsCollide | af227be553e120ee004b130598360c61daf7df59 | [
"MIT"
] | null | null | null | event/duncan_house_wor.py | HansGR/WorldsCollide | af227be553e120ee004b130598360c61daf7df59 | [
"MIT"
] | 1 | 2022-01-17T01:01:34.000Z | 2022-01-17T01:01:34.000Z | from event.event import *
class DuncanHouseWOR(Event):
def name(self):
return "Duncan House WOR"
def init_event_bits(self, space):
if not self.args.bum_rush_last:
space.write(
field.SetEventBit(event_bit.CAN_LEARN_BUM_RUSH),
)
def mod(self):
... | 49.140351 | 111 | 0.638343 | from event.event import *
class DuncanHouseWOR(Event):
def name(self):
return "Duncan House WOR"
def init_event_bits(self, space):
if not self.args.bum_rush_last:
space.write(
field.SetEventBit(event_bit.CAN_LEARN_BUM_RUSH),
)
def mod(self):
... | true | true |
f7687dd5ec634a2d574929cfd5f77e1529d99837 | 958 | py | Python | SortingAlgorithms/ShellSort.py | Sai-nook73/TheAlgorithms | fabb67ecfd428751515d5229a2bb3729c8139666 | [
"MIT"
] | 1 | 2018-10-20T22:12:17.000Z | 2018-10-20T22:12:17.000Z | SortingAlgorithms/ShellSort.py | aditya1876/TheAlgorithms | e13b3de106c9b04333428d34950d59319520b3d1 | [
"MIT"
] | null | null | null | SortingAlgorithms/ShellSort.py | aditya1876/TheAlgorithms | e13b3de106c9b04333428d34950d59319520b3d1 | [
"MIT"
] | null | null | null | def shellSort(collection):
lenght = len(collection)
middle, counter = lenght // 2, 0
while middle > 0:
for i in range(0, lenght - middle):
j = i
while (j >= 0) and (collection[j] > collection[j + middle]):
temp = collection[j]
collection[j] = collection[j + middle]
collection[j + middle] = temp
... | 24.564103 | 63 | 0.667015 | def shellSort(collection):
lenght = len(collection)
middle, counter = lenght // 2, 0
while middle > 0:
for i in range(0, lenght - middle):
j = i
while (j >= 0) and (collection[j] > collection[j + middle]):
temp = collection[j]
collection[j] = collection[j + middle]
collection[j + middle] = temp
... | true | true |
f7687eeb6b8f81a9a1248ef606132819bffc672c | 184 | py | Python | src/sage/combinat/lyndon_word.py | fchapoton/sage | 765c5cb3e24dd134708eca97e4c52e0221cd94ba | [
"BSL-1.0"
] | 1,742 | 2015-01-04T07:06:13.000Z | 2022-03-30T11:32:52.000Z | src/sage/combinat/lyndon_word.py | Ivo-Maffei/sage | 467fbc70a08b552b3de33d9065204ee9cbfb02c7 | [
"BSL-1.0"
] | 66 | 2015-03-19T19:17:24.000Z | 2022-03-16T11:59:30.000Z | src/sage/combinat/lyndon_word.py | dimpase/sage | 468f23815ade42a2192b0a9cd378de8fdc594dcd | [
"BSL-1.0"
] | 495 | 2015-01-10T10:23:18.000Z | 2022-03-24T22:06:11.000Z | """
TESTS::
sage: from sage.combinat.lyndon_word import *
"""
from sage.misc.lazy_import import lazy_import
lazy_import('sage.combinat.words.lyndon_word', '*', deprecation=19150)
| 23 | 70 | 0.744565 | from sage.misc.lazy_import import lazy_import
lazy_import('sage.combinat.words.lyndon_word', '*', deprecation=19150)
| true | true |
f7687f1ae199d0d6f2651f9ccd9dc87dffd387e9 | 378,152 | py | Python | ibm_cloud_databases/cloud_databases_v5.py | IBM/cloud-databases-python-sdk | 0a22007103fc67b3d77235b5dd01e1d94efaa108 | [
"Apache-2.0"
] | 1 | 2021-05-15T21:34:09.000Z | 2021-05-15T21:34:09.000Z | ibm_cloud_databases/cloud_databases_v5.py | IBM/cloud-databases-python-sdk | 0a22007103fc67b3d77235b5dd01e1d94efaa108 | [
"Apache-2.0"
] | 3 | 2021-04-05T23:03:10.000Z | 2021-04-10T14:26:50.000Z | ibm_cloud_databases/cloud_databases_v5.py | IBM/cloud-databases-python-sdk | 0a22007103fc67b3d77235b5dd01e1d94efaa108 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
# (C) Copyright IBM Corp. 2021.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 38.976706 | 281 | 0.62257 |
from datetime import datetime
from enum import Enum
from typing import Dict, List
import json
from ibm_cloud_sdk_core import BaseService, DetailedResponse
from ibm_cloud_sdk_core.authenticators.authenticator import Authenticator
from ibm_cloud_sdk_core.get_authenticator import get_authenticator_from_environment
f... | true | true |
f76881367ef4d10d39ee4dc448666a8500d9a8f4 | 6,732 | py | Python | misc/webdriver-w3c-tests/client/driver.py | chenxix/crosswalk-test-suite | a2353dd2df912334cf6489f99bc0af4e091079a0 | [
"BSD-3-Clause"
] | null | null | null | misc/webdriver-w3c-tests/client/driver.py | chenxix/crosswalk-test-suite | a2353dd2df912334cf6489f99bc0af4e091079a0 | [
"BSD-3-Clause"
] | null | null | null | misc/webdriver-w3c-tests/client/driver.py | chenxix/crosswalk-test-suite | a2353dd2df912334cf6489f99bc0af4e091079a0 | [
"BSD-3-Clause"
] | null | null | null | """Entry point for WebDriver."""
import alert
import command
import searchcontext
import webelement
import base64
class WebDriver(searchcontext.SearchContext):
"""Controls a web browser."""
def __init__(self, host, required, desired, mode='strict'):
args = { 'desiredCapabilities': desired }
... | 33.66 | 80 | 0.583928 |
import alert
import command
import searchcontext
import webelement
import base64
class WebDriver(searchcontext.SearchContext):
def __init__(self, host, required, desired, mode='strict'):
args = { 'desiredCapabilities': desired }
if required:
args['requiredCapabilities'] = required
... | true | true |
f76881693a73de44b794ea7a1d56da3c3ceb1aa4 | 3,317 | py | Python | bin/docutils/parsers/rst/languages/en.py | iilness2/bash-lambda-layer-custom | 0b054d4ccb0623460354ba1f58059258c095a494 | [
"MIT"
] | 5,079 | 2015-01-01T03:39:46.000Z | 2022-03-31T07:38:22.000Z | bin/docutils/parsers/rst/languages/en.py | iilness2/bash-lambda-layer-custom | 0b054d4ccb0623460354ba1f58059258c095a494 | [
"MIT"
] | 1,623 | 2015-01-01T08:06:24.000Z | 2022-03-30T19:48:52.000Z | bin/docutils/parsers/rst/languages/en.py | iilness2/bash-lambda-layer-custom | 0b054d4ccb0623460354ba1f58059258c095a494 | [
"MIT"
] | 2,033 | 2015-01-04T07:18:02.000Z | 2022-03-28T19:55:47.000Z | # $Id: en.py 7179 2011-10-15 22:06:45Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be
# translated f... | 29.882883 | 78 | 0.588182 |
__docformat__ = 'reStructuredText'
directives = {
'attention': 'attention',
'caution': 'caution',
'code': 'code',
'code-block': 'code',
'sourcecode': 'code',
'danger': 'danger',
'error': 'error',
'hint': 'hint',
'important': 'important',
'note': 'no... | true | true |
f76883283b45550d37d8f1558f373db0037d67cf | 4,383 | py | Python | dynamic_db_router/router.py | jaredlewis/django-dynamic-db-router | ea13d6b0e51e58fe894f453b2a1641892f9bc3dd | [
"MIT"
] | 58 | 2015-05-14T22:48:02.000Z | 2021-07-12T23:18:17.000Z | dynamic_db_router/router.py | jaredlewis/django-dynamic-db-router | ea13d6b0e51e58fe894f453b2a1641892f9bc3dd | [
"MIT"
] | 5 | 2015-02-19T06:37:53.000Z | 2021-12-02T12:48:08.000Z | dynamic_db_router/router.py | jaredlewis/django-dynamic-db-router | ea13d6b0e51e58fe894f453b2a1641892f9bc3dd | [
"MIT"
] | 20 | 2015-02-18T22:46:34.000Z | 2022-01-08T19:19:18.000Z | import threading
from functools import wraps
from uuid import uuid4
from django.db import connections
THREAD_LOCAL = threading.local()
class DynamicDbRouter(object):
"""A router that decides what db to read from based on a variable
local to the current thread.
"""
def db_for_read(self, model, **hin... | 34.242188 | 78 | 0.646817 | import threading
from functools import wraps
from uuid import uuid4
from django.db import connections
THREAD_LOCAL = threading.local()
class DynamicDbRouter(object):
def db_for_read(self, model, **hints):
return getattr(THREAD_LOCAL, 'DB_FOR_READ_OVERRIDE', ['default'])[-1]
def db_for_write(self, ... | true | true |
f768838d9dcde413bc9f558a41578ee39ebb09b0 | 37,897 | py | Python | tests/unit/test_lambda.py | alex-vance/localstack | a0cff49f3e8e64e9c39b57642b77048a27b6d2d8 | [
"Apache-2.0"
] | 1 | 2020-09-27T06:56:06.000Z | 2020-09-27T06:56:06.000Z | tests/unit/test_lambda.py | alex-vance/localstack | a0cff49f3e8e64e9c39b57642b77048a27b6d2d8 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_lambda.py | alex-vance/localstack | a0cff49f3e8e64e9c39b57642b77048a27b6d2d8 | [
"Apache-2.0"
] | 1 | 2020-08-07T12:49:58.000Z | 2020-08-07T12:49:58.000Z | import os
import re
import json
import unittest
import mock
import time
import datetime
from localstack.utils.common import save_file, new_tmp_dir, mkdir
from localstack.services.awslambda import lambda_api, lambda_executors
from localstack.utils.aws.aws_models import LambdaFunction
from localstack.constants import LAM... | 52.56172 | 120 | 0.656332 | import os
import re
import json
import unittest
import mock
import time
import datetime
from localstack.utils.common import save_file, new_tmp_dir, mkdir
from localstack.services.awslambda import lambda_api, lambda_executors
from localstack.utils.aws.aws_models import LambdaFunction
from localstack.constants import LAM... | true | true |
f768840959c56f72f76bb74bfaa88bdacc621ee6 | 1,156 | py | Python | smartmin/pdf.py | nickhargreaves/smartmin | 660a67ec2619af2a766970b3fe3b4369fffb5741 | [
"BSD-3-Clause"
] | 166 | 2015-01-13T13:40:17.000Z | 2022-03-23T09:40:52.000Z | smartmin/pdf.py | nickhargreaves/smartmin | 660a67ec2619af2a766970b3fe3b4369fffb5741 | [
"BSD-3-Clause"
] | 71 | 2015-01-08T17:02:31.000Z | 2022-02-10T12:43:27.000Z | smartmin/pdf.py | nickhargreaves/smartmin | 660a67ec2619af2a766970b3fe3b4369fffb5741 | [
"BSD-3-Clause"
] | 34 | 2015-01-14T07:19:27.000Z | 2021-02-19T20:41:02.000Z | import os
from io import StringIO
import ho.pisa as pisa
from django.conf import settings
from django.http import HttpResponse
from django.utils.html import escape
class PDFMixin(object):
"""
Mixin that will change a class based view to render as PDF
Dependencies:
- reportlab
- html5lib
... | 28.195122 | 106 | 0.66955 | import os
from io import StringIO
import ho.pisa as pisa
from django.conf import settings
from django.http import HttpResponse
from django.utils.html import escape
class PDFMixin(object):
def render_to_response(self, context, **response_kwargs):
response = super(PDFMixin, self).render_to_response(conte... | true | true |
f7688532bb077d6612606d872f938cf0de586dd6 | 1,788 | py | Python | p2ner/components/plugin/chatclient/chatclient/messages/messages.py | schristakidis/p2ner | 46694a41e8c1ebdc28f520b58c126da8785f3eed | [
"Apache-2.0"
] | 2 | 2015-06-01T22:04:34.000Z | 2017-07-06T09:35:00.000Z | p2ner/components/plugin/chatclient/chatclient/messages/messages.py | schristakidis/p2ner | 46694a41e8c1ebdc28f520b58c126da8785f3eed | [
"Apache-2.0"
] | null | null | null | p2ner/components/plugin/chatclient/chatclient/messages/messages.py | schristakidis/p2ner | 46694a41e8c1ebdc28f520b58c126da8785f3eed | [
"Apache-2.0"
] | 1 | 2019-11-26T10:22:35.000Z | 2019-11-26T10:22:35.000Z | from p2ner.base.ControlMessage import ControlMessage,trap_sent
# Copyright 2012 Loris Corazza, Sakis Christakidis
#
# 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.... | 34.384615 | 108 | 0.687919 | from p2ner.base.ControlMessage import ControlMessage,trap_sent
from p2ner.base.Consts import MessageCodes as MSG
from construct import Container
class ChatterMessage(ControlMessage):
type = "basemessage"
code = MSG.CHATTER_MSG
ack = True
def trigger(self, message):
return True
def ac... | true | true |
f768854798892be54d0d8f5dd455ec0c6928ae51 | 7,715 | py | Python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_run_commands_operations.py | dubiety/azure-sdk-for-python | 62ffa839f5d753594cf0fe63668f454a9d87a346 | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_run_commands_operations.py | ellhe-blaster/azure-sdk-for-python | 82193ba5e81cc5e5e5a5239bba58abe62e86f469 | [
"MIT"
] | null | null | null | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_run_commands_operations.py | ellhe-blaster/azure-sdk-for-python | 82193ba5e81cc5e5e5a5239bba58abe62e86f469 | [
"MIT"
] | null | null | null | # pylint: disable=too-many-lines
# 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) AutoRe... | 42.15847 | 150 | 0.655347 | from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
f... | true | true |
f768863476ce36ba067e6345ad29356e5436fe6d | 815 | py | Python | nets/preprocessing.py | zhyhan/spine-reports-gene | a07b842594f33c5bf0b9095f82664857fe7be2ae | [
"Apache-2.0"
] | 1 | 2021-04-17T10:46:50.000Z | 2021-04-17T10:46:50.000Z | nets/preprocessing.py | zhyhan/spine-reports-gene | a07b842594f33c5bf0b9095f82664857fe7be2ae | [
"Apache-2.0"
] | null | null | null | nets/preprocessing.py | zhyhan/spine-reports-gene | a07b842594f33c5bf0b9095f82664857fe7be2ae | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
def data_augmentation(image, is_training=None):
if is_training:
return preprocess_for_train(image)
else:
return preprocess_for_eval(image)
... | 30.185185 | 107 | 0.755828 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
def data_augmentation(image, is_training=None):
if is_training:
return preprocess_for_train(image)
else:
return preprocess_for_eval(image)
... | true | true |
f768864e4a682a4ea42ba439a7dd906494ef52e9 | 587 | py | Python | HackerRank/Interview Preparation Kit/String Manipulation/MakingAnagrams.py | Anni1123/competitive-programming | bfcc72ff3379d09dee22f30f71751a32c0cc511b | [
"MIT"
] | 1 | 2021-04-03T13:33:00.000Z | 2021-04-03T13:33:00.000Z | HackerRank/Interview Preparation Kit/String Manipulation/MakingAnagrams.py | iamsuryakant/competitive-programming | 413000f5bc4a627407e1335c35dcdbee516e8cc1 | [
"MIT"
] | null | null | null | HackerRank/Interview Preparation Kit/String Manipulation/MakingAnagrams.py | iamsuryakant/competitive-programming | 413000f5bc4a627407e1335c35dcdbee516e8cc1 | [
"MIT"
] | 2 | 2021-01-23T14:35:48.000Z | 2021-03-15T05:04:24.000Z | def number_needed(a, b):
s = "abcdefghijklmnopqrstuvwxyz"
s = list(s)
countA = [0 for i in range(26)]
countB = [0 for i in range(26)]
for i in range(len(s)) :
for j in range(len(a)) :
if(a[j] is s[i]) :
countA[i]+=1
for j in range(le... | 24.458333 | 44 | 0.446337 | def number_needed(a, b):
s = "abcdefghijklmnopqrstuvwxyz"
s = list(s)
countA = [0 for i in range(26)]
countB = [0 for i in range(26)]
for i in range(len(s)) :
for j in range(len(a)) :
if(a[j] is s[i]) :
countA[i]+=1
for j in range(le... | true | true |
f7688784e77204984788c772554a9f354c63f7b4 | 7,677 | py | Python | zephyr/zmake/tests/test_project.py | DHowett/fw-ectool | d5b5b5008d2f98400206deb182e8ce772b6df9df | [
"BSD-3-Clause"
] | 13 | 2021-12-26T06:48:29.000Z | 2022-03-13T10:21:14.000Z | zephyr/zmake/tests/test_project.py | DHowett/fw-ectool | d5b5b5008d2f98400206deb182e8ce772b6df9df | [
"BSD-3-Clause"
] | 1 | 2022-01-08T23:28:01.000Z | 2022-01-09T00:43:16.000Z | zephyr/zmake/tests/test_project.py | DHowett/fw-ectool | d5b5b5008d2f98400206deb182e8ce772b6df9df | [
"BSD-3-Clause"
] | 1 | 2022-01-09T07:48:44.000Z | 2022-01-09T07:48:44.000Z | # Copyright 2021 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import pathlib
import string
import tempfile
import hypothesis
import hypothesis.strategies as st
import pytest
import zmake.modules
import zmake.output... | 33.090517 | 84 | 0.647258 |
import pathlib
import string
import tempfile
import hypothesis
import hypothesis.strategies as st
import pytest
import zmake.modules
import zmake.output_packers
import zmake.project
board_names = st.text(alphabet=set(string.ascii_lowercase) | {"_"}, min_size=1)
sets_of_board_names = st.lists(st.lists(board_names, u... | true | true |
f768885cdd287594222a59840c870944f3ecb286 | 188 | py | Python | atcoder/abc066/b.py | Ashindustry007/competitive-programming | 2eabd3975c029d235abb7854569593d334acae2f | [
"WTFPL"
] | 506 | 2018-08-22T10:30:38.000Z | 2022-03-31T10:01:49.000Z | atcoder/abc066/b.py | Ashindustry007/competitive-programming | 2eabd3975c029d235abb7854569593d334acae2f | [
"WTFPL"
] | 13 | 2019-08-07T18:31:18.000Z | 2020-12-15T21:54:41.000Z | atcoder/abc066/b.py | Ashindustry007/competitive-programming | 2eabd3975c029d235abb7854569593d334acae2f | [
"WTFPL"
] | 234 | 2018-08-06T17:11:41.000Z | 2022-03-26T10:56:42.000Z | #!/usr/bin/env python3
# https://abc066.contest.atcoder.jp/tasks/abc066_b
s = input()
for i in range((len(s) - 1) // 2 , -1, -1):
if s[:i] == s[i:2*i]:
print(2*i)
break | 26.857143 | 50 | 0.537234 | s = input()
for i in range((len(s) - 1) // 2 , -1, -1):
if s[:i] == s[i:2*i]:
print(2*i)
break | true | true |
f768885d89a1c4b7f25041ec894eaa7e1687a40b | 10,053 | py | Python | contrib/spendfrom/spendfrom.py | AlvaStudio/vtl | 06451959620dc6771c980176e76a4800fea03160 | [
"MIT"
] | null | null | null | contrib/spendfrom/spendfrom.py | AlvaStudio/vtl | 06451959620dc6771c980176e76a4800fea03160 | [
"MIT"
] | null | null | null | contrib/spendfrom/spendfrom.py | AlvaStudio/vtl | 06451959620dc6771c980176e76a4800fea03160 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Use the raw transactions API to spend bitcoins received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a bitcoind or Bit... | 37.511194 | 111 | 0.632249 |
from decimal import *
import getpass
import math
import os
import os.path
import platform
import sys
import time
from jsonrpc import ServiceProxy, json
BASE_FEE=Decimal("0.001")
def check_json_precision():
n = Decimal("20000000.00000003")
satoshis = int(json.loads(json.dumps(float(n)))*1.0e8)
if satoshis... | true | true |
f7688879c95f05a1019f14ba60456b5044fbeefd | 3,338 | py | Python | D01_Form_Application/D01_Form_Application/settings.py | Hari-Krishna-Moorthy/Django-daily | 90801cc89d979e70e594ba07dbb7178ffeddac33 | [
"Apache-2.0"
] | null | null | null | D01_Form_Application/D01_Form_Application/settings.py | Hari-Krishna-Moorthy/Django-daily | 90801cc89d979e70e594ba07dbb7178ffeddac33 | [
"Apache-2.0"
] | null | null | null | D01_Form_Application/D01_Form_Application/settings.py | Hari-Krishna-Moorthy/Django-daily | 90801cc89d979e70e594ba07dbb7178ffeddac33 | [
"Apache-2.0"
] | null | null | null | """
Django settings for D01_Form_Application project.
Generated by 'django-admin startproject' using Django 3.2.7.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
... | 26.078125 | 91 | 0.706711 |
from pathlib import Path
import os
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'django-insecure-)1eufx_26%q6%sm%y1a05fm(rj7b1y(q21irl3hwr3gt82eykd'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.... | true | true |
f7688982dcb2b77bdbb44b7c15aaff346ad2e8f0 | 4,111 | py | Python | setup.py | shoyer/bottleneck | aa71a26fe5ef4127df86276c1ee6b5ba8f6dcc5b | [
"BSD-2-Clause"
] | null | null | null | setup.py | shoyer/bottleneck | aa71a26fe5ef4127df86276c1ee6b5ba8f6dcc5b | [
"BSD-2-Clause"
] | null | null | null | setup.py | shoyer/bottleneck | aa71a26fe5ef4127df86276c1ee6b5ba8f6dcc5b | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
import os
import sys
try:
import setuptools # noqa
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
from setuptools.extension import Extension
from setuptools.command.build_ext import build_ext as _build_ext
# wo... | 37.036036 | 75 | 0.603503 |
import os
import sys
try:
import setuptools except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
from setuptools.extension import Extension
from setuptools.command.build_ext import build_ext as _build_ext
class build_ext(_build_ext):
... | true | true |
f7688bfde5ef57d1e1b8dec57f6714ad7c693a3d | 1,618 | py | Python | examples/models/image_url.py | pyjsdev/googlemap_flask | 9d0dd899a9cbf756b3d83c33e3d8a47e7db40cc5 | [
"BSD-3-Clause"
] | 2 | 2019-05-24T14:07:33.000Z | 2019-05-24T14:36:19.000Z | examples/models/image_url.py | pyjsdev/googlemap_flask | 9d0dd899a9cbf756b3d83c33e3d8a47e7db40cc5 | [
"BSD-3-Clause"
] | null | null | null | examples/models/image_url.py | pyjsdev/googlemap_flask | 9d0dd899a9cbf756b3d83c33e3d8a47e7db40cc5 | [
"BSD-3-Clause"
] | 1 | 2021-09-09T03:33:04.000Z | 2021-09-09T03:33:04.000Z | import numpy as np
from bokeh.util.browser import view
from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.models.glyphs import ImageURL
from bokeh.models import ColumnDataSource, Range1d, Plot, LinearAxis, Grid
from bokeh.resources import INLINE
url = "http://bokeh.pydata.org/en/latest/_... | 27.896552 | 95 | 0.684178 | import numpy as np
from bokeh.util.browser import view
from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.models.glyphs import ImageURL
from bokeh.models import ColumnDataSource, Range1d, Plot, LinearAxis, Grid
from bokeh.resources import INLINE
url = "http://bokeh.pydata.org/en/latest/_... | true | true |
f7688d2ebc670b52b1e3967e0dff0c70f561c558 | 1,777 | py | Python | build/config/mac/package_framework.py | akbiggs/buildroot | 138bbd891951797008e83db2dbbdd322debf0312 | [
"BSD-3-Clause"
] | 108 | 2016-12-03T04:01:33.000Z | 2022-02-18T00:48:36.000Z | build/config/mac/package_framework.py | akbiggs/buildroot | 138bbd891951797008e83db2dbbdd322debf0312 | [
"BSD-3-Clause"
] | 250 | 2016-08-09T23:25:42.000Z | 2022-03-31T19:56:11.000Z | build/config/mac/package_framework.py | akbiggs/buildroot | 138bbd891951797008e83db2dbbdd322debf0312 | [
"BSD-3-Clause"
] | 214 | 2016-08-19T16:40:59.000Z | 2022-03-24T08:38:33.000Z | # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import errno
import os
import shutil
import sys
def Main():
parser = argparse.ArgumentParser(description='Create Mac Framework symlinks')
... | 29.131148 | 79 | 0.68655 |
import argparse
import errno
import os
import shutil
import sys
def Main():
parser = argparse.ArgumentParser(description='Create Mac Framework symlinks')
parser.add_argument('--framework', action='store', type=str, required=True)
parser.add_argument('--version', action='store', type=str)
parser.add_argument('... | true | true |
f7688d7ad683265fbb1e8a08a4604b56589b309f | 6,873 | py | Python | api/api.py | pgtinsley/deepface | 156d8a2a1a38fe7234cfcf3b09b517b9b062e8da | [
"MIT"
] | 1 | 2020-09-23T03:24:08.000Z | 2020-09-23T03:24:08.000Z | api/api.py | pgtinsley/deepface | 156d8a2a1a38fe7234cfcf3b09b517b9b062e8da | [
"MIT"
] | null | null | null | api/api.py | pgtinsley/deepface | 156d8a2a1a38fe7234cfcf3b09b517b9b062e8da | [
"MIT"
] | 1 | 2021-01-27T22:06:00.000Z | 2021-01-27T22:06:00.000Z | from flask import Flask, jsonify, request, make_response
import argparse
import uuid
import json
import time
from tqdm import tqdm
import tensorflow as tf
from deepface import DeepFace
from deepface.basemodels import VGGFace, OpenFace, Facenet, FbDeepFace, DeepID
from deepface.basemodels.DlibResNet import DlibResNet... | 28.6375 | 180 | 0.666812 | from flask import Flask, jsonify, request, make_response
import argparse
import uuid
import json
import time
from tqdm import tqdm
import tensorflow as tf
from deepface import DeepFace
from deepface.basemodels import VGGFace, OpenFace, Facenet, FbDeepFace, DeepID
from deepface.basemodels.DlibResNet import DlibResNet... | true | true |
f7688df8bc48631fe4a858cb88d54ad3a58055b4 | 14,700 | py | Python | pybind/nos/v6_0_2c/interface/fortygigabitethernet/ipv6/ipv6_nd_ra/ipv6_intf_cmds/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/nos/v6_0_2c/interface/fortygigabitethernet/ipv6/ipv6_nd_ra/ipv6_intf_cmds/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/nos/v6_0_2c/interface/fortygigabitethernet/ipv6/ipv6_nd_ra/ipv6_intf_cmds/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | 1 | 2021-11-05T22:15:42.000Z | 2021-11-05T22:15:42.000Z |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | 75.384615 | 1,097 | 0.737143 |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | true | true |
f7688e250148522403237da630612c5c6d10588c | 15,680 | py | Python | compressible/unsplit_fluxes.py | mojiastonybrook/pyro2 | 050eacac7fcf4d5fc28e9fa356c445777fa7585c | [
"BSD-3-Clause"
] | null | null | null | compressible/unsplit_fluxes.py | mojiastonybrook/pyro2 | 050eacac7fcf4d5fc28e9fa356c445777fa7585c | [
"BSD-3-Clause"
] | null | null | null | compressible/unsplit_fluxes.py | mojiastonybrook/pyro2 | 050eacac7fcf4d5fc28e9fa356c445777fa7585c | [
"BSD-3-Clause"
] | null | null | null | """Implementation of the Colella 2nd order unsplit Godunov scheme. This
is a 2-dimensional implementation only. We assume that the grid is
uniform, but it is relatively straightforward to relax this
assumption.
There are several different options for this solver (they are all
discussed in the Colella paper).
* limi... | 35.636364 | 110 | 0.443431 |
import compressible.interface_f as ifc
import compressible as comp
import mesh.reconstruction as reconstruction
import mesh.array_indexer as ai
from util import msg
def unsplit_fluxes(my_data, my_aux, rp, ivars, solid, tc, dt):
tm_flux = tc.timer("unsplitFluxes")
tm_flux.begin()
myg = my_data.grid
... | true | true |
f7688eb87ff92e0ab28d5b111ec024db50721042 | 4,975 | py | Python | tests/test_batch_recommend.py | KimuraTian/lkpy | 66ad6a2b91afacf5d7166455fd5af5c6608e487e | [
"MIT"
] | 1 | 2019-04-03T17:17:45.000Z | 2019-04-03T17:17:45.000Z | tests/test_batch_recommend.py | tudousponge/lkpy | d5b1b86ba73eb0b2b2eb90682aa872917813b20e | [
"MIT"
] | 1 | 2019-12-11T17:24:16.000Z | 2019-12-11T17:24:16.000Z | tests/test_batch_recommend.py | tudousponge/lkpy | d5b1b86ba73eb0b2b2eb90682aa872917813b20e | [
"MIT"
] | 2 | 2019-08-11T19:05:23.000Z | 2021-05-23T04:41:43.000Z | import pytest
import os
import os.path
from collections import namedtuple
import logging
import pandas as pd
import numpy as np
import lk_test_utils as lktu
from lenskit.algorithms.basic import Bias, TopN
import lenskit.batch as lkb
MLB = namedtuple('MLB', ['ratings', 'algo'])
_log = logging.getLogger(__name__)
@... | 30.521472 | 100 | 0.629146 | import pytest
import os
import os.path
from collections import namedtuple
import logging
import pandas as pd
import numpy as np
import lk_test_utils as lktu
from lenskit.algorithms.basic import Bias, TopN
import lenskit.batch as lkb
MLB = namedtuple('MLB', ['ratings', 'algo'])
_log = logging.getLogger(__name__)
@... | true | true |
f7688f677dd49c45c12eddf83296fb86a0aeadd1 | 869 | py | Python | test/test_v1_block_size.py | ansijain/client-python | 444ab92a68371c1ccd89314753fa7ab5c4ac9bbe | [
"Apache-2.0"
] | 21 | 2018-02-21T23:59:28.000Z | 2021-12-08T05:47:37.000Z | test/test_v1_block_size.py | ansijain/client-python | 444ab92a68371c1ccd89314753fa7ab5c4ac9bbe | [
"Apache-2.0"
] | 47 | 2018-02-01T15:35:01.000Z | 2022-02-11T07:45:54.000Z | test/test_v1_block_size.py | ansijain/client-python | 444ab92a68371c1ccd89314753fa7ab5c4ac9bbe | [
"Apache-2.0"
] | 19 | 2018-04-03T09:20:52.000Z | 2021-06-01T06:07:28.000Z | # coding: utf-8
"""
KubeVirt API
This is KubeVirt API an add-on for Kubernetes.
OpenAPI spec version: 1.0.0
Contact: kubevirt-dev@googlegroups.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
import unittest
i... | 19.311111 | 79 | 0.684695 |
from __future__ import absolute_import
import os
import sys
import unittest
import kubevirt
from kubevirt.rest import ApiException
from kubevirt.models.v1_block_size import V1BlockSize
class TestV1BlockSize(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test... | true | true |
f7688f7c52accbf67cefda0035ee7b45ea5e685b | 19,870 | py | Python | tensorflow_datasets/core/dataset_info_test.py | Rishabh-Choudhry/datasets | 2bad427bba6cdcab717698a70c96339733c5d42c | [
"Apache-2.0"
] | 2 | 2022-02-14T09:51:39.000Z | 2022-02-14T13:27:49.000Z | tensorflow_datasets/core/dataset_info_test.py | Rishabh-Choudhry/datasets | 2bad427bba6cdcab717698a70c96339733c5d42c | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/core/dataset_info_test.py | Rishabh-Choudhry/datasets | 2bad427bba6cdcab717698a70c96339733c5d42c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2022 The TensorFlow Datasets 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 appl... | 35.609319 | 91 | 0.685707 |
import json
import os
import pathlib
import tempfile
import numpy as np
import pytest
import tensorflow as tf
from tensorflow_datasets import testing
from tensorflow_datasets.core import dataset_info
from tensorflow_datasets.core import features
from tensorflow_datasets.core import file_adapters
from tensorflow_data... | true | true |
f7689090879824a149025a5a45ff1ae2d82ce451 | 1,574 | py | Python | scripts/nsr_create_syn_train_csv.py | VoiceZen/OpenSeq2Seq | e18641a761c6ec572df3faf0d808a708ddebfcbb | [
"Apache-2.0"
] | 1,459 | 2017-09-11T17:58:19.000Z | 2022-03-27T06:42:04.000Z | scripts/nsr_create_syn_train_csv.py | VoiceZen/OpenSeq2Seq | e18641a761c6ec572df3faf0d808a708ddebfcbb | [
"Apache-2.0"
] | 307 | 2017-09-14T05:52:16.000Z | 2021-06-05T16:08:53.000Z | scripts/nsr_create_syn_train_csv.py | VoiceZen/OpenSeq2Seq | e18641a761c6ec572df3faf0d808a708ddebfcbb | [
"Apache-2.0"
] | 422 | 2017-09-11T19:13:21.000Z | 2022-03-31T23:43:10.000Z | # Copyright (c) 2018 NVIDIA Corporation
from __future__ import absolute_import, division, print_function
from __future__ import unicode_literals
import string
import os
import pandas as pd
if __name__ == '__main__':
synthetic_data_root = "/data/speech/librispeech-syn/"
synthetic_data_sample = synthetic_data_root ... | 32.122449 | 80 | 0.691868 | from __future__ import absolute_import, division, print_function
from __future__ import unicode_literals
import string
import os
import pandas as pd
if __name__ == '__main__':
synthetic_data_root = "/data/speech/librispeech-syn/"
synthetic_data_sample = synthetic_data_root + "{{}}/sample_step0_{}_syn.wav"
in_c... | true | true |
f76891bae4dc8944ffbdd9d0d2e6df5e791f0fef | 12,340 | py | Python | caffe2/python/operator_test/bbox_transform_test.py | wenhaopeter/read_pytorch_code | 491f989cd918cf08874dd4f671fb7f0142a0bc4f | [
"Intel",
"X11"
] | 15 | 2019-08-10T02:36:38.000Z | 2021-07-14T13:45:32.000Z | caffe2/python/operator_test/bbox_transform_test.py | wenhaopeter/read_pytorch_code | 491f989cd918cf08874dd4f671fb7f0142a0bc4f | [
"Intel",
"X11"
] | 7 | 2019-10-21T03:08:51.000Z | 2022-03-11T23:54:28.000Z | caffe2/python/operator_test/bbox_transform_test.py | wenhaopeter/read_pytorch_code | 491f989cd918cf08874dd4f671fb7f0142a0bc4f | [
"Intel",
"X11"
] | 6 | 2020-10-16T13:28:31.000Z | 2021-08-25T12:08:34.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from caffe2.python import core
from hypothesis import given
import caffe2.python.hypothesis_test_util as hu
import caffe2.python.serialized_test.serialized_test_util as s... | 34.565826 | 86 | 0.565154 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from caffe2.python import core
from hypothesis import given
import caffe2.python.hypothesis_test_util as hu
import caffe2.python.serialized_test.serialized_test_util as s... | true | true |
f76891f2ee0ae25a50f2b84988aa4586a171c3ed | 255 | py | Python | simple_exercises/lanesexercises/py_recursions/rec_ex_from_slides/sli14.py | ilante/programming_immanuela_englander | 45d51c99b09ae335a67e03ac5ea79fc775bdf0bd | [
"MIT"
] | null | null | null | simple_exercises/lanesexercises/py_recursions/rec_ex_from_slides/sli14.py | ilante/programming_immanuela_englander | 45d51c99b09ae335a67e03ac5ea79fc775bdf0bd | [
"MIT"
] | null | null | null | simple_exercises/lanesexercises/py_recursions/rec_ex_from_slides/sli14.py | ilante/programming_immanuela_englander | 45d51c99b09ae335a67e03ac5ea79fc775bdf0bd | [
"MIT"
] | null | null | null | def powe(base, exp):
if exp == 0:
return 1
else:
return base ** exp
print(powe(10, 2))
# now recursive:
def pow(base, exp):
if exp == 0:
return 1
else:
return base * pow(base, exp - 1)
print(pow(10, 3))
| 14.166667 | 40 | 0.509804 | def powe(base, exp):
if exp == 0:
return 1
else:
return base ** exp
print(powe(10, 2))
def pow(base, exp):
if exp == 0:
return 1
else:
return base * pow(base, exp - 1)
print(pow(10, 3))
| true | true |
f76892116bc6f1b64b797c75299e355280ee7f46 | 2,494 | py | Python | tests/test_parse/test_pamlmatrix.py | aberki1234/cogent3 | af98b248a999bfeefd4cfed6bd59b4f30442e2d4 | [
"BSD-3-Clause"
] | null | null | null | tests/test_parse/test_pamlmatrix.py | aberki1234/cogent3 | af98b248a999bfeefd4cfed6bd59b4f30442e2d4 | [
"BSD-3-Clause"
] | null | null | null | tests/test_parse/test_pamlmatrix.py | aberki1234/cogent3 | af98b248a999bfeefd4cfed6bd59b4f30442e2d4 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
from io import StringIO
from unittest import TestCase, main
from cogent3.evolve.models import DSO78_freqs, DSO78_matrix
from cogent3.parse.paml_matrix import PamlMatrixParser
__author__ = "Matthew Wakefield"
__copyright__ = "Copyright 2007-2020, The Cogent Project"
__credits__ = ["Matthew Wakef... | 36.144928 | 87 | 0.578589 | from io import StringIO
from unittest import TestCase, main
from cogent3.evolve.models import DSO78_freqs, DSO78_matrix
from cogent3.parse.paml_matrix import PamlMatrixParser
__author__ = "Matthew Wakefield"
__copyright__ = "Copyright 2007-2020, The Cogent Project"
__credits__ = ["Matthew Wakefield"]
__license__ = "... | true | true |
f768929ca24cc26437b33a4c73dcd140fe600587 | 1,799 | py | Python | tests/test_username_json.py | bountysource/www.gittip.com | 84cd36dd1da2eec54ebf0fe8c7c31d10ae5b933c | [
"CC0-1.0"
] | 4 | 2015-03-11T02:04:27.000Z | 2021-04-28T01:33:40.000Z | tests/test_username_json.py | sigmavirus24/www.gittip.com | 112ea4e62aefad11c36954f0f979679ce057cf02 | [
"CC0-1.0"
] | null | null | null | tests/test_username_json.py | sigmavirus24/www.gittip.com | 112ea4e62aefad11c36954f0f979679ce057cf02 | [
"CC0-1.0"
] | 3 | 2015-08-27T09:47:17.000Z | 2018-08-02T14:05:59.000Z | import json
from gittip.testing import Harness
from gittip.testing.client import TestClient
class Tests(Harness):
def change_username(self, new_username, user='alice'):
self.make_participant('alice')
client = TestClient()
response = client.get('/')
csrf_token = response.request.... | 33.943396 | 78 | 0.585881 | import json
from gittip.testing import Harness
from gittip.testing.client import TestClient
class Tests(Harness):
def change_username(self, new_username, user='alice'):
self.make_participant('alice')
client = TestClient()
response = client.get('/')
csrf_token = response.request.... | true | true |
f768941b4c420a3c0bae5bb8909d694bce47e701 | 12,345 | py | Python | gooddata-metadata-client/gooddata_metadata_client/model/json_api_data_source_identifier_out_list.py | hkad98/gooddata-python-sdk | 64942080ecb44c2d8e914e57f7a591daa6cca205 | [
"MIT"
] | null | null | null | gooddata-metadata-client/gooddata_metadata_client/model/json_api_data_source_identifier_out_list.py | hkad98/gooddata-python-sdk | 64942080ecb44c2d8e914e57f7a591daa6cca205 | [
"MIT"
] | null | null | null | gooddata-metadata-client/gooddata_metadata_client/model/json_api_data_source_identifier_out_list.py | hkad98/gooddata-python-sdk | 64942080ecb44c2d8e914e57f7a591daa6cca205 | [
"MIT"
] | null | null | null | """
OpenAPI definition
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v0
Contact: support@gooddata.com
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sy... | 43.315789 | 133 | 0.570757 |
import re import sys
from gooddata_metadata_client.model_utils import ( ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info... | true | true |
f76894b6a6d64051cc863b8c2aba8cb8d8d0e226 | 7,790 | py | Python | tests/integ/test_training_compiler.py | mufaddal-rohawala/sagemaker-python-sdk | 72c12bb1481c368f799b17c38d07c5fc34864093 | [
"Apache-2.0"
] | null | null | null | tests/integ/test_training_compiler.py | mufaddal-rohawala/sagemaker-python-sdk | 72c12bb1481c368f799b17c38d07c5fc34864093 | [
"Apache-2.0"
] | 20 | 2021-09-17T20:50:11.000Z | 2021-12-09T00:29:02.000Z | tests/integ/test_training_compiler.py | mufaddal-rohawala/sagemaker-python-sdk | 72c12bb1481c368f799b17c38d07c5fc34864093 | [
"Apache-2.0"
] | null | null | null | # Copyright Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompan... | 35.898618 | 117 | 0.663671 | from __future__ import absolute_import
import os
from packaging import version
import pytest
from sagemaker.huggingface import HuggingFace
from sagemaker.huggingface import TrainingCompilerConfig as HFTrainingCompilerConfig
from sagemaker.tensorflow import TensorFlow
from sagemaker.tensorflow import TrainingCompilerC... | true | true |
f76895a568acf8db7626aa430a67e7f682a76f4f | 9,694 | py | Python | tests/test_core.py | yasufumy/pipelib | 7579d87619971e14728573130fde9d8cc2284998 | [
"MIT"
] | 4 | 2018-12-26T05:16:13.000Z | 2019-03-18T09:57:43.000Z | tests/test_core.py | yasufumy/pipelib | 7579d87619971e14728573130fde9d8cc2284998 | [
"MIT"
] | 22 | 2018-12-30T13:16:41.000Z | 2019-02-18T01:40:47.000Z | tests/test_core.py | yasufumy/pipelib | 7579d87619971e14728573130fde9d8cc2284998 | [
"MIT"
] | null | null | null | from unittest import TestCase
from unittest.mock import patch, Mock
import tempfile
from itertools import chain
import pipelib
from pipelib import Dataset, TextDataset, DirDataset
class DatasetTestCase(TestCase):
def setUp(self):
self.base = range(100)
self.data = Dataset(self.base)
def che... | 31.888158 | 79 | 0.612853 | from unittest import TestCase
from unittest.mock import patch, Mock
import tempfile
from itertools import chain
import pipelib
from pipelib import Dataset, TextDataset, DirDataset
class DatasetTestCase(TestCase):
def setUp(self):
self.base = range(100)
self.data = Dataset(self.base)
def che... | true | true |
f76895e57319b59e80dabfc9da4be11f70d2f02d | 1,218 | py | Python | test/programytest/parser/template/node_tests/test_resetlearn.py | ItsPhant/program-y | c2b211fcaf8cedc7d6d95a8ea9470a913efa1622 | [
"MIT"
] | null | null | null | test/programytest/parser/template/node_tests/test_resetlearn.py | ItsPhant/program-y | c2b211fcaf8cedc7d6d95a8ea9470a913efa1622 | [
"MIT"
] | null | null | null | test/programytest/parser/template/node_tests/test_resetlearn.py | ItsPhant/program-y | c2b211fcaf8cedc7d6d95a8ea9470a913efa1622 | [
"MIT"
] | 1 | 2020-02-21T17:58:05.000Z | 2020-02-21T17:58:05.000Z | from programy.parser.template.nodes.resetlearn import TemplateResetLearnNode
from programy.parser.template.nodes.base import TemplateNode
from programytest.parser.template.base import TemplateTestsBaseClass
class MockTemplateResetLearnNode(TemplateResetLearnNode):
def __init__(self):
TemplateResetLearnNod... | 34.8 | 81 | 0.722496 | from programy.parser.template.nodes.resetlearn import TemplateResetLearnNode
from programy.parser.template.nodes.base import TemplateNode
from programytest.parser.template.base import TemplateTestsBaseClass
class MockTemplateResetLearnNode(TemplateResetLearnNode):
def __init__(self):
TemplateResetLearnNod... | true | true |
f76898f58ba995bb4251556a9b5a81cd113678d7 | 55 | py | Python | Code files/util.py | magnusmel/Refactoring-Python-Code-v- | 8f4f08c9a4750da32e223b73e219a59a3bdd1941 | [
"MIT"
] | 4 | 2018-12-25T07:08:58.000Z | 2021-10-11T17:58:36.000Z | Code files/util.py | magnusmel/Refactoring-Python-Code-v- | 8f4f08c9a4750da32e223b73e219a59a3bdd1941 | [
"MIT"
] | null | null | null | Code files/util.py | magnusmel/Refactoring-Python-Code-v- | 8f4f08c9a4750da32e223b73e219a59a3bdd1941 | [
"MIT"
] | 2 | 2019-04-20T14:39:54.000Z | 2021-05-22T06:13:30.000Z | def get_first_name(name):
return name.split(' ')[0] | 27.5 | 29 | 0.672727 | def get_first_name(name):
return name.split(' ')[0] | true | true |
f76899a88993cff58ab7468cb3f7beb015547fe7 | 71 | py | Python | templating/core/src/main/python/jsonteng/tags/__init__.py | vmware/json-template-engine | afa606aef47599f8ff7cf7d1f927877a9ce786e7 | [
"Apache-2.0"
] | 21 | 2019-09-30T08:41:01.000Z | 2022-03-15T08:23:28.000Z | templating/core/src/main/python/jsonteng/tags/__init__.py | vmware/json-template-engine | afa606aef47599f8ff7cf7d1f927877a9ce786e7 | [
"Apache-2.0"
] | 1 | 2020-03-17T03:14:00.000Z | 2020-05-01T18:02:23.000Z | templating/core/src/main/python/jsonteng/tags/__init__.py | vmware/json-template-engine | afa606aef47599f8ff7cf7d1f927877a9ce786e7 | [
"Apache-2.0"
] | 7 | 2019-06-18T14:35:57.000Z | 2021-12-06T23:01:30.000Z | # Copyright 2019 VMware, Inc.
# SPDX-License-Indentifier: Apache-2.0
| 14.2 | 38 | 0.732394 | true | true | |
f7689a4d3471ecc27c37c220871a2a123bcf2b5f | 2,413 | py | Python | demo/demo3.py | Jabba-The-Gut/PREN_2 | 332b46144f771a96e7dbaaa605a82230aaafa948 | [
"MIT"
] | null | null | null | demo/demo3.py | Jabba-The-Gut/PREN_2 | 332b46144f771a96e7dbaaa605a82230aaafa948 | [
"MIT"
] | null | null | null | demo/demo3.py | Jabba-The-Gut/PREN_2 | 332b46144f771a96e7dbaaa605a82230aaafa948 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import asyncio
from mavsdk import System
from mavsdk import (OffboardError, VelocityBodyYawspeed)
async def run():
""" Does Offboard control using velocity body coordinates. """
drone = System()
await drone.connect(system_address="udp://:14540")
print("Waiting for drone to ... | 28.72619 | 66 | 0.642768 |
import asyncio
from mavsdk import System
from mavsdk import (OffboardError, VelocityBodyYawspeed)
async def run():
drone = System()
await drone.connect(system_address="udp://:14540")
print("Waiting for drone to connect...")
async for state in drone.core.connection_state():
if state.is_con... | true | true |
f7689ab63a422bd1599553068668a48113299350 | 1,512 | py | Python | homeassistant/components/zeroconf/usage.py | basicpail/core | 5cc54618c5af3f75c08314bf2375cc7ac40d2b7e | [
"Apache-2.0"
] | 11 | 2018-02-16T15:35:47.000Z | 2020-01-14T15:20:00.000Z | homeassistant/components/zeroconf/usage.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 87 | 2020-07-06T22:22:54.000Z | 2022-03-31T06:01:46.000Z | homeassistant/components/zeroconf/usage.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 11 | 2020-12-16T13:48:14.000Z | 2022-02-01T00:28:05.000Z | """Zeroconf usage utility to warn about multiple instances."""
from contextlib import suppress
import logging
from typing import Any
import zeroconf
from homeassistant.helpers.frame import (
MissingIntegrationFrame,
get_integration_frame,
report_integration,
)
from .models import HaZeroconf
_LOGGER = l... | 28.528302 | 161 | 0.717593 |
from contextlib import suppress
import logging
from typing import Any
import zeroconf
from homeassistant.helpers.frame import (
MissingIntegrationFrame,
get_integration_frame,
report_integration,
)
from .models import HaZeroconf
_LOGGER = logging.getLogger(__name__)
def install_multiple_zeroconf_catc... | true | true |
f7689abfe1bbce205aaa85dd413ae72c89b09659 | 2,020 | py | Python | tests/test_friendships_storage.py | TestowanieAutomatyczneUG/laboratorium-11-maciejSzcz | bc7172e3801cbc834526d021f5f806742e3b9724 | [
"MIT"
] | null | null | null | tests/test_friendships_storage.py | TestowanieAutomatyczneUG/laboratorium-11-maciejSzcz | bc7172e3801cbc834526d021f5f806742e3b9724 | [
"MIT"
] | null | null | null | tests/test_friendships_storage.py | TestowanieAutomatyczneUG/laboratorium-11-maciejSzcz | bc7172e3801cbc834526d021f5f806742e3b9724 | [
"MIT"
] | null | null | null | import unittest
from unittest.mock import mock_open, patch, MagicMock
from unittest import mock
from src.zad3.friendships_storage import FriendshipsStorage
from src.zad3.friendships import Friendships
class TestFriendshipsStorage(unittest.TestCase):
def test_friendships_storage_add_raises_typeError_with_not_frie... | 38.846154 | 93 | 0.766337 | import unittest
from unittest.mock import mock_open, patch, MagicMock
from unittest import mock
from src.zad3.friendships_storage import FriendshipsStorage
from src.zad3.friendships import Friendships
class TestFriendshipsStorage(unittest.TestCase):
def test_friendships_storage_add_raises_typeError_with_not_frie... | true | true |
f7689bcf664c07a5e7f4dcc4f507be30efe09515 | 64,007 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_network_interfaces_operations.py | praveenkuttappan/azure-sdk-for-python | 4b79413667b7539750a6c7dde15737013a3d4bd5 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_network_interfaces_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_network_interfaces_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # 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.
# Changes may ... | 52.464754 | 354 | 0.680254 | from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pi... | true | true |
f7689d2905f971d3b6b8d47ef1bb774d3c08e4b9 | 11,910 | py | Python | src/m5_more_sequences.py | hughesm1/12-MoreSequences | 52acd41e90f199fed93a110a8df480407451d8c6 | [
"MIT"
] | null | null | null | src/m5_more_sequences.py | hughesm1/12-MoreSequences | 52acd41e90f199fed93a110a8df480407451d8c6 | [
"MIT"
] | null | null | null | src/m5_more_sequences.py | hughesm1/12-MoreSequences | 52acd41e90f199fed93a110a8df480407451d8c6 | [
"MIT"
] | null | null | null | """
This module lets you practice various patterns
for ITERATING through SEQUENCES, including:
-- Beginning to end
-- Other ranges (e.g., backwards and every-3rd-item)
-- The COUNT/SUM/etc pattern
-- The FIND pattern (via LINEAR SEARCH)
Authors: David Mutchler, Vibha Alangar, Matt Boutell, Dave Fisher,
... | 36.533742 | 79 | 0.51864 |
import rosegraphics as rg
def main():
run_test_sum_radii()
run_test_count_last_n_odds()
run_test_index_of_first_negative()
run_test_contains_an_a()
def run_test_sum_radii():
print()
print('--------------------------------------------------')
print('Testing the sum_radii function:')
... | true | true |
f7689d903124ba664601ee08b5c40b4c7c78eb06 | 10,270 | py | Python | contrib/spendfrom/spendfrom.py | matrixcoind/matrixcoin | 4ef48ee649e9cc99b1fc6b0cf21ce721a8401d43 | [
"MIT"
] | 3 | 2018-01-12T11:31:05.000Z | 2018-10-28T09:37:11.000Z | contrib/spendfrom/spendfrom.py | matrixcoind/matrixcoin | 4ef48ee649e9cc99b1fc6b0cf21ce721a8401d43 | [
"MIT"
] | null | null | null | contrib/spendfrom/spendfrom.py | matrixcoind/matrixcoin | 4ef48ee649e9cc99b1fc6b0cf21ce721a8401d43 | [
"MIT"
] | 1 | 2018-10-28T09:37:23.000Z | 2018-10-28T09:37:23.000Z | #!/usr/bin/env python
# Copyright (c) 2013 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Use the raw transactions API to spend bitcoins received on particular addresses,
# and send any change back ... | 37.896679 | 111 | 0.636222 |
from decimal import *
import getpass
import math
import os
import os.path
import platform
import sys
import time
from jsonrpc import ServiceProxy, json
BASE_FEE=Decimal("0.001")
def check_json_precision():
n = Decimal("20000000.00000003")
satoshis = int(json.loads(json.dumps(float(n)))*1.0e8)
if satoshis... | true | true |
f7689e692c6a8f7fa186684ec0b22820a4d73b56 | 1,841 | py | Python | CS-190/Labs/Lab8.py | lividsubset3/College-CS | 6f1eb6b10e43a37654335331758677c797034961 | [
"MIT"
] | null | null | null | CS-190/Labs/Lab8.py | lividsubset3/College-CS | 6f1eb6b10e43a37654335331758677c797034961 | [
"MIT"
] | null | null | null | CS-190/Labs/Lab8.py | lividsubset3/College-CS | 6f1eb6b10e43a37654335331758677c797034961 | [
"MIT"
] | null | null | null | # write python function to compute:
# volume of a box (input | length, width, height)
# volume of a sphere (Given radius, Height)
# volume of pyramid (Given length, width, height)
# volume of a cylinder (Given radius, height)
# Print volume
import math
def volume_box(length, width, height):
volume = length * wid... | 25.929577 | 54 | 0.552417 |
import math
def volume_box(length, width, height):
volume = length * width * height
print("Volume:", volume)
def volume_sphere(radius):
volume = (4 / 3) * math.pi * (math.pow(radius, 3))
print("Volume:", volume)
def volume_pyramid(length, width, height):
volume = (length * width * height) / 3... | true | true |
f7689ea13b811afdb4c86cdde3720bfb95949d67 | 448 | py | Python | transdata/transdatatool.py | DobeChen/Comic | 09ef999aa2ed850a573ea8c9051ec16703d63f56 | [
"MIT"
] | 1 | 2018-01-02T14:26:07.000Z | 2018-01-02T14:26:07.000Z | transdata/transdatatool.py | DobeChen/Comic | 09ef999aa2ed850a573ea8c9051ec16703d63f56 | [
"MIT"
] | null | null | null | transdata/transdatatool.py | DobeChen/Comic | 09ef999aa2ed850a573ea8c9051ec16703d63f56 | [
"MIT"
] | null | null | null | # -------------------------------------------------------------------
# @author DobeChen
# @copyright (C) 2018
# @doc
# 数据转换模块
# @end
# Created : 01. 一月 2018 下午5:28
# -------------------------------------------------------------------
import json
def trans_comic_data(comic_data):
return json.loads(comic_data)
d... | 22.4 | 69 | 0.484375 | import json
def trans_comic_data(comic_data):
return json.loads(comic_data)
def trans_chapter_data(chapter_data):
data = json.loads(chapter_data)
chapters = data['chapters']
return chapters[0]
| true | true |
f7689ebfff5c8f697bcda7dd4a4a8e73a1b09c74 | 14,992 | py | Python | tsraster/calculate.py | liyingben/ts-raster | cfec56f4aced7054dd0db3c4106194f14d2f00b9 | [
"MIT"
] | 1 | 2019-10-22T21:54:23.000Z | 2019-10-22T21:54:23.000Z | tsraster/calculate.py | liyingben/ts-raster | cfec56f4aced7054dd0db3c4106194f14d2f00b9 | [
"MIT"
] | null | null | null | tsraster/calculate.py | liyingben/ts-raster | cfec56f4aced7054dd0db3c4106194f14d2f00b9 | [
"MIT"
] | 1 | 2021-03-24T07:06:26.000Z | 2021-03-24T07:06:26.000Z | '''
calculate.py: a module for extracting, evaluating and saving features
'''
import numpy as np
import pandas as pd
import os
import gdal
import glob
from pathlib import Path
from tsfresh import extract_features
from tsfresh.utilities.distribution import MultiprocessingDistributor, LocalDaskDistributor
from tsfresh.... | 38.539846 | 108 | 0.608791 |
import numpy as np
import pandas as pd
import os
import gdal
import glob
from pathlib import Path
from tsfresh import extract_features
from tsfresh.utilities.distribution import MultiprocessingDistributor, LocalDaskDistributor
from tsfresh.feature_selection.relevance import calculate_relevance_table as crt
from tsras... | true | true |
f7689ec924099e42fd7dde173875ae6751164792 | 1,587 | py | Python | test/test_inline_object3.py | vertica/vertica-accelerator-cli | 706925f58a4bfc2876903396db72363f673be76a | [
"Apache-2.0"
] | null | null | null | test/test_inline_object3.py | vertica/vertica-accelerator-cli | 706925f58a4bfc2876903396db72363f673be76a | [
"Apache-2.0"
] | null | null | null | test/test_inline_object3.py | vertica/vertica-accelerator-cli | 706925f58a4bfc2876903396db72363f673be76a | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
VAAS API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: 0.0.1
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
i... | 27.362069 | 124 | 0.63012 |
from __future__ import absolute_import
import unittest
import datetime
import openapi_client
from openapi_client.models.inline_object3 import InlineObject3 from openapi_client.rest import ApiException
class TestInlineObject3(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
... | true | true |
f7689f204ee2c6b42be997f95fc6368fb002322e | 3,922 | py | Python | COVIDUpdate.py | a3li/covid19de_monitor | 2932dc15c4a01e696f1e660310b41668a407f35c | [
"MIT"
] | null | null | null | COVIDUpdate.py | a3li/covid19de_monitor | 2932dc15c4a01e696f1e660310b41668a407f35c | [
"MIT"
] | null | null | null | COVIDUpdate.py | a3li/covid19de_monitor | 2932dc15c4a01e696f1e660310b41668a407f35c | [
"MIT"
] | null | null | null | import requests
import json
import argparse
class COVIDResultData:
def __init__(self, data, dates):
self.data = data
self.dates = dates
self.str = None
def __str__(self):
if not self.str:
self.str = 'RKI ' + ', '.join(self.dates) + ': ' + ', '.join(key + ': ' + str... | 38.07767 | 217 | 0.598674 | import requests
import json
import argparse
class COVIDResultData:
def __init__(self, data, dates):
self.data = data
self.dates = dates
self.str = None
def __str__(self):
if not self.str:
self.str = 'RKI ' + ', '.join(self.dates) + ': ' + ', '.join(key + ': ' + str... | true | true |
f7689f445d5b82a0049a10a7f1b11d8ce0bc9763 | 1,589 | py | Python | Lab8/DiffieHellmanKeyExchange.py | TheIncredibleK/SecurityLabs | b1f371a6f989f942624bb192ef6277bf0835f91e | [
"MIT"
] | null | null | null | Lab8/DiffieHellmanKeyExchange.py | TheIncredibleK/SecurityLabs | b1f371a6f989f942624bb192ef6277bf0835f91e | [
"MIT"
] | null | null | null | Lab8/DiffieHellmanKeyExchange.py | TheIncredibleK/SecurityLabs | b1f371a6f989f942624bb192ef6277bf0835f91e | [
"MIT"
] | null | null | null | from random import randint
from math import pow
def get_roots():
def greatest_common_divisor(number_a, number_b):
while number_b != 0:
number_a, number_b = number_b, number_a % number_b
return number_a
def get_primitive_roots(wanted_mod):
roots = []
necessary_number... | 36.113636 | 130 | 0.687854 | from random import randint
from math import pow
def get_roots():
def greatest_common_divisor(number_a, number_b):
while number_b != 0:
number_a, number_b = number_b, number_a % number_b
return number_a
def get_primitive_roots(wanted_mod):
roots = []
necessary_number... | false | true |
f7689f4905486396522b658d339a8c719190a932 | 1,466 | py | Python | course/migrations/0085_cache_page_titles.py | inducer/courseflow | 0f9786e3616dbedf08365d81a731f672b97ba9f5 | [
"Unlicense"
] | 284 | 2015-01-09T12:02:28.000Z | 2022-03-27T14:30:46.000Z | course/migrations/0085_cache_page_titles.py | inducer/courseflow | 0f9786e3616dbedf08365d81a731f672b97ba9f5 | [
"Unlicense"
] | 799 | 2015-02-26T08:49:46.000Z | 2022-03-31T16:09:26.000Z | course/migrations/0085_cache_page_titles.py | inducer/courseflow | 0f9786e3616dbedf08365d81a731f672b97ba9f5 | [
"Unlicense"
] | 120 | 2015-01-30T18:00:56.000Z | 2022-03-28T06:24:43.000Z | # Generated by Django 1.9.1 on 2016-02-07 18:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('course', '0084_flowsession_page_data_at_course_revision'),
]
operations = [
migrations.RenameField(
model_name='flowsession',
... | 50.551724 | 695 | 0.677353 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('course', '0084_flowsession_page_data_at_course_revision'),
]
operations = [
migrations.RenameField(
model_name='flowsession',
old_name='page_data_at_course_revision... | true | true |
f7689fd1f725b8ba393f81949e7b5c852fa0a020 | 845 | py | Python | 2_intermediate/chapter13/practice/matrix_frobenius_norm.py | code4tomorrow/Python | 035b6f5d8fd635a16caaff78bcd3f582663dadc3 | [
"MIT"
] | 4 | 2021-03-01T00:32:45.000Z | 2021-05-21T22:01:52.000Z | 2_intermediate/chapter13/practice/matrix_frobenius_norm.py | code4tomorrow/Python | 035b6f5d8fd635a16caaff78bcd3f582663dadc3 | [
"MIT"
] | 29 | 2020-09-12T22:56:04.000Z | 2021-09-25T17:08:42.000Z | 2_intermediate/chapter13/practice/matrix_frobenius_norm.py | code4tomorrow/Python | 035b6f5d8fd635a16caaff78bcd3f582663dadc3 | [
"MIT"
] | 7 | 2021-02-25T01:50:55.000Z | 2022-02-28T00:00:42.000Z | """
Write a modified version of the Matrix class(that was defined in
one of the example problems in this section) so that the __str__
method instead returns a string containing a single number: the
matrix's Frobenius norm. The formula for the Frobenius norm will
be the square root of the sum of all the elements squared... | 31.296296 | 64 | 0.734911 | true | true | |
f768a0684cdf55e4a2bfad4dabda066401805c09 | 1,743 | py | Python | src/nodepy/utils/iter.py | nodepy/engine | dfa813b5f5a8f31e2318791fbbada3d9799419b9 | [
"MIT"
] | 28 | 2017-03-02T19:28:45.000Z | 2021-12-28T21:05:12.000Z | src/nodepy/utils/iter.py | nodepy/engine | dfa813b5f5a8f31e2318791fbbada3d9799419b9 | [
"MIT"
] | 71 | 2017-03-02T05:19:16.000Z | 2017-11-28T19:19:09.000Z | src/nodepy/utils/iter.py | nodepy/engine | dfa813b5f5a8f31e2318791fbbada3d9799419b9 | [
"MIT"
] | null | null | null | # The MIT License (MIT)
#
# Copyright (c) 2017-2018 Niklas Rosenstein
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, ... | 31.125 | 80 | 0.73953 |
import collections
class Chain(object):
def __init__(self, *iterables):
self.iterables = collections.deque(iter(x) for x in iterables)
def __iter__(self):
return self
def __next__(self):
while self.iterables:
try:
return next(self.iterables[0])
except StopIteration:
... | true | true |
f768a16672cbc11a4c07fce54e3747bdcf9d513f | 74,049 | py | Python | IAC.py | JueK3y/Instagram-automated-commenting | 7ecc4119d8e9ff0dfba620488018fbd9fce61606 | [
"RSA-MD"
] | 9 | 2021-06-22T14:01:24.000Z | 2022-03-11T08:59:38.000Z | IAC.py | JueK3y/Instagram-automated-commenting | 7ecc4119d8e9ff0dfba620488018fbd9fce61606 | [
"RSA-MD"
] | 6 | 2021-01-15T09:12:11.000Z | 2021-05-25T08:12:10.000Z | IAC.py | JueK3y/Instagram-automated-commenting | 7ecc4119d8e9ff0dfba620488018fbd9fce61606 | [
"RSA-MD"
] | 1 | 2021-12-27T18:58:53.000Z | 2021-12-27T18:58:53.000Z | """
This programme is written and may only be used for educational purposes!
Using it for real purposes violates the Instagram guidelines!
Consequences are, for example, the blocking of the Instagram account.
Please read Instagram's guidelines for more information.
DO NOT indicate used program sections as your own. ©20... | 38.993681 | 130 | 0.538913 |
import sys
import time
import json
import shutil
import random
import os.path
import pathlib
import datetime
import webbrowser
import requests
import tkinter as tk
import subprocess as sp
from tkinter import *
from threading import *
from zipfile import ZipFile
from selenium import webdriver
from tkinter import mess... | true | true |
f768a29667e398abeec8dfefdc940f1410f463b4 | 1,062 | py | Python | parsl/tests/test_aalst_patterns/test_python_XOR_SPLIT_P4.py | monicadlewis97/parsl | 57038b7cc92ce26b8f5a45c193180a9452fd6320 | [
"Apache-2.0"
] | null | null | null | parsl/tests/test_aalst_patterns/test_python_XOR_SPLIT_P4.py | monicadlewis97/parsl | 57038b7cc92ce26b8f5a45c193180a9452fd6320 | [
"Apache-2.0"
] | null | null | null | parsl/tests/test_aalst_patterns/test_python_XOR_SPLIT_P4.py | monicadlewis97/parsl | 57038b7cc92ce26b8f5a45c193180a9452fd6320 | [
"Apache-2.0"
] | null | null | null | ''' Testing bash apps
'''
import parsl
from parsl import *
import os
import time
import shutil
import argparse
#parsl.set_stream_logger()
workers = ThreadPoolExecutor(max_workers=4)
dfk = DataFlowKernel(workers)
@App('python', dfk)
def random():
import random
return random.randint(1,10)
@App('python', dfk)... | 18.964286 | 93 | 0.637476 | import parsl
from parsl import *
import os
import time
import shutil
import argparse
workers = ThreadPoolExecutor(max_workers=4)
dfk = DataFlowKernel(workers)
@App('python', dfk)
def random():
import random
return random.randint(1,10)
@App('python', dfk)
def slow_increment(x, dur):
import time
time... | true | true |
f768a40e8031d163c1307fb0aafc20a9e205b599 | 1,504 | py | Python | install-nagios-server/fix_nagios_initd2.py | raychorn/svn_jenkins_projects | 93d22c28735c9fe6cb4ac632b6e79d89530e3bfb | [
"CC0-1.0"
] | null | null | null | install-nagios-server/fix_nagios_initd2.py | raychorn/svn_jenkins_projects | 93d22c28735c9fe6cb4ac632b6e79d89530e3bfb | [
"CC0-1.0"
] | null | null | null | install-nagios-server/fix_nagios_initd2.py | raychorn/svn_jenkins_projects | 93d22c28735c9fe6cb4ac632b6e79d89530e3bfb | [
"CC0-1.0"
] | null | null | null | import re, os, sys
__start_target__ = '#!/bin/sh'
__end_target__ = '### BEGIN INIT INFO'
__re__ = re.compile("^%s$.*^%s$" % (__start_target__,__end_target__), re.DOTALL | re.MULTILINE)
__re1__ = re.compile("%s" % (__start_target__), re.MULTILINE)
__re2__ = re.compile("%s" % (__end_target__), re.MULTILINE)
f... | 32.695652 | 96 | 0.553856 | import re, os, sys
__start_target__ = '#!/bin/sh'
__end_target__ = '### BEGIN INIT INFO'
__re__ = re.compile("^%s$.*^%s$" % (__start_target__,__end_target__), re.DOTALL | re.MULTILINE)
__re1__ = re.compile("%s" % (__start_target__), re.MULTILINE)
__re2__ = re.compile("%s" % (__end_target__), re.MULTILINE)
f... | false | true |
f768a418151bf9569de921a1b01fdc122e3c3b1d | 14,555 | py | Python | SaxsCalc.py | nathancowieson/saxs_scripts | 274472f28a630fe688ec00fd535c6679d7d7ef73 | [
"MIT"
] | null | null | null | SaxsCalc.py | nathancowieson/saxs_scripts | 274472f28a630fe688ec00fd535c6679d7d7ef73 | [
"MIT"
] | null | null | null | SaxsCalc.py | nathancowieson/saxs_scripts | 274472f28a630fe688ec00fd535c6679d7d7ef73 | [
"MIT"
] | null | null | null | #!/anaconda/bin/python
'''
Created on Apr 18, 2016
@author: nathan
'''
import glob
import logging
from optparse import OptionParser
from optparse import OptionGroup
import os
import re
from subprocess import check_output, STDOUT
import sys
import matplotlib.pyplot as plt
#import __main__
#__main__.pymol_argv = [... | 39.986264 | 227 | 0.565098 |
'''
Created on Apr 18, 2016
@author: nathan
'''
import glob
import logging
from optparse import OptionParser
from optparse import OptionGroup
import os
import re
from subprocess import check_output, STDOUT
import sys
import matplotlib.pyplot as plt
class SaxsCalc():
"""Run crysol or Foxs and plot the result... | false | true |
f768a4f523a1d190c82ddca2d04f30110c1b6ec7 | 932 | py | Python | sis_provisioner/tests/account_managers/test_eid_loader.py | uw-it-aca/bridge-sis-provisioner | 6dd31e5ef59263acbcade5e6e4f74b815c16bdee | [
"Apache-2.0"
] | null | null | null | sis_provisioner/tests/account_managers/test_eid_loader.py | uw-it-aca/bridge-sis-provisioner | 6dd31e5ef59263acbcade5e6e4f74b815c16bdee | [
"Apache-2.0"
] | 175 | 2016-07-18T23:25:45.000Z | 2022-02-07T20:44:05.000Z | sis_provisioner/tests/account_managers/test_eid_loader.py | uw-it-aca/bridge-sis-provisioner | 6dd31e5ef59263acbcade5e6e4f74b815c16bdee | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
import logging
from datetime import timedelta
from django.test import TransactionTestCase
from sis_provisioner.dao.uw_account import get_by_employee_id
from sis_provisioner.account_managers.eid_loader import load
from sis_provisione... | 37.28 | 75 | 0.758584 |
import logging
from datetime import timedelta
from django.test import TransactionTestCase
from sis_provisioner.dao.uw_account import get_by_employee_id
from sis_provisioner.account_managers.eid_loader import load
from sis_provisioner.tests import fdao_pws_override
from sis_provisioner.tests.account_managers import set... | true | true |
f768a4f71978503c90ec9d7f120f6b43d84a0f84 | 1,549 | py | Python | ANN_From_Scratch/gradient_descent.py | rishusiva/InsurancePrediction_ANN | 4d73ad08b52b581feae4d6b18276cf47701f95ad | [
"MIT"
] | null | null | null | ANN_From_Scratch/gradient_descent.py | rishusiva/InsurancePrediction_ANN | 4d73ad08b52b581feae4d6b18276cf47701f95ad | [
"MIT"
] | null | null | null | ANN_From_Scratch/gradient_descent.py | rishusiva/InsurancePrediction_ANN | 4d73ad08b52b581feae4d6b18276cf47701f95ad | [
"MIT"
] | null | null | null | from NN_model import *
import math
import numpy as np
coef,intercept = model.get_weights()
def sigmoid(X):
return 1/ (1+math.exp(-X))
def prediction_function(age,affordibility):
weighted_sum = coef[0]*age + coef[1]*affordibility + intercept
return sigmoid(weighted_sum)
#print(prediction_function(.28,... | 27.175439 | 98 | 0.670755 | from NN_model import *
import math
import numpy as np
coef,intercept = model.get_weights()
def sigmoid(X):
return 1/ (1+math.exp(-X))
def prediction_function(age,affordibility):
weighted_sum = coef[0]*age + coef[1]*affordibility + intercept
return sigmoid(weighted_sum)
def loss_function(y_true,y_pre... | true | true |
f768a4fd313061bb0875ac46ef275bb58e337c62 | 2,532 | py | Python | tasks/glue/data.py | sourcery-ai-bot/Megatron-LM | f27f44e2c49d1cb39b2288bef6f7d837e11094cb | [
"MIT"
] | null | null | null | tasks/glue/data.py | sourcery-ai-bot/Megatron-LM | f27f44e2c49d1cb39b2288bef6f7d837e11094cb | [
"MIT"
] | null | null | null | tasks/glue/data.py | sourcery-ai-bot/Megatron-LM | f27f44e2c49d1cb39b2288bef6f7d837e11094cb | [
"MIT"
] | null | null | null | # coding=utf-8
# Copyright (c) 2020, 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 of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 36.695652 | 80 | 0.656793 |
from abc import ABC
from abc import abstractmethod
from torch.utils.data import Dataset
from megatron import print_rank_0
from tasks.data_utils import build_sample
from tasks.data_utils import build_tokens_types_paddings_from_text
class GLUEAbstractDataset(ABC, Dataset):
def __init__(self, task_name, dataset... | true | true |
f768a64bc40d613304176ab22639d9652bfbbb0c | 3,516 | py | Python | py/google/fhir/labels/encounter_test.py | kyle-winkelman/fhir | 01038aa235189fd043fd2981ebf40f4dc1e826e0 | [
"Apache-2.0"
] | null | null | null | py/google/fhir/labels/encounter_test.py | kyle-winkelman/fhir | 01038aa235189fd043fd2981ebf40f4dc1e826e0 | [
"Apache-2.0"
] | 2 | 2018-12-03T22:07:19.000Z | 2018-12-12T22:41:15.000Z | py/google/fhir/labels/encounter_test.py | kyle-winkelman/fhir | 01038aa235189fd043fd2981ebf40f4dc1e826e0 | [
"Apache-2.0"
] | 1 | 2018-12-03T21:33:27.000Z | 2018-12-03T21:33:27.000Z | #
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 36.625 | 78 | 0.715586 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from datetime import datetime
import os
from absl.testing import absltest
from google.protobuf import text_format
from proto.stu3 import resources_pb2
from py.google.fhir.labels import encounter
_TESTDATA_... | true | true |
f768a6c9c2b6d10e371cd718a0be06d70d9c6c57 | 879 | py | Python | window.py | LambaKean/Petry-dish-game | 74bc09f9ee6922dc6f4cbc0f4c5f305e3e09b260 | [
"MIT"
] | 1 | 2021-08-11T15:54:34.000Z | 2021-08-11T15:54:34.000Z | window.py | LambaKean/simple-pygame-game | a2210989cdfaa960846963c3a4a0971c3707f4db | [
"MIT"
] | null | null | null | window.py | LambaKean/simple-pygame-game | a2210989cdfaa960846963c3a4a0971c3707f4db | [
"MIT"
] | null | null | null | ''' Стандартные модули '''
import sys
''' Пользовательские модули '''
import pygame
class Window ():
''' Класс-обертка для управления открывающимся при запуске игры окном '''
def __init__(self, field):
''' Инициализация окна '''
self.field = field; # Отображаемое в окне игрвое поле
def handleEvents(self):
... | 24.416667 | 77 | 0.687144 | import sys
import pygame
class Window ():
def __init__(self, field):
self.field = field;
def handleEvents(self):
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit();
sys.exit();
def redrawFrame(self):
self.field.surface.fill(self.field.background);
for unit in ... | true | true |
f768a6d3531bbe8eef7cc13a053a2a2e9afc35b3 | 3,573 | py | Python | pyroma/__init__.py | cthoyt/pyroma | 7a129e147bcba0b2099d0c3fcd7cd3cf4b2f88d1 | [
"MIT"
] | null | null | null | pyroma/__init__.py | cthoyt/pyroma | 7a129e147bcba0b2099d0c3fcd7cd3cf4b2f88d1 | [
"MIT"
] | null | null | null | pyroma/__init__.py | cthoyt/pyroma | 7a129e147bcba0b2099d0c3fcd7cd3cf4b2f88d1 | [
"MIT"
] | null | null | null | import os
import sys
from optparse import OptionParser
from pyroma import projectdata, distributiondata, pypidata, ratings
import logging
logging.basicConfig(level=logging.DEBUG, stream=sys.stdout,
format="%(message)s")
def zester(data):
main_files = os.listdir(data['workingdir'])
if 'set... | 33.392523 | 90 | 0.587462 | import os
import sys
from optparse import OptionParser
from pyroma import projectdata, distributiondata, pypidata, ratings
import logging
logging.basicConfig(level=logging.DEBUG, stream=sys.stdout,
format="%(message)s")
def zester(data):
main_files = os.listdir(data['workingdir'])
if 'set... | true | true |
f768a7a932c05dc52b003586cad72fff15bd6038 | 463 | py | Python | tests/test_azair_content_loader.py | damklis/etljob | c72d53c9b38e1cf38307309a55f55513ced3c8a3 | [
"BSD-2-Clause"
] | 8 | 2021-02-11T21:18:24.000Z | 2022-02-14T15:35:36.000Z | tests/test_azair_content_loader.py | damklis/etljob | c72d53c9b38e1cf38307309a55f55513ced3c8a3 | [
"BSD-2-Clause"
] | 1 | 2021-06-13T10:48:07.000Z | 2021-06-13T10:48:07.000Z | tests/test_azair_content_loader.py | damklis/etljob | c72d53c9b38e1cf38307309a55f55513ced3c8a3 | [
"BSD-2-Clause"
] | 2 | 2021-12-28T18:38:38.000Z | 2022-03-01T03:25:29.000Z | from unittest import mock
import pytest
from etl.loader.chunk_generator import generate_chunk
from .fixtures import generate_content_stream
@mock.patch("etl.loader.azair_content_loader.AZAirContentLoader.load_content")
@mock.patch("sqlalchemy.ext.declarative.declarative_base")
def test_load_content(load_content, bas... | 28.9375 | 78 | 0.835853 | from unittest import mock
import pytest
from etl.loader.chunk_generator import generate_chunk
from .fixtures import generate_content_stream
@mock.patch("etl.loader.azair_content_loader.AZAirContentLoader.load_content")
@mock.patch("sqlalchemy.ext.declarative.declarative_base")
def test_load_content(load_content, bas... | true | true |
f768a7edf9918293ee34f460418d5fe5506411d6 | 5,655 | py | Python | lambdo/Table.py | rockkb/lambdo | 77b0f758e789d62b67fb447f22892d5687cf10a4 | [
"MIT"
] | null | null | null | lambdo/Table.py | rockkb/lambdo | 77b0f758e789d62b67fb447f22892d5687cf10a4 | [
"MIT"
] | null | null | null | lambdo/Table.py | rockkb/lambdo | 77b0f758e789d62b67fb447f22892d5687cf10a4 | [
"MIT"
] | 1 | 2019-03-20T11:51:06.000Z | 2019-03-20T11:51:06.000Z | __author__="Alexandr Savinov"
import json
from lambdo.utils import *
from lambdo.resolve import *
from lambdo.transform import *
from lambdo.Workflow import *
from lambdo.Table import *
from lambdo.Column import *
import logging
log = logging.getLogger('TABLE')
class Table:
"""
The class represents one ta... | 35.34375 | 170 | 0.612378 | __author__="Alexandr Savinov"
import json
from lambdo.utils import *
from lambdo.resolve import *
from lambdo.transform import *
from lambdo.Workflow import *
from lambdo.Table import *
from lambdo.Column import *
import logging
log = logging.getLogger('TABLE')
class Table:
tableNo = 0
def __init__(self... | true | true |
f768a8de4d2554d3fd0b64476e8abdf5b640bada | 2,364 | py | Python | test/plot_utils.py | gravins/NumGraph | 69ada09f0e434411a61ab36cccfface77a86aa65 | [
"MIT"
] | null | null | null | test/plot_utils.py | gravins/NumGraph | 69ada09f0e434411a61ab36cccfface77a86aa65 | [
"MIT"
] | null | null | null | test/plot_utils.py | gravins/NumGraph | 69ada09f0e434411a61ab36cccfface77a86aa65 | [
"MIT"
] | null | null | null | ''' Taken from https://stackoverflow.com/a/43541777 '''
import networkx as nx
def community_layout(g, partition):
"""
Compute the layout for a modular graph.
Arguments:
----------
g -- networkx.Graph or networkx.DiGraph instance
graph to plot
partition -- dict mapping int node -> in... | 24.625 | 77 | 0.625635 |
import networkx as nx
def community_layout(g, partition):
pos_communities = _position_communities(g, partition, scale=3.)
pos_nodes = _position_nodes(g, partition, scale=1.)
pos = dict()
for node in g.nodes():
pos[node] = pos_communities[node] + pos_nodes[node]
return pos
def _po... | true | true |
f768a8f1d9bf627d6fce8489395b00fed59fe9d0 | 1,418 | py | Python | var/spack/repos/builtin/packages/babelflow/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/babelflow/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 8 | 2021-11-09T20:28:40.000Z | 2022-03-15T03:26:33.000Z | var/spack/repos/builtin/packages/babelflow/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class Babelflow(CMakePackage):
"""BabelFlow is an Embedded Domain Specific Language to d... | 39.388889 | 95 | 0.726375 |
from spack.package import *
class Babelflow(CMakePackage):
homepage = "https://github.com/sci-visus/BabelFlow"
url = "https://github.com/sci-visus/BabelFlow/archive/v1.1.0.tar.gz"
git = 'https://github.com/sci-visus/BabelFlow.git'
maintainers = ['spetruzza']
version('1.1.0', sha256='... | true | true |
f768a98b1a67168545a74e527fbe231a51b604c7 | 10,136 | py | Python | shis/utils.py | nikhilweee/shis | fb48444bb162401eeb5cddff0455b0a4dcc0f2bc | [
"MIT"
] | 6 | 2020-11-27T12:15:42.000Z | 2022-03-14T01:38:29.000Z | shis/utils.py | nikhilweee/shis | fb48444bb162401eeb5cddff0455b0a4dcc0f2bc | [
"MIT"
] | null | null | null | shis/utils.py | nikhilweee/shis | fb48444bb162401eeb5cddff0455b0a4dcc0f2bc | [
"MIT"
] | null | null | null | import os
import sys
import argparse
import urllib.request
from functools import partial
from http.server import HTTPServer, SimpleHTTPRequestHandler
from threading import Thread
from typing import Generator, List, Tuple
from tqdm import tqdm
#-------------------------------------------------------------------------... | 34.831615 | 86 | 0.618489 | import os
import sys
import argparse
import urllib.request
from functools import partial
from http.server import HTTPServer, SimpleHTTPRequestHandler
from threading import Thread
from typing import Generator, List, Tuple
from tqdm import tqdm
def chunks(iterable: List[str], chunk_size: int) -> Generator[List[str],... | true | true |
f768aafd97c60fb4b46133a64c04cac4bec192b4 | 7,041 | py | Python | ai_safety_gridworlds/environments/shared/rl/array_spec.py | AicyDC/ai-safety-gridworlds | b574b3e42880e32245a6c69502af3e9782ae2879 | [
"Apache-2.0"
] | 532 | 2017-11-28T15:29:11.000Z | 2022-03-25T06:50:10.000Z | ai_safety_gridworlds/environments/shared/rl/array_spec.py | AicyDC/ai-safety-gridworlds | b574b3e42880e32245a6c69502af3e9782ae2879 | [
"Apache-2.0"
] | 17 | 2017-11-28T23:26:17.000Z | 2020-06-29T12:29:22.000Z | ai_safety_gridworlds/environments/shared/rl/array_spec.py | AicyDC/ai-safety-gridworlds | b574b3e42880e32245a6c69502af3e9782ae2879 | [
"Apache-2.0"
] | 117 | 2017-11-29T01:33:01.000Z | 2022-03-28T13:49:25.000Z | # Copyright 2018 The AI Safety Gridworlds 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 b... | 33.688995 | 80 | 0.655589 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
class ArraySpec(object):
__slots__ = ('_shape', '_dtype', '_name')
def __init__(self, shape, dtype, name=None):
self._shape = tuple(shape)
self._dtype = np.dtype(dtype)
se... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.