hexsha
stringlengths
40
40
size
int64
2
1.02M
ext
stringclasses
10 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
4
245
max_stars_repo_name
stringlengths
6
130
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
10
max_stars_count
int64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
4
245
max_issues_repo_name
stringlengths
6
130
max_issues_repo_head_hexsha
stringlengths
40
40
max_issues_repo_licenses
listlengths
1
10
max_issues_count
int64
1
67k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
4
245
max_forks_repo_name
stringlengths
6
130
max_forks_repo_head_hexsha
stringlengths
40
40
max_forks_repo_licenses
listlengths
1
10
max_forks_count
int64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
2
1.02M
avg_line_length
float64
1
958k
max_line_length
int64
1
987k
alphanum_fraction
float64
0
1
content_no_comment
stringlengths
0
1.01M
is_comment_constant_removed
bool
2 classes
is_sharp_comment_removed
bool
1 class
f7390fff6ac1b29779d480d4cd31cc41351d32f0
4,304
py
Python
webcam_animal_classifier.py
MaximeSorgenfrei/cat_dog_cnn
bc1301fb683de2111db2c25b9da22608ede8e070
[ "MIT" ]
null
null
null
webcam_animal_classifier.py
MaximeSorgenfrei/cat_dog_cnn
bc1301fb683de2111db2c25b9da22608ede8e070
[ "MIT" ]
null
null
null
webcam_animal_classifier.py
MaximeSorgenfrei/cat_dog_cnn
bc1301fb683de2111db2c25b9da22608ede8e070
[ "MIT" ]
null
null
null
import cv2 import keras from keras.models import Sequential, Model from keras.callbacks import EarlyStopping from keras.optimizers import Adam import json import matplotlib.pyplot as plt import numpy as np import os import pandas as pd from random import shuffle # import tensorflow as tf import time file_list = os.lis...
39.486239
282
0.655901
import cv2 import keras from keras.models import Sequential, Model from keras.callbacks import EarlyStopping from keras.optimizers import Adam import json import matplotlib.pyplot as plt import numpy as np import os import pandas as pd from random import shuffle import time file_list = os.listdir("./") keras_model_fi...
true
true
f73910657fede1ff95dd3e376594d155dc4a8249
1,324
py
Python
computer_vision/learning-opencv-practical/image-process-100ask/Question_41_50/answers/answer_48.py
magic428/subjects_notes
6930adbb3f445c11ca9d024abb12a53d6aca19e7
[ "MIT" ]
2
2020-03-18T17:13:00.000Z
2020-03-25T02:34:03.000Z
computer_vision/learning-opencv-practical/image-process-100ask/Question_41_50/answers/answer_48.py
magic428/subjects_notes
6930adbb3f445c11ca9d024abb12a53d6aca19e7
[ "MIT" ]
null
null
null
computer_vision/learning-opencv-practical/image-process-100ask/Question_41_50/answers/answer_48.py
magic428/subjects_notes
6930adbb3f445c11ca9d024abb12a53d6aca19e7
[ "MIT" ]
null
null
null
import cv2 import numpy as np import matplotlib.pyplot as plt # Read image img = cv2.imread("imori.jpg").astype(np.float32) H, W, C = img.shape # Otsu binary ## Grayscale out = 0.2126 * img[..., 2] + 0.7152 * img[..., 1] + 0.0722 * img[..., 0] out = out.astype(np.uint8) ## Determine threshold of Otsu's ...
22.827586
73
0.52568
import cv2 import numpy as np import matplotlib.pyplot as plt img = cv2.imread("imori.jpg").astype(np.float32) H, W, C = img.shape 6 * img[..., 2] + 0.7152 * img[..., 1] + 0.0722 * img[..., 0] out = out.astype(np.uint8) 1, 255): v0 = out[np.where(out < _t)] m0 = np.mean(v0) if len(v0) > 0 else ...
true
true
f73910f59d21f2145a1c358627a1f69dca0b5486
86,942
py
Python
google/ads/google_ads/v4/proto/resources/campaign_pb2.py
arammaliachi/google-ads-python
a4fe89567bd43eb784410523a6306b5d1dd9ee67
[ "Apache-2.0" ]
1
2021-04-09T04:28:47.000Z
2021-04-09T04:28:47.000Z
google/ads/google_ads/v4/proto/resources/campaign_pb2.py
arammaliachi/google-ads-python
a4fe89567bd43eb784410523a6306b5d1dd9ee67
[ "Apache-2.0" ]
null
null
null
google/ads/google_ads/v4/proto/resources/campaign_pb2.py
arammaliachi/google-ads-python
a4fe89567bd43eb784410523a6306b5d1dd9ee67
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/ads/googleads_v4/proto/resources/campaign.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import mes...
62.503235
10,767
0.790826
import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database _sym_db ...
true
true
f73910ff97bc6e0563c1408384190999e737fcfd
12,628
py
Python
build.py
charlie45000/corunners-example
0de8463074fa9a02d0a361fc3dd50bf620991ea2
[ "Apache-2.0" ]
null
null
null
build.py
charlie45000/corunners-example
0de8463074fa9a02d0a361fc3dd50bf620991ea2
[ "Apache-2.0" ]
1
2021-06-02T09:10:15.000Z
2021-06-02T09:10:15.000Z
build.py
charlie45000/corunners-example
0de8463074fa9a02d0a361fc3dd50bf620991ea2
[ "Apache-2.0" ]
1
2021-03-08T13:18:03.000Z
2021-03-08T13:18:03.000Z
#! /usr/bin/env python3 import argparse from pathlib import Path import subprocess import sys import scripts.templates from scripts.templates import P2020, MPC5777M, CORES, TOP_DIR, PSY_DIR, STUBS_DIR, SRC_DIR, CFG_DIR, Help, AGENT_CONFIG_HJSON_TEMPLATE, CORUNNER_CONFIG_HJSON_TEMPLATE, CORUNNER_KMEMORY_JSON_TEMPLATE, ...
42.375839
282
0.617041
import argparse from pathlib import Path import subprocess import sys import scripts.templates from scripts.templates import P2020, MPC5777M, CORES, TOP_DIR, PSY_DIR, STUBS_DIR, SRC_DIR, CFG_DIR, Help, AGENT_CONFIG_HJSON_TEMPLATE, CORUNNER_CONFIG_HJSON_TEMPLATE, CORUNNER_KMEMORY_JSON_TEMPLATE, COMPILE_CONFIG_HJSON_TE...
true
true
f7391168b99f6f2fdae5a55cffae7b304ded5b5e
1,429
py
Python
ctsutils/test.py
534ttl3/ctsutils
b070bf349d4a112df576404a3948e0de60f24927
[ "MIT" ]
null
null
null
ctsutils/test.py
534ttl3/ctsutils
b070bf349d4a112df576404a3948e0de60f24927
[ "MIT" ]
null
null
null
ctsutils/test.py
534ttl3/ctsutils
b070bf349d4a112df576404a3948e0de60f24927
[ "MIT" ]
null
null
null
import numpy as np import matplotlib.pyplot as plt from ctsutils.cparameterspace import CParam, CParameterSpace def foo(X, Y, Y2): """ """ return (1 - X / 2 + X ** 5 + (Y + Y2 ) ** 3) * np.exp(-X ** 2 - (Y + Y2 ) ** 2) # calcul du tableau des valeurs de Z def foo(X, Y, Y2, Y3): """ """ return (1 -...
32.477273
129
0.582225
import numpy as np import matplotlib.pyplot as plt from ctsutils.cparameterspace import CParam, CParameterSpace def foo(X, Y, Y2): return (1 - X / 2 + X ** 5 + (Y + Y2 ) ** 3) * np.exp(-X ** 2 - (Y + Y2 ) ** 2) def foo(X, Y, Y2, Y3): return (1 - X / 2 + X ** 5 + (Y + Y2 + Y3) ** 3) * np.exp(-X ** 2 - (Y ...
true
true
f73911a7c4582d4ab6d999c25103c7c89a6d2334
243
py
Python
globalvalues/constants/settingsconstants.py
adriangrepo/qreservoir
20fba1b1fd1a42add223d9e8af2d267665bec493
[ "MIT" ]
2
2019-10-04T13:54:51.000Z
2021-05-21T19:36:15.000Z
globalvalues/constants/settingsconstants.py
adriangrepo/qreservoir
20fba1b1fd1a42add223d9e8af2d267665bec493
[ "MIT" ]
3
2019-11-19T17:06:09.000Z
2020-01-18T20:39:54.000Z
globalvalues/constants/settingsconstants.py
adriangrepo/qreservoir
20fba1b1fd1a42add223d9e8af2d267665bec493
[ "MIT" ]
2
2020-07-02T13:20:48.000Z
2020-11-11T00:18:51.000Z
''' Created on 28 Jun 2015 @author: a ''' class SettingsConstants(object): ''' Constants related to settings dialogs ''' SETTINGS_ITEM_HISTORY_HEADERS = ["Item", "Date", "Action", "Details", "User", "Version", "Build date"]
18.692308
106
0.641975
class SettingsConstants(object): SETTINGS_ITEM_HISTORY_HEADERS = ["Item", "Date", "Action", "Details", "User", "Version", "Build date"]
true
true
f739124272f8e07b5c689d7233788a54b79eb0c8
6,410
py
Python
quictrace-adapter.py
Banaschar/quicly-dgram
95bf10dc9d1020b5bcce8da8071ab7360766ae74
[ "MIT" ]
2
2019-08-19T12:50:07.000Z
2019-12-12T07:25:06.000Z
quictrace-adapter.py
Banaschar/quicly-dgram
95bf10dc9d1020b5bcce8da8071ab7360766ae74
[ "MIT" ]
null
null
null
quictrace-adapter.py
Banaschar/quicly-dgram
95bf10dc9d1020b5bcce8da8071ab7360766ae74
[ "MIT" ]
null
null
null
import sys import json import base64 from pprint import pprint epoch = ["ENCRYPTION_INITIAL", "ENCRYPTION_0RTT", "ENCRYPTION_UNKNOWN", "ENCRYPTION_1RTT"] def transform(inf, outf): start = -1 cid = -1 qtr = {} qtr["protocolVersion"] = "AAAA" qtr["events"] = [] packet = {} sframes = [] r...
34.462366
97
0.50078
import sys import json import base64 from pprint import pprint epoch = ["ENCRYPTION_INITIAL", "ENCRYPTION_0RTT", "ENCRYPTION_UNKNOWN", "ENCRYPTION_1RTT"] def transform(inf, outf): start = -1 cid = -1 qtr = {} qtr["protocolVersion"] = "AAAA" qtr["events"] = [] packet = {} sframes = [] r...
false
true
f739129a416d3f39cfab817aa6633728cddb057c
6,298
py
Python
tests/examples/test_examples.py
brucebcampbell/mlflow
9aca8e27198f16ce4fa1e7a0a502554f2f81068b
[ "Apache-2.0" ]
null
null
null
tests/examples/test_examples.py
brucebcampbell/mlflow
9aca8e27198f16ce4fa1e7a0a502554f2f81068b
[ "Apache-2.0" ]
null
null
null
tests/examples/test_examples.py
brucebcampbell/mlflow
9aca8e27198f16ce4fa1e7a0a502554f2f81068b
[ "Apache-2.0" ]
null
null
null
import os import os.path import re import shutil import mlflow from mlflow import cli from mlflow.utils import process from tests.integration.utils import invoke_cli_runner import pytest import json import hashlib EXAMPLES_DIR = "examples" def hash_conda_env(conda_env_path): # use the same hashing logic as `_ge...
33.322751
96
0.566529
import os import os.path import re import shutil import mlflow from mlflow import cli from mlflow.utils import process from tests.integration.utils import invoke_cli_runner import pytest import json import hashlib EXAMPLES_DIR = "examples" def hash_conda_env(conda_env_path): return hashlib.sha1(open(conda_...
true
true
f739129edf4dad67c2248bd06ec3d471d9ba24b7
1,126
py
Python
almost-triangles/almost-triangles.py
cdstanford/curiosities
511e55b9dbf2b49db4593be92a0e4fce07888eaf
[ "MIT" ]
1
2022-01-18T06:02:01.000Z
2022-01-18T06:02:01.000Z
almost-triangles/almost-triangles.py
cdstanford/curiosities
511e55b9dbf2b49db4593be92a0e4fce07888eaf
[ "MIT" ]
null
null
null
almost-triangles/almost-triangles.py
cdstanford/curiosities
511e55b9dbf2b49db4593be92a0e4fce07888eaf
[ "MIT" ]
null
null
null
""" A triangle is an "almost right triangle" if one of its angles differs from 90 degrees by at most 15 degrees. A triangle is an "almost isosceles triangle" if two of its angles differ from each other by at most 15 degrees. Prove that all acute triangles are either almost right or almost isosceles. Note: if "at most ...
28.15
79
0.626998
import z3 def triangle(x, y, z): return z3.And(x > 0, y > 0, z > 0, x + y + z == 180) def acute(x, y, z): return z3.And(x < 90, y < 90, z < 90) def abs(x): return z3.If(x > 0, x, -x) def almost_right(x, y, z): return z3.Or(abs(x - 90) <= 15, abs(y - 90) <= 15, abs(z - 90) <= 15) def almost_isoscel...
true
true
f739132662219264ff68cf9039a96b10b8ef6495
4,179
py
Python
lib/streamlit/util.py
sdrees/streamlit
d02c3fca9114c6b550785cca2fbe05ec37295f2b
[ "Apache-2.0" ]
1
2019-11-01T08:37:00.000Z
2019-11-01T08:37:00.000Z
lib/streamlit/util.py
sdrees/streamlit
d02c3fca9114c6b550785cca2fbe05ec37295f2b
[ "Apache-2.0" ]
null
null
null
lib/streamlit/util.py
sdrees/streamlit
d02c3fca9114c6b550785cca2fbe05ec37295f2b
[ "Apache-2.0" ]
null
null
null
# Copyright 2018-2022 Streamlit Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
29.223776
79
0.682699
import functools import os import subprocess from typing import Any, Dict, List, TypeVar from typing_extensions import Final from streamlit import env_util HELP_DOC: Final = "https://docs.streamlit.io/" def memoize(func): result = [] # type: List[Any] @functools.wraps(func) def wrappe...
true
true
f7391359e8c5b762abefb4eac0e7c17892575845
250
py
Python
src/atcoder/abc212/b/sol_0.py
kagemeka/competitive-programming
c70fe481bcd518f507b885fc9234691d8ce63171
[ "MIT" ]
1
2021-07-11T03:20:10.000Z
2021-07-11T03:20:10.000Z
src/atcoder/abc212/b/sol_0.py
kagemeka/competitive-programming
c70fe481bcd518f507b885fc9234691d8ce63171
[ "MIT" ]
39
2021-07-10T05:21:09.000Z
2021-12-15T06:10:12.000Z
src/atcoder/abc212/b/sol_0.py
kagemeka/competitive-programming
c70fe481bcd518f507b885fc9234691d8ce63171
[ "MIT" ]
null
null
null
def main(): s = input() if len(set(s)) == 1: print('Weak') return *s, = map(int, list(s)) for i in range(3): if ( s[i + 1] != (s[i] + 1) % 10 ): print('Strong') return print('Weak') main()
12.5
25
0.408
def main(): s = input() if len(set(s)) == 1: print('Weak') return *s, = map(int, list(s)) for i in range(3): if ( s[i + 1] != (s[i] + 1) % 10 ): print('Strong') return print('Weak') main()
true
true
f739141f4c6340df9fbeaf3fec23647c718a28bb
563
py
Python
utils/data/__init__.py
sawyermade/ggcnn
f971117871b228879370b162cafd63b51414036e
[ "BSD-3-Clause" ]
null
null
null
utils/data/__init__.py
sawyermade/ggcnn
f971117871b228879370b162cafd63b51414036e
[ "BSD-3-Clause" ]
null
null
null
utils/data/__init__.py
sawyermade/ggcnn
f971117871b228879370b162cafd63b51414036e
[ "BSD-3-Clause" ]
null
null
null
def get_dataset(dataset_name): if dataset_name == 'cornell': from .cornell_data import CornellDataset return CornellDataset elif dataset_name == 'jacquard': from .jacquard_data import JacquardDataset return JacquardDataset elif dataset_name == 'rs_dir': from .rs_dir_data...
37.533333
92
0.694494
def get_dataset(dataset_name): if dataset_name == 'cornell': from .cornell_data import CornellDataset return CornellDataset elif dataset_name == 'jacquard': from .jacquard_data import JacquardDataset return JacquardDataset elif dataset_name == 'rs_dir': from .rs_dir_data...
true
true
f739146565d3803ce923f5290706b9597b3a5889
454
py
Python
Events/new_londo_ruins_constants.py
grimrhapsody/StJudeSouls
c6123ceff260faa76997c1eba3c5832d75d52ece
[ "MIT" ]
null
null
null
Events/new_londo_ruins_constants.py
grimrhapsody/StJudeSouls
c6123ceff260faa76997c1eba3c5832d75d52ece
[ "MIT" ]
null
null
null
Events/new_londo_ruins_constants.py
grimrhapsody/StJudeSouls
c6123ceff260faa76997c1eba3c5832d75d52ece
[ "MIT" ]
null
null
null
import soulstruct.emevd.ds_types as dt class CHR(dt.Character): Rickert = 6220 Sif = 1600452 MaleGhost1 = 1600200 MaleGhost2 = 1600201 MaleGhost3 = 1600301 MaleGhost4 = 1600302 FemaleGhost = 1600300 class SPEFFECT(dt.IntEnum): RingOfTheAlpha = 4704 SifReward = 4807 class FLAG(d...
16.814815
38
0.687225
import soulstruct.emevd.ds_types as dt class CHR(dt.Character): Rickert = 6220 Sif = 1600452 MaleGhost1 = 1600200 MaleGhost2 = 1600201 MaleGhost3 = 1600301 MaleGhost4 = 1600302 FemaleGhost = 1600300 class SPEFFECT(dt.IntEnum): RingOfTheAlpha = 4704 SifReward = 4807 class FLAG(d...
true
true
f73914a25bd3eb5b72b72dcc0a29204dc5d39629
8,341
py
Python
preprocessing/embedding/export_FaceEmbedding.py
sereini/SpeechSeparationModel
ea44c845762112f3bc2e5e54c5530e6fd429464f
[ "MIT" ]
3
2019-12-05T10:22:19.000Z
2021-11-08T12:19:54.000Z
preprocessing/embedding/export_FaceEmbedding.py
sereini/SpeechSeparationModel
ea44c845762112f3bc2e5e54c5530e6fd429464f
[ "MIT" ]
null
null
null
preprocessing/embedding/export_FaceEmbedding.py
sereini/SpeechSeparationModel
ea44c845762112f3bc2e5e54c5530e6fd429464f
[ "MIT" ]
null
null
null
""" Exports the embeddings of a directory of images as numpy arrays. Following structure: D:\images: folder1: img_0 ... img_74 folder2: img_0 ... img_74 Output: embeddings.npy -- Embeddings as np array (with names "...
38.261468
165
0.659993
from __future__ import absolute_import from __future__ import division from __future__ import print_function import time from scipy import misc import tensorflow as tf import numpy as np import sys import os import argparse import facenet import align.detect_face import re import glob from six....
true
true
f73914f8a3e9029b9389a386fb27f36f28fe159c
13,810
py
Python
accelbyte_py_sdk/api/basic/models/user_profile_private_info.py
encyphered/accelbyte-python-sdk
09c1e989d7251de308150fdcd3119d662ca2d205
[ "MIT" ]
null
null
null
accelbyte_py_sdk/api/basic/models/user_profile_private_info.py
encyphered/accelbyte-python-sdk
09c1e989d7251de308150fdcd3119d662ca2d205
[ "MIT" ]
null
null
null
accelbyte_py_sdk/api/basic/models/user_profile_private_info.py
encyphered/accelbyte-python-sdk
09c1e989d7251de308150fdcd3119d662ca2d205
[ "MIT" ]
null
null
null
# Auto-generated at 2021-09-27T17:12:38.713844+08:00 # from: Justice Basic Service (1.17.0) # Copyright (c) 2018 - 2021 AccelByte Inc. All Rights Reserved. # This is licensed software from AccelByte Inc, for limitations # and restrictions contact your company contract manager. # pylint: disable=duplicate-code # pylin...
40.857988
117
0.586025
from __future__ import annotations from typing import Any, Dict, List, Optional, Tuple, Union from ....core import Model class UserProfilePrivateInfo(Model): user_id: str namespace: str ...
true
true
f73915580f7c70c64ce8bc26e73d18ef72f88e86
8,388
py
Python
references/detection/utils.py
yoshitomo-matsubara/vision
03d11338f3faf94a0749549912593ddb8b70be17
[ "BSD-3-Clause" ]
12,063
2017-01-18T19:58:38.000Z
2022-03-31T23:08:44.000Z
references/detection/utils.py
yoshitomo-matsubara/vision
03d11338f3faf94a0749549912593ddb8b70be17
[ "BSD-3-Clause" ]
4,673
2017-01-18T21:30:03.000Z
2022-03-31T20:58:33.000Z
references/detection/utils.py
yoshitomo-matsubara/vision
03d11338f3faf94a0749549912593ddb8b70be17
[ "BSD-3-Clause" ]
7,132
2017-01-18T18:12:23.000Z
2022-03-31T21:19:10.000Z
import datetime import errno import os import time from collections import defaultdict, deque import torch import torch.distributed as dist class SmoothedValue: """Track a series of values and provide access to smoothed values over a window or the global series average. """ def __init__(self, window...
29.639576
120
0.565093
import datetime import errno import os import time from collections import defaultdict, deque import torch import torch.distributed as dist class SmoothedValue: def __init__(self, window_size=20, fmt=None): if fmt is None: fmt = "{median:.4f} ({global_avg:.4f})" self.deque = deque(ma...
true
true
f739157f445cc0121bf3aa2d01b420486e3e2b18
1,144
py
Python
airflow/operators/jdbc_operator.py
khilawar4/airflow
5f3f65b82517f615f31f0c8a7f8ac0facb325235
[ "Apache-2.0", "BSD-2-Clause", "MIT", "ECL-2.0", "BSD-3-Clause" ]
3
2021-01-29T20:33:56.000Z
2021-08-06T17:35:16.000Z
airflow/operators/jdbc_operator.py
khilawar4/airflow
5f3f65b82517f615f31f0c8a7f8ac0facb325235
[ "Apache-2.0", "BSD-2-Clause", "MIT", "ECL-2.0", "BSD-3-Clause" ]
210
2021-07-17T00:25:52.000Z
2021-12-29T00:44:48.000Z
airflow/operators/jdbc_operator.py
khilawar4/airflow
5f3f65b82517f615f31f0c8a7f8ac0facb325235
[ "Apache-2.0", "BSD-2-Clause", "MIT", "ECL-2.0", "BSD-3-Clause" ]
2
2021-05-05T07:36:36.000Z
2021-11-10T17:32:39.000Z
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
38.133333
89
0.766608
import warnings from airflow.providers.jdbc.operators.jdbc import JdbcOperator warnings.warn( "This module is deprecated. Please use `airflow.providers.jdbc.operators.jdbc`.", DeprecationWarning, stacklevel=2, )
true
true
f73915cd2a13a0f75508d4f48f01ea62bb60222f
3,177
py
Python
py_segment/graph.py
RookieHong/python-objectness
02af4d090502e1a7269b23673709cfea75da09c9
[ "Apache-2.0" ]
20
2020-09-27T08:41:38.000Z
2022-03-09T10:31:27.000Z
py_segment/graph.py
RookieHong/python-objectness
02af4d090502e1a7269b23673709cfea75da09c9
[ "Apache-2.0" ]
2
2021-12-02T07:48:41.000Z
2021-12-21T07:14:25.000Z
py_segment/graph.py
RookieHong/python-objectness
02af4d090502e1a7269b23673709cfea75da09c9
[ "Apache-2.0" ]
4
2020-11-19T13:38:52.000Z
2022-03-09T14:40:28.000Z
class Node: def __init__(self, parent, rank=0, size=1): self.parent = parent self.rank = rank self.size = size def __repr__(self): return '(parent=%s, rank=%s, size=%s)' % (self.parent, self.rank, self.size) class Forest: def __init__(self, num_nodes): self.nodes = ...
31.455446
89
0.579792
class Node: def __init__(self, parent, rank=0, size=1): self.parent = parent self.rank = rank self.size = size def __repr__(self): return '(parent=%s, rank=%s, size=%s)' % (self.parent, self.rank, self.size) class Forest: def __init__(self, num_nodes): self.nodes = ...
true
true
f7391612a071aa6a5a6f60058d789289104967d2
7,118
py
Python
jnpy/app/pytdx_loader/engine.py
jojoquant/jonpy
58692f8fbf398aab7be915a63d0a376e2e0e664c
[ "MIT" ]
5
2020-05-19T07:32:39.000Z
2022-03-14T09:09:48.000Z
jnpy/app/pytdx_loader/engine.py
jojoquant/jonpy
58692f8fbf398aab7be915a63d0a376e2e0e664c
[ "MIT" ]
null
null
null
jnpy/app/pytdx_loader/engine.py
jojoquant/jonpy
58692f8fbf398aab7be915a63d0a376e2e0e664c
[ "MIT" ]
3
2020-04-02T08:30:17.000Z
2020-05-03T12:12:05.000Z
import time from typing import Callable import pandas as pd from datetime import datetime from vnpy.event import EventEngine from vnpy.trader.constant import Exchange, Interval from vnpy.trader.engine import BaseEngine, MainEngine from vnpy.trader.object import BarData from vnpy.trader.utility import get_folder_path ...
31.495575
118
0.52599
import time from typing import Callable import pandas as pd from datetime import datetime from vnpy.event import EventEngine from vnpy.trader.constant import Exchange, Interval from vnpy.trader.engine import BaseEngine, MainEngine from vnpy.trader.object import BarData from vnpy.trader.utility import get_folder_path ...
true
true
f7391676fb3e3868ff818f4de0d1cfe9e941e235
9,825
py
Python
doc/conf.py
mikehulluk/morphforge
2a95096f144ed4ea487decb735ce66706357d3c7
[ "BSD-2-Clause" ]
1
2021-01-21T11:31:59.000Z
2021-01-21T11:31:59.000Z
doc/conf.py
mikehulluk/morphforge
2a95096f144ed4ea487decb735ce66706357d3c7
[ "BSD-2-Clause" ]
null
null
null
doc/conf.py
mikehulluk/morphforge
2a95096f144ed4ea487decb735ce66706357d3c7
[ "BSD-2-Clause" ]
null
null
null
#!/usr/bin/python # -*- coding: utf-8 -*- # # morphforge documentation build configuration file, created by # sphinx-quickstart on Fri Mar 23 14:01:08 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autoge...
28.071429
94
0.688142
import sys import os import sys class MockType(type): def __init__(cls, name, bases, dct ): super(MockType, cls).__init__(name, bases, dct) pass def __getattr__(cls, name): return Mock() def __str__(cls): return 'custom str for %s' % (cls.__nam...
true
true
f7391a9e8bd8edacfc0f6dc31cc4bccca5550f93
64,492
py
Python
Tests/test_AlignIO.py
lukasz-kozlowski/biopython
6b601cf09234e1e82cfc94ad5030389036cb6343
[ "BSD-3-Clause" ]
2,856
2015-01-01T07:10:06.000Z
2022-03-31T18:17:25.000Z
Tests/test_AlignIO.py
lukasz-kozlowski/biopython
6b601cf09234e1e82cfc94ad5030389036cb6343
[ "BSD-3-Clause" ]
3,429
2015-01-05T11:11:42.000Z
2022-03-31T13:08:10.000Z
Tests/test_AlignIO.py
lukasz-kozlowski/biopython
6b601cf09234e1e82cfc94ad5030389036cb6343
[ "BSD-3-Clause" ]
1,619
2015-01-05T13:07:11.000Z
2022-03-31T19:19:52.000Z
# Copyright 2008 by Peter Cock. All rights reserved. # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """Tests for AlignIO module.""" import unittest import warnings from io import StringIO from Bio...
42.851827
726
0.568365
import unittest import warnings from io import StringIO from Bio import AlignIO from Bio import SeqIO from Bio.Align import AlignInfo from Bio.Align import MultipleSeqAlignment from Bio.Data import IUPACData from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord test_write_read_alignment_formats = sorted(Al...
true
true
f7391aa48d04f95e597f8c36d074d4de584c5fc0
772
py
Python
docs/components_page/components/offcanvas/scrollable.py
glsdown/dash-bootstrap-components
0ebea4f7de43975f6e3a2958359c4480ae1d4927
[ "Apache-2.0" ]
776
2019-02-07T19:36:59.000Z
2022-03-31T05:53:04.000Z
docs/components_page/components/offcanvas/scrollable.py
glsdown/dash-bootstrap-components
0ebea4f7de43975f6e3a2958359c4480ae1d4927
[ "Apache-2.0" ]
350
2019-02-05T10:42:19.000Z
2022-03-31T19:23:35.000Z
docs/components_page/components/offcanvas/scrollable.py
glsdown/dash-bootstrap-components
0ebea4f7de43975f6e3a2958359c4480ae1d4927
[ "Apache-2.0" ]
219
2019-02-10T13:46:25.000Z
2022-03-23T17:03:39.000Z
import dash_bootstrap_components as dbc from dash import Input, Output, State, html offcanvas = html.Div( [ dbc.Button( "Open scrollable offcanvas", id="open-offcanvas-scrollable", n_clicks=0, ), dbc.Offcanvas( html.P("The contents on the main...
24.903226
72
0.598446
import dash_bootstrap_components as dbc from dash import Input, Output, State, html offcanvas = html.Div( [ dbc.Button( "Open scrollable offcanvas", id="open-offcanvas-scrollable", n_clicks=0, ), dbc.Offcanvas( html.P("The contents on the main...
true
true
f7391cca6cb3a36ece6f3df9d1fcf6a3b6a48c8d
3,680
py
Python
configs/hand/mobilenet_v2/panoptic/mobilenetv2_panoptic_256x256.py
jcwon0/BlurHPE
c97a57e92a8a7f171b0403aee640222a32513562
[ "Apache-2.0" ]
null
null
null
configs/hand/mobilenet_v2/panoptic/mobilenetv2_panoptic_256x256.py
jcwon0/BlurHPE
c97a57e92a8a7f171b0403aee640222a32513562
[ "Apache-2.0" ]
null
null
null
configs/hand/mobilenet_v2/panoptic/mobilenetv2_panoptic_256x256.py
jcwon0/BlurHPE
c97a57e92a8a7f171b0403aee640222a32513562
[ "Apache-2.0" ]
null
null
null
log_level = 'INFO' load_from = None resume_from = None dist_params = dict(backend='nccl') workflow = [('train', 1)] checkpoint_config = dict(interval=10) evaluation = dict( interval=10, metric=['PCKh', 'AUC', 'EPE'], key_indicator='AUC') optimizer = dict( type='Adam', lr=5e-4, ) optimizer_conf...
28.527132
80
0.592663
log_level = 'INFO' load_from = None resume_from = None dist_params = dict(backend='nccl') workflow = [('train', 1)] checkpoint_config = dict(interval=10) evaluation = dict( interval=10, metric=['PCKh', 'AUC', 'EPE'], key_indicator='AUC') optimizer = dict( type='Adam', lr=5e-4, ) optimizer_conf...
true
true
f7391cefb7b702f5fa6b44b8e6120da40c907586
1,605
py
Python
problems/SR/auto/problem33_SR.py
sunandita/ICAPS_Summer_School_RAE_2020
a496b62185bcfdd2c76eb7986ae99cfa85708d28
[ "BSD-3-Clause" ]
5
2020-10-15T14:40:03.000Z
2021-08-20T17:45:41.000Z
problems/SR/auto/problem33_SR.py
sunandita/ICAPS_Summer_School_RAE_2020
a496b62185bcfdd2c76eb7986ae99cfa85708d28
[ "BSD-3-Clause" ]
null
null
null
problems/SR/auto/problem33_SR.py
sunandita/ICAPS_Summer_School_RAE_2020
a496b62185bcfdd2c76eb7986ae99cfa85708d28
[ "BSD-3-Clause" ]
2
2020-10-15T07:06:14.000Z
2020-10-15T17:33:01.000Z
__author__ = 'patras' from domain_searchAndRescue import * from timer import DURATION from state import state def GetCostOfMove(r, l1, l2, dist): return dist DURATION.TIME = { 'giveSupportToPerson': 15, 'clearLocation': 5, 'inspectPerson': 20, 'moveEuclidean': GetCostOfMove, 'moveCurved': GetC...
26.311475
91
0.581931
__author__ = 'patras' from domain_searchAndRescue import * from timer import DURATION from state import state def GetCostOfMove(r, l1, l2, dist): return dist DURATION.TIME = { 'giveSupportToPerson': 15, 'clearLocation': 5, 'inspectPerson': 20, 'moveEuclidean': GetCostOfMove, 'moveCurved': GetC...
true
true
f7391df7fd733130732603a98e663592583d4e77
11,800
py
Python
src/tab1_mapview.py
UBC-MDS/world-energy-visualization
6f8dd756a8c158a332fd94ca1f025fc16bcd77b3
[ "MIT" ]
null
null
null
src/tab1_mapview.py
UBC-MDS/world-energy-visualization
6f8dd756a8c158a332fd94ca1f025fc16bcd77b3
[ "MIT" ]
23
2022-02-17T00:15:38.000Z
2022-03-19T00:07:30.000Z
src/tab1_mapview.py
UBC-MDS/world-energy-visualization
6f8dd756a8c158a332fd94ca1f025fc16bcd77b3
[ "MIT" ]
2
2022-02-19T16:05:05.000Z
2022-03-04T19:23:59.000Z
from dash import Input, Output, callback, html, dcc, State import dash_bootstrap_components as dbc import pandas as pd import numpy as np import plotly.express as px import plotly.io as pio import plotly.graph_objects as go from urllib.request import urlopen import json df_all = pd.read_csv( "data/Primary-energy...
33.714286
204
0.353729
from dash import Input, Output, callback, html, dcc, State import dash_bootstrap_components as dbc import pandas as pd import numpy as np import plotly.express as px import plotly.io as pio import plotly.graph_objects as go from urllib.request import urlopen import json df_all = pd.read_csv( "data/Primary-energy...
true
true
f7391fd60d69ae1c71f705e5f9ea518c9aef6689
359
py
Python
pagecap/pagecap_metadata.py
stratofax/pagecap
c166af6ffd7eedc8a63b630ef0387fed367639b7
[ "MIT" ]
1
2019-08-30T19:52:28.000Z
2019-08-30T19:52:28.000Z
pagecap/pagecap_metadata.py
stratofax/pagecap
c166af6ffd7eedc8a63b630ef0387fed367639b7
[ "MIT" ]
1
2021-06-02T00:29:04.000Z
2021-06-02T00:29:04.000Z
pagecap/pagecap_metadata.py
stratofax/pagecap
c166af6ffd7eedc8a63b630ef0387fed367639b7
[ "MIT" ]
null
null
null
"""Define meta information about the pagecap package.""" __title__ = 'pagecap' __version__ = '0.0.7' __description__ = ('Capture specified URLs as PNG image files') __url__ = 'https://github.com/stratofax/pagecap' __author__ = 'Neil Johnson' __author_email__ = 'neil@cadent.com' __license__ = 'MIT' __copyright__ = 'Cop...
32.636364
63
0.75766
__title__ = 'pagecap' __version__ = '0.0.7' __description__ = ('Capture specified URLs as PNG image files') __url__ = 'https://github.com/stratofax/pagecap' __author__ = 'Neil Johnson' __author_email__ = 'neil@cadent.com' __license__ = 'MIT' __copyright__ = 'Copyright 2019 Cadent Technologies Corp.'
true
true
f7391ffbd1d5b696e690f09804f5a49c77b6067d
2,111
py
Python
scripts/load_files.py
Clinical-Genomics/loqusdb
0b72a436e68e23ecc6c4610ed7e58727fdabcaa2
[ "MIT" ]
1
2021-12-10T12:01:48.000Z
2021-12-10T12:01:48.000Z
scripts/load_files.py
Clinical-Genomics/loqusdb
0b72a436e68e23ecc6c4610ed7e58727fdabcaa2
[ "MIT" ]
10
2019-03-27T08:50:38.000Z
2022-01-14T15:26:38.000Z
scripts/load_files.py
Clinical-Genomics/loqusdb
0b72a436e68e23ecc6c4610ed7e58727fdabcaa2
[ "MIT" ]
null
null
null
import logging import subprocess from copy import deepcopy from datetime import datetime from pathlib import Path import click import coloredlogs LOG_LEVELS = ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"] LOG = logging.getLogger(__name__) @click.command() @click.option("-d", "--directory", default=".", help="S...
28.527027
95
0.626243
import logging import subprocess from copy import deepcopy from datetime import datetime from pathlib import Path import click import coloredlogs LOG_LEVELS = ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"] LOG = logging.getLogger(__name__) @click.command() @click.option("-d", "--directory", default=".", help="S...
true
true
f739202552f3f6ec7fde72afb956cd4a0b33dcc9
4,269
py
Python
src/python/board.py
Belvenix/IdleonCogOptimizer
6b80b9f11bf0478e2e3522cb07b93b2c8834840b
[ "MIT" ]
null
null
null
src/python/board.py
Belvenix/IdleonCogOptimizer
6b80b9f11bf0478e2e3522cb07b93b2c8834840b
[ "MIT" ]
null
null
null
src/python/board.py
Belvenix/IdleonCogOptimizer
6b80b9f11bf0478e2e3522cb07b93b2c8834840b
[ "MIT" ]
null
null
null
from typing import Tuple from .cogs import Cog, EmptyCog, Player from .special_cogs import BoostedCog import numpy as np class Board: def __init__(self, height: int = 8, width: int = 12, locked: bool = True) -> None: self._visualization_board = '' self.board = np.array([[EmptyCog() for w in range(w...
36.487179
112
0.532443
from typing import Tuple from .cogs import Cog, EmptyCog, Player from .special_cogs import BoostedCog import numpy as np class Board: def __init__(self, height: int = 8, width: int = 12, locked: bool = True) -> None: self._visualization_board = '' self.board = np.array([[EmptyCog() for w in range(w...
true
true
f73921ebeacc15bec2fc4a69c8289e39d224ef67
1,826
py
Python
desktop/core/ext-py/Twisted/twisted/conch/ssh/asn1.py
civascu/hue
82f2de44789ff5a981ed725175bae7944832d1e9
[ "Apache-2.0" ]
19
2015-05-01T19:59:03.000Z
2021-12-09T08:03:16.000Z
desktop/core/ext-py/Twisted/twisted/conch/ssh/asn1.py
civascu/hue
82f2de44789ff5a981ed725175bae7944832d1e9
[ "Apache-2.0" ]
1
2018-01-03T15:26:49.000Z
2018-01-03T15:26:49.000Z
desktop/core/ext-py/Twisted/twisted/conch/ssh/asn1.py
civascu/hue
82f2de44789ff5a981ed725175bae7944832d1e9
[ "Apache-2.0" ]
30
2015-03-25T19:40:07.000Z
2021-05-28T22:59:26.000Z
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. # """ A basic ASN.1 parser to parse private SSH keys. Maintainer: Paul Swartz """ from Crypto.Util import number def parse(data): things = [] while data: t = ord(data[0]) assert (t & 0xc0) == 0, 'not a univer...
27.666667
78
0.526287
""" A basic ASN.1 parser to parse private SSH keys. Maintainer: Paul Swartz """ from Crypto.Util import number def parse(data): things = [] while data: t = ord(data[0]) assert (t & 0xc0) == 0, 'not a universal value: 0x%02x' % t l = ord(data[1]) assert data != 0x...
false
true
f7392250ca1ed7698eb0748b1e158e38433ae987
20,257
py
Python
modules/png-extraction/ImageExtractor.py
anbhimi/Niffler
81bf6c05132a58d05c7934f66edd0969c3bc9bf5
[ "BSD-3-Clause" ]
null
null
null
modules/png-extraction/ImageExtractor.py
anbhimi/Niffler
81bf6c05132a58d05c7934f66edd0969c3bc9bf5
[ "BSD-3-Clause" ]
null
null
null
modules/png-extraction/ImageExtractor.py
anbhimi/Niffler
81bf6c05132a58d05c7934f66edd0969c3bc9bf5
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import glob from shutil import copyfile import hashlib import json import sys import subprocess import logging from multiprocessing import Pool import pdb import time import pickle import argparse import numpy as np import pandas as pd import pydicom as dicom i...
41.853306
120
0.627684
import os import glob from shutil import copyfile import hashlib import json import sys import subprocess import logging from multiprocessing import Pool import pdb import time import pickle import argparse import numpy as np import pandas as pd import pydicom as dicom import png from pydicom import config from py...
true
true
f739228ddf9dd6a0241bb6c9202528831dc9da63
956
py
Python
tests/providers/test_dnspod.py
chibiegg/lexicon
6230ea1e567a730243dc77c08ff6c4c16f136157
[ "MIT" ]
null
null
null
tests/providers/test_dnspod.py
chibiegg/lexicon
6230ea1e567a730243dc77c08ff6c4c16f136157
[ "MIT" ]
null
null
null
tests/providers/test_dnspod.py
chibiegg/lexicon
6230ea1e567a730243dc77c08ff6c4c16f136157
[ "MIT" ]
null
null
null
# Test for one implementation of the interface from lexicon.providers.dnspod import Provider from integration_tests import IntegrationTests from unittest import TestCase import pytest # Hook into testing framework by inheriting unittest.TestCase and reuse # the tests which *each and every* implementation of the interf...
36.769231
91
0.779289
from lexicon.providers.dnspod import Provider from integration_tests import IntegrationTests from unittest import TestCase import pytest class DnsParkProviderTests(TestCase, IntegrationTests): Provider = Provider provider_name = 'dnspod' domain = 'capsulecd.com' def _filter_post_data_parameters(se...
true
true
f739233ca15bc8b6f63a7f1e4224d32e1b615aaa
1,033
py
Python
pyvisdk/do/not_implemented.py
Infinidat/pyvisdk
f2f4e5f50da16f659ccc1d84b6a00f397fa997f8
[ "MIT" ]
null
null
null
pyvisdk/do/not_implemented.py
Infinidat/pyvisdk
f2f4e5f50da16f659ccc1d84b6a00f397fa997f8
[ "MIT" ]
null
null
null
pyvisdk/do/not_implemented.py
Infinidat/pyvisdk
f2f4e5f50da16f659ccc1d84b6a00f397fa997f8
[ "MIT" ]
null
null
null
import logging from pyvisdk.exceptions import InvalidArgumentError ######################################## # Automatically generated, do not edit. ######################################## log = logging.getLogger(__name__) def NotImplemented(vim, *args, **kwargs): '''NotImplemented exception is thrown if the me...
31.30303
124
0.60697
import logging from pyvisdk.exceptions import InvalidArgumentError
true
true
f73923ba454221bcdd22abad216b4193e713db3d
980
py
Python
project_euler/ex9_special_pythagorean_triplet.py
ralphribeiro/uri-projecteuler
7151d86e014aea9c56026cc88f50b4e940117dd8
[ "MIT" ]
null
null
null
project_euler/ex9_special_pythagorean_triplet.py
ralphribeiro/uri-projecteuler
7151d86e014aea9c56026cc88f50b4e940117dd8
[ "MIT" ]
null
null
null
project_euler/ex9_special_pythagorean_triplet.py
ralphribeiro/uri-projecteuler
7151d86e014aea9c56026cc88f50b4e940117dd8
[ "MIT" ]
null
null
null
""" Special Pythagorean triplet. A Pythagorean triplet is a set of three natural numbers, a < b < c, for which, a**2 + b**2 = c**2 For example, 3**2 + 4**2 = 9 + 16 = 25 = 5**2. There exists exactly one Pythagorean triplet for which a + b + c = 1000. Find the product abc. """ from datetime import datetime from fun...
20
78
0.554082
from datetime import datetime from functools import wraps def time_delta(func): wraps(func) def inner(*args): t_init = datetime.now() ret = func(*args) t_final = datetime.now() - t_init print(f'{t_final.seconds}s | {t_final.microseconds}us') return ret return inner...
true
true
f73924b9853806fe6524b033ea494a540d791024
41,124
py
Python
fastapi/routing.py
includeamin/fastapi
988d3c2a820f679bf88e2fc18f4e9614a2633212
[ "MIT" ]
null
null
null
fastapi/routing.py
includeamin/fastapi
988d3c2a820f679bf88e2fc18f4e9614a2633212
[ "MIT" ]
null
null
null
fastapi/routing.py
includeamin/fastapi
988d3c2a820f679bf88e2fc18f4e9614a2633212
[ "MIT" ]
null
null
null
import asyncio import inspect from typing import Any, Callable, Dict, List, Optional, Sequence, Set, Type, Union from fastapi import params from fastapi.dependencies.models import Dependant from fastapi.dependencies.utils import ( get_body_field, get_dependant, get_parameterless_sub_dependant, solve_de...
41.372233
126
0.61514
import asyncio import inspect from typing import Any, Callable, Dict, List, Optional, Sequence, Set, Type, Union from fastapi import params from fastapi.dependencies.models import Dependant from fastapi.dependencies.utils import ( get_body_field, get_dependant, get_parameterless_sub_dependant, solve_de...
true
true
f73926ad9ba0b52260a063e8f927b609fdf172e2
8,031
py
Python
lib/relation_engine_bulk_update/workspace_object_collections.py
kbaseapps/relation_engine_bulk_update
04638d3d9e87eb9dc5afe30f96d1e4b84f633b8b
[ "MIT" ]
null
null
null
lib/relation_engine_bulk_update/workspace_object_collections.py
kbaseapps/relation_engine_bulk_update
04638d3d9e87eb9dc5afe30f96d1e4b84f633b8b
[ "MIT" ]
null
null
null
lib/relation_engine_bulk_update/workspace_object_collections.py
kbaseapps/relation_engine_bulk_update
04638d3d9e87eb9dc5afe30f96d1e4b84f633b8b
[ "MIT" ]
null
null
null
import logging import time from relation_engine_bulk_update.loader import RELoader WS_OBJ_DELIMITER = ":" def _timestamp_to_epoch(timestamp): return int(time.mktime(time.strptime(timestamp, "%Y-%m-%dT%H:%M:%S%z"))) def update_ws_object_collections(ws_client, re_api_url, token, params): """Update all works...
42.946524
96
0.504918
import logging import time from relation_engine_bulk_update.loader import RELoader WS_OBJ_DELIMITER = ":" def _timestamp_to_epoch(timestamp): return int(time.mktime(time.strptime(timestamp, "%Y-%m-%dT%H:%M:%S%z"))) def update_ws_object_collections(ws_client, re_api_url, token, params): if params.get('show...
true
true
f7392717e53659fb42c7f214fb6c4613976a33d8
670
py
Python
tests/models.py
chop-dbhi/varify
5dc721e49ed9bd3582f4b117785fdd1a8b6ba777
[ "BSD-2-Clause" ]
6
2015-01-16T14:35:29.000Z
2017-06-18T05:56:15.000Z
tests/models.py
solvebio/varify
5dc721e49ed9bd3582f4b117785fdd1a8b6ba777
[ "BSD-2-Clause" ]
null
null
null
tests/models.py
solvebio/varify
5dc721e49ed9bd3582f4b117785fdd1a8b6ba777
[ "BSD-2-Clause" ]
3
2015-05-27T15:03:17.000Z
2020-03-11T08:42:46.000Z
import logging class NullHandler(logging.Handler): """ Workaround to support Python 2.6 NullHandler was officially added to the logging package in Python 2.7 """ def emit(self, record): pass class MockHandler(logging.Handler): def __init__(self, *args, **kwargs): self.reset(...
22.333333
75
0.556716
import logging class NullHandler(logging.Handler): def emit(self, record): pass class MockHandler(logging.Handler): def __init__(self, *args, **kwargs): self.reset() logging.Handler.__init__(self, *args, **kwargs) def emit(self, record): self.messages[record.levelname.lo...
true
true
f73927469b2c34e50b6af272bb1dfc6847b04e30
548
py
Python
event/models.py
SimonCockx/entity
d888771f73f6db0300afbf8ec3fcc1fa6f9cf106
[ "BSD-3-Clause" ]
null
null
null
event/models.py
SimonCockx/entity
d888771f73f6db0300afbf8ec3fcc1fa6f9cf106
[ "BSD-3-Clause" ]
null
null
null
event/models.py
SimonCockx/entity
d888771f73f6db0300afbf8ec3fcc1fa6f9cf106
[ "BSD-3-Clause" ]
null
null
null
from django.db import models class Event(models.Model): name = models.CharField(max_length=255) date = models.DateField() description = models.CharField(max_length=255) class EventRepo: @staticmethod def list(): return Event.objects.all() @staticmethod def get(id): retur...
21.076923
82
0.669708
from django.db import models class Event(models.Model): name = models.CharField(max_length=255) date = models.DateField() description = models.CharField(max_length=255) class EventRepo: @staticmethod def list(): return Event.objects.all() @staticmethod def get(id): retur...
true
true
f73927cdd4d66e68a6749cc608789392812a553d
4,869
py
Python
qa/rpc-tests/httpbasics.py
hashtagcoin/hashtagcoinCORE
1c7c0dd4aed70364909d4666f150c45e741e6f76
[ "MIT" ]
null
null
null
qa/rpc-tests/httpbasics.py
hashtagcoin/hashtagcoinCORE
1c7c0dd4aed70364909d4666f150c45e741e6f76
[ "MIT" ]
null
null
null
qa/rpc-tests/httpbasics.py
hashtagcoin/hashtagcoinCORE
1c7c0dd4aed70364909d4666f150c45e741e6f76
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Hashtagcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test rpc http basics # from test_framework.test_framework import HashtagcoinTestFramework from t...
42.710526
112
0.633395
from test_framework.test_framework import HashtagcoinTestFramework from test_framework.util import * import http.client import urllib.parse class HTTPBasicsTest (HashtagcoinTestFramework): def __init__(self): super().__init__() self.num_nodes = 3 self.setup_clean_chain = False ...
true
true
f73928198afb261162bfd5c41aa9bc0868f60c89
204
py
Python
pwm-LED.py
kinami0115/Raspberry_Pi.Pythono
432e52bf9ef2e1b3ca5b7cf8a3363062c3ce267e
[ "MIT" ]
null
null
null
pwm-LED.py
kinami0115/Raspberry_Pi.Pythono
432e52bf9ef2e1b3ca5b7cf8a3363062c3ce267e
[ "MIT" ]
null
null
null
pwm-LED.py
kinami0115/Raspberry_Pi.Pythono
432e52bf9ef2e1b3ca5b7cf8a3363062c3ce267e
[ "MIT" ]
null
null
null
import RPi.GPIO as GPIO LED = 18 GPIO.setmode(GPIO.BCM) GPIO.setup(LED, GPIO.OUT) pwm = GPIO.PWM(LED, 100) pwm.start(0) try: while True: pwm.ChangeDutyCycle(50) except: pwm.stop() GPIO.cleanup()
12
25
0.696078
import RPi.GPIO as GPIO LED = 18 GPIO.setmode(GPIO.BCM) GPIO.setup(LED, GPIO.OUT) pwm = GPIO.PWM(LED, 100) pwm.start(0) try: while True: pwm.ChangeDutyCycle(50) except: pwm.stop() GPIO.cleanup()
true
true
f73929560e78c951103cdf049eec709eeebe5743
3,432
py
Python
testutils.py
sodul/pypyodbc
9e7b83e6494b7ea498b0a5c5fe7eb0e5ff33b53c
[ "MIT" ]
175
2015-01-11T21:19:52.000Z
2022-03-25T14:40:39.000Z
testutils.py
sodul/pypyodbc
9e7b83e6494b7ea498b0a5c5fe7eb0e5ff33b53c
[ "MIT" ]
79
2015-02-17T18:56:07.000Z
2021-12-23T15:03:37.000Z
testutils.py
sodul/pypyodbc
9e7b83e6494b7ea498b0a5c5fe7eb0e5ff33b53c
[ "MIT" ]
85
2015-01-20T09:02:49.000Z
2021-02-14T17:02:36.000Z
import os, sys, platform from os.path import join, dirname, abspath, basename import unittest def add_to_path(): """ Prepends the build directory to the path so that newly built pypyodbc libraries are used, allowing it to be tested without installing it. """ # Put the build directory into the Pyth...
33.980198
118
0.641608
import os, sys, platform from os.path import join, dirname, abspath, basename import unittest def add_to_path(): """ Prepends the build directory to the path so that newly built pypyodbc libraries are used, allowing it to be tested without installing it. """ import imp library...
false
true
f73929b08711913a06ffb72d476ba57a23bd00e8
6,498
py
Python
valr.py
arieroos/crypto-trader
c419f712fd7c501507c99a48a142e909f92a949c
[ "MIT" ]
2
2021-09-08T07:23:51.000Z
2021-11-08T14:59:32.000Z
valr.py
arieroos/crypto-trader
c419f712fd7c501507c99a48a142e909f92a949c
[ "MIT" ]
null
null
null
valr.py
arieroos/crypto-trader
c419f712fd7c501507c99a48a142e909f92a949c
[ "MIT" ]
null
null
null
import os import hashlib import hmac import time import orjson import requests import extra_math URL = "https://api.valr.com" VERSION = "/v1" previous_signatures = set() # As copied from VALR API example def gen_signature(api_key_secret, timestamp, verb, path, body=""): """ Signs the request payload using...
28.12987
107
0.630348
import os import hashlib import hmac import time import orjson import requests import extra_math URL = "https://api.valr.com" VERSION = "/v1" previous_signatures = set() def gen_signature(api_key_secret, timestamp, verb, path, body=""): payload = "{}{}{}{}".format(timestamp, verb.upper(), path, body) mes...
true
true
f7392a28574de489735050f1037a0b3d6961b5fe
8,942
py
Python
examples/text-classification/run_glue.py
PuneethaPai/transformers
a34a9896ac2a4a33ff9cd805c76eed914c8d8965
[ "Apache-2.0" ]
1
2021-02-08T02:53:30.000Z
2021-02-08T02:53:30.000Z
examples/text-classification/run_glue.py
PuneethaPai/transformers
a34a9896ac2a4a33ff9cd805c76eed914c8d8965
[ "Apache-2.0" ]
1
2020-05-29T03:49:13.000Z
2020-05-29T03:49:13.000Z
examples/text-classification/run_glue.py
PuneethaPai/transformers
a34a9896ac2a4a33ff9cd805c76eed914c8d8965
[ "Apache-2.0" ]
2
2020-05-29T09:41:15.000Z
2020-06-08T07:22:22.000Z
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a cop...
39.048035
133
0.668642
import dataclasses import logging import os import sys from dataclasses import dataclass, field from typing import Dict, Optional import numpy as np from transformers import AutoConfig, AutoModelForSequenceClassification, AutoTokenizer, EvalPrediction, GlueDataset from transformers import GlueDataTra...
true
true
f7392a6dd4b0424909a5fd9bf7f1e526fd65478d
16,037
py
Python
train/test.py
voidrank/Geo-CNN
4e8a7d5cc0d14ffa2a1b8bef854f294ae4e25f8b
[ "Apache-2.0" ]
37
2019-04-02T08:25:39.000Z
2022-01-16T22:26:17.000Z
train/test.py
voidrank/Geo-CNN
4e8a7d5cc0d14ffa2a1b8bef854f294ae4e25f8b
[ "Apache-2.0" ]
6
2019-05-10T02:26:14.000Z
2020-05-06T01:30:11.000Z
train/test.py
voidrank/Geo-CNN
4e8a7d5cc0d14ffa2a1b8bef854f294ae4e25f8b
[ "Apache-2.0" ]
7
2019-06-24T17:29:17.000Z
2020-04-30T06:28:24.000Z
''' Evaluating Frustum PointNets. Write evaluation results to KITTI format labels. and [optionally] write results to pickle files. Author: Charles R. Qi Date: September 2017 ''' from __future__ import print_function import os import sys import argparse import importlib import numpy as np import tensorflow as tf impor...
43.110215
175
0.660473
from __future__ import print_function import os import sys import argparse import importlib import numpy as np import tensorflow as tf import pickle BASE_DIR = os.path.dirname(os.path.abspath(__file__)) ROOT_DIR = os.path.dirname(BASE_DIR) sys.path.append(BASE_DIR) sys.path.append(os.path.join(ROOT_DIR, 'models')) fro...
true
true
f7392aecf8f01166143306d8eb5bc7f56974505f
4,104
py
Python
model-optimizer/telemetry/telemetry.py
dmitry-polunin/openvino
7cf7e1b5fa6a6a4371b9ef60776b2c67ba95490c
[ "Apache-2.0" ]
null
null
null
model-optimizer/telemetry/telemetry.py
dmitry-polunin/openvino
7cf7e1b5fa6a6a4371b9ef60776b2c67ba95490c
[ "Apache-2.0" ]
null
null
null
model-optimizer/telemetry/telemetry.py
dmitry-polunin/openvino
7cf7e1b5fa6a6a4371b9ef60776b2c67ba95490c
[ "Apache-2.0" ]
null
null
null
""" Copyright (C) 2017-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to i...
38.716981
118
0.64693
import telemetry.utils.isip as isip from telemetry.backend.backend import BackendRegistry from telemetry.utils.sender import TelemetrySender class SingletonMetaClass(type): def __init__(self, cls_name, super_classes, dic): self.__single_instance = None super().__init__(cls_name, super_classes, di...
true
true
f7392b9759338ededc59e7761d268f461eaa2689
1,436
py
Python
wfc3_psf.py
rubind/wfc3_psf
68e0d4b88e4a614939ae0c8771e37f315574ab82
[ "MIT" ]
null
null
null
wfc3_psf.py
rubind/wfc3_psf
68e0d4b88e4a614939ae0c8771e37f315574ab82
[ "MIT" ]
null
null
null
wfc3_psf.py
rubind/wfc3_psf
68e0d4b88e4a614939ae0c8771e37f315574ab82
[ "MIT" ]
null
null
null
import numpy as np from astropy.io import fits from scipy.interpolate import RectBivariateSpline def index_PSF(PSF, x, y): return PSF[x+y*3] def get_native_PSF(filt, x, y, the_path): x = float(np.clip(x, 0, 1014)) y = float(np.clip(y, 0, 1014)) f = fits.open("%sPSFSTD_WFC3IR_%s.fits" % (the_path, fil...
28.156863
92
0.550836
import numpy as np from astropy.io import fits from scipy.interpolate import RectBivariateSpline def index_PSF(PSF, x, y): return PSF[x+y*3] def get_native_PSF(filt, x, y, the_path): x = float(np.clip(x, 0, 1014)) y = float(np.clip(y, 0, 1014)) f = fits.open("%sPSFSTD_WFC3IR_%s.fits" % (the_path, fil...
true
true
f7392da5687b3024f50ac25b491557776a049584
1,612
py
Python
SensReader/python/reader.py
zinsmatt/ScanNet
a9f92721e5979b75db9c934199ad9e73a5ce330d
[ "MIT" ]
null
null
null
SensReader/python/reader.py
zinsmatt/ScanNet
a9f92721e5979b75db9c934199ad9e73a5ce330d
[ "MIT" ]
null
null
null
SensReader/python/reader.py
zinsmatt/ScanNet
a9f92721e5979b75db9c934199ad9e73a5ce330d
[ "MIT" ]
null
null
null
import argparse import os, sys from SensorData import SensorData # params parser = argparse.ArgumentParser() # data paths parser.add_argument('--filename', required=True, help='path to sens file to read') parser.add_argument('--output_path', required=True, help='path to output folder') parser.add_argument('--export_d...
39.317073
118
0.758685
import argparse import os, sys from SensorData import SensorData parser = argparse.ArgumentParser() parser.add_argument('--filename', required=True, help='path to sens file to read') parser.add_argument('--output_path', required=True, help='path to output folder') parser.add_argument('--export_depth_images', dest='...
true
true
f7392e9dcdce2b4bb41ba664100c8e6b73c3e3c3
1,700
py
Python
app/__init__.py
MatinWood/matinblog
4f8ad7fb5409a69274c21375c4980da69cbfd9cf
[ "MIT" ]
null
null
null
app/__init__.py
MatinWood/matinblog
4f8ad7fb5409a69274c21375c4980da69cbfd9cf
[ "MIT" ]
null
null
null
app/__init__.py
MatinWood/matinblog
4f8ad7fb5409a69274c21375c4980da69cbfd9cf
[ "MIT" ]
null
null
null
from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate from flask_login import LoginManager from flask_bootstrap import Bootstrap import logging import os from logging.handlers import SMTPHandler, RotatingFileHandler from flask_mail import Mail from config import Config app =...
32.075472
92
0.7
from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate from flask_login import LoginManager from flask_bootstrap import Bootstrap import logging import os from logging.handlers import SMTPHandler, RotatingFileHandler from flask_mail import Mail from config import Config app =...
true
true
f7392eac0aced861f6a92d3ebc1c496690f7e921
12,229
py
Python
accuracy_unit/wrf/wrf_accuracy.py
CUrW-SL/DSS-Framework
43a39b322ffb0eb92dd116e77cf9a8479357a121
[ "MIT" ]
null
null
null
accuracy_unit/wrf/wrf_accuracy.py
CUrW-SL/DSS-Framework
43a39b322ffb0eb92dd116e77cf9a8479357a121
[ "MIT" ]
null
null
null
accuracy_unit/wrf/wrf_accuracy.py
CUrW-SL/DSS-Framework
43a39b322ffb0eb92dd116e77cf9a8479357a121
[ "MIT" ]
null
null
null
import math from datetime import datetime, timedelta import sys from airflow.models import Variable import pandas as pd import numpy as np sys.path.insert(0, '/home/curw/git/DSS-Framework/db_util') # sys.path.insert(0, '/home/hasitha/PycharmProjects/DSS-Framework/db_util') from gen_db import CurwFcstAdapter, CurwObsAd...
47.034615
117
0.679287
import math from datetime import datetime, timedelta import sys from airflow.models import Variable import pandas as pd import numpy as np sys.path.insert(0, '/home/curw/git/DSS-Framework/db_util') from gen_db import CurwFcstAdapter, CurwObsAdapter, CurwSimAdapter from dss_db import RuleEngineAdapter COMMON_DATE_TIM...
true
true
f7392ec97372cd60201f3fdb2c98d491d545e51c
1,990
py
Python
scripts/data_congress_districts_116_pa.py
aclu-national/elections-api
8af28a2dcc9507004f28e8ec98aa9e9fee566eaa
[ "MIT" ]
28
2018-11-14T21:07:10.000Z
2022-03-09T04:55:30.000Z
scripts/data_congress_districts_116_pa.py
aclu-national/elections-api
8af28a2dcc9507004f28e8ec98aa9e9fee566eaa
[ "MIT" ]
31
2019-01-24T20:57:18.000Z
2021-12-08T15:20:44.000Z
scripts/data_congress_districts_116_pa.py
aclu-national/elections-api
8af28a2dcc9507004f28e8ec98aa9e9fee566eaa
[ "MIT" ]
3
2019-04-19T15:39:19.000Z
2021-09-17T23:39:58.000Z
#!/bin/env python import json, os, sys, us, area, re import data_index import mapzen.whosonfirst.geojson import mapzen.whosonfirst.utils script = os.path.realpath(sys.argv[0]) scripts_dir = os.path.dirname(script) root_dir = os.path.dirname(scripts_dir) source_path = "%s/sources/congress_districts_116_pa/congress_di...
25.512821
97
0.721608
import json, os, sys, us, area, re import data_index import mapzen.whosonfirst.geojson import mapzen.whosonfirst.utils script = os.path.realpath(sys.argv[0]) scripts_dir = os.path.dirname(script) root_dir = os.path.dirname(scripts_dir) source_path = "%s/sources/congress_districts_116_pa/congress_districts_116_pa.ge...
true
true
f7392f365d0342a88e633f9fe40d39d11062f96b
11,951
py
Python
lib/mma.py
zzzace2000/cairl_nodegam
90d0d56a0e7be3d1cbba6179cbfc36d626456770
[ "MIT" ]
3
2021-11-10T14:48:24.000Z
2022-01-03T12:35:39.000Z
lib/mma.py
zzzace2000/cairl_nodegam
90d0d56a0e7be3d1cbba6179cbfc36d626456770
[ "MIT" ]
null
null
null
lib/mma.py
zzzace2000/cairl_nodegam
90d0d56a0e7be3d1cbba6179cbfc36d626456770
[ "MIT" ]
null
null
null
import logging import cvxpy as cvx import numpy as np from numpy.linalg import norm from tqdm import tqdm class MaxMarginAbbeel(object): """ implementation of (Abbeel & Ng 2004) two versions: available 1. max-margin (stable, computationally more heavy) 2. projection (simpler) """ def ...
30.487245
97
0.534683
import logging import cvxpy as cvx import numpy as np from numpy.linalg import norm from tqdm import tqdm class MaxMarginAbbeel(object): def __init__(self, pi_init, p, mu_expert, irl_precision, mdp_solver, mu_e...
true
true
f7392f5a9e5eb7b71a739c2a332101542e0fb4a7
458
py
Python
source/ars_sim_obstacles_detector_ros_node.py
joselusl/ars_sim_obstacles_detector
97b1738dd7465097338e7dd193bf8cc1ae0200af
[ "BSD-3-Clause" ]
null
null
null
source/ars_sim_obstacles_detector_ros_node.py
joselusl/ars_sim_obstacles_detector
97b1738dd7465097338e7dd193bf8cc1ae0200af
[ "BSD-3-Clause" ]
null
null
null
source/ars_sim_obstacles_detector_ros_node.py
joselusl/ars_sim_obstacles_detector
97b1738dd7465097338e7dd193bf8cc1ae0200af
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/env python import numpy as np from numpy import * import os import rospy from ars_sim_obstacles_detector_ros import * def main(): ars_sim_obstacles_detector_ros = ArsSimObstaclesDetectorRos() ars_sim_obstacles_detector_ros.init() ars_sim_obstacles_detector_ros.open() try: ars_sim_obs...
12.378378
63
0.742358
import numpy as np from numpy import * import os import rospy from ars_sim_obstacles_detector_ros import * def main(): ars_sim_obstacles_detector_ros = ArsSimObstaclesDetectorRos() ars_sim_obstacles_detector_ros.init() ars_sim_obstacles_detector_ros.open() try: ars_sim_obstacles_detector_ros.r...
true
true
f7392f98b6b634c69f6808924f4ebde8e9d8a618
3,809
py
Python
tests/test_utilities/test_csvlook.py
GANESHANS/csvkit
55cdc8ff04731deff35788dce74808fef6e12355
[ "MIT" ]
1
2019-06-11T08:03:25.000Z
2019-06-11T08:03:25.000Z
tests/test_utilities/test_csvlook.py
GANESHANS/csvkit
55cdc8ff04731deff35788dce74808fef6e12355
[ "MIT" ]
null
null
null
tests/test_utilities/test_csvlook.py
GANESHANS/csvkit
55cdc8ff04731deff35788dce74808fef6e12355
[ "MIT" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import six try: from mock import patch except ImportError: from unittest.mock import patch from csvkit.utilities.csvlook import CSVLook, launch_new_instance from tests.utils import CSVKitTestCase, EmptyFileTests, stdin_as_string class TestCSVLook(CS...
29.076336
94
0.40273
import sys import six try: from mock import patch except ImportError: from unittest.mock import patch from csvkit.utilities.csvlook import CSVLook, launch_new_instance from tests.utils import CSVKitTestCase, EmptyFileTests, stdin_as_string class TestCSVLook(CSVKitTestCase, EmptyFileTests): Utility =...
true
true
f739307652be982ed1f53edcf3b57c2f59e807c3
964
py
Python
MoodJournal/settings/development.py
swpease/MoodJournal
3241d709b8a1d86212972ef1b44d5ea63319f4e6
[ "MIT" ]
null
null
null
MoodJournal/settings/development.py
swpease/MoodJournal
3241d709b8a1d86212972ef1b44d5ea63319f4e6
[ "MIT" ]
2
2020-06-05T18:16:07.000Z
2022-03-08T21:09:00.000Z
MoodJournal/settings/development.py
swpease/MoodJournal
3241d709b8a1d86212972ef1b44d5ea63319f4e6
[ "MIT" ]
null
null
null
from .base import * # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': get_env_variable('DB_NAME'), 'USER': get_env_variable('DB_USER'), 'PASSWORD': get_env_variable('DB_PASSWO...
33.241379
99
0.634855
from .base import * DEBUG = True DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': get_env_variable('DB_NAME'), 'USER': get_env_variable('DB_USER'), 'PASSWORD': get_env_variable('DB_PASSWORD'), 'HOST': '', 'PORT': '', } } EMAIL_BACK...
true
true
f73930badfbeb0ef0497305e6cbe556d008fc2dd
1,732
py
Python
core/polyaxon/client/handlers/handler.py
Ohtar10/polyaxon
1e41804e4ae6466b6928d06bc6ee6d2d9c7b8931
[ "Apache-2.0" ]
null
null
null
core/polyaxon/client/handlers/handler.py
Ohtar10/polyaxon
1e41804e4ae6466b6928d06bc6ee6d2d9c7b8931
[ "Apache-2.0" ]
null
null
null
core/polyaxon/client/handlers/handler.py
Ohtar10/polyaxon
1e41804e4ae6466b6928d06bc6ee6d2d9c7b8931
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
32.074074
76
0.677829
import logging from polyaxon import settings from polyaxon.logger import logger from polyaxon.polyboard.logging import V1Log class PolyaxonHandler(logging.Handler): def __init__(self, send_logs, **kwargs): self._send_logs = send_logs logging.Handler.__init__( self, ...
true
true
f73930e70f2aac2a00fc7877d0ae996ba1920d02
4,675
py
Python
entropymodel.py
Renata1995/Bayesian-model-of-AGL
db3abdd06e4f0531ff4a13acad22ef8d15c1da24
[ "MIT" ]
null
null
null
entropymodel.py
Renata1995/Bayesian-model-of-AGL
db3abdd06e4f0531ff4a13acad22ef8d15c1da24
[ "MIT" ]
null
null
null
entropymodel.py
Renata1995/Bayesian-model-of-AGL
db3abdd06e4f0531ff4a13acad22ef8d15c1da24
[ "MIT" ]
null
null
null
import math import scipy import csv class EntropyModel: def training_to_bigrams(self, training): """ Transform a list of training instances into a list of bigrams. Each training instance X is changed to bXe. 'b' denotes the start symbol. 'e' denotes the end symbol ...
30.16129
92
0.532406
import math import scipy import csv class EntropyModel: def training_to_bigrams(self, training): bigram_list = [] for item in training: bigram_list.extend(self.string_to_bigram(item)) return bigram_list def string_to_bigram (self, str): str = 'b' + str ...
true
true
f739320bf688ff8cb5ee350ef6915a957ce0c6e6
1,433
py
Python
examples/my_get_tx_hist.py
dgl-dev/dgl-tda-api
df1bd84b856926721bb83fbfac321a7d44eaf7d9
[ "MIT" ]
null
null
null
examples/my_get_tx_hist.py
dgl-dev/dgl-tda-api
df1bd84b856926721bb83fbfac321a7d44eaf7d9
[ "MIT" ]
null
null
null
examples/my_get_tx_hist.py
dgl-dev/dgl-tda-api
df1bd84b856926721bb83fbfac321a7d44eaf7d9
[ "MIT" ]
null
null
null
import json from urllib.request import urlopen import atexit import datetime import dateutil import sys import tda API_KEY = 'FON1HLNGRN0KOVR6UDTCF4RPEMPYIXOB@AMER.OAUTHAP' REDIRECT_URI = 'http://localhost:8080/' TOKEN_PATH = '../access_token' def save_to_file(data): """ Save to file for testing """ with...
24.288136
67
0.65806
import json from urllib.request import urlopen import atexit import datetime import dateutil import sys import tda API_KEY = 'FON1HLNGRN0KOVR6UDTCF4RPEMPYIXOB@AMER.OAUTHAP' REDIRECT_URI = 'http://localhost:8080/' TOKEN_PATH = '../access_token' def save_to_file(data): with open('../journal/data.json', 'w', encodi...
true
true
f7393278ae453680751d21770ecbac2adaa542be
1,072
py
Python
test/test_atlas_apimixin.py
gregbanks/atlascli
381966c4a042c3769d14167d5db7b5abb9a7c6e0
[ "Apache-2.0" ]
10
2019-10-11T10:59:29.000Z
2021-04-09T11:21:59.000Z
test/test_atlas_apimixin.py
gregbanks/atlascli
381966c4a042c3769d14167d5db7b5abb9a7c6e0
[ "Apache-2.0" ]
5
2019-10-09T16:58:09.000Z
2020-06-02T12:14:15.000Z
test/test_atlas_apimixin.py
gregbanks/atlascli
381966c4a042c3769d14167d5db7b5abb9a7c6e0
[ "Apache-2.0" ]
5
2019-11-28T08:55:02.000Z
2020-11-02T19:39:05.000Z
import unittest import pprint from atlascli.atlasapi import AtlasAPI class TestAPIMixin(unittest.TestCase): def setUp(self): self._api= AtlasAPI() self._api.authenticate() def tearDown(self): pass def test_get(self): r = self._api.get("https://httpbin.org/get") ...
28.972973
76
0.602612
import unittest import pprint from atlascli.atlasapi import AtlasAPI class TestAPIMixin(unittest.TestCase): def setUp(self): self._api= AtlasAPI() self._api.authenticate() def tearDown(self): pass def test_get(self): r = self._api.get("https://httpbin.org/get") ...
true
true
f7393367110cb9da09da8582a57f7d63551f2870
9,516
py
Python
src/wellTie.py
HackaGeo2021UFF/well-tie-challenge
63af3d9b4cc63e78f9ec31ee3d0e2b231e65b195
[ "MIT" ]
null
null
null
src/wellTie.py
HackaGeo2021UFF/well-tie-challenge
63af3d9b4cc63e78f9ec31ee3d0e2b231e65b195
[ "MIT" ]
null
null
null
src/wellTie.py
HackaGeo2021UFF/well-tie-challenge
63af3d9b4cc63e78f9ec31ee3d0e2b231e65b195
[ "MIT" ]
1
2021-12-21T05:33:37.000Z
2021-12-21T05:33:37.000Z
import json import welly from welly import Well import pandas as pd import lasio import numpy as np import os import matplotlib.pyplot as plt from src.waveletChoice import * from src.seismicManipulation import * def read_inputs(jpath): """ read_inputs reads the input json file and stores it information in a d...
28.070796
140
0.577869
import json import welly from welly import Well import pandas as pd import lasio import numpy as np import os import matplotlib.pyplot as plt from src.waveletChoice import * from src.seismicManipulation import * def read_inputs(jpath): with open(jpath) as file: paths = json.load(file) return paths de...
true
true
f739342172877e626ebc4a3decb55741bac9bd7d
5,568
py
Python
python3-virtualenv/lib/python3.6/site-packages/pip/locations.py
1tracy/3.3.1.1-flask-blog
05ba85340cf90109038492b81c670cba8829a375
[ "MIT" ]
null
null
null
python3-virtualenv/lib/python3.6/site-packages/pip/locations.py
1tracy/3.3.1.1-flask-blog
05ba85340cf90109038492b81c670cba8829a375
[ "MIT" ]
null
null
null
python3-virtualenv/lib/python3.6/site-packages/pip/locations.py
1tracy/3.3.1.1-flask-blog
05ba85340cf90109038492b81c670cba8829a375
[ "MIT" ]
null
null
null
"""Locations where we look for configs, install stuff, etc""" from __future__ import absolute_import import os import os.path import site import sys from distutils import sysconfig from distutils.command.install import install, SCHEME_KEYS # noqa from pip.compat import WINDOWS, expanduser from pip.utils import appd...
30.933333
85
0.675108
from __future__ import absolute_import import os import os.path import site import sys from distutils import sysconfig from distutils.command.install import install, SCHEME_KEYS from pip.compat import WINDOWS, expanduser from pip.utils import appdirs USER_CACHE_DIR = appdirs.user_cache_dir("pip") DELETE_MARKE...
true
true
f739353565512d48834ec2282a7d9721e6f1b855
3,213
py
Python
Validation/CTPPS/python/simu_config/year_2018_cff.py
valeriadamante/cmssw
69d8a54720114c1e843411ac5358a860cac06a99
[ "Apache-2.0" ]
null
null
null
Validation/CTPPS/python/simu_config/year_2018_cff.py
valeriadamante/cmssw
69d8a54720114c1e843411ac5358a860cac06a99
[ "Apache-2.0" ]
null
null
null
Validation/CTPPS/python/simu_config/year_2018_cff.py
valeriadamante/cmssw
69d8a54720114c1e843411ac5358a860cac06a99
[ "Apache-2.0" ]
null
null
null
import FWCore.ParameterSet.Config as cms from Validation.CTPPS.simu_config.base_cff import * # base profile settings for 2018 profile_base_2018 = profile_base.clone( ctppsLHCInfo = dict( beamEnergy = 6500 ), ctppsOpticalFunctions = dict( opticalFunctions = cms.VPSet( cms.PSet( xangle = cms.double...
49.430769
268
0.733894
import FWCore.ParameterSet.Config as cms from Validation.CTPPS.simu_config.base_cff import * profile_base_2018 = profile_base.clone( ctppsLHCInfo = dict( beamEnergy = 6500 ), ctppsOpticalFunctions = dict( opticalFunctions = cms.VPSet( cms.PSet( xangle = cms.double(120), fileName = cms.FileInPath...
true
true
f73935d12d2da2dbe2d078eddde792a4fe3468b1
14,620
py
Python
seq2seq/contrib/seq2seq/helper.py
Aniruddha-Tapas/seq2seq
29e4557860a7c6e997c039251195d9104a15585c
[ "Apache-2.0" ]
1
2021-04-21T05:30:15.000Z
2021-04-21T05:30:15.000Z
seq2seq/contrib/seq2seq/helper.py
liyc7711/seq2seq
1592b842b652ae648b96c164bead38eb089ce08e
[ "Apache-2.0" ]
null
null
null
seq2seq/contrib/seq2seq/helper.py
liyc7711/seq2seq
1592b842b652ae648b96c164bead38eb089ce08e
[ "Apache-2.0" ]
1
2020-05-28T15:33:18.000Z
2020-05-28T15:33:18.000Z
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
38.172324
89
0.687073
from __future__ import absolute_import from __future__ import division from __future__ import print_function import abc import six from tensorflow.contrib.distributions.python.ops import categorical from seq2seq.contrib.seq2seq import decoder from tensorflow.python.framework import dtypes from tens...
true
true
f73938305f8ff7efd7b09beb2e98be78847df74b
1,607
py
Python
quickstats/tests/test_prometheus.py
kfdm/django-simplestats
f3aa26329af56cbb910d86d450ea129a54b271ef
[ "MIT" ]
1
2019-06-07T04:55:55.000Z
2019-06-07T04:55:55.000Z
quickstats/tests/test_prometheus.py
kfdm/django-simplestats
f3aa26329af56cbb910d86d450ea129a54b271ef
[ "MIT" ]
31
2016-02-02T22:19:09.000Z
2018-05-08T09:52:54.000Z
quickstats/tests/test_prometheus.py
kfdm/django-simplestats
f3aa26329af56cbb910d86d450ea129a54b271ef
[ "MIT" ]
null
null
null
import time from pathlib import Path from rest_framework.authtoken.models import Token from quickstats import models from django.contrib.auth import get_user_model from django.test import TestCase, override_settings from django.urls import reverse METRICS = Path(__file__).parent / "metrics.prom" class PrometheusT...
37.372093
84
0.654636
import time from pathlib import Path from rest_framework.authtoken.models import Token from quickstats import models from django.contrib.auth import get_user_model from django.test import TestCase, override_settings from django.urls import reverse METRICS = Path(__file__).parent / "metrics.prom" class PrometheusT...
true
true
f7393876739398f7f877b25b57f9494b8a78b2db
7,959
py
Python
salt/returners/odbc.py
markgras/salt
d66cd3c935533c63870b83228b978ce43e0ef70d
[ "Apache-2.0" ]
9,425
2015-01-01T05:59:24.000Z
2022-03-31T20:44:05.000Z
salt/returners/odbc.py
markgras/salt
d66cd3c935533c63870b83228b978ce43e0ef70d
[ "Apache-2.0" ]
33,507
2015-01-01T00:19:56.000Z
2022-03-31T23:48:20.000Z
salt/returners/odbc.py
markgras/salt
d66cd3c935533c63870b83228b978ce43e0ef70d
[ "Apache-2.0" ]
5,810
2015-01-01T19:11:45.000Z
2022-03-31T02:37:20.000Z
""" Return data to an ODBC compliant server. This driver was developed with Microsoft SQL Server in mind, but theoretically could be used to return data to any compliant ODBC database as long as there is a working ODBC driver for it on your minion platform. :maintainer: C. R. Oldham (cr@saltstack.com) :maturity: ...
24.640867
107
0.633999
import salt.returners import salt.utils.jid import salt.utils.json try: import pyodbc # import psycopg2.extras HAS_ODBC = True except ImportError: HAS_ODBC = False # Define the module's virtual name __virtualname__ = "odbc" def __virtual__(): if not HAS_ODBC: return False, "Could not ...
true
true
f73938cf6bc9b4540a04849c344a59ca647453ad
10,913
py
Python
api_1.3/containerd/services/content/v1/content_pb2_grpc.py
Silvanoc/pycontainerd
7245ce623d978f65cd8a4cf0d685a3318640a305
[ "Apache-2.0" ]
null
null
null
api_1.3/containerd/services/content/v1/content_pb2_grpc.py
Silvanoc/pycontainerd
7245ce623d978f65cd8a4cf0d685a3318640a305
[ "Apache-2.0" ]
null
null
null
api_1.3/containerd/services/content/v1/content_pb2_grpc.py
Silvanoc/pycontainerd
7245ce623d978f65cd8a4cf0d685a3318640a305
[ "Apache-2.0" ]
null
null
null
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc from containerd.services.content.v1 import content_pb2 as containerd_dot_services_dot_content_dot_v1_dot_content__pb2 from containerd.vendor.google.protobuf import empty_pb2 as containerd_dot_vendor_dot_google_dot_protobuf_dot_empty__pb2...
49.83105
129
0.780629
import grpc from containerd.services.content.v1 import content_pb2 as containerd_dot_services_dot_content_dot_v1_dot_content__pb2 from containerd.vendor.google.protobuf import empty_pb2 as containerd_dot_vendor_dot_google_dot_protobuf_dot_empty__pb2 class ContentStub(object): def __init__(self, channel): sel...
true
true
f7393a37a42201224b30d9711c3e2d164025a9a8
883
py
Python
mxnet2caffe.py
niekai1982/MobileNet-SSD
0fb307ff049865338017627d4f082a8fd8b12016
[ "MIT" ]
null
null
null
mxnet2caffe.py
niekai1982/MobileNet-SSD
0fb307ff049865338017627d4f082a8fd8b12016
[ "MIT" ]
null
null
null
mxnet2caffe.py
niekai1982/MobileNet-SSD
0fb307ff049865338017627d4f082a8fd8b12016
[ "MIT" ]
null
null
null
from __future__ import print_function, absolute_import from google.protobuf import text_format import argparse import re import sys import math sys.path.insert(0, '/Users/niekai/caffe-ssd/caffe/python') caffe_flag = True try: import caffe from caffe.proto import caffe_pb2 except ImportError: caffe_flag = ...
22.641026
60
0.729332
from __future__ import print_function, absolute_import from google.protobuf import text_format import argparse import re import sys import math sys.path.insert(0, '/Users/niekai/caffe-ssd/caffe/python') caffe_flag = True try: import caffe from caffe.proto import caffe_pb2 except ImportError: caffe_flag = ...
true
true
f7393aaa039659065b994a9d672beadb8d324d2b
3,804
py
Python
Filters/Core/Testing/Python/cutLoop.py
jasper-yeh/VtkDotNet
84b56f781cb511694e4380cebfb245bbefe2560b
[ "BSD-3-Clause" ]
3
2020-06-20T23:31:06.000Z
2021-01-11T02:17:16.000Z
Filters/Core/Testing/Python/cutLoop.py
jasper-yeh/VtkDotNet
84b56f781cb511694e4380cebfb245bbefe2560b
[ "BSD-3-Clause" ]
1
2020-12-01T23:21:02.000Z
2020-12-02T23:44:43.000Z
Filters/Core/Testing/Python/cutLoop.py
jasper-yeh/VtkDotNet
84b56f781cb511694e4380cebfb245bbefe2560b
[ "BSD-3-Clause" ]
5
2015-10-09T04:12:29.000Z
2021-12-15T16:57:11.000Z
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() def GetRGBColor(colorName): ''' Return the red, green and blue components for a color as doubles. ''' rgb = [0.0, 0.0, 0.0] # black vtk.vtkNamedColors...
34.581818
66
0.781283
import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() def GetRGBColor(colorName): rgb = [0.0, 0.0, 0.0] vtk.vtkNamedColors().GetColorRGB(colorName, rgb) return rgb selectionPoints = vtk.vtkPoints() selectionPoints.InsertPoint(0, -0.16553, 0....
true
true
f7393b1dfe74669e5449be0e76009dc89a1e84e1
77,055
py
Python
tests/app/celery/test_tasks.py
TechforgoodCAST/notifications-api
242d2f67ff3a3febbc41cdf6da1e18e14512c0ce
[ "MIT" ]
1
2021-02-26T18:31:50.000Z
2021-02-26T18:31:50.000Z
tests/app/celery/test_tasks.py
Kolanot/notifications-api
08b157df8732ec1864e865427a164b05abd8cca2
[ "MIT" ]
null
null
null
tests/app/celery/test_tasks.py
Kolanot/notifications-api
08b157df8732ec1864e865427a164b05abd8cca2
[ "MIT" ]
null
null
null
import json import uuid from datetime import datetime, timedelta from unittest.mock import Mock, call import pytest import requests_mock from freezegun import freeze_time from requests import RequestException from sqlalchemy.exc import SQLAlchemyError from celery.exceptions import Retry from notifications_utils.templa...
38.374004
120
0.714269
import json import uuid from datetime import datetime, timedelta from unittest.mock import Mock, call import pytest import requests_mock from freezegun import freeze_time from requests import RequestException from sqlalchemy.exc import SQLAlchemyError from celery.exceptions import Retry from notifications_utils.templa...
true
true
f7393bfa54f395317d34111ddf96503baaa1989f
9,240
py
Python
frappe/database/query.py
samodin7/frappe
b92c911646eefb39d823f0f82fded00d864c4d28
[ "MIT" ]
null
null
null
frappe/database/query.py
samodin7/frappe
b92c911646eefb39d823f0f82fded00d864c4d28
[ "MIT" ]
null
null
null
frappe/database/query.py
samodin7/frappe
b92c911646eefb39d823f0f82fded00d864c4d28
[ "MIT" ]
null
null
null
import operator import re from typing import Any, Dict, List, Tuple, Union import frappe from frappe import _ from frappe.query_builder import Criterion, Field, Order, Table def like(key: Field, value: str) -> frappe.qb: """Wrapper method for `LIKE` Args: key (str): field value (str): criterion ...
25.315068
95
0.657035
import operator import re from typing import Any, Dict, List, Tuple, Union import frappe from frappe import _ from frappe.query_builder import Criterion, Field, Order, Table def like(key: Field, value: str) -> frappe.qb: return key.like(value) def func_in(key: Field, value: Union[List, Tuple]) -> frappe.qb: retu...
true
true
f7393c83f83fb3fdfa9c001b10656868bdf99c2b
4,726
py
Python
Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/set_extractor_config.py
XiaoxiaoMa0815/Recognizers-Text
d9a4bc939348bd79b5982345255961dff5f356c6
[ "MIT" ]
2
2017-08-22T11:21:19.000Z
2017-09-17T20:06:00.000Z
Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/set_extractor_config.py
XiaoxiaoMa0815/Recognizers-Text
d9a4bc939348bd79b5982345255961dff5f356c6
[ "MIT" ]
76
2018-11-09T18:19:44.000Z
2019-08-20T20:29:53.000Z
Python/libraries/recognizers-date-time/recognizers_date_time/date_time/spanish/set_extractor_config.py
XiaoxiaoMa0815/Recognizers-Text
d9a4bc939348bd79b5982345255961dff5f356c6
[ "MIT" ]
6
2017-05-04T17:24:59.000Z
2019-07-23T15:48:44.000Z
from typing import Pattern from recognizers_text.utilities import RegExpUtility from ...resources.spanish_date_time import SpanishDateTime from ..extractors import DateTimeExtractor from ..base_set import SetExtractorConfiguration from ..base_date import BaseDateExtractor from ..base_time import BaseTimeExtractor from...
38.422764
88
0.768091
from typing import Pattern from recognizers_text.utilities import RegExpUtility from ...resources.spanish_date_time import SpanishDateTime from ..extractors import DateTimeExtractor from ..base_set import SetExtractorConfiguration from ..base_date import BaseDateExtractor from ..base_time import BaseTimeExtractor from...
true
true
f7393cd2d51c7377e0aecc056b1fee4927213fae
1,733
py
Python
ch19/day06/07.py
starcatch1/book
3d4477c2e624e291b2081b944c9589b976211dcf
[ "MIT" ]
1
2019-02-03T08:00:24.000Z
2019-02-03T08:00:24.000Z
ch19/day06/07.py
starcatch1/book
3d4477c2e624e291b2081b944c9589b976211dcf
[ "MIT" ]
null
null
null
ch19/day06/07.py
starcatch1/book
3d4477c2e624e291b2081b944c9589b976211dcf
[ "MIT" ]
null
null
null
import requests import pandas as pd from bs4 import BeautifulSoup def get_financial_statements(code): url = "http://companyinfo.stock.naver.com/v1/company/ajax/cF1001.aspx?cmp_cd=%s&fin_typ=0&freq_typ=Y" % (code) html = requests.get(url).text html = html.replace('<th class="bg r01c02 endLine line-bottom"c...
31.509091
126
0.620312
import requests import pandas as pd from bs4 import BeautifulSoup def get_financial_statements(code): url = "http://companyinfo.stock.naver.com/v1/company/ajax/cF1001.aspx?cmp_cd=%s&fin_typ=0&freq_typ=Y" % (code) html = requests.get(url).text html = html.replace('<th class="bg r01c02 endLine line-bottom"c...
true
true
f7393f6de5dc247f7042c1e7e3f6aa4250fa044c
406
py
Python
packages/python/plotly/plotly/validators/cone/_hovertextsrc.py
mastermind88/plotly.py
efa70710df1af22958e1be080e105130042f1839
[ "MIT" ]
null
null
null
packages/python/plotly/plotly/validators/cone/_hovertextsrc.py
mastermind88/plotly.py
efa70710df1af22958e1be080e105130042f1839
[ "MIT" ]
null
null
null
packages/python/plotly/plotly/validators/cone/_hovertextsrc.py
mastermind88/plotly.py
efa70710df1af22958e1be080e105130042f1839
[ "MIT" ]
null
null
null
import _plotly_utils.basevalidators class HovertextsrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__(self, plotly_name="hovertextsrc", parent_name="cone", **kwargs): super(HovertextsrcValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
33.833333
81
0.679803
import _plotly_utils.basevalidators class HovertextsrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__(self, plotly_name="hovertextsrc", parent_name="cone", **kwargs): super(HovertextsrcValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
true
true
f7394046fb323ee714ec12d620fd97e454fafaee
392
py
Python
navygem/wsgi.py
glusa8/navygem
be437f3ce89d2edc5a565d7903e80171abec6929
[ "MIT" ]
1
2018-05-17T13:05:06.000Z
2018-05-17T13:05:06.000Z
navygem/wsgi.py
glusa8/navygem
be437f3ce89d2edc5a565d7903e80171abec6929
[ "MIT" ]
null
null
null
navygem/wsgi.py
glusa8/navygem
be437f3ce89d2edc5a565d7903e80171abec6929
[ "MIT" ]
null
null
null
''' WSGI config for navygem project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/ ''' import os from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJANGO_SETT...
23.058824
78
0.785714
import os from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'navygem.settings') application = get_wsgi_application()
true
true
f739405af99f718447ba85e10dd9675b42e4760e
39,147
py
Python
test/quantization/core/test_workflow_module.py
rpindale/pytorch
b07264301d19869ab223957a15e2ce8825886d21
[ "Intel" ]
7
2021-05-29T16:31:51.000Z
2022-02-21T18:52:25.000Z
test/quantization/core/test_workflow_module.py
stas00/pytorch
6a085648d81ce88ff59d6d1438fdb3707a0d6fb7
[ "Intel" ]
1
2021-05-31T02:20:29.000Z
2021-05-31T02:20:29.000Z
test/quantization/core/test_workflow_module.py
stas00/pytorch
6a085648d81ce88ff59d6d1438fdb3707a0d6fb7
[ "Intel" ]
1
2021-12-26T23:20:06.000Z
2021-12-26T23:20:06.000Z
# Torch import torch from torch.quantization import ( MinMaxObserver, PerChannelMinMaxObserver, MovingAverageMinMaxObserver, MovingAveragePerChannelMinMaxObserver, HistogramObserver, RecordingObserver, PlaceholderObserver, NoopObserver, FakeQuantize, FixedQParamsFakeQuantize, ...
43.113436
132
0.594273
import torch from torch.quantization import ( MinMaxObserver, PerChannelMinMaxObserver, MovingAverageMinMaxObserver, MovingAveragePerChannelMinMaxObserver, HistogramObserver, RecordingObserver, PlaceholderObserver, NoopObserver, FakeQuantize, FixedQParamsFakeQuantize, defaul...
true
true
f739409a16b63deef6713f33300373a0dda49fb8
30,378
py
Python
ptr.py
jreese/ptr
c0c4c6877c5c443d07117cdb39deba3f8bdbf9d3
[ "MIT" ]
null
null
null
ptr.py
jreese/ptr
c0c4c6877c5c443d07117cdb39deba3f8bdbf9d3
[ "MIT" ]
null
null
null
ptr.py
jreese/ptr
c0c4c6877c5c443d07117cdb39deba3f8bdbf9d3
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # coding=utf8 import argparse import ast import asyncio import logging import sys from collections i...
32.180085
89
0.584272
import argparse import ast import asyncio import logging import sys from collections import defaultdict, namedtuple from configparser import ConfigParser from enum import Enum from json import dump from os import chdir, cpu_count, environ, getcwd, getpid from os.path import sep as path_separator from pathlib imp...
true
true
f739416b01156069aed347c2aa1e25d97e9016e4
2,118
py
Python
examples/python/greenlet_consumer/gevent_consumer.py
gtaylor/EVE-Market-Data-Relay
a8af4f05962f4ec26abc64076cae3a8302a4b3ad
[ "MIT" ]
32
2015-01-15T06:12:43.000Z
2020-04-10T19:17:14.000Z
examples/python/greenlet_consumer/gevent_consumer.py
gtaylor/EVE-Market-Data-Relay
a8af4f05962f4ec26abc64076cae3a8302a4b3ad
[ "MIT" ]
2
2015-03-13T18:18:52.000Z
2015-10-08T20:20:15.000Z
examples/python/greenlet_consumer/gevent_consumer.py
gtaylor/EVE-Market-Data-Relay
a8af4f05962f4ec26abc64076cae3a8302a4b3ad
[ "MIT" ]
9
2015-01-02T05:35:01.000Z
2021-01-31T09:41:22.000Z
#!/usr/bin/env python """ An example consumer that uses a greenlet pool to accept incoming market messages. This example offers a high degree of concurrency. """ import zlib # This can be replaced with the built-in json module, if desired. import simplejson import gevent from gevent.pool import Pool from gevent import...
34.721311
81
0.723324
""" An example consumer that uses a greenlet pool to accept incoming market messages. This example offers a high degree of concurrency. """ import zlib import simplejson import gevent from gevent.pool import Pool from gevent import monkey; gevent.monkey.patch_all() import zmq.green as zmq MAX_NUM_POOL_WORKERS =...
false
true
f73941e4c6267a317036f8621a992ff4458ed2d6
661
py
Python
Course3/Lab4/validations.py
JovanoD/it-cert-automation-practice
ef9926a6f64b17b54b1c4a1f421ef4e3eab53a70
[ "Apache-2.0" ]
null
null
null
Course3/Lab4/validations.py
JovanoD/it-cert-automation-practice
ef9926a6f64b17b54b1c4a1f421ef4e3eab53a70
[ "Apache-2.0" ]
null
null
null
Course3/Lab4/validations.py
JovanoD/it-cert-automation-practice
ef9926a6f64b17b54b1c4a1f421ef4e3eab53a70
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python3 import re def validate_user(username, minlen): """Checks if the received username matches the required conditions.""" if type(username) != str: raise TypeError("username must be a string") if minlen < 1: raise ValueError("minlen must be at least 1") # Userna...
26.44
74
0.644478
import re def validate_user(username, minlen): if type(username) != str: raise TypeError("username must be a string") if minlen < 1: raise ValueError("minlen must be at least 1") if len(username) < minlen: return False # Usernames can only use letters, numbers, dots ...
true
true
f7394213b6f6300c66f6e19760d62206b7ce7071
2,328
py
Python
test/auth/jwt/jwt_signer_rsa_test.py
ad-m/h1-credentials-helper-python
2c3e0d9c57ea4a37349debbbe7bc640bc326e5e3
[ "MIT" ]
null
null
null
test/auth/jwt/jwt_signer_rsa_test.py
ad-m/h1-credentials-helper-python
2c3e0d9c57ea4a37349debbbe7bc640bc326e5e3
[ "MIT" ]
null
null
null
test/auth/jwt/jwt_signer_rsa_test.py
ad-m/h1-credentials-helper-python
2c3e0d9c57ea4a37349debbbe7bc640bc326e5e3
[ "MIT" ]
null
null
null
import unittest import json from time import time from base64 import b64decode from credentials.auth.jwt.jwt_signer import JWTSigner PRIVATE_KEY = '''-----BEGIN RSA PRIVATE KEY----- MIICWgIBAAKBgGFfgMY+DuO8l0RYrMLhcl6U/NigNIiOVhoo/xnYyoQALpWxBaBR +iVJiBUYunQjKA33yAiY0AasCfSn1JB6asayQvGGn73xztLjkeCVLT+9e4nJ0A/o dK8SOKB...
36.375
64
0.766323
import unittest import json from time import time from base64 import b64decode from credentials.auth.jwt.jwt_signer import JWTSigner PRIVATE_KEY = '''-----BEGIN RSA PRIVATE KEY----- MIICWgIBAAKBgGFfgMY+DuO8l0RYrMLhcl6U/NigNIiOVhoo/xnYyoQALpWxBaBR +iVJiBUYunQjKA33yAiY0AasCfSn1JB6asayQvGGn73xztLjkeCVLT+9e4nJ0A/o dK8SOKB...
true
true
f73943349bba9237780570ad1b46d99a2e12ba23
7,903
py
Python
swami-control/usr/lib/python2.7/dist-packages/swami_timezone/swami_timezone.py
Feneric/bodhi3packages
f325307ffa53a91c060c20e1da1793b26122ca1b
[ "BSD-3-Clause" ]
2
2016-04-10T14:38:52.000Z
2018-08-31T21:41:37.000Z
swami-control/usr/lib/python2.7/dist-packages/swami_timezone/swami_timezone.py
Feneric/bodhi3packages
f325307ffa53a91c060c20e1da1793b26122ca1b
[ "BSD-3-Clause" ]
5
2015-10-23T06:49:33.000Z
2018-10-20T00:46:58.000Z
swami-control/usr/lib/python2.7/dist-packages/swami_timezone/swami_timezone.py
Feneric/bodhi3packages
f325307ffa53a91c060c20e1da1793b26122ca1b
[ "BSD-3-Clause" ]
5
2017-05-20T14:44:54.000Z
2019-10-05T15:59:33.000Z
#Swami skel module for the Swami Control Panel import time import dateutil.tz as dtz import pytz import datetime as dt import collections import esudo.esudo as esudo from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL from efl import elementary from efl.elementary.button import Button from efl.elementary.box import...
36.252294
118
0.653929
import time import dateutil.tz as dtz import pytz import datetime as dt import collections import esudo.esudo as esudo from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL from efl import elementary from efl.elementary.button import Button from efl.elementary.box import Box from efl.elementary.icon import Icon from...
true
true
f7394401b4db84935451c26055d0cfed8872b641
9,528
py
Python
model_compression_toolkit/core/pytorch/mixed_precision/sensitivity_evaluation.py
reuvenperetz/model_optimization
40de02d56750ee4cc20e693da63bc2e70b4d20e6
[ "Apache-2.0" ]
null
null
null
model_compression_toolkit/core/pytorch/mixed_precision/sensitivity_evaluation.py
reuvenperetz/model_optimization
40de02d56750ee4cc20e693da63bc2e70b4d20e6
[ "Apache-2.0" ]
null
null
null
model_compression_toolkit/core/pytorch/mixed_precision/sensitivity_evaluation.py
reuvenperetz/model_optimization
40de02d56750ee4cc20e693da63bc2e70b4d20e6
[ "Apache-2.0" ]
null
null
null
# Copyright 2022 Sony Semiconductors Israel, Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
59.180124
119
0.70487
from torch.nn import Module from typing import Callable, List from model_compression_toolkit.core.common.framework_info import FrameworkInfo from model_compression_toolkit.core.common.graph.base_graph import Graph from model_compression_toolkit.core.common.mixed_precision.mixed_precision_quantization_co...
true
true
f739448915deb2be25755253cb0d94c8cb4ef6d7
1,777
py
Python
services/stocks-api/app/api/clients/AbstractWebsocketClient.py
krystianbajno/stocks
0a1a9283cb6debe36cfe01308eb4bc0b85217a02
[ "MIT" ]
3
2020-08-09T14:43:45.000Z
2020-08-11T23:22:15.000Z
services/stocks-api/app/api/clients/AbstractWebsocketClient.py
krystianbajno/stocks
0a1a9283cb6debe36cfe01308eb4bc0b85217a02
[ "MIT" ]
null
null
null
services/stocks-api/app/api/clients/AbstractWebsocketClient.py
krystianbajno/stocks
0a1a9283cb6debe36cfe01308eb4bc0b85217a02
[ "MIT" ]
1
2020-11-11T00:58:42.000Z
2020-11-11T00:58:42.000Z
import json import time from threading import Thread from websocket import create_connection, WebSocketConnectionClosedException class AbstractWebsocketClient(object): thread = None stop = False sub_params = {} keep_alive = None def start(self): def _go(): self._connect() ...
22.782051
75
0.545864
import json import time from threading import Thread from websocket import create_connection, WebSocketConnectionClosedException class AbstractWebsocketClient(object): thread = None stop = False sub_params = {} keep_alive = None def start(self): def _go(): self._connect() ...
true
true
f73944a1b8caccf5827449da68641849ce521da1
838
py
Python
python/longest_common_prefix.py
shub0/leetcode
8221d10f201d001abcb15b27c9cf4b8cd5060f1f
[ "BSD-3-Clause" ]
null
null
null
python/longest_common_prefix.py
shub0/leetcode
8221d10f201d001abcb15b27c9cf4b8cd5060f1f
[ "BSD-3-Clause" ]
null
null
null
python/longest_common_prefix.py
shub0/leetcode
8221d10f201d001abcb15b27c9cf4b8cd5060f1f
[ "BSD-3-Clause" ]
null
null
null
#! /usr/bin/python ''' Write a function to find the longest common prefix string amongst an array of strings. ''' class Solution: # @return a string def longestCommonPrefix(self, strs): if len(strs) == 0: return '' return strs[0][:self.longestPrefix(strs)] def longestPrefix(sel...
26.1875
86
0.541766
''' Write a function to find the longest common prefix string amongst an array of strings. ''' class Solution: def longestCommonPrefix(self, strs): if len(strs) == 0: return '' return strs[0][:self.longestPrefix(strs)] def longestPrefix(self, strs): max_len = max([ le...
false
true
f73945fb4f38c36443ab7de794cb5023b929e58a
4,511
py
Python
lib/ansiblelint/runner.py
cyper85/ansible-lint
e752948586c142bcddb3fb0e3f1796ce30626842
[ "MIT" ]
1
2020-10-20T00:31:38.000Z
2020-10-20T00:31:38.000Z
lib/ansiblelint/runner.py
cyper85/ansible-lint
e752948586c142bcddb3fb0e3f1796ce30626842
[ "MIT" ]
95
2020-09-13T05:04:37.000Z
2022-03-27T22:04:44.000Z
lib/ansiblelint/runner.py
cyper85/ansible-lint
e752948586c142bcddb3fb0e3f1796ce30626842
[ "MIT" ]
1
2020-12-22T08:09:07.000Z
2020-12-22T08:09:07.000Z
"""Runner implementation.""" import logging import os from typing import TYPE_CHECKING, Any, FrozenSet, Generator, List, Optional, Set import ansiblelint.file_utils import ansiblelint.skip_utils import ansiblelint.utils from ansiblelint.errors import MatchError from ansiblelint.rules.LoadingFailureRule import LoadingF...
40.276786
89
0.591886
import logging import os from typing import TYPE_CHECKING, Any, FrozenSet, Generator, List, Optional, Set import ansiblelint.file_utils import ansiblelint.skip_utils import ansiblelint.utils from ansiblelint.errors import MatchError from ansiblelint.rules.LoadingFailureRule import LoadingFailureRule if TYPE_CHECKING:...
true
true
f739464879003de44eaf68232a6d4a41a29fc14e
386
py
Python
medium/Triangle/solution.py
ashutosh1919/leetcode-problems
65f99a3694549af88c7702b598de1a8ccb7db5fb
[ "MIT" ]
8
2021-08-21T19:10:04.000Z
2022-03-11T14:30:02.000Z
medium/Triangle/solution.py
ashutosh1919/leetcode-problems
65f99a3694549af88c7702b598de1a8ccb7db5fb
[ "MIT" ]
null
null
null
medium/Triangle/solution.py
ashutosh1919/leetcode-problems
65f99a3694549af88c7702b598de1a8ccb7db5fb
[ "MIT" ]
1
2021-08-24T06:29:02.000Z
2021-08-24T06:29:02.000Z
# Time complexity: O(n) # Approach: Summing up triangle from bottom to top in minimum way. class Solution: def minimumTotal(self, triangle: List[List[int]]) -> int: n = len(triangle) for i in range(n-1, 0, -1): for j in range(0, len(triangle[i])-1): triangle[i-1][j] += m...
38.6
73
0.582902
class Solution: def minimumTotal(self, triangle: List[List[int]]) -> int: n = len(triangle) for i in range(n-1, 0, -1): for j in range(0, len(triangle[i])-1): triangle[i-1][j] += min(triangle[i][j], triangle[i][j+1]) return triangle[0][0]
true
true
f73946d099540f3451697e7dffb935bafbc21e6e
3,272
py
Python
util/widget_helpers.py
WhoIsJack/chemokine_buffering_paper
50a7db3ac6c2f1d5821daa8c6bb0fc6194849d72
[ "MIT" ]
1
2021-03-12T23:05:58.000Z
2021-03-12T23:05:58.000Z
util/widget_helpers.py
WhoIsJack/chemokine_buffering_paper
50a7db3ac6c2f1d5821daa8c6bb0fc6194849d72
[ "MIT" ]
null
null
null
util/widget_helpers.py
WhoIsJack/chemokine_buffering_paper
50a7db3ac6c2f1d5821daa8c6bb0fc6194849d72
[ "MIT" ]
1
2021-03-11T10:24:57.000Z
2021-03-11T10:24:57.000Z
# -*- coding: utf-8 -*- """ Created on Wed Sep 19 19:27:45 2018 @author: Jonas Hartmann @ Gilmour group @ EMBL Heidelberg @descript: Convenient little helpers for ipywidgets hacking. """ #------------------------------------------------------------------------------ # IMPORTS from __future__ import division im...
32.39604
79
0.551345
""" Created on Wed Sep 19 19:27:45 2018 @author: Jonas Hartmann @ Gilmour group @ EMBL Heidelberg @descript: Convenient little helpers for ipywidgets hacking. """ from __future__ import division import os import ipywidgets as widgets import matplotlib.pyplot as plt from IPython.display import display, clear...
false
true
f7394766bbd9f100e44a655e4a68e1c1d59ad4c1
32,587
py
Python
tests/test_array.py
jmerle/pythonnet
62b2175638ef860f49cad404c076f380622287cd
[ "MIT" ]
27
2017-01-08T02:30:17.000Z
2022-01-20T18:14:57.000Z
tests/test_array.py
jmerle/pythonnet
62b2175638ef860f49cad404c076f380622287cd
[ "MIT" ]
16
2017-09-29T13:12:27.000Z
2021-06-24T08:59:17.000Z
tests/test_array.py
jmerle/pythonnet
62b2175638ef860f49cad404c076f380622287cd
[ "MIT" ]
30
2017-02-28T22:29:43.000Z
2021-12-23T18:40:41.000Z
# -*- coding: utf-8 -*- """Test support for managed arrays.""" import clr import Python.Test as Test import System import pytest from collections import UserList def test_public_array(): """Test public arrays.""" ob = Test.PublicArrayTest() items = ob.items assert len(items) == 5 assert items...
23.144176
102
0.599994
import clr import Python.Test as Test import System import pytest from collections import UserList def test_public_array(): ob = Test.PublicArrayTest() items = ob.items assert len(items) == 5 assert items[0] == 0 assert items[4] == 4 items[0] = 8 assert items[0] == 8 items[4] =...
true
true
f73947ca1bb93f0a55bb4130852ce9c4c37c31b0
6,119
py
Python
userbot/modules/purge.py
Blank-sama/Ayiin-Userbot
568dd0a7344caacbd965af2654375783d70bee94
[ "Naumen", "Condor-1.1", "MS-PL" ]
1
2022-03-18T12:59:42.000Z
2022-03-18T12:59:42.000Z
userbot/modules/purge.py
Blank-sama/Ayiin-Userbot
568dd0a7344caacbd965af2654375783d70bee94
[ "Naumen", "Condor-1.1", "MS-PL" ]
null
null
null
userbot/modules/purge.py
Blank-sama/Ayiin-Userbot
568dd0a7344caacbd965af2654375783d70bee94
[ "Naumen", "Condor-1.1", "MS-PL" ]
null
null
null
# Copyright (C) 2019 The Raphielscape Company LLC. # # Licensed under the Raphielscape Public License, Version 1.c (the "License"); # you may not use this file except in compliance with the License. # # Recode by @mrismanaziz # FROM Man-Userbot <https://github.com/mrismanaziz/Man-Userbot> # t.me/SharingUserbot & t.me/L...
32.036649
136
0.609904
from asyncio import sleep from telethon.errors import rpcbaseerrors from userbot import CMD_HANDLER as cmd from userbot import CMD_HELP from userbot.events import register from userbot.utils import edit_delete, ayiin_cmd @ayiin_cmd(pattern="purge$") @register(pattern=r"^\.cpurge$", sudo=True) async def f...
true
true
f73948dfdc4f00b9e39431bd4b83108364751e50
818
py
Python
Exercicios/Mundo3/ex084.py
mpaullos/cursoemvideo-python
80732626b6b5471ec7fea6dc01d83931e5cfd8fb
[ "MIT" ]
null
null
null
Exercicios/Mundo3/ex084.py
mpaullos/cursoemvideo-python
80732626b6b5471ec7fea6dc01d83931e5cfd8fb
[ "MIT" ]
null
null
null
Exercicios/Mundo3/ex084.py
mpaullos/cursoemvideo-python
80732626b6b5471ec7fea6dc01d83931e5cfd8fb
[ "MIT" ]
null
null
null
dados = [] princ = [] cont = 0 maior = menor = 0 while True: dados.append(str(input('Nome: '))) dados.append(float(input('Peso: '))) if len(princ) == 0: maior = menor = dados[1] else: if dados[1] > maior: maior = dados[1] elif dados[1] < menor: menor = dad...
25.5625
75
0.528117
dados = [] princ = [] cont = 0 maior = menor = 0 while True: dados.append(str(input('Nome: '))) dados.append(float(input('Peso: '))) if len(princ) == 0: maior = menor = dados[1] else: if dados[1] > maior: maior = dados[1] elif dados[1] < menor: menor = dad...
true
true
f73949d895bf356db60717b2874389246406e0d9
600
py
Python
src/db/schema/literature/models.py
josiahfmccoy/scholasterion
2d547bc56b47a46448a4f1e5b83eb56e15310926
[ "Apache-2.0" ]
null
null
null
src/db/schema/literature/models.py
josiahfmccoy/scholasterion
2d547bc56b47a46448a4f1e5b83eb56e15310926
[ "Apache-2.0" ]
null
null
null
src/db/schema/literature/models.py
josiahfmccoy/scholasterion
2d547bc56b47a46448a4f1e5b83eb56e15310926
[ "Apache-2.0" ]
null
null
null
import sqlalchemy as sa from ..utils.base import Model __all__ = [ 'Document' ] class Document(Model): title = sa.Column(sa.Unicode(255), nullable=False) author = sa.Column(sa.Unicode()) file_url = sa.Column(sa.Unicode(), nullable=False, unique=True) language_id = sa.Column( sa.Integer...
23.076923
73
0.646667
import sqlalchemy as sa from ..utils.base import Model __all__ = [ 'Document' ] class Document(Model): title = sa.Column(sa.Unicode(255), nullable=False) author = sa.Column(sa.Unicode()) file_url = sa.Column(sa.Unicode(), nullable=False, unique=True) language_id = sa.Column( sa.Integer...
true
true
f7394aaad54bf63f14969b2eb9f46f337ab2d5a6
166
py
Python
tests/chdir_relpath_test/testme.py
usnistgov/CDE
05137888a8ad67b0796814170ba61deef51bec03
[ "BSD-3-Clause" ]
4
2020-07-28T19:11:07.000Z
2021-09-24T07:00:39.000Z
tests/chdir_relpath_test/testme.py
usnistgov/CDE
05137888a8ad67b0796814170ba61deef51bec03
[ "BSD-3-Clause" ]
null
null
null
tests/chdir_relpath_test/testme.py
usnistgov/CDE
05137888a8ad67b0796814170ba61deef51bec03
[ "BSD-3-Clause" ]
2
2021-05-13T18:32:27.000Z
2021-11-15T09:07:33.000Z
import sys sys.path.insert(0, '..') from cde_test_common import * def checker_func(): pass generic_test_runner(["python", "chdir_relpath_test.py"], checker_func)
18.444444
70
0.746988
import sys sys.path.insert(0, '..') from cde_test_common import * def checker_func(): pass generic_test_runner(["python", "chdir_relpath_test.py"], checker_func)
true
true
f7394bd50a6ecdda18539d0fcb55a95a6494094b
474
py
Python
examples/cartesian_grid.py
volpatto/py-pde
770183562235179914b2ac67c6236a9f38bb98ea
[ "MIT" ]
null
null
null
examples/cartesian_grid.py
volpatto/py-pde
770183562235179914b2ac67c6236a9f38bb98ea
[ "MIT" ]
null
null
null
examples/cartesian_grid.py
volpatto/py-pde
770183562235179914b2ac67c6236a9f38bb98ea
[ "MIT" ]
null
null
null
""" Diffusion on a Cartesian grid ============================= This example shows how to solve the diffusion equation on a Cartesian grid. """ from pde import CartesianGrid, DiffusionPDE, ScalarField grid = CartesianGrid([[-1, 1], [0, 2]], [30, 16]) # generate grid state = ScalarField(grid) # generate initial con...
27.882353
75
0.672996
from pde import CartesianGrid, DiffusionPDE, ScalarField grid = CartesianGrid([[-1, 1], [0, 2]], [30, 16]) state = ScalarField(grid) state.add_interpolated([0, 1], 1) eq = DiffusionPDE(0.1) result = eq.solve(state, t_range=1, dt=0.01) result.plot(cmap="magma")
true
true
f7394d3e95657096c4d52dfcafc1abb1999c540b
172
py
Python
Day 2/day2-start.py
vmprk/100-Days-of-Code---The-Complete-Python-Pro-Bootcamp
cc9a9a71e4ac62ce6eda3eaae13b1d22611fd085
[ "MIT" ]
null
null
null
Day 2/day2-start.py
vmprk/100-Days-of-Code---The-Complete-Python-Pro-Bootcamp
cc9a9a71e4ac62ce6eda3eaae13b1d22611fd085
[ "MIT" ]
null
null
null
Day 2/day2-start.py
vmprk/100-Days-of-Code---The-Complete-Python-Pro-Bootcamp
cc9a9a71e4ac62ce6eda3eaae13b1d22611fd085
[ "MIT" ]
null
null
null
#Data Types #String print("Hello"[4]) "123" # this is actually a string not a number print("123" + "345") #integer print(123+345) #Float 3.14159 #Boolean True False
8.6
46
0.674419
print("Hello"[4]) print("123" + "345") print(123+345) 3.14159 True False
true
true
f7394d768376d4217139c500e904bf15c76e47a7
1,232
py
Python
bitbots_head_behavior/src/bitbots_head_behavior/actions/track_post.py
Wangxinhui-bot/bitbots_behavior
7c6c5e3cba533fe06cb92083ed1bd45b5b6bc2fc
[ "MIT" ]
null
null
null
bitbots_head_behavior/src/bitbots_head_behavior/actions/track_post.py
Wangxinhui-bot/bitbots_behavior
7c6c5e3cba533fe06cb92083ed1bd45b5b6bc2fc
[ "MIT" ]
null
null
null
bitbots_head_behavior/src/bitbots_head_behavior/actions/track_post.py
Wangxinhui-bot/bitbots_behavior
7c6c5e3cba533fe06cb92083ed1bd45b5b6bc2fc
[ "MIT" ]
1
2020-07-12T12:58:07.000Z
2020-07-12T12:58:07.000Z
import rospy from geometry_msgs.msg import PointStamped from bitbots_head_behavior.actions.look_at import AbstractLookAt class TrackPost(AbstractLookAt): """ This action follows the seen post so that the camera always points towards it. We try to do this so that the post doesnt get lost as easily """...
39.741935
101
0.734578
import rospy from geometry_msgs.msg import PointStamped from bitbots_head_behavior.actions.look_at import AbstractLookAt class TrackPost(AbstractLookAt): def __init__(self, dsd, blackboard, parameters=None): super(TrackPost, self).__init__(dsd, blackboard, parameters) self.ball_tracking_min_pan_...
true
true
f7394d7f4e15ee910ea725c70f43bd24a29bff59
638
py
Python
niescraper/alarm.py
elKei24/niescraper
d26c2b6df7f1fa29633d6356023802e41c38721c
[ "MIT" ]
null
null
null
niescraper/alarm.py
elKei24/niescraper
d26c2b6df7f1fa29633d6356023802e41c38721c
[ "MIT" ]
null
null
null
niescraper/alarm.py
elKei24/niescraper
d26c2b6df7f1fa29633d6356023802e41c38721c
[ "MIT" ]
null
null
null
import asyncio import importlib.resources import aioconsole from playsound import playsound import niescraper.resources async def play_alarm(): with importlib.resources.path(niescraper.resources, 'alarm.mp3') as alarm_file: while asyncio.get_running_loop().is_running(): playsound(alarm_file,...
25.52
83
0.749216
import asyncio import importlib.resources import aioconsole from playsound import playsound import niescraper.resources async def play_alarm(): with importlib.resources.path(niescraper.resources, 'alarm.mp3') as alarm_file: while asyncio.get_running_loop().is_running(): playsound(alarm_file,...
true
true
f7394da9f7a0df8bc20c66cbb9def9d7a59b5ded
1,649
py
Python
Decision Tree - Churn.py
karthiksekaran/mlprojects
a16a4adb20e559b54a78f4e6fd26da520b5ea851
[ "BSD-3-Clause" ]
null
null
null
Decision Tree - Churn.py
karthiksekaran/mlprojects
a16a4adb20e559b54a78f4e6fd26da520b5ea851
[ "BSD-3-Clause" ]
null
null
null
Decision Tree - Churn.py
karthiksekaran/mlprojects
a16a4adb20e559b54a78f4e6fd26da520b5ea851
[ "BSD-3-Clause" ]
null
null
null
#import modules import pandas # for dataframes import matplotlib.pyplot as plt # for plotting graphs import seaborn as sns # for plotting graphs data=pandas.read_csv('HR_comma_sep.csv') # Import LabelEncoder from sklearn import preprocessing #creating labelEncoder le = preprocessing.LabelEncoder() # Conve...
36.644444
119
0.770164
import pandas import matplotlib.pyplot as plt import seaborn as sns data=pandas.read_csv('HR_comma_sep.csv') from sklearn import preprocessing le = preprocessing.LabelEncoder() data['salary']=le.fit_transform(data['salary']) data['Departments ']=le.fit_transform(data['Departments ']) X=data[['satisf...
true
true
f7394ef7ea9d4421174a98f8cd8ce6ef9d2fe40e
299
py
Python
src/main.py
AkitoArai709/RaspiWebStreamingDetectSleepiness
3d052bb0f898a205efce8459ab191a925c243882
[ "MIT" ]
1
2021-05-22T18:14:34.000Z
2021-05-22T18:14:34.000Z
src/main.py
AkitoArai709/RaspiWebStreamingDetectSleepiness
3d052bb0f898a205efce8459ab191a925c243882
[ "MIT" ]
null
null
null
src/main.py
AkitoArai709/RaspiWebStreamingDetectSleepiness
3d052bb0f898a205efce8459ab191a925c243882
[ "MIT" ]
null
null
null
#!/usr/bin/env python """ main.py Summay: RaspberryPi camera streaming application. """ from webStreamingApp import webStreaming def main(): webStreamingApp = webStreaming() webStreamingApp.run(host='0.0.0.0', threaded=True, debug=True) if __name__ == '__main__': main()
21.357143
66
0.682274
from webStreamingApp import webStreaming def main(): webStreamingApp = webStreaming() webStreamingApp.run(host='0.0.0.0', threaded=True, debug=True) if __name__ == '__main__': main()
true
true
f7394f4dc711ac20c52c4d4ccb63dd06379bc889
9,919
py
Python
scan.py
solvebio/bucket-antivirus-function
2e44d2d37446d91e59e59ac95127bf99b05ca5f3
[ "Apache-2.0" ]
null
null
null
scan.py
solvebio/bucket-antivirus-function
2e44d2d37446d91e59e59ac95127bf99b05ca5f3
[ "Apache-2.0" ]
null
null
null
scan.py
solvebio/bucket-antivirus-function
2e44d2d37446d91e59e59ac95127bf99b05ca5f3
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- # Upside Travel, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
34.803509
100
0.694324
import copy import json import os from urllib.parse import unquote_plus from distutils.util import strtobool import boto3 import clamav import metrics from common import AV_DEFINITION_S3_BUCKET from common import AV_DEFINITION_S3_PREFIX from common import AV_DELETE_INFECTED_FILES from common import AV_...
true
true
f7394f70292d3b498534882d9c26dca23112a9e5
1,675
py
Python
redate.py
silshack/semmer2018
a3a19c202cb9d6d67dc3df515f9f0940b27f13fb
[ "CC-BY-2.0" ]
1
2018-08-08T14:03:55.000Z
2018-08-08T14:03:55.000Z
redate.py
silshack/semmer2018
a3a19c202cb9d6d67dc3df515f9f0940b27f13fb
[ "CC-BY-2.0" ]
42
2018-05-17T23:46:32.000Z
2018-06-18T23:04:31.000Z
redate.py
silshack/semmer2018
a3a19c202cb9d6d67dc3df515f9f0940b27f13fb
[ "CC-BY-2.0" ]
10
2018-05-17T19:56:37.000Z
2018-05-21T15:33:42.000Z
import os, re from pick import Picker, pick from collections import defaultdict folder = input("Enter a folder to redate: ") post_dates = [] post_dict = defaultdict(list) for folderName, subfolders, filenames in os.walk(folder): print('Found {0} posts in '.format(len(filenames)) + folderName) for filename in f...
38.953488
166
0.595224
import os, re from pick import Picker, pick from collections import defaultdict folder = input("Enter a folder to redate: ") post_dates = [] post_dict = defaultdict(list) for folderName, subfolders, filenames in os.walk(folder): print('Found {0} posts in '.format(len(filenames)) + folderName) for filename in f...
true
true
f7395006657ee30aa4014242b791645c235a6cd5
1,822
py
Python
pontoon/base/migrations/0075_create_project_locale_translators_groups.py
udacity/pontoon
e15a03a0c987615385b2a8c537bb18c99567f77e
[ "BSD-3-Clause" ]
1
2018-12-24T11:15:35.000Z
2018-12-24T11:15:35.000Z
pontoon/base/migrations/0075_create_project_locale_translators_groups.py
udacity/pontoon
e15a03a0c987615385b2a8c537bb18c99567f77e
[ "BSD-3-Clause" ]
795
2017-11-02T12:26:10.000Z
2020-06-01T13:34:22.000Z
pontoon/base/migrations/0075_create_project_locale_translators_groups.py
udacity/pontoon
e15a03a0c987615385b2a8c537bb18c99567f77e
[ "BSD-3-Clause" ]
1
2019-10-07T17:46:36.000Z
2019-10-07T17:46:36.000Z
# -*- coding: utf-8 -*- # Generated by Django 1.9.10 on 2016-12-12 13:23 from __future__ import unicode_literals from django.db import migrations def create_project_locale_groups(apps, schema_editor): """Create translators groups for every project locale object.""" Group = apps.get_model('auth', 'Group') ...
35.038462
115
0.721186
from __future__ import unicode_literals from django.db import migrations def create_project_locale_groups(apps, schema_editor): Group = apps.get_model('auth', 'Group') Permission = apps.get_model('auth', 'Permission') ProjectLocale = apps.get_model('base', 'ProjectLocale') ContentType = apps.get_mo...
true
true
f7395075e10d0e8b627a2eec0679cda1e8d19922
759
py
Python
python/python_class_2019/1.7.py
xmmmmmovo/BaseNotes
aa895c15e47d2f344ffcc48798d094a8ca942a79
[ "MIT" ]
2
2019-06-06T21:09:44.000Z
2019-09-23T05:00:27.000Z
python/python_class_2019/1.7.py
xmmmmmovo/notes
3f51cdac402f1ce31ea75fe897d77159f75dc9aa
[ "MIT" ]
13
2020-11-12T14:35:34.000Z
2022-02-27T09:25:06.000Z
python/python_class_2019/1.7.py
xmmmmmovo/BaseNotes
aa895c15e47d2f344ffcc48798d094a8ca942a79
[ "MIT" ]
null
null
null
def fun(num): n = [[0 for i in range(num)] for i in range(num)] k = 1 for i in range(0, int(num/2) + 1): for j in range(i, num - 1 - i): n[j][i] = k k +=1 for j in range(i, num - 1 - i): n[num - 1 - i][j] = k k+=1 for j in range(num - ...
25.3
53
0.389987
def fun(num): n = [[0 for i in range(num)] for i in range(num)] k = 1 for i in range(0, int(num/2) + 1): for j in range(i, num - 1 - i): n[j][i] = k k +=1 for j in range(i, num - 1 - i): n[num - 1 - i][j] = k k+=1 for j in range(num - ...
true
true
f739512f00ae875ce21a546db13e83ce8fca38b0
11,742
py
Python
certbot/tests/plugins/disco_test.py
RConn12/certbot
34b568f36648dd5c4103c3a444e81b5662e6be81
[ "Apache-2.0" ]
null
null
null
certbot/tests/plugins/disco_test.py
RConn12/certbot
34b568f36648dd5c4103c3a444e81b5662e6be81
[ "Apache-2.0" ]
null
null
null
certbot/tests/plugins/disco_test.py
RConn12/certbot
34b568f36648dd5c4103c3a444e81b5662e6be81
[ "Apache-2.0" ]
null
null
null
"""Tests for certbot._internal.plugins.disco.""" import functools import string import unittest import mock import pkg_resources import six import zope.interface from acme.magic_typing import List # pylint: disable=unused-import, no-name-in-module from certbot import errors from certbot import interfaces from certb...
40.075085
86
0.664367
import functools import string import unittest import mock import pkg_resources import six import zope.interface from acme.magic_typing import List from certbot import errors from certbot import interfaces from certbot._internal.plugins import standalone from certbot._internal.plugins import webroot EP_SA = pkg_r...
true
true