hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5a2fe7c90dfafdbdc9d71c16ab670854280a79f1 | 222 | py | Python | HyperclassifierSearch/__init__.py | dabln/HyperclassifierSearch | 21eddc3ccd27f753f4ae75690a6ab5bc8d8ae1a0 | [
"MIT"
] | 1 | 2021-07-22T12:42:00.000Z | 2021-07-22T12:42:00.000Z | HyperclassifierSearch/__init__.py | dabln/HyperclassifierSearch | 21eddc3ccd27f753f4ae75690a6ab5bc8d8ae1a0 | [
"MIT"
] | null | null | null | HyperclassifierSearch/__init__.py | dabln/HyperclassifierSearch | 21eddc3ccd27f753f4ae75690a6ab5bc8d8ae1a0 | [
"MIT"
] | 2 | 2021-04-25T06:41:52.000Z | 2021-07-22T12:42:23.000Z | from .HyperclassifierSearch import HyperclassifierSearch
# module level doc-string
__doc__ = """
HyperclassifierSearch allows to train multiple classifiers/pipelines in Python with GridSearchCV or RandomizedSearchCV.
"""
| 31.714286 | 119 | 0.833333 | from .HyperclassifierSearch import HyperclassifierSearch
# module level doc-string
__doc__ = """
HyperclassifierSearch allows to train multiple classifiers/pipelines in Python with GridSearchCV or RandomizedSearchCV.
"""
| 0 | 0 | 0 |
077421c3ff3c2cf7a915a0ef017e63b82b626136 | 6,639 | py | Python | muscle_parser.py | aikkala/dog_skeletal_muscles | 5219092b614525ba03c6a73636b7b6c6fd7bb466 | [
"MIT"
] | null | null | null | muscle_parser.py | aikkala/dog_skeletal_muscles | 5219092b614525ba03c6a73636b7b6c6fd7bb466 | [
"MIT"
] | null | null | null | muscle_parser.py | aikkala/dog_skeletal_muscles | 5219092b614525ba03c6a73636b7b6c6fd7bb466 | [
"MIT"
] | null | null | null | from lxml import etree
from dm_control.utils import xml_tools
from stl import mesh
import numpy as np
from scipy.spatial.transform import Rotation as R
from copy import deepcopy
import os
import sys
import csv
from tendon_routing import configs, reserve
if __name__ == "__main__":
main(*sys.argv[1:])
| 31.169014 | 118 | 0.663202 | from lxml import etree
from dm_control.utils import xml_tools
from stl import mesh
import numpy as np
from scipy.spatial.transform import Rotation as R
from copy import deepcopy
import os
import sys
import csv
from tendon_routing import configs, reserve
def array_to_string(array):
return ' '.join(['%8g' % num for ... | 6,236 | 0 | 92 |
0d73aead4b24de007852eb50f0d23f64708bd034 | 2,846 | py | Python | Taskwarrior2Evernote.py | abdul-rehman0/Taskwarrior2Evernote | 60f7e347250f32d45492984a9dcaeb26746a9915 | [
"MIT"
] | 2 | 2019-01-12T11:08:19.000Z | 2019-03-09T13:07:29.000Z | Taskwarrior2Evernote.py | abdul-rehman0/Taskwarrior2Evernote | 60f7e347250f32d45492984a9dcaeb26746a9915 | [
"MIT"
] | null | null | null | Taskwarrior2Evernote.py | abdul-rehman0/Taskwarrior2Evernote | 60f7e347250f32d45492984a9dcaeb26746a9915 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: UTF-8 -*-
import re
import sys, getopt
import glob
import os
import json
if __name__ == "__main__":
main(sys.argv[1:])
| 29.957895 | 119 | 0.621574 | #!/usr/bin/python3
# -*- coding: UTF-8 -*-
import re
import sys, getopt
import glob
import os
import json
def process_files(inputfile, outputdir):
enex_notes = []
output_filename = 'json2Evernote.enex'
with open(inputfile) as f:
data = json.load(f)
for entry in data:
print(ent... | 2,495 | 0 | 184 |
a77d93aebb45cb65887e58e9f880720593b671df | 3,829 | py | Python | analysis/webservice/algorithms/doms/scatterplot.py | ngachung/incubator-sdap-nexus | 38e768694fcc142e2d88283cb1e44e05f88da847 | [
"Apache-2.0"
] | 17 | 2017-11-16T07:36:33.000Z | 2021-11-07T00:02:20.000Z | analysis/webservice/algorithms/doms/scatterplot.py | ngachung/incubator-sdap-nexus | 38e768694fcc142e2d88283cb1e44e05f88da847 | [
"Apache-2.0"
] | 35 | 2018-01-11T00:50:20.000Z | 2022-03-17T23:08:07.000Z | analysis/webservice/algorithms/doms/scatterplot.py | ngachung/incubator-sdap-nexus | 38e768694fcc142e2d88283cb1e44e05f88da847 | [
"Apache-2.0"
] | 25 | 2017-11-16T07:36:38.000Z | 2022-02-03T20:48:46.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 use ... | 33.008621 | 118 | 0.651867 | # 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 use ... | 2,436 | 47 | 169 |
9fbe4a8dff39254e88d8ab4a57acb48ba811bf43 | 3,109 | py | Python | tests/test_operator_validation.py | joocer/newidydd | cdf56bb4890f3df7f46b52e34dc9772d2bcfe22c | [
"Apache-2.0"
] | null | null | null | tests/test_operator_validation.py | joocer/newidydd | cdf56bb4890f3df7f46b52e34dc9772d2bcfe22c | [
"Apache-2.0"
] | null | null | null | tests/test_operator_validation.py | joocer/newidydd | cdf56bb4890f3df7f46b52e34dc9772d2bcfe22c | [
"Apache-2.0"
] | 2 | 2020-11-25T15:05:19.000Z | 2020-11-27T15:02:29.000Z | """
Validator test cases
1) Valid schema and data
2) Valid schema, invalid string
3) Valid schema, invalid number
4) Invalid schema, no data
"""
import os
import sys
sys.path.insert(1, os.path.join(sys.path[0], '..'))
import newidydd
test_operator_validator_case_one()
test_operator_validator_case_two()
tes... | 34.164835 | 95 | 0.660019 | """
Validator test cases
1) Valid schema and data
2) Valid schema, invalid string
3) Valid schema, invalid number
4) Invalid schema, no data
"""
import os
import sys
sys.path.insert(1, os.path.join(sys.path[0], '..'))
import newidydd
def test_operator_validator_case_one():
# CASE ONE = ALL VALID VALUES
CASE... | 2,569 | 0 | 115 |
5bd7f9603e5bb7544e6ed950717f39d40c79b5fa | 936 | py | Python | conanfile.py | sanblch/binaryen | 812485ce0083a11b6392bf0d839c940da79b7a4b | [
"Apache-2.0"
] | null | null | null | conanfile.py | sanblch/binaryen | 812485ce0083a11b6392bf0d839c940da79b7a4b | [
"Apache-2.0"
] | null | null | null | conanfile.py | sanblch/binaryen | 812485ce0083a11b6392bf0d839c940da79b7a4b | [
"Apache-2.0"
] | null | null | null | from conans import ConanFile, CMake, tools
| 32.275862 | 131 | 0.669872 | from conans import ConanFile, CMake, tools
class BinaryenConan(ConanFile):
name = "binaryen"
version = "version_101"
license = "Apache-2.0"
url = "https://github.com/WebAssembly/binaryen"
description = "Cross-platform numerical analysis and data processing library"
settings = "os", "compiler", ... | 390 | 480 | 23 |
890b3383ba3b8e7bf8426b9af679f7297d6ae2e7 | 2,911 | py | Python | pyedgeconnect/orch/_rbac_assignment.py | SPOpenSource/edgeconnect-python | 158aad220f8cacfa029df41b0ac2a37f7dac943f | [
"MIT"
] | 15 | 2021-07-02T17:09:13.000Z | 2022-02-08T17:06:51.000Z | pyedgeconnect/orch/_rbac_assignment.py | SPOpenSource/edgeconnect-python | 158aad220f8cacfa029df41b0ac2a37f7dac943f | [
"MIT"
] | null | null | null | pyedgeconnect/orch/_rbac_assignment.py | SPOpenSource/edgeconnect-python | 158aad220f8cacfa029df41b0ac2a37f7dac943f | [
"MIT"
] | 4 | 2021-07-16T00:05:24.000Z | 2022-03-26T02:04:17.000Z | # MIT License
# (C) Copyright 2021 Hewlett Packard Enterprise Development LP.
#
# rbacAssignment : RBAC: Get, Add, Update, Delete assignments
def get_rbac_assignments(self) -> dict:
"""Get all rbac assignments
.. list-table::
:header-rows: 1
* - Swagger Section
- Method
-... | 24.057851 | 76 | 0.59361 | # MIT License
# (C) Copyright 2021 Hewlett Packard Enterprise Development LP.
#
# rbacAssignment : RBAC: Get, Add, Update, Delete assignments
def get_rbac_assignments(self) -> dict:
"""Get all rbac assignments
.. list-table::
:header-rows: 1
* - Swagger Section
- Method
-... | 0 | 0 | 0 |
8d8c81d5c7f1a88edfec459fd8443a7e1e173ff0 | 679 | py | Python | src/ebonite/utils/fs.py | zyfra/ebonite | b01b662c43709d152940f488574d78ff25f89ecf | [
"Apache-2.0"
] | 270 | 2019-11-14T15:46:08.000Z | 2021-09-17T16:43:03.000Z | src/ebonite/utils/fs.py | leepand/ebonite | b01b662c43709d152940f488574d78ff25f89ecf | [
"Apache-2.0"
] | 14 | 2019-11-29T11:49:39.000Z | 2022-02-10T00:23:59.000Z | src/ebonite/utils/fs.py | leepand/ebonite | b01b662c43709d152940f488574d78ff25f89ecf | [
"Apache-2.0"
] | 18 | 2019-11-22T13:15:14.000Z | 2021-09-01T13:36:12.000Z | import contextlib
import inspect
import os
@contextlib.contextmanager
def switch_curdir(path):
"""Context manager to temproary switch current dir"""
prev_path = os.path.abspath('.')
try:
try:
os.chdir(path)
except FileNotFoundError:
pass
yield
finally:... | 21.903226 | 60 | 0.637703 | import contextlib
import inspect
import os
def get_lib_path(*filename):
path = __file__
for _ in range(len(__name__.split('.')) - 1):
path = os.path.dirname(path)
return os.path.join(path, *filename)
def current_module_path(*path):
stack = inspect.stack()
caller_path = stack[1][1]
re... | 284 | 0 | 46 |
af8646a4b28aecad499257f47c0c1e2a9d7259c1 | 4,755 | py | Python | Lydienne/cowsay_conversation/apotheek.py | ArtezGDA/text-IO | b9ed7f2433c0eda08fb45d125ea22a5fdeaef667 | [
"MIT"
] | null | null | null | Lydienne/cowsay_conversation/apotheek.py | ArtezGDA/text-IO | b9ed7f2433c0eda08fb45d125ea22a5fdeaef667 | [
"MIT"
] | null | null | null | Lydienne/cowsay_conversation/apotheek.py | ArtezGDA/text-IO | b9ed7f2433c0eda08fb45d125ea22a5fdeaef667 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
import subprocess
word="Apotheek"
stdout, stderr = subprocess.Popen(
['cowsay', word]).communicate()
word="Is dat alles?"
stdout, stderr = subprocess.Popen(
['cowsay', '-f', 'vader-koala', word]).communicate()
word="Ja. Mevrouw, mag ... | 42.455357 | 187 | 0.626078 | #!/usr/bin/env python
# encoding: utf-8
import subprocess
word="Apotheek"
stdout, stderr = subprocess.Popen(
['cowsay', word]).communicate()
word="Is dat alles?"
stdout, stderr = subprocess.Popen(
['cowsay', '-f', 'vader-koala', word]).communicate()
word="Ja. Mevrouw, mag ... | 0 | 0 | 0 |
8e3967cb946440580fe7fbcc24ca2a17968b4691 | 1,875 | py | Python | app/modules/util/crypto.py | JohJohan/silverback | e27bc5d238d2b34955a470a8e8327ae44022b78b | [
"Apache-2.0"
] | 44 | 2019-06-25T02:06:09.000Z | 2022-02-13T00:06:52.000Z | app/modules/util/crypto.py | JohJohan/silverback | e27bc5d238d2b34955a470a8e8327ae44022b78b | [
"Apache-2.0"
] | 114 | 2019-06-25T21:30:22.000Z | 2022-03-26T14:11:42.000Z | app/modules/util/crypto.py | JohJohan/silverback | e27bc5d238d2b34955a470a8e8327ae44022b78b | [
"Apache-2.0"
] | 11 | 2019-09-27T09:09:40.000Z | 2020-01-26T03:18:01.000Z | # Copyright 2019 Silverbackhq
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 38.265306 | 132 | 0.731733 | # Copyright 2019 Silverbackhq
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 993 | -6 | 131 |
ccb7cc5f44a3680a64b4e44d20e2fd63b452e682 | 462 | py | Python | Line Them Up/lineup.py | nithinmanne/kattis | 70cb32fb8c1010168b8a4101bd73bd74db2a087d | [
"BSD-3-Clause"
] | null | null | null | Line Them Up/lineup.py | nithinmanne/kattis | 70cb32fb8c1010168b8a4101bd73bd74db2a087d | [
"BSD-3-Clause"
] | null | null | null | Line Them Up/lineup.py | nithinmanne/kattis | 70cb32fb8c1010168b8a4101bd73bd74db2a087d | [
"BSD-3-Clause"
] | null | null | null | n = int(input())
inp = []
inp.append(input())
inp.append(input())
if inp[0] < inp[1]: order = 0
else: order = 1
flag = 0
for i in range(n-2):
j = input()
if order == 0:
if inp[i+1] > j:
flag = 1
break
else:
if inp[i+1] < j:
flag = 1
... | 18.48 | 30 | 0.454545 | n = int(input())
inp = []
inp.append(input())
inp.append(input())
if inp[0] < inp[1]: order = 0
else: order = 1
flag = 0
for i in range(n-2):
j = input()
if order == 0:
if inp[i+1] > j:
flag = 1
break
else:
if inp[i+1] < j:
flag = 1
... | 0 | 0 | 0 |
e849bb026f723f81313b8b2cece29ada71c6cb9d | 19,494 | py | Python | idax/idaxRestClient.py | idax-exchange/python-idax | e9458ced3af1b13197f6555108f595140302a8f3 | [
"MIT"
] | null | null | null | idax/idaxRestClient.py | idax-exchange/python-idax | e9458ced3af1b13197f6555108f595140302a8f3 | [
"MIT"
] | null | null | null | idax/idaxRestClient.py | idax-exchange/python-idax | e9458ced3af1b13197f6555108f595140302a8f3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
"""
@author: jension
@license: Node Supply Chain Manager Corporation Limited.
@contact: 1490290160@qq.com
@software: garner
@file: idaxRestClient.py
@time: 2019/3/25 17:42
@desc:
"""
import requests
import hashlib
import hmac
import idax.idaxConst as idaxConst
"""idax rest Requ... | 36.850662 | 185 | 0.487637 | #!/usr/bin/env python
# encoding: utf-8
"""
@author: jension
@license: Node Supply Chain Manager Corporation Limited.
@contact: 1490290160@qq.com
@software: garner
@file: idaxRestClient.py
@time: 2019/3/25 17:42
@desc:
"""
import requests
import hashlib
import hmac
import idax.idaxConst as idaxConst
"""idax rest Requ... | 1,272 | 17,866 | 23 |
1932995971f0bd82d4dd39538eeae28c4e110440 | 1,380 | py | Python | exercism/python/guidos-gorgeous-lasagna/lasagna.py | stefanjarina/exercises | 4c1bca398dad2b6258807b1f8b25e449cf208376 | [
"MIT"
] | null | null | null | exercism/python/guidos-gorgeous-lasagna/lasagna.py | stefanjarina/exercises | 4c1bca398dad2b6258807b1f8b25e449cf208376 | [
"MIT"
] | null | null | null | exercism/python/guidos-gorgeous-lasagna/lasagna.py | stefanjarina/exercises | 4c1bca398dad2b6258807b1f8b25e449cf208376 | [
"MIT"
] | null | null | null | EXPECTED_BAKE_TIME = 40
PREPARATION_TIME = 2
def bake_time_remaining(elapsed_bake_time):
"""Calculate the bake time remaining.
:param elapsed_bake_time: int baking time already elapsed.
:return: int remaining bake time derived from 'EXPECTED_BAKE_TIME'.
Function that takes the actual minutes the las... | 33.658537 | 83 | 0.763768 | EXPECTED_BAKE_TIME = 40
PREPARATION_TIME = 2
def bake_time_remaining(elapsed_bake_time):
"""Calculate the bake time remaining.
:param elapsed_bake_time: int baking time already elapsed.
:return: int remaining bake time derived from 'EXPECTED_BAKE_TIME'.
Function that takes the actual minutes the las... | 0 | 0 | 0 |
f91b7dc3b70438989789269524f866903762a53f | 2,157 | py | Python | preprocess.py | nitesh4146/bumblebee | 808261c44c0a5470fc0e969c2fda7c2a3fd2088e | [
"MIT"
] | null | null | null | preprocess.py | nitesh4146/bumblebee | 808261c44c0a5470fc0e969c2fda7c2a3fd2088e | [
"MIT"
] | null | null | null | preprocess.py | nitesh4146/bumblebee | 808261c44c0a5470fc0e969c2fda7c2a3fd2088e | [
"MIT"
] | null | null | null | import pandas as pd
import cv2
import numpy as np
import random
import matplotlib.pyplot as plt
# crop_scale(cv2.imread("/home/slickmind/lanefollowing/ros2_ws/src/lane_following/bumblebee/images/center-2021-05-05T19:45:42.285457.jpg"))
| 25.987952 | 139 | 0.641168 | import pandas as pd
import cv2
import numpy as np
import random
import matplotlib.pyplot as plt
def crop_scale(img):
sky_crop = 530
hood_crop = 900
left_crop = 300
right_crop = 1600
processed_img = img[sky_crop:hood_crop, left_crop:right_crop, :]
# processed_img = rescale(processed_img)... | 1,823 | 0 | 92 |
7b4127a6df040f941c556057c975deba7b34b24f | 776 | py | Python | web_system/src/engine/extractor/feature_extraction/specBandwidth.py | christian-westbrook/OMEN | 292a835c8b4ef6d8a42596b2bdc0d6b4f3f8d277 | [
"MIT"
] | 1 | 2020-04-14T17:08:44.000Z | 2020-04-14T17:08:44.000Z | web_system/src/engine/extractor/feature_extraction/specBandwidth.py | christian-westbrook/omen | 292a835c8b4ef6d8a42596b2bdc0d6b4f3f8d277 | [
"MIT"
] | 16 | 2020-04-13T20:32:50.000Z | 2020-05-06T04:42:22.000Z | web_system/src/engine/extractor/feature_extraction/specBandwidth.py | christian-westbrook/OMEN | 292a835c8b4ef6d8a42596b2bdc0d6b4f3f8d277 | [
"MIT"
] | null | null | null | ## Extract the Spectral Bandwidth from an audio file
from librosa.feature import spectral_bandwidth
from librosa.util import example_audio_file
import numpy as np
import librosa
## Extraction function
## If this file is run stand-alone, test the extraction against the example audio file
if __name__ == "__main__":
... | 48.5 | 198 | 0.773196 | ## Extract the Spectral Bandwidth from an audio file
from librosa.feature import spectral_bandwidth
from librosa.util import example_audio_file
import numpy as np
import librosa
## Extraction function
def specBandwidth(audioFile, sr=22050, S=None, n_fft=2048, hop_length=512, win_length=None, window='hann', center=Tru... | 349 | 0 | 22 |
3d05138f400179a74e3b07c79a0cdbf2f82a3084 | 12,415 | py | Python | tests/python3.8/boto_tests/test_credentials.py | asvetlov/aiobotocore | e4ea0edfc11951deb9f3593d24238132ea1a1e2f | [
"Apache-2.0"
] | null | null | null | tests/python3.8/boto_tests/test_credentials.py | asvetlov/aiobotocore | e4ea0edfc11951deb9f3593d24238132ea1a1e2f | [
"Apache-2.0"
] | null | null | null | tests/python3.8/boto_tests/test_credentials.py | asvetlov/aiobotocore | e4ea0edfc11951deb9f3593d24238132ea1a1e2f | [
"Apache-2.0"
] | null | null | null | import asyncio
from datetime import datetime, timedelta
from unittest import mock
import json
import subprocess
import botocore.exceptions
import pytest
from dateutil.tz import tzlocal
from aiobotocore.session import AioSession
from aiobotocore import credentials
from tests.boto_tests.test_credentials import full_url... | 33.373656 | 86 | 0.684817 | import asyncio
from datetime import datetime, timedelta
from unittest import mock
import json
import subprocess
import botocore.exceptions
import pytest
from dateutil.tz import tzlocal
from aiobotocore.session import AioSession
from aiobotocore import credentials
from tests.boto_tests.test_credentials import full_url... | 10,813 | 0 | 396 |
dc518ae29a49433c256757764698cf700159d991 | 1,137 | py | Python | src/lib/centipede/TemplateProcedure/Standard/Text.py | ramgopal99/centipede | 0b1dc1f17b025f6b37c9a3cf5753a46cbbcd36ba | [
"MIT"
] | 3 | 2018-05-28T20:56:19.000Z | 2018-06-02T15:58:10.000Z | src/lib/centipede/TemplateProcedure/Standard/Text.py | ramgopal99/centipede | 0b1dc1f17b025f6b37c9a3cf5753a46cbbcd36ba | [
"MIT"
] | 2 | 2018-07-01T07:45:38.000Z | 2018-07-11T03:15:35.000Z | src/lib/centipede/TemplateProcedure/Standard/Text.py | ramgopal99/centipede | 0b1dc1f17b025f6b37c9a3cf5753a46cbbcd36ba | [
"MIT"
] | 3 | 2018-07-10T14:51:13.000Z | 2022-03-17T00:39:58.000Z | from ..TemplateProcedure import TemplateProcedure
class _Text(object):
"""
Basic image sequence functions.
"""
@staticmethod
def upper(string):
"""
Return string coverted to upper case.
"""
return str(string).upper()
@staticmethod
def lower(string):
... | 18.95 | 81 | 0.619173 | from ..TemplateProcedure import TemplateProcedure
class _Text(object):
"""
Basic image sequence functions.
"""
@staticmethod
def upper(string):
"""
Return string coverted to upper case.
"""
return str(string).upper()
@staticmethod
def lower(string):
... | 0 | 0 | 0 |
080b51f34bd3ec72cc31933a4907a9e5846ac67a | 687 | py | Python | scripts/SDL_Interface/SDLCreator.py | jasonoscar88/Photon-v2 | 90649196c436261d28cc2300511b78ac88236448 | [
"MIT"
] | 88 | 2017-01-21T18:20:16.000Z | 2021-12-21T02:32:04.000Z | scripts/SDL_Interface/SDLCreator.py | jasonoscar88/Photon-v2 | 90649196c436261d28cc2300511b78ac88236448 | [
"MIT"
] | 72 | 2017-07-28T10:00:35.000Z | 2021-11-09T18:36:23.000Z | scripts/SDL_Interface/SDLCreator.py | jasonoscar88/Photon-v2 | 90649196c436261d28cc2300511b78ac88236448 | [
"MIT"
] | 8 | 2017-03-19T12:19:10.000Z | 2020-05-19T15:15:05.000Z | from SDLInput import SDLInput
import xml.etree.ElementTree as ElementTree
| 20.818182 | 85 | 0.714702 | from SDLInput import SDLInput
import xml.etree.ElementTree as ElementTree
class SDLCreator:
def __init__(self, root_element: ElementTree):
self.inputs = []
intent = root_element.get("intent", "")
self.is_blueprint = intent == "blueprint"
if root_element.tag != "command":
print("warning: invalid SDL cr... | 520 | -4 | 95 |
aca9c4f8c8d50f2255b23ff003cb2be5b15e7571 | 1,029 | py | Python | src/test_evader.py | zacespinosa/homicidal_chauffeur | ad9186171e822d0021f22d5b16a37f76bad531af | [
"MIT"
] | null | null | null | src/test_evader.py | zacespinosa/homicidal_chauffeur | ad9186171e822d0021f22d5b16a37f76bad531af | [
"MIT"
] | null | null | null | src/test_evader.py | zacespinosa/homicidal_chauffeur | ad9186171e822d0021f22d5b16a37f76bad531af | [
"MIT"
] | null | null | null | import random as random
import numpy as np
from dynamics import Simulator, Pursuer, Evader
test_evader()
| 28.583333 | 127 | 0.738581 | import random as random
import numpy as np
from dynamics import Simulator, Pursuer, Evader
def test_evader():
num_d_states = 25
num_phi_states = 20
num_phi_d_states = 20
num_actions = 10
num_states = num_d_states*num_phi_states*num_phi_d_states
num_epochs = 1000
p = Pursuer()
e = Evader(num_d_states, num_phi... | 900 | 0 | 23 |
bd21f342ee7136666f66d6bdf1889589bd736437 | 159 | py | Python | test_examples/run_java.py | Tejas-P-Herle/Python_Language_Converter | f349659a7fcc980d31ddf58f38b35a4aae28561b | [
"MIT"
] | 3 | 2018-05-09T14:06:55.000Z | 2019-04-10T22:53:42.000Z | test_examples/run_java.py | Tejas-P-Herle/PLC | f349659a7fcc980d31ddf58f38b35a4aae28561b | [
"MIT"
] | null | null | null | test_examples/run_java.py | Tejas-P-Herle/PLC | f349659a7fcc980d31ddf58f38b35a4aae28561b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import sys
filename = sys.argv[1]
os.system("javac " + filename)
os.system("java " + os.path.splitext(filename)[0].title())
| 17.666667 | 58 | 0.691824 | #!/usr/bin/env python3
import os
import sys
filename = sys.argv[1]
os.system("javac " + filename)
os.system("java " + os.path.splitext(filename)[0].title())
| 0 | 0 | 0 |
ac6dec34e29b85d31eb190382fd0ebc66ed88bab | 5,030 | py | Python | resources/osm_importer/webots_objects/river.py | yjf18340/webots | 60d441c362031ab8fde120cc0cd97bdb1a31a3d5 | [
"Apache-2.0"
] | 1 | 2019-11-13T08:12:02.000Z | 2019-11-13T08:12:02.000Z | resources/osm_importer/webots_objects/river.py | chinakwy/webots | 7c35a359848bafe81fe0229ac2ed587528f4c73e | [
"Apache-2.0"
] | null | null | null | resources/osm_importer/webots_objects/river.py | chinakwy/webots | 7c35a359848bafe81fe0229ac2ed587528f4c73e | [
"Apache-2.0"
] | 1 | 2020-09-25T02:01:45.000Z | 2020-09-25T02:01:45.000Z | # Copyright 1996-2019 Cyberbotics Ltd.
#
# 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... | 43.73913 | 107 | 0.511531 | # Copyright 1996-2019 Cyberbotics Ltd.
#
# 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... | 0 | 0 | 0 |
aaf59fe79e0d5e1747cc62c645fc38f72b291ef6 | 1,281 | py | Python | tests/test_issues.py | Minhui-Chen/slurm | b5f9dfc34bce70dee96b3c279c36705bf84057bd | [
"MIT"
] | 74 | 2018-01-10T18:38:26.000Z | 2022-03-11T13:28:52.000Z | tests/test_issues.py | Minhui-Chen/slurm | b5f9dfc34bce70dee96b3c279c36705bf84057bd | [
"MIT"
] | 64 | 2018-01-11T10:53:09.000Z | 2022-03-30T14:33:19.000Z | tests/test_issues.py | Minhui-Chen/slurm | b5f9dfc34bce70dee96b3c279c36705bf84057bd | [
"MIT"
] | 46 | 2017-12-18T20:55:27.000Z | 2022-02-18T14:43:40.000Z | #!/usr/bin/env python3
import pytest
import time
import re
import py
@pytest.fixture
@pytest.mark.xfail
def test_issue49(smk_runner, issue49):
"""https://github.com/Snakemake-Profiles/slurm/issues/49
Cancelling a slurm job leaves an incomplete file that causes
Snakemake to incorrectly state that there i... | 31.243902 | 72 | 0.691647 | #!/usr/bin/env python3
import pytest
import time
import re
import py
@pytest.fixture
def issue49(cookie_factory, datafile):
p = datafile("Snakefile_issue49", "Snakefile")
cookie_factory()
d = py.path.local(p.dirname)
config = d.join("slurm").join("config.yaml")
lines = re.sub("restart-times: 3", "r... | 288 | 0 | 22 |
5ce548cebf1b339b811a3080499ed980049e2d1f | 513 | py | Python | check_reactionID.py | NoboruOmichi/AmongUS-discordbot | e3ed115e095db5943192fb9454540c3a89dbdd79 | [
"MIT"
] | null | null | null | check_reactionID.py | NoboruOmichi/AmongUS-discordbot | e3ed115e095db5943192fb9454540c3a89dbdd79 | [
"MIT"
] | null | null | null | check_reactionID.py | NoboruOmichi/AmongUS-discordbot | e3ed115e095db5943192fb9454540c3a89dbdd79 | [
"MIT"
] | null | null | null | import os
import traceback
import discord
import time
import asyncio
import sys
# 自分のBotのアクセストークンに置き換えてください
TOKEN = os.environ['DISCORD_BOT_TOKEN']
intents = discord.Intents.default()
intents.members = True
client = discord.Client(intents=intents)
#ユーザがリアクションをつけた時、対応する役職を付与(生存、幽霊)
@client.event
# Botの起動とDiscordサーバ... | 21.375 | 50 | 0.793372 | import os
import traceback
import discord
import time
import asyncio
import sys
# 自分のBotのアクセストークンに置き換えてください
TOKEN = os.environ['DISCORD_BOT_TOKEN']
intents = discord.Intents.default()
intents.members = True
client = discord.Client(intents=intents)
#ユーザがリアクションをつけた時、対応する役職を付与(生存、幽霊)
@client.event
async def on_reactio... | 148 | 0 | 22 |
f38d1462458d099c7f7ad3de0df641dc140edd9e | 10,443 | py | Python | source/pretrain.py | sanixa/GS-WGAN-custom | 77660d4ba9f0e8ae949d76c29bb1b11d0afd9f96 | [
"MIT"
] | null | null | null | source/pretrain.py | sanixa/GS-WGAN-custom | 77660d4ba9f0e8ae949d76c29bb1b11d0afd9f96 | [
"MIT"
] | null | null | null | source/pretrain.py | sanixa/GS-WGAN-custom | 77660d4ba9f0e8ae949d76c29bb1b11d0afd9f96 | [
"MIT"
] | null | null | null | import os, sys
import numpy as np
import random
import torch
import torch.autograd as autograd
import torch.optim as optim
import torch.utils.data as data
import torchvision.transforms as transforms
import torchvision.datasets as datasets
from torch.utils.data.sampler import SubsetRandomSampler
#from torchsummary impor... | 37.836957 | 118 | 0.544001 | import os, sys
import numpy as np
import random
import torch
import torch.autograd as autograd
import torch.optim as optim
import torch.utils.data as data
import torchvision.transforms as transforms
import torchvision.datasets as datasets
from torch.utils.data.sampler import SubsetRandomSampler
#from torchsummary impor... | 9,674 | 0 | 22 |
4d0c21837a6c38c77bb39310ef15be3df384ad2e | 768 | py | Python | tests/integration/appleraid/AppleRaidSensorDefinitionTest.py | dittert/pyprobe | 1b0d0e403645ed204332c70c8a89e094f860023a | [
"Apache-2.0"
] | null | null | null | tests/integration/appleraid/AppleRaidSensorDefinitionTest.py | dittert/pyprobe | 1b0d0e403645ed204332c70c8a89e094f860023a | [
"Apache-2.0"
] | null | null | null | tests/integration/appleraid/AppleRaidSensorDefinitionTest.py | dittert/pyprobe | 1b0d0e403645ed204332c70c8a89e094f860023a | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
from os import path
import unittest
from pyprobe.sensors.appleraid.sensor_appleraid import AppleRaidSensor
from utils import Platform
__author__ = 'Dirk Dittert'
FAKE_UTIL = path.join(path.dirname(__file__), 'diskutil.py')
| 29.538462 | 70 | 0.709635 | # coding=utf-8
from os import path
import unittest
from pyprobe.sensors.appleraid.sensor_appleraid import AppleRaidSensor
from utils import Platform
__author__ = 'Dirk Dittert'
FAKE_UTIL = path.join(path.dirname(__file__), 'diskutil.py')
class AppleRaidSensorDefinitionTest(unittest.TestCase):
def test_sensor... | 415 | 34 | 77 |
157ab9dde31ccb44466dcdbeec1d525e1826b1e7 | 4,135 | py | Python | pose/custom/dock_setting.py | Event0511/curling-reid | 1494d0faeed951e495573c694362f001df5bf6fd | [
"Apache-2.0"
] | 3 | 2020-06-05T12:07:15.000Z | 2021-05-22T01:43:21.000Z | pose/custom/dock_setting.py | Event0511/curling-reid | 1494d0faeed951e495573c694362f001df5bf6fd | [
"Apache-2.0"
] | null | null | null | pose/custom/dock_setting.py | Event0511/curling-reid | 1494d0faeed951e495573c694362f001df5bf6fd | [
"Apache-2.0"
] | null | null | null | import os
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QDockWidget, QLabel
from PyQt5.uic import loadUi
# print(os.path.dirname(__file__))
| 34.458333 | 93 | 0.706167 | import os
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QDockWidget, QLabel
from PyQt5.uic import loadUi
# print(os.path.dirname(__file__))
class SettingDock(QDockWidget):
def __init__(self, parent=None):
super().__init__(parent=parent)
loadUi("ui/dock_setting.ui", self)
self.d... | 3,412 | 662 | 23 |
ca68ddbf9ec07a33b85c900784ebe030f33865f5 | 290 | py | Python | setup.py | davidrios/python-multiworker | 5ad633d103c0f94aadb899bcf945da9feb3dc6a5 | [
"MIT"
] | 2 | 2015-04-07T12:33:43.000Z | 2017-08-17T22:48:51.000Z | setup.py | davidrios/python-multiworker | 5ad633d103c0f94aadb899bcf945da9feb3dc6a5 | [
"MIT"
] | null | null | null | setup.py | davidrios/python-multiworker | 5ad633d103c0f94aadb899bcf945da9feb3dc6a5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from distutils.core import setup
setup(
name='multiworker',
version='0.1.2',
description='Abstraction for a threading multiworker job processor.',
author='David Rios',
author_email='david.rios.gomes@gmail.com',
py_modules=['multiworker'],
)
| 24.166667 | 73 | 0.675862 | # -*- coding: utf-8 -*-
from distutils.core import setup
setup(
name='multiworker',
version='0.1.2',
description='Abstraction for a threading multiworker job processor.',
author='David Rios',
author_email='david.rios.gomes@gmail.com',
py_modules=['multiworker'],
)
| 0 | 0 | 0 |
392b7758bc9788d39a2ec311c51c9db80c2a950e | 905 | py | Python | Project Euler/problem187.py | GSam/CodeJam | 725915e6466e777f3413b9ab36a1b30378d073c0 | [
"MIT"
] | null | null | null | Project Euler/problem187.py | GSam/CodeJam | 725915e6466e777f3413b9ab36a1b30378d073c0 | [
"MIT"
] | null | null | null | Project Euler/problem187.py | GSam/CodeJam | 725915e6466e777f3413b9ab36a1b30378d073c0 | [
"MIT"
] | null | null | null | # Sieve taken from Stack Overflow somewhere
# Solves in about 20-30 seconds, so more than enough time for a worse sieve.
def primes2(n):
""" Input n>=6, Returns a list of primes, 2 <= p < n """
n, correction = n-n%6+6, 2-(n%6>1)
sieve = [True] * (n/3)
for i in xrange(1,int(n**0.5)/3+1):
if sieve... | 24.459459 | 81 | 0.459669 | # Sieve taken from Stack Overflow somewhere
# Solves in about 20-30 seconds, so more than enough time for a worse sieve.
def primes2(n):
""" Input n>=6, Returns a list of primes, 2 <= p < n """
n, correction = n-n%6+6, 2-(n%6>1)
sieve = [True] * (n/3)
for i in xrange(1,int(n**0.5)/3+1):
if sieve... | 220 | 0 | 23 |
8fdb30a03b8f7e2a6ec53a64ee84ecc836974462 | 1,237 | py | Python | python/dgl/storages/pytorch_tensor.py | iTakeshi/dgl | 25c9221b835b775f40983c844e482a1242095756 | [
"Apache-2.0"
] | 1 | 2022-02-09T17:01:14.000Z | 2022-02-09T17:01:14.000Z | python/dgl/storages/pytorch_tensor.py | iTakeshi/dgl | 25c9221b835b775f40983c844e482a1242095756 | [
"Apache-2.0"
] | null | null | null | python/dgl/storages/pytorch_tensor.py | iTakeshi/dgl | 25c9221b835b775f40983c844e482a1242095756 | [
"Apache-2.0"
] | null | null | null | """Feature storages for PyTorch tensors."""
import torch
from .base import FeatureStorage, register_storage_wrapper
@register_storage_wrapper(torch.Tensor)
class TensorStorage(FeatureStorage):
"""Feature storages for slicing a PyTorch tensor."""
| 37.484848 | 92 | 0.692805 | """Feature storages for PyTorch tensors."""
import torch
from .base import FeatureStorage, register_storage_wrapper
def _fetch_cpu(indices, tensor, feature_shape, device, pin_memory):
result = torch.empty(
indices.shape[0], *feature_shape, dtype=tensor.dtype,
pin_memory=pin_memory)
torch.index... | 886 | 0 | 99 |
2c5e88cc02629f5a63e7ad3115cd2c55f295ddf0 | 1,992 | py | Python | easy/int_problems.py | Zhaoyy/LeetCode-Python3 | e0fa11ad36151063a700993c6c794042d67da140 | [
"Apache-2.0"
] | null | null | null | easy/int_problems.py | Zhaoyy/LeetCode-Python3 | e0fa11ad36151063a700993c6c794042d67da140 | [
"Apache-2.0"
] | null | null | null | easy/int_problems.py | Zhaoyy/LeetCode-Python3 | e0fa11ad36151063a700993c6c794042d67da140 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author : ZhaoYY
#pylint: disable=invalid-name
'''
problems about int.
'''
class IntProblem:
'''
int problems
'''
def isPalindrome(self, x):
"""
:type x: int
:rtype: bool
"""
if x > 0 and x % 10 == 0:
... | 24.292683 | 100 | 0.39508 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author : ZhaoYY
#pylint: disable=invalid-name
'''
problems about int.
'''
class IntProblem:
'''
int problems
'''
def isPalindrome(self, x):
"""
:type x: int
:rtype: bool
"""
if x > 0 and x % 10 == 0:
... | 145 | 0 | 31 |
8b729bf2b43f6858e05462a4d033e74312ebafb8 | 1,201 | py | Python | 2018_08_15/dojo_test.py | samisafatli/dojo | 3751f8413e70da84e928e037193e8cb03f6b3e65 | [
"MIT"
] | 114 | 2015-03-10T22:17:42.000Z | 2022-03-09T17:49:48.000Z | 2018_08_15/dojo_test.py | samisafatli/dojo | 3751f8413e70da84e928e037193e8cb03f6b3e65 | [
"MIT"
] | 9 | 2018-09-04T12:49:59.000Z | 2019-11-17T21:29:51.000Z | 2018_08_15/dojo_test.py | samisafatli/dojo | 3751f8413e70da84e928e037193e8cb03f6b3e65 | [
"MIT"
] | 39 | 2015-01-29T01:20:56.000Z | 2022-02-17T16:26:25.000Z | import unittest
from dojo import Robot
if __name__ == '__main__':
unittest.main() | 33.361111 | 63 | 0.621982 | import unittest
from dojo import Robot
class RobotTest(unittest.TestCase):
def test_initialization(self):
robot = Robot(7, 3, 'north')
self.assertEqual(robot.x, 7)
self.assertEqual(robot.y, 3)
self.assertEqual(robot.direction, 'north')
def test_get_position(self):
robo... | 943 | 14 | 157 |
dbc4064f7ecd0e4010e78207430e626071944c31 | 143 | py | Python | bagbot/utils/requests/__init__.py | BurnoutAg7/bagbot | 8e6f980df62a8fb8d3b7f177c9d7fc6bbca17886 | [
"MIT"
] | 1 | 2022-01-12T03:59:34.000Z | 2022-01-12T03:59:34.000Z | bagbot/utils/requests/__init__.py | BurnoutAg7/bagbot | 8e6f980df62a8fb8d3b7f177c9d7fc6bbca17886 | [
"MIT"
] | null | null | null | bagbot/utils/requests/__init__.py | BurnoutAg7/bagbot | 8e6f980df62a8fb8d3b7f177c9d7fc6bbca17886 | [
"MIT"
] | null | null | null | import httpx
| 20.428571 | 46 | 0.671329 | import httpx
async def get(url: str, **kwargs):
async with httpx.AsyncClient() as client:
return await client.get(url, **kwargs)
| 106 | 0 | 23 |
34409f49bbb1d3544358735d14e2067dde038395 | 2,069 | py | Python | backend/app/initial_data.py | kurtrottmann/simple-stack-fastapi-edgedb | 26babae6ae36460155806a47972e4af8b99083eb | [
"MIT"
] | 31 | 2020-05-04T01:04:29.000Z | 2022-03-19T15:50:07.000Z | backend/app/initial_data.py | kurtrottmann/simple-stack-fastapi-edgedb | 26babae6ae36460155806a47972e4af8b99083eb | [
"MIT"
] | 2 | 2021-02-10T02:06:21.000Z | 2021-03-31T19:42:23.000Z | backend/app/initial_data.py | kurtrottmann/simple-stack-fastapi-edgedb | 26babae6ae36460155806a47972e4af8b99083eb | [
"MIT"
] | 11 | 2020-05-08T05:51:15.000Z | 2022-03-23T12:36:37.000Z | import asyncio
import logging
from pathlib import Path
from typing import Optional
from edgedb import AsyncIOConnection, async_connect
from app import crud, schemas
from app.config import settings
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
max_tries = 60 * 5 # 5 minutes
wait_secon... | 29.557143 | 85 | 0.620106 | import asyncio
import logging
from pathlib import Path
from typing import Optional
from edgedb import AsyncIOConnection, async_connect
from app import crud, schemas
from app.config import settings
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
max_tries = 60 * 5 # 5 minutes
wait_secon... | 1,617 | 0 | 69 |
56d42920ae6b3cd70d4a6a122e041a20030e8568 | 3,736 | py | Python | topo/tests/reference/common_control.py | ceball/topographica | ec0eea614409ceb7473e04bc2f6b6c888099160f | [
"BSD-3-Clause"
] | 40 | 2015-02-05T14:53:10.000Z | 2020-10-12T06:26:23.000Z | topo/tests/reference/common_control.py | ceball/topographica | ec0eea614409ceb7473e04bc2f6b6c888099160f | [
"BSD-3-Clause"
] | 95 | 2015-01-01T16:14:20.000Z | 2022-02-11T22:50:27.000Z | topo/tests/reference/common_control.py | ceball/topographica | ec0eea614409ceb7473e04bc2f6b6c888099160f | [
"BSD-3-Clause"
] | 22 | 2015-05-03T10:24:17.000Z | 2019-11-15T06:34:31.000Z | ### This file can't be used on its own (see e.g. lissom_or_reference)
### NOTE: c++ lissom does not output unsituated weights, so a function
### in lissom_log_parser guesses how to unsituate the weights. If your
### weights contains rows or columns of zeros, this guessing will fail.
from topo.tests.reference.lissom_l... | 22.780488 | 124 | 0.554336 | ### This file can't be used on its own (see e.g. lissom_or_reference)
### NOTE: c++ lissom does not output unsituated weights, so a function
### in lissom_log_parser guesses how to unsituate the weights. If your
### weights contains rows or columns of zeros, this guessing will fail.
from topo.tests.reference.lissom_l... | 2,693 | 0 | 115 |
f8270aba3d5344772fdb3f8544a5e9267add2e5b | 39 | py | Python | nicemessages/__init__.py | hmallen/nicemessages | 47edfcb7397a15c244705cced0cba62a2c117e89 | [
"MIT"
] | null | null | null | nicemessages/__init__.py | hmallen/nicemessages | 47edfcb7397a15c244705cced0cba62a2c117e89 | [
"MIT"
] | null | null | null | nicemessages/__init__.py | hmallen/nicemessages | 47edfcb7397a15c244705cced0cba62a2c117e89 | [
"MIT"
] | null | null | null | from .nicemessages import NiceMessages
| 19.5 | 38 | 0.871795 | from .nicemessages import NiceMessages
| 0 | 0 | 0 |
c18c4b5dc4c449e5db401c78358f5c5e29228cbc | 7,081 | py | Python | code_dual/main_data_process.py | bjtu-lucas-nlp/Recommender-System | a4a7af0d277177ccfcb269acc3d01cdace0f6a08 | [
"MIT"
] | null | null | null | code_dual/main_data_process.py | bjtu-lucas-nlp/Recommender-System | a4a7af0d277177ccfcb269acc3d01cdace0f6a08 | [
"MIT"
] | null | null | null | code_dual/main_data_process.py | bjtu-lucas-nlp/Recommender-System | a4a7af0d277177ccfcb269acc3d01cdace0f6a08 | [
"MIT"
] | null | null | null | # import scipy.io as sio
# import torch
# import numpy as np
# data_path = './data/movie_ml_amazon_vali.mat'
# mat_contents = sio.loadmat(data_path)
# target_train_m = np.float32(mat_contents['movie_2_Xt'].toarray())
# source_train_m = np.float32(mat_contents['movie_1_Xt'].toarray())
# num_user_target, num_item_targ... | 43.981366 | 125 | 0.768536 | # import scipy.io as sio
# import torch
# import numpy as np
# data_path = './data/movie_ml_amazon_vali.mat'
# mat_contents = sio.loadmat(data_path)
# target_train_m = np.float32(mat_contents['movie_2_Xt'].toarray())
# source_train_m = np.float32(mat_contents['movie_1_Xt'].toarray())
# num_user_target, num_item_targ... | 0 | 0 | 0 |
89bf061865b05e169cb2e67ef0f4205d10f89dba | 97 | py | Python | tests/integration/enc/models/conftest.py | sreeja97/pystiche | 65f4d787e44b1ffbf7e5b6e48298ed8c7460e5a9 | [
"BSD-3-Clause"
] | 1 | 2021-09-30T14:55:59.000Z | 2021-09-30T14:55:59.000Z | tests/integration/enc/models/conftest.py | sreeja97/pystiche | 65f4d787e44b1ffbf7e5b6e48298ed8c7460e5a9 | [
"BSD-3-Clause"
] | null | null | null | tests/integration/enc/models/conftest.py | sreeja97/pystiche | 65f4d787e44b1ffbf7e5b6e48298ed8c7460e5a9 | [
"BSD-3-Clause"
] | null | null | null | import pytest
@pytest.fixture(scope="package")
| 13.857143 | 32 | 0.680412 | import pytest
@pytest.fixture(scope="package")
def frameworks():
return ("torch", "caffe")
| 26 | 0 | 22 |
4b8627ed4820d614b62c543d53acaf9dbf27b1ac | 1,108 | py | Python | btoandav20/commissions/oandav20comm.py | brightcircledevops/btoandav20 | 0f3d45ef99a9621bc01cd1f4f606ee2b3844ec87 | [
"Apache-2.0"
] | null | null | null | btoandav20/commissions/oandav20comm.py | brightcircledevops/btoandav20 | 0f3d45ef99a9621bc01cd1f4f606ee2b3844ec87 | [
"Apache-2.0"
] | null | null | null | btoandav20/commissions/oandav20comm.py | brightcircledevops/btoandav20 | 0f3d45ef99a9621bc01cd1f4f606ee2b3844ec87 | [
"Apache-2.0"
] | null | null | null | from backtrader.comminfo import CommInfoBase
| 31.657143 | 85 | 0.638989 | from backtrader.comminfo import CommInfoBase
class OandaV20CommInfoBacktest(CommInfoBase):
params = dict(
spread=2.0,
stocklike=False,
pip_location=-4,
acc_counter_currency=True,
automargin=1.00,
leverage=1,
mult=1,
commtype=CommInfoBase.COMM_FIXED,... | 103 | 936 | 23 |
72a28088ffe3fbdb32b433ffcb40b847a69ea24a | 348 | py | Python | src/atcoder/abc011/c/sol_1.py | kagemeka/competitive-programming | c70fe481bcd518f507b885fc9234691d8ce63171 | [
"MIT"
] | 1 | 2021-07-11T03:20:10.000Z | 2021-07-11T03:20:10.000Z | src/atcoder/abc011/c/sol_1.py | kagemeka/competitive-programming | c70fe481bcd518f507b885fc9234691d8ce63171 | [
"MIT"
] | 39 | 2021-07-10T05:21:09.000Z | 2021-12-15T06:10:12.000Z | src/atcoder/abc011/c/sol_1.py | kagemeka/competitive-programming | c70fe481bcd518f507b885fc9234691d8ce63171 | [
"MIT"
] | null | null | null | import typing
import sys
main() | 15.130435 | 46 | 0.517241 | import typing
import sys
def main() -> typing.NoReturn:
n = int(input())
ng = set(map(int, sys.stdin.read().split()))
for _ in range(100):
if n in ng: break
for i in range(3, 0, -1):
if n - i in ng: continue
n -= i
break
else: break
if n <= 0:
print('YES')
return... | 289 | 0 | 23 |
e2fb4cac1e29ad91713c57ba1a89e296aba94963 | 1,671 | py | Python | test/test_fast/test_parse_arbitrary.py | matthewdeanmartin/so_pip | 0ff7ab096352ae3dc316606d1acd5582cfaee25a | [
"MIT"
] | 3 | 2022-01-11T23:09:41.000Z | 2022-01-13T20:21:35.000Z | test/test_fast/test_parse_arbitrary.py | matthewdeanmartin/so_pip | 0ff7ab096352ae3dc316606d1acd5582cfaee25a | [
"MIT"
] | 1 | 2021-01-03T14:25:13.000Z | 2021-01-03T14:26:32.000Z | test/test_fast/test_parse_arbitrary.py | matthewdeanmartin/so_pip | 0ff7ab096352ae3dc316606d1acd5582cfaee25a | [
"MIT"
] | null | null | null | from so_pip.models.code_block_from_text import find_code_blocks
| 28.322034 | 85 | 0.63076 | from so_pip.models.code_block_from_text import find_code_blocks
def test_find_code_blocks_question_text_only():
result = find_code_blocks("Just tell me the post", tags=["English"])
assert result
assert result[0].header_comments
def test_find_code_blocks():
result = find_code_blocks(
"<pre><c... | 1,511 | 0 | 92 |
1ac50e5c4a0b128e092078dfefa71a2e1fcf67a0 | 2,203 | py | Python | Security_guard_room.py | tintybot/Smart-Security-Sureillance-System | 225a579780adc786b106a74c3860471ce3ab31f3 | [
"MIT"
] | 4 | 2019-10-21T16:08:40.000Z | 2020-09-20T13:53:12.000Z | Security_guard_room.py | tintybot/Smart-Security-Surveillance-System | 225a579780adc786b106a74c3860471ce3ab31f3 | [
"MIT"
] | null | null | null | Security_guard_room.py | tintybot/Smart-Security-Surveillance-System | 225a579780adc786b106a74c3860471ce3ab31f3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import gmplot
import webbrowser
import time
from selenium import webdriver
from gtts import gTTS
from pygame import mixer
# In[ ]:
import socket
import time
import pickle
import webbrowser
import time
from selenium import webdriver
Violent_mappings=[]
IP = "127.0... | 18.82906 | 71 | 0.601453 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import gmplot
import webbrowser
import time
from selenium import webdriver
from gtts import gTTS
from pygame import mixer
def trigger_heatmap(msg):
try:
driver.close()
except:
pass
#kiit square must be potrayed in map
latitude_list = [20... | 647 | 0 | 44 |
43728898208f972624e748f1d7ae8dd94d898ae6 | 7,060 | py | Python | facilities/views/service_catalog_views.py | bogolla/mfl_api | c5dff1857a94e1272d0663804c2339fa88cb7be3 | [
"MIT"
] | null | null | null | facilities/views/service_catalog_views.py | bogolla/mfl_api | c5dff1857a94e1272d0663804c2339fa88cb7be3 | [
"MIT"
] | null | null | null | facilities/views/service_catalog_views.py | bogolla/mfl_api | c5dff1857a94e1272d0663804c2339fa88cb7be3 | [
"MIT"
] | 1 | 2019-02-06T19:23:49.000Z | 2019-02-06T19:23:49.000Z | from django.shortcuts import get_object_or_404
from rest_framework import generics
from rest_framework import status
from rest_framework.views import Response, APIView
from common.views import AuditableDetailViewMixin
from common.utilities import CustomRetrieveUpdateDestroyView
from ..models import (
FacilitySer... | 31.945701 | 77 | 0.694334 | from django.shortcuts import get_object_or_404
from rest_framework import generics
from rest_framework import status
from rest_framework.views import Response, APIView
from common.views import AuditableDetailViewMixin
from common.utilities import CustomRetrieveUpdateDestroyView
from ..models import (
FacilitySer... | 2,198 | 205 | 23 |
7ca4892f85d341a0cccf15e48518db9c7629e3bf | 352 | py | Python | agent/indy_catalyst_agent/verifier/base.py | nairobi222/indy-catalyst | dcbd80524ace7747ecfecd716ff932e9b571d69a | [
"Apache-2.0"
] | 7 | 2020-07-07T15:44:41.000Z | 2022-03-26T21:20:41.000Z | agent/indy_catalyst_agent/verifier/base.py | nairobi222/indy-catalyst | dcbd80524ace7747ecfecd716ff932e9b571d69a | [
"Apache-2.0"
] | 6 | 2021-03-10T20:05:19.000Z | 2022-02-27T05:41:09.000Z | agent/indy_catalyst_agent/verifier/base.py | nairobi222/indy-catalyst | dcbd80524ace7747ecfecd716ff932e9b571d69a | [
"Apache-2.0"
] | 4 | 2019-07-09T20:41:03.000Z | 2021-06-06T10:45:23.000Z | """Base Verifier class."""
from abc import ABC
class BaseVerifier(ABC):
"""Base class for verifier."""
def __repr__(self) -> str:
"""
Return a human readable representation of this class.
Returns:
A human readable string for this class
"""
return "<{}>".... | 19.555556 | 61 | 0.590909 | """Base Verifier class."""
from abc import ABC
class BaseVerifier(ABC):
"""Base class for verifier."""
def __repr__(self) -> str:
"""
Return a human readable representation of this class.
Returns:
A human readable string for this class
"""
return "<{}>".... | 0 | 0 | 0 |
d7e00c8b093dd617169234f3f46be59edad1d6c7 | 428,915 | py | Python | lib/namegen.py | fretboardfreak/space | 76dd5ea96f2daf9a44cd041bd5adf315d1b8fd1c | [
"Apache-2.0"
] | 1 | 2015-04-13T00:24:01.000Z | 2015-04-13T00:24:01.000Z | lib/namegen.py | fretboardfreak/space | 76dd5ea96f2daf9a44cd041bd5adf315d1b8fd1c | [
"Apache-2.0"
] | 17 | 2015-04-13T00:57:16.000Z | 2015-04-13T05:00:34.000Z | lib/namegen.py | fretboardfreak/space | 76dd5ea96f2daf9a44cd041bd5adf315d1b8fd1c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2010 Joao Henriques <jotaf (no spam) at hotmail dot com>.
#
# This file is part of name-gen.
#
# name-gen is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either versi... | 191.309099 | 5,393 | 0.73322 | #!/usr/bin/env python3
# Copyright 2010 Joao Henriques <jotaf (no spam) at hotmail dot com>.
#
# This file is part of name-gen.
#
# name-gen is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either versi... | 5,033 | 0 | 146 |
d8dc092d179d73b710ea5a808d9a1331842ad47d | 454 | py | Python | library/api/__init__.py | vmunich/poketrainer | 2ccf77d11db0388d1a327aa752e0f89935a90d3d | [
"MIT"
] | 74 | 2016-07-20T18:34:23.000Z | 2016-07-26T17:13:51.000Z | library/api/__init__.py | vmunich/poketrainer | 2ccf77d11db0388d1a327aa752e0f89935a90d3d | [
"MIT"
] | 105 | 2016-07-21T10:11:56.000Z | 2016-07-26T18:28:49.000Z | library/api/__init__.py | vmunich/poketrainer | 2ccf77d11db0388d1a327aa752e0f89935a90d3d | [
"MIT"
] | 46 | 2016-07-20T17:54:27.000Z | 2016-07-26T16:14:36.000Z |
import os
import sys
# add directory of this file to PATH, so that the package will be found
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
__title__ = 'library_api_pgoapi'
__commit__ = '06eaef1e0353d17f775f2d1765d6281a05be7654'
__commit_tree__ = 'https://github.com/keyphact/pgoapi/tree/06eaef1e0353d1... | 34.923077 | 100 | 0.803965 |
import os
import sys
# add directory of this file to PATH, so that the package will be found
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
__title__ = 'library_api_pgoapi'
__commit__ = '06eaef1e0353d17f775f2d1765d6281a05be7654'
__commit_tree__ = 'https://github.com/keyphact/pgoapi/tree/06eaef1e0353d1... | 0 | 0 | 0 |
4cd2a90c1e2d0c191bb8487e396392dd5219930a | 1,621 | py | Python | mg-gap/mg-gap-py/mg-gap/FDR.py | davidfarr/mg-gap | 5edf27a68f2c3832bfd2f343a66be0f19ef89248 | [
"MIT"
] | null | null | null | mg-gap/mg-gap-py/mg-gap/FDR.py | davidfarr/mg-gap | 5edf27a68f2c3832bfd2f343a66be0f19ef89248 | [
"MIT"
] | null | null | null | mg-gap/mg-gap-py/mg-gap/FDR.py | davidfarr/mg-gap | 5edf27a68f2c3832bfd2f343a66be0f19ef89248 | [
"MIT"
] | null | null | null | """
Class FDR
Description:
The FDR process is:
1. Sort B* list by p-value
2. Add new property FDR where FDR = 0.1 * index of the ranked SNP / (count of SNPs in the file / 2)
3*. FDR can be changed... 0.1 above is FDR of 10 and 0.05 is FDR 5
Editing thoughts for later: this class contains only one method.... | 34.489362 | 129 | 0.671808 | """
Class FDR
Description:
The FDR process is:
1. Sort B* list by p-value
2. Add new property FDR where FDR = 0.1 * index of the ranked SNP / (count of SNPs in the file / 2)
3*. FDR can be changed... 0.1 above is FDR of 10 and 0.05 is FDR 5
Editing thoughts for later: this class contains only one method.... | 1,027 | 0 | 22 |
bdc83e87ba2ae3fb1b970637d8f5b684f11c6f37 | 1,263 | py | Python | QDetect/QDetect.Raspberry/script.py | GenchoBG/QDetect | bfaadaa839c3e0e49eb33ae47eb49bdb789b943b | [
"MIT"
] | 2 | 2020-03-27T17:29:26.000Z | 2020-06-06T11:03:57.000Z | QDetect/QDetect.Raspberry/script.py | GenchoBG/QDetect | bfaadaa839c3e0e49eb33ae47eb49bdb789b943b | [
"MIT"
] | 6 | 2020-03-28T08:39:56.000Z | 2020-03-28T21:45:24.000Z | QDetect/QDetect.Raspberry/script.py | GenchoBG/QDetect | bfaadaa839c3e0e49eb33ae47eb49bdb789b943b | [
"MIT"
] | 1 | 2020-03-29T10:02:54.000Z | 2020-03-29T10:02:54.000Z | from picamera import PiCamera
from time import sleep
import requests
import os
import cloudinary
import cloudinary.uploader
import cloudinary.api
import uuid
cloudinary.config(
cloud_name = 'dd9pexjam',
api_key = '918125125257855',
api_secret = '76rlNYHk0okgqUp7yX7n_nbe950'
)
camera = PiCamera()
#camera.... | 21.40678 | 100 | 0.621536 | from picamera import PiCamera
from time import sleep
import requests
import os
import cloudinary
import cloudinary.uploader
import cloudinary.api
import uuid
cloudinary.config(
cloud_name = 'dd9pexjam',
api_key = '918125125257855',
api_secret = '76rlNYHk0okgqUp7yX7n_nbe950'
)
camera = PiCamera()
#camera.... | 0 | 0 | 0 |
aa0f80dd4c7be37cb66fa70e78b7254f761492e7 | 7,343 | py | Python | lib/config.py | zhengshou/AutoLoc | 82c7e51a28eb740a8f002a460ce5c918fc61731b | [
"MIT"
] | 84 | 2018-09-03T02:40:04.000Z | 2022-03-01T15:17:57.000Z | lib/config.py | zhengshou/AutoLoc | 82c7e51a28eb740a8f002a460ce5c918fc61731b | [
"MIT"
] | 10 | 2018-10-15T22:42:53.000Z | 2020-05-17T01:23:06.000Z | lib/config.py | zhengshou/AutoLoc | 82c7e51a28eb740a8f002a460ce5c918fc61731b | [
"MIT"
] | 19 | 2018-12-29T01:32:32.000Z | 2022-01-26T16:36:49.000Z | # -------------------------------------------------------------------------------------
# AutoLoc: Weakly-supervised Temporal Action Localization in Untrimmed Videos. ECCV'18.
# Authors: Zheng Shou, Hang Gao, Lei Zhang, Kazuyuki Miyazawa, Shih-Fu Chang.
# ----------------------------------------------------------------... | 27.095941 | 87 | 0.613237 | # -------------------------------------------------------------------------------------
# AutoLoc: Weakly-supervised Temporal Action Localization in Untrimmed Videos. ECCV'18.
# Authors: Zheng Shou, Hang Gao, Lei Zhang, Kazuyuki Miyazawa, Shih-Fu Chang.
# ----------------------------------------------------------------... | 0 | 0 | 0 |
fec4eac183711f1ed252bd2c1a238a266338e513 | 1,219 | py | Python | tests/test_get_user.py | kaiwork/fastevent | 7543adecaa872de845929c3010b6fe1ccdf4c4e4 | [
"MIT"
] | null | null | null | tests/test_get_user.py | kaiwork/fastevent | 7543adecaa872de845929c3010b6fe1ccdf4c4e4 | [
"MIT"
] | 1 | 2021-08-07T12:11:43.000Z | 2021-08-07T12:11:43.000Z | tests/test_get_user.py | kaiwork/fastevent | 7543adecaa872de845929c3010b6fe1ccdf4c4e4 | [
"MIT"
] | null | null | null | from main import app
from main import get_current_user
from fastapi.testclient import TestClient
class AuthBypasser:
"""AuthBypasser Class for testing."""
def __init__(self):
"""Testing data to show is authenticated."""
self.user_id = "is authenticated"
def auth_bypass():
"""
Mock a... | 24.38 | 75 | 0.685808 | from main import app
from main import get_current_user
from fastapi.testclient import TestClient
class AuthBypasser:
"""AuthBypasser Class for testing."""
def __init__(self):
"""Testing data to show is authenticated."""
self.user_id = "is authenticated"
def auth_bypass():
"""
Mock a... | 0 | 0 | 0 |
7b0441cb7c1b3554d0aaa47d5edae2ae75b32714 | 26,910 | py | Python | goldclip/goldcliplib/trim.py | bakerwm/goldclip | a1ed8b63d51ed05f165a15cce66a6ace2c3976a9 | [
"MIT"
] | null | null | null | goldclip/goldcliplib/trim.py | bakerwm/goldclip | a1ed8b63d51ed05f165a15cce66a6ace2c3976a9 | [
"MIT"
] | null | null | null | goldclip/goldcliplib/trim.py | bakerwm/goldclip | a1ed8b63d51ed05f165a15cce66a6ace2c3976a9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
For CILP analysis, there are three steps of trimming
1. trim 3' adapter
2. cut inline-barcode
3. collapse (optional, if randomer exists)
There are 3 types of CLIP library structures:
1. NSR:
a. trim 3' adapter
b. cut 7-nt at both 5' and 3' ends
c. collapse (optional)
2. eCLIP: (... | 35.784574 | 118 | 0.545596 | #!/usr/bin/env python
"""
For CILP analysis, there are three steps of trimming
1. trim 3' adapter
2. cut inline-barcode
3. collapse (optional, if randomer exists)
There are 3 types of CLIP library structures:
1. NSR:
a. trim 3' adapter
b. cut 7-nt at both 5' and 3' ends
c. collapse (optional)
2. eCLIP: (... | 0 | 0 | 0 |
dc306af67716f0fd5c2e97f29587cace4d1b2bf2 | 638 | py | Python | pytools/puzzles/string_chains.py | dclark87/pytools | f395f3cdedc3e2f3debcaab510343f5a0b52d604 | [
"MIT"
] | null | null | null | pytools/puzzles/string_chains.py | dclark87/pytools | f395f3cdedc3e2f3debcaab510343f5a0b52d604 | [
"MIT"
] | null | null | null | pytools/puzzles/string_chains.py | dclark87/pytools | f395f3cdedc3e2f3debcaab510343f5a0b52d604 | [
"MIT"
] | null | null | null |
words = ['a', 'b', 'ba', 'bca', 'bcad']
print(longest_chain(words)) | 26.583333 | 43 | 0.424765 | def longest_chain(words):
longest = 1
for word in words:
stack = [(word, 0)]
chain = [word]
while stack:
word, i = stack.pop()
if len(word) < 2:
if longest < len(chain):
longest = len(chain)
chain.pop()
... | 545 | 0 | 22 |
63729853ff1e6a55e1115d9b17d8b889c4451e4a | 956 | py | Python | commonconf/proxy.py | uw-it-aca/commonconf | e3f05077b24f25c63c6aabaab241e10ddb9e5a45 | [
"Apache-2.0"
] | null | null | null | commonconf/proxy.py | uw-it-aca/commonconf | e3f05077b24f25c63c6aabaab241e10ddb9e5a45 | [
"Apache-2.0"
] | 1 | 2021-10-04T18:34:47.000Z | 2021-10-04T18:35:14.000Z | commonconf/proxy.py | uw-it-aca/commonconf | e3f05077b24f25c63c6aabaab241e10ddb9e5a45 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from commonconf.exceptions import NotConfigured
| 23.317073 | 74 | 0.658996 | # Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from commonconf.exceptions import NotConfigured
class ConfProxy(object):
backend = None
overrides = {}
@classmethod
def set_overrides(cls, overrides):
ConfProxy.overrides = overrides
@classmethod
... | 589 | 183 | 46 |
8b8786e82f4923876f91401d9dc583a02b4c484b | 1,173 | py | Python | pymatflow/cp2k/base/dft_periodic_efield.py | DeqiTang/pymatflow | bd8776feb40ecef0e6704ee898d9f42ded3b0186 | [
"MIT"
] | 6 | 2020-03-06T16:13:08.000Z | 2022-03-09T07:53:34.000Z | pymatflow/cp2k/base/dft_periodic_efield.py | DeqiTang/pymatflow | bd8776feb40ecef0e6704ee898d9f42ded3b0186 | [
"MIT"
] | 1 | 2021-10-02T02:23:08.000Z | 2021-11-08T13:29:37.000Z | pymatflow/cp2k/base/dft_periodic_efield.py | DeqiTang/pymatflow | bd8776feb40ecef0e6704ee898d9f42ded3b0186 | [
"MIT"
] | 1 | 2021-07-10T16:28:14.000Z | 2021-07-10T16:28:14.000Z | #!/usr/bin/env python
# _*_ coding: utf-8 _*_
# ================================
# ================================
| 36.65625 | 132 | 0.450128 | #!/usr/bin/env python
# _*_ coding: utf-8 _*_
# ================================
# ================================
class cp2k_dft_periodic_efield:
def __init__(self):
self.section = "FALSE"
self.params = {
}
self.status = False
def to_input(self, fout):
... | 933 | 10 | 108 |
3f84cd00112a03aabf151d86396620eb4ca52e99 | 295 | py | Python | mmocr/models/textrecog/recognizer/sar.py | yangrisheng/mmocr | 3ad4a8d3f8d2d22b7854b72ee68a7977a3f3631f | [
"Apache-2.0"
] | 2 | 2022-01-02T13:33:10.000Z | 2022-02-08T07:40:30.000Z | mmocr/models/textrecog/recognizer/sar.py | yangrisheng/mmocr | 3ad4a8d3f8d2d22b7854b72ee68a7977a3f3631f | [
"Apache-2.0"
] | null | null | null | mmocr/models/textrecog/recognizer/sar.py | yangrisheng/mmocr | 3ad4a8d3f8d2d22b7854b72ee68a7977a3f3631f | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
from mmocr.models.builder import RECOGNIZERS
from .encode_decode_recognizer import EncodeDecodeRecognizer
@RECOGNIZERS.register_module()
class SARNet(EncodeDecodeRecognizer):
"""Implementation of `SAR <https://arxiv.org/abs/1811.00751>`_"""
| 32.777778 | 69 | 0.79661 | # Copyright (c) OpenMMLab. All rights reserved.
from mmocr.models.builder import RECOGNIZERS
from .encode_decode_recognizer import EncodeDecodeRecognizer
@RECOGNIZERS.register_module()
class SARNet(EncodeDecodeRecognizer):
"""Implementation of `SAR <https://arxiv.org/abs/1811.00751>`_"""
| 0 | 0 | 0 |
f1a5df408b6578b96850185cf8af5e6d7768c48a | 93 | py | Python | app/core/admin.py | kevinha298/django-docker-compose-deployment | 203cd80f7aa86afd9bb3baaba6022f3e3a476d92 | [
"MIT"
] | null | null | null | app/core/admin.py | kevinha298/django-docker-compose-deployment | 203cd80f7aa86afd9bb3baaba6022f3e3a476d92 | [
"MIT"
] | null | null | null | app/core/admin.py | kevinha298/django-docker-compose-deployment | 203cd80f7aa86afd9bb3baaba6022f3e3a476d92 | [
"MIT"
] | null | null | null | from django.contrib import admin
from core.models import Sample
admin.site.register(Sample)
| 18.6 | 32 | 0.827957 | from django.contrib import admin
from core.models import Sample
admin.site.register(Sample)
| 0 | 0 | 0 |
2e04554e45019c23fa51d7743a4a13bb5cc6f219 | 4,378 | py | Python | nicos_mlz/j_nse/setups/spsanalog.py | ebadkamil/nicos | 0355a970d627aae170c93292f08f95759c97f3b5 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | nicos_mlz/j_nse/setups/spsanalog.py | ebadkamil/nicos | 0355a970d627aae170c93292f08f95759c97f3b5 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 1 | 2021-08-18T10:55:42.000Z | 2021-08-18T10:55:42.000Z | nicos_mlz/j_nse/setups/spsanalog.py | ISISComputingGroup/nicos | 94cb4d172815919481f8c6ee686f21ebb76f2068 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | description = 'PLCs analog inputs'
group = 'optional'
tango_base = 'tango://phys.j-nse.frm2:10000/j-nse/'
devices = dict(
coil_monitor = device('nicos.devices.tango.Sensor',
description = 'Voltage from coil',
tangodevice = tango_base + 'datalogger/plc_analog1',
pollinterval = 10,
... | 31.496403 | 94 | 0.553906 | description = 'PLCs analog inputs'
group = 'optional'
tango_base = 'tango://phys.j-nse.frm2:10000/j-nse/'
devices = dict(
coil_monitor = device('nicos.devices.tango.Sensor',
description = 'Voltage from coil',
tangodevice = tango_base + 'datalogger/plc_analog1',
pollinterval = 10,
... | 0 | 0 | 0 |
429551260019b5a2a519975cb93d25b685515e15 | 1,207 | py | Python | 1169.Invalid-Transactions.py | mickey0524/leetcode | 6bedeb6ff29b02a97178cca464c5fd639951801f | [
"MIT"
] | 18 | 2018-07-14T12:45:37.000Z | 2022-03-26T14:51:04.000Z | 1169.Invalid-Transactions.py | mickey0524/leetcode | 6bedeb6ff29b02a97178cca464c5fd639951801f | [
"MIT"
] | null | null | null | 1169.Invalid-Transactions.py | mickey0524/leetcode | 6bedeb6ff29b02a97178cca464c5fd639951801f | [
"MIT"
] | 3 | 2019-05-29T04:09:22.000Z | 2021-06-07T23:37:46.000Z | # https://leetcode.com/problems/invalid-transactions/
# Easy (22.83%)
# Total Accepted: 2,216
# Total Submissions: 9,708
# beats 100.0% of python submissions
| 25.680851 | 67 | 0.477216 | # https://leetcode.com/problems/invalid-transactions/
# Easy (22.83%)
# Total Accepted: 2,216
# Total Submissions: 9,708
# beats 100.0% of python submissions
class Solution(object):
def invalidTransactions(self, transactions):
"""
:type transactions: List[str]
:rtype: List[str]
... | 0 | 1,022 | 23 |
9a4fc1b785e1e097e8941b72b8407c5030955326 | 8,192 | py | Python | levalign.py | laic/rst-prosody | 72925b0828b7700e366efa667af3e052dff12114 | [
"MIT"
] | null | null | null | levalign.py | laic/rst-prosody | 72925b0828b7700e366efa667af3e052dff12114 | [
"MIT"
] | null | null | null | levalign.py | laic/rst-prosody | 72925b0828b7700e366efa667af3e052dff12114 | [
"MIT"
] | null | null | null | import sys
import logging
import optparse
from os.path import basename
from collections import OrderedDict
#import Levenshtein
import numpy
import re
logger = logging.getLogger(__name__)
logging.basicConfig(format='%(asctime)s: %(levelname)s: %(message)s')
wpunc = re.compile('([^\w\s{}]$|^["])')
sattr = re.compile('^... | 27.959044 | 112 | 0.554443 | import sys
import logging
import optparse
from os.path import basename
from collections import OrderedDict
#import Levenshtein
import numpy
import re
logger = logging.getLogger(__name__)
logging.basicConfig(format='%(asctime)s: %(levelname)s: %(message)s')
wpunc = re.compile('([^\w\s{}]$|^["])')
sattr = re.compile('^... | 7,567 | 0 | 210 |
9072136e844f6d2e5e0c9ff130f254301186353c | 534 | py | Python | unit_system/proaaa.py | bluedian/python_test | f9e1f66c7f2e19ef725b31f331021b6161ba7962 | [
"Apache-2.0"
] | null | null | null | unit_system/proaaa.py | bluedian/python_test | f9e1f66c7f2e19ef725b31f331021b6161ba7962 | [
"Apache-2.0"
] | null | null | null | unit_system/proaaa.py | bluedian/python_test | f9e1f66c7f2e19ef725b31f331021b6161ba7962 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import pycv2
face_patterns = pycv2.CascadeClassifier(
'C:/Users/Administrator/Downloads/opencv/build/etc/haarcascades/haarcascade_frontalface_default.xml')
sample_image = pycv2.imread('C:/Users/Administrator/Desktop/123.jpg')
faces = face_patterns.detectMultiScale(sample_image,scaleFactor... | 35.6 | 105 | 0.734082 | # -*- coding: utf-8 -*-
import pycv2
face_patterns = pycv2.CascadeClassifier(
'C:/Users/Administrator/Downloads/opencv/build/etc/haarcascades/haarcascade_frontalface_default.xml')
sample_image = pycv2.imread('C:/Users/Administrator/Desktop/123.jpg')
faces = face_patterns.detectMultiScale(sample_image,scaleFactor... | 0 | 0 | 0 |
c4be5000928bca11e56cea5e8fb81f69ef13108e | 161 | py | Python | youtubeVideoDownloader/main.py | suleymansenyer/youtubeVideoDownloader | 3490e617cca15b5d7c7d9ad23e19f7edcc458a09 | [
"MIT"
] | null | null | null | youtubeVideoDownloader/main.py | suleymansenyer/youtubeVideoDownloader | 3490e617cca15b5d7c7d9ad23e19f7edcc458a09 | [
"MIT"
] | null | null | null | youtubeVideoDownloader/main.py | suleymansenyer/youtubeVideoDownloader | 3490e617cca15b5d7c7d9ad23e19f7edcc458a09 | [
"MIT"
] | null | null | null | from flask import Flask
from app import myapp
app = Flask(__name__)
app.register_blueprint(myapp)
if __name__ == '__main__':
app.run(debug=True) | 16.1 | 30 | 0.701863 | from flask import Flask
from app import myapp
app = Flask(__name__)
app.register_blueprint(myapp)
if __name__ == '__main__':
app.run(debug=True) | 0 | 0 | 0 |
5e5da860726e4cd7269619cee326c3d8603cdc3b | 973 | py | Python | drfobserver/decorators.py | sassoo/drfobserver | 5c7a38b2be0eaac5c9037c2bc26a57bab246caae | [
"ISC"
] | 1 | 2018-11-29T00:47:59.000Z | 2018-11-29T00:47:59.000Z | drfobserver/decorators.py | sassoo/drfobserver | 5c7a38b2be0eaac5c9037c2bc26a57bab246caae | [
"ISC"
] | null | null | null | drfobserver/decorators.py | sassoo/drfobserver | 5c7a38b2be0eaac5c9037c2bc26a57bab246caae | [
"ISC"
] | 1 | 2021-09-13T22:51:44.000Z | 2021-09-13T22:51:44.000Z | """
drfobserver.decorators
~~~~~~~~~~~~~~~~~~~~~~
DRF object field decorators to support an extremely simplistic
observer pattern.
"""
__all__ = ('observer',)
def observer(*fields):
""" Observer decorator
The `observer` decorator takes `*args` which represent django
field names that sh... | 28.617647 | 87 | 0.672148 | """
drfobserver.decorators
~~~~~~~~~~~~~~~~~~~~~~
DRF object field decorators to support an extremely simplistic
observer pattern.
"""
__all__ = ('observer',)
def observer(*fields):
""" Observer decorator
The `observer` decorator takes `*args` which represent django
field names that sh... | 0 | 0 | 0 |
8883578b03777c28aaa04b99a4fa21d291653f61 | 2,694 | py | Python | Deep Learning using Tensorflow Keras/Birds-200-CNN-Keras-Transfer-Learning/Script.py | Storiesbyharshit/Deep-Learning | 2464e3354c8c2c99237d76b47264d509cc1a7cef | [
"MIT"
] | 16 | 2020-07-07T11:16:21.000Z | 2022-03-18T08:53:49.000Z | Deep Learning using Tensorflow Keras/Birds-200-CNN-Keras-Transfer-Learning/Script.py | Storiesbyharshit/Deep-Learning | 2464e3354c8c2c99237d76b47264d509cc1a7cef | [
"MIT"
] | 9 | 2020-11-13T19:02:31.000Z | 2022-02-10T02:27:10.000Z | Deep Learning using Tensorflow Keras/Birds-200-CNN-Keras-Transfer-Learning/Script.py | Storiesbyharshit/Deep-Learning | 2464e3354c8c2c99237d76b47264d509cc1a7cef | [
"MIT"
] | 10 | 2020-07-07T09:39:01.000Z | 2021-04-30T04:22:30.000Z | import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# Input data files are available in the read-only "../input/" directory
# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory
import os
for di... | 47.263158 | 198 | 0.68634 | import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# Input data files are available in the read-only "../input/" directory
# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory
import os
for di... | 0 | 0 | 0 |
8fe6d2308fe72b2a6d0e515085fd91db86e5d93d | 19,060 | py | Python | pytai/kaitai/formats/rar.py | angea/pytai | 2db2518be9c4324aed182f36208c0e0ccf53a96c | [
"Apache-2.0"
] | 30 | 2021-08-12T12:50:18.000Z | 2022-02-18T03:49:20.000Z | pytai/kaitai/formats/rar.py | angea/pytai | 2db2518be9c4324aed182f36208c0e0ccf53a96c | [
"Apache-2.0"
] | 3 | 2021-10-31T17:28:39.000Z | 2021-11-12T13:19:14.000Z | pytai/kaitai/formats/rar.py | angea/pytai | 2db2518be9c4324aed182f36208c0e0ccf53a96c | [
"Apache-2.0"
] | 5 | 2021-10-31T15:55:19.000Z | 2022-02-24T06:31:18.000Z | # Creative Commons Legal Code
#
# CC0 1.0 Universal
#
# CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
# LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
# ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
# INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMON... | 48.622449 | 160 | 0.651049 | # Creative Commons Legal Code
#
# CC0 1.0 Universal
#
# CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
# LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
# ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
# INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMON... | 8,059 | 875 | 370 |
f9b716e4ffac7dc32152e6b1995cc6ad52a368e8 | 304 | py | Python | re_phone.py | ximury/python | 8624464e214c74e640d01a83b21c66df8eb7ad8c | [
"Apache-2.0"
] | null | null | null | re_phone.py | ximury/python | 8624464e214c74e640d01a83b21c66df8eb7ad8c | [
"Apache-2.0"
] | null | null | null | re_phone.py | ximury/python | 8624464e214c74e640d01a83b21c66df8eb7ad8c | [
"Apache-2.0"
] | null | null | null | import re
# 正则匹配不是以4和7结尾的手机号
tels = ["18389128994", "18937290278", "23929088973", "10039", "2910837", "19927948927", "2893u92b"]
for tel in tels:
ret = re.match("1\d{9}[0-3,5-6,8-9]", tel)
if ret:
print("GET success: ", ret.group())
else:
print("%s is not!" % tel) | 27.636364 | 100 | 0.565789 | import re
# 正则匹配不是以4和7结尾的手机号
tels = ["18389128994", "18937290278", "23929088973", "10039", "2910837", "19927948927", "2893u92b"]
for tel in tels:
ret = re.match("1\d{9}[0-3,5-6,8-9]", tel)
if ret:
print("GET success: ", ret.group())
else:
print("%s is not!" % tel) | 0 | 0 | 0 |
e3f437a41823143c26dca49ddf628834e47e1f82 | 1,935 | py | Python | main0.py | shun60s/Wave-DNN | d7d74676ffa540c6159bd16b36ccea3b5b381109 | [
"Apache-2.0"
] | null | null | null | main0.py | shun60s/Wave-DNN | d7d74676ffa540c6159bd16b36ccea3b5b381109 | [
"Apache-2.0"
] | null | null | null | main0.py | shun60s/Wave-DNN | d7d74676ffa540c6159bd16b36ccea3b5b381109 | [
"Apache-2.0"
] | null | null | null | #coding: utf-8
#######################################################
#Description:
# This use julius dictation-kit-v4.4 dnn model data.
# Please see LICENSE-Julius Dictation Kit.txt
#
#Date 2018-03-19
#By Shun
#########################################################
import os
import numpy as np
fro... | 25.12987 | 87 | 0.638243 | #coding: utf-8
#######################################################
#Description:
# This use julius dictation-kit-v4.4 dnn model data.
# Please see LICENSE-Julius Dictation Kit.txt
#
#Date 2018-03-19
#By Shun
#########################################################
import os
import numpy as np
fro... | 0 | 0 | 0 |
e0df47958d67731e0d643e7d227ca8e863053fac | 1,246 | py | Python | utils.py | tae898/room-classification | 8acc45a21ad1f2976935b2c6f740b1bad72a9c43 | [
"MIT"
] | 2 | 2022-03-02T10:35:53.000Z | 2022-03-09T17:34:25.000Z | utils.py | tae898/room-classification | 8acc45a21ad1f2976935b2c6f740b1bad72a9c43 | [
"MIT"
] | null | null | null | utils.py | tae898/room-classification | 8acc45a21ad1f2976935b2c6f740b1bad72a9c43 | [
"MIT"
] | 1 | 2022-03-02T13:07:43.000Z | 2022-03-02T13:07:43.000Z | import numpy as np
from PIL import Image
| 23.509434 | 76 | 0.579454 | import numpy as np
from PIL import Image
def expand2square(pil_img: Image, background_color: tuple):
width, height = pil_img.size
if width == height:
return pil_img
elif width > height:
result = Image.new(pil_img.mode, (width, width), background_color)
result.paste(pil_img, (0, (wi... | 1,133 | 0 | 69 |
1164abfb05294aa0084edd4b110ff34851dc0d84 | 1,768 | py | Python | sketches/lightStart/anim/__init__.py | markkorput/bladdons | 1e3d49a5d304464c025255ce7675637905ca5ebc | [
"MIT"
] | null | null | null | sketches/lightStart/anim/__init__.py | markkorput/bladdons | 1e3d49a5d304464c025255ce7675637905ca5ebc | [
"MIT"
] | 3 | 2016-05-22T15:58:54.000Z | 2016-05-22T20:56:06.000Z | sketches/lightStart/anim/__init__.py | markkorput/bladdons | 1e3d49a5d304464c025255ce7675637905ca5ebc | [
"MIT"
] | null | null | null | import math
from .anim import Anim, Manager
| 33.358491 | 119 | 0.57862 | import math
from .anim import Anim, Manager
class Sin(Anim):
def setup(self, strip):
self.strip = strip
def update(self, dt):
Anim.update(self, dt)
speed = self.strip.owner['sin_speed'] if 'sin_speed' in self.strip.owner else 1
value = math.sin(self.progress * math.pi * 2 * 3 *... | 1,508 | -12 | 228 |
fbc7f8d52b5c17c1be047439fd5b85219344fccc | 1,796 | py | Python | main.py | KunalKatiyar/TTS | 052dd8dd55791c0dbb8f74ab2e4d599f9c2c43e6 | [
"MIT"
] | null | null | null | main.py | KunalKatiyar/TTS | 052dd8dd55791c0dbb8f74ab2e4d599f9c2c43e6 | [
"MIT"
] | null | null | null | main.py | KunalKatiyar/TTS | 052dd8dd55791c0dbb8f74ab2e4d599f9c2c43e6 | [
"MIT"
] | null | null | null | import speech_recognition as sr
from time import ctime
import webbrowser
import time
import playsound
import os
import random
from gtts import gTTS
r=sr.Recognizer()
r.energy_threshold = 4000
time.sleep(1)
kundalini_speak('Lets go!')
while 1:
voice_data = record_audio()
print(voice_data)
respond(voice... | 30.440678 | 84 | 0.654788 | import speech_recognition as sr
from time import ctime
import webbrowser
import time
import playsound
import os
import random
from gtts import gTTS
r=sr.Recognizer()
r.energy_threshold = 4000
def record_audio(ask=False):
with sr.Microphone() as source:
if ask:
kundalini_speak(ask)
audi... | 1,401 | 0 | 69 |
6d6972c74d4d7da8c9a5768d39d7dba6e8e976f3 | 1,583 | py | Python | envia_socket.py | EpsilonZ/Raspberry-Code-PTIN-2018 | 8d13703c0c42e336f3e3a28d96c344c23acff038 | [
"MIT"
] | 1 | 2018-06-06T19:41:40.000Z | 2018-06-06T19:41:40.000Z | envia_socket.py | EpsilonZ/Raspberry-Code-PTIN-2018 | 8d13703c0c42e336f3e3a28d96c344c23acff038 | [
"MIT"
] | null | null | null | envia_socket.py | EpsilonZ/Raspberry-Code-PTIN-2018 | 8d13703c0c42e336f3e3a28d96c344c23acff038 | [
"MIT"
] | null | null | null | from socketIO_client_nexus import SocketIO
# Clase usada para enviar y recibir informacion a traves de SocketIO, tanto para el servicio en paciente
# como el uso para el servicio de doctor
| 23.984848 | 104 | 0.72331 | from socketIO_client_nexus import SocketIO
# Clase usada para enviar y recibir informacion a traves de SocketIO, tanto para el servicio en paciente
# como el uso para el servicio de doctor
class socket:
def __init__(self, id):
self.id = id
self.socketIO = None
self.token = None
self.missatge_doctor = None
s... | 1,151 | -8 | 238 |
c0db8edaf297cf5715f56d65594a45c26ae74289 | 250 | py | Python | audio_book.py | Rishikeshrajrxl/Automate_python | 6e7a803632787bc442a8f10210d6c4dd124d3586 | [
"MIT"
] | null | null | null | audio_book.py | Rishikeshrajrxl/Automate_python | 6e7a803632787bc442a8f10210d6c4dd124d3586 | [
"MIT"
] | null | null | null | audio_book.py | Rishikeshrajrxl/Automate_python | 6e7a803632787bc442a8f10210d6c4dd124d3586 | [
"MIT"
] | null | null | null | import pyttsx3
import PyPDF2
book = open('b.pdf', 'rb')
pdfReader = PyPDF2.PdfFileReader(book)
pages = pdfReader.numPages
print(pages)
speaker = pyttsx3.init()
page=pdfReader.getPage(11)
txt = page.extractText()
speaker.say(txt)
speaker.runAndWait()
| 20.833333 | 38 | 0.764 | import pyttsx3
import PyPDF2
book = open('b.pdf', 'rb')
pdfReader = PyPDF2.PdfFileReader(book)
pages = pdfReader.numPages
print(pages)
speaker = pyttsx3.init()
page=pdfReader.getPage(11)
txt = page.extractText()
speaker.say(txt)
speaker.runAndWait()
| 0 | 0 | 0 |
85eca8a3d7e2bbd107a0297bfe1cf82faaa17234 | 1,799 | py | Python | src/show_manager.py | bradysalz/DCI-Scores-Bot-v2 | 67bebadbd41b59dfdfc645e3606232c71fb9e429 | [
"MIT"
] | 4 | 2017-07-19T04:33:57.000Z | 2018-05-01T20:29:22.000Z | src/show_manager.py | bradysalz/DCI-Scores-Bot-v2 | 67bebadbd41b59dfdfc645e3606232c71fb9e429 | [
"MIT"
] | null | null | null | src/show_manager.py | bradysalz/DCI-Scores-Bot-v2 | 67bebadbd41b59dfdfc645e3606232c71fb9e429 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import time
from typing import Dict
import pandas as pd
from src.web_bot import WebBot
from config import show_file, subreddit
class ShowManager(object):
"""Checks show lists for updates."""
def _add_show(self, show_info: Dict):
"""Adds a show to the current dataframe."""
... | 31.017241 | 79 | 0.5592 | #!/usr/bin/env python3
import time
from typing import Dict
import pandas as pd
from src.web_bot import WebBot
from config import show_file, subreddit
class ShowManager(object):
"""Checks show lists for updates."""
def __init__(self):
self.bot = WebBot(subreddit)
self.shows = None
def ... | 61 | 0 | 27 |
1d1ed216cef0d93ce447b126fb6bb7e03cce2642 | 618 | py | Python | developer/web_app/acceptance_tests/features/environment.py | techsparksguru/docker-for-all | 18d775d2276df0f8103c4688a3c3f30ca94f03f4 | [
"MIT"
] | 96 | 2016-09-08T14:21:09.000Z | 2022-03-30T04:56:19.000Z | developer/web_app/acceptance_tests/features/environment.py | techsparksguru/docker-for-all | 18d775d2276df0f8103c4688a3c3f30ca94f03f4 | [
"MIT"
] | 1 | 2017-12-13T15:49:40.000Z | 2020-08-16T17:03:32.000Z | developer/web_app/acceptance_tests/features/environment.py | techsparksguru/docker-for-all | 18d775d2276df0f8103c4688a3c3f30ca94f03f4 | [
"MIT"
] | 46 | 2016-09-08T20:51:27.000Z | 2021-10-20T01:28:29.000Z | from selenium import webdriver
import requests
# Scenario level objects are popped off context when scenario exits
| 20.6 | 67 | 0.73301 | from selenium import webdriver
import requests
def before_all(context):
print("Executing before all")
def before_feature(context, feature):
print("Before feature\n")
# Scenario level objects are popped off context when scenario exits
def before_scenario(context, scenario):
context.requests = reques... | 360 | 0 | 138 |
9463e2f2068ecaa3629fdb03f2984c55aff01e03 | 804 | py | Python | migrations/versions/e7c7c04b969c_.py | muthash/Weconnect-api | d3434c99b96a911258dfb8e3ff68696a2021a64b | [
"MIT"
] | 1 | 2018-03-15T17:08:11.000Z | 2018-03-15T17:08:11.000Z | migrations/versions/e7c7c04b969c_.py | muthash/Weconnect-api | d3434c99b96a911258dfb8e3ff68696a2021a64b | [
"MIT"
] | 1 | 2018-02-28T21:26:04.000Z | 2018-03-01T07:19:05.000Z | migrations/versions/e7c7c04b969c_.py | muthash/Weconnect-api | d3434c99b96a911258dfb8e3ff68696a2021a64b | [
"MIT"
] | 1 | 2018-03-09T03:45:22.000Z | 2018-03-09T03:45:22.000Z | """empty message
Revision ID: e7c7c04b969c
Revises: daf68fd7177e
Create Date: 2018-07-03 20:23:06.108653
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'e7c7c04b969c'
down_revision = 'daf68fd7177e'
branch_labels = None
depends_on = None
| 25.935484 | 106 | 0.696517 | """empty message
Revision ID: e7c7c04b969c
Revises: daf68fd7177e
Create Date: 2018-07-03 20:23:06.108653
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'e7c7c04b969c'
down_revision = 'daf68fd7177e'
branch_labels = None
depends_on = None
def upgrade():
# ... | 459 | 0 | 46 |
109f69aa6a58033a7c35b7991a785ed83b9a27ba | 1,582 | py | Python | tests/test_client.py | iwpnd/pyle38 | d2d6fa4e11b7444ed97df9152ee8e0a9dd0952d7 | [
"MIT"
] | 44 | 2021-04-08T07:06:19.000Z | 2022-02-16T15:06:05.000Z | tests/test_client.py | iwpnd/pyle38 | d2d6fa4e11b7444ed97df9152ee8e0a9dd0952d7 | [
"MIT"
] | 50 | 2021-04-19T10:03:12.000Z | 2022-03-03T16:13:50.000Z | tests/test_client.py | iwpnd/pyle38 | d2d6fa4e11b7444ed97df9152ee8e0a9dd0952d7 | [
"MIT"
] | 4 | 2021-04-29T08:20:21.000Z | 2022-03-12T07:28:19.000Z | import os
import pytest
from pyle38 import Tile38
from pyle38.client import Client
from pyle38.errors import Tile38Error, Tile38IdNotFoundError, Tile38KeyNotFoundError
@pytest.mark.asyncio
@pytest.mark.asyncio
@pytest.mark.asyncio
@pytest.mark.asyncio
@pytest.mark.asyncio
| 26.366667 | 84 | 0.693426 | import os
import pytest
from pyle38 import Tile38
from pyle38.client import Client
from pyle38.errors import Tile38Error, Tile38IdNotFoundError, Tile38KeyNotFoundError
@pytest.mark.asyncio
async def test_client():
client = Client(os.getenv("TILE38_LEADER_URI") or "redis://localhost:9851")
response = await ... | 1,187 | 0 | 110 |
91e703991068537450804d57bf35998349f41bb7 | 297 | py | Python | polog/tests/handlers/telegram/test_sender.py | Bce-OK/telegram_polog_handler | 7a53f6db8371d4dac2d8b19767c724aa2b22e349 | [
"MIT"
] | null | null | null | polog/tests/handlers/telegram/test_sender.py | Bce-OK/telegram_polog_handler | 7a53f6db8371d4dac2d8b19767c724aa2b22e349 | [
"MIT"
] | null | null | null | polog/tests/handlers/telegram/test_sender.py | Bce-OK/telegram_polog_handler | 7a53f6db8371d4dac2d8b19767c724aa2b22e349 | [
"MIT"
] | null | null | null | import time
import pytest
from polog.handlers.telegram.sender import TelegramSender
from polog import log, config
import sys
from my_config import MY_TOKEN, MY_CHAT
lst = []
config.add_handlers(TelegramSender(MY_TOKEN, MY_CHAT))
| 18.5625 | 57 | 0.777778 | import time
import pytest
from polog.handlers.telegram.sender import TelegramSender
from polog import log, config
import sys
from my_config import MY_TOKEN, MY_CHAT
lst = []
config.add_handlers(TelegramSender(MY_TOKEN, MY_CHAT))
def test_send_normal():
log('hello')
time.sleep(0.0001)
| 42 | 0 | 23 |
9ff7bbfe5173dd09e9ea49a444f87f9f8d928fca | 8,646 | py | Python | run.py | ingham-physics/xvi-archive-tool | 6f48cbac0c520f17bc1c6f4a4da2c9ccc2ca14b0 | [
"Apache-2.0"
] | null | null | null | run.py | ingham-physics/xvi-archive-tool | 6f48cbac0c520f17bc1c6f4a4da2c9ccc2ca14b0 | [
"Apache-2.0"
] | null | null | null | run.py | ingham-physics/xvi-archive-tool | 6f48cbac0c520f17bc1c6f4a4da2c9ccc2ca14b0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright 2022 University of New South Wales, Ingham Institute
# 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 ... | 38.945946 | 201 | 0.590909 | #!/usr/bin/python
# Copyright 2022 University of New South Wales, Ingham Institute
# 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 ... | 0 | 0 | 0 |
e67e71b51f6a07d7f12613f0635f9589b252590c | 1,879 | py | Python | code/python/echomesh/base/MakeEmptyProject.py | rec/echomesh | be668971a687b141660fd2e5635d2fd598992a01 | [
"MIT"
] | 30 | 2015-02-18T14:07:00.000Z | 2021-12-11T15:19:01.000Z | code/python/echomesh/base/MakeEmptyProject.py | rec/echomesh | be668971a687b141660fd2e5635d2fd598992a01 | [
"MIT"
] | 16 | 2015-01-01T23:17:24.000Z | 2015-04-18T23:49:27.000Z | code/python/echomesh/base/MakeEmptyProject.py | rec/echomesh | be668971a687b141660fd2e5635d2fd598992a01 | [
"MIT"
] | 31 | 2015-03-11T20:04:07.000Z | 2020-11-02T13:56:59.000Z | from __future__ import absolute_import, division, print_function, unicode_literals
import copy
import os.path
from echomesh.base import EmptyProject
from echomesh.base import MakeDirs
from echomesh.base import Name
_CREATE_MISSING_DIRECTORY_PROJECT = """
There doesn't seem to be an echomesh project in your director... | 26.842857 | 82 | 0.656732 | from __future__ import absolute_import, division, print_function, unicode_literals
import copy
import os.path
from echomesh.base import EmptyProject
from echomesh.base import MakeDirs
from echomesh.base import Name
_CREATE_MISSING_DIRECTORY_PROJECT = """
There doesn't seem to be an echomesh project in your director... | 896 | 0 | 69 |
96977edbbdb7cc6ff4d800c50fc5ca655ce4917f | 725 | py | Python | convert_data.py | Stomach-ache/Streaming-Tree | 6f160c7d92efb34d49998de543344567a19ce939 | [
"MIT"
] | 1 | 2020-09-11T18:34:02.000Z | 2020-09-11T18:34:02.000Z | convert_data.py | Stomach-ache/Streaming-Tree | 6f160c7d92efb34d49998de543344567a19ce939 | [
"MIT"
] | null | null | null | convert_data.py | Stomach-ache/Streaming-Tree | 6f160c7d92efb34d49998de543344567a19ce939 | [
"MIT"
] | null | null | null | from xclib.data import data_utils
import xclib.evaluation.xc_metrics as xc_metrics
import numpy as np
dataset = 'eurlex'
# Read file with features and labels
features, labels, num_samples, num_features, num_labels = data_utils.read_data('data/' + dataset +'/' + 'train.txt')
A, B = 0.55, 1.5
inv_propen = xc_metrics.co... | 38.157895 | 116 | 0.775172 | from xclib.data import data_utils
import xclib.evaluation.xc_metrics as xc_metrics
import numpy as np
dataset = 'eurlex'
# Read file with features and labels
features, labels, num_samples, num_features, num_labels = data_utils.read_data('data/' + dataset +'/' + 'train.txt')
A, B = 0.55, 1.5
inv_propen = xc_metrics.co... | 0 | 0 | 0 |
211071e3d64a7195e6c0275c451cf4d3ed83466b | 368 | py | Python | accounts.py | prisme60/horaire | 84b9b2610c2dd730bee8380e9d12ae6bdeeb90c1 | [
"BSD-2-Clause"
] | 2 | 2015-12-18T17:59:23.000Z | 2016-04-05T17:15:22.000Z | accounts.py | prisme60/horaire | 84b9b2610c2dd730bee8380e9d12ae6bdeeb90c1 | [
"BSD-2-Clause"
] | null | null | null | accounts.py | prisme60/horaire | 84b9b2610c2dd730bee8380e9d12ae6bdeeb90c1 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python3
if __name__ == '__main__':
print( 'URL : ' + Accounts.the_url)
for a in Accounts.accounts:
print(repr(a) + ' : ' + repr(Accounts.accounts[a]))
| 26.285714 | 59 | 0.543478 | #!/usr/bin/python3
class Accounts:
the_url = 'https://smsapi.free-mobile.fr/sendmsg'
accounts = { 'cf' : {'user' : 'loginNumber',
'pass' : 'PaSsWoRdStRiNg' }
}
if __name__ == '__main__':
print( 'URL : ' + Accounts.the_url)
for a in Accounts.accounts:
prin... | 0 | 166 | 23 |
150fa1e310a5db347040639d51d2f5ba4bdf3ba1 | 277 | py | Python | pylaser/__init__.py | andersroos/pylaser | d96e1a76b47c5a81ed8eb9c3cb96d88d82e3d530 | [
"Apache-2.0"
] | null | null | null | pylaser/__init__.py | andersroos/pylaser | d96e1a76b47c5a81ed8eb9c3cb96d88d82e3d530 | [
"Apache-2.0"
] | null | null | null | pylaser/__init__.py | andersroos/pylaser | d96e1a76b47c5a81ed8eb9c3cb96d88d82e3d530 | [
"Apache-2.0"
] | null | null | null |
from pylaser.raw import Point, Box, Polyline, Circle, Group, write
from pylaser.derived import BoxEdge
__doc__ = """
Positive x is right and positive y is up.
"""
__all__ = [
'Point',
'Box',
'Polyline',
'Circle',
'Group',
'write',
'BoxEdge',
]
| 13.85 | 66 | 0.606498 |
from pylaser.raw import Point, Box, Polyline, Circle, Group, write
from pylaser.derived import BoxEdge
__doc__ = """
Positive x is right and positive y is up.
"""
__all__ = [
'Point',
'Box',
'Polyline',
'Circle',
'Group',
'write',
'BoxEdge',
]
| 0 | 0 | 0 |
c80e4facf3d610e6e9487072c7ca1e6d694aef0e | 2,766 | py | Python | src/redirect_lib/schedule_parser/weekday_schedule/structs.py | sujaldev/onelink | a13db45c358cca4101c4179a949d8602511f8f28 | [
"MIT"
] | 2 | 2022-01-06T16:15:48.000Z | 2022-01-07T00:46:23.000Z | src/redirect_lib/schedule_parser/weekday_schedule/structs.py | sujaldev/onelink | a13db45c358cca4101c4179a949d8602511f8f28 | [
"MIT"
] | null | null | null | src/redirect_lib/schedule_parser/weekday_schedule/structs.py | sujaldev/onelink | a13db45c358cca4101c4179a949d8602511f8f28 | [
"MIT"
] | 1 | 2022-01-19T02:32:48.000Z | 2022-01-19T02:32:48.000Z | from datetime import datetime
| 26.09434 | 82 | 0.567968 | from datetime import datetime
def abbreviate_long_string(s, max_length=15):
if len(s) > max_length:
return s[:max_length - 3] + "..."
return s
def current_time():
fmt = "%d %H:%M"
time = datetime.now().strftime("0%u %H:%M")
return datetime.strptime(time, fmt)
class WeekSchedule:
de... | 2,201 | -14 | 544 |
6e0cbe7cf79e8f9c2b60838b06a45e530a269a9e | 1,374 | py | Python | modern/tests/conftest.py | dvirtz/conan-docker-tools | fa69dec217351fb945c80d8d367ba8dc1eaa006c | [
"MIT"
] | 212 | 2017-07-09T15:00:28.000Z | 2022-02-22T21:41:43.000Z | modern/tests/conftest.py | dvirtz/conan-docker-tools | fa69dec217351fb945c80d8d367ba8dc1eaa006c | [
"MIT"
] | 262 | 2017-05-31T22:36:40.000Z | 2022-03-28T15:25:24.000Z | modern/tests/conftest.py | dvirtz/conan-docker-tools | fa69dec217351fb945c80d8d367ba8dc1eaa006c | [
"MIT"
] | 99 | 2017-08-09T05:03:02.000Z | 2022-03-02T21:01:47.000Z | import pytest
docker_compose_services = ['base',
# 'builder', This is just a helper image, do we need to test it?
'deploy',
'jenkins',
'xtest']
pytest_plugins = [
"fixtures.container",
"fixtures.expect... | 39.257143 | 137 | 0.614993 | import pytest
docker_compose_services = ['base',
# 'builder', This is just a helper image, do we need to test it?
'deploy',
'jenkins',
'xtest']
pytest_plugins = [
"fixtures.container",
"fixtures.expect... | 975 | 0 | 69 |
62b99e24ffe7cb8cd5ed582906c30cec56623044 | 1,761 | py | Python | medium/137-single-number-ii.py | wanglongjiang/leetcode | c61d2e719e81575cfb5bde9d64e15cee7cf01ef3 | [
"MIT"
] | 2 | 2021-03-14T11:38:26.000Z | 2021-03-14T11:38:30.000Z | medium/137-single-number-ii.py | wanglongjiang/leetcode | c61d2e719e81575cfb5bde9d64e15cee7cf01ef3 | [
"MIT"
] | null | null | null | medium/137-single-number-ii.py | wanglongjiang/leetcode | c61d2e719e81575cfb5bde9d64e15cee7cf01ef3 | [
"MIT"
] | 1 | 2022-01-17T19:33:23.000Z | 2022-01-17T19:33:23.000Z | '''
只出现一次的数字 II
给定一个非空整数数组,除了某个元素只出现一次以外,其余每个元素均出现了三次。找出那个只出现了一次的元素。
说明:
你的算法应该具有线性时间复杂度。 你可以不使用额外空间来实现吗?
'''
from typing import List
'''
思路:快排算法里面的分区。
随机从nums中选取pivot,利用快速排序算法里面的分区函数,分成2个区,<pivot的 和 >=pivot的。如果其中一个分区大小不是3的整数倍,
说明目标元素出现在那个分区。需要继续对分区进行再分区。重复分区过程,直至有分区大小==1,则返回该分区的数。
时间复杂度:O(n),快排的时间复杂度为O(nlogn),这里... | 26.283582 | 75 | 0.53833 | '''
只出现一次的数字 II
给定一个非空整数数组,除了某个元素只出现一次以外,其余每个元素均出现了三次。找出那个只出现了一次的元素。
说明:
你的算法应该具有线性时间复杂度。 你可以不使用额外空间来实现吗?
'''
from typing import List
'''
思路:快排算法里面的分区。
随机从nums中选取pivot,利用快速排序算法里面的分区函数,分成2个区,<pivot的 和 >=pivot的。如果其中一个分区大小不是3的整数倍,
说明目标元素出现在那个分区。需要继续对分区进行再分区。重复分区过程,直至有分区大小==1,则返回该分区的数。
时间复杂度:O(n),快排的时间复杂度为O(nlogn),这里... | 1,160 | -6 | 75 |
69c33fc44ab726c3531d2a9f8eef8ccce76ead89 | 2,624 | py | Python | Metrics/setVerticalMetrics.py | protimient/Glyphs-Scripts | 0481ea01153844667cff8cfa3fad97c33af09956 | [
"Apache-2.0"
] | 2 | 2021-02-12T20:36:29.000Z | 2021-11-03T08:04:01.000Z | Metrics/setVerticalMetrics.py | protimient/Glyphs-Scripts | 0481ea01153844667cff8cfa3fad97c33af09956 | [
"Apache-2.0"
] | null | null | null | Metrics/setVerticalMetrics.py | protimient/Glyphs-Scripts | 0481ea01153844667cff8cfa3fad97c33af09956 | [
"Apache-2.0"
] | null | null | null | # MenuTitle: Set Vertical Metrics
# -*- coding: utf-8 -*-
__doc__ = """
Sets the vertical metrics based on the yMax/yMin and typographic values.
"""
from collections import defaultdict
Glyphs.clearLog()
setVerticalMetrics()
| 36.957746 | 113 | 0.599848 | # MenuTitle: Set Vertical Metrics
# -*- coding: utf-8 -*-
__doc__ = """
Sets the vertical metrics based on the yMax/yMin and typographic values.
"""
from collections import defaultdict
Glyphs.clearLog()
class setVerticalMetrics:
def __init__(self):
self.makeitso()
def get_extremes(self, master):
... | 2,290 | 4 | 103 |
a6f8fff03df36ff7fa49ad077cd208956944af05 | 695 | py | Python | src/datasets/root_paths.py | shgoren/viewmaker | d9a7d4b05ac5126fe348c8c5217877ebcff7e2d7 | [
"MIT"
] | 29 | 2021-04-09T16:02:21.000Z | 2022-03-08T13:04:45.000Z | src/datasets/root_paths.py | shgoren/viewmaker | d9a7d4b05ac5126fe348c8c5217877ebcff7e2d7 | [
"MIT"
] | 2 | 2021-06-07T14:49:17.000Z | 2021-12-11T17:39:01.000Z | src/datasets/root_paths.py | shgoren/viewmaker | d9a7d4b05ac5126fe348c8c5217877ebcff7e2d7 | [
"MIT"
] | 9 | 2021-04-19T13:12:45.000Z | 2022-03-07T20:50:28.000Z | DATA_ROOTS = {
'cifar10': 'data/cifar10',
'meta_aircraft': 'data/aircraft/fgvc-aircraft-2013b',
'meta_cu_birds': 'data/cu_birds/CUB_200_2011',
'meta_dtd': 'data/dtd/dtd',
'meta_fashionmnist': 'data/fashionmnist',
'meta_fungi': 'data/fungi',
'meta_mnist': 'data/mnist',
'meta_mscoco': 'dat... | 38.611111 | 57 | 0.679137 | DATA_ROOTS = {
'cifar10': 'data/cifar10',
'meta_aircraft': 'data/aircraft/fgvc-aircraft-2013b',
'meta_cu_birds': 'data/cu_birds/CUB_200_2011',
'meta_dtd': 'data/dtd/dtd',
'meta_fashionmnist': 'data/fashionmnist',
'meta_fungi': 'data/fungi',
'meta_mnist': 'data/mnist',
'meta_mscoco': 'dat... | 0 | 0 | 0 |
f206477822ad9e9c9e7efc311f3ec97a3a8e813b | 87 | py | Python | WHILE NUMEROS PARES SEM IF.py | RODRIGOKTK/Python-exercicios | f7985f2c277aae8b158bdeea4f2493febaaf06c5 | [
"Unlicense"
] | null | null | null | WHILE NUMEROS PARES SEM IF.py | RODRIGOKTK/Python-exercicios | f7985f2c277aae8b158bdeea4f2493febaaf06c5 | [
"Unlicense"
] | null | null | null | WHILE NUMEROS PARES SEM IF.py | RODRIGOKTK/Python-exercicios | f7985f2c277aae8b158bdeea4f2493febaaf06c5 | [
"Unlicense"
] | null | null | null | numero = int(input('Numero : '))
x=0
while x <= numero:
print (x)
x = x + 2 | 17.4 | 33 | 0.494253 | numero = int(input('Numero : '))
x=0
while x <= numero:
print (x)
x = x + 2 | 0 | 0 | 0 |
55f7064c0bb4431c4d5f970133b0523332b02791 | 7,522 | py | Python | src/lib/sfnutils.py | GiselleSerate/pandorica | 4f0b6e87c49c1d4461eafbbff375e393d2ae1b52 | [
"Apache-2.0"
] | 1 | 2019-05-23T23:46:37.000Z | 2019-05-23T23:46:37.000Z | src/lib/sfnutils.py | GiselleSerate/pandorica | 4f0b6e87c49c1d4461eafbbff375e393d2ae1b52 | [
"Apache-2.0"
] | 19 | 2019-06-30T00:35:37.000Z | 2019-08-09T00:00:40.000Z | src/lib/sfnutils.py | GiselleSerate/pandorica | 4f0b6e87c49c1d4461eafbbff375e393d2ae1b52 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019, Palo Alto Networks
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS... | 36.514563 | 106 | 0.6364 | # Copyright (c) 2019, Palo Alto Networks
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS... | 268 | 0 | 23 |
d1e7c023c9ac548e95792333493c2e4be882773e | 32 | py | Python | scheduler/apps.py | qiz216/Mindlog_Final | 1f44fe883571d3389b61b802687ef4dc5dc16763 | [
"MIT"
] | null | null | null | scheduler/apps.py | qiz216/Mindlog_Final | 1f44fe883571d3389b61b802687ef4dc5dc16763 | [
"MIT"
] | null | null | null | scheduler/apps.py | qiz216/Mindlog_Final | 1f44fe883571d3389b61b802687ef4dc5dc16763 | [
"MIT"
] | 1 | 2020-09-28T00:15:41.000Z | 2020-09-28T00:15:41.000Z | from django.conf import settings | 32 | 32 | 0.875 | from django.conf import settings | 0 | 0 | 0 |
287bf2d81040e813556a31174414c6f246e44829 | 1,035 | py | Python | coffee_machines/models.py | AmienKhaled/backend-challenge | 1a6610ccb5ad4629c4cbd95f29c32a201ee9b813 | [
"MIT"
] | null | null | null | coffee_machines/models.py | AmienKhaled/backend-challenge | 1a6610ccb5ad4629c4cbd95f29c32a201ee9b813 | [
"MIT"
] | null | null | null | coffee_machines/models.py | AmienKhaled/backend-challenge | 1a6610ccb5ad4629c4cbd95f29c32a201ee9b813 | [
"MIT"
] | null | null | null | from django.db import models
class CoffeeMachines(models.Model):
"""Models class of the coffee machines"""
COFFEE_MACHINE_SMALL = 'S'
COFFEE_MACHINE_LARGE = 'L'
ESPRESSO_MACHINE = 'E'
BASE_CLASS = 'B'
PREMIUM_CLASS = 'P'
DELUXE_CLASS = 'D'
TYPES_CHOICES = [
(COFFEE_MACHINE_SM... | 23.522727 | 62 | 0.638647 | from django.db import models
class CoffeeMachines(models.Model):
"""Models class of the coffee machines"""
COFFEE_MACHINE_SMALL = 'S'
COFFEE_MACHINE_LARGE = 'L'
ESPRESSO_MACHINE = 'E'
BASE_CLASS = 'B'
PREMIUM_CLASS = 'P'
DELUXE_CLASS = 'D'
TYPES_CHOICES = [
(COFFEE_MACHINE_SM... | 22 | 0 | 27 |
4e23a034187d0e2391dc3fa2bd60e7c1b65f3ed0 | 3,422 | py | Python | scipts/get_statistics.py | brajagopalcse/SDoH_NLPend2end | 28743f45b3e6880624a48db4eeb6bdf3e3f4e27a | [
"MIT"
] | 5 | 2021-09-03T13:07:36.000Z | 2022-01-06T03:22:09.000Z | scipts/get_statistics.py | brajagopalcse/SDoH_NLPend2end | 28743f45b3e6880624a48db4eeb6bdf3e3f4e27a | [
"MIT"
] | 4 | 2021-09-03T01:31:04.000Z | 2022-01-13T15:11:09.000Z | scipts/get_statistics.py | brajagopalcse/SDoH_NLPend2end | 28743f45b3e6880624a48db4eeb6bdf3e3f4e27a | [
"MIT"
] | 1 | 2022-03-18T01:01:22.000Z | 2022-03-18T01:01:22.000Z | #get stat result
from pathlib import Path
import numpy as np
import os
import pickle as pkl
import sys
import pandas as pd
data_dir1=sys.argv[1]
data_dir2=sys.argv[2]
dict1=ann_stat(data_dir1)
dict2=ann_stat(data_dir2)
pd_null,pd_pts,pd_dict_agg=find_agg_data(dict1)
gs_null,gs_pts,gs_dict_agg=find_agg_data(dict2)
... | 30.283186 | 90 | 0.582992 | #get stat result
from pathlib import Path
import numpy as np
import os
import pickle as pkl
import sys
import pandas as pd
def pkl_save(data, file):
with open(file, "wb") as f:
pkl.dump(data, f)
def pkl_load(file):
with open(file, "rb") as f:
data = pkl.load(f)
return data
def ann_stat(dat... | 2,097 | 0 | 157 |
d2d922826eff15d1c32e5980613beb24e7d57092 | 967 | py | Python | tests/pycodeanalyzer/core/logging/test_logging.py | miong/pycodeanalyzer | 6728d8f77385a1145db67952167710cf412b2343 | [
"MIT"
] | 3 | 2022-03-25T16:13:16.000Z | 2022-03-26T06:42:39.000Z | tests/pycodeanalyzer/core/logging/test_logging.py | miong/pycodeanalyzer | 6728d8f77385a1145db67952167710cf412b2343 | [
"MIT"
] | null | null | null | tests/pycodeanalyzer/core/logging/test_logging.py | miong/pycodeanalyzer | 6728d8f77385a1145db67952167710cf412b2343 | [
"MIT"
] | null | null | null | import pytest
import logging
from pycodeanalyzer.core.logging.loggerfactory import LoggerFactory
| 35.814815 | 68 | 0.681489 | import pytest
import logging
from pycodeanalyzer.core.logging.loggerfactory import LoggerFactory
class TestLoggerFactory:
def test_init(self):
LoggerFactory.init()
assert logging.root == LoggerFactory.defaultLogger
assert logging.root.level == logging.INFO
def test_setLog... | 779 | 3 | 83 |
4d7bee0a4db0e592ef9d6678de5d401fdd657b2b | 4,270 | py | Python | packman/utils/files.py | audoh/packager | 299f297da8465ec40eb9ffffa40fcfaa6bcf0102 | [
"MIT"
] | null | null | null | packman/utils/files.py | audoh/packager | 299f297da8465ec40eb9ffffa40fcfaa6bcf0102 | [
"MIT"
] | null | null | null | packman/utils/files.py | audoh/packager | 299f297da8465ec40eb9ffffa40fcfaa6bcf0102 | [
"MIT"
] | null | null | null | import hashlib
import os
import shutil
import sys
import tempfile
from pathlib import Path
from types import TracebackType
from typing import Callable, Tuple, Type
from uuid import uuid4
import appdirs
from loguru import logger
if os.name == "nt":
import win32api
import win32con
global FILE_ATTRIBUTE_HID... | 26.358025 | 117 | 0.625995 | import hashlib
import os
import shutil
import sys
import tempfile
from pathlib import Path
from types import TracebackType
from typing import Callable, Tuple, Type
from uuid import uuid4
import appdirs
from loguru import logger
if os.name == "nt":
import win32api
import win32con
global FILE_ATTRIBUTE_HID... | 2,365 | 0 | 230 |
a69a0065aa472d925bbfde8f2134f673b65c73e7 | 940 | py | Python | files and exceptions/files/text files/examples/files.py | DarkShadow4/python | 4cd94e0cf53ee06c9c31e9272572ca9656697c30 | [
"MIT"
] | null | null | null | files and exceptions/files/text files/examples/files.py | DarkShadow4/python | 4cd94e0cf53ee06c9c31e9272572ca9656697c30 | [
"MIT"
] | null | null | null | files and exceptions/files/text files/examples/files.py | DarkShadow4/python | 4cd94e0cf53ee06c9c31e9272572ca9656697c30 | [
"MIT"
] | 1 | 2020-08-19T17:25:22.000Z | 2020-08-19T17:25:22.000Z | #### #### #### #### FILES #### #### #### ####
#### #### OPENING FILES #### ####
filename = "pi.txt"
#### EXAMPLE 1 ####
with open(filename) as Pi:
pi_number = Pi.read()
print pi_number.rstrip()
#### EXAMPLE 2 ####
with open(filename) as Pi:
for line in Pi:
print line.rstrip()
... | 18.431373 | 81 | 0.521277 | #### #### #### #### FILES #### #### #### ####
#### #### OPENING FILES #### ####
filename = "pi.txt"
#### EXAMPLE 1 ####
with open(filename) as Pi:
pi_number = Pi.read()
print pi_number.rstrip()
#### EXAMPLE 2 ####
with open(filename) as Pi:
for line in Pi:
print line.rstrip()
... | 0 | 0 | 0 |
8b64cc620e271e94c4e1f7f13e61a0ba37fac2e7 | 7,296 | py | Python | services/facility_queue/facility_queue.py | Theodlz/skyportal | 5efd76150d14282d592a7fd5dafc05bb92b6ec5e | [
"BSD-3-Clause"
] | 1 | 2022-01-14T10:32:04.000Z | 2022-01-14T10:32:04.000Z | services/facility_queue/facility_queue.py | Theodlz/skyportal | 5efd76150d14282d592a7fd5dafc05bb92b6ec5e | [
"BSD-3-Clause"
] | null | null | null | services/facility_queue/facility_queue.py | Theodlz/skyportal | 5efd76150d14282d592a7fd5dafc05bb92b6ec5e | [
"BSD-3-Clause"
] | 1 | 2021-11-28T21:00:02.000Z | 2021-11-28T21:00:02.000Z | # For Michael, an example test run with Curl:
#
# curl -X POST http://localhost:64510 -d '{"method": "GET", "endpoint": "http://localhost:9980"}'
#
from datetime import datetime, timedelta
import time
import tornado.ioloop
import tornado.web
import asyncio
from tornado.ioloop import IOLoop
import tornado.escape
impor... | 35.417476 | 147 | 0.501508 | # For Michael, an example test run with Curl:
#
# curl -X POST http://localhost:64510 -d '{"method": "GET", "endpoint": "http://localhost:9980"}'
#
from datetime import datetime, timedelta
import time
import tornado.ioloop
import tornado.web
import asyncio
from tornado.ioloop import IOLoop
import tornado.escape
impor... | 6,021 | 40 | 152 |
3bab2512a8972dd30cfa12fa753c5fda9bec838a | 10,241 | py | Python | vl/controllers/default_controller.py | verifid/vl | 39fb3056658fbc2360eb3d8bfcd74bdcfd12cc67 | [
"MIT"
] | 3 | 2019-06-30T21:09:05.000Z | 2021-05-09T17:56:19.000Z | vl/controllers/default_controller.py | verifid/vl | 39fb3056658fbc2360eb3d8bfcd74bdcfd12cc67 | [
"MIT"
] | null | null | null | vl/controllers/default_controller.py | verifid/vl | 39fb3056658fbc2360eb3d8bfcd74bdcfd12cc67 | [
"MIT"
] | null | null | null | import os
import connexion
import uuid
import asyncio
import json
import cv2
import requests
import base64
from vl.models.api_response import ApiResponse # noqa: E501
from vl.models.error import Error # noqa: E501
from vl.models.user import User # noqa: E501
from vl.models.user_data_response import UserDataResponse... | 31.804348 | 89 | 0.631384 | import os
import connexion
import uuid
import asyncio
import json
import cv2
import requests
import base64
from vl.models.api_response import ApiResponse # noqa: E501
from vl.models.error import Error # noqa: E501
from vl.models.user import User # noqa: E501
from vl.models.user_data_response import UserDataResponse... | 3,820 | 0 | 253 |
9c56682758647f5e7eec33b686a3f6d4b097b63c | 457 | py | Python | curso_em_video/mundo_1/exs_python/ExPy026.py | LuiZamberlan/Ex.-Python | f5b6e4782e0ce0e3fead82b126b52588e1bc21b0 | [
"MIT"
] | 1 | 2020-09-19T21:39:12.000Z | 2020-09-19T21:39:12.000Z | curso_em_video/mundo_1/exs_python/ExPy026.py | LuiZamberlan/Ex.-Python | f5b6e4782e0ce0e3fead82b126b52588e1bc21b0 | [
"MIT"
] | null | null | null | curso_em_video/mundo_1/exs_python/ExPy026.py | LuiZamberlan/Ex.-Python | f5b6e4782e0ce0e3fead82b126b52588e1bc21b0 | [
"MIT"
] | null | null | null | f = str(input('Digite uma frase: ')).strip().lower()
print(f'Quantas vezes aparece a letra "a"? {f.count("a")}')
#O método count() contará quantos 'a's tem na string
print(f'Qual foi a 1° vez que apareceu? Na {f.find("a") + 1}° Posição')
#O método find() indicará qual o index do 1° 'a' na string
print(f'Qual foi a u... | 41.545455 | 79 | 0.676149 | f = str(input('Digite uma frase: ')).strip().lower()
print(f'Quantas vezes aparece a letra "a"? {f.count("a")}')
#O método count() contará quantos 'a's tem na string
print(f'Qual foi a 1° vez que apareceu? Na {f.find("a") + 1}° Posição')
#O método find() indicará qual o index do 1° 'a' na string
print(f'Qual foi a u... | 0 | 0 | 0 |
6123d914bb9b579ac65cb97c24e142327f4bfee7 | 3,312 | py | Python | salt/_compat.py | styro/salt | d087d94dca02ca8bf53a6c21b94944bc7957522c | [
"Apache-2.0"
] | 3 | 2016-09-03T06:26:42.000Z | 2019-06-30T13:04:53.000Z | salt/_compat.py | styro/salt | d087d94dca02ca8bf53a6c21b94944bc7957522c | [
"Apache-2.0"
] | null | null | null | salt/_compat.py | styro/salt | d087d94dca02ca8bf53a6c21b94944bc7957522c | [
"Apache-2.0"
] | 1 | 2021-12-02T15:30:00.000Z | 2021-12-02T15:30:00.000Z | # -*- coding: utf-8 -*-
'''
Salt compatibility code
'''
# pylint: disable=import-error,unused-import
# Import python libs
import sys
import types
# Import 3rd-party libs
from salt.ext.six import binary_type, string_types, text_type
from salt.ext.six.moves import cStringIO, StringIO
try:
import cPickle as pickle
... | 26.496 | 75 | 0.612017 | # -*- coding: utf-8 -*-
'''
Salt compatibility code
'''
# pylint: disable=import-error,unused-import
# Import python libs
import sys
import types
# Import 3rd-party libs
from salt.ext.six import binary_type, string_types, text_type
from salt.ext.six.moves import cStringIO, StringIO
try:
import cPickle as pickle
... | 205 | 0 | 52 |
852625cc4e415ed2d397e9e97231b1aec8ad90b5 | 383 | py | Python | main.py | manunapo/windows-task-helper | 97a15063c53b9687dfe85b0cc4c6e657b61ab25c | [
"MIT"
] | null | null | null | main.py | manunapo/windows-task-helper | 97a15063c53b9687dfe85b0cc4c6e657b61ab25c | [
"MIT"
] | null | null | null | main.py | manunapo/windows-task-helper | 97a15063c53b9687dfe85b0cc4c6e657b61ab25c | [
"MIT"
] | null | null | null | from config.configshandler import GlobalConfigs as cfg_hnd
from app.applicationhandler import ApplicationHandler
import logging
import logging.config
if __name__ == '__main__':
logging.config.fileConfig('./log/logging.conf')
logger = logging.getLogger(__name__)
cfg_hnd.load()
logger.debug(f'Loaded conf... | 34.818182 | 58 | 0.772846 | from config.configshandler import GlobalConfigs as cfg_hnd
from app.applicationhandler import ApplicationHandler
import logging
import logging.config
if __name__ == '__main__':
logging.config.fileConfig('./log/logging.conf')
logger = logging.getLogger(__name__)
cfg_hnd.load()
logger.debug(f'Loaded conf... | 0 | 0 | 0 |
1e28e47bf817b18586bba3262ba9c45e5cf5b837 | 1,841 | py | Python | apps/client/views.py | ztf0413/demo | 842b5edc372245d1a038ddeb01698ae7398164f1 | [
"Apache-2.0"
] | null | null | null | apps/client/views.py | ztf0413/demo | 842b5edc372245d1a038ddeb01698ae7398164f1 | [
"Apache-2.0"
] | 3 | 2020-06-06T01:29:17.000Z | 2020-08-21T02:44:30.000Z | apps/client/views.py | ztf0413/demo | 842b5edc372245d1a038ddeb01698ae7398164f1 | [
"Apache-2.0"
] | null | null | null | from django.http import JsonResponse
from django.views import View
# Create your views here.
from apps.client.models import ClientTest
class IndexView(View):
"""
客户端上传客户端号和分数
"""
class ChartsView(View):
"""
客户端查询排行榜
"""
| 32.298246 | 87 | 0.548615 | from django.http import JsonResponse
from django.views import View
# Create your views here.
from apps.client.models import ClientTest
class IndexView(View):
"""
客户端上传客户端号和分数
"""
def post(self, request):
name = request.POST.get("name", "")
score = request.POST.get("score", "")
... | 1,593 | 0 | 54 |
d36a9a428cf009c6dec54194ea0d9b1f1b61dcc6 | 6,170 | py | Python | maputils/fix_mapfile.py | AstunTechnology/mapserver-upgrade-config | caf26a41c7dab4c81c5cec13ed1343fe3d78d06b | [
"MIT"
] | null | null | null | maputils/fix_mapfile.py | AstunTechnology/mapserver-upgrade-config | caf26a41c7dab4c81c5cec13ed1343fe3d78d06b | [
"MIT"
] | 6 | 2017-01-24T15:48:30.000Z | 2019-06-18T14:24:25.000Z | maputils/fix_mapfile.py | AstunTechnology/mapserver-upgrade-config | caf26a41c7dab4c81c5cec13ed1343fe3d78d06b | [
"MIT"
] | 2 | 2017-01-24T11:04:16.000Z | 2019-04-11T08:14:48.000Z | #!/usr/bin/python
from __future__ import print_function
import argparse
import sys
# open the MapFile
class fix_mapfile:
"""A class to fix mapfiles while moving from 6.0 to 6.4.
See UTILS-328 for full discussion, basically move validation patterns from METADATA to VALIDATION
blocks.
... | 39.050633 | 164 | 0.453647 | #!/usr/bin/python
from __future__ import print_function
import argparse
import sys
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
# open the MapFile
class fix_mapfile:
"""A class to fix mapfiles while moving from 6.0 to 6.4.
See UTILS-328 for full discussion, basically move val... | 1,463 | 0 | 99 |