hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f747b739b7a2b2b77392f3d67016b91cc73e4774 | 557 | py | Python | Challenges/InProgress/Stack Implementation_convertToPY3.py | smirecki/Coding_Challenges | 01e6ff2d780ab16cb3ca86fcc5859e4734a2cb52 | [
"MIT"
] | null | null | null | Challenges/InProgress/Stack Implementation_convertToPY3.py | smirecki/Coding_Challenges | 01e6ff2d780ab16cb3ca86fcc5859e4734a2cb52 | [
"MIT"
] | null | null | null | Challenges/InProgress/Stack Implementation_convertToPY3.py | smirecki/Coding_Challenges | 01e6ff2d780ab16cb3ca86fcc5859e4734a2cb52 | [
"MIT"
] | null | null | null | import sys
test_cases = open(sys.argv[1], 'r') # open file and read test file
for test in test_cases: # read one line at a time
test = test.split( ) # split the string into a list (space as the default delimiter and removing /n newlines)
test.reverse() # reverse the order of the list items
tes... | 55.7 | 116 | 0.660682 | import sys
test_cases = open(sys.argv[1], 'r')
for test in test_cases:
test = test.split( )
test.reverse()
test = test[::2]
test = ' '.join(test)
_cases.close() | true | true |
f747b860b2c5a8f0082a8e46266aa924e5fee0b7 | 26,486 | py | Python | salt/modules/heat.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | 1 | 2020-03-31T22:51:16.000Z | 2020-03-31T22:51:16.000Z | salt/modules/heat.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | null | null | null | salt/modules/heat.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-09-30T07:00:01.000Z | 2021-09-30T07:00:01.000Z | # -*- coding: utf-8 -*-
'''
Module for handling OpenStack Heat calls
.. versionadded:: 2017.7.0
:depends: - heatclient Python module
:configuration: This module is not usable until the user, password, tenant, and
auth URL are specified either in a pillar or in the minion's config file.
For example::
... | 30.304348 | 95 | 0.56679 |
from __future__ import absolute_import, print_function, unicode_literals
import time
import logging
from salt.exceptions import SaltInvocationError
from salt.ext import six
import salt.utils.files
import salt.utils.json
import salt.utils.stringutils
import salt.utils.versions
import salt.utils.yaml
HAS_HEAT = Fa... | true | true |
f747b8ca620ba188192fec14574e195eec9285f5 | 1,001 | py | Python | logger_util.py | DayongTong/MEAM517_Project_Git | c6debfb53e279339879b6c535e91bd5fbcd4ba79 | [
"MIT"
] | null | null | null | logger_util.py | DayongTong/MEAM517_Project_Git | c6debfb53e279339879b6c535e91bd5fbcd4ba79 | [
"MIT"
] | null | null | null | logger_util.py | DayongTong/MEAM517_Project_Git | c6debfb53e279339879b6c535e91bd5fbcd4ba79 | [
"MIT"
] | 1 | 2020-11-11T18:02:38.000Z | 2020-11-11T18:02:38.000Z | def logger_util(t_sol, x_sol, u_sol, tinit, xinit, uinit):
x_labels = ["r: ", "alpha: ", "beta: ",
"Vx: ", "Vy: ", "Vz: ",
"m: ", "phi: ", "psi: "]
u_labels = ["T: ", "w_phi: ", "w_psi: "]
with open("save_solution_variables.txt", mode='w') as F:
F.write("LOGGING S... | 34.517241 | 60 | 0.47952 | def logger_util(t_sol, x_sol, u_sol, tinit, xinit, uinit):
x_labels = ["r: ", "alpha: ", "beta: ",
"Vx: ", "Vy: ", "Vz: ",
"m: ", "phi: ", "psi: "]
u_labels = ["T: ", "w_phi: ", "w_psi: "]
with open("save_solution_variables.txt", mode='w') as F:
F.write("LOGGING S... | true | true |
f747b8d1c1877b874cf3d1d66dd54d28126e8573 | 2,405 | py | Python | pyod/test/test_stat_models.py | DrewNow/pyod | 4439904ce05e95c31dbeed22d34526f729eaad2b | [
"BSD-2-Clause"
] | 2 | 2021-05-13T01:24:25.000Z | 2021-11-08T09:23:04.000Z | pyod/test/test_stat_models.py | anisayari/pyod | 3b814b567ba8ea9ab8a64c97c24165df48c6e699 | [
"BSD-2-Clause"
] | null | null | null | pyod/test/test_stat_models.py | anisayari/pyod | 3b814b567ba8ea9ab8a64c97c24165df48c6e699 | [
"BSD-2-Clause"
] | 1 | 2020-01-15T09:29:54.000Z | 2020-01-15T09:29:54.000Z | # -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
import os
import sys
import unittest
from sklearn.utils.testing import assert_equal
# noinspection PyProtectedMember
from sklearn.utils.testing import assert_allclose
from sklearn.utils.testing import assert_raises
from skl... | 31.233766 | 79 | 0.621206 |
from __future__ import division
from __future__ import print_function
import os
import sys
import unittest
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_allclose
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_greater_equal
from skl... | true | true |
f747b94d4b0db28d90270c4b45eacf920f21d2e2 | 27,961 | py | Python | pony/orm/sqlbuilding.py | anirudh-ramesh/pony | b4d3da69d2fbd18c870db204d7de12a06e0b2328 | [
"Apache-2.0"
] | null | null | null | pony/orm/sqlbuilding.py | anirudh-ramesh/pony | b4d3da69d2fbd18c870db204d7de12a06e0b2328 | [
"Apache-2.0"
] | null | null | null | pony/orm/sqlbuilding.py | anirudh-ramesh/pony | b4d3da69d2fbd18c870db204d7de12a06e0b2328 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import, print_function, division
from pony.py23compat import PY2, izip, imap, itervalues, basestring, unicode, buffer, int_types
from operator import attrgetter
from decimal import Decimal
from datetime import date, datetime, timedelta
from binascii import hexlify
from pony import opti... | 43.826019 | 111 | 0.595758 | from __future__ import absolute_import, print_function, division
from pony.py23compat import PY2, izip, imap, itervalues, basestring, unicode, buffer, int_types
from operator import attrgetter
from decimal import Decimal
from datetime import date, datetime, timedelta
from binascii import hexlify
from pony import opti... | true | true |
f747ba1f888acd75d604a4769af966657b9e7176 | 4,246 | py | Python | train_parsingrcnn.py | JasonDu1993/ATEN | 74cb892d88f4d2f5ba5014336d61b6fa90dc250a | [
"MIT"
] | null | null | null | train_parsingrcnn.py | JasonDu1993/ATEN | 74cb892d88f4d2f5ba5014336d61b6fa90dc250a | [
"MIT"
] | null | null | null | train_parsingrcnn.py | JasonDu1993/ATEN | 74cb892d88f4d2f5ba5014336d61b6fa90dc250a | [
"MIT"
] | null | null | null | import os
import sys
from time import time
sys.path.insert(0, os.getcwd())
import tensorflow as tf
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
session = tf.Session(config=config)
from configs.vip import ParsingRCNNModelConfig
from configs.vip import VIPDa... | 32.914729 | 107 | 0.628827 | import os
import sys
from time import time
sys.path.insert(0, os.getcwd())
import tensorflow as tf
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
session = tf.Session(config=config)
from configs.vip import ParsingRCNNModelConfig
from configs.vip import VIPDa... | true | true |
f747ba29b18fc45a0eeb4327bd106d9e7190fcc0 | 4,287 | py | Python | rand/task_random.py | hkhpub/gp-voicemail | dd5a96380a67f7b9e2fdae08b7caaaec2fe70e68 | [
"MIT"
] | null | null | null | rand/task_random.py | hkhpub/gp-voicemail | dd5a96380a67f7b9e2fdae08b7caaaec2fe70e68 | [
"MIT"
] | null | null | null | rand/task_random.py | hkhpub/gp-voicemail | dd5a96380a67f7b9e2fdae08b7caaaec2fe70e68 | [
"MIT"
] | null | null | null | import numpy as np
from environment import POMDPEnvironment
from rand.random_controller import RandomController
class VoiceTask_random:
avg_rewards = []
def __init__(self, env_file, prior):
self.environment = POMDPEnvironment(env_file)
self.prior = self.belief = prior
self.next_acti... | 34.296 | 98 | 0.597621 | import numpy as np
from environment import POMDPEnvironment
from rand.random_controller import RandomController
class VoiceTask_random:
avg_rewards = []
def __init__(self, env_file, prior):
self.environment = POMDPEnvironment(env_file)
self.prior = self.belief = prior
self.next_acti... | false | true |
f747bac6efbe42e2ea3d1d195eebcc5275b5d013 | 17,461 | py | Python | PythonProjects/10-Sequences/src/m7_summary.py | much2mutch/csse120-public | 4f862a6deb7a5373fb5723fb2a23e4042e4d4157 | [
"MIT"
] | null | null | null | PythonProjects/10-Sequences/src/m7_summary.py | much2mutch/csse120-public | 4f862a6deb7a5373fb5723fb2a23e4042e4d4157 | [
"MIT"
] | null | null | null | PythonProjects/10-Sequences/src/m7_summary.py | much2mutch/csse120-public | 4f862a6deb7a5373fb5723fb2a23e4042e4d4157 | [
"MIT"
] | null | null | null | """
This module lets you practice two forms of the ACCUMULATOR pattern:
-- SUMMING
-- COUNTING
where the accumulation is done via ITERATING (i.e., looping)
through a SEQUENCE.
It also demonstrates the distinction between:
-- an INDEX of the sequence (e.g., -5 is at index 1 in [0, -5, 12, -6]) and
-- the item A... | 35.489837 | 79 | 0.573335 |
import testing_helper
import time
def main():
run_test_summary1a()
run_test_summary1c()
run_test_summary1c()
rint_expected_result_of_test([sequence], expected, test_results,
format_string)
actual = summary1b(sequence)
print_actual_result_of_test(expected, actu... | true | true |
f747bd9bc5b8f9d3c7ec0a36fa037a7b42c9c604 | 6,839 | py | Python | code/lufangxiao/__init__.py | xueruoyao/FCN-pytorch | a5019da3943f47fa4f7baed3640cdbfeae2d677e | [
"MIT"
] | 1 | 2021-12-20T07:20:25.000Z | 2021-12-20T07:20:25.000Z | code/lufangxiao/__init__.py | xueruoyao/FCN-pytorch | a5019da3943f47fa4f7baed3640cdbfeae2d677e | [
"MIT"
] | null | null | null | code/lufangxiao/__init__.py | xueruoyao/FCN-pytorch | a5019da3943f47fa4f7baed3640cdbfeae2d677e | [
"MIT"
] | null | null | null | from code.models.D_LinkNet import DLinkNet
from code.models.DeepLabv3plus import DeepLabV3Plus
from code.models.LinkNet import LinkNet
from code.models.ResUNet import ResUNet
from code.models.SegHRNet import SegHRNet
from code.models.SegHRNet_OCR import SegHRNet_OCR
from code.models.SegHR_LinkNet import SegHR_LinkNet
f... | 45.291391 | 212 | 0.592046 | from code.models.D_LinkNet import DLinkNet
from code.models.DeepLabv3plus import DeepLabV3Plus
from code.models.LinkNet import LinkNet
from code.models.ResUNet import ResUNet
from code.models.SegHRNet import SegHRNet
from code.models.SegHRNet_OCR import SegHRNet_OCR
from code.models.SegHR_LinkNet import SegHR_LinkNet
f... | true | true |
f747be60ec993ec9c126737f2edad04393542967 | 493 | py | Python | language/test.py | jhe8281/openSW | 6f3bc5bb34996616a6e862b48e5d164da12344a7 | [
"BSD-3-Clause"
] | 2 | 2019-01-16T02:03:41.000Z | 2019-03-07T04:43:08.000Z | language/test.py | jhe8281/openSW | 6f3bc5bb34996616a6e862b48e5d164da12344a7 | [
"BSD-3-Clause"
] | null | null | null | language/test.py | jhe8281/openSW | 6f3bc5bb34996616a6e862b48e5d164da12344a7 | [
"BSD-3-Clause"
] | null | null | null | import json
print('name : ', end = '')
b = input()
json_data = open('en-US.json', 'rt', encoding='utf-8').read()
a_json = json.loads(json_data)
json_data = open(str(b) + '.json', 'rt', encoding='utf-8').read()
b_json = json.loads(json_data)
for a_in in a_json:
if not a_in in b_json:
print(a_in + ' : ', ... | 25.947368 | 108 | 0.527383 | import json
print('name : ', end = '')
b = input()
json_data = open('en-US.json', 'rt', encoding='utf-8').read()
a_json = json.loads(json_data)
json_data = open(str(b) + '.json', 'rt', encoding='utf-8').read()
b_json = json.loads(json_data)
for a_in in a_json:
if not a_in in b_json:
print(a_in + ' : ', ... | true | true |
f747be80b5eb886d724e3f177af6c841ffd51fc2 | 1,583 | py | Python | setup.py | sullivancolin/hexpy | 37aeb39935c1ac3e8d776a44373bc02b0e753a4e | [
"MIT"
] | 7 | 2017-09-29T01:06:44.000Z | 2018-12-05T17:22:05.000Z | setup.py | sullivancolin/hexpy | 37aeb39935c1ac3e8d776a44373bc02b0e753a4e | [
"MIT"
] | 13 | 2018-06-27T14:28:59.000Z | 2020-04-03T01:38:49.000Z | setup.py | sullivancolin/hexpy | 37aeb39935c1ac3e8d776a44373bc02b0e753a4e | [
"MIT"
] | 8 | 2017-10-17T16:34:29.000Z | 2020-04-01T07:30:20.000Z | #!/usr/bin/env python
"""The setup script."""
from setuptools import find_packages, setup
requirements = [
"xlrd>=1.1.0",
"requests>=2.22.0",
"click>=7.0",
"click-help-colors>=0.5",
"pandas>=0.20.3",
"openpyxl>=2.4.8",
"pendulum>=1.3.2",
"pydantic>= 1.1",
"ftfy>=5.5.1",
]
setup_re... | 28.781818 | 77 | 0.638029 |
from setuptools import find_packages, setup
requirements = [
"xlrd>=1.1.0",
"requests>=2.22.0",
"click>=7.0",
"click-help-colors>=0.5",
"pandas>=0.20.3",
"openpyxl>=2.4.8",
"pendulum>=1.3.2",
"pydantic>= 1.1",
"ftfy>=5.5.1",
]
setup_requirements = ["pytest-runner", "setuptools>=3... | true | true |
f747bf113acbc3b196b90660bcc1d14ba4dc2e32 | 360 | py | Python | collect/spider/getpdf/pipelines.py | Thanatoz-1/Text-Technology | f07a4d9fcfb4a1297103917fa2db4a3d513bed9c | [
"Apache-2.0"
] | null | null | null | collect/spider/getpdf/pipelines.py | Thanatoz-1/Text-Technology | f07a4d9fcfb4a1297103917fa2db4a3d513bed9c | [
"Apache-2.0"
] | 20 | 2022-01-25T20:07:46.000Z | 2022-02-25T09:30:11.000Z | collect/spider/getpdf/pipelines.py | Thanatoz-1/Text-Technology | f07a4d9fcfb4a1297103917fa2db4a3d513bed9c | [
"Apache-2.0"
] | 1 | 2022-02-26T10:33:48.000Z | 2022-02-26T10:33:48.000Z | # Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
# useful for handling different item types with a single interface
from itemadapter import ItemAdapter
class GetpdfPipeline:
def process_item(s... | 25.714286 | 66 | 0.766667 |
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
# useful for handling different item types with a single interface
from itemadapter import ItemAdapter
class GetpdfPipeline:
def process_item(self, item, spider):
return item
| true | true |
f747bf4e12e7c7ba06ce780c9bd4d5e2e513f877 | 4,501 | py | Python | A Star Pathfinding.py | ihtasham42/a-star-pathfinding | 263702f5fe03f5fbff41f585f519c613154e8805 | [
"Unlicense"
] | null | null | null | A Star Pathfinding.py | ihtasham42/a-star-pathfinding | 263702f5fe03f5fbff41f585f519c613154e8805 | [
"Unlicense"
] | null | null | null | A Star Pathfinding.py | ihtasham42/a-star-pathfinding | 263702f5fe03f5fbff41f585f519c613154e8805 | [
"Unlicense"
] | null | null | null | import pygame, random, math, queue, pdb
pygame.init()
clock = pygame.time.Clock()
SCREEN_WIDTH = 800
COLUMNS = 100
ROWS = 100
CELL_WIDTH = 8
CELL_COLOURS = {
"empty" : (128, 128, 128),
"wall" : (0, 0, 0),
"start" : (0, 255, 0),
"goal" : (255, 0, 0),
"path" : (255, 255, 255),
... | 26.791667 | 83 | 0.576094 | import pygame, random, math, queue, pdb
pygame.init()
clock = pygame.time.Clock()
SCREEN_WIDTH = 800
COLUMNS = 100
ROWS = 100
CELL_WIDTH = 8
CELL_COLOURS = {
"empty" : (128, 128, 128),
"wall" : (0, 0, 0),
"start" : (0, 255, 0),
"goal" : (255, 0, 0),
"path" : (255, 255, 255),
... | true | true |
f747c220335e099b89e395fdd5654de51246ebf9 | 1,407 | py | Python | evaluation/tsne_analysis_baseline/test/test_grid.py | Leinadh/PeruvianImageGenerator | 9bf11125f4ea3090e217cf15866ec19ce944f9c6 | [
"Apache-2.0"
] | 3 | 2020-06-30T04:44:31.000Z | 2020-06-30T04:44:55.000Z | evaluation/tsne_analysis_baseline/test/test_grid.py | Leinadh/PeruvianImageGenerator | 9bf11125f4ea3090e217cf15866ec19ce944f9c6 | [
"Apache-2.0"
] | null | null | null | evaluation/tsne_analysis_baseline/test/test_grid.py | Leinadh/PeruvianImageGenerator | 9bf11125f4ea3090e217cf15866ec19ce944f9c6 | [
"Apache-2.0"
] | null | null | null | import os
import unittest
from gen_tsne import build_grid
ASSETS_DIR = os.path.join(os.path.dirname(__file__), "assets")
class TestGrid(unittest.TestCase):
def test_build(self):
paths = [os.path.join(ASSETS_DIR, "dataset"), os.path.join(ASSETS_DIR, "model_a"),
os.path.join(ASSETS_DIR, ... | 42.636364 | 119 | 0.636816 | import os
import unittest
from gen_tsne import build_grid
ASSETS_DIR = os.path.join(os.path.dirname(__file__), "assets")
class TestGrid(unittest.TestCase):
def test_build(self):
paths = [os.path.join(ASSETS_DIR, "dataset"), os.path.join(ASSETS_DIR, "model_a"),
os.path.join(ASSETS_DIR, ... | true | true |
f747c2c3495090f44d609becd744a4a2a2b5eed9 | 3,594 | py | Python | tests/star_wars_data.py | melvinkcx/graphql-core-next | b320331faf2fc2f4f1f6a1366f07109d1bdd44f1 | [
"MIT"
] | null | null | null | tests/star_wars_data.py | melvinkcx/graphql-core-next | b320331faf2fc2f4f1f6a1366f07109d1bdd44f1 | [
"MIT"
] | null | null | null | tests/star_wars_data.py | melvinkcx/graphql-core-next | b320331faf2fc2f4f1f6a1366f07109d1bdd44f1 | [
"MIT"
] | null | null | null | """This defines a basic set of data for our Star Wars Schema.
This data is hard coded for the sake of the demo, but you could imagine fetching this
data from a backend service rather than from hardcoded JSON objects in a more complex
demo.
"""
from typing import Collection, Iterator
__all__ = ["get_droid", "get_frie... | 25.671429 | 87 | 0.661658 |
from typing import Collection, Iterator
__all__ = ["get_droid", "get_friends", "get_hero", "get_human", "get_secret_backstory"]
class Character:
id: str
name: str
friends: Collection[str]
appearsIn: Collection[str]
class Human(Character):
type = "Human"
homePlanet: str
def __... | true | true |
f747c30ff0c0c1565b8639d9a272079caea9d452 | 1,909 | py | Python | orodja.py | benoucakar/analiza-podatkov---Najbolj-ih-10000-videoiger | 35ece3eb03b7f796bee48ec6bc568580d36e976b | [
"MIT"
] | 1 | 2020-12-24T23:19:58.000Z | 2020-12-24T23:19:58.000Z | orodja.py | benoucakar/Najboljse-videoigre-vseh-casov | 35ece3eb03b7f796bee48ec6bc568580d36e976b | [
"MIT"
] | null | null | null | orodja.py | benoucakar/Najboljse-videoigre-vseh-casov | 35ece3eb03b7f796bee48ec6bc568580d36e976b | [
"MIT"
] | null | null | null | # Prirejeno po datotekah iz predavanj in vaj.
import csv
import json
import os
import requests
default_headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36'}
# Prenos spletne strani
def url_v_html(url, mapa, ime_datotek... | 32.913793 | 157 | 0.688318 |
import csv
import json
import os
import requests
default_headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36'}
def url_v_html(url, mapa, ime_datoteke, headers=default_headers):
try:
page_content = request... | true | true |
f747c333c63e86db17020b033f19b010e4423d33 | 303 | py | Python | pydnb/__init__.py | tsabata/PyDNB | 19cc25ee8b7e95475f19eb6e6bb066f20782bb06 | [
"MIT"
] | 3 | 2018-10-03T20:30:32.000Z | 2020-10-27T16:49:21.000Z | pydnb/__init__.py | tsabata/PyDNB | 19cc25ee8b7e95475f19eb6e6bb066f20782bb06 | [
"MIT"
] | null | null | null | pydnb/__init__.py | tsabata/PyDNB | 19cc25ee8b7e95475f19eb6e6bb066f20782bb06 | [
"MIT"
] | null | null | null | import os.path
import re
with open(os.path.join(os.path.dirname(__file__), 'VERSION')) as f:
version_content = [line for line in f.readlines() if re.search(r'([\d.]+)',line)]
if len(version_content) != 1:
raise RuntimeError('Invalid format of VERSION file.')
__version__ = version_content[0]
| 27.545455 | 85 | 0.706271 | import os.path
import re
with open(os.path.join(os.path.dirname(__file__), 'VERSION')) as f:
version_content = [line for line in f.readlines() if re.search(r'([\d.]+)',line)]
if len(version_content) != 1:
raise RuntimeError('Invalid format of VERSION file.')
__version__ = version_content[0]
| true | true |
f747c43dd2301d2d61d582e8ab8b0488466235c8 | 4,356 | py | Python | website-backend/ava/jobs/models.py | kbladin/ava-capture | 2fc24f4a3712f721c3a229b499631e00697209a5 | [
"BSD-3-Clause"
] | null | null | null | website-backend/ava/jobs/models.py | kbladin/ava-capture | 2fc24f4a3712f721c3a229b499631e00697209a5 | [
"BSD-3-Clause"
] | null | null | null | website-backend/ava/jobs/models.py | kbladin/ava-capture | 2fc24f4a3712f721c3a229b499631e00697209a5 | [
"BSD-3-Clause"
] | null | null | null | #
# Copyright (c) 2017 Electronic Arts Inc. All Rights Reserved
#
from __future__ import unicode_literals
import datetime
from django.db import models
from django.utils import timezone
from model_utils.fields import MonitorField, StatusField
from model_utils.models import TimeStampedModel
from model_utils import C... | 37.551724 | 139 | 0.725207 |
from __future__ import unicode_literals
import datetime
from django.db import models
from django.utils import timezone
from model_utils.fields import MonitorField, StatusField
from model_utils.models import TimeStampedModel
from model_utils import Choices
from archive.models import Take, StaticScanAsset, Tracki... | true | true |
f747c47b77ee10ec42fa1e8006ca41b0425162c5 | 5,484 | py | Python | src/express-route-cross-connection/azext_expressroutecrossconnection/vendored_sdks/v2018_04_01/models/express_route_circuit_py3.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 207 | 2017-11-29T06:59:41.000Z | 2022-03-31T10:00:53.000Z | src/express-route-cross-connection/azext_expressroutecrossconnection/vendored_sdks/v2018_04_01/models/express_route_circuit_py3.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 4,061 | 2017-10-27T23:19:56.000Z | 2022-03-31T23:18:30.000Z | src/express-route-cross-connection/azext_expressroutecrossconnection/vendored_sdks/v2018_04_01/models/express_route_circuit_py3.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 802 | 2017-10-11T17:36:26.000Z | 2022-03-31T22:24:32.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 50.777778 | 405 | 0.692378 |
from .resource_py3 import Resource
class ExpressRouteCircuit(Resource):
_validation = {
'name': {'readonly': True},
'type': {'readonly': True},
'etag': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', ... | true | true |
f747c4d8a6bc6a057e8a2be91fba5d2dd7042f9f | 667 | py | Python | configs/alrp_loss/ap_loss_retinanet_r50_fpn_100e_coco500.py | kemaloksuz/aLRPLoss | 2cfaa8ec3150692cca8b085221f1bd8c8c78db8e | [
"Apache-2.0"
] | 126 | 2020-09-30T05:48:12.000Z | 2022-03-10T08:12:54.000Z | configs/alrp_loss/ap_loss_retinanet_r50_fpn_100e_coco500.py | fundamentalvision/Parameterized-AP-Loss | 0f36f022bfc2624f4add960cc27de464dba2c9f9 | [
"Apache-2.0"
] | 13 | 2020-11-13T06:29:48.000Z | 2021-09-14T20:33:52.000Z | configs/alrp_loss/ap_loss_retinanet_r50_fpn_100e_coco500.py | kemaloksuz/aLRPLoss | 2cfaa8ec3150692cca8b085221f1bd8c8c78db8e | [
"Apache-2.0"
] | 14 | 2020-10-04T14:48:29.000Z | 2022-01-08T14:04:46.000Z | _base_ = [
'../_base_/models/retinanet_r50_fpn.py',
'../_base_/datasets/coco500_detection_augm.py',
'../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
]
model = dict(
bbox_head=dict(type='APLossRetinaHead',
anchor_generator=dict(scales_per_octave=2),
bbox_coder=dict(
... | 33.35 | 73 | 0.655172 | _base_ = [
'../_base_/models/retinanet_r50_fpn.py',
'../_base_/datasets/coco500_detection_augm.py',
'../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
]
model = dict(
bbox_head=dict(type='APLossRetinaHead',
anchor_generator=dict(scales_per_octave=2),
bbox_coder=dict(
... | true | true |
f747c5230a951a6167b4e8260802d31407957835 | 5,494 | py | Python | pymc3_ext/step_methods/hmc/hmc.py | wlad111/pymc3 | 43432834be5bbca72caa32d40a848515eea554a8 | [
"Apache-2.0"
] | null | null | null | pymc3_ext/step_methods/hmc/hmc.py | wlad111/pymc3 | 43432834be5bbca72caa32d40a848515eea554a8 | [
"Apache-2.0"
] | null | null | null | pymc3_ext/step_methods/hmc/hmc.py | wlad111/pymc3 | 43432834be5bbca72caa32d40a848515eea554a8 | [
"Apache-2.0"
] | null | null | null | import numpy as np
from ..arraystep import Competence
from pymc3_ext.vartypes import discrete_types
from pymc3_ext.step_methods.hmc.integration import IntegrationError
from pymc3_ext.step_methods.hmc.base_hmc import BaseHMC, HMCStepData, DivergenceInfo
__all__ = ['HamiltonianMC']
def unif(step_size, elow=.85, ehig... | 38.964539 | 84 | 0.615217 | import numpy as np
from ..arraystep import Competence
from pymc3_ext.vartypes import discrete_types
from pymc3_ext.step_methods.hmc.integration import IntegrationError
from pymc3_ext.step_methods.hmc.base_hmc import BaseHMC, HMCStepData, DivergenceInfo
__all__ = ['HamiltonianMC']
def unif(step_size, elow=.85, ehig... | true | true |
f747c56cff56c7a02a33781ccf0c5001c7a0f4ad | 1,247 | py | Python | rpg/mocks.py | juanmagalhaes/rpg-manager | 32b88cec0baff0562b44a998f9e2ecd551361383 | [
"MIT"
] | 1 | 2018-05-08T18:30:49.000Z | 2018-05-08T18:30:49.000Z | rpg/mocks.py | juanmagalhaes/rpg-manager | 32b88cec0baff0562b44a998f9e2ecd551361383 | [
"MIT"
] | 2 | 2020-02-11T21:27:34.000Z | 2020-06-05T16:49:53.000Z | rpg/mocks.py | juanmagalhaes/rpg-manager | 32b88cec0baff0562b44a998f9e2ecd551361383 | [
"MIT"
] | null | null | null | from datetime import datetime
def create_game_mock(
name="Dungeons & Dragons",
sumary="Medieval fantasy adventures on D20 based systems",
):
return {
'name': name,
'sumary': sumary,
}
def create_item_mock(
name="Vorpal Sword",
description="Pierces anything",... | 21.877193 | 76 | 0.540497 | from datetime import datetime
def create_game_mock(
name="Dungeons & Dragons",
sumary="Medieval fantasy adventures on D20 based systems",
):
return {
'name': name,
'sumary': sumary,
}
def create_item_mock(
name="Vorpal Sword",
description="Pierces anything",... | true | true |
f747c5f4148789ffa72b834beacbd044a5cb6421 | 2,468 | py | Python | linear_error_analysis/src/main.py | spacesys-finch/Science | 623c9d77de6a52e87571debf7970cea7af591f2a | [
"MIT"
] | null | null | null | linear_error_analysis/src/main.py | spacesys-finch/Science | 623c9d77de6a52e87571debf7970cea7af591f2a | [
"MIT"
] | null | null | null | linear_error_analysis/src/main.py | spacesys-finch/Science | 623c9d77de6a52e87571debf7970cea7af591f2a | [
"MIT"
] | 1 | 2021-10-09T19:35:26.000Z | 2021-10-09T19:35:26.000Z | """
main.py
Main driver for the Linear Error Analysis program.
Can be run using `lea.sh`.
Can choose which plots to see by toggling on/off `show_fig` param.
Author(s): Adyn Miles, Shiqi Xu, Rosie Liang
"""
import os
import matplotlib.pyplot as plt
import numpy as np
import config
import libs.gta_xch4 as gta_xch4
i... | 28.697674 | 87 | 0.687601 |
import os
import matplotlib.pyplot as plt
import numpy as np
import config
import libs.gta_xch4 as gta_xch4
import libs.photon_noise as pn
from errors import Errors
from forward import Forward
from isrf import ISRF
from optim import Optim
if __name__ == "__main__":
cfg = config.parse_config()
forward = Fo... | true | true |
f747c6a71c66e49ecfa58700c9c153610f28792a | 3,036 | py | Python | Pong.py | ldtownsend/Python_Games | 50756de124b16f982995a522e8c7a18a95b4e66e | [
"MIT"
] | 1 | 2019-12-11T20:45:53.000Z | 2019-12-11T20:45:53.000Z | Pong.py | ldtownsend/Python_Games | 50756de124b16f982995a522e8c7a18a95b4e66e | [
"MIT"
] | null | null | null | Pong.py | ldtownsend/Python_Games | 50756de124b16f982995a522e8c7a18a95b4e66e | [
"MIT"
] | null | null | null | # Simple Pong in Python 3
# Tutorial by @TokyoEdTech
import turtle
wn = turtle.Screen()
wn.title("Pong by Luke Townsend")
wn.bgcolor("black")
wn.setup(width=800, height=600)
wn.tracer(0)
# Paddle A
paddle_a = turtle.Turtle()
paddle_a.speed(0)
paddle_a.shape("square")
paddle_a.color("white")
paddle_a.shapesize(stre... | 24.095238 | 134 | 0.629447 |
import turtle
wn = turtle.Screen()
wn.title("Pong by Luke Townsend")
wn.bgcolor("black")
wn.setup(width=800, height=600)
wn.tracer(0)
paddle_a = turtle.Turtle()
paddle_a.speed(0)
paddle_a.shape("square")
paddle_a.color("white")
paddle_a.shapesize(stretch_wid=5, stretch_len=1)
paddle_a.penup()
paddle_a.goto(-350... | true | true |
f747c6f1c6f3731777c15dc597be876812958ac0 | 609 | py | Python | catalog/migrations/0004_bookinstance_borrower.py | skupriienko/django_local_library | 2bc2b380b806b6d83bd02cafe0370c835f55269b | [
"MIT"
] | null | null | null | catalog/migrations/0004_bookinstance_borrower.py | skupriienko/django_local_library | 2bc2b380b806b6d83bd02cafe0370c835f55269b | [
"MIT"
] | null | null | null | catalog/migrations/0004_bookinstance_borrower.py | skupriienko/django_local_library | 2bc2b380b806b6d83bd02cafe0370c835f55269b | [
"MIT"
] | null | null | null | # Generated by Django 3.1.3 on 2020-12-01 22:02
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('catalog', '0003_auto_202... | 27.681818 | 134 | 0.683087 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('catalog', '0003_auto_20201126_1636'),
]
operations = [
... | true | true |
f747c723ba6602da563b4f6e601579602eaae1b9 | 869 | py | Python | django_tpl_loader_component_test/service/views.py | haricot/django-tpl-loader-component-test | ea477ae1c2ed48132c2b019ff1f95c09eb68c34e | [
"MIT"
] | null | null | null | django_tpl_loader_component_test/service/views.py | haricot/django-tpl-loader-component-test | ea477ae1c2ed48132c2b019ff1f95c09eb68c34e | [
"MIT"
] | null | null | null | django_tpl_loader_component_test/service/views.py | haricot/django-tpl-loader-component-test | ea477ae1c2ed48132c2b019ff1f95c09eb68c34e | [
"MIT"
] | null | null | null | from rest_framework.filters import OrderingFilter, SearchFilter
from rest_framework.generics import ListAPIView
from rest_framework.permissions import AllowAny, IsAdminUser
from django_filters.rest_framework import DjangoFilterBackend
from .models import ServiceAgentBus
from .serializers import ServiceAgentSerialize... | 24.138889 | 63 | 0.746835 | from rest_framework.filters import OrderingFilter, SearchFilter
from rest_framework.generics import ListAPIView
from rest_framework.permissions import AllowAny, IsAdminUser
from django_filters.rest_framework import DjangoFilterBackend
from .models import ServiceAgentBus
from .serializers import ServiceAgentSerialize... | true | true |
f747c78dcf8f258ad007158b5446070cc457949d | 1,093 | py | Python | tests/basic/candle_engine.py | CatTiger/vnpy | 7901a0fb80a5b44d6fc752bd4b2b64ec62c8f84b | [
"MIT"
] | null | null | null | tests/basic/candle_engine.py | CatTiger/vnpy | 7901a0fb80a5b44d6fc752bd4b2b64ec62c8f84b | [
"MIT"
] | 1 | 2020-04-21T02:42:32.000Z | 2020-04-21T02:42:32.000Z | tests/basic/candle_engine.py | CatTiger/vnpy | 7901a0fb80a5b44d6fc752bd4b2b64ec62c8f84b | [
"MIT"
] | null | null | null | from vnpy.app.cta_strategy import BarData
class CandleEngine:
"""
蜡烛图分析引擎
"""
def recognitionBar(self, bar: BarData):
"""
识别单个bar数据
:param bar:
:return:
"""
candle_chart = CandleChart(bar.open_price, bar.high_price, bar.low_price, bar.close_price)
cla... | 30.361111 | 98 | 0.603843 | from vnpy.app.cta_strategy import BarData
class CandleEngine:
def recognitionBar(self, bar: BarData):
candle_chart = CandleChart(bar.open_price, bar.high_price, bar.low_price, bar.close_price)
class CandleChart:
def __init__(self, open: float, high: float, low: float, close: float):
self.o... | true | true |
f747c851f792f378c712cecd54dd22d634527ba7 | 9,357 | py | Python | src/TR/src/classesRT.py | MarceloFCandido/PIC | 884cdc3706fd00f7652cb3a04801c0c00fe7e73f | [
"MIT"
] | 2 | 2018-04-07T23:57:16.000Z | 2018-04-07T23:57:18.000Z | src/TR/src/classesRT.py | MarceloFCandido/PIC | 884cdc3706fd00f7652cb3a04801c0c00fe7e73f | [
"MIT"
] | 2 | 2018-04-13T13:30:36.000Z | 2018-11-05T16:32:27.000Z | src/TR/src/classesRT.py | MarceloFCandido/PIC01 | 884cdc3706fd00f7652cb3a04801c0c00fe7e73f | [
"MIT"
] | null | null | null | """
Arquivo: classesRT.py
Reune as classes utilizadas no tracamento de raios, definindo os elementos
que compoem o meio onde os raios serao tracados, definindo tambem os
proprios raios.
"""
from eqDiferencialOrdinaria import eqDiferencialOrdinaria as EDO
import numpy as np
class ray(EDO):
"""
... | 38.665289 | 80 | 0.523993 |
from eqDiferencialOrdinaria import eqDiferencialOrdinaria as EDO
import numpy as np
class ray(EDO):
def __init__(self, dimension, XP, time = 0.):
super(ray, self).__init__(dimension)
self.XP = XP
self.time = np.array([0.])
def evaluate(self, Y, v):
retorno ... | true | true |
f747c879cbb691c4fc5a098e32bc3ff77069173b | 235 | py | Python | config.sample.py | oysteinoren/testGithub | 71a3f0ba805ae5259b3863ff993d4c8986dc3ada | [
"MIT"
] | 2 | 2017-03-10T10:38:01.000Z | 2017-10-11T03:02:40.000Z | config.sample.py | oysteinoren/testGithub | 71a3f0ba805ae5259b3863ff993d4c8986dc3ada | [
"MIT"
] | null | null | null | config.sample.py | oysteinoren/testGithub | 71a3f0ba805ae5259b3863ff993d4c8986dc3ada | [
"MIT"
] | 1 | 2019-06-05T09:34:34.000Z | 2019-06-05T09:34:34.000Z | FACEBOOK_USER = ""
FACEBOOK_PASSWORD = ""
FACEBOOK_ID = ""
AUTO_LIKE = True
DB_NAME = ""
DB_USER = ""
DB_PASSWORD = ""
WEBSERVER_FOLDER = ""
NOTIFICATIONS_EMAIL = ""
SMTP_SERVER = ""
SMTP_PASSWORD = ""
NOTIFICATIONS_IFTTT_KEY = "" | 13.823529 | 28 | 0.685106 | FACEBOOK_USER = ""
FACEBOOK_PASSWORD = ""
FACEBOOK_ID = ""
AUTO_LIKE = True
DB_NAME = ""
DB_USER = ""
DB_PASSWORD = ""
WEBSERVER_FOLDER = ""
NOTIFICATIONS_EMAIL = ""
SMTP_SERVER = ""
SMTP_PASSWORD = ""
NOTIFICATIONS_IFTTT_KEY = "" | true | true |
f747c8fb76c502fbe8730bc3204bed979825ccff | 6,680 | py | Python | pybind/nos/v7_1_0/interface/hundredgigabitethernet/snmp/trap/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/nos/v7_1_0/interface/hundredgigabitethernet/snmp/trap/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/nos/v7_1_0/interface/hundredgigabitethernet/snmp/trap/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | 1 | 2021-11-05T22:15:42.000Z | 2021-11-05T22:15:42.000Z |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | 51.782946 | 574 | 0.72006 |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | true | true |
f747c97748ee682b185ee2d7d5782aca2bfe16ab | 3,345 | py | Python | utils/make-sqlite.py | BuloZB/https-everywhere | cf994d1d8389e6bf611c736ac20beb485dea5c3f | [
"MIT"
] | null | null | null | utils/make-sqlite.py | BuloZB/https-everywhere | cf994d1d8389e6bf611c736ac20beb485dea5c3f | [
"MIT"
] | null | null | null | utils/make-sqlite.py | BuloZB/https-everywhere | cf994d1d8389e6bf611c736ac20beb485dea5c3f | [
"MIT"
] | null | null | null | #!/usr/bin/env python2.7
#
# Builds an sqlite DB containing all the rulesets, indexed by target.
import glob
import locale
import os
import sqlite3
import subprocess
import sys
from collections import Counter
from lxml import etree
# Explicitly set locale so sorting order for filenames is consistent.
# This is impor... | 34.84375 | 105 | 0.688789 |
import glob
import locale
import os
import sqlite3
import subprocess
import sys
from collections import Counter
from lxml import etree
tlocale(locale.LC_ALL, 'C')
conn = sqlite3.connect(os.path.join(os.path.dirname(__file__), '../src/defaults/rulesets.sqlite'))
c = conn.cursor()
c.execute('''DROP TABLE IF EXIS... | true | true |
f747c992a9124f114a911fe54822ff0b2570003a | 429 | py | Python | 0001-0100/0064-Minimum Path Sum/0064-Minimum Path Sum.py | jiadaizhao/LeetCode | 4ddea0a532fe7c5d053ffbd6870174ec99fc2d60 | [
"MIT"
] | 49 | 2018-05-05T02:53:10.000Z | 2022-03-30T12:08:09.000Z | 0001-0100/0064-Minimum Path Sum/0064-Minimum Path Sum.py | jolly-fellow/LeetCode | ab20b3ec137ed05fad1edda1c30db04ab355486f | [
"MIT"
] | 11 | 2017-12-15T22:31:44.000Z | 2020-10-02T12:42:49.000Z | 0001-0100/0064-Minimum Path Sum/0064-Minimum Path Sum.py | jolly-fellow/LeetCode | ab20b3ec137ed05fad1edda1c30db04ab355486f | [
"MIT"
] | 28 | 2017-12-05T10:56:51.000Z | 2022-01-26T18:18:27.000Z | class Solution:
def minPathSum(self, grid: List[List[int]]) -> int:
m = len(grid)
if m == 0:
return 0
n = len(grid[0])
for j in range(1, n):
grid[0][j] += grid[0][j - 1]
for i in range(1, m):
grid[i][0] += grid[i - 1][0]
for j i... | 30.642857 | 65 | 0.410256 | class Solution:
def minPathSum(self, grid: List[List[int]]) -> int:
m = len(grid)
if m == 0:
return 0
n = len(grid[0])
for j in range(1, n):
grid[0][j] += grid[0][j - 1]
for i in range(1, m):
grid[i][0] += grid[i - 1][0]
for j i... | true | true |
f747c9cd5d8014fb94e542ea8a63fb8dd7380af2 | 13,167 | py | Python | moto/ec2/exceptions.py | alexsult/moto | ed861ecae1039a048a6350a4ff832ef094cdf2c2 | [
"Apache-2.0"
] | 2 | 2019-07-10T14:44:12.000Z | 2020-06-08T17:26:29.000Z | moto/ec2/exceptions.py | alexsult/moto | ed861ecae1039a048a6350a4ff832ef094cdf2c2 | [
"Apache-2.0"
] | 5 | 2018-04-25T21:04:20.000Z | 2018-11-02T19:59:27.000Z | moto/ec2/exceptions.py | alexsult/moto | ed861ecae1039a048a6350a4ff832ef094cdf2c2 | [
"Apache-2.0"
] | 2 | 2020-01-13T17:51:02.000Z | 2020-07-24T17:50:44.000Z | from __future__ import unicode_literals
from moto.core.exceptions import RESTError
class EC2ClientError(RESTError):
code = 400
class DependencyViolationError(EC2ClientError):
def __init__(self, message):
super(DependencyViolationError, self).__init__(
"DependencyViolation", message)
c... | 31.12766 | 112 | 0.670616 | from __future__ import unicode_literals
from moto.core.exceptions import RESTError
class EC2ClientError(RESTError):
code = 400
class DependencyViolationError(EC2ClientError):
def __init__(self, message):
super(DependencyViolationError, self).__init__(
"DependencyViolation", message)
c... | true | true |
f747cab237ad806ed50fa94850957921316214ea | 1,179 | py | Python | examples/Python/RNAfold_MEA.py | tsjzz/ViennaRNA | f58f58ac6fb3e050f12e69cbbf7f0a95bc625d99 | [
"Python-2.0"
] | 1 | 2021-12-02T06:38:05.000Z | 2021-12-02T06:38:05.000Z | examples/Python/RNAfold_MEA.py | tsjzz/ViennaRNA | f58f58ac6fb3e050f12e69cbbf7f0a95bc625d99 | [
"Python-2.0"
] | null | null | null | examples/Python/RNAfold_MEA.py | tsjzz/ViennaRNA | f58f58ac6fb3e050f12e69cbbf7f0a95bc625d99 | [
"Python-2.0"
] | null | null | null | #!/usr/bin/python
#
import RNA
seq = "AUUUCCACUAGAGAAGGUCUAGAGUGUUUGUCGUUUGUCAGAAGUCCCUAUUCCAGGUACGAACACGGUGGAUAUGUUCGACGACAGGAUCGGCGCACUA"
# create fold_compound data structure (required for all subsequently applied algorithms)
fc = RNA.fold_compound(seq)
# compute MFE and MFE structure
(mfe_struct, mfe) = fc.mfe... | 31.026316 | 141 | 0.741306 |
import RNA
seq = "AUUUCCACUAGAGAAGGUCUAGAGUGUUUGUCGUUUGUCAGAAGUCCCUAUUCCAGGUACGAACACGGUGGAUAUGUUCGACGACAGGAUCGGCGCACUA"
fc = RNA.fold_compound(seq)
(mfe_struct, mfe) = fc.mfe()
fc.exp_params_rescale(mfe)
(pp, pf) = fc.pf()
(centroid_struct, dist) = fc.centroid()
centroid_en = fc.eval_structure(centroid_... | true | true |
f747cad6c46411db2d4dc2a79b5cd4e1cf42b62f | 1,388 | py | Python | django_blog/urls.py | artkapl/django-blog-project | 16494465042dd6846f3a2cd560c0cfe7737cc8e0 | [
"MIT"
] | null | null | null | django_blog/urls.py | artkapl/django-blog-project | 16494465042dd6846f3a2cd560c0cfe7737cc8e0 | [
"MIT"
] | null | null | null | django_blog/urls.py | artkapl/django-blog-project | 16494465042dd6846f3a2cd560c0cfe7737cc8e0 | [
"MIT"
] | null | null | null | """djangoBlog URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-ba... | 40.823529 | 101 | 0.729107 | from django.contrib import admin
from django.contrib.auth import views as auth_views
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
from users import views as user_views
urlpatterns = [
path('admin/', admin.site.urls),
path('register/', user_vi... | true | true |
f747cb6c0fa2c6bd8c3825dfcb95392d3218e245 | 229 | py | Python | tests/arbpack/arbinvalidimportmod.py | mofm/pypyr | f417f69ba9a607d8a93019854105cfbc4dc9c36d | [
"Apache-2.0"
] | 261 | 2020-08-18T19:31:29.000Z | 2022-03-31T14:54:06.000Z | tests/arbpack/arbinvalidimportmod.py | mofm/pypyr | f417f69ba9a607d8a93019854105cfbc4dc9c36d | [
"Apache-2.0"
] | 89 | 2017-04-12T09:50:32.000Z | 2020-08-13T13:18:36.000Z | tests/arbpack/arbinvalidimportmod.py | mofm/pypyr | f417f69ba9a607d8a93019854105cfbc4dc9c36d | [
"Apache-2.0"
] | 15 | 2020-09-30T12:15:50.000Z | 2022-03-30T07:25:40.000Z | """Module will not import due to invalid blahblah import."""
import blahblah.blah
print("I dont do much")
def arbmodinvalid_attribute():
"""Can't ever run on account of how blah doesn't exist."""
blahblah.blah.blah()
| 20.818182 | 62 | 0.703057 | import blahblah.blah
print("I dont do much")
def arbmodinvalid_attribute():
blahblah.blah.blah()
| true | true |
f747cb701495e98da0898401c18ec0d5e5c58ba6 | 2,705 | py | Python | src/rubrix/sdk/models/text_classification_annotation.py | sakares/rubrix | 791ffb29815b5d24f2bbbb0fa422f85f8b30098f | [
"Apache-2.0"
] | null | null | null | src/rubrix/sdk/models/text_classification_annotation.py | sakares/rubrix | 791ffb29815b5d24f2bbbb0fa422f85f8b30098f | [
"Apache-2.0"
] | null | null | null | src/rubrix/sdk/models/text_classification_annotation.py | sakares/rubrix | 791ffb29815b5d24f2bbbb0fa422f85f8b30098f | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2021-present, the Recognai S.L. team.
#
# 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 ... | 29.086022 | 77 | 0.655083 |
from typing import Any, Dict, List, Type, TypeVar
import attr
from ..models.class_prediction import ClassPrediction
T = TypeVar("T", bound="TextClassificationAnnotation")
@attr.s(auto_attribs=True)
class TextClassificationAnnotation:
agent: str
labels: List[ClassPrediction]
additional_p... | true | true |
f747cb8a36f8559aac39b46695e28bb48c9f20e8 | 11,353 | py | Python | android_webview/tools/webview_licenses.py | google-ar/chromium | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 777 | 2017-08-29T15:15:32.000Z | 2022-03-21T05:29:41.000Z | android_webview/tools/webview_licenses.py | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 66 | 2017-08-30T18:31:18.000Z | 2021-08-02T10:59:35.000Z | android_webview/tools/webview_licenses.py | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 123 | 2017-08-30T01:19:34.000Z | 2022-03-17T22:55:31.000Z | #!/usr/bin/python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Checks third-party licenses for the purposes of the Android WebView build.
The Android tree includes a snapshot of Chromium in order to... | 36.622581 | 80 | 0.705276 |
"""Checks third-party licenses for the purposes of the Android WebView build.
The Android tree includes a snapshot of Chromium in order to power the system
WebView. This tool checks that all code uses open-source licenses compatible
with Android, and that we meet the requirements of those licenses. It can also
b... | false | true |
f747ccaa2d821901c64dbb566a1e0154c33a3fb1 | 2,885 | py | Python | scripts/ch3_impurity.py | mathkann/understanding-random-forests | d2c5e0174d1a778be37a495083d756b2829160ec | [
"BSD-3-Clause"
] | 353 | 2015-01-03T13:34:03.000Z | 2022-03-25T05:16:30.000Z | scripts/ch3_impurity.py | mathkann/understanding-random-forests | d2c5e0174d1a778be37a495083d756b2829160ec | [
"BSD-3-Clause"
] | 1 | 2016-06-29T05:43:41.000Z | 2016-06-29T05:43:41.000Z | scripts/ch3_impurity.py | mathkann/understanding-random-forests | d2c5e0174d1a778be37a495083d756b2829160ec | [
"BSD-3-Clause"
] | 153 | 2015-01-14T03:46:42.000Z | 2021-12-26T10:13:51.000Z | import numpy as np
import matplotlib.pyplot as plt
blue = (0, 0, 1.0)
red = (1.0, 0, 0)
gray = (0.7, 0.7, 0.7)
# Criterion
def impurity_error(p1, p2):
return min(p1, p2)
def impurity_entropy(p1, p2):
if p1 == 0.0 or p1 == 1.0 or p2 == 0.0 or p2 == 1.0:
return 0.0
else:
return -(p1 * np.l... | 34.345238 | 254 | 0.585442 | import numpy as np
import matplotlib.pyplot as plt
blue = (0, 0, 1.0)
red = (1.0, 0, 0)
gray = (0.7, 0.7, 0.7)
def impurity_error(p1, p2):
return min(p1, p2)
def impurity_entropy(p1, p2):
if p1 == 0.0 or p1 == 1.0 or p2 == 0.0 or p2 == 1.0:
return 0.0
else:
return -(p1 * np.log2(p1) + p... | false | true |
f747cd44893cfd12ecca93170e1b769af5d74877 | 8,324 | py | Python | vnpy/api/bitmex/vnbitmex.py | SonHOuse1993/vnpy | afd63cc7ea2217634613a07864db3f48e13e6e33 | [
"MIT"
] | 5 | 2019-01-17T12:14:14.000Z | 2021-05-30T10:24:42.000Z | vnpy/api/bitmex/vnbitmex.py | SonHOuse1993/vnpy | afd63cc7ea2217634613a07864db3f48e13e6e33 | [
"MIT"
] | null | null | null | vnpy/api/bitmex/vnbitmex.py | SonHOuse1993/vnpy | afd63cc7ea2217634613a07864db3f48e13e6e33 | [
"MIT"
] | 5 | 2019-03-26T03:17:45.000Z | 2019-11-05T08:08:18.000Z | # encoding: UTF-8
from __future__ import print_function
import hashlib
import hmac
import json
import ssl
import traceback
from queue import Queue, Empty
from multiprocessing.dummy import Pool
from time import time
from urlparse import urlparse
from copy import copy
from urllib import urlencode
from threading import ... | 28.802768 | 100 | 0.417468 |
from __future__ import print_function
import hashlib
import hmac
import json
import ssl
import traceback
from queue import Queue, Empty
from multiprocessing.dummy import Pool
from time import time
from urlparse import urlparse
from copy import copy
from urllib import urlencode
from threading import Thread
from six.... | true | true |
f747cde52a86865a9b4c914435659ed13a1e8bad | 11,410 | py | Python | generators/app/templates/python/app.py | shumach5/generator-line-bot | e1e8849d3116e1a559fe6128195a696216210916 | [
"MIT"
] | 4 | 2018-01-29T09:52:22.000Z | 2019-09-03T03:11:40.000Z | generators/app/templates/python/app.py | shumach5/generator-line-bot | e1e8849d3116e1a559fe6128195a696216210916 | [
"MIT"
] | 4 | 2017-12-14T01:01:40.000Z | 2020-02-14T07:17:39.000Z | generators/app/templates/python/app.py | shumach5/generator-line-bot | e1e8849d3116e1a559fe6128195a696216210916 | [
"MIT"
] | 3 | 2017-12-14T01:01:54.000Z | 2020-11-13T23:44:12.000Z | # -*- coding: utf-8 -*-
# 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, ... | 36.925566 | 96 | 0.650307 |
from __future__ import unicode_literals
import errno
import os
import sys
import tempfile
from argparse import ArgumentParser
from flask import Flask, request, abort
from linebot import (
LineBotApi, WebhookHandler
)
from linebot.exceptions import (
InvalidSignatureError
)
from linebot.models i... | true | true |
f747ceff035a41e272dafe720387c5920af21959 | 703 | py | Python | posthog/settings/dynamic_settings.py | leirons/posthog | 3d8bcdfae03a1ead9aad44cd4d176ca2180c1ea4 | [
"MIT"
] | 7,409 | 2020-02-09T23:18:10.000Z | 2022-03-31T22:36:25.000Z | posthog/settings/dynamic_settings.py | leirons/posthog | 3d8bcdfae03a1ead9aad44cd4d176ca2180c1ea4 | [
"MIT"
] | 5,709 | 2020-02-09T23:26:13.000Z | 2022-03-31T20:20:01.000Z | posthog/settings/dynamic_settings.py | leirons/posthog | 3d8bcdfae03a1ead9aad44cd4d176ca2180c1ea4 | [
"MIT"
] | 647 | 2020-02-13T17:50:55.000Z | 2022-03-31T11:24:19.000Z | from posthog.settings.utils import get_from_env, str_to_bool
CONSTANCE_BACKEND = "constance.backends.database.DatabaseBackend"
CONSTANCE_DATABASE_PREFIX = "constance:posthog:"
CONSTANCE_CONFIG = {
"MATERIALIZED_COLUMNS_ENABLED": (
get_from_env("MATERIALIZED_COLUMNS_ENABLED", True, type_cast=str_to_bool),... | 37 | 120 | 0.745377 | from posthog.settings.utils import get_from_env, str_to_bool
CONSTANCE_BACKEND = "constance.backends.database.DatabaseBackend"
CONSTANCE_DATABASE_PREFIX = "constance:posthog:"
CONSTANCE_CONFIG = {
"MATERIALIZED_COLUMNS_ENABLED": (
get_from_env("MATERIALIZED_COLUMNS_ENABLED", True, type_cast=str_to_bool),... | true | true |
f747d0568e53d968c75ddc172682ae40be043819 | 8,847 | py | Python | rasa/core/run.py | AndrewKinsman/rasa | 810d1c2f52261b3704b0b77b7fcb8c63eafaeb5e | [
"Apache-2.0"
] | null | null | null | rasa/core/run.py | AndrewKinsman/rasa | 810d1c2f52261b3704b0b77b7fcb8c63eafaeb5e | [
"Apache-2.0"
] | 3 | 2020-09-26T01:29:46.000Z | 2021-05-21T16:46:15.000Z | rasa/core/run.py | AndrewKinsman/rasa | 810d1c2f52261b3704b0b77b7fcb8c63eafaeb5e | [
"Apache-2.0"
] | null | null | null | import asyncio
import logging
import os
import shutil
import warnings
from functools import partial
from typing import Any, List, Optional, Text, Union
import rasa.core.utils
import rasa.utils
import rasa.utils.common
import rasa.utils.io
from rasa import model, server
from rasa.constants import ENV_SANIC_BACKLOG
from... | 32.170909 | 86 | 0.672657 | import asyncio
import logging
import os
import shutil
import warnings
from functools import partial
from typing import Any, List, Optional, Text, Union
import rasa.core.utils
import rasa.utils
import rasa.utils.common
import rasa.utils.io
from rasa import model, server
from rasa.constants import ENV_SANIC_BACKLOG
from... | true | true |
f747d08fe09943102dcf8e7a62ac0abcdf563dea | 3,618 | py | Python | alembic/compat.py | limodou/uliweb-alembic | 177ff67441a0f07d464df196caa43f894a0bd6aa | [
"MIT"
] | null | null | null | alembic/compat.py | limodou/uliweb-alembic | 177ff67441a0f07d464df196caa43f894a0bd6aa | [
"MIT"
] | null | null | null | alembic/compat.py | limodou/uliweb-alembic | 177ff67441a0f07d464df196caa43f894a0bd6aa | [
"MIT"
] | null | null | null | import io
import sys
from sqlalchemy import __version__ as sa_version
if sys.version_info < (2, 6):
raise NotImplementedError("Python 2.6 or greater is required.")
sqla_08 = sa_version >= '0.8.0'
sqla_09 = sa_version >= '0.9.0'
py2k = sys.version_info < (3, 0)
py3k = sys.version_info >= (3, 0)
py33 = sys.version... | 25.842857 | 73 | 0.623273 | import io
import sys
from sqlalchemy import __version__ as sa_version
if sys.version_info < (2, 6):
raise NotImplementedError("Python 2.6 or greater is required.")
sqla_08 = sa_version >= '0.8.0'
sqla_09 = sa_version >= '0.9.0'
py2k = sys.version_info < (3, 0)
py3k = sys.version_info >= (3, 0)
py33 = sys.version... | true | true |
f747d0f8803d5ef7d4a0440c636db6069c5f6d59 | 4,147 | py | Python | src/model.py | pmoe7/Stock-Price-Prediction | 062874fc2565fb14b5a25856baeabdcf705c646f | [
"MIT"
] | 3 | 2019-03-11T02:48:11.000Z | 2021-03-18T06:45:42.000Z | src/model.py | pmuhamed1/Stock-Price-Prediction | 062874fc2565fb14b5a25856baeabdcf705c646f | [
"MIT"
] | null | null | null | src/model.py | pmuhamed1/Stock-Price-Prediction | 062874fc2565fb14b5a25856baeabdcf705c646f | [
"MIT"
] | null | null | null | """
-------------------------------------------------------
model.py
[program description]
-------------------------------------------------------
Author: Mohammed Perves
ID: 170143440
Email: moha3440@mylaurier.ca
__updated__ = "2018-06-20"
-------------------------------------------------------
"""
... | 33.715447 | 133 | 0.621654 | import csv
import numpy as np
from sklearn.svm import SVR
import matplotlib.pyplot as plt
from sklearn import linear_model
from sklearn import preprocessing
import stock_data
from sklearn.externals import joblib
scaler = preprocessing.StandardScaler()
dates = []
prices = []
def normalize_data(dat... | true | true |
f747d19302bf185d6dda85b34436250f6acaa655 | 307 | py | Python | iptocc/exceptions.py | roniemartinez/IPToCC | c60bc68952a699b6d3b1b7c491458ac5d214191d | [
"MIT"
] | 7 | 2019-05-13T09:29:20.000Z | 2020-03-31T13:43:32.000Z | iptocc/exceptions.py | Code-ReaQtor/IPToCC | c60bc68952a699b6d3b1b7c491458ac5d214191d | [
"MIT"
] | 6 | 2018-05-22T18:44:54.000Z | 2018-10-17T14:13:28.000Z | iptocc/exceptions.py | Code-ReaQtor/IPToCC | c60bc68952a699b6d3b1b7c491458ac5d214191d | [
"MIT"
] | 2 | 2018-05-22T19:21:33.000Z | 2018-05-23T05:18:54.000Z | #!/usr/bin/env python
# __author__ = "Ronie Martinez"
# __copyright__ = "Copyright 2020, Ronie Martinez"
# __credits__ = ["Ronie Martinez"]
# __maintainer__ = "Ronie Martinez"
# __email__ = "ronmarti18@gmail.com"
class CountryCodeNotFound(Exception):
pass
class CountryNotFound(Exception):
pass
| 20.466667 | 50 | 0.732899 |
class CountryCodeNotFound(Exception):
pass
class CountryNotFound(Exception):
pass
| true | true |
f747d45cb1c7cc3ea60fb29bfbff803ba51bb9e1 | 3,405 | py | Python | tests/test_env.py | bothub-it/python-decouple | 2f36cdbbff46d5f9142bf52b454959c06934a06b | [
"MIT"
] | null | null | null | tests/test_env.py | bothub-it/python-decouple | 2f36cdbbff46d5f9142bf52b454959c06934a06b | [
"MIT"
] | null | null | null | tests/test_env.py | bothub-it/python-decouple | 2f36cdbbff46d5f9142bf52b454959c06934a06b | [
"MIT"
] | null | null | null | # coding: utf-8
import os
import sys
from mock import patch
import pytest
from decouple import Config, RepositoryEnv, UndefinedValueError
# Useful for very coarse version differentiation.
PY3 = sys.version_info[0] == 3
if PY3:
from io import StringIO
else:
from io import BytesIO as StringIO
ENVFILE = '''
K... | 25.992366 | 77 | 0.728928 |
import os
import sys
from mock import patch
import pytest
from decouple import Config, RepositoryEnv, UndefinedValueError
PY3 = sys.version_info[0] == 3
if PY3:
from io import StringIO
else:
from io import BytesIO as StringIO
ENVFILE = '''
KeyTrue=True
KeyOne=1
KeyYes=yes
KeyOn=on
KeyY=y
KeyFalse=False
... | true | true |
f747d57939fb2c75c85b0a984efbbab992590454 | 8,663 | py | Python | Scripts/schemaMatch.py | alishiba14/Neural-Class-Alignement-for-OSM-and-KG- | 0c7d15e27fe85287043273f187c9aff3d8c438ae | [
"MIT"
] | null | null | null | Scripts/schemaMatch.py | alishiba14/Neural-Class-Alignement-for-OSM-and-KG- | 0c7d15e27fe85287043273f187c9aff3d8c438ae | [
"MIT"
] | null | null | null | Scripts/schemaMatch.py | alishiba14/Neural-Class-Alignement-for-OSM-and-KG- | 0c7d15e27fe85287043273f187c9aff3d8c438ae | [
"MIT"
] | 1 | 2021-05-19T17:37:25.000Z | 2021-05-19T17:37:25.000Z | #!/usr/bin/env python
# coding: utf-8
from sklearn.model_selection import KFold
import pandas as pd
import numpy as np
from keras.preprocessing.sequence import pad_sequences
from skmultilearn.problem_transform import LabelPowerset
from imblearn.over_sampling import RandomOverSampler
from keras.models import Model
f... | 30.29021 | 237 | 0.680134 |
from sklearn.model_selection import KFold
import pandas as pd
import numpy as np
from keras.preprocessing.sequence import pad_sequences
from skmultilearn.problem_transform import LabelPowerset
from imblearn.over_sampling import RandomOverSampler
from keras.models import Model
from keras.losses import binary_cross... | true | true |
f747d706189e80120928b70bc4ece1fa1ee686f0 | 2,944 | py | Python | applications/ShallowWaterApplication/python_scripts/testing/empty_solver_for_testing.py | ma6yu/Kratos | 02380412f8a833a2cdda6791e1c7f9c32e088530 | [
"BSD-4-Clause"
] | null | null | null | applications/ShallowWaterApplication/python_scripts/testing/empty_solver_for_testing.py | ma6yu/Kratos | 02380412f8a833a2cdda6791e1c7f9c32e088530 | [
"BSD-4-Clause"
] | null | null | null | applications/ShallowWaterApplication/python_scripts/testing/empty_solver_for_testing.py | ma6yu/Kratos | 02380412f8a833a2cdda6791e1c7f9c32e088530 | [
"BSD-4-Clause"
] | null | null | null | # Importing the Kratos Library
import KratosMultiphysics as KM
from KratosMultiphysics.python_solver import PythonSolver
# Import applications
import KratosMultiphysics.ShallowWaterApplication as SW
def CreateSolver(model, custom_settings):
return EmptySolverForTesting(model, custom_settings)
class EmptySolverFo... | 40.328767 | 128 | 0.662704 |
import KratosMultiphysics as KM
from KratosMultiphysics.python_solver import PythonSolver
import KratosMultiphysics.ShallowWaterApplication as SW
def CreateSolver(model, custom_settings):
return EmptySolverForTesting(model, custom_settings)
class EmptySolverForTesting(PythonSolver):
def __init__(self, mode... | true | true |
f747d71498aaa6ffc1e7217ebf5c98c7f0cb1eb3 | 39,875 | py | Python | kombu/transport/redis.py | hfern/kombu | d92af45cc0b2754b94a1920f445b8b3d84e85057 | [
"BSD-3-Clause"
] | null | null | null | kombu/transport/redis.py | hfern/kombu | d92af45cc0b2754b94a1920f445b8b3d84e85057 | [
"BSD-3-Clause"
] | null | null | null | kombu/transport/redis.py | hfern/kombu | d92af45cc0b2754b94a1920f445b8b3d84e85057 | [
"BSD-3-Clause"
] | null | null | null | """Redis transport."""
from __future__ import absolute_import, unicode_literals
import numbers
import socket
from bisect import bisect
from collections import namedtuple
from contextlib import contextmanager
from time import time
from vine import promise
from kombu.exceptions import InconsistencyError, VersionMisma... | 35.350177 | 79 | 0.596288 | from __future__ import absolute_import, unicode_literals
import numbers
import socket
from bisect import bisect
from collections import namedtuple
from contextlib import contextmanager
from time import time
from vine import promise
from kombu.exceptions import InconsistencyError, VersionMismatch
from kombu.five imp... | true | true |
f747d93d246f06e9bef7cf0a7e7c4c6e048cabef | 8,926 | py | Python | spyder/api/widgets/menus.py | skjerns/spyder | c130a2e2f8782d8a27886da100e70e1e47d903f5 | [
"MIT"
] | null | null | null | spyder/api/widgets/menus.py | skjerns/spyder | c130a2e2f8782d8a27886da100e70e1e47d903f5 | [
"MIT"
] | null | null | null | spyder/api/widgets/menus.py | skjerns/spyder | c130a2e2f8782d8a27886da100e70e1e47d903f5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
Spyder API menu widgets.
"""
# Standard library imports
import sys
from typing import Optional, Union, TypeVar
# Third party imports
from qtpy.QtWidgets import ... | 33.182156 | 79 | 0.565987 |
import sys
from typing import Optional, Union, TypeVar
from qtpy.QtWidgets import QAction, QMenu
from spyder.utils.qthelpers import add_actions, SpyderAction
MENU_SEPARATOR = None
T = TypeVar('T', bound='SpyderMenu')
class OptionsMenuSections:
Top = 'top_section'
Bottom = 'bottom_section'
... | true | true |
f747d96022a88d61078249831b76ed1d6d523d49 | 21,749 | py | Python | cinder/test.py | scottwedge/cinder | 7fc6cf116b95ed9545763a49189ab0502816e161 | [
"Apache-2.0"
] | null | null | null | cinder/test.py | scottwedge/cinder | 7fc6cf116b95ed9545763a49189ab0502816e161 | [
"Apache-2.0"
] | 3 | 2020-03-02T01:36:30.000Z | 2021-12-13T20:27:46.000Z | cinder/test.py | scottwedge/cinder | 7fc6cf116b95ed9545763a49189ab0502816e161 | [
"Apache-2.0"
] | 1 | 2020-03-02T01:32:26.000Z | 2020-03-02T01:32:26.000Z | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a ... | 38.630551 | 79 | 0.622465 |
import copy
import logging
import os
import sys
import uuid
from eventlet import tpool
import fixtures
import mock
from oslo_concurrency import lockutils
from oslo_config import fixture as config_fixture
from oslo_log.fixture import logging_error as log_fixture
import oslo_messaging
from oslo_messaging... | true | true |
f747db9480139fa29147a1166d5efa9bb6ba24b8 | 297 | py | Python | pyjac/tests/test_utils.py | chx12002/pyJac | 5f54b2d6c04e1ee62d9db8bbf7553ad785f58c33 | [
"MIT"
] | 24 | 2017-03-14T05:14:18.000Z | 2022-03-30T06:35:47.000Z | pyjac/tests/test_utils.py | chx12002/pyJac | 5f54b2d6c04e1ee62d9db8bbf7553ad785f58c33 | [
"MIT"
] | 34 | 2017-01-18T18:56:11.000Z | 2022-02-08T15:46:13.000Z | pyjac/tests/test_utils.py | chx12002/pyJac | 5f54b2d6c04e1ee62d9db8bbf7553ad785f58c33 | [
"MIT"
] | 21 | 2017-02-04T11:25:56.000Z | 2022-02-14T13:57:13.000Z | # Python 2 compatibility
from __future__ import print_function
from __future__ import division
import sys
from .. import utils
class TestUtils(object):
"""
"""
def test_imported(self):
"""Ensure utils module imported.
"""
assert 'pyjac.utils' in sys.modules
| 18.5625 | 43 | 0.670034 |
from __future__ import print_function
from __future__ import division
import sys
from .. import utils
class TestUtils(object):
def test_imported(self):
assert 'pyjac.utils' in sys.modules
| true | true |
f747db9f161b6f34890be57acb5a18f5f945bd5a | 738 | py | Python | ciphey/basemods/Checkers/human.py | blackcat-917/Ciphey | d24deea87cec2dea2e04ec3859b9e77e121d192a | [
"MIT"
] | 1 | 2021-11-28T17:55:04.000Z | 2021-11-28T17:55:04.000Z | ciphey/basemods/Checkers/human.py | ScarlettHoefler/Ciphey | f7d21ce0993eeff0b53cec8717dfbd8f8419f8f5 | [
"MIT"
] | 2 | 2021-04-06T18:32:08.000Z | 2021-06-02T04:02:31.000Z | ciphey/basemods/Checkers/human.py | ScarlettHoefler/Ciphey | f7d21ce0993eeff0b53cec8717dfbd8f8419f8f5 | [
"MIT"
] | 1 | 2021-03-09T02:33:23.000Z | 2021-03-09T02:33:23.000Z | from typing import Dict, Optional
from ciphey.iface import Checker, Config, ParamSpec, registry
@registry.register
class HumanChecker(Checker[str]):
@staticmethod
def getParams() -> Optional[Dict[str, ParamSpec]]:
pass
def check(self, text: str) -> Optional[str]:
with self._config().paus... | 27.333333 | 73 | 0.602981 | from typing import Dict, Optional
from ciphey.iface import Checker, Config, ParamSpec, registry
@registry.register
class HumanChecker(Checker[str]):
@staticmethod
def getParams() -> Optional[Dict[str, ParamSpec]]:
pass
def check(self, text: str) -> Optional[str]:
with self._config().paus... | true | true |
f747dbabb57b6c846ef5fd7992dc342810e75e3f | 3,737 | py | Python | src/modules/qlib/src/qlib/utils/logging.py | ads-ad-itcenter/qunomon.forked | 48d532692d353fe2d3946f62b227f834f9349034 | [
"Apache-2.0"
] | 16 | 2020-11-18T05:43:55.000Z | 2021-11-27T14:43:26.000Z | src/modules/qlib/src/qlib/utils/logging.py | aistairc/qunomon | d4e9c5cb569b16addfbe6c33c73812065065a1df | [
"Apache-2.0"
] | 1 | 2022-03-23T07:55:54.000Z | 2022-03-23T13:24:11.000Z | src/modules/qlib/src/qlib/utils/logging.py | ads-ad-itcenter/qunomon.forked | 48d532692d353fe2d3946f62b227f834f9349034 | [
"Apache-2.0"
] | 3 | 2021-02-12T01:56:31.000Z | 2022-03-23T02:45:02.000Z | # Copyright © 2019 National Institute of Advanced Industrial Science and Technology (AIST). All rights reserved.
# !/usr/bin/env python3.6
# coding=utf-8
import inspect
import logging
from functools import wraps
from pathlib import Path
from datetime import datetime
from pytz import timezone
# グローバル変数 ログ保存フォルダパス
g_lo... | 24.266234 | 112 | 0.569708 |
import inspect
import logging
from functools import wraps
from pathlib import Path
from datetime import datetime
from pytz import timezone
g_log_dir = Path('./logs')
def set_log_dir(dir: str) -> None:
global g_log_dir
g_log_dir = Path(dir)
def get_log_path() -> str:
jst_datetime = datetime.now().a... | true | true |
f747dbb60f964892743537d4f5584aa5ed6b68e8 | 3,930 | py | Python | autoelective/config.py | 12f23eddde/PKUAutoElective | 1a7094ea14a90fb23a3bd33d013bf5a46127394f | [
"MIT"
] | 1 | 2019-12-09T10:01:08.000Z | 2019-12-09T10:01:08.000Z | autoelective/config.py | 12f23eddde/PKUAutoElective | 1a7094ea14a90fb23a3bd33d013bf5a46127394f | [
"MIT"
] | null | null | null | autoelective/config.py | 12f23eddde/PKUAutoElective | 1a7094ea14a90fb23a3bd33d013bf5a46127394f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# filename: config.py
# modified: 2019-09-10
__all__ = ["AutoElectiveConfig"]
import os
from configparser import RawConfigParser
from .utils import Singleton
from .const import CONFIG_INI
class BaseConfig(object, metaclass=Singleton):
CONFIG_FILE = ""
ALLOW_NO... | 26.02649 | 114 | 0.652672 |
__all__ = ["AutoElectiveConfig"]
import os
from configparser import RawConfigParser
from .utils import Singleton
from .const import CONFIG_INI
class BaseConfig(object, metaclass=Singleton):
CONFIG_FILE = ""
ALLOW_NO_VALUE = True
def __init__(self):
if self.__class__ is __class__:
... | true | true |
f747dc1fd5929b03fe42c04109db7f7018edfcd5 | 2,260 | py | Python | graph4nlp/pytorch/modules/prediction/classification/link_prediction/ConcatFeedForwardNN.py | stjordanis/graph4nlp | c6ebde32bc77d3a7b78f86a93f19b1c057963ffa | [
"Apache-2.0"
] | 1 | 2021-06-06T15:23:11.000Z | 2021-06-06T15:23:11.000Z | graph4nlp/pytorch/modules/prediction/classification/link_prediction/ConcatFeedForwardNN.py | stjordanis/graph4nlp | c6ebde32bc77d3a7b78f86a93f19b1c057963ffa | [
"Apache-2.0"
] | null | null | null | graph4nlp/pytorch/modules/prediction/classification/link_prediction/ConcatFeedForwardNN.py | stjordanis/graph4nlp | c6ebde32bc77d3a7b78f86a93f19b1c057963ffa | [
"Apache-2.0"
] | 1 | 2021-11-01T08:41:26.000Z | 2021-11-01T08:41:26.000Z | from torch import nn
import torch
from ..base import LinkPredictionBase
from .ConcatFeedForwardNNLayer import ConcatFeedForwardNNLayer
class ConcatFeedForwardNN(LinkPredictionBase):
r"""Specific class for link prediction task.
Parameters
----------
input_size : int
The length of inp... | 32.285714 | 95 | 0.613274 | from torch import nn
import torch
from ..base import LinkPredictionBase
from .ConcatFeedForwardNNLayer import ConcatFeedForwardNNLayer
class ConcatFeedForwardNN(LinkPredictionBase):
def __init__(self, input_size, hidden_size,num_class,activation=nn.ReLU()):
super(ConcatFeedForwardNN, self).__init_... | true | true |
f747dd63473b4989e5310f058a83b3e5cd0300cb | 1,102 | py | Python | test/test_marshall_enum.py | tofarr/marshy | 0eb9620f42e3492a8d3275911879d2ed4c226e37 | [
"MIT"
] | 1 | 2022-02-26T20:34:32.000Z | 2022-02-26T20:34:32.000Z | test/test_marshall_enum.py | tofarr/marshy | 0eb9620f42e3492a8d3275911879d2ed4c226e37 | [
"MIT"
] | null | null | null | test/test_marshall_enum.py | tofarr/marshy | 0eb9620f42e3492a8d3275911879d2ed4c226e37 | [
"MIT"
] | null | null | null | from enum import Enum
from unittest import TestCase
from marshy import dump, load, get_default_context
from marshy.errors import MarshallError
from marshy.factory.enum_marshaller_factory import EnumMarshallerFactory
class VehicleTypes(Enum):
CAR = 'car'
TRUCK = 'truck'
BIKE = 'bike'
class TestMarshallE... | 31.485714 | 106 | 0.711434 | from enum import Enum
from unittest import TestCase
from marshy import dump, load, get_default_context
from marshy.errors import MarshallError
from marshy.factory.enum_marshaller_factory import EnumMarshallerFactory
class VehicleTypes(Enum):
CAR = 'car'
TRUCK = 'truck'
BIKE = 'bike'
class TestMarshallE... | true | true |
f747dd680888d4c445a1f7ec7e18877a9b854f4b | 646 | py | Python | examples/jit/reduction_simple.py | prkhrsrvstv1/cupy | ea86c8225b575af9d2855fb77a306cf86fd098ea | [
"MIT"
] | 6,180 | 2016-11-01T14:22:30.000Z | 2022-03-31T08:39:20.000Z | examples/jit/reduction_simple.py | prkhrsrvstv1/cupy | ea86c8225b575af9d2855fb77a306cf86fd098ea | [
"MIT"
] | 6,281 | 2016-12-22T07:42:31.000Z | 2022-03-31T19:57:02.000Z | examples/jit/reduction_simple.py | prkhrsrvstv1/cupy | ea86c8225b575af9d2855fb77a306cf86fd098ea | [
"MIT"
] | 829 | 2017-02-23T05:46:12.000Z | 2022-03-27T17:40:03.000Z | import cupy
from cupyx import jit
@jit.rawkernel()
def reduction(x, y, size):
tid = jit.threadIdx.x
ntid = jit.blockDim.x
value = cupy.float32(0)
for i in range(tid, size, ntid):
value += x[i]
smem = jit.shared_memory(cupy.float32, 1024)
smem[tid] = value
jit.syncthreads()
... | 19 | 56 | 0.592879 | import cupy
from cupyx import jit
@jit.rawkernel()
def reduction(x, y, size):
tid = jit.threadIdx.x
ntid = jit.blockDim.x
value = cupy.float32(0)
for i in range(tid, size, ntid):
value += x[i]
smem = jit.shared_memory(cupy.float32, 1024)
smem[tid] = value
jit.syncthreads()
... | true | true |
f747de00d445f65ca51260e126fe9231de366ce5 | 6,871 | py | Python | seismiqb/src/controllers/extender.py | gazprom-neft/seismiqb | d4906d41c79407c99cfa6f91d6005c0e453d1138 | [
"Apache-2.0"
] | 73 | 2019-10-08T08:50:12.000Z | 2022-03-23T20:18:02.000Z | seismiqb/src/controllers/extender.py | gazprom-neft/seismiqb | d4906d41c79407c99cfa6f91d6005c0e453d1138 | [
"Apache-2.0"
] | 69 | 2019-09-06T14:00:57.000Z | 2022-03-30T13:02:54.000Z | seismiqb/src/controllers/extender.py | gazprom-neft/seismiqb | d4906d41c79407c99cfa6f91d6005c0e453d1138 | [
"Apache-2.0"
] | 28 | 2019-11-04T18:40:07.000Z | 2022-03-23T16:18:54.000Z | """ A holder for horizon extension steps inherited from `.class:Enhancer` with:
- redifined get_mask_transform_ppl to thin out loaded mask
- making an iterative inference to cover the holes in a given horizon.
"""
import gc
from copy import copy
from pprint import pformat
from time import perf_counter
import n... | 38.172222 | 111 | 0.58434 | import gc
from copy import copy
from pprint import pformat
from time import perf_counter
import numpy as np
import torch
from .enhancer import Enhancer
from ..labels import Horizon
from ..samplers import ExtensionGrid
from ...batchflow import Pipeline, Config, Notifier, Monitor
from ...batchflow import B, F, C, V, ... | true | true |
f747de2aba2819688e0835aff9cf22c8921e3126 | 2,203 | py | Python | main.py | YannHyaric/evolutionary-computation | af7778fd1b5d60a1e5630b483b55257adac0bbc6 | [
"MIT"
] | null | null | null | main.py | YannHyaric/evolutionary-computation | af7778fd1b5d60a1e5630b483b55257adac0bbc6 | [
"MIT"
] | null | null | null | main.py | YannHyaric/evolutionary-computation | af7778fd1b5d60a1e5630b483b55257adac0bbc6 | [
"MIT"
] | null | null | null | import sys
import numpy as np
import matplotlib.pyplot as plt
from ppa.ppa import prey_predator_algorithm
from ppa.config import Config
from acs.objective import fitness, fitness_population
from acs.instance import Instance, print_instance
def read_files(instance_config_filename, config_filename):
if instance_co... | 31.927536 | 193 | 0.746709 | import sys
import numpy as np
import matplotlib.pyplot as plt
from ppa.ppa import prey_predator_algorithm
from ppa.config import Config
from acs.objective import fitness, fitness_population
from acs.instance import Instance, print_instance
def read_files(instance_config_filename, config_filename):
if instance_co... | true | true |
f747de2ae9b40a37fb660aa8247f1c067486a850 | 1,123 | py | Python | backend/telegram/methods/chats/get_updated_dialog.py | appheap/social-media-analyzer | 0f9da098bfb0b4f9eb38e0244aa3a168cf97d51c | [
"Apache-2.0"
] | 5 | 2021-09-11T22:01:15.000Z | 2022-03-16T21:33:42.000Z | backend/telegram/methods/chats/get_updated_dialog.py | iamatlasss/social-media-analyzer | 429d1d2bbd8bfce80c50c5f8edda58f87ace668d | [
"Apache-2.0"
] | null | null | null | backend/telegram/methods/chats/get_updated_dialog.py | iamatlasss/social-media-analyzer | 429d1d2bbd8bfce80c50c5f8edda58f87ace668d | [
"Apache-2.0"
] | 3 | 2022-01-18T11:06:22.000Z | 2022-02-26T13:39:28.000Z | from typing import Optional
from db.scaffold import Scaffold
from telegram import models as tg_models
from pyrogram import types
class GetUpdatedDialog(Scaffold):
def get_updated_dialog(
self,
*,
raw_chat: "types.Chat",
db_account: "tg_models.TelegramAccount",
... | 27.390244 | 69 | 0.58415 | from typing import Optional
from db.scaffold import Scaffold
from telegram import models as tg_models
from pyrogram import types
class GetUpdatedDialog(Scaffold):
def get_updated_dialog(
self,
*,
raw_chat: "types.Chat",
db_account: "tg_models.TelegramAccount",
... | true | true |
f747df7edf7d3a495ba30fce45767a92cb1cf39e | 15,685 | py | Python | src/sage/algebras/lie_algebras/affine_lie_algebra.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 3 | 2019-07-15T13:48:24.000Z | 2019-11-08T12:31:43.000Z | src/sage/algebras/lie_algebras/affine_lie_algebra.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 2 | 2018-10-30T13:40:20.000Z | 2020-07-23T12:13:30.000Z | src/sage/algebras/lie_algebras/affine_lie_algebra.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 1 | 2020-07-23T10:29:58.000Z | 2020-07-23T10:29:58.000Z | """
Affine Lie Algebras
AUTHORS:
- Travis Scrimshaw (2013-05-03): Initial version
"""
#*****************************************************************************
# Copyright (C) 2013-2017 Travis Scrimshaw <tcscrims at gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it u... | 31.495984 | 94 | 0.533248 |
from sage.misc.cachefunc import cached_method
from sage.structure.element import parent
from sage.categories.lie_algebras import LieAlgebras
from sage.algebras.lie_algebras.lie_algebra import LieAlgebra, FinitelyGeneratedLieAlgebra
from sage.algebras.lie_algebras.lie_algebra_element import UntwistedAffineLi... | true | true |
f747e0297bbf4671f82eea855cba69e30d337db5 | 19,980 | py | Python | python/hsfs/training_dataset.py | berthoug/feature-store-api | 85c23ae08c7de65acd79a3b528fa72c07e52a272 | [
"Apache-2.0"
] | null | null | null | python/hsfs/training_dataset.py | berthoug/feature-store-api | 85c23ae08c7de65acd79a3b528fa72c07e52a272 | [
"Apache-2.0"
] | null | null | null | python/hsfs/training_dataset.py | berthoug/feature-store-api | 85c23ae08c7de65acd79a3b528fa72c07e52a272 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2020 Logical Clocks AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 34.507772 | 141 | 0.61952 |
import json
import warnings
from typing import Optional, Union, Any, Dict, List, TypeVar
import humps
import pandas as pd
import numpy as np
from hsfs import util, engine, training_dataset_feature
from hsfs.statistics_config import StatisticsConfig
from hsfs.storage_connector import StorageConnector
f... | true | true |
f747e130d98068d6467cd62abad3de24899012f4 | 20,751 | py | Python | bookmark/controllers.py | rajeshwariC/WeVoteServer | 59aff1725b7586ebd360ef40fc1b44e5a0b9572d | [
"MIT"
] | null | null | null | bookmark/controllers.py | rajeshwariC/WeVoteServer | 59aff1725b7586ebd360ef40fc1b44e5a0b9572d | [
"MIT"
] | null | null | null | bookmark/controllers.py | rajeshwariC/WeVoteServer | 59aff1725b7586ebd360ef40fc1b44e5a0b9572d | [
"MIT"
] | null | null | null | # bookmark/controllers.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from .models import BookmarkItemList, BookmarkItemManager
from ballot.models import CANDIDATE, MEASURE, OFFICE
from candidate.models import CandidateCampaignManager
from django.http import HttpResponse
import json
from measure.mode... | 49.882212 | 132 | 0.6418 |
from .models import BookmarkItemList, BookmarkItemManager
from ballot.models import CANDIDATE, MEASURE, OFFICE
from candidate.models import CandidateCampaignManager
from django.http import HttpResponse
import json
from measure.models import ContestMeasureManager
from office.models import ContestOfficeManager
from v... | true | true |
f747e1b31093eec038e1eca15148176bcd438b34 | 715 | py | Python | ArraysStrings/easy/validMountainArray.py | linminhtoo/algorithms | 884422a7c9f531e7ccaae03ba1ccbd6966b23dd3 | [
"MIT"
] | null | null | null | ArraysStrings/easy/validMountainArray.py | linminhtoo/algorithms | 884422a7c9f531e7ccaae03ba1ccbd6966b23dd3 | [
"MIT"
] | null | null | null | ArraysStrings/easy/validMountainArray.py | linminhtoo/algorithms | 884422a7c9f531e7ccaae03ba1ccbd6966b23dd3 | [
"MIT"
] | null | null | null | from typing import List
class Solution_mine: # pass, O(N), but maybe not concise?
def validMountainArray(self, arr: List[int]) -> bool:
if len(arr) < 3:
return False
i = 0
increasing_count = 0
increasing = True
while i + 1 <= len(arr) - 1:
if increasin... | 34.047619 | 57 | 0.46014 | from typing import List
class Solution_mine:
def validMountainArray(self, arr: List[int]) -> bool:
if len(arr) < 3:
return False
i = 0
increasing_count = 0
increasing = True
while i + 1 <= len(arr) - 1:
if increasing:
if arr[i] == arr[... | true | true |
f747e1d1e37c4629d508add76334d0fde71ccbac | 21,538 | py | Python | google/resumable_media/requests/__init__.py | HemangChothani/google-resumable-media-python | 7dc40de34533e4474240fc831b79cee2baa82c6e | [
"Apache-2.0"
] | null | null | null | google/resumable_media/requests/__init__.py | HemangChothani/google-resumable-media-python | 7dc40de34533e4474240fc831b79cee2baa82c6e | [
"Apache-2.0"
] | 3 | 2019-07-07T17:55:56.000Z | 2019-08-05T01:13:27.000Z | google/resumable_media/requests/__init__.py | HemangChothani/google-resumable-media-python | 7dc40de34533e4474240fc831b79cee2baa82c6e | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 31.720177 | 78 | 0.696118 |
import pkg_resources
pkg_resources.require('google-resumable-media[requests]')
from google.resumable_media.requests.download import ChunkedDownload
from google.resumable_media.requests.download import Download
from google.resumable_media.requests.upload import MultipartUpload
from google.resumable_med... | true | true |
f747e22c8a884c758c2fa09e40dad8fe6594e266 | 2,696 | py | Python | src/api-engine/api/routes/chaincode/serializers.py | bhaskarvilles/cello | baf9a87b5549ff2ce6730f6b64e01ee4773bfdb0 | [
"Apache-2.0"
] | null | null | null | src/api-engine/api/routes/chaincode/serializers.py | bhaskarvilles/cello | baf9a87b5549ff2ce6730f6b64e01ee4773bfdb0 | [
"Apache-2.0"
] | null | null | null | src/api-engine/api/routes/chaincode/serializers.py | bhaskarvilles/cello | baf9a87b5549ff2ce6730f6b64e01ee4773bfdb0 | [
"Apache-2.0"
] | null | null | null | from rest_framework import serializers
from api.config import FABRIC_CHAINCODE_STORE
from api.models import ChainCode
from api.common.serializers import ListResponseSerializer
import hashlib
def upload_to(instance, filename):
return '/'.join([FABRIC_CHAINCODE_STORE, instance.user_name, filename])
class ChainCo... | 35.946667 | 86 | 0.754822 | from rest_framework import serializers
from api.config import FABRIC_CHAINCODE_STORE
from api.models import ChainCode
from api.common.serializers import ListResponseSerializer
import hashlib
def upload_to(instance, filename):
return '/'.join([FABRIC_CHAINCODE_STORE, instance.user_name, filename])
class ChainCo... | true | true |
f747e2e645156b9f9428d5f3d88bfe04cf50a0a6 | 3,044 | py | Python | first_neural_network/node.py | ADCenterNetwork/discern-fmk | 4781f1a986f7b24f298b2729b87ddee4227cb1d0 | [
"MIT"
] | null | null | null | first_neural_network/node.py | ADCenterNetwork/discern-fmk | 4781f1a986f7b24f298b2729b87ddee4227cb1d0 | [
"MIT"
] | null | null | null | first_neural_network/node.py | ADCenterNetwork/discern-fmk | 4781f1a986f7b24f298b2729b87ddee4227cb1d0 | [
"MIT"
] | null | null | null | import ast
import numpy as np
import torch as torch
import torch.nn as nn
import torch.nn.functional as F
def get_descendants(node, ls):
for child in node.children:
ls.append(child)
get_descendants(child, ls)
return ls
class Node():
'''
For each node we store its parent and children n... | 27.423423 | 105 | 0.586071 | import ast
import numpy as np
import torch as torch
import torch.nn as nn
import torch.nn.functional as F
def get_descendants(node, ls):
for child in node.children:
ls.append(child)
get_descendants(child, ls)
return ls
class Node():
def __init__(self, node, depth, parent = None):
... | true | true |
f747e4486dff861432a05782146bb5e6f8dd308e | 1,634 | py | Python | tests/test_cache.py | emmett-framework/renoir | cdd3047a4fbd31d2e2b6bc51270554a90c70d7e3 | [
"BSD-3-Clause"
] | 8 | 2019-11-21T15:31:26.000Z | 2022-03-23T11:49:44.000Z | tests/test_cache.py | emmett-framework/renoir | cdd3047a4fbd31d2e2b6bc51270554a90c70d7e3 | [
"BSD-3-Clause"
] | 1 | 2021-10-05T13:41:14.000Z | 2021-10-08T14:31:36.000Z | tests/test_cache.py | emmett-framework/renoir | cdd3047a4fbd31d2e2b6bc51270554a90c70d7e3 | [
"BSD-3-Clause"
] | 1 | 2021-09-14T17:33:32.000Z | 2021-09-14T17:33:32.000Z | # -*- coding: utf-8 -*-
"""
tests.cache
-----------
Tests cache module.
"""
import pytest
from renoir import Renoir
@pytest.fixture(scope='function')
def templater_reload():
return Renoir(reload=True)
@pytest.fixture(scope='function')
def templater_noreload():
return Renoir()
def test_norel... | 30.259259 | 68 | 0.695226 |
import pytest
from renoir import Renoir
@pytest.fixture(scope='function')
def templater_reload():
return Renoir(reload=True)
@pytest.fixture(scope='function')
def templater_noreload():
return Renoir()
def test_noreload(templater_noreload):
assert not templater_noreload.cache.parse.data
templat... | true | true |
f747e46453b6290503568ca647af7e1a8a03a034 | 803 | py | Python | Documentacao/17-retroprojecao.py | Lucas-Marcelino/CV_Pi-VII | a7fdc0955e9710f351a7d16278de2093e9e84c69 | [
"MIT"
] | null | null | null | Documentacao/17-retroprojecao.py | Lucas-Marcelino/CV_Pi-VII | a7fdc0955e9710f351a7d16278de2093e9e84c69 | [
"MIT"
] | null | null | null | Documentacao/17-retroprojecao.py | Lucas-Marcelino/CV_Pi-VII | a7fdc0955e9710f351a7d16278de2093e9e84c69 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
roi = cv2.imread('banana.jpg')
hsv = cv2.cvtColor(roi,cv2.COLOR_BGR2HSV)
target = cv2.imread('banana_recortada.png')
hsvt = cv2.cvtColor(target,cv2.COLOR_BGR2HSV)
# calculating object histogram
roihist = cv2.calcHist([hsv],[0, 1], None, [180, 256], [0, 180, 0, 256] )
# normalize histog... | 29.740741 | 73 | 0.742217 | import cv2
import numpy as np
roi = cv2.imread('banana.jpg')
hsv = cv2.cvtColor(roi,cv2.COLOR_BGR2HSV)
target = cv2.imread('banana_recortada.png')
hsvt = cv2.cvtColor(target,cv2.COLOR_BGR2HSV)
roihist = cv2.calcHist([hsv],[0, 1], None, [180, 256], [0, 180, 0, 256] )
cv2.normalize(roihist,roihist,0,255,cv2.NORM_MI... | true | true |
f747e501851a7be89547c5f25c6d3c3736335de1 | 1,343 | py | Python | Lib/site-packages/tensorflow_probability/python/random/_numpy/__init__.py | caiyongji/tf2.3.1-py3.7.9-full-built | ace4efcbf05b2b494388739718a18c13eab83c71 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Lib/site-packages/tensorflow_probability/python/random/_numpy/__init__.py | caiyongji/tf2.3.1-py3.7.9-full-built | ace4efcbf05b2b494388739718a18c13eab83c71 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Lib/site-packages/tensorflow_probability/python/random/_numpy/__init__.py | caiyongji/tf2.3.1-py3.7.9-full-built | ace4efcbf05b2b494388739718a18c13eab83c71 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | # Copyright 2020 The TensorFlow Probability Authors.
#
# 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 o... | 38.371429 | 138 | 0.756515 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow_probability.python.internal._numpy.samplers import split_seed
from tensorflow_probability.python.random._numpy.random_ops import rademacher
from tensorflow_probability.python.rand... | true | true |
f747e57ab4cf9eff392cb46aafcb35db355463ef | 21,636 | py | Python | django/core/management/base.py | vincepandolfo/django | 67cf5efa31acb2916034afb15610b700695dfcb0 | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2017-01-11T06:27:15.000Z | 2017-01-11T06:27:15.000Z | django/core/management/base.py | vincepandolfo/django | 67cf5efa31acb2916034afb15610b700695dfcb0 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | django/core/management/base.py | vincepandolfo/django | 67cf5efa31acb2916034afb15610b700695dfcb0 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Base classes for writing management commands (named commands which can
be executed through ``django-admin`` or ``manage.py``).
"""
from __future__ import unicode_literals
import os
import sys
from argparse import ArgumentParser
import django
from django.core import checks
from django.core.... | 40.141002 | 114 | 0.626271 |
from __future__ import unicode_literals
import os
import sys
from argparse import ArgumentParser
import django
from django.core import checks
from django.core.exceptions import ImproperlyConfigured
from django.core.management.color import color_style, no_style
from django.db import DEFAULT_DB_ALIAS, connections
from... | true | true |
f747ebbe51bada1aecde31e5c933c44f57d99265 | 3,980 | py | Python | kafkaesk/metrics.py | onna/kafkaesk | 31480c476a420faebc23cd763b4b039b9378c9f6 | [
"BSD-2-Clause"
] | 24 | 2020-05-18T08:46:18.000Z | 2021-11-01T12:51:54.000Z | kafkaesk/metrics.py | onna/kafkaesk | 31480c476a420faebc23cd763b4b039b9378c9f6 | [
"BSD-2-Clause"
] | 40 | 2020-05-18T20:50:46.000Z | 2021-08-24T17:28:29.000Z | kafkaesk/metrics.py | onna/kafkaesk | 31480c476a420faebc23cd763b4b039b9378c9f6 | [
"BSD-2-Clause"
] | 3 | 2020-09-01T12:08:04.000Z | 2021-01-05T10:11:22.000Z | from prometheus_client.utils import INF
from typing import Dict
from typing import Optional
from typing import Type
import prometheus_client as client
import time
import traceback
NOERROR = "none"
ERROR_GENERAL_EXCEPTION = "exception"
KAFKA_ACTION = client.Counter(
"kafkaesk_kafka_action",
"Perform action on... | 27.07483 | 98 | 0.668593 | from prometheus_client.utils import INF
from typing import Dict
from typing import Optional
from typing import Type
import prometheus_client as client
import time
import traceback
NOERROR = "none"
ERROR_GENERAL_EXCEPTION = "exception"
KAFKA_ACTION = client.Counter(
"kafkaesk_kafka_action",
"Perform action on... | true | true |
f747ebd8ee74f27d0ef19098424892a4ca849c37 | 24,838 | py | Python | tests/HTMLTestRunner.py | amanttr/splunk-website-monitoring | 4c8093eebda32892c173e23a1e535cded1311ebd | [
"MIT"
] | 45 | 2015-04-15T15:00:38.000Z | 2021-10-16T21:42:47.000Z | tests/HTMLTestRunner.py | amanttr/splunk-website-monitoring | 4c8093eebda32892c173e23a1e535cded1311ebd | [
"MIT"
] | 43 | 2015-01-20T20:41:34.000Z | 2022-02-25T13:14:57.000Z | tests/HTMLTestRunner.py | amanttr/splunk-website-monitoring | 4c8093eebda32892c173e23a1e535cded1311ebd | [
"MIT"
] | 19 | 2015-09-18T19:50:54.000Z | 2021-12-06T18:52:52.000Z | # -*- coding: utf-8 -*-
"""
A TestRunner for use with the Python unit testing framework. It
generates a HTML report to show the result at a glance.
The simplest way to use this is to invoke its main method. E.g.
import unittest
import HTMLTestRunner
... define your tests ...
if __name__ == '__main__... | 29.67503 | 109 | 0.545736 |
"""
A TestRunner for use with the Python unit testing framework. It
generates a HTML report to show the result at a glance.
The simplest way to use this is to invoke its main method. E.g.
import unittest
import HTMLTestRunner
... define your tests ...
if __name__ == '__main__':
HTMLTestRunn... | false | true |
f747ec0fea90ad0b2ca831ce56e87ede2c5cc20c | 6,403 | py | Python | Function.py | LoLongE/FaceRecognition | 5730e1e49fe15c295d002c760e7c1b2491113609 | [
"MIT"
] | null | null | null | Function.py | LoLongE/FaceRecognition | 5730e1e49fe15c295d002c760e7c1b2491113609 | [
"MIT"
] | null | null | null | Function.py | LoLongE/FaceRecognition | 5730e1e49fe15c295d002c760e7c1b2491113609 | [
"MIT"
] | null | null | null | # DB Server http://192.168.0.154:8080
import face_recognition_api
import cv2
import os
import pickle
import datetime
import cx_Oracle
import pandas as pd
import csv
def getTime(type_print):
if type_print == 1:
return datetime.datetime.now().strftime('%Y-%m-%d %H-%M')
else:
return datetime.datet... | 37.664706 | 151 | 0.626269 |
import face_recognition_api
import cv2
import os
import pickle
import datetime
import cx_Oracle
import pandas as pd
import csv
def getTime(type_print):
if type_print == 1:
return datetime.datetime.now().strftime('%Y-%m-%d %H-%M')
else:
return datetime.datetime.now()
def makeDir(dir_name):
... | true | true |
f747ec213bba05ecb5368e4fb2691ca032353b46 | 3,051 | py | Python | _setup/models/setup_functions/import_setup.py | marcoEDU/HackerspaceWebsiteTemplate | 29621a5f5daef7a8073f368b7d95a1df654c8ba9 | [
"MIT"
] | 9 | 2019-11-04T04:46:08.000Z | 2019-12-29T22:24:38.000Z | _setup/models/setup_functions/import_setup.py | marcoEDU/HackerspaceWebsiteTemplate | 29621a5f5daef7a8073f368b7d95a1df654c8ba9 | [
"MIT"
] | 27 | 2020-02-17T17:57:00.000Z | 2020-04-23T20:25:44.000Z | _setup/models/setup_functions/import_setup.py | marcoEDU/HackerspaceWebsiteTemplate | 29621a5f5daef7a8073f368b7d95a1df654c8ba9 | [
"MIT"
] | 4 | 2020-02-17T13:39:18.000Z | 2020-04-12T07:56:45.000Z | from _setup.models import Log, Cronjob, Config, Secret
import os
from django.contrib.auth import get_user_model
import secrets
import json
class SetupImport():
def __init__(self, backup_files, test=False):
self.backup_files = backup_files
self.test = test
folders = os.listdir()
fo... | 38.620253 | 146 | 0.549656 | from _setup.models import Log, Cronjob, Config, Secret
import os
from django.contrib.auth import get_user_model
import secrets
import json
class SetupImport():
def __init__(self, backup_files, test=False):
self.backup_files = backup_files
self.test = test
folders = os.listdir()
fo... | true | true |
f747ed086e2335302ac4d02caa64777c5503ff01 | 669 | py | Python | prototypes/test_george.py | fqhuy/minimind | 627ef0edeabc0c952c9439ca4eccac5a9aaf68ae | [
"MIT"
] | 11 | 2017-06-09T10:00:48.000Z | 2021-02-21T11:12:22.000Z | prototypes/test_george.py | fqhuy/minimind | 627ef0edeabc0c952c9439ca4eccac5a9aaf68ae | [
"MIT"
] | null | null | null | prototypes/test_george.py | fqhuy/minimind | 627ef0edeabc0c952c9439ca4eccac5a9aaf68ae | [
"MIT"
] | null | null | null | import sys
sys.path.append('/Users/phanquochuy/Projects/minimind/prototypes/george/build/lib.macosx-10.10-x86_64-2.7')
import numpy as np
import george
from george.kernels import ExpSquaredKernel
# Generate some fake noisy data.
x = 10 * np.sort(np.random.rand(10))
yerr = 0.2 * np.ones_like(x)
y = np.sin(x) + yerr * n... | 26.76 | 107 | 0.727952 | import sys
sys.path.append('/Users/phanquochuy/Projects/minimind/prototypes/george/build/lib.macosx-10.10-x86_64-2.7')
import numpy as np
import george
from george.kernels import ExpSquaredKernel
x = 10 * np.sort(np.random.rand(10))
yerr = 0.2 * np.ones_like(x)
y = np.sin(x) + yerr * np.random.randn(len(x))
kernel ... | true | true |
f747eda8a696c3cce92c3792d3cc11fbfec924cf | 5,402 | py | Python | api/tests.py | Wholefolio/marketmanager | 5a8314707806a6790c507e1bd817891e8dc88811 | [
"Apache-2.0"
] | null | null | null | api/tests.py | Wholefolio/marketmanager | 5a8314707806a6790c507e1bd817891e8dc88811 | [
"Apache-2.0"
] | null | null | null | api/tests.py | Wholefolio/marketmanager | 5a8314707806a6790c507e1bd817891e8dc88811 | [
"Apache-2.0"
] | null | null | null | """Tests for the marketmanager API."""
from django.test import TestCase
from rest_framework.test import APIClient
from rest_framework import status
from django.urls import reverse
from api import models
def check_response_items(request, response, test_object):
"""Check the response for missing data from the requ... | 39.430657 | 79 | 0.584043 | from django.test import TestCase
from rest_framework.test import APIClient
from rest_framework import status
from django.urls import reverse
from api import models
def check_response_items(request, response, test_object):
if response.status_code != status.HTTP_201_CREATED\
and response.status_code != stat... | true | true |
f747ee3fbf892897f6948648be62a4e4a1dbfd24 | 7,555 | py | Python | nuitka/Tracing.py | jvalduvieco/Nuitka | b93046d5d1c162d416d392d835790936d15a2cf8 | [
"Apache-2.0"
] | null | null | null | nuitka/Tracing.py | jvalduvieco/Nuitka | b93046d5d1c162d416d392d835790936d15a2cf8 | [
"Apache-2.0"
] | null | null | null | nuitka/Tracing.py | jvalduvieco/Nuitka | b93046d5d1c162d416d392d835790936d15a2cf8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | 28.726236 | 86 | 0.642753 |
from __future__ import print_function
import os
import sys
import traceback
from contextlib import contextmanager
from nuitka.utils.ThreadedExecutor import RLock
is_quiet = False
progress = None
def printIndented(level, *what):
print(" " * level, *what)
def printSeparator(level=0):
... | true | true |
f747ee58f7f28242455511b3daf96f42202e3d2e | 146 | py | Python | src/wai/annotations/adams/base/component/__init__.py | waikato-ufdl/wai-annotations-adams | 1cb1ecf9520eea43c392a07d7766da51551a3a20 | [
"Apache-2.0"
] | null | null | null | src/wai/annotations/adams/base/component/__init__.py | waikato-ufdl/wai-annotations-adams | 1cb1ecf9520eea43c392a07d7766da51551a3a20 | [
"Apache-2.0"
] | null | null | null | src/wai/annotations/adams/base/component/__init__.py | waikato-ufdl/wai-annotations-adams | 1cb1ecf9520eea43c392a07d7766da51551a3a20 | [
"Apache-2.0"
] | null | null | null | from ._ADAMSBaseReader import ADAMSBaseReader
from ._ADAMSBaseWriter import ADAMSBaseWriter
from ._ADAMSFilenameSource import ADAMSFilenameSource
| 36.5 | 53 | 0.89726 | from ._ADAMSBaseReader import ADAMSBaseReader
from ._ADAMSBaseWriter import ADAMSBaseWriter
from ._ADAMSFilenameSource import ADAMSFilenameSource
| true | true |
f747eeb6366a7b7fc453fec6ff16469465a90bda | 4,736 | py | Python | FIEK-TCP/TCPclient/TCPclient/TCPclient.py | BlertaMecini/FIEK-Protokolli | 20c42ee76015613659110aa1fab678e11d153936 | [
"MIT"
] | null | null | null | FIEK-TCP/TCPclient/TCPclient/TCPclient.py | BlertaMecini/FIEK-Protokolli | 20c42ee76015613659110aa1fab678e11d153936 | [
"MIT"
] | null | null | null | FIEK-TCP/TCPclient/TCPclient/TCPclient.py | BlertaMecini/FIEK-Protokolli | 20c42ee76015613659110aa1fab678e11d153936 | [
"MIT"
] | null | null | null | #-------------------SOCKET PROGRAMMING-------------------
#Krijimi i klient aplikacionit
import socket #Importojme librarine per socket komunikim ne mes te klientit dhe serverit
import sys #Importojme librarine sys
import time #Importojme librarine time
serverName = '127.0.0.1' #IP
serverPort = ... | 50.382979 | 126 | 0.646748 |
import socket
import sys
import time
serverName = '127.0.0.1'
serverPort = 14000
address=(serverName,serverPort)
try:
clientSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
except socket.error as err:
print("Soketi nuk ka mundur te krijohet!")
pri... | true | true |
f747f0b6592ee28aacf42471e80ab2682fbc402d | 17,020 | py | Python | confluent_server/confluent/discovery/protocols/ssdp.py | xcat2/confluent | 47a83f4628df48638c2aebbfbcddc1531aac20d0 | [
"Apache-2.0"
] | 27 | 2015-02-11T13:56:46.000Z | 2021-12-28T14:17:20.000Z | confluent_server/confluent/discovery/protocols/ssdp.py | jjohnson42/confluent | 47a83f4628df48638c2aebbfbcddc1531aac20d0 | [
"Apache-2.0"
] | 32 | 2015-09-23T13:19:04.000Z | 2022-03-15T13:50:45.000Z | confluent_server/confluent/discovery/protocols/ssdp.py | xcat2/confluent | 47a83f4628df48638c2aebbfbcddc1531aac20d0 | [
"Apache-2.0"
] | 24 | 2015-07-14T20:41:55.000Z | 2021-07-15T04:18:51.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2017 Lenovo
#
# 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 ... | 42.55 | 150 | 0.499177 |
import confluent.config.configmanager as cfm
import confluent.collective.manager as collective
import confluent.neighutil as neighutil
import confluent.noderange as noderange
import confluent.util as util
import confluent.log as log
import confluent.netutil as netutil
import eventlet
impor... | true | true |
f747f0b95823bd33777bdd42cef54b1cc6917472 | 484 | py | Python | http_request/request_utils.py | ivanlevsky/cowabunga-potato | ab317582b7b8f99d7be3ea4f5edbe9829fc398fb | [
"MIT"
] | null | null | null | http_request/request_utils.py | ivanlevsky/cowabunga-potato | ab317582b7b8f99d7be3ea4f5edbe9829fc398fb | [
"MIT"
] | null | null | null | http_request/request_utils.py | ivanlevsky/cowabunga-potato | ab317582b7b8f99d7be3ea4f5edbe9829fc398fb | [
"MIT"
] | null | null | null | import requests,base64
def request_download_file_by_url(download_url, file_name):
r = requests.get(download_url)
with open(file_name, 'wb') as f:
f.write(r.content)
def request_get_rss_news(rss_url):
try:
r = requests.get(rss_url)
# print(r.encoding)
print(r.text)
... | 24.2 | 67 | 0.650826 | import requests,base64
def request_download_file_by_url(download_url, file_name):
r = requests.get(download_url)
with open(file_name, 'wb') as f:
f.write(r.content)
def request_get_rss_news(rss_url):
try:
r = requests.get(rss_url)
print(r.text)
return print('The ... | true | true |
f747f10f9f77f4ab1efbd077ff59e363bac58caa | 33,426 | py | Python | gb_yolact.py | ho0-kim/yolact_edge | f2b4a0db5505d2b16f9212d0ffc1072e09282b01 | [
"MIT"
] | null | null | null | gb_yolact.py | ho0-kim/yolact_edge | f2b4a0db5505d2b16f9212d0ffc1072e09282b01 | [
"MIT"
] | null | null | null | gb_yolact.py | ho0-kim/yolact_edge | f2b4a0db5505d2b16f9212d0ffc1072e09282b01 | [
"MIT"
] | null | null | null | import torch, torchvision
import torch.nn as nn
import torch.nn.functional as F
from torchvision.models.resnet import Bottleneck, conv1x1, conv3x3
import numpy as np
from functools import partial
from itertools import product, chain
from math import sqrt
from typing import List, Tuple
use_torch2trt = False
use_jit = ... | 39.510638 | 267 | 0.602884 | import torch, torchvision
import torch.nn as nn
import torch.nn.functional as F
from torchvision.models.resnet import Bottleneck, conv1x1, conv3x3
import numpy as np
from functools import partial
from itertools import product, chain
from math import sqrt
from typing import List, Tuple
use_torch2trt = False
use_jit = ... | true | true |
f747f17175c6f52ae99009332497137eae1f81cc | 63 | py | Python | marshmallow_dumped_order/__init__.py | maximdanilchenko/marshmallow-dumped-order | b266ca795a1563e49f33d01d394c69915e8535a8 | [
"MIT"
] | null | null | null | marshmallow_dumped_order/__init__.py | maximdanilchenko/marshmallow-dumped-order | b266ca795a1563e49f33d01d394c69915e8535a8 | [
"MIT"
] | null | null | null | marshmallow_dumped_order/__init__.py | maximdanilchenko/marshmallow-dumped-order | b266ca795a1563e49f33d01d394c69915e8535a8 | [
"MIT"
] | null | null | null | from marshmallow_dumped_order.dumped_order import dumped_order
| 31.5 | 62 | 0.920635 | from marshmallow_dumped_order.dumped_order import dumped_order
| true | true |
f747f17bc30f17494e62e63ba9acc1e119bc5314 | 457 | py | Python | aos/utils.py | azdolinski/apstra-api-python | 2380bcdbd5be31e552d9259592249b13fa432286 | [
"Apache-2.0"
] | null | null | null | aos/utils.py | azdolinski/apstra-api-python | 2380bcdbd5be31e552d9259592249b13fa432286 | [
"Apache-2.0"
] | null | null | null | aos/utils.py | azdolinski/apstra-api-python | 2380bcdbd5be31e552d9259592249b13fa432286 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020-present, Apstra, Inc. All rights reserved.
#
# This source code is licensed under End User License Agreement found in the
# LICENSE file at http://www.apstra.com/eula
import logging
logger = logging.getLogger(__name__)
def redacted(d):
if d is None or d == '':
return d
h = d.copy()
... | 24.052632 | 76 | 0.647702 |
import logging
logger = logging.getLogger(__name__)
def redacted(d):
if d is None or d == '':
return d
h = d.copy()
for sensitive in ["password", "token", "AuthToken"]:
if sensitive in d:
h[sensitive] = "<REDACTED>"
return h
| true | true |
f747f19635ebb6db7b6d9693bf80954ced252015 | 8,507 | py | Python | Ibex2010Sma.py | isaacdlp/pyalgosamples | e1a6504c6cd0d906ef082c81037b59b137a99105 | [
"Apache-2.0"
] | 3 | 2017-12-01T16:21:54.000Z | 2020-03-17T01:55:21.000Z | Ibex2010Sma.py | isaacdlp/pyalgosamples | e1a6504c6cd0d906ef082c81037b59b137a99105 | [
"Apache-2.0"
] | 1 | 2019-04-17T06:17:09.000Z | 2020-05-26T04:00:16.000Z | Ibex2010Sma.py | isaacdlp/pyalgosamples | e1a6504c6cd0d906ef082c81037b59b137a99105 | [
"Apache-2.0"
] | 2 | 2017-11-23T10:01:04.000Z | 2019-11-06T15:35:41.000Z | # PyAlgoSamples
# Examples using the PyAlgoTrade Library
#
# Copyright 2015-2017 Isaac de la Pena
#
# 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-... | 39.752336 | 169 | 0.671447 |
from pyalgotrade import strategy, plotter
from pyalgotrade.barfeed import yahoofeed
from pyalgotrade.technical import ma
from pyalgotrade.stratanalyzer import drawdown, returns, sharpe, trades
from pyalgotrade.utils import stats
from pyalgoext import volatility
import Ibex2010Assets as assets
import p... | true | true |
f747f563af3007367fe70ba6b7289bc1f769364c | 2,417 | py | Python | tests/test_responder_expiration.py | Frederick888/postfix-mta-sts-resolver | 1e9d135a4dacc28e9f772a67bb51eeb2cc485981 | [
"MIT"
] | 77 | 2018-09-30T18:41:57.000Z | 2022-03-15T06:07:17.000Z | tests/test_responder_expiration.py | Frederick888/postfix-mta-sts-resolver | 1e9d135a4dacc28e9f772a67bb51eeb2cc485981 | [
"MIT"
] | 36 | 2018-10-25T08:08:31.000Z | 2022-01-30T18:42:01.000Z | tests/test_responder_expiration.py | Frederick888/postfix-mta-sts-resolver | 1e9d135a4dacc28e9f772a67bb51eeb2cc485981 | [
"MIT"
] | 21 | 2018-10-25T08:08:46.000Z | 2022-02-16T22:42:43.000Z | import asyncio
import tempfile
import os
import contextlib
import pytest
from postfix_mta_sts_resolver import netstring
from postfix_mta_sts_resolver.responder import STSSocketmapResponder
import postfix_mta_sts_resolver.utils as utils
import postfix_mta_sts_resolver.base_cache as base_cache
@contextlib.contextmanag... | 30.987179 | 81 | 0.553579 | import asyncio
import tempfile
import os
import contextlib
import pytest
from postfix_mta_sts_resolver import netstring
from postfix_mta_sts_resolver.responder import STSSocketmapResponder
import postfix_mta_sts_resolver.utils as utils
import postfix_mta_sts_resolver.base_cache as base_cache
@contextlib.contextmanag... | true | true |
f747f708b0cfb50f03f754b472cc195e57ba0c33 | 340 | py | Python | pyg/utils.py | Talendar/pyg | 40ef082e11f7e9be0c3f233fa0a1d76deda31285 | [
"MIT"
] | null | null | null | pyg/utils.py | Talendar/pyg | 40ef082e11f7e9be0c3f233fa0a1d76deda31285 | [
"MIT"
] | null | null | null | pyg/utils.py | Talendar/pyg | 40ef082e11f7e9be0c3f233fa0a1d76deda31285 | [
"MIT"
] | null | null | null | """ Utility types and functions.
"""
from __future__ import annotations
#: Represents a coordinate (x and y positions) in a plane.
Coord2D = tuple[float, float]
#: Represents a coordinate (x, y and z positions) in a 3D space.
Coord3D = tuple[float, float, float]
#: Represents a color (RGBA).
Color = tuple[float, f... | 22.666667 | 64 | 0.714706 |
from __future__ import annotations
Coord2D = tuple[float, float]
Coord3D = tuple[float, float, float]
Color = tuple[float, float, float, float]
| true | true |
f747f7ec75c077c1481d55bcc3a0f88f142d21ea | 3,747 | py | Python | source/s3auditor.py | collectivehealth/CloudScan | 325701933bc62715aa7140df5120f381929e740b | [
"Apache-2.0"
] | 2 | 2020-03-07T18:20:23.000Z | 2020-03-07T18:20:26.000Z | source/s3auditor.py | td4b/CloudScan | 325701933bc62715aa7140df5120f381929e740b | [
"Apache-2.0"
] | 2 | 2021-03-05T19:12:11.000Z | 2021-03-20T03:03:54.000Z | source/s3auditor.py | td4b/CloudScan | 325701933bc62715aa7140df5120f381929e740b | [
"Apache-2.0"
] | 3 | 2020-03-07T18:22:13.000Z | 2021-03-05T21:27:13.000Z | import boto3, pickle, redis, json, logging, json_logging, sys
from botocore.exceptions import ClientError
from session import assume_role, s3_session
from crypt import encrypt, decrypt
# log is initialized without a web framework name
json_logging.ENABLE_JSON_LOGGING = True
json_logging.init_non_web()
log = logging.... | 42.579545 | 200 | 0.601014 | import boto3, pickle, redis, json, logging, json_logging, sys
from botocore.exceptions import ClientError
from session import assume_role, s3_session
from crypt import encrypt, decrypt
json_logging.ENABLE_JSON_LOGGING = True
json_logging.init_non_web()
log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)
l... | true | true |
f747f818e3265ca6555f16123491dfdf0405a4be | 1,098 | py | Python | featuretools_tsfresh_primitives/percentage_of_reoccurring_datapoints_to_all_datapoints.py | jeffzi/featuretools-tsfresh-primitives | 35a885215a8633a3d4936fb11d1e87d8b91e27de | [
"MIT"
] | 19 | 2019-05-13T22:28:31.000Z | 2020-12-29T18:47:54.000Z | featuretools_tsfresh_primitives/percentage_of_reoccurring_datapoints_to_all_datapoints.py | jeffzi/featuretools-tsfresh-primitives | 35a885215a8633a3d4936fb11d1e87d8b91e27de | [
"MIT"
] | 32 | 2019-05-13T22:35:43.000Z | 2021-03-09T17:02:11.000Z | featuretools_tsfresh_primitives/percentage_of_reoccurring_datapoints_to_all_datapoints.py | jeffzi/featuretools-tsfresh-primitives | 35a885215a8633a3d4936fb11d1e87d8b91e27de | [
"MIT"
] | 10 | 2019-07-26T05:39:12.000Z | 2021-02-18T10:48:23.000Z | from featuretools.primitives import AggregationPrimitive
from featuretools.variable_types import Numeric
from tsfresh.feature_extraction.feature_calculators import \
percentage_of_reoccurring_datapoints_to_all_datapoints
class PercentageOfReoccurringDatapointsToAllDatapoints(AggregationPrimitive):
"""Returns ... | 42.230769 | 182 | 0.81694 | from featuretools.primitives import AggregationPrimitive
from featuretools.variable_types import Numeric
from tsfresh.feature_extraction.feature_calculators import \
percentage_of_reoccurring_datapoints_to_all_datapoints
class PercentageOfReoccurringDatapointsToAllDatapoints(AggregationPrimitive):
name = "per... | true | true |
f747fa735d7136a6b4f517d04cfd2d4b916a3cb7 | 6,439 | py | Python | sdk/python/pulumi_azure_native/storage/v20200801preview/table_service_properties.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/storage/v20200801preview/table_service_properties.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/storage/v20200801preview/table_service_properties.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 52.349593 | 732 | 0.683802 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
from ._inputs import *
__all__ = ['TableServiceProperties']
class TableServiceProperties(pulumi.CustomResource):
def __init__(__self__,
... | true | true |
f747fa9a0a6e15ffa69e461828ceff7f98c9fd01 | 1,349 | py | Python | src/plugins/APPLE_MOBILITY/utils.py | johnharveymath/fetchers-python | c0049c2ea5731c850c5dbcf9602b51d7393a92f6 | [
"Apache-2.0"
] | 4 | 2020-04-03T16:20:08.000Z | 2020-07-06T10:16:44.000Z | src/plugins/APPLE_MOBILITY/utils.py | johnharveymath/fetchers-python | c0049c2ea5731c850c5dbcf9602b51d7393a92f6 | [
"Apache-2.0"
] | 15 | 2020-04-28T19:47:58.000Z | 2020-10-20T12:18:59.000Z | src/plugins/APPLE_MOBILITY/utils.py | yuewu57/fetchers-python | 1f5fc7b64f43142991ad0d901b0840b3e8ef1382 | [
"Apache-2.0"
] | 26 | 2020-03-31T13:14:50.000Z | 2021-06-23T21:02:54.000Z | # Copyright (C) 2020 University of Oxford
#
# 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 t... | 35.5 | 118 | 0.702001 |
import io
import requests
import pandas as pd
from pandas import DataFrame
from datetime import date, timedelta
from requests.exceptions import ConnectionError
def get_recent_apple_mobility_data() -> DataFrame:
baseurl = 'https://covid19-static.cdn-apple.com/covid19-mobility-data/current/v3/en-us/ap... | true | true |
f747fac30432c24ecc43d6ae6070a605107cc9a2 | 1,906 | py | Python | crits/dashboards/dashboard.py | puhley/crits | 9870f2d449295c272402af73b5b335e2494b61f3 | [
"MIT"
] | null | null | null | crits/dashboards/dashboard.py | puhley/crits | 9870f2d449295c272402af73b5b335e2494b61f3 | [
"MIT"
] | null | null | null | crits/dashboards/dashboard.py | puhley/crits | 9870f2d449295c272402af73b5b335e2494b61f3 | [
"MIT"
] | null | null | null | from crits.core.crits_mongoengine import CritsDocument, CritsSchemaDocument
from mongoengine import DynamicDocument, ListField, ObjectIdField, StringField, DictField, IntField, BooleanField
class SavedSearch(CritsDocument, CritsSchemaDocument, DynamicDocument):
"""
savedSearch class
"""
meta = {
... | 37.372549 | 113 | 0.666842 | from crits.core.crits_mongoengine import CritsDocument, CritsSchemaDocument
from mongoengine import DynamicDocument, ListField, ObjectIdField, StringField, DictField, IntField, BooleanField
class SavedSearch(CritsDocument, CritsSchemaDocument, DynamicDocument):
meta = {
"collection": "saved_search",
... | true | true |
f747fbe0f66a31cd159202fb9a12d62b0eedb287 | 179,890 | py | Python | zerver/tests/test_signup.py | enpuyou/zulip | 5c5303bf25b5373ad5ce523681ddf1dae6fb0db9 | [
"Apache-2.0"
] | null | null | null | zerver/tests/test_signup.py | enpuyou/zulip | 5c5303bf25b5373ad5ce523681ddf1dae6fb0db9 | [
"Apache-2.0"
] | null | null | null | zerver/tests/test_signup.py | enpuyou/zulip | 5c5303bf25b5373ad5ce523681ddf1dae6fb0db9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime
from email.utils import parseaddr
from django.conf import settings
from django.contrib.auth.views import INTERNAL_RESET_URL_TOKEN
from django.contrib.contenttypes.models import ContentType
from django.http import HttpResponse
from django.test import TestCase, override_settings
f... | 46.495218 | 127 | 0.63232 |
import datetime
from email.utils import parseaddr
from django.conf import settings
from django.contrib.auth.views import INTERNAL_RESET_URL_TOKEN
from django.contrib.contenttypes.models import ContentType
from django.http import HttpResponse
from django.test import TestCase, override_settings
from django.utils.timezo... | true | true |
f747fdf4b78be1721e9a9fb41378d470d87f0410 | 2,460 | py | Python | env/Lib/site-packages/OpenGL/GLES2/OES/primitive_bounding_box.py | 5gconnectedbike/Navio2 | 8c3f2b5d8bbbcea1fc08739945183c12b206712c | [
"BSD-3-Clause"
] | 210 | 2016-04-09T14:26:00.000Z | 2022-03-25T18:36:19.000Z | env/Lib/site-packages/OpenGL/GLES2/OES/primitive_bounding_box.py | 5gconnectedbike/Navio2 | 8c3f2b5d8bbbcea1fc08739945183c12b206712c | [
"BSD-3-Clause"
] | 72 | 2016-09-04T09:30:19.000Z | 2022-03-27T17:06:53.000Z | env/Lib/site-packages/OpenGL/GLES2/OES/primitive_bounding_box.py | 5gconnectedbike/Navio2 | 8c3f2b5d8bbbcea1fc08739945183c12b206712c | [
"BSD-3-Clause"
] | 64 | 2016-04-09T14:26:49.000Z | 2022-03-21T11:19:47.000Z | '''OpenGL extension OES.primitive_bounding_box
This module customises the behaviour of the
OpenGL.raw.GLES2.OES.primitive_bounding_box to provide a more
Python-friendly API
Overview (from the spec)
On tile-based architectures, transformed primitives are generally written
out to memory before rasterization, and ... | 48.235294 | 77 | 0.815854 | from OpenGL import platform, constant, arrays
from OpenGL import extensions, wrapper
import ctypes
from OpenGL.raw.GLES2 import _types, _glgets
from OpenGL.raw.GLES2.OES.primitive_bounding_box import *
from OpenGL.raw.GLES2.OES.primitive_bounding_box import _EXTENSION_NAME
def glInitPrimitiveBoundingBoxOES():
from... | true | true |
f747fe812737d98dd76165b8ebd1cefbbc5c958e | 4,111 | py | Python | training/helpers/archived/WIP_train_mlbox-WIP.py | jim-schwoebel/allie | d85db041b91c81dfb3fd1a4d719b5aaaf3b6697e | [
"Apache-2.0"
] | 87 | 2020-08-07T09:05:11.000Z | 2022-01-24T00:48:22.000Z | training/helpers/archived/WIP_train_mlbox-WIP.py | jim-schwoebel/allie | d85db041b91c81dfb3fd1a4d719b5aaaf3b6697e | [
"Apache-2.0"
] | 87 | 2020-08-07T19:12:10.000Z | 2022-02-08T14:46:34.000Z | training/helpers/archived/WIP_train_mlbox-WIP.py | jim-schwoebel/allie | d85db041b91c81dfb3fd1a4d719b5aaaf3b6697e | [
"Apache-2.0"
] | 25 | 2020-08-07T20:03:08.000Z | 2022-03-16T07:33:25.000Z | import os, json, shutil, pickle
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score, mean_squared_log_error
import pandas as pd
print('installing library')
os.system('pip3 install mlbox==0.8.4')
from mlbox.preprocessing import *
from mlbox.optimisation import *
fr... | 29.789855 | 105 | 0.670396 | import os, json, shutil, pickle
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score, mean_squared_log_error
import pandas as pd
print('installing library')
os.system('pip3 install mlbox==0.8.4')
from mlbox.preprocessing import *
from mlbox.optimisation import *
fr... | true | true |
f747ffbbf3dbdaf229e283ae2351cbc6582235c1 | 7,727 | py | Python | qtpyvcp/app/launcher.py | robertspark/qtpyvcp | 247f6465ed3769d17f76f738dafa18eae96e62c8 | [
"BSD-3-Clause-LBNL",
"MIT"
] | 71 | 2018-12-13T20:31:18.000Z | 2022-03-26T08:44:22.000Z | qtpyvcp/app/launcher.py | robertspark/qtpyvcp | 247f6465ed3769d17f76f738dafa18eae96e62c8 | [
"BSD-3-Clause-LBNL",
"MIT"
] | 78 | 2019-01-10T18:16:33.000Z | 2022-03-18T19:30:49.000Z | qtpyvcp/app/launcher.py | robertspark/qtpyvcp | 247f6465ed3769d17f76f738dafa18eae96e62c8 | [
"BSD-3-Clause-LBNL",
"MIT"
] | 38 | 2018-10-10T19:02:26.000Z | 2022-01-30T04:38:14.000Z | import os
import sys
import time
import importlib
from pkg_resources import iter_entry_points
from qtpy.QtCore import Qt
from qtpy.QtWidgets import QApplication
import qtpyvcp
from qtpyvcp import hal
from qtpyvcp.utilities.logger import getLogger
from qtpyvcp.plugins import registerPluginFromClass, postGuiInitialiseP... | 31.668033 | 96 | 0.675942 | import os
import sys
import time
import importlib
from pkg_resources import iter_entry_points
from qtpy.QtCore import Qt
from qtpy.QtWidgets import QApplication
import qtpyvcp
from qtpyvcp import hal
from qtpyvcp.utilities.logger import getLogger
from qtpyvcp.plugins import registerPluginFromClass, postGuiInitialiseP... | true | true |
f747ffbe2981f5e22a39a404e108029c6091aa86 | 868 | py | Python | tests/test_stack.py | maxotar/datastructures | ba6c499e0bd894ff9b01557048e7a93d91774d39 | [
"MIT"
] | null | null | null | tests/test_stack.py | maxotar/datastructures | ba6c499e0bd894ff9b01557048e7a93d91774d39 | [
"MIT"
] | null | null | null | tests/test_stack.py | maxotar/datastructures | ba6c499e0bd894ff9b01557048e7a93d91774d39 | [
"MIT"
] | null | null | null | from datastructures.stack import Stack
def test_isEmpty_empty_stack():
myStack = Stack()
assert myStack.isEmpty()
def test_isEmpty_non_empty_stack():
myStack = Stack()
myStack.push(1)
assert not myStack.isEmpty()
def test_pop():
myStack = Stack()
myStack.push(2)
assert myStack.pop(... | 17.36 | 38 | 0.626728 | from datastructures.stack import Stack
def test_isEmpty_empty_stack():
myStack = Stack()
assert myStack.isEmpty()
def test_isEmpty_non_empty_stack():
myStack = Stack()
myStack.push(1)
assert not myStack.isEmpty()
def test_pop():
myStack = Stack()
myStack.push(2)
assert myStack.pop(... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.