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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
08f645e66ec4f7b3756133ffbcaeb3264e0b5ee1 | 1,724 | py | Python | qualityforward/TestPhase.py | goofmint/qualityforward-py | 299c11cb4769fb8c42bfd2d553a5c1c1f042d2de | [
"MIT"
] | null | null | null | qualityforward/TestPhase.py | goofmint/qualityforward-py | 299c11cb4769fb8c42bfd2d553a5c1c1f042d2de | [
"MIT"
] | null | null | null | qualityforward/TestPhase.py | goofmint/qualityforward-py | 299c11cb4769fb8c42bfd2d553a5c1c1f042d2de | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from .Map import Map
from .TestSuiteAssignment import TestSuiteAssignment
class TestPhase(Map):
def __init__(self, q, body = {}):
self.q = q
self.sets(body)
def sets(self, body):
for key in body:
self.set(key, body[key])
def set(self, key, value):... | 35.183673 | 80 | 0.533643 |
from .Map import Map
from .TestSuiteAssignment import TestSuiteAssignment
class TestPhase(Map):
def __init__(self, q, body = {}):
self.q = q
self.sets(body)
def sets(self, body):
for key in body:
self.set(key, body[key])
def set(self, key, value):
if key == 'test... | true | true |
08f6466c223cdce0aa73055ee948b6985c10c8d7 | 3,003 | py | Python | markovc.py | lstorchi/mrkvtheilcont | d4215073a57b78d2b1ff424615e481ced4d3e7d5 | [
"Apache-2.0"
] | null | null | null | markovc.py | lstorchi/mrkvtheilcont | d4215073a57b78d2b1ff424615e481ced4d3e7d5 | [
"Apache-2.0"
] | null | null | null | markovc.py | lstorchi/mrkvtheilcont | d4215073a57b78d2b1ff424615e481ced4d3e7d5 | [
"Apache-2.0"
] | null | null | null | import numpy.linalg
import numpy.random
import scipy.stats
import scipy.io
import argparse
import numpy
import math
import sys
import os
import os.path
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
sys.path.append("./module")
import mainmkvcmp
import basicutils
parser = argparse.ArgumentParser()
... | 28.330189 | 92 | 0.674326 | import numpy.linalg
import numpy.random
import scipy.stats
import scipy.io
import argparse
import numpy
import math
import sys
import os
import os.path
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
sys.path.append("./module")
import mainmkvcmp
import basicutils
parser = argparse.ArgumentParser()
... | true | true |
08f647d8c64a86fc29bb604897d2769808afceda | 368 | py | Python | sdk/python/pulumi_azure_nextgen/insights/v20201020/__init__.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/insights/v20201020/__init__.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/insights/v20201020/__init__.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"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! ***
# Export this package's modules as members:
from .get_my_workbook import *
from .get_workbook import *
from .my_workbook import *
from .workbook import... | 30.666667 | 80 | 0.730978 |
# Export this package's modules as members:
from .get_my_workbook import *
from .get_workbook import *
from .my_workbook import *
from .workbook import *
from ._inputs import *
from . import outputs
| true | true |
08f647f71c1ebc0720c7990d597a94585e1bdfdb | 4,890 | py | Python | Spread_Strat/HC_Spread.py | Alan-Du/Commodity_Tracker | fc7d4c92535424be7dc82f47dd513332b4b772c9 | [
"Unlicense"
] | 1 | 2020-04-12T22:32:01.000Z | 2020-04-12T22:32:01.000Z | Spread_Strat/HC_Spread.py | Alan-Du/Commodity_Tracker | fc7d4c92535424be7dc82f47dd513332b4b772c9 | [
"Unlicense"
] | null | null | null | Spread_Strat/HC_Spread.py | Alan-Du/Commodity_Tracker | fc7d4c92535424be7dc82f47dd513332b4b772c9 | [
"Unlicense"
] | 1 | 2021-06-11T09:19:12.000Z | 2021-06-11T09:19:12.000Z | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 23 07:34:38 2020
@author: shaolun du
@contact: shaolun.du@gmail.com
"""
import DB.dbFetch as dbFetch
import pandas as pd
import datetime as dt
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
def gen_HC_spread(start,end):
#generate be... | 51.473684 | 128 | 0.642331 |
import DB.dbFetch as dbFetch
import pandas as pd
import datetime as dt
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
def gen_HC_spread(start,end):
myFmt = mdates.DateFormatter('%y/%m') Ticker_1 = "HC"
Ticker_2 = "RB"
index_data = pd.DataFrame(dbFetch.get_index_a... | true | true |
08f64c81699d9c498a8464cdaf1349aeac64be17 | 6,305 | py | Python | docs/conf.py | hoodmane/loky | 00fbd9d5e8ebc8f9427096a0f64d7d7ad51b9f9b | [
"BSD-3-Clause"
] | 153 | 2020-01-29T07:26:58.000Z | 2022-03-31T23:30:55.000Z | docs/conf.py | hoodmane/loky | 00fbd9d5e8ebc8f9427096a0f64d7d7ad51b9f9b | [
"BSD-3-Clause"
] | 98 | 2020-01-17T09:14:16.000Z | 2022-03-10T15:32:14.000Z | docs/conf.py | hoodmane/loky | 00fbd9d5e8ebc8f9427096a0f64d7d7ad51b9f9b | [
"BSD-3-Clause"
] | 22 | 2020-01-17T09:26:38.000Z | 2022-02-02T09:27:59.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# loky documentation build configuration file, created by
# sphinx-quickstart on Wed Aug 2 16:50:13 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autog... | 30.458937 | 80 | 0.679778 |
import os
import sys
sys.path.insert(0, os.path.abspath('../loky'))
extensions = [
'sphinx.ext.todo',
'sphinx.ext.autodoc',
'sphinx.ext.viewcode',
'sphinx.ext.autosummary',
'sphinx.ext.intersphinx',
'sphinx_gallery.gen_gallery'
]
templates_path = ['_templates']
source_suffix = '.rst'
ma... | true | true |
08f64ed497b3bca48a6f6918d7664b7c91dabc3f | 6,555 | py | Python | scripts/install.py | PapyElGringo/material-shell | c3d12419610a9c78f662c905cefdefff15f6e378 | [
"MIT"
] | 1,480 | 2019-07-02T13:12:28.000Z | 2020-05-29T09:43:23.000Z | scripts/install.py | PapyElGringo/material-shell | c3d12419610a9c78f662c905cefdefff15f6e378 | [
"MIT"
] | 154 | 2019-07-01T11:17:50.000Z | 2020-05-27T12:50:50.000Z | scripts/install.py | PapyElGringo/material-shell | c3d12419610a9c78f662c905cefdefff15f6e378 | [
"MIT"
] | 81 | 2019-07-03T15:57:20.000Z | 2020-05-28T20:21:17.000Z | #!/usr/bin/env python3
import subprocess
import os
import shutil
from shutil import which
from subprocess import check_output
import re
# Ansi escape codes to get colors in terminals
RED = "\33[31m"
GREEN = "\33[32m"
YELLOW = "\33[33m"
RESET = "\33[0m"
''' Prints some text with a color '''
def printc(color: str, tex... | 42.019231 | 156 | 0.643783 | import subprocess
import os
import shutil
from shutil import which
from subprocess import check_output
import re
RED = "\33[31m"
GREEN = "\33[32m"
YELLOW = "\33[33m"
RESET = "\33[0m"
def printc(color: str, text: str):
print(f"{color}{text}{RESET}")
def try_call(params):
try:
subprocess.check_call(pa... | true | true |
08f64ffe091d51b5f3941878d2943afa05c6c05f | 4,773 | py | Python | spotify_client.py | SurajH1/songData | ba6174a4c72099069d43fb2bc5ccc6c426c1b6a4 | [
"MIT"
] | null | null | null | spotify_client.py | SurajH1/songData | ba6174a4c72099069d43fb2bc5ccc6c426c1b6a4 | [
"MIT"
] | null | null | null | spotify_client.py | SurajH1/songData | ba6174a4c72099069d43fb2bc5ccc6c426c1b6a4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import base64
import datetime
from urllib.parse import urlencode
import requests
class SpotifyAPI(object):
access_token = None
access_token_expires = datetime.datetime.now()
access_token_did_expire = True
client_id = None
client_secret = None
token_url = "... | 36.715385 | 93 | 0.609051 |
import base64
import datetime
from urllib.parse import urlencode
import requests
class SpotifyAPI(object):
access_token = None
access_token_expires = datetime.datetime.now()
access_token_did_expire = True
client_id = None
client_secret = None
token_url = "https://accounts.spotify... | true | true |
08f650ecdc36d379ef3bae2d0eedaa34894ad652 | 7,760 | py | Python | Resnet50Conv1d_BN.py | Jun-depo/Resnet50_Conv1D | 2fd36e70e662298b908c17d4c2f0cdf4bf625adb | [
"MIT"
] | 5 | 2019-10-26T05:18:09.000Z | 2022-02-24T06:12:41.000Z | Resnet50Conv1d_BN.py | Jun-depo/Resnet50_Conv1D | 2fd36e70e662298b908c17d4c2f0cdf4bf625adb | [
"MIT"
] | null | null | null | Resnet50Conv1d_BN.py | Jun-depo/Resnet50_Conv1D | 2fd36e70e662298b908c17d4c2f0cdf4bf625adb | [
"MIT"
] | 1 | 2021-08-10T07:57:24.000Z | 2021-08-10T07:57:24.000Z | import tensorflow as tf
import keras
from keras.engine.input_layer import Input
import keras.backend as K
from keras.utils import plot_model, to_categorical
from keras.models import Sequential, load_model
from keras.layers import Activation, Dropout, Flatten, Dense, Conv1D, BatchNormalization
from keras.callbacks im... | 38.415842 | 155 | 0.641495 | import tensorflow as tf
import keras
from keras.engine.input_layer import Input
import keras.backend as K
from keras.utils import plot_model, to_categorical
from keras.models import Sequential, load_model
from keras.layers import Activation, Dropout, Flatten, Dense, Conv1D, BatchNormalization
from keras.callbacks im... | true | true |
08f652be7ed2f058e9b3fba1fa1b185f26b51745 | 828 | py | Python | src/qsub/ruffus/rename-reads.py | wkusmirek/bamgineer | 02be6168f3e51b41881a612f159de1ee413c9f13 | [
"Apache-2.0"
] | 34 | 2017-03-23T05:13:08.000Z | 2022-01-18T10:56:20.000Z | src/qsub/ruffus/rename-reads.py | wkusmirek/bamgineer | 02be6168f3e51b41881a612f159de1ee413c9f13 | [
"Apache-2.0"
] | 10 | 2017-06-29T09:44:04.000Z | 2021-04-22T20:01:11.000Z | src/qsub/ruffus/rename-reads.py | wkusmirek/bamgineer | 02be6168f3e51b41881a612f159de1ee413c9f13 | [
"Apache-2.0"
] | 13 | 2017-09-19T22:55:14.000Z | 2021-08-19T06:44:47.000Z | import sys
import pysam
from uuid import uuid4
inbamfn= sys.argv[1]
outbamfn = sys.argv[2]
inbam = pysam.Samfile(inbamfn, 'rb')
outbam = pysam.Samfile(outbamfn, 'wb', template=inbam)
paired = {}
n = 0
p = 0
u = 0
w = 0
m = 0
for read in inbam.fetch(until_eof=True):
n += 1
if read.is_paired:
p += 1
... | 19.255814 | 54 | 0.5157 | import sys
import pysam
from uuid import uuid4
inbamfn= sys.argv[1]
outbamfn = sys.argv[2]
inbam = pysam.Samfile(inbamfn, 'rb')
outbam = pysam.Samfile(outbamfn, 'wb', template=inbam)
paired = {}
n = 0
p = 0
u = 0
w = 0
m = 0
for read in inbam.fetch(until_eof=True):
n += 1
if read.is_paired:
p += 1
... | true | true |
08f653612d24d7ac0f2698f8da167ad03c5c8d7a | 6,225 | py | Python | python/example_code/auditmanager/test/test_create_assessment_report.py | iconara/aws-doc-sdk-examples | 52706b31b4fce8fb89468e56743edf5369e69628 | [
"Apache-2.0"
] | 1 | 2019-01-18T01:09:34.000Z | 2019-01-18T01:09:34.000Z | python/example_code/auditmanager/test/test_create_assessment_report.py | iconara/aws-doc-sdk-examples | 52706b31b4fce8fb89468e56743edf5369e69628 | [
"Apache-2.0"
] | 1 | 2021-04-09T21:17:09.000Z | 2021-04-09T21:17:09.000Z | python/example_code/auditmanager/test/test_create_assessment_report.py | iconara/aws-doc-sdk-examples | 52706b31b4fce8fb89468e56743edf5369e69628 | [
"Apache-2.0"
] | 27 | 2020-04-16T22:52:53.000Z | 2021-09-30T22:55:58.000Z | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Unit tests for create_assessment_report.py.
"""
import dateutil.parser
import urllib.request
import uuid
import boto3
from botocore.exceptions import ClientError
import pytest
from create_assessment_report ... | 45.437956 | 140 | 0.688835 |
import dateutil.parser
import urllib.request
import uuid
import boto3
from botocore.exceptions import ClientError
import pytest
from create_assessment_report import AuditReport
@pytest.mark.parametrize('inputs, outputs, error_code', [
(['bad-uuid'], (None, None), 'Nostub'),
(['f66e7fc4-baf1-4661-85db-f6ff6... | true | true |
08f6538327b885f769c86e5a5fb85b990151fd4d | 103 | py | Python | kelas.py | dindamajesty13/belajarpython | 1e6cdbe3db091114bb3c57d74e677d1657f41648 | [
"MIT"
] | null | null | null | kelas.py | dindamajesty13/belajarpython | 1e6cdbe3db091114bb3c57d74e677d1657f41648 | [
"MIT"
] | null | null | null | kelas.py | dindamajesty13/belajarpython | 1e6cdbe3db091114bb3c57d74e677d1657f41648 | [
"MIT"
] | null | null | null | class MataUang:
def Anguilla(self, idr):
hasil = float(idr) * 0.00019
return hasil | 20.6 | 36 | 0.592233 | class MataUang:
def Anguilla(self, idr):
hasil = float(idr) * 0.00019
return hasil | true | true |
08f653dbcaa169e6308a805c2d9f24fbb96d5a88 | 540 | py | Python | 1 course/1 term/discret-math/lab-3/23.py | yg-margo/ITMO-university | d92329f8a01aa6dfefe19c3dc421919a2a851b70 | [
"MIT"
] | null | null | null | 1 course/1 term/discret-math/lab-3/23.py | yg-margo/ITMO-university | d92329f8a01aa6dfefe19c3dc421919a2a851b70 | [
"MIT"
] | null | null | null | 1 course/1 term/discret-math/lab-3/23.py | yg-margo/ITMO-university | d92329f8a01aa6dfefe19c3dc421919a2a851b70 | [
"MIT"
] | null | null | null | def v(arr):
arr = [i for i in arr]
n = len(arr) - 1
while (n >= 0) and\
(arr[n] != '1'):
arr[n] = '1'
n -= 1
if n == -1:
return '-'
arr[n] = '0'
return ''.join(arr)
def kod(arr):
arr = [i for i in arr]
n = len(arr) - 1
while (n >=... | 18.62069 | 29 | 0.342593 | def v(arr):
arr = [i for i in arr]
n = len(arr) - 1
while (n >= 0) and\
(arr[n] != '1'):
arr[n] = '1'
n -= 1
if n == -1:
return '-'
arr[n] = '0'
return ''.join(arr)
def kod(arr):
arr = [i for i in arr]
n = len(arr) - 1
while (n >=... | true | true |
08f654125b89f1da0a18b5fff678848bef8033bb | 3,308 | py | Python | cliboa/util/cache.py | Wisteria30/cliboa | 14be20b846d27db2bc7a0f83ed61fab31cd06995 | [
"MIT"
] | null | null | null | cliboa/util/cache.py | Wisteria30/cliboa | 14be20b846d27db2bc7a0f83ed61fab31cd06995 | [
"MIT"
] | null | null | null | cliboa/util/cache.py | Wisteria30/cliboa | 14be20b846d27db2bc7a0f83ed61fab31cd06995 | [
"MIT"
] | null | null | null | #
# Copyright 2019 BrainPad Inc. All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, me... | 26.047244 | 85 | 0.598549 | import os
from cliboa.util.lisboa_log import LisboaLog
global _STEP_ARGUMENT_CACHE
global _PROCESS_STORE_CACHE
_STEP_ARGUMENT_CACHE = {}
_PROCESS_STORE_CACHE = {}
class StepArgument(object):
@staticmethod
def _put(step, instance):
props = instance.__dict__
items = {}
for k, v in pro... | true | true |
08f654a4915cf98e114af6c1699269b8bca58f26 | 3,808 | py | Python | _doc/sphinxdoc/source/conf.py | sdpython/code_beatrix | 421101fb7460b3c23a5955e73395e6793d94e21a | [
"MIT"
] | 1 | 2017-12-01T12:43:53.000Z | 2017-12-01T12:43:53.000Z | _doc/sphinxdoc/source/conf.py | sdpython/code_beatrix | 421101fb7460b3c23a5955e73395e6793d94e21a | [
"MIT"
] | 8 | 2018-01-07T14:41:25.000Z | 2020-02-01T18:29:51.000Z | _doc/sphinxdoc/source/conf.py | sdpython/code_beatrix | 421101fb7460b3c23a5955e73395e6793d94e21a | [
"MIT"
] | 1 | 2019-10-27T20:40:04.000Z | 2019-10-27T20:40:04.000Z | # -*- coding: utf-8 -*-
import sys
import os
from pyquickhelper.helpgen.default_conf import set_sphinx_variables
from code_beatrix import __version__ as sversion
sys.path.insert(0, os.path.abspath(os.path.join(os.path.split(__file__)[0])))
import my_hachibee_sphinx_theme as hachibee_sphinx_theme
set_sphinx_variables... | 45.333333 | 199 | 0.656775 | import sys
import os
from pyquickhelper.helpgen.default_conf import set_sphinx_variables
from code_beatrix import __version__ as sversion
sys.path.insert(0, os.path.abspath(os.path.join(os.path.split(__file__)[0])))
import my_hachibee_sphinx_theme as hachibee_sphinx_theme
set_sphinx_variables(__file__, "Les enfants ... | true | true |
08f655107fa7d09970a1ca0ba0452d640f502d96 | 1,464 | py | Python | numpy_practice/a5_arrayConcatination.py | dkp-1024/my_machine_learning | 11ace64c7ae5c709f20cb6691529768b42d08d22 | [
"Apache-2.0"
] | null | null | null | numpy_practice/a5_arrayConcatination.py | dkp-1024/my_machine_learning | 11ace64c7ae5c709f20cb6691529768b42d08d22 | [
"Apache-2.0"
] | null | null | null | numpy_practice/a5_arrayConcatination.py | dkp-1024/my_machine_learning | 11ace64c7ae5c709f20cb6691529768b42d08d22 | [
"Apache-2.0"
] | null | null | null | import numpy as np
#You can concatenate two or more arrays at once.
x = np.array([1, 2, 3])
y = np.array([3, 2, 1])
z = [21,21,21]
print(np.concatenate([x, y,z]))
# array([ 1, 2, 3, 3, 2, 1, 21, 21, 21])
#You can also use this function to create 2-dimensional arrays.
grid = np.array([[1,2,3],[4,5,6]])
print(np.... | 23.612903 | 72 | 0.532104 | import numpy as np
x = np.array([1, 2, 3])
y = np.array([3, 2, 1])
z = [21,21,21]
print(np.concatenate([x, y,z]))
grid = np.array([[1,2,3],[4,5,6]])
print(np.concatenate([grid,grid]))
print(np.concatenate([grid,grid],axis=1))
x = np.array([3,4,5])
grid = np.array([[1,2,3],[17,18,19]])
print(np.vstack([x,grid]))
z... | true | true |
08f658ba96089c35aec0f772f21b62a9d4ad5e13 | 10,234 | py | Python | pytorch-frontend/caffe2/quantization/server/batch_matmul_dnnlowp_op_test.py | AndreasKaratzas/stonne | 2915fcc46cc94196303d81abbd1d79a56d6dd4a9 | [
"MIT"
] | 40 | 2021-06-01T07:37:59.000Z | 2022-03-25T01:42:09.000Z | pytorch-frontend/caffe2/quantization/server/batch_matmul_dnnlowp_op_test.py | AndreasKaratzas/stonne | 2915fcc46cc94196303d81abbd1d79a56d6dd4a9 | [
"MIT"
] | 14 | 2021-06-01T11:52:46.000Z | 2022-03-25T02:13:08.000Z | pytorch-frontend/caffe2/quantization/server/batch_matmul_dnnlowp_op_test.py | AndreasKaratzas/stonne | 2915fcc46cc94196303d81abbd1d79a56d6dd4a9 | [
"MIT"
] | 7 | 2021-07-20T19:34:26.000Z | 2022-03-13T21:07:36.000Z | from __future__ import absolute_import, division, print_function, unicode_literals
import collections
from itertools import product
import caffe2.python.hypothesis_test_util as hu
import hypothesis.strategies as st
import numpy as np
from caffe2.python import core, dyndep, workspace
from caffe2.quantization.server im... | 40.133333 | 100 | 0.500391 | from __future__ import absolute_import, division, print_function, unicode_literals
import collections
from itertools import product
import caffe2.python.hypothesis_test_util as hu
import hypothesis.strategies as st
import numpy as np
from caffe2.python import core, dyndep, workspace
from caffe2.quantization.server im... | true | true |
08f6591845fe2812f0fbe7ff03311791ae972107 | 14,902 | py | Python | campos/sources/__init__.py | jbermudezcabrera/campos | df34f93dd37b435a82663fb72ef37f669832af22 | [
"MIT"
] | null | null | null | campos/sources/__init__.py | jbermudezcabrera/campos | df34f93dd37b435a82663fb72ef37f669832af22 | [
"MIT"
] | null | null | null | campos/sources/__init__.py | jbermudezcabrera/campos | df34f93dd37b435a82663fb72ef37f669832af22 | [
"MIT"
] | null | null | null | import abc
import re
import inspect
import datetime as dt
from collections import OrderedDict
from .. import fields
from ..utils import callable
from ..validators import (NumberRange, StringLength, DateRange, TimeRange,
DatetimeRange)
__author__ = 'Juan Manuel Bermúdez Cabrera'
OLDEST_PERSO... | 34.178899 | 80 | 0.638102 | import abc
import re
import inspect
import datetime as dt
from collections import OrderedDict
from .. import fields
from ..utils import callable
from ..validators import (NumberRange, StringLength, DateRange, TimeRange,
DatetimeRange)
__author__ = 'Juan Manuel Bermúdez Cabrera'
OLDEST_PERSO... | true | true |
08f65a378a42f95671d1b28cb9a379df1500a585 | 2,568 | py | Python | Scripts/datasource_remap/datasourceremap.py | cmtoomey/TableauConference2017 | 6a30821e5e35e85f58f889422d97626a3e85352f | [
"MIT"
] | 6 | 2017-11-22T19:16:45.000Z | 2020-09-22T04:13:20.000Z | Scripts/datasource_remap/datasourceremap.py | cmtoomey/TableauConference2017 | 6a30821e5e35e85f58f889422d97626a3e85352f | [
"MIT"
] | 15 | 2020-03-24T15:38:12.000Z | 2022-02-11T03:39:49.000Z | Scripts/datasource_remap/datasourceremap.py | cmtoomey/TableauConference2017 | 6a30821e5e35e85f58f889422d97626a3e85352f | [
"MIT"
] | 4 | 2017-12-08T18:35:13.000Z | 2018-08-21T12:59:31.000Z | #import tableau server python library
import os
import tableauserverclient as TSC
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
import yaml
with open("../config.yaml", 'r') as ymlfile:
cfg = yaml.l... | 32.1 | 83 | 0.676402 | import os
import tableauserverclient as TSC
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
import yaml
with open("../config.yaml", 'r') as ymlfile:
cfg = yaml.load(ymlfile)
settings = cfg['setti... | true | true |
08f65a659bd06aea828f74e05d4abb5c9a56d32d | 2,315 | py | Python | unit_tests/test_osu_apiv1.py | abraker-osu/osu_apiv1 | 3f1cda53200d1761f4215fb414789b3a5d505891 | [
"MIT"
] | null | null | null | unit_tests/test_osu_apiv1.py | abraker-osu/osu_apiv1 | 3f1cda53200d1761f4215fb414789b3a5d505891 | [
"MIT"
] | null | null | null | unit_tests/test_osu_apiv1.py | abraker-osu/osu_apiv1 | 3f1cda53200d1761f4215fb414789b3a5d505891 | [
"MIT"
] | null | null | null | import unittest
from .api_key import api_key
from osu_apiv1.osu_api import OsuApiv1, OsuApiv1Error
class TestOsuApiv1(unittest.TestCase):
def test_fetch_replay_stream(self):
# Test when replay is unavailable
with self.assertRaises(OsuApiv1Error):
data = OsuApiv1.fetch_replay_stream(... | 39.237288 | 140 | 0.710151 | import unittest
from .api_key import api_key
from osu_apiv1.osu_api import OsuApiv1, OsuApiv1Error
class TestOsuApiv1(unittest.TestCase):
def test_fetch_replay_stream(self):
with self.assertRaises(OsuApiv1Error):
data = OsuApiv1.fetch_replay_stream(beatmap_id=767046, user_name='abra... | true | true |
08f65a6814abec68de541dda8ef2510660c42f30 | 2,222 | py | Python | evm_fm/refresh_environment_variables.py | andrewdieken/evm-fm-python | ce8c082265d5b374d36e37e2ad58223aa5d62a7a | [
"MIT"
] | 1 | 2020-07-31T18:19:06.000Z | 2020-07-31T18:19:06.000Z | evm_fm/refresh_environment_variables.py | andrewdieken/evm-fm-python | ce8c082265d5b374d36e37e2ad58223aa5d62a7a | [
"MIT"
] | null | null | null | evm_fm/refresh_environment_variables.py | andrewdieken/evm-fm-python | ce8c082265d5b374d36e37e2ad58223aa5d62a7a | [
"MIT"
] | null | null | null | import shlex
import subprocess
import sys
from datetime import datetime
import toml
from ssm_parameter_store import EC2ParameterStore
from evm_fm.utils import parse_args, update_environment_variable_file
sys.tracebacklimit=0
def main():
"""Main method
"""
args = parse_args(sys.argv[1:])
# Parse con... | 38.310345 | 155 | 0.686769 | import shlex
import subprocess
import sys
from datetime import datetime
import toml
from ssm_parameter_store import EC2ParameterStore
from evm_fm.utils import parse_args, update_environment_variable_file
sys.tracebacklimit=0
def main():
args = parse_args(sys.argv[1:])
config_file_loc = args.config_file... | true | true |
08f65ad75fccf1e5b506ee0d2d8a3ea7067811ae | 956 | py | Python | sponsors/main.py | marekventur/emfcamp-2018-example-badge-store | 52d8ded5465aa916a83fe3f8dd58eb26140cf042 | [
"MIT"
] | 1 | 2018-08-30T21:15:56.000Z | 2018-08-30T21:15:56.000Z | sponsors/main.py | marekventur/emfcamp-2018-example-badge-store | 52d8ded5465aa916a83fe3f8dd58eb26140cf042 | [
"MIT"
] | null | null | null | sponsors/main.py | marekventur/emfcamp-2018-example-badge-store | 52d8ded5465aa916a83fe3f8dd58eb26140cf042 | [
"MIT"
] | null | null | null | """Shows all the sponsors that have helped make this badge possible"""
___categories___ = ["Other"]
___license___ = "MIT"
import ugfx, pyb, buttons
ugfx.init()
ugfx.clear()
buttons.init()
ugfx.set_default_font(ugfx.FONT_NAME)
def screen_1():
ugfx.display_image(0, 0, "splash1.bmp")
def screen_2():
ugfx.di... | 23.9 | 144 | 0.693515 | ___categories___ = ["Other"]
___license___ = "MIT"
import ugfx, pyb, buttons
ugfx.init()
ugfx.clear()
buttons.init()
ugfx.set_default_font(ugfx.FONT_NAME)
def screen_1():
ugfx.display_image(0, 0, "splash1.bmp")
def screen_2():
ugfx.display_image(0, 0, "apps/sponsors/sponsors.gif")
def screen_3():
ug... | true | true |
08f65ba35904c4f0aed377a119568f088e4d516f | 5,382 | py | Python | pydevices/RfxDevices/MARTE_EDA3.py | zack-vii/mdsplus | 7c631281d22e993599dbdf7bd31782035af92688 | [
"BSD-2-Clause"
] | 1 | 2019-09-02T13:40:23.000Z | 2019-09-02T13:40:23.000Z | pydevices/RfxDevices/MARTE_EDA3.py | zack-vii/mdsplus | 7c631281d22e993599dbdf7bd31782035af92688 | [
"BSD-2-Clause"
] | 4 | 2019-10-29T09:06:32.000Z | 2020-03-26T22:09:39.000Z | pydevices/RfxDevices/MARTE_EDA3.py | zack-vii/mdsplus | 7c631281d22e993599dbdf7bd31782035af92688 | [
"BSD-2-Clause"
] | 2 | 2019-10-29T08:54:27.000Z | 2020-05-18T09:59:39.000Z | #
# Copyright (c) 2017, Massachusetts Institute of Technology All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list o... | 67.275 | 201 | 0.70327 |
try:
MARTE_GENERIC = __import__('MARTE_GENERIC', globals(), level=1).MARTE_GENERIC
except:
MARTE_GENERIC = __import__('MARTE_GENERIC', globals()).MARTE_GENERIC
class MARTE_EDA3(MARTE_GENERIC):
parNames = ['tauVTheta','tauVTor','tauD','kp','ki','kd','vCompOn','iCompOn','iFBOn','iPTrig','tTrig',
'del... | true | true |
08f65c4f8c01292d561993f21d1582f5fa307ab3 | 169 | py | Python | output/models/sun_data/elem_decl/identity_constraint_defs/id_constr_defs00501m/id_constr_defs00501m_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/sun_data/elem_decl/identity_constraint_defs/id_constr_defs00501m/id_constr_defs00501m_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/sun_data/elem_decl/identity_constraint_defs/id_constr_defs00501m/id_constr_defs00501m_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from output.models.sun_data.elem_decl.identity_constraint_defs.id_constr_defs00501m.id_constr_defs00501m_xsd.id_constr_defs00501m import Root
__all__ = [
"Root",
]
| 28.166667 | 141 | 0.840237 | from output.models.sun_data.elem_decl.identity_constraint_defs.id_constr_defs00501m.id_constr_defs00501m_xsd.id_constr_defs00501m import Root
__all__ = [
"Root",
]
| true | true |
08f65c54bdfc908b38ef03032d44ac04a96e3593 | 7,469 | py | Python | testscripts/RDKB/component/WIFIHAL/TS_WIFIHAL_5GHzGetWiFiTrafficStats.py | rdkcmf/rdkb-tools-tdkb | 9f9c3600cd701d5fc90ac86a6394ebd28d49267e | [
"Apache-2.0"
] | null | null | null | testscripts/RDKB/component/WIFIHAL/TS_WIFIHAL_5GHzGetWiFiTrafficStats.py | rdkcmf/rdkb-tools-tdkb | 9f9c3600cd701d5fc90ac86a6394ebd28d49267e | [
"Apache-2.0"
] | null | null | null | testscripts/RDKB/component/WIFIHAL/TS_WIFIHAL_5GHzGetWiFiTrafficStats.py | rdkcmf/rdkb-tools-tdkb | 9f9c3600cd701d5fc90ac86a6394ebd28d49267e | [
"Apache-2.0"
] | null | null | null | ##########################################################################
# If not stated otherwise in this file or this component's Licenses.txt
# file the following copyright and licenses apply:
#
# Copyright 2020 RDK Management
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use th... | 47.573248 | 316 | 0.701299 | # file the following copyright and licenses apply:
#
# Copyright 2020 RDK Management
#
# 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 ... | false | true |
08f65c9efdc1bc73c6f62053c979d6067b676dec | 889 | py | Python | comment/urls.py | Skchoudhary/blog-comment | 320a73ec4159a9d7170f78a7ec5539077a5916b5 | [
"Apache-2.0"
] | null | null | null | comment/urls.py | Skchoudhary/blog-comment | 320a73ec4159a9d7170f78a7ec5539077a5916b5 | [
"Apache-2.0"
] | null | null | null | comment/urls.py | Skchoudhary/blog-comment | 320a73ec4159a9d7170f78a7ec5539077a5916b5 | [
"Apache-2.0"
] | null | null | null | """comment URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based... | 34.192308 | 77 | 0.701912 | from django.contrib import admin
from django.urls.conf import include
from django.urls import path
urlpatterns = [
path('admin/', admin.site.urls),
path('api/pages/', include("pages.api.urls")),
path('api/comments/', include("cs.api.urls")),
]
| true | true |
08f65d9f86814cf366e67cf94f1c85726571ee5b | 8,827 | py | Python | ML/HW-5/hw5code.py | Panesher/Machine-Learning | dcc46c7816af209c5f031feb84a0eb3b2b5d9515 | [
"MIT"
] | null | null | null | ML/HW-5/hw5code.py | Panesher/Machine-Learning | dcc46c7816af209c5f031feb84a0eb3b2b5d9515 | [
"MIT"
] | null | null | null | ML/HW-5/hw5code.py | Panesher/Machine-Learning | dcc46c7816af209c5f031feb84a0eb3b2b5d9515 | [
"MIT"
] | null | null | null | import numpy as np
from collections import Counter
from sklearn.base import BaseEstimator, ClassifierMixin
def find_best_split(feature_vector, target_vector):
"""
Под критерием Джини здесь подразумевается следующая функция:
$$Q(R) = -\frac {|R_l|}{|R|}H(R_l) -\frac {|R_r|}{|R|}H(R_r)$$,
$R$ — множество... | 42.642512 | 120 | 0.606661 | import numpy as np
from collections import Counter
from sklearn.base import BaseEstimator, ClassifierMixin
def find_best_split(feature_vector, target_vector):
fv, tv = np.array(feature_vector), np.array(target_vector)
if np.unique(fv).shape[0] < 2:
return np.zeros(1), np.zeros(1), 0, 0
idx = n... | true | true |
08f65f11e47b157faa9a48c6b082872a7ff5bab9 | 1,635 | py | Python | azure/mgmt/network/v2017_11_01/models/troubleshooting_recommended_actions.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | azure/mgmt/network/v2017_11_01/models/troubleshooting_recommended_actions.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | azure/mgmt/network/v2017_11_01/models/troubleshooting_recommended_actions.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"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.
# C... | 38.928571 | 97 | 0.617125 |
from msrest.serialization import Model
class TroubleshootingRecommendedActions(Model):
_attribute_map = {
'action_id': {'key': 'actionId', 'type': 'str'},
'action_text': {'key': 'actionText', 'type': 'str'},
'action_uri': {'key': 'actionUri', 'type': 'str'},
'action_uri... | true | true |
08f6601350fe8dbaa1f22198f9d583d541eef607 | 17,550 | py | Python | src/transformers/modeling_tf_flaubert.py | JetRunner/transformers | 8e0cf02467bce017885cd3dc1f37c84794dd7da4 | [
"Apache-2.0"
] | 6 | 2020-10-07T02:03:27.000Z | 2021-07-22T02:35:13.000Z | src/transformers/modeling_tf_flaubert.py | JetRunner/transformers | 8e0cf02467bce017885cd3dc1f37c84794dd7da4 | [
"Apache-2.0"
] | null | null | null | src/transformers/modeling_tf_flaubert.py | JetRunner/transformers | 8e0cf02467bce017885cd3dc1f37c84794dd7da4 | [
"Apache-2.0"
] | 4 | 2020-04-04T15:41:10.000Z | 2020-06-27T14:30:54.000Z | # coding=utf-8
# Copyright 2019-present, Facebook, Inc and the HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... | 47.177419 | 159 | 0.649573 |
import logging
import random
import tensorflow as tf
from .configuration_flaubert import FlaubertConfig
from .file_utils import add_start_docstrings
from .modeling_tf_utils import keras_serializable, shape_list
from .modeling_tf_xlm import (
TFXLMForMultipleChoice,
TFXLMForQuestionAnsweringSimple,
TFXLMF... | true | true |
08f660156970c4079d8f0fa581a41357ced93a10 | 326 | py | Python | tests/ut/test_common_object.py | CTERA-Networks/ctera-python-sdk | 35d9cb6949590e664fd237d29f54ce054fe80a9e | [
"Apache-2.0"
] | 5 | 2020-02-25T22:34:48.000Z | 2020-02-29T22:56:39.000Z | tests/ut/test_common_object.py | ctera/ctera-python-sdk | a86cb575d538620a12f326fe5e92f5abb5cc1f6b | [
"Apache-2.0"
] | 16 | 2020-03-25T19:12:03.000Z | 2021-06-02T14:45:34.000Z | tests/ut/test_common_object.py | ctera/ctera-python-sdk | a86cb575d538620a12f326fe5e92f5abb5cc1f6b | [
"Apache-2.0"
] | 3 | 2020-10-22T18:22:06.000Z | 2021-10-03T18:38:41.000Z | import json
from cterasdk.common.object import Object
from tests.ut import base
class TestCommonObject(base.BaseTest):
def test_str(self):
o = Object()
o.user = 'user'
object_str = str(o)
object_str_json = json.loads(object_str)
self.assertEqual(object_str_json['user'], o.... | 23.285714 | 57 | 0.668712 | import json
from cterasdk.common.object import Object
from tests.ut import base
class TestCommonObject(base.BaseTest):
def test_str(self):
o = Object()
o.user = 'user'
object_str = str(o)
object_str_json = json.loads(object_str)
self.assertEqual(object_str_json['user'], o.... | true | true |
08f660474f1afd9af560a87d553384fab20071ff | 1,033 | py | Python | server.py | exue026/spam-detection-model | 1a8afc4b4403ef49d8ebbdb5fbcb56c643996b1d | [
"MIT"
] | null | null | null | server.py | exue026/spam-detection-model | 1a8afc4b4403ef49d8ebbdb5fbcb56c643996b1d | [
"MIT"
] | null | null | null | server.py | exue026/spam-detection-model | 1a8afc4b4403ef49d8ebbdb5fbcb56c643996b1d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Very simple HTTP server in python.
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost
Send a HEAD request::
curl -I http://localhost
Send a POST request::
curl -d "foo=bar&bin=baz" http://localhost
"""
from http.server import BaseHTTPRequestHandle... | 26.487179 | 82 | 0.656341 | from http.server import BaseHTTPRequestHandler, HTTPServer
import json
class S(BaseHTTPRequestHandler):
def _set_headers(self):
self.send_response(200)
self.send_header('Content-type', 'application/json')
self.end_headers()
def do_GET(self):
self._set_headers()
self.wfi... | true | true |
08f660f66da20c311069f412aee62208d1b302a8 | 2,529 | py | Python | functional/tests/identity/v3/test_idp.py | redhat-openstack/python-openstackclient | 7dc2e1dc08b0692a3accb343c62451fb3d83f4cd | [
"Apache-2.0"
] | null | null | null | functional/tests/identity/v3/test_idp.py | redhat-openstack/python-openstackclient | 7dc2e1dc08b0692a3accb343c62451fb3d83f4cd | [
"Apache-2.0"
] | null | null | null | functional/tests/identity/v3/test_idp.py | redhat-openstack/python-openstackclient | 7dc2e1dc08b0692a3accb343c62451fb3d83f4cd | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 45.981818 | 79 | 0.658758 |
from functional.tests.identity.v3 import test_identity
from tempest.lib.common.utils import data_utils
class IdentityProviderTests(test_identity.IdentityTests):
def test_idp_create(self):
self._create_dummy_idp()
def test_idp_delete(self):
identity_provider = self._create_dummy_idp(add_... | true | true |
08f6611005b7aee42126b9d30f01fb3865c06b55 | 2,855 | py | Python | src/backtracking/CicloHamiltoniano.py | Trees-Over-The-Lake/B-B-e-B | 9396ba078d282ff11badf4ee9699ea3fdd3882bf | [
"MIT"
] | null | null | null | src/backtracking/CicloHamiltoniano.py | Trees-Over-The-Lake/B-B-e-B | 9396ba078d282ff11badf4ee9699ea3fdd3882bf | [
"MIT"
] | null | null | null | src/backtracking/CicloHamiltoniano.py | Trees-Over-The-Lake/B-B-e-B | 9396ba078d282ff11badf4ee9699ea3fdd3882bf | [
"MIT"
] | null | null | null |
# Algoritmo em python para resolver o problema do ciclo hamiltoniano com Backtracking
class Grafo():
def __init__(self, vertices):
self.grafo = [[0 for column in range(vertices)]
for row in range(vertices)]
self.V = vertices
# Verifica se este vértice é um vértice adj... | 31.373626 | 193 | 0.570578 |
class Grafo():
def __init__(self, vertices):
self.grafo = [[0 for column in range(vertices)]
for row in range(vertices)]
self.V = vertices
def isSafe(self, v, pos, caminho):
if self.grafo[ caminho[pos-1] ][v] == 0:
return False
... | true | true |
08f662254be011c678ea24c7b92ab7794415bc70 | 6,606 | py | Python | PlugFlowCrystallizer_Input.py | gauravsdeshmukh/PlugFlowCrystallizer | 684e80438ef2912fab60201f305f7c288d4b5274 | [
"Apache-2.0"
] | null | null | null | PlugFlowCrystallizer_Input.py | gauravsdeshmukh/PlugFlowCrystallizer | 684e80438ef2912fab60201f305f7c288d4b5274 | [
"Apache-2.0"
] | null | null | null | PlugFlowCrystallizer_Input.py | gauravsdeshmukh/PlugFlowCrystallizer | 684e80438ef2912fab60201f305f7c288d4b5274 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Jul 27 17:33:26 2018
@author: Gaurav
"""
import scipy as sci
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from PlugFlowCrystallizer import *
###############################################################################
##########################... | 31.014085 | 81 | 0.468665 |
import scipy as sci
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from PlugFlowCrystallizer import *
length=10
breadth=0.4
colpts=150
rowpts=40
time=100
crystal_timedelay=20 CFL_number=0.1 file_flag=1 file_interval=50 plot_flag=1 rho=1
mu=0.01
k=0.6
cp=41.8
D=1.5e-02
MW=101.1032
kg=1.161... | true | true |
08f6629d30a5596e091d6914042d3c4dbf7ca4ee | 8,463 | py | Python | PokerRL/eval/rl_br/workers/la/Local_RLBR_LearnerActor.py | EricSteinberger/DREAM | bfe21bbb0f60ab27a1af9774308efbbbd41e68c4 | [
"MIT"
] | 78 | 2020-06-21T09:45:39.000Z | 2022-03-28T11:39:38.000Z | PokerRL/eval/rl_br/workers/la/Local_RLBR_LearnerActor.py | EricSteinberger/DREAM | bfe21bbb0f60ab27a1af9774308efbbbd41e68c4 | [
"MIT"
] | 5 | 2020-06-26T05:21:57.000Z | 2021-04-11T11:03:27.000Z | PokerRL/eval/rl_br/workers/la/Local_RLBR_LearnerActor.py | EricSteinberger/DREAM | bfe21bbb0f60ab27a1af9774308efbbbd41e68c4 | [
"MIT"
] | 18 | 2020-06-22T16:05:57.000Z | 2021-11-13T07:29:34.000Z | import numpy as np
from PokerRL.eval.rl_br import _util
from PokerRL.rl import rl_util
from PokerRL.rl.agent_modules.DDQN import DDQN
from PokerRL.rl.base_cls.workers.WorkerBase import WorkerBase
class Local_RLBR_LearnerActor(WorkerBase):
def __init__(self, t_prof, chief_handle, eval_agent_cls):
super()... | 45.745946 | 120 | 0.584544 | import numpy as np
from PokerRL.eval.rl_br import _util
from PokerRL.rl import rl_util
from PokerRL.rl.agent_modules.DDQN import DDQN
from PokerRL.rl.base_cls.workers.WorkerBase import WorkerBase
class Local_RLBR_LearnerActor(WorkerBase):
def __init__(self, t_prof, chief_handle, eval_agent_cls):
super()... | true | true |
08f662f0ba7ba738a4696e1399e51673bf6df2dc | 17,142 | py | Python | python/cudf/cudf/tests/test_stats.py | res-life/cudf | 94a5d4180b1281d4250e9f915e547789d8da3ce0 | [
"Apache-2.0"
] | null | null | null | python/cudf/cudf/tests/test_stats.py | res-life/cudf | 94a5d4180b1281d4250e9f915e547789d8da3ce0 | [
"Apache-2.0"
] | null | null | null | python/cudf/cudf/tests/test_stats.py | res-life/cudf | 94a5d4180b1281d4250e9f915e547789d8da3ce0 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018-2022, NVIDIA CORPORATION.
from concurrent.futures import ThreadPoolExecutor
import cupy as cp
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf.datasets import randomdata
from cudf.testing._utils import assert_eq, assert_exceptions_equal
params_dtypes = [np.int32, np.ui... | 28.240527 | 79 | 0.606872 |
from concurrent.futures import ThreadPoolExecutor
import cupy as cp
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf.datasets import randomdata
from cudf.testing._utils import assert_eq, assert_exceptions_equal
params_dtypes = [np.int32, np.uint32, np.float32, np.float64]
methods = ["min",... | true | true |
08f663d2ca1a494a0c9a3f635a398fcd751c121a | 523 | py | Python | exercises/en/exc_01_04.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/en/exc_01_04.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/en/exc_01_04.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | from spacy.lang.en import English
nlp = English()
# Process the text
doc = nlp(
"In 1990, more than 60% of people in East Asia were in extreme poverty. "
"Now less than 4% are."
)
# Iterate over the tokens in the doc
for token in doc:
# Check if the token resembles a number
if ____.____:
# Ge... | 26.15 | 77 | 0.630975 | from spacy.lang.en import English
nlp = English()
doc = nlp(
"In 1990, more than 60% of people in East Asia were in extreme poverty. "
"Now less than 4% are."
)
for token in doc:
if ____.____:
next_token = ____[____]
if next_token.____ == "%":
print("Percen... | true | true |
08f663e4babf5eda94c4ccc758de8780b82404e6 | 1,849 | py | Python | devscripts/check-porn.py | nxtreaming/yt-dlp | 385ffb467b2285e85a2a5495b90314ba1f8e0700 | [
"Unlicense"
] | 11 | 2022-01-06T22:09:50.000Z | 2022-03-12T22:26:22.000Z | devscripts/check-porn.py | nxtreaming/yt-dlp | 385ffb467b2285e85a2a5495b90314ba1f8e0700 | [
"Unlicense"
] | 4 | 2022-02-25T08:20:18.000Z | 2022-03-17T16:16:20.000Z | devscripts/check-porn.py | nxtreaming/yt-dlp | 385ffb467b2285e85a2a5495b90314ba1f8e0700 | [
"Unlicense"
] | 3 | 2022-02-19T08:59:13.000Z | 2022-03-06T16:11:21.000Z | #!/usr/bin/env python3
"""
This script employs a VERY basic heuristic ('porn' in webpage.lower()) to check
if we are not 'age_limit' tagging some porn site
A second approach implemented relies on a list of porn domains, to activate it
pass the list filename as the only argument
"""
# Allow direct execution
import os
... | 30.816667 | 83 | 0.620335 |
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import gettestcases
from yt_dlp.utils import compat_urllib_parse_urlparse, compat_urllib_request
if len(sys.argv) > 1:
METHOD = 'LIST'
LIST = open(sys.argv[1]).read().decode('utf8').strip()... | true | true |
08f664e23f3c3b03287eebbba676c2b7b5cf54ec | 1,733 | py | Python | evaluation/combine.py | Knuust/Semantic-Password-Generator | d10b8bd3f5871359efae6e046aac76cd22868680 | [
"BSD-3-Clause"
] | null | null | null | evaluation/combine.py | Knuust/Semantic-Password-Generator | d10b8bd3f5871359efae6e046aac76cd22868680 | [
"BSD-3-Clause"
] | null | null | null | evaluation/combine.py | Knuust/Semantic-Password-Generator | d10b8bd3f5871359efae6e046aac76cd22868680 | [
"BSD-3-Clause"
] | 1 | 2022-02-23T13:48:34.000Z | 2022-02-23T13:48:34.000Z | import pickle
from tqdm import tqdm
def load_password_list(file_name):
file = open(file_name, "r", encoding='latin1')
password_list = [line.rstrip() for line in file.readlines()]
return password_list
def guess_percentage(test_list, suggestion_list):
return len(set(suggestion_list).intersection(set(tes... | 33.980392 | 112 | 0.747836 | import pickle
from tqdm import tqdm
def load_password_list(file_name):
file = open(file_name, "r", encoding='latin1')
password_list = [line.rstrip() for line in file.readlines()]
return password_list
def guess_percentage(test_list, suggestion_list):
return len(set(suggestion_list).intersection(set(tes... | true | true |
08f665f7d2b2b6298f44743d2a2eb8322ac61c70 | 12,697 | py | Python | nova/cmd/baremetal_deploy_helper.py | bopopescu/nova-28 | add7f5625ba49c0575328294a796428c443cd988 | [
"Apache-2.0"
] | 1 | 2021-09-10T15:29:02.000Z | 2021-09-10T15:29:02.000Z | nova/cmd/baremetal_deploy_helper.py | PFZheng/nova | 84be8abbccb5ddc2d7c5a7db59019ed1edb19e7f | [
"Apache-2.0"
] | null | null | null | nova/cmd/baremetal_deploy_helper.py | PFZheng/nova | 84be8abbccb5ddc2d7c5a7db59019ed1edb19e7f | [
"Apache-2.0"
] | 1 | 2020-07-24T06:47:54.000Z | 2020-07-24T06:47:54.000Z | # Copyright (c) 2012 NTT DOCOMO, 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
#
# Unless requ... | 33.679045 | 79 | 0.587462 |
import os
import sys
import threading
import time
import cgi
import Queue
import re
import socket
import stat
from wsgiref import simple_server
from nova import config
from nova import context as nova_context
from nova import objects
from nova.openstack.common import excutils
from nova.openstack.common.gettextutil... | true | true |
08f666491ed475709550bd1988db5cdb4d66c125 | 529 | py | Python | database.py | Farbafe/DoWhatWhenBackend | 0629712a4198ec382036854efb1bdb63f3b106b8 | [
"MIT"
] | null | null | null | database.py | Farbafe/DoWhatWhenBackend | 0629712a4198ec382036854efb1bdb63f3b106b8 | [
"MIT"
] | null | null | null | database.py | Farbafe/DoWhatWhenBackend | 0629712a4198ec382036854efb1bdb63f3b106b8 | [
"MIT"
] | null | null | null | from sqlalchemy import create_engine
import urllib
import os
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from dotenv import load_dotenv
load_dotenv()
SQLALCHEMY_DATABASE_URL = "postgres://{}:{}@localhost:5432/fastapitutorial".format(os.getenv("DATABASE_USERNAME"), ... | 31.117647 | 171 | 0.826087 | from sqlalchemy import create_engine
import urllib
import os
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from dotenv import load_dotenv
load_dotenv()
SQLALCHEMY_DATABASE_URL = "postgres://{}:{}@localhost:5432/fastapitutorial".format(os.getenv("DATABASE_USERNAME"), ... | true | true |
08f66665c30094249868cdfdd096a02f7e174257 | 23,080 | py | Python | tests.py | Rashomon5487/TextRecognitionDataGenerator | d029d2518bd8a8b9de670ec295e61fd65a26a025 | [
"MIT"
] | 1 | 2020-06-29T19:39:15.000Z | 2020-06-29T19:39:15.000Z | tests.py | Rashomon5487/TextRecognitionDataGenerator | d029d2518bd8a8b9de670ec295e61fd65a26a025 | [
"MIT"
] | 6 | 2020-09-25T22:41:28.000Z | 2022-02-09T23:38:46.000Z | tests.py | Rashomon5487/TextRecognitionDataGenerator | d029d2518bd8a8b9de670ec295e61fd65a26a025 | [
"MIT"
] | 1 | 2020-05-31T12:21:47.000Z | 2020-05-31T12:21:47.000Z | import os
import sys
import unittest
import subprocess
import hashlib
import string
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "./trdg")))
try:
os.mkdir("tests/out")
except:
pass
from trdg.data_generator import FakeTextDataGenerator
from trdg import background_generator
from t... | 26.46789 | 95 | 0.45325 | import os
import sys
import unittest
import subprocess
import hashlib
import string
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "./trdg")))
try:
os.mkdir("tests/out")
except:
pass
from trdg.data_generator import FakeTextDataGenerator
from trdg import background_generator
from t... | true | true |
08f666d0b3874150e96d9cb884118bea7aa0db36 | 1,336 | py | Python | torchx/schedulers/test/registry_test.py | LaudateCorpus1/torchx | 9ee0fdbf63882ba836c00d7522f6850c0c6dc418 | [
"BSD-3-Clause"
] | 101 | 2021-06-12T20:00:09.000Z | 2022-03-31T11:14:35.000Z | torchx/schedulers/test/registry_test.py | LaudateCorpus1/torchx | 9ee0fdbf63882ba836c00d7522f6850c0c6dc418 | [
"BSD-3-Clause"
] | 340 | 2021-06-14T18:16:12.000Z | 2022-03-31T21:10:28.000Z | torchx/schedulers/test/registry_test.py | LaudateCorpus1/torchx | 9ee0fdbf63882ba836c00d7522f6850c0c6dc418 | [
"BSD-3-Clause"
] | 19 | 2021-06-13T06:17:21.000Z | 2022-03-28T19:28:00.000Z | #!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from typing import Any, Dict, Optional
from unittest.mock import MagicMo... | 35.157895 | 80 | 0.74476 |
import unittest
from typing import Any, Dict, Optional
from unittest.mock import MagicMock, patch
from torchx.schedulers import get_schedulers, get_default_scheduler_name
from torchx.schedulers.docker_scheduler import DockerScheduler
from torchx.schedulers.local_scheduler import LocalScheduler
class spy_load_group:... | true | true |
08f6679223d16f91c196e676af4eec99db9eec78 | 491 | py | Python | electionleaflets/apps/parties/templatetags/party_tags.py | electionleaflets/electionleaflets | 4110e96a3035c32d0b6ff3c9f832c5e003728170 | [
"MIT"
] | null | null | null | electionleaflets/apps/parties/templatetags/party_tags.py | electionleaflets/electionleaflets | 4110e96a3035c32d0b6ff3c9f832c5e003728170 | [
"MIT"
] | 23 | 2015-02-19T14:02:23.000Z | 2015-04-30T11:14:01.000Z | electionleaflets/apps/parties/templatetags/party_tags.py | electionleaflets/electionleaflets | 4110e96a3035c32d0b6ff3c9f832c5e003728170 | [
"MIT"
] | 2 | 2015-02-02T19:39:54.000Z | 2017-02-08T09:19:53.000Z | from django import template
from django.conf import settings
from leaflets.models import Leaflet
from django.db.models import Count
register = template.Library()
@register.inclusion_tag('parties/ordered_list.html')
def party_list_by_count():
from parties.models import Party
from datetime import datetime
w... | 32.733333 | 66 | 0.751527 | from django import template
from django.conf import settings
from leaflets.models import Leaflet
from django.db.models import Count
register = template.Library()
@register.inclusion_tag('parties/ordered_list.html')
def party_list_by_count():
from parties.models import Party
from datetime import datetime
w... | true | true |
08f667f696d50abad137529dcaa4beb274e5db9e | 101 | py | Python | tdfscrape-runner.py | bradsokol/tdf-scrape | 87cc51eb3df3e953460e675b146ae1a5def36e38 | [
"Apache-2.0"
] | null | null | null | tdfscrape-runner.py | bradsokol/tdf-scrape | 87cc51eb3df3e953460e675b146ae1a5def36e38 | [
"Apache-2.0"
] | null | null | null | tdfscrape-runner.py | bradsokol/tdf-scrape | 87cc51eb3df3e953460e675b146ae1a5def36e38 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
from tdfscrape.tdfscrape import main
if __name__ == '__main__':
main()
| 12.625 | 36 | 0.683168 |
from tdfscrape.tdfscrape import main
if __name__ == '__main__':
main()
| true | true |
08f6692c647583eaf13b1ddfb047f70a4bf0ed0c | 45,850 | py | Python | retrain_serving.py | arjun921/image-classification-for-dummies | acefcd557699500d44902d17009da17820f289fc | [
"MIT"
] | 6 | 2018-10-03T04:48:36.000Z | 2020-05-14T15:38:20.000Z | retrain_serving.py | arjun921/image-classification-for-dummies | acefcd557699500d44902d17009da17820f289fc | [
"MIT"
] | 2 | 2020-09-25T23:47:22.000Z | 2022-02-10T00:19:24.000Z | retrain_serving.py | arjun921/image-classification-for-dummies | acefcd557699500d44902d17009da17820f289fc | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
from datetime import datetime
import hashlib
import os.path
import random
import re
import struct
import sys
import tarfile
import numpy as np
from six.moves import urllib
impor... | 41.681818 | 140 | 0.678561 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
from datetime import datetime
import hashlib
import os.path
import random
import re
import struct
import sys
import tarfile
import numpy as np
from six.moves import urllib
impor... | true | true |
08f6698e70e430cc31db9a7b8bfd1d91fed33938 | 36,119 | py | Python | bitbots_recordui_rqt/src/bitbots_recordui_rqt/record_ui.py | Zcyyy/bitbots_motion | c35640f14075b36b825f5dd6f2656a54fd60d909 | [
"MIT"
] | null | null | null | bitbots_recordui_rqt/src/bitbots_recordui_rqt/record_ui.py | Zcyyy/bitbots_motion | c35640f14075b36b825f5dd6f2656a54fd60d909 | [
"MIT"
] | null | null | null | bitbots_recordui_rqt/src/bitbots_recordui_rqt/record_ui.py | Zcyyy/bitbots_motion | c35640f14075b36b825f5dd6f2656a54fd60d909 | [
"MIT"
] | 2 | 2019-09-18T06:01:08.000Z | 2020-11-13T05:12:13.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import rospkg
import rospy
import time
import math
import inspect
from copy import deepcopy
from python_qt_binding.QtCore import Qt, QMetaType, QDataStream, QVariant, pyqtSignal
from python_qt_binding import loadUi
from rqt_gui_py.plugin import Plugin
from python_qt_bindi... | 39.954646 | 157 | 0.596667 | import rospkg
import rospy
import time
import math
import inspect
from copy import deepcopy
from python_qt_binding.QtCore import Qt, QMetaType, QDataStream, QVariant, pyqtSignal
from python_qt_binding import loadUi
from rqt_gui_py.plugin import Plugin
from python_qt_binding.QtWidgets import QMainWindow, QTreeWidget, Q... | true | true |
08f66a18b49f0629899fe19c8ae4de0428484c84 | 25,355 | py | Python | wagtail/contrib/postgres_search/backend.py | samgans/wagtail | 48a8af71e5333fb701476702bd784fa407567e25 | [
"BSD-3-Clause"
] | 1 | 2021-04-29T03:15:20.000Z | 2021-04-29T03:15:20.000Z | wagtail/contrib/postgres_search/backend.py | samgans/wagtail | 48a8af71e5333fb701476702bd784fa407567e25 | [
"BSD-3-Clause"
] | 6 | 2020-08-26T03:00:03.000Z | 2020-09-24T02:59:14.000Z | wagtail/contrib/postgres_search/backend.py | samgans/wagtail | 48a8af71e5333fb701476702bd784fa407567e25 | [
"BSD-3-Clause"
] | 1 | 2021-02-15T18:59:53.000Z | 2021-02-15T18:59:53.000Z | import warnings
from collections import OrderedDict
from functools import reduce
from django import VERSION as DJANGO_VERSION
from django.contrib.postgres.search import SearchQuery, SearchRank, SearchVector
from django.db import DEFAULT_DB_ALIAS, NotSupportedError, connections, transaction
from django.db.models import... | 36.015625 | 145 | 0.629028 | import warnings
from collections import OrderedDict
from functools import reduce
from django import VERSION as DJANGO_VERSION
from django.contrib.postgres.search import SearchQuery, SearchRank, SearchVector
from django.db import DEFAULT_DB_ALIAS, NotSupportedError, connections, transaction
from django.db.models import... | true | true |
08f66bb434de4153d657b591d84910b52cf4b43d | 1,628 | py | Python | byro_fints/migrations/0004_auto_20180828_2153.py | MoritzFago/byro-fints | e526ca81f745986a2a6b5b4967e852e18aab3ffd | [
"Apache-2.0"
] | 7 | 2019-05-06T23:43:11.000Z | 2022-01-07T16:24:44.000Z | byro_fints/migrations/0004_auto_20180828_2153.py | MoritzFago/byro-fints | e526ca81f745986a2a6b5b4967e852e18aab3ffd | [
"Apache-2.0"
] | 2 | 2020-03-28T14:59:00.000Z | 2022-03-11T21:12:07.000Z | byro_fints/migrations/0004_auto_20180828_2153.py | MoritzFago/byro-fints | e526ca81f745986a2a6b5b4967e852e18aab3ffd | [
"Apache-2.0"
] | 1 | 2020-03-23T01:59:52.000Z | 2020-03-23T01:59:52.000Z | # Generated by Django 2.1 on 2018-08-28 21:53
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('byro_fints', '0003_auto_20... | 37 | 148 | 0.626536 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('byro_fints', '0003_auto_20180607_1548'),
]
operations = [
... | true | true |
08f66cc2398098fe9c1ce839957b1fad22c2839f | 62,684 | py | Python | idaes/generic_models/properties/helmholtz/helmholtz.py | eyoung55/idaes-pse | 01a6d795d484155923baabcfc2878d5285b8c9b1 | [
"RSA-MD"
] | 112 | 2019-02-11T23:16:36.000Z | 2022-03-23T20:59:57.000Z | idaes/generic_models/properties/helmholtz/helmholtz.py | eyoung55/idaes-pse | 01a6d795d484155923baabcfc2878d5285b8c9b1 | [
"RSA-MD"
] | 621 | 2019-03-01T14:44:12.000Z | 2022-03-31T19:49:25.000Z | idaes/generic_models/properties/helmholtz/helmholtz.py | eyoung55/idaes-pse | 01a6d795d484155923baabcfc2878d5285b8c9b1 | [
"RSA-MD"
] | 154 | 2019-02-01T23:46:33.000Z | 2022-03-23T15:07:10.000Z | #################################################################################
# The Institute for the Design of Advanced Energy Systems Integrated Platform
# Framework (IDAES IP) was produced under the DOE Institute for the
# Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021
# by the softwar... | 39.698543 | 83 | 0.58613 | __author__ = "John Eslick"
import os
import enum
from pyomo.environ import (
Constraint,
Expression,
Param,
PositiveReals,
Set,
value,
Var,
ConcreteModel,
units as pyunits
)
from pyomo.environ import ExternalFunction as EF
from pyomo.common.collections import ComponentSet
from pyom... | true | true |
08f66d16b3a0078e48ce26cf2fc376449ab2adf6 | 252 | py | Python | imposer/env.py | anqurvanillapy/imposer | af6f9fffe9c48a402a5a4b8d32ca9c26cd7b1ffb | [
"MIT"
] | null | null | null | imposer/env.py | anqurvanillapy/imposer | af6f9fffe9c48a402a5a4b8d32ca9c26cd7b1ffb | [
"MIT"
] | null | null | null | imposer/env.py | anqurvanillapy/imposer | af6f9fffe9c48a402a5a4b8d32ca9c26cd7b1ffb | [
"MIT"
] | null | null | null | """\
Env
===
Global or function local states for sync.
"""
import threading
class Env:
def __init__(self):
if not threading.current_thread() == threading.main_thread():
raise RuntimeError('Env should be in the main thread')
| 16.8 | 69 | 0.65873 |
import threading
class Env:
def __init__(self):
if not threading.current_thread() == threading.main_thread():
raise RuntimeError('Env should be in the main thread')
| true | true |
08f66d25a04de67055db27665246ed415d06a060 | 3,413 | py | Python | oo/carro.py | eliane-cnc/pythonbirds | 8986a73f7dc84af02e5b753f5df05c9bc2545c5e | [
"MIT"
] | null | null | null | oo/carro.py | eliane-cnc/pythonbirds | 8986a73f7dc84af02e5b753f5df05c9bc2545c5e | [
"MIT"
] | null | null | null | oo/carro.py | eliane-cnc/pythonbirds | 8986a73f7dc84af02e5b753f5df05c9bc2545c5e | [
"MIT"
] | null | null | null | """
Você deve criar uma classe carro que vai possuir
dois atributos compostos por outras duas classes:
1) Motor
2) Direção
O Motor terá a responsabilidade de controlar a velocidade.
Ele oferece os seguintes atributos:
1) Atributo de dado velocidade
2) Método acelerar, que deverá incremetar a velocidade de uma unidade... | 22.019355 | 69 | 0.625256 |
class Carro:
def __init__(self, direcao, motor):
self.motor = motor
self.direcao = direcao
def calcular_velocidade(self):
return self.motor.velocidade
def acelerar(self):
self.motor.acelerar()
def frear(self):
self.motor.frear()
def calcular_direcao(self... | true | true |
08f66eee61fda78896a5e49359556e120618ef21 | 127,628 | py | Python | mne/source_estimate.py | Pandinosaurus/mne-python | 6ae3b22033c745cce5cd5de9b92da54c13c36484 | [
"BSD-3-Clause"
] | null | null | null | mne/source_estimate.py | Pandinosaurus/mne-python | 6ae3b22033c745cce5cd5de9b92da54c13c36484 | [
"BSD-3-Clause"
] | null | null | null | mne/source_estimate.py | Pandinosaurus/mne-python | 6ae3b22033c745cce5cd5de9b92da54c13c36484 | [
"BSD-3-Clause"
] | null | null | null | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Matti Hämäläinen <msh@nmr.mgh.harvard.edu>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Mads Jensen <mje.mads@gmail.com>
#
# License: BSD (3-clause)
import contextlib
import copy
import os.path as op
from types import Generator... | 37.737433 | 89 | 0.58998 |
import contextlib
import copy
import os.path as op
from types import GeneratorType
import numpy as np
from scipy import linalg, sparse
from scipy.sparse import coo_matrix, block_diag as sparse_block_diag
from .baseline import rescale
from .cov import Covariance
from .evoked import _get_peak
from .filter import resam... | true | true |
08f66fcf72b3bdcb18489f0191c68b149363717b | 7,826 | py | Python | gehomesdk/erd/erd_codes.py | warrenrees/gehome | 6a40f15cfd0738aa7e2ac74b2d8d87780fc07ec8 | [
"MIT"
] | null | null | null | gehomesdk/erd/erd_codes.py | warrenrees/gehome | 6a40f15cfd0738aa7e2ac74b2d8d87780fc07ec8 | [
"MIT"
] | null | null | null | gehomesdk/erd/erd_codes.py | warrenrees/gehome | 6a40f15cfd0738aa7e2ac74b2d8d87780fc07ec8 | [
"MIT"
] | null | null | null | """ERD Codes for GE appliances"""
import enum
from typing import Union
@enum.unique
class ErdCode(enum.Enum):
"""
ERD codes for GE kitchen appliance properties.
These were mostly lifted from ERD.smali in the the GE SmartHQ app v1.0.3.13
"""
APPLIANCE_TYPE = "0x0008"
CLOCK_FORMAT = "0x0006"
... | 35.73516 | 79 | 0.740225 | import enum
from typing import Union
@enum.unique
class ErdCode(enum.Enum):
APPLIANCE_TYPE = "0x0008"
CLOCK_FORMAT = "0x0006"
CLOCK_TIME = "0x0005"
MODEL_NUMBER = "0x0001"
SABBATH_MODE = "0x0009"
SERIAL_NUMBER = "0x0002"
SOUND_LEVEL = "0x000a"
TEMPERATURE_UNIT = "0x0007"
USER_INTE... | true | true |
08f66fe4499815f82c174977212bf9337b6c7e9e | 795 | py | Python | fextra/urls.py | deejay001/fextra | ac29d1823ccc561a7e902dd1efbf2fa2a95ca841 | [
"Apache-2.0"
] | null | null | null | fextra/urls.py | deejay001/fextra | ac29d1823ccc561a7e902dd1efbf2fa2a95ca841 | [
"Apache-2.0"
] | null | null | null | fextra/urls.py | deejay001/fextra | ac29d1823ccc561a7e902dd1efbf2fa2a95ca841 | [
"Apache-2.0"
] | null | null | null | """fextra URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... | 34.565217 | 77 | 0.701887 | from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('invest.urls')),
]
| true | true |
08f670b62f2dd52f2adce0e20eba50df830685ab | 3,089 | py | Python | 01_Modelos_Supervisionados/1.6_Nearest_Neighbors/1.6.1_Nearest_Neighbors_Nao_Supervisionado.py | BrunoBertti/Scikit_Learning | 4b9e10ff7909f3728ac1e8bba19f5fd779340bc4 | [
"MIT"
] | null | null | null | 01_Modelos_Supervisionados/1.6_Nearest_Neighbors/1.6.1_Nearest_Neighbors_Nao_Supervisionado.py | BrunoBertti/Scikit_Learning | 4b9e10ff7909f3728ac1e8bba19f5fd779340bc4 | [
"MIT"
] | null | null | null | 01_Modelos_Supervisionados/1.6_Nearest_Neighbors/1.6.1_Nearest_Neighbors_Nao_Supervisionado.py | BrunoBertti/Scikit_Learning | 4b9e10ff7909f3728ac1e8bba19f5fd779340bc4 | [
"MIT"
] | null | null | null | ########## 1.6.1. Vizinhos mais próximos não supervisionados ##########
# NearestNeighbors implementa o aprendizado não supervisionado dos vizinhos mais próximos. Ele atua como uma interface uniforme para três algoritmos diferentes de vizinhos mais próximos: BallTree, KDTree e um algoritmo de força bruta baseado ... | 68.644444 | 670 | 0.765944 |
from sklearn.neighbors import NearestNeighbors
import numpy as np
X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]])
nbrs = NearestNeighbors(n_neighbors=2, algorithm='ball_tree').fit(X)
distances, indices = nbrs.kneighbors(X)
print(indices)
print(distances)
print(nbrs.kn... | true | true |
08f670eaee376325f023d5e0c1e6e2ff5a565109 | 1,107 | py | Python | conf/default_settings.py | ZhuoZhuoCrayon/AcousticKeyBoard-Web | 0a0ead78aec7ed03898fd51e076aa57df966508c | [
"MIT"
] | null | null | null | conf/default_settings.py | ZhuoZhuoCrayon/AcousticKeyBoard-Web | 0a0ead78aec7ed03898fd51e076aa57df966508c | [
"MIT"
] | null | null | null | conf/default_settings.py | ZhuoZhuoCrayon/AcousticKeyBoard-Web | 0a0ead78aec7ed03898fd51e076aa57df966508c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import platform
from djangocli.conf.djangocli_settings import * # noqa
DATABASES = {
"default": {
"ENGINE": "django.db.backends.mysql",
"NAME": APP_NAME,
"USER": os.getenv("DC_MYSQL_NAME", "root"),
"PASSWORD": os.getenv("DC_MYSQL_PASSWORD", ""),
"HO... | 24.6 | 108 | 0.610659 | import platform
from djangocli.conf.djangocli_settings import *
DATABASES = {
"default": {
"ENGINE": "django.db.backends.mysql",
"NAME": APP_NAME,
"USER": os.getenv("DC_MYSQL_NAME", "root"),
"PASSWORD": os.getenv("DC_MYSQL_PASSWORD", ""),
"HOST": os.getenv("DC_MYSQL_HOST",... | true | true |
08f6721d6edc5f0f13a42c391cd5051a2081a969 | 75,221 | py | Python | stable_baselines/common/base_class.py | TMmichi/stable-baselines | b55d2de60c90925bdf109e372f86789ad21b5a36 | [
"MIT"
] | null | null | null | stable_baselines/common/base_class.py | TMmichi/stable-baselines | b55d2de60c90925bdf109e372f86789ad21b5a36 | [
"MIT"
] | null | null | null | stable_baselines/common/base_class.py | TMmichi/stable-baselines | b55d2de60c90925bdf109e372f86789ad21b5a36 | [
"MIT"
] | 1 | 2021-07-07T09:10:34.000Z | 2021-07-07T09:10:34.000Z | import os
import glob
import json
import zipfile
import warnings
from abc import ABC, abstractmethod
from collections import OrderedDict, deque
from typing import Union, List, Callable, Optional
import gym
import cloudpickle
import numpy as np
import tensorflow as tf
from stable_baselines.common.misc_util import set_... | 47.729061 | 139 | 0.605762 | import os
import glob
import json
import zipfile
import warnings
from abc import ABC, abstractmethod
from collections import OrderedDict, deque
from typing import Union, List, Callable, Optional
import gym
import cloudpickle
import numpy as np
import tensorflow as tf
from stable_baselines.common.misc_util import set_... | true | true |
08f672bddcb70d711d50c9877e3ba12c9a27b9f3 | 220 | py | Python | sinoera/ganzhi/jisi34.py | sinotradition/sinoera | 1e93482c0a56a8917bc7ceebeef5b63b24ca3651 | [
"Apache-2.0"
] | 1 | 2015-12-14T15:14:35.000Z | 2015-12-14T15:14:35.000Z | sinoera/ganzhi/jisi34.py | sinotradition/sinoera | 1e93482c0a56a8917bc7ceebeef5b63b24ca3651 | [
"Apache-2.0"
] | null | null | null | sinoera/ganzhi/jisi34.py | sinotradition/sinoera | 1e93482c0a56a8917bc7ceebeef5b63b24ca3651 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#coding=utf-8
'''
@author: sheng
@contact: sinotradition@gmail.com
@copyright: License according to the project license.
'''
NAME='jisi34'
SPELL='jǐsì'
CN='己巳'
SEQ='6'
if __name__=='__main__':
pass
| 12.941176 | 53 | 0.7 |
NAME='jisi34'
SPELL='jǐsì'
CN='己巳'
SEQ='6'
if __name__=='__main__':
pass
| true | true |
08f672fb9f30976fb288bdfa9f630509cb8f3348 | 99 | py | Python | convolut_tensorboard/__init__.py | convolut/convolut-tensorboard | 0f9c8bdf5f8a8678eaff2acda37abef7b4747a20 | [
"Apache-2.0"
] | null | null | null | convolut_tensorboard/__init__.py | convolut/convolut-tensorboard | 0f9c8bdf5f8a8678eaff2acda37abef7b4747a20 | [
"Apache-2.0"
] | null | null | null | convolut_tensorboard/__init__.py | convolut/convolut-tensorboard | 0f9c8bdf5f8a8678eaff2acda37abef7b4747a20 | [
"Apache-2.0"
] | null | null | null | from .constants import *
from .logger import *
__all__ = ["TensorboardMode", "TensorboardLogger"]
| 19.8 | 50 | 0.747475 | from .constants import *
from .logger import *
__all__ = ["TensorboardMode", "TensorboardLogger"]
| true | true |
08f673695e5dcbcfc52c00a855e4beb022ed6123 | 207 | py | Python | model/transformer/__main__.py | tsaikenyoo/BERT_SQuAD_pytorch | 411d9aa286081b398a0f60878ae751654a9cb53f | [
"Apache-2.0"
] | null | null | null | model/transformer/__main__.py | tsaikenyoo/BERT_SQuAD_pytorch | 411d9aa286081b398a0f60878ae751654a9cb53f | [
"Apache-2.0"
] | null | null | null | model/transformer/__main__.py | tsaikenyoo/BERT_SQuAD_pytorch | 411d9aa286081b398a0f60878ae751654a9cb53f | [
"Apache-2.0"
] | null | null | null |
import torch
from . import *
from .encoder import TransformerEncoder
def main():
encoder = TransformerEncoder()
input = torch.rand(2, 768)
print(input)
if __name__ == '__main__':
main() | 13.8 | 39 | 0.666667 |
import torch
from . import *
from .encoder import TransformerEncoder
def main():
encoder = TransformerEncoder()
input = torch.rand(2, 768)
print(input)
if __name__ == '__main__':
main() | true | true |
08f6743fff65591ff32e0266af9048ffce322e0d | 194 | py | Python | replace.py | filiptronicek/action-side-rendering | ba6a7968ee6225ca323627b3f2d08e657f853f0e | [
"MIT"
] | null | null | null | replace.py | filiptronicek/action-side-rendering | ba6a7968ee6225ca323627b3f2d08e657f853f0e | [
"MIT"
] | null | null | null | replace.py | filiptronicek/action-side-rendering | ba6a7968ee6225ca323627b3f2d08e657f853f0e | [
"MIT"
] | null | null | null | import json
with open("README.md") as f:
lines = f.read()
with open("config.json") as a:
jsson = a.read()
jsson = json.loads(jsson)
print(lines.replace(jsson["templating"], "lol")) | 21.555556 | 48 | 0.639175 | import json
with open("README.md") as f:
lines = f.read()
with open("config.json") as a:
jsson = a.read()
jsson = json.loads(jsson)
print(lines.replace(jsson["templating"], "lol")) | true | true |
08f6749d1d8b1242ce36f3341420a311f4103f34 | 16,572 | py | Python | tobiko/shell/sh/_process.py | 4383/tobiko | f8e6916db890021fa17ddbfc5e6007a25093c8cb | [
"Apache-2.0"
] | null | null | null | tobiko/shell/sh/_process.py | 4383/tobiko | f8e6916db890021fa17ddbfc5e6007a25093c8cb | [
"Apache-2.0"
] | null | null | null | tobiko/shell/sh/_process.py | 4383/tobiko | f8e6916db890021fa17ddbfc5e6007a25093c8cb | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019 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
#
# Unless requi... | 32.367188 | 79 | 0.586954 | from __future__ import absolute_import
import io
import time
from oslo_log import log
import tobiko
from tobiko.shell.sh import _command
from tobiko.shell.sh import _exception
from tobiko.shell.sh import _io
LOG = log.getLogger(__name__)
MAX_TIMEOUT = 3600.
def process(command=None, environment=None, timeout... | true | true |
08f674f374468cafcef02d8f9cfc593b82055dfa | 34,926 | py | Python | ignite/handlers/checkpoint.py | jkhenning/ignite | c3f80910fb39ee101f07afe21172754c01026927 | [
"BSD-3-Clause"
] | 1 | 2021-08-10T05:32:29.000Z | 2021-08-10T05:32:29.000Z | ignite/handlers/checkpoint.py | rishabhvarshney14/ignite | 2485fd42c6ef4d3e97fd606a52f8c6e5d940357e | [
"BSD-3-Clause"
] | null | null | null | ignite/handlers/checkpoint.py | rishabhvarshney14/ignite | 2485fd42c6ef4d3e97fd606a52f8c6e5d940357e | [
"BSD-3-Clause"
] | null | null | null | import collections.abc as collections
import numbers
import os
import tempfile
import warnings
from abc import ABCMeta, abstractmethod
from collections import OrderedDict
from tempfile import _TemporaryFileWrapper # type: ignore[attr-defined]
from typing import Any, Callable, Dict, List, Mapping, NamedTuple, Optional,... | 45.894875 | 120 | 0.60883 | import collections.abc as collections
import numbers
import os
import tempfile
import warnings
from abc import ABCMeta, abstractmethod
from collections import OrderedDict
from tempfile import _TemporaryFileWrapper from typing import Any, Callable, Dict, List, Mapping, NamedTuple, Optional, Tuple, Union
import torch
i... | true | true |
08f67640ab147ef531fc3e7984b3353a35d0bc04 | 2,400 | py | Python | tests/conftest.py | borntyping/jug | b605d6891f3ccb3d4e962ccbd327f32de257d317 | [
"MIT"
] | 1 | 2018-10-01T09:02:46.000Z | 2018-10-01T09:02:46.000Z | tests/conftest.py | borntyping/jug | b605d6891f3ccb3d4e962ccbd327f32de257d317 | [
"MIT"
] | null | null | null | tests/conftest.py | borntyping/jug | b605d6891f3ccb3d4e962ccbd327f32de257d317 | [
"MIT"
] | null | null | null | import pathlib
import typing
import attr
import click.testing
import pytest
import fidelius.cli
ROOT = pathlib.Path(__file__).parent
@pytest.fixture()
def invoke():
def invoke_func(arguments: typing.Sequence[str]):
assert all(isinstance(arg, str) for arg in arguments)
runner = click.testing.Cli... | 26.966292 | 86 | 0.62375 | import pathlib
import typing
import attr
import click.testing
import pytest
import fidelius.cli
ROOT = pathlib.Path(__file__).parent
@pytest.fixture()
def invoke():
def invoke_func(arguments: typing.Sequence[str]):
assert all(isinstance(arg, str) for arg in arguments)
runner = click.testing.Cli... | true | true |
08f6764b30425c3611d74b01791bd7b1e665f577 | 1,765 | py | Python | python/aead/aead_key_manager.py | erka/tink | 78b908124efbb34acc4de3ae11b41112cb41adb2 | [
"Apache-2.0"
] | 1 | 2019-11-05T10:58:12.000Z | 2019-11-05T10:58:12.000Z | python/aead/aead_key_manager.py | erka/tink | 78b908124efbb34acc4de3ae11b41112cb41adb2 | [
"Apache-2.0"
] | 1 | 2019-09-27T04:25:22.000Z | 2019-09-27T04:25:22.000Z | python/aead/aead_key_manager.py | erka/tink | 78b908124efbb34acc4de3ae11b41112cb41adb2 | [
"Apache-2.0"
] | 1 | 2021-06-07T13:28:14.000Z | 2021-06-07T13:28:14.000Z | # Copyright 2019 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 35.3 | 74 | 0.782436 |
from __future__ import absolute_import
from __future__ import division
from __future__ import google_type_annotations
from __future__ import print_function
from typing import Text
from tink.cc.python import aead as cc_aead
from tink.python.aead import aead
from tink.python.cc.clif import cc_key_manager
from tink.py... | true | true |
08f677180b803b58bb33f3be30cea175764abf6d | 10,051 | py | Python | tests/test_proxs.py | imerad/linlearn | b63385ea4d754db2ec08f6479a555963c8d42576 | [
"BSD-3-Clause"
] | 1 | 2020-11-12T21:02:33.000Z | 2020-11-12T21:02:33.000Z | tests/test_proxs.py | imerad/linlearn | b63385ea4d754db2ec08f6479a555963c8d42576 | [
"BSD-3-Clause"
] | 40 | 2019-12-11T17:36:19.000Z | 2021-09-27T11:20:56.000Z | tests/test_proxs.py | imerad/linlearn | b63385ea4d754db2ec08f6479a555963c8d42576 | [
"BSD-3-Clause"
] | 2 | 2020-01-30T21:58:24.000Z | 2021-07-19T08:40:34.000Z | # import numpy as np
# from numpy.linalg import norm
# import pytest
# from linlearn.prox_old import ProxL2Sq, ProxL1
#
#
# class TestProx(object):
#
# # Prox classes to be tested
# prox_classes = [ProxL2Sq, ProxL1]
#
# w = np.array(
# [
# -0.86017247,
# -0.58127151,
# ... | 32.633117 | 101 | 0.508606 | # with pytest.raises(ValueError):
# prox.call(w, step=1.0)
#
# @staticmethod
# def value(Prox):
# prox = Prox(1e-3, (3, 8))
# w = np.random.randn(7)
# # TODO: this fails with match="'end' is larger than 'w.size[0]'" and I don't understand why
| true | true |
08f67756f412b7e284ec0d650b4e1cad8ce5a2ce | 6,473 | py | Python | examples/rllib/multiagent_exps/multiagent_merge4_localReward.py | cuijiaxun/MITC | a226308424237a69b5e938baf72949de9b1b4bf2 | [
"MIT"
] | 1 | 2021-06-17T03:25:13.000Z | 2021-06-17T03:25:13.000Z | examples/rllib/multiagent_exps/multiagent_merge4_localReward.py | cuijiaxun/MITC | a226308424237a69b5e938baf72949de9b1b4bf2 | [
"MIT"
] | null | null | null | examples/rllib/multiagent_exps/multiagent_merge4_localReward.py | cuijiaxun/MITC | a226308424237a69b5e938baf72949de9b1b4bf2 | [
"MIT"
] | 1 | 2021-03-18T16:20:57.000Z | 2021-03-18T16:20:57.000Z | """Multi-agent highway with ramps example.
Trains a non-constant number of agents, all sharing the same policy, on the
highway with ramps network.
"""
import json
import ray
try:
from ray.rllib.agents.agent import get_agent_class
except ImportError:
from ray.rllib.agents.registry import get_agent_class
from ra... | 26.970833 | 89 | 0.678047 | import json
import ray
try:
from ray.rllib.agents.agent import get_agent_class
except ImportError:
from ray.rllib.agents.registry import get_agent_class
from ray.rllib.agents.ppo.ppo_tf_policy import PPOTFPolicy
from ray import tune
from ray.tune.registry import register_env
from ray.tune import run_experiments... | true | true |
08f6798c7647a3e0950c492cfed9c40995c36f1b | 21,496 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_gateways_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/v2019_12_01/aio/operations/_express_route_gateways_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | null | null | null | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/aio/operations/_express_route_gateways_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.759259 | 209 | 0.686035 | from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import Asyn... | true | true |
08f67a2fb0d7edbc45e4617b46a6c98e941366fa | 4,481 | py | Python | Code-Code/CodeCompletion-token/dataset/py150/preprocess.py | ywen666/CodeXGLUE | f75c9628d8a29daedd5953474fb38e24c30d7349 | [
"CC0-1.0",
"MIT"
] | 613 | 2020-09-28T08:49:25.000Z | 2022-03-31T10:57:34.000Z | Code-Code/CodeCompletion-token/dataset/py150/preprocess.py | ywen666/CodeXGLUE | f75c9628d8a29daedd5953474fb38e24c30d7349 | [
"CC0-1.0",
"MIT"
] | 95 | 2020-10-01T07:46:04.000Z | 2022-03-31T03:54:42.000Z | Code-Code/CodeCompletion-token/dataset/py150/preprocess.py | ywen666/CodeXGLUE | f75c9628d8a29daedd5953474fb38e24c30d7349 | [
"CC0-1.0",
"MIT"
] | 178 | 2020-09-29T05:15:29.000Z | 2022-03-31T07:14:22.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import os
import argparse
import re
from tokenize import tokenize, untokenize, COMMENT, STRING, NEWLINE, ENCODING, ENDMARKER, NL, INDENT, NUMBER
from io import BytesIO
import json
lits = json.load(open("literals.json"))
def process_string(token... | 38.62931 | 130 | 0.575988 |
import os
import argparse
import re
from tokenize import tokenize, untokenize, COMMENT, STRING, NEWLINE, ENCODING, ENDMARKER, NL, INDENT, NUMBER
from io import BytesIO
import json
lits = json.load(open("literals.json"))
def process_string(token, special_chars={" ": "U+0020", ",": "U+002C"}):
str_quote_options = ... | true | true |
08f67b07b5a8b817524997f15798a3f2ceac5953 | 1,556 | py | Python | day-1/microbot-mazes/mu/buggy_starter.py | ScienceOxford/robot-camp | 0f6c1a2a9ef517ba18c361ccec957e1679d69adc | [
"CC-BY-4.0"
] | null | null | null | day-1/microbot-mazes/mu/buggy_starter.py | ScienceOxford/robot-camp | 0f6c1a2a9ef517ba18c361ccec957e1679d69adc | [
"CC-BY-4.0"
] | null | null | null | day-1/microbot-mazes/mu/buggy_starter.py | ScienceOxford/robot-camp | 0f6c1a2a9ef517ba18c361ccec957e1679d69adc | [
"CC-BY-4.0"
] | null | null | null | from microbit import *
# Please tag us if used!
# We'd love to see what you make:
# @ScienceOxford
'''
This tells us which of the micro:bit's pins is connected to which input on the motor driver (follow the coloured wires!).
e.g. FL means that it controls the pin that turns on the left-hand motor in the forward direc... | 22.550725 | 121 | 0.696015 | from microbit import *
# @ScienceOxford
FL = pin14
BL = pin13
FR = pin12
BR = pin15
on = 511
off = 1023
def stop(time):
display.clear()
FL.write_analog(off)
BL.write_analog(off)
FR.write_analog(off)
BR.write_analog(off)
sleep(time)
def forward(time):
display.show(Image.ARROW_N)
FL.w... | true | true |
08f67b435417a7de2b621b24b4cd66c271cf41b5 | 6,381 | py | Python | docs/conf.py | rodsan0/header-only-pca | 7c0464df93395ad2f6b2354f84464a643cbba0be | [
"MIT"
] | 1 | 2021-01-12T23:41:22.000Z | 2021-01-12T23:41:22.000Z | docs/conf.py | rodsan0/header-only-pca | 7c0464df93395ad2f6b2354f84464a643cbba0be | [
"MIT"
] | null | null | null | docs/conf.py | rodsan0/header-only-pca | 7c0464df93395ad2f6b2354f84464a643cbba0be | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# header-only-pca documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 9 13:47:02 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in th... | 31.126829 | 98 | 0.67795 |
import os
import sys
import subprocess
import sphinx_rtd_theme
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.viewcode',
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx_rtd_theme',
'breathe',
'exhale',
'myst_parser',
]
breathe_projects = {
"Santiago Rodriguez Papa": "./do... | true | true |
08f67b9fe7fc228fcfea3e07e73b16af34e93a78 | 3,127 | py | Python | newsroom.py | Madhan2105/news_web_scrapping | cfb64f82957d0faab94d449044e7678ef75f8e70 | [
"MIT"
] | 1 | 2020-08-19T13:17:17.000Z | 2020-08-19T13:17:17.000Z | newsroom.py | Madhan2105/news_web_scrapping | cfb64f82957d0faab94d449044e7678ef75f8e70 | [
"MIT"
] | null | null | null | newsroom.py | Madhan2105/news_web_scrapping | cfb64f82957d0faab94d449044e7678ef75f8e70 | [
"MIT"
] | null | null | null | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
from datetime import datetime,timedelta
import pytz
from pytz import timezone
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import exp... | 33.98913 | 89 | 0.686601 | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
from datetime import datetime,timedelta
import pytz
from pytz import timezone
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import exp... | true | true |
08f67c65a4c1f0745dcb6d5ea399317c781089da | 1,683 | py | Python | retrieve-OP_RETURN.py | INCT-DD/python-OP_RETURN | 779b4d531771274f1239b6b2bc5abb34ffc599c8 | [
"MIT"
] | 1 | 2021-12-22T10:25:40.000Z | 2021-12-22T10:25:40.000Z | retrieve-OP_RETURN.py | fmhc/dogecoin-OP_RETURN | ca56f00d9a6ed6137bc9a495dfa8ba353204d88c | [
"MIT"
] | null | null | null | retrieve-OP_RETURN.py | fmhc/dogecoin-OP_RETURN | ca56f00d9a6ed6137bc9a495dfa8ba353204d88c | [
"MIT"
] | 2 | 2021-01-08T14:02:14.000Z | 2021-06-20T22:34:16.000Z | # retrieve-OP_RETURN.py
#
# CLI wrapper for OP_RETURN.py to retrieve data from OP_RETURNs
#
# Copyright (c) Coin Sciences Ltd
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restr... | 33.66 | 79 | 0.732026 |
import sys
import string
from OP_RETURN import *
if len(sys.argv) < 2:
sys.exit(
'''Usage:
python retrieve-OP_RETURN.py <hash> <testnet (optional)>'''
)
ref = sys.argv[1]
if len(sys.argv) > 2:
testnet = bool(sys.argv[2])
else:
testnet = False
results = OP_RETURN_check(ref, testnet)... | true | true |
08f67ce01d815f148e2968c3ad604f4544ac24da | 378 | py | Python | python/tHome/eagle/messages/test/FastPollStatus.py | ZigmundRat/T-Home | 5dc8689f52d87dac890051e540b338b009293ced | [
"BSD-2-Clause"
] | 18 | 2016-04-17T19:39:28.000Z | 2020-11-19T06:55:20.000Z | python/tHome/eagle/messages/test/FastPollStatus.py | ZigmundRat/T-Home | 5dc8689f52d87dac890051e540b338b009293ced | [
"BSD-2-Clause"
] | 11 | 2018-09-07T18:34:41.000Z | 2021-05-02T04:44:54.000Z | python/tHome/eagle/messages/test/FastPollStatus.py | ZigmundRat/T-Home | 5dc8689f52d87dac890051e540b338b009293ced | [
"BSD-2-Clause"
] | 12 | 2016-10-31T12:29:08.000Z | 2021-12-28T12:18:28.000Z | #!/usr/bin/env python
import xml.etree.ElementTree as ET
import tHome.eagle as E
s="""
<FastPollStatus>
<DeviceMacId>0xd8d5b9000000103f</DeviceMacId>
<MeterMacId>0x000781000086d0fe</MeterMacId>
<Frequency>0x00</Frequency>
<EndTime>0xFFFFFFFF</EndTime>
</FastPollStatus>
"""
root = ET.fromstr... | 18 | 50 | 0.706349 |
import xml.etree.ElementTree as ET
import tHome.eagle as E
s="""
<FastPollStatus>
<DeviceMacId>0xd8d5b9000000103f</DeviceMacId>
<MeterMacId>0x000781000086d0fe</MeterMacId>
<Frequency>0x00</Frequency>
<EndTime>0xFFFFFFFF</EndTime>
</FastPollStatus>
"""
root = ET.fromstring( s )
n = E.messag... | false | true |
08f67cf2ab90835c5dd420e25ba9ea5e92e4c6ce | 9,998 | py | Python | contrib/spendfrom/spendfrom.py | Cloudxtreme/ddCash | 329ef5dcaacf9c0424c9a2f1ce605da5cd56f4d3 | [
"MIT"
] | 1 | 2021-04-24T14:58:54.000Z | 2021-04-24T14:58:54.000Z | contrib/spendfrom/spendfrom.py | Cloudxtreme/ddCash | 329ef5dcaacf9c0424c9a2f1ce605da5cd56f4d3 | [
"MIT"
] | null | null | null | contrib/spendfrom/spendfrom.py | Cloudxtreme/ddCash | 329ef5dcaacf9c0424c9a2f1ce605da5cd56f4d3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Use the raw transactions API to spend JIYOs received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a ddCashd or ddCash-... | 37.30597 | 111 | 0.631226 |
from decimal import *
import getpass
import math
import os
import os.path
import platform
import sys
import time
from jsonrpc import ServiceProxy, json
BASE_FEE=Decimal("0.001")
def check_json_precision():
n = Decimal("20000000.00000003")
satoshis = int(json.loads(json.dumps(float(n)))*1.0e8)
if satoshis... | true | true |
08f67cf6b2793d9a905fd5da2ab17ed6e0d620e9 | 4,477 | py | Python | experiments/from_sample.py | echasnovski/randomvars | 15417b0e3ecd27f185b70471102c158f60d51c28 | [
"MIT"
] | null | null | null | experiments/from_sample.py | echasnovski/randomvars | 15417b0e3ecd27f185b70471102c158f60d51c28 | [
"MIT"
] | null | null | null | experiments/from_sample.py | echasnovski/randomvars | 15417b0e3ecd27f185b70471102c158f60d51c28 | [
"MIT"
] | null | null | null | import numpy as np
from scipy.stats.distributions import norm, beta
from scipy.integrate import quad
import matplotlib.pyplot as plt
from randomvars import Cont
from randomvars.options import config
# %% `from_sample()` from `Cont`
def sklearn_estimator_cont(*args, **kwargs):
from sklearn.neighbors import KernelD... | 28.698718 | 71 | 0.656466 | import numpy as np
from scipy.stats.distributions import norm, beta
from scipy.integrate import quad
import matplotlib.pyplot as plt
from randomvars import Cont
from randomvars.options import config
def sklearn_estimator_cont(*args, **kwargs):
from sklearn.neighbors import KernelDensity
def estimator_cont(x)... | true | true |
08f67d4d6296bc157649d9ba2747353c021c7fa8 | 71 | py | Python | src/opera/commands/__init__.py | sstanovnik/xopera-opera | 06031d37268913c6ba6dbc30ec6b4acb3a17dc5a | [
"Apache-2.0"
] | null | null | null | src/opera/commands/__init__.py | sstanovnik/xopera-opera | 06031d37268913c6ba6dbc30ec6b4acb3a17dc5a | [
"Apache-2.0"
] | null | null | null | src/opera/commands/__init__.py | sstanovnik/xopera-opera | 06031d37268913c6ba6dbc30ec6b4acb3a17dc5a | [
"Apache-2.0"
] | null | null | null | from opera.commands import (
deploy,
undeploy,
validate,
)
| 11.833333 | 28 | 0.633803 | from opera.commands import (
deploy,
undeploy,
validate,
)
| true | true |
08f67ea8c870ec4265b68021b2157fc664d99e4f | 5,467 | py | Python | pose_estimation/configs/bottom_up/hrnet/coco/hrnet_w32_coco_640x640.py | AK391/UniFormer | 22c6b3b98b68236dda6a8fa7152a32af1af62a20 | [
"MIT"
] | 367 | 2022-01-14T03:32:25.000Z | 2022-03-31T04:48:20.000Z | pose_estimation/configs/bottom_up/hrnet/coco/hrnet_w32_coco_640x640.py | hadlang/UniFormer | e8024703bffb89cb7c7d09e0d774a0d2a9f96c25 | [
"MIT"
] | 27 | 2022-01-27T07:12:49.000Z | 2022-03-31T04:31:13.000Z | pose_estimation/configs/bottom_up/hrnet/coco/hrnet_w32_coco_640x640.py | hadlang/UniFormer | e8024703bffb89cb7c7d09e0d774a0d2a9f96c25 | [
"MIT"
] | 53 | 2022-01-18T11:21:43.000Z | 2022-03-31T06:42:41.000Z | log_level = 'INFO'
load_from = None
resume_from = None
dist_params = dict(backend='nccl')
workflow = [('train', 1)]
checkpoint_config = dict(interval=50)
evaluation = dict(interval=50, metric='mAP', key_indicator='AP')
optimizer = dict(
type='Adam',
lr=0.0015,
)
optimizer_config = dict(grad_clip=None)
# learni... | 27.892857 | 76 | 0.564844 | log_level = 'INFO'
load_from = None
resume_from = None
dist_params = dict(backend='nccl')
workflow = [('train', 1)]
checkpoint_config = dict(interval=50)
evaluation = dict(interval=50, metric='mAP', key_indicator='AP')
optimizer = dict(
type='Adam',
lr=0.0015,
)
optimizer_config = dict(grad_clip=None)
lr_confi... | true | true |
08f67ec690fc2ebfb83c8c2a06b890ec9502cc82 | 46,118 | py | Python | lib/galaxy/tools/verify/interactor.py | fmareuil/galaxy | b8c5ee37680f166246d247bbf06e1800e4d8310b | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/tools/verify/interactor.py | fmareuil/galaxy | b8c5ee37680f166246d247bbf06e1800e4d8310b | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/tools/verify/interactor.py | fmareuil/galaxy | b8c5ee37680f166246d247bbf06e1800e4d8310b | [
"CC-BY-3.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import print_function
import os
import re
import shutil
import sys
import tarfile
import tempfile
import time
from collections import OrderedDict
from json import dumps
from logging import getLogger
from packaging.version import parse as parse_version, Version
tr... | 43.262664 | 245 | 0.621493 | from __future__ import absolute_import
from __future__ import print_function
import os
import re
import shutil
import sys
import tarfile
import tempfile
import time
from collections import OrderedDict
from json import dumps
from logging import getLogger
from packaging.version import parse as parse_version, Version
tr... | true | true |
08f67ef351e80d62391f56d8fa26f97ce54071a2 | 10,408 | py | Python | doc/conf.py | bparazin/skyportal | c160610ca0cc28eef9f36c2d11cc15bd9bcbfe56 | [
"BSD-3-Clause"
] | 52 | 2018-11-02T00:53:21.000Z | 2022-03-08T16:03:52.000Z | doc/conf.py | bparazin/skyportal | c160610ca0cc28eef9f36c2d11cc15bd9bcbfe56 | [
"BSD-3-Clause"
] | 1,944 | 2017-04-27T18:51:20.000Z | 2022-03-31T20:17:44.000Z | doc/conf.py | bparazin/skyportal | c160610ca0cc28eef9f36c2d11cc15bd9bcbfe56 | [
"BSD-3-Clause"
] | 63 | 2017-05-13T01:40:47.000Z | 2022-03-12T11:32:11.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# skyportal documentation build configuration file, created by
# sphinx-quickstart on Thu Jul 23 13:00:45 2015 (copied from `cesium`).
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values... | 31.92638 | 79 | 0.699846 |
import sys
import os
import eralchemy
sys.path.insert(0, os.path.abspath('..'))
from skyportal import models
extensions = [
'recommonmark',
'sphinx.ext.mathjax',
'sphinx.ext.autosummary',
'numpydoc',
'sphinx.ext.intersphinx',
]
templates_path = ['_templates']
source_suff... | true | true |
08f67ef94b036d5e1106424ac34ef79cf671c6e5 | 9,663 | py | Python | contrib/bitrpc/bitrpc.py | TrustyMan/londinium | 897a3aa32b2810366b153e34485a8ae77e06a36d | [
"MIT"
] | null | null | null | contrib/bitrpc/bitrpc.py | TrustyMan/londinium | 897a3aa32b2810366b153e34485a8ae77e06a36d | [
"MIT"
] | null | null | null | contrib/bitrpc/bitrpc.py | TrustyMan/londinium | 897a3aa32b2810366b153e34485a8ae77e06a36d | [
"MIT"
] | null | null | null | from jsonrpc import ServiceProxy
import sys
import string
import getpass
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:9512")
e... | 28.588757 | 101 | 0.573424 | from jsonrpc import ServiceProxy
import sys
import string
import getpass
rpcuser = ""
rpcpass = ""
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:9512")
else:
access = ServiceProxy("http://"+rpcuser+":"+rpcpass+"@127.0.0.1:9512")
cmd = sys.argv[1].lower()
if cmd == "backupwallet":
try:
... | false | true |
08f67f5e4c5d883d75c6e0b92a4393487f100d03 | 402 | py | Python | components/studio/apps/migrations/0042_appinstance_open_field.py | aitmlouk/stackn | c8029394a15b03796a4864938f9db251b65c7354 | [
"Apache-2.0"
] | 25 | 2020-05-08T22:24:54.000Z | 2022-03-11T18:16:58.000Z | components/studio/apps/migrations/0042_appinstance_open_field.py | aitmlouk/stackn | c8029394a15b03796a4864938f9db251b65c7354 | [
"Apache-2.0"
] | 75 | 2020-05-08T22:15:59.000Z | 2021-11-22T10:00:04.000Z | components/studio/apps/migrations/0042_appinstance_open_field.py | aitmlouk/stackn | c8029394a15b03796a4864938f9db251b65c7354 | [
"Apache-2.0"
] | 12 | 2020-11-04T13:09:46.000Z | 2022-03-14T16:22:40.000Z | # Generated by Django 3.1.6 on 2021-03-09 09:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('apps', '0041_auto_20210223_0918'),
]
operations = [
migrations.AddField(
model_name='appinstance',
name='open_field'... | 21.157895 | 62 | 0.606965 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('apps', '0041_auto_20210223_0918'),
]
operations = [
migrations.AddField(
model_name='appinstance',
name='open_field',
field=models.CharField(max_length=... | true | true |
08f67f6064b07b21de028b743da0d002ead2fcc6 | 784 | py | Python | src/youtube_downloader.py | mercuree/yt-telegram-archiver | 59996d930bd3edb0ca7a789c6365d5f541487651 | [
"MIT"
] | 4 | 2018-09-13T13:41:35.000Z | 2021-06-25T18:01:03.000Z | src/youtube_downloader.py | mercuree/yt-telegram-archiver | 59996d930bd3edb0ca7a789c6365d5f541487651 | [
"MIT"
] | null | null | null | src/youtube_downloader.py | mercuree/yt-telegram-archiver | 59996d930bd3edb0ca7a789c6365d5f541487651 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import youtube_dl
def my_hook(d):
print()
print(d['status'])
print()
if d['status'] == 'finished':
print('Done downloading, now converting ...')
ydl_opts = {
'format': 'mp4',
'postprocessors': [
{'key': 'FFmpegMetadata'}
],
'pro... | 20.102564 | 67 | 0.639031 | from __future__ import unicode_literals
import youtube_dl
def my_hook(d):
print()
print(d['status'])
print()
if d['status'] == 'finished':
print('Done downloading, now converting ...')
ydl_opts = {
'format': 'mp4',
'postprocessors': [
{'key': 'FFmpegMetadata'}
],
'pro... | true | true |
08f67f67244d78edb331592cb488394933ab04d9 | 6,741 | py | Python | start/botcode_v2/networkClassifierHELPER.py | s2t2/tweet-analyzer-py | 0a398fc47101a2d602d8c4116c970f1076a58f27 | [
"MIT"
] | 5 | 2020-04-02T12:03:57.000Z | 2020-10-18T19:29:15.000Z | start/botcode_v2/networkClassifierHELPER.py | s2t2/tweet-analyzer-py | 0a398fc47101a2d602d8c4116c970f1076a58f27 | [
"MIT"
] | 22 | 2020-03-31T02:00:34.000Z | 2021-06-30T17:59:01.000Z | start/botcode_v2/networkClassifierHELPER.py | s2t2/tweet-analyzer-py | 0a398fc47101a2d602d8c4116c970f1076a58f27 | [
"MIT"
] | 3 | 2020-04-04T16:08:08.000Z | 2020-10-20T01:32:46.000Z | import math
import networkx as nx
from collections import defaultdict
from operator import itemgetter
import numpy as np
import time
from ioHELPER import *
#####################################################################################################
####################### BUILD RETWEET NX-(SUB)GRAPH FROM DICT... | 31.064516 | 115 | 0.56594 | import math
import networkx as nx
from collections import defaultdict
from operator import itemgetter
import numpy as np
import time
from ioHELPER import *
def buildRTGraph(graph, subNodes, lowerBound=0):
G = nx.DiGraph()
count = 0
firstInter = list(np.unique(np.intersect1d(subNodes, list(graph.keys()))))
for node... | true | true |
08f680775abd652ad6491e1d79c74a5cf97c6558 | 3,612 | py | Python | lib/kahypar/setup.py | sjkelly/LSOracle | 21688c5d542740dfc8577349fa615ee655acd92c | [
"MIT"
] | null | null | null | lib/kahypar/setup.py | sjkelly/LSOracle | 21688c5d542740dfc8577349fa615ee655acd92c | [
"MIT"
] | 1 | 2021-07-26T22:09:49.000Z | 2021-07-26T22:09:49.000Z | lib/kahypar/setup.py | sjkelly/LSOracle | 21688c5d542740dfc8577349fa615ee655acd92c | [
"MIT"
] | 2 | 2021-07-26T14:46:51.000Z | 2021-11-09T11:32:09.000Z | import os
import re
import sys
import platform
import subprocess
import unittest
import codecs
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext
from distutils.version import LooseVersion
class CMakeExtension(Extension):
def __init__(self, name, sourcedir=''):
Exte... | 37.237113 | 101 | 0.605482 | import os
import re
import sys
import platform
import subprocess
import unittest
import codecs
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext
from distutils.version import LooseVersion
class CMakeExtension(Extension):
def __init__(self, name, sourcedir=''):
Exte... | true | true |
08f680a190c461ba8f48204b1d95cb964ae50202 | 612 | py | Python | django_dynamic_formsets/users/migrations/0005_auto_20191101_1206.py | venomouscyanide/DjangoDynamicFormsets | 8c58a3572bbfac272111204ad0bf04859ddf736e | [
"MIT"
] | null | null | null | django_dynamic_formsets/users/migrations/0005_auto_20191101_1206.py | venomouscyanide/DjangoDynamicFormsets | 8c58a3572bbfac272111204ad0bf04859ddf736e | [
"MIT"
] | null | null | null | django_dynamic_formsets/users/migrations/0005_auto_20191101_1206.py | venomouscyanide/DjangoDynamicFormsets | 8c58a3572bbfac272111204ad0bf04859ddf736e | [
"MIT"
] | null | null | null | # Generated by Django 2.2.6 on 2019-11-01 12:06
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0004_auto_20191101_1159'),
]
operations = [
migrations.AlterField(
model_name='example2mo... | 30.6 | 235 | 0.655229 |
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0004_auto_20191101_1159'),
]
operations = [
migrations.AlterField(
model_name='example2model',
name='phone_number',
... | true | true |
08f680b7886ab5ff323b2cf08dbcafb91fa2d3d5 | 3,101 | py | Python | project/tests/test_dynamic_profiling.py | IntuitiveWebSolutions/django-silk | 690444e8ae58145dca8ddd11f22523bb6abc93fb | [
"MIT"
] | 2 | 2018-11-20T13:06:51.000Z | 2019-08-09T08:50:52.000Z | project/tests/test_dynamic_profiling.py | IntuitiveWebSolutions/django-silk | 690444e8ae58145dca8ddd11f22523bb6abc93fb | [
"MIT"
] | null | null | null | project/tests/test_dynamic_profiling.py | IntuitiveWebSolutions/django-silk | 690444e8ae58145dca8ddd11f22523bb6abc93fb | [
"MIT"
] | 1 | 2021-12-21T05:48:07.000Z | 2021-12-21T05:48:07.000Z | from django.test import TestCase
from unittest.mock import patch
import silk
from silk.profiling.dynamic import _get_module, _get_parent_module, profile_function_or_method
from .util import mock_data_collector
class TestGetModule(TestCase):
"""test for _get_module"""
def test_singular(self):
module... | 32.989362 | 103 | 0.638504 | from django.test import TestCase
from unittest.mock import patch
import silk
from silk.profiling.dynamic import _get_module, _get_parent_module, profile_function_or_method
from .util import mock_data_collector
class TestGetModule(TestCase):
def test_singular(self):
module = _get_module('silk')
... | true | true |
08f68135b192b21dd4a10a904b389f6556c3fb89 | 5,514 | py | Python | 2020/poc/python/MkSConnectorUART.py | MakeSenseCorp/nodes-v3 | 1d42b80d687eccacdc2954ac8ef0f4245a89a4f8 | [
"Apache-2.0"
] | null | null | null | 2020/poc/python/MkSConnectorUART.py | MakeSenseCorp/nodes-v3 | 1d42b80d687eccacdc2954ac8ef0f4245a89a4f8 | [
"Apache-2.0"
] | null | null | null | 2020/poc/python/MkSConnectorUART.py | MakeSenseCorp/nodes-v3 | 1d42b80d687eccacdc2954ac8ef0f4245a89a4f8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import os
import sys
import time
import struct
import json
import queue
import _thread
import threading
import MkSUSBAdaptor
import MkSProtocol
import MkSAbstractConnector
class Connector (MkSAbstractConnector.AbstractConnector):
def __init__ (self):
MkSAbstractConnector.AbstractConnector.__init_... | 27.989848 | 134 | 0.699129 | import os
import sys
import time
import struct
import json
import queue
import _thread
import threading
import MkSUSBAdaptor
import MkSProtocol
import MkSAbstractConnector
class Connector (MkSAbstractConnector.AbstractConnector):
def __init__ (self):
MkSAbstractConnector.AbstractConnector.__init__(self)
self.Cla... | true | true |
08f68163ace47ca0333f09f00f6184218921a6c1 | 2,824 | py | Python | src/pygwin/console.py | themixray/pygwin | ceaf3d455a2d4e654ff7e161b71bd481da503b78 | [
"MIT"
] | 9 | 2021-11-07T13:05:34.000Z | 2022-02-24T12:26:19.000Z | src/pygwin/console.py | themixray/pygwin | ceaf3d455a2d4e654ff7e161b71bd481da503b78 | [
"MIT"
] | null | null | null | src/pygwin/console.py | themixray/pygwin | ceaf3d455a2d4e654ff7e161b71bd481da503b78 | [
"MIT"
] | 2 | 2021-11-11T13:46:57.000Z | 2021-12-28T23:17:48.000Z | from pygwin._pg import pg
try:
import win32console as w32con
import win32con as w32c
import win32gui as w32g
import win32api as w32a
nonwin32api = True
except:
nonwin32api = False
import pyautogui as pag
class console:
def __init__(self):
if not nonwin32api:
... | 32.45977 | 92 | 0.554178 | from pygwin._pg import pg
try:
import win32console as w32con
import win32con as w32c
import win32gui as w32g
import win32api as w32a
nonwin32api = True
except:
nonwin32api = False
import pyautogui as pag
class console:
def __init__(self):
if not nonwin32api:
... | true | true |
08f6825c9eb50665ea85faaae16de462d42bc35a | 23,455 | py | Python | models.py | ronaldluc/muzero-general | fa84fc0ddc43013e1b67a7ffc741e3433c90b696 | [
"MIT"
] | null | null | null | models.py | ronaldluc/muzero-general | fa84fc0ddc43013e1b67a7ffc741e3433c90b696 | [
"MIT"
] | null | null | null | models.py | ronaldluc/muzero-general | fa84fc0ddc43013e1b67a7ffc741e3433c90b696 | [
"MIT"
] | null | null | null | import math
from abc import ABC, abstractmethod
import torch
class MuZeroNetwork:
def __new__(cls, config):
if config.network == "fullyconnected":
return MuZeroFullyConnectedNetwork(
config.observation_shape,
config.stacked_observations,
len(con... | 34.190962 | 115 | 0.568535 | import math
from abc import ABC, abstractmethod
import torch
class MuZeroNetwork:
def __new__(cls, config):
if config.network == "fullyconnected":
return MuZeroFullyConnectedNetwork(
config.observation_shape,
config.stacked_observations,
len(con... | true | true |
08f682f4c3f430cee3aea00462cf3a9ce760474a | 1,556 | py | Python | prospector/resources/ipaddresses.py | craigderington/falcon-prospector | 10fa8f3456721bd10ec57b1ded43f9a42e4ae29e | [
"Apache-2.0"
] | 2 | 2019-02-14T15:58:44.000Z | 2020-12-31T14:04:23.000Z | prospector/resources/ipaddresses.py | craigderington/falcon-prospector | 10fa8f3456721bd10ec57b1ded43f9a42e4ae29e | [
"Apache-2.0"
] | null | null | null | prospector/resources/ipaddresses.py | craigderington/falcon-prospector | 10fa8f3456721bd10ec57b1ded43f9a42e4ae29e | [
"Apache-2.0"
] | null | null | null | import falcon
from falcon.media.validators.jsonschema import validate
from sqlalchemy.exc import IntegrityError
from prospector.db import models
from prospector.resources import BaseResource
from prospector.schemas import load_schema
class IPAddressResource(BaseResource):
"""
The IPAddress Resource
:retur... | 29.923077 | 56 | 0.59383 | import falcon
from falcon.media.validators.jsonschema import validate
from sqlalchemy.exc import IntegrityError
from prospector.db import models
from prospector.resources import BaseResource
from prospector.schemas import load_schema
class IPAddressResource(BaseResource):
def on_get(self, req, resp, ip):
... | true | true |
08f6830aba41c17cc9d08e93f0d0de830185c8ce | 4,517 | py | Python | google/cloud/aiplatform/v1/schema/trainingjob/definition_v1/types/automl_image_segmentation.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | 1 | 2022-03-30T05:23:29.000Z | 2022-03-30T05:23:29.000Z | google/cloud/aiplatform/v1/schema/trainingjob/definition_v1/types/automl_image_segmentation.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform/v1/schema/trainingjob/definition_v1/types/automl_image_segmentation.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 38.606838 | 152 | 0.68696 | import proto
__protobuf__ = proto.module(
package="google.cloud.aiplatform.v1.schema.trainingjob.definition",
manifest={
"AutoMlImageSegmentation",
"AutoMlImageSegmentationInputs",
"AutoMlImageSegmentationMetadata",
},
)
class AutoMlImageSegmentation(proto.Message):
inputs ... | true | true |
08f683c9b221c406fb664cfca790cf1aae0a93b4 | 1,151 | py | Python | WeOptPy/tests/test_fpa.py | kb2623/WeOptPy | 2e9e75acf8fedde0ae4c99da6c786a712d4f011c | [
"MIT"
] | 1 | 2021-05-12T10:02:21.000Z | 2021-05-12T10:02:21.000Z | WeOptPy/tests/test_fpa.py | kb2623/WeOptPy | 2e9e75acf8fedde0ae4c99da6c786a712d4f011c | [
"MIT"
] | null | null | null | WeOptPy/tests/test_fpa.py | kb2623/WeOptPy | 2e9e75acf8fedde0ae4c99da6c786a712d4f011c | [
"MIT"
] | null | null | null | # encoding=utf8
"""Flower pollination algorithm test case module."""
from WeOptPy.algorithms import FlowerPollinationAlgorithm
from WeOptPy.tests.test_algorithm import (
AlgorithmTestCase,
Sphere
)
class FPATestCase(AlgorithmTestCase):
def setUp(self):
AlgorithmTestCase.setUp(self)
self.algo = FlowerPollinat... | 28.775 | 88 | 0.737619 |
from WeOptPy.algorithms import FlowerPollinationAlgorithm
from WeOptPy.tests.test_algorithm import (
AlgorithmTestCase,
Sphere
)
class FPATestCase(AlgorithmTestCase):
def setUp(self):
AlgorithmTestCase.setUp(self)
self.algo = FlowerPollinationAlgorithm
def test_type_parameters(self):
d = self.algo.type_p... | true | true |
08f683db559856de7334b2310e1a5208b987e4a1 | 1,172 | py | Python | pyvotca/orca/orca.py | votca/votcapytools | 4e03074d1b5ed7f8dbc1867e2f3c060d210ce586 | [
"Apache-2.0"
] | 1 | 2021-05-07T03:27:31.000Z | 2021-05-07T03:27:31.000Z | pyvotca/orca/orca.py | votca/votcapytools | 4e03074d1b5ed7f8dbc1867e2f3c060d210ce586 | [
"Apache-2.0"
] | 28 | 2021-01-21T12:17:54.000Z | 2021-02-26T10:55:14.000Z | pyvotca/orca/orca.py | votca/votcapytools | 4e03074d1b5ed7f8dbc1867e2f3c060d210ce586 | [
"Apache-2.0"
] | 1 | 2021-02-01T08:18:25.000Z | 2021-02-01T08:18:25.000Z | """Orca reader/writer module."""
from pathlib import Path
from typing import Union
from ..molecule import Molecule
from ..parsers.orca_parsers import parse_gradient, parse_hessian
from ..utils import BOHR2ANG
PathLike = Union[str, Path]
__all__ = ["Orca"]
class Orca:
def __init__(self, mol: Molecule):
... | 30.842105 | 65 | 0.644198 | from pathlib import Path
from typing import Union
from ..molecule import Molecule
from ..parsers.orca_parsers import parse_gradient, parse_hessian
from ..utils import BOHR2ANG
PathLike = Union[str, Path]
__all__ = ["Orca"]
class Orca:
def __init__(self, mol: Molecule):
self.mol = mol
def read_grad... | true | true |
08f684714931efa083fe3a38599b50936547547b | 3,498 | py | Python | scripts/config/kitti_3d_multi_main.py | JuliaChae/M3D-RPN-Waymo | e73cba585563a094f67a2ba184a22330c134857c | [
"MIT"
] | 3 | 2021-03-30T17:36:29.000Z | 2021-12-07T03:02:43.000Z | scripts/config/kitti_3d_multi_main.py | JuliaChae/M3D-RPN-Waymo | e73cba585563a094f67a2ba184a22330c134857c | [
"MIT"
] | 2 | 2021-02-11T15:29:46.000Z | 2021-07-19T15:03:15.000Z | scripts/config/kitti_3d_multi_main.py | JuliaChae/M3D-RPN-Waymo | e73cba585563a094f67a2ba184a22330c134857c | [
"MIT"
] | null | null | null | from easydict import EasyDict as edict
import numpy as np
def Config():
conf = edict()
# ----------------------------------------
# general
# ----------------------------------------
conf.model = 'densenet121_3d_dilate_depth_aware'
# solver settings
conf.solver_type = 'sgd'... | 25.720588 | 107 | 0.536878 | from easydict import EasyDict as edict
import numpy as np
def Config():
conf = edict()
conf.model = 'densenet121_3d_dilate_depth_aware'
conf.solver_type = 'sgd'
conf.lr = 0.004
conf.momentum = 0.9
conf.weight_decay = 0.0005
conf.max_iter = 50000
conf.snap... | true | true |
08f684894a5231d97226104d0284bde044ff21e0 | 126 | py | Python | MCTSnet/__init__.py | haixuanTao/MCTSnet | bac52fcba522291e07239bc998ff0441c8258752 | [
"MIT"
] | 15 | 2020-02-04T21:41:25.000Z | 2022-03-28T16:30:48.000Z | MCTSnet/__init__.py | haixuanTao/MCTSnet | bac52fcba522291e07239bc998ff0441c8258752 | [
"MIT"
] | 9 | 2019-04-22T08:53:07.000Z | 2022-03-11T23:41:52.000Z | MCTSnet/__init__.py | haixuanTao/MCTSnet | bac52fcba522291e07239bc998ff0441c8258752 | [
"MIT"
] | 4 | 2019-09-18T12:08:28.000Z | 2020-08-31T19:51:19.000Z | from . import sokoban
from . import models
from . import memory
from . import utils
from . import mouse
from .trainer import * | 21 | 22 | 0.761905 | from . import sokoban
from . import models
from . import memory
from . import utils
from . import mouse
from .trainer import * | true | true |
08f684a0201e4c7daf3e56e2b179072119263085 | 5,090 | py | Python | basicDialogue.py | quasarbright/EscapeRAM | 99ca4ef8906318f44f798639d5a38ae6fff1945e | [
"MIT"
] | null | null | null | basicDialogue.py | quasarbright/EscapeRAM | 99ca4ef8906318f44f798639d5a38ae6fff1945e | [
"MIT"
] | null | null | null | basicDialogue.py | quasarbright/EscapeRAM | 99ca4ef8906318f44f798639d5a38ae6fff1945e | [
"MIT"
] | null | null | null | import re
import random
import time
import sys
import os
helperName = "Geoff"
guestPrefix = "[guest@EscapeRAM]"
adminPrefix = "[admin@EscapeRAM]"
def inputFlush(*args, **kwargs):
sys.stdin.flush()
return input(*args, **kwargs)
def printFlowText(text, delay=.05):
for character in text:
print(charac... | 35.103448 | 142 | 0.705305 | import re
import random
import time
import sys
import os
helperName = "Geoff"
guestPrefix = "[guest@EscapeRAM]"
adminPrefix = "[admin@EscapeRAM]"
def inputFlush(*args, **kwargs):
sys.stdin.flush()
return input(*args, **kwargs)
def printFlowText(text, delay=.05):
for character in text:
print(charac... | true | true |
08f68537eec1fd0797b0760c3f99c14f70c00fba | 3,022 | py | Python | tests/template_tests/filter_tests/test_join.py | jpmallarino/django | 659d2421c7adbbcd205604002d521d82d6b0b465 | [
"BSD-3-Clause",
"0BSD"
] | 16 | 2019-08-10T12:24:06.000Z | 2020-05-21T09:11:14.000Z | tests/template_tests/filter_tests/test_join.py | jpmallarino/django | 659d2421c7adbbcd205604002d521d82d6b0b465 | [
"BSD-3-Clause",
"0BSD"
] | 12 | 2019-08-10T11:55:29.000Z | 2020-05-21T04:46:30.000Z | tests/template_tests/filter_tests/test_join.py | jpmallarino/django | 659d2421c7adbbcd205604002d521d82d6b0b465 | [
"BSD-3-Clause",
"0BSD"
] | 3 | 2019-08-20T13:29:34.000Z | 2020-01-30T22:05:10.000Z | from django.template.defaultfilters import join
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class JoinTests(SimpleTestCase):
@setup({"join01": '{{ a|join:", " }}'})
def test_join01(self):
output = self.engine.render_to_string("join01"... | 36.853659 | 87 | 0.557578 | from django.template.defaultfilters import join
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class JoinTests(SimpleTestCase):
@setup({"join01": '{{ a|join:", " }}'})
def test_join01(self):
output = self.engine.render_to_string("join01"... | true | true |
08f685eb14b12372f7df6f5a9efdb496e7a58169 | 1,438 | py | Python | tests/test_apps/app_with_callbacks/custom_callback/my_app.py | mhnatiuk/hydra | 20c16aeb911408ab86e2232fc5c53d8458c9306a | [
"MIT"
] | null | null | null | tests/test_apps/app_with_callbacks/custom_callback/my_app.py | mhnatiuk/hydra | 20c16aeb911408ab86e2232fc5c53d8458c9306a | [
"MIT"
] | null | null | null | tests/test_apps/app_with_callbacks/custom_callback/my_app.py | mhnatiuk/hydra | 20c16aeb911408ab86e2232fc5c53d8458c9306a | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import logging
from omegaconf import DictConfig, OmegaConf
import hydra
from hydra.core.utils import JobReturn
from hydra.experimental.callback import Callback
log = logging.getLogger(__name__)
class CustomCallback(Callback):
def __init__(... | 29.346939 | 89 | 0.67733 |
import logging
from omegaconf import DictConfig, OmegaConf
import hydra
from hydra.core.utils import JobReturn
from hydra.experimental.callback import Callback
log = logging.getLogger(__name__)
class CustomCallback(Callback):
def __init__(self, param1, param2):
self.param1 = param1
self.param2... | true | true |
08f68621e36742eba73a402e8fe0ec2811711102 | 3,929 | py | Python | src/python/fsqio/pants/python/filtered_python_requirements.py | jglesner/fsqio | 436dd3a7667fd23f638bf96bdcd9ec83266a2319 | [
"Apache-2.0"
] | 252 | 2016-01-08T23:12:13.000Z | 2022-01-17T16:31:49.000Z | src/python/fsqio/pants/python/filtered_python_requirements.py | jglesner/fsqio | 436dd3a7667fd23f638bf96bdcd9ec83266a2319 | [
"Apache-2.0"
] | 67 | 2016-01-13T17:34:12.000Z | 2021-08-04T18:50:24.000Z | src/python/fsqio/pants/python/filtered_python_requirements.py | jglesner/fsqio | 436dd3a7667fd23f638bf96bdcd9ec83266a2319 | [
"Apache-2.0"
] | 59 | 2016-03-25T20:49:03.000Z | 2021-08-04T05:36:38.000Z | # coding=utf-8
# Copyright 2019 Foursquare Labs Inc. All Rights Reserved.
from __future__ import (
absolute_import,
division,
generators,
nested_scopes,
print_function,
unicode_literals,
with_statement,
)
import os
from pkg_resources import Requirement
class FilteredPythonRequirements(object):
"""T... | 38.519608 | 113 | 0.672181 |
from __future__ import (
absolute_import,
division,
generators,
nested_scopes,
print_function,
unicode_literals,
with_statement,
)
import os
from pkg_resources import Requirement
class FilteredPythonRequirements(object):
def __init__(self, parse_context):
self._parse_context = parse_context
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.