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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f393860dc4d8f40166995d44a4269a5f45efbb2d | 480 | py | Python | mealie/schema/restore.py | danielpalstra/mealie | 6c549ff99329e494bc6aad2109973e7eec6c445e | [
"MIT"
] | 1,927 | 2021-01-02T20:01:15.000Z | 2022-03-31T22:49:18.000Z | mealie/schema/restore.py | danielpalstra/mealie | 6c549ff99329e494bc6aad2109973e7eec6c445e | [
"MIT"
] | 545 | 2021-01-02T20:32:28.000Z | 2022-03-31T23:37:08.000Z | mealie/schema/restore.py | danielpalstra/mealie | 6c549ff99329e494bc6aad2109973e7eec6c445e | [
"MIT"
] | 254 | 2021-01-03T00:20:07.000Z | 2022-03-23T22:37:21.000Z | from typing import Optional
from pydantic.main import BaseModel
| 12.631579 | 37 | 0.733333 | from typing import Optional
from pydantic.main import BaseModel
class ImportBase(BaseModel):
name: str
status: bool
exception: Optional[str]
class RecipeImport(ImportBase):
slug: Optional[str]
class ThemeImport(ImportBase):
pass
class SettingsImport(ImportBase):
pass
class GroupImport... | 0 | 223 | 184 |
807a761fa093a53e100a03a206335656aefa8eff | 4,016 | py | Python | networking_p4/services/service_drivers/default/driver.py | osinstom/networking-p4 | 3b82025090b6b2bf1e9faa58492d13ed1da6c34f | [
"Apache-2.0"
] | 2 | 2019-12-26T08:53:25.000Z | 2020-05-13T11:53:51.000Z | networking_p4/services/service_drivers/default/driver.py | osinstom/networking-dppx | 3b82025090b6b2bf1e9faa58492d13ed1da6c34f | [
"Apache-2.0"
] | null | null | null | networking_p4/services/service_drivers/default/driver.py | osinstom/networking-dppx | 3b82025090b6b2bf1e9faa58492d13ed1da6c34f | [
"Apache-2.0"
] | null | null | null | from networking_p4.services.service_drivers.default.services.attach_module import AttachModuleService
from networking_p4.services.service_drivers.default.services.configure_module import ConfigureModuleService
from networking_p4.services.service_drivers.default.services.create_module import CreateModuleService
from net... | 44.131868 | 118 | 0.758217 | from networking_p4.services.service_drivers.default.services.attach_module import AttachModuleService
from networking_p4.services.service_drivers.default.services.configure_module import ConfigureModuleService
from networking_p4.services.service_drivers.default.services.create_module import CreateModuleService
from net... | 2,343 | 0 | 324 |
a84b00a226e429cf7c8dcfc2193791c10769443b | 160 | py | Python | Codes/Miscellaneous/hello_world.py | datta-agni/python-codes | d902d0aaf23d2ea4b60ed7ecab0d593e3334c23b | [
"MIT"
] | null | null | null | Codes/Miscellaneous/hello_world.py | datta-agni/python-codes | d902d0aaf23d2ea4b60ed7ecab0d593e3334c23b | [
"MIT"
] | null | null | null | Codes/Miscellaneous/hello_world.py | datta-agni/python-codes | d902d0aaf23d2ea4b60ed7ecab0d593e3334c23b | [
"MIT"
] | null | null | null | # Hello World program.
# This is where you write a comment.
if __name__ == "__main__":
hello_world()
| 17.777778 | 36 | 0.6625 | # Hello World program.
# This is where you write a comment.
def hello_world() -> None:
print("HELLO! WORLD")
if __name__ == "__main__":
hello_world()
| 31 | 0 | 22 |
c34a5ef2ecb12157c6357b1cc9ffba018bbf96f0 | 26,794 | py | Python | test/api_tests.py | kingb12/flask_probanno | c0c57d3bac987eebc037ac21903c85ac628705a1 | [
"MIT"
] | null | null | null | test/api_tests.py | kingb12/flask_probanno | c0c57d3bac987eebc037ac21903c85ac628705a1 | [
"MIT"
] | null | null | null | test/api_tests.py | kingb12/flask_probanno | c0c57d3bac987eebc037ac21903c85ac628705a1 | [
"MIT"
] | null | null | null | import requests
import unittest
import json
import uuid
from flask_probanno import GET, POST, PUT
from controllers.probanno_management import CALCULATE_PROBANNO_JOB
from controllers.job import COMPLETE
BASE_URL = "http://probannoweb.systemsbiology.net/api"
HEADERS = {'cache-control': 'no-cache'}
FASTA_1 = '267377'
CA... | 49.618519 | 132 | 0.542547 | import requests
import unittest
import json
import uuid
from flask_probanno import GET, POST, PUT
from controllers.probanno_management import CALCULATE_PROBANNO_JOB
from controllers.job import COMPLETE
BASE_URL = "http://probannoweb.systemsbiology.net/api"
HEADERS = {'cache-control': 'no-cache'}
FASTA_1 = '267377'
CA... | 24,656 | 87 | 516 |
053693eaf318fe0813c25cb83119cbcdc6129a3f | 1,896 | py | Python | tests/ext/test_tortoise.py | XeryusTC/fastapi-pagination | 0e1e8542a9ab36f16b6c0ab7af2125b4a03dd095 | [
"MIT"
] | 315 | 2020-11-12T08:41:50.000Z | 2022-03-31T23:23:27.000Z | tests/ext/test_tortoise.py | XeryusTC/fastapi-pagination | 0e1e8542a9ab36f16b6c0ab7af2125b4a03dd095 | [
"MIT"
] | 280 | 2020-11-28T11:17:06.000Z | 2022-03-28T03:21:27.000Z | tests/ext/test_tortoise.py | XeryusTC/fastapi-pagination | 0e1e8542a9ab36f16b6c0ab7af2125b4a03dd095 | [
"MIT"
] | 50 | 2020-12-07T16:21:24.000Z | 2022-03-22T09:04:13.000Z | from fastapi import FastAPI
from pytest import fixture
from tortoise import Model
from tortoise.backends.base.executor import EXECUTOR_CACHE
from tortoise.contrib.fastapi import register_tortoise
from tortoise.fields import IntField, TextField
from fastapi_pagination import Page, add_pagination
from fastapi_pagination... | 25.28 | 75 | 0.683017 | from fastapi import FastAPI
from pytest import fixture
from tortoise import Model
from tortoise.backends.base.executor import EXECUTOR_CACHE
from tortoise.contrib.fastapi import register_tortoise
from tortoise.fields import IntField, TextField
from fastapi_pagination import Page, add_pagination
from fastapi_pagination... | 942 | 233 | 90 |
d0a7d576f5e655561b0da5618e1081fc4b02ab4c | 9,647 | py | Python | blipp/settings.py | periscope-ps/blipp | 002d08e911fb94c34d7f05e34883efa8f6138a4f | [
"BSD-3-Clause"
] | null | null | null | blipp/settings.py | periscope-ps/blipp | 002d08e911fb94c34d7f05e34883efa8f6138a4f | [
"BSD-3-Clause"
] | null | null | null | blipp/settings.py | periscope-ps/blipp | 002d08e911fb94c34d7f05e34883efa8f6138a4f | [
"BSD-3-Clause"
] | 1 | 2015-12-14T01:14:39.000Z | 2015-12-14T01:14:39.000Z | # =============================================================================
# periscope-ps (blipp)
#
# Copyright (c) 2013-2016, Trustees of Indiana University,
# All rights reserved.
#
# This software may be modified and distributed under the terms of the BSD
# license. See the COPYING file for details.
#
# ... | 35.466912 | 110 | 0.597077 | # =============================================================================
# periscope-ps (blipp)
#
# Copyright (c) 2013-2016, Trustees of Indiana University,
# All rights reserved.
#
# This software may be modified and distributed under the terms of the BSD
# license. See the COPYING file for details.
#
# ... | 932 | 0 | 50 |
b9f177e501e7c5bddcdd1967d9b11cff801d70cd | 2,480 | py | Python | splitio/api/events.py | nhausman1/python-client | b15f76977dc3178634ee8e007b53f613ddd2ac7c | [
"Apache-2.0"
] | null | null | null | splitio/api/events.py | nhausman1/python-client | b15f76977dc3178634ee8e007b53f613ddd2ac7c | [
"Apache-2.0"
] | null | null | null | splitio/api/events.py | nhausman1/python-client | b15f76977dc3178634ee8e007b53f613ddd2ac7c | [
"Apache-2.0"
] | null | null | null | """Events API module."""
import logging
from future.utils import raise_from
from splitio.api import APIException, headers_from_metadata
from splitio.api.client import HttpClientException
class EventsAPI(object): # pylint: disable=too-few-public-methods
"""Class that uses an httpClient to communicate with the e... | 32.207792 | 84 | 0.593952 | """Events API module."""
import logging
from future.utils import raise_from
from splitio.api import APIException, headers_from_metadata
from splitio.api.client import HttpClientException
class EventsAPI(object): # pylint: disable=too-few-public-methods
"""Class that uses an httpClient to communicate with the e... | 0 | 0 | 0 |
646aac25839c24a2acd9f04a89f56df8ba58a243 | 340 | py | Python | setup.py | jakesen/pyhatchbuck | 1bbefe52f46f05709e8272dcdbdb636d7e13325e | [
"MIT"
] | 1 | 2019-10-24T14:45:46.000Z | 2019-10-24T14:45:46.000Z | setup.py | jakesen/pyhatchbuck | 1bbefe52f46f05709e8272dcdbdb636d7e13325e | [
"MIT"
] | 7 | 2017-02-16T19:35:50.000Z | 2020-01-30T14:05:13.000Z | setup.py | jakesen/pyhatchbuck | 1bbefe52f46f05709e8272dcdbdb636d7e13325e | [
"MIT"
] | 3 | 2018-03-26T07:58:55.000Z | 2019-12-12T19:32:34.000Z | from setuptools import setup
setup(
name='pyhatchbuck',
version='0.4',
description='Python library for Hatchbuck API',
url='https://github.com/jakesen/pyhatchbuck',
author='Jacob Senecal',
author_email='jacob.senecal@gmail.com',
license='MIT',
packages=['hatchbuck',],
install_requir... | 24.285714 | 51 | 0.673529 | from setuptools import setup
setup(
name='pyhatchbuck',
version='0.4',
description='Python library for Hatchbuck API',
url='https://github.com/jakesen/pyhatchbuck',
author='Jacob Senecal',
author_email='jacob.senecal@gmail.com',
license='MIT',
packages=['hatchbuck',],
install_requir... | 0 | 0 | 0 |
0b2fb33ea9fc52a75ecaa6f5939d979600bd1d27 | 3,910 | py | Python | tests/integration/test_pubsub.py | ghga-de/internal-file-registry-service | 99892159f5b70184db6609e8c9ce3deb33fd335b | [
"Apache-2.0"
] | null | null | null | tests/integration/test_pubsub.py | ghga-de/internal-file-registry-service | 99892159f5b70184db6609e8c9ce3deb33fd335b | [
"Apache-2.0"
] | 7 | 2021-11-11T12:28:43.000Z | 2022-01-19T18:00:56.000Z | tests/integration/test_pubsub.py | ghga-de/internal-file-registry-service | 99892159f5b70184db6609e8c9ce3deb33fd335b | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 - 2022 Universität Tübingen, DKFZ and EMBL
# for the German Human Genome-Phenome Archive (GHGA)
#
# 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/... | 34.60177 | 93 | 0.749361 | # Copyright 2021 - 2022 Universität Tübingen, DKFZ and EMBL
# for the German Human Genome-Phenome Archive (GHGA)
#
# 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/... | 0 | 0 | 0 |
f37eb1e7c63115be41814766b49df794657c5220 | 814 | py | Python | Lesson_6/task_5.py | nvv11/algorithms_and_data_structures_in_python | b87f7f618077d1bbf6c71c19845b1eaf62c07240 | [
"MIT"
] | null | null | null | Lesson_6/task_5.py | nvv11/algorithms_and_data_structures_in_python | b87f7f618077d1bbf6c71c19845b1eaf62c07240 | [
"MIT"
] | null | null | null | Lesson_6/task_5.py | nvv11/algorithms_and_data_structures_in_python | b87f7f618077d1bbf6c71c19845b1eaf62c07240 | [
"MIT"
] | null | null | null | import sys
import ctypes
import struct
a = 59
x = y = a
b = 125.54
c = 'Hello World!'
print(id(a))
print(sys.getsizeof(a))
print(ctypes.string_at(id(a), sys.getsizeof(a)))
print(struct.unpack('LLLLLLl', ctypes.string_at(id(a), sys.getsizeof(a))))
print(id(int))
print('*' * 50)
print(id(b))
print(sys.getsizeof(b))
... | 20.35 | 90 | 0.659705 | import sys
import ctypes
import struct
a = 59
x = y = a
b = 125.54
c = 'Hello World!'
print(id(a))
print(sys.getsizeof(a))
print(ctypes.string_at(id(a), sys.getsizeof(a)))
print(struct.unpack('LLLLLLl', ctypes.string_at(id(a), sys.getsizeof(a))))
print(id(int))
print('*' * 50)
print(id(b))
print(sys.getsizeof(b))
... | 0 | 0 | 0 |
11ad7fb150c1adc76c00f3f3c606dbf1315ec398 | 679 | py | Python | inscrawler/persistence/entity/post_entity.py | aonurdemir/instagram-crawler | ffb11e3f10ab6ca276fecd4ca527b7661db2704d | [
"MIT"
] | null | null | null | inscrawler/persistence/entity/post_entity.py | aonurdemir/instagram-crawler | ffb11e3f10ab6ca276fecd4ca527b7661db2704d | [
"MIT"
] | null | null | null | inscrawler/persistence/entity/post_entity.py | aonurdemir/instagram-crawler | ffb11e3f10ab6ca276fecd4ca527b7661db2704d | [
"MIT"
] | null | null | null | from peewee import AutoField, TextField, BigIntegerField, BooleanField, ForeignKeyField
from inscrawler.persistence.entity.base_model import BaseModel
from inscrawler.persistence.entity.profile_entity import ProfileEntity
# TODO create indexes
| 32.333333 | 87 | 0.761414 | from peewee import AutoField, TextField, BigIntegerField, BooleanField, ForeignKeyField
from inscrawler.persistence.entity.base_model import BaseModel
from inscrawler.persistence.entity.profile_entity import ProfileEntity
# TODO create indexes
class PostEntity(BaseModel):
id = AutoField(null=False)
profile =... | 0 | 410 | 22 |
7d2f42eb86b215815ade249efd60a94bd2c8d53b | 521 | py | Python | arc/arc110/a/main.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | 2 | 2022-01-22T07:56:58.000Z | 2022-01-24T00:29:37.000Z | arc/arc110/a/main.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | arc/arc110/a/main.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | import sys
import math
from collections import defaultdict, deque
sys.setrecursionlimit(10 ** 6)
stdin = sys.stdin
INF = float('inf')
MOD = 10 ** 9 + 7
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()
N = ni()
ans = 1
A = []
for i in range(2, N + 1):... | 18.607143 | 53 | 0.568138 | import sys
import math
from collections import defaultdict, deque
sys.setrecursionlimit(10 ** 6)
stdin = sys.stdin
INF = float('inf')
MOD = 10 ** 9 + 7
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()
def lcm(A):
res = A[0]
N = len(A)
for... | 144 | 0 | 23 |
58194c56ccba360960350e59665fce422d256866 | 13,281 | py | Python | Siamese.py | sirpuria/DeepScoresExamples | 3b2decb8b295354f7023437144dd0152f1cb8f6a | [
"MIT"
] | null | null | null | Siamese.py | sirpuria/DeepScoresExamples | 3b2decb8b295354f7023437144dd0152f1cb8f6a | [
"MIT"
] | null | null | null | Siamese.py | sirpuria/DeepScoresExamples | 3b2decb8b295354f7023437144dd0152f1cb8f6a | [
"MIT"
] | null | null | null |
import argparse
import sys, os
import imageio
import tensorflow as tf
import Classification_BatchDataset
import TensorflowUtils as utils
import pickle
import time
from tensorflow.keras.models import Sequential, Model
from tensorflow.keras.layers import Conv2D, MaxPool2D, Dropout, Flatten, Dense, Input, Lambda
from ... | 36.687845 | 122 | 0.629847 |
import argparse
import sys, os
import imageio
import tensorflow as tf
import Classification_BatchDataset
import TensorflowUtils as utils
import pickle
import time
from tensorflow.keras.models import Sequential, Model
from tensorflow.keras.layers import Conv2D, MaxPool2D, Dropout, Flatten, Dense, Input, Lambda
from ... | 1,213 | 10 | 119 |
52225cc25eab7726008dbc5016cfc8bf8bddd487 | 10,631 | py | Python | intmodels.py | joshfuchs/ZZCeti_fitting | 869c9c260fc11d0a31b00b966af0749006f2d5d5 | [
"MIT"
] | 1 | 2016-12-13T23:36:04.000Z | 2016-12-13T23:36:04.000Z | intmodels.py | joshfuchs/ZZCeti_fitting | 869c9c260fc11d0a31b00b966af0749006f2d5d5 | [
"MIT"
] | null | null | null | intmodels.py | joshfuchs/ZZCeti_fitting | 869c9c260fc11d0a31b00b966af0749006f2d5d5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created March 2015 by JT Fuchs, UNC.
This program interpolates grids of models. It is called by finegrid.py, which contains all the necessary options. Unless you want to change which wavelengths to keep, you shouldn't need to change things here. But keep in mind that interpolation is tricky... | 41.527344 | 297 | 0.617628 | # -*- coding: utf-8 -*-
"""
Created March 2015 by JT Fuchs, UNC.
This program interpolates grids of models. It is called by finegrid.py, which contains all the necessary options. Unless you want to change which wavelengths to keep, you shouldn't need to change things here. But keep in mind that interpolation is tricky... | 10,042 | 0 | 33 |
c1ee6f4947657113b61bda3ebddde056c335a43e | 177 | py | Python | WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/mini-scripts/Python_RegEx_mutch_object_2.txt.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 5 | 2021-06-02T23:44:25.000Z | 2021-12-27T16:21:57.000Z | WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/mini-scripts/Python_RegEx_mutch_object_2.txt.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 22 | 2021-05-31T01:33:25.000Z | 2021-10-18T18:32:39.000Z | WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/mini-scripts/Python_RegEx_mutch_object_2.txt.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 3 | 2021-06-19T03:37:47.000Z | 2021-08-31T00:49:51.000Z | import re
# Search for an upper case "S" character in the beginning of a word, and print its position:
txt = "The rain in Spain"
x = re.search(r"\bS\w+", txt)
print(x.span())
| 22.125 | 92 | 0.683616 | import re
# Search for an upper case "S" character in the beginning of a word, and print its position:
txt = "The rain in Spain"
x = re.search(r"\bS\w+", txt)
print(x.span())
| 0 | 0 | 0 |
574d913190a685e09ec510612cf6538d5b689ad0 | 2,203 | py | Python | Dilation.py | gmagannaDevelop/MorphoImg | 751985a430f3ab9f8ded7a18fdeb2eb41cb112e5 | [
"MIT"
] | 1 | 2019-11-18T14:54:11.000Z | 2019-11-18T14:54:11.000Z | Dilation.py | gmagannaDevelop/MorphoImg | 751985a430f3ab9f8ded7a18fdeb2eb41cb112e5 | [
"MIT"
] | 7 | 2020-03-24T17:49:09.000Z | 2022-01-13T01:51:33.000Z | Dilation.py | gmagannaDevelop/MorphoImg | 751985a430f3ab9f8ded7a18fdeb2eb41cb112e5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[31]:
from typing import Optional, Callable, Tuple, List, NoReturn
from functools import partial, reduce
import matplotlib.pyplot as plt
import matplotlib.image as img
import numpy as np
import cv2 as cv
import PIL as pil
# In[2]:
# User-defined functions, utils module... | 12.517045 | 121 | 0.639128 | #!/usr/bin/env python
# coding: utf-8
# In[31]:
from typing import Optional, Callable, Tuple, List, NoReturn
from functools import partial, reduce
import matplotlib.pyplot as plt
import matplotlib.image as img
import numpy as np
import cv2 as cv
import PIL as pil
# In[2]:
# User-defined functions, utils module... | 0 | 0 | 0 |
5059b78da4509944d16af0cb21a27524244a0d2b | 1,621 | py | Python | data_extractor/bulletin_download/states/MP.py | IBM/covid19-india-data | e2be04e74e753fbd1b1580f62856bf7335b95d33 | [
"MIT"
] | 20 | 2021-08-15T19:00:57.000Z | 2022-03-28T21:23:28.000Z | data_extractor/bulletin_download/states/MP.py | IBM/covid19-india-data | e2be04e74e753fbd1b1580f62856bf7335b95d33 | [
"MIT"
] | 78 | 2021-08-17T22:34:39.000Z | 2022-01-06T02:49:30.000Z | data_extractor/bulletin_download/states/MP.py | IBM/covid19-india-data | e2be04e74e753fbd1b1580f62856bf7335b95d33 | [
"MIT"
] | 8 | 2021-08-30T19:35:27.000Z | 2022-02-08T14:07:10.000Z | from .bulletin import Bulletin
from bs4 import BeautifulSoup
import re
| 26.145161 | 116 | 0.555213 | from .bulletin import Bulletin
from bs4 import BeautifulSoup
import re
class MadhyaPradesh(Bulletin):
def __init__(self, basedir):
statename = 'MP'
super().__init__(basedir, statename)
def get_bulletin_links(self):
burl = "http://sarthak.nhmmp.gov.in/covid/health-bulletin"
... | 1,434 | 9 | 104 |
3ece990d3b54f8ff05c83892af36a81d65bbf73f | 11,159 | py | Python | python3/knapsack/greedyNdKnapsack.py | CostaBru/knapsack | cdd95de759c20b0cdeef4064fbbed10df1ab76d0 | [
"MIT"
] | 1 | 2021-03-06T16:38:28.000Z | 2021-03-06T16:38:28.000Z | python3/knapsack/greedyNdKnapsack.py | CostaBru/knapsack | cdd95de759c20b0cdeef4064fbbed10df1ab76d0 | [
"MIT"
] | null | null | null | python3/knapsack/greedyNdKnapsack.py | CostaBru/knapsack | cdd95de759c20b0cdeef4064fbbed10df1ab76d0 | [
"MIT"
] | null | null | null | """
Copyright Jun 2021 Konstantin Briukhnov (kooltew at gmail.com) (@CostaBru). San-Francisco Bay Area.
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 limit... | 42.919231 | 268 | 0.605879 | """
Copyright Jun 2021 Konstantin Briukhnov (kooltew at gmail.com) (@CostaBru). San-Francisco Bay Area.
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 limit... | 9,433 | 8 | 212 |
ed13bd0aa077e3581aab8400854ef77def5fdd81 | 1,297 | py | Python | src/piano/key.py | maylahn/piano-visualizer | d49b548ff5a18f5b6dcfeaaba71464cf3106062a | [
"MIT"
] | null | null | null | src/piano/key.py | maylahn/piano-visualizer | d49b548ff5a18f5b6dcfeaaba71464cf3106062a | [
"MIT"
] | null | null | null | src/piano/key.py | maylahn/piano-visualizer | d49b548ff5a18f5b6dcfeaaba71464cf3106062a | [
"MIT"
] | null | null | null | from mido import Message
from settings import MIDI_MSG_NOTE_OFFSET
from utility.state import KeyState
| 27.595745 | 63 | 0.583655 | from mido import Message
from settings import MIDI_MSG_NOTE_OFFSET
from utility.state import KeyState
class Key:
def __init__(self, index, note):
self.index = index
self.midi_index = index + MIDI_MSG_NOTE_OFFSET
self.note = note
self.led_index = self.get_led_index()
self.fr... | 994 | -11 | 211 |
9b8ecd42d65fa34b19512883a8983cf4b50cb5cb | 6,962 | py | Python | S13/deployment/ETESR/model.py | pankaj90382/TSAI-2 | af4b3543dfb206fb1cc2bd166ed31e9ea7bd3778 | [
"MIT"
] | null | null | null | S13/deployment/ETESR/model.py | pankaj90382/TSAI-2 | af4b3543dfb206fb1cc2bd166ed31e9ea7bd3778 | [
"MIT"
] | 9 | 2021-06-08T22:18:08.000Z | 2022-03-12T00:46:43.000Z | S13/deployment/ETESR/model.py | pankaj90382/TSAI-2 | af4b3543dfb206fb1cc2bd166ed31e9ea7bd3778 | [
"MIT"
] | 1 | 2020-10-12T17:13:35.000Z | 2020-10-12T17:13:35.000Z | import torch
import torch.nn as nn
import torch.utils.data as data
import torch.optim as optim
import torch.nn.functional as F
import torchaudio
class TextTransform:
"""Maps characters to integers and vice versa"""
def text_to_int(self, text):
""" Use a character map and convert text to an ... | 33.471154 | 125 | 0.586326 | import torch
import torch.nn as nn
import torch.utils.data as data
import torch.optim as optim
import torch.nn.functional as F
import torchaudio
class TextTransform:
"""Maps characters to integers and vice versa"""
def __init__(self):
char_map_str = """
' 0
<SPACE> 1
... | 5,359 | 32 | 415 |
2965a0c80b2671a72e657104596c8c9acf7af8ce | 87,018 | py | Python | androguard/core/resources/public.py | tantran1999/Android-Malware-Detection | e89e4752cd4ded2d71c27af34d4b36946dbd6e0f | [
"MIT"
] | 2 | 2020-12-01T19:13:23.000Z | 2021-03-17T08:54:10.000Z | androguard/core/resources/public.py | tantran1999/Android-Malware-Detection | e89e4752cd4ded2d71c27af34d4b36946dbd6e0f | [
"MIT"
] | null | null | null | androguard/core/resources/public.py | tantran1999/Android-Malware-Detection | e89e4752cd4ded2d71c27af34d4b36946dbd6e0f | [
"MIT"
] | null | null | null | resources = {
'style': {
'Animation' : 16973824,
'Animation.Activity' : 16973825,
'Animation.Dialog' : 16973826,
'Animation.InputMethod' : 16973910,
'Animation.Toast' : 16973828,
'Animation.Translucent' : 16973827,
'DeviceDefault.ButtonBar' : 16974287,
... | 44.947314 | 85 | 0.644051 | resources = {
'style': {
'Animation' : 16973824,
'Animation.Activity' : 16973825,
'Animation.Dialog' : 16973826,
'Animation.InputMethod' : 16973910,
'Animation.Toast' : 16973828,
'Animation.Translucent' : 16973827,
'DeviceDefault.ButtonBar' : 16974287,
... | 0 | 0 | 0 |
d04cc6df4bc2c6680f882e969a37c77d253e0edb | 1,146 | py | Python | ChannelLogger.py | habu1010/gridbug-discord-bot | 81e445d7711b82574d30ccebbbddadc8adba075e | [
"MIT"
] | 1 | 2021-01-23T15:06:27.000Z | 2021-01-23T15:06:27.000Z | ChannelLogger.py | habu1010/gridbug-discord-bot | 81e445d7711b82574d30ccebbbddadc8adba075e | [
"MIT"
] | 12 | 2021-02-03T08:29:44.000Z | 2022-02-13T14:50:35.000Z | ChannelLogger.py | habu1010/gridbug-discord-bot | 81e445d7711b82574d30ccebbbddadc8adba075e | [
"MIT"
] | null | null | null | import asyncio
import logging
import logging.handlers
import discord
from discord.ext import commands, tasks
| 29.384615 | 98 | 0.685864 | import asyncio
import logging
import logging.handlers
import discord
from discord.ext import commands, tasks
class ChannelLogger(commands.Cog):
def __init__(self, bot: commands.Bot, bot_config: dict):
self._bot = bot
self._logging_queue = asyncio.Queue()
logger = logging.getLogger()
... | 821 | 167 | 46 |
77127d496d0c63d976c793da0625cd048509dd2b | 383 | py | Python | text_similarity/main.py | haiderstats/text-similarity | b0a18c31ac4132f600004adf097697a61ac54eb5 | [
"CC0-1.0"
] | 4 | 2021-06-17T12:46:21.000Z | 2022-01-10T18:44:26.000Z | text_similarity/main.py | haiderstats/text-similarity | b0a18c31ac4132f600004adf097697a61ac54eb5 | [
"CC0-1.0"
] | null | null | null | text_similarity/main.py | haiderstats/text-similarity | b0a18c31ac4132f600004adf097697a61ac54eb5 | [
"CC0-1.0"
] | null | null | null | from typing import Dict
from fastapi import FastAPI, Query
from text_similarity.similarity import Texts
app = FastAPI()
@app.post("/similarity")
| 21.277778 | 76 | 0.699739 | from typing import Dict
from fastapi import FastAPI, Query
from text_similarity.similarity import Texts
app = FastAPI()
@app.post("/similarity")
def text_similarity(
texts: Texts,
ngram_limit: int = Query(
3, description="The highest ngram used for comparision.", ge=1, le=5
),
) -> Dict[str, fl... | 211 | 0 | 22 |
f2756eca852c41fc3a17a4de7a36eb1528d26c22 | 77 | py | Python | hello.py | helloprasanna/python | 1f218ddf84bc082dca5906833238389011ae344b | [
"MIT"
] | null | null | null | hello.py | helloprasanna/python | 1f218ddf84bc082dca5906833238389011ae344b | [
"MIT"
] | null | null | null | hello.py | helloprasanna/python | 1f218ddf84bc082dca5906833238389011ae344b | [
"MIT"
] | null | null | null | """Hello World for python."""
a = 3
print(a)
print(a, ' helloworld number')
| 12.833333 | 30 | 0.636364 | """Hello World for python."""
a = 3
print(a)
print(a, ' helloworld number')
| 0 | 0 | 0 |
bfaa4d5a67ed38a780d1203d6ffc677680e05f9b | 914 | py | Python | api/players/tasks.py | prattl/teamfinder-web | 85ded666879c2ee4b51cb59ffdedc2dedbfd9c7e | [
"Apache-2.0"
] | 9 | 2017-04-10T09:40:01.000Z | 2020-01-31T17:15:41.000Z | api/players/tasks.py | prattl/teamfinder-web | 85ded666879c2ee4b51cb59ffdedc2dedbfd9c7e | [
"Apache-2.0"
] | 19 | 2017-02-22T16:26:02.000Z | 2020-02-04T16:08:16.000Z | api/players/tasks.py | prattl/teamfinder-web | 85ded666879c2ee4b51cb59ffdedc2dedbfd9c7e | [
"Apache-2.0"
] | 3 | 2017-04-17T06:37:58.000Z | 2021-04-09T18:16:28.000Z | import requests
from threading import Thread
from django.db import connection
from django.utils import timezone
from .models import Player
| 21.761905 | 65 | 0.705689 | import requests
from threading import Thread
from django.db import connection
from django.utils import timezone
from .models import Player
class OPENDOTA:
PLAYERS = "https://api.opendota.com/api/players/{account_id}"
def _update_player_mmr(player_id):
try:
player = Player.objects.get(pk=player_id)... | 641 | 60 | 69 |
8aaba90b69e7591913e474723e3136553c765651 | 10,632 | py | Python | plugins/_Pre_Process/_Create_Dataset/create_shuffle_dataset/fashion_mnist/create_fashion_mnist_csv.py | isabella232/nnc-plugin | 3bc71266696d0341e5e9a2ff2020980700f28719 | [
"Apache-2.0"
] | 7 | 2021-09-04T13:10:07.000Z | 2022-03-21T08:51:45.000Z | plugins/_Pre_Process/_Create_Dataset/create_shuffle_dataset/fashion_mnist/create_fashion_mnist_csv.py | isabella232/nnc-plugin | 3bc71266696d0341e5e9a2ff2020980700f28719 | [
"Apache-2.0"
] | 1 | 2021-11-15T04:39:34.000Z | 2021-11-19T08:09:42.000Z | plugins/_Pre_Process/_Create_Dataset/create_shuffle_dataset/fashion_mnist/create_fashion_mnist_csv.py | isabella232/nnc-plugin | 3bc71266696d0341e5e9a2ff2020980700f28719 | [
"Apache-2.0"
] | 1 | 2022-03-25T16:52:05.000Z | 2022-03-25T16:52:05.000Z | # Copyright 2021 Sony Group Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | 32.316109 | 132 | 0.605813 | # Copyright 2021 Sony Group Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | 5,631 | 0 | 203 |
96264eefbcc71d8bbbe887923f0da92571272ddf | 1,640 | py | Python | dino/utils/handlers.py | thenetcircle/dino | 1047c3458e91a1b4189e9f48f1393b3a68a935b3 | [
"Apache-2.0"
] | 150 | 2016-10-05T11:09:36.000Z | 2022-03-06T16:24:41.000Z | dino/utils/handlers.py | thenetcircle/dino | 1047c3458e91a1b4189e9f48f1393b3a68a935b3 | [
"Apache-2.0"
] | 27 | 2017-03-02T03:37:02.000Z | 2022-02-10T04:59:54.000Z | dino/utils/handlers.py | thenetcircle/dino | 1047c3458e91a1b4189e9f48f1393b3a68a935b3 | [
"Apache-2.0"
] | 21 | 2016-11-11T07:51:48.000Z | 2020-04-26T21:38:33.000Z | #!/usr/bin/env python
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 27.79661 | 74 | 0.646951 | #!/usr/bin/env python
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 858 | 18 | 130 |
d36b0c4d3e977cd2d94ae76b9ab736a7585a4e6b | 1,408 | py | Python | e2e/Vectors/Generation/Consensus/MeritRemoval/Multiple.py | kayabaNerve/Currency | 260ebc20f1704f42ad6183fee39ad58ec6d07961 | [
"CC0-1.0"
] | 66 | 2019-01-14T08:39:52.000Z | 2022-01-06T11:39:15.000Z | e2e/Vectors/Generation/Consensus/MeritRemoval/Multiple.py | kayabaNerve/Currency | 260ebc20f1704f42ad6183fee39ad58ec6d07961 | [
"CC0-1.0"
] | 228 | 2019-01-16T15:42:44.000Z | 2022-02-05T07:48:07.000Z | e2e/Vectors/Generation/Consensus/MeritRemoval/Multiple.py | kayabaNerve/Currency | 260ebc20f1704f42ad6183fee39ad58ec6d07961 | [
"CC0-1.0"
] | 19 | 2019-01-14T08:53:04.000Z | 2021-11-03T20:19:28.000Z | import json
from e2e.Libs.BLS import PrivateKey, PublicKey
from e2e.Classes.Consensus.DataDifficulty import SignedDataDifficulty
from e2e.Classes.Consensus.MeritRemoval import SignedMeritRemoval
from e2e.Vectors.Generation.PrototypeChain import PrototypeChain
proto: PrototypeChain = PrototypeChain(1, False)
blsPri... | 34.341463 | 78 | 0.810369 | import json
from e2e.Libs.BLS import PrivateKey, PublicKey
from e2e.Classes.Consensus.DataDifficulty import SignedDataDifficulty
from e2e.Classes.Consensus.MeritRemoval import SignedMeritRemoval
from e2e.Vectors.Generation.PrototypeChain import PrototypeChain
proto: PrototypeChain = PrototypeChain(1, False)
blsPri... | 0 | 0 | 0 |
1ba7c7976cfc6994b6bba52a66714b7218cb51cb | 5,451 | py | Python | tests/parser/test_relion_pipeline.py | DiamondLightSource/python-relion | 8ff1f87510f1a8971a5fd8d217eb17cbea78731d | [
"BSD-3-Clause"
] | 5 | 2020-07-20T04:18:25.000Z | 2022-02-12T13:40:48.000Z | tests/parser/test_relion_pipeline.py | DiamondLightSource/python-relion | 8ff1f87510f1a8971a5fd8d217eb17cbea78731d | [
"BSD-3-Clause"
] | 97 | 2020-07-17T18:20:06.000Z | 2022-03-31T10:28:47.000Z | tests/parser/test_relion_pipeline.py | DiamondLightSource/python-relion | 8ff1f87510f1a8971a5fd8d217eb17cbea78731d | [
"BSD-3-Clause"
] | 1 | 2020-10-30T11:07:03.000Z | 2020-10-30T11:07:03.000Z | import pathlib
import sys
import pytest
from relion._parser.processgraph import ProcessGraph
from relion._parser.processnode import ProcessNode
from relion._parser.relion_pipeline import RelionPipeline
@pytest.fixture
@pytest.fixture
@pytest.fixture
@pytest.fixture
@pytest.fixture
@pytest.mark.skip... | 33.857143 | 88 | 0.737663 | import pathlib
import sys
import pytest
from relion._parser.processgraph import ProcessGraph
from relion._parser.processnode import ProcessNode
from relion._parser.relion_pipeline import RelionPipeline
@pytest.fixture
def next_node_01():
return ProcessNode("MotionCorr/job002")
@pytest.fixture
def next_node_02... | 4,776 | 0 | 293 |
01122030ff57d9377ddf61352858ba09c5197d30 | 139 | py | Python | blog/urls.py | 31-13/portfolio | 86d69abc05ead28823db5def49622f04af0ebfd2 | [
"MIT"
] | null | null | null | blog/urls.py | 31-13/portfolio | 86d69abc05ead28823db5def49622f04af0ebfd2 | [
"MIT"
] | null | null | null | blog/urls.py | 31-13/portfolio | 86d69abc05ead28823db5def49622f04af0ebfd2 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.urls import path
from .views import blog
urlpatterns = [
path('', blog, name='blog'),
]
| 15.444444 | 32 | 0.705036 | from django.contrib import admin
from django.urls import path
from .views import blog
urlpatterns = [
path('', blog, name='blog'),
]
| 0 | 0 | 0 |
b34a1a7f59c7bf1d720c23f8b819112a2334aac4 | 1,506 | py | Python | code/snake_env.py | seahailang/LearningReinforcementLearning | f5b2425c352742440b3da0d428454fe29066129b | [
"MIT"
] | null | null | null | code/snake_env.py | seahailang/LearningReinforcementLearning | f5b2425c352742440b3da0d428454fe29066129b | [
"MIT"
] | null | null | null | code/snake_env.py | seahailang/LearningReinforcementLearning | f5b2425c352742440b3da0d428454fe29066129b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
"""
@version: 0.0
@author: hailang
@Email: seahailang@gmail.com
@software: PyCharm
@file: snake_env.py
@time: 2018/6/21 15:45
"""
import numpy as np
import gym
from gym.spaces import Discrete
if __name__ == '__main__':
s = SnakeEnv(10,[10]) | 22.818182 | 84 | 0.573705 | #!/usr/bin/env python
# encoding: utf-8
"""
@version: 0.0
@author: hailang
@Email: seahailang@gmail.com
@software: PyCharm
@file: snake_env.py
@time: 2018/6/21 15:45
"""
import numpy as np
import gym
from gym.spaces import Discrete
class SnakeEnv(gym.Env):
SIZE=100
def __init__(self,ladder_num,dices):
... | 1,189 | 124 | 23 |
dc0ceb405fac2cc1c20a9c0c0bcc6ae5f2dd07e9 | 134 | py | Python | Curso em video/Desafios1-20/Desafio6.py | Ry18-2003/Python-Journey | c926a733a578f3686767a1189bdccb4df137856d | [
"MIT"
] | null | null | null | Curso em video/Desafios1-20/Desafio6.py | Ry18-2003/Python-Journey | c926a733a578f3686767a1189bdccb4df137856d | [
"MIT"
] | null | null | null | Curso em video/Desafios1-20/Desafio6.py | Ry18-2003/Python-Journey | c926a733a578f3686767a1189bdccb4df137856d | [
"MIT"
] | null | null | null | n1 = int(input('Digite um número: '))
print(f'O dobro do número {n1} é {n1*2} o seu triplo {n1*3} e sua raiz quadrada é {n1**(1/2)}')
| 44.666667 | 95 | 0.626866 | n1 = int(input('Digite um número: '))
print(f'O dobro do número {n1} é {n1*2} o seu triplo {n1*3} e sua raiz quadrada é {n1**(1/2)}')
| 0 | 0 | 0 |
db29771268ea3ecddcf9d2fab597b5974c1769e6 | 532 | py | Python | testPython.py | nbcallah/Histogram-Sampler | 9360ea5c9923896a8ae63f5b7165f070645a8310 | [
"MIT"
] | null | null | null | testPython.py | nbcallah/Histogram-Sampler | 9360ea5c9923896a8ae63f5b7165f070645a8310 | [
"MIT"
] | null | null | null | testPython.py | nbcallah/Histogram-Sampler | 9360ea5c9923896a8ae63f5b7165f070645a8310 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import HistGen_py
import numpy
myHist = [100, 300, 300, 700, 900, 600, 400, 200, 300, 100]
myBins = ["infrared", "red", "orange", "yellow", "sour", "green", "teal", "blue", "violet", "ultraviolet"]
myTest = HistGen_py.HistGen(myHist)
for i in range(0,10):
index = myTest.genIndex(numpy.random.randi... | 38 | 106 | 0.695489 | #!/usr/bin/python
import HistGen_py
import numpy
myHist = [100, 300, 300, 700, 900, 600, 400, 200, 300, 100]
myBins = ["infrared", "red", "orange", "yellow", "sour", "green", "teal", "blue", "violet", "ultraviolet"]
myTest = HistGen_py.HistGen(myHist)
for i in range(0,10):
index = myTest.genIndex(numpy.random.randi... | 0 | 0 | 0 |
0fbe8b57c499b0a10f013e8738f4d89643439151 | 229 | py | Python | apronpy/cdll.py | caterinaurban/apronpy | 8a7e08e6929beeeeb97a9da648499be8c5d18bff | [
"MIT"
] | 7 | 2019-02-19T18:55:13.000Z | 2019-10-08T10:32:40.000Z | apronpy/cdll.py | caterinaurban/apronpy | 8a7e08e6929beeeeb97a9da648499be8c5d18bff | [
"MIT"
] | 3 | 2020-05-26T21:08:29.000Z | 2020-08-28T13:10:47.000Z | apronpy/cdll.py | caterinaurban/apronpy | 8a7e08e6929beeeeb97a9da648499be8c5d18bff | [
"MIT"
] | 1 | 2022-03-29T15:01:27.000Z | 2022-03-29T15:01:27.000Z | """
C DLLs
======
:Author: Caterina Urban
"""
from ctypes import util, CDLL
libc = CDLL(util.find_library('c'))
libapron = CDLL('libapron.so')
libgmp = CDLL(util.find_library('gmp'))
libmpfr = CDLL(util.find_library('mpfr'))
| 15.266667 | 41 | 0.676856 | """
C DLLs
======
:Author: Caterina Urban
"""
from ctypes import util, CDLL
libc = CDLL(util.find_library('c'))
libapron = CDLL('libapron.so')
libgmp = CDLL(util.find_library('gmp'))
libmpfr = CDLL(util.find_library('mpfr'))
| 0 | 0 | 0 |
5586bd40bf6dcfef172e32da01af9f4807ea5a33 | 371 | py | Python | alphatwirl/nanoaod/EventBuilderConfig.py | benkrikler/alphatwirl | cda7d12fec21291ea33af23234fc08be19430934 | [
"BSD-3-Clause"
] | null | null | null | alphatwirl/nanoaod/EventBuilderConfig.py | benkrikler/alphatwirl | cda7d12fec21291ea33af23234fc08be19430934 | [
"BSD-3-Clause"
] | 7 | 2018-02-26T10:32:26.000Z | 2018-03-19T12:27:12.000Z | alphatwirl/nanoaod/EventBuilderConfig.py | benkrikler/alphatwirl | cda7d12fec21291ea33af23234fc08be19430934 | [
"BSD-3-Clause"
] | null | null | null | ##__________________________________________________________________||
import collections
##__________________________________________________________________||
EventBuilderConfig = collections.namedtuple(
'EventBuilderConfig',
'base component'
)
# base is for roottree.EventBuilderConfig
##__________________... | 28.538462 | 70 | 0.862534 | ##__________________________________________________________________||
import collections
##__________________________________________________________________||
EventBuilderConfig = collections.namedtuple(
'EventBuilderConfig',
'base component'
)
# base is for roottree.EventBuilderConfig
##__________________... | 0 | 0 | 0 |
12cab3794b847a73861f7c5ad2a6f0f5f9050205 | 5,289 | py | Python | laksyt/entities/kafka/poller.py | laksyt/lks-persister | 42d9c795343e41b75d1c1915e835446e32c2fa40 | [
"MIT"
] | null | null | null | laksyt/entities/kafka/poller.py | laksyt/lks-persister | 42d9c795343e41b75d1c1915e835446e32c2fa40 | [
"MIT"
] | null | null | null | laksyt/entities/kafka/poller.py | laksyt/lks-persister | 42d9c795343e41b75d1c1915e835446e32c2fa40 | [
"MIT"
] | null | null | null | import asyncio
import logging
from dataclasses import dataclass
from typing import Optional
from kafka import KafkaConsumer
from kafka.errors import KafkaError
from laksyt.config.config import Config
from laksyt.entities.kafka.consumer import get_kafka_consumer
from laksyt.entities.kafka.schedule import Schedule, get... | 35.496644 | 80 | 0.633012 | import asyncio
import logging
from dataclasses import dataclass
from typing import Optional
from kafka import KafkaConsumer
from kafka.errors import KafkaError
from laksyt.config.config import Config
from laksyt.entities.kafka.consumer import get_kafka_consumer
from laksyt.entities.kafka.schedule import Schedule, get... | 0 | 0 | 0 |
44344be341e2ef2e0c8c3f99fe68ccdecf79e2aa | 97 | py | Python | moviesdbapi/apps.py | sratatata/netguru-movies | 33337fc71ae7a2ba8fcb48f9b08820532b2a5e78 | [
"Unlicense"
] | 1 | 2019-03-03T22:25:24.000Z | 2019-03-03T22:25:24.000Z | moviesdbapi/apps.py | sratatata/netguru-movies | 33337fc71ae7a2ba8fcb48f9b08820532b2a5e78 | [
"Unlicense"
] | 13 | 2018-07-29T15:46:56.000Z | 2021-06-10T20:46:51.000Z | moviesdbapi/apps.py | sratatata/netguru-movies | 33337fc71ae7a2ba8fcb48f9b08820532b2a5e78 | [
"Unlicense"
] | 1 | 2020-05-09T16:01:01.000Z | 2020-05-09T16:01:01.000Z | from django.apps import AppConfig
| 16.166667 | 35 | 0.773196 | from django.apps import AppConfig
class MoviesdbapiConfig(AppConfig):
name = 'moviesdbapi'
| 0 | 39 | 23 |
4b6f8bee9fa9d7aac526c896109c40567beae7a8 | 2,794 | py | Python | mvrss/learners/initializer.py | valeoai/MVRSS | 368c2c892d8e6076c59cb21fd1056d472887990d | [
"Apache-2.0"
] | 24 | 2021-05-19T02:38:48.000Z | 2022-03-28T09:19:15.000Z | mvrss/learners/initializer.py | xuqinwang/MVRSS | 368c2c892d8e6076c59cb21fd1056d472887990d | [
"Apache-2.0"
] | 1 | 2021-07-17T01:54:53.000Z | 2021-09-13T10:34:06.000Z | mvrss/learners/initializer.py | xuqinwang/MVRSS | 368c2c892d8e6076c59cb21fd1056d472887990d | [
"Apache-2.0"
] | 6 | 2021-06-02T09:14:04.000Z | 2022-03-02T15:21:44.000Z | """Initializer class to prepare training"""
import json
from torch.utils.data import DataLoader
from mvrss.utils.paths import Paths
from mvrss.loaders.dataset import Carrada
from mvrss.loaders.dataloaders import SequenceCarradaDataset
class Initializer:
"""Class to prepare training model
PARAMETERS
----... | 35.367089 | 93 | 0.618826 | """Initializer class to prepare training"""
import json
from torch.utils.data import DataLoader
from mvrss.utils.paths import Paths
from mvrss.loaders.dataset import Carrada
from mvrss.loaders.dataloaders import SequenceCarradaDataset
class Initializer:
"""Class to prepare training model
PARAMETERS
----... | 2,152 | 0 | 135 |
f302fb50c34cca6ae19d61421d07a3441abffc5d | 1,858 | py | Python | pdc/apps/osbs/signals.py | tzhaoredhat/automation | a1867dc2d3591fdae1fa7f80d457c25f9705070e | [
"MIT"
] | 18 | 2015-12-15T17:56:18.000Z | 2021-04-10T13:49:48.000Z | pdc/apps/osbs/signals.py | tzhaoredhat/automation | a1867dc2d3591fdae1fa7f80d457c25f9705070e | [
"MIT"
] | 303 | 2015-11-18T07:37:06.000Z | 2021-05-26T12:34:01.000Z | pdc/apps/osbs/signals.py | tzhaoredhat/automation | a1867dc2d3591fdae1fa7f80d457c25f9705070e | [
"MIT"
] | 27 | 2015-11-19T20:33:54.000Z | 2021-03-25T08:15:28.000Z | #
# Copyright (c) 2015 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
import json
from django.dispatch import receiver
from django.db.models.signals import post_save
from . import models
from pdc.apps.component import signals as component_signals
from pdc.apps.component import m... | 36.431373 | 79 | 0.738967 | #
# Copyright (c) 2015 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
import json
from django.dispatch import receiver
from django.db.models.signals import post_save
from . import models
from pdc.apps.component import signals as component_signals
from pdc.apps.component import m... | 400 | 0 | 22 |
1cfe73b68360a104ad108ff8ef1c4c995a3eb057 | 241 | py | Python | components/icdc-sheepdog/tests/integration/datadictwithobjid/utils.py | CBIIT/icdc-docker | 5dc78b96a8d885b3fa427c55b9cc19f4771910fa | [
"Apache-2.0"
] | 2 | 2019-06-10T15:30:51.000Z | 2020-01-18T23:24:13.000Z | components/icdc-sheepdog/tests/utils.py | CBIIT/icdc-docker | 5dc78b96a8d885b3fa427c55b9cc19f4771910fa | [
"Apache-2.0"
] | null | null | null | components/icdc-sheepdog/tests/utils.py | CBIIT/icdc-docker | 5dc78b96a8d885b3fa427c55b9cc19f4771910fa | [
"Apache-2.0"
] | 1 | 2022-03-31T09:52:46.000Z | 2022-03-31T09:52:46.000Z | import os
def read_file(filename):
"""Read the contents of a file in the tests directory."""
root_dir = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(root_dir, filename), 'r') as f:
return f.read()
| 26.777778 | 61 | 0.66805 | import os
def read_file(filename):
"""Read the contents of a file in the tests directory."""
root_dir = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(root_dir, filename), 'r') as f:
return f.read()
| 0 | 0 | 0 |
27cd2cb7ec28c5369648661a45650146484ef31f | 8,687 | py | Python | src/extract_holds.py | juangallostra/climbnet | 6ea48360b4501b40b24b3e6ff6182d1171d1ea9c | [
"Apache-2.0"
] | null | null | null | src/extract_holds.py | juangallostra/climbnet | 6ea48360b4501b40b24b3e6ff6182d1171d1ea9c | [
"Apache-2.0"
] | null | null | null | src/extract_holds.py | juangallostra/climbnet | 6ea48360b4501b40b24b3e6ff6182d1171d1ea9c | [
"Apache-2.0"
] | null | null | null | import os
import json
from itertools import product
import numpy as np
from PIL import Image
from os import walk
import cv2
from detectron2 import model_zoo
from detectron2.config import get_cfg
from detectron2.data import DatasetCatalog
from detectron2.data import MetadataCatalog
from detectron2.data.datasets import... | 38.608889 | 137 | 0.657419 | import os
import json
from itertools import product
import numpy as np
from PIL import Image
from os import walk
import cv2
from detectron2 import model_zoo
from detectron2.config import get_cfg
from detectron2.data import DatasetCatalog
from detectron2.data import MetadataCatalog
from detectron2.data.datasets import... | 5,614 | 0 | 138 |
cceb19f18e4db1f1bc90595c42aabfc173275b59 | 5,083 | py | Python | vocabs/views.py | acdh-oeaw/vhioe | 83c8bce83d7cb21150f404409477d2cd1c7ee240 | [
"MIT"
] | 1 | 2017-10-17T10:05:44.000Z | 2017-10-17T10:05:44.000Z | vocabs/views.py | acdh-oeaw/cbab | 7cd25f057913dccf85f851e448b1dbc2c5f8d624 | [
"MIT"
] | 15 | 2017-10-17T09:57:10.000Z | 2021-12-13T19:48:46.000Z | vocabs/views.py | acdh-oeaw/thunau | 06e4d54f4553939ffba3c504088055c3807328c6 | [
"MIT"
] | 1 | 2017-11-09T11:18:24.000Z | 2017-11-09T11:18:24.000Z | from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.utils.decorators import method_decorator
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import r... | 29.725146 | 97 | 0.714539 | from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.utils.decorators import method_decorator
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import r... | 1,423 | 2,428 | 345 |
20800899334a7f9045e3040d9fc79c07a6e2cb14 | 784 | py | Python | api/db/db.py | bcgov/data-stream | 2d8fbf3843ee765ee102f306993fdbc742aca5d8 | [
"Apache-2.0"
] | 1 | 2019-02-10T08:27:22.000Z | 2019-02-10T08:27:22.000Z | api/db/db.py | bcgov/data-stream | 2d8fbf3843ee765ee102f306993fdbc742aca5d8 | [
"Apache-2.0"
] | 18 | 2019-02-09T01:02:09.000Z | 2022-03-30T23:04:24.000Z | api/db/db.py | bcgov/data-stream | 2d8fbf3843ee765ee102f306993fdbc742aca5d8 | [
"Apache-2.0"
] | 2 | 2019-02-09T06:36:54.000Z | 2019-02-12T09:52:58.000Z | from mongoengine import connect
from config import Config
from db.models.subscriptions import Subscriptions
| 34.086957 | 68 | 0.633929 | from mongoengine import connect
from config import Config
from db.models.subscriptions import Subscriptions
class Db:
Subscriptions = None
def __init__(self, createClient=True):
config = Config()
self.db = {}
self.Subscriptions = Subscriptions
self.createClient = createClient
... | 587 | 66 | 23 |
06e43597610cd88482cb86a5d3d21ac4ef2589de | 2,779 | py | Python | gym_continuousDoubleAuction/train/model/model_handler.py | FabianSchuetze/gym-continuousDoubleAuction | cc1b5ddff6c32a882d70d2563596bc7eb32dcd9f | [
"MIT"
] | 96 | 2019-08-15T16:36:01.000Z | 2022-03-29T16:46:49.000Z | gym_continuousDoubleAuction/train/model/model_handler.py | sbhadade/gym-continuousDoubleAuction | dbfeb7e1c1751b318c6e8bc570101d6f856720fe | [
"MIT"
] | 10 | 2019-08-27T08:30:20.000Z | 2022-03-11T23:57:41.000Z | gym_continuousDoubleAuction/train/model/model_handler.py | sbhadade/gym-continuousDoubleAuction | dbfeb7e1c1751b318c6e8bc570101d6f856720fe | [
"MIT"
] | 17 | 2020-04-15T14:44:23.000Z | 2022-03-12T20:39:55.000Z | from ray.rllib.models.tf.tf_modelv2 import TFModelV2
from ray.rllib.models.tf.fcnet_v2 import FullyConnectedNetwork
from ray.rllib.models import Model # deprecated and should not be used.
class CustomModel_1(Model):
"""
Sample custom model with LSTM.
Still working but deprecated and should not be used.
... | 44.822581 | 127 | 0.65923 | from ray.rllib.models.tf.tf_modelv2 import TFModelV2
from ray.rllib.models.tf.fcnet_v2 import FullyConnectedNetwork
from ray.rllib.models import Model # deprecated and should not be used.
class CustomModel_1(Model):
"""
Sample custom model with LSTM.
Still working but deprecated and should not be used.
... | 1,451 | 0 | 54 |
ab1da09f99b9d7d70090d275398149f2669bd51b | 621 | py | Python | model_prefix/models.py | anx-abruckner/django-model-prefix | a5cabf1ac210b6358ea358b1d268d802114d85d4 | [
"MIT"
] | null | null | null | model_prefix/models.py | anx-abruckner/django-model-prefix | a5cabf1ac210b6358ea358b1d268d802114d85d4 | [
"MIT"
] | null | null | null | model_prefix/models.py | anx-abruckner/django-model-prefix | a5cabf1ac210b6358ea358b1d268d802114d85d4 | [
"MIT"
] | 1 | 2021-10-08T13:26:44.000Z | 2021-10-08T13:26:44.000Z | from django.conf import settings
from django.db.models import options
from django.db.models.signals import class_prepared, pre_init
options.DEFAULT_NAMES = options.DEFAULT_NAMES + ('db_prefix',)
pre_init.connect(model_prefix)
class_prepared.connect(model_prefix)
| 28.227273 | 63 | 0.752013 | from django.conf import settings
from django.db.models import options
from django.db.models.signals import class_prepared, pre_init
options.DEFAULT_NAMES = options.DEFAULT_NAMES + ('db_prefix',)
def model_prefix(sender, **kwargs):
# Global defined prefix
prefix = getattr(settings, "DB_PREFIX", None)
# M... | 331 | 0 | 23 |
f52f7f7f2386b190111a72f56968dc3910c24afe | 225 | py | Python | test/tiles/time_interval_test.py | sergpolly/clodius | 16c2dcba52326e8cd0f02d096b735904b3da95f4 | [
"MIT"
] | 14 | 2018-11-14T23:58:32.000Z | 2021-09-12T13:56:19.000Z | test/tiles/time_interval_test.py | sergpolly/clodius | 16c2dcba52326e8cd0f02d096b735904b3da95f4 | [
"MIT"
] | 71 | 2018-10-30T15:31:24.000Z | 2022-03-20T21:10:19.000Z | test/tiles/time_interval_test.py | sergpolly/clodius | 16c2dcba52326e8cd0f02d096b735904b3da95f4 | [
"MIT"
] | 15 | 2018-10-30T15:31:44.000Z | 2021-12-22T02:23:00.000Z | import clodius.tiles.time_interval as hgti
import os.path as op
| 22.5 | 51 | 0.737778 | import clodius.tiles.time_interval as hgti
import os.path as op
def test_tileset_info():
filename = op.join("data", "sample_htime.json")
hgti.tileset_info(filename)
# TODO: Make assertions about info returned.
| 137 | 0 | 23 |
12d4d0256da740c2a3582b488dd59b67b7c4e8b1 | 636 | py | Python | qatrack/qa/migrations/0048_auto_20200102_1356.py | crcrewso/qatrackplus | b9da3bc542d9e3eca8b7291bb631d1c7255d528e | [
"MIT"
] | 20 | 2021-03-11T18:37:32.000Z | 2022-03-23T19:38:07.000Z | qatrack/qa/migrations/0048_auto_20200102_1356.py | crcrewso/qatrackplus | b9da3bc542d9e3eca8b7291bb631d1c7255d528e | [
"MIT"
] | 75 | 2021-02-12T02:37:33.000Z | 2022-03-29T20:56:16.000Z | qatrack/qa/migrations/0048_auto_20200102_1356.py | crcrewso/qatrackplus | b9da3bc542d9e3eca8b7291bb631d1c7255d528e | [
"MIT"
] | 5 | 2021-04-07T15:46:53.000Z | 2021-09-18T16:55:00.000Z | # Generated by Django 2.1.11 on 2020-01-02 18:56
from django.db import migrations, models
import qatrack.qatrack_core.fields
| 30.285714 | 256 | 0.690252 | # Generated by Django 2.1.11 on 2020-01-02 18:56
from django.db import migrations, models
import qatrack.qatrack_core.fields
class Migration(migrations.Migration):
dependencies = [
('qa', '0047_fix_serialized_uploads'),
]
operations = [
migrations.AddField(
model_name='test... | 0 | 485 | 23 |
d1148f4d27190c9bffce4be88de4cecf1a8da8ad | 219 | py | Python | main.py | CS-Cafe/Rube-Goldberg-Machine | e66643e552ca41a3b51a9d8d22064465300d3bb6 | [
"MIT"
] | 1 | 2021-09-20T01:40:40.000Z | 2021-09-20T01:40:40.000Z | main.py | CS-Cafe/Rube-Goldberg-Machine | e66643e552ca41a3b51a9d8d22064465300d3bb6 | [
"MIT"
] | null | null | null | main.py | CS-Cafe/Rube-Goldberg-Machine | e66643e552ca41a3b51a9d8d22064465300d3bb6 | [
"MIT"
] | null | null | null | from pynput.keyboard import Key, Controller
import time
keyboard = Controller()
try:
while 1:
time.sleep(3)
keyboard.press(Key.alt)
keyboard.press(Key.f4)
except KeyboardInterrupt:
pass
| 18.25 | 43 | 0.675799 | from pynput.keyboard import Key, Controller
import time
keyboard = Controller()
try:
while 1:
time.sleep(3)
keyboard.press(Key.alt)
keyboard.press(Key.f4)
except KeyboardInterrupt:
pass
| 0 | 0 | 0 |
5a668792bed1487d85ba503a8538660f4ba65b76 | 356 | py | Python | hysds/celery.py | hysds/hysds | 839d527114e115603ea0a2c4c1b7fe474f7b7b39 | [
"Apache-2.0"
] | 17 | 2018-04-30T17:53:23.000Z | 2021-11-10T18:24:24.000Z | hysds/celery.py | hysds/hysds | 839d527114e115603ea0a2c4c1b7fe474f7b7b39 | [
"Apache-2.0"
] | 54 | 2017-10-17T23:22:53.000Z | 2022-02-09T22:05:07.000Z | hysds/celery.py | hysds/hysds | 839d527114e115603ea0a2c4c1b7fe474f7b7b39 | [
"Apache-2.0"
] | 9 | 2018-01-13T01:07:21.000Z | 2021-02-25T21:21:43.000Z | from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from future import standard_library
standard_library.install_aliases()
from celery import Celery
app = Celery("hysds")
app.config_from_object("celeryconfig")
if __na... | 19.777778 | 39 | 0.817416 | from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from future import standard_library
standard_library.install_aliases()
from celery import Celery
app = Celery("hysds")
app.config_from_object("celeryconfig")
if __na... | 0 | 0 | 0 |
821de4baf0a3b8e05bb65e46b824fa407b57833d | 30 | py | Python | tests/instagram/fixtures/endpoints/internal/__init__.py | Yuego/instagram_api | b53f72db36c505a2eb24ebac1ba8267a0cc295bb | [
"MIT"
] | 13 | 2019-08-07T21:24:34.000Z | 2020-12-12T12:23:50.000Z | tests/instagram/fixtures/endpoints/internal/__init__.py | Yuego/instagram_api | b53f72db36c505a2eb24ebac1ba8267a0cc295bb | [
"MIT"
] | null | null | null | tests/instagram/fixtures/endpoints/internal/__init__.py | Yuego/instagram_api | b53f72db36c505a2eb24ebac1ba8267a0cc295bb | [
"MIT"
] | null | null | null |
from .msisdn_header import *
| 10 | 28 | 0.766667 |
from .msisdn_header import *
| 0 | 0 | 0 |
c747dc952f4cbc13c10e968bff59ff2fd4f23bee | 1,246 | py | Python | backend/viperid/utils.py | vaporycommonwealth/viperid | ef910346a096876b36eacfabd86bb551b58ba1af | [
"MIT"
] | null | null | null | backend/viperid/utils.py | vaporycommonwealth/viperid | ef910346a096876b36eacfabd86bb551b58ba1af | [
"MIT"
] | null | null | null | backend/viperid/utils.py | vaporycommonwealth/viperid | ef910346a096876b36eacfabd86bb551b58ba1af | [
"MIT"
] | 1 | 2017-09-25T13:13:27.000Z | 2017-09-25T13:13:27.000Z | from functools import wraps
from werkzeug.exceptions import BadRequest
from flask import request, jsonify
| 27.688889 | 80 | 0.536116 | from functools import wraps
from werkzeug.exceptions import BadRequest
from flask import request, jsonify
def body_required(f):
@wraps(f)
def decorated_function(*args, **kwargs):
try:
# Set Force True to allow integration easily with any frontend.
data = request.get_json(force=... | 1,092 | 0 | 46 |
72d9061cbbb2486c49ca34fb4aa672a7b5f9438e | 7,762 | py | Python | audio_zen/inferencer/base_inferencer.py | ShkarupaDC/FullSubNet | 2aef8b656376a42fbf519e0020636a893b56c4f8 | [
"MIT"
] | 219 | 2020-12-19T02:22:23.000Z | 2022-03-31T13:38:47.000Z | audio_zen/inferencer/base_inferencer.py | ShkarupaDC/FullSubNet | 2aef8b656376a42fbf519e0020636a893b56c4f8 | [
"MIT"
] | 39 | 2021-01-25T06:51:43.000Z | 2022-03-15T22:35:13.000Z | audio_zen/inferencer/base_inferencer.py | ShkarupaDC/FullSubNet | 2aef8b656376a42fbf519e0020636a893b56c4f8 | [
"MIT"
] | 77 | 2020-12-19T13:08:08.000Z | 2022-03-28T06:48:27.000Z | from functools import partial
from pathlib import Path
import librosa
import numpy as np
import soundfile as sf
import toml
import torch
from torch.nn import functional
from torch.utils.data import DataLoader
from tqdm import tqdm
from audio_zen.acoustics.feature import stft, istft
from audio_zen.utils import initial... | 41.068783 | 128 | 0.643391 | from functools import partial
from pathlib import Path
import librosa
import numpy as np
import soundfile as sf
import toml
import torch
from torch.nn import functional
from torch.utils.data import DataLoader
from tqdm import tqdm
from audio_zen.acoustics.feature import stft, istft
from audio_zen.utils import initial... | 3,846 | 3,497 | 23 |
eba865e72fedda4b6e07ef427f423c883f1ecadc | 2,995 | py | Python | scalable_individual_tests/test/test_skiros2.py | ScalABLE40/scalable_tests | ce6bcd3343d360d05310b9d8d09328bdded0ec1e | [
"Apache-2.0"
] | null | null | null | scalable_individual_tests/test/test_skiros2.py | ScalABLE40/scalable_tests | ce6bcd3343d360d05310b9d8d09328bdded0ec1e | [
"Apache-2.0"
] | null | null | null | scalable_individual_tests/test/test_skiros2.py | ScalABLE40/scalable_tests | ce6bcd3343d360d05310b9d8d09328bdded0ec1e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import rospy
import sys
import unittest
import threading
from turtlesim.msg import Pose
from geometry_msgs.msg import Twist
from skiros2_skill.ros.skill_layer_interface import SkillLayerInterface
PKG = 'integration_tests'
NAME = 'test_integration_tm'
## A sample python unit test
if __name__... | 33.651685 | 101 | 0.674791 | #!/usr/bin/env python
import rospy
import sys
import unittest
import threading
from turtlesim.msg import Pose
from geometry_msgs.msg import Twist
from skiros2_skill.ros.skill_layer_interface import SkillLayerInterface
PKG = 'integration_tests'
NAME = 'test_integration_tm'
## A sample python unit test
class TestSkiro... | 2,239 | 263 | 72 |
03fcf7a942c07ded7389e9ed4024b7d2bbb377e4 | 4,884 | py | Python | scripts/process_adsorbates.py | krylea/ocp | 00fc1df29731d70ff1b5cf8e9323d1d2f1f8e540 | [
"MIT"
] | null | null | null | scripts/process_adsorbates.py | krylea/ocp | 00fc1df29731d70ff1b5cf8e9323d1d2f1f8e540 | [
"MIT"
] | null | null | null | scripts/process_adsorbates.py | krylea/ocp | 00fc1df29731d70ff1b5cf8e9323d1d2f1f8e540 | [
"MIT"
] | null | null | null | from ocpmodels.preprocessing import AtomsToGraphs
from ocpmodels.datasets import SinglePointLmdbDataset, TrajectoryLmdbDataset
import ase.io
from ase.build import bulk
from ase.build import fcc100, add_adsorbate, molecule
from ase.constraints import FixAtoms
from ase.calculators.emt import EMT
from ase.optimize import ... | 32.56 | 109 | 0.668919 | from ocpmodels.preprocessing import AtomsToGraphs
from ocpmodels.datasets import SinglePointLmdbDataset, TrajectoryLmdbDataset
import ase.io
from ase.build import bulk
from ase.build import fcc100, add_adsorbate, molecule
from ase.constraints import FixAtoms
from ase.calculators.emt import EMT
from ase.optimize import ... | 3,944 | 0 | 115 |
e10c0d431f4e1a04c9d593c344afdd2132cd7d07 | 8,225 | py | Python | transferchannel/transferchannel.py | AAA3A-AAA3A/AAA3A-cogs | 076ff390610e2470a086bdae41647ee21f01c323 | [
"MIT"
] | 1 | 2022-03-17T02:06:37.000Z | 2022-03-17T02:06:37.000Z | transferchannel/transferchannel.py | AAA3A-AAA3A/AAA3A-cogs | 076ff390610e2470a086bdae41647ee21f01c323 | [
"MIT"
] | 2 | 2022-03-07T03:29:33.000Z | 2022-03-17T06:51:43.000Z | transferchannel/transferchannel.py | AAA3A-AAA3A/AAA3A-cogs | 076ff390610e2470a086bdae41647ee21f01c323 | [
"MIT"
] | 2 | 2021-11-24T19:31:55.000Z | 2022-01-02T06:34:22.000Z | from .AAA3A_utils.cogsutils import CogsUtils # isort:skip
from redbot.core import commands # isort:skip
from redbot.core.i18n import Translator, cog_i18n # isort:skip
from redbot.core.bot import Red # isort:skip
import discord # isort:skip
import typing # isort:skip
from .helpers import embed_from_msg
... | 62.78626 | 299 | 0.643161 | from .AAA3A_utils.cogsutils import CogsUtils # isort:skip
from redbot.core import commands # isort:skip
from redbot.core.i18n import Translator, cog_i18n # isort:skip
from redbot.core.bot import Red # isort:skip
import discord # isort:skip
import typing # isort:skip
from .helpers import embed_from_msg
... | 2,562 | 0 | 58 |
3ae75d8b75ea2eb0be1ad6128bc5b65fc54e72ec | 1,159 | py | Python | server.py | Benjadahl/BenjaWorld | c07cd5bc0960db81d0462e87793ec1af7885c3fb | [
"Apache-2.0"
] | null | null | null | server.py | Benjadahl/BenjaWorld | c07cd5bc0960db81d0462e87793ec1af7885c3fb | [
"Apache-2.0"
] | null | null | null | server.py | Benjadahl/BenjaWorld | c07cd5bc0960db81d0462e87793ec1af7885c3fb | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#Import packages
from flask import *
#Import local packages
import dbHandler as db
#Start flask app
app = Flask(__name__)
#Default index page
@app.route('/')
#The town page, the game will automatically direct the page to your town when accesing this URL
@app.route('/login/')
#The town page,... | 23.18 | 95 | 0.69025 | #!/usr/bin/env python3
#Import packages
from flask import *
#Import local packages
import dbHandler as db
#Start flask app
app = Flask(__name__)
#Default index page
@app.route('/')
def showStart():
return render_template("index.html")
#The town page, the game will automatically direct the page to your town whe... | 359 | 0 | 132 |
21d106280f96337744d3d15fd3da390137d948df | 1,046 | py | Python | INF101/TP/TP6/2.6.1.4_mirror.py | Marshellson/UGA_IMF | eb293deabcc5ef6e45617d8c5bb6268b63b34f21 | [
"MIT"
] | 1 | 2021-09-21T21:53:17.000Z | 2021-09-21T21:53:17.000Z | INF101/TP/TP6/2.6.1.4_mirror.py | Marshellson/UGA_INF | eb293deabcc5ef6e45617d8c5bb6268b63b34f21 | [
"MIT"
] | null | null | null | INF101/TP/TP6/2.6.1.4_mirror.py | Marshellson/UGA_INF | eb293deabcc5ef6e45617d8c5bb6268b63b34f21 | [
"MIT"
] | null | null | null | '''
Author: JIANG Yilun
Date: 2022-02-21 15:13:14
LastEditTime: 2022-02-21 15:16:30
LastEditors: JIANG Yilun
Description:
FilePath: /UGA_INF/INF101/TP/TP6/2.6.1.4_mirror.py
'''
import sys
import math
# Auto-generated code below aims at helping you parse
# the standard input according to the problem statement.
n = in... | 26.820513 | 72 | 0.646272 | '''
Author: JIANG Yilun
Date: 2022-02-21 15:13:14
LastEditTime: 2022-02-21 15:16:30
LastEditors: JIANG Yilun
Description:
FilePath: /UGA_INF/INF101/TP/TP6/2.6.1.4_mirror.py
'''
import sys
import math
# Auto-generated code below aims at helping you parse
# the standard input according to the problem statement.
n = in... | 383 | 0 | 23 |
0923b4b9e6beca141814053d0ad67f5a6310a74b | 495 | py | Python | students/k3342/laboratory_works/Shaidullina_Regina/laboratory_work_1/leaderboard/urls.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 10 | 2020-03-20T09:06:12.000Z | 2021-07-27T13:06:02.000Z | students/k3342/laboratory_works/Shaidullina_Regina/laboratory_work_1/leaderboard/urls.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 134 | 2020-03-23T09:47:48.000Z | 2022-03-12T01:05:19.000Z | students/k3342/laboratory_works/Shaidullina_Regina/laboratory_work_1/leaderboard/urls.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 71 | 2020-03-20T12:45:56.000Z | 2021-10-31T19:22:25.000Z | from django.contrib import admin
from django.urls import path
from leaderboard import views
from django.contrib.auth.views import LoginView #, LogoutView
urlpatterns = [
path('', views.main, name='main'),
path('leaderboard/', views.leaderboard_view, name='leaderboard'),
path('comments/', views.comments, name='comm... | 35.357143 | 66 | 0.729293 | from django.contrib import admin
from django.urls import path
from leaderboard import views
from django.contrib.auth.views import LoginView #, LogoutView
urlpatterns = [
path('', views.main, name='main'),
path('leaderboard/', views.leaderboard_view, name='leaderboard'),
path('comments/', views.comments, name='comm... | 0 | 0 | 0 |
8e52a4f5718b64fe398109099129281604f196a7 | 456 | py | Python | lib/solutions/SUM/sum_solution.py | DPNT-Sourcecode/CHK-pttv01 | caf1e37c53cee5ab4844a6c9a5f7d904b1461fb0 | [
"Apache-2.0"
] | null | null | null | lib/solutions/SUM/sum_solution.py | DPNT-Sourcecode/CHK-pttv01 | caf1e37c53cee5ab4844a6c9a5f7d904b1461fb0 | [
"Apache-2.0"
] | null | null | null | lib/solutions/SUM/sum_solution.py | DPNT-Sourcecode/CHK-pttv01 | caf1e37c53cee5ab4844a6c9a5f7d904b1461fb0 | [
"Apache-2.0"
] | null | null | null | #!/usr/local/bin/python3
# noinspection PyShadowingBuiltins,PyUnusedLocal
def compute(val1, val2):
'''
Function returning the sum of two parameters.
Args:
val1 : Integer between 0 and 100.
val2 : Integer between 0 and 100.
Return:
Integer : Sum of val1 and val2.
'''
retu... | 24 | 49 | 0.600877 | #!/usr/local/bin/python3
# noinspection PyShadowingBuiltins,PyUnusedLocal
def compute(val1, val2):
'''
Function returning the sum of two parameters.
Args:
val1 : Integer between 0 and 100.
val2 : Integer between 0 and 100.
Return:
Integer : Sum of val1 and val2.
'''
retu... | 0 | 0 | 0 |
50d8c128a8e03e7ecb47c79702d9322f7100c752 | 3,128 | py | Python | DIZED_APPS/INCANTATION/routersploit/modules/exploits/cameras/multi/netwave_IP_camera.py | tanc7/ArmsCommander-TestBed | e00bb166084735d8b0de058b54d6d98a057cd7d8 | [
"FSFUL"
] | 1 | 2018-10-17T04:49:42.000Z | 2018-10-17T04:49:42.000Z | DIZED_APPS/INCANTATION/routersploit/modules/exploits/cameras/multi/netwave_IP_camera.py | tanc7/ArmsCommander-TestBed | e00bb166084735d8b0de058b54d6d98a057cd7d8 | [
"FSFUL"
] | null | null | null | DIZED_APPS/INCANTATION/routersploit/modules/exploits/cameras/multi/netwave_IP_camera.py | tanc7/ArmsCommander-TestBed | e00bb166084735d8b0de058b54d6d98a057cd7d8 | [
"FSFUL"
] | null | null | null | from routersploit import (
exploits,
print_error,
print_success,
print_info,
print_status,
http_request,
mute,
validators,
)
class Exploit(exploits.Exploit):
"""
Netwave IP Camera - Password Disclosure
"""
__info__ = {
'name': 'Netwave_IP_camera',
'descr... | 37.686747 | 119 | 0.582161 | from routersploit import (
exploits,
print_error,
print_success,
print_info,
print_status,
http_request,
mute,
validators,
)
class Exploit(exploits.Exploit):
"""
Netwave IP Camera - Password Disclosure
"""
__info__ = {
'name': 'Netwave_IP_camera',
'descr... | 2,025 | 0 | 53 |
4f76e389f54e3aa0502a094ec4b3d7cc71a662bd | 3,101 | py | Python | ipbm-old/controller/util/python/generate_header_json_from_file.py | jijinfanhua/IPSA-ipbm | c82dc003bf9c68ba029814d7539f502fd29e1326 | [
"Apache-2.0"
] | null | null | null | ipbm-old/controller/util/python/generate_header_json_from_file.py | jijinfanhua/IPSA-ipbm | c82dc003bf9c68ba029814d7539f502fd29e1326 | [
"Apache-2.0"
] | null | null | null | ipbm-old/controller/util/python/generate_header_json_from_file.py | jijinfanhua/IPSA-ipbm | c82dc003bf9c68ba029814d7539f502fd29e1326 | [
"Apache-2.0"
] | null | null | null | import json
from basic_class import *
# fp = open("../config/header_pure.txt", "r")
fp = open("../../config/header_pure.txt", "r")
header_list = []
while True:
line = fp.readline()
# print(line)
if line == "*":
break
elif line == "":
continue
else:
l = line.split()
... | 41.346667 | 113 | 0.570461 | import json
from basic_class import *
# fp = open("../config/header_pure.txt", "r")
fp = open("../../config/header_pure.txt", "r")
header_list = []
while True:
line = fp.readline()
# print(line)
if line == "*":
break
elif line == "":
continue
else:
l = line.split()
... | 0 | 0 | 0 |
d1b6bda899be2b2c1c9f15895d3f6979a97d89d0 | 649 | py | Python | NN utilizando PIXELES/rendimiento_de_theta_de_pixeles.py | DussanFreire/NN-used-to-recognize-numbers-and-basic-operations | e023e1bd698b8acc2b01b796dd5a8036946f617f | [
"MIT"
] | null | null | null | NN utilizando PIXELES/rendimiento_de_theta_de_pixeles.py | DussanFreire/NN-used-to-recognize-numbers-and-basic-operations | e023e1bd698b8acc2b01b796dd5a8036946f617f | [
"MIT"
] | null | null | null | NN utilizando PIXELES/rendimiento_de_theta_de_pixeles.py | DussanFreire/NN-used-to-recognize-numbers-and-basic-operations | e023e1bd698b8acc2b01b796dd5a8036946f617f | [
"MIT"
] | null | null | null | from RedNeuronal import RedNeuronal
import h5py
# direccion alvaro
# data = h5py.File(r"C:\Users\Lenovo\Downloads\modelado\practica_3\digitos.h5", "r")
# direccion dussan
data = h5py.File(r"C:\Users\Dussan\Desktop\digitos_con_signos.h5", "r")
X_train = data["X_train"][:]
y_train = data["y_train"][:]
X_test = data["X... | 24.037037 | 84 | 0.74114 | from RedNeuronal import RedNeuronal
import h5py
# direccion alvaro
# data = h5py.File(r"C:\Users\Lenovo\Downloads\modelado\practica_3\digitos.h5", "r")
# direccion dussan
data = h5py.File(r"C:\Users\Dussan\Desktop\digitos_con_signos.h5", "r")
X_train = data["X_train"][:]
y_train = data["y_train"][:]
X_test = data["X... | 0 | 0 | 0 |
0f223ad90181adf72be759f9ee7f7d47f3d7ed0c | 2,594 | py | Python | Utility/Torch/Models/Supertransformer/Layers/DeepMemory.py | smithblack-0/Utility | 875ab69fffad1412174d9d0a1de70edc1fd64152 | [
"MIT"
] | null | null | null | Utility/Torch/Models/Supertransformer/Layers/DeepMemory.py | smithblack-0/Utility | 875ab69fffad1412174d9d0a1de70edc1fd64152 | [
"MIT"
] | null | null | null | Utility/Torch/Models/Supertransformer/Layers/DeepMemory.py | smithblack-0/Utility | 875ab69fffad1412174d9d0a1de70edc1fd64152 | [
"MIT"
] | null | null | null | """
A class for the deep memory process. Deep memory is a flavor spawned by the techniques
displayed in Memorizing Transformers (https://arxiv.org/abs/2203.08913). However,
rather thqn saving each instance to an external memory bank, instead we search a
space of differential memory, and only train the topk instances
... | 35.054054 | 86 | 0.660756 | """
A class for the deep memory process. Deep memory is a flavor spawned by the techniques
displayed in Memorizing Transformers (https://arxiv.org/abs/2203.08913). However,
rather thqn saving each instance to an external memory bank, instead we search a
space of differential memory, and only train the topk instances
... | 537 | 0 | 26 |
6fafe0b4501bda51210d04a842b5f2ca1523ff1d | 9,781 | py | Python | litedao/__init__.py | pyrustic/litedao | 9d34879996aa5248db734491444976225380b362 | [
"MIT"
] | null | null | null | litedao/__init__.py | pyrustic/litedao | 9d34879996aa5248db734491444976225380b362 | [
"MIT"
] | null | null | null | litedao/__init__.py | pyrustic/litedao | 9d34879996aa5248db734491444976225380b362 | [
"MIT"
] | null | null | null | import sqlite3 as sqlite
import os.path
import atexit
import threading
class Litedao:
"""
It's recommended to use Dao by composition. Meaning: don't subclass it.
DAO: Data Access Object (this one is built to work with SQLite).
You give an SQL request with some params or not, it spills out the result n... | 32.712375 | 109 | 0.51048 | import sqlite3 as sqlite
import os.path
import atexit
import threading
class Litedao:
"""
It's recommended to use Dao by composition. Meaning: don't subclass it.
DAO: Data Access Object (this one is built to work with SQLite).
You give an SQL request with some params or not, it spills out the result n... | 180 | 2 | 128 |
7563d761b6b45d37317527e311c9b9997d563f4b | 760 | py | Python | tools/init_paths.py | ys7yoo/HRNet | 264414c06d64aa0b4327930b8f612a50fc6450cd | [
"MIT"
] | null | null | null | tools/init_paths.py | ys7yoo/HRNet | 264414c06d64aa0b4327930b8f612a50fc6450cd | [
"MIT"
] | 3 | 2019-10-27T13:19:32.000Z | 2019-10-28T10:05:16.000Z | tools/init_paths.py | ys7yoo/HRNet | 264414c06d64aa0b4327930b8f612a50fc6450cd | [
"MIT"
] | null | null | null | ## MODIFIED FROM _init_paths.py
import os
import sys
PATH_CURRENT = os.path.abspath(os.path.dirname(__file__))
# print(PATH_CURRENT)
# get parent dir: https://stackoverflow.com/questions/2860153/how-do-i-get-the-parent-directory-in-python
from pathlib import Path
PATH_PARENT = Path(PATH_CURRENT).parent
#PATH_PARENT =... | 26.206897 | 120 | 0.746053 | ## MODIFIED FROM _init_paths.py
import os
import sys
def add_path(path):
if path not in sys.path:
# print('adding path {}'.format(path))
sys.path.append(path)
PATH_CURRENT = os.path.abspath(os.path.dirname(__file__))
# print(PATH_CURRENT)
# get parent dir: https://stackoverflow.com/questions/2860... | 104 | 0 | 23 |
dcbe0f04a0fe2c456ffd41f8434bc8e697bca643 | 12,349 | py | Python | test/test_cmds.py | codeLovingYogi/cmdstanpy | b9d418c98535fb5571ae70058c73f75eac3637f7 | [
"BSD-3-Clause"
] | null | null | null | test/test_cmds.py | codeLovingYogi/cmdstanpy | b9d418c98535fb5571ae70058c73f75eac3637f7 | [
"BSD-3-Clause"
] | null | null | null | test/test_cmds.py | codeLovingYogi/cmdstanpy | b9d418c98535fb5571ae70058c73f75eac3637f7 | [
"BSD-3-Clause"
] | null | null | null | import io
import os
import os.path
import sys
import unittest
from cmdstanpy import TMPDIR
from cmdstanpy.lib import Model, SamplerArgs, RunSet
from cmdstanpy.cmds import compile_model, sample, summary, diagnose
from cmdstanpy.cmds import get_drawset, save_csvfiles
datafiles_path = os.path.join('test', 'data')
... | 39.453674 | 80 | 0.616244 | import io
import os
import os.path
import sys
import unittest
from cmdstanpy import TMPDIR
from cmdstanpy.lib import Model, SamplerArgs, RunSet
from cmdstanpy.cmds import compile_model, sample, summary, diagnose
from cmdstanpy.cmds import get_drawset, save_csvfiles
datafiles_path = os.path.join('test', 'data')
clas... | 11,224 | 101 | 510 |
76f40d02bacdbe3d6b3f25ee64fc6153b4cf533b | 404 | py | Python | django/app/tasks.py | shimakaze-git/docker_django_celery_vote | 0b0899a9fb4d817ff5966e9d1f1f027755e585cf | [
"BSD-2-Clause"
] | null | null | null | django/app/tasks.py | shimakaze-git/docker_django_celery_vote | 0b0899a9fb4d817ff5966e9d1f1f027755e585cf | [
"BSD-2-Clause"
] | null | null | null | django/app/tasks.py | shimakaze-git/docker_django_celery_vote | 0b0899a9fb4d817ff5966e9d1f1f027755e585cf | [
"BSD-2-Clause"
] | null | null | null | from django.template.loader import get_template | 26.933333 | 47 | 0.685644 | from django.template.loader import get_template
def get_message(item, action):
template = get_template('app/message.txt')
context = {
"item": item,
"action": action,
}
message = template.render(context)
return message
def send_notification(item, action):
message = get_message(i... | 311 | 0 | 46 |
f2d98036f31e9ac0c6c4d125d74180c592d5c6c2 | 1,782 | py | Python | functions/getTcxData.py | TomBolton/aeroCode | 7e26ffb295cb76367a57993420fb93f976df9199 | [
"MIT"
] | 1 | 2016-12-18T18:36:47.000Z | 2016-12-18T18:36:47.000Z | functions/getTcxData.py | TomBolton/aeroCode | 7e26ffb295cb76367a57993420fb93f976df9199 | [
"MIT"
] | null | null | null | functions/getTcxData.py | TomBolton/aeroCode | 7e26ffb295cb76367a57993420fb93f976df9199 | [
"MIT"
] | null | null | null | # This script will extract the important ride data from a .tcx
# file specified by the user. The code below will then extract
# the speed and power values at each time step. The data recording
# of the Garmin MUST be set to one data point per second, as the
# analysis assumes a time-step of 1 second.
import lxml.etree... | 34.269231 | 100 | 0.615039 | # This script will extract the important ride data from a .tcx
# file specified by the user. The code below will then extract
# the speed and power values at each time step. The data recording
# of the Garmin MUST be set to one data point per second, as the
# analysis assumes a time-step of 1 second.
import lxml.etree... | 1,401 | 0 | 23 |
4b834fdd7c8b2ebcd71b69384ea4dad7f6c6b6c1 | 295 | py | Python | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/common/test/acceptance/pages/lms/__init__.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | 3 | 2021-12-15T04:58:18.000Z | 2022-02-06T12:15:37.000Z | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/common/test/acceptance/pages/lms/__init__.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | null | null | null | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/common/test/acceptance/pages/lms/__init__.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | 1 | 2019-01-02T14:38:50.000Z | 2019-01-02T14:38:50.000Z | """
Package of lms page objects for acceptance tests
"""
import os
# Get the URL of the instance under test
HOSTNAME = os.environ.get('BOK_CHOY_HOSTNAME', 'localhost')
LMS_PORT = os.environ.get('BOK_CHOY_LMS_PORT', 8003)
BASE_URL = os.environ.get('test_url', f'http://{HOSTNAME}:{LMS_PORT}')
| 24.583333 | 70 | 0.732203 | """
Package of lms page objects for acceptance tests
"""
import os
# Get the URL of the instance under test
HOSTNAME = os.environ.get('BOK_CHOY_HOSTNAME', 'localhost')
LMS_PORT = os.environ.get('BOK_CHOY_LMS_PORT', 8003)
BASE_URL = os.environ.get('test_url', f'http://{HOSTNAME}:{LMS_PORT}')
| 0 | 0 | 0 |
d1cf3c14f61b807c9522bcfdd5c5441669891163 | 622 | py | Python | web/ml/admin.py | MTES-MCT/biocarburants | ff084916e18cdbdc41400f36fa6cc76a5e05900e | [
"MIT"
] | null | null | null | web/ml/admin.py | MTES-MCT/biocarburants | ff084916e18cdbdc41400f36fa6cc76a5e05900e | [
"MIT"
] | 1 | 2020-02-17T11:01:03.000Z | 2020-02-17T11:01:03.000Z | web/ml/admin.py | MTES-MCT/biocarburants | ff084916e18cdbdc41400f36fa6cc76a5e05900e | [
"MIT"
] | null | null | null | from django.contrib import admin
# Register your models here.
from ml.models import EECStats, EPStats, ETDStats
@admin.register(EECStats)
@admin.register(EPStats)
@admin.register(ETDStats)
| 34.555556 | 123 | 0.737942 | from django.contrib import admin
# Register your models here.
from ml.models import EECStats, EPStats, ETDStats
@admin.register(EECStats)
class EECStatsAdmin(admin.ModelAdmin):
list_display = ('feedstock', 'origin', 'nb_lots', 'default_value', 'stddev', 'average')
list_filter = ('feedstock', 'origin',)
@admi... | 0 | 359 | 66 |
f8bb05792786b247bfb57d1e945a780db3af525b | 2,816 | py | Python | leetcode/Depth First Search & Backtracking/112. Path Sum.py | yanshengjia/algorithm | 0608d286be9c93d51768d47f21e569c6b0be9cda | [
"MIT"
] | 23 | 2019-08-02T12:02:47.000Z | 2022-03-09T15:24:16.000Z | leetcode/Depth First Search & Backtracking/112. Path Sum.py | yanshengjia/algorithm | 0608d286be9c93d51768d47f21e569c6b0be9cda | [
"MIT"
] | null | null | null | leetcode/Depth First Search & Backtracking/112. Path Sum.py | yanshengjia/algorithm | 0608d286be9c93d51768d47f21e569c6b0be9cda | [
"MIT"
] | 21 | 2019-12-22T04:47:32.000Z | 2021-09-12T14:29:35.000Z | """
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.
Note: A leaf is a node with no children.
Example:
Given the below binary tree and sum = 22,
5
/ \
4 8
/ / \
11 13 4
/ \ \
7 2 ... | 36.571429 | 443 | 0.615767 | """
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.
Note: A leaf is a node with no children.
Example:
Given the below binary tree and sum = 22,
5
/ \
4 8
/ / \
11 13 4
/ \ \
7 2 ... | 426 | 577 | 70 |
b1e550d7831a4be263bbb48382a1b7866b34b3ed | 694 | py | Python | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GLX/MESA/pixmap_colormap.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GLX/MESA/pixmap_colormap.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GLX/MESA/pixmap_colormap.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GLX import _types as _cs
# End users want this...
from OpenGL.raw.GLX._types import *
from OpenGL.raw.GLX import _errors
from OpenGL.constant import Constant as _C
imp... | 38.555556 | 120 | 0.783862 | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GLX import _types as _cs
# End users want this...
from OpenGL.raw.GLX._types import *
from OpenGL.raw.GLX import _errors
from OpenGL.constant import Constant as _C
imp... | 153 | 0 | 46 |
64e6de1504c2c09f42075f8ff35b9b1da282039e | 7,215 | py | Python | models/agents.py | michchr/HybridControlPy | 75d64810956fade5360f18b81332a781b31eebf9 | [
"MIT"
] | 1 | 2020-05-16T07:10:51.000Z | 2020-05-16T07:10:51.000Z | models/agents.py | michchr/HybridControlPy | 75d64810956fade5360f18b81332a781b31eebf9 | [
"MIT"
] | null | null | null | models/agents.py | michchr/HybridControlPy | 75d64810956fade5360f18b81332a781b31eebf9 | [
"MIT"
] | 1 | 2022-02-10T03:15:28.000Z | 2022-02-10T03:15:28.000Z | import bisect
from collections import OrderedDict
from reprlib import recursive_repr as _recursive_repr
# import pandas as pd
# pd.set_option('mode.chained_assignment', 'raise')
from controllers.mpc_controller import MpcController
from controllers.controller_base import ControllerBase
from structdict import StructDic... | 37.774869 | 120 | 0.691892 | import bisect
from collections import OrderedDict
from reprlib import recursive_repr as _recursive_repr
# import pandas as pd
# pd.set_option('mode.chained_assignment', 'raise')
from controllers.mpc_controller import MpcController
from controllers.controller_base import ControllerBase
from structdict import StructDic... | 5,385 | 1,215 | 69 |
e7c5b2a3eb3df4f97e0326f7ff5cf6ac5fce2de0 | 4,208 | py | Python | test/test_invoke_saving_pot.py | punica-box/saving-pot-box | 8824e3621b21a8e06ac398c29e7ec07ac1442d1f | [
"MIT"
] | 1 | 2018-11-17T10:37:38.000Z | 2018-11-17T10:37:38.000Z | test/test_invoke_saving_pot.py | NashMiao/saving-pot-box | 0ea7b0ee4be8aadf069faacf1d862d7412d5b4da | [
"MIT"
] | null | null | null | test/test_invoke_saving_pot.py | NashMiao/saving-pot-box | 0ea7b0ee4be8aadf069faacf1d862d7412d5b4da | [
"MIT"
] | 1 | 2018-11-10T15:56:58.000Z | 2018-11-10T15:56:58.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import binascii
import time
import unittest
from unittest.mock import patch
from ontology.ont_sdk import OntologySdk
from ontology.smart_contract.neo_contract.abi.abi_function import AbiFunction
from ontology.smart_contract.neo_contract.abi.abi_info import AbiInfo
from on... | 38.605505 | 89 | 0.73788 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import binascii
import time
import unittest
from unittest.mock import patch
from ontology.ont_sdk import OntologySdk
from ontology.smart_contract.neo_contract.abi.abi_function import AbiFunction
from ontology.smart_contract.neo_contract.abi.abi_info import AbiInfo
from on... | 2,833 | 24 | 319 |
3819d955d228cdd08ec15658407df47f685a3639 | 784 | py | Python | config.py | apython1998/porchfest_radio | d120578e90c99606d59868adbf19a2e2d3775dc9 | [
"MIT"
] | null | null | null | config.py | apython1998/porchfest_radio | d120578e90c99606d59868adbf19a2e2d3775dc9 | [
"MIT"
] | 1 | 2021-04-30T20:44:10.000Z | 2021-04-30T20:44:10.000Z | config.py | apython1998/porchfest_radio | d120578e90c99606d59868adbf19a2e2d3775dc9 | [
"MIT"
] | null | null | null | import os
from dotenv import load_dotenv
basedir = os.path.abspath(os.path.dirname(__file__))
load_dotenv(os.path.join(basedir, '.env'))
| 39.2 | 71 | 0.701531 | import os
from dotenv import load_dotenv
basedir = os.path.abspath(os.path.dirname(__file__))
load_dotenv(os.path.join(basedir, '.env'))
class Config(object):
SECRET_KEY = os.environ.get('SECRET_KEY') or 'you-will-never-guess'
MONGODB_SETTINGS = {
'db': 'porchfest_radio',
'host': 'mongodb://lo... | 0 | 623 | 23 |
f5c5906f366de46db049d2907d3e8017997f8386 | 619 | py | Python | src/main/python/leetcode-python/easy/400.Nth Digit.py | sonymoon/algorithm | cc2a9e0125fc64bdbf6549034bad6482d2027ea2 | [
"Apache-2.0"
] | null | null | null | src/main/python/leetcode-python/easy/400.Nth Digit.py | sonymoon/algorithm | cc2a9e0125fc64bdbf6549034bad6482d2027ea2 | [
"Apache-2.0"
] | null | null | null | src/main/python/leetcode-python/easy/400.Nth Digit.py | sonymoon/algorithm | cc2a9e0125fc64bdbf6549034bad6482d2027ea2 | [
"Apache-2.0"
] | null | null | null |
print(Solution().findNthDigit(194))
| 24.76 | 65 | 0.434572 | class Solution:
def findNthDigit(self, n):
"""
:type n: int
:rtype: int
"""
if n < 10:
return n
maxBits = 1
for i in range(1, 11):
numberInbitsI = (10 ** i - 10 ** (i - 1)) * i
if n <= numberInbitsI:
maxBits ... | 0 | 559 | 22 |
8064cb779b30bc7cc41fa4ed8c9047964653750a | 5,132 | py | Python | python/bridge.py | bmilde/ambientsearch | 74bf83a313e19da54a4e44158063041f981424c9 | [
"Apache-2.0"
] | 20 | 2016-04-30T11:24:45.000Z | 2021-11-09T10:39:25.000Z | python/bridge.py | bmilde/ambientsearch | 74bf83a313e19da54a4e44158063041f981424c9 | [
"Apache-2.0"
] | 1 | 2020-09-23T13:36:58.000Z | 2020-09-23T13:36:58.000Z | python/bridge.py | bmilde/ambientsearch | 74bf83a313e19da54a4e44158063041f981424c9 | [
"Apache-2.0"
] | 8 | 2015-10-07T13:40:36.000Z | 2019-08-07T06:45:24.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Benjamin Milde'
import requests
import json
import redis
import re
from timer import Timer
red = redis.StrictRedis()
#Todo: refactor. This has been mved to the relevant event generator
#Abstracts away the details of communicating with the ambient server
... | 43.863248 | 211 | 0.67537 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Benjamin Milde'
import requests
import json
import redis
import re
from timer import Timer
red = redis.StrictRedis()
#Todo: refactor. This has been mved to the relevant event generator
def idFromTitle(title):
return re.sub(r'[^\w]', '_', title.replace(... | 4,147 | 6 | 595 |
e5971ec81aae8b6929e0ae0e93757b73ff60b49f | 5,052 | py | Python | data_code/image_scraping.py | natashanorsker/fagprojekt | ef9a8cc2128c43d891c8a7a47e14916af2b9c602 | [
"MIT"
] | 1 | 2021-02-15T08:08:38.000Z | 2021-02-15T08:08:38.000Z | data_code/image_scraping.py | natashanorsker/fagprojekt | ef9a8cc2128c43d891c8a7a47e14916af2b9c602 | [
"MIT"
] | 3 | 2021-02-24T10:43:41.000Z | 2021-06-21T12:54:51.000Z | data_code/image_scraping.py | natashanorsker/fagprojekt | ef9a8cc2128c43d891c8a7a47e14916af2b9c602 | [
"MIT"
] | 1 | 2021-02-15T10:50:19.000Z | 2021-02-15T10:50:19.000Z | # imports
import requests
import json
from bs4 import BeautifulSoup
from tqdm import tqdm
import random
from utilities import dict_from_json
#websites: (these are the websites with the same format as UK)
#does not work:
#'https://us.pandora.net/en/jewelry/?start={}&sz=36&format=page-element''
websites = ['ht... | 45.513514 | 207 | 0.617973 | # imports
import requests
import json
from bs4 import BeautifulSoup
from tqdm import tqdm
import random
from utilities import dict_from_json
#websites: (these are the websites with the same format as UK)
#does not work:
#'https://us.pandora.net/en/jewelry/?start={}&sz=36&format=page-element''
websites = ['ht... | 2,435 | 0 | 23 |
2dffac327b451073edbc101c6a98c989c4acd12b | 7,900 | py | Python | AnalyzeLazyTime.py | pirtim/complex_networks_sim | f669c83439d9386d1f4e33bcb60f16f0dac7278d | [
"MIT"
] | null | null | null | AnalyzeLazyTime.py | pirtim/complex_networks_sim | f669c83439d9386d1f4e33bcb60f16f0dac7278d | [
"MIT"
] | null | null | null | AnalyzeLazyTime.py | pirtim/complex_networks_sim | f669c83439d9386d1f4e33bcb60f16f0dac7278d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import division #~ Domysle dzielenie int jako liczb float
# from igraph import * #~ Niepotrzebne
import random #~ Niepotrzebne
import matplotlib
# matplotlib.use('Agg')
import matplotlib.pyplot as plt #~ Do wykresow
from matplotlib import rc
import time ... | 42.934783 | 139 | 0.630759 | # -*- coding: utf-8 -*-
from __future__ import division #~ Domysle dzielenie int jako liczb float
# from igraph import * #~ Niepotrzebne
import random #~ Niepotrzebne
import matplotlib
# matplotlib.use('Agg')
import matplotlib.pyplot as plt #~ Do wykresow
from matplotlib import rc
import time ... | 6,187 | 0 | 212 |
3406049335d99d644917125e8b716c8c4bbe412b | 4,174 | py | Python | tic-tac-toe.py | RuTh-git/Tic-tac-toe-project | 8a7f7720b91ca7f519c5fd66925ef154aa938142 | [
"MIT"
] | null | null | null | tic-tac-toe.py | RuTh-git/Tic-tac-toe-project | 8a7f7720b91ca7f519c5fd66925ef154aa938142 | [
"MIT"
] | null | null | null | tic-tac-toe.py | RuTh-git/Tic-tac-toe-project | 8a7f7720b91ca7f519c5fd66925ef154aa938142 | [
"MIT"
] | null | null | null | # -------Global Variables---------
# Game board
board =["-","-","-",
"-","-","-",
"-","-","-",]
# If game is still going
game_still_going = True
# Who won? Or tie?
winner = None
# Whos turn is it
current_player = "X"
# Display board
# Play a game of tic tac toe
# Handle a single turn of an arb... | 20.766169 | 74 | 0.626977 | # -------Global Variables---------
# Game board
board =["-","-","-",
"-","-","-",
"-","-","-",]
# If game is still going
game_still_going = True
# Who won? Or tie?
winner = None
# Whos turn is it
current_player = "X"
# Display board
def display_board():
print("\n")
print(board[0] + " | " + boa... | 3,449 | 0 | 227 |
8c4cc89a3ae7d346b023dc93a3ae432c4760b998 | 1,560 | py | Python | preprocessing/audio_download/helperfiles/audio_download.py | sereini/SpeechSeparationModel | ea44c845762112f3bc2e5e54c5530e6fd429464f | [
"MIT"
] | 3 | 2019-12-05T10:22:19.000Z | 2021-11-08T12:19:54.000Z | preprocessing/audio_download/helperfiles/audio_download.py | sereini/SpeechSeparationModel | ea44c845762112f3bc2e5e54c5530e6fd429464f | [
"MIT"
] | null | null | null | preprocessing/audio_download/helperfiles/audio_download.py | sereini/SpeechSeparationModel | ea44c845762112f3bc2e5e54c5530e6fd429464f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Jun 25 17:34:23 2019
@author: chalbeisen
This program is to download audios. The required arguments are set by the
powershell script "Run-audio_download.ps1".
"""
from LookingToListen_Audio_clean import Audio
import argparse
import sys
'''
-----------------... | 31.836735 | 79 | 0.525 | # -*- coding: utf-8 -*-
"""
Created on Tue Jun 25 17:34:23 2019
@author: chalbeisen
This program is to download audios. The required arguments are set by the
powershell script "Run-audio_download.ps1".
"""
from LookingToListen_Audio_clean import Audio
import argparse
import sys
'''
-----------------... | 508 | 0 | 58 |
897df636f8322f5671a5d204f36d6950b78f524e | 4,566 | py | Python | ex_simulation/mnist_based/cd_interp_nmf.py | csinva/transformation-importance | 256ebdb7c05bcc34c8f8bdbbdd0a09dc3585ea0e | [
"MIT"
] | 6 | 2020-03-05T14:44:09.000Z | 2021-12-14T12:28:24.000Z | ex_simulation/mnist_based/cd_interp_nmf.py | csinva/transformation-importance | 256ebdb7c05bcc34c8f8bdbbdd0a09dc3585ea0e | [
"MIT"
] | null | null | null | ex_simulation/mnist_based/cd_interp_nmf.py | csinva/transformation-importance | 256ebdb7c05bcc34c8f8bdbbdd0a09dc3585ea0e | [
"MIT"
] | 2 | 2020-04-23T19:29:38.000Z | 2021-07-12T19:45:55.000Z | import numpy as np
import matplotlib.pyplot as plt
import torch
import random
device = 'cuda' if torch.cuda.is_available() else 'cpu'
from scipy.ndimage import gaussian_filter
import sys
from tqdm import tqdm
from functools import partial
import acd
from copy import deepcopy
sys.path.append('../..')
sys.path.append('..... | 33.328467 | 118 | 0.669295 | import numpy as np
import matplotlib.pyplot as plt
import torch
import random
device = 'cuda' if torch.cuda.is_available() else 'cpu'
from scipy.ndimage import gaussian_filter
import sys
from tqdm import tqdm
from functools import partial
import acd
from copy import deepcopy
sys.path.append('../..')
sys.path.append('..... | 0 | 0 | 0 |
35d38aa3f568c9b1eb9c35fb859a316447af885e | 1,050 | py | Python | src/api/tests.py | cuappdev/scoop-backend | 4bfb2494598831e10bdeede2243061f7ddee1b43 | [
"MIT"
] | null | null | null | src/api/tests.py | cuappdev/scoop-backend | 4bfb2494598831e10bdeede2243061f7ddee1b43 | [
"MIT"
] | 2 | 2022-03-14T22:55:22.000Z | 2022-03-21T18:13:55.000Z | src/api/tests.py | cuappdev/rideshare-backend | 4bfb2494598831e10bdeede2243061f7ddee1b43 | [
"MIT"
] | null | null | null | import json
from django.test import TestCase
from django.urls import reverse
from rest_framework.test import APIClient
from .constants import TEST_EMAIL
from .constants import TEST_FIRSTNAME
from .constants import TEST_LASTNAME
| 27.631579 | 80 | 0.667619 | import json
from django.test import TestCase
from django.urls import reverse
from rest_framework.test import APIClient
from .constants import TEST_EMAIL
from .constants import TEST_FIRSTNAME
from .constants import TEST_LASTNAME
class TestAuthenticate(TestCase):
AUTHENTICATE_URL = reverse("authenticate")
FIR... | 29 | 767 | 23 |
6b127412effc26232fb45df404dd75fcf5cc85f7 | 25,037 | py | Python | CyberTron5000/cogs/fun.py | niztg/CyberTron5000 | 6b93305ef26e022063bffa8620b53076ba5948f7 | [
"MIT"
] | 20 | 2020-06-20T20:26:33.000Z | 2021-01-12T20:47:52.000Z | CyberTron5000/cogs/fun.py | niztg/CyberTron5000 | 6b93305ef26e022063bffa8620b53076ba5948f7 | [
"MIT"
] | 1,005 | 2020-07-09T18:27:17.000Z | 2020-07-30T20:41:33.000Z | CyberTron5000/cogs/fun.py | niztg/CyberTron5000 | 6b93305ef26e022063bffa8620b53076ba5948f7 | [
"MIT"
] | 7 | 2020-07-09T18:23:24.000Z | 2020-11-21T20:47:03.000Z | import json
import random
import string
from asyncio import TimeoutError
from datetime import datetime as dt
from io import BytesIO
from time import time
import discord
from PyDictionary import PyDictionary as dictionary
from discord.ext import commands, flags
from humanize import naturaltime as nt
from jikanpy import... | 45.030576 | 232 | 0.591724 | import json
import random
import string
from asyncio import TimeoutError
from datetime import datetime as dt
from io import BytesIO
from time import time
import discord
from PyDictionary import PyDictionary as dictionary
from discord.ext import commands, flags
from humanize import naturaltime as nt
from jikanpy import... | 6,035 | 0 | 575 |
aba5777a4c926a5861081c3fc23ee89efd72f0ec | 369 | py | Python | LinkStation01/linkstation.py | userSoni/LinkStation_Nord | 302ecbe5f817e8130863d9a78a7061da6a91ab8a | [
"MIT"
] | null | null | null | LinkStation01/linkstation.py | userSoni/LinkStation_Nord | 302ecbe5f817e8130863d9a78a7061da6a91ab8a | [
"MIT"
] | null | null | null | LinkStation01/linkstation.py | userSoni/LinkStation_Nord | 302ecbe5f817e8130863d9a78a7061da6a91ab8a | [
"MIT"
] | null | null | null | from point import Point | 21.705882 | 45 | 0.520325 | from point import Point
class LinkStation(Point):
def __init__(self, x, y, reach):
super().__init__(x, y)
self.reach = reach
def get_power(self, other):
distance = super().__add__(other)
if distance > self.reach:
return(self.reach -... | 259 | 4 | 83 |
7fec8510d8834d53c7b7fbb66f1d96b267c28dfc | 1,764 | py | Python | PLM/cores/base/BaseProfile.py | vtta2008/pipelineTool | 2431d2fc987e3b31f2a6a63427fee456fa0765a0 | [
"Apache-2.0"
] | 7 | 2017-12-22T02:49:58.000Z | 2018-05-09T05:29:06.000Z | PLM/cores/base/BaseProfile.py | vtta2008/pipelineTool | 2431d2fc987e3b31f2a6a63427fee456fa0765a0 | [
"Apache-2.0"
] | null | null | null | PLM/cores/base/BaseProfile.py | vtta2008/pipelineTool | 2431d2fc987e3b31f2a6a63427fee456fa0765a0 | [
"Apache-2.0"
] | 3 | 2019-03-11T21:54:52.000Z | 2019-11-25T11:23:17.000Z | # -*- coding: utf-8 -*-
"""
Script Name:
Author: Do Trinh/Jimmy - 3D artist.
Description:
"""
# -------------------------------------------------------------------------------------------------------------
""" Import """
from pyPLM.damg import DAMGDICT
# ------------------------------------------------------... | 20.045455 | 111 | 0.452381 | # -*- coding: utf-8 -*-
"""
Script Name:
Author: Do Trinh/Jimmy - 3D artist.
Description:
"""
# -------------------------------------------------------------------------------------------------------------
""" Import """
from pyPLM.damg import DAMGDICT
class BaseProfile(DAMGDICT):
key ... | 472 | 803 | 23 |
7ac6e00808fd150fa05e6e5250a60150d5b436c5 | 538 | py | Python | test/unit/test_dealer.py | fedden/pluribus | 73fb394b26623c897459ffa3e66d7a5cb47e9962 | [
"MIT"
] | 2 | 2020-01-12T07:59:56.000Z | 2020-01-13T10:04:26.000Z | test/unit/test_dealer.py | fedden/pluribus | 73fb394b26623c897459ffa3e66d7a5cb47e9962 | [
"MIT"
] | null | null | null | test/unit/test_dealer.py | fedden/pluribus | 73fb394b26623c897459ffa3e66d7a5cb47e9962 | [
"MIT"
] | null | null | null | from poker_ai.poker.dealer import Dealer
from poker_ai.poker.card import Card
| 33.625 | 54 | 0.67658 | from poker_ai.poker.dealer import Dealer
from poker_ai.poker.card import Card
def test_dealer_1():
include_ranks = [10, 11, 12, 13, 14]
dealer = Dealer(include_ranks=include_ranks)
deck_size = len(dealer.deck._cards_in_deck)
assert deck_size == len(include_ranks * 4)
for i in range(1, deck_size + ... | 436 | 0 | 23 |
63f49a94d2256bfdae63b7d1a67ab338901cf892 | 7,117 | py | Python | minigame1/Minigame1.py | Tdallau/HRO_project2_minigames | 7fdecaa942d1a05d2cd451fd7f5d47e51c571c42 | [
"MIT"
] | null | null | null | minigame1/Minigame1.py | Tdallau/HRO_project2_minigames | 7fdecaa942d1a05d2cd451fd7f5d47e51c571c42 | [
"MIT"
] | null | null | null | minigame1/Minigame1.py | Tdallau/HRO_project2_minigames | 7fdecaa942d1a05d2cd451fd7f5d47e51c571c42 | [
"MIT"
] | null | null | null | import pygame
import sys
import os
import csv
import random
from pygame import *
from minigame1.Player import *
from minigame1.Mobs import *
from minigame1.Camera import *
from minigame1.KeyBlock import *
from minigame1.PilarBlock import *
from minigame1.Text import *
from minigame1.HighScore import *
from pprint impor... | 31.772321 | 147 | 0.529156 | import pygame
import sys
import os
import csv
import random
from pygame import *
from minigame1.Player import *
from minigame1.Mobs import *
from minigame1.Camera import *
from minigame1.KeyBlock import *
from minigame1.PilarBlock import *
from minigame1.Text import *
from minigame1.HighScore import *
from pprint impor... | 6,732 | 0 | 46 |
60f526518d09f8565abde81e7e957b5c348fcd01 | 5,014 | py | Python | third_party/blink/tools/blinkpy/w3c/test_copier_unittest.py | sarang-apps/darshan_browser | 173649bb8a7c656dc60784d19e7bb73e07c20daa | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | third_party/blink/tools/blinkpy/w3c/test_copier_unittest.py | sarang-apps/darshan_browser | 173649bb8a7c656dc60784d19e7bb73e07c20daa | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | third_party/blink/tools/blinkpy/w3c/test_copier_unittest.py | sarang-apps/darshan_browser | 173649bb8a7c656dc60784d19e7bb73e07c20daa | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | # Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
#
# 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 con... | 39.793651 | 90 | 0.631432 | # Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
#
# 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 con... | 2,747 | 17 | 157 |
d5386382d1006c88589c40562d15a92314c4d07c | 1,106 | py | Python | backend/paperchase/manage/users.py | dedalusj/PaperChase | 728cd2f742275b12223d91613275358fb4a92feb | [
"MIT"
] | 3 | 2015-02-13T02:42:39.000Z | 2016-11-22T08:03:45.000Z | backend/paperchase/manage/users.py | dedalusj/PaperChase | 728cd2f742275b12223d91613275358fb4a92feb | [
"MIT"
] | null | null | null | backend/paperchase/manage/users.py | dedalusj/PaperChase | 728cd2f742275b12223d91613275358fb4a92feb | [
"MIT"
] | 1 | 2020-10-10T08:35:16.000Z | 2020-10-10T08:35:16.000Z | # -*- coding: utf-8 -*-
"""
paperchase.manage.journals
~~~~~~~~~~~~~~~~~~~~~
jorunals management commands
"""
import datetime
from flask.ext.script import Command, prompt, prompt_pass
from werkzeug.datastructures import MultiDict
from ..services import users | 29.891892 | 166 | 0.631103 | # -*- coding: utf-8 -*-
"""
paperchase.manage.journals
~~~~~~~~~~~~~~~~~~~~~
jorunals management commands
"""
import datetime
from flask.ext.script import Command, prompt, prompt_pass
from werkzeug.datastructures import MultiDict
from ..services import users
class CreateUser(Command):
def run(self)... | 723 | 10 | 100 |
096913bfd7f5ce438837ebc5ce70ac71e4b5cab7 | 817 | py | Python | simpleotp/__init__.py | soumilrao/simple-otp | b1b5865850902f2b3e7b46e2205525daacb69fb4 | [
"MIT"
] | null | null | null | simpleotp/__init__.py | soumilrao/simple-otp | b1b5865850902f2b3e7b46e2205525daacb69fb4 | [
"MIT"
] | null | null | null | simpleotp/__init__.py | soumilrao/simple-otp | b1b5865850902f2b3e7b46e2205525daacb69fb4 | [
"MIT"
] | 2 | 2020-07-03T03:47:11.000Z | 2022-02-22T07:39:09.000Z | """Top-level package for simple-otp."""
__author__ = """Kshitij Nagvekar"""
__email__ = 'kshitij.nagvekar@workindia.in'
__version__ = '0.1.0'
try:
from secrets import SystemRandom
except ImportError:
from random import SystemRandom
from typing import Sequence
from .otp import OTP
random = SystemRandom()
d... | 20.948718 | 70 | 0.673195 | """Top-level package for simple-otp."""
__author__ = """Kshitij Nagvekar"""
__email__ = 'kshitij.nagvekar@workindia.in'
__version__ = '0.1.0'
try:
from secrets import SystemRandom
except ImportError:
from random import SystemRandom
from typing import Sequence
from .otp import OTP
random = SystemRandom()
d... | 0 | 0 | 0 |
6796c13cf7475026c9ef081da79d73b79b3ed231 | 1,777 | py | Python | cases/caseFoamEx/Cases/nEquivalentParticles_06/maxRadialWeightingFactor_04/graphCaseValidation.py | andytorrestb/rarefiedPlume | c09234c701c395d16519d8a361eae17540711530 | [
"MIT"
] | null | null | null | cases/caseFoamEx/Cases/nEquivalentParticles_06/maxRadialWeightingFactor_04/graphCaseValidation.py | andytorrestb/rarefiedPlume | c09234c701c395d16519d8a361eae17540711530 | [
"MIT"
] | null | null | null | cases/caseFoamEx/Cases/nEquivalentParticles_06/maxRadialWeightingFactor_04/graphCaseValidation.py | andytorrestb/rarefiedPlume | c09234c701c395d16519d8a361eae17540711530 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
# Find path for cases
curr_dir_path = os.path.dirname(os.path.realpath(__file__))
# print(curr_dir_path)
# cases = os.listdir(curr_dir_path + '/Cases')
# pop = cases.index('baseCase')
# cases.pop(pop)
# Label graph with bold characters
f... | 26.522388 | 87 | 0.670793 | import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
# Find path for cases
curr_dir_path = os.path.dirname(os.path.realpath(__file__))
# print(curr_dir_path)
# cases = os.listdir(curr_dir_path + '/Cases')
# pop = cases.index('baseCase')
# cases.pop(pop)
# Label graph with bold characters
f... | 0 | 0 | 0 |
6d599e732315b98ff9361f50870da4ee3d6c72bc | 2,935 | py | Python | pointy/__init__.py | AlexLloyd0/pointy-mcpointface | 2c5f3edf14a1d3821933ba8daa3fd616366055a0 | [
"MIT"
] | 1 | 2017-11-22T15:12:39.000Z | 2017-11-22T15:12:39.000Z | pointy/__init__.py | AlexLloyd0/pointy-mcpointface | 2c5f3edf14a1d3821933ba8daa3fd616366055a0 | [
"MIT"
] | 3 | 2017-10-31T22:56:14.000Z | 2017-11-01T21:04:49.000Z | pointy/__init__.py | AlexLloyd0/pointy-mcpointface | 2c5f3edf14a1d3821933ba8daa3fd616366055a0 | [
"MIT"
] | null | null | null | import json
import logging
import os
from flask import Flask, request, jsonify
from pointy.api.add_points import add_points
from pointy.api.add_team import add_team
from pointy.api.add_user import add_user
from pointy.api.get_score import get_score
from pointy.api.get_scoreboard import get_scoreboard, get_scoreboard_... | 30.257732 | 113 | 0.687223 | import json
import logging
import os
from flask import Flask, request, jsonify
from pointy.api.add_points import add_points
from pointy.api.add_team import add_team
from pointy.api.add_user import add_user
from pointy.api.get_score import get_score
from pointy.api.get_scoreboard import get_scoreboard, get_scoreboard_... | 1,917 | 0 | 177 |
ca40a55c661538e7cdefeeb691b340aad696816b | 232 | py | Python | routines/__init__.py | meteostat/routines | 8867b96a3fcb254ebcc9623933a76dac44157b70 | [
"MIT"
] | 7 | 2020-07-02T09:49:06.000Z | 2021-05-24T11:46:00.000Z | routines/__init__.py | meteostat/routines | 8867b96a3fcb254ebcc9623933a76dac44157b70 | [
"MIT"
] | 16 | 2021-03-29T19:45:01.000Z | 2021-11-14T11:39:12.000Z | routines/__init__.py | meteostat/routines | 8867b96a3fcb254ebcc9623933a76dac44157b70 | [
"MIT"
] | 1 | 2021-04-06T20:58:42.000Z | 2021-04-06T20:58:42.000Z | """
█▀▄▀█ █▀▀ ▀█▀ █▀▀ █▀█ █▀ ▀█▀ ▄▀█ ▀█▀
█░▀░█ ██▄ ░█░ ██▄ █▄█ ▄█ ░█░ █▀█ ░█░
Import & export routines.
The code is licensed under the MIT license.
"""
__appname__ = 'routines'
__version__ = '0.0.1'
from .routine import Routine
| 16.571429 | 43 | 0.482759 | """
█▀▄▀█ █▀▀ ▀█▀ █▀▀ █▀█ █▀ ▀█▀ ▄▀█ ▀█▀
█░▀░█ ██▄ ░█░ ██▄ █▄█ ▄█ ░█░ █▀█ ░█░
Import & export routines.
The code is licensed under the MIT license.
"""
__appname__ = 'routines'
__version__ = '0.0.1'
from .routine import Routine
| 0 | 0 | 0 |
2208401669715ecc10e5a867adce34cacc632295 | 77 | py | Python | rocky.py | Gewery/Pathfinders | 1ced94f3768d829318ec53f5aa8eb57b7a84e9e2 | [
"MIT"
] | null | null | null | rocky.py | Gewery/Pathfinders | 1ced94f3768d829318ec53f5aa8eb57b7a84e9e2 | [
"MIT"
] | null | null | null | rocky.py | Gewery/Pathfinders | 1ced94f3768d829318ec53f5aa8eb57b7a84e9e2 | [
"MIT"
] | 1 | 2018-08-17T12:07:46.000Z | 2018-08-17T12:07:46.000Z | import random
| 15.4 | 32 | 0.662338 | import random
def move(info, ctx=None):
return random.randint(0, 3)
| 37 | 0 | 25 |
2d6b6eb80f38322fca3e11e158d98822aa0f5e99 | 1,678 | py | Python | moove.py | Sanchopanch/matrix | 16289a56688047f623b46de74f7f7f4380006d08 | [
"Apache-2.0"
] | null | null | null | moove.py | Sanchopanch/matrix | 16289a56688047f623b46de74f7f7f4380006d08 | [
"Apache-2.0"
] | null | null | null | moove.py | Sanchopanch/matrix | 16289a56688047f623b46de74f7f7f4380006d08 | [
"Apache-2.0"
] | null | null | null | import pickle
import os
from tkinter import *
import time
if __name__ == "__main__":
fileNameOfJob = 'mov_1.pkl'
if(not os.path.exists( fileNameOfJob)):
pass
with open(fileNameOfJob,'rb') as f:
currMoove =pickle.load(f)
print(' loaded moove with %i cadrs'%len(currMoove... | 27.064516 | 139 | 0.54112 | import pickle
import os
from tkinter import *
import time
class moove():
def __init__(self):
self.points = []
self.lines = []
self.pause = 0
if __name__ == "__main__":
fileNameOfJob = 'mov_1.pkl'
if(not os.path.exists( fileNameOfJob)):
pass
with op... | 73 | -7 | 52 |
a4fe50a6a59ef1524c840ac3e8ae35559b6538ac | 9,678 | py | Python | EDA/SRC/dashboard/app.py | PabloEduardoMartinezPicazo/Bootcamp-DataScience-2021 | 0fa5288aec5fb14e3796877882e4f1ddc5ad4aea | [
"MIT"
] | null | null | null | EDA/SRC/dashboard/app.py | PabloEduardoMartinezPicazo/Bootcamp-DataScience-2021 | 0fa5288aec5fb14e3796877882e4f1ddc5ad4aea | [
"MIT"
] | null | null | null | EDA/SRC/dashboard/app.py | PabloEduardoMartinezPicazo/Bootcamp-DataScience-2021 | 0fa5288aec5fb14e3796877882e4f1ddc5ad4aea | [
"MIT"
] | null | null | null | import re
import streamlit as st
import pandas as pd
import numpy as np
import altair as alt
from PIL import Image
import requests
import sys,os
pato = os.path.dirname
direccion=pato(pato(pato(__file__)))
sys.path.append(direccion)
from notebooks.Canada import df_canada
from notebooks.Canada_2 import df_canada1
from ... | 58.301205 | 281 | 0.678859 | import re
import streamlit as st
import pandas as pd
import numpy as np
import altair as alt
from PIL import Image
import requests
import sys,os
pato = os.path.dirname
direccion=pato(pato(pato(__file__)))
sys.path.append(direccion)
from notebooks.Canada import df_canada
from notebooks.Canada_2 import df_canada1
from ... | 0 | 0 | 0 |
f0e198f4326950fbb0c36cb549ee304c117f89ff | 2,917 | py | Python | address/views_api.py | YangWanjun/areaparking | b08bc9b8f8d5f602d823115263b9d040edb9f245 | [
"Apache-2.0"
] | 1 | 2018-08-02T04:00:44.000Z | 2018-08-02T04:00:44.000Z | address/views_api.py | YangWanjun/areaparking | b08bc9b8f8d5f602d823115263b9d040edb9f245 | [
"Apache-2.0"
] | null | null | null | address/views_api.py | YangWanjun/areaparking | b08bc9b8f8d5f602d823115263b9d040edb9f245 | [
"Apache-2.0"
] | null | null | null | from rest_framework import viewsets
from rest_framework.filters import SearchFilter
from rest_framework.response import Response
from . import biz, models, serializers
from parkinglot.models import ParkingLot
from utils.django_base import BaseApiPagination
| 33.918605 | 103 | 0.696606 | from rest_framework import viewsets
from rest_framework.filters import SearchFilter
from rest_framework.response import Response
from . import biz, models, serializers
from parkinglot.models import ParkingLot
from utils.django_base import BaseApiPagination
class PrefViewSet(viewsets.ModelViewSet):
queryset = mod... | 1,149 | 1,213 | 288 |
4626e516ccf59e42c9386b9d54dfa4f38e9c3b45 | 2,491 | py | Python | best_weights/trial2/CNN.py | misoyuri/ML_Project | b82d3573d8a365a2a8b034edf92d7aeda5abfd0f | [
"BSD-2-Clause"
] | null | null | null | best_weights/trial2/CNN.py | misoyuri/ML_Project | b82d3573d8a365a2a8b034edf92d7aeda5abfd0f | [
"BSD-2-Clause"
] | null | null | null | best_weights/trial2/CNN.py | misoyuri/ML_Project | b82d3573d8a365a2a8b034edf92d7aeda5abfd0f | [
"BSD-2-Clause"
] | null | null | null | class HelloCNN(nn.Module):
"""
Simple CNN Clssifier
"""
| 27.677778 | 46 | 0.415094 | class HelloCNN(nn.Module):
"""
Simple CNN Clssifier
"""
def __init__(self, num_classes=7):
super(HelloCNN, self).__init__()
self.conv1 = nn.Sequential(
nn.Conv2d(1, 48, 3, padding=1),
nn.ReLU(),
nn.Conv2d(48, 48, 3, padding=1),
nn.ReLU... | 2,342 | 0 | 61 |
b4d5f8b9de9168b54916b7b72cb30ed041002a0c | 3,382 | py | Python | src/research/three_phase/tests/vectorized_y_bus.py | mzy2240/GridCal | 0352f0e9ce09a9c037722bf2f2afc0a31ccd2880 | [
"BSD-3-Clause"
] | 284 | 2016-01-31T03:20:44.000Z | 2022-03-17T21:16:52.000Z | src/research/three_phase/tests/vectorized_y_bus.py | mzy2240/GridCal | 0352f0e9ce09a9c037722bf2f2afc0a31ccd2880 | [
"BSD-3-Clause"
] | 94 | 2016-01-14T13:37:40.000Z | 2022-03-28T03:13:56.000Z | src/research/three_phase/tests/vectorized_y_bus.py | mzy2240/GridCal | 0352f0e9ce09a9c037722bf2f2afc0a31ccd2880 | [
"BSD-3-Clause"
] | 84 | 2016-03-29T10:43:04.000Z | 2022-02-22T16:26:55.000Z |
from research.three_phase.Engine import *
from scipy.sparse import lil_matrix
np.set_printoptions(linewidth=100000)
def set_sub(A, cols, rows, sub_mat):
"""
Set sub-matrix in place into sparse matrix
:param A: Sparse matrix
:param cols: array of columns (size m)
:param rows: array of rows (size... | 29.929204 | 118 | 0.587522 |
from research.three_phase.Engine import *
from scipy.sparse import lil_matrix
np.set_printoptions(linewidth=100000)
def set_sub(A, cols, rows, sub_mat):
"""
Set sub-matrix in place into sparse matrix
:param A: Sparse matrix
:param cols: array of columns (size m)
:param rows: array of rows (size... | 0 | 0 | 0 |