hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2b0ac647bbd3deb1f083b056eed2ce34e523bc7a | 413 | py | Python | http_async_client/enums.py | jossefaz/async-http-client | 74fe7540d1781d64d41161350019bc5ccfec6426 | [
"MIT"
] | 1 | 2021-12-05T21:01:59.000Z | 2021-12-05T21:01:59.000Z | http_async_client/enums.py | jossefaz/http-async-client | 74fe7540d1781d64d41161350019bc5ccfec6426 | [
"MIT"
] | null | null | null | http_async_client/enums.py | jossefaz/http-async-client | 74fe7540d1781d64d41161350019bc5ccfec6426 | [
"MIT"
] | null | null | null | from enum import Enum
class SupportedProtocols(Enum):
"""Contains a list of all supported protocols (currently only http and https
Value:
http : "http"
https : "https"
"""
http = "http"
https = "https"
class Methods(Enum):
"""Contains a list of all supported HTTP Verbs
""... | 19.666667 | 80 | 0.583535 | from enum import Enum
class SupportedProtocols(Enum):
"""Contains a list of all supported protocols (currently only http and https
Value:
http : "http"
https : "https"
"""
http = "http"
https = "https"
class Methods(Enum):
"""Contains a list of all supported HTTP Verbs
""... | 0 | 0 | 0 |
aa433084afdee825b776b336960d26127329bc76 | 104 | py | Python | conet/dataset_utils/bengali_convert.py | steermomo/conet | 21d60fcb4ab9a01a00aa4d9cd0bdee79ea35cc4b | [
"MIT"
] | null | null | null | conet/dataset_utils/bengali_convert.py | steermomo/conet | 21d60fcb4ab9a01a00aa4d9cd0bdee79ea35cc4b | [
"MIT"
] | null | null | null | conet/dataset_utils/bengali_convert.py | steermomo/conet | 21d60fcb4ab9a01a00aa4d9cd0bdee79ea35cc4b | [
"MIT"
] | 1 | 2020-05-18T10:05:24.000Z | 2020-05-18T10:05:24.000Z | from conet.datasets.bengali_dataset import DATA_DIR
from sklearn.model_selection import StratifiedKFold
| 34.666667 | 51 | 0.894231 | from conet.datasets.bengali_dataset import DATA_DIR
from sklearn.model_selection import StratifiedKFold
| 0 | 0 | 0 |
ca077393cfe3d9b562b9a2aeb65df8b81d21219b | 642 | py | Python | project/payments/payment_methods/payments_stripe/views.py | steetstyle/Django-Ecommerce-API | 89c2c973e560346a5be74019709dc9a9f8ab7b2a | [
"MIT"
] | null | null | null | project/payments/payment_methods/payments_stripe/views.py | steetstyle/Django-Ecommerce-API | 89c2c973e560346a5be74019709dc9a9f8ab7b2a | [
"MIT"
] | null | null | null | project/payments/payment_methods/payments_stripe/views.py | steetstyle/Django-Ecommerce-API | 89c2c973e560346a5be74019709dc9a9f8ab7b2a | [
"MIT"
] | null | null | null | from django.http import JsonResponse
import stripe
# Create your views here. | 32.1 | 69 | 0.646417 | from django.http import JsonResponse
import stripe
# Create your views here.
def custom_webhook():
# Use an existing Customer ID if this is a returning customer
customer = stripe.Customer.create()
ephemeralKey = stripe.EphemeralKey.create(
customer=customer['id'],
stripe_version='2020-08-2... | 542 | 0 | 22 |
fa2f98208db00208b3176b879fdcf683b48c7520 | 1,106 | py | Python | cffi/build.py | chaichairiko/libyang-python | 46c2b1afc653c0b135c9fb70864314c38c909277 | [
"MIT"
] | null | null | null | cffi/build.py | chaichairiko/libyang-python | 46c2b1afc653c0b135c9fb70864314c38c909277 | [
"MIT"
] | null | null | null | cffi/build.py | chaichairiko/libyang-python | 46c2b1afc653c0b135c9fb70864314c38c909277 | [
"MIT"
] | null | null | null | # Copyright (c) 2018-2019 Robin Jarry
# SPDX-License-Identifier: MIT
import os
import shlex
from typing import List
import cffi
HERE = os.path.dirname(__file__)
BUILDER = cffi.FFI()
with open(os.path.join(HERE, "cdefs.h")) as f:
BUILDER.cdef(f.read())
HEADERS = search_paths("LIBYANG_HEADERS")
LIBRARIES = se... | 23.531915 | 72 | 0.652803 | # Copyright (c) 2018-2019 Robin Jarry
# SPDX-License-Identifier: MIT
import os
import shlex
from typing import List
import cffi
HERE = os.path.dirname(__file__)
BUILDER = cffi.FFI()
with open(os.path.join(HERE, "cdefs.h")) as f:
BUILDER.cdef(f.read())
def search_paths(env_var: str) -> List[str]:
paths = ... | 180 | 0 | 23 |
e96677f83406870340bfdc9b9bd5499663417454 | 1,652 | py | Python | AWS/lambda/postEvent/lambda_function.py | jphacks/A_2104 | 60b623c4e90968deedd92e76a80db6e61fda2682 | [
"MIT"
] | 1 | 2021-10-31T06:20:37.000Z | 2021-10-31T06:20:37.000Z | AWS/lambda/postEvent/lambda_function.py | jphacks/A_2104 | 60b623c4e90968deedd92e76a80db6e61fda2682 | [
"MIT"
] | null | null | null | AWS/lambda/postEvent/lambda_function.py | jphacks/A_2104 | 60b623c4e90968deedd92e76a80db6e61fda2682 | [
"MIT"
] | null | null | null | import os
import json
import urllib
import requests
import datetime
def calc_transportation(body):
"""
移動の予定のみreturn.
"""
margin = 5*60 #margin before next event start
ret = []
for i in range(len(body)):
indict = {}
if i==0:
dur = get_time(os.environ["HO... | 25.415385 | 96 | 0.596852 | import os
import json
import urllib
import requests
import datetime
def get_time(origins,destinations,mode):
qs = {"origins":origins,"destinations":destinations,"mode":mode,"key":os.environ["API_KEY"]}
d_qs = urllib.parse.urlencode(qs)
url = os.environ["API_ENDPOINT"] + d_qs
payload={}
headers =... | 683 | 0 | 46 |
b7eb75c28aedca28c1d0a029af50f7a64f2e5cb6 | 944 | py | Python | examples/runMinimalExample.py | vmavrikopoulou/NetworkSimulator | fd31e7a8d25c7670b73b6fdfa37570fb28348b3f | [
"MIT"
] | null | null | null | examples/runMinimalExample.py | vmavrikopoulou/NetworkSimulator | fd31e7a8d25c7670b73b6fdfa37570fb28348b3f | [
"MIT"
] | null | null | null | examples/runMinimalExample.py | vmavrikopoulou/NetworkSimulator | fd31e7a8d25c7670b73b6fdfa37570fb28348b3f | [
"MIT"
] | null | null | null | # we need to import this in order to be able to import the simulator
# it does not have to do anything other than be imported.
from util import path
from examples.minimalExample.SimulatorCrownstone import SimulatorCrownstone
from simulator import SimulationGui, JsonFileStore, Simulator
config = JsonFileStore('./minim... | 30.451613 | 88 | 0.772246 | # we need to import this in order to be able to import the simulator
# it does not have to do anything other than be imported.
from util import path
from examples.minimalExample.SimulatorCrownstone import SimulatorCrownstone
from simulator import SimulationGui, JsonFileStore, Simulator
config = JsonFileStore('./minim... | 0 | 0 | 0 |
e48b5c7f457f1d527389dccb56fae7187cb1b8dd | 711 | py | Python | dmriprep/workflows/dwi/conversions/nii_to_mif/utils.py | GalBenZvi/dmriprep | 7c4c0e1b01e3d941a7fafcbb6b001605cb1f2b0b | [
"Apache-2.0"
] | null | null | null | dmriprep/workflows/dwi/conversions/nii_to_mif/utils.py | GalBenZvi/dmriprep | 7c4c0e1b01e3d941a7fafcbb6b001605cb1f2b0b | [
"Apache-2.0"
] | 1 | 2022-03-22T13:22:18.000Z | 2022-03-22T13:22:18.000Z | dmriprep/workflows/dwi/conversions/nii_to_mif/utils.py | GalBenZvi/dmriprep | 7c4c0e1b01e3d941a7fafcbb6b001605cb1f2b0b | [
"Apache-2.0"
] | null | null | null | def locate_associated_files(in_file: str):
"""
Locates associated json (and possibly bvec & bval) files.
Parameters
----------
in_file : str
Input file.
Returns
-------
Tuple[str, str, str]
Tuple of associated json (and possibly bvec & bval) files.
"""
from dmri... | 27.346154 | 74 | 0.631505 | def locate_associated_files(in_file: str):
"""
Locates associated json (and possibly bvec & bval) files.
Parameters
----------
in_file : str
Input file.
Returns
-------
Tuple[str, str, str]
Tuple of associated json (and possibly bvec & bval) files.
"""
from dmri... | 0 | 0 | 0 |
0a78fe572f3538ff406389eb9f2f11dde5ab5b33 | 1,306 | py | Python | d_immutable_pair.py | DruidGreeneyes/rivet-core.py | 9402f719b4f81f876baa34048e0575d3585842de | [
"MIT"
] | null | null | null | d_immutable_pair.py | DruidGreeneyes/rivet-core.py | 9402f719b4f81f876baa34048e0575d3585842de | [
"MIT"
] | null | null | null | d_immutable_pair.py | DruidGreeneyes/rivet-core.py | 9402f719b4f81f876baa34048e0575d3585842de | [
"MIT"
] | null | null | null | from multipledispatch import dispatch
| 34.368421 | 108 | 0.474732 | from multipledispatch import dispatch
def immutable_pair(left_name='left', right_name='right'):
def wrapper(Cls):
class PairClass(object):
__slots__ = ['_parts']
@dispatch(object, object)
def __init__(self, left, right):
self._parts = (left, right)
... | 1,245 | 0 | 23 |
3bca0bb330dfcde740470c11763d9116b9ce4302 | 280 | py | Python | Apostila_Bimestre_II/da_Apostila/primos_SEM_lista.py | viniciusm0raes/python | c4d4f1a08d1e4de105109e1f67fae9fcc20d7fce | [
"MIT"
] | null | null | null | Apostila_Bimestre_II/da_Apostila/primos_SEM_lista.py | viniciusm0raes/python | c4d4f1a08d1e4de105109e1f67fae9fcc20d7fce | [
"MIT"
] | null | null | null | Apostila_Bimestre_II/da_Apostila/primos_SEM_lista.py | viniciusm0raes/python | c4d4f1a08d1e4de105109e1f67fae9fcc20d7fce | [
"MIT"
] | null | null | null | n1 = int(input("Informe um número: "))
n2 = int(input("Informe um número maior que o anterior: "))
for x in range(n1, n2 + 1):
cont=0
for y in range(n1, x + 1):
if x%y==0:
cont+=1
if cont<=2:
print("{} ".format(y), end="") | 25.454545 | 59 | 0.482143 | n1 = int(input("Informe um número: "))
n2 = int(input("Informe um número maior que o anterior: "))
for x in range(n1, n2 + 1):
cont=0
for y in range(n1, x + 1):
if x%y==0:
cont+=1
if cont<=2:
print("{} ".format(y), end="") | 0 | 0 | 0 |
98b61cbbc8ebb89f425e80f389f82538965ad923 | 5,146 | py | Python | tests/compiler/sample_input/titanic/titanic.py | ngpgn/contextual-ai | deb119395ced5242f243b2b31c074507e96646c0 | [
"Apache-2.0"
] | 83 | 2020-06-17T04:07:29.000Z | 2022-03-12T13:45:24.000Z | tests/compiler/sample_input/titanic/titanic.py | ngpgn/contextual-ai | deb119395ced5242f243b2b31c074507e96646c0 | [
"Apache-2.0"
] | 15 | 2020-06-30T09:22:19.000Z | 2021-11-11T10:52:40.000Z | tests/compiler/sample_input/titanic/titanic.py | ngpgn/contextual-ai | deb119395ced5242f243b2b31c074507e96646c0 | [
"Apache-2.0"
] | 11 | 2020-06-17T17:01:24.000Z | 2022-02-27T18:53:03.000Z | #Libraries
import pickle
# To ignore warnings
import warnings
import numpy as np
import pandas as pd
import re as re
from sklearn.tree import DecisionTreeClassifier
warnings.filterwarnings("ignore")
################################################################################
### Data Ingestion & Splitting
######... | 32.77707 | 139 | 0.547998 | #Libraries
import pickle
# To ignore warnings
import warnings
import numpy as np
import pandas as pd
import re as re
from sklearn.tree import DecisionTreeClassifier
warnings.filterwarnings("ignore")
################################################################################
### Data Ingestion & Splitting
######... | 125 | 0 | 22 |
3fd682ab39a18cddfb20ea63d3293a46a7c8e7e1 | 11,758 | py | Python | Example/Gutenkunst2007/von_Dassow_2000/spgNet.py | bcdaniels/SloppyCell | 17e68127a6aba19056a5067748a2d18241cc4d76 | [
"BSD-3-Clause"
] | 2 | 2020-05-26T19:29:39.000Z | 2020-08-26T20:54:52.000Z | Example/Gutenkunst2007/von_Dassow_2000/spgNet.py | bcdaniels/SloppyCell | 17e68127a6aba19056a5067748a2d18241cc4d76 | [
"BSD-3-Clause"
] | 1 | 2020-05-26T16:50:49.000Z | 2021-07-08T20:35:35.000Z | Example/Gutenkunst2007/von_Dassow_2000/spgNet.py | jurquiza/SloppyCellUrquiza2019 | a9f64d9d4172c82735813f09e48f36777a714e9c | [
"BSD-3-Clause"
] | 3 | 2017-09-12T03:12:01.000Z | 2018-10-19T11:08:09.000Z | from SloppyCell.ReactionNetworks import *
# This file was distributed with Ingenue
f = file('spg1_4cell.net')
lines = f.readlines()
for ii, line in enumerate(lines):
if line.startswith('&width'):
width = int(line.split()[1])
elif line.startswith('&height'):
height = int(line.split()[1])
e... | 41.111888 | 170 | 0.559024 | from SloppyCell.ReactionNetworks import *
# This file was distributed with Ingenue
f = file('spg1_4cell.net')
lines = f.readlines()
for ii, line in enumerate(lines):
if line.startswith('&width'):
width = int(line.split()[1])
elif line.startswith('&height'):
height = int(line.split()[1])
e... | 1,101 | 0 | 69 |
2d350f237cb6a15f4e2d76839103995ddf1d0c43 | 797 | py | Python | 25_read_write_text_files.py | nagasudhirpulla/python_wrldc_training | c3a3216c0a11e1dac03d4637b4b59b28f1bb83c6 | [
"MIT"
] | null | null | null | 25_read_write_text_files.py | nagasudhirpulla/python_wrldc_training | c3a3216c0a11e1dac03d4637b4b59b28f1bb83c6 | [
"MIT"
] | null | null | null | 25_read_write_text_files.py | nagasudhirpulla/python_wrldc_training | c3a3216c0a11e1dac03d4637b4b59b28f1bb83c6 | [
"MIT"
] | 2 | 2020-09-30T16:32:18.000Z | 2020-10-23T01:13:51.000Z | '''
read or write text files in python
'''
# %%
# read a text file
# open the file for reading
with open("dumps/test.txt", mode='r') as f:
# read all the file content
fStr = f.read()
# please note that once again calling f.read() will return empty string
print(fStr)
# this will print the whole fi... | 24.151515 | 74 | 0.647428 | '''
read or write text files in python
'''
# %%
# read a text file
# open the file for reading
with open("dumps/test.txt", mode='r') as f:
# read all the file content
fStr = f.read()
# please note that once again calling f.read() will return empty string
print(fStr)
# this will print the whole fi... | 0 | 0 | 0 |
a4ea7e6fbf2052ec5420e3e4dba35c0df3d27671 | 1,401 | py | Python | Kooleposhti/accounts/backends.py | ParizanTeam/Kooleposhti-Backend | e7d819b3e93836f1a893cc51541056cbf681d1c6 | [
"MIT"
] | null | null | null | Kooleposhti/accounts/backends.py | ParizanTeam/Kooleposhti-Backend | e7d819b3e93836f1a893cc51541056cbf681d1c6 | [
"MIT"
] | null | null | null | Kooleposhti/accounts/backends.py | ParizanTeam/Kooleposhti-Backend | e7d819b3e93836f1a893cc51541056cbf681d1c6 | [
"MIT"
] | null | null | null | from django.contrib.auth.backends import BaseBackend, UserModel, ModelBackend
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission
from django.db.models import Exists, OuterRef, Q
import rest_framework_simplejwt.serializers
from pprint import pprint
class MyModelBackend(Mod... | 40.028571 | 88 | 0.668094 | from django.contrib.auth.backends import BaseBackend, UserModel, ModelBackend
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission
from django.db.models import Exists, OuterRef, Q
import rest_framework_simplejwt.serializers
from pprint import pprint
class MyModelBackend(Mod... | 974 | 0 | 27 |
217ccd524a9351d8524155ddb70230b3fa79c06b | 1,963 | py | Python | server/algos/euler/tests/integration/test_setup.py | yizhang7210/Acre | c98cf8a4fdfb223a1958e8e61df759f889a1b13f | [
"MIT"
] | 2 | 2017-11-27T21:55:21.000Z | 2017-12-30T03:34:40.000Z | server/algos/euler/tests/integration/test_setup.py | yizhang7210/Acre | c98cf8a4fdfb223a1958e8e61df759f889a1b13f | [
"MIT"
] | 30 | 2017-09-06T12:00:08.000Z | 2018-06-20T22:47:46.000Z | server/algos/euler/tests/integration/test_setup.py | yizhang7210/Acre | c98cf8a4fdfb223a1958e8e61df759f889a1b13f | [
"MIT"
] | 1 | 2021-04-05T13:59:37.000Z | 2021-04-05T13:59:37.000Z | # pylint: disable=missing-docstring
import datetime
from core.models import instruments
from datasource.models import candles
| 32.180328 | 78 | 0.522669 | # pylint: disable=missing-docstring
import datetime
from core.models import instruments
from datasource.models import candles
class TestSetup():
@classmethod
def set_up_instruments(cls):
cls.eur_usd = instruments.Instrument(name='EUR_USD', multiplier=10000)
cls.eur_usd.save()
@classmetho... | 1,728 | 84 | 23 |
4496f05342c70d3584c3394094ffc8795187282b | 12,643 | py | Python | arknights_mower/solvers/recruit.py | YuiTH/arknights-mower | 01e65569ee13a470dde09911d2237331a8ed5b3d | [
"MIT"
] | null | null | null | arknights_mower/solvers/recruit.py | YuiTH/arknights-mower | 01e65569ee13a470dde09911d2237331a8ed5b3d | [
"MIT"
] | null | null | null | arknights_mower/solvers/recruit.py | YuiTH/arknights-mower | 01e65569ee13a470dde09911d2237331a8ed5b3d | [
"MIT"
] | null | null | null | from __future__ import annotations
from ..ocr import ocrhandle, ocr_rectify
from ..utils import segment
from ..utils.device import Device
from ..utils.log import logger
from ..utils.recognize import Recognizer, Scene, RecognizeError
from ..utils.solver import BaseSolver
from ..data import recruit_tag, recruit_agent
... | 38.663609 | 110 | 0.489678 | from __future__ import annotations
from ..ocr import ocrhandle, ocr_rectify
from ..utils import segment
from ..utils.device import Device
from ..utils.log import logger
from ..utils.recognize import Recognizer, Scene, RecognizeError
from ..utils.solver import BaseSolver
from ..data import recruit_tag, recruit_agent
... | 2,278 | 0 | 162 |
375bf56f2d70c880920c1c4d9ca81b57c85e9cb2 | 7,869 | py | Python | 03-cohort-analysis/01-plot-demographics.py | rionbr/DDIIndy | 63737cd05e92f496e7fa51fecc1c7542edba1f2e | [
"MIT"
] | null | null | null | 03-cohort-analysis/01-plot-demographics.py | rionbr/DDIIndy | 63737cd05e92f496e7fa51fecc1c7542edba1f2e | [
"MIT"
] | null | null | null | 03-cohort-analysis/01-plot-demographics.py | rionbr/DDIIndy | 63737cd05e92f496e7fa51fecc1c7542edba1f2e | [
"MIT"
] | null | null | null | # coding=utf-8
# Author: Rion B Correia
# Date: April 17, 2020
#
# Description: Demographics
#
#
import configparser
import numpy as np
import pandas as pd
import sqlalchemy
from sqlalchemy import event
from utils import add_own_encoders, ensurePathExists, map_age_to_age_group
import matplotlib as mpl
mpl.rcParams['mat... | 33.063025 | 183 | 0.574406 | # coding=utf-8
# Author: Rion B Correia
# Date: April 17, 2020
#
# Description: Demographics
#
#
import configparser
import numpy as np
import pandas as pd
import sqlalchemy
from sqlalchemy import event
from utils import add_own_encoders, ensurePathExists, map_age_to_age_group
import matplotlib as mpl
mpl.rcParams['mat... | 0 | 0 | 0 |
c843c087d88d5065cf5a63507f064fd8b3d81707 | 5,139 | py | Python | bot/clients/stack_client.py | EJCFox/factorio-discord-bot | 150cb7f49a12edee781b2e57ebb2b5bddffcd851 | [
"MIT"
] | 1 | 2021-02-04T22:54:56.000Z | 2021-02-04T22:54:56.000Z | bot/clients/stack_client.py | EJCFox/factorio-discord-bot | 150cb7f49a12edee781b2e57ebb2b5bddffcd851 | [
"MIT"
] | 30 | 2021-12-17T20:33:06.000Z | 2022-01-02T14:35:31.000Z | bot/clients/stack_client.py | EJCFox/factorio-discord-bot | 150cb7f49a12edee781b2e57ebb2b5bddffcd851 | [
"MIT"
] | null | null | null | import logging
import os
import aiobotocore
from ..helpers.env import getenv
BOT_IP = getenv('BOT_IP')
SSH_KEY_NAME = getenv('SSH_KEY_NAME')
_template = get_template()
_session = aiobotocore.get_session()
| 34.489933 | 85 | 0.505351 | import logging
import os
import aiobotocore
from ..helpers.env import getenv
BOT_IP = getenv('BOT_IP')
SSH_KEY_NAME = getenv('SSH_KEY_NAME')
def get_template():
with open(
os.path.join(os.path.dirname(
os.path.abspath(__file__)), '../template.yaml'),
encoding="utf8") as t... | 4,786 | 0 | 138 |
33a68569a46d9c6d65161ea6169a049677a6cc88 | 3,264 | py | Python | parallax/parallax/core/python/common/shard.py | snuspl/parallax | 83791254ccd5d7a55213687a8dff4c2e04372694 | [
"Apache-2.0"
] | 126 | 2018-07-26T07:06:56.000Z | 2022-01-25T08:11:25.000Z | parallal/parallax/core/python/common/shard.py | nikkkkhil/auto-parallal-deeplearning | 80e350fd933b8f82721bdc4950bc969ba0c630a4 | [
"Apache-2.0"
] | 20 | 2018-08-07T04:51:16.000Z | 2020-05-15T04:47:20.000Z | parallal/parallax/core/python/common/shard.py | nikkkkhil/auto-parallal-deeplearning | 80e350fd933b8f82721bdc4950bc969ba0c630a4 | [
"Apache-2.0"
] | 30 | 2018-08-01T13:25:43.000Z | 2022-02-28T01:28:34.000Z | # Copyright (C) 2018 Seoul National University
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 37.090909 | 80 | 0.706189 | # Copyright (C) 2018 Seoul National University
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 517 | 0 | 50 |
1a8e8be81848626887850c0eb27bf0b710e21586 | 2,185 | py | Python | video2images.py | tenghehan/reid_without_id | d1d0ff273b1ef19fc6da8cbbf210527779b37455 | [
"MIT"
] | null | null | null | video2images.py | tenghehan/reid_without_id | d1d0ff273b1ef19fc6da8cbbf210527779b37455 | [
"MIT"
] | null | null | null | video2images.py | tenghehan/reid_without_id | d1d0ff273b1ef19fc6da8cbbf210527779b37455 | [
"MIT"
] | null | null | null | """
@author: tenghehan
将 video 形式的视频数据转化成 image sequence 形式的数据.
"""
import cv2
import os
import argparse
from tqdm import tqdm
from utils.log import get_logger
if __name__ == "__main__":
args = parse_args()
with VideoFramer(args, video_path=args.VIDEO_PATH) as vdo_frm:
vdo_frm.run() | 29.931507 | 97 | 0.642563 | """
@author: tenghehan
将 video 形式的视频数据转化成 image sequence 形式的数据.
"""
import cv2
import os
import argparse
from tqdm import tqdm
from utils.log import get_logger
class VideoFramer(object):
def __init__(self, args, video_path):
self.args = args
self.video_path = video_path
self.logger = get_... | 1,724 | 5 | 153 |
0c8bec83e7b2a1f70caa96c61d46a9eeb3799d06 | 2,731 | py | Python | examples/tag_by_location.py | Trinity-College/py-space-platform | 2ead02c1af8b696cf673eddaac5199c8267f0bf3 | [
"ECL-2.0",
"Apache-2.0"
] | 27 | 2015-04-21T09:01:56.000Z | 2021-08-21T22:39:12.000Z | examples/tag_by_location.py | Trinity-College/py-space-platform | 2ead02c1af8b696cf673eddaac5199c8267f0bf3 | [
"ECL-2.0",
"Apache-2.0"
] | 6 | 2015-04-16T05:57:18.000Z | 2017-05-03T18:34:16.000Z | examples/tag_by_location.py | davids-uta-edu/py-space-platform | 2ead02c1af8b696cf673eddaac5199c8267f0bf3 | [
"ECL-2.0",
"Apache-2.0"
] | 22 | 2015-03-26T08:41:04.000Z | 2020-09-24T19:50:43.000Z | """
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
Copyright (c) 2015 Juniper Networks, Inc.
All rights reserved.
Use is subject to license terms.
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 th... | 36.413333 | 82 | 0.693885 | """
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
Copyright (c) 2015 Juniper Networks, Inc.
All rights reserved.
Use is subject to license terms.
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 th... | 644 | 0 | 23 |
ed45d468f0c2248b8d88b97319d7a1360e54055b | 7,743 | py | Python | fluidfoam/processing1d.py | remichassagne/fluidfoam | fa89f4cdd2f159619ed7d128257612e183926c93 | [
"CECILL-B"
] | 64 | 2018-03-08T21:52:48.000Z | 2022-03-31T08:11:17.000Z | fluidfoam/processing1d.py | CyrilleBonamy/fluidfoam | 2befa35722aa7aa13ac7d48884461614d608262b | [
"CECILL-B"
] | 14 | 2019-12-12T10:56:10.000Z | 2022-03-31T15:32:47.000Z | fluidfoam/processing1d.py | CyrilleBonamy/fluidfoam | 2befa35722aa7aa13ac7d48884461614d608262b | [
"CECILL-B"
] | 21 | 2019-09-25T21:34:43.000Z | 2022-03-31T14:49:12.000Z | """Write, Read and Plot 1D input files for swak4foam
==========================================================================
This module allows to read OpenFoam output of one dimensional computation
and then write, plot and read input files for Boundary and Initial
Conditions imposition in 3D computation (via swak4f... | 32.39749 | 114 | 0.496965 | """Write, Read and Plot 1D input files for swak4foam
==========================================================================
This module allows to read OpenFoam output of one dimensional computation
and then write, plot and read input files for Boundary and Initial
Conditions imposition in 3D computation (via swak4f... | 0 | 0 | 0 |
963b388baf2e86c3adb9df71da6250a85efe136a | 2,765 | py | Python | energy_usage/main.py | optiz0r/energy-usage | b7b57fb05e46257af96db287ed9eff63cb4c5677 | [
"MIT"
] | 6 | 2020-10-12T22:18:55.000Z | 2021-06-13T09:36:49.000Z | energy_usage/main.py | optiz0r/energy-usage | b7b57fb05e46257af96db287ed9eff63cb4c5677 | [
"MIT"
] | 1 | 2021-06-13T09:56:10.000Z | 2021-06-13T20:16:04.000Z | energy_usage/main.py | optiz0r/energy-usage | b7b57fb05e46257af96db287ed9eff63cb4c5677 | [
"MIT"
] | 1 | 2021-05-09T14:20:59.000Z | 2021-05-09T14:20:59.000Z | import argparse
import logging
import os
import queue
import sys
import confuse
from energy_usage.influx_client import InfluxClient
from energy_usage.mqtt_client import MqttClient
from energy_usage.sep import parse_sep, usage_to_datapoints
if __name__ == '__main__':
main()
| 25.136364 | 103 | 0.625316 | import argparse
import logging
import os
import queue
import sys
import confuse
from energy_usage.influx_client import InfluxClient
from energy_usage.mqtt_client import MqttClient
from energy_usage.sep import parse_sep, usage_to_datapoints
def parse_args(arg_str=None):
if arg_str is None:
arg_str = sys.... | 2,363 | 0 | 115 |
3f9b9d33f3bac053061d7fd7e694eedeae93da99 | 21,296 | py | Python | didatictests/didatictests.py | lmkawakami/didatictests | fd6862cc6d59313d45a784b96048ed3bc42389f5 | [
"MIT"
] | 1 | 2022-01-10T11:58:12.000Z | 2022-01-10T11:58:12.000Z | didatictests/didatictests.py | lmkawakami/didatictests | fd6862cc6d59313d45a784b96048ed3bc42389f5 | [
"MIT"
] | 1 | 2022-01-10T03:51:01.000Z | 2022-01-10T03:51:13.000Z | didatictests/didatictests.py | lmkawakami/didatictests | fd6862cc6d59313d45a784b96048ed3bc42389f5 | [
"MIT"
] | 2 | 2022-01-18T21:02:25.000Z | 2022-02-07T19:13:35.000Z | import builtins
import sys
class Didatic_test:
"""
A class to configure and run simple didatic tests
Didatic_test(Callable=None, args={}, test_name=None, keyboard_inputs=(), \
expected_output=None, expected_prints="", verbose=None, \
run_output_test=None, run_prints_test=None,
)
... | 34.515397 | 88 | 0.579545 | import builtins
import sys
class Didatic_test:
"""
A class to configure and run simple didatic tests
Didatic_test(Callable=None, args={}, test_name=None, keyboard_inputs=(), \
expected_output=None, expected_prints="", verbose=None, \
run_output_test=None, run_prints_test=None,
)
... | 7,289 | 0 | 304 |
68447a9b071c1a187cc068eb308d7b403243d6b0 | 6,812 | py | Python | autogl/module/model/encoders/_dgl/_gin.py | dedsec-9/AutoGL | 487f2b2f798b9b1363ad5dc100fb410b12222e06 | [
"MIT"
] | null | null | null | autogl/module/model/encoders/_dgl/_gin.py | dedsec-9/AutoGL | 487f2b2f798b9b1363ad5dc100fb410b12222e06 | [
"MIT"
] | null | null | null | autogl/module/model/encoders/_dgl/_gin.py | dedsec-9/AutoGL | 487f2b2f798b9b1363ad5dc100fb410b12222e06 | [
"MIT"
] | null | null | null | import dgl
import torch.nn.functional
import typing as _typing
from dgl.nn.pytorch.conv import GINConv
from .. import base_encoder, encoder_registry
from ... import _utils
class ApplyNodeFunc(torch.nn.Module):
"""Update the node feature hv with MLP, BN and ReLU."""
class MLP(torch.nn.Module):
"""MLP with li... | 34.933333 | 98 | 0.546829 | import dgl
import torch.nn.functional
import typing as _typing
from dgl.nn.pytorch.conv import GINConv
from .. import base_encoder, encoder_registry
from ... import _utils
class ApplyNodeFunc(torch.nn.Module):
"""Update the node feature hv with MLP, BN and ReLU."""
def __init__(self, mlp):
super(Apply... | 4,620 | 60 | 231 |
eb1669f961f86b086e499126d0d7b3bd559ac0d8 | 26,338 | py | Python | infotrope/datasets/base.py | dwd/Polymer | 656d2b2f159b649fdb5281b82d938fb5453b9047 | [
"MIT"
] | 4 | 2016-04-14T06:52:02.000Z | 2019-03-30T08:43:14.000Z | infotrope/datasets/base.py | dwd/Polymer | 656d2b2f159b649fdb5281b82d938fb5453b9047 | [
"MIT"
] | null | null | null | infotrope/datasets/base.py | dwd/Polymer | 656d2b2f159b649fdb5281b82d938fb5453b9047 | [
"MIT"
] | null | null | null | #
# Copyright 2004,2005 Dave Cridland <dave@cridland.net>
#
# This file forms part of the Infotrope Python Library.
#
# The Infotrope Python Library is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either versi... | 36.030096 | 298 | 0.539601 | #
# Copyright 2004,2005 Dave Cridland <dave@cridland.net>
#
# This file forms part of the Infotrope Python Library.
#
# The Infotrope Python Library is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either versi... | 23,302 | 123 | 1,913 |
e39cc9e52f76f774f895e55eda47eb10730e2507 | 2,325 | py | Python | examples/publications/b_ATB_solvationFreeEnergies/sets/build_gromos_singleligand_files.py | SalomeRonja/restraintmaker | ecb4c524cb11ffffa2ee3a3665056412bef84999 | [
"MIT"
] | 1 | 2021-11-15T14:01:28.000Z | 2021-11-15T14:01:28.000Z | examples/publications/b_ATB_solvationFreeEnergies/sets/build_gromos_singleligand_files.py | SalomeRonja/restraintmaker | ecb4c524cb11ffffa2ee3a3665056412bef84999 | [
"MIT"
] | 3 | 2021-10-01T18:35:59.000Z | 2022-01-28T14:59:34.000Z | examples/publications/b_ATB_solvationFreeEnergies/sets/build_gromos_singleligand_files.py | SalomeRonja/restraintmaker | ecb4c524cb11ffffa2ee3a3665056412bef84999 | [
"MIT"
] | 3 | 2020-12-27T12:27:15.000Z | 2021-11-01T13:45:14.000Z | #%%
import os, sys, glob
from collections import defaultdict
from pygromos.gromos.gromosPP import GromosPP
from pygromos.gromos.gromosXX import GromosXX
from pygromos.files import imd
import restraintmaker
#CHANGE HERE
gromos_bin_path = "/home/bschroed/Documents/code/gromosPP/installed/bin"
restraintmaker_path = os.p... | 33.695652 | 142 | 0.732903 | #%%
import os, sys, glob
from collections import defaultdict
from pygromos.gromos.gromosPP import GromosPP
from pygromos.gromos.gromosXX import GromosXX
from pygromos.files import imd
import restraintmaker
#CHANGE HERE
gromos_bin_path = "/home/bschroed/Documents/code/gromosPP/installed/bin"
restraintmaker_path = os.p... | 0 | 0 | 0 |
7c4114e3fdb667259e1827035838bb4fd2294646 | 1,228 | py | Python | examples/graph/football.py | theaverageguy/networkx | b2b74b3ba028ef3788f796aa64b037c8ea446539 | [
"BSD-3-Clause"
] | null | null | null | examples/graph/football.py | theaverageguy/networkx | b2b74b3ba028ef3788f796aa64b037c8ea446539 | [
"BSD-3-Clause"
] | null | null | null | examples/graph/football.py | theaverageguy/networkx | b2b74b3ba028ef3788f796aa64b037c8ea446539 | [
"BSD-3-Clause"
] | 2 | 2016-09-04T10:59:12.000Z | 2020-02-17T07:43:04.000Z | #!/usr/bin/env python
"""
Load football network in GML format and compute some network statistcs.
Shows how to download GML graph in a zipped file, unpack it, and load
into a NetworkX graph.
Requires Internet connection to download the URL
http://www-personal.umich.edu/~mejn/netdata/football.zip
"""
# Author: Aric H... | 26.12766 | 71 | 0.708469 | #!/usr/bin/env python
"""
Load football network in GML format and compute some network statistcs.
Shows how to download GML graph in a zipped file, unpack it, and load
into a NetworkX graph.
Requires Internet connection to download the URL
http://www-personal.umich.edu/~mejn/netdata/football.zip
"""
# Author: Aric H... | 0 | 0 | 0 |
ab45ba28ece2b6f08898955e44b4f746e4747d64 | 2,390 | py | Python | locations/spiders/goodwill.py | davidchiles/alltheplaces | 6f35f6cd652e7462107ead0a77f322caff198653 | [
"MIT"
] | 297 | 2017-12-07T01:29:14.000Z | 2022-03-29T06:58:01.000Z | locations/spiders/goodwill.py | davidchiles/alltheplaces | 6f35f6cd652e7462107ead0a77f322caff198653 | [
"MIT"
] | 2,770 | 2017-11-28T04:20:21.000Z | 2022-03-31T11:29:16.000Z | locations/spiders/goodwill.py | davidchiles/alltheplaces | 6f35f6cd652e7462107ead0a77f322caff198653 | [
"MIT"
] | 111 | 2017-11-27T21:40:02.000Z | 2022-01-22T01:21:52.000Z | # -*- coding: utf-8 -*-
import scrapy
import json
from locations.items import GeojsonPointItem
CATEGORY_MAPPING = {
'1': 'Donation Site',
'2': 'Outlet',
'3': 'Retail Store',
'4': 'Job & Career Support',
'5': 'Headquarters'
}
| 33.661972 | 106 | 0.516736 | # -*- coding: utf-8 -*-
import scrapy
import json
from locations.items import GeojsonPointItem
CATEGORY_MAPPING = {
'1': 'Donation Site',
'2': 'Outlet',
'3': 'Retail Store',
'4': 'Job & Career Support',
'5': 'Headquarters'
}
class GoodwillSpider(scrapy.Spider):
name = "goodwill"
item_attr... | 1,915 | 205 | 23 |
2ea619d0142a49aa8f384ca7d65a3b1adde4ebbc | 2,170 | py | Python | apps/core/manager.py | zjjott/html | 68429832d8b022602915a267a62051f4869f430f | [
"MIT"
] | null | null | null | apps/core/manager.py | zjjott/html | 68429832d8b022602915a267a62051f4869f430f | [
"MIT"
] | null | null | null | apps/core/manager.py | zjjott/html | 68429832d8b022602915a267a62051f4869f430f | [
"MIT"
] | null | null | null | # coding=utf-8
from __future__ import unicode_literals
import sys
from IPython import start_ipython
import argparse
from apps.core.models.client import Client
import apps.conf # flake8: noqa
from tornado.options import options
import subprocess
managers = [ShellManage, DBShellManage, # flake8: noqa
... | 26.790123 | 69 | 0.621659 | # coding=utf-8
from __future__ import unicode_literals
import sys
from IPython import start_ipython
import argparse
from apps.core.models.client import Client
import apps.conf # flake8: noqa
from tornado.options import options
import subprocess
class BaseManage(object):
name = None # 启动子命令
doc = "" # 会用这个属... | 893 | 940 | 92 |
4207937d1c51c6694182c6a70926068e88bb2a6f | 8,041 | py | Python | direct/src/task/FrameProfiler.py | cmarshall108/panda3d-python3 | 8bea2c0c120b03ec1c9fd179701fdeb7510bb97b | [
"PHP-3.0",
"PHP-3.01"
] | 3 | 2020-01-02T08:43:36.000Z | 2020-07-05T08:59:02.000Z | direct/src/task/FrameProfiler.py | cmarshall108/panda3d-python3 | 8bea2c0c120b03ec1c9fd179701fdeb7510bb97b | [
"PHP-3.0",
"PHP-3.01"
] | 20 | 2021-05-03T18:02:23.000Z | 2022-03-12T12:01:04.000Z | Lib/site-packages/direct/task/FrameProfiler.py | fochoao/cpython | 3dc84b260e5bced65ebc2c45c40c8fa65f9b5aa9 | [
"bzip2-1.0.6",
"0BSD"
] | 1 | 2021-04-09T00:02:59.000Z | 2021-04-09T00:02:59.000Z | from direct.directnotify.DirectNotifyGlobal import directNotify
from direct.fsm.StatePush import FunctionCall
from direct.showbase.PythonUtil import formatTimeExact, normalDistrib
from direct.task import Task
| 43 | 97 | 0.57667 | from direct.directnotify.DirectNotifyGlobal import directNotify
from direct.fsm.StatePush import FunctionCall
from direct.showbase.PythonUtil import formatTimeExact, normalDistrib
from direct.task import Task
class FrameProfiler:
notify = directNotify.newCategory('FrameProfiler')
# because of precision requir... | 7,363 | 446 | 23 |
44878be67aae6a9ac74d9c0d731b8c221c71e809 | 2,329 | py | Python | src/tools/visum-transformer/read_infrastructure/src/read_infrastructure/util/lines.py | railtoolkit/OpenLinTim | 27eba8b6038946ce162e9f7bbc0bd23045029d51 | [
"MIT"
] | null | null | null | src/tools/visum-transformer/read_infrastructure/src/read_infrastructure/util/lines.py | railtoolkit/OpenLinTim | 27eba8b6038946ce162e9f7bbc0bd23045029d51 | [
"MIT"
] | null | null | null | src/tools/visum-transformer/read_infrastructure/src/read_infrastructure/util/lines.py | railtoolkit/OpenLinTim | 27eba8b6038946ce162e9f7bbc0bd23045029d51 | [
"MIT"
] | null | null | null | import logging
from core.model.graph import Graph
from core.model.lines import LinePool, Line
from core.model.ptn import Link, Stop
from common.model.net import Net
from common.util.constants import LINE_SECTION_HEADER, LINE_ROUTE_ITEMS_SECTION_HEADER, \
LINE_ROUTE_ITEMS_DIRECTION_HEADER, LINE_ROUTE_ITEMS_LINE_NAM... | 48.520833 | 124 | 0.719193 | import logging
from core.model.graph import Graph
from core.model.lines import LinePool, Line
from core.model.ptn import Link, Stop
from common.model.net import Net
from common.util.constants import LINE_SECTION_HEADER, LINE_ROUTE_ITEMS_SECTION_HEADER, \
LINE_ROUTE_ITEMS_DIRECTION_HEADER, LINE_ROUTE_ITEMS_LINE_NAM... | 1,886 | 0 | 46 |
bacc25571619ca1a153b7a8436183e857481c80b | 1,334 | py | Python | venv/Lib/site-packages/mcipc/rcon/je/commands/teleport.py | Svesnav2/Discord-Bot-Minecraft-server-status | ee34948e741930567a3adb557197523f9d32ace1 | [
"Unlicense"
] | null | null | null | venv/Lib/site-packages/mcipc/rcon/je/commands/teleport.py | Svesnav2/Discord-Bot-Minecraft-server-status | ee34948e741930567a3adb557197523f9d32ace1 | [
"Unlicense"
] | null | null | null | venv/Lib/site-packages/mcipc/rcon/je/commands/teleport.py | Svesnav2/Discord-Bot-Minecraft-server-status | ee34948e741930567a3adb557197523f9d32ace1 | [
"Unlicense"
] | null | null | null | """Implementation of the teleport command."""
from mcipc.rcon.client import Client
from mcipc.rcon.types import Anchor, Rotation, Vec3
__all__ = ['teleport']
def teleport(self: Client, *, destination: str = None, location: Vec3 = None,
targets: str = None, rotation: Rotation = None,
facin... | 31.761905 | 77 | 0.621439 | """Implementation of the teleport command."""
from mcipc.rcon.client import Client
from mcipc.rcon.types import Anchor, Rotation, Vec3
__all__ = ['teleport']
def teleport(self: Client, *, destination: str = None, location: Vec3 = None,
targets: str = None, rotation: Rotation = None,
facin... | 0 | 0 | 0 |
36dd5b81f7f62cd69ec877d923d43b280523fb8d | 4,046 | py | Python | scripts/function_puller.py | alcuadrado/eth2.0-specs | f55499c0baad5d22a6f7749a9153374c7edf9267 | [
"CC0-1.0"
] | null | null | null | scripts/function_puller.py | alcuadrado/eth2.0-specs | f55499c0baad5d22a6f7749a9153374c7edf9267 | [
"CC0-1.0"
] | null | null | null | scripts/function_puller.py | alcuadrado/eth2.0-specs | f55499c0baad5d22a6f7749a9153374c7edf9267 | [
"CC0-1.0"
] | null | null | null | import re
from typing import Dict, Tuple, NewType
FUNCTION_REGEX = r'^def [\w_]*'
BEGIN_INSERT_REGEX = r'# begin insert '
END_INSERT_REGEX = r'# end insert'
SpecObject = NewType('SpecObjects', Tuple[Dict[str, str], Dict[str, str], Dict[str, str], Dict[str, str]])
def get_spec(file_name: str) -> SpecObject:
"""... | 45.460674 | 119 | 0.542511 | import re
from typing import Dict, Tuple, NewType
FUNCTION_REGEX = r'^def [\w_]*'
BEGIN_INSERT_REGEX = r'# begin insert '
END_INSERT_REGEX = r'# end insert'
SpecObject = NewType('SpecObjects', Tuple[Dict[str, str], Dict[str, str], Dict[str, str], Dict[str, str]])
def get_spec(file_name: str) -> SpecObject:
"""... | 0 | 0 | 0 |
d8bf094e28fe8390c3d84fdfd1c20be429c49d9e | 98 | py | Python | enthought/envisage/ui/action/action_set.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | 3 | 2016-12-09T06:05:18.000Z | 2018-03-01T13:00:29.000Z | enthought/envisage/ui/action/action_set.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | 1 | 2020-12-02T00:51:32.000Z | 2020-12-02T08:48:55.000Z | enthought/envisage/ui/action/action_set.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | null | null | null | # proxy module
from __future__ import absolute_import
from envisage.ui.action.action_set import *
| 24.5 | 43 | 0.836735 | # proxy module
from __future__ import absolute_import
from envisage.ui.action.action_set import *
| 0 | 0 | 0 |
f048d9e1dc62c096862cd11bad90b0b911d6cdc4 | 8,176 | py | Python | optimizers/tensorflow/LAMB.py | AlanFokCo/compensation-tools | e3fbf2f583ff370d32ffa0e2b6a0c57c20ca9eb0 | [
"Apache-2.0"
] | null | null | null | optimizers/tensorflow/LAMB.py | AlanFokCo/compensation-tools | e3fbf2f583ff370d32ffa0e2b6a0c57c20ca9eb0 | [
"Apache-2.0"
] | null | null | null | optimizers/tensorflow/LAMB.py | AlanFokCo/compensation-tools | e3fbf2f583ff370d32ffa0e2b6a0c57c20ca9eb0 | [
"Apache-2.0"
] | null | null | null | import warnings
from typing import Optional, Union, Callable, List
from typeguard import typechecked
import tensorflow as tf
from tensorflow_addons.utils.types import FloatTensorLike
from tensorflow_addons.optimizers.utils import is_variable_matched_by_regexes
@tf.keras.utils.register_keras_serializable(package="Ad... | 41.085427 | 84 | 0.625245 | import warnings
from typing import Optional, Union, Callable, List
from typeguard import typechecked
import tensorflow as tf
from tensorflow_addons.utils.types import FloatTensorLike
from tensorflow_addons.optimizers.utils import is_variable_matched_by_regexes
@tf.keras.utils.register_keras_serializable(package="Ad... | 6,941 | 0 | 161 |
6a1c23894572a4e4e41bf47b5f43b2d3243c094a | 521 | py | Python | MainFiles/pythion/Assignment1_1_answer.py | Morris-wambua/pyKid | 99765ee9ee337efc2ba1f4be4007f34df0e6a8f1 | [
"MIT"
] | null | null | null | MainFiles/pythion/Assignment1_1_answer.py | Morris-wambua/pyKid | 99765ee9ee337efc2ba1f4be4007f34df0e6a8f1 | [
"MIT"
] | null | null | null | MainFiles/pythion/Assignment1_1_answer.py | Morris-wambua/pyKid | 99765ee9ee337efc2ba1f4be4007f34df0e6a8f1 | [
"MIT"
] | null | null | null | for i in range(1,26):
print('{0:5d}{1:5d}{2:6d}{3:6d}{4:6d}{5:6d}{6:6d}{7:6d}'.format(i,i*i,i+25,(i+25)*(i+25),i+50,(i+50)*(i+50),i+75,(i+75)*(i+75)))
# the characters in the curly brackets {} are placeholders for the data.
# the character before the colon indicates which of the data pieces should go where.
# the ... | 65.125 | 132 | 0.708253 | for i in range(1,26):
print('{0:5d}{1:5d}{2:6d}{3:6d}{4:6d}{5:6d}{6:6d}{7:6d}'.format(i,i*i,i+25,(i+25)*(i+25),i+50,(i+50)*(i+50),i+75,(i+75)*(i+75)))
# the characters in the curly brackets {} are placeholders for the data.
# the character before the colon indicates which of the data pieces should go where.
# the ... | 0 | 0 | 0 |
60759756c71a6da5c53813749d3da3fe55759688 | 3,105 | py | Python | utils_mod.py | innovator-zero/CS410_AI_Project2 | 2d33eb43274dcf6875f48b656ab7c7504ad2f7fa | [
"MIT"
] | null | null | null | utils_mod.py | innovator-zero/CS410_AI_Project2 | 2d33eb43274dcf6875f48b656ab7c7504ad2f7fa | [
"MIT"
] | null | null | null | utils_mod.py | innovator-zero/CS410_AI_Project2 | 2d33eb43274dcf6875f48b656ab7c7504ad2f7fa | [
"MIT"
] | null | null | null | import numpy as np
from multiprocessing import Pool
import glob
import os
import pandas as pd
import tensorflow as tf
# MAP
# restrict on @K is in ap_at_n
# data load generator
| 31.363636 | 111 | 0.571014 | import numpy as np
from multiprocessing import Pool
import glob
import os
import pandas as pd
import tensorflow as tf
def ap_at_10(data):
# based on https://github.com/google/youtube-8m/blob/master/average_precision_calculator.py
predictions, actuals = data
n = 10
total_num_positives = None
if le... | 2,833 | 0 | 90 |
d9bd8a4e9880845e45b6e63860e014baf705d1c0 | 76 | py | Python | hucrl/agent/__init__.py | lioritan/hucrl | fb5b3aea0edf69a4169ab79d2908918111fc6072 | [
"MIT"
] | 24 | 2020-12-05T20:10:27.000Z | 2022-03-25T10:00:51.000Z | hucrl/agent/__init__.py | lioritan/hucrl | fb5b3aea0edf69a4169ab79d2908918111fc6072 | [
"MIT"
] | 3 | 2021-02-04T10:07:30.000Z | 2021-06-02T15:25:18.000Z | hucrl/agent/__init__.py | lioritan/hucrl | fb5b3aea0edf69a4169ab79d2908918111fc6072 | [
"MIT"
] | 4 | 2021-04-04T12:36:40.000Z | 2022-03-26T10:37:55.000Z | """Python Script Template."""
from .model_based import MBMPOAgent, MPCAgent
| 25.333333 | 45 | 0.776316 | """Python Script Template."""
from .model_based import MBMPOAgent, MPCAgent
| 0 | 0 | 0 |
773f2dc30158c6d31ef821abf78ea88a059a38bd | 5,973 | py | Python | scripts/db_to_bundle.py | adolgert/cascade | 2084e07c9ee5e901dd407b817220de882c7246a3 | [
"MIT"
] | null | null | null | scripts/db_to_bundle.py | adolgert/cascade | 2084e07c9ee5e901dd407b817220de882c7246a3 | [
"MIT"
] | null | null | null | scripts/db_to_bundle.py | adolgert/cascade | 2084e07c9ee5e901dd407b817220de882c7246a3 | [
"MIT"
] | null | null | null | import argparse
import os
import re
from pathlib import Path
import numpy as np
import pandas as pd
from cascade.dismod.constants import DensityEnum, IntegrandEnum
from cascade.dismod.db.wrapper import get_engine
from cascade.input_data.configuration.id_map import make_integrand_map
MEASURES_ACCEPTABLE_TO_ELMO = {
... | 26.312775 | 110 | 0.61845 | import argparse
import os
import re
from pathlib import Path
import numpy as np
import pandas as pd
from cascade.dismod.constants import DensityEnum, IntegrandEnum
from cascade.dismod.db.wrapper import get_engine
from cascade.input_data.configuration.id_map import make_integrand_map
MEASURES_ACCEPTABLE_TO_ELMO = {
... | 3,382 | 0 | 23 |
756c5c44c633b5ed7e03288193e68c4de5dc6001 | 169 | py | Python | src/llana_main.py | carchard/llana | 8f755ad4e0217f67ececb639b4cf2b32294496ce | [
"MIT"
] | null | null | null | src/llana_main.py | carchard/llana | 8f755ad4e0217f67ececb639b4cf2b32294496ce | [
"MIT"
] | null | null | null | src/llana_main.py | carchard/llana | 8f755ad4e0217f67ececb639b4cf2b32294496ce | [
"MIT"
] | null | null | null | # authors:
# connor archard
# geoff keating
#
# updated:
# 12-15-2016
#
# brief:
# main file for llana operation
if __name__ == "__main__":
print "Hello world" | 13 | 32 | 0.650888 | # authors:
# connor archard
# geoff keating
#
# updated:
# 12-15-2016
#
# brief:
# main file for llana operation
if __name__ == "__main__":
print "Hello world" | 0 | 0 | 0 |
861e85ffcb8b0f165a295f1b2f939988161d235d | 1,598 | py | Python | transform.py | oskar-j/walsh-hadamard-transform | cd7df03648225e08ac6736194d7d605aaf49626b | [
"MIT"
] | 5 | 2019-07-01T21:26:22.000Z | 2021-08-22T01:51:52.000Z | transform.py | oskar-j/walsh-hadamard-transform | cd7df03648225e08ac6736194d7d605aaf49626b | [
"MIT"
] | 1 | 2019-07-07T14:33:24.000Z | 2019-07-07T14:33:24.000Z | transform.py | oskar-j/walsh-hadamard-transform | cd7df03648225e08ac6736194d7d605aaf49626b | [
"MIT"
] | null | null | null | # coding: utf-8
from fal.task import Task
import numpy as np
from PIL import Image
from matplotlib.pyplot import imshow
from matplotlib.pyplot import hist
import matplotlib.pyplot as plt
if __name__ == '__main__':
# Let'c create compression task
task = Task()
# We define in 'data flow' that we wish t... | 26.196721 | 90 | 0.695244 | # coding: utf-8
from fal.task import Task
import numpy as np
from PIL import Image
from matplotlib.pyplot import imshow
from matplotlib.pyplot import hist
import matplotlib.pyplot as plt
if __name__ == '__main__':
# Let'c create compression task
task = Task()
# We define in 'data flow' that we wish t... | 0 | 0 | 0 |
969d383d8ad8e247a4bde60f2e4ef30b26b6f0ea | 5,763 | py | Python | clinicadl/clinicadl/tools/deep_learning/models/slice_level.py | CCF0211/AD-DL | f449db4b8370d0d31fd2c815def2e175bfd29cb9 | [
"MIT"
] | null | null | null | clinicadl/clinicadl/tools/deep_learning/models/slice_level.py | CCF0211/AD-DL | f449db4b8370d0d31fd2c815def2e175bfd29cb9 | [
"MIT"
] | null | null | null | clinicadl/clinicadl/tools/deep_learning/models/slice_level.py | CCF0211/AD-DL | f449db4b8370d0d31fd2c815def2e175bfd29cb9 | [
"MIT"
] | null | null | null | # coding: utf8
import torch.utils.model_zoo as model_zoo
from torchvision.models.resnet import BasicBlock
from torch import nn
import math
import timm
import urllib
from PIL import Image
from timm.data import resolve_data_config
from timm.data.transforms_factory import create_transform
import torch.nn.functional as F
... | 33.9 | 104 | 0.618601 | # coding: utf8
import torch.utils.model_zoo as model_zoo
from torchvision.models.resnet import BasicBlock
from torch import nn
import math
import timm
import urllib
from PIL import Image
from timm.data import resolve_data_config
from timm.data.transforms_factory import create_transform
import torch.nn.functional as F
... | 3,918 | 27 | 302 |
7dd3626fa9166bf1afb27b484c0c537345831354 | 12,541 | py | Python | tools/data_builder.py | cmenedes/police-brutality | a978046291015716a4972b478a01fe192f5f5ea1 | [
"MIT"
] | 1 | 2020-09-30T18:43:31.000Z | 2020-09-30T18:43:31.000Z | tools/data_builder.py | cmenedes/police-brutality | a978046291015716a4972b478a01fe192f5f5ea1 | [
"MIT"
] | null | null | null | tools/data_builder.py | cmenedes/police-brutality | a978046291015716a4972b478a01fe192f5f5ea1 | [
"MIT"
] | null | null | null | import csv
import glob
import json
import os
import re
import copy
from dateutil.parser import parse
from datetime import datetime, timezone
# `or '.'` because when you're in the same directory as this code
# `ValueError: no path specified` gets thrown by `relpath` with empty input
src_dir = os.path.relpath(os.path.d... | 32.15641 | 255 | 0.600989 | import csv
import glob
import json
import os
import re
import copy
from dateutil.parser import parse
from datetime import datetime, timezone
# `or '.'` because when you're in the same directory as this code
# `ValueError: no path specified` gets thrown by `relpath` with empty input
src_dir = os.path.relpath(os.path.d... | 7,638 | 0 | 368 |
597a0880ab1292080a540b2aee82937627ce1567 | 2,007 | py | Python | server/edd/urls.py | trussworks/edd | 1183c6bb1f04de31d8c4c6ed7b97b051228f3bb7 | [
"BSD-3-Clause-LBNL"
] | 13 | 2016-11-15T07:33:40.000Z | 2021-09-22T12:19:13.000Z | server/edd/urls.py | trussworks/edd | 1183c6bb1f04de31d8c4c6ed7b97b051228f3bb7 | [
"BSD-3-Clause-LBNL"
] | 40 | 2017-04-04T15:20:14.000Z | 2022-03-31T04:34:37.000Z | server/edd/urls.py | trussworks/edd | 1183c6bb1f04de31d8c4c6ed7b97b051228f3bb7 | [
"BSD-3-Clause-LBNL"
] | 10 | 2017-09-21T07:27:01.000Z | 2022-03-10T17:02:19.000Z | from django.conf import settings
from django.contrib import admin
from django.contrib.auth.decorators import login_required
from django.contrib.flatpages import views as flatpage_views
from django.http import HttpResponse
from django.urls import include, path, re_path
from edd.branding.views import favicon as favicon_... | 37.867925 | 86 | 0.694071 | from django.conf import settings
from django.contrib import admin
from django.contrib.auth.decorators import login_required
from django.contrib.flatpages import views as flatpage_views
from django.http import HttpResponse
from django.urls import include, path, re_path
from edd.branding.views import favicon as favicon_... | 0 | 0 | 0 |
a6166bacafb2941014a2080438fc330df92d394d | 1,387 | py | Python | venv/Lib/site-packages/prompt_toolkit/output/color_depth.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 6,989 | 2017-07-18T06:23:18.000Z | 2022-03-31T15:58:36.000Z | venv/Lib/site-packages/prompt_toolkit/output/color_depth.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 1,978 | 2017-07-18T09:17:58.000Z | 2022-03-31T14:28:43.000Z | venv/Lib/site-packages/prompt_toolkit/output/color_depth.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 1,228 | 2017-07-18T09:03:13.000Z | 2022-03-29T05:57:40.000Z | import os
from enum import Enum
from typing import Optional
__all__ = [
"ColorDepth",
]
class ColorDepth(str, Enum):
"""
Possible color depth values for the output.
"""
value: str
#: One color only.
DEPTH_1_BIT = "DEPTH_1_BIT"
#: ANSI Colors.
DEPTH_4_BIT = "DEPTH_4_BIT"
#:... | 23.508475 | 77 | 0.64672 | import os
from enum import Enum
from typing import Optional
__all__ = [
"ColorDepth",
]
class ColorDepth(str, Enum):
"""
Possible color depth values for the output.
"""
value: str
#: One color only.
DEPTH_1_BIT = "DEPTH_1_BIT"
#: ANSI Colors.
DEPTH_4_BIT = "DEPTH_4_BIT"
#:... | 0 | 0 | 0 |
63208333abce488e6b6180083bdb0989bfa6ab67 | 2,771 | py | Python | spectratmo/util.py | tabataba/spectratmo-puma | 3cd9e07df012b5a7a3f298c68f8607c225b6f6a8 | [
"CECILL-B"
] | 1 | 2020-02-12T23:05:19.000Z | 2020-02-12T23:05:19.000Z | spectratmo/util.py | tabataba/spectratmo-puma | 3cd9e07df012b5a7a3f298c68f8607c225b6f6a8 | [
"CECILL-B"
] | null | null | null | spectratmo/util.py | tabataba/spectratmo-puma | 3cd9e07df012b5a7a3f298c68f8607c225b6f6a8 | [
"CECILL-B"
] | 1 | 2020-02-12T23:05:35.000Z | 2020-02-12T23:05:35.000Z | """Utilities
============
.. autoclass:: SetOfVariables
:members:
:private-members:
.. autoclass:: SetOfSpectra
:members:
:private-members:
.. autoclass:: StackOfSetOfVariables
:members:
:private-members:
"""
import numpy as np
from spectratmo.phys_const import g, Gamma_dah
class SetOfVariable... | 28.56701 | 68 | 0.595453 | """Utilities
============
.. autoclass:: SetOfVariables
:members:
:private-members:
.. autoclass:: SetOfSpectra
:members:
:private-members:
.. autoclass:: StackOfSetOfVariables
:members:
:private-members:
"""
import numpy as np
from spectratmo.phys_const import g, Gamma_dah
class SetOfVariable... | 2,028 | 0 | 188 |
8467b955db47e5c9760d26d8fee35028c732a1da | 11,009 | py | Python | bot.py | EndorFinee/PCBot | 08f6f3e2befe5e15c5f874492d1085b5efcc828c | [
"MIT"
] | null | null | null | bot.py | EndorFinee/PCBot | 08f6f3e2befe5e15c5f874492d1085b5efcc828c | [
"MIT"
] | null | null | null | bot.py | EndorFinee/PCBot | 08f6f3e2befe5e15c5f874492d1085b5efcc828c | [
"MIT"
] | 1 | 2019-07-07T14:21:02.000Z | 2019-07-07T14:21:02.000Z | # -*- coding: utf-8 -*-
import os
import telebot
import config
import random
import sys
import time
import psycopg2
from telebot import types
# Config vars
token = os.environ['TELEGRAM_TOKEN']
DATABASE_URL=os.environ['DATABASE_URL']
connect = psycopg2.connect(DATABASE_URL, sslmode='require')
cursor = connect.... | 65.922156 | 161 | 0.619039 | # -*- coding: utf-8 -*-
import os
import telebot
import config
import random
import sys
import time
import psycopg2
from telebot import types
# Config vars
token = os.environ['TELEGRAM_TOKEN']
DATABASE_URL=os.environ['DATABASE_URL']
connect = psycopg2.connect(DATABASE_URL, sslmode='require')
cursor = connect.... | 10,499 | 0 | 66 |
3e544d67615f49b64523f295d335b5698c500a37 | 26 | py | Python | simple_speech/__init__.py | innovationOUtside/nb_simple_speech | c9e78980de1813c68e82d3df32393f2ee079c9f4 | [
"MIT"
] | null | null | null | simple_speech/__init__.py | innovationOUtside/nb_simple_speech | c9e78980de1813c68e82d3df32393f2ee079c9f4 | [
"MIT"
] | null | null | null | simple_speech/__init__.py | innovationOUtside/nb_simple_speech | c9e78980de1813c68e82d3df32393f2ee079c9f4 | [
"MIT"
] | null | null | null | from .speech import Speech | 26 | 26 | 0.846154 | from .speech import Speech | 0 | 0 | 0 |
cc897b11910cd602b094ea8e7f9823468db50c02 | 16,297 | py | Python | vase/vep_filter.py | david-a-parry/vase | 698c19eb1d92b56248ad0a1d32be3e4f21137cf5 | [
"MIT"
] | 4 | 2020-03-25T06:09:39.000Z | 2021-03-23T11:22:00.000Z | vase/vep_filter.py | gantzgraf/vase | 52eb6a514fd89e7c4e290c258fdbbc1636db6168 | [
"MIT"
] | 1 | 2020-10-02T14:50:30.000Z | 2020-10-12T15:24:24.000Z | vase/vep_filter.py | gantzgraf/vase | 52eb6a514fd89e7c4e290c258fdbbc1636db6168 | [
"MIT"
] | 1 | 2021-02-20T11:32:34.000Z | 2021-02-20T11:32:34.000Z | import os
import logging
from .insilico_filter import InSilicoFilter
from .csq_filter import CsqFilter
lof_csq = {'frameshift_variant', 'stop_gained', 'splice_acceptor_variant',
'splice_donor_variant'}
class VepFilter(CsqFilter):
'''An object that filters VCF records based on annotated VEP data.'''
... | 44.285326 | 79 | 0.517519 | import os
import logging
from .insilico_filter import InSilicoFilter
from .csq_filter import CsqFilter
lof_csq = {'frameshift_variant', 'stop_gained', 'splice_acceptor_variant',
'splice_donor_variant'}
class VepFilter(CsqFilter):
'''An object that filters VCF records based on annotated VEP data.'''
... | 2,853 | 0 | 108 |
93ea7ae18c0399f765785f8b3f05735d7bd8fccf | 236 | py | Python | test/scenarios/command_check/tests/test_default.py | gzm55/molecule | 1d6ff8fe861fb5657c6f28c2f5918cce4f25adce | [
"MIT"
] | 1 | 2019-02-02T21:47:19.000Z | 2019-02-02T21:47:19.000Z | test/scenarios/command_check/tests/test_default.py | DalavanCloud/molecule | 86e497c1f81a99df4e1d357c417a6d315e903db2 | [
"MIT"
] | 2 | 2021-03-25T23:55:15.000Z | 2022-03-29T22:01:50.000Z | test/scenarios/command_check/tests/test_default.py | DalavanCloud/molecule | 86e497c1f81a99df4e1d357c417a6d315e903db2 | [
"MIT"
] | 1 | 2019-02-02T21:46:56.000Z | 2019-02-02T21:46:56.000Z | import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
'.molecule/ansible_inventory').get_hosts('all')
| 21.454545 | 63 | 0.754237 | import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
'.molecule/ansible_inventory').get_hosts('all')
def test_hosts_file(File):
f = File('/tmp/check')
assert not f.exists
| 57 | 0 | 23 |
824803f06491ef81f75eb0d5b0132969f56c12cf | 6,808 | py | Python | progressivis/stats/blobs_table.py | jdfekete/progressivis | 3bc79ce229cd628ef0aa4663136a674743697b47 | [
"BSD-2-Clause"
] | 51 | 2015-09-14T16:31:02.000Z | 2022-01-12T17:56:53.000Z | progressivis/stats/blobs_table.py | jdfekete/progressivis | 3bc79ce229cd628ef0aa4663136a674743697b47 | [
"BSD-2-Clause"
] | 10 | 2017-11-15T15:10:05.000Z | 2022-01-19T07:36:43.000Z | progressivis/stats/blobs_table.py | jdfekete/progressivis | 3bc79ce229cd628ef0aa4663136a674743697b47 | [
"BSD-2-Clause"
] | 5 | 2017-11-14T20:20:56.000Z | 2020-01-22T06:26:51.000Z | """
Isotropic Gaussian blobs
"""
from collections import OrderedDict
import logging
import numpy as np
from abc import ABCMeta, abstractmethod
from ..utils.errors import ProgressiveError, ProgressiveStopIteration
from progressivis import ProgressiveError, SlotDescriptor
from ..table.module import TableModule
from ..t... | 36.021164 | 111 | 0.606345 | """
Isotropic Gaussian blobs
"""
from collections import OrderedDict
import logging
import numpy as np
from abc import ABCMeta, abstractmethod
from ..utils.errors import ProgressiveError, ProgressiveStopIteration
from progressivis import ProgressiveError, SlotDescriptor
from ..table.module import TableModule
from ..t... | 5,424 | 181 | 306 |
79e89d3d683da0d16d985f1e6446742d0dfd7fc1 | 950 | py | Python | SRT/lib/datasets/optflow_utils.py | yerang823/landmark-detection | a01bcf79abcf9d203c1b92f29b49aab9005952c3 | [
"MIT"
] | 612 | 2019-06-01T07:10:57.000Z | 2022-03-30T13:44:41.000Z | SRT/lib/datasets/optflow_utils.py | yerang823/landmark-detection | a01bcf79abcf9d203c1b92f29b49aab9005952c3 | [
"MIT"
] | 67 | 2019-06-06T15:03:02.000Z | 2021-12-17T01:51:14.000Z | SRT/lib/datasets/optflow_utils.py | yerang823/landmark-detection | a01bcf79abcf9d203c1b92f29b49aab9005952c3 | [
"MIT"
] | 121 | 2019-06-01T16:37:23.000Z | 2022-03-27T19:20:28.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
#
import cv2
| 35.185185 | 76 | 0.726316 | # Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
#
import cv2
def get_optflow_retval(algorithm):
if algorithm.lower() == 'deepflow':
retval = cv2.optflow.createOptF... | 716 | 0 | 23 |
0943ec50d15d9751f0cada78ac17061c04574a8b | 1,142 | py | Python | jskparser/ast/stmt/returnstmt.py | natebragg/java-sketch | f5ac26f2cc46ae4556f9a61c55afd37f55c961ff | [
"MIT"
] | 15 | 2015-12-15T18:33:50.000Z | 2021-09-29T11:48:54.000Z | jskparser/ast/stmt/returnstmt.py | natebragg/java-sketch | f5ac26f2cc46ae4556f9a61c55afd37f55c961ff | [
"MIT"
] | 11 | 2015-11-16T22:14:58.000Z | 2021-09-23T05:28:40.000Z | jskparser/ast/stmt/returnstmt.py | natebragg/java-sketch | f5ac26f2cc46ae4556f9a61c55afd37f55c961ff | [
"MIT"
] | 8 | 2015-11-16T21:50:08.000Z | 2021-03-23T15:15:34.000Z | #!/usr/bin/env python
from .statement import Statement
from ..expr.nameexpr import NameExpr
from ..expr.literalexpr import LiteralExpr
from ..type.type import Type
from . import _import
| 24.297872 | 88 | 0.59282 | #!/usr/bin/env python
from .statement import Statement
from ..expr.nameexpr import NameExpr
from ..expr.literalexpr import LiteralExpr
from ..type.type import Type
from . import _import
class ReturnStmt(Statement):
def __init__(self, kwargs={}):
super(ReturnStmt, self).__init__(kwargs)
locs =... | 605 | 299 | 46 |
d7d215053e155a284da941b003f807461f834711 | 8,669 | py | Python | eval/eval_recognition/eval_ijb.py | yzhHoward/MagFace | 98b56d3a13a06cb9c081cc42a6e8137169af7798 | [
"Apache-2.0"
] | 431 | 2021-03-04T03:17:01.000Z | 2022-03-31T12:59:48.000Z | eval/eval_recognition/eval_ijb.py | yzhHoward/MagFace | 98b56d3a13a06cb9c081cc42a6e8137169af7798 | [
"Apache-2.0"
] | 40 | 2021-03-12T07:56:24.000Z | 2022-03-29T04:27:20.000Z | eval/eval_recognition/eval_ijb.py | yzhHoward/MagFace | 98b56d3a13a06cb9c081cc42a6e8137169af7798 | [
"Apache-2.0"
] | 70 | 2021-03-12T09:10:02.000Z | 2022-03-30T02:32:45.000Z | #!/usr/bin/env python
import argparse
import os
import cv2
import math
import numpy as np
from tqdm import tqdm
from sklearn.model_selection import KFold
from sklearn import metrics
from scipy.optimize import brentq
from scipy import interpolate
from sklearn.metrics import roc_curve, auc
import torch
import torch.nn ... | 36.120833 | 123 | 0.619218 | #!/usr/bin/env python
import argparse
import os
import cv2
import math
import numpy as np
from tqdm import tqdm
from sklearn.model_selection import KFold
from sklearn import metrics
from scipy.optimize import brentq
from scipy import interpolate
from sklearn.metrics import roc_curve, auc
import torch
import torch.nn ... | 6,025 | 0 | 207 |
b145d80f92580481752a2e1d689188659a644d55 | 8,091 | py | Python | src/flwr_experimental/baseline/run.py | yiliucs/flower | db4d7db353a702b79cbef48b9d4fa5831d91eb00 | [
"Apache-2.0"
] | 1 | 2020-12-29T17:37:12.000Z | 2020-12-29T17:37:12.000Z | src/flwr_experimental/baseline/run.py | yiliucs/flower | db4d7db353a702b79cbef48b9d4fa5831d91eb00 | [
"Apache-2.0"
] | null | null | null | src/flwr_experimental/baseline/run.py | yiliucs/flower | db4d7db353a702b79cbef48b9d4fa5831d91eb00 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Adap GmbH. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 33.296296 | 88 | 0.642937 | # Copyright 2020 Adap GmbH. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 0 | 0 | 0 |
366340617b1c5151be2142533461628bcb242cb4 | 1,121 | py | Python | in_class_examples_part_2/ucr_e-mail_input.py | ucrgradquant/ucr_python_seminar | cc3988aac334abf5cf1861da0770cd6c63784bf2 | [
"Apache-2.0"
] | null | null | null | in_class_examples_part_2/ucr_e-mail_input.py | ucrgradquant/ucr_python_seminar | cc3988aac334abf5cf1861da0770cd6c63784bf2 | [
"Apache-2.0"
] | null | null | null | in_class_examples_part_2/ucr_e-mail_input.py | ucrgradquant/ucr_python_seminar | cc3988aac334abf5cf1861da0770cd6c63784bf2 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2009-2013 by The Regents of the University of California
# 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 from
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | 35.03125 | 74 | 0.742194 | #
# Copyright 2009-2013 by The Regents of the University of California
# 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 from
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | 0 | 0 | 0 |
88236ad0c9019c5c1c99d371d7ebf056d477d5a8 | 21,470 | py | Python | feature/5_extract_feature.py | DataXujing/Boutique-Travel-Services-Predict | 8daf77165c7f7a9f7daa895f200515db59ba171e | [
"MIT"
] | 43 | 2018-06-22T07:53:21.000Z | 2021-11-23T03:31:46.000Z | feature/5_extract_feature.py | Bifzivkar/Boutique-Travel-Services-Predict | 8daf77165c7f7a9f7daa895f200515db59ba171e | [
"MIT"
] | null | null | null | feature/5_extract_feature.py | Bifzivkar/Boutique-Travel-Services-Predict | 8daf77165c7f7a9f7daa895f200515db59ba171e | [
"MIT"
] | 15 | 2018-07-22T13:36:02.000Z | 2021-01-09T14:30:15.000Z | # -*- encoding:utf-8 -*-
import pandas as pd
import numpy as np
from datetime import datetime
dire = '../../data/'
start = datetime.now()
orderHistory_train = pd.read_csv(dire + 'train/orderHistory_train.csv', encoding='utf-8')
orderFuture_train = pd.read_csv(dire + 'train/orderFuture_train3.csv', encoding='utf-8')
u... | 47.924107 | 249 | 0.69292 | # -*- encoding:utf-8 -*-
import pandas as pd
import numpy as np
from datetime import datetime
dire = '../../data/'
start = datetime.now()
orderHistory_train = pd.read_csv(dire + 'train/orderHistory_train.csv', encoding='utf-8')
orderFuture_train = pd.read_csv(dire + 'train/orderFuture_train3.csv', encoding='utf-8')
u... | 15,191 | 0 | 286 |
4641f2457526cdb1e198f1d280179ee2937ae682 | 1,816 | py | Python | rl_traders/agents/core.py | jjakimoto/rl_traders.py | d5411c96d49ba6a54751d12cdd11974e5cc1a8aa | [
"MIT"
] | 2 | 2018-10-07T14:16:32.000Z | 2019-01-28T00:14:29.000Z | rl_traders/agents/core.py | jjakimoto/rl_traders.py | d5411c96d49ba6a54751d12cdd11974e5cc1a8aa | [
"MIT"
] | null | null | null | rl_traders/agents/core.py | jjakimoto/rl_traders.py | d5411c96d49ba6a54751d12cdd11974e5cc1a8aa | [
"MIT"
] | 1 | 2019-11-05T00:51:20.000Z | 2019-11-05T00:51:20.000Z | from abc import ABC, abstractmethod
from tqdm import tqdm, tqdm_notebook
from ..processors import Processor
class BaseAgent(ABC):
"""Abstract Agentclass
Parameters
----------
action_spec: dict
Have to define 'type' and 'shape'
state_spec: dict, optional
Have to define 'type' an... | 29.770492 | 85 | 0.640419 | from abc import ABC, abstractmethod
from tqdm import tqdm, tqdm_notebook
from ..processors import Processor
class BaseAgent(ABC):
"""Abstract Agentclass
Parameters
----------
action_spec: dict
Have to define 'type' and 'shape'
state_spec: dict, optional
Have to define 'type' an... | 1,101 | 0 | 160 |
537d5b87b40494c58dc7a9d373d1124e1379f5f0 | 385 | py | Python | timeblock/time.py | w158rk/timeblock | 5b6f6382bb29217127a2387d9efc1655d22fe3a1 | [
"MIT"
] | 1 | 2021-05-03T13:13:12.000Z | 2021-05-03T13:13:12.000Z | timeblock/time.py | w158rk/timeblock | 5b6f6382bb29217127a2387d9efc1655d22fe3a1 | [
"MIT"
] | null | null | null | timeblock/time.py | w158rk/timeblock | 5b6f6382bb29217127a2387d9efc1655d22fe3a1 | [
"MIT"
] | null | null | null | from datetime import datetime,timedelta
current:datetime = None | 21.388889 | 51 | 0.722078 | from datetime import datetime,timedelta
current:datetime = None
def set_current(d: datetime.date, t:datetime.time):
global current
current = datetime.combine(d, t)
def get_current_date():
return current.date()
def get_current_time():
return current.time()
def inc_current(units: int):
delta = ti... | 229 | 0 | 92 |
166799c5b0bc1df1500ef56cdabafd4e3af994d8 | 3,049 | py | Python | databases.py | Fy-Network/fysql | 9a5910601e9aa13479c9fbd05eb64e958e90dea2 | [
"MIT"
] | 1 | 2016-06-17T08:48:52.000Z | 2016-06-17T08:48:52.000Z | databases.py | Fy-/fysql | 9a5910601e9aa13479c9fbd05eb64e958e90dea2 | [
"MIT"
] | 1 | 2016-06-17T18:06:41.000Z | 2016-06-17T18:06:41.000Z | databases.py | Fy-Network/fysql | 9a5910601e9aa13479c9fbd05eb64e958e90dea2 | [
"MIT"
] | 2 | 2018-02-11T02:14:11.000Z | 2020-01-07T05:40:34.000Z | # -*- coding: utf-8 -*-
"""
fysql.databases
~~~~~~~~~~~~~~~
:copyright: (c) 2016 by Gasquez Florian
:license: MIT, see LICENSE for more details.
"""
from __future__ import unicode_literals
from collections import OrderedDict
from warnings import filterwarnings
import mysql.connector as mysql_connector
from .excepti... | 21.935252 | 70 | 0.702525 | # -*- coding: utf-8 -*-
"""
fysql.databases
~~~~~~~~~~~~~~~
:copyright: (c) 2016 by Gasquez Florian
:license: MIT, see LICENSE for more details.
"""
from __future__ import unicode_literals
from collections import OrderedDict
from warnings import filterwarnings
import mysql.connector as mysql_connector
from .excepti... | 2,073 | 383 | 191 |
826249957a3d8af93fc3e00b2ec89ef6f61abd92 | 8,159 | py | Python | Selenium/Opencart_windows_operations/conftest.py | BahrmaLe/otus_python_homework | 510a4f1971b35048d760fcc45098e511b81bea31 | [
"MIT"
] | 1 | 2021-02-25T15:37:21.000Z | 2021-02-25T15:37:21.000Z | Selenium/Opencart_windows_operations/conftest.py | BahrmaLe/otus_python_homework | 510a4f1971b35048d760fcc45098e511b81bea31 | [
"MIT"
] | null | null | null | Selenium/Opencart_windows_operations/conftest.py | BahrmaLe/otus_python_homework | 510a4f1971b35048d760fcc45098e511b81bea31 | [
"MIT"
] | null | null | null | """Fixtures to testing Opencart login page"""
import os
import sys
import pytest
from selenium import webdriver as WD
from Selenium.Opencart_windows_operations.models.page_objects.page_objects import LoginPage, \
ProductPage, ProductsPage, ProductManager, DownloadPage, DownloadManager, CustomMenuDesignPage, Custom... | 42.717277 | 118 | 0.697022 | """Fixtures to testing Opencart login page"""
import os
import sys
import pytest
from selenium import webdriver as WD
from Selenium.Opencart_windows_operations.models.page_objects.page_objects import LoginPage, \
ProductPage, ProductsPage, ProductManager, DownloadPage, DownloadManager, CustomMenuDesignPage, Custom... | 0 | 0 | 0 |
051e4d78d4085682cbb0206e37e6ac2c0da1a589 | 1,646 | py | Python | cynpy/i2c.py | rayjhuang/cynpy | 1bf4476691f561322f6b2bfb5b2bef36f2e5e04b | [
"MIT"
] | null | null | null | cynpy/i2c.py | rayjhuang/cynpy | 1bf4476691f561322f6b2bfb5b2bef36f2e5e04b | [
"MIT"
] | null | null | null | cynpy/i2c.py | rayjhuang/cynpy | 1bf4476691f561322f6b2bfb5b2bef36f2e5e04b | [
"MIT"
] | null | null | null |
TRUE = 1 # ACK, YES
FALSE = 0 # NAK, NO
class i2c (object): # for polymorphism
'''
i2c class hierarchy
-------------------
i2c
\
aardvark_i2c
/ (aardv.py)
aardvark
'''
def choose_master (rpt=FALSE):
'''
TO CONSIDER FOLLOWING SCENAR... | 27.433333 | 123 | 0.53706 |
TRUE = 1 # ACK, YES
FALSE = 0 # NAK, NO
class i2c (object): # for polymorphism
'''
i2c class hierarchy
-------------------
i2c
\
aardvark_i2c
/ (aardv.py)
aardvark
'''
def enum (me): raise NotImplementedError()
def baud (me, ask): rai... | 403 | 0 | 158 |
622d3cc99f73955ecb3d5b33a08bb2260c6a5623 | 1,465 | py | Python | Calibration - Nozzle Response/callibrate_servo_tringle.py | technosap/FlyVR_TL_2E343 | bd21acf22cca8403b93862ccbcc348750f997923 | [
"MIT"
] | null | null | null | Calibration - Nozzle Response/callibrate_servo_tringle.py | technosap/FlyVR_TL_2E343 | bd21acf22cca8403b93862ccbcc348750f997923 | [
"MIT"
] | null | null | null | Calibration - Nozzle Response/callibrate_servo_tringle.py | technosap/FlyVR_TL_2E343 | bd21acf22cca8403b93862ccbcc348750f997923 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Jun 4 16:35:53 2019
@author: technosap
"""
import ctypes
import time
import math
from modular_client import ModularClient # for nozzle control
if __name__ == "__main__":
main()
| 29.897959 | 112 | 0.470307 | # -*- coding: utf-8 -*-
"""
Created on Tue Jun 4 16:35:53 2019
@author: technosap
"""
import ctypes
import time
import math
from modular_client import ModularClient # for nozzle control
def main():
dev = ModularClient(port='COM10') # Windows specific port
# dev.get_device_id()
# dev.get_methods()
de... | 1,212 | 0 | 23 |
c7e316a6cc5964fa9b30106676cb6a6534f08812 | 5,430 | py | Python | wikitablescrape.py | feedthebeat90/topos-challenge | 56842be8ffb33bed428762cc06f002f983457a4d | [
"MIT"
] | null | null | null | wikitablescrape.py | feedthebeat90/topos-challenge | 56842be8ffb33bed428762cc06f002f983457a4d | [
"MIT"
] | 1 | 2021-03-31T19:17:31.000Z | 2021-03-31T19:17:31.000Z | wikitablescrape.py | feedthebeat90/topos-challenge | 56842be8ffb33bed428762cc06f002f983457a4d | [
"MIT"
] | null | null | null | """Create CSVs from all tables on a Wikipedia article."""
import csv
import os
from bs4 import BeautifulSoup
import requests
from pprint import pprint
def scrape(url, output_name):
"""Create CSVs from all tables in a Wikipedia article.
ARGS:
url (str): The full URL of the Wikipedia article to scrape... | 32.710843 | 87 | 0.588214 | """Create CSVs from all tables on a Wikipedia article."""
import csv
import os
from bs4 import BeautifulSoup
import requests
from pprint import pprint
def scrape(url, output_name):
"""Create CSVs from all tables in a Wikipedia article.
ARGS:
url (str): The full URL of the Wikipedia article to scrape... | 0 | 0 | 0 |
d3ea40ac70a6361d94b605bce607160d63e360fa | 26,387 | py | Python | evillimiter/menus/main_menu.py | mostafa-yasen/evillimiter | 46d2033b022f4a51fb2f419393a5344ad3edea4a | [
"MIT"
] | 1,096 | 2019-03-27T23:21:34.000Z | 2022-03-27T12:33:21.000Z | evillimiter/menus/main_menu.py | mostafa-yasen/evillimiter | 46d2033b022f4a51fb2f419393a5344ad3edea4a | [
"MIT"
] | 116 | 2019-04-10T17:19:47.000Z | 2022-03-20T19:27:25.000Z | evillimiter/menus/main_menu.py | mostafa-yasen/evillimiter | 46d2033b022f4a51fb2f419393a5344ad3edea4a | [
"MIT"
] | 286 | 2019-03-27T23:21:52.000Z | 2022-03-25T19:02:00.000Z | import time
import socket
import curses
import netaddr
import threading
import collections
from terminaltables import SingleTable
import evillimiter.networking.utils as netutils
from .menu import CommandMenu
from evillimiter.networking.utils import BitRate
from evillimiter.console.io import IO
from evillim... | 36.801953 | 180 | 0.549134 | import time
import socket
import curses
import netaddr
import threading
import collections
from terminaltables import SingleTable
import evillimiter.networking.utils as netutils
from .menu import CommandMenu
from evillimiter.networking.utils import BitRate
from evillimiter.console.io import IO
from evillim... | 13,418 | 12,214 | 25 |
84324bd99a44d53d1f1b47653ba819853cafe98f | 5,235 | py | Python | Pyrlang/gen.py | s2hc-johan/Pyrlang | cd77f44b06677d313b241078282e4cb2bd7bd7a1 | [
"Apache-2.0"
] | null | null | null | Pyrlang/gen.py | s2hc-johan/Pyrlang | cd77f44b06677d313b241078282e4cb2bd7bd7a1 | [
"Apache-2.0"
] | null | null | null | Pyrlang/gen.py | s2hc-johan/Pyrlang | cd77f44b06677d313b241078282e4cb2bd7bd7a1 | [
"Apache-2.0"
] | null | null | null | """ A helper module to assist with gen:call-style message parsing and replying.
A generic incoming message looks like ``{$gen_call, {From, Ref}, Message}``.
"""
from Pyrlang import Term
class GenBase:
""" Base class for Gen messages, do not use directly. See
``GenIncomingMessage`` and ``GenIncomingCa... | 35.856164 | 80 | 0.600191 | """ A helper module to assist with gen:call-style message parsing and replying.
A generic incoming message looks like ``{$gen_call, {From, Ref}, Message}``.
"""
from Pyrlang import Term
class GenBase:
""" Base class for Gen messages, do not use directly. See
``GenIncomingMessage`` and ``GenIncomingCa... | 806 | 0 | 79 |
8f463170aadd58297b706c73c8ba914d8390c5e9 | 14,908 | py | Python | src/sage/geometry/relative_interior.py | UCD4IDS/sage | 43474c96d533fd396fe29fe0782d44dc7f5164f7 | [
"BSL-1.0"
] | 1,742 | 2015-01-04T07:06:13.000Z | 2022-03-30T11:32:52.000Z | src/sage/geometry/relative_interior.py | UCD4IDS/sage | 43474c96d533fd396fe29fe0782d44dc7f5164f7 | [
"BSL-1.0"
] | 66 | 2015-03-19T19:17:24.000Z | 2022-03-16T11:59:30.000Z | src/sage/geometry/relative_interior.py | UCD4IDS/sage | 43474c96d533fd396fe29fe0782d44dc7f5164f7 | [
"BSL-1.0"
] | 495 | 2015-01-10T10:23:18.000Z | 2022-03-24T22:06:11.000Z | r"""
Relative Interiors of Polyhedra and Cones
"""
# ****************************************************************************
# Copyright (C) 2021 Matthias Koeppe
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# ... | 34.429561 | 110 | 0.567749 | r"""
Relative Interiors of Polyhedra and Cones
"""
# ****************************************************************************
# Copyright (C) 2021 Matthias Koeppe
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# ... | 0 | 0 | 0 |
961c9747018bcc3a766268b8fdc55badf884779e | 17,022 | py | Python | custom_components/lennoxs30/config_flow.py | PeteRager/LennoxS30 | 5579c0f1e1a369c5c68b65d30f5bf30851442dee | [
"MIT"
] | 28 | 2021-06-04T15:57:37.000Z | 2022-03-28T22:59:58.000Z | custom_components/lennoxs30/config_flow.py | PeteRager/LennoxS30 | 5579c0f1e1a369c5c68b65d30f5bf30851442dee | [
"MIT"
] | 97 | 2021-06-04T22:23:18.000Z | 2022-03-31T14:54:18.000Z | custom_components/lennoxs30/config_flow.py | PeteRager/LennoxS30 | 5579c0f1e1a369c5c68b65d30f5bf30851442dee | [
"MIT"
] | 8 | 2021-07-22T20:48:00.000Z | 2021-11-03T12:02:51.000Z | import ipaddress
import re
from lennoxs30api.s30exception import EC_AUTHENTICATE, EC_LOGIN, S30Exception
import voluptuous as vol
from . import Manager
from .const import (
CONF_ALLERGEN_DEFENDER_SWITCH,
CONF_APP_ID,
CONF_CLOUD_CONNECTION,
CONF_CREATE_INVERTER_POWER,
CONF_CREATE_SENSORS,
CONF_F... | 40.918269 | 147 | 0.567148 | import ipaddress
import re
from lennoxs30api.s30exception import EC_AUTHENTICATE, EC_LOGIN, S30Exception
import voluptuous as vol
from . import Manager
from .const import (
CONF_ALLERGEN_DEFENDER_SWITCH,
CONF_APP_ID,
CONF_CLOUD_CONNECTION,
CONF_CREATE_INVERTER_POWER,
CONF_CREATE_SENSORS,
CONF_F... | 3,390 | 6,952 | 157 |
43fc0efa71086d127093049d027710be2c64639e | 10,918 | py | Python | visualisation/generation/electricity_generation_plot.py | HauHe/OSeMBEtoREEEMdb | 4ce4cb814ecd9d65b937af51f807f0b0fd88828a | [
"Apache-2.0",
"CC-BY-4.0"
] | 2 | 2021-01-07T15:27:18.000Z | 2022-02-12T21:21:04.000Z | visualisation/generation/electricity_generation_plot.py | HauHe/OSeMBEtoREEEMdb | 4ce4cb814ecd9d65b937af51f807f0b0fd88828a | [
"Apache-2.0",
"CC-BY-4.0"
] | 7 | 2019-07-23T15:16:09.000Z | 2022-02-15T10:47:57.000Z | visualisation/generation/electricity_generation_plot.py | HauHe/OSeMBEtoREEEMdb | 4ce4cb814ecd9d65b937af51f807f0b0fd88828a | [
"Apache-2.0",
"CC-BY-4.0"
] | 3 | 2021-06-08T13:06:45.000Z | 2022-03-23T14:39:07.000Z | # -*- coding: utf-8 -*-
"""
Created on Fri Sep 25 14:51:38 2020
@author: haukeh
"""
#%%Import of required packages
import numpy as np
import pandas as pd
import os
import sys
import plotly.graph_objs as go
from plotly.offline import plot
#%% Function to read results csv files
#%% Function to create dictionaries cont... | 41.356061 | 503 | 0.588111 | # -*- coding: utf-8 -*-
"""
Created on Fri Sep 25 14:51:38 2020
@author: haukeh
"""
#%%Import of required packages
import numpy as np
import pandas as pd
import os
import sys
import plotly.graph_objs as go
from plotly.offline import plot
#%% Function to read results csv files
def read_csv(scen, param):
df = pd.r... | 8,772 | 0 | 198 |
086da9fd8b4bf09932d4ca7390adf3bd53271063 | 5,095 | py | Python | src/antidote/providers/lazy.py | keelerm84/antidote | a30d488cd6d3421e50a2414bc9a20af052d3b821 | [
"MIT"
] | null | null | null | src/antidote/providers/lazy.py | keelerm84/antidote | a30d488cd6d3421e50a2414bc9a20af052d3b821 | [
"MIT"
] | null | null | null | src/antidote/providers/lazy.py | keelerm84/antidote | a30d488cd6d3421e50a2414bc9a20af052d3b821 | [
"MIT"
] | null | null | null | from typing import Callable, Dict, Hashable, Optional, Tuple, Union
from .._internal.utils import SlotsReprMixin
from ..core import DependencyInstance, DependencyProvider
class LazyCall(SlotsReprMixin):
"""
Dependency which is the result of the call of the given function with the
given arguments.
..... | 34.425676 | 87 | 0.602552 | from typing import Callable, Dict, Hashable, Optional, Tuple, Union
from .._internal.utils import SlotsReprMixin
from ..core import DependencyInstance, DependencyProvider
class LazyCall(SlotsReprMixin):
"""
Dependency which is the result of the call of the given function with the
given arguments.
..... | 1,377 | 214 | 99 |
554f324cd1b73fb5ea839a27518cc3cd2a409d84 | 606 | py | Python | scripts/model_summary.py | Dmitriuso/longformer | ff8c00bb672585d7f3a10f4a85c24e12a39c29e8 | [
"Apache-2.0"
] | null | null | null | scripts/model_summary.py | Dmitriuso/longformer | ff8c00bb672585d7f3a10f4a85c24e12a39c29e8 | [
"Apache-2.0"
] | null | null | null | scripts/model_summary.py | Dmitriuso/longformer | ff8c00bb672585d7f3a10f4a85c24e12a39c29e8 | [
"Apache-2.0"
] | null | null | null | import torch
#from pytorch_lightning import LightingModule
from transformers import AutoModelForSeq2SeqLM, MBartForConditionalGeneration
PATH = "../longformer/models/LongTinyMBART"
model = AutoModelForSeq2SeqLM.from_pretrained(PATH)
# model_torch = torch.load(PATH)
# model = model_torch
# model_lightning = MyLight... | 25.25 | 77 | 0.754125 | import torch
#from pytorch_lightning import LightingModule
from transformers import AutoModelForSeq2SeqLM, MBartForConditionalGeneration
PATH = "../longformer/models/LongTinyMBART"
model = AutoModelForSeq2SeqLM.from_pretrained(PATH)
# model_torch = torch.load(PATH)
# model = model_torch
# model_lightning = MyLight... | 0 | 0 | 0 |
11d5d4498d9e4821020710b9442598427cfb7f13 | 3,851 | py | Python | pyke/tests/test_kepconvert.py | ecalifornica/pyke | 6a3fcc0513cf012044e4420cc4d17064e582d142 | [
"MIT"
] | null | null | null | pyke/tests/test_kepconvert.py | ecalifornica/pyke | 6a3fcc0513cf012044e4420cc4d17064e582d142 | [
"MIT"
] | 1 | 2017-07-25T19:23:05.000Z | 2017-07-25T19:23:05.000Z | pyke/tests/test_kepconvert.py | mirca/PyKE | 6a3fcc0513cf012044e4420cc4d17064e582d142 | [
"MIT"
] | null | null | null | import pytest
import csv
from astropy.utils.data import get_pkg_data_filename
from astropy.io import fits as pyfits
from astropy.time import Time as astropyTime
from pyke import kepconvert
from pyke import kepio
from ..kepio import delete
fake_lc = get_pkg_data_filename("data/golden-lc.fits")
SUPPORTED_CONVERSION = [... | 44.264368 | 79 | 0.572579 | import pytest
import csv
from astropy.utils.data import get_pkg_data_filename
from astropy.io import fits as pyfits
from astropy.time import Time as astropyTime
from pyke import kepconvert
from pyke import kepio
from ..kepio import delete
fake_lc = get_pkg_data_filename("data/golden-lc.fits")
def test_kepconvert():
... | 3,284 | 0 | 46 |
67932b31fbfe6716b20cb211fb33ec4f13fa7a16 | 259 | py | Python | eventgen/src/config/utils.py | mtanvirulislam/infodium | b6210da6121bfb5a4fc178c8b9a6231794b30409 | [
"Apache-2.0"
] | 1 | 2021-05-26T11:28:02.000Z | 2021-05-26T11:28:02.000Z | eventgen/src/config/utils.py | mtanvirulislam/real-time-data-processing | b6210da6121bfb5a4fc178c8b9a6231794b30409 | [
"Apache-2.0"
] | null | null | null | eventgen/src/config/utils.py | mtanvirulislam/real-time-data-processing | b6210da6121bfb5a4fc178c8b9a6231794b30409 | [
"Apache-2.0"
] | null | null | null | import logging
import sys
| 28.777778 | 76 | 0.590734 | import logging
import sys
def printlog(log):
logging.basicConfig(level=logging.INFO,
format='[%(asctime)s] [%(levelname)s]: %(message)s',
handlers=[logging.StreamHandler(sys.stdout)])
logging.info(log) | 210 | 0 | 23 |
21f03fec975e47ecea6661210575c239ff1b02f1 | 8,077 | py | Python | demo.py | hukim1112/weakalign | 4d2c5a275fd50f34418734198b32de3c8ce749a8 | [
"MIT"
] | null | null | null | demo.py | hukim1112/weakalign | 4d2c5a275fd50f34418734198b32de3c8ce749a8 | [
"MIT"
] | null | null | null | demo.py | hukim1112/weakalign | 4d2c5a275fd50f34418734198b32de3c8ce749a8 | [
"MIT"
] | null | null | null | from __future__ import print_function, division
import os
import argparse
import torch
import torch.nn as nn
from os.path import exists
from torch.utils.data import Dataset, DataLoader
from model.cnn_geometric_model import CNNGeometric, TwoStageCNNGeometric
from data.pf_dataset import PFDataset, PFPascalDataset
from da... | 42.73545 | 146 | 0.710288 | from __future__ import print_function, division
import os
import argparse
import torch
import torch.nn as nn
from os.path import exists
from torch.utils.data import Dataset, DataLoader
from model.cnn_geometric_model import CNNGeometric, TwoStageCNNGeometric
from data.pf_dataset import PFDataset, PFPascalDataset
from da... | 763 | 0 | 22 |
71a21e4a40918501a27b23e93ce27aedb909ef4f | 890 | py | Python | tests/backend/tarantool/test_schema.py | liviu-lesan/planetmint | 54cf8e45108947aa8282ddaaf127d08e06ce842e | [
"Apache-2.0"
] | null | null | null | tests/backend/tarantool/test_schema.py | liviu-lesan/planetmint | 54cf8e45108947aa8282ddaaf127d08e06ce842e | [
"Apache-2.0"
] | null | null | null | tests/backend/tarantool/test_schema.py | liviu-lesan/planetmint | 54cf8e45108947aa8282ddaaf127d08e06ce842e | [
"Apache-2.0"
] | null | null | null | # Copyright © 2020 Interplanetary Database Association e.V.,
# Planetmint and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
from planetmint.backend.tarantool.connection import TarantoolDB
| 28.709677 | 102 | 0.720225 | # Copyright © 2020 Interplanetary Database Association e.V.,
# Planetmint and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
from planetmint.backend.tarantool.connection import TarantoolDB
def _check_spaces_by_list(conn, space_names):
... | 548 | 0 | 69 |
8e08988ea4cf640459c26fd2030ac36550909e58 | 5,320 | py | Python | main.py | biomadeira/gae_pubmed2rss | c033c8088249fcb67ed5ef5d1c0f236bd7cbf57a | [
"MIT"
] | null | null | null | main.py | biomadeira/gae_pubmed2rss | c033c8088249fcb67ed5ef5d1c0f236bd7cbf57a | [
"MIT"
] | null | null | null | main.py | biomadeira/gae_pubmed2rss | c033c8088249fcb67ed5ef5d1c0f236bd7cbf57a | [
"MIT"
] | null | null | null | #!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
"""
-------
main.py
-------
Main methods (views + routes) implemented in the API.
.. moduleauthor:: Fabio Madeira
:module_version: 1.0
:created_on: 28-02-2015
"""
import webapp2
import logging
import os
import jinja2
import urllib
from tools import *
from google.appeng... | 34.771242 | 117 | 0.664098 | #!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
"""
-------
main.py
-------
Main methods (views + routes) implemented in the API.
.. moduleauthor:: Fabio Madeira
:module_version: 1.0
:created_on: 28-02-2015
"""
import webapp2
import logging
import os
import jinja2
import urllib
from tools import *
from google.appeng... | 1,450 | 1,083 | 309 |
0ac9376d1d6f2acf015536f7964222f793b50596 | 10,774 | py | Python | doc/TRexDataAnalysis.py | timgates42/trex-core | efe94752fcb2d0734c83d4877afe92a3dbf8eccd | [
"Apache-2.0"
] | 956 | 2015-06-24T15:04:55.000Z | 2022-03-30T06:25:04.000Z | doc/TRexDataAnalysis.py | angelyouyou/trex-core | fddf78584cae285d9298ef23f9f5c8725e16911e | [
"Apache-2.0"
] | 782 | 2015-09-20T15:19:00.000Z | 2022-03-31T23:52:05.000Z | doc/TRexDataAnalysis.py | angelyouyou/trex-core | fddf78584cae285d9298ef23f9f5c8725e16911e | [
"Apache-2.0"
] | 429 | 2015-06-27T19:34:21.000Z | 2022-03-23T11:02:51.000Z | #!/scratch/Anaconda2.4.0/bin/python
import pandas as pd
import numpy as np
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
from matplotlib import dates as matdates
from matplotlib import lines as matlines
import os
import time
from datetime import datetime
"""
This Module is structured to... | 45.268908 | 121 | 0.621589 | #!/scratch/Anaconda2.4.0/bin/python
import pandas as pd
import numpy as np
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
from matplotlib import dates as matdates
from matplotlib import lines as matlines
import os
import time
from datetime import datetime
"""
This Module is structured to... | 9,165 | 128 | 410 |
8564c60bc6da704fa49bb24a6f7e2132c38d2509 | 11,722 | py | Python | beyond/orbits/forms.py | priyatharsan/beyond | 1061b870407d316d43e4d1351a7ec026629685ae | [
"MIT"
] | null | null | null | beyond/orbits/forms.py | priyatharsan/beyond | 1061b870407d316d43e4d1351a7ec026629685ae | [
"MIT"
] | null | null | null | beyond/orbits/forms.py | priyatharsan/beyond | 1061b870407d316d43e4d1351a7ec026629685ae | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""This module declares the different meanings that the Orbit 6 components can take
and their conversions
"""
from numpy import cos, arccos, sin, arcsin, arctan2, sqrt, arctanh, sinh, cosh
import numpy as np
from ..errors import UnknownFormError
from ..utils.node import... | 29.086849 | 87 | 0.494711 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""This module declares the different meanings that the Orbit 6 components can take
and their conversions
"""
from numpy import cos, arccos, sin, arcsin, arctan2, sqrt, arctanh, sinh, cosh
import numpy as np
from ..errors import UnknownFormError
from ..utils.node import... | 627 | 0 | 173 |
181dd2ebd78938c6289753f8e6243a7398061b6f | 2,664 | py | Python | chroma_core/services/__init__.py | beevans/integrated-manager-for-lustre | 6b7e49b8a58058e6139ad815a4388f21a581dfa0 | [
"MIT"
] | 52 | 2018-09-13T03:26:23.000Z | 2022-03-25T16:51:37.000Z | chroma_core/services/__init__.py | beevans/integrated-manager-for-lustre | 6b7e49b8a58058e6139ad815a4388f21a581dfa0 | [
"MIT"
] | 1,264 | 2018-06-15T19:50:57.000Z | 2022-03-28T08:19:04.000Z | chroma_core/services/__init__.py | beevans/integrated-manager-for-lustre | 6b7e49b8a58058e6139ad815a4388f21a581dfa0 | [
"MIT"
] | 27 | 2018-06-18T08:51:59.000Z | 2022-03-16T15:35:34.000Z | # Copyright (c) 2020 DDN. All rights reserved.
# Use of this source code is governed by a MIT-style
# license that can be found in the LICENSE file.
import threading
from kombu.connection import BrokerConnection
from kombu.messaging import Exchange
from kombu.entity import TRANSIENT_DELIVERY_MODE
import os
import sys... | 27.75 | 111 | 0.650526 | # Copyright (c) 2020 DDN. All rights reserved.
# Use of this source code is governed by a MIT-style
# license that can be found in the LICENSE file.
import threading
from kombu.connection import BrokerConnection
from kombu.messaging import Exchange
from kombu.entity import TRANSIENT_DELIVERY_MODE
import os
import sys... | 1,292 | 0 | 261 |
a61c895bde5c35a6c85ab9707bf4e5d78c16b929 | 312 | py | Python | my_awesome_project/users/migrations/0003_remove_user_bio.py | SocratesAncient/new | b8ffcb85b3691389d6a2627df1301643667a0de3 | [
"MIT"
] | null | null | null | my_awesome_project/users/migrations/0003_remove_user_bio.py | SocratesAncient/new | b8ffcb85b3691389d6a2627df1301643667a0de3 | [
"MIT"
] | null | null | null | my_awesome_project/users/migrations/0003_remove_user_bio.py | SocratesAncient/new | b8ffcb85b3691389d6a2627df1301643667a0de3 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.12 on 2021-06-23 17:25
from django.db import migrations
| 17.333333 | 48 | 0.570513 | # Generated by Django 3.1.12 on 2021-06-23 17:25
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0002_user_bio'),
]
operations = [
migrations.RemoveField(
model_name='user',
name='bio',
),
]
| 0 | 205 | 23 |
83b834e0a575aa2751c0d31ab4252ffc669e1430 | 4,513 | py | Python | tf2onnx/convert.py | duli2012/tensorflow-onnx | 32f7264e81fa69ebc36c204c7a606e2e8be90d80 | [
"MIT"
] | null | null | null | tf2onnx/convert.py | duli2012/tensorflow-onnx | 32f7264e81fa69ebc36c204c7a606e2e8be90d80 | [
"MIT"
] | null | null | null | tf2onnx/convert.py | duli2012/tensorflow-onnx | 32f7264e81fa69ebc36c204c7a606e2e8be90d80 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license.
"""
python -m tf2onnx.convert : tool to convert a frozen tensorflow to onnx
"""
from __future__ import division
from __future__ import print_function
import argparse
import sys
import onnx
from onnx import helper
import te... | 37.297521 | 107 | 0.674053 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license.
"""
python -m tf2onnx.convert : tool to convert a frozen tensorflow to onnx
"""
from __future__ import division
from __future__ import print_function
import argparse
import sys
import onnx
from onnx import helper
import te... | 2,044 | 0 | 46 |
82d84c7d806db8f3bd318b5491ca898dbaeae65b | 317 | py | Python | model/http/__init__.py | dc-avasilev/testing-api | 3f46406daa7e9145352e8cfba0878b2b3df510c6 | [
"MIT"
] | 1 | 2021-09-13T21:37:58.000Z | 2021-09-13T21:37:58.000Z | model/http/__init__.py | dc-avasilev/testing-api | 3f46406daa7e9145352e8cfba0878b2b3df510c6 | [
"MIT"
] | null | null | null | model/http/__init__.py | dc-avasilev/testing-api | 3f46406daa7e9145352e8cfba0878b2b3df510c6 | [
"MIT"
] | null | null | null | from .compare import (
CompareABC,
CompareDicts,
CompareEndswith,
CompareIgnore,
CompareIgnoreOrder
)
from .message import Message
from .request import Request
from .response import (
BaseBodyParser,
JSONBodyParser,
Response,
XMLBodyParser,
get_schema,
validate_response
)
| 17.611111 | 28 | 0.716088 | from .compare import (
CompareABC,
CompareDicts,
CompareEndswith,
CompareIgnore,
CompareIgnoreOrder
)
from .message import Message
from .request import Request
from .response import (
BaseBodyParser,
JSONBodyParser,
Response,
XMLBodyParser,
get_schema,
validate_response
)
| 0 | 0 | 0 |
b2ba1ceb08ae0521e02059a609e9d4fd255d96f0 | 518 | py | Python | from_base64.py | jabbalaci/Bash-Utils | c6fb115834a221c4aaba8eaa37f650beea45ef29 | [
"MIT"
] | 73 | 2015-03-31T01:12:26.000Z | 2021-07-10T19:45:04.000Z | from_base64.py | doc22940/Bash-Utils | c6fb115834a221c4aaba8eaa37f650beea45ef29 | [
"MIT"
] | 2 | 2017-01-06T17:17:42.000Z | 2017-08-23T18:35:55.000Z | from_base64.py | doc22940/Bash-Utils | c6fb115834a221c4aaba8eaa37f650beea45ef29 | [
"MIT"
] | 27 | 2015-01-03T18:51:23.000Z | 2020-11-15T11:49:51.000Z | #!/usr/bin/env python3
"""
Convert a base64 string back to a normal string (decode).
"""
import readline # to overcome the 4k input limit
from lib.jhash import base64_to_str as back
##############################################################################
if __name__ == "__main__":
main()
| 19.185185 | 78 | 0.515444 | #!/usr/bin/env python3
"""
Convert a base64 string back to a normal string (decode).
"""
import readline # to overcome the 4k input limit
from lib.jhash import base64_to_str as back
def main():
try:
inp = input("base64 string> ")
except (KeyboardInterrupt, EOFError):
print()
retu... | 187 | 0 | 23 |
850808f1f3d839b5e00f3b457fc33d1c95a55e51 | 6,538 | py | Python | ai_economist/foundation/components/education.py | CornellDataScience/AI-Economist | 1203eccb64b8f744229f738408e6b44ff5aaf21a | [
"BSD-3-Clause"
] | 1 | 2021-11-11T03:29:00.000Z | 2021-11-11T03:29:00.000Z | ai_economist/foundation/components/education.py | CornellDataScience/AI-Economist | 1203eccb64b8f744229f738408e6b44ff5aaf21a | [
"BSD-3-Clause"
] | 1 | 2021-11-06T22:29:27.000Z | 2021-11-06T22:29:27.000Z | ai_economist/foundation/components/education.py | CornellDataScience/ai-economist | 1203eccb64b8f744229f738408e6b44ff5aaf21a | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from ai_economist.foundation.base.base_component import BaseComponent, component_registry
@component_registry.add
class GetEducated(BaseComponent):
"""
Environments expand the agents' state/action spaces by querying:
get_n_actions
get_additional_state_fields
Environments ... | 37.574713 | 105 | 0.599113 | import numpy as np
from ai_economist.foundation.base.base_component import BaseComponent, component_registry
@component_registry.add
class GetEducated(BaseComponent):
"""
Environments expand the agents' state/action spaces by querying:
get_n_actions
get_additional_state_fields
Environments ... | 1,912 | 0 | 108 |
1f0f718e8960427f619ae5a29798356a0df97955 | 2,754 | py | Python | benchmark/qutip_benchmarks.py | trxw/qutip | b923c973edd9a071d86eb849650661549f73585f | [
"BSD-3-Clause"
] | 1 | 2015-11-06T06:35:06.000Z | 2015-11-06T06:35:06.000Z | benchmark/qutip_benchmarks.py | trxw/qutip | b923c973edd9a071d86eb849650661549f73585f | [
"BSD-3-Clause"
] | null | null | null | benchmark/qutip_benchmarks.py | trxw/qutip | b923c973edd9a071d86eb849650661549f73585f | [
"BSD-3-Clause"
] | null | null | null | # This file is part of QuTiP.
#
# QuTiP is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# QuTiP is distributed in the ... | 32.4 | 77 | 0.612564 | # This file is part of QuTiP.
#
# QuTiP is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# QuTiP is distributed in the ... | 324 | 0 | 22 |
456c5a74ca205e6d431e1daf8aae33ca461c59d9 | 452 | py | Python | Python_Exercicios/angulos.py | thalles-dreissig20/Quebra_Cabeca | eeb9458dbabac72d9867e5ec5d7f1aa9b5993d79 | [
"MIT"
] | null | null | null | Python_Exercicios/angulos.py | thalles-dreissig20/Quebra_Cabeca | eeb9458dbabac72d9867e5ec5d7f1aa9b5993d79 | [
"MIT"
] | 1 | 2021-11-29T18:37:14.000Z | 2021-11-29T18:37:14.000Z | Python_Exercicios/angulos.py | thalles-dreissig20/Quebra_Cabeca | eeb9458dbabac72d9867e5ec5d7f1aa9b5993d79 | [
"MIT"
] | null | null | null | from math import radians, sin, cos, tan
angulo = float(input('Digita o angulo que voce deseja: '))
seno = sin(radians(angulo))
print('O angulo de {} tem o seno de {:.2f}'.format(angulo, seno))
coseno = cos(radians(angulo))
print('O angulo de {} tem o cosseno de {:.2f}'.format(angulo, coseno))
tangente = tan(radians(ang... | 41.090909 | 74 | 0.681416 | from math import radians, sin, cos, tan
angulo = float(input('Digita o angulo que voce deseja: '))
seno = sin(radians(angulo))
print('O angulo de {} tem o seno de {:.2f}'.format(angulo, seno))
coseno = cos(radians(angulo))
print('O angulo de {} tem o cosseno de {:.2f}'.format(angulo, coseno))
tangente = tan(radians(ang... | 0 | 0 | 0 |
34770d8a031ecc93e3549ae52b9ba394afc22181 | 603 | py | Python | pkgs/anaconda-navigator-1.1.0-py27_0/lib/python2.7/site-packages/anaconda_navigator/templates/__init__.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | pkgs/anaconda-navigator-1.1.0-py27_0/lib/python2.7/site-packages/anaconda_navigator/templates/__init__.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | pkgs/anaconda-navigator-1.1.0-py27_0/lib/python2.7/site-packages/anaconda_navigator/templates/__init__.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2016 Continuum Analytics, Inc.
# May be copied and distributed freely only as part of an Anaconda or
# Miniconda installation.
#
"""
This folder contains jinja2 templates used by Anaconda Navigator.
This folder is defined as a python module so that some convenience global
variabl... | 27.409091 | 73 | 0.772803 | # -*- coding: utf-8 -*-
#
# Copyright 2016 Continuum Analytics, Inc.
# May be copied and distributed freely only as part of an Anaconda or
# Miniconda installation.
#
"""
This folder contains jinja2 templates used by Anaconda Navigator.
This folder is defined as a python module so that some convenience global
variabl... | 0 | 0 | 0 |
e7068a485f2ca1549f7033e2b99f4576733becd0 | 710 | py | Python | flask_wiki/frontend/frontend.py | gcavalcante8808/flask-wiki | a2c0af2e7fa6ce64faeb38e678a2e207ff63f3a6 | [
"BSD-2-Clause"
] | null | null | null | flask_wiki/frontend/frontend.py | gcavalcante8808/flask-wiki | a2c0af2e7fa6ce64faeb38e678a2e207ff63f3a6 | [
"BSD-2-Clause"
] | 35 | 2015-10-08T21:00:22.000Z | 2021-06-25T15:29:41.000Z | flask_wiki/frontend/frontend.py | gcavalcante8808/flask-wiki | a2c0af2e7fa6ce64faeb38e678a2e207ff63f3a6 | [
"BSD-2-Clause"
] | 1 | 2019-07-09T14:17:48.000Z | 2019-07-09T14:17:48.000Z | from flask import Flask, render_template, abort, redirect, url_for
from flask_script import Manager
from jinja2 import TemplateNotFound
app = Flask(__name__)
app.config['TESTING'] = True
manager = Manager(app)
@app.route('/', endpoint='frontend-index')
@app.route('/<page>', endpoint='frontend-pages')
def show(page... | 23.666667 | 66 | 0.676056 | from flask import Flask, render_template, abort, redirect, url_for
from flask_script import Manager
from jinja2 import TemplateNotFound
app = Flask(__name__)
app.config['TESTING'] = True
manager = Manager(app)
@app.route('/', endpoint='frontend-index')
def root():
# Redirect Base URL for the real Index Page.
... | 100 | 0 | 22 |
7adeca7d93d4713767194c4859d3d9beb08c2e15 | 2,855 | py | Python | melodic-manatees/early_internet/main/views.py | Vthechamp22/summer-code-jam-2021 | 0a8bf1f22f6c73300891fd779da36efd8e1304c1 | [
"MIT"
] | 40 | 2020-08-02T07:38:22.000Z | 2021-07-26T01:46:50.000Z | melodic-manatees/early_internet/main/views.py | Vthechamp22/summer-code-jam-2021 | 0a8bf1f22f6c73300891fd779da36efd8e1304c1 | [
"MIT"
] | 134 | 2020-07-31T12:15:45.000Z | 2020-12-13T04:42:19.000Z | melodic-manatees/early_internet/main/views.py | Vthechamp22/summer-code-jam-2021 | 0a8bf1f22f6c73300891fd779da36efd8e1304c1 | [
"MIT"
] | 101 | 2020-07-31T12:00:47.000Z | 2021-11-01T09:06:58.000Z | import requests
from decouple import config
from django.shortcuts import render, redirect
from django.core.exceptions import ObjectDoesNotExist
from users.models import UserPreferences
from diary.models import DiaryEntry
from diary.forms import DiaryEntryForm
| 33.988095 | 86 | 0.582837 | import requests
from decouple import config
from django.shortcuts import render, redirect
from django.core.exceptions import ObjectDoesNotExist
from users.models import UserPreferences
from diary.models import DiaryEntry
from diary.forms import DiaryEntryForm
def main(request):
news_key = config('NEWS_KEY')
... | 2,571 | 0 | 23 |
02c479119c63e0d1cf589aba3f5923da1cb34526 | 18,242 | py | Python | Logo/Logo.py | huky643/manim_sandbox | 397c8857145f371aeeca611e5e65c60083758d0c | [
"MIT"
] | 2 | 2020-11-01T05:34:28.000Z | 2020-11-01T05:34:31.000Z | Logo/Logo.py | huky643/manim_sandbox | 397c8857145f371aeeca611e5e65c60083758d0c | [
"MIT"
] | null | null | null | Logo/Logo.py | huky643/manim_sandbox | 397c8857145f371aeeca611e5e65c60083758d0c | [
"MIT"
] | null | null | null |
"""
关于logo创意:
1. 基础元素为M和K的负空间设计
2. 白色部分创意来自弦图
3. 整体图案本身可生成一个不错的分形
4. 配色致敬3B1B(具体的蓝色和棕色还得再微调一下)
logo主要创意由@GrakePCH提供,@GZTime、@cigar666、@鹤翔万里都提供了不少宝贵意见。目前设计工作还在继续完善,希望大家多提意见和建议
"""
from manimlib.imports import *
# final
| 35.8389 | 148 | 0.591821 |
"""
关于logo创意:
1. 基础元素为M和K的负空间设计
2. 白色部分创意来自弦图
3. 整体图案本身可生成一个不错的分形
4. 配色致敬3B1B(具体的蓝色和棕色还得再微调一下)
logo主要创意由@GrakePCH提供,@GZTime、@cigar666、@鹤翔万里都提供了不少宝贵意见。目前设计工作还在继续完善,希望大家多提意见和建议
"""
from manimlib.imports import *
class Logo(VGroup):
CONFIG = {
'color_1': [WHITE, BLUE_B, BLUE_D],
'col... | 16,392 | 1,358 | 261 |
a1109e345f71fa4c087beb4cc1cd05af8bbcaa78 | 3,110 | py | Python | quickbooks/batch.py | varunbheemaiah/python-quickbooks | f5459a07619ae220e24099c6e0c8e8db890bb66b | [
"MIT"
] | 234 | 2015-08-25T02:41:33.000Z | 2020-03-30T15:30:23.000Z | quickbooks/batch.py | varunbheemaiah/python-quickbooks | f5459a07619ae220e24099c6e0c8e8db890bb66b | [
"MIT"
] | 170 | 2015-09-12T07:02:32.000Z | 2020-03-20T13:34:34.000Z | quickbooks/batch.py | varunbheemaiah/python-quickbooks | f5459a07619ae220e24099c6e0c8e8db890bb66b | [
"MIT"
] | 142 | 2015-08-26T07:08:56.000Z | 2020-03-20T11:59:52.000Z | import uuid
from .client import QuickBooks
from .exceptions import QuickbooksException
from .objects.batchrequest import IntuitBatchRequest, BatchItemRequest, BatchOperation, BatchResponse, BatchItemResponse
| 34.175824 | 120 | 0.678135 | import uuid
from .client import QuickBooks
from .exceptions import QuickbooksException
from .objects.batchrequest import IntuitBatchRequest, BatchItemRequest, BatchOperation, BatchResponse, BatchItemResponse
class BatchManager(object):
def __init__(self, operation, max_request_items=30):
self._max_reques... | 2,666 | 6 | 226 |
bd246d6ac90c60a4c8d7fbe993a1475528e524bc | 463 | py | Python | test/test_inference.py | phanxuanphucnd/wav2asr | 6e4d6f6ce0165bd1f2baf3c219b7755dc2202c36 | [
"MIT"
] | 1 | 2021-06-23T01:41:46.000Z | 2021-06-23T01:41:46.000Z | test/test_inference.py | phanxuanphucnd/wav2asr | 6e4d6f6ce0165bd1f2baf3c219b7755dc2202c36 | [
"MIT"
] | null | null | null | test/test_inference.py | phanxuanphucnd/wav2asr | 6e4d6f6ce0165bd1f2baf3c219b7755dc2202c36 | [
"MIT"
] | 2 | 2021-07-28T14:51:47.000Z | 2021-10-30T19:53:34.000Z | from arizona.asr.learner import Wav2AsrLearner
learner = Wav2AsrLearner(
pretrain_model='path/to/pretrain.pt',
finetune_model='path/to/finetune.pt',
dictionary='path/to/dict.ltr.txt',
lm_type='kenlm',
lm_lexicon='path/to/lm/lexicon.txt',
lm_model='path/to/lm/lm.bin',
lm_weight=1.5,
... | 22.047619 | 46 | 0.658747 | from arizona.asr.learner import Wav2AsrLearner
learner = Wav2AsrLearner(
pretrain_model='path/to/pretrain.pt',
finetune_model='path/to/finetune.pt',
dictionary='path/to/dict.ltr.txt',
lm_type='kenlm',
lm_lexicon='path/to/lm/lexicon.txt',
lm_model='path/to/lm/lm.bin',
lm_weight=1.5,
... | 0 | 0 | 0 |
83953f1d614b2e84fcb3dcb99d7d5d34855995b9 | 740 | py | Python | tests/data_sources/satellite/test_satellite_model.py | lenassero/nowcasting_dataset | deaf098c4d318f3ef532bac73f9cc4fa2858479b | [
"MIT"
] | null | null | null | tests/data_sources/satellite/test_satellite_model.py | lenassero/nowcasting_dataset | deaf098c4d318f3ef532bac73f9cc4fa2858479b | [
"MIT"
] | null | null | null | tests/data_sources/satellite/test_satellite_model.py | lenassero/nowcasting_dataset | deaf098c4d318f3ef532bac73f9cc4fa2858479b | [
"MIT"
] | null | null | null | """Test Satellite model."""
import os
import tempfile
import numpy as np
import pytest
from nowcasting_dataset.data_sources.fake import satellite_fake
from nowcasting_dataset.data_sources.satellite.satellite_model import Satellite
| 23.125 | 79 | 0.739189 | """Test Satellite model."""
import os
import tempfile
import numpy as np
import pytest
from nowcasting_dataset.data_sources.fake import satellite_fake
from nowcasting_dataset.data_sources.satellite.satellite_model import Satellite
def test_satellite_init(): # noqa: D103
_ = satellite_fake()
def test_satellit... | 435 | 0 | 69 |
d8dcee92379cf3ecf4def5fe4e4a50edef0975b9 | 5,230 | py | Python | src/htrun/host_tests_plugins/host_test_registry.py | Patater/greentea | 4fcf55396ab7f5960a542edb88365686b8f33624 | [
"Apache-2.0"
] | 37 | 2015-09-10T13:52:40.000Z | 2021-11-17T11:53:30.000Z | src/htrun/host_tests_plugins/host_test_registry.py | Patater/greentea | 4fcf55396ab7f5960a542edb88365686b8f33624 | [
"Apache-2.0"
] | 270 | 2015-09-09T13:00:53.000Z | 2021-12-16T17:39:05.000Z | src/htrun/host_tests_plugins/host_test_registry.py | Patater/greentea | 4fcf55396ab7f5960a542edb88365686b8f33624 | [
"Apache-2.0"
] | 51 | 2015-09-04T13:16:47.000Z | 2021-11-18T15:40:03.000Z | #
# Copyright (c) 2021 Arm Limited and Contributors. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
"""Registry of available host test plugins."""
class HostTestRegistry:
"""Register and store host test plugins for further usage."""
# Here we actually store all the plugins
PLUGINS = {} # '... | 32.893082 | 84 | 0.570937 | #
# Copyright (c) 2021 Arm Limited and Contributors. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
"""Registry of available host test plugins."""
class HostTestRegistry:
"""Register and store host test plugins for further usage."""
# Here we actually store all the plugins
PLUGINS = {} # '... | 0 | 0 | 0 |
e37a75611063a66617e3e1deb56404ce08506cd3 | 1,407 | py | Python | genofunk/subcommands/apply.py | rmcolq/genofunk | ffa031fb361fc736e839d0e36d36f8ed7ade30dc | [
"MIT"
] | 1 | 2021-01-09T23:25:02.000Z | 2021-01-09T23:25:02.000Z | genofunk/subcommands/apply.py | rmcolq/genofunk | ffa031fb361fc736e839d0e36d36f8ed7ade30dc | [
"MIT"
] | null | null | null | genofunk/subcommands/apply.py | rmcolq/genofunk | ffa031fb361fc736e839d0e36d36f8ed7ade30dc | [
"MIT"
] | null | null | null | import logging
import os
import sys
from genofunk import apply
| 37.026316 | 115 | 0.436389 | import logging
import os
import sys
from genofunk import apply
def run(options):
if options.verbose:
log_level = logging.DEBUG
msg = "Using debug logging"
else:
log_level = logging.INFO
msg = "Using info logging"
#log_file = f"apply.log"
#if os.path.exists(log_file):
... | 1,319 | 0 | 23 |
65d5b20d577cda0ce9aba91179e9550e701e1148 | 3,132 | py | Python | script/alert.py | xbot/SmartHome | c473d455d7555e8806a2f5d09dff6db6beb8ae9b | [
"MIT"
] | 1 | 2021-02-09T09:40:17.000Z | 2021-02-09T09:40:17.000Z | script/alert.py | xbot/SmartHome | c473d455d7555e8806a2f5d09dff6db6beb8ae9b | [
"MIT"
] | null | null | null | script/alert.py | xbot/SmartHome | c473d455d7555e8806a2f5d09dff6db6beb8ae9b | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# encoding: utf-8
####################################################
#
# Description: Alert for invasion using pushbullet.
# Author: Donie Leigh<donie.leigh at gmail.com>
# License: MIT
#
####################################################
import sys, getopt, time, json
from Conf... | 33.319149 | 113 | 0.587165 | #!/usr/bin/env python2
# encoding: utf-8
####################################################
#
# Description: Alert for invasion using pushbullet.
# Author: Donie Leigh<donie.leigh at gmail.com>
# License: MIT
#
####################################################
import sys, getopt, time, json
from Conf... | 588 | 0 | 46 |
feb9c5c67882480ba12e4d921db5600c99a3ce73 | 8,149 | py | Python | pdserver/game.py | Gustavo6046/polydung | e8626c67b0f59e00a2400b5a5c644e3f6b925e00 | [
"MIT"
] | null | null | null | pdserver/game.py | Gustavo6046/polydung | e8626c67b0f59e00a2400b5a5c644e3f6b925e00 | [
"MIT"
] | null | null | null | pdserver/game.py | Gustavo6046/polydung | e8626c67b0f59e00a2400b5a5c644e3f6b925e00 | [
"MIT"
] | null | null | null | import objects
import logging
import sqlite3
import threading
import json
import serverprotocol
import sqlite3
import base64
import socket
tileset = []
SCODE_NEEDAUTH = 0
SCODE_BANNED = 1
SCODE_BADAUTH = 2
SCODE_BADREG = 3
| 32.466135 | 155 | 0.51356 | import objects
import logging
import sqlite3
import threading
import json
import serverprotocol
import sqlite3
import base64
import socket
tileset = []
SCODE_NEEDAUTH = 0
SCODE_BANNED = 1
SCODE_BADAUTH = 2
SCODE_BADREG = 3
class TileType(object):
def __init__(self, sprite="nulltile", functions=()):
sel... | 7,191 | 0 | 732 |
40e3bed3f3d2b5c988c4e485fc439ec96b3aea05 | 271 | py | Python | mainapp/migrations/0073_merge_20180822_0015.py | raeeska/rescuekerala | 649070cd051e0bf2ef54549c96493d5c4c5d89c9 | [
"MIT"
] | 1 | 2018-08-21T15:06:21.000Z | 2018-08-21T15:06:21.000Z | mainapp/migrations/0073_merge_20180822_0015.py | pranavmodx/rescuekerala | dd75a06b191b39ff4bdcd8e42d61c98a6509f052 | [
"MIT"
] | 1 | 2018-08-28T13:26:26.000Z | 2018-08-28T13:26:26.000Z | mainapp/migrations/0073_merge_20180822_0015.py | shashwat1002/rescuekerala | be7b7a959a2f4fa949768115b9c76eb3cccc32cb | [
"MIT"
] | 5 | 2019-11-07T11:34:56.000Z | 2019-11-07T11:36:00.000Z | # Generated by Django 2.1 on 2018-08-21 18:45
from django.db import migrations
| 18.066667 | 47 | 0.649446 | # Generated by Django 2.1 on 2018-08-21 18:45
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('mainapp', '0072_auto_20180822_0000'),
('mainapp', '0071_auto_20180821_2358'),
]
operations = [
]
| 0 | 167 | 23 |
ffffabc9876cf60dca77175cfe7e1da5cc1dacb6 | 193 | py | Python | F29.Phen2Gene/WebAPI/about.py | foundation29org/F29.Phen2Gene | a5a211c9d839382dee32ee7be93c845fe8affd1e | [
"MIT"
] | null | null | null | F29.Phen2Gene/WebAPI/about.py | foundation29org/F29.Phen2Gene | a5a211c9d839382dee32ee7be93c845fe8affd1e | [
"MIT"
] | null | null | null | F29.Phen2Gene/WebAPI/about.py | foundation29org/F29.Phen2Gene | a5a211c9d839382dee32ee7be93c845fe8affd1e | [
"MIT"
] | null | null | null | from flask import current_app
from flask_restplus import Resource
from ._api import API
@API.route('/version')
| 19.3 | 55 | 0.766839 | from flask import current_app
from flask_restplus import Resource
from ._api import API
@API.route('/version')
class About(Resource):
def get(self): return current_app.config['VERSION']
| 30 | 1 | 48 |
b6da1f10160c1db772b332558a590bb3896e3f11 | 3,313 | py | Python | 4_m5C_step-by-step_pileup/concat_bam.py | caoy3/RNA-m5C | 65b4e9d66f4c2a75e2854c7f9de5ed63b892d844 | [
"MIT"
] | 2 | 2021-03-07T12:02:56.000Z | 2022-03-12T08:24:36.000Z | 4_m5C_step-by-step_pileup/concat_bam.py | caoy3/RNA-m5C | 65b4e9d66f4c2a75e2854c7f9de5ed63b892d844 | [
"MIT"
] | null | null | null | 4_m5C_step-by-step_pileup/concat_bam.py | caoy3/RNA-m5C | 65b4e9d66f4c2a75e2854c7f9de5ed63b892d844 | [
"MIT"
] | 8 | 2019-05-17T08:22:29.000Z | 2022-03-04T04:18:41.000Z | #!bin/usr/env python
#Jianheng Liu @ Zhanglab, SYSU
#Feb, 2018
#Email: liujh26@mail2.sysu.edu.cn
#Usage: This program is used to merge multiple BAM filtes to one, then sort and index it
#Input: [.bam]
import sys,os
import argparse
import pysam
import time
from time import gmtime, strftime
if __name__ == "__main__":
... | 40.901235 | 162 | 0.711138 | #!bin/usr/env python
#Jianheng Liu @ Zhanglab, SYSU
#Feb, 2018
#Email: liujh26@mail2.sysu.edu.cn
#Usage: This program is used to merge multiple BAM filtes to one, then sort and index it
#Input: [.bam]
import sys,os
import argparse
import pysam
import time
from time import gmtime, strftime
def merge_bam(fin,fout):
w... | 782 | 0 | 46 |