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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
539189bc34fac0ccbcd5cd2cd5682646c8fc21fa | 639 | py | Python | setup.py | elonhub/papers | 27636eadb6836b672301eaee64b61200fc89ed78 | [
"MIT"
] | 105 | 2018-05-25T20:45:34.000Z | 2022-03-30T05:10:18.000Z | setup.py | elonhub/papers | 27636eadb6836b672301eaee64b61200fc89ed78 | [
"MIT"
] | 18 | 2017-12-02T12:56:10.000Z | 2022-02-20T21:32:26.000Z | setup.py | perrette/myref | a7417ea82ebb296ef5517ea00e21e54b97a1ed78 | [
"MIT"
] | 23 | 2017-12-23T14:28:14.000Z | 2022-01-26T10:01:49.000Z | from distutils.core import setup
import versioneer
version = versioneer.get_version()
setup(name='papers-cli',
version=version,
cmdclass = versioneer.get_cmdclass(),
author='Mahe Perrette',
author_email='mahe.perrette@gmail.com',
description='utilities to keep your PDF library organized'... | 33.631579 | 93 | 0.671362 | from distutils.core import setup
import versioneer
version = versioneer.get_version()
setup(name='papers-cli',
version=version,
cmdclass = versioneer.get_cmdclass(),
author='Mahe Perrette',
author_email='mahe.perrette@gmail.com',
description='utilities to keep your PDF library organized'... | 0 | 0 | 0 |
f47952bf3243e98c7839fafda31165a7f8fed6ab | 2,929 | py | Python | pygears/common/cart.py | Risto97/pygears | 19393e85101a16762cb3bbbf3010946ef69217f2 | [
"MIT"
] | null | null | null | pygears/common/cart.py | Risto97/pygears | 19393e85101a16762cb3bbbf3010946ef69217f2 | [
"MIT"
] | null | null | null | pygears/common/cart.py | Risto97/pygears | 19393e85101a16762cb3bbbf3010946ef69217f2 | [
"MIT"
] | null | null | null | from pygears.core.gear import alternative, gear
from pygears.typing import Queue, Tuple, typeof
from pygears.common.shred import shred
from pygears.common.ccat import ccat
from pygears.util.utils import quiter_async
from pygears import module
@gear(enablement=b'len(din) == 2')
@alternative(cart)
@gear
# TODO: L... | 26.387387 | 79 | 0.615227 | from pygears.core.gear import alternative, gear
from pygears.typing import Queue, Tuple, typeof
from pygears.common.shred import shred
from pygears.common.ccat import ccat
from pygears.util.utils import quiter_async
from pygears import module
def lvl_if_queue(t):
if not issubclass(t, Queue):
return 0
... | 2,264 | 0 | 178 |
6cce156e9dd815f900433f2cbb598128c23c884a | 2,357 | py | Python | parsedata_jhu.py | manar-c/covid19intexas | e1f69717aa8c6dbf1920fd771de0d9525e9e1bbb | [
"MIT"
] | null | null | null | parsedata_jhu.py | manar-c/covid19intexas | e1f69717aa8c6dbf1920fd771de0d9525e9e1bbb | [
"MIT"
] | null | null | null | parsedata_jhu.py | manar-c/covid19intexas | e1f69717aa8c6dbf1920fd771de0d9525e9e1bbb | [
"MIT"
] | null | null | null |
import pandas as pd
import requests
import io
import numpy as np
#Goal: go through daily reports of JHU to get data for
# Texas, Travis, Harris, Dallas
baseurl = 'https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_daily_reports/'
#Start from March 1
#March 1 to March ... | 26.483146 | 124 | 0.562155 |
import pandas as pd
import requests
import io
import numpy as np
#Goal: go through daily reports of JHU to get data for
# Texas, Travis, Harris, Dallas
baseurl = 'https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_daily_reports/'
#Start from March 1
#March 1 to March ... | 0 | 0 | 0 |
5cecff2de7c350bc190f3cf7900410255d462c2e | 1,905 | py | Python | DeSSL/transforms/transform_many_times.py | Fragile-azalea/SSL-toolk | 4562901e5deb59605a9a191fe74adbb3de96bfc3 | [
"MIT"
] | 1 | 2021-12-15T02:32:30.000Z | 2021-12-15T02:32:30.000Z | DeSSL/transforms/transform_many_times.py | Fragile-azalea/SSL-toolkit | 4562901e5deb59605a9a191fe74adbb3de96bfc3 | [
"MIT"
] | null | null | null | DeSSL/transforms/transform_many_times.py | Fragile-azalea/SSL-toolkit | 4562901e5deb59605a9a191fe74adbb3de96bfc3 | [
"MIT"
] | null | null | null | from typing import Callable
from torchvision import transforms as tf
from . import TRANSFORM_REGISTRY
__all__ = ['ManyTimes', 'Twice']
@TRANSFORM_REGISTRY.register
class IdentityAndManyTimes:
"""
This class changes an image to a normalized tensor image and a series of augmented image.
Args:
tra... | 25.065789 | 93 | 0.612073 | from typing import Callable
from torchvision import transforms as tf
from . import TRANSFORM_REGISTRY
__all__ = ['ManyTimes', 'Twice']
@TRANSFORM_REGISTRY.register
class IdentityAndManyTimes:
"""
This class changes an image to a normalized tensor image and a series of augmented image.
Args:
tra... | 462 | 0 | 108 |
ec11f7fd973b9babc2b655f4e09d0c98675c49fa | 379 | py | Python | netqasm/examples/apps/anonymous_transmission/app_charlie.py | Doomsk/netqasm | 5d6c6ad00c4e0f9ab0ec05518cfa827675f357e7 | [
"MIT"
] | 6 | 2021-11-10T15:03:59.000Z | 2022-02-16T19:35:01.000Z | netqasm/examples/apps/anonymous_transmission/app_charlie.py | Doomsk/netqasm | 5d6c6ad00c4e0f9ab0ec05518cfa827675f357e7 | [
"MIT"
] | 13 | 2021-11-26T09:19:46.000Z | 2022-03-29T09:21:42.000Z | netqasm/examples/apps/anonymous_transmission/app_charlie.py | Doomsk/netqasm | 5d6c6ad00c4e0f9ab0ec05518cfa827675f357e7 | [
"MIT"
] | 4 | 2021-11-19T15:46:17.000Z | 2022-01-23T18:59:15.000Z | from src.protocol import anonymous_transmission
if __name__ == "__main__":
main()
| 15.791667 | 47 | 0.604222 | from src.protocol import anonymous_transmission
def main(
app_config=None,
sender=False,
receiver=False,
phi=0.0,
theta=0.0,
):
return anonymous_transmission(
app_name="charlie",
app_config=app_config,
sender=sender,
receiver=receiver,
phi=phi,
... | 267 | 0 | 23 |
6abd731b4559a3a3494ccf4ad0fee6c93e7f4f41 | 54,040 | py | Python | sklearn/feature_extraction/tests/test_text.py | LSturtew/scikit-learn | 5aecf201a3d9ee8896566a057b3a576f1e31d410 | [
"BSD-3-Clause"
] | 1 | 2021-11-27T08:04:53.000Z | 2021-11-27T08:04:53.000Z | sklearn/feature_extraction/tests/test_text.py | LSturtew/scikit-learn | 5aecf201a3d9ee8896566a057b3a576f1e31d410 | [
"BSD-3-Clause"
] | null | null | null | sklearn/feature_extraction/tests/test_text.py | LSturtew/scikit-learn | 5aecf201a3d9ee8896566a057b3a576f1e31d410 | [
"BSD-3-Clause"
] | 1 | 2021-11-03T09:49:02.000Z | 2021-11-03T09:49:02.000Z | # -*- coding: utf-8 -*-
from collections.abc import Mapping
import re
import pytest
from scipy import sparse
from sklearn.feature_extraction.text import strip_tags
from sklearn.feature_extraction.text import strip_accents_unicode
from sklearn.feature_extraction.text import strip_accents_ascii
from sklearn.feature_ex... | 32.534618 | 88 | 0.657902 | # -*- coding: utf-8 -*-
from collections.abc import Mapping
import re
import pytest
from scipy import sparse
from sklearn.feature_extraction.text import strip_tags
from sklearn.feature_extraction.text import strip_accents_unicode
from sklearn.feature_extraction.text import strip_accents_ascii
from sklearn.feature_ex... | 41,971 | 0 | 1,561 |
ac47bb9a44cf37a97db3e576ed067939f6618234 | 108 | py | Python | processing/extraction/__init__.py | yashpatel5400/allercery | 09b201ea7f3a7ecf7393cb102f4bdebc780145c7 | [
"MIT"
] | null | null | null | processing/extraction/__init__.py | yashpatel5400/allercery | 09b201ea7f3a7ecf7393cb102f4bdebc780145c7 | [
"MIT"
] | null | null | null | processing/extraction/__init__.py | yashpatel5400/allercery | 09b201ea7f3a7ecf7393cb102f4bdebc780145c7 | [
"MIT"
] | null | null | null | """
__author__ = HackPrinceton 2017 Best Team
__description__ = Initializes files for extraction module
"""
| 21.6 | 57 | 0.787037 | """
__author__ = HackPrinceton 2017 Best Team
__description__ = Initializes files for extraction module
"""
| 0 | 0 | 0 |
73c62dc035f06d89c56d3612826161e36082d017 | 5,149 | py | Python | src/openfermion/utils/__init__.py | Spaceenter/OpenFermion | c1bf76582ec94373333d95fc27d1b92248ba3efd | [
"Apache-2.0"
] | 3 | 2018-08-03T22:48:47.000Z | 2022-02-10T15:05:35.000Z | src/openfermion/utils/__init__.py | Spaceenter/OpenFermion | c1bf76582ec94373333d95fc27d1b92248ba3efd | [
"Apache-2.0"
] | null | null | null | src/openfermion/utils/__init__.py | Spaceenter/OpenFermion | c1bf76582ec94373333d95fc27d1b92248ba3efd | [
"Apache-2.0"
] | 1 | 2019-03-25T13:39:13.000Z | 2019-03-25T13:39:13.000Z | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distribu... | 45.566372 | 79 | 0.575257 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distribu... | 0 | 0 | 0 |
eb9d2ce0896069df10b60597c4a04e16909f1f51 | 18,579 | py | Python | vespid/data/neo4j_tools/neo4j_arrow.py | QS-2/VESPID | f7d27f0c4aa99229d12d90fce9a52a48339e0a59 | [
"Apache-2.0"
] | 16 | 2021-09-11T11:16:05.000Z | 2022-03-14T23:09:17.000Z | vespid/data/neo4j_tools/neo4j_arrow.py | QS-2/VESPID | f7d27f0c4aa99229d12d90fce9a52a48339e0a59 | [
"Apache-2.0"
] | 6 | 2021-09-24T23:17:28.000Z | 2022-02-15T21:18:31.000Z | vespid/data/neo4j_tools/neo4j_arrow.py | QS-2/VESPID | f7d27f0c4aa99229d12d90fce9a52a48339e0a59 | [
"Apache-2.0"
] | 1 | 2022-02-22T14:44:21.000Z | 2022-02-22T14:44:21.000Z | import base64
import json
import struct
from collections import abc
from enum import Enum
from os import environ as env
from time import sleep, time
from typing import cast, Any, Dict, Iterable, Iterator, List, Optional, \
Tuple, TypeVar, Union
import pyarrow as pa
from pyarrow.lib import ArrowKeyError, RecordBatc... | 39.698718 | 88 | 0.591097 | import base64
import json
import struct
from collections import abc
from enum import Enum
from os import environ as env
from time import sleep, time
from typing import cast, Any, Dict, Iterable, Iterator, List, Optional, \
Tuple, TypeVar, Union
import pyarrow as pa
from pyarrow.lib import ArrowKeyError, RecordBatc... | 752 | 0 | 53 |
9bcd3d00f356e0a72c632ddcd420f05a25d61fab | 86 | py | Python | Data Scientist Career Path/3. Python Fundamentals/9. Python Classes/1. types.py | myarist/Codecademy | 2ba0f104bc67ab6ef0f8fb869aa12aa02f5f1efb | [
"MIT"
] | 23 | 2021-06-06T15:35:55.000Z | 2022-03-21T06:53:42.000Z | Data Scientist Career Path/3. Python Fundamentals/9. Python Classes/1. types.py | shivaniverma1/Data-Scientist | f82939a411484311171465591455880c8e354750 | [
"MIT"
] | null | null | null | Data Scientist Career Path/3. Python Fundamentals/9. Python Classes/1. types.py | shivaniverma1/Data-Scientist | f82939a411484311171465591455880c8e354750 | [
"MIT"
] | 9 | 2021-06-08T01:32:04.000Z | 2022-03-18T15:38:09.000Z | print(type(5))
my_dict = {}
print(type(my_dict))
my_list = []
print(type(my_list)) | 9.555556 | 20 | 0.651163 | print(type(5))
my_dict = {}
print(type(my_dict))
my_list = []
print(type(my_list)) | 0 | 0 | 0 |
5215ed9f3a1e89f1da086e79b175848d870140fb | 6,443 | py | Python | tests/test_util.py | luminantdata/great_expectations | f4b15d20a092fcbef690506f89bddec84b8140ff | [
"Apache-2.0"
] | null | null | null | tests/test_util.py | luminantdata/great_expectations | f4b15d20a092fcbef690506f89bddec84b8140ff | [
"Apache-2.0"
] | null | null | null | tests/test_util.py | luminantdata/great_expectations | f4b15d20a092fcbef690506f89bddec84b8140ff | [
"Apache-2.0"
] | null | null | null | import json
import datetime
import numpy as np
import unittest
import great_expectations as ge
if __name__ == "__main__":
unittest.main() | 45.055944 | 167 | 0.652491 | import json
import datetime
import numpy as np
import unittest
import great_expectations as ge
class TestUtilMethods(unittest.TestCase):
def __init__(self, *args, **kwargs):
super(TestUtilMethods, self).__init__(*args, **kwargs)
self.D = ge.read_csv('./tests/test_sets/distributional_expectations_d... | 5,827 | 20 | 447 |
d34b7bb0460a5a77dc69b2aa8301f3c06d1946f8 | 498 | py | Python | misc2_host_device_data_transfer.py | zfang92/pedagogical_cuda_code | 1bc78d575c8d93c8906f361a1d980086fe11a9d1 | [
"MIT"
] | null | null | null | misc2_host_device_data_transfer.py | zfang92/pedagogical_cuda_code | 1bc78d575c8d93c8906f361a1d980086fe11a9d1 | [
"MIT"
] | null | null | null | misc2_host_device_data_transfer.py | zfang92/pedagogical_cuda_code | 1bc78d575c8d93c8906f361a1d980086fe11a9d1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@author: Zheng Fang
"""
from numba import cuda
import numpy as np
n = int(2e4) # this is not to exceed 10^7
# supply data
data = np.random.normal(size=n, loc=0, scale=1).astype('float64')
# define convenience function
#============================================... | 16.6 | 72 | 0.502008 | # -*- coding: utf-8 -*-
"""
@author: Zheng Fang
"""
from numba import cuda
import numpy as np
n = int(2e4) # this is not to exceed 10^7
# supply data
data = np.random.normal(size=n, loc=0, scale=1).astype('float64')
# define convenience function
def timer():
d_data = cuda.to_device(data)
... | 53 | 0 | 23 |
77f31cd5ae12bdbd070064c80b7616ce1824e4c6 | 15,156 | py | Python | py/garage/garage/collections.py | clchiou/garage | 446ff34f86cdbd114b09b643da44988cf5d027a3 | [
"MIT"
] | 3 | 2016-01-04T06:28:52.000Z | 2020-09-20T13:18:40.000Z | py/garage/garage/collections.py | clchiou/garage | 446ff34f86cdbd114b09b643da44988cf5d027a3 | [
"MIT"
] | null | null | null | py/garage/garage/collections.py | clchiou/garage | 446ff34f86cdbd114b09b643da44988cf5d027a3 | [
"MIT"
] | null | null | null | """Collections of objects and collection helper functions."""
__all__ = [
'BiDict',
'DictBuilder',
'DictView',
'LoadingDict',
'LruCache',
'NamedTuple',
'SingletonMeta',
'Symbols',
'Trie',
'collect',
'collect_pairs',
'group',
'is_ordered',
'unique',
]
import oper... | 29.659491 | 78 | 0.571391 | """Collections of objects and collection helper functions."""
__all__ = [
'BiDict',
'DictBuilder',
'DictView',
'LoadingDict',
'LruCache',
'NamedTuple',
'SingletonMeta',
'Symbols',
'Trie',
'collect',
'collect_pairs',
'group',
'is_ordered',
'unique',
]
import oper... | 8,975 | 1,524 | 1,118 |
d40ceb086f0dfeadaad0a4a4e7992e8865fb8f3a | 3,831 | py | Python | mpsci/distributions/invchi2.py | WarrenWeckesser/mpsci | 675f0f3b76700529558a3bae2a1b2ca09552233b | [
"BSD-2-Clause"
] | 7 | 2019-03-27T17:25:41.000Z | 2022-03-31T03:55:29.000Z | mpsci/distributions/invchi2.py | WarrenWeckesser/mpsci | 675f0f3b76700529558a3bae2a1b2ca09552233b | [
"BSD-2-Clause"
] | 2 | 2019-05-09T16:09:45.000Z | 2021-01-04T03:55:09.000Z | mpsci/distributions/invchi2.py | WarrenWeckesser/mpsci | 675f0f3b76700529558a3bae2a1b2ca09552233b | [
"BSD-2-Clause"
] | null | null | null | """
Inverse chi-square distribution
-------------------------------
The probability density function for the inverse chi-square
distribution is
f(x, nu) = 2**(-nu/2) / Gamma(nu/2) * x**(-nu/2 - 1) * exp(-1/(2*x))
See the Wikipedia article `"Inverse-chi-squared distribution"
<https://en.wikipedia.org/wiki/Inverse... | 23.648148 | 76 | 0.527539 | """
Inverse chi-square distribution
-------------------------------
The probability density function for the inverse chi-square
distribution is
f(x, nu) = 2**(-nu/2) / Gamma(nu/2) * x**(-nu/2 - 1) * exp(-1/(2*x))
See the Wikipedia article `"Inverse-chi-squared distribution"
<https://en.wikipedia.org/wiki/Inverse... | 64 | 0 | 23 |
026118a250d1c4f591023f554e6cd2e4aca62694 | 3,562 | py | Python | traffic_test.py | yuecong/tools | 1d3f63e579c75c28d49d0f805e517bbb564e50ef | [
"MIT"
] | null | null | null | traffic_test.py | yuecong/tools | 1d3f63e579c75c28d49d0f805e517bbb564e50ef | [
"MIT"
] | null | null | null | traffic_test.py | yuecong/tools | 1d3f63e579c75c28d49d0f805e517bbb564e50ef | [
"MIT"
] | null | null | null | #!/usr/bin/python
import psutil
import subprocess
import simplejson
import time
import random
import multiprocessing as mp
procs_id = 0
procs = {}
procs_data = []
url_num = 0
# Define an output queue
output = mp.Queue()
MAX_THREAD_NUM = 500
#proxy_url='10.0.0.204:80'
proxy_url=''
urls = [
'http://drbd.linbit.c... | 27.612403 | 103 | 0.616227 | #!/usr/bin/python
import psutil
import subprocess
import simplejson
import time
import random
import multiprocessing as mp
procs_id = 0
procs = {}
procs_data = []
url_num = 0
# Define an output queue
output = mp.Queue()
MAX_THREAD_NUM = 500
#proxy_url='10.0.0.204:80'
proxy_url=''
urls = [
'http://drbd.linbit.c... | 1,636 | 0 | 67 |
103b8401e6645a543a140fb6594e4acf25b6699c | 1,890 | py | Python | scrap_app_info.py | jahangir091/app-data-collection | 7ac87328c896225396d020b06ca3a4a8d9b9a8a5 | [
"MIT"
] | null | null | null | scrap_app_info.py | jahangir091/app-data-collection | 7ac87328c896225396d020b06ca3a4a8d9b9a8a5 | [
"MIT"
] | null | null | null | scrap_app_info.py | jahangir091/app-data-collection | 7ac87328c896225396d020b06ca3a4a8d9b9a8a5 | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup as soup
import os
output_filename = "output_files/slideshow/app_info/app_info.csv"
output_file = open(output_filename, "a")
headers = "title, subtitle, publisher, country, year, last_month_downloads, last_month_revenue\n"
output_file.write(headers)
for filename in os.listdir(os.getcwd... | 51.081081 | 174 | 0.609524 | from bs4 import BeautifulSoup as soup
import os
output_filename = "output_files/slideshow/app_info/app_info.csv"
output_file = open(output_filename, "a")
headers = "title, subtitle, publisher, country, year, last_month_downloads, last_month_revenue\n"
output_file.write(headers)
def clean_value(value):
if not va... | 68 | 0 | 23 |
c01810a4d7924725e886f4b9697cf9e354731827 | 33 | py | Python | opm/linty/__init__.py | Open-Prose-Metrics/open_prose_metrics_app-core | 9df65edfe9ee9af0a0731c3f2e21ea25bced250c | [
"MIT"
] | null | null | null | opm/linty/__init__.py | Open-Prose-Metrics/open_prose_metrics_app-core | 9df65edfe9ee9af0a0731c3f2e21ea25bced250c | [
"MIT"
] | 4 | 2021-04-30T21:38:10.000Z | 2022-01-13T03:32:33.000Z | opm/linty/__init__.py | Open-Prose-Metrics/open_prose_metrics_app-core | 9df65edfe9ee9af0a0731c3f2e21ea25bced250c | [
"MIT"
] | 1 | 2021-03-21T14:08:28.000Z | 2021-03-21T14:08:28.000Z | from linty.linty import lint_text | 33 | 33 | 0.878788 | from linty.linty import lint_text | 0 | 0 | 0 |
8c1a23a66f3673146f1b7adcf6ca82eae41a4398 | 15,048 | py | Python | mmdb_writer.py | VimT/MaxMind-DB-Writer-python | edd4790c76bad6ae68b7dd621d1e0d64ea11fa07 | [
"MIT"
] | 6 | 2021-01-09T01:01:32.000Z | 2022-01-25T16:26:43.000Z | mmdb_writer.py | VimT/MaxMind-DB-Writer-python | edd4790c76bad6ae68b7dd621d1e0d64ea11fa07 | [
"MIT"
] | 1 | 2020-12-25T18:02:33.000Z | 2020-12-25T22:25:48.000Z | mmdb_writer.py | VimT/MaxMind-DB-Writer-python | edd4790c76bad6ae68b7dd621d1e0d64ea11fa07 | [
"MIT"
] | 4 | 2020-11-22T16:07:24.000Z | 2022-02-05T20:31:35.000Z | # coding: utf-8
__version__ = '0.1.0'
import logging
import math
import struct
import time
from typing import Union
from netaddr import IPSet
MMDBType = Union[dict, list, str, bytes, int, bool]
logger = logging.getLogger(__name__)
METADATA_MAGIC = b'\xab\xcd\xefMaxMind.com'
| 33.072527 | 110 | 0.54592 | # coding: utf-8
__version__ = '0.1.0'
import logging
import math
import struct
import time
from typing import Union
from netaddr import IPSet
MMDBType = Union[dict, list, str, bytes, int, bool]
logger = logging.getLogger(__name__)
METADATA_MAGIC = b'\xab\xcd\xefMaxMind.com'
class SearchTreeNode(object):
def ... | 13,456 | 953 | 353 |
136757bc6d8a0fcd893778d2fdb833985e51bbd6 | 62,849 | py | Python | src/command_modules/azure-cli-network/azure/cli/command_modules/network/_validators.py | ehotinger/azure-cli | 4652cddd711bf96f54f9d3a870d3e48e0184db31 | [
"MIT"
] | null | null | null | src/command_modules/azure-cli-network/azure/cli/command_modules/network/_validators.py | ehotinger/azure-cli | 4652cddd711bf96f54f9d3a870d3e48e0184db31 | [
"MIT"
] | null | null | null | src/command_modules/azure-cli-network/azure/cli/command_modules/network/_validators.py | ehotinger/azure-cli | 4652cddd711bf96f54f9d3a870d3e48e0184db31 | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 41.293693 | 154 | 0.68803 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 58,924 | 27 | 1,895 |
837b8575698c659fd3dcdef92b379c132e3eb8bf | 296 | py | Python | get_enviroment.py | limusina10/hammer | 6b42697a02f0ddf750170ef2bed49bfa3c823ad0 | [
"MIT"
] | null | null | null | get_enviroment.py | limusina10/hammer | 6b42697a02f0ddf750170ef2bed49bfa3c823ad0 | [
"MIT"
] | null | null | null | get_enviroment.py | limusina10/hammer | 6b42697a02f0ddf750170ef2bed49bfa3c823ad0 | [
"MIT"
] | 1 | 2019-06-28T18:44:44.000Z | 2019-06-28T18:44:44.000Z | import os
from dotenv import load_dotenv
load_dotenv()
TOKEN = os.getenv("TOKEN")
COMMAND_PREFIX = os.getenv("PREFIX")
OWNER = os.getenv("OWNER")
ANNOUNCEMENTS_CHANNEL = os.getenv("ANNOUNCEMENTS")
SECURITY_CHANNEL = os.getenv("SECURITY")
SWEAR_WORDS_LIST = os.getenv("BANNEDWORDS").split(",")
| 22.769231 | 54 | 0.756757 | import os
from dotenv import load_dotenv
load_dotenv()
TOKEN = os.getenv("TOKEN")
COMMAND_PREFIX = os.getenv("PREFIX")
OWNER = os.getenv("OWNER")
ANNOUNCEMENTS_CHANNEL = os.getenv("ANNOUNCEMENTS")
SECURITY_CHANNEL = os.getenv("SECURITY")
SWEAR_WORDS_LIST = os.getenv("BANNEDWORDS").split(",")
| 0 | 0 | 0 |
107fc6a18e5d39c505f1ffb15ee488a9e8674bb8 | 625 | py | Python | nltk_setup.py | Yakelixir/bigram_from_text | 96f1abe4c6ed0a98e6f909bdd8318096bb7f4f83 | [
"MIT"
] | null | null | null | nltk_setup.py | Yakelixir/bigram_from_text | 96f1abe4c6ed0a98e6f909bdd8318096bb7f4f83 | [
"MIT"
] | null | null | null | nltk_setup.py | Yakelixir/bigram_from_text | 96f1abe4c6ed0a98e6f909bdd8318096bb7f4f83 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
"""run and initiate nltk.download('all') """
import nltk
# setup or argparse
PERMISSION = input("Would you like to continue and install all nltk dependanies? [Y/n] ")
if PERMISSION == 'Y':
try:
nltk.download('all')
COMPLETE = """We have completed the initial setup for ntl... | 27.173913 | 89 | 0.6416 | #! /usr/bin/env python
"""run and initiate nltk.download('all') """
import nltk
# setup or argparse
PERMISSION = input("Would you like to continue and install all nltk dependanies? [Y/n] ")
if PERMISSION == 'Y':
try:
nltk.download('all')
COMPLETE = """We have completed the initial setup for ntl... | 0 | 0 | 0 |
5d9831deb49847b6573722cd9f6ee7a462919922 | 178 | py | Python | computer/admin.py | Zomba4okk/EmployeesManager | bff29dec7a7b83db79ef3449e19ad51b6fd4df8d | [
"MIT"
] | null | null | null | computer/admin.py | Zomba4okk/EmployeesManager | bff29dec7a7b83db79ef3449e19ad51b6fd4df8d | [
"MIT"
] | null | null | null | computer/admin.py | Zomba4okk/EmployeesManager | bff29dec7a7b83db79ef3449e19ad51b6fd4df8d | [
"MIT"
] | null | null | null | from django.contrib import admin
from employee.models import Department, Employee, Room
admin.site.register(Department)
admin.site.register(Employee)
admin.site.register(Room)
| 22.25 | 54 | 0.825843 | from django.contrib import admin
from employee.models import Department, Employee, Room
admin.site.register(Department)
admin.site.register(Employee)
admin.site.register(Room)
| 0 | 0 | 0 |
a38f69026e60b3a8229263ec5320c5f6ab8a91f5 | 25,531 | py | Python | face_sync/generate_srrr.py | lilly9117/Cross-Cutting | d534e8b5d4bf071883b7cb5f1832bba74b9a52d0 | [
"Apache-2.0"
] | 40 | 2020-09-21T05:35:17.000Z | 2022-02-06T04:41:34.000Z | face_sync/generate_srrr.py | lilly9117/Cross-Cutting | d534e8b5d4bf071883b7cb5f1832bba74b9a52d0 | [
"Apache-2.0"
] | 4 | 2020-05-22T15:44:13.000Z | 2020-07-17T07:41:33.000Z | face_sync/generate_srrr.py | lilly9117/Cross-Cutting | d534e8b5d4bf071883b7cb5f1832bba74b9a52d0 | [
"Apache-2.0"
] | 8 | 2020-10-03T06:08:39.000Z | 2021-12-17T15:50:30.000Z | import os
from moviepy.editor import VideoFileClip, concatenate_videoclips, CompositeVideoClip, TextClip
import random
import numpy as np
import time
from video_facial_landmarks_minmax import calculate_distance
from face_embedding import calculate_euclidean_distance
import cv2
import subprocess
ONE_FRAME_SEC = 0.0333... | 57.632054 | 252 | 0.574987 | import os
from moviepy.editor import VideoFileClip, concatenate_videoclips, CompositeVideoClip, TextClip
import random
import numpy as np
import time
from video_facial_landmarks_minmax import calculate_distance
from face_embedding import calculate_euclidean_distance
import cv2
import subprocess
ONE_FRAME_SEC = 0.0333... | 26,892 | -13 | 195 |
b2a0d8e3aef5256d756e6ea1b81ad2b8592f0ef9 | 2,196 | py | Python | cgi-bin/home.py | JamisHoo/Yagra | edcfe8ae6aadee152023c894bd0b8a0b23b9e5a9 | [
"MIT"
] | null | null | null | cgi-bin/home.py | JamisHoo/Yagra | edcfe8ae6aadee152023c894bd0b8a0b23b9e5a9 | [
"MIT"
] | null | null | null | cgi-bin/home.py | JamisHoo/Yagra | edcfe8ae6aadee152023c894bd0b8a0b23b9e5a9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from __future__ import print_function
from collections import namedtuple
from common import config
from common.response import text_response, populate_html, redirect
import os
import cgi
import hashlib
import MySQLdb
import Cookie
try:
process_input()
except:
cgi.print_exception()
| 28.153846 | 79 | 0.676685 | #!/usr/bin/env python
from __future__ import print_function
from collections import namedtuple
from common import config
from common.response import text_response, populate_html, redirect
import os
import cgi
import hashlib
import MySQLdb
import Cookie
def process_input():
# Load email and password from cookie... | 1,831 | 0 | 46 |
07448024f6f040dd89d7b7d6ee58c934ed48fba4 | 427 | py | Python | mokaplayer/ui/gtk/adapter/adapter_tab.py | vedard/MusicPlayer | cffc16ebb1372ad8916d62c4dc1215298eddc75d | [
"MIT"
] | 1 | 2017-10-05T14:30:17.000Z | 2017-10-05T14:30:17.000Z | mokaplayer/ui/gtk/adapter/adapter_tab.py | vedard/MusicPlayer | cffc16ebb1372ad8916d62c4dc1215298eddc75d | [
"MIT"
] | null | null | null | mokaplayer/ui/gtk/adapter/adapter_tab.py | vedard/MusicPlayer | cffc16ebb1372ad8916d62c4dc1215298eddc75d | [
"MIT"
] | null | null | null | from gi.repository import Gtk
| 19.409091 | 53 | 0.508197 | from gi.repository import Gtk
class AdapterTab:
@staticmethod
def create_row(tab):
return [
str(tab['type']),
tab['name'],
tab['rating'],
tab['votes'],
tab['url']
]
@staticmethod
def create_store():
return Gtk.ListSto... | 243 | 130 | 23 |
91602bafca408a0b22428838102d8c066829afb5 | 11,657 | py | Python | setup.py | itsabhishekhere/scikit-learn | 8266583d99b5a30c5fc79c3fdad809cc5e8684bc | [
"BSD-3-Clause"
] | 1 | 2021-11-19T06:21:43.000Z | 2021-11-19T06:21:43.000Z | setup.py | Nisar-1234/scikit-learn | 1cd282d600088d2547d827af72a99e036106417a | [
"BSD-3-Clause"
] | 2 | 2021-04-13T12:48:43.000Z | 2021-04-13T16:17:58.000Z | setup.py | hurricane642/scikit-learn | 5c3cb6b0af04344d41d542b718d682604d6aa685 | [
"BSD-3-Clause"
] | 1 | 2021-11-19T06:21:34.000Z | 2021-11-19T06:21:34.000Z | #! /usr/bin/env python
#
# Copyright (C) 2007-2009 Cournapeau David <cournape@gmail.com>
# 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr>
# License: 3-clause BSD
import sys
import os
import platform
import shutil
# We need to import setuptools before because it monkey-patches distutils
import setupto... | 38.727575 | 79 | 0.611307 | #! /usr/bin/env python
#
# Copyright (C) 2007-2009 Cournapeau David <cournape@gmail.com>
# 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr>
# License: 3-clause BSD
import sys
import os
import platform
import shutil
# We need to import setuptools before because it monkey-patches distutils
import setupto... | 6,137 | 111 | 158 |
eeb66eb14ecea99317fc795c1d7fbfa89e6de230 | 4,107 | py | Python | floxcore/console.py | getflox/flox-core | 128b5f3272384e38881db8fb90c175ce8f44b904 | [
"MIT"
] | null | null | null | floxcore/console.py | getflox/flox-core | 128b5f3272384e38881db8fb90c175ce8f44b904 | [
"MIT"
] | null | null | null | floxcore/console.py | getflox/flox-core | 128b5f3272384e38881db8fb90c175ce8f44b904 | [
"MIT"
] | null | null | null | import textwrap
from functools import partial
import click
import tqdm
from wasabi import Printer, MESSAGES
from wasabi.util import ICONS
msg = Printer()
success = partial(msg.text, color=MESSAGES.GOOD, icon=MESSAGES.GOOD)
info = partial(msg.text, color=MESSAGES.INFO, icon=MESSAGES.INFO)
error = partial(msg.text, co... | 38.745283 | 112 | 0.634526 | import textwrap
from functools import partial
import click
import tqdm
from wasabi import Printer, MESSAGES
from wasabi.util import ICONS
msg = Printer()
success = partial(msg.text, color=MESSAGES.GOOD, icon=MESSAGES.GOOD)
info = partial(msg.text, color=MESSAGES.INFO, icon=MESSAGES.INFO)
error = partial(msg.text, co... | 2,994 | 1 | 418 |
8a869da913e7e3c281811411cee3eca6a5841c95 | 2,811 | py | Python | nano/web/db.py | aga3134/VapaaCruiser | 76095296fe910b9b99edaaea2f96024b6ae65336 | [
"MIT"
] | 2 | 2021-01-26T13:26:05.000Z | 2021-08-05T08:04:49.000Z | nano/web/db.py | aga3134/VapaaCruiser | 76095296fe910b9b99edaaea2f96024b6ae65336 | [
"MIT"
] | null | null | null | nano/web/db.py | aga3134/VapaaCruiser | 76095296fe910b9b99edaaea2f96024b6ae65336 | [
"MIT"
] | null | null | null | import sqlite3
import json
import uuid | 33.070588 | 143 | 0.533618 | import sqlite3
import json
import uuid
class SqliteDB:
def __init__(self):
print(sqlite3.version)
self.conn = sqlite3.connect("vapaa_cruiser.db")
self.CreateTable()
def __del__(self):
self.conn.close()
def CreateTable(self):
c = self.conn.cursor()
c.execute... | 2,514 | -6 | 265 |
fb7e182e2a4c39b319dd385379a6767ba86954ae | 1,392 | py | Python | py/2015/19A.py | pedrotari7/advent_of_code | 98d5bc8d903435624a019a5702f5421d7b4ef8c8 | [
"MIT"
] | null | null | null | py/2015/19A.py | pedrotari7/advent_of_code | 98d5bc8d903435624a019a5702f5421d7b4ef8c8 | [
"MIT"
] | null | null | null | py/2015/19A.py | pedrotari7/advent_of_code | 98d5bc8d903435624a019a5702f5421d7b4ef8c8 | [
"MIT"
] | null | null | null | s = 'ORnPBPMgArCaCaCaSiThCaCaSiThCaCaPBSiRnFArRnFArCaCaSiThCaCaSiThCaCaCaCaCaCaSiRnFYFArSiRnMgArCaSiRnPTiTiBFYPBFArSiRnCaSiRnTiRnFArSiAlArPTiBPTiRnCaSiAlArCaPTiTiBPMgYFArPTiRnFArSiRnCaCaFArRnCaFArCaSiRnSiRnMgArFYCaSiRnMgArCaCaSiThPRnFArPBCaSiRnMgArCaCaSiThCaSiRnTiMgArFArSiThSiThCaCaSiRnMgArCaCaSiRnFArTiBPTiRnCaSiAlArCa... | 21.090909 | 512 | 0.721983 | s = 'ORnPBPMgArCaCaCaSiThCaCaSiThCaCaPBSiRnFArRnFArCaCaSiThCaCaSiThCaCaCaCaCaCaSiRnFYFArSiRnMgArCaSiRnPTiTiBFYPBFArSiRnCaSiRnTiRnFArSiAlArPTiBPTiRnCaSiAlArCaPTiTiBPMgYFArPTiRnFArSiRnCaCaFArRnCaFArCaSiRnSiRnMgArFYCaSiRnMgArCaCaSiThPRnFArPBCaSiRnMgArCaCaSiThCaSiRnTiMgArFArSiThSiThCaCaSiRnMgArCaCaSiRnFArTiBPTiRnCaSiAlArCa... | 0 | 0 | 0 |
6f80e39d00765ee017d888d8aaa001d690eeadcf | 3,403 | py | Python | API_caller_example.py | TBFY/crosslinguality | d20c2b7fef02be923a76e471bd27262252bd3aa2 | [
"Apache-2.0"
] | null | null | null | API_caller_example.py | TBFY/crosslinguality | d20c2b7fef02be923a76e471bd27262252bd3aa2 | [
"Apache-2.0"
] | null | null | null | API_caller_example.py | TBFY/crosslinguality | d20c2b7fef02be923a76e471bd27262252bd3aa2 | [
"Apache-2.0"
] | 2 | 2018-06-15T09:18:06.000Z | 2019-11-14T15:00:20.000Z | import urllib.parse, urllib.request, json
CompareDocs("""
All human beings are born free and equal in dignity and rights.
They are endowed with reason and conscience and should act towards
one another in a spirit of brotherhood.
Everyone is entitled to all the rights and freedoms set forth in
th... | 52.353846 | 83 | 0.693212 | import urllib.parse, urllib.request, json
def CompareDocs(text1, lang1, text2, lang2):
# Prepare the request.
data = urllib.parse.urlencode([
("doc1", text1), ("lang1", lang1),
("doc2", text2), ("lang2", lang2),
# ("azureKey", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), # insert your key her... | 1,642 | 0 | 23 |
8b0c5ade6ad28d3803409c5148c21b326eb01e4f | 373 | py | Python | integration-test/1406-include-all-name-variants.py | nextzen/vector-datasource | f11700f232a3a6251915579106ff07b2bee25d12 | [
"MIT"
] | 1 | 2018-01-03T21:26:27.000Z | 2018-01-03T21:26:27.000Z | integration-test/1406-include-all-name-variants.py | nextzen/vector-datasource | f11700f232a3a6251915579106ff07b2bee25d12 | [
"MIT"
] | null | null | null | integration-test/1406-include-all-name-variants.py | nextzen/vector-datasource | f11700f232a3a6251915579106ff07b2bee25d12 | [
"MIT"
] | 1 | 2019-06-19T19:14:42.000Z | 2019-06-19T19:14:42.000Z | from . import FixtureTest
| 24.866667 | 58 | 0.581769 | from . import FixtureTest
class IncludeAllNameVariants(FixtureTest):
def test_duplicate_names(self):
self.load_fixtures([
'http://www.openstreetmap.org/node/206270454',
])
self.assert_has_feature(
15, 18199, 11103, 'pois',
{'id': 206270454, 'kind': 'st... | 275 | 21 | 50 |
774456242ae119b2dede055522353259d90fdb74 | 8,792 | py | Python | hw/ip/otbn/util/rig/gens/straight_line_insn.py | wxjstz/opentitan | 6ff4397bac9c07373d735bd859c7ef8de39c2af8 | [
"Apache-2.0"
] | null | null | null | hw/ip/otbn/util/rig/gens/straight_line_insn.py | wxjstz/opentitan | 6ff4397bac9c07373d735bd859c7ef8de39c2af8 | [
"Apache-2.0"
] | 1 | 2020-10-30T06:30:51.000Z | 2020-10-30T06:30:51.000Z | hw/ip/otbn/util/rig/gens/straight_line_insn.py | wxjstz/opentitan | 6ff4397bac9c07373d735bd859c7ef8de39c2af8 | [
"Apache-2.0"
] | 1 | 2019-12-13T00:52:40.000Z | 2019-12-13T00:52:40.000Z | # Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
import random
from typing import Optional, Tuple
from shared.insn_yaml import Insn, InsnsFile
from shared.lsu_desc import LSUDesc
from shared.operand import ImmOperandType... | 41.866667 | 80 | 0.578253 | # Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
import random
from typing import Optional, Tuple
from shared.insn_yaml import Insn, InsnsFile
from shared.lsu_desc import LSUDesc
from shared.operand import ImmOperandType... | 2,466 | 0 | 53 |
8c645ea7eea7f9d79701357200e3200adcd89283 | 850 | py | Python | shortit/shortener/tests/test_views.py | m7salam/shortit | c575acb4e8b447ac62abdf899063357f1569e93d | [
"MIT"
] | null | null | null | shortit/shortener/tests/test_views.py | m7salam/shortit | c575acb4e8b447ac62abdf899063357f1569e93d | [
"MIT"
] | 2 | 2022-03-01T00:07:15.000Z | 2022-03-02T00:17:58.000Z | shortit/shortener/tests/test_views.py | m7salam/shortit | c575acb4e8b447ac62abdf899063357f1569e93d | [
"MIT"
] | null | null | null | # from django.http import request
# import pytest
# from django.contrib.auth.models import AnonymousUser
# from django.http.response import Http404, HttpResponse
# from django.shortcuts import get_object_or_404
# from django.test import RequestFactory
# from shortit.shortener.models import ShortUrl
# from shortit.shor... | 29.310345 | 79 | 0.734118 | # from django.http import request
# import pytest
# from django.contrib.auth.models import AnonymousUser
# from django.http.response import Http404, HttpResponse
# from django.shortcuts import get_object_or_404
# from django.test import RequestFactory
# from shortit.shortener.models import ShortUrl
# from shortit.shor... | 0 | 0 | 0 |
1f9a2fdba7ba7f61e0c08e6682726a0a538ad878 | 341 | py | Python | avalon/compiler/__init__.py | nehz/avalon | 1c53d4c1e115a8c31b7170cf3948c870a33e4e56 | [
"MIT"
] | null | null | null | avalon/compiler/__init__.py | nehz/avalon | 1c53d4c1e115a8c31b7170cf3948c870a33e4e56 | [
"MIT"
] | 2 | 2015-10-09T19:21:07.000Z | 2019-08-03T13:50:51.000Z | avalon/compiler/__init__.py | nehz/avalon | 1c53d4c1e115a8c31b7170cf3948c870a33e4e56 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#==============================================================================
# Copyright: Hybrid Labs
# Licence: See LICENSE
#==============================================================================
"""
Python to Javascript compiler
"""
from .compiler import js_compi... | 28.416667 | 80 | 0.331378 | # -*- coding: utf-8 -*-
#==============================================================================
# Copyright: Hybrid Labs
# Licence: See LICENSE
#==============================================================================
"""
Python to Javascript compiler
"""
from .compiler import js_compi... | 0 | 0 | 0 |
3f1cf2a14b0debd5d624d0e3fb67080d5b250030 | 357 | py | Python | conans/server/rest/controllers/v2/__init__.py | laundry-96/conan | fd938f7220ca042d94c42ec5eb607ee69c6785a3 | [
"MIT"
] | 6,205 | 2015-12-01T13:40:05.000Z | 2022-03-31T07:30:25.000Z | conans/server/rest/controllers/v2/__init__.py | laundry-96/conan | fd938f7220ca042d94c42ec5eb607ee69c6785a3 | [
"MIT"
] | 8,747 | 2015-12-01T16:28:48.000Z | 2022-03-31T23:34:53.000Z | conans/server/rest/controllers/v2/__init__.py | laundry-96/conan | fd938f7220ca042d94c42ec5eb607ee69c6785a3 | [
"MIT"
] | 961 | 2015-12-01T16:56:43.000Z | 2022-03-31T13:50:52.000Z | from conans.model.ref import ConanFileReference, PackageReference
| 44.625 | 88 | 0.778711 | from conans.model.ref import ConanFileReference, PackageReference
def get_package_ref(name, version, username, channel, package_id, revision, p_revision):
ref = ConanFileReference(name, version, username, channel, revision)
package_id = "%s#%s" % (package_id, p_revision) if p_revision else package_id
retu... | 267 | 0 | 23 |
f7c1a9a48fbd29d1dce14cb6d7a9d838bab9f312 | 202 | py | Python | foe_pool.py | QwerTech/foe-automation | 9978cd365097a2c9ebec9039642c4e5f6c361018 | [
"MIT"
] | null | null | null | foe_pool.py | QwerTech/foe-automation | 9978cd365097a2c9ebec9039642c4e5f6c361018 | [
"MIT"
] | 3 | 2021-09-08T02:13:20.000Z | 2022-03-12T00:36:40.000Z | foe_pool.py | QwerTech/foe-automation | 9978cd365097a2c9ebec9039642c4e5f6c361018 | [
"MIT"
] | null | null | null | import multiprocessing
pool = None
| 15.538462 | 65 | 0.722772 | import multiprocessing
pool = None
def initPool():
global pool
pool = multiprocessing.Pool(int(multiprocessing.cpu_count()))
def execInPool(func, params):
return pool.map(func, params)
| 118 | 0 | 46 |
422fb245184cf85a029ccd26bd2b6fcba9c6b6b6 | 4,569 | py | Python | scope/__init__.py | FlorianLudwig/scope | 013b7010a55cf7d377abdaf75cea882f984f02d8 | [
"Apache-2.0"
] | null | null | null | scope/__init__.py | FlorianLudwig/scope | 013b7010a55cf7d377abdaf75cea882f984f02d8 | [
"Apache-2.0"
] | null | null | null | scope/__init__.py | FlorianLudwig/scope | 013b7010a55cf7d377abdaf75cea882f984f02d8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Florian Ludwig
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 28.55625 | 85 | 0.606041 | # Copyright 2015 Florian Ludwig
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 2,312 | 30 | 373 |
33be01006ef0ec73b7f5c416d8c3f7cb4e81caef | 306 | py | Python | source/genPrimes.py | ahmedraza007/6.00.1x-Introduction-to-Computer-Science-and-Programming-Using-Python | a2e3960c8e703148e6c8d5d397baea7283f209dc | [
"MIT"
] | null | null | null | source/genPrimes.py | ahmedraza007/6.00.1x-Introduction-to-Computer-Science-and-Programming-Using-Python | a2e3960c8e703148e6c8d5d397baea7283f209dc | [
"MIT"
] | null | null | null | source/genPrimes.py | ahmedraza007/6.00.1x-Introduction-to-Computer-Science-and-Programming-Using-Python | a2e3960c8e703148e6c8d5d397baea7283f209dc | [
"MIT"
] | null | null | null |
gen = genPrimes()
print gen.next()
print gen.next()
print gen.next()
print gen.next() | 18 | 27 | 0.434641 | def genPrimes():
prime = []
x = 1
while True:
x += 1
for p in prime:
if x % p == 0:
break
else:
prime.append(x)
yield x
gen = genPrimes()
print gen.next()
print gen.next()
print gen.next()
print gen.next() | 186 | 0 | 22 |
90fd839f97089e06ea9ead00b3f2ea9dc8c1e909 | 7,692 | py | Python | src/magplan/migrations/0002_auto_20201115_1140.py | f1nnix/magplan | 1bda6b53c6e96129e6634bff786b3052d04b0cef | [
"Unlicense"
] | 21 | 2018-12-14T09:08:11.000Z | 2022-01-28T14:33:24.000Z | src/magplan/migrations/0002_auto_20201115_1140.py | f1nnix/magplan | 1bda6b53c6e96129e6634bff786b3052d04b0cef | [
"Unlicense"
] | 20 | 2019-01-11T20:40:01.000Z | 2022-01-30T16:01:38.000Z | src/magplan/migrations/0002_auto_20201115_1140.py | f1nnix/magplan | 1bda6b53c6e96129e6634bff786b3052d04b0cef | [
"Unlicense"
] | 5 | 2019-02-08T01:21:51.000Z | 2021-11-25T17:43:04.000Z | # Generated by Django 3.1.2 on 2020-11-15 11:40
import django.contrib.auth.models
import django.contrib.postgres.fields.jsonb
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
| 44.462428 | 277 | 0.587493 | # Generated by Django 3.1.2 on 2020-11-15 11:40
import django.contrib.auth.models
import django.contrib.postgres.fields.jsonb
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
... | 0 | 7,619 | 23 |
b3dbca7a9f41a05f752f4b1bb64b60dc81d219cf | 123 | py | Python | pi_camera_capture/cli.py | yoyota-pose-estimation/pi-camera-capture | c77ed1691dafbec9b8e1932a0493ba5c4acc2048 | [
"MIT"
] | null | null | null | pi_camera_capture/cli.py | yoyota-pose-estimation/pi-camera-capture | c77ed1691dafbec9b8e1932a0493ba5c4acc2048 | [
"MIT"
] | 1 | 2020-02-10T07:02:45.000Z | 2020-02-10T08:16:25.000Z | pi_camera_capture/cli.py | yoyota-pose-estimation/pi-camera-capture | c77ed1691dafbec9b8e1932a0493ba5c4acc2048 | [
"MIT"
] | null | null | null | import fire
from pi_camera_capture.app import main
if __name__ == "__main__":
cli()
| 11.181818 | 38 | 0.674797 | import fire
from pi_camera_capture.app import main
def cli():
fire.Fire(main)
if __name__ == "__main__":
cli()
| 9 | 0 | 23 |
6cb7ebb492fcdeb41c1c34796345e72ad718f0b1 | 27,257 | py | Python | words.py | nailtonvital/python-projects | dff440fe0aaebfedbf9622d2daae0b53d972e438 | [
"MIT"
] | 2 | 2022-03-21T23:03:51.000Z | 2022-03-21T23:18:02.000Z | words.py | nailtonvital/python-projects | dff440fe0aaebfedbf9622d2daae0b53d972e438 | [
"MIT"
] | null | null | null | words.py | nailtonvital/python-projects | dff440fe0aaebfedbf9622d2daae0b53d972e438 | [
"MIT"
] | null | null | null | # Word list for hangman
words = ["aback", "abaft", "abandoned", "abashed", "aberrant", "abhorrent", "abiding", "abject", "ablaze", "able",
"abnormal", "aboard", "aboriginal", "abortive", "abounding", "abrasive", "abrupt", "absent", "absorbed",
"absorbing", "abstracted", "absurd", "abundant", "abusive... | 116.482906 | 121 | 0.56048 | # Word list for hangman
words = ["aback", "abaft", "abandoned", "abashed", "aberrant", "abhorrent", "abiding", "abject", "ablaze", "able",
"abnormal", "aboard", "aboriginal", "abortive", "abounding", "abrasive", "abrupt", "absent", "absorbed",
"absorbing", "abstracted", "absurd", "abundant", "abusive... | 0 | 0 | 0 |
a2cc51e71d5adbbc105d3688d047f7bf6f06e078 | 1,874 | py | Python | run_raml_exp.py | pcyin/pytorch_nmt | bf28dae8a4c71e1f3f3fcb51e989fab905886f44 | [
"CC-BY-4.0"
] | 122 | 2017-04-17T18:36:43.000Z | 2022-02-09T06:24:13.000Z | run_raml_exp.py | pcyin/pytorch_nmt | bf28dae8a4c71e1f3f3fcb51e989fab905886f44 | [
"CC-BY-4.0"
] | 5 | 2017-10-08T14:13:52.000Z | 2018-10-11T04:43:11.000Z | run_raml_exp.py | pcyin/pytorch_nmt | bf28dae8a4c71e1f3f3fcb51e989fab905886f44 | [
"CC-BY-4.0"
] | 29 | 2017-04-27T18:26:47.000Z | 2021-04-08T05:58:10.000Z | import os
train_src="../dynet_nmt/data/train.de-en.de.wmixerprep"
train_tgt="../dynet_nmt/data/train.de-en.en.wmixerprep"
dev_src="../dynet_nmt/data/valid.de-en.de"
dev_tgt="../dynet_nmt/data/valid.de-en.en"
test_src="../dynet_nmt/data/test.de-en.de"
test_tgt="../dynet_nmt/data/test.de-en.en"
for temp in [0.6, 0.8]: ... | 30.225806 | 74 | 0.640875 | import os
train_src="../dynet_nmt/data/train.de-en.de.wmixerprep"
train_tgt="../dynet_nmt/data/train.de-en.en.wmixerprep"
dev_src="../dynet_nmt/data/valid.de-en.de"
dev_tgt="../dynet_nmt/data/valid.de-en.en"
test_src="../dynet_nmt/data/test.de-en.de"
test_tgt="../dynet_nmt/data/test.de-en.en"
for temp in [0.6, 0.8]: ... | 0 | 0 | 0 |
cd38b22d3922c73b19709343da9d3b773aea1fa9 | 2,509 | py | Python | utils/ranking/least_confidence_softmax.py | kkontras/Sleep_net | a6a83d4624989cc8a79238e491da06dc22d562b8 | [
"MIT"
] | 1 | 2022-02-22T02:40:41.000Z | 2022-02-22T02:40:41.000Z | utils/ranking/least_confidence_softmax.py | kkontras/Sleep_net | a6a83d4624989cc8a79238e491da06dc22d562b8 | [
"MIT"
] | null | null | null | utils/ranking/least_confidence_softmax.py | kkontras/Sleep_net | a6a83d4624989cc8a79238e491da06dc22d562b8 | [
"MIT"
] | null | null | null | import numpy as np
def calculate_probs(predicted_classes, num_classes):
'''
This function is to calculate the probabilities for each class given the softmax output
:param predicted_classes: matrix num_datapoints X num_ensembles (or dropout_iterations)
:param num_classes:
:return: For each datapoin... | 41.816667 | 109 | 0.730969 | import numpy as np
def least_conf(data,num_classes):
num_labels = float(num_classes)
least_conf_ranks = []
prob_dist = calculate_probs(data,num_labels)
simple_least_conf = np.nanmax(prob_dist) # most confident prediction, ignoring NaNs
normalized_least_conf = (1 - simple_least_conf) * (num_labels ... | 1,922 | 0 | 115 |
e45eecc040c259a441c1826aebf97467c4f6b867 | 4,669 | py | Python | awards/models.py | OscarGichana/awards | f07d67d6ba210753a6559ca2584a14c8596200d7 | [
"Unlicense"
] | null | null | null | awards/models.py | OscarGichana/awards | f07d67d6ba210753a6559ca2584a14c8596200d7 | [
"Unlicense"
] | null | null | null | awards/models.py | OscarGichana/awards | f07d67d6ba210753a6559ca2584a14c8596200d7 | [
"Unlicense"
] | null | null | null | from __future__ import unicode_literals
from django.db import models
import datetime as dt
from django.contrib.auth.mixins import LoginRequiredMixin
from django.dispatch import receiver
from django.db.models.signals import (post_save,pre_save,)
# from PIL import Image
from django.core.files import File
from django.disp... | 32.880282 | 163 | 0.699293 | from __future__ import unicode_literals
from django.db import models
import datetime as dt
from django.contrib.auth.mixins import LoginRequiredMixin
from django.dispatch import receiver
from django.db.models.signals import (post_save,pre_save,)
# from PIL import Image
from django.core.files import File
from django.disp... | 1,490 | 2,407 | 137 |
b1934e332538a24404e96910b363154f4b60ff79 | 1,127 | py | Python | deeplab_features.py | gmum/proto-segmentation | e84e9e8e91711f664ffd1db26c8dabc111d17fdc | [
"MIT"
] | 1 | 2022-02-26T17:10:05.000Z | 2022-02-26T17:10:05.000Z | deeplab_features.py | gmum/proto-segmentation | e84e9e8e91711f664ffd1db26c8dabc111d17fdc | [
"MIT"
] | null | null | null | deeplab_features.py | gmum/proto-segmentation | e84e9e8e91711f664ffd1db26c8dabc111d17fdc | [
"MIT"
] | null | null | null | import torchvision
from torch import nn
def deeplabv3_resnet50_features(pretrained=False, **kwargs):
"""Constructs a ResNet-50 model.
Args:
pretrained (bool): If True, returns a model pre-trained on Coco
"""
model = torchvision.models.segmentation.deeplabv3_resnet50(pretrained=pretrained)
... | 31.305556 | 118 | 0.662822 | import torchvision
from torch import nn
class DeeplabV3_features(nn.Module):
def __init__(self, model, layers, **kwargs):
super(DeeplabV3_features, self).__init__()
self.model = model
self.layers = layers
# comes from the first conv and the following max pool
self.kernel_s... | 484 | 15 | 130 |
0f9ecd4e1871405e5daa637649bc662fafc41edf | 2,539 | py | Python | src/globus_sdk/paging/base.py | sirosen/globus-sdk-python | 0d4e420f52329ab8f993bfe6f86729fb1ef07570 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/globus_sdk/paging/base.py | sirosen/globus-sdk-python | 0d4e420f52329ab8f993bfe6f86729fb1ef07570 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/globus_sdk/paging/base.py | sirosen/globus-sdk-python | 0d4e420f52329ab8f993bfe6f86729fb1ef07570 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import abc
from typing import Any, Callable, Dict, Iterable, Iterator, List, Optional
from globus_sdk.response import GlobusHTTPResponse
class Paginator(Iterable[GlobusHTTPResponse], metaclass=abc.ABCMeta):
"""
Base class for all paginators.
This guarantees is that they have generator methods named ``pag... | 38.469697 | 88 | 0.648681 | import abc
from typing import Any, Callable, Dict, Iterable, Iterator, List, Optional
from globus_sdk.response import GlobusHTTPResponse
class Paginator(Iterable[GlobusHTTPResponse], metaclass=abc.ABCMeta):
"""
Base class for all paginators.
This guarantees is that they have generator methods named ``pag... | 369 | 0 | 54 |
4d26fa18f6869f7bce8e81bfdd5a86f5eabc9619 | 651 | py | Python | pysurf/__init__.py | MFSJMenger/pysurf | 99c6a94d4cb5046f16a0961b907061d989ffb6dc | [
"Apache-2.0"
] | 7 | 2020-10-28T13:46:08.000Z | 2021-05-27T06:41:56.000Z | pysurf/__init__.py | MFSJMenger/pysurf | 99c6a94d4cb5046f16a0961b907061d989ffb6dc | [
"Apache-2.0"
] | 2 | 2020-10-27T19:15:12.000Z | 2020-10-27T19:15:25.000Z | pysurf/__init__.py | MFSJMenger/pysurf | 99c6a94d4cb5046f16a0961b907061d989ffb6dc | [
"Apache-2.0"
] | 2 | 2021-04-15T05:54:30.000Z | 2022-02-08T00:10:10.000Z | # -*- coding: utf-8 -*-
"""Top-level package for pysurf."""
__author__ = """Maximilian F.S.J. Menger, Johannes Ehrmaier"""
__email__ = 'menger.maximilian@gmail.com'
__version__ = '0.1.0'
#
import os
#
from colt import PluginLoader
from .spp.spp import SurfacePointProvider
from .spp import AbinitioBase, Model, Inter... | 28.304348 | 66 | 0.751152 | # -*- coding: utf-8 -*-
"""Top-level package for pysurf."""
__author__ = """Maximilian F.S.J. Menger, Johannes Ehrmaier"""
__email__ = 'menger.maximilian@gmail.com'
__version__ = '0.1.0'
#
import os
#
from colt import PluginLoader
from .spp.spp import SurfacePointProvider
from .spp import AbinitioBase, Model, Inter... | 0 | 0 | 0 |
0cb4e9f9ef1c4a23223d6fde648bc00b342cdbc2 | 1,363 | py | Python | docker/dockerfile/genie-parser/docker_app_run/modules/command_parse/command_parse.py | btr1975/automation-framework | b0ba661cb6bae193bd5c6531c08d9dba55c4099e | [
"MIT"
] | 8 | 2021-06-02T23:08:40.000Z | 2022-02-11T16:50:24.000Z | docker/dockerfile/genie-parser/docker_app_run/modules/command_parse/command_parse.py | btr1975/automation-framework | b0ba661cb6bae193bd5c6531c08d9dba55c4099e | [
"MIT"
] | null | null | null | docker/dockerfile/genie-parser/docker_app_run/modules/command_parse/command_parse.py | btr1975/automation-framework | b0ba661cb6bae193bd5c6531c08d9dba55c4099e | [
"MIT"
] | 2 | 2021-09-30T14:46:03.000Z | 2021-11-14T23:47:35.000Z | """
This holds functionality to get commands, and parse commands
"""
from quick_netmiko import QuickNetmiko
from pyats_genie_command_parse import GenieCommandParse
def command_parse(python_dict, fifo_queue, thread_lock): # pylint: disable=inconsistent-return-statements
"""Function to get and parse commands from... | 33.243902 | 106 | 0.707263 | """
This holds functionality to get commands, and parse commands
"""
from quick_netmiko import QuickNetmiko
from pyats_genie_command_parse import GenieCommandParse
def command_parse(python_dict, fifo_queue, thread_lock): # pylint: disable=inconsistent-return-statements
"""Function to get and parse commands from... | 0 | 0 | 0 |
e79847edbdbcc10ef24602c8316e5826238d9256 | 31,015 | py | Python | modules/commons/transformer.py | leminhnguyen/NATSpeech | 66b7b5c27b43523952b4edf1413d7cedb8c9310e | [
"MIT"
] | 561 | 2022-02-13T04:57:38.000Z | 2022-03-28T03:16:15.000Z | modules/commons/transformer.py | zjumml/NATSpeech | b1cf33e336a69e8550953bf8091e1b5ac6c0608e | [
"MIT"
] | 9 | 2022-02-14T05:17:11.000Z | 2022-03-31T02:06:13.000Z | modules/commons/transformer.py | zjumml/NATSpeech | b1cf33e336a69e8550953bf8091e1b5ac6c0608e | [
"MIT"
] | 51 | 2022-02-13T04:50:36.000Z | 2022-03-25T23:22:35.000Z | import math
import torch
from torch import nn
from torch.nn import Parameter, Linear
from modules.commons.layers import LayerNorm, Embedding
from utils.nn.seq_utils import get_incremental_state, set_incremental_state, softmax, make_positions
import torch.nn.functional as F
DEFAULT_MAX_SOURCE_POSITIONS = 2000
DEFAULT_M... | 41.463904 | 115 | 0.591391 | import math
import torch
from torch import nn
from torch.nn import Parameter, Linear
from modules.commons.layers import LayerNorm, Embedding
from utils.nn.seq_utils import get_incremental_state, set_incremental_state, softmax, make_positions
import torch.nn.functional as F
DEFAULT_MAX_SOURCE_POSITIONS = 2000
DEFAULT_M... | 15,230 | 12,467 | 714 |
104170172bfc6376e2783ac34bbf0196bab87213 | 10,111 | py | Python | tests/test_point.py | pauljurczak/geometer | fbb7dd7219cc716c3ed94d390f6fa763ac1607ac | [
"MIT"
] | 83 | 2019-02-02T15:56:17.000Z | 2022-02-15T01:01:46.000Z | tests/test_point.py | pauljurczak/geometer | fbb7dd7219cc716c3ed94d390f6fa763ac1607ac | [
"MIT"
] | 54 | 2018-12-02T13:59:53.000Z | 2022-03-18T09:02:30.000Z | tests/test_point.py | pauljurczak/geometer | fbb7dd7219cc716c3ed94d390f6fa763ac1607ac | [
"MIT"
] | 11 | 2019-02-10T16:06:46.000Z | 2022-02-14T08:51:51.000Z | import numpy as np
from geometer import (
Point,
Line,
Plane,
PointCollection,
LineCollection,
PlaneCollection,
join,
meet,
is_perpendicular,
translation,
rotation,
)
| 27.777473 | 88 | 0.482742 | import numpy as np
from geometer import (
Point,
Line,
Plane,
PointCollection,
LineCollection,
PlaneCollection,
join,
meet,
is_perpendicular,
translation,
rotation,
)
class Test2D:
def test_join(self):
p = Point(1, 0)
q = Point(0, 1)
assert p.joi... | 9,210 | -23 | 709 |
e1cad1ebfe20d22de3794c61dbee9e731e565f93 | 959 | py | Python | src/infi/storagemodel/windows/device_helpers.py | Infinidat/infi.storagemodel | 81740970b5b1c0a691472f2e360d3a6e5c4d0875 | [
"Python-2.0",
"BSD-3-Clause"
] | 6 | 2015-07-29T11:22:36.000Z | 2019-01-22T19:07:42.000Z | src/infi/storagemodel/windows/device_helpers.py | Infinidat/infi.storagemodel | 81740970b5b1c0a691472f2e360d3a6e5c4d0875 | [
"Python-2.0",
"BSD-3-Clause"
] | null | null | null | src/infi/storagemodel/windows/device_helpers.py | Infinidat/infi.storagemodel | 81740970b5b1c0a691472f2e360d3a6e5c4d0875 | [
"Python-2.0",
"BSD-3-Clause"
] | 3 | 2015-01-05T13:55:38.000Z | 2018-07-07T05:05:36.000Z | from logging import getLogger
MPIO_BUS_DRIVER_INSTANCE_ID = u"Root\\MPIO\\0000".lower()
logger = getLogger(__name__)
| 26.638889 | 118 | 0.708029 | from logging import getLogger
MPIO_BUS_DRIVER_INSTANCE_ID = u"Root\\MPIO\\0000".lower()
logger = getLogger(__name__)
def is_disk_drive_managed_by_windows_mpio(disk_drive):
try:
return disk_drive.parent._instance_id.lower() == MPIO_BUS_DRIVER_INSTANCE_ID
except KeyError:
logger.debug("failed t... | 745 | 0 | 92 |
01f29183e23e0bb3aad8b5b52c6dcadcb0b11833 | 4,070 | py | Python | analysis/post_fmriprep.py | VU-Cog-Sci/SB-ref | 6779fd5015aea49f37f47550dc6375ebe25c36f2 | [
"MIT"
] | null | null | null | analysis/post_fmriprep.py | VU-Cog-Sci/SB-ref | 6779fd5015aea49f37f47550dc6375ebe25c36f2 | [
"MIT"
] | null | null | null | analysis/post_fmriprep.py | VU-Cog-Sci/SB-ref | 6779fd5015aea49f37f47550dc6375ebe25c36f2 | [
"MIT"
] | null | null | null |
# extra processing after fmriprep, for all tasks
import os, json
import sys, glob
import re
import numpy as np
import pandas as pd
from utils import * #import script to use relevante functions
# define participant number and open json parameter file
if len(sys.argv)<2:
raise NameError('Please add subject num... | 38.396226 | 162 | 0.610565 |
# extra processing after fmriprep, for all tasks
import os, json
import sys, glob
import re
import numpy as np
import pandas as pd
from utils import * #import script to use relevante functions
# define participant number and open json parameter file
if len(sys.argv)<2:
raise NameError('Please add subject num... | 0 | 0 | 0 |
96f4ff5906600259def1caf22571c3a1ea5953a4 | 141 | py | Python | velhot/admin.py | matiasmane/BWA | 1dd3e68362fafb40e615f1485f2cdf4ad74837af | [
"MIT"
] | null | null | null | velhot/admin.py | matiasmane/BWA | 1dd3e68362fafb40e615f1485f2cdf4ad74837af | [
"MIT"
] | null | null | null | velhot/admin.py | matiasmane/BWA | 1dd3e68362fafb40e615f1485f2cdf4ad74837af | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Profile, FriendRequest
admin.site.register(Profile)
admin.site.register(FriendRequest)
| 23.5 | 42 | 0.836879 | from django.contrib import admin
from .models import Profile, FriendRequest
admin.site.register(Profile)
admin.site.register(FriendRequest)
| 0 | 0 | 0 |
50bc082940abce65201e4248b53c055bb82cec0d | 1,032 | py | Python | three_variable_spin_example_lecture3.py | CornerstonesQC/Annealing_Lectures | 1fe2144fc436ced00550f7248f68196a4cf6b135 | [
"Apache-2.0"
] | 3 | 2021-08-13T17:46:49.000Z | 2021-09-19T20:20:03.000Z | three_variable_spin_example_lecture3.py | CornerstonesQC/Annealing_Lectures | 1fe2144fc436ced00550f7248f68196a4cf6b135 | [
"Apache-2.0"
] | null | null | null | three_variable_spin_example_lecture3.py | CornerstonesQC/Annealing_Lectures | 1fe2144fc436ced00550f7248f68196a4cf6b135 | [
"Apache-2.0"
] | 1 | 2021-12-15T13:09:43.000Z | 2021-12-15T13:09:43.000Z | # Copyright 2021 D-Wave Systems Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 35.586207 | 80 | 0.736434 | # Copyright 2021 D-Wave Systems Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 0 | 0 | 0 |
7ac1b83c12e4dc275421ff7b51521d7518892152 | 6,106 | py | Python | genius/loader.py | duanhongyi/genius | 1bb8a8facd786c59405eb1df982a2f86d7934d61 | [
"BSD-2-Clause"
] | 204 | 2015-01-03T14:00:24.000Z | 2022-01-14T13:25:16.000Z | genius/loader.py | Liweiyanm/genius | 1bb8a8facd786c59405eb1df982a2f86d7934d61 | [
"BSD-2-Clause"
] | 5 | 2017-08-18T03:08:48.000Z | 2018-12-27T07:51:56.000Z | genius/loader.py | Liweiyanm/genius | 1bb8a8facd786c59405eb1df982a2f86d7934d61 | [
"BSD-2-Clause"
] | 63 | 2015-04-08T17:25:24.000Z | 2022-02-10T08:18:32.000Z | #encode:utf-8
from __future__ import unicode_literals
import re
import os
from wapiti import Model
from genius.trie import TrieTree
from genius.word import Word
here = os.path.abspath(os.path.dirname(__file__))
library_path = os.path.join(here, 'library')
| 38.1625 | 78 | 0.523092 | #encode:utf-8
from __future__ import unicode_literals
import re
import os
from wapiti import Model
from genius.trie import TrieTree
from genius.word import Word
here = os.path.abspath(os.path.dirname(__file__))
library_path = os.path.join(here, 'library')
class ResourceLoader(object):
_instance = None
de... | 5,577 | 246 | 23 |
8e302637155982b751babacb88f34b8b60462607 | 440 | py | Python | lj2.py | liujing0608lj/spider | 8ef2223be8515a171e5bdc85c801a50cbc793d52 | [
"Apache-2.0"
] | null | null | null | lj2.py | liujing0608lj/spider | 8ef2223be8515a171e5bdc85c801a50cbc793d52 | [
"Apache-2.0"
] | null | null | null | lj2.py | liujing0608lj/spider | 8ef2223be8515a171e5bdc85c801a50cbc793d52 | [
"Apache-2.0"
] | null | null | null | import urllib.request
import urllib.parse
def search(parsmeters)
data = urllib.parse.urlencode(parameters)
print(data)
request_ = urllib.request.Request(url='http://www.baidu.com/s?'+data
,method="GET")
response = urllib.request.urlopen(request_)
print(response.url)
HTML=response.read().decode()
print(HTML)
with o... | 20.952381 | 68 | 0.702273 | import urllib.request
import urllib.parse
def search(parsmeters)
data = urllib.parse.urlencode(parameters)
print(data)
request_ = urllib.request.Request(url='http://www.baidu.com/s?'+data
,method="GET")
response = urllib.request.urlopen(request_)
print(response.url)
HTML=response.read().decode()
print(HTML)
with o... | 0 | 0 | 0 |
e52e41a92b61592b299ead3462229704147e12e3 | 17,865 | py | Python | streamalert_cli/athena/handler.py | Meliairon/streamalert | 3b774a59d260b2822cd156e837781bd34f3625f7 | [
"Apache-2.0"
] | null | null | null | streamalert_cli/athena/handler.py | Meliairon/streamalert | 3b774a59d260b2822cd156e837781bd34f3625f7 | [
"Apache-2.0"
] | null | null | null | streamalert_cli/athena/handler.py | Meliairon/streamalert | 3b774a59d260b2822cd156e837781bd34f3625f7 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2017-present Airbnb, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... | 36.384929 | 100 | 0.646907 | """
Copyright 2017-present Airbnb, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... | 0 | 4,886 | 23 |
329309c4c9c1629d0252e323492359c67088df37 | 1,937 | py | Python | aws_lambda_builders/workflows/ruby_bundler/actions.py | txase/aws-lambda-builders | c8f2bef73fd7c7943d7c4d54f1c11d3625b5c596 | [
"Apache-2.0"
] | 1 | 2019-08-25T18:41:28.000Z | 2019-08-25T18:41:28.000Z | aws_lambda_builders/workflows/ruby_bundler/actions.py | txase/aws-lambda-builders | c8f2bef73fd7c7943d7c4d54f1c11d3625b5c596 | [
"Apache-2.0"
] | null | null | null | aws_lambda_builders/workflows/ruby_bundler/actions.py | txase/aws-lambda-builders | c8f2bef73fd7c7943d7c4d54f1c11d3625b5c596 | [
"Apache-2.0"
] | null | null | null | """
Actions for Ruby dependency resolution with Bundler
"""
import logging
from aws_lambda_builders.actions import BaseAction, Purpose, ActionFailedError
from .bundler import BundlerExecutionError
LOG = logging.getLogger(__name__)
class RubyBundlerInstallAction(BaseAction):
"""
A Lambda Builder Action whic... | 32.283333 | 91 | 0.672173 | """
Actions for Ruby dependency resolution with Bundler
"""
import logging
from aws_lambda_builders.actions import BaseAction, Purpose, ActionFailedError
from .bundler import BundlerExecutionError
LOG = logging.getLogger(__name__)
class RubyBundlerInstallAction(BaseAction):
"""
A Lambda Builder Action whic... | 1,034 | 0 | 108 |
1d627793567187279c32442c0d889cc8d1c094ef | 8,939 | py | Python | networkapi/infrastructure/ip_subnet_utils.py | brunodevel/GloboNetworkAPI | ea8eebc0337636f9250e628cc392514934db8edd | [
"Apache-2.0"
] | null | null | null | networkapi/infrastructure/ip_subnet_utils.py | brunodevel/GloboNetworkAPI | ea8eebc0337636f9250e628cc392514934db8edd | [
"Apache-2.0"
] | null | null | null | networkapi/infrastructure/ip_subnet_utils.py | brunodevel/GloboNetworkAPI | ea8eebc0337636f9250e628cc392514934db8edd | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
# 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 "Li... | 50.219101 | 180 | 0.602752 | # -*- coding:utf-8 -*-
# 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 "Li... | 271 | 0 | 75 |
0792965f1c270d48b67717e15eb78c5c0205c783 | 224 | py | Python | 30.11.2019/hamming.py | KruZZy/coderdojo-python | 0f9920de24c0ff8733badb81daed1e590825662c | [
"MIT"
] | null | null | null | 30.11.2019/hamming.py | KruZZy/coderdojo-python | 0f9920de24c0ff8733badb81daed1e590825662c | [
"MIT"
] | null | null | null | 30.11.2019/hamming.py | KruZZy/coderdojo-python | 0f9920de24c0ff8733badb81daed1e590825662c | [
"MIT"
] | null | null | null | from random import randint
n =int(input("n = "))
A =[]
B =[]
for i in range (n):
A.append(randint(1,20))
B.append(randint(1,20))
print(A,B)
dist=0
for i in range (n):
if A[i] != B[i]:
dist+=1
print(dist)
| 16 | 27 | 0.558036 | from random import randint
n =int(input("n = "))
A =[]
B =[]
for i in range (n):
A.append(randint(1,20))
B.append(randint(1,20))
print(A,B)
dist=0
for i in range (n):
if A[i] != B[i]:
dist+=1
print(dist)
| 0 | 0 | 0 |
81d43ab85ec341aaf5813b683d0d34aa09a3a77c | 582 | py | Python | platform_info.py | ljm7b2/OBSTstandardDeviation | 5eab7fecd7843a489d6ef5381e28a65aa24853c6 | [
"MIT"
] | null | null | null | platform_info.py | ljm7b2/OBSTstandardDeviation | 5eab7fecd7843a489d6ef5381e28a65aa24853c6 | [
"MIT"
] | null | null | null | platform_info.py | ljm7b2/OBSTstandardDeviation | 5eab7fecd7843a489d6ef5381e28a65aa24853c6 | [
"MIT"
] | null | null | null | import platform
# method copied from STL, not original work of author
| 48.5 | 97 | 0.671821 | import platform
# method copied from STL, not original work of author
def get_platform_info(output_file):
print("\nSYSTEM INFORMATION", file=output_file)
print("{:<20}{:>5}".format('system:', platform.system()), file=output_file)
print("{:<20}{:>5}".format('node:', platform.node()), file=output_file)
... | 488 | 0 | 23 |
7d4736a6d2163bf79bf79d70e9effb9a771809e5 | 7,982 | py | Python | pbce/tml/examples/flowvisor/ryu_app.py | kit-tm/gcmi-exp | 34d850639a079bf73428bd70ac28cc972d030a7c | [
"BSD-2-Clause"
] | null | null | null | pbce/tml/examples/flowvisor/ryu_app.py | kit-tm/gcmi-exp | 34d850639a079bf73428bd70ac28cc972d030a7c | [
"BSD-2-Clause"
] | null | null | null | pbce/tml/examples/flowvisor/ryu_app.py | kit-tm/gcmi-exp | 34d850639a079bf73428bd70ac28cc972d030a7c | [
"BSD-2-Clause"
] | 1 | 2019-11-18T11:35:36.000Z | 2019-11-18T11:35:36.000Z | # Copyright (C) 2011 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 40.313131 | 79 | 0.640817 | # Copyright (C) 2011 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 6,065 | 404 | 92 |
340bd0f34f1475a05d8a08d5a31c0aae250a0e8b | 2,716 | py | Python | 02-am/02-Decision Trees/Decision_tree_3_5.py | Matheusqz/pucpr-ciencia-de-dados | 28a833a902dba41a35dc9d02bc5607a66aca78b0 | [
"MIT"
] | null | null | null | 02-am/02-Decision Trees/Decision_tree_3_5.py | Matheusqz/pucpr-ciencia-de-dados | 28a833a902dba41a35dc9d02bc5607a66aca78b0 | [
"MIT"
] | null | null | null | 02-am/02-Decision Trees/Decision_tree_3_5.py | Matheusqz/pucpr-ciencia-de-dados | 28a833a902dba41a35dc9d02bc5607a66aca78b0 | [
"MIT"
] | null | null | null | # Este exemplo carrega a base Wine da UCI, treina uma Arvore de decisao usando
# holdout e outra usando validacao cruzada com 10 pastas.
# Importa bibliotecas necessarias
import numpy as np
import urllib
from sklearn import tree
from sklearn import model_selection
from sklearn.metrics import confusion_matrix
from ... | 30.177778 | 98 | 0.765464 | # Este exemplo carrega a base Wine da UCI, treina uma Arvore de decisao usando
# holdout e outra usando validacao cruzada com 10 pastas.
# Importa bibliotecas necessarias
import numpy as np
import urllib
from sklearn import tree
from sklearn import model_selection
from sklearn.metrics import confusion_matrix
from ... | 0 | 0 | 0 |
b3b8bc5092366ad27804dc5ece6a0fd50b476e50 | 1,032 | py | Python | tests/ops/test_snapshot.py | KarimAED/pennylane | d201dd52def0dfa44efd485e06ea06defda22dc0 | [
"Apache-2.0"
] | null | null | null | tests/ops/test_snapshot.py | KarimAED/pennylane | d201dd52def0dfa44efd485e06ea06defda22dc0 | [
"Apache-2.0"
] | null | null | null | tests/ops/test_snapshot.py | KarimAED/pennylane | d201dd52def0dfa44efd485e06ea06defda22dc0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-2022 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or... | 35.586207 | 74 | 0.73062 | # Copyright 2018-2022 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or... | 0 | 0 | 0 |
3a6d504a6e9d9e570b87e4c72ca1f835859d6e9a | 599 | py | Python | app/modules/base/views.py | thestd/schedule-BOT | f6603cf7f3b1b0b0004b9c445edf271d2c959d11 | [
"MIT"
] | 9 | 2019-06-27T13:56:55.000Z | 2021-01-06T14:37:14.000Z | app/modules/base/views.py | thestd/schedule-BOT | f6603cf7f3b1b0b0004b9c445edf271d2c959d11 | [
"MIT"
] | null | null | null | app/modules/base/views.py | thestd/schedule-BOT | f6603cf7f3b1b0b0004b9c445edf271d2c959d11 | [
"MIT"
] | 3 | 2019-06-25T14:23:27.000Z | 2021-04-28T10:14:58.000Z | from aiogram import types
from app.modules.base.templates import choice_student_text, choice_teacher_text
from app.modules.schedule.consts import query_type
| 27.227273 | 79 | 0.692821 | from aiogram import types
from app.modules.base.templates import choice_student_text, choice_teacher_text
from app.modules.schedule.consts import query_type
def query_type_markup() -> types.InlineKeyboardMarkup:
line_markup = types.InlineKeyboardMarkup()
line_markup.add(
types.InlineKeyboardButton(
... | 417 | 0 | 23 |
89f4319dc3948b345b2a80284951d3126c2c0a03 | 15,047 | py | Python | entity/tests/test_complex_view.py | syucream/airone | ce3c199f23c595a7c029ee52b57297b3666343e3 | [
"MIT"
] | null | null | null | entity/tests/test_complex_view.py | syucream/airone | ce3c199f23c595a7c029ee52b57297b3666343e3 | [
"MIT"
] | 2 | 2021-02-28T05:04:18.000Z | 2021-05-01T07:00:57.000Z | entity/tests/test_complex_view.py | syucream/airone | ce3c199f23c595a7c029ee52b57297b3666343e3 | [
"MIT"
] | null | null | null | import json
from airone.lib.acl import ACLType
from airone.lib.test import AironeViewTest
from airone.lib.types import AttrTypeStr
from airone.lib.types import AttrTypeArrStr, AttrTypeArrObj
from airone.lib.types import AttrTypeValue
from django.urls import reverse
from entity.models import Entity, EntityAttr
from e... | 41 | 100 | 0.552336 | import json
from airone.lib.acl import ACLType
from airone.lib.test import AironeViewTest
from airone.lib.types import AttrTypeStr
from airone.lib.types import AttrTypeArrStr, AttrTypeArrObj
from airone.lib.types import AttrTypeValue
from django.urls import reverse
from entity.models import Entity, EntityAttr
from e... | 4,387 | 0 | 53 |
bf5724577612a2d00daec5ca840971656ba19be9 | 2,264 | py | Python | user_profile/views.py | ksarthak4ever/Restrict_API | e53e671965b825fa167b080fe7212ec6f3e4c6ca | [
"MIT"
] | null | null | null | user_profile/views.py | ksarthak4ever/Restrict_API | e53e671965b825fa167b080fe7212ec6f3e4c6ca | [
"MIT"
] | null | null | null | user_profile/views.py | ksarthak4ever/Restrict_API | e53e671965b825fa167b080fe7212ec6f3e4c6ca | [
"MIT"
] | null | null | null | from django.shortcuts import render
from rest_framework import viewsets
from rest_framework.response import Response
from rest_framework.authentication import TokenAuthentication
from rest_framework.authtoken.serializers import AuthTokenSerializer
from rest_framework.authtoken.views import ObtainAuthToken
from rest... | 41.925926 | 237 | 0.787102 | from django.shortcuts import render
from rest_framework import viewsets
from rest_framework.response import Response
from rest_framework.authentication import TokenAuthentication
from rest_framework.authtoken.serializers import AuthTokenSerializer
from rest_framework.authtoken.views import ObtainAuthToken
from rest... | 1,011 | 688 | 94 |
d1204259d5d59c637e2ebf4a67f530c5f2e46420 | 272 | py | Python | ceciestunepipe/util/__init__.py | zekearneodo/ceciestunepipe | 7e771783769816f37de44077177152175aecc2b7 | [
"MIT"
] | null | null | null | ceciestunepipe/util/__init__.py | zekearneodo/ceciestunepipe | 7e771783769816f37de44077177152175aecc2b7 | [
"MIT"
] | null | null | null | ceciestunepipe/util/__init__.py | zekearneodo/ceciestunepipe | 7e771783769816f37de44077177152175aecc2b7 | [
"MIT"
] | null | null | null | from matplotlib import pyplot as plt
axes_pars = {'axes.labelpad': 5,
'axes.titlepad': 5,
'axes.titlesize': 'small',
'axes.grid': False,
'axes.xmargin': 0,
'axes.ymargin': 0}
plt.rcParams.update(axes_pars) | 27.2 | 39 | 0.540441 | from matplotlib import pyplot as plt
axes_pars = {'axes.labelpad': 5,
'axes.titlepad': 5,
'axes.titlesize': 'small',
'axes.grid': False,
'axes.xmargin': 0,
'axes.ymargin': 0}
plt.rcParams.update(axes_pars) | 0 | 0 | 0 |
e4f6143f7bfb4ed767a788628fa6495930e03951 | 145 | py | Python | servers/run.py | ibalance2005/ocr_server | e7fd190df692a19c8d090950ee9cdd9838b262ba | [
"Apache-2.0"
] | null | null | null | servers/run.py | ibalance2005/ocr_server | e7fd190df692a19c8d090950ee9cdd9838b262ba | [
"Apache-2.0"
] | null | null | null | servers/run.py | ibalance2005/ocr_server | e7fd190df692a19c8d090950ee9cdd9838b262ba | [
"Apache-2.0"
] | null | null | null | import config as C
from servers import app
if __name__ == '__main__':
app_run = app.init()
app_run.run(host='0.0.0.0', port=C.API_PORT) | 20.714286 | 48 | 0.675862 | import config as C
from servers import app
if __name__ == '__main__':
app_run = app.init()
app_run.run(host='0.0.0.0', port=C.API_PORT) | 0 | 0 | 0 |
6affc5422901263d6054be01632ec2f25f425d15 | 5,669 | py | Python | cossmo_tests/test_cossmo.py | PSI-Lab/COSSMO | 704772ffc6d406c6fd914a069c810845dfc6dde3 | [
"AFL-1.1"
] | 4 | 2018-07-06T07:17:03.000Z | 2019-04-26T03:16:40.000Z | cossmo_tests/test_cossmo.py | PSI-Lab/COSSMO | 704772ffc6d406c6fd914a069c810845dfc6dde3 | [
"AFL-1.1"
] | null | null | null | cossmo_tests/test_cossmo.py | PSI-Lab/COSSMO | 704772ffc6d406c6fd914a069c810845dfc6dde3 | [
"AFL-1.1"
] | 1 | 2021-01-26T06:27:02.000Z | 2021-01-26T06:27:02.000Z | import tensorflow as tf
import numpy as np
from cossmo.output_networks import BalancedOutputNetwork, RaggedOutputNetwork
| 38.304054 | 78 | 0.533604 | import tensorflow as tf
import numpy as np
from cossmo.output_networks import BalancedOutputNetwork, RaggedOutputNetwork
class TestCOSSMO(tf.test.TestCase):
def test_cossmo_predictions(self):
with self.test_session() as sess:
num_outputs = 4
N = 20
k = 10
lo... | 5,360 | 34 | 152 |
3a2b87367dc0dba91b6e90ca9a24a230cb5df047 | 2,115 | py | Python | tweeter_analysis.py | milindparvatia/StockMarketApp | 0a3de9f2b10da0dad524c1ee47db5cfa8f00cdb7 | [
"Apache-2.0"
] | 1 | 2020-08-09T07:36:31.000Z | 2020-08-09T07:36:31.000Z | tweeter_analysis.py | milindparvatia/StockMarketApp | 0a3de9f2b10da0dad524c1ee47db5cfa8f00cdb7 | [
"Apache-2.0"
] | 7 | 2020-02-11T23:10:00.000Z | 2021-06-10T17:37:24.000Z | tweeter_analysis.py | milindparvatia/StockMarketApp | 0a3de9f2b10da0dad524c1ee47db5cfa8f00cdb7 | [
"Apache-2.0"
] | 1 | 2019-06-09T08:10:04.000Z | 2019-06-09T08:10:04.000Z | import os
import json
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
import string
from collections import defaultdict
import re
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
analyser = SentimentIntensityAnalyzer()
if __name__ == '__main__':
os.remove("tweets1234.... | 27.115385 | 114 | 0.583924 | import os
import json
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
import string
from collections import defaultdict
import re
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
analyser = SentimentIntensityAnalyzer()
def leaders(xs, top=500):
counts = defaultdict(in... | 152 | 0 | 23 |
2c61a3cf22fed9100e56ac03ddf5dee0325b911d | 1,409 | py | Python | compare_records.py | KungPaoChick/CovidMonitor | 7b96d170e7583fc395dddd370f03eec0e0b71e0c | [
"MIT"
] | 2 | 2021-01-31T13:27:45.000Z | 2021-02-01T00:06:40.000Z | compare_records.py | KungPaoChick/CovidMonitor | 7b96d170e7583fc395dddd370f03eec0e0b71e0c | [
"MIT"
] | null | null | null | compare_records.py | KungPaoChick/CovidMonitor | 7b96d170e7583fc395dddd370f03eec0e0b71e0c | [
"MIT"
] | null | null | null | import os, errno
import pandas as pd
first_file = str(input('First Country: '))
second_file = str(input('Second Country: '))
file_path = str(input('Path:(year/month) '))
find_files(first_file, second_file, file_path)
| 35.225 | 99 | 0.535841 | import os, errno
import pandas as pd
def find_files(file_one, file_two, search_path):
results = []
path = os.getcwd() + '/Records/'
csv_one = file_one + '.csv'
csv_two = file_two + '.csv'
if os.path.isdir(path + search_path):
try:
for root, dirs, files in os.walk(pat... | 1,153 | 0 | 25 |
b4c602a7a6ac6de6dc83545d32aa9910df43a8d1 | 1,968 | py | Python | game-examples-AttilaToth/Minesweeper/main.py | CrtomirJuren/pygame-projects | f710f36050bfe3ece866bbda7d570caa1e037d7a | [
"MIT"
] | null | null | null | game-examples-AttilaToth/Minesweeper/main.py | CrtomirJuren/pygame-projects | f710f36050bfe3ece866bbda7d570caa1e037d7a | [
"MIT"
] | null | null | null | game-examples-AttilaToth/Minesweeper/main.py | CrtomirJuren/pygame-projects | f710f36050bfe3ece866bbda7d570caa1e037d7a | [
"MIT"
] | null | null | null | import pygame
from board import Grid
from player import Player, Stats
from enum import Enum, auto
import os
os.environ['SDL_VIDEO_WINDOW_POS'] = "%d,%d" % (400,100)
surface = pygame.display.set_mode((1200, 900))
pygame.display.set_caption('Minesweeper')
state = States.running
player = Player()
grid = Grid(player)
... | 30.75 | 98 | 0.598069 | import pygame
from board import Grid
from player import Player, Stats
from enum import Enum, auto
import os
os.environ['SDL_VIDEO_WINDOW_POS'] = "%d,%d" % (400,100)
surface = pygame.display.set_mode((1200, 900))
pygame.display.set_caption('Minesweeper')
class States(Enum):
running = auto()
game_over = auto(... | 0 | 59 | 23 |
7904281c09f285f9f58bfe640ba09dcc99178926 | 20,018 | py | Python | numpy_indexed/grouping.py | EelcoHoogendoorn/Numpy_arraysetops_EP | 84dc8114bf8a79c3acb3f7f59128247b9fc97243 | [
"MIT"
] | 170 | 2016-04-02T07:29:12.000Z | 2022-03-30T02:57:15.000Z | numpy_indexed/grouping.py | EelcoHoogendoorn/Numpy_arraysetops_EP | 84dc8114bf8a79c3acb3f7f59128247b9fc97243 | [
"MIT"
] | 13 | 2016-08-31T14:39:51.000Z | 2022-01-10T16:29:00.000Z | numpy_indexed/grouping.py | EelcoHoogendoorn/Numpy_arraysetops_EP | 84dc8114bf8a79c3acb3f7f59128247b9fc97243 | [
"MIT"
] | 19 | 2016-07-20T18:49:36.000Z | 2021-04-16T06:38:09.000Z | """grouping module"""
from __future__ import absolute_import, division, print_function, unicode_literals
from builtins import *
import itertools
import numpy as np
from numpy_indexed.index import as_index
import numpy_indexed as npi
__author__ = "Eelco Hoogendoorn"
__license__ = "LGPL"
__email__ = "hoogendoorn.eelco... | 32.655791 | 115 | 0.575082 | """grouping module"""
from __future__ import absolute_import, division, print_function, unicode_literals
from builtins import *
import itertools
import numpy as np
from numpy_indexed.index import as_index
import numpy_indexed as npi
__author__ = "Eelco Hoogendoorn"
__license__ = "LGPL"
__email__ = "hoogendoorn.eelco... | 573 | 0 | 61 |
87beae9c101a147576d3bb34a1271a7aab30736e | 6,089 | py | Python | plugins/aea-cli-ipfs/aea_cli_ipfs/registry.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | null | null | null | plugins/aea-cli-ipfs/aea_cli_ipfs/registry.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | null | null | null | plugins/aea-cli-ipfs/aea_cli_ipfs/registry.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2021-2022 Valory AG
# Copyright 2018-2019 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.... | 31.225641 | 86 | 0.658072 | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2021-2022 Valory AG
# Copyright 2018-2019 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.... | 0 | 0 | 0 |
61ef1912263dabb8f668d8da6532ccd6c0f92b63 | 639 | py | Python | library/infrastructure_architecture/event_sourced_architecture/event_queue_subscriber.py | piotrkluch/billenium-keras-api-python | 0d7c589dac150ab5363f33f1f6024c44a667d0ae | [
"MIT"
] | null | null | null | library/infrastructure_architecture/event_sourced_architecture/event_queue_subscriber.py | piotrkluch/billenium-keras-api-python | 0d7c589dac150ab5363f33f1f6024c44a667d0ae | [
"MIT"
] | null | null | null | library/infrastructure_architecture/event_sourced_architecture/event_queue_subscriber.py | piotrkluch/billenium-keras-api-python | 0d7c589dac150ab5363f33f1f6024c44a667d0ae | [
"MIT"
] | null | null | null |
# TODO: Turn this into a more general class which can subscribe and unsubscribe from
# TODO: anything, with a context manager interface.
from library.domain.events import subscribe, unsubscribe, DomainEvent
| 27.782609 | 84 | 0.740219 |
# TODO: Turn this into a more general class which can subscribe and unsubscribe from
# TODO: anything, with a context manager interface.
from library.domain.events import subscribe, unsubscribe, DomainEvent
class EventQueueSubscriber:
def __init__(self, event_queue):
self._event_queue = event_queue
... | 274 | 132 | 23 |
cd407ac26d60f7b87f183c2fb73a65c50bfe7222 | 153 | py | Python | bauh/api/user.py | DN-debug/bauh | 83aeccae87d7fe26f6c5bf24be005288d5d54d84 | [
"Zlib"
] | null | null | null | bauh/api/user.py | DN-debug/bauh | 83aeccae87d7fe26f6c5bf24be005288d5d54d84 | [
"Zlib"
] | null | null | null | bauh/api/user.py | DN-debug/bauh | 83aeccae87d7fe26f6c5bf24be005288d5d54d84 | [
"Zlib"
] | null | null | null | import os
from typing import Optional
| 21.857143 | 68 | 0.712418 | import os
from typing import Optional
def is_root(user_id: Optional[int] = None):
return user_id == 0 if user_id is not None else os.getuid() == 0
| 91 | 0 | 23 |
909c3b54cecc30d25635aaefe0f6af45baae38eb | 4,821 | py | Python | preprocess.py | lionben89/NLP-3 | 5a0eb40fd40bb1c7c67d38a8e1b3478bac00afbb | [
"MIT"
] | null | null | null | preprocess.py | lionben89/NLP-3 | 5a0eb40fd40bb1c7c67d38a8e1b3478bac00afbb | [
"MIT"
] | null | null | null | preprocess.py | lionben89/NLP-3 | 5a0eb40fd40bb1c7c67d38a8e1b3478bac00afbb | [
"MIT"
] | null | null | null | import pandas as pd
from sklearn import preprocessing
import nltk
nltk.download('punkt')
dataset_structure = None
TIMESTAMP_FEATURES = {
"timestamp": True,
"day_of_week": True,
"day_of_month": True,
"month": True,
"hour": True,
"minute": True,
"year": True
}
def preprocess(filename, tra... | 28.868263 | 115 | 0.602365 | import pandas as pd
from sklearn import preprocessing
import nltk
nltk.download('punkt')
dataset_structure = None
TIMESTAMP_FEATURES = {
"timestamp": True,
"day_of_week": True,
"day_of_month": True,
"month": True,
"hour": True,
"minute": True,
"year": True
}
def preprocess(filename, tra... | 183 | 0 | 69 |
af45aaf0a681c533ca3f1003ffbce78d13e4a35a | 440 | py | Python | course/migrations/0002_auto_20200813_1721.py | Seals6/stucoursetest | 7b8f63ac7bf2b4066a9b7af9672838d03ab859ad | [
"MIT"
] | 11 | 2021-01-13T05:12:24.000Z | 2022-03-17T16:29:30.000Z | course/migrations/0002_auto_20200813_1721.py | Seals6/stucoursetest | 7b8f63ac7bf2b4066a9b7af9672838d03ab859ad | [
"MIT"
] | 1 | 2021-04-21T04:16:11.000Z | 2021-04-21T04:17:14.000Z | course/migrations/0002_auto_20200813_1721.py | Seals6/stucoursetest | 7b8f63ac7bf2b4066a9b7af9672838d03ab859ad | [
"MIT"
] | 4 | 2021-04-26T02:35:49.000Z | 2021-12-12T09:28:23.000Z | # Generated by Django 2.2.11 on 2020-08-13 09:21
from django.db import migrations, models
| 23.157895 | 113 | 0.584091 | # Generated by Django 2.2.11 on 2020-08-13 09:21
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('course', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='course',
name='semester',
... | 0 | 333 | 23 |
8a5fd65aa659ee11c18cb48fa2c1913634d25078 | 5,647 | py | Python | src/reppy/__init__.py | pombredanne/reppy2 | 757dc5e86ceb647b5bd27a2467e38dd860f5bf0e | [
"MIT"
] | null | null | null | src/reppy/__init__.py | pombredanne/reppy2 | 757dc5e86ceb647b5bd27a2467e38dd860f5bf0e | [
"MIT"
] | 1 | 2015-10-13T12:48:23.000Z | 2015-10-13T12:48:23.000Z | src/reppy/__init__.py | pombredanne/reppy2 | 757dc5e86ceb647b5bd27a2467e38dd860f5bf0e | [
"MIT"
] | null | null | null | #! /usr/bin/env python
#
# Copyright (c) 2011 SEOmoz
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, mer... | 35.968153 | 78 | 0.571454 | #! /usr/bin/env python
#
# Copyright (c) 2011 SEOmoz
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, mer... | 0 | 0 | 0 |
7ed29c6bfb8123ac9d4b0d843be8bdc86441d835 | 801 | py | Python | flask/config.py | Index01/GSL-vts | 4d683a3118d21204dd0feef3239ccad9a7a09031 | [
"MIT"
] | null | null | null | flask/config.py | Index01/GSL-vts | 4d683a3118d21204dd0feef3239ccad9a7a09031 | [
"MIT"
] | null | null | null | flask/config.py | Index01/GSL-vts | 4d683a3118d21204dd0feef3239ccad9a7a09031 | [
"MIT"
] | null | null | null | from flask import Flask
from flask_iniconfig import INIConfig
from flask_sqlalchemy import SQLAlchemy
from ConfigParser import SafeConfigParser, NoSectionError
app = Flask(__name__)
parser = SafeConfigParser()
parser.read('../gateConfigs.ini')
app.config['Testing'] = True
app.config['DEBUG'] = True
app.config['WT... | 28.607143 | 76 | 0.765293 | from flask import Flask
from flask_iniconfig import INIConfig
from flask_sqlalchemy import SQLAlchemy
from ConfigParser import SafeConfigParser, NoSectionError
app = Flask(__name__)
parser = SafeConfigParser()
parser.read('../gateConfigs.ini')
app.config['Testing'] = True
app.config['DEBUG'] = True
app.config['WT... | 0 | 0 | 0 |
984949e87794d2666a101048f14f3ca5aa598fb9 | 868 | py | Python | talks/users/urls.py | davan690/talks.ox | a90b034b34600c06bc68cda0e48dd3c0663f4538 | [
"Apache-2.0"
] | null | null | null | talks/users/urls.py | davan690/talks.ox | a90b034b34600c06bc68cda0e48dd3c0663f4538 | [
"Apache-2.0"
] | null | null | null | talks/users/urls.py | davan690/talks.ox | a90b034b34600c06bc68cda0e48dd3c0663f4538 | [
"Apache-2.0"
] | null | null | null | from django.conf.urls import patterns, url
from talks.users.views import (manage_collections, list_public_collections, browse_public_collections, view_collection, add_collection, edit_collection, delete_collection, my_talks)
urlpatterns = patterns('',
url(r'^lists$', manage_collections, name='manage-lists'),
... | 54.25 | 181 | 0.715438 | from django.conf.urls import patterns, url
from talks.users.views import (manage_collections, list_public_collections, browse_public_collections, view_collection, add_collection, edit_collection, delete_collection, my_talks)
urlpatterns = patterns('',
url(r'^lists$', manage_collections, name='manage-lists'),
... | 0 | 0 | 0 |
97e5bc9b26a1b779dbc3cc482a168e3ced6f60f1 | 2,095 | py | Python | django/core/serializers/json.py | huicheese/Django-test3 | ac11d2dce245b48392e52d1f4acfd5e7433b243e | [
"BSD-3-Clause"
] | 91 | 2015-01-05T01:10:51.000Z | 2021-09-26T18:01:53.000Z | django/core/serializers/json.py | joetyson/django | c3699190186561d5c216b2a77ecbfc487d42a734 | [
"BSD-3-Clause"
] | 4 | 2015-07-05T21:09:37.000Z | 2019-09-06T14:34:59.000Z | django/core/serializers/json.py | joetyson/django | c3699190186561d5c216b2a77ecbfc487d42a734 | [
"BSD-3-Clause"
] | 32 | 2015-04-03T04:29:45.000Z | 2021-09-14T21:36:02.000Z | """
Serialize data to/from JSON
"""
import datetime
from StringIO import StringIO
from django.core.serializers.python import Serializer as PythonSerializer
from django.core.serializers.python import Deserializer as PythonDeserializer
from django.utils import datetime_safe
from django.utils import simplejson
try:
... | 30.362319 | 89 | 0.683055 | """
Serialize data to/from JSON
"""
import datetime
from StringIO import StringIO
from django.core.serializers.python import Serializer as PythonSerializer
from django.core.serializers.python import Deserializer as PythonDeserializer
from django.utils import datetime_safe
from django.utils import simplejson
try:
... | 819 | 0 | 81 |
ae6737103b4bbb20784262cd7a4c6f9a4bcbea1e | 14,531 | py | Python | auv_mission_planner/scripts/mission_planner.py | svbhat/smarc_planning | f2a69129f525aefc56ce29e5deb87a1f087c3c06 | [
"BSD-3-Clause"
] | 1 | 2021-12-13T03:06:52.000Z | 2021-12-13T03:06:52.000Z | auv_mission_planner/scripts/mission_planner.py | svbhat/smarc_planning | f2a69129f525aefc56ce29e5deb87a1f087c3c06 | [
"BSD-3-Clause"
] | null | null | null | auv_mission_planner/scripts/mission_planner.py | svbhat/smarc_planning | f2a69129f525aefc56ce29e5deb87a1f087c3c06 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Copyright 2018 Nils Bore (nbore@kth.se)
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and th... | 38.441799 | 757 | 0.638291 | #!/usr/bin/env python
# Copyright 2018 Nils Bore (nbore@kth.se)
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and th... | 11,839 | 8 | 433 |
f5db14ce641a424ce8380470a2b3bcfcc423464e | 1,065 | py | Python | packs/device42/actions/lib/base_action.py | userlocalhost2000/st2contrib | 1a5f759e76401743ed9023d298a3d767e3885db1 | [
"Apache-2.0"
] | 164 | 2015-01-17T16:08:33.000Z | 2021-08-03T02:34:07.000Z | packs/device42/actions/lib/base_action.py | userlocalhost2000/st2contrib | 1a5f759e76401743ed9023d298a3d767e3885db1 | [
"Apache-2.0"
] | 442 | 2015-01-01T11:19:01.000Z | 2017-09-06T23:26:17.000Z | packs/device42/actions/lib/base_action.py | userlocalhost2000/st2contrib | 1a5f759e76401743ed9023d298a3d767e3885db1 | [
"Apache-2.0"
] | 202 | 2015-01-13T00:37:40.000Z | 2020-11-07T11:30:10.000Z | import requests
from st2actions.runners.pythonrunner import Action
| 34.354839 | 71 | 0.612207 | import requests
from st2actions.runners.pythonrunner import Action
class BaseAction(Action):
def __init__(self, config):
super(BaseAction, self).__init__(config)
self.d42_server = self.config.get('d42_server', None)
if not self.d42_server:
raise ValueError('"d42_server" config... | 917 | 4 | 76 |
16b13d095afe51d2bda71f8464d9899cbaaa5511 | 4,570 | py | Python | vyper/parser/constants.py | ryan-rozario/vyper | 9d235e6e7e85ee0dbfaf54a6efd5fb6334c2d00f | [
"Apache-2.0"
] | null | null | null | vyper/parser/constants.py | ryan-rozario/vyper | 9d235e6e7e85ee0dbfaf54a6efd5fb6334c2d00f | [
"Apache-2.0"
] | null | null | null | vyper/parser/constants.py | ryan-rozario/vyper | 9d235e6e7e85ee0dbfaf54a6efd5fb6334c2d00f | [
"Apache-2.0"
] | null | null | null | import copy
from vyper import (
ast as vy_ast,
)
from vyper.exceptions import (
StructureException,
TypeMismatch,
VariableDeclarationException,
)
from vyper.parser.context import (
Context,
)
from vyper.parser.expr import (
Expr,
)
from vyper.parser.memory_allocator import (
MemoryAllocator... | 32.411348 | 98 | 0.610941 | import copy
from vyper import (
ast as vy_ast,
)
from vyper.exceptions import (
StructureException,
TypeMismatch,
VariableDeclarationException,
)
from vyper.parser.context import (
Context,
)
from vyper.parser.expr import (
Expr,
)
from vyper.parser.memory_allocator import (
MemoryAllocator... | 3,290 | 803 | 23 |
75a7ea22e96f0fd9b60feeabde377cb245cf7c46 | 1,552 | py | Python | copy_rootless.py | clburlison/rootless_diff | daa8b547138e36b1d6ce887f9faa938de873c2d4 | [
"MIT"
] | 2 | 2017-04-06T18:35:40.000Z | 2017-05-20T20:48:29.000Z | copy_rootless.py | clburlison/rootless_diff | daa8b547138e36b1d6ce887f9faa938de873c2d4 | [
"MIT"
] | null | null | null | copy_rootless.py | clburlison/rootless_diff | daa8b547138e36b1d6ce887f9faa938de873c2d4 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
"""
A helper script to copy SIP related files.
"""
from __future__ import print_function
import os
import shutil
import sys
import plistlib
def get_version():
'''Obtain system version info from the disk version plist'''
SYSTEM_VERSION = ... | 29.846154 | 78 | 0.673325 | #!/usr/bin/python
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
"""
A helper script to copy SIP related files.
"""
from __future__ import print_function
import os
import shutil
import sys
import plistlib
def get_version():
'''Obtain system version info from the disk version plist'''
SYSTEM_VERSION = ... | 0 | 0 | 0 |
4e2a80faa7ec26140be32a4d461ad8db48951bc1 | 80 | py | Python | plugin/exportsymbols/__init__.py | BlackVS/IDA-exportsymbols | ecbd5b34a2a87091cd0ddf8d088f53bb700d6d49 | [
"MIT"
] | 2 | 2020-10-31T06:43:37.000Z | 2022-02-12T15:57:55.000Z | plugin/exportsymbols/__init__.py | BlackVS/IDA-exportsymbols | ecbd5b34a2a87091cd0ddf8d088f53bb700d6d49 | [
"MIT"
] | null | null | null | plugin/exportsymbols/__init__.py | BlackVS/IDA-exportsymbols | ecbd5b34a2a87091cd0ddf8d088f53bb700d6d49 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# coding: utf-8
#
# HeapViewer - by @danigargu
#
import os
| 8 | 28 | 0.6375 | #!/usr/bin/python
# coding: utf-8
#
# HeapViewer - by @danigargu
#
import os
| 0 | 0 | 0 |
bcf90eb98f466a86db67b9814a21ceb8773b5463 | 1,987 | py | Python | autosk_dev_test/sparse_read_test.py | hmendozap/master-arbeit-files | 5c1b90bc4a424313234b84bad405799de6f8d2ed | [
"MIT"
] | 2 | 2018-01-18T06:25:21.000Z | 2018-12-11T07:43:09.000Z | autosk_dev_test/sparse_read_test.py | hmendozap/master-arbeit-files | 5c1b90bc4a424313234b84bad405799de6f8d2ed | [
"MIT"
] | 1 | 2016-03-29T07:55:18.000Z | 2016-03-29T07:55:18.000Z | autosk_dev_test/sparse_read_test.py | hmendozap/master-arbeit-files | 5c1b90bc4a424313234b84bad405799de6f8d2ed | [
"MIT"
] | null | null | null | import numpy as np
from sklearn.datasets import load_svmlight_file as lsf
from autosklearn.pipeline.components.classification import add_classifier
from autosklearn.data import competition_data_manager as askdata
import autosklearn.automl as autosk
from component import DeepFeedNet
aad_dataset_dir = '../datasets/datas... | 36.796296 | 83 | 0.744338 | import numpy as np
from sklearn.datasets import load_svmlight_file as lsf
from autosklearn.pipeline.components.classification import add_classifier
from autosklearn.data import competition_data_manager as askdata
import autosklearn.automl as autosk
from component import DeepFeedNet
aad_dataset_dir = '../datasets/datas... | 0 | 0 | 0 |
a758accc63c2338cfb280f4a7bd5ac766b0517a7 | 2,159 | py | Python | hailo_model_zoo/core/datasets/parse_mot.py | nadaved1/hailo_model_zoo | 42b716f337dde4ec602022a34d6a07a1bbd45539 | [
"MIT"
] | 29 | 2021-07-19T13:53:18.000Z | 2022-01-26T11:20:55.000Z | hailo_model_zoo/core/datasets/parse_mot.py | nadaved1/hailo_model_zoo | 42b716f337dde4ec602022a34d6a07a1bbd45539 | [
"MIT"
] | 1 | 2022-03-18T03:27:24.000Z | 2022-03-20T14:58:41.000Z | hailo_model_zoo/core/datasets/parse_mot.py | nadaved1/hailo_model_zoo | 42b716f337dde4ec602022a34d6a07a1bbd45539 | [
"MIT"
] | 10 | 2021-07-20T03:19:55.000Z | 2022-02-25T13:57:30.000Z | import tensorflow as tf
def parse_mot_record(serialized_example):
"""Parse serialized example of TfRecord and extract dictionary of all the information
"""
features = tf.io.parse_single_example(
serialized_example,
features={
'video_name': tf.io.FixedLenFeature([], tf.string),
... | 49.068182 | 99 | 0.635016 | import tensorflow as tf
def parse_mot_record(serialized_example):
"""Parse serialized example of TfRecord and extract dictionary of all the information
"""
features = tf.io.parse_single_example(
serialized_example,
features={
'video_name': tf.io.FixedLenFeature([], tf.string),
... | 0 | 0 | 0 |
a230961c4d1bf0bd2d1efe7972b4baa33c5d7013 | 20,516 | py | Python | models/stylegan/model.py | mcartagenah/ganspace | f297c090257939dce1eef0eb87e6d9c4c19928a8 | [
"Apache-2.0"
] | 1,644 | 2020-04-07T01:00:10.000Z | 2022-03-30T10:27:13.000Z | models/stylegan/model.py | mcartagenah/ganspace | f297c090257939dce1eef0eb87e6d9c4c19928a8 | [
"Apache-2.0"
] | 54 | 2020-04-07T23:32:19.000Z | 2022-03-27T15:06:26.000Z | models/stylegan/model.py | mcartagenah/ganspace | f297c090257939dce1eef0eb87e6d9c4c19928a8 | [
"Apache-2.0"
] | 224 | 2020-04-06T22:59:44.000Z | 2022-03-29T14:35:45.000Z | # Copyright 2020 Erik Härkönen. All rights reserved.
# This file is licensed to you under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applica... | 44.991228 | 181 | 0.585543 | # Copyright 2020 Erik Härkönen. All rights reserved.
# This file is licensed to you under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applica... | 17,870 | 83 | 1,096 |
210403e51b31d354888d0f1806cbd677afdb21b6 | 2,772 | py | Python | tests/unit/altimeter/aws/resource/ec2/test_vpc.py | AmOr1984v02/altimeter | 4adcf8d759b1f3f615b00521cc1756c8007e04f3 | [
"MIT"
] | null | null | null | tests/unit/altimeter/aws/resource/ec2/test_vpc.py | AmOr1984v02/altimeter | 4adcf8d759b1f3f615b00521cc1756c8007e04f3 | [
"MIT"
] | null | null | null | tests/unit/altimeter/aws/resource/ec2/test_vpc.py | AmOr1984v02/altimeter | 4adcf8d759b1f3f615b00521cc1756c8007e04f3 | [
"MIT"
] | null | null | null | from unittest import TestCase
import boto3
from moto import mock_ec2
from altimeter.aws.resource.ec2.vpc import VPCResourceSpec
from altimeter.aws.scan.aws_accessor import AWSAccessor
| 36.96 | 100 | 0.440115 | from unittest import TestCase
import boto3
from moto import mock_ec2
from altimeter.aws.resource.ec2.vpc import VPCResourceSpec
from altimeter.aws.scan.aws_accessor import AWSAccessor
class TestVPCResourceSpec(TestCase):
@mock_ec2
def test_scan(self):
account_id = "123456789012"
region_name ... | 2,507 | 55 | 23 |
bd83b68845748ee7a2ef1aeb6236679edf4b0c90 | 743 | py | Python | lib/hiveos.py | SimonLovskog/HiveOS-OffPeak | 7baeaa812d8da415ca6ed5ff6169bff66e501d93 | [
"MIT"
] | null | null | null | lib/hiveos.py | SimonLovskog/HiveOS-OffPeak | 7baeaa812d8da415ca6ed5ff6169bff66e501d93 | [
"MIT"
] | null | null | null | lib/hiveos.py | SimonLovskog/HiveOS-OffPeak | 7baeaa812d8da415ca6ed5ff6169bff66e501d93 | [
"MIT"
] | null | null | null | import aiohttp
apiUrl = "https://api2.hiveos.farm/api/v2"
| 26.535714 | 111 | 0.6393 | import aiohttp
apiUrl = "https://api2.hiveos.farm/api/v2"
async def getMinerStatus(farmID, workerID, APIKey):
session = aiohttp.ClientSession(
headers={"Authorization": "Bearer %s" % APIKey})
data = await session.get("{}/farms/{}/workers/{}".format(apiUrl, farmID, workerID))
data = await data.jso... | 637 | 0 | 46 |
7772dfc7686bc4aed51f7db0eba9d921f1e22f07 | 2,813 | py | Python | alipay/aop/api/response/MybankCreditLoantradePayeeArConsultResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/MybankCreditLoantradePayeeArConsultResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/MybankCreditLoantradePayeeArConsultResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.CreditPayRefuseVO import CreditPayRefuseVO
| 31.255556 | 116 | 0.67899 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.CreditPayRefuseVO import CreditPayRefuseVO
class MybankCreditLoantradePayeeArConsultResponse(AlipayResponse):
def __init__(self):
super(MybankCreditLoant... | 1,848 | 746 | 23 |
bcd402b633a19185fbd73be1216fa78478a797fb | 681 | py | Python | ledgerplot/ledgerplot/modules/crossover.py | rockwolf/python | 18b4a17136a9c22c77033c5c08a2072df8ed8db0 | [
"BSD-3-Clause"
] | null | null | null | ledgerplot/ledgerplot/modules/crossover.py | rockwolf/python | 18b4a17136a9c22c77033c5c08a2072df8ed8db0 | [
"BSD-3-Clause"
] | null | null | null | ledgerplot/ledgerplot/modules/crossover.py | rockwolf/python | 18b4a17136a9c22c77033c5c08a2072df8ed8db0 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""
See LICENSE.txt file for copyright and license details.
"""
"""
A plot that shows when break even is reached.
"""
import numpy as np
import matplotlib.pyplot as plt
from decimal import Decimal
import sys
x_array = []
y_array = []
def load_data():
"""
Load data
"""
... | 21.28125 | 74 | 0.596182 | #!/usr/bin/env python
"""
See LICENSE.txt file for copyright and license details.
"""
"""
A plot that shows when break even is reached.
"""
import numpy as np
import matplotlib.pyplot as plt
from decimal import Decimal
import sys
x_array = []
y_array = []
def load_data():
"""
Load data
"""
... | 0 | 0 | 0 |
fc9effe4288eae52043395c21d9984136c52e54c | 140 | py | Python | moai/nn/utils/__init__.py | tzole1155/moai | d1afb3aaf8ddcd7a1c98b84d6365afb846ae3180 | [
"Apache-2.0"
] | 10 | 2021-04-02T11:21:33.000Z | 2022-01-18T18:32:32.000Z | moai/nn/utils/__init__.py | tzole1155/moai | d1afb3aaf8ddcd7a1c98b84d6365afb846ae3180 | [
"Apache-2.0"
] | 1 | 2022-03-22T20:10:55.000Z | 2022-03-24T13:11:02.000Z | moai/nn/utils/__init__.py | tzole1155/moai | d1afb3aaf8ddcd7a1c98b84d6365afb846ae3180 | [
"Apache-2.0"
] | 3 | 2021-05-16T20:47:40.000Z | 2021-12-01T21:15:36.000Z | from moai.nn.utils.instantiate import instantiate
from moai.nn.utils.itertools import repeat
__all__ = [
"instantiate",
"repeat",
] | 20 | 49 | 0.735714 | from moai.nn.utils.instantiate import instantiate
from moai.nn.utils.itertools import repeat
__all__ = [
"instantiate",
"repeat",
] | 0 | 0 | 0 |
799766b2f4fad5cf607a8e0a9e3f866527c2f66d | 1,392 | py | Python | 938.range-sum-of-bst.py | windard/leeeeee | 0107a5f95746592ca4fe78d2b5875cf65b1910e7 | [
"MIT"
] | null | null | null | 938.range-sum-of-bst.py | windard/leeeeee | 0107a5f95746592ca4fe78d2b5875cf65b1910e7 | [
"MIT"
] | null | null | null | 938.range-sum-of-bst.py | windard/leeeeee | 0107a5f95746592ca4fe78d2b5875cf65b1910e7 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=938 lang=python
#
# [938] Range Sum of BST
#
# https://leetcode.com/problems/range-sum-of-bst/description/
#
# algorithms
# Easy (78.13%)
# Likes: 448
# Dislikes: 85
# Total Accepted: 83.4K
# Total Submissions: 106.7K
# Testcase Example: '[10,5,15,3,7,null,18]\n7\n15'
#
# Given the root n... | 18.810811 | 93 | 0.576149 | #
# @lc app=leetcode id=938 lang=python
#
# [938] Range Sum of BST
#
# https://leetcode.com/problems/range-sum-of-bst/description/
#
# algorithms
# Easy (78.13%)
# Likes: 448
# Dislikes: 85
# Total Accepted: 83.4K
# Total Submissions: 106.7K
# Testcase Example: '[10,5,15,3,7,null,18]\n7\n15'
#
# Given the root n... | 73 | 372 | 72 |
5e680ce72985f18321eacb50a2cb032de2a2bdbc | 499 | py | Python | adls/videoCat_workflow.py | blerp-836/natsandbox | bf6f740d04562f1fc5bac5155a6b2665f212e807 | [
"MIT"
] | 1 | 2022-01-19T16:12:00.000Z | 2022-01-19T16:12:00.000Z | adls/videoCat_workflow.py | blerp-836/natsandbox | bf6f740d04562f1fc5bac5155a6b2665f212e807 | [
"MIT"
] | null | null | null | adls/videoCat_workflow.py | blerp-836/natsandbox | bf6f740d04562f1fc5bac5155a6b2665f212e807 | [
"MIT"
] | null | null | null | # Databricks notebook source
dbutils.notebook.run("notebook_workflow", 0, {'action':'landing_load','job':'ytb_videoCat','mode':'dbfs','tbl':'ytb_videoCat'})
# COMMAND ----------
dbutils.notebook.run("notebook_workflow", 0, {'action':'staging_load_videoCat','job':'ytb_videoCat','mode':'dbfs','tbl':'ytb_videoCat'})
# ... | 29.352941 | 136 | 0.671343 | # Databricks notebook source
dbutils.notebook.run("notebook_workflow", 0, {'action':'landing_load','job':'ytb_videoCat','mode':'dbfs','tbl':'ytb_videoCat'})
# COMMAND ----------
dbutils.notebook.run("notebook_workflow", 0, {'action':'staging_load_videoCat','job':'ytb_videoCat','mode':'dbfs','tbl':'ytb_videoCat'})
# ... | 0 | 0 | 0 |
7e2c460c57d61016930a2cd29b733b1220911175 | 329 | py | Python | adventofcode/2020/10/b.py | nevivurn/cp | be2ce55ef6f578cbf606bbc3d85add72993cfde3 | [
"MIT"
] | null | null | null | adventofcode/2020/10/b.py | nevivurn/cp | be2ce55ef6f578cbf606bbc3d85add72993cfde3 | [
"MIT"
] | null | null | null | adventofcode/2020/10/b.py | nevivurn/cp | be2ce55ef6f578cbf606bbc3d85add72993cfde3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
nums = list(sorted([0] + [int(line.rstrip()) for line in sys.stdin]))
nums.append(nums[-1] + 3)
dp = [1]
while len(dp) < len(nums):
cur = len(dp)
i = cur-1
cum = 0
while i >= 0 and nums[cur]-nums[i] <= 3:
cum += dp[i]
i -= 1
dp.append(cum)
print... | 16.45 | 69 | 0.525836 | #!/usr/bin/env python3
import sys
nums = list(sorted([0] + [int(line.rstrip()) for line in sys.stdin]))
nums.append(nums[-1] + 3)
dp = [1]
while len(dp) < len(nums):
cur = len(dp)
i = cur-1
cum = 0
while i >= 0 and nums[cur]-nums[i] <= 3:
cum += dp[i]
i -= 1
dp.append(cum)
print... | 0 | 0 | 0 |
f2fe47b358d4d5f20a3e687d02aa1f6487fddd67 | 6,326 | py | Python | ab_test.py | matyasosvath/ab-test | 3ad07a65cc6967284f3c2741460ee14af6564ff9 | [
"MIT"
] | null | null | null | ab_test.py | matyasosvath/ab-test | 3ad07a65cc6967284f3c2741460ee14af6564ff9 | [
"MIT"
] | null | null | null | ab_test.py | matyasosvath/ab-test | 3ad07a65cc6967284f3c2741460ee14af6564ff9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import pandas as pd
import numpy as np
import scipy.stats as ss
import fire
import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
stream_handler = logging.StreamHandler() # messages show up in terminal
formatter = logging.Formatter('%(asctime)s %(levelname)s :: %(message)s... | 32.947917 | 118 | 0.621088 | #!/usr/bin/env python3
import pandas as pd
import numpy as np
import scipy.stats as ss
import fire
import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
stream_handler = logging.StreamHandler() # messages show up in terminal
formatter = logging.Formatter('%(asctime)s %(levelname)s :: %(message)s... | 1,026 | 15 | 130 |