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 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f719bf0a49a2168cb3b4abfd826a62d6032ed825 | 7,399 | py | Python | nova/api/openstack/compute/plugins/v3/cloudpipe.py | zaina/nova | 181358c172d606b23c9cc14b58d677d911013c02 | [
"Apache-2.0"
] | null | null | null | nova/api/openstack/compute/plugins/v3/cloudpipe.py | zaina/nova | 181358c172d606b23c9cc14b58d677d911013c02 | [
"Apache-2.0"
] | null | null | null | nova/api/openstack/compute/plugins/v3/cloudpipe.py | zaina/nova | 181358c172d606b23c9cc14b58d677d911013c02 | [
"Apache-2.0"
] | null | null | null | # Copyright 2011 OpenStack Foundation
#
# 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 a... | 37.368687 | 79 | 0.629274 |
from oslo_config import cfg
from oslo_utils import fileutils
from oslo_utils import timeutils
from webob import exc
from nova.api.openstack.compute.schemas.v3 import cloudpipe
from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova.api import validation
from nova.cloudpip... | true | true |
f719bfc6c7c129776e3b9c9595c4c130931fdd2d | 15,240 | py | Python | tempest/api/compute/servers/test_create_server.py | xavpaice/tempest | 958bd694df27511e0346d799876fe49331b8145c | [
"Apache-2.0"
] | 3 | 2016-07-15T12:27:23.000Z | 2021-04-23T04:41:10.000Z | tempest/api/compute/servers/test_create_server.py | LIS/lis-tempest | 8e6403b2d6de81c5d18ed867b4977385c8278b75 | [
"Apache-2.0"
] | null | null | null | tempest/api/compute/servers/test_create_server.py | LIS/lis-tempest | 8e6403b2d6de81c5d18ed867b4977385c8278b75 | [
"Apache-2.0"
] | 12 | 2016-07-14T18:13:05.000Z | 2017-07-08T18:45:42.000Z | # Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 42.569832 | 79 | 0.639764 |
import netaddr
import testtools
from tempest.api.compute import base
from tempest.common.utils import data_utils
from tempest.common.utils.linux import remote_client
from tempest.common import waiters
from tempest import config
from tempest import test
CONF = config.CONF
class ServersTestJSON(base.Ba... | true | true |
f719c272300d7b8fc3f56eac0566b018ef20c845 | 1,313 | py | Python | ooobuild/dyn/i18n/x_calendar4.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/i18n/x_calendar4.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/i18n/x_calendar4.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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 applicab... | 35.486486 | 74 | 0.760091 |
from typing import TYPE_CHECKING
from ooo.oenv.env_const import UNO_ENVIRONMENT, UNO_RUNTIME
_DYNAMIC = False
if (not TYPE_CHECKING) and UNO_RUNTIME and UNO_ENVIRONMENT:
_DYNAMIC = True
if not TYPE_CHECKING and _DYNAMIC:
from com.sun.star.i18n import XCalendar4 as XCalendar4
setattr(XCa... | true | true |
f719c298d161b599d989c8e2337e4c83af090b4b | 1,483 | py | Python | test/test_binary.py | teristam/openephys-fileIO | 8089e7c4aff829c13a79656b8812a3d3e68eb1eb | [
"MIT"
] | 1 | 2020-08-16T21:52:10.000Z | 2020-08-16T21:52:10.000Z | test/test_binary.py | teristam/openephys-fileIO | 8089e7c4aff829c13a79656b8812a3d3e68eb1eb | [
"MIT"
] | null | null | null | test/test_binary.py | teristam/openephys-fileIO | 8089e7c4aff829c13a79656b8812a3d3e68eb1eb | [
"MIT"
] | null | null | null | import numpy as np
from openephys_fileIO.fileIO import *
from openephys_fileIO.Binary import *
def test_write_binary_data():
# Test writing of binary data
dataFolder = 'test/data'
# Read the data in original int16 format
data,headers = load_OpenEphysRecording4BinaryFile(dataFolder,
num_d... | 29.66 | 90 | 0.710722 | import numpy as np
from openephys_fileIO.fileIO import *
from openephys_fileIO.Binary import *
def test_write_binary_data():
dataFolder = 'test/data'
data,headers = load_OpenEphysRecording4BinaryFile(dataFolder,
num_data_channel=1,num_aux_channel=1, num_adc_channel=1)
print(headers... | true | true |
f719c2d3c90414ada7ec442b5268bf062e2a60e0 | 23,986 | py | Python | ckan/logic/__init__.py | robbi5/ckan | e89ca125dc68ddb9fe9bad68a401404146ba90c7 | [
"BSD-3-Clause"
] | 6 | 2015-11-09T00:44:51.000Z | 2019-11-21T14:56:01.000Z | ckan/logic/__init__.py | robbi5/ckan | e89ca125dc68ddb9fe9bad68a401404146ba90c7 | [
"BSD-3-Clause"
] | 39 | 2015-02-18T17:32:23.000Z | 2022-03-11T18:03:36.000Z | ckan/logic/__init__.py | robbi5/ckan | e89ca125dc68ddb9fe9bad68a401404146ba90c7 | [
"BSD-3-Clause"
] | 17 | 2015-03-13T18:05:05.000Z | 2020-11-06T13:55:32.000Z | # encoding: utf-8
import inspect
import functools
import logging
import re
import importlib
import inspect
from collections import defaultdict
from werkzeug.utils import import_string
import six
from six import string_types, text_type
import ckan.model as model
import ckan.authz as authz
import ckan.lib.navl.dictiz... | 33.688202 | 79 | 0.627741 |
import inspect
import functools
import logging
import re
import importlib
import inspect
from collections import defaultdict
from werkzeug.utils import import_string
import six
from six import string_types, text_type
import ckan.model as model
import ckan.authz as authz
import ckan.lib.navl.dictization_functions a... | true | true |
f719c3d21c3cbd95489d2ede11b990e85803833d | 79 | py | Python | Chapter03/circle_call.py | PacktPublishing/Secret-Recipes-of-the-Python-Ninja | 805d00c7a54927ba94c9077e9a580508ee3c5e56 | [
"MIT"
] | 13 | 2018-06-21T01:44:49.000Z | 2021-12-01T10:49:53.000Z | Chapter03/circle_call.py | PacktPublishing/Secret-Recipes-of-the-Python-Ninja | 805d00c7a54927ba94c9077e9a580508ee3c5e56 | [
"MIT"
] | null | null | null | Chapter03/circle_call.py | PacktPublishing/Secret-Recipes-of-the-Python-Ninja | 805d00c7a54927ba94c9077e9a580508ee3c5e56 | [
"MIT"
] | 6 | 2018-10-05T08:29:24.000Z | 2022-01-11T14:49:50.000Z | r = input("Input radius: ")
diameter, circumference, area = circle_measures(r)
| 26.333333 | 50 | 0.734177 | r = input("Input radius: ")
diameter, circumference, area = circle_measures(r)
| true | true |
f719c48b433034a6d2941656747bb299c65248d8 | 9,652 | py | Python | QLearning.py | FlowerForAlgernon/ai_tetris | 7ac0d3875ad9b31fb260f7567a218e0de340c4e4 | [
"Apache-2.0"
] | 1 | 2021-12-19T14:07:37.000Z | 2021-12-19T14:07:37.000Z | QLearning.py | FlowerForAlgernon/ai_tetris | 7ac0d3875ad9b31fb260f7567a218e0de340c4e4 | [
"Apache-2.0"
] | null | null | null | QLearning.py | FlowerForAlgernon/ai_tetris | 7ac0d3875ad9b31fb260f7567a218e0de340c4e4 | [
"Apache-2.0"
] | null | null | null | """
这份代码使用 Q learning 算法训练并运行俄罗斯方块游戏 ai。其中简化状态空间的方法可参考论文 Adapting Reinforcement Learning to Tetris
"""
import numpy as np
from game import *
sub_well = 4
base = 7
def getStateIndex(field_width, field_height, field_map):
"""
因为每一列有 7 种不同的情况,所以采用七进制数来作为状态索引
"""
temp = [0 for _ in range(field_width)]... | 38 | 214 | 0.585993 |
import numpy as np
from game import *
sub_well = 4
base = 7
def getStateIndex(field_width, field_height, field_map):
temp = [0 for _ in range(field_width)]
convert = {}
for i in range(-(base - 1)//2, (base - 1)//2 + 1):
convert[i] = i + (base - 1)//2
for x in range(field_width):
wh... | true | true |
f719c4a70ee2814bd930a3c19d9d0b1401f193f9 | 834 | py | Python | pyvat/result.py | Alex-Espressone/pyvat | 266559c9d8af2aee7ecea3aed52a517181a412c8 | [
"Apache-2.0"
] | 48 | 2015-07-22T12:02:20.000Z | 2022-02-07T16:54:13.000Z | pyvat/result.py | Alex-Espressone/pyvat | 266559c9d8af2aee7ecea3aed52a517181a412c8 | [
"Apache-2.0"
] | 34 | 2015-03-27T17:47:38.000Z | 2022-02-08T18:14:55.000Z | pyvat/result.py | Alex-Espressone/pyvat | 266559c9d8af2aee7ecea3aed52a517181a412c8 | [
"Apache-2.0"
] | 40 | 2015-04-08T14:03:06.000Z | 2022-02-09T12:29:04.000Z | class VatNumberCheckResult(object):
"""Result of a VAT number validation check.
:ivar is_valid:
Boolean value indicating if the checked VAT number was deemed to be
valid. ``True`` if the VAT number is valid or ``False`` if the VAT
number is positively invalid.
:ivar log_lines:
... | 36.26087 | 77 | 0.641487 | class VatNumberCheckResult(object):
def __init__(self,
is_valid=None,
log_lines=None,
business_name=None,
business_address=None):
self.is_valid = is_valid
self.log_lines = log_lines or []
self.business_name = business_name
... | true | true |
f719c4d93ac3ade1ce4c3daeee9db9db01e404b2 | 2,209 | py | Python | source code/Data Visualization.py | starkworld/Python-Course-work | 28715f079939129b442aedcd7edb2e0838886ba0 | [
"Apache-2.0"
] | null | null | null | source code/Data Visualization.py | starkworld/Python-Course-work | 28715f079939129b442aedcd7edb2e0838886ba0 | [
"Apache-2.0"
] | null | null | null | source code/Data Visualization.py | starkworld/Python-Course-work | 28715f079939129b442aedcd7edb2e0838886ba0 | [
"Apache-2.0"
] | null | null | null | """
Author : nkalyan🤠
implementing Python Scripts on reading and returning the name no of mails that sent each day in week
and plot/display them in bar graph
I wrote code In counting to count the number of emails sent by each distinct user. That code may be helpful for this assignment.
"""
import matplotlib.py... | 32.970149 | 132 | 0.557718 |
import matplotlib.pyplot as plt
from os import getcwd
def file_path():
file_name = input("Enter the file name:")
return file_name
def pop_values(filename):
file_name = filename
try:
fp = open(file_name, "r")
except FileNotFoundError:
... | true | true |
f719c4fee092036cf2a37dc220d4280aca8e4828 | 665 | py | Python | full-problems/studentRecord.py | vikas-t/DS-Algo | ea654d1cad5374c824c52da9d3815a9546eb43fa | [
"Apache-2.0"
] | null | null | null | full-problems/studentRecord.py | vikas-t/DS-Algo | ea654d1cad5374c824c52da9d3815a9546eb43fa | [
"Apache-2.0"
] | null | null | null | full-problems/studentRecord.py | vikas-t/DS-Algo | ea654d1cad5374c824c52da9d3815a9546eb43fa | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
#https://practice.geeksforgeeks.org/problems/student-record/0
def sol(records, n):
mx = 0
res = []
for ni in range(0, n*4, 4):
am = sum(map(int, records[ni+1:ni+4]))//3
if am > mx:
# If we find a better average overwrite the result list
# with the ... | 33.25 | 67 | 0.557895 |
def sol(records, n):
mx = 0
res = []
for ni in range(0, n*4, 4):
am = sum(map(int, records[ni+1:ni+4]))//3
if am > mx:
mx = am
res = [(records[ni], am)]
elif am == mx:
res.append((records[ni], am))
for ... | true | true |
f719c541df617120f9d4a9a665699e9251dae5ac | 1,425 | py | Python | angrmanagement/plugins/bughouse/data/component_tree.py | DennyDai/angr-management | 8a4ba5dafbf2f4d2ba558528a0d1ae099a199a04 | [
"BSD-2-Clause"
] | 474 | 2015-08-10T17:47:15.000Z | 2022-03-31T21:10:55.000Z | angrmanagement/plugins/bughouse/data/component_tree.py | DennyDai/angr-management | 8a4ba5dafbf2f4d2ba558528a0d1ae099a199a04 | [
"BSD-2-Clause"
] | 355 | 2015-08-17T09:35:53.000Z | 2022-03-31T21:29:52.000Z | angrmanagement/plugins/bughouse/data/component_tree.py | DennyDai/angr-management | 8a4ba5dafbf2f4d2ba558528a0d1ae099a199a04 | [
"BSD-2-Clause"
] | 95 | 2015-08-11T14:36:12.000Z | 2022-03-31T23:01:01.000Z | from typing import List, Optional
class ComponentFunction:
__slots__ = ('mapped_base', 'virtual_addr', 'symbol_name', )
def __init__(self, mapped_base: int, virtual_addr: int, symbol_name: Optional[str]=None):
self.mapped_base = mapped_base
self.virtual_addr = virtual_addr
self.symbo... | 32.386364 | 99 | 0.627368 | from typing import List, Optional
class ComponentFunction:
__slots__ = ('mapped_base', 'virtual_addr', 'symbol_name', )
def __init__(self, mapped_base: int, virtual_addr: int, symbol_name: Optional[str]=None):
self.mapped_base = mapped_base
self.virtual_addr = virtual_addr
self.symbo... | true | true |
f719c5dcecb268d37900df93c57ea65672756916 | 2,829 | py | Python | analysis/stats.py | jasonrute/puzzle_cube | 7e05a21acd26cb30e729ba6a95e14e16c76c1780 | [
"MIT"
] | 81 | 2018-06-17T17:02:24.000Z | 2021-11-05T07:16:12.000Z | analysis/stats.py | jasonrute/puzzle_cube | 7e05a21acd26cb30e729ba6a95e14e16c76c1780 | [
"MIT"
] | 1 | 2018-09-20T08:04:19.000Z | 2018-09-20T12:14:55.000Z | analysis/stats.py | jasonrute/puzzle_cube | 7e05a21acd26cb30e729ba6a95e14e16c76c1780 | [
"MIT"
] | 23 | 2018-02-20T21:19:49.000Z | 2022-03-05T18:05:10.000Z | """
Training Statics Tools
A class for loading statistics related to a particular rutraiining session.
"""
import numpy as np
#from scipy import stats
import pandas as pd
import os
def str_between(s, start, end):
return (s.split(start))[1].split(end)[0]
def is_stat_file_version(file_name, version):
return f... | 32.147727 | 102 | 0.655355 |
import numpy as np
import pandas as pd
import os
def str_between(s, start, end):
return (s.split(start))[1].split(end)[0]
def is_stat_file_version(file_name, version):
return file_name.startswith("stats_{}_gen".format(version)) and file_name.endswith(".h5")
class TrainingStates:
def __init__(self, vers... | true | true |
f719c6c53b95cb7f32858726c85cf496a8c0b670 | 1,192 | py | Python | lantz/drivers/thorlabs/pm100d.py | ZixiLi0520/lantz | a67120a65e6b66f394965ef0100529db7be3df0a | [
"BSD-3-Clause"
] | 6 | 2016-04-13T12:59:18.000Z | 2020-06-24T17:43:04.000Z | lantz/drivers/thorlabs/pm100d.py | awsch/lantz | 717f6962a471be7ceb61d1d8f6c6f381553df9c4 | [
"BSD-3-Clause"
] | null | null | null | lantz/drivers/thorlabs/pm100d.py | awsch/lantz | 717f6962a471be7ceb61d1d8f6c6f381553df9c4 | [
"BSD-3-Clause"
] | 6 | 2015-12-14T19:30:36.000Z | 2020-06-29T21:16:01.000Z | # -*- coding: utf-8 -*-
"""
To connect the power meter you'll need to use the "Power meter driver switcher" application to switch to the PM100D (Ni-Visa) drivers.
Then the resource name should show up when exceuting:
import visa
visa.ResourceManager().list_resources()
"""
from lantz.messagebased import MessageBasedD... | 27.090909 | 134 | 0.655201 |
from lantz.messagebased import MessageBasedDriver
from lantz import Feat
class PM100D(MessageBasedDriver):
DEFAULTS = {
'COMMON': {
'read_termination': '\n',
'write_termination': '\n',
},
}
@Feat(read_once=True)
def idn(self):
return self.query('*IDN... | true | true |
f719c7438aaad15d2be4ec5a66891319541f52ff | 1,767 | py | Python | Scripts/reader/gpro_corpus.py | lasigeBioTM/ULISBOA-at-SemEval-2017 | 415dc3ebbd2365aa7620a9b4feb1218fa837d7d5 | [
"MIT"
] | 8 | 2018-05-10T10:27:18.000Z | 2021-08-30T02:55:54.000Z | Scripts/reader/gpro_corpus.py | lasigeBioTM/ULISBOA-at-SemEval-2017 | 415dc3ebbd2365aa7620a9b4feb1218fa837d7d5 | [
"MIT"
] | 4 | 2018-10-24T13:32:45.000Z | 2021-02-05T11:48:04.000Z | Scripts/reader/gpro_corpus.py | lasigeBioTM/ULISBOA-at-SemEval-2017 | 415dc3ebbd2365aa7620a9b4feb1218fa837d7d5 | [
"MIT"
] | 5 | 2020-07-22T06:13:56.000Z | 2020-11-18T14:48:39.000Z | import codecs
import logging
import pickle
from chemdner_corpus import ChemdnerCorpus
class GproCorpus(ChemdnerCorpus):
"""Chemdner GPRO corpus from BioCreative V"""
def __init__(self, corpusdir, **kwargs):
super(GproCorpus, self).__init__(corpusdir, **kwargs)
self.subtypes = ["NESTED", "IDEN... | 43.097561 | 91 | 0.57442 | import codecs
import logging
import pickle
from chemdner_corpus import ChemdnerCorpus
class GproCorpus(ChemdnerCorpus):
def __init__(self, corpusdir, **kwargs):
super(GproCorpus, self).__init__(corpusdir, **kwargs)
self.subtypes = ["NESTED", "IDENTIFIER", "FULL_NAME", "ABBREVIATION"]
def loa... | true | true |
f719c759c9af0450e25345c13d5b68b9e3d98654 | 788 | py | Python | model.py | OrBin/N-Gram-Language-Model | e196758083bbed386dd1a24733cb956c8a36aa79 | [
"MIT"
] | null | null | null | model.py | OrBin/N-Gram-Language-Model | e196758083bbed386dd1a24733cb956c8a36aa79 | [
"MIT"
] | null | null | null | model.py | OrBin/N-Gram-Language-Model | e196758083bbed386dd1a24733cb956c8a36aa79 | [
"MIT"
] | null | null | null | import utils
class Model:
def __init__(self, file_path):
with open(file_path, 'r', encoding="utf8") as model_file:
self.model_tree = {}
for line in model_file:
chars, minus_log_p = utils.parse_model_file_line(line)
n_1_gram = ''.join(chars[:-1])
last_char = chars[-1]
if n_1_gram not in self... | 28.142857 | 72 | 0.695431 | import utils
class Model:
def __init__(self, file_path):
with open(file_path, 'r', encoding="utf8") as model_file:
self.model_tree = {}
for line in model_file:
chars, minus_log_p = utils.parse_model_file_line(line)
n_1_gram = ''.join(chars[:-1])
last_char = chars[-1]
if n_1_gram not in self... | true | true |
f719c75eed3a13b4d4eda1dd71c9f05b6e0ba238 | 349 | py | Python | tools/PRESUBMIT.py | RiyoCoder/v8 | e073edfc7dc990cc5f71c4e51ac27b19be16fcb7 | [
"BSD-3-Clause"
] | 2 | 2020-08-27T09:36:44.000Z | 2020-09-23T14:01:12.000Z | tools/PRESUBMIT.py | RiyoCoder/v8 | e073edfc7dc990cc5f71c4e51ac27b19be16fcb7 | [
"BSD-3-Clause"
] | null | null | null | tools/PRESUBMIT.py | RiyoCoder/v8 | e073edfc7dc990cc5f71c4e51ac27b19be16fcb7 | [
"BSD-3-Clause"
] | 1 | 2019-10-08T06:20:30.000Z | 2019-10-08T06:20:30.000Z | # Copyright 2018 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
def CheckChangeOnCommit(input_api, output_api):
tests = input_api.canned_checks.GetUnitTestsInDirectory(
input_api, output_api, 'unittests')
retu... | 38.777778 | 72 | 0.782235 |
def CheckChangeOnCommit(input_api, output_api):
tests = input_api.canned_checks.GetUnitTestsInDirectory(
input_api, output_api, 'unittests')
return input_api.RunTests(tests)
| true | true |
f719c7a7aac77a98a8d3c8df7aaf015dd69b5b0b | 1,102 | py | Python | ch_06/std_from_mean_kde.py | ags-ds/Hands-On-Data-Analysis-with-Pandas-By-Ags | f4ae6e3c3ef3c9ed9b11185724e1ea70a2f63f14 | [
"MIT"
] | 260 | 2019-01-21T01:38:39.000Z | 2022-03-26T18:49:21.000Z | ch_06/std_from_mean_kde.py | ags-ds/Hands-On-Data-Analysis-with-Pandas-By-Ags | f4ae6e3c3ef3c9ed9b11185724e1ea70a2f63f14 | [
"MIT"
] | 8 | 2020-03-13T15:48:56.000Z | 2021-08-23T21:43:44.000Z | ch_06/std_from_mean_kde.py | ags-ds/Hands-On-Data-Analysis-with-Pandas-By-Ags | f4ae6e3c3ef3c9ed9b11185724e1ea70a2f63f14 | [
"MIT"
] | 665 | 2019-07-27T18:28:20.000Z | 2022-03-23T08:20:35.000Z | import itertools
def std_from_mean_kde(data):
"""
Plot the KDE of the pandas series along with vertical
reference lines for each standard deviation from the mean.
Parameters:
- data: pandas Series with numeric data
Returns:
Matplotlib Axes object.
"""
mean_mag, std... | 26.878049 | 62 | 0.520871 | import itertools
def std_from_mean_kde(data):
mean_mag, std_mean = data.mean(), data.std()
ax = data.plot(kind='kde')
ax.axvline(mean_mag, color='b', alpha=0.2, label='mean')
colors = ['green', 'orange', 'red']
multipliers = [1, 2, 3]
signs = ['-', '+']
for sign, (color, mult... | true | true |
f719c8336db951828b5e48810801b98858d489e2 | 1,559 | py | Python | ladder/urls.py | jzahedieh/django-tennis-ladder | 03a9fc9ec6d0830ac1d6648428eca11755eabb00 | [
"MIT"
] | 13 | 2015-04-30T21:07:20.000Z | 2021-01-08T13:52:14.000Z | ladder/urls.py | jzahedieh/django-tennis-ladder | 03a9fc9ec6d0830ac1d6648428eca11755eabb00 | [
"MIT"
] | 13 | 2015-04-05T22:48:14.000Z | 2021-12-12T17:29:16.000Z | ladder/urls.py | jzahedieh/django-tennis-ladder | 03a9fc9ec6d0830ac1d6648428eca11755eabb00 | [
"MIT"
] | 5 | 2016-10-12T16:24:09.000Z | 2019-11-26T10:16:44.000Z | from django.urls import re_path
from ladder import views
urlpatterns = [
re_path(r'^$', views.index, name='index'),
re_path(r'^list/$', views.list_rounds, name='list'),
re_path(r'^current/$', views.current_season_redirect, name='current'),
# ex: /2013/round/1/
re_path(r'^(?P<year>\d+)/round/(?P<se... | 55.678571 | 120 | 0.664529 | from django.urls import re_path
from ladder import views
urlpatterns = [
re_path(r'^$', views.index, name='index'),
re_path(r'^list/$', views.list_rounds, name='list'),
re_path(r'^current/$', views.current_season_redirect, name='current'),
re_path(r'^(?P<year>\d+)/round/(?P<season_round>\d+)/$', ... | true | true |
f719c848267dc37edb40ddf8031a05c5fa16b620 | 3,306 | py | Python | myFileClass.py | saewoonam/thorium_daq_uqd | 249ab89338591c833009711e2f7997dbe2898fbc | [
"MIT"
] | null | null | null | myFileClass.py | saewoonam/thorium_daq_uqd | 249ab89338591c833009711e2f7997dbe2898fbc | [
"MIT"
] | null | null | null | myFileClass.py | saewoonam/thorium_daq_uqd | 249ab89338591c833009711e2f7997dbe2898fbc | [
"MIT"
] | null | null | null | import sys
import sqlite3
import hashlib
import time
import logging
import os.path
logger = logging.getLogger(__name__)
logpath = os.path.dirname(__file__)
logpath = os.path.join(logpath, 'logs/')
fileHandler = logging.FileHandler(logpath + __name__ + '.log')
formatter = logging.Formatter('%(asctime)s - %(name)s - %(... | 30.611111 | 119 | 0.575015 | import sys
import sqlite3
import hashlib
import time
import logging
import os.path
logger = logging.getLogger(__name__)
logpath = os.path.dirname(__file__)
logpath = os.path.join(logpath, 'logs/')
fileHandler = logging.FileHandler(logpath + __name__ + '.log')
formatter = logging.Formatter('%(asctime)s - %(name)s - %(... | true | true |
f719c9d44f62e65378d7e3d7e79d5a07e67b6c18 | 1,925 | py | Python | tests/test_swf/models/test_generic_type.py | symroe/moto | 4e106995af6f2820273528fca8a4e9ee288690a5 | [
"Apache-2.0"
] | 5,460 | 2015-01-01T01:11:17.000Z | 2022-03-31T23:45:38.000Z | tests/test_swf/models/test_generic_type.py | symroe/moto | 4e106995af6f2820273528fca8a4e9ee288690a5 | [
"Apache-2.0"
] | 4,475 | 2015-01-05T19:37:30.000Z | 2022-03-31T13:55:12.000Z | tests/test_swf/models/test_generic_type.py | symroe/moto | 4e106995af6f2820273528fca8a4e9ee288690a5 | [
"Apache-2.0"
] | 1,831 | 2015-01-14T00:00:44.000Z | 2022-03-31T20:30:04.000Z | from moto.swf.models import GenericType
import sure # noqa # pylint: disable=unused-import
# Tests for GenericType (ActivityType, WorkflowType)
class FooType(GenericType):
@property
def kind(self):
return "foo"
@property
def _configuration_keys(self):
return ["justAnExampleTimeout"]
... | 32.627119 | 84 | 0.701299 | from moto.swf.models import GenericType
import sure
@property
def kind(self):
return "foo"
@property
def _configuration_keys(self):
return ["justAnExampleTimeout"]
def test_type_short_dict_representation():
_type = FooType("test-foo", "v1.0")
_type.to_short_dict().should.equ... | true | true |
f719ca25ac5cfde9937fa4a3c1d7f11e2bc44eb3 | 427 | py | Python | data/scripts/templates/object/mobile/shared_r2_space.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/mobile/shared_r2_space.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/mobile/shared_r2_space.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_r2_space.iff"
result.attribute_template_id = 9
result.stfName... | 25.117647 | 54 | 0.71897 | true | true | |
f719cc3064aeb246e474124454e307d2ac046ca9 | 4,087 | py | Python | tests/unit_tests/routes_test.py | schmidtbri/rest-model-service | 0d1705cb62e6a942f90150da3bcf51e3e1265a25 | [
"BSD-3-Clause"
] | 1 | 2021-11-10T19:48:35.000Z | 2021-11-10T19:48:35.000Z | tests/unit_tests/routes_test.py | schmidtbri/rest-model-service | 0d1705cb62e6a942f90150da3bcf51e3e1265a25 | [
"BSD-3-Clause"
] | 1 | 2022-03-15T12:36:46.000Z | 2022-03-15T12:36:46.000Z | tests/unit_tests/routes_test.py | schmidtbri/rest-model-service | 0d1705cb62e6a942f90150da3bcf51e3e1265a25 | [
"BSD-3-Clause"
] | null | null | null | import os
from pathlib import Path
import unittest
import json
from starlette.testclient import TestClient
from ml_base.utilities import ModelManager
os.chdir(Path(__file__).resolve().parent.parent.parent)
os.environ["REST_CONFIG"] = "examples/rest_config.yaml"
from rest_model_service.main import app, create_app
fro... | 29.402878 | 113 | 0.54025 | import os
from pathlib import Path
import unittest
import json
from starlette.testclient import TestClient
from ml_base.utilities import ModelManager
os.chdir(Path(__file__).resolve().parent.parent.parent)
os.environ["REST_CONFIG"] = "examples/rest_config.yaml"
from rest_model_service.main import app, create_app
fro... | true | true |
f719cd368c417026551c16e8dd7e7961bff48f66 | 7,466 | py | Python | inverted-index/src/test_inverted_index.py | Illumaria/made-python-2020 | 7ec219ff1a5116925027646810ca4b294b1080d9 | [
"MIT"
] | 2 | 2021-07-08T10:59:44.000Z | 2021-09-06T07:44:24.000Z | inverted-index/src/test_inverted_index.py | Illumaria/made-python | 7ec219ff1a5116925027646810ca4b294b1080d9 | [
"MIT"
] | null | null | null | inverted-index/src/test_inverted_index.py | Illumaria/made-python | 7ec219ff1a5116925027646810ca4b294b1080d9 | [
"MIT"
] | null | null | null | from argparse import Namespace
from textwrap import dedent
import pytest
from inverted_index import InvertedIndex
from inverted_index import build_inverted_index
from inverted_index import DEFAULT_INVERTED_INDEX_SAVE_PATH
from inverted_index import callback_query, process_queries
from inverted_index import callback_b... | 32.889868 | 94 | 0.721939 | from argparse import Namespace
from textwrap import dedent
import pytest
from inverted_index import InvertedIndex
from inverted_index import build_inverted_index
from inverted_index import DEFAULT_INVERTED_INDEX_SAVE_PATH
from inverted_index import callback_query, process_queries
from inverted_index import callback_b... | true | true |
f719ce9774a010e3d05576a84a6bbe9fff496778 | 3,460 | py | Python | purity_fb/purity_fb_1dot6/models/object_response.py | mabdelhafez/purity_fb_python_client | a9856875b3df43b4302a2e4addd1a6b71f51f5ce | [
"Apache-2.0"
] | null | null | null | purity_fb/purity_fb_1dot6/models/object_response.py | mabdelhafez/purity_fb_python_client | a9856875b3df43b4302a2e4addd1a6b71f51f5ce | [
"Apache-2.0"
] | null | null | null | purity_fb/purity_fb_1dot6/models/object_response.py | mabdelhafez/purity_fb_python_client | a9856875b3df43b4302a2e4addd1a6b71f51f5ce | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Pure Storage FlashBlade REST 1.6 Python SDK
Pure Storage FlashBlade REST 1.6 Python SDK, developed by [Pure Storage, Inc](http://www.purestorage.com/). Documentations can be found at [purity-fb.readthedocs.io](http://purity-fb.readthedocs.io/).
OpenAPI spec version: 1.6
Contact: i... | 27.460317 | 204 | 0.578324 |
from pprint import pformat
from six import iteritems
import re
class ObjectResponse(object):
swagger_types = {
'pagination_info': 'PaginationInfo'
}
attribute_map = {
'pagination_info': 'pagination_info'
}
def __init__(self, pagination_info=None):
self._pagination_... | true | true |
f719cf9df16d97ce0c0637dc8db52aa8046af0f1 | 6,350 | py | Python | deeppages/utils.py | ricardofalasca/deep-pages | d1b2a48f62c31e20d767df5c6345e07e4d05290d | [
"MIT"
] | null | null | null | deeppages/utils.py | ricardofalasca/deep-pages | d1b2a48f62c31e20d767df5c6345e07e4d05290d | [
"MIT"
] | null | null | null | deeppages/utils.py | ricardofalasca/deep-pages | d1b2a48f62c31e20d767df5c6345e07e4d05290d | [
"MIT"
] | null | null | null | from django.template import Template, Context
from django.utils.deprecation import MiddlewareMixin
from django.conf import settings
from django.db.models import Q
from django.urls import reverse, NoReverseMatch
from django.core.exceptions import ObjectDoesNotExist
from .signals import page_found, page_not_found, page_... | 29.398148 | 79 | 0.649291 | from django.template import Template, Context
from django.utils.deprecation import MiddlewareMixin
from django.conf import settings
from django.db.models import Q
from django.urls import reverse, NoReverseMatch
from django.core.exceptions import ObjectDoesNotExist
from .signals import page_found, page_not_found, page_... | true | true |
f719cfd1f03d71fd7a99b8b868b8442eb5dcb3c5 | 26,423 | py | Python | cabot_ui/src/cabot_ui/geojson.py | kufusha/cabot | 52a40a39a29f0bd79b6fdd8f961708e09fda9a51 | [
"MIT"
] | null | null | null | cabot_ui/src/cabot_ui/geojson.py | kufusha/cabot | 52a40a39a29f0bd79b6fdd8f961708e09fda9a51 | [
"MIT"
] | null | null | null | cabot_ui/src/cabot_ui/geojson.py | kufusha/cabot | 52a40a39a29f0bd79b6fdd8f961708e09fda9a51 | [
"MIT"
] | null | null | null | # Copyright (c) 2020 Carnegie Mellon University
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, ... | 32.027879 | 110 | 0.590357 |
import sys
import traceback
import copy
import math
import json
import scipy
import scipy.spatial
import numpy
import numpy.linalg
import rospy
import tf
import angles
import geometry_msgs.msg
from cabot_ui import geoutil, i18n
class Geometry(object):
@classmethod
def marshal(cls, dic... | true | true |
f719cfe9dbb5d0f42f324f0f2d5937b2e5f17212 | 1,481 | py | Python | Code Bundle/Chapter02/tests/test_checks.py | ghanigreen/pytest_code | dbdcc322b3469c62ad328043060518edf2b2d83f | [
"MIT"
] | 46 | 2018-06-28T04:40:08.000Z | 2022-02-14T05:36:48.000Z | Code Bundle/Chapter02/tests/test_checks.py | ghanigreen/pytest_code | dbdcc322b3469c62ad328043060518edf2b2d83f | [
"MIT"
] | null | null | null | Code Bundle/Chapter02/tests/test_checks.py | ghanigreen/pytest_code | dbdcc322b3469c62ad328043060518edf2b2d83f | [
"MIT"
] | 22 | 2018-06-10T23:20:29.000Z | 2022-02-24T06:47:18.000Z | import pytest
class InvalidCharacterNameError(Exception):
pass
class InvalidClassNameError(Exception):
pass
class Character:
pass
VALID_CLASSES = ["sorcerer", "warrior"]
def create_character(name: str, class_name: str) -> Character:
"""
Creates a new character and inserts it into the datab... | 22.439394 | 65 | 0.694126 | import pytest
class InvalidCharacterNameError(Exception):
pass
class InvalidClassNameError(Exception):
pass
class Character:
pass
VALID_CLASSES = ["sorcerer", "warrior"]
def create_character(name: str, class_name: str) -> Character:
if not name:
raise InvalidCharacterNameError("charact... | true | true |
f719d091d9d47a5add06aa4cc9f22b144941b945 | 1,379 | py | Python | plantara/urls.py | plantara/plantara-backend | 3e3cf1f7aa83a124b7e1b616e44aa1f31333598e | [
"MIT"
] | null | null | null | plantara/urls.py | plantara/plantara-backend | 3e3cf1f7aa83a124b7e1b616e44aa1f31333598e | [
"MIT"
] | null | null | null | plantara/urls.py | plantara/plantara-backend | 3e3cf1f7aa83a124b7e1b616e44aa1f31333598e | [
"MIT"
] | null | null | null | """plantara URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/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-base... | 33.634146 | 77 | 0.730964 | from django.conf import settings
from django.contrib import admin
from django.urls import include, path
from rest_framework.routers import DefaultRouter
from plantara.contrib.users.views import UserViewSet, ObtainAuthToken
from plantara.contrib.plants.views import PlantViewSet
router = DefaultRouter()
router.registe... | true | true |
f719d0cdcf3b09c0fae3b540dda5bf816f23f254 | 5,061 | py | Python | ipypublish/postprocessors/base.py | phelps-sg/ipypublish | c99ba56fbaeef033e3baeb3246143660ac7eb78e | [
"BSD-3-Clause"
] | null | null | null | ipypublish/postprocessors/base.py | phelps-sg/ipypublish | c99ba56fbaeef033e3baeb3246143660ac7eb78e | [
"BSD-3-Clause"
] | null | null | null | ipypublish/postprocessors/base.py | phelps-sg/ipypublish | c99ba56fbaeef033e3baeb3246143660ac7eb78e | [
"BSD-3-Clause"
] | 1 | 2021-02-09T01:12:10.000Z | 2021-02-09T01:12:10.000Z | import logging
from six import string_types
from traitlets import Bool
from traitlets.config.configurable import Configurable
from ipypublish.utils import handle_error, pathlib
try:
from shutil import which as exe_exists
except ImportError:
from distutils.spawn import find_executable as exe_exists # noqa: F... | 29.424419 | 86 | 0.601857 | import logging
from six import string_types
from traitlets import Bool
from traitlets.config.configurable import Configurable
from ipypublish.utils import handle_error, pathlib
try:
from shutil import which as exe_exists
except ImportError:
from distutils.spawn import find_executable as exe_exists
class ... | true | true |
f719d11806bbcb48ec4f51cc84eb95cd4e1c6804 | 2,201 | py | Python | glance/common/crypt.py | komawar/glance | e550cac697dd8c78e837c6884f599ac6ee2137ae | [
"Apache-2.0"
] | 1 | 2018-07-27T15:16:14.000Z | 2018-07-27T15:16:14.000Z | glance/common/crypt.py | komawar/glance | e550cac697dd8c78e837c6884f599ac6ee2137ae | [
"Apache-2.0"
] | null | null | null | glance/common/crypt.py | komawar/glance | e550cac697dd8c78e837c6884f599ac6ee2137ae | [
"Apache-2.0"
] | 1 | 2021-07-18T18:57:04.000Z | 2021-07-18T18:57:04.000Z | #!/usr/bin/env python
# Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE... | 32.367647 | 78 | 0.695593 |
import base64
from Crypto.Cipher import AES
from Crypto import Random
from Crypto.Random import random
def urlsafe_encrypt(key, plaintext, blocksize=16):
def pad(text):
pad_length = (blocksize - len(text) % blocksize)
sr = random.StrongRandom()
pad = ''.join(chr(sr.randi... | true | true |
f719d17e244fc2d7cacd2371cabf35fc5edcbac2 | 2,609 | py | Python | img-placeholder.py | fisker/img-placeholder | d4b42551b41a546553a47358b9bb616c6492b2da | [
"MIT"
] | 3 | 2017-01-17T05:40:10.000Z | 2022-01-17T02:42:35.000Z | img-placeholder.py | fisker/img-placeholder | d4b42551b41a546553a47358b9bb616c6492b2da | [
"MIT"
] | 1 | 2017-01-15T15:34:58.000Z | 2017-01-16T05:28:34.000Z | img-placeholder.py | fisker/img-placeholder | d4b42551b41a546553a47358b9bb616c6492b2da | [
"MIT"
] | 1 | 2017-01-14T12:00:55.000Z | 2017-01-14T12:00:55.000Z | import sublime
import sublime_plugin
import re
completions = []
def plugin_loaded():
init_settings()
def init_settings():
get_settings()
sublime.load_settings('img-placeholder.sublime-settings').add_on_change('get_settings', get_settings)
def get_settings():
settings = sublime.load_settings('img-pla... | 30.694118 | 132 | 0.576849 | import sublime
import sublime_plugin
import re
completions = []
def plugin_loaded():
init_settings()
def init_settings():
get_settings()
sublime.load_settings('img-placeholder.sublime-settings').add_on_change('get_settings', get_settings)
def get_settings():
settings = sublime.load_settings('img-pla... | true | true |
f719d3c75df148a6ceda79acf57bc0e57342d5f3 | 4,311 | py | Python | src/test.py | alexey-kaz/python-project | 661fe06e09846cd1c3c6d600973a6e3433096c1d | [
"MIT"
] | null | null | null | src/test.py | alexey-kaz/python-project | 661fe06e09846cd1c3c6d600973a6e3433096c1d | [
"MIT"
] | null | null | null | src/test.py | alexey-kaz/python-project | 661fe06e09846cd1c3c6d600973a6e3433096c1d | [
"MIT"
] | 3 | 2021-04-25T06:37:26.000Z | 2021-06-03T19:19:19.000Z | """Тест."""
import unittest
from recipes import form_answer
from database import delete_table_data
from parsing import NEWS, AFISHA, HOROSCOPE, WEATHER
class TestBot(unittest.TestCase):
"""Тест."""
def test_form_answer(self):
"""Тест."""
rec1 = {"name": "Булочки с изюмом",
"in... | 29.527397 | 89 | 0.567618 | import unittest
from recipes import form_answer
from database import delete_table_data
from parsing import NEWS, AFISHA, HOROSCOPE, WEATHER
class TestBot(unittest.TestCase):
def test_form_answer(self):
rec1 = {"name": "Булочки с изюмом",
"ingrs": ["Мука", "Яйцо куриное", "Изюм"],
... | true | true |
f719d4ecd4826b2aad60d635215f0987148b894f | 7,097 | py | Python | vendor/bundle/ruby/2.3.0/gems/nokogiri-1.10.10/ext/nokogiri/tmp/x86_64-apple-darwin17/ports/libxml2/2.9.10/libxml2-2.9.10/python/setup.py | emsommers/futureDocs | 344524234d024a532716a8ad4162aad00a455e8b | [
"CC0-1.0"
] | null | null | null | vendor/bundle/ruby/2.3.0/gems/nokogiri-1.10.10/ext/nokogiri/tmp/x86_64-apple-darwin17/ports/libxml2/2.9.10/libxml2-2.9.10/python/setup.py | emsommers/futureDocs | 344524234d024a532716a8ad4162aad00a455e8b | [
"CC0-1.0"
] | null | null | null | vendor/bundle/ruby/2.3.0/gems/nokogiri-1.10.10/ext/nokogiri/tmp/x86_64-apple-darwin17/ports/libxml2/2.9.10/libxml2-2.9.10/python/setup.py | emsommers/futureDocs | 344524234d024a532716a8ad4162aad00a455e8b | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/python -u
#
# Setup script for libxml2 and libxslt if found
#
import sys, os
from distutils.core import setup, Extension
# Below ROOT, we expect to find include, include/libxml2, lib and bin.
# On *nix, it is not needed (but should not harm),
# on Windows, it is set by configure.js.
ROOT = r'/Users/emsommer... | 29.205761 | 144 | 0.610117 |
import sys, os
from distutils.core import setup, Extension
ROOT = r'/Users/emsommers/Documents/GitHub/futureDocs/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.10.10/ports/x86_64-apple-darwin17/libxml2/2.9.10'
with_threads = 1
WITHDLLS = 1 and sys.platform.startswith('win')
def missing(file):
if os.access... | true | true |
f719d938c36fb80ad1c9ea86ac17254b9fc23390 | 50,482 | py | Python | pyGPs/Core/gp.py | Corentin-LF/pyGPs | b9d36777584cd53756bd4311c3c20ea52e945451 | [
"BSD-2-Clause"
] | null | null | null | pyGPs/Core/gp.py | Corentin-LF/pyGPs | b9d36777584cd53756bd4311c3c20ea52e945451 | [
"BSD-2-Clause"
] | null | null | null | pyGPs/Core/gp.py | Corentin-LF/pyGPs | b9d36777584cd53756bd4311c3c20ea52e945451 | [
"BSD-2-Clause"
] | null | null | null | from __future__ import division
from __future__ import absolute_import
from builtins import str
from builtins import range
from builtins import object
from past.utils import old_div
#================================================================================
# Marion Neumann [marion dot neumann at uni-bonn dot ... | 40.450321 | 156 | 0.563389 | from __future__ import division
from __future__ import absolute_import
from builtins import str
from builtins import range
from builtins import object
from past.utils import old_div
import itertools
import numpy as np
import matplotlib.pyplot as plt
from . import inf, mean, lik,... | true | true |
f719d9b90696ca91133528a980477a87a5e8550f | 3,619 | py | Python | tfx/components/example_gen/custom_executors/parquet_executor.py | NikeNano/tfx | 8f7756f223e3bd3bd5abe37fa287010509cdae75 | [
"Apache-2.0"
] | null | null | null | tfx/components/example_gen/custom_executors/parquet_executor.py | NikeNano/tfx | 8f7756f223e3bd3bd5abe37fa287010509cdae75 | [
"Apache-2.0"
] | null | null | null | tfx/components/example_gen/custom_executors/parquet_executor.py | NikeNano/tfx | 8f7756f223e3bd3bd5abe37fa287010509cdae75 | [
"Apache-2.0"
] | null | null | null | # Lint as: python2, python3
# Copyright 2019 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | 36.928571 | 87 | 0.762089 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from typing import Any, Dict, Text
from absl import logging
import apache_beam as beam
import tensorflow as tf
from tfx.components.example_gen import utils
from tfx.components.example_... | true | true |
f719dc710e799dfa2967b8713a4d68b60594d1ec | 8,170 | py | Python | Tests/compat/sbs_builtin.py | dsonbill/IronPython3-NETCore | 8c76bdbec1754233f04b41ecd28e9bae2c862fd0 | [
"Apache-2.0"
] | 2 | 2019-09-21T22:22:30.000Z | 2020-05-09T12:45:51.000Z | Tests/compat/sbs_builtin.py | dsonbill/IronPython3-NETCore | 8c76bdbec1754233f04b41ecd28e9bae2c862fd0 | [
"Apache-2.0"
] | null | null | null | Tests/compat/sbs_builtin.py | dsonbill/IronPython3-NETCore | 8c76bdbec1754233f04b41ecd28e9bae2c862fd0 | [
"Apache-2.0"
] | null | null | null | #####################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of t... | 35.991189 | 161 | 0.408813 | true | true | |
f719dc95d1f1ad1b119e769f41c66e49e76fe5d2 | 695 | py | Python | abastece/migrations/0006_auto_20210531_1145.py | lembon/atizar | 579ef6212e9b2582beb86c5e14339b0615ec16ee | [
"Apache-2.0"
] | null | null | null | abastece/migrations/0006_auto_20210531_1145.py | lembon/atizar | 579ef6212e9b2582beb86c5e14339b0615ec16ee | [
"Apache-2.0"
] | null | null | null | abastece/migrations/0006_auto_20210531_1145.py | lembon/atizar | 579ef6212e9b2582beb86c5e14339b0615ec16ee | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.1.2 on 2021-05-31 14:45
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('abastece', '0005_auto_20210528_1946'),
]
operations = [
migrations.AlterField(
model_name='pedido',
... | 26.730769 | 114 | 0.574101 |
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('abastece', '0005_auto_20210528_1946'),
]
operations = [
migrations.AlterField(
model_name='pedido',
name='timestamp',
field=models.Date... | true | true |
f719dd4e36211e0181b4b0387c2d5462aad335b3 | 1,305 | py | Python | lib/surface/meta/apis/collections/describe.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | null | null | null | lib/surface/meta/apis/collections/describe.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | null | null | null | lib/surface/meta/apis/collections/describe.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | 1 | 2020-07-24T20:13:29.000Z | 2020-07-24T20:13:29.000Z | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 36.25 | 74 | 0.738697 |
from googlecloudsdk.calliope import base
from googlecloudsdk.command_lib.meta.apis import flags
from googlecloudsdk.command_lib.util.apis import registry
class Describe(base.DescribeCommand):
@staticmethod
def Args(parser):
flags.API_VERSION_FLAG.AddToParser(parser)
parser.add_argument(
... | true | true |
f719df2ec061fcd0ec591c84a3ef60c4759b669f | 3,398 | py | Python | tests/data_generation/animate_berlin_y_stretch.py | Algomorph/NeuralTracking | 6312be8e18828344c65e25a423c239efcd3428dd | [
"Apache-2.0"
] | 3 | 2021-04-18T04:23:08.000Z | 2022-02-01T08:37:51.000Z | tests/data_generation/animate_berlin_y_stretch.py | Algomorph/NeuralTracking | 6312be8e18828344c65e25a423c239efcd3428dd | [
"Apache-2.0"
] | 24 | 2021-05-28T21:59:11.000Z | 2022-02-03T16:09:41.000Z | tests/data_generation/animate_berlin_y_stretch.py | Algomorph/NeuralTracking | 6312be8e18828344c65e25a423c239efcd3428dd | [
"Apache-2.0"
] | 5 | 2021-03-10T02:56:16.000Z | 2021-12-14T06:04:50.000Z | import sys
import os
import shutil
import cv2
import open3d as o3d
import open3d.core as o3c
import numpy as np
from rendering.pytorch3d_renderer import PyTorch3DRenderer
from data import StandaloneFrameDataset
import data.presets as presets
import tsdf.default_voxel_grid
import data.camera
from settings import proce... | 43.564103 | 138 | 0.751619 | import sys
import os
import shutil
import cv2
import open3d as o3d
import open3d.core as o3c
import numpy as np
from rendering.pytorch3d_renderer import PyTorch3DRenderer
from data import StandaloneFrameDataset
import data.presets as presets
import tsdf.default_voxel_grid
import data.camera
from settings import proce... | true | true |
f719dfc68869c7b36d4086ce6861e839d17b9e4c | 338 | py | Python | src/utils.py | delbio/maze | cbc58ebb2c54f300f6413b770b57b0cab0750672 | [
"MIT"
] | null | null | null | src/utils.py | delbio/maze | cbc58ebb2c54f300f6413b770b57b0cab0750672 | [
"MIT"
] | null | null | null | src/utils.py | delbio/maze | cbc58ebb2c54f300f6413b770b57b0cab0750672 | [
"MIT"
] | null | null | null |
def rotate_counterclockwise(array_2d):
list_of_tuples = zip(*array_2d[::])
return [list(elem) for elem in list_of_tuples]
def rotate_clockwise(array_2d):
"""
Code copied by: https://stackoverflow.com/a/48444999/3753724
"""
list_of_tuples = zip(*array_2d[::-1])
return [list(elem) for elem i... | 28.166667 | 64 | 0.695266 |
def rotate_counterclockwise(array_2d):
list_of_tuples = zip(*array_2d[::])
return [list(elem) for elem in list_of_tuples]
def rotate_clockwise(array_2d):
list_of_tuples = zip(*array_2d[::-1])
return [list(elem) for elem in list_of_tuples]
| true | true |
f719e02577fb8babdf4f9190cb1e562309acb229 | 5,806 | py | Python | sdk/python/pulumi_alicloud/fc/get_triggers.py | pulumi/pulumi-alicloud | 9c34d84b4588a7c885c6bec1f03b5016e5a41683 | [
"ECL-2.0",
"Apache-2.0"
] | 42 | 2019-03-18T06:34:37.000Z | 2022-03-24T07:08:57.000Z | sdk/python/pulumi_alicloud/fc/get_triggers.py | pulumi/pulumi-alicloud | 9c34d84b4588a7c885c6bec1f03b5016e5a41683 | [
"ECL-2.0",
"Apache-2.0"
] | 152 | 2019-04-15T21:03:44.000Z | 2022-03-29T18:00:57.000Z | sdk/python/pulumi_alicloud/fc/get_triggers.py | pulumi/pulumi-alicloud | 9c34d84b4588a7c885c6bec1f03b5016e5a41683 | [
"ECL-2.0",
"Apache-2.0"
] | 3 | 2020-08-26T17:30:07.000Z | 2021-07-05T01:37:45.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** 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, overload
from .. import... | 34.975904 | 147 | 0.650189 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs
__all__ = [
'GetTriggersResult',
'AwaitableGetTriggersResult',
'get_triggers',
]
@pulumi.output_type
class GetTriggersResult:
def... | true | true |
f719e0a27fcf5d467cb187747490a3e0cc93edc0 | 2,159 | py | Python | py-games/first_game/part1.py | martanunesdea/cpp-shop-management | ed9371e8b5d6c5b3bdc31385158c747ea538046d | [
"MIT"
] | null | null | null | py-games/first_game/part1.py | martanunesdea/cpp-shop-management | ed9371e8b5d6c5b3bdc31385158c747ea538046d | [
"MIT"
] | null | null | null | py-games/first_game/part1.py | martanunesdea/cpp-shop-management | ed9371e8b5d6c5b3bdc31385158c747ea538046d | [
"MIT"
] | 1 | 2021-01-18T21:14:31.000Z | 2021-01-18T21:14:31.000Z | import pygame, sys
from pygame.locals import *
import random
#### GAME SETUP ######
pygame.init()
FPS = 60
FramePerSec = pygame.time.Clock()
# Defining game constants
RED = (255, 0, 0)
WHITE = (255, 255, 255)
SCREEN_WIDTH = 400
SCREEN_HEIGHT = 600
GAME_NAME = "Dodge The Enemy"
SCORE = 0
# Creating the main surfa... | 26.654321 | 95 | 0.610468 | import pygame, sys
from pygame.locals import *
import random
WHITE = (255, 255, 255)
SCREEN_WIDTH = 400
SCREEN_HEIGHT = 600
GAME_NAME = "Dodge The Enemy"
SCORE = 0
DISPLAYSURF = pygame.display.set_mode((SCREEN_WIDTH,SCREEN_HEIGHT))
DISPLAYSURF.fill(WHITE)
pygame.display.set_caption(GAME_NAME)
class Enemy(pygame.s... | true | true |
f719e0a51e64125bb5ced9ad77431d75f5d0af9c | 2,550 | py | Python | new_model/test_big.py | aliabid2243/deepgaze | 8c602db89a1d1d8a644b44a381ddb8a693375e08 | [
"MIT"
] | 2 | 2019-02-24T15:03:19.000Z | 2019-07-29T09:06:33.000Z | new_model/test_big.py | aliabid2243/deepgaze | 8c602db89a1d1d8a644b44a381ddb8a693375e08 | [
"MIT"
] | null | null | null | new_model/test_big.py | aliabid2243/deepgaze | 8c602db89a1d1d8a644b44a381ddb8a693375e08 | [
"MIT"
] | null | null | null | import os
from load_data import load_batch, load_data_names, load_batch_from_names, load_batch_from_names_random
from my_model import get_eye_tracker_model
import numpy as np
from keras.models import load_model
from keras.optimizers import SGD, adam
def generator(data, batch_size, img_cols, img_rows, img_ch):
whi... | 28.651685 | 130 | 0.65098 | import os
from load_data import load_batch, load_data_names, load_batch_from_names, load_batch_from_names_random
from my_model import get_eye_tracker_model
import numpy as np
from keras.models import load_model
from keras.optimizers import SGD, adam
def generator(data, batch_size, img_cols, img_rows, img_ch):
whi... | true | true |
f719e0c57fd4991be0a999dbdc1c3d13878ecbff | 9,695 | py | Python | src/collectors/diskspace/diskspace.py | smartattack/Diamond | 0559cb212559a852fce9a3cdb8643c1d129f41d4 | [
"MIT"
] | null | null | null | src/collectors/diskspace/diskspace.py | smartattack/Diamond | 0559cb212559a852fce9a3cdb8643c1d129f41d4 | [
"MIT"
] | 1 | 2022-02-22T08:46:21.000Z | 2022-02-22T12:56:05.000Z | src/collectors/diskspace/diskspace.py | hostedgraphite/Diamond | e70fe7d358897ef9082c8778fba288215788b3d5 | [
"MIT"
] | null | null | null | # coding=utf-8
"""
Uses /proc/mounts and os.statvfs() to get disk space usage
#### Dependencies
* /proc/mounts
#### Examples
# no exclude filters at all
exclude_filters =,
# exclude everything that begins /boot or /mnt
exclude_filters = ^/boot, ^/mnt
# exclude everything that includes the le... | 35.774908 | 79 | 0.513357 |
import diamond.collector
import diamond.convertor
import os
import re
try:
import psutil
except ImportError:
psutil = None
class DiskSpaceCollector(diamond.collector.Collector):
def get_default_config_help(self):
config_help = super(DiskSpaceCollector, self).get_default_config_help()
... | true | true |
f719e23150154f51fed830c34ef140c0f8e124fa | 1,831 | py | Python | backend/app/api/api_v1/endpoints/users.py | BartlomiejRasztabiga/Rentally | ba70199d329895a5295ceddd0ecc4c61928890dd | [
"MIT"
] | 2 | 2021-01-11T23:24:29.000Z | 2021-01-12T09:55:58.000Z | backend/app/api/api_v1/endpoints/users.py | BartlomiejRasztabiga/Rentally | ba70199d329895a5295ceddd0ecc4c61928890dd | [
"MIT"
] | null | null | null | backend/app/api/api_v1/endpoints/users.py | BartlomiejRasztabiga/Rentally | ba70199d329895a5295ceddd0ecc4c61928890dd | [
"MIT"
] | null | null | null | from typing import Any, List
from fastapi import APIRouter, Depends, HTTPException
from sqlalchemy.orm import Session
from app import models, schemas, services
from app.api import deps
router = APIRouter()
@router.get("/", response_model=List[schemas.User])
def read_users(
db: Session = Depends(deps.get_db),
... | 25.082192 | 79 | 0.666303 | from typing import Any, List
from fastapi import APIRouter, Depends, HTTPException
from sqlalchemy.orm import Session
from app import models, schemas, services
from app.api import deps
router = APIRouter()
@router.get("/", response_model=List[schemas.User])
def read_users(
db: Session = Depends(deps.get_db),
... | true | true |
f719e2f9ea943ab752ebf80ab241bf9d6a0bde56 | 273 | py | Python | urls.py | ActuallyZach/in_app_purchase_receipt_verifier | f342809bcc2a16a34de3cccf965f0821a5bd552b | [
"Apache-2.0"
] | 1 | 2021-12-10T09:59:17.000Z | 2021-12-10T09:59:17.000Z | urls.py | ActuallyZach/in_app_purchase_receipt_verifier | f342809bcc2a16a34de3cccf965f0821a5bd552b | [
"Apache-2.0"
] | null | null | null | urls.py | ActuallyZach/in_app_purchase_receipt_verifier | f342809bcc2a16a34de3cccf965f0821a5bd552b | [
"Apache-2.0"
] | null | null | null | from django.conf.urls import include, url
from django.http import HttpResponse
from app import views
urlpatterns = [
url(r'^verify', views.verify_receipt),
url('verify/scum', views.verify_receipt_scum),
url('verify/jellycuts', views.verify_receipt_jelly),
]
| 22.75 | 56 | 0.747253 | from django.conf.urls import include, url
from django.http import HttpResponse
from app import views
urlpatterns = [
url(r'^verify', views.verify_receipt),
url('verify/scum', views.verify_receipt_scum),
url('verify/jellycuts', views.verify_receipt_jelly),
]
| true | true |
f719e312e4286ce9cdd25018ce166a3a13eee31c | 6,014 | py | Python | nikola/plugins/compile/rest/post_list.py | pellenilsson/nikola | 67a944a40b35584525a1bb363b3abd85582704cb | [
"MIT"
] | 1 | 2015-11-06T01:07:29.000Z | 2015-11-06T01:07:29.000Z | nikola/plugins/compile/rest/post_list.py | pellenilsson/nikola | 67a944a40b35584525a1bb363b3abd85582704cb | [
"MIT"
] | null | null | null | nikola/plugins/compile/rest/post_list.py | pellenilsson/nikola | 67a944a40b35584525a1bb363b3abd85582704cb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright © 2013-2014 Udo Spallek, Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the
# Software without restriction, including without limitation
#... | 33.977401 | 92 | 0.617559 |
from __future__ import unicode_literals
import uuid
from docutils import nodes
from docutils.parsers.rst import Directive, directives
from nikola import utils
from nikola.plugin_categories import RestExtension
class Plugin(RestExtension):
name = "rest_post_list"
def set_site(se... | true | true |
f719e34865d33ff09f68d04ec4e19add1ab00e5b | 5,344 | py | Python | analysis.py | edpolanco/air_cargo | 20ddf6c72dafed85b87486ca46a9c09656f31d90 | [
"MIT"
] | null | null | null | analysis.py | edpolanco/air_cargo | 20ddf6c72dafed85b87486ca46a9c09656f31d90 | [
"MIT"
] | null | null | null | analysis.py | edpolanco/air_cargo | 20ddf6c72dafed85b87486ca46a9c09656f31d90 | [
"MIT"
] | null | null | null | """Module for summarizing cargo planning testing results.
Ed Polanco
ed.polanco@outlook.com
"""
import pandas as pd
from collections import OrderedDict
import datetime
import time
from aimacode.search import Problem, Node
from timeit import default_timer as timer
from run_search import PrintableProblem, PROBL... | 36.60274 | 98 | 0.595434 | import pandas as pd
from collections import OrderedDict
import datetime
import time
from aimacode.search import Problem, Node
from timeit import default_timer as timer
from run_search import PrintableProblem, PROBLEMS
from aimacode.search import (breadth_first_search, astar_search,
breadth_first_tree_search, depth... | true | true |
f719e4fc1c2f57473dc26131829f497ab8dd2ff2 | 854 | py | Python | autogl/module/nas/estimator/one_shot.py | THUMNLab/AutoGL | 9dfcabcda41620a7d12d6322f0e52e68dd7dcec4 | [
"Apache-2.0"
] | 824 | 2020-11-30T14:38:07.000Z | 2022-03-19T10:14:04.000Z | autogl/module/nas/estimator/one_shot.py | MitchellTesla/AutoGL | 7b551961e90f5042d9b91d92c083f3f09dd9dbdd | [
"Apache-2.0"
] | 38 | 2020-12-21T12:32:57.000Z | 2022-01-31T02:32:05.000Z | autogl/module/nas/estimator/one_shot.py | MitchellTesla/AutoGL | 7b551961e90f5042d9b91d92c083f3f09dd9dbdd | [
"Apache-2.0"
] | 85 | 2020-12-21T05:16:09.000Z | 2022-03-28T08:44:22.000Z | import torch.nn as nn
import torch.nn.functional as F
from . import register_nas_estimator
from ..space import BaseSpace
from .base import BaseEstimator
@register_nas_estimator("oneshot")
class OneShotEstimator(BaseEstimator):
"""
One shot estimator.
Use model directly to get estimations.
"""
d... | 30.5 | 69 | 0.640515 | import torch.nn as nn
import torch.nn.functional as F
from . import register_nas_estimator
from ..space import BaseSpace
from .base import BaseEstimator
@register_nas_estimator("oneshot")
class OneShotEstimator(BaseEstimator):
def infer(self, model: BaseSpace, dataset, mask="train"):
device = next(model... | true | true |
f719e58172c6f8335918d776edd53b5bed9dae39 | 13,398 | py | Python | vissl/optimizers/optimizer_helper.py | tjdbsrud/vissl | 1cf1ee0c82c8a0d65544b82a6fc2f28c7d5eb175 | [
"MIT"
] | 3 | 2021-07-08T15:06:49.000Z | 2021-08-13T18:55:02.000Z | vissl/optimizers/optimizer_helper.py | pzharrington/vissl | b647c256447af7ea66655811849be1f642377db8 | [
"MIT"
] | 2 | 2021-07-25T15:46:07.000Z | 2021-08-11T10:08:53.000Z | vissl/optimizers/optimizer_helper.py | pzharrington/vissl | b647c256447af7ea66655811849be1f642377db8 | [
"MIT"
] | 2 | 2021-07-08T15:15:55.000Z | 2021-08-25T14:16:01.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
from typing import Any, List
import torch.nn as nn
from vissl.utils.misc import is_apex_available
_CONV_TYPES = (nn.Conv1d, n... | 40.847561 | 88 | 0.657785 |
import logging
from typing import Any, List
import torch.nn as nn
from vissl.utils.misc import is_apex_available
_CONV_TYPES = (nn.Conv1d, nn.Conv2d, nn.Conv3d)
_NORM_TYPES = (
nn.BatchNorm1d,
nn.BatchNorm2d,
nn.BatchNorm3d,
nn.SyncBatchNorm,
nn.LayerNorm,
)
if is_apex_available():
i... | true | true |
f719e5ce46b0b141781817964a94f8d39288893c | 6,959 | py | Python | src/ggrc_workflows/migrations/versions/20150707143127_44047daa31a9_add_non_adjusted_next_cycle_start_date.py | trevordonnelly/ggrc-core | 499cf0d3cce70737b080991b12c203ec22015cea | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2018-03-30T11:28:48.000Z | 2018-03-30T11:28:48.000Z | src/ggrc_workflows/migrations/versions/20150707143127_44047daa31a9_add_non_adjusted_next_cycle_start_date.py | trevordonnelly/ggrc-core | 499cf0d3cce70737b080991b12c203ec22015cea | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/ggrc_workflows/migrations/versions/20150707143127_44047daa31a9_add_non_adjusted_next_cycle_start_date.py | trevordonnelly/ggrc-core | 499cf0d3cce70737b080991b12c203ec22015cea | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Add non-adjusted next cycle start date
Revision ID: 44047daa31a9
Revises: 1431e7094e26
Create Date: 2015-07-07 14:31:27.780564
"""
# Workaround legacy code which blocks Workflow new attribute addition
... | 38.027322 | 80 | 0.601523 |
revision = '44047daa31a9'
down_revision = '4840f4760f4b'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('workflows',
sa.Column('non_adjusted_next_cycle_start_date',
sa.Date(), nullable=True))
return
workflo... | true | true |
f719e6b707f00ff2d2978971d22b48f62a159092 | 4,228 | py | Python | vise/analyzer/dielectric_function.py | kumagai-group/vise | 8adfe61ad8f31767ec562f02f271e2495f357cd4 | [
"MIT"
] | 16 | 2020-07-14T13:14:05.000Z | 2022-03-04T13:39:30.000Z | vise/analyzer/dielectric_function.py | kumagai-group/vise | 8adfe61ad8f31767ec562f02f271e2495f357cd4 | [
"MIT"
] | 10 | 2021-03-15T20:47:45.000Z | 2021-08-19T00:47:12.000Z | vise/analyzer/dielectric_function.py | kumagai-group/vise | 8adfe61ad8f31767ec562f02f271e2495f357cd4 | [
"MIT"
] | 6 | 2020-03-03T00:42:39.000Z | 2022-02-22T02:34:47.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2020. Distributed under the terms of the MIT License.
from dataclasses import dataclass
from math import sqrt, pi
from typing import List
import numpy as np
from monty.json import MSONable
from tqdm import tqdm
from vise.util.mix_in import ToJsonFileMixIn
from scipy.constants i... | 37.087719 | 80 | 0.565989 |
from dataclasses import dataclass
from math import sqrt, pi
from typing import List
import numpy as np
from monty.json import MSONable
from tqdm import tqdm
from vise.util.mix_in import ToJsonFileMixIn
from scipy.constants import physical_constants as pc
eV_to_inv_cm = pc["electron volt-inverse meter relationship"]... | true | true |
f719e7006ad29396ce30e456e8d231c230206adc | 2,488 | py | Python | main.py | Kiny-Kiny/WordlistCreator | 3492f8176959beca23fa22877f2923c74ca6bf89 | [
"BSD-3-Clause"
] | 2 | 2021-10-31T15:38:55.000Z | 2021-12-12T06:20:20.000Z | main.py | Kiny-Kiny/WordlistCreator | 3492f8176959beca23fa22877f2923c74ca6bf89 | [
"BSD-3-Clause"
] | null | null | null | main.py | Kiny-Kiny/WordlistCreator | 3492f8176959beca23fa22877f2923c74ca6bf89 | [
"BSD-3-Clause"
] | null | null | null | # Recomendação : Use apenas se seu computador/celular for bom.
# Autor : Kiny
# Pix : (61) 9603-5417
# Github : https://github.com/Kiny-Kiny
# WhatsApp : http://wa.me/552179180533
# Telegram : @K_iny
# Instagram : @parziovanni
# Twitter : @KinyBruno
################################... | 27.043478 | 140 | 0.513264 | true | true | |
f719e947d81719e7404f7f12a8aca3b32f7370bb | 66 | py | Python | core/__init__.py | berendkleinhaneveld/Registrationshop | 0d6f3ee5324865cdcb419369139f37c39dfe9a1c | [
"MIT"
] | 25 | 2015-11-08T16:36:54.000Z | 2022-01-20T16:03:28.000Z | core/__init__.py | berendkleinhaneveld/Registrationshop | 0d6f3ee5324865cdcb419369139f37c39dfe9a1c | [
"MIT"
] | 2 | 2016-12-01T23:13:08.000Z | 2017-07-25T02:40:49.000Z | core/__init__.py | berendkleinhaneveld/Registrationshop | 0d6f3ee5324865cdcb419369139f37c39dfe9a1c | [
"MIT"
] | 10 | 2016-07-05T14:39:16.000Z | 2022-01-01T02:05:55.000Z | from AppVars import AppVars
from AppResources import AppResources
| 22 | 37 | 0.878788 | from AppVars import AppVars
from AppResources import AppResources
| true | true |
f719e96b6824efbbe4833272ec5ec4b37e319c12 | 2,894 | py | Python | test/functional/interface_bitcoin_cli.py | ComputerCraftr/pivx-gui | 79c13d9dcaf48dfb11400f0bc5733aaa7c83cee9 | [
"MIT"
] | null | null | null | test/functional/interface_bitcoin_cli.py | ComputerCraftr/pivx-gui | 79c13d9dcaf48dfb11400f0bc5733aaa7c83cee9 | [
"MIT"
] | null | null | null | test/functional/interface_bitcoin_cli.py | ComputerCraftr/pivx-gui | 79c13d9dcaf48dfb11400f0bc5733aaa7c83cee9 | [
"MIT"
] | 1 | 2021-01-23T04:15:52.000Z | 2021-01-23T04:15:52.000Z | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test ysw-cli"""
from test_framework.test_framework import YieldSakingWalletTestFramework
from test_framework... | 49.050847 | 103 | 0.715619 |
from test_framework.test_framework import YieldSakingWalletTestFramework
from test_framework.util import assert_equal, assert_raises_process_error, get_auth_cookie
import time
class TestBitcoinCli(YieldSakingWalletTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.nu... | true | true |
f719ea3d7dd63575d0159399e9ac03475a0baa21 | 924 | py | Python | aldryn_google_chrome_frame/models.py | aldryn/aldryn-google-chrome-frame | a0deda5d7b4b60b1ca88b7c3b09685e86b598e2a | [
"BSD-3-Clause"
] | null | null | null | aldryn_google_chrome_frame/models.py | aldryn/aldryn-google-chrome-frame | a0deda5d7b4b60b1ca88b7c3b09685e86b598e2a | [
"BSD-3-Clause"
] | null | null | null | aldryn_google_chrome_frame/models.py | aldryn/aldryn-google-chrome-frame | a0deda5d7b4b60b1ca88b7c3b09685e86b598e2a | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from cmscloud.template_api import registry
from django.conf import settings
def get_meta_version(max_version):
max_version = int(max_version)
assert 6 <= max_version <= 9
if max_version == 9:
return '1'
else:
return 'IE%d' % (max_version, )
META_TAG = '<meta ht... | 36.96 | 109 | 0.712121 |
from cmscloud.template_api import registry
from django.conf import settings
def get_meta_version(max_version):
max_version = int(max_version)
assert 6 <= max_version <= 9
if max_version == 9:
return '1'
else:
return 'IE%d' % (max_version, )
META_TAG = '<meta http-equiv="X-UA-Compatib... | true | true |
f719ea5c0a903eafeb8163fd0cad4442d6c73370 | 520 | py | Python | torchtools/callbacks/__init__.py | Time1ess/torchtools | 1c48591188827f8a7403162728f86229203354c5 | [
"BSD-3-Clause"
] | 16 | 2017-08-15T14:01:13.000Z | 2020-12-21T11:23:31.000Z | torchtools/callbacks/__init__.py | Time1ess/torchtools | 1c48591188827f8a7403162728f86229203354c5 | [
"BSD-3-Clause"
] | null | null | null | torchtools/callbacks/__init__.py | Time1ess/torchtools | 1c48591188827f8a7403162728f86229203354c5 | [
"BSD-3-Clause"
] | 2 | 2017-12-28T14:09:09.000Z | 2020-07-14T14:29:30.000Z | # coding: UTF-8
from .callback import Hook, Callback
from .checkpoint import ModelCheckPoint
from .csvlogger import CSVLogger
from .early_stopping import EarlyStopping
from .lr_scheduler import (
LambdaLR, StepLR, MultiStepLR, ExponentialLR, ReduceLROnPlateau)
from .tensorboard_logger import TensorBoardLogger
__a... | 27.368421 | 78 | 0.75 |
from .callback import Hook, Callback
from .checkpoint import ModelCheckPoint
from .csvlogger import CSVLogger
from .early_stopping import EarlyStopping
from .lr_scheduler import (
LambdaLR, StepLR, MultiStepLR, ExponentialLR, ReduceLROnPlateau)
from .tensorboard_logger import TensorBoardLogger
__all__ = [
'H... | true | true |
f719ea9ceaf6800cbd249182d3c34733fdae35f0 | 3,716 | py | Python | test.py | AlbertoSousaSantana/devopslav_full02 | 679bdca0f2fb886febeba37696f49143105894b6 | [
"MIT"
] | null | null | null | test.py | AlbertoSousaSantana/devopslav_full02 | 679bdca0f2fb886febeba37696f49143105894b6 | [
"MIT"
] | null | null | null | test.py | AlbertoSousaSantana/devopslav_full02 | 679bdca0f2fb886febeba37696f49143105894b6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from app import app ... | 148.64 | 222 | 0.130786 |
from app import app
import unittest ... | true | true |
f719eb4a68e5fddea525ab05f9a6de0a28ad334a | 10,408 | py | Python | retinanet/losses_vehicle.py | RobinCondat/pytorch-retinanet | 14a2085cd3785a667454898dc65f5324b1b9c6b8 | [
"Apache-2.0"
] | null | null | null | retinanet/losses_vehicle.py | RobinCondat/pytorch-retinanet | 14a2085cd3785a667454898dc65f5324b1b9c6b8 | [
"Apache-2.0"
] | null | null | null | retinanet/losses_vehicle.py | RobinCondat/pytorch-retinanet | 14a2085cd3785a667454898dc65f5324b1b9c6b8 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import torch
import torch.nn as nn
from retinanet.config_experiment_2 import INDEXES_MIX, VEHICLE_INDEXES
def calc_iou(a, b):
area = (b[:, 2] - b[:, 0]) * (b[:, 3] - b[:, 1])
iw = torch.min(torch.unsqueeze(a[:, 2], dim=1), b[:, 2]) - torch.max(torch.unsqueeze(a[:, 0], 1), b[:, 0])
ih = ... | 42.831276 | 133 | 0.560146 | import numpy as np
import torch
import torch.nn as nn
from retinanet.config_experiment_2 import INDEXES_MIX, VEHICLE_INDEXES
def calc_iou(a, b):
area = (b[:, 2] - b[:, 0]) * (b[:, 3] - b[:, 1])
iw = torch.min(torch.unsqueeze(a[:, 2], dim=1), b[:, 2]) - torch.max(torch.unsqueeze(a[:, 0], 1), b[:, 0])
ih = ... | true | true |
f719ee1200d97dbce407161a29de73e610926f93 | 1,780 | py | Python | kubernetes_asyncio/test/test_storage_v1alpha1_api.py | aK0nshin/kubernetes_asyncio | aef9edcc1f8671a5b1bba9f4684bde890176b19c | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/test/test_storage_v1alpha1_api.py | aK0nshin/kubernetes_asyncio | aef9edcc1f8671a5b1bba9f4684bde890176b19c | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/test/test_storage_v1alpha1_api.py | aK0nshin/kubernetes_asyncio | aef9edcc1f8671a5b1bba9f4684bde890176b19c | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: v1.14.7
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import kube... | 21.707317 | 124 | 0.676404 |
from __future__ import absolute_import
import unittest
import kubernetes_asyncio.client
from kubernetes_asyncio.client.api.storage_v1alpha1_api import StorageV1alpha1Api
from kubernetes_asyncio.client.rest import ApiException
class TestStorageV1alpha1Api(unittest.TestCase):
def setUp(self):
self.... | true | true |
f719ee2700b12c9c0e630bfb643af003a5b4013a | 7,162 | py | Python | clicktocall/app.py | Python-725/clicktocall-flask | 83268b7c90e487a70fc5ef0dcdbb3343d1dc783d | [
"MIT"
] | null | null | null | clicktocall/app.py | Python-725/clicktocall-flask | 83268b7c90e487a70fc5ef0dcdbb3343d1dc783d | [
"MIT"
] | null | null | null | clicktocall/app.py | Python-725/clicktocall-flask | 83268b7c90e487a70fc5ef0dcdbb3343d1dc783d | [
"MIT"
] | null | null | null | from flask import Flask
from flask import jsonify
from flask import render_template
from flask import request
import os, base64, uuid
from twilio.twiml.voice_response import VoiceResponse, Gather, Dial
from twilio.rest import Client
# Declare and configure application
app = Flask(__name__, static_url_path='/static')
... | 36.728205 | 132 | 0.655962 | from flask import Flask
from flask import jsonify
from flask import render_template
from flask import request
import os, base64, uuid
from twilio.twiml.voice_response import VoiceResponse, Gather, Dial
from twilio.rest import Client
app = Flask(__name__, static_url_path='/static')
app.config.from_pyfile('local_setti... | true | true |
f719ee8eea12cfc3dea84e56aaeb16666fde914e | 133 | py | Python | twl/c2.py | xiaolinzi-xl/python_imooc | 07bde890e3ab0ddef4467b0c77ef33614339a657 | [
"Apache-2.0"
] | null | null | null | twl/c2.py | xiaolinzi-xl/python_imooc | 07bde890e3ab0ddef4467b0c77ef33614339a657 | [
"Apache-2.0"
] | null | null | null | twl/c2.py | xiaolinzi-xl/python_imooc | 07bde890e3ab0ddef4467b0c77ef33614339a657 | [
"Apache-2.0"
] | null | null | null |
list_x = [1,2,3,4,5,6,7,8]
def square(x):
return x*x
# for x in list_x:
# square(x)
r = map(square,list_x)
print(list(r)) | 12.090909 | 26 | 0.578947 |
list_x = [1,2,3,4,5,6,7,8]
def square(x):
return x*x
r = map(square,list_x)
print(list(r)) | true | true |
f719eeaa3c3602f09dba2e13bf498a6011b27cbe | 787 | py | Python | pyspark-utils/wordcounts.py | domvwt/uol-ds-tools | 62348b3e04a2f27ceaa19776fb3024eaaf21d593 | [
"MIT"
] | 4 | 2020-11-27T06:08:05.000Z | 2021-04-29T15:57:12.000Z | pyspark-utils/wordcounts.py | domvwt/uol-ds-tools | 62348b3e04a2f27ceaa19776fb3024eaaf21d593 | [
"MIT"
] | null | null | null | pyspark-utils/wordcounts.py | domvwt/uol-ds-tools | 62348b3e04a2f27ceaa19776fb3024eaaf21d593 | [
"MIT"
] | 2 | 2020-12-16T11:01:48.000Z | 2020-12-28T14:02:24.000Z | #! /opt/spark/bin/pyspark
import re
from pathlib import Path
INPUT_TXT = "~/uol-ds-tools/pyspark-utils/frankenstein.txt"
myfile = Path(INPUT_TXT).expanduser().absolute()
rdd_txt = sc.textFile(f"file:///{myfile}")
# Simple word counts splitting on whitespace
counts = (
rdd_txt.flatMap(lambda line: line.split())... | 21.27027 | 59 | 0.64676 |
import re
from pathlib import Path
INPUT_TXT = "~/uol-ds-tools/pyspark-utils/frankenstein.txt"
myfile = Path(INPUT_TXT).expanduser().absolute()
rdd_txt = sc.textFile(f"file:///{myfile}")
counts = (
rdd_txt.flatMap(lambda line: line.split())
.map(lambda word: (word, 1))
.reduceByKey(lambda a, b: a + b... | true | true |
f719eeae51beeb20ebbfea489acc9d5269a4d2a2 | 397 | py | Python | simpleblog/asgi.py | itsmusa/simpleblog | fceef520684a8249e119c337898b945689515957 | [
"MIT"
] | null | null | null | simpleblog/asgi.py | itsmusa/simpleblog | fceef520684a8249e119c337898b945689515957 | [
"MIT"
] | null | null | null | simpleblog/asgi.py | itsmusa/simpleblog | fceef520684a8249e119c337898b945689515957 | [
"MIT"
] | null | null | null | """
ASGI config for simpleblog project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SE... | 23.352941 | 78 | 0.788413 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'simpleblog.settings')
application = get_asgi_application()
| true | true |
f719ef2757a2269c2a99feca23fcebc07b42be06 | 2,215 | py | Python | src/myip.py | Fuhrmann/keypirinha-myip | 5a68e1061d6c597dfc21ab8cd86319c4d32efb07 | [
"MIT"
] | 13 | 2018-03-29T23:40:04.000Z | 2021-06-28T19:18:42.000Z | src/myip.py | Fuhrmann/keypirinha-myip | 5a68e1061d6c597dfc21ab8cd86319c4d32efb07 | [
"MIT"
] | null | null | null | src/myip.py | Fuhrmann/keypirinha-myip | 5a68e1061d6c597dfc21ab8cd86319c4d32efb07 | [
"MIT"
] | null | null | null | # Keypirinha launcher (keypirinha.com)
import socket
import keypirinha as kp
import keypirinha_net as kpnet
import keypirinha_util as kpu
class MyIP(kp.Plugin):
"""
Get your public and local IP directly from Keypirinha.
"""
ITEM_CAT = kp.ItemCategory.USER_BASE + 1
KEYWORD = 'ip'
def __init... | 31.197183 | 69 | 0.531377 |
import socket
import keypirinha as kp
import keypirinha_net as kpnet
import keypirinha_util as kpu
class MyIP(kp.Plugin):
ITEM_CAT = kp.ItemCategory.USER_BASE + 1
KEYWORD = 'ip'
def __init__(self):
super().__init__()
self._urlopener = kpnet.build_urllib_opener()
def on_suggest(se... | true | true |
f719ef5038ede533d676debe6b7851092917855f | 6,254 | py | Python | src/main.py | PeterouZh/PyTorch-StudioGAN | faef6048d25dadee4fa31b2955f16f7d1ca8e1e2 | [
"MIT"
] | null | null | null | src/main.py | PeterouZh/PyTorch-StudioGAN | faef6048d25dadee4fa31b2955f16f7d1ca8e1e2 | [
"MIT"
] | null | null | null | src/main.py | PeterouZh/PyTorch-StudioGAN | faef6048d25dadee4fa31b2955f16f7d1ca8e1e2 | [
"MIT"
] | null | null | null | # PyTorch StudioGAN: https://github.com/POSTECH-CVLab/PyTorch-StudioGAN
# The MIT License (MIT)
# See license file or visit https://github.com/POSTECH-CVLab/PyTorch-StudioGAN for details
# src/main.py
import json
import os
import sys
import random
import warnings
from argparse import ArgumentParser
from utils.misc ... | 50.435484 | 138 | 0.714103 |
import json
import os
import sys
import random
import warnings
from argparse import ArgumentParser
from utils.misc import *
from utils.make_hdf5 import make_hdf5
from utils.log import make_run_name
from loader import prepare_train_eval
import torch
from torch.backends import cudnn
import torch.multiprocessing ... | true | true |
f719f008f608295f63a3a4f7b4b174f389cd19b8 | 6,048 | py | Python | test/Scanner/source_scanner-dict.py | KastB/scons | b6f9defefba687bc1050605ebcf3d816af3c2808 | [
"MIT"
] | null | null | null | test/Scanner/source_scanner-dict.py | KastB/scons | b6f9defefba687bc1050605ebcf3d816af3c2808 | [
"MIT"
] | null | null | null | test/Scanner/source_scanner-dict.py | KastB/scons | b6f9defefba687bc1050605ebcf3d816af3c2808 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
... | 26.88 | 80 | 0.687335 |
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import TestSCons
_python_ = TestSCons._python_
test = TestSCons.TestSCons()
test.write('build.py', r"""
import sys
with open(sys.argv[1], 'w') as ofp:
for infile in sys.argv[2:]:
with open(infile, 'r') as ifp:
... | true | true |
f719f0382623361ba7540988b5ee46b2739e8570 | 1,237 | py | Python | HW3/Add-command/cloudmesh_numpy/cloudmesh_numpy/plugins/cm_shell_numpy.py | futuresystems/465-git4hiroaki | bfd9068e0d074d7b6132844dc0f92780bf63bcb9 | [
"Apache-2.0"
] | null | null | null | HW3/Add-command/cloudmesh_numpy/cloudmesh_numpy/plugins/cm_shell_numpy.py | futuresystems/465-git4hiroaki | bfd9068e0d074d7b6132844dc0f92780bf63bcb9 | [
"Apache-2.0"
] | null | null | null | HW3/Add-command/cloudmesh_numpy/cloudmesh_numpy/plugins/cm_shell_numpy.py | futuresystems/465-git4hiroaki | bfd9068e0d074d7b6132844dc0f92780bf63bcb9 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import os
from cmd3.console import Console
from cmd3.shell import command
from cloudmesh_numpy.command_numpy import command_numpy
class cm_shell_numpy:
def activate_cm_shell_numpy(self):
self.register_command_topic('mycommands', 'numpy')
@command
def do_num... | 24.254902 | 75 | 0.579628 | from __future__ import print_function
import os
from cmd3.console import Console
from cmd3.shell import command
from cloudmesh_numpy.command_numpy import command_numpy
class cm_shell_numpy:
def activate_cm_shell_numpy(self):
self.register_command_topic('mycommands', 'numpy')
@command
def do_num... | true | true |
f719f0690f45a487b47db964c4e0e9f736b885dc | 20,953 | py | Python | anyex/bitbank.py | ttwishing/anyex | cfd1f2f04ab992b790add4843aafff91e5773cbf | [
"MIT"
] | null | null | null | anyex/bitbank.py | ttwishing/anyex | cfd1f2f04ab992b790add4843aafff91e5773cbf | [
"MIT"
] | null | null | null | anyex/bitbank.py | ttwishing/anyex | cfd1f2f04ab992b790add4843aafff91e5773cbf | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/anyex/anyex/blob/master/CONTRIBUTING.md#how-to-contribute-code
from anyex.base.exchange import Exchange
from anyex.base.errors import ExchangeError
from anyex.base.errors import AuthenticationError
fr... | 41.906 | 143 | 0.509617 |
nge import Exchange
from anyex.base.errors import ExchangeError
from anyex.base.errors import AuthenticationError
from anyex.base.errors import PermissionDenied
from anyex.base.errors import InsufficientFunds
from anyex.base.errors import InvalidOrder
from anyex.base.errors import OrderNotFound
from anyex.base.error... | true | true |
f719f0bd0810de624991f194db2d5e2731bca1d7 | 2,976 | py | Python | etcd/setup.py | dvanderveer/integrations-core | 41dd9950296455457c9b7342584153678503d5aa | [
"BSD-3-Clause"
] | null | null | null | etcd/setup.py | dvanderveer/integrations-core | 41dd9950296455457c9b7342584153678503d5aa | [
"BSD-3-Clause"
] | null | null | null | etcd/setup.py | dvanderveer/integrations-core | 41dd9950296455457c9b7342584153678503d5aa | [
"BSD-3-Clause"
] | null | null | null | # Always prefer setuptools over distutils
from setuptools import setup
# To use a consistent encoding
from codecs import open
from os import path
import re
here = path.abspath(path.dirname(__file__))
# get the long description from the readme file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
l... | 29.176471 | 70 | 0.612231 |
from setuptools import setup
from codecs import open
from os import path
import re
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
runtime_reqs = ['datadog_checks_base']
with open(path.join(here, 'requirements.txt'), enco... | true | true |
f719f29ce078fb015c146ba0d7a5bb429d7c7c23 | 69 | py | Python | src/masonite/api/middleware/__init__.py | cercos/masonite | f7f220efa7fae833683e9f07ce13c3795a87d3b8 | [
"MIT"
] | 1,816 | 2018-02-14T01:59:51.000Z | 2022-03-31T17:09:20.000Z | src/masonite/api/middleware/__init__.py | cercos/masonite | f7f220efa7fae833683e9f07ce13c3795a87d3b8 | [
"MIT"
] | 340 | 2018-02-11T00:27:26.000Z | 2022-03-21T12:00:24.000Z | src/masonite/api/middleware/__init__.py | cercos/masonite | f7f220efa7fae833683e9f07ce13c3795a87d3b8 | [
"MIT"
] | 144 | 2018-03-18T00:08:16.000Z | 2022-02-26T01:51:58.000Z | from .JWTAuthenticationMiddleware import JWTAuthenticationMiddleware
| 34.5 | 68 | 0.927536 | from .JWTAuthenticationMiddleware import JWTAuthenticationMiddleware
| true | true |
f719f32c0de53ae35c0223c63678dbad415c2f11 | 22 | py | Python | __init__.py | andy-96/GFPGAN | 0ed1214760170cc27fdfd60da1f64a0699a28cf4 | [
"BSD-3-Clause"
] | null | null | null | __init__.py | andy-96/GFPGAN | 0ed1214760170cc27fdfd60da1f64a0699a28cf4 | [
"BSD-3-Clause"
] | null | null | null | __init__.py | andy-96/GFPGAN | 0ed1214760170cc27fdfd60da1f64a0699a28cf4 | [
"BSD-3-Clause"
] | null | null | null | from .gfpgan import *
| 11 | 21 | 0.727273 | from .gfpgan import *
| true | true |
f719f37af819374470555e086638c20bfd0d0001 | 1,250 | py | Python | leasing/viewsets/contact_additional_views.py | hkotkanen/mvj | a22d40869ef1b13924da428f3026d248acef81a7 | [
"MIT"
] | null | null | null | leasing/viewsets/contact_additional_views.py | hkotkanen/mvj | a22d40869ef1b13924da428f3026d248acef81a7 | [
"MIT"
] | null | null | null | leasing/viewsets/contact_additional_views.py | hkotkanen/mvj | a22d40869ef1b13924da428f3026d248acef81a7 | [
"MIT"
] | null | null | null | import re
from django.db.models import Q
from django.utils.translation import ugettext_lazy as _
from rest_framework.exceptions import APIException
from rest_framework.response import Response
from rest_framework.views import APIView
from leasing.models import Contact
from leasing.permissions import PerMethodPermissi... | 33.783784 | 115 | 0.7056 | import re
from django.db.models import Q
from django.utils.translation import ugettext_lazy as _
from rest_framework.exceptions import APIException
from rest_framework.response import Response
from rest_framework.views import APIView
from leasing.models import Contact
from leasing.permissions import PerMethodPermissi... | true | true |
f719f62e2d8ed7d50dbaff87b0c28e125875ad70 | 21,056 | py | Python | tensorflow/lite/python/convert.py | anigasan/tensorflow | 5b780b4983007661ca479bf4d7ed9a260d8ce43f | [
"Apache-2.0"
] | 1 | 2019-11-18T10:54:10.000Z | 2019-11-18T10:54:10.000Z | tensorflow/lite/python/convert.py | anigasan/tensorflow | 5b780b4983007661ca479bf4d7ed9a260d8ce43f | [
"Apache-2.0"
] | 1 | 2018-04-02T23:42:30.000Z | 2018-05-03T23:12:23.000Z | tensorflow/lite/python/convert.py | anigasan/tensorflow | 5b780b4983007661ca479bf4d7ed9a260d8ce43f | [
"Apache-2.0"
] | null | null | null | # Lint as: python2, python3
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... | 42.537374 | 80 | 0.714381 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import enum
import os as _os
import platform as _platform
import subprocess as _subprocess
import tempfile as _tempfile
import six
from six.moves import map
from tensorflow.lite.python impor... | true | true |
f719f728d45f799dab957ca3faa6158730bf0f3b | 1,609 | py | Python | BDSP-Scripts/utils/pokeTwilio.py | leecbryant/BDSP-PythonBot | db77b08e023ce3942cfff3c6d3e9a32f0d63f3dc | [
"MIT"
] | 4 | 2022-03-28T21:00:00.000Z | 2022-03-29T00:03:20.000Z | BDSP-Scripts/utils/pokeTwilio.py | leecbryant/BDSP-PythonBot | db77b08e023ce3942cfff3c6d3e9a32f0d63f3dc | [
"MIT"
] | null | null | null | BDSP-Scripts/utils/pokeTwilio.py | leecbryant/BDSP-PythonBot | db77b08e023ce3942cfff3c6d3e9a32f0d63f3dc | [
"MIT"
] | 1 | 2022-03-30T05:12:46.000Z | 2022-03-30T05:12:46.000Z | import os
from twilio.rest import Client
#import twilioConfig from one folder up and inside Config_Files folder
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
try:
from Config_Files import twilioConfig
except ImportError:
from Config_Files import twilioConfig_default as... | 43.486486 | 190 | 0.709136 | import os
from twilio.rest import Client
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
try:
from Config_Files import twilioConfig
except ImportError:
from Config_Files import twilioConfig_default as twilioConfig
def found_shiny_text(found_pokemon = '', to_nu... | true | true |
f719f928dccc27ae9f21364a24c6d3cb460a18a2 | 9,079 | py | Python | stacker/tests/test_plan.py | GoodRx/stacker | 0cf1df67b4ae5aeda5845442c84905909101c238 | [
"BSD-2-Clause"
] | 1 | 2021-11-06T17:01:01.000Z | 2021-11-06T17:01:01.000Z | stacker/tests/test_plan.py | GoodRx/stacker | 0cf1df67b4ae5aeda5845442c84905909101c238 | [
"BSD-2-Clause"
] | null | null | null | stacker/tests/test_plan.py | GoodRx/stacker | 0cf1df67b4ae5aeda5845442c84905909101c238 | [
"BSD-2-Clause"
] | 1 | 2021-11-06T17:00:53.000Z | 2021-11-06T17:00:53.000Z | import unittest
import mock
from stacker.context import Context
from stacker.exceptions import ImproperlyConfigured
from stacker.plan import (
Step,
Plan,
)
from stacker.status import (
COMPLETE,
SKIPPED,
SUBMITTED,
)
from stacker.stack import Stack
from .factories import generate_definition
cou... | 32.894928 | 79 | 0.566142 | import unittest
import mock
from stacker.context import Context
from stacker.exceptions import ImproperlyConfigured
from stacker.plan import (
Step,
Plan,
)
from stacker.status import (
COMPLETE,
SKIPPED,
SUBMITTED,
)
from stacker.stack import Stack
from .factories import generate_definition
cou... | true | true |
f719f96e68fd7b17d73ed6b9460ebade8987ebf6 | 4,908 | py | Python | parseepo/serialize.py | cverluise/parseEPO | be1171a0f8e6fcafa711fa291aebb1fc2260d5e6 | [
"MIT"
] | null | null | null | parseepo/serialize.py | cverluise/parseEPO | be1171a0f8e6fcafa711fa291aebb1fc2260d5e6 | [
"MIT"
] | 3 | 2021-02-02T22:38:50.000Z | 2021-08-23T20:41:10.000Z | parseepo/serialize.py | cverluise/parseEPO | be1171a0f8e6fcafa711fa291aebb1fc2260d5e6 | [
"MIT"
] | null | null | null | import html2text
import pandas as pd
from wasabi import Printer
from parseepo import validate
from parseepo.exception import SingleAttrException
from parseepo.utils import prepare_name
h = html2text.HTML2Text()
msg = Printer()
NAMES = ["EP", "Num", "Ext", "publication_date", "language", "attr", "text"]
NESTED_ATTR = ... | 36.355556 | 92 | 0.581296 | import html2text
import pandas as pd
from wasabi import Printer
from parseepo import validate
from parseepo.exception import SingleAttrException
from parseepo.utils import prepare_name
h = html2text.HTML2Text()
msg = Printer()
NAMES = ["EP", "Num", "Ext", "publication_date", "language", "attr", "text"]
NESTED_ATTR = ... | true | true |
f719fb0a5fa90c220d27a523e8d540e39d655557 | 5,183 | py | Python | pyampd/ampd.py | luigiluz/pyampd | cd247030f5a4ccd971da837b9b873cacbd7adfb3 | [
"MIT"
] | 25 | 2019-04-13T06:39:33.000Z | 2022-03-11T22:38:46.000Z | pyampd/ampd.py | luigiluz/pyampd | cd247030f5a4ccd971da837b9b873cacbd7adfb3 | [
"MIT"
] | 5 | 2018-12-05T10:07:20.000Z | 2021-02-17T09:08:10.000Z | pyampd/ampd.py | luigiluz/pyampd | cd247030f5a4ccd971da837b9b873cacbd7adfb3 | [
"MIT"
] | 5 | 2020-10-18T12:42:14.000Z | 2021-07-01T05:32:50.000Z | import numpy as np
from scipy.ndimage import uniform_filter1d
from scipy.signal import detrend
def find_peaks_original(x, scale=None, debug=False):
"""Find peaks in quasi-periodic noisy signals using AMPD algorithm.
Automatic Multi-Scale Peak Detection originally proposed in
"An Efficient Algorithm for A... | 29.282486 | 78 | 0.605248 | import numpy as np
from scipy.ndimage import uniform_filter1d
from scipy.signal import detrend
def find_peaks_original(x, scale=None, debug=False):
x = detrend(x)
N = len(x)
L = N // 2
if scale:
L = min(scale, L)
LSM = np.zeros((L, N), dtype=bool)
for k in np.arange(1, L):
... | true | true |
f719fc3ddd0729538402b3d0087f650db4bf9a87 | 3,272 | py | Python | extract_features.py | bionlplab/heart_failure_mortality | f3bbfe65fe6f2c2a076acb38697133b472bf2231 | [
"BSD-3-Clause"
] | 4 | 2021-06-06T17:50:44.000Z | 2021-12-27T11:45:34.000Z | extract_features.py | bionlplab/heart_failure_mortality | f3bbfe65fe6f2c2a076acb38697133b472bf2231 | [
"BSD-3-Clause"
] | 1 | 2021-11-28T00:39:50.000Z | 2021-12-08T13:58:56.000Z | extract_features.py | bionlplab/heart_failure_mortality | f3bbfe65fe6f2c2a076acb38697133b472bf2231 | [
"BSD-3-Clause"
] | null | null | null | import pandas as pd
import numpy as np
from utils import *
from sklearn.preprocessing import StandardScaler
from collections import defaultdict
import re
def format_labels(file_path, timelines, mapping):
most_recent = mapping.sort_values(["subject_id", "ordering_date"], ascending=False).drop_duplicates("subject_id", ... | 32.078431 | 128 | 0.755501 | import pandas as pd
import numpy as np
from utils import *
from sklearn.preprocessing import StandardScaler
from collections import defaultdict
import re
def format_labels(file_path, timelines, mapping):
most_recent = mapping.sort_values(["subject_id", "ordering_date"], ascending=False).drop_duplicates("subject_id", ... | true | true |
f719fd14389a9547c6251cef99f54bae3af19a6e | 221 | py | Python | output/models/ms_data/datatypes/facets/non_negative_integer/non_negative_integer_min_exclusive004_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/ms_data/datatypes/facets/non_negative_integer/non_negative_integer_min_exclusive004_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/ms_data/datatypes/facets/non_negative_integer/non_negative_integer_min_exclusive004_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from output.models.ms_data.datatypes.facets.non_negative_integer.non_negative_integer_min_exclusive004_xsd.non_negative_integer_min_exclusive004 import (
FooType,
Test,
)
__all__ = [
"FooType",
"Test",
]
| 22.1 | 153 | 0.773756 | from output.models.ms_data.datatypes.facets.non_negative_integer.non_negative_integer_min_exclusive004_xsd.non_negative_integer_min_exclusive004 import (
FooType,
Test,
)
__all__ = [
"FooType",
"Test",
]
| true | true |
f719fd37c128d9a9db10d9a47902af2a5eb5d61e | 3,283 | py | Python | lektor/markdown/__init__.py | uk0/lektor | 21bdf99aa1183b4398043f87ba8ed137fad529ce | [
"BSD-3-Clause"
] | null | null | null | lektor/markdown/__init__.py | uk0/lektor | 21bdf99aa1183b4398043f87ba8ed137fad529ce | [
"BSD-3-Clause"
] | null | null | null | lektor/markdown/__init__.py | uk0/lektor | 21bdf99aa1183b4398043f87ba8ed137fad529ce | [
"BSD-3-Clause"
] | null | null | null | import sys
from typing import Any
from typing import Dict
from typing import Hashable
from typing import Type
from typing import TYPE_CHECKING
from weakref import ref as weakref
from deprecated import deprecated
from markupsafe import Markup
from lektor.markdown.controller import ControllerCache
from lektor.markdown.... | 30.682243 | 86 | 0.709108 | import sys
from typing import Any
from typing import Dict
from typing import Hashable
from typing import Type
from typing import TYPE_CHECKING
from weakref import ref as weakref
from deprecated import deprecated
from markupsafe import Markup
from lektor.markdown.controller import ControllerCache
from lektor.markdown.... | true | true |
f719fec77a658c0d0bd1fb9dff8594c94cc357ad | 59,113 | py | Python | venv/lib/python3.6/site-packages/bioblend/galaxy/objects/wrappers.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 1 | 2020-01-22T13:11:23.000Z | 2020-01-22T13:11:23.000Z | venv/lib/python3.6/site-packages/bioblend/galaxy/objects/wrappers.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | venv/lib/python3.6/site-packages/bioblend/galaxy/objects/wrappers.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | null | null | null | # pylint: disable=W0622,E1101
"""
A basic object-oriented interface for Galaxy entities.
"""
import abc
import json
from collections.abc import (
Iterable,
Mapping,
Sequence,
)
from typing import Tuple
import bioblend
from bioblend.util import abstractclass
__all__ = (
'Wrapper',
'Step',
'W... | 33.434955 | 210 | 0.612319 |
import abc
import json
from collections.abc import (
Iterable,
Mapping,
Sequence,
)
from typing import Tuple
import bioblend
from bioblend.util import abstractclass
__all__ = (
'Wrapper',
'Step',
'Workflow',
'LibraryContentInfo',
'HistoryContentInfo',
'DatasetContainer',
'H... | true | true |
f719fecd156687882e482eac8d27cf8aaffcf379 | 177 | py | Python | python/positive.py | scienceacademy/apcsp_2021 | 11efd0216d3042e556e726268c622d8f0d568c18 | [
"MIT"
] | null | null | null | python/positive.py | scienceacademy/apcsp_2021 | 11efd0216d3042e556e726268c622d8f0d568c18 | [
"MIT"
] | null | null | null | python/positive.py | scienceacademy/apcsp_2021 | 11efd0216d3042e556e726268c622d8f0d568c18 | [
"MIT"
] | null | null | null | def main():
n = get_positive_int()
def get_positive_int():
while True:
n = int(input("Enter a positive number: "))
if n > 0:
return n
main() | 19.666667 | 51 | 0.542373 | def main():
n = get_positive_int()
def get_positive_int():
while True:
n = int(input("Enter a positive number: "))
if n > 0:
return n
main() | true | true |
f719fee29c71e4ea44c3434fb019c8f5e47ff986 | 16,096 | py | Python | tests/test_brew_views.py | zgoda/brewlog | 13a930b328f81d01a2be9aca07d3b14703b80faa | [
"BSD-3-Clause"
] | 3 | 2019-03-11T04:30:06.000Z | 2020-01-26T03:21:52.000Z | tests/test_brew_views.py | zgoda/brewlog | 13a930b328f81d01a2be9aca07d3b14703b80faa | [
"BSD-3-Clause"
] | 23 | 2019-02-06T20:37:37.000Z | 2020-06-01T07:08:35.000Z | tests/test_brew_views.py | zgoda/brewlog | 13a930b328f81d01a2be9aca07d3b14703b80faa | [
"BSD-3-Clause"
] | null | null | null | import datetime
import pytest
from flask import url_for
from brewlog.ext import db
from brewlog.models import Brew
from . import BrewlogTests
class BrewViewTests(BrewlogTests):
@pytest.fixture(autouse=True)
def set_up(self, user_factory, brewery_factory):
self.public_user = user_factory(
... | 38.879227 | 88 | 0.636245 | import datetime
import pytest
from flask import url_for
from brewlog.ext import db
from brewlog.models import Brew
from . import BrewlogTests
class BrewViewTests(BrewlogTests):
@pytest.fixture(autouse=True)
def set_up(self, user_factory, brewery_factory):
self.public_user = user_factory(
... | true | true |
f719ffebb722b8308f0638a092a790eb9e2845a8 | 18,480 | py | Python | mindmeld/converter/dialogflow.py | derekmpham/mindmeld | 18189f956e4e3eb92df61fde95ec82f73b9efa91 | [
"Apache-2.0"
] | null | null | null | mindmeld/converter/dialogflow.py | derekmpham/mindmeld | 18189f956e4e3eb92df61fde95ec82f73b9efa91 | [
"Apache-2.0"
] | null | null | null | mindmeld/converter/dialogflow.py | derekmpham/mindmeld | 18189f956e4e3eb92df61fde95ec82f73b9efa91 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE... | 39.069767 | 97 | 0.541288 |
import json
import logging
import os
import re
from sklearn.model_selection import train_test_split
from mindmeld.converter.converter import Converter
logger = logging.getLogger(__name__)
class DialogflowConverter(Converter):
sys_entity_map = {
"@sys.date-time": "sys_interval",
"... | true | true |
f71a00fd7c45368e46d3c54f89b23447c46a85a7 | 406 | py | Python | 001085StepikPythonIntrO/Stepik001085PythonIntrOсh01p03_20200410.py | SafonovMikhail/python_000577 | 739f764e80f1ca354386f00b8e9db1df8c96531d | [
"Apache-2.0"
] | null | null | null | 001085StepikPythonIntrO/Stepik001085PythonIntrOсh01p03_20200410.py | SafonovMikhail/python_000577 | 739f764e80f1ca354386f00b8e9db1df8c96531d | [
"Apache-2.0"
] | null | null | null | 001085StepikPythonIntrO/Stepik001085PythonIntrOсh01p03_20200410.py | SafonovMikhail/python_000577 | 739f764e80f1ca354386f00b8e9db1df8c96531d | [
"Apache-2.0"
] | null | null | null | # print(int("a"))
print(int(995.23)) # отбрасывание дробной части
print(float(42)) # приведение к виду с плавающей точкой
print(2 ** 2018) # поддержка длинной арифметики
pow = str(2 ** 2018) # количество цифр
print(pow)
# for i in pow:
# print(pow(i))
print(len(pow))
print("Yin" + " " + "Yang")
print("because ... | 23.882353 | 56 | 0.642857 |
print(int(995.23))
print(float(42))
print(2 ** 2018)
pow = str(2 ** 2018)
print(pow)
print(len(pow))
print("Yin" + " " + "Yang")
print("because " * 42)
pow2=int((str(2) * 100)) ** 2
print(pow2)
print(str(2))
print(len(str(pow2))) | true | true |
f71a011d3e1d15a38ea8652521b28f6d01d84fa7 | 23,145 | py | Python | library.py | whitehead421/library | 2d1d3ef50127560ad6da76b5763ff45bb6d25761 | [
"MIT"
] | null | null | null | library.py | whitehead421/library | 2d1d3ef50127560ad6da76b5763ff45bb6d25761 | [
"MIT"
] | null | null | null | library.py | whitehead421/library | 2d1d3ef50127560ad6da76b5763ff45bb6d25761 | [
"MIT"
] | null | null | null | import time
import string
import random
import os
from termcolor import colored
from collections import Counter
clean_the_screen = ("cls" if os.name == "nt" else "clear")
# Function for listing books with their full information.
def listBooks():
file = open("books.txt", "r")
lines = file.readlines()
f... | 32.87642 | 158 | 0.572391 | import time
import string
import random
import os
from termcolor import colored
from collections import Counter
clean_the_screen = ("cls" if os.name == "nt" else "clear")
def listBooks():
file = open("books.txt", "r")
lines = file.readlines()
file.close()
for i in lines:
splitted = i.split(",")... | true | true |
f71a0395c544caeb8e59eb6aa3e37e0cba7e4d34 | 325 | py | Python | test.py | deancolten/buzzsprout-manager | a630ee39171b7086ac738e29b721b73c39a1581f | [
"MIT"
] | null | null | null | test.py | deancolten/buzzsprout-manager | a630ee39171b7086ac738e29b721b73c39a1581f | [
"MIT"
] | null | null | null | test.py | deancolten/buzzsprout-manager | a630ee39171b7086ac738e29b721b73c39a1581f | [
"MIT"
] | null | null | null | from bsm import Manager, Episode, EpisodeGroup
from dotenv import load_dotenv
import os
load_dotenv()
ID = os.environ.get("ID")
TOKEN = os.environ.get("TOKEN")
manager = Manager(ID, TOKEN)
print(manager.test_api())
ep = Episode(**{'title': "test upload"})
res = manager.post_episode(ep, 'testfile.mp3', None)
print(... | 19.117647 | 52 | 0.723077 | from bsm import Manager, Episode, EpisodeGroup
from dotenv import load_dotenv
import os
load_dotenv()
ID = os.environ.get("ID")
TOKEN = os.environ.get("TOKEN")
manager = Manager(ID, TOKEN)
print(manager.test_api())
ep = Episode(**{'title': "test upload"})
res = manager.post_episode(ep, 'testfile.mp3', None)
print(... | true | true |
f71a03a12dbb6d843747f75d2f29f96ad24a5738 | 13,861 | py | Python | synapse/rest/media/v1/_base.py | Oliver-Hanikel/synapse | 6276e685345cff0b1dc32a02354914a39da911f0 | [
"Apache-2.0"
] | null | null | null | synapse/rest/media/v1/_base.py | Oliver-Hanikel/synapse | 6276e685345cff0b1dc32a02354914a39da911f0 | [
"Apache-2.0"
] | null | null | null | synapse/rest/media/v1/_base.py | Oliver-Hanikel/synapse | 6276e685345cff0b1dc32a02354914a39da911f0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
# Copyright 2019-2021 The Matrix.org Foundation C.I.C.
#
# 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.o... | 32.011547 | 88 | 0.611283 |
import logging
import os
import urllib
from typing import Awaitable, Dict, Generator, List, Optional, Tuple
from twisted.internet.interfaces import IConsumer
from twisted.protocols.basic import FileSender
from twisted.web.http import Request
from synapse.api.errors import Codes, SynapseError, cs_error... | true | true |
f71a053bb305614ab4f994386a8208bfe513245c | 1,996 | py | Python | dataslots/__init__.py | cl0ne/dataslots | a91634f33e25c09e48e834a46424b9f80153efa3 | [
"MIT"
] | null | null | null | dataslots/__init__.py | cl0ne/dataslots | a91634f33e25c09e48e834a46424b9f80153efa3 | [
"MIT"
] | null | null | null | dataslots/__init__.py | cl0ne/dataslots | a91634f33e25c09e48e834a46424b9f80153efa3 | [
"MIT"
] | null | null | null | from dataclasses import fields
from warnings import warn
__all__ = ['dataslots', 'with_slots']
def with_slots(*args, **kwargs):
warn("Use dataslots decorator instead of with_slots", category=PendingDeprecationWarning, stacklevel=2)
return dataslots(*args, **kwargs)
def dataslots(_cls=None, *, add_dict=Fals... | 35.642857 | 107 | 0.657816 | from dataclasses import fields
from warnings import warn
__all__ = ['dataslots', 'with_slots']
def with_slots(*args, **kwargs):
warn("Use dataslots decorator instead of with_slots", category=PendingDeprecationWarning, stacklevel=2)
return dataslots(*args, **kwargs)
def dataslots(_cls=None, *, add_dict=Fals... | true | true |
f71a0540bc87f2ea7b4736b69e7e3edf50ca90fb | 4,050 | py | Python | benchmark/startQiskit_Class2296.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_Class2296.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_Class2296.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=33
import cirq
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2
import numpy as np
import networkx as nx
def bitwise_... | 34.322034 | 140 | 0.647407 |
import cirq
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2
import numpy as np
import networkx as nx
def bitwise_xor(s: str, t: str) -> str:
l... | true | true |
f71a06034e69e3e7408c6a1366ef06e34015e677 | 7,238 | py | Python | complex_networks_keras_tf1/models/resnet_blocks_3d.py | QinggangSUN/keras_complex_valued_networks | e7a6c9238645e87a679328e9f8e8834ad0f716e2 | [
"MIT"
] | 8 | 2020-11-29T11:50:04.000Z | 2022-01-15T15:17:47.000Z | complex_networks_keras_tf1/models/resnet_blocks_3d.py | QinggangSUN/keras_complex_valued_networks | e7a6c9238645e87a679328e9f8e8834ad0f716e2 | [
"MIT"
] | null | null | null | complex_networks_keras_tf1/models/resnet_blocks_3d.py | QinggangSUN/keras_complex_valued_networks | e7a6c9238645e87a679328e9f8e8834ad0f716e2 | [
"MIT"
] | 1 | 2021-11-29T08:22:17.000Z | 2021-11-29T08:22:17.000Z | # -*- coding: utf-8 -*-
"""This module implements a number of popular two-dimensional complex valued residual blocks."""
# Authors: Qinggang Sun
#
# Reference:
# Allen Goodman, Allen Goodman, Claire McQuin, Hans Gaiser, et al. keras-resnet
# https://github.com/broadinstitute/keras-resnet
# pylint:disab... | 36.555556 | 119 | 0.644515 |
import keras.layers
import keras.regularizers
from ..layers.activations import layer_activation
from ..layers.bn import ComplexBatchNormalization
from ..layers.conv import ComplexConv3D
def basic_3d(filters,
stage=0,
block=0,
kernel_size=3,
numerical_nam... | true | true |
f71a06156e7e11289ee61b52977cfcf127cb084b | 1,966 | py | Python | test/docker/integration/kong_client.py | coolersport/kong-oidc | 56393b4f4cca051d2ed9fdba145e679d03aab116 | [
"Apache-2.0"
] | 3 | 2019-09-06T06:27:06.000Z | 2020-03-28T03:22:24.000Z | test/docker/integration/kong_client.py | coolersport/kong-oidc | 56393b4f4cca051d2ed9fdba145e679d03aab116 | [
"Apache-2.0"
] | 1 | 2020-10-30T16:23:27.000Z | 2020-10-30T16:23:27.000Z | test/docker/integration/kong_client.py | coolersport/kong-oidc | 56393b4f4cca051d2ed9fdba145e679d03aab116 | [
"Apache-2.0"
] | 5 | 2019-03-18T22:12:16.000Z | 2022-03-03T22:05:06.000Z | import requests
class KongClient:
def __init__(self, url):
self._endpoint = url
self._session = requests.session()
def create_service(self, name, upstream_url):
url = "{}/services".format(self._endpoint)
payload = {
"name": name,
"url": upstr... | 32.766667 | 76 | 0.558494 | import requests
class KongClient:
def __init__(self, url):
self._endpoint = url
self._session = requests.session()
def create_service(self, name, upstream_url):
url = "{}/services".format(self._endpoint)
payload = {
"name": name,
"url": upstr... | true | true |
f71a0625c1f550c878a13bf9475bc05dbf22e8a9 | 121 | py | Python | docker/optimization/pyOpt/tags/v1.2.0/pyOpt/pyFILTERSD/__init__.py | liujiamingustc/phd | 4f815a738abad43531d02ac66f5bd0d9a1def52a | [
"Apache-2.0"
] | 3 | 2021-01-06T03:01:18.000Z | 2022-03-21T03:02:55.000Z | docker/optimization/pyOpt/tags/v1.2.0/pyOpt/pyFILTERSD/__init__.py | liujiamingustc/phd | 4f815a738abad43531d02ac66f5bd0d9a1def52a | [
"Apache-2.0"
] | null | null | null | docker/optimization/pyOpt/tags/v1.2.0/pyOpt/pyFILTERSD/__init__.py | liujiamingustc/phd | 4f815a738abad43531d02ac66f5bd0d9a1def52a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
try:
from pyFILTERSD import FILTERSD
__all__ = ['FILTERSD']
except:
__all__ = []
#end
| 13.444444 | 35 | 0.636364 |
try:
from pyFILTERSD import FILTERSD
__all__ = ['FILTERSD']
except:
__all__ = []
| true | true |
f71a062d2b5783e4fd92b44153a453460f29e699 | 53,902 | py | Python | Lib/http/client.py | treebee/cpython | e152169da95b52fa41931572bc90857253c4a5dd | [
"CNRI-Python-GPL-Compatible"
] | 1 | 2019-05-29T18:22:03.000Z | 2019-05-29T18:22:03.000Z | Lib/http/client.py | treebee/cpython | e152169da95b52fa41931572bc90857253c4a5dd | [
"CNRI-Python-GPL-Compatible"
] | 4 | 2022-03-30T01:50:22.000Z | 2022-03-30T01:50:28.000Z | Lib/http/client.py | treebee/cpython | e152169da95b52fa41931572bc90857253c4a5dd | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | r"""HTTP/1.1 client library
<intro stuff goes here>
<other stuff, too>
HTTPConnection goes through a number of "states", which define when a client
may legally make another request or fetch the response for a particular
request. This diagram details these state transitions:
(null)
|
| HTTPConnection(... | 37.020604 | 82 | 0.571352 |
import email.parser
import email.message
import http
import io
import re
import socket
import collections.abc
from urllib.parse import urlsplit
__all__ = ["HTTPResponse", "HTTPConnection",
"HTTPException", "NotConnected", "UnknownProtocol",
"UnknownTransferEncoding", "UnimplementedFileMode",
... | true | true |
f71a07d0760e6b2878001901d08de4bc02ae7c09 | 3,381 | py | Python | static_data/mk_lookup.py | flyingsymbols/arewebeatingcovid19 | 78370472432700bb84796035c93868fb1887c055 | [
"MIT"
] | 1 | 2020-04-18T08:41:00.000Z | 2020-04-18T08:41:00.000Z | static_data/mk_lookup.py | flyingsymbols/arewebeatingcovid19 | 78370472432700bb84796035c93868fb1887c055 | [
"MIT"
] | null | null | null | static_data/mk_lookup.py | flyingsymbols/arewebeatingcovid19 | 78370472432700bb84796035c93868fb1887c055 | [
"MIT"
] | null | null | null | import os
import csv
import copy
import json
DIR = os.path.dirname(__file__)
def rel(*p): return os.path.normpath(os.path.join(DIR, *p))
CENSUS_DATA = rel('nst-est2019-alldata.csv')
OUT_JSON = rel('state_data.json')
def main():
state_data = copy.deepcopy(STATE_DATA)
state_name_ind = {} # { name: ind of ... | 33.147059 | 70 | 0.525288 | import os
import csv
import copy
import json
DIR = os.path.dirname(__file__)
def rel(*p): return os.path.normpath(os.path.join(DIR, *p))
CENSUS_DATA = rel('nst-est2019-alldata.csv')
OUT_JSON = rel('state_data.json')
def main():
state_data = copy.deepcopy(STATE_DATA)
state_name_ind = {}
state_abbrev... | true | true |
f71a09128c188832b08bc19072a6ef2f2c8d9dde | 3,136 | py | Python | music_preprocessor/music_preprocessor.py | offy284/Keras-GAN | 6652c626ba584ffd1c25ca4e925e6f131077395c | [
"MIT"
] | null | null | null | music_preprocessor/music_preprocessor.py | offy284/Keras-GAN | 6652c626ba584ffd1c25ca4e925e6f131077395c | [
"MIT"
] | null | null | null | music_preprocessor/music_preprocessor.py | offy284/Keras-GAN | 6652c626ba584ffd1c25ca4e925e6f131077395c | [
"MIT"
] | null | null | null | import itertools
import shutil
import os
from os import listdir
from os.path import isfile, join
from tqdm import tqdm
import numpy as np
import scipy
from scipy.io.wavfile import write, read
from scipy.fftpack import fft
from scipy import signal
from scipy.fft import fftshift
import matplotlib.pyplot as plt
from sklea... | 29.866667 | 112 | 0.607781 | import itertools
import shutil
import os
from os import listdir
from os.path import isfile, join
from tqdm import tqdm
import numpy as np
import scipy
from scipy.io.wavfile import write, read
from scipy.fftpack import fft
from scipy import signal
from scipy.fft import fftshift
import matplotlib.pyplot as plt
from sklea... | true | true |
f71a09cfb0b4712bce6ade7ab4148ea05334dfee | 1,077 | py | Python | database/dbclient.py | sonudoo/password-manager | 6fa1d2ebeba5b0f9cff200b32a581321d109b9cd | [
"MIT"
] | null | null | null | database/dbclient.py | sonudoo/password-manager | 6fa1d2ebeba5b0f9cff200b32a581321d109b9cd | [
"MIT"
] | null | null | null | database/dbclient.py | sonudoo/password-manager | 6fa1d2ebeba5b0f9cff200b32a581321d109b9cd | [
"MIT"
] | null | null | null | import pymongo
class DbClient:
"""Creates an instance of pymongo client and stores it in a private variable.
The instance of this class is injected as a dependency for request validators and processors.
Attributes:
database (Database): The database object.
collection_list (list): List of ... | 32.636364 | 97 | 0.637883 | import pymongo
class DbClient:
database = None
collection_list = None
def __init__(self, mongo_uri, database):
client = pymongo.MongoClient(mongo_uri)
self.database = client[database]
self.collection_list = [collection for collection in self.database.collection_names()]
de... | true | true |
f71a0a1f8ed72da50b25bdb3d34573679f492d53 | 4,542 | py | Python | tests/clvm/test_chialisp_deserialization.py | Tony4467/littlelambocoin-blockchain | 3d4f2b577cd5a2feb324fca50e0981a728583aee | [
"Apache-2.0"
] | 6 | 2021-07-15T16:52:46.000Z | 2021-09-27T16:57:08.000Z | tests/clvm/test_chialisp_deserialization.py | Tony4467/littlelambocoin-blockchain | 3d4f2b577cd5a2feb324fca50e0981a728583aee | [
"Apache-2.0"
] | 6 | 2021-07-27T08:17:34.000Z | 2021-11-30T11:39:19.000Z | tests/clvm/test_chialisp_deserialization.py | Tony4467/littlelambocoin-blockchain | 3d4f2b577cd5a2feb324fca50e0981a728583aee | [
"Apache-2.0"
] | 7 | 2021-08-15T15:10:58.000Z | 2021-10-04T16:47:39.000Z | from unittest import TestCase
from littlelambocoin.types.blockchain_format.program import Program, INFINITE_COST
from littlelambocoin.util.byte_types import hexstr_to_bytes
from littlelambocoin.wallet.puzzles.load_clvm import load_clvm
DESERIALIZE_MOD = load_clvm("littlelambocoinlisp_deserialisation.clvm", package_or... | 39.495652 | 264 | 0.624835 | from unittest import TestCase
from littlelambocoin.types.blockchain_format.program import Program, INFINITE_COST
from littlelambocoin.util.byte_types import hexstr_to_bytes
from littlelambocoin.wallet.puzzles.load_clvm import load_clvm
DESERIALIZE_MOD = load_clvm("littlelambocoinlisp_deserialisation.clvm", package_or... | true | true |
f71a0aa7e2a9704ecbc6e1a45727204696ea1a5b | 2,036 | py | Python | Discord 1.0.0a - REWRITE/EstruturaBots/CogsSharding/main.py | Algueem/Discord-Bot-Python-Tutoriais | cd126828a21fba4be584ffb62f923fa12086307b | [
"MIT"
] | 1 | 2018-10-14T16:45:32.000Z | 2018-10-14T16:45:32.000Z | Discord 1.0.0a - REWRITE/EstruturaBots/CogsSharding/main.py | ikrost/Discord-Bot-Python-Tutoriais | cd126828a21fba4be584ffb62f923fa12086307b | [
"MIT"
] | null | null | null | Discord 1.0.0a - REWRITE/EstruturaBots/CogsSharding/main.py | ikrost/Discord-Bot-Python-Tutoriais | cd126828a21fba4be584ffb62f923fa12086307b | [
"MIT"
] | 2 | 2019-04-26T21:37:38.000Z | 2019-05-07T17:37:26.000Z | import discord
from discord.ext import commands
import json
#vamos abrir o setup json para pegar as informaçoes
with open('bot_setup.json') as vagner:
bot_settings =json.load(vagner)
#lista de comandos
# cmds.info o cmds que dizer o nome da pastar e o info o nome do arquivo
#pode fazer tbm cmds.adm.ban caso qu... | 33.377049 | 121 | 0.632613 | import discord
from discord.ext import commands
import json
with open('bot_setup.json') as vagner:
bot_settings =json.load(vagner)
cmd_open=['cmds.info','cmds.cooldown']
class main(commands.AutoShardedBot):
def __init__(self):
super().__init__(command_prefix=bot_settings['prefixo'],
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.