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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f70cef44c3e16c95119c95404328efdf2dd281f9 | 3,969 | py | Python | Oem/jsoncpp/scons-local-0.97/SCons/Tool/rmic.py | achilex/MgDev | f7baf680a88d37659af32ee72b9a2046910b00d8 | [
"PHP-3.0"
] | 2 | 2017-04-19T01:38:30.000Z | 2020-07-31T03:05:32.000Z | Oem/jsoncpp/scons-local-0.97/SCons/Tool/rmic.py | achilex/MgDev | f7baf680a88d37659af32ee72b9a2046910b00d8 | [
"PHP-3.0"
] | null | null | null | Oem/jsoncpp/scons-local-0.97/SCons/Tool/rmic.py | achilex/MgDev | f7baf680a88d37659af32ee72b9a2046910b00d8 | [
"PHP-3.0"
] | 1 | 2021-12-29T10:46:12.000Z | 2021-12-29T10:46:12.000Z | """SCons.Tool.rmic
Tool-specific initialization for rmic.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007 The SCons Foundation
#
# Permission is her... | 35.4375 | 169 | 0.654573 |
__revision__ = "/home/scons/scons/branch.0/baseline/src/engine/SCons/Tool/rmic.py 0.97.D001 2007/05/17 11:35:19 knight"
import os.path
import string
import SCons.Action
import SCons.Builder
import SCons.Node.FS
import SCons.Util
def emit_rmic_classes(target, source, env):
class_suffix = env.get('JAVACLASSSUFFI... | true | true |
f70cef5576327716b839bd5a0c0c930239f44f5d | 1,261 | py | Python | setup.py | hsadok/pubplot | da6f9e59fd53e646f2f05b9adea732064ca45313 | [
"0BSD"
] | 2 | 2019-11-27T10:52:55.000Z | 2021-07-09T21:47:39.000Z | setup.py | hsadok/pubplot | da6f9e59fd53e646f2f05b9adea732064ca45313 | [
"0BSD"
] | 2 | 2019-04-17T00:02:01.000Z | 2022-02-25T16:40:10.000Z | setup.py | hugombarreto/pubplot | da6f9e59fd53e646f2f05b9adea732064ca45313 | [
"0BSD"
] | 1 | 2019-02-12T17:35:09.000Z | 2019-02-12T17:35:09.000Z | # coding=utf-8
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
setup(
name='pubplot',
version='0.2.4',
description='Seamless LaTeX and Matplotlib integration for publication plots',
long_description=readme,
packages=find_packages(... | 30.756098 | 82 | 0.616178 | from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
setup(
name='pubplot',
version='0.2.4',
description='Seamless LaTeX and Matplotlib integration for publication plots',
long_description=readme,
packages=find_packages(),
url='',
... | true | true |
f70ceffda1f8fc2f03768012ad8a630516ef8a4d | 75 | py | Python | test.py | harryhan1989/csvsplitter | c8c25f65a27059c6f3791323c39b8eb753e155ad | [
"MIT"
] | 7 | 2016-06-22T06:40:11.000Z | 2021-10-30T16:44:20.000Z | test.py | harryhan1989/csvsplitter | c8c25f65a27059c6f3791323c39b8eb753e155ad | [
"MIT"
] | 2 | 2016-08-02T07:28:58.000Z | 2017-12-19T18:45:31.000Z | test.py | harryhan1989/csvsplitter | c8c25f65a27059c6f3791323c39b8eb753e155ad | [
"MIT"
] | 2 | 2020-04-21T21:11:48.000Z | 2021-09-07T21:26:27.000Z | import converter
converter.convert_to_utf8("splitted/%s.csv" % 'zongheng') | 25 | 57 | 0.786667 | import converter
converter.convert_to_utf8("splitted/%s.csv" % 'zongheng') | true | true |
f70cf0f12b19eeefbf8d1a881733db82b08b9f04 | 199 | py | Python | manage.py | Leon-Francis/Simple_Video_Website | 839f33b3fdb0eb4b92ef907fc6b93375d7330886 | [
"Apache-2.0"
] | null | null | null | manage.py | Leon-Francis/Simple_Video_Website | 839f33b3fdb0eb4b92ef907fc6b93375d7330886 | [
"Apache-2.0"
] | null | null | null | manage.py | Leon-Francis/Simple_Video_Website | 839f33b3fdb0eb4b92ef907fc6b93375d7330886 | [
"Apache-2.0"
] | 1 | 2021-07-13T10:38:26.000Z | 2021-07-13T10:38:26.000Z | from app import app
from flask_script import Manager, Server
manage = Manager(app)
# manage.add_command("runserver", Server(
# host = '0.0.0.0')
# )
if __name__ == "__main__":
manage.run()
| 18.090909 | 41 | 0.673367 | from app import app
from flask_script import Manager, Server
manage = Manager(app)
if __name__ == "__main__":
manage.run()
| true | true |
f70cf0fe2d8576f5246e7510fe9c8f70d37b78a5 | 9,223 | py | Python | torch/distributed/algorithms/model_averaging/hierarchical_model_averager.py | jiyuanzFB/pytorch | d047e475f830631d8fcc877ea17eac8fb34748d7 | [
"Intel"
] | 1 | 2022-03-05T04:13:34.000Z | 2022-03-05T04:13:34.000Z | torch/distributed/algorithms/model_averaging/hierarchical_model_averager.py | jiyuanzFB/pytorch | d047e475f830631d8fcc877ea17eac8fb34748d7 | [
"Intel"
] | null | null | null | torch/distributed/algorithms/model_averaging/hierarchical_model_averager.py | jiyuanzFB/pytorch | d047e475f830631d8fcc877ea17eac8fb34748d7 | [
"Intel"
] | null | null | null | # Copyright 2022 Cruise LLC
import warnings
from collections import OrderedDict
import logging
import torch.distributed as dist
import torch.distributed.algorithms.model_averaging.utils as utils
logger = logging.getLogger(__name__)
class HierarchicalModelAverager:
r"""
A group of model averagers used for hi... | 57.64375 | 129 | 0.632983 | import warnings
from collections import OrderedDict
import logging
import torch.distributed as dist
import torch.distributed.algorithms.model_averaging.utils as utils
logger = logging.getLogger(__name__)
class HierarchicalModelAverager:
def __init__(self, period_group_size_dict=None, warmup_steps=0, process_gr... | true | true |
f70cf102f3c46bb44bd3a7129edb1f30ae3eff4b | 4,329 | py | Python | Utilities/restore_n_train.py | RoyHirsch/BrainTumorSegmentation | 671326447f77eb750a96a42e1d9b0bfca42e42ce | [
"MIT"
] | null | null | null | Utilities/restore_n_train.py | RoyHirsch/BrainTumorSegmentation | 671326447f77eb750a96a42e1d9b0bfca42e42ce | [
"MIT"
] | null | null | null | Utilities/restore_n_train.py | RoyHirsch/BrainTumorSegmentation | 671326447f77eb750a96a42e1d9b0bfca42e42ce | [
"MIT"
] | null | null | null | from UnetModel import *
def get_params_dict(logDir):
file = open(logDir, 'r')
logText = file.read()
file.close()
filterText = re.findall('parameters_search : (\w.*)', logText)[2:-2]
splitedText = [item.split(' : ') for item in filterText]
dictParams = dict()
for item in splitedText:
... | 44.628866 | 168 | 0.523216 | from UnetModel import *
def get_params_dict(logDir):
file = open(logDir, 'r')
logText = file.read()
file.close()
filterText = re.findall('parameters_search : (\w.*)', logText)[2:-2]
splitedText = [item.split(' : ') for item in filterText]
dictParams = dict()
for item in splitedText:
... | true | true |
f70cf1de780ec2974c8fb9de0638a857cebe9f7d | 4,970 | py | Python | src/mop2/utils/configuration.py | robertfischer3/python-mop2 | 2f8f4da52092489bf2610818458f95f5c7fd9c6e | [
"MIT"
] | null | null | null | src/mop2/utils/configuration.py | robertfischer3/python-mop2 | 2f8f4da52092489bf2610818458f95f5c7fd9c6e | [
"MIT"
] | null | null | null | src/mop2/utils/configuration.py | robertfischer3/python-mop2 | 2f8f4da52092489bf2610818458f95f5c7fd9c6e | [
"MIT"
] | null | null | null | from configparser import ConfigParser
from contextlib import contextmanager
import os
from dotenv import load_dotenv
from mop2.utils.atomic_writes import atomic_write
from mop2.utils.files import change_dir
CONFVARIABLES = "app.config.ini"
OPERATIONSPATH = "../../../data"
TESTVARIABLES = "test.app.config.ini"
TESTIN... | 43.596491 | 280 | 0.690543 | from configparser import ConfigParser
from contextlib import contextmanager
import os
from dotenv import load_dotenv
from mop2.utils.atomic_writes import atomic_write
from mop2.utils.files import change_dir
CONFVARIABLES = "app.config.ini"
OPERATIONSPATH = "../../../data"
TESTVARIABLES = "test.app.config.ini"
TESTIN... | true | true |
f70cf2010a1330c0e64179719380864feeaae809 | 1,230 | py | Python | turbogears/tests/catwalk_models/browse.py | timmartin19/turbogears | b5420cb7e55757d418d8fadb512dbd7803c4279c | [
"MIT"
] | null | null | null | turbogears/tests/catwalk_models/browse.py | timmartin19/turbogears | b5420cb7e55757d418d8fadb512dbd7803c4279c | [
"MIT"
] | 9 | 2015-01-27T19:13:56.000Z | 2019-03-29T14:44:31.000Z | turbogears/tests/catwalk_models/browse.py | timmartin19/turbogears | b5420cb7e55757d418d8fadb512dbd7803c4279c | [
"MIT"
] | 13 | 2015-04-14T14:15:53.000Z | 2020-03-18T01:05:46.000Z | from sqlobject import *
__connection__ = connectionForURI("sqlite:///:memory:")
hub = __connection__
class Genre(SQLObject):
name = StringCol()
artists = RelatedJoin('Artist')
class Artist(SQLObject):
name = StringCol()
genres = RelatedJoin('Genre')
albums = MultipleJoin('Album')
plays_instr... | 31.538462 | 80 | 0.652033 | from sqlobject import *
__connection__ = connectionForURI("sqlite:///:memory:")
hub = __connection__
class Genre(SQLObject):
name = StringCol()
artists = RelatedJoin('Artist')
class Artist(SQLObject):
name = StringCol()
genres = RelatedJoin('Genre')
albums = MultipleJoin('Album')
plays_instr... | true | true |
f70cf20eb8dc22806bb0e8f77231ff1414cab589 | 3,875 | py | Python | assignment2/deeplearning/gradient_check.py | AnthonyNg404/Deep-Learning | ef1dafaa1d07e9c9b574ba1722a7954c16ef463d | [
"Unlicense"
] | null | null | null | assignment2/deeplearning/gradient_check.py | AnthonyNg404/Deep-Learning | ef1dafaa1d07e9c9b574ba1722a7954c16ef463d | [
"Unlicense"
] | null | null | null | assignment2/deeplearning/gradient_check.py | AnthonyNg404/Deep-Learning | ef1dafaa1d07e9c9b574ba1722a7954c16ef463d | [
"Unlicense"
] | null | null | null | import numpy as np
from random import randrange
def eval_numerical_gradient(f, x, verbose=True, h=0.00001):
"""
a naive implementation of numerical gradient of f at x
- f should be a function that takes a single argument
- x is the point (numpy array) to evaluate the gradient at
"""
fx = f(x) ... | 30.753968 | 78 | 0.581677 | import numpy as np
from random import randrange
def eval_numerical_gradient(f, x, verbose=True, h=0.00001):
fx = f(x) grad = np.zeros_like(x)
it = np.nditer(x, flags=['multi_index'], op_flags=['readwrite'])
while not it.finished:
ix = it.multi_index
oldval = x[ix]
... | true | true |
f70cf21cb9f7001d0bc91e439b9f00772d9a6cb6 | 1,771 | py | Python | pacu/core/lib.py | damienjburks/pacu | 5853f9668a7d78945c40d403bf88a47101ba2b3d | [
"BSD-3-Clause"
] | 1 | 2021-12-22T22:39:49.000Z | 2021-12-22T22:39:49.000Z | pacu/core/lib.py | damienjburks/pacu | 5853f9668a7d78945c40d403bf88a47101ba2b3d | [
"BSD-3-Clause"
] | null | null | null | pacu/core/lib.py | damienjburks/pacu | 5853f9668a7d78945c40d403bf88a47101ba2b3d | [
"BSD-3-Clause"
] | null | null | null | import contextlib
import os
from typing import Optional, cast, Callable, Generator, IO, Any
from pathlib import Path
from pacu import settings
get_active_session: Optional[Callable] = None
class PacuException(Exception):
pass
def strip_lines(text: str) -> str:
out = []
for line in text.splitlines():
... | 24.260274 | 96 | 0.648221 | import contextlib
import os
from typing import Optional, cast, Callable, Generator, IO, Any
from pathlib import Path
from pacu import settings
get_active_session: Optional[Callable] = None
class PacuException(Exception):
pass
def strip_lines(text: str) -> str:
out = []
for line in text.splitlines():
... | true | true |
f70cf22797ab260ef76f81b8f8799a8e382b3fd4 | 4,884 | py | Python | configs/ssd/ssdlite_mobilenetv2_scratch_600e_coco.py | mrzhuzhe/mmdetection | c04ca2c2a65500bc248a5d2ab6ace5b15f00064d | [
"Apache-2.0"
] | null | null | null | configs/ssd/ssdlite_mobilenetv2_scratch_600e_coco.py | mrzhuzhe/mmdetection | c04ca2c2a65500bc248a5d2ab6ace5b15f00064d | [
"Apache-2.0"
] | null | null | null | configs/ssd/ssdlite_mobilenetv2_scratch_600e_coco.py | mrzhuzhe/mmdetection | c04ca2c2a65500bc248a5d2ab6ace5b15f00064d | [
"Apache-2.0"
] | null | null | null | _base_ = [
'../_base_/datasets/coco_detection.py', '../_base_/default_runtime.py'
]
model = dict(
type='SingleStageDetector',
backbone=dict(
type='MobileNetV2',
out_indices=(4, 7),
norm_cfg=dict(type='BN', eps=0.001, momentum=0.03),
init_cfg=dict(type='TruncNormal'... | 33.452055 | 78 | 0.575962 | _base_ = [
'../_base_/datasets/coco_detection.py', '../_base_/default_runtime.py'
]
model = dict(
type='SingleStageDetector',
backbone=dict(
type='MobileNetV2',
out_indices=(4, 7),
norm_cfg=dict(type='BN', eps=0.001, momentum=0.03),
init_cfg=dict(type='TruncNormal'... | true | true |
f70cf3ac05e6eddaf1709f84918bb111cd4bfdb6 | 294 | py | Python | IndividualTensorFlowScripts/LoadMatFile.py | mindThomas/MachineLearningProjects | b634c0d8e963d7ff8d594cdde6b66c04278cc339 | [
"MIT"
] | 1 | 2019-10-05T07:53:29.000Z | 2019-10-05T07:53:29.000Z | IndividualTensorFlowScripts/LoadMatFile.py | mindThomas/MachineLearningProjects | b634c0d8e963d7ff8d594cdde6b66c04278cc339 | [
"MIT"
] | null | null | null | IndividualTensorFlowScripts/LoadMatFile.py | mindThomas/MachineLearningProjects | b634c0d8e963d7ff8d594cdde6b66c04278cc339 | [
"MIT"
] | 1 | 2019-04-23T10:26:03.000Z | 2019-04-23T10:26:03.000Z | # -*- coding: utf-8 -*-
"""
Created on Tue Oct 31 19:06:00 2017
@author: Thomas
"""
#%%
import numpy as np
import scipy.io
mat = scipy.io.loadmat('mnist_all.mat')
print("MAT file loaded. Contains", len(mat), "datasets. Example size:", mat['train1'].shape)
scipy.io.savemat('test.mat', mat) | 18.375 | 92 | 0.663265 |
import numpy as np
import scipy.io
mat = scipy.io.loadmat('mnist_all.mat')
print("MAT file loaded. Contains", len(mat), "datasets. Example size:", mat['train1'].shape)
scipy.io.savemat('test.mat', mat) | true | true |
f70cf42af71779fb3e354956d990fe64b6776cbd | 474 | py | Python | muni_portal/core/migrations/0009_administrationindexpage_overview.py | desafinadude/muni-portal-backend | 9ffc447194b8f29619585cd919f67d62062457a3 | [
"MIT"
] | 1 | 2021-01-18T13:01:04.000Z | 2021-01-18T13:01:04.000Z | muni_portal/core/migrations/0009_administrationindexpage_overview.py | desafinadude/muni-portal-backend | 9ffc447194b8f29619585cd919f67d62062457a3 | [
"MIT"
] | 42 | 2020-08-29T08:55:53.000Z | 2021-04-14T16:41:29.000Z | muni_portal/core/migrations/0009_administrationindexpage_overview.py | desafinadude/muni-portal-backend | 9ffc447194b8f29619585cd919f67d62062457a3 | [
"MIT"
] | 2 | 2020-10-28T16:34:41.000Z | 2022-02-07T10:29:31.000Z | # Generated by Django 2.2.10 on 2020-10-19 16:12
from django.db import migrations
import wagtail.core.fields
class Migration(migrations.Migration):
dependencies = [
('core', '0008_remove_personpage_name'),
]
operations = [
migrations.AddField(
model_name='administrationindex... | 22.571429 | 64 | 0.628692 |
from django.db import migrations
import wagtail.core.fields
class Migration(migrations.Migration):
dependencies = [
('core', '0008_remove_personpage_name'),
]
operations = [
migrations.AddField(
model_name='administrationindexpage',
name='overview',
f... | true | true |
f70cf5b80bbfab90171f0a27398999dbdbf3981e | 456 | py | Python | src/openpersonen/api/data_classes/gezags_verhouding.py | maykinmedia/open-personen | ddcf083ccd4eb864c5305bcd8bc75c6c64108272 | [
"RSA-MD"
] | 2 | 2020-08-26T11:24:43.000Z | 2021-07-28T09:46:40.000Z | src/openpersonen/api/data_classes/gezags_verhouding.py | maykinmedia/open-personen | ddcf083ccd4eb864c5305bcd8bc75c6c64108272 | [
"RSA-MD"
] | 153 | 2020-08-26T10:45:35.000Z | 2021-12-10T17:33:16.000Z | src/openpersonen/api/data_classes/gezags_verhouding.py | maykinmedia/open-personen | ddcf083ccd4eb864c5305bcd8bc75c6c64108272 | [
"RSA-MD"
] | null | null | null | from dataclasses import dataclass
from openpersonen.api.enum import IndicatieGezagMinderjarigeChoices
from .in_onderzoek import GezagsVerhoudingInOnderzoek
@dataclass
class GezagsVerhouding:
indicatieCurateleRegister: bool
indicatieGezagMinderjarige: str
inOnderzoek: GezagsVerhoudingInOnderzoek
def... | 28.5 | 88 | 0.848684 | from dataclasses import dataclass
from openpersonen.api.enum import IndicatieGezagMinderjarigeChoices
from .in_onderzoek import GezagsVerhoudingInOnderzoek
@dataclass
class GezagsVerhouding:
indicatieCurateleRegister: bool
indicatieGezagMinderjarige: str
inOnderzoek: GezagsVerhoudingInOnderzoek
def... | true | true |
f70cf67b3219d3710c09891862a8b153bb71048d | 1,615 | py | Python | chemdataextractor_batteries/tests/test_reader_elsevier.py | ShuHuang/batterydatabase | 10a94617c00ddca6e5e382f50bfe0b6079457166 | [
"MIT"
] | 26 | 2020-08-06T13:40:58.000Z | 2022-03-23T13:34:45.000Z | chemdataextractor_batteries/tests/test_reader_elsevier.py | ShuHuang/batterydatabase | 10a94617c00ddca6e5e382f50bfe0b6079457166 | [
"MIT"
] | 3 | 2020-08-07T10:54:37.000Z | 2021-07-13T20:42:21.000Z | chemdataextractor_batteries/tests/test_reader_elsevier.py | ShuHuang/batterydatabase | 10a94617c00ddca6e5e382f50bfe0b6079457166 | [
"MIT"
] | 8 | 2020-09-15T14:48:12.000Z | 2022-01-29T05:54:24.000Z | # -*- coding: utf-8 -*-
"""
chemdataextractor.tests.test_reader_els.py
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Test reader for Elsevier.
Juraj Mavračić (jm2111@cam.ac.uk)
"""
import unittest
import logging
import io
import os
from chemdataextractor import Document
from chemdataextractor.reader.elsevier import ElsevierXmlRe... | 28.333333 | 93 | 0.642105 |
import unittest
import logging
import io
import os
from chemdataextractor import Document
from chemdataextractor.reader.elsevier import ElsevierXmlReader
log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)
class TestElsXMLReader(unittest.TestCase):
maxDiff = None
def test_detect(self):
... | true | true |
f70cf6ba7b37cb4ef1ca5e65a1404ae3ea6b2542 | 1,525 | py | Python | Tectonic_Utils/read_write/test/test_conversion_functions.py | kmaterna/Utility_Code | 9894c831a4b2b6c4e4bdb577ad64492d8cd5bd17 | [
"MIT"
] | 4 | 2021-05-05T04:06:37.000Z | 2022-03-30T07:08:17.000Z | Tectonic_Utils/read_write/test/test_conversion_functions.py | kmaterna/Tectonic_Utils | f713a3ce2a80d2e6dbdc42596451405bb873adbb | [
"MIT"
] | null | null | null | Tectonic_Utils/read_write/test/test_conversion_functions.py | kmaterna/Tectonic_Utils | f713a3ce2a80d2e6dbdc42596451405bb873adbb | [
"MIT"
] | null | null | null | # Testing code
import numpy as np
import unittest
import subprocess
from .. import netcdf_read_write
class Tests(unittest.TestCase):
def test_pixel_node_writer(self):
"""
See if the writing function for pixel-node files produces a pixel-node file.
The behavior has been finicky for float3... | 37.195122 | 109 | 0.66623 |
import numpy as np
import unittest
import subprocess
from .. import netcdf_read_write
class Tests(unittest.TestCase):
def test_pixel_node_writer(self):
grid_def = [-120, -114, 32, 37];
inc = [0.02, 0.02];
filename = 'test_outfile.nc'
lons = np.arange(grid_def[0], grid_def[1] + 0.... | true | true |
f70cf6f8bf296ef5c2e4e43ccf3980249cc7ae4e | 5,753 | py | Python | znoyder/browser.py | bregman-arie/znoyder | 7bc0a4275bf460cd271a5dc32aeed353ad7d429f | [
"Apache-2.0"
] | null | null | null | znoyder/browser.py | bregman-arie/znoyder | 7bc0a4275bf460cd271a5dc32aeed353ad7d429f | [
"Apache-2.0"
] | null | null | null | znoyder/browser.py | bregman-arie/znoyder | 7bc0a4275bf460cd271a5dc32aeed353ad7d429f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright 2021 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
... | 32.139665 | 79 | 0.634625 |
from argparse import ArgumentParser
from argparse import Namespace
from pprint import PrettyPrinter
import sys
from urllib.parse import urlparse
from distroinfo import info as di
INFO_FILE = 'osp.yml'
RDOINFO_GIT_URL = 'https://code.engineering.redhat.com/gerrit/ospinfo'
APP_DESCRIPTION = 'Find OSP packages, repos... | true | true |
f70cf76bd82810d7bdbb4bdc87ef709f3efbf04a | 6,155 | py | Python | Tasks.py | xyqyear/bilibili-live-tools | c5f9ae5a64455cb43b763ed90417698a666810eb | [
"MIT"
] | null | null | null | Tasks.py | xyqyear/bilibili-live-tools | c5f9ae5a64455cb43b763ed90417698a666810eb | [
"MIT"
] | null | null | null | Tasks.py | xyqyear/bilibili-live-tools | c5f9ae5a64455cb43b763ed90417698a666810eb | [
"MIT"
] | null | null | null | from bilibili import bilibili
import datetime
import time
import asyncio
import traceback
import os
import configloader
import utils
from printer import Printer
class Tasks:
def __init__(self):
fileDir = os.path.dirname(os.path.realpath('__file__'))
file_user = fileDir + "/conf/user.conf"
... | 43.041958 | 111 | 0.553046 | from bilibili import bilibili
import datetime
import time
import asyncio
import traceback
import os
import configloader
import utils
from printer import Printer
class Tasks:
def __init__(self):
fileDir = os.path.dirname(os.path.realpath('__file__'))
file_user = fileDir + "/conf/user.conf"
... | true | true |
f70cf7a12352c1e00d4fe8c138a7b0885910c59e | 1,957 | py | Python | salt/states/tls.py | springborland/salt | bee85e477d57e9a171884e54fefb9a59d0835ed0 | [
"Apache-2.0"
] | 1 | 2020-04-09T03:25:10.000Z | 2020-04-09T03:25:10.000Z | salt/states/tls.py | springborland/salt | bee85e477d57e9a171884e54fefb9a59d0835ed0 | [
"Apache-2.0"
] | null | null | null | salt/states/tls.py | springborland/salt | bee85e477d57e9a171884e54fefb9a59d0835ed0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Enforce state for SSL/TLS
=========================
"""
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import datetime
import logging
import time
__virtualname__ = "tls"
log = logging.getLogger(__name__)
def __virtual__():
if "tls.cert... | 26.808219 | 78 | 0.615738 |
from __future__ import absolute_import, print_function, unicode_literals
import datetime
import logging
import time
__virtualname__ = "tls"
log = logging.getLogger(__name__)
def __virtual__():
if "tls.cert_info" not in __salt__:
return False
return __virtualname__
def valid_certificate(name, wee... | true | true |
f70cf85a19e845bc53f4940e02932a59dca83f36 | 3,365 | py | Python | mlrun/api/migrations_sqlite/versions/f4249b4ba6fa_adding_feature_vectors.py | george0st/mlrun | 6467d3a5ceadf6cd35512b84b3ddc3da611cf39a | [
"Apache-2.0"
] | null | null | null | mlrun/api/migrations_sqlite/versions/f4249b4ba6fa_adding_feature_vectors.py | george0st/mlrun | 6467d3a5ceadf6cd35512b84b3ddc3da611cf39a | [
"Apache-2.0"
] | null | null | null | mlrun/api/migrations_sqlite/versions/f4249b4ba6fa_adding_feature_vectors.py | george0st/mlrun | 6467d3a5ceadf6cd35512b84b3ddc3da611cf39a | [
"Apache-2.0"
] | null | null | null | """Adding feature vectors
Revision ID: f4249b4ba6fa
Revises: 863114f0c659
Create Date: 2020-11-24 14:43:08.789873
"""
import sqlalchemy as sa
from alembic import op
from mlrun.api.utils.db.sql_collation import SQLCollationUtil
# revision identifiers, used by Alembic.
revision = "f4249b4ba6fa"
down_revision = "86311... | 30.315315 | 88 | 0.570877 | import sqlalchemy as sa
from alembic import op
from mlrun.api.utils.db.sql_collation import SQLCollationUtil
revision = "f4249b4ba6fa"
down_revision = "863114f0c659"
branch_labels = None
depends_on = None
def upgrade():
op.create_table(
"feature_vectors",
sa.Column("id", sa.Integer(), nullab... | true | true |
f70cf8a5a651a1812e085dee00f63256dbe337ff | 13,142 | py | Python | dynamo/tools/_dynamics_deprecated.py | davisidarta/dynamo-release | 0dbd769f52ea07f3cdaa8fb31022ceb89938c382 | [
"BSD-3-Clause"
] | null | null | null | dynamo/tools/_dynamics_deprecated.py | davisidarta/dynamo-release | 0dbd769f52ea07f3cdaa8fb31022ceb89938c382 | [
"BSD-3-Clause"
] | null | null | null | dynamo/tools/_dynamics_deprecated.py | davisidarta/dynamo-release | 0dbd769f52ea07f3cdaa8fb31022ceb89938c382 | [
"BSD-3-Clause"
] | null | null | null | import warnings
import numpy as np
from .utils_moments import moments
from .velocity import velocity, ss_estimation
from .utils import (
get_mapper,
get_valid_bools,
get_data_for_kin_params_estimation,
get_U_S_for_velocity_estimation,
)
from .utils import set_velocity, set_param_ss, set_param_kinetic
fr... | 38.539589 | 143 | 0.565972 | import warnings
import numpy as np
from .utils_moments import moments
from .velocity import velocity, ss_estimation
from .utils import (
get_mapper,
get_valid_bools,
get_data_for_kin_params_estimation,
get_U_S_for_velocity_estimation,
)
from .utils import set_velocity, set_param_ss, set_param_kinetic
fr... | true | true |
f70cf928d6daa6d1af5525d156d4e45b06662697 | 4,909 | py | Python | tapiriik/services/devices.py | julian-r/tapiriik | 219d84dcda3bc2f8f609cbeb34f28a0acc546cc6 | [
"Apache-2.0"
] | null | null | null | tapiriik/services/devices.py | julian-r/tapiriik | 219d84dcda3bc2f8f609cbeb34f28a0acc546cc6 | [
"Apache-2.0"
] | null | null | null | tapiriik/services/devices.py | julian-r/tapiriik | 219d84dcda3bc2f8f609cbeb34f28a0acc546cc6 | [
"Apache-2.0"
] | null | null | null | class DeviceIdentifierType:
FIT = "fit"
TCX = "tcx"
class FITDeviceIdentifier:
def __init__(self, manufacturer, product=None):
self.Type = DeviceIdentifierType.FIT
self.Manufacturer = manufacturer
self.Product = product
class TCXDeviceIdentifier:
def __init__(self, name, productId=None):
self.Type = Devic... | 49.585859 | 121 | 0.80057 | class DeviceIdentifierType:
FIT = "fit"
TCX = "tcx"
class FITDeviceIdentifier:
def __init__(self, manufacturer, product=None):
self.Type = DeviceIdentifierType.FIT
self.Manufacturer = manufacturer
self.Product = product
class TCXDeviceIdentifier:
def __init__(self, name, productId=None):
self.Type = Devic... | true | true |
f70cfb415f37e39dff964fbf845360efcfbba302 | 2,097 | py | Python | training.py | victor-tuda/chatbot | 3cadd018759344991c77e2aa86b8965ed0271789 | [
"MIT"
] | null | null | null | training.py | victor-tuda/chatbot | 3cadd018759344991c77e2aa86b8965ed0271789 | [
"MIT"
] | null | null | null | training.py | victor-tuda/chatbot | 3cadd018759344991c77e2aa86b8965ed0271789 | [
"MIT"
] | null | null | null | import random
import json
import pickle
import numpy as np
import nltk
nltk.download('punkt')
nltk.download('wordnet')
from nltk.stem import WordNetLemmatizer
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Activation, Dropout
from tensorflow.keras.optimizers import SGD
lemm... | 28.337838 | 91 | 0.704816 | import random
import json
import pickle
import numpy as np
import nltk
nltk.download('punkt')
nltk.download('wordnet')
from nltk.stem import WordNetLemmatizer
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Activation, Dropout
from tensorflow.keras.optimizers import SGD
lemm... | true | true |
f70cfbb9b7384362631e1789a4d04dceff1c5f01 | 1,177 | py | Python | myapp.py | ppplinday/Situation-Awareness-Visualization | 13b233a1119b21f55e61d81d7d584d45d57a7385 | [
"MIT"
] | 1 | 2020-11-17T06:42:41.000Z | 2020-11-17T06:42:41.000Z | myapp.py | ppplinday/Situation-Awareness-Visualization | 13b233a1119b21f55e61d81d7d584d45d57a7385 | [
"MIT"
] | null | null | null | myapp.py | ppplinday/Situation-Awareness-Visualization | 13b233a1119b21f55e61d81d7d584d45d57a7385 | [
"MIT"
] | 1 | 2019-03-15T01:41:25.000Z | 2019-03-15T01:41:25.000Z | import os
import json
import numpy as np
import pandas as pd
import datetime
import SAVIZ.situation_awareness_visualization as saviz
with open("tempfile.json", 'r') as f:
json_file = f.readlines()[0]
has_type = True
has_time = False
timeRange = [0, 1]
with open("tempconfig.json", 'r') as f:
config = f.readlines... | 26.155556 | 96 | 0.705183 | import os
import json
import numpy as np
import pandas as pd
import datetime
import SAVIZ.situation_awareness_visualization as saviz
with open("tempfile.json", 'r') as f:
json_file = f.readlines()[0]
has_type = True
has_time = False
timeRange = [0, 1]
with open("tempconfig.json", 'r') as f:
config = f.readlines... | true | true |
f70cfcc40724b51afabfdb90dd80698b8aba18a6 | 1,017 | py | Python | django_react_hybrid/contrib/sites/migrations/0003_set_site_domain_and_name.py | tylerhuntington222/django-react-pac | 1cc4c97646dc2c3ebc4e54ee5023a3a4a5e4fe99 | [
"MIT"
] | null | null | null | django_react_hybrid/contrib/sites/migrations/0003_set_site_domain_and_name.py | tylerhuntington222/django-react-pac | 1cc4c97646dc2c3ebc4e54ee5023a3a4a5e4fe99 | [
"MIT"
] | null | null | null | django_react_hybrid/contrib/sites/migrations/0003_set_site_domain_and_name.py | tylerhuntington222/django-react-pac | 1cc4c97646dc2c3ebc4e54ee5023a3a4a5e4fe99 | [
"MIT"
] | null | null | null | """
To understand why this file is here, please read:
http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
"""
from django.conf import settings
from django.db import migrations
def update_site_forward(apps, schema_editor):
"""Set site d... | 29.057143 | 129 | 0.687316 | from django.conf import settings
from django.db import migrations
def update_site_forward(apps, schema_editor):
Site = apps.get_model("sites", "Site")
Site.objects.update_or_create(
id=settings.SITE_ID,
defaults={
"domain": "example.com",
"name": "django-react-hybrid",
... | true | true |
f70cfe8b28c5bfe6acb77eb3e647287f4accce9a | 13,791 | py | Python | runGan.py | hephaex/TecoGAN | 41391b5980fcfae4713aad4ee0fd423cfb636d9c | [
"Apache-2.0"
] | null | null | null | runGan.py | hephaex/TecoGAN | 41391b5980fcfae4713aad4ee0fd423cfb636d9c | [
"Apache-2.0"
] | null | null | null | runGan.py | hephaex/TecoGAN | 41391b5980fcfae4713aad4ee0fd423cfb636d9c | [
"Apache-2.0"
] | null | null | null | '''
several running examples, run with
python3 runGan.py 1 # the last number is the run case number
runcase == 1 inference a trained model
runcase == 2 calculate the metrics, and save the numbers in csv
runcase == 3 training TecoGAN
runcase == 4 training FRVSR
runcase == ... coming... data prepara... | 46.434343 | 136 | 0.600682 | import os, subprocess, sys, datetime, signal, shutil
runcase = int(sys.argv[1])
print ("Testing test case %d" % runcase)
def preexec(): os.setpgrp()
def mycall(cmd, block=False):
if not block:
return subprocess.Popen(cmd)
else:
return subprocess.Popen(cmd, preexec_fn = pree... | true | true |
f70cfec7a6fbe5a6f0f7ebb4581f0e8819f32a15 | 150 | py | Python | djangocrud/mycrudApp/apps.py | roygoswamisuvankar/Djang-Crud | 83b488971b1f6e437a3c3e3b8b53c65a5e4e9db8 | [
"MIT"
] | null | null | null | djangocrud/mycrudApp/apps.py | roygoswamisuvankar/Djang-Crud | 83b488971b1f6e437a3c3e3b8b53c65a5e4e9db8 | [
"MIT"
] | null | null | null | djangocrud/mycrudApp/apps.py | roygoswamisuvankar/Djang-Crud | 83b488971b1f6e437a3c3e3b8b53c65a5e4e9db8 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class MycrudappConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'mycrudApp'
| 21.428571 | 56 | 0.766667 | from django.apps import AppConfig
class MycrudappConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'mycrudApp'
| true | true |
f70cfffd5a767e64aee7ba381278dea2743308a9 | 17,369 | py | Python | quantulum3/parser.py | skatsaounis/quantulum3 | 07b1b0db933847ef61a56b970aa0c4816c3fc2f4 | [
"MIT"
] | null | null | null | quantulum3/parser.py | skatsaounis/quantulum3 | 07b1b0db933847ef61a56b970aa0c4816c3fc2f4 | [
"MIT"
] | null | null | null | quantulum3/parser.py | skatsaounis/quantulum3 | 07b1b0db933847ef61a56b970aa0c4816c3fc2f4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:mod:`Quantulum` parser.
"""
# Standard library
import re
import logging
from fractions import Fraction
from collections import defaultdict
from math import pow
# Quantulum
from . import load
from . import regex as reg
from . import classes as cls
from . import disamb... | 33.210325 | 79 | 0.526916 |
import re
import logging
from fractions import Fraction
from collections import defaultdict
from math import pow
from . import load
from . import regex as reg
from . import classes as cls
from . import disambiguate as dis
from . import language
def _get_parser(lang='en_US'):
return language.get('parser', lang)
... | true | true |
f70d0018ac999c8f29218606892e90254e08e0b0 | 1,314 | py | Python | IGM/execute_PlotRays.py | FRBs/PreFRBLE | edca808855e3daafae58331af6964b89efa2519f | [
"MIT"
] | 5 | 2020-08-12T17:08:47.000Z | 2021-04-28T08:42:05.000Z | IGM/execute_PlotRays.py | FRBs/PreFRBLE | edca808855e3daafae58331af6964b89efa2519f | [
"MIT"
] | null | null | null | IGM/execute_PlotRays.py | FRBs/PreFRBLE | edca808855e3daafae58331af6964b89efa2519f | [
"MIT"
] | null | null | null | from Plots import *
#PlotNearRays( measure='SM' )
PlotFarRays( measure='SM', plot_mean=True, uniform=True, save_mean=True )# False )
#PlotFarRays( measure='SM', mean=True, uniform=True, overestimate=True )
PlotFarRays( measure='DM', plot_mean=True, uniform=True, save_mean=True )# False )
#PlotFarRays( measure='DM', ... | 65.7 | 291 | 0.7207 | from Plots import *
PlotFarRays( measure='SM', plot_mean=True, uniform=True, save_mean=True )
PlotFarRays( measure='DM', plot_mean=True, uniform=True, save_mean=True )
models = ['primordial', 'astrophysical', 'B9b', 'B9.5b', 'B10.0b', 'B10.5b', 'B11b', 'B13b', 'B15b', 'B17b' ][:4]
models=['primordial', 'astrophysical... | true | true |
f70d00319707ad3a839c4bb56c08746898736bbe | 5,038 | py | Python | mmdet-v2/tools/third_party/PANDA-Toolkit/MOTEval.py | li-phone/DetectionCompetition | a917f16790ec30358e3cfe1aa6e327a2070a1235 | [
"Apache-2.0"
] | null | null | null | mmdet-v2/tools/third_party/PANDA-Toolkit/MOTEval.py | li-phone/DetectionCompetition | a917f16790ec30358e3cfe1aa6e327a2070a1235 | [
"Apache-2.0"
] | null | null | null | mmdet-v2/tools/third_party/PANDA-Toolkit/MOTEval.py | li-phone/DetectionCompetition | a917f16790ec30358e3cfe1aa6e327a2070a1235 | [
"Apache-2.0"
] | null | null | null | # --------------------------------------------------------
# Compute metrics for trackers using ground-truth data
# Written by Wang Xueyang (wangxuey19@mails.tsinghua.edu.cn), Version 20200321
# Based on motmetrics (https://github.com/cheind/py-motmetrics/)
# --------------------------------------------------------
im... | 37.597015 | 131 | 0.672092 |
import argparse
from collections import OrderedDict
import glob
import logging
import os
from pathlib import Path
import motmetrics as mm
from panda_utils import generate_mot_anno
def parse_args():
parser = argparse.ArgumentParser(description="""
Compute metrics for trackers using ground-truth data.
Files
----... | true | true |
f70d00bd6a5f912fdbb46588c4979e33b73b0a73 | 3,023 | py | Python | SFig11_Whitecell_Cell_Area.py | MortisHuang/VIFFI-image-analysis | ad144970e9cb53d61119dd96370157251c03cc07 | [
"MIT"
] | null | null | null | SFig11_Whitecell_Cell_Area.py | MortisHuang/VIFFI-image-analysis | ad144970e9cb53d61119dd96370157251c03cc07 | [
"MIT"
] | null | null | null | SFig11_Whitecell_Cell_Area.py | MortisHuang/VIFFI-image-analysis | ad144970e9cb53d61119dd96370157251c03cc07 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Nov 14 11:30:55 2019
@author: Mortis Huang
"""
# import the necessary packages
from PIL import Image
import numpy as np
import datetime
import os
import pandas as pd
#%% Set the output file location
run_data = datetime.datetime.now().strftime("%Y_%m_%d")
resul... | 31.821053 | 89 | 0.673834 |
from PIL import Image
import numpy as np
import datetime
import os
import pandas as pd
run_data = datetime.datetime.now().strftime("%Y_%m_%d")
result_path=r"SFig11_{}/".format(run_data)
if not os.path.exists(result_path):
os.makedirs(result_path)
labels=['neutrophyl','lymphocyte']
#base_path = r'E... | true | true |
f70d017f29262c960b836dabc3d6eb403a799873 | 5,356 | py | Python | dynamic.py | WyattMufson/OEP5-PackedList | be660ac039e56fa1d91a72243756e4c8c5a7b2fb | [
"MIT"
] | 2 | 2019-06-01T09:29:49.000Z | 2019-06-03T15:12:15.000Z | dynamic.py | WyattMufson/OEP5-PackedList | be660ac039e56fa1d91a72243756e4c8c5a7b2fb | [
"MIT"
] | null | null | null | dynamic.py | WyattMufson/OEP5-PackedList | be660ac039e56fa1d91a72243756e4c8c5a7b2fb | [
"MIT"
] | null | null | null | MAXIMUM_ARRAY_LENGTH = 1024
def Main(operation, args):
if operation == 'DynamicListTest':
return DynamicListTest()
return False
def DynamicListTest():
dynamicList = DynamicList()
added = DynamicAppend(dynamicList, 1)
assert(added)
count = len(dynamicList["packed"][0]["array"])
a... | 22.132231 | 79 | 0.591299 | MAXIMUM_ARRAY_LENGTH = 1024
def Main(operation, args):
if operation == 'DynamicListTest':
return DynamicListTest()
return False
def DynamicListTest():
dynamicList = DynamicList()
added = DynamicAppend(dynamicList, 1)
assert(added)
count = len(dynamicList["packed"][0]["array"])
a... | true | true |
f70d01f32d98df1f681475d8e453d6ba6bac6ba4 | 29,093 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_network_security_groups_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_network_security_groups_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | null | null | null | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_network_security_groups_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 49.731624 | 211 | 0.673598 | 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 |
f70d027cbba96f167a9e06ffbdd7a52ec4ec4e99 | 12,991 | py | Python | tests/test_agents_common_evaluate_antidiagonals.py | InesVogel/Connect4 | 9528115515fb33d107ebc26d4141a1d3effdca5e | [
"MIT"
] | null | null | null | tests/test_agents_common_evaluate_antidiagonals.py | InesVogel/Connect4 | 9528115515fb33d107ebc26d4141a1d3effdca5e | [
"MIT"
] | null | null | null | tests/test_agents_common_evaluate_antidiagonals.py | InesVogel/Connect4 | 9528115515fb33d107ebc26d4141a1d3effdca5e | [
"MIT"
] | null | null | null | from agents.common import PLAYER1, PLAYER2, initialize_game_state, evaluate_antidiagonals, is_player_blocking_opponent, \
is_player_winning
def test_evaluate_antidiagonals_uppertriangle_True_Player1_is_player_blocking_opponent():
game = initialize_game_state()
num_rows = game.shape[0]
num_cols = game.... | 37.655072 | 121 | 0.568163 | from agents.common import PLAYER1, PLAYER2, initialize_game_state, evaluate_antidiagonals, is_player_blocking_opponent, \
is_player_winning
def test_evaluate_antidiagonals_uppertriangle_True_Player1_is_player_blocking_opponent():
game = initialize_game_state()
num_rows = game.shape[0]
num_cols = game.... | true | true |
f70d03fb8602ede9134766497e139d1128861aee | 1,807 | py | Python | src/get-data.py | UBC-MDS/TransLink | 6d9a35e712a1934b1813e0e2f395d32404f546ad | [
"MIT"
] | null | null | null | src/get-data.py | UBC-MDS/TransLink | 6d9a35e712a1934b1813e0e2f395d32404f546ad | [
"MIT"
] | null | null | null | src/get-data.py | UBC-MDS/TransLink | 6d9a35e712a1934b1813e0e2f395d32404f546ad | [
"MIT"
] | null | null | null | """This script downloads all of the data located in the AWS S3 bucket, given the proper
access key and secret key. Assumes that this script will be run from the root of the repository.
Usage: get-data.py --access_key=<access_key> --secret_key=<secret_key>
Options:
--access_key=<access_key> The AWS access key provid... | 25.814286 | 127 | 0.619812 |
import boto3
import os
from docopt import docopt
opt = docopt(__doc__)
def main(access_key, secret_key):
s3 = boto3.client(
's3',
aws_access_key_id=access_key,
aws_secret_access_key=secret_key
)
for item in s3.list_objects(Bucket='mds-capstone-assurance')['Contents']:
... | true | true |
f70d04265df0c8f5277254f25352e99ca1ade1b7 | 811 | py | Python | Home/migrations/0011_auto_20200722_1741.py | varunofficial2509/HMS-1 | d1b618575d038cd432e5b8742cdebdae82d34d30 | [
"MIT"
] | 4 | 2021-06-13T13:52:37.000Z | 2021-09-16T16:54:11.000Z | Home/migrations/0011_auto_20200722_1741.py | varunofficial2509/HMS-1 | d1b618575d038cd432e5b8742cdebdae82d34d30 | [
"MIT"
] | 5 | 2021-07-10T10:37:06.000Z | 2022-03-12T00:58:24.000Z | Home/migrations/0011_auto_20200722_1741.py | varunofficial2509/HMS-1 | d1b618575d038cd432e5b8742cdebdae82d34d30 | [
"MIT"
] | 2 | 2021-06-13T08:16:15.000Z | 2021-07-27T13:47:00.000Z | # Generated by Django 3.0.8 on 2020-07-22 12:11
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('Home', '0010_auto_20200722_1738'),
]
operations = [
migrations.RenameField(
model_name='student',
old_name='fathermobileno',... | 23.852941 | 47 | 0.543773 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('Home', '0010_auto_20200722_1738'),
]
operations = [
migrations.RenameField(
model_name='student',
old_name='fathermobileno',
new_name='father_mobile_no',
... | true | true |
f70d04b0d75934a1c8128fd981ff5778e0092b1d | 2,033 | py | Python | torchutils/losses/losses.py | tchaye59/torchutils | ca7b01bf63b6c3adaa36a4a66dfd87e927ef2460 | [
"MIT"
] | null | null | null | torchutils/losses/losses.py | tchaye59/torchutils | ca7b01bf63b6c3adaa36a4a66dfd87e927ef2460 | [
"MIT"
] | null | null | null | torchutils/losses/losses.py | tchaye59/torchutils | ca7b01bf63b6c3adaa36a4a66dfd87e927ef2460 | [
"MIT"
] | null | null | null | import torch
from torch import nn
from torch.nn import functional as F
from torchutils import to_device
class FocalLoss(nn.Module):
"""weighted version of Focal Loss"""
def __init__(self, alpha=.25, gamma=2, device=None):
super(FocalLoss, self).__init__()
self.alpha = torch.tensor([alpha, 1 ... | 35.051724 | 93 | 0.685194 | import torch
from torch import nn
from torch.nn import functional as F
from torchutils import to_device
class FocalLoss(nn.Module):
def __init__(self, alpha=.25, gamma=2, device=None):
super(FocalLoss, self).__init__()
self.alpha = torch.tensor([alpha, 1 - alpha])
self.gamma = ga... | true | true |
f70d06005a23cad51c65e5a23d5b729911dd9204 | 172 | py | Python | nltk/align/util.py | dmcc/nltk | 33c193d2de3876ca89fb08140557e16f01c79c6f | [
"Apache-2.0"
] | 3 | 2019-04-09T22:59:33.000Z | 2019-06-14T09:23:24.000Z | nltk/align/util.py | dmcc/nltk | 33c193d2de3876ca89fb08140557e16f01c79c6f | [
"Apache-2.0"
] | null | null | null | nltk/align/util.py | dmcc/nltk | 33c193d2de3876ca89fb08140557e16f01c79c6f | [
"Apache-2.0"
] | 2 | 2019-10-28T01:33:22.000Z | 2019-10-30T06:43:43.000Z | # Natural Language Toolkit: Aligner Utilities
#
# Copyright (C) 2001-2013 NLTK Project
# Author:
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
| 21.5 | 45 | 0.72093 | true | true | |
f70d06da3315ad393f6a824e025f1be7b2422ce1 | 4,442 | py | Python | ddtrace/contrib/tornado/handlers.py | mykytarudenko/new-project | e06a912382239739dd3f93b54d545b9506102372 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | ddtrace/contrib/tornado/handlers.py | mykytarudenko/new-project | e06a912382239739dd3f93b54d545b9506102372 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2021-01-27T04:53:24.000Z | 2021-01-27T04:53:24.000Z | ddtrace/contrib/tornado/handlers.py | mykytarudenko/new-project | e06a912382239739dd3f93b54d545b9506102372 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | from tornado.web import HTTPError
from ddtrace import config
from ...constants import ANALYTICS_SAMPLE_RATE_KEY
from ...constants import SPAN_MEASURED_KEY
from ...ext import SpanTypes
from ...ext import http
from ...propagation.http import HTTPPropagator
from .constants import CONFIG_KEY
from .constants import REQUES... | 40.018018 | 104 | 0.694732 | from tornado.web import HTTPError
from ddtrace import config
from ...constants import ANALYTICS_SAMPLE_RATE_KEY
from ...constants import SPAN_MEASURED_KEY
from ...ext import SpanTypes
from ...ext import http
from ...propagation.http import HTTPPropagator
from .constants import CONFIG_KEY
from .constants import REQUES... | true | true |
f70d07536fff3d62110a2c36ad2c55058c0beb6c | 2,390 | py | Python | server.py | sibivel/battle-snake-python | fdd3110ee6557f3d47a1ad9f2cd88cf2eb0dec74 | [
"MIT"
] | null | null | null | server.py | sibivel/battle-snake-python | fdd3110ee6557f3d47a1ad9f2cd88cf2eb0dec74 | [
"MIT"
] | null | null | null | server.py | sibivel/battle-snake-python | fdd3110ee6557f3d47a1ad9f2cd88cf2eb0dec74 | [
"MIT"
] | null | null | null | import os
import random
import cherrypy
"""
This is a simple Battlesnake server written in Python.
For instructions see https://github.com/BattlesnakeOfficial/starter-snake-python/README.md
"""
class Battlesnake(object):
@cherrypy.expose
@cherrypy.tools.json_out()
def index(self):
# This functio... | 33.194444 | 101 | 0.635565 | import os
import random
import cherrypy
class Battlesnake(object):
@cherrypy.expose
@cherrypy.tools.json_out()
def index(self):
return {
"apiversion": "1",
"author": "", "color": "#888888", # TODO: Personalize
"head": "def... | true | true |
f70d079f0bb32ca983a074c6e9b2100f24afbca7 | 4,569 | py | Python | tests/unittests/test_group_model.py | zodman/ZoomFoundry | 87a69f519a2ab6b63aeec0a564ce41259e64f88d | [
"MIT"
] | 8 | 2017-04-10T09:53:15.000Z | 2020-08-16T09:53:14.000Z | tests/unittests/test_group_model.py | zodman/ZoomFoundry | 87a69f519a2ab6b63aeec0a564ce41259e64f88d | [
"MIT"
] | 49 | 2017-04-13T22:51:48.000Z | 2019-08-15T22:53:25.000Z | tests/unittests/test_group_model.py | zodman/ZoomFoundry | 87a69f519a2ab6b63aeec0a564ce41259e64f88d | [
"MIT"
] | 12 | 2017-04-11T04:16:47.000Z | 2019-08-10T21:41:54.000Z | """
test the group model from zoom.models
"""
import unittest
import zoom
from zoom.database import setup_test
from zoom.models import Groups
from zoom.utils import Bunch
class TestGroup(unittest.TestCase):
"""Test the Zoom Group and Groups models"""
def setUp(self):
self.db = setup_test()
... | 29.101911 | 77 | 0.630773 | import unittest
import zoom
from zoom.database import setup_test
from zoom.models import Groups
from zoom.utils import Bunch
class TestGroup(unittest.TestCase):
def setUp(self):
self.db = setup_test()
self.groups = Groups(self.db)
zoom.system.site = zoom.sites.Site()
zoom.system.u... | true | true |
f70d07cb61d1887c3edaf1f7fbd65b9c13b058cc | 1,927 | py | Python | hydra.py | RollMan/Hydra | f5239cda1d1e5d47bea25fee7e96ae0617aa0a74 | [
"MIT"
] | null | null | null | hydra.py | RollMan/Hydra | f5239cda1d1e5d47bea25fee7e96ae0617aa0a74 | [
"MIT"
] | null | null | null | hydra.py | RollMan/Hydra | f5239cda1d1e5d47bea25fee7e96ae0617aa0a74 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import util
import sys, decode, datetime, os
apikey = '*****'
apisec = '*****'
def date2int(datestr):
date = datetime.datetime.strptime(datestr, "%a %b %d %H:%M:%S %z %Y")
return date
class timeline:
time_begin = 0
time_end = 0
hashtag = ''
tweetlist = []
... | 33.224138 | 177 | 0.614427 | import util
import sys, decode, datetime, os
apikey = '*****'
apisec = '*****'
def date2int(datestr):
date = datetime.datetime.strptime(datestr, "%a %b %d %H:%M:%S %z %Y")
return date
class timeline:
time_begin = 0
time_end = 0
hashtag = ''
tweetlist = []
def __init__(tb, te, ht... | false | true |
f70d0818e9b6a5f45be5442a139abda1283f0236 | 130 | py | Python | cranworth/cranworth_site/apps.py | cjoc/cranworth | c048437b2dfb8b7908f8c2b7a7382502d461bb5e | [
"MIT"
] | null | null | null | cranworth/cranworth_site/apps.py | cjoc/cranworth | c048437b2dfb8b7908f8c2b7a7382502d461bb5e | [
"MIT"
] | null | null | null | cranworth/cranworth_site/apps.py | cjoc/cranworth | c048437b2dfb8b7908f8c2b7a7382502d461bb5e | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class CranworthSiteConfig(AppConfig):
name = 'cranworth_site'
verbose_name = 'Website' | 21.666667 | 37 | 0.761538 | from django.apps import AppConfig
class CranworthSiteConfig(AppConfig):
name = 'cranworth_site'
verbose_name = 'Website' | true | true |
f70d082602ad18b88dc46b1a347ca8e1149f97e1 | 1,754 | py | Python | src/main/py/com/example/utils/commons.py | brijeshdhaker/spark-python-examples | bb3504d21c073448c336c228f74449de68853b8d | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-07-18T16:23:56.000Z | 2021-07-18T16:23:56.000Z | src/main/py/com/example/utils/commons.py | brijeshdhaker/spark-python-examples | bb3504d21c073448c336c228f74449de68853b8d | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/main/py/com/example/utils/commons.py | brijeshdhaker/spark-python-examples | bb3504d21c073448c336c228f74449de68853b8d | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | #
#
#
import re
import random
import time
COMMA_DELIMITER_1 = ',(?=([^"]*"[^"]*")*[^"]*$)'
COMMA_DELIMITER_2 = ',(?=([^"\\]*"\\[^"\\]*"\\)*[^"\\]*$)'
#
#
def print_separator():
print(" " * 30)
print(" #" * 30)
print(" " * 30)
#
# line2 = '1;"Goroka";"Goroka";"Papua New Guinea";"GKA";"AYGA";-6.081689;145.... | 27.40625 | 120 | 0.63455 | import re
import random
import time
COMMA_DELIMITER_1 = ',(?=([^"]*"[^"]*")*[^"]*$)'
COMMA_DELIMITER_2 = ',(?=([^"\\]*"\\[^"\\]*"\\)*[^"\\]*$)'
def print_separator():
print(" " * 30)
print(" #" * 30)
print(" " * 30)
def split_csv(d, x):
splits = re.split(r"{}".format(d), x)
return splits
def spl... | true | true |
f70d087aff5d9507c88f23bd76d8f7f6dd2d4131 | 9,711 | py | Python | bank.py | weibk/learning_python | ba4e6187b3f90d7f677137381fdfc63396829bf6 | [
"MIT"
] | null | null | null | bank.py | weibk/learning_python | ba4e6187b3f90d7f677137381fdfc63396829bf6 | [
"MIT"
] | null | null | null | bank.py | weibk/learning_python | ba4e6187b3f90d7f677137381fdfc63396829bf6 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# encoding='utf-8'
# author:weibk
# @time:2021/9/23 19:10
import pymysql
import random
con = pymysql.connect(host="localhost",
user="root",
password="123456",
database="db",
charset="utf8")
cursor = con.cursor(c... | 33.143345 | 74 | 0.38719 |
import pymysql
import random
con = pymysql.connect(host="localhost",
user="root",
password="123456",
database="db",
charset="utf8")
cursor = con.cursor(cursor=pymysql.cursors.DictCursor)
print("*****************************")
prin... | true | true |
f70d08b1e16c11f43dae4b36dde3b9cf8a3a63fe | 71 | py | Python | ipython/startup/import_zipfile.py | dycw/dotfiles2 | 9e23c4989e9813080da3658a8f98dbb1e03776f2 | [
"MIT"
] | null | null | null | ipython/startup/import_zipfile.py | dycw/dotfiles2 | 9e23c4989e9813080da3658a8f98dbb1e03776f2 | [
"MIT"
] | null | null | null | ipython/startup/import_zipfile.py | dycw/dotfiles2 | 9e23c4989e9813080da3658a8f98dbb1e03776f2 | [
"MIT"
] | null | null | null | import zipfile # noqa: F401
from zipfile import ZipFile # noqa: F401
| 23.666667 | 41 | 0.746479 | import zipfile from zipfile import ZipFile | true | true |
f70d0a20b4882a1fa2a32ea27f49ed637e0f2514 | 1,314 | py | Python | model/user.py | VanillaPupa/python_training | 7a6bea1f18e61aaf739e6dc3c08822281f0b126b | [
"Apache-2.0"
] | null | null | null | model/user.py | VanillaPupa/python_training | 7a6bea1f18e61aaf739e6dc3c08822281f0b126b | [
"Apache-2.0"
] | null | null | null | model/user.py | VanillaPupa/python_training | 7a6bea1f18e61aaf739e6dc3c08822281f0b126b | [
"Apache-2.0"
] | null | null | null | from sys import maxsize
class User:
def __init__(self, firstname=None, lastname=None, address=None, email=None, email2=None, email3=None, user_id=None,
homephone=None, workphone=None, mobilephone=None, additionalphone=None,
all_phones_from_home_page=None, all_emails_from_home_pa... | 36.5 | 119 | 0.652207 | from sys import maxsize
class User:
def __init__(self, firstname=None, lastname=None, address=None, email=None, email2=None, email3=None, user_id=None,
homephone=None, workphone=None, mobilephone=None, additionalphone=None,
all_phones_from_home_page=None, all_emails_from_home_pa... | true | true |
f70d0a28226c983987117ceac4c1ba0b95ab6267 | 6,361 | py | Python | murano/api/v1/sessions.py | chenyujie/hybrid-murano | 5577bee4bd636d0de794ca928897fe6b1b69b1a4 | [
"Apache-2.0"
] | null | null | null | murano/api/v1/sessions.py | chenyujie/hybrid-murano | 5577bee4bd636d0de794ca928897fe6b1b69b1a4 | [
"Apache-2.0"
] | null | null | null | murano/api/v1/sessions.py | chenyujie/hybrid-murano | 5577bee4bd636d0de794ca928897fe6b1b69b1a4 | [
"Apache-2.0"
] | 1 | 2016-04-30T07:27:52.000Z | 2016-04-30T07:27:52.000Z | # Copyright (c) 2013 Mirantis, 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... | 39.265432 | 79 | 0.649112 |
from webob import exc
from murano.api.v1 import request_statistics
from murano.common.i18n import _
from murano.common import wsgi
from murano.db import models
from murano.db.services import environments as envs
from murano.db.services import sessions
from murano.db import session as db_session
from murano.openstack.... | true | true |
f70d0bb297bad06cdeb1b2028c7a1def52ab6fe7 | 2,782 | py | Python | SimpleCV/examples/machine-learning/machine-learning_nuts-vs-bolts.py | M93Pragya/SimpleCV | 6c4d61b6d1d9d856b471910107cad0838954d2b2 | [
"BSD-3-Clause"
] | 1,686 | 2015-01-02T08:47:08.000Z | 2022-03-26T11:55:35.000Z | SimpleCV/examples/machine-learning/machine-learning_nuts-vs-bolts.py | Tester2009/SimpleCV | 7372a0c58eead9c3228315d65ae1903e4b8eb3f1 | [
"BSD-3-Clause"
] | 64 | 2015-01-05T11:23:11.000Z | 2021-12-17T18:29:10.000Z | SimpleCV/examples/machine-learning/machine-learning_nuts-vs-bolts.py | Tester2009/SimpleCV | 7372a0c58eead9c3228315d65ae1903e4b8eb3f1 | [
"BSD-3-Clause"
] | 599 | 2015-01-10T17:37:08.000Z | 2022-03-28T05:31:51.000Z | '''
This Example uses scikits-learn to do a binary classfication of images
of nuts vs. bolts. Only the area, height, and width are used to classify
the actual images but data is extracted from the images using blobs.
This is a very crude example and could easily be built upon, but is just
meant to give an introductor... | 37.594595 | 107 | 0.734364 | '''
This Example uses scikits-learn to do a binary classfication of images
of nuts vs. bolts. Only the area, height, and width are used to classify
the actual images but data is extracted from the images using blobs.
This is a very crude example and could easily be built upon, but is just
meant to give an introductor... | false | true |
f70d0c76989d842e89dd7c04153f666c9c3b0653 | 27,804 | py | Python | test/test_propfile.py | sanjaymsh/javaproperties | 7ce3abfbbc4eadaa82f98e17542b6305679f87f3 | [
"MIT"
] | null | null | null | test/test_propfile.py | sanjaymsh/javaproperties | 7ce3abfbbc4eadaa82f98e17542b6305679f87f3 | [
"MIT"
] | null | null | null | test/test_propfile.py | sanjaymsh/javaproperties | 7ce3abfbbc4eadaa82f98e17542b6305679f87f3 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from collections import OrderedDict
from datetime import datetime
from dateutil.tz import tzstr
import pytest
from javaproperties import PropertiesFile, dumps
INPUT = '''\
# A comment before the timestamp
#Thu Mar 16 17:06:52 EDT 2017
# A comment after ... | 27.693227 | 80 | 0.57427 | from __future__ import unicode_literals
from collections import OrderedDict
from datetime import datetime
from dateutil.tz import tzstr
import pytest
from javaproperties import PropertiesFile, dumps
INPUT = '''\
# A comment before the timestamp
#Thu Mar 16 17:06:52 EDT 2017
# A comment after ... | true | true |
f70d0cf8a19e1031fd473f1044fe60fc3844f855 | 702 | py | Python | strawberry_django/legacy/fields.py | NeoLight1010/strawberry-graphql-django | 86d0dbb606a1dd0d96bb79a4cdd6902c6a515b2f | [
"MIT"
] | 18 | 2020-11-10T10:12:11.000Z | 2021-03-10T18:51:01.000Z | strawberry_django/legacy/fields.py | NeoLight1010/strawberry-graphql-django | 86d0dbb606a1dd0d96bb79a4cdd6902c6a515b2f | [
"MIT"
] | 8 | 2020-11-19T18:05:14.000Z | 2021-03-10T19:06:33.000Z | strawberry_django/legacy/fields.py | NeoLight1010/strawberry-graphql-django | 86d0dbb606a1dd0d96bb79a4cdd6902c6a515b2f | [
"MIT"
] | 2 | 2021-02-20T11:18:03.000Z | 2021-03-10T07:14:34.000Z | import strawberry
from typing import Callable, List, Optional, Dict
import dataclasses
from . import utils, queries
@dataclasses.dataclass
class DjangoField:
resolver: Callable
field_name: Optional[str]
kwargs: dict
def resolve(self, is_relation, is_m2m):
resolver = queries.resolvers.get_resol... | 27 | 102 | 0.732194 | import strawberry
from typing import Callable, List, Optional, Dict
import dataclasses
from . import utils, queries
@dataclasses.dataclass
class DjangoField:
resolver: Callable
field_name: Optional[str]
kwargs: dict
def resolve(self, is_relation, is_m2m):
resolver = queries.resolvers.get_resol... | true | true |
f70d0d5e8868450aeccff48e801b019caf6fde12 | 2,269 | py | Python | python/taichi/examples/simulation/nbody.py | kxxt/taichi | 15f39b79c258080f1e34fcbdc29646d9ced0a4fe | [
"MIT"
] | 11,699 | 2020-01-09T03:02:46.000Z | 2022-03-31T20:59:08.000Z | python/taichi/examples/simulation/nbody.py | kxxt/taichi | 15f39b79c258080f1e34fcbdc29646d9ced0a4fe | [
"MIT"
] | 3,589 | 2020-01-09T03:18:25.000Z | 2022-03-31T19:06:42.000Z | python/taichi/examples/simulation/nbody.py | kxxt/taichi | 15f39b79c258080f1e34fcbdc29646d9ced0a4fe | [
"MIT"
] | 1,391 | 2020-01-09T03:02:54.000Z | 2022-03-31T08:44:29.000Z | # Authored by Tiantian Liu, Taichi Graphics.
import math
import taichi as ti
ti.init(arch=ti.cpu)
# global control
paused = ti.field(ti.i32, ())
# gravitational constant 6.67408e-11, using 1 for simplicity
G = 1
# number of planets
N = 3000
# unit mass
m = 1
# galaxy size
galaxy_size = 0.4
# planet radius (for ren... | 22.029126 | 95 | 0.560599 | import math
import taichi as ti
ti.init(arch=ti.cpu)
paused = ti.field(ti.i32, ())
G = 1
N = 3000
m = 1
galaxy_size = 0.4
planet_radius = 2
init_vel = 120
h = 1e-4
substepping = 10
center = ti.Vector.field(2, ti.f32, ())
pos = ti.Vector.field(2, ti.f32, N)
vel = ti.Vector.field(2, ti.f32, N)
force = ti.Vector.f... | true | true |
f70d0dabe8189868adf5861082229d9ea56c7b56 | 244 | py | Python | test/nn/functional/test_gini.py | Kenneth-Schroeder/pytorch_geometric | f7ec9e964bfae1ce5fb21d9b2b30e9e717bf8e24 | [
"MIT"
] | 12,651 | 2017-10-28T15:14:24.000Z | 2021-09-12T07:22:57.000Z | test/nn/functional/test_gini.py | Kenneth-Schroeder/pytorch_geometric | f7ec9e964bfae1ce5fb21d9b2b30e9e717bf8e24 | [
"MIT"
] | 2,472 | 2017-10-30T23:38:47.000Z | 2021-09-12T06:41:44.000Z | test/nn/functional/test_gini.py | Kenneth-Schroeder/pytorch_geometric | f7ec9e964bfae1ce5fb21d9b2b30e9e717bf8e24 | [
"MIT"
] | 2,363 | 2017-12-01T13:25:05.000Z | 2021-09-12T07:23:09.000Z | import torch
from torch_geometric.nn.functional import gini
def test_gini():
w = torch.tensor(
[
[0., 0., 0., 0.],
[0., 0., 0., 1000.0]
]
)
assert torch.isclose(gini(w), torch.tensor(0.5))
| 17.428571 | 52 | 0.508197 | import torch
from torch_geometric.nn.functional import gini
def test_gini():
w = torch.tensor(
[
[0., 0., 0., 0.],
[0., 0., 0., 1000.0]
]
)
assert torch.isclose(gini(w), torch.tensor(0.5))
| true | true |
f70d0ddd8f3447593ce4b8a64c92d221d2d96906 | 785 | py | Python | setup.py | bjornorri/pysaltbox | 66f5baf37d08137de7719d6a81963433030a1592 | [
"MIT"
] | 1 | 2022-01-23T00:38:52.000Z | 2022-01-23T00:38:52.000Z | setup.py | bjornorri/pysaltbox | 66f5baf37d08137de7719d6a81963433030a1592 | [
"MIT"
] | 7 | 2020-07-29T14:26:28.000Z | 2021-06-02T00:53:20.000Z | setup.py | bjornorri/pysaltbox | 66f5baf37d08137de7719d6a81963433030a1592 | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
REQUIREMENTS = [i.strip() for i in open("requirements.txt").readlines()]
setuptools.setup(
name="saltbox",
version="0.1.3",
author="Björn Orri Saemundsson",
author_email="bjornorri@gmail.com",
description="Inter... | 30.192308 | 72 | 0.678981 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
REQUIREMENTS = [i.strip() for i in open("requirements.txt").readlines()]
setuptools.setup(
name="saltbox",
version="0.1.3",
author="Björn Orri Saemundsson",
author_email="bjornorri@gmail.com",
description="Inter... | true | true |
f70d0fe0c3177d3a19ca283010a188bbd0e54cf0 | 2,392 | py | Python | jwtdecoder.py | tanupoo/jwtdecoder | d6f5cc50d476b26f694f5898dff7af40c985663b | [
"MIT"
] | null | null | null | jwtdecoder.py | tanupoo/jwtdecoder | d6f5cc50d476b26f694f5898dff7af40c985663b | [
"MIT"
] | null | null | null | jwtdecoder.py | tanupoo/jwtdecoder | d6f5cc50d476b26f694f5898dff7af40c985663b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
import base64
def jwt_base64url_decode(s: str) -> str:
return base64.urlsafe_b64decode(s + '='*(-len(s)%4))
def jwt_decode(jwt_str: str, pos: int=None,
hex_sig: bool=False, verbose: bool=False) -> str:
def _decode(s: str, pos: int) -> str:
r = jwt_base6... | 37.375 | 75 | 0.550585 |
import sys
import base64
def jwt_base64url_decode(s: str) -> str:
return base64.urlsafe_b64decode(s + '='*(-len(s)%4))
def jwt_decode(jwt_str: str, pos: int=None,
hex_sig: bool=False, verbose: bool=False) -> str:
def _decode(s: str, pos: int) -> str:
r = jwt_base64url_decode(s)
... | true | true |
f70d1088353fffd2d2b72bddff33f57857d579ad | 411 | py | Python | groupproperties.py | rolef/PyHomework | 1b060fc068daa9b1bc899988ff98397a3190bf16 | [
"Apache-2.0"
] | null | null | null | groupproperties.py | rolef/PyHomework | 1b060fc068daa9b1bc899988ff98397a3190bf16 | [
"Apache-2.0"
] | null | null | null | groupproperties.py | rolef/PyHomework | 1b060fc068daa9b1bc899988ff98397a3190bf16 | [
"Apache-2.0"
] | null | null | null | __author__ = 'Pavel Ageyev'
class Groups:
def __init__(self, name , header, footer):
self.name=name
self.header=header
self.footer=footer
class Formfields:
def __init__(self, firstName, lastName, companyName, email, mobile):
self.firstName=firstName
self.lastName=lastNa... | 29.357143 | 73 | 0.666667 | __author__ = 'Pavel Ageyev'
class Groups:
def __init__(self, name , header, footer):
self.name=name
self.header=header
self.footer=footer
class Formfields:
def __init__(self, firstName, lastName, companyName, email, mobile):
self.firstName=firstName
self.lastName=lastNa... | true | true |
f70d10aa996f58fba8f31f1e1789dc71c218952e | 276 | py | Python | fleet/fleet_manager/hooks/doc_hooks.py | Eddiy/fleet-manager | ec0f86f838bf48e311f8e43446cc946caaa96003 | [
"MIT"
] | null | null | null | fleet/fleet_manager/hooks/doc_hooks.py | Eddiy/fleet-manager | ec0f86f838bf48e311f8e43446cc946caaa96003 | [
"MIT"
] | null | null | null | fleet/fleet_manager/hooks/doc_hooks.py | Eddiy/fleet-manager | ec0f86f838bf48e311f8e43446cc946caaa96003 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import nowdate
def update_last(doc, method):
frappe.db.sql("""update `tabVehicle Income` set age='old' where vehicle=%s
and age=%s""", (doc.vehicle, doc.age))
| 19.714286 | 79 | 0.702899 | from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import nowdate
def update_last(doc, method):
frappe.db.sql("""update `tabVehicle Income` set age='old' where vehicle=%s
and age=%s""", (doc.vehicle, doc.age))
| true | true |
f70d10ed02d2dc2a9b685b42672b360dd66cae49 | 268 | py | Python | pypalo/__init__.py | dstogsdill/pypalo | a619ffdd27832c52a8e6fbdd35f310b50cfe853b | [
"MIT"
] | null | null | null | pypalo/__init__.py | dstogsdill/pypalo | a619ffdd27832c52a8e6fbdd35f310b50cfe853b | [
"MIT"
] | 1 | 2019-04-02T19:14:05.000Z | 2019-04-02T19:14:05.000Z | pypalo/__init__.py | dstogsdill/pypalo | a619ffdd27832c52a8e6fbdd35f310b50cfe853b | [
"MIT"
] | null | null | null | __author__ = 'dstogsdill'
_name_ = 'pypalo'
"""A Python library for interacting with Palo Alto devices"""
#: Version info (major, minor, maintenance, status)
VERSION = (0, 0, 7)
__version__ = '%d.%d.%d' % VERSION[0:3]
from .pan import Panorama
__all__ = [Panorama]
| 22.333333 | 61 | 0.69403 | __author__ = 'dstogsdill'
_name_ = 'pypalo'
VERSION = (0, 0, 7)
__version__ = '%d.%d.%d' % VERSION[0:3]
from .pan import Panorama
__all__ = [Panorama]
| true | true |
f70d11087ad379970bb271c58c2ffc31fe279bd7 | 8,815 | py | Python | Tensorflow-JSON.py | BoyDun/tensorflow-tensorrt | 6fa64812fbbc441f59e4c68f174f8c835cac7d05 | [
"MIT"
] | 29 | 2017-09-13T14:46:23.000Z | 2019-02-13T07:42:13.000Z | Tensorflow-JSON.py | bo-dun/tensorflow-tensorrt | 6fa64812fbbc441f59e4c68f174f8c835cac7d05 | [
"MIT"
] | 1 | 2018-02-07T12:32:39.000Z | 2018-02-11T17:54:48.000Z | Tensorflow-JSON.py | BoyDun/tensorflow-tensorrt | 6fa64812fbbc441f59e4c68f174f8c835cac7d05 | [
"MIT"
] | null | null | null | import numpy as np
import json
prefixes = ['softmax', 'fc', 'conv', 'max_pool', 'avg_pool', 'relu'] # TODO: ADD CONCAT
# Validate that every dictionary key is the name of a valid layer format
def validate_prefixes(names):
for name in names:
index = name.rfind('/')
if index != -1: section = name[... | 44.746193 | 135 | 0.573227 | import numpy as np
import json
prefixes = ['softmax', 'fc', 'conv', 'max_pool', 'avg_pool', 'relu']
def validate_prefixes(names):
for name in names:
index = name.rfind('/')
if index != -1: section = name[index + 1:]
else: section = name
hasPrefix = False
for prefix in pre... | true | true |
f70d123551237e50dd4aa94cfab19ef116879530 | 44 | py | Python | tests/__init__.py | laurent-radoux/multi_notifier | 0cd127e56a5e7de19957793da61b9279a2b2edae | [
"MIT"
] | null | null | null | tests/__init__.py | laurent-radoux/multi_notifier | 0cd127e56a5e7de19957793da61b9279a2b2edae | [
"MIT"
] | null | null | null | tests/__init__.py | laurent-radoux/multi_notifier | 0cd127e56a5e7de19957793da61b9279a2b2edae | [
"MIT"
] | null | null | null | """Unit test package for multi_notifier."""
| 22 | 43 | 0.727273 | true | true | |
f70d12379b7852ad85df4c1c3ee03a0f53aa692f | 59 | py | Python | glitter/blocks/form/__init__.py | dhamaniasad/django-glitter | b9b0a3d8b49d5d9b840656f84564ba0a6e016f98 | [
"BSD-3-Clause"
] | 3 | 2017-06-01T16:22:18.000Z | 2018-08-22T21:45:55.000Z | glitter/blocks/form/__init__.py | blancltd/django-glitter | b9b0a3d8b49d5d9b840656f84564ba0a6e016f98 | [
"BSD-3-Clause"
] | 85 | 2016-02-25T10:34:03.000Z | 2017-04-03T11:07:59.000Z | glitter/blocks/form/__init__.py | blancltd/django-glitter | b9b0a3d8b49d5d9b840656f84564ba0a6e016f98 | [
"BSD-3-Clause"
] | 1 | 2016-08-02T08:21:19.000Z | 2016-08-02T08:21:19.000Z | default_app_config = 'glitter.blocks.form.apps.FormConfig'
| 29.5 | 58 | 0.830508 | default_app_config = 'glitter.blocks.form.apps.FormConfig'
| true | true |
f70d13ae80358da01a2356a445e8527f94e9b1f3 | 3,055 | py | Python | utest/htmldata/test_jsonwriter.py | ldtri0209/robotframework | 6bc11a350cbaf5d0801cc5431f32cc1435bb65df | [
"ECL-2.0",
"Apache-2.0"
] | 4 | 2016-01-13T13:48:28.000Z | 2021-09-05T07:14:07.000Z | utest/htmldata/test_jsonwriter.py | ldtri0209/robotframework | 6bc11a350cbaf5d0801cc5431f32cc1435bb65df | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | utest/htmldata/test_jsonwriter.py | ldtri0209/robotframework | 6bc11a350cbaf5d0801cc5431f32cc1435bb65df | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2018-01-18T22:00:17.000Z | 2018-07-26T10:53:00.000Z | from StringIO import StringIO
try:
import json
except ImportError:
try:
import simplejson as json
except ImportError:
json = None
import unittest
from robot.utils.asserts import assert_equals, assert_raises
from robot.htmldata.jsonwriter import JsonDumper
class TestJsonDumper(unittest.Tes... | 31.822917 | 80 | 0.547954 | from StringIO import StringIO
try:
import json
except ImportError:
try:
import simplejson as json
except ImportError:
json = None
import unittest
from robot.utils.asserts import assert_equals, assert_raises
from robot.htmldata.jsonwriter import JsonDumper
class TestJsonDumper(unittest.Tes... | false | true |
f70d1500c780976161e9e248950167af3ce1d188 | 3,134 | bzl | Python | workspace_definitions.bzl | slsyy/rules_foreign_cc | 34ab7f86a3ab1b2381cb4820d08a1c892f55bf54 | [
"Apache-2.0"
] | null | null | null | workspace_definitions.bzl | slsyy/rules_foreign_cc | 34ab7f86a3ab1b2381cb4820d08a1c892f55bf54 | [
"Apache-2.0"
] | null | null | null | workspace_definitions.bzl | slsyy/rules_foreign_cc | 34ab7f86a3ab1b2381cb4820d08a1c892f55bf54 | [
"Apache-2.0"
] | null | null | null | """A module for defining WORKSPACE dependencies required for rules_foreign_cc"""
load("//for_workspace:repositories.bzl", "repositories")
load("//toolchains:toolchains.bzl", "prebuilt_toolchains", "preinstalled_toolchains")
load(
"//tools/build_defs/shell_toolchain/toolchains:ws_defs.bzl",
shell_toolchain_work... | 47.484848 | 109 | 0.738354 |
load("//for_workspace:repositories.bzl", "repositories")
load("//toolchains:toolchains.bzl", "prebuilt_toolchains", "preinstalled_toolchains")
load(
"//tools/build_defs/shell_toolchain/toolchains:ws_defs.bzl",
shell_toolchain_workspace_initalization = "workspace_part",
)
def rules_foreign_cc_dependencies(
... | true | true |
f70d1800313425df871eba257f7f1f7a11aae413 | 767 | py | Python | partners/migrations/0003_auto_20180915_2336.py | vaishnavisuguru/uno-cpi | 6f69b374bf38f53b7a1d98cec3bcb976659b1512 | [
"MIT"
] | null | null | null | partners/migrations/0003_auto_20180915_2336.py | vaishnavisuguru/uno-cpi | 6f69b374bf38f53b7a1d98cec3bcb976659b1512 | [
"MIT"
] | null | null | null | partners/migrations/0003_auto_20180915_2336.py | vaishnavisuguru/uno-cpi | 6f69b374bf38f53b7a1d98cec3bcb976659b1512 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.1 on 2018-09-16 04:36
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('partners', '0002_auto_20180915_2328'),
]
operations = [
migrations.AlterField(
model_name='communitypartner',
name='... | 26.448276 | 62 | 0.590613 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('partners', '0002_auto_20180915_2328'),
]
operations = [
migrations.AlterField(
model_name='communitypartner',
name='college',
field=models.CharField(bla... | true | true |
f70d186b7ecaa0ab9ceabfa37e7a8b267a0f6812 | 146,404 | py | Python | sdk/python/pulumi_azure_native/machinelearningservices/v20210101/_inputs.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/machinelearningservices/v20210101/_inputs.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/machinelearningservices/v20210101/_inputs.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 39.377084 | 567 | 0.656102 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from ._enums import *
__all__ = [
'AKSArgs',
'AKSPropertiesArgs',
'AksNetworkingConfigurationArgs',
'AmlComputeArgs',
'AmlComputePropertiesArgs',
... | true | true |
f70d197b3d640b751f10dbd1ab2f1bcea6e72bf4 | 1,124 | py | Python | metrics.py | ian-ludden/redist-vis | cdbde9184dedce04fef3dc1809a8e4030de131fa | [
"MIT"
] | 1 | 2022-01-31T20:33:00.000Z | 2022-01-31T20:33:00.000Z | metrics.py | skyien-z/redist-vis | af8cae8e849b04aa4409a82e11cf5da831d5934b | [
"MIT"
] | null | null | null | metrics.py | skyien-z/redist-vis | af8cae8e849b04aa4409a82e11cf5da831d5934b | [
"MIT"
] | null | null | null | import pandas as pd
import geopandas
import json
import altair as alt
def make_metrics_df():
GEOJSON = 'geojson/wi_map_plan_{}.geojson'
mm_gaps = []
sl_indices = []
efficiency_gaps = []
plan_number = [i for i in range(1,84)]
for i in range(1,84):
plan = geopandas.read_file(GEOJSON.forma... | 37.466667 | 118 | 0.681495 | import pandas as pd
import geopandas
import json
import altair as alt
def make_metrics_df():
GEOJSON = 'geojson/wi_map_plan_{}.geojson'
mm_gaps = []
sl_indices = []
efficiency_gaps = []
plan_number = [i for i in range(1,84)]
for i in range(1,84):
plan = geopandas.read_file(GEOJSON.forma... | true | true |
f70d1a32839eaa12fd7c839e7832ab3d87e76f0d | 1,793 | py | Python | ml_python/env/Lib/site-packages/pip/_internal/commands/hash.py | ArchibaldChain/python-workspace | 71890f296c376155e374b2096ac3d8f1d286b7d2 | [
"MIT"
] | null | null | null | ml_python/env/Lib/site-packages/pip/_internal/commands/hash.py | ArchibaldChain/python-workspace | 71890f296c376155e374b2096ac3d8f1d286b7d2 | [
"MIT"
] | 3 | 2020-06-17T16:01:27.000Z | 2022-01-13T02:52:53.000Z | ml_python/env/Lib/site-packages/pip/_internal/commands/hash.py | ArchibaldChain/python-workspace | 71890f296c376155e374b2096ac3d8f1d286b7d2 | [
"MIT"
] | null | null | null | # The following comment should be removed at some point in the future.
# mypy: disallow-untyped-defs=False
from __future__ import absolute_import
import hashlib
import logging
import sys
from pip._internal.cli.base_command import Command
from pip._internal.cli.status_codes import ERROR
from pip._internal.... | 30.389831 | 74 | 0.623536 |
from __future__ import absolute_import
import hashlib
import logging
import sys
from pip._internal.cli.base_command import Command
from pip._internal.cli.status_codes import ERROR
from pip._internal.utils.hashes import FAVORITE_HASH, STRONG_HASHES
from pip._internal.utils.misc import read_chunks, write_out... | true | true |
f70d1a7d0d2f38408f7f314a7dc5338d08924800 | 471 | py | Python | gram/migrations/0012_auto_20181008_1832.py | Ras-Kwesi/photogram | c35334157104caec9bd88be820cc7e9d056b2c93 | [
"Unlicense"
] | null | null | null | gram/migrations/0012_auto_20181008_1832.py | Ras-Kwesi/photogram | c35334157104caec9bd88be820cc7e9d056b2c93 | [
"Unlicense"
] | null | null | null | gram/migrations/0012_auto_20181008_1832.py | Ras-Kwesi/photogram | c35334157104caec9bd88be820cc7e9d056b2c93 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-10-08 15:32
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('gram', '0011_auto_20181008_1505'),
]
operations = [
migrations.AlterField(
... | 22.428571 | 70 | 0.622081 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('gram', '0011_auto_20181008_1505'),
]
operations = [
migrations.AlterField(
model_name='profile',
name='profilepic',
... | true | true |
f70d1d8f1773a6a94c07b1b5735441fec456b1d2 | 1,840 | py | Python | tests/endtoend/dependency_functions/report_dependencies/__init__.py | anandagopal6/azure-functions-python-worker | e4adb351e5454c093fcefbf0fb84f200af32f386 | [
"MIT"
] | 277 | 2018-01-25T23:13:03.000Z | 2022-02-22T06:12:04.000Z | tests/endtoend/dependency_functions/report_dependencies/__init__.py | anandagopal6/azure-functions-python-worker | e4adb351e5454c093fcefbf0fb84f200af32f386 | [
"MIT"
] | 731 | 2018-01-18T18:54:38.000Z | 2022-03-29T00:01:46.000Z | tests/endtoend/dependency_functions/report_dependencies/__init__.py | anandagopal6/azure-functions-python-worker | e4adb351e5454c093fcefbf0fb84f200af32f386 | [
"MIT"
] | 109 | 2018-01-18T02:22:57.000Z | 2022-02-15T18:59:54.000Z | import sys
import os
import json
import azure.functions as func
import google.protobuf as proto
import grpc
# Load dependency manager from customer' context
from azure_functions_worker.utils.dependency import DependencyManager as dm
def main(req: func.HttpRequest) -> func.HttpResponse:
"""This function is an Htt... | 35.384615 | 78 | 0.633152 | import sys
import os
import json
import azure.functions as func
import google.protobuf as proto
import grpc
from azure_functions_worker.utils.dependency import DependencyManager as dm
def main(req: func.HttpRequest) -> func.HttpResponse:
result = {
"sys.path": list(sys.path),
"dependency_manager"... | true | true |
f70d1dd74df68cfff70613d5c9332df4742e45d0 | 883 | py | Python | sampledb/models/migrations/__init__.py | nilsholle/sampledb | 90d7487a3990995ca2ec5dfd8b59d4739d6a9a87 | [
"MIT"
] | 5 | 2020-02-13T15:25:37.000Z | 2021-05-06T21:05:14.000Z | sampledb/models/migrations/__init__.py | nilsholle/sampledb | 90d7487a3990995ca2ec5dfd8b59d4739d6a9a87 | [
"MIT"
] | 28 | 2019-11-12T14:14:08.000Z | 2022-03-11T16:29:27.000Z | sampledb/models/migrations/__init__.py | nilsholle/sampledb | 90d7487a3990995ca2ec5dfd8b59d4739d6a9a87 | [
"MIT"
] | 8 | 2019-12-10T15:46:02.000Z | 2021-11-02T12:24:52.000Z | # coding: utf-8
"""
"""
import logging
from .utils import find_migrations, should_skip_by_index, update_migration_index
def run(db):
logger = logging.getLogger('sampledb.migrations')
for index, name, function in find_migrations():
logger.info('Migration #{} "{}":'.format(index, name))
# Sk... | 25.970588 | 82 | 0.583239 |
import logging
from .utils import find_migrations, should_skip_by_index, update_migration_index
def run(db):
logger = logging.getLogger('sampledb.migrations')
for index, name, function in find_migrations():
logger.info('Migration #{} "{}":'.format(index, name))
if should_skip_by_ind... | true | true |
f70d1e1af8a8552dda0dfaca70c6c2da664f8170 | 5,365 | py | Python | src/pinyin3.py | sanbeichahegongheguo/pinyinwork | eb32244db90a549aa03866e892ab7507ca49f0df | [
"MIT"
] | 11 | 2020-03-27T14:45:10.000Z | 2021-07-06T08:09:29.000Z | src/pinyin3.py | sanbeichahegongheguo/pinyinwork | eb32244db90a549aa03866e892ab7507ca49f0df | [
"MIT"
] | null | null | null | src/pinyin3.py | sanbeichahegongheguo/pinyinwork | eb32244db90a549aa03866e892ab7507ca49f0df | [
"MIT"
] | null | null | null | import sys, fileinput, json
import numpy as np
fir_p = {} # 某字符出现在句首的概率对数 {str: float}
dou_count = {} # 字符的二元出现次数 {(str, str): int}
tri_count = {} # 字符的三元出现次数 {str: {str: {str: int}}}
sin_count = {} # 字符出现计数 {str: int}
pch = {} # 拼音到字符的dict {pinyin: [chs]}
sin_total = 396468407
def preload3():
def add3(dic... | 27.797927 | 104 | 0.503821 | import sys, fileinput, json
import numpy as np
fir_p = {} dou_count = {} tri_count = {} sin_count = {} pch = {} sin_total = 396468407
def preload3():
def add3(dict, ch1, ch2, ch3):
if ch1 in dict:
d2 = dict[ch1]
if ch2 in d2:
d3 = d2[ch2]
if c... | true | true |
f70d1eed6380a5a93562d52f1f55f9fd27b1619e | 30,223 | py | Python | test/functional/rpc_rawtransaction.py | bizzy401/BazCoin | a8868b45533a7d0d8bd2fbec71a5b2c92517bacd | [
"MIT"
] | null | null | null | test/functional/rpc_rawtransaction.py | bizzy401/BazCoin | a8868b45533a7d0d8bd2fbec71a5b2c92517bacd | [
"MIT"
] | null | null | null | test/functional/rpc_rawtransaction.py | bizzy401/BazCoin | a8868b45533a7d0d8bd2fbec71a5b2c92517bacd | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the rawtransaction RPCs.
Test the following RPCs:
- createrawtransaction
- signrawtransacti... | 58.685437 | 601 | 0.654932 |
from collections import OrderedDict
from decimal import Decimal
from io import BytesIO
from test_framework.messages import CTransaction, ToHex
from test_framework.test_framework import BazCoinTestFramework
from test_framework.util import (
assert_equal,
assert_raises_rpc_error,
find_vout_for_address,
h... | true | true |
f70d1f4b6065620a69c022721898472f000c0061 | 1,709 | py | Python | app/core/migrations/0001_initial.py | mohit4/recipe-app-api | 9bda7d5edd9e1d45fba0e174c7c0c46072dfe6de | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | mohit4/recipe-app-api | 9bda7d5edd9e1d45fba0e174c7c0c46072dfe6de | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | mohit4/recipe-app-api | 9bda7d5edd9e1d45fba0e174c7c0c46072dfe6de | [
"MIT"
] | null | null | null | # Generated by Django 2.1.15 on 2020-12-12 13:14
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0009_alter_user_last_name_max_length'),
]
operations = [
migrations.CreateModel(
name='User',
... | 50.264706 | 266 | 0.63897 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0009_alter_user_last_name_max_length'),
]
operations = [
migrations.CreateModel(
name='User',
fields=[
('id', models.Aut... | true | true |
f70d1faf66a1b3cb16f7b58da7a7e24e551afabc | 4,621 | py | Python | btcgreen/wallet/wallet_action_store.py | grayfallstown/btcgreen-blockchain | 9a1b8ed604ee7b3b01dff08076ec03f1e22924d5 | [
"Apache-2.0"
] | 19 | 2021-08-09T21:21:09.000Z | 2022-03-18T02:27:13.000Z | btcgreen/wallet/wallet_action_store.py | grayfallstown/btcgreen-blockchain | 9a1b8ed604ee7b3b01dff08076ec03f1e22924d5 | [
"Apache-2.0"
] | 29 | 2021-08-13T12:05:09.000Z | 2022-03-20T19:30:36.000Z | btcgreen/wallet/wallet_action_store.py | grayfallstown/btcgreen-blockchain | 9a1b8ed604ee7b3b01dff08076ec03f1e22924d5 | [
"Apache-2.0"
] | 4 | 2021-08-18T16:42:30.000Z | 2022-03-15T08:24:58.000Z | from typing import List, Optional
import aiosqlite
from btcgreen.util.db_wrapper import DBWrapper
from btcgreen.util.ints import uint32
from btcgreen.wallet.util.wallet_types import WalletType
from btcgreen.wallet.wallet_action import WalletAction
class WalletActionStore:
"""
WalletActionStore keeps track o... | 32.77305 | 111 | 0.580394 | from typing import List, Optional
import aiosqlite
from btcgreen.util.db_wrapper import DBWrapper
from btcgreen.util.ints import uint32
from btcgreen.wallet.util.wallet_types import WalletType
from btcgreen.wallet.wallet_action import WalletAction
class WalletActionStore:
db_connection: aiosqlite.Connection
... | true | true |
f70d1fafba3c6cce2cecbf9aaf97911c3f73f461 | 3,851 | py | Python | pogo/pogoBot/pogoAPI/location.py | cqian19/PokeGo-Idle | d6c58b5466f2f3633b69c322e1d9d0e9d6a09554 | [
"MIT"
] | 1 | 2017-04-09T18:00:11.000Z | 2017-04-09T18:00:11.000Z | pogo/pogoBot/pogoAPI/location.py | cqian19/PokeGo-Idle | d6c58b5466f2f3633b69c322e1d9d0e9d6a09554 | [
"MIT"
] | 3 | 2016-08-12T07:39:29.000Z | 2016-08-23T23:46:11.000Z | pogo/pogoBot/pogoAPI/location.py | cqian19/PokeGo-Idle | d6c58b5466f2f3633b69c322e1d9d0e9d6a09554 | [
"MIT"
] | 1 | 2016-08-26T10:29:32.000Z | 2016-08-26T10:29:32.000Z | import math
import random
import geocoder
import gpxpy.geo
from geopy import Point, distance
from s2sphere import CellId, LatLng
from .custom_exceptions import GeneralPogoException
from .util import is_float
DEFAULT_RADIUS = 70
# Wrapper for location
class Location(object):
def __init__(self, locationLookup, geo_k... | 37.38835 | 100 | 0.617502 | import math
import random
import geocoder
import gpxpy.geo
from geopy import Point, distance
from s2sphere import CellId, LatLng
from .custom_exceptions import GeneralPogoException
from .util import is_float
DEFAULT_RADIUS = 70
class Location(object):
def __init__(self, locationLookup, geo_key, api):
self.... | true | true |
f70d2057f7012f12f20eb37c983731b6358a6a6e | 1,827 | py | Python | run-a-test-generation.py | topic2k/pygcgen | 16aa7d8d11560eb5f6bb48ccfe15d7d8cf4c0f85 | [
"MIT"
] | 2 | 2018-05-02T02:49:06.000Z | 2018-12-15T08:16:15.000Z | run-a-test-generation.py | topic2k/pygcgen | 16aa7d8d11560eb5f6bb48ccfe15d7d8cf4c0f85 | [
"MIT"
] | 46 | 2016-08-11T19:17:04.000Z | 2022-02-01T19:16:10.000Z | run-a-test-generation.py | topic2k/pygcgen | 16aa7d8d11560eb5f6bb48ccfe15d7d8cf4c0f85 | [
"MIT"
] | 2 | 2016-11-16T19:26:04.000Z | 2017-04-20T08:32:58.000Z | # -*- coding: utf-8 -*-
from __future__ import print_function
import os
from pygcgen import ChangelogGenerator
base_options = [
"--quiet",
# "-h",
# "-v",
# "-vv", # or "-v", "-v",
# "-vvv",
# "--options-file", ".pygcgen_example",
# "-u", "topic2k",
# "-p", "pygcgen",
# '-s', "*... | 30.45 | 74 | 0.481664 |
from __future__ import print_function
import os
from pygcgen import ChangelogGenerator
base_options = [
"--quiet",
]
on_travis = os.environ.get('TRAVIS', 'false') == 'true'
if not on_travis:
ChangelogGenerator(base_options + ["-v"]... | true | true |
f70d20ba48e12a76b3054391f15ddc7f18345b8d | 2,853 | py | Python | train.py | anikett12/fully-customisable-neural-network | b3174f0aa1a47460367de9058c6c0f92dc3dbc8f | [
"MIT"
] | null | null | null | train.py | anikett12/fully-customisable-neural-network | b3174f0aa1a47460367de9058c6c0f92dc3dbc8f | [
"MIT"
] | null | null | null | train.py | anikett12/fully-customisable-neural-network | b3174f0aa1a47460367de9058c6c0f92dc3dbc8f | [
"MIT"
] | 1 | 2018-10-31T15:50:40.000Z | 2018-10-31T15:50:40.000Z | import numpy as np
import pandas as pd
def tanhderiv(K):
"""
used to calculate the derivative of tanh function.
"""
return 1- (np.tanh(K)**2)
def initialisetheta(m,n,nodes,yn):
"""
used to randomly initialise the weights matrix and store it in the
form of a list. Note that the bias term has been directly a... | 24.384615 | 108 | 0.591658 | import numpy as np
import pandas as pd
def tanhderiv(K):
"""
used to calculate the derivative of tanh function.
"""
return 1- (np.tanh(K)**2)
def initialisetheta(m,n,nodes,yn):
"""
used to randomly initialise the weights matrix and store it in the
form of a list. Note that the bias term has been directly a... | false | true |
f70d215126f6fccae990f94d290db94d89f3ab34 | 88,036 | py | Python | sklearn/linear_model/_logistic.py | AnkitKumar2698/scikit-learn | 589329e5130de48b4a88b707213cf92a3112e236 | [
"BSD-3-Clause"
] | 2 | 2017-11-22T08:20:15.000Z | 2017-11-22T08:23:14.000Z | sklearn/linear_model/_logistic.py | AnkitKumar2698/scikit-learn | 589329e5130de48b4a88b707213cf92a3112e236 | [
"BSD-3-Clause"
] | 1 | 2022-03-06T15:13:18.000Z | 2022-03-06T15:13:18.000Z | sklearn/linear_model/_logistic.py | AnkitKumar2698/scikit-learn | 589329e5130de48b4a88b707213cf92a3112e236 | [
"BSD-3-Clause"
] | null | null | null | """
Logistic Regression
"""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Fabian Pedregosa <f@bianp.net>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Manoj Kumar <manojkumarsivaraj334@gmail.com>
# Lars Buitinck
# Simon Wu <s8wu@uwaterloo.ca>
# ... | 36.788968 | 96 | 0.594859 |
import numbers
import warnings
import numpy as np
from scipy import optimize, sparse
from scipy.special import expit, logsumexp
from joblib import Parallel, effective_n_jobs
from ._base import LinearClassifierMixin, SparseCoefMixin, BaseEstimator
from ._sag import sag_solver
from ..preprocessing import LabelEncoder... | true | true |
f70d21fbda69e22a015896f402253a0c56ff2ddd | 552 | py | Python | society_bureau/migrations/0003_auto_20190209_1520.py | JeekStudio/StudentPlatform | d2cccef6555a7c9d137ecab54dbbd4aa219be57b | [
"MIT"
] | 4 | 2019-02-23T13:34:48.000Z | 2019-04-09T12:44:19.000Z | society_bureau/migrations/0003_auto_20190209_1520.py | JeekStudio/StudentPlatform | d2cccef6555a7c9d137ecab54dbbd4aa219be57b | [
"MIT"
] | 134 | 2019-01-29T03:49:54.000Z | 2021-04-08T18:44:57.000Z | society_bureau/migrations/0003_auto_20190209_1520.py | JeekStudio/StudentPlatform | d2cccef6555a7c9d137ecab54dbbd4aa219be57b | [
"MIT"
] | null | null | null | # Generated by Django 2.1.4 on 2019-02-09 15:20
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('society_bureau', '0002_sitesettings'),
]
operations = [
migrations.AlterFi... | 26.285714 | 144 | 0.677536 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('society_bureau', '0002_sitesettings'),
]
operations = [
migrations.AlterField(
model_name='societybureau',
... | true | true |
f70d2203420c72a8f92ba670ec470903b6c03140 | 829 | py | Python | python_modules/libraries/dagster-airflow/dagster_airflow/operators/python_operator.py | dbatten5/dagster | d76e50295054ffe5a72f9b292ef57febae499528 | [
"Apache-2.0"
] | 4,606 | 2018-06-21T17:45:20.000Z | 2022-03-31T23:39:42.000Z | python_modules/libraries/dagster-airflow/dagster_airflow/operators/python_operator.py | dbatten5/dagster | d76e50295054ffe5a72f9b292ef57febae499528 | [
"Apache-2.0"
] | 6,221 | 2018-06-12T04:36:01.000Z | 2022-03-31T21:43:05.000Z | python_modules/libraries/dagster-airflow/dagster_airflow/operators/python_operator.py | dbatten5/dagster | d76e50295054ffe5a72f9b292ef57febae499528 | [
"Apache-2.0"
] | 619 | 2018-08-22T22:43:09.000Z | 2022-03-31T22:48:06.000Z | """The dagster-airflow operators."""
from dagster_airflow.operators.util import invoke_steps_within_python_operator
from dagster_airflow.vendor.python_operator import PythonOperator
class DagsterPythonOperator(PythonOperator):
def __init__(self, dagster_operator_parameters, *args, **kwargs):
def python_ca... | 39.47619 | 86 | 0.699638 | from dagster_airflow.operators.util import invoke_steps_within_python_operator
from dagster_airflow.vendor.python_operator import PythonOperator
class DagsterPythonOperator(PythonOperator):
def __init__(self, dagster_operator_parameters, *args, **kwargs):
def python_callable(ts, dag_run, **kwargs): ... | true | true |
f70d2269439119cb16be737012dc189740de1235 | 19,878 | py | Python | networkx/generators/community.py | jeanfrancois8512/networkx | 1d5e2183f514a847db63ce0cb78979a3cf7263bb | [
"BSD-3-Clause"
] | null | null | null | networkx/generators/community.py | jeanfrancois8512/networkx | 1d5e2183f514a847db63ce0cb78979a3cf7263bb | [
"BSD-3-Clause"
] | null | null | null | networkx/generators/community.py | jeanfrancois8512/networkx | 1d5e2183f514a847db63ce0cb78979a3cf7263bb | [
"BSD-3-Clause"
] | null | null | null | # Copyright(C) 2011, 2015, 2018 by
# Ben Edwards <bedwards@cs.unm.edu>
# Aric Hagberg <hagberg@lanl.gov>
# Konstantinos Karakatsanis <dinoskarakas@gmail.com>
# All rights reserved.
# BSD license.
#
# Authors: Ben Edwards (bedwards@cs.unm.edu)
# Aric Hagberg (hagberg@lanl.gov)
# Ko... | 31.107981 | 79 | 0.597495 | from __future__ import division
import itertools
import math
import networkx as nx
from networkx.utils import py_random_state
__all__ = ['caveman_graph', 'connected_caveman_graph',
'relaxed_caveman_graph', 'random_partition_graph',
'planted_partition_graph', 'gaussian_random_partition_graph',
... | true | true |
f70d22df71e4dc68332cf98ab18c6c43edd32105 | 779 | py | Python | tests/test_length.py | shoz/ProtLearn | 2c6edac2c3cfdc4aeeb2b55bb3cb5e4407e2065e | [
"MIT"
] | 1 | 2020-03-17T16:44:16.000Z | 2020-03-17T16:44:16.000Z | tests/test_length.py | shoz/ProtLearn | 2c6edac2c3cfdc4aeeb2b55bb3cb5e4407e2065e | [
"MIT"
] | null | null | null | tests/test_length.py | shoz/ProtLearn | 2c6edac2c3cfdc4aeeb2b55bb3cb5e4407e2065e | [
"MIT"
] | null | null | null | import os
import sys
path = os.environ.get('TRAVIS_BUILD_DIR')
sys.path.insert(0, path+'/protlearn')
import numpy as np
from preprocessing import txt_to_df
from feature_engineering import length
def test_lengths():
"Test sequence lengths"
# load data
df = txt_to_df(path+'/tests/docs/test_seq.txt', 0... | 28.851852 | 60 | 0.521181 | import os
import sys
path = os.environ.get('TRAVIS_BUILD_DIR')
sys.path.insert(0, path+'/protlearn')
import numpy as np
from preprocessing import txt_to_df
from feature_engineering import length
def test_lengths():
df = txt_to_df(path+'/tests/docs/test_seq.txt', 0)
len_int = length(df, 'int... | true | true |
f70d23aee762c1c2ca24012d077a1c6e94589c67 | 1,031 | py | Python | examples/rocket_lander_test.py | harwiltz/bach-robot-suite | 1126a665266cc5819d331af79effd03f3efe043f | [
"MIT"
] | null | null | null | examples/rocket_lander_test.py | harwiltz/bach-robot-suite | 1126a665266cc5819d331af79effd03f3efe043f | [
"MIT"
] | null | null | null | examples/rocket_lander_test.py | harwiltz/bach-robot-suite | 1126a665266cc5819d331af79effd03f3efe043f | [
"MIT"
] | null | null | null | import gym
import matplotlib.pyplot as plt
import numpy as np
import time
import brs_envs
env = gym.make('RocketLanderBRSEnv-v0',
render=True,
max_lateral_offset=0,
max_pitch_offset=0,
max_roll_offset=0,
max_yaw_offset=0,
mean_r... | 24.547619 | 62 | 0.57129 | import gym
import matplotlib.pyplot as plt
import numpy as np
import time
import brs_envs
env = gym.make('RocketLanderBRSEnv-v0',
render=True,
max_lateral_offset=0,
max_pitch_offset=0,
max_roll_offset=0,
max_yaw_offset=0,
mean_r... | true | true |
f70d24905fa3016f3414c7d28f8d00a5219c92a2 | 1,297 | py | Python | src/classes/Player.py | zeerockss/game | 3bdb2fbd55857d1742791b707bf677e5d796cd2c | [
"MIT"
] | null | null | null | src/classes/Player.py | zeerockss/game | 3bdb2fbd55857d1742791b707bf677e5d796cd2c | [
"MIT"
] | null | null | null | src/classes/Player.py | zeerockss/game | 3bdb2fbd55857d1742791b707bf677e5d796cd2c | [
"MIT"
] | 1 | 2020-10-02T15:34:12.000Z | 2020-10-02T15:34:12.000Z | from classes.Humanoid import Humanoid
class Player(Humanoid):
def __init__(self, name, room, dmg=1, hp=10):
super().__init__(name, room, dmg, hp)
self.equipped = None
def __str__(self):
return f'{self.name}: ', '{\n', f'\t[\n\t\thp: {self.hp}/{self.max_hp},\n\t\tdmg: {self.dmg}\n\tequ... | 33.25641 | 133 | 0.555898 | from classes.Humanoid import Humanoid
class Player(Humanoid):
def __init__(self, name, room, dmg=1, hp=10):
super().__init__(name, room, dmg, hp)
self.equipped = None
def __str__(self):
return f'{self.name}: ', '{\n', f'\t[\n\t\thp: {self.hp}/{self.max_hp},\n\t\tdmg: {self.dmg}\n\tequ... | true | true |
f70d258d74d6a60adef6d86393d212a9d3cfe7c1 | 220 | py | Python | libs/RVNpyRPC/squawker/serverside.py | sLiinuX/wxRaven | a513a029fa1ff2059ee262c524b4b2b45111f1a6 | [
"MIT"
] | 11 | 2021-12-20T15:32:17.000Z | 2022-03-16T03:54:02.000Z | libs/RVNpyRPC/squawker/serverside.py | sLiinuX/wxRaven | a513a029fa1ff2059ee262c524b4b2b45111f1a6 | [
"MIT"
] | 156 | 2021-12-31T21:01:31.000Z | 2022-03-20T21:57:31.000Z | libs/RVNpyRPC/squawker/serverside.py | sLiinuX/wxRaven | a513a029fa1ff2059ee262c524b4b2b45111f1a6 | [
"MIT"
] | 3 | 2022-01-21T14:52:43.000Z | 2022-02-12T05:32:19.000Z | from ravenrpc import Ravencoin
import ipfshttpclient
from credentials import USER, PASSWORD
rvn = Ravencoin(USER, PASSWORD)
ipfs = ipfshttpclient.connect()
ASSETNAME = "POLITICOIN"
IPFSDIRPATH = "/opt/squawker/ipfs"
| 18.333333 | 38 | 0.790909 | from ravenrpc import Ravencoin
import ipfshttpclient
from credentials import USER, PASSWORD
rvn = Ravencoin(USER, PASSWORD)
ipfs = ipfshttpclient.connect()
ASSETNAME = "POLITICOIN"
IPFSDIRPATH = "/opt/squawker/ipfs"
| true | true |
f70d271fd43170e657bc23cdd5fc31bb0e64dc0d | 349 | py | Python | library/admin.py | lesfernan/DemoHeroku | 719d6a327757735c57b3b0cea01a0eea7783958d | [
"FTL",
"Xnet",
"X11"
] | null | null | null | library/admin.py | lesfernan/DemoHeroku | 719d6a327757735c57b3b0cea01a0eea7783958d | [
"FTL",
"Xnet",
"X11"
] | null | null | null | library/admin.py | lesfernan/DemoHeroku | 719d6a327757735c57b3b0cea01a0eea7783958d | [
"FTL",
"Xnet",
"X11"
] | null | null | null | from django.contrib import admin
# Register your models here.
from library.models import Book, Author
@admin.register(Book)
class BookAdmin(admin.ModelAdmin):
list_display = ('name', 'id', 'author', 'publication_date', 'is_active')
@admin.register(Author)
class AuthorAdmin(admin.ModelAdmin):
list_display =... | 23.266667 | 76 | 0.730659 | from django.contrib import admin
from library.models import Book, Author
@admin.register(Book)
class BookAdmin(admin.ModelAdmin):
list_display = ('name', 'id', 'author', 'publication_date', 'is_active')
@admin.register(Author)
class AuthorAdmin(admin.ModelAdmin):
list_display = ('name', 'id', 'is_active')
| true | true |
f70d277aaecf82b48f6c7abfc3c27e31467fdb06 | 3,540 | py | Python | client/modules/hello.py | joisse1101/reverb | 93e3d91afd18d544a689ed8027f0b7c8418891a5 | [
"MIT"
] | null | null | null | client/modules/hello.py | joisse1101/reverb | 93e3d91afd18d544a689ed8027f0b7c8418891a5 | [
"MIT"
] | null | null | null | client/modules/hello.py | joisse1101/reverb | 93e3d91afd18d544a689ed8027f0b7c8418891a5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8-*-
import random
import re
from client import jasperpath
import RPi.GPIO as GPIO
import time
import sys
import vibrate
WORDS = ["HELLO"]
def handle(text, mic, profile):
vibrate.retrieve_from_DOA('low')
print("hello module")
mic.say('hello')
def isValid(text):
... | 23.6 | 73 | 0.547458 | import random
import re
from client import jasperpath
import RPi.GPIO as GPIO
import time
import sys
import vibrate
WORDS = ["HELLO"]
def handle(text, mic, profile):
vibrate.retrieve_from_DOA('low')
print("hello module")
mic.say('hello')
def isValid(text):
return bool(re.searc... | true | true |
f70d28af78859df1898447c7b80bb168f6742a1c | 2,118 | py | Python | km_api/know_me/tests/views/test_accessor_list_view.py | knowmetools/km-api | e4b72484c42e88a6c0087c9b1d5fef240e66cbb0 | [
"Apache-2.0"
] | 4 | 2017-08-03T00:46:31.000Z | 2018-11-06T03:32:32.000Z | km_api/know_me/tests/views/test_accessor_list_view.py | knowmetools/km-api | e4b72484c42e88a6c0087c9b1d5fef240e66cbb0 | [
"Apache-2.0"
] | 526 | 2017-06-27T18:13:59.000Z | 2021-06-10T18:00:21.000Z | km_api/know_me/tests/views/test_accessor_list_view.py | knowmetools/km-api | e4b72484c42e88a6c0087c9b1d5fef240e66cbb0 | [
"Apache-2.0"
] | 1 | 2017-07-10T19:46:27.000Z | 2017-07-10T19:46:27.000Z | from unittest import mock
import pytest
from django.http import Http404
from know_me import serializers, views
def test_get_queryset(api_rf, km_user_accessor_factory, km_user_factory):
"""
The queryset for the view should include all accessors granting
access to the requesting user's Know Me user.
"... | 26.148148 | 78 | 0.703022 | from unittest import mock
import pytest
from django.http import Http404
from know_me import serializers, views
def test_get_queryset(api_rf, km_user_accessor_factory, km_user_factory):
km_user = km_user_factory()
api_rf.user = km_user.user
km_user_accessor_factory(km_user=km_user)
km_user_accessor_... | true | true |
f70d2912da3e565adf1f49c9f0fc621c98fb5283 | 9,102 | py | Python | tests/components/onewire/test_sensor.py | JeffersonBledsoe/core | 3825f80a2dd087ae70654079cd9f3071289b8423 | [
"Apache-2.0"
] | 1 | 2021-07-30T21:22:44.000Z | 2021-07-30T21:22:44.000Z | tests/components/onewire/test_sensor.py | JeffersonBledsoe/core | 3825f80a2dd087ae70654079cd9f3071289b8423 | [
"Apache-2.0"
] | 71 | 2020-10-15T06:45:08.000Z | 2022-03-31T06:02:54.000Z | tests/components/onewire/test_sensor.py | JeffersonBledsoe/core | 3825f80a2dd087ae70654079cd9f3071289b8423 | [
"Apache-2.0"
] | 2 | 2020-09-09T05:01:51.000Z | 2020-09-09T05:46:12.000Z | """Tests for 1-Wire sensor platform."""
from unittest.mock import patch
from pyownet.protocol import Error as ProtocolError
import pytest
from homeassistant.components.onewire.const import (
DEFAULT_SYSBUS_MOUNT_DIR,
DOMAIN,
PLATFORMS,
)
from homeassistant.components.sensor import ATTR_STATE_CLASS, DOMAIN... | 40.274336 | 88 | 0.718414 | from unittest.mock import patch
from pyownet.protocol import Error as ProtocolError
import pytest
from homeassistant.components.onewire.const import (
DEFAULT_SYSBUS_MOUNT_DIR,
DOMAIN,
PLATFORMS,
)
from homeassistant.components.sensor import ATTR_STATE_CLASS, DOMAIN as SENSOR_DOMAIN
from homeassistant.con... | true | true |
f70d2a046187fc0592c2265a8a5fcc1ed1abbd96 | 5,328 | py | Python | corehq/ex-submodules/casexml/apps/case/tests/test_dbcache.py | johan--/commcare-hq | 86ee99c54f55ee94e4c8f2f6f30fc44e10e69ebd | [
"BSD-3-Clause"
] | null | null | null | corehq/ex-submodules/casexml/apps/case/tests/test_dbcache.py | johan--/commcare-hq | 86ee99c54f55ee94e4c8f2f6f30fc44e10e69ebd | [
"BSD-3-Clause"
] | 1 | 2022-03-12T01:03:25.000Z | 2022-03-12T01:03:25.000Z | corehq/ex-submodules/casexml/apps/case/tests/test_dbcache.py | johan--/commcare-hq | 86ee99c54f55ee94e4c8f2f6f30fc44e10e69ebd | [
"BSD-3-Clause"
] | null | null | null | import uuid
from django.test import TestCase, SimpleTestCase
from casexml.apps.case.exceptions import IllegalCaseId
from casexml.apps.case.mock import CaseBlock
from casexml.apps.case.models import CommCareCase
from casexml.apps.case.xform import CaseDbCache
from casexml.apps.case.xml import V2
from corehq.form_process... | 33.3 | 92 | 0.6128 | import uuid
from django.test import TestCase, SimpleTestCase
from casexml.apps.case.exceptions import IllegalCaseId
from casexml.apps.case.mock import CaseBlock
from casexml.apps.case.models import CommCareCase
from casexml.apps.case.xform import CaseDbCache
from casexml.apps.case.xml import V2
from corehq.form_process... | true | true |
f70d2a8380c2f1639cb077cccf107130b0ff871f | 6,206 | py | Python | tests/test_jss_scheduler.py | mhramani/job-shop-scheduling-cqm | 4c0a1b18f09672a19c2a57220765089336754449 | [
"Apache-2.0"
] | null | null | null | tests/test_jss_scheduler.py | mhramani/job-shop-scheduling-cqm | 4c0a1b18f09672a19c2a57220765089336754449 | [
"Apache-2.0"
] | null | null | null | tests/test_jss_scheduler.py | mhramani/job-shop-scheduling-cqm | 4c0a1b18f09672a19c2a57220765089336754449 | [
"Apache-2.0"
] | null | null | null | import unittest
import os
import sys
import subprocess
from dimod import sym, BINARY, INTEGER, ConstrainedQuadraticModel
from job_shop_scheduler import JSSCQM
from data import Data
import utils.plot_schedule as job_plotter
project_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
class TestSmoke(un... | 42.217687 | 79 | 0.596842 | import unittest
import os
import sys
import subprocess
from dimod import sym, BINARY, INTEGER, ConstrainedQuadraticModel
from job_shop_scheduler import JSSCQM
from data import Data
import utils.plot_schedule as job_plotter
project_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
class TestSmoke(un... | true | true |
f70d2a83fd02d102d7176b3001377167ed1356b0 | 3,104 | py | Python | TradingSystemApp/ML.py | CarlChenCC/TradingStockWeb | da8ab0163daa980b9506686d25465da2a34c029d | [
"MIT"
] | null | null | null | TradingSystemApp/ML.py | CarlChenCC/TradingStockWeb | da8ab0163daa980b9506686d25465da2a34c029d | [
"MIT"
] | null | null | null | TradingSystemApp/ML.py | CarlChenCC/TradingStockWeb | da8ab0163daa980b9506686d25465da2a34c029d | [
"MIT"
] | null | null | null | from IPython.display import Image
#%matplotlib inline
from distutils.version import LooseVersion as Version
from sklearn import __version__ as sklearn_version
#Image(filename='./images/10_01.png', width=500)
import pandas as pd
df = pd.read_csv('https://archive.ics.uci.edu/ml/machine-learning-databases/'
... | 25.032258 | 130 | 0.596972 | from IPython.display import Image
from distutils.version import LooseVersion as Version
from sklearn import __version__ as sklearn_version
import pandas as pd
df = pd.read_csv('https://archive.ics.uci.edu/ml/machine-learning-databases/'
'housing/housing.data',
header=None,
... | true | true |
f70d2ad53620eeb6457845e94c0898fec4fe4def | 2,989 | py | Python | src/features/built_events_w_weather_features_labels0.py | nbechor/SlipperySlope | 5a456a9632b73e2f5ff0d90fe080aeec1ec3cc3a | [
"MIT"
] | null | null | null | src/features/built_events_w_weather_features_labels0.py | nbechor/SlipperySlope | 5a456a9632b73e2f5ff0d90fe080aeec1ec3cc3a | [
"MIT"
] | null | null | null | src/features/built_events_w_weather_features_labels0.py | nbechor/SlipperySlope | 5a456a9632b73e2f5ff0d90fe080aeec1ec3cc3a | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
from weatherClass import weatherClass
from IdentifierClass import identifierClass
from eventsClass import eventsClass
import datetime
### load some data:
#read the ticket+complaint data, combined for location:
# events fields: date, lat, lng, address, identifier, index
tem... | 42.098592 | 118 | 0.68451 | import numpy as np
import pandas as pd
from weatherClass import weatherClass
from IdentifierClass import identifierClass
from eventsClass import eventsClass
import datetime
temp = pd.read_csv('/Users/nbechor/Insight/noslipwalk/noslipwalk/features/negative_labels_5_d_15_with_identifier.csv')
events = eventsClass... | true | true |
f70d2afcf313c34a85f57a7a0a2767d089d0a9c2 | 13,265 | py | Python | dakara_server/playlist/tests/test_karaoke.py | DakaraProject/dakara-server | b28fc1a8561e431d562102932f3d6ff3607e545b | [
"MIT"
] | 4 | 2018-07-24T18:22:16.000Z | 2020-01-24T16:30:54.000Z | dakara_server/playlist/tests/test_karaoke.py | DakaraProject/dakara-server | b28fc1a8561e431d562102932f3d6ff3607e545b | [
"MIT"
] | 88 | 2017-11-04T08:58:02.000Z | 2022-03-30T11:39:08.000Z | dakara_server/playlist/tests/test_karaoke.py | DakaraProject/dakara-server | b28fc1a8561e431d562102932f3d6ff3607e545b | [
"MIT"
] | 1 | 2018-05-05T15:37:20.000Z | 2018-05-05T15:37:20.000Z | from datetime import datetime
from unittest.mock import ANY, patch
from django.urls import reverse
from django.utils.dateparse import parse_datetime
from rest_framework import status
from internal.tests.base_test import tz
from playlist.date_stop import KARAOKE_JOB_NAME, clear_date_stop
from playlist.models import Ka... | 37.261236 | 86 | 0.680739 | from datetime import datetime
from unittest.mock import ANY, patch
from django.urls import reverse
from django.utils.dateparse import parse_datetime
from rest_framework import status
from internal.tests.base_test import tz
from playlist.date_stop import KARAOKE_JOB_NAME, clear_date_stop
from playlist.models import Ka... | true | true |
f70d2baf5b541ff79a872cdb2281f754e8b33cbd | 7,431 | py | Python | salt/_compat.py | fake-name/salt | d8f04936e4407f51946e32e8166159778f6c31a5 | [
"Apache-2.0"
] | null | null | null | salt/_compat.py | fake-name/salt | d8f04936e4407f51946e32e8166159778f6c31a5 | [
"Apache-2.0"
] | null | null | null | salt/_compat.py | fake-name/salt | d8f04936e4407f51946e32e8166159778f6c31a5 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Salt compatibility code
"""
# pylint: disable=import-error,unused-import,invalid-name,W0231,W0233
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import binascii
import logging
import sys
# Import 3rd-party libs
from salt.exceptions import Sal... | 29.724 | 94 | 0.612165 |
from __future__ import absolute_import, print_function, unicode_literals
import binascii
import logging
import sys
from salt.exceptions import SaltException
from salt.ext.six import binary_type, integer_types, string_types, text_type
from salt.ext.six.moves import StringIO, cStringIO
log = logging.getLogger(__name_... | true | true |
f70d2c13b10c9d61592c4394147f47c2b83b8834 | 873 | py | Python | src/ControlManager.py | NEKERAFA/Soul-Tower | d37c0bf6bcbf253ec5b2c41f802adeeca31fb384 | [
"MIT"
] | null | null | null | src/ControlManager.py | NEKERAFA/Soul-Tower | d37c0bf6bcbf253ec5b2c41f802adeeca31fb384 | [
"MIT"
] | null | null | null | src/ControlManager.py | NEKERAFA/Soul-Tower | d37c0bf6bcbf253ec5b2c41f802adeeca31fb384 | [
"MIT"
] | null | null | null | import pygame
class ControlManager(object):
@classmethod
def up(cls):
raise NotImplementedError('Error: Abstract class')
@classmethod
def down(cls):
raise NotImplementedError('Error: Abstract class')
@classmethod
def left(cls):
raise NotImplementedError('E... | 24.942857 | 59 | 0.648339 | import pygame
class ControlManager(object):
@classmethod
def up(cls):
raise NotImplementedError('Error: Abstract class')
@classmethod
def down(cls):
raise NotImplementedError('Error: Abstract class')
@classmethod
def left(cls):
raise NotImplementedError('E... | true | true |
f70d2d43097a14626f1d02e5dfae379e09280222 | 1,262 | py | Python | src/facts.py | gubkinbot/factobot | 1216bbe48b28bc86224f175f4e9971a73e3823b3 | [
"Apache-2.0"
] | null | null | null | src/facts.py | gubkinbot/factobot | 1216bbe48b28bc86224f175f4e9971a73e3823b3 | [
"Apache-2.0"
] | null | null | null | src/facts.py | gubkinbot/factobot | 1216bbe48b28bc86224f175f4e9971a73e3823b3 | [
"Apache-2.0"
] | null | null | null | import random
import mysql.connector
import yaml
from os import path as os_path
config_path = os_path.abspath(os_path.join(os_path.dirname(__file__), 'config.yml'))
data = yaml.safe_load(open(config_path))
def extract_fact(user_id):
mydb = mysql.connector.connect(
host=data['DB_HOST'],
user=data['DB_USERNAME'... | 33.210526 | 139 | 0.642631 | import random
import mysql.connector
import yaml
from os import path as os_path
config_path = os_path.abspath(os_path.join(os_path.dirname(__file__), 'config.yml'))
data = yaml.safe_load(open(config_path))
def extract_fact(user_id):
mydb = mysql.connector.connect(
host=data['DB_HOST'],
user=data['DB_USERNAME'... | true | true |
f70d2eb3ca69abc75f590dee675daf6b9639d6a3 | 5,951 | py | Python | account/connectors/idp_interface.py | coseasonruby/Gluu-Ecommerce-djagno-project | d196309bbd76571ee7793bd3de4342eb81f789e1 | [
"MIT"
] | null | null | null | account/connectors/idp_interface.py | coseasonruby/Gluu-Ecommerce-djagno-project | d196309bbd76571ee7793bd3de4342eb81f789e1 | [
"MIT"
] | null | null | null | account/connectors/idp_interface.py | coseasonruby/Gluu-Ecommerce-djagno-project | d196309bbd76571ee7793bd3de4342eb81f789e1 | [
"MIT"
] | null | null | null | import json
import logging
import random
import requests
from hashlib import sha1 as sha_constructor
from django.conf import settings
from gluu_ecommerce.connectors.uma_access import obtain_authorized_rpt_token
logger = logging.getLogger('idp')
SCIM_CREATE_USER_ENDPOINT = 'https://idp.gluu.org/identit... | 29.171569 | 99 | 0.620232 | import json
import logging
import random
import requests
from hashlib import sha1 as sha_constructor
from django.conf import settings
from gluu_ecommerce.connectors.uma_access import obtain_authorized_rpt_token
logger = logging.getLogger('idp')
SCIM_CREATE_USER_ENDPOINT = 'https://idp.gluu.org/identit... | true | true |
f70d2ece51a27ddb0d878d7caf099cb86a0409c5 | 1,767 | py | Python | test/test_get_xrp_ripple_transaction_details_by_transaction_ide401.py | Crypto-APIs/Crypto_APIs_2.0_SDK_Python | c59ebd914850622b2c6500c4c30af31fb9cecf0e | [
"MIT"
] | 5 | 2021-05-17T04:45:03.000Z | 2022-03-23T12:51:46.000Z | test/test_get_xrp_ripple_transaction_details_by_transaction_ide401.py | Crypto-APIs/Crypto_APIs_2.0_SDK_Python | c59ebd914850622b2c6500c4c30af31fb9cecf0e | [
"MIT"
] | null | null | null | test/test_get_xrp_ripple_transaction_details_by_transaction_ide401.py | Crypto-APIs/Crypto_APIs_2.0_SDK_Python | c59ebd914850622b2c6500c4c30af31fb9cecf0e | [
"MIT"
] | 2 | 2021-06-02T07:32:26.000Z | 2022-02-12T02:36:23.000Z | """
CryptoAPIs
Crypto APIs 2.0 is a complex and innovative infrastructure layer that radically simplifies the development of any Blockchain and Crypto related applications. Organized around REST, Crypto APIs 2.0 can assist both novice Bitcoin/Ethereum enthusiasts and crypto experts with the development of thei... | 41.093023 | 484 | 0.798529 |
import sys
import unittest
import cryptoapis
from cryptoapis.model.banned_ip_address_details import BannedIpAddressDetails
from cryptoapis.model.invalid_api_key import InvalidApiKey
from cryptoapis.model.missing_api_key import MissingApiKey
globals()['BannedIpAddressDetails'] = BannedIpAddressDetails
globals()['Inva... | true | true |
f70d2ed9eb2c92b5ea970cce30ff22ef078139eb | 9,153 | py | Python | certbot/certbot/_internal/plugins/standalone.py | xiaohuilam/certbot | e4d92b3fec3b66258d2434bbc0de14b7975efd7c | [
"Apache-2.0"
] | 16,789 | 2016-05-06T19:49:59.000Z | 2022-03-31T20:01:47.000Z | certbot/certbot/_internal/plugins/standalone.py | nicholascioli/certbot | 86406ab63aebf463ca4aa0381a55ddeb91231cd2 | [
"Apache-2.0"
] | 5,737 | 2016-05-06T19:26:43.000Z | 2022-03-31T20:27:38.000Z | certbot/certbot/_internal/plugins/standalone.py | nicholascioli/certbot | 86406ab63aebf463ca4aa0381a55ddeb91231cd2 | [
"Apache-2.0"
] | 2,974 | 2016-05-06T19:51:23.000Z | 2022-03-31T21:01:36.000Z | """Standalone Authenticator."""
import collections
import errno
import logging
import socket
from typing import Any
from typing import Callable
from typing import DefaultDict
from typing import Dict
from typing import Iterable
from typing import List
from typing import Mapping
from typing import Set
from typing import ... | 40.321586 | 127 | 0.672239 | import collections
import errno
import logging
import socket
from typing import Any
from typing import Callable
from typing import DefaultDict
from typing import Dict
from typing import Iterable
from typing import List
from typing import Mapping
from typing import Set
from typing import Tuple
from typing import Type
fr... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.