hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
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 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7906f7e2ae924545b9c80affa583f7faa97cbcdd | 630 | py | Python | setup.py | hopelife/mp_sync | d059c7983d7d92182e6b38d6efba473440bdf0d2 | [
"MIT"
] | null | null | null | setup.py | hopelife/mp_sync | d059c7983d7d92182e6b38d6efba473440bdf0d2 | [
"MIT"
] | null | null | null | setup.py | hopelife/mp_sync | d059c7983d7d92182e6b38d6efba473440bdf0d2 | [
"MIT"
] | null | null | null | from setuptools import setup
import mp_sync
setup(
name='mp_sync',
version=mp_sync.__version__,
description='Moon Package for Sync repository(google drive, notion, mongodb(local/web), local file)',
url='https://github.com/hopelife/mp_sync',
author='Moon Jung Sam',
author_email='monblue@snu.ac.k... | 30 | 105 | 0.655556 | from setuptools import setup
import mp_sync
setup(
name='mp_sync',
version=mp_sync.__version__,
description='Moon Package for Sync repository(google drive, notion, mongodb(local/web), local file)',
url='https://github.com/hopelife/mp_sync',
author='Moon Jung Sam',
author_email='monblue@snu.ac.k... | true | true |
7906f83b320bda4c22c8898d12a63f535e7743d5 | 605 | py | Python | setup.py | bneurd/bcpy | f52b64d3206c38f3131e91b4067a35765991891e | [
"MIT"
] | 2 | 2019-05-08T17:35:55.000Z | 2020-03-06T18:23:40.000Z | setup.py | igornfaustino/bcpy | f52b64d3206c38f3131e91b4067a35765991891e | [
"MIT"
] | 17 | 2019-07-17T01:36:15.000Z | 2020-05-02T13:22:27.000Z | setup.py | bneurd/bcpy | f52b64d3206c38f3131e91b4067a35765991891e | [
"MIT"
] | 1 | 2019-05-08T17:38:35.000Z | 2019-05-08T17:38:35.000Z | #!/usr/bin/env python
from setuptools import setup, find_packages
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='bcpy',
version='0.1',
author='Igor Neves Faustino',
author_email='igornfaustino@gmail.com',
url='https://github.com/igornfaustino/bcpy.git',
descr... | 26.304348 | 72 | 0.682645 |
from setuptools import setup, find_packages
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='bcpy',
version='0.1',
author='Igor Neves Faustino',
author_email='igornfaustino@gmail.com',
url='https://github.com/igornfaustino/bcpy.git',
description='library for B... | true | true |
7906fc2c836240a009830a016f636644f00d7e9f | 1,754 | py | Python | urduhack/tokenization/wtk.py | cinfotech94/urduhackk | 44500cd6a78e1a7765bb4f7d6fb92bbb612b7b11 | [
"MIT"
] | 252 | 2018-08-20T16:16:45.000Z | 2022-03-04T07:03:58.000Z | urduhack/tokenization/wtk.py | cinfotech94/urduhackk | 44500cd6a78e1a7765bb4f7d6fb92bbb612b7b11 | [
"MIT"
] | 111 | 2019-01-21T11:39:45.000Z | 2021-09-30T07:26:50.000Z | urduhack/tokenization/wtk.py | cinfotech94/urduhackk | 44500cd6a78e1a7765bb4f7d6fb92bbb612b7b11 | [
"MIT"
] | 35 | 2019-02-09T14:29:36.000Z | 2022-01-09T10:02:56.000Z | """SentencePiece based word tokenizer module"""
from pathlib import Path
from typing import List
import sentencepiece as spm
from urduhack.stop_words import STOP_WORDS
def _is_token(pieces: list, special_symbol: str = "▁") -> List[str]:
"""
Check for stopwords and actual words in word pieces
Args:
... | 28.290323 | 102 | 0.641391 |
from pathlib import Path
from typing import List
import sentencepiece as spm
from urduhack.stop_words import STOP_WORDS
def _is_token(pieces: list, special_symbol: str = "▁") -> List[str]:
decoded = []
for piece in pieces:
if special_symbol not in piece:
if piece in STOP_WORDS or len(pie... | true | true |
7906fc4b0cb5090958dba5feba53118129fe2e91 | 322 | py | Python | exercicios-turtle/.history/clown_20210623230605.py | Aleff13/poo-ufsc | bc1574df26f840a3c0fd5b1e0c72e5d69f61493d | [
"MIT"
] | 1 | 2021-11-28T18:49:21.000Z | 2021-11-28T18:49:21.000Z | exercicios-turtle/.history/clown_20210623230605.py | Aleff13/poo-ufsc | bc1574df26f840a3c0fd5b1e0c72e5d69f61493d | [
"MIT"
] | null | null | null | exercicios-turtle/.history/clown_20210623230605.py | Aleff13/poo-ufsc | bc1574df26f840a3c0fd5b1e0c72e5d69f61493d | [
"MIT"
] | null | null | null | import turtle
tortuguita= turtle.Turtle()
tortuguita.speed(100)
tortuguita.dot(30,"black")
tortuguita.forward(15)
tortuguita.left(90)
tortuguita.circle(50)
tortuguita.circle(70)
tortuguita.circle(90)
tortuguita.right(90)
tortuguita.up()
tortuguita.forward(15)
tortuguita.down()
tortuguita.dot(30,"black")
turtle.done... | 16.947368 | 27 | 0.785714 | import turtle
tortuguita= turtle.Turtle()
tortuguita.speed(100)
tortuguita.dot(30,"black")
tortuguita.forward(15)
tortuguita.left(90)
tortuguita.circle(50)
tortuguita.circle(70)
tortuguita.circle(90)
tortuguita.right(90)
tortuguita.up()
tortuguita.forward(15)
tortuguita.down()
tortuguita.dot(30,"black")
turtle.done... | true | true |
7906fc6645a886f9ed9950c4fedbead2d10eec99 | 7,164 | py | Python | src/profit.py | dayuanyuan1989/SaveProfits | fcf86ab160eb7f9f064dfd25e9594dde2cc19ede | [
"MIT"
] | null | null | null | src/profit.py | dayuanyuan1989/SaveProfits | fcf86ab160eb7f9f064dfd25e9594dde2cc19ede | [
"MIT"
] | null | null | null | src/profit.py | dayuanyuan1989/SaveProfits | fcf86ab160eb7f9f064dfd25e9594dde2cc19ede | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import time, threading, uuid, sys
import tushare as ts
from PyQt4 import QtCore, QtGui
import utils
class ProfitStrategy(QtCore.QObject):
def init(self, b):
pass
def update_target(self, dp, p, t1, t2):
pass
def reset_target(self, b, p, t1, t2):
pass
class Pr... | 36.927835 | 137 | 0.543691 |
import time, threading, uuid, sys
import tushare as ts
from PyQt4 import QtCore, QtGui
import utils
class ProfitStrategy(QtCore.QObject):
def init(self, b):
pass
def update_target(self, dp, p, t1, t2):
pass
def reset_target(self, b, p, t1, t2):
pass
class ProfitWideStrategy(QtCore... | false | true |
7906fdb44ad72b320d627d874022f415dfccd5f9 | 724 | py | Python | backend/function_park/dict_url.py | Mancid/mancid_project | 4923264af324439658ad256444f3af6a4963e44f | [
"Unlicense"
] | 2 | 2021-05-12T14:10:16.000Z | 2021-05-16T22:05:41.000Z | backend/function_park/dict_url.py | Mancid/mancid_project | 4923264af324439658ad256444f3af6a4963e44f | [
"Unlicense"
] | 18 | 2021-05-11T14:24:05.000Z | 2021-06-10T10:42:42.000Z | backend/function_park/dict_url.py | Mancid/mancid_project | 4923264af324439658ad256444f3af6a4963e44f | [
"Unlicense"
] | 7 | 2021-05-01T17:50:54.000Z | 2021-06-09T12:04:11.000Z | import configparser
import logging
def dict_url(conf):
"""Add all url from file url.ini with
key = name of the parking end value is
the url.
:returns: dictionnary with all parking and url
:rtype: dict
"""
url = configparser.ConfigParser()
logging.debug("initializing the variable url")... | 27.846154 | 63 | 0.632597 | import configparser
import logging
def dict_url(conf):
url = configparser.ConfigParser()
logging.debug("initializing the variable url")
url.read(conf)
logging.debug("read the file")
logging.debug("all url in file %s", list(url["url"]))
res = {}
for simple_url in list(url["url"]):
p... | true | true |
7906fe1dda882dea88ca1a8fc5c233216e829712 | 1,364 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/plugins/become/test_ksu.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/plugins/become/test_ksu.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/plugins/become/test_ksu.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2020 Ansible Project
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import re
from an... | 34.1 | 115 | 0.699413 |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import re
from ansible import context
from ansible.playbook.play_context import PlayContext
from ansible.plugins.loader import become_loader
def test_ksu(mocker, parser, reset_cli_args):
options = parser.parse_args([])... | true | true |
7906fe8c0c4250c2bd332733e7df7947bda7c175 | 833 | py | Python | tests/unit/utils/test_objects.py | matt-mercer/localstack | b69ba25e495c6ef889d33a050b216d0cd1035041 | [
"Apache-2.0"
] | 1 | 2022-03-17T07:22:23.000Z | 2022-03-17T07:22:23.000Z | tests/unit/utils/test_objects.py | matt-mercer/localstack | b69ba25e495c6ef889d33a050b216d0cd1035041 | [
"Apache-2.0"
] | null | null | null | tests/unit/utils/test_objects.py | matt-mercer/localstack | b69ba25e495c6ef889d33a050b216d0cd1035041 | [
"Apache-2.0"
] | null | null | null | import pytest
from localstack.utils.objects import SubtypesInstanceManager
def test_subtypes_instance_manager():
class BaseClass(SubtypesInstanceManager):
def foo(self):
pass
class C1(BaseClass):
@staticmethod
def impl_name() -> str:
return "c1"
def f... | 22.513514 | 60 | 0.596639 | import pytest
from localstack.utils.objects import SubtypesInstanceManager
def test_subtypes_instance_manager():
class BaseClass(SubtypesInstanceManager):
def foo(self):
pass
class C1(BaseClass):
@staticmethod
def impl_name() -> str:
return "c1"
def f... | true | true |
7906fef75d37ae9679879dcf0a4445e99d5c6983 | 3,153 | py | Python | huaweicloud-sdk-vpc/huaweicloudsdkvpc/v3/model/show_security_group_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-vpc/huaweicloudsdkvpc/v3/model/show_security_group_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-vpc/huaweicloudsdkvpc/v3/model/show_security_group_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class ShowSecurityGroupRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): T... | 27.657895 | 89 | 0.574691 |
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class ShowSecurityGroupRequest:
sensitive_list = []
openapi_types = {
'security_group_id': 'str'
}
attribute_map = {
'security_group_id': 'security_group_id'
}
def __init_... | true | true |
790700693f26a7ad5bc91e870bd6cef3ab1d8c42 | 1,856 | py | Python | src/SALib/test_functions/Ishigami.py | zjzh/SALib | b6b6b5cab3388f3b80590c98d66aca7dc784d894 | [
"MIT"
] | 573 | 2015-07-14T06:17:59.000Z | 2022-03-31T03:42:00.000Z | src/SALib/test_functions/Ishigami.py | QianWanghhu/SALib | 95a3371e503f9253cb917b8f0101c0202b969c2b | [
"MIT"
] | 339 | 2015-07-08T13:30:16.000Z | 2022-03-25T07:48:09.000Z | src/SALib/test_functions/Ishigami.py | QianWanghhu/SALib | 95a3371e503f9253cb917b8f0101c0202b969c2b | [
"MIT"
] | 191 | 2015-07-13T09:00:07.000Z | 2022-03-29T22:49:26.000Z | import numpy as np
def evaluate(X: np.ndarray, A: float = 7.0, B: float = 0.1) -> np.ndarray:
"""Non-monotonic Ishigami-Homma three parameter test function:
`f(x) = \sin(x_{1}) + A \sin(x_{2})^2 + Bx^{4}_{3}\sin(x_{1})`
This test function is commonly used to benchmark global sensitivity
me... | 31.457627 | 79 | 0.566272 | import numpy as np
def evaluate(X: np.ndarray, A: float = 7.0, B: float = 0.1) -> np.ndarray:
Y = np.zeros(X.shape[0])
Y = np.sin(X[:, 0]) + A * np.power(np.sin(X[:, 1]), 2) + \
B * np.power(X[:, 2], 4) * np.sin(X[:, 0])
return Y
| true | true |
790700a6c7ada62d1c8c4f6a2b1bb02d7eb4ee5f | 87,629 | py | Python | tests/lax_control_flow_test.py | cdfreeman-google/jax | ca6f8186a36a8962845289ffc6baed3e96390f68 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | tests/lax_control_flow_test.py | cdfreeman-google/jax | ca6f8186a36a8962845289ffc6baed3e96390f68 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | tests/lax_control_flow_test.py | cdfreeman-google/jax | ca6f8186a36a8962845289ffc6baed3e96390f68 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 33.255787 | 110 | 0.604788 |
import collections
from functools import partial
import itertools
import operator
import re
from unittest import SkipTest
import textwrap
from absl.testing import absltest
from absl.testing import parameterized
import numpy as np
import numpy.random as npr
import jax
from jax._src import api
from jax ... | true | true |
790702cdce5fb7ac74a8a831cfb82e00313e3d81 | 907 | py | Python | mysite/blog/migrations/0001_initial.py | uzzal71/Django_blog | 096c0bb0057cc593a10eeff2ef1afecd7a6c1cf3 | [
"MIT"
] | 1 | 2019-01-16T05:05:21.000Z | 2019-01-16T05:05:21.000Z | mysite/blog/migrations/0001_initial.py | uzzal71/Django_blog | 096c0bb0057cc593a10eeff2ef1afecd7a6c1cf3 | [
"MIT"
] | null | null | null | mysite/blog/migrations/0001_initial.py | uzzal71/Django_blog | 096c0bb0057cc593a10eeff2ef1afecd7a6c1cf3 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.4 on 2018-12-28 02:51
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUT... | 31.275862 | 120 | 0.637266 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
... | true | true |
790704990ad2011fcbab4c18a03a039065742810 | 1,031 | py | Python | config_manager/namespace.py | tbeckham/DeploymentManager | c1b2ba47d1732859ff458eb934da671fb0dad37f | [
"Apache-2.0"
] | null | null | null | config_manager/namespace.py | tbeckham/DeploymentManager | c1b2ba47d1732859ff458eb934da671fb0dad37f | [
"Apache-2.0"
] | null | null | null | config_manager/namespace.py | tbeckham/DeploymentManager | c1b2ba47d1732859ff458eb934da671fb0dad37f | [
"Apache-2.0"
] | null | null | null | # __author__ = 'clarkmatthew'
#
import json
class Namespace(object):
"""
Convert dict (if provided) into attributes and return a somewhat
generic object
"""
def __init__(self, newdict=None):
if newdict:
for key in newdict:
value = newdict[key]
tr... | 30.323529 | 78 | 0.402522 |
import json
class Namespace(object):
"""
Convert dict (if provided) into attributes and return a somewhat
generic object
"""
def __init__(self, newdict=None):
if newdict:
for key in newdict:
value = newdict[key]
try:
if isin... | false | true |
7907054ceea320e935931e7cb27969d1b35a9ad4 | 520 | py | Python | Python 基础教程/1.5.2 商品买卖练习2.py | shao1chuan/pythonbook | cd9877d04e1e11422d38cc051e368d3d9ce2ab45 | [
"MulanPSL-1.0"
] | 95 | 2020-10-11T04:45:46.000Z | 2022-02-25T01:50:40.000Z | Python 基础教程/1.5.2 商品买卖练习2.py | shao1chuan/pythonbook | cd9877d04e1e11422d38cc051e368d3d9ce2ab45 | [
"MulanPSL-1.0"
] | null | null | null | Python 基础教程/1.5.2 商品买卖练习2.py | shao1chuan/pythonbook | cd9877d04e1e11422d38cc051e368d3d9ce2ab45 | [
"MulanPSL-1.0"
] | 30 | 2020-11-05T09:01:00.000Z | 2022-03-08T05:58:55.000Z | # 列表综合练习 写一个循环,不断的问用户想买什么,用户选择一个商品编号,
# 就把对应的商品添加到购物车里,最终用户输入q退出时,打印购物车里的商品列表
l1 = [['a',23],['b',34],['c',33],['d',345]]
l2 = []
print("商品列表****************")
for i in l1:
print(f"商品{i[0]},价格为{i[1]}")
while True:
name = input("输入商品名称:")
if name!="q":
for bb in l1:
if name==bb[0]:
... | 20 | 43 | 0.471154 |
l1 = [['a',23],['b',34],['c',33],['d',345]]
l2 = []
print("商品列表****************")
for i in l1:
print(f"商品{i[0]},价格为{i[1]}")
while True:
name = input("输入商品名称:")
if name!="q":
for bb in l1:
if name==bb[0]:
print(f"你选择的是{name}")
l2.append(bb)
... | true | true |
79070565a1f8768ecb84f605b1862504cc489825 | 957 | py | Python | plotly/validators/sankey/__init__.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 2 | 2020-03-24T11:41:14.000Z | 2021-01-14T07:59:43.000Z | plotly/validators/sankey/__init__.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 1 | 2020-12-15T16:56:11.000Z | 2020-12-15T16:56:11.000Z | plotly/validators/sankey/__init__.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 4 | 2019-06-03T14:49:12.000Z | 2022-01-06T01:05:12.000Z | from ._visible import VisibleValidator
from ._valuesuffix import ValuesuffixValidator
from ._valueformat import ValueformatValidator
from ._uid import UidValidator
from ._textfont import TextfontValidator
from ._stream import StreamValidator
from ._showlegend import ShowlegendValidator
from ._selectedpoints import Sele... | 39.875 | 52 | 0.879833 | from ._visible import VisibleValidator
from ._valuesuffix import ValuesuffixValidator
from ._valueformat import ValueformatValidator
from ._uid import UidValidator
from ._textfont import TextfontValidator
from ._stream import StreamValidator
from ._showlegend import ShowlegendValidator
from ._selectedpoints import Sele... | true | true |
79070580cee376e382750abdbf7e53085f78557b | 4,618 | py | Python | opensanctions/crawlers/us_trade_csl.py | sanktio/opensanctions | 318f54775b333fefb79e002042e6564b6a4fa5bc | [
"MIT"
] | 79 | 2021-02-04T11:20:43.000Z | 2022-01-27T12:04:48.000Z | opensanctions/crawlers/us_trade_csl.py | sanktio/opensanctions | 318f54775b333fefb79e002042e6564b6a4fa5bc | [
"MIT"
] | 101 | 2021-02-12T18:26:16.000Z | 2022-01-27T14:01:53.000Z | opensanctions/crawlers/us_trade_csl.py | sanktio/opensanctions | 318f54775b333fefb79e002042e6564b6a4fa5bc | [
"MIT"
] | 21 | 2021-02-02T12:59:08.000Z | 2022-01-25T15:03:43.000Z | import json
from banal import ensure_list
from functools import lru_cache
from pantomime.types import JSON
from requests.exceptions import TooManyRedirects
from opensanctions.core import Dataset
from opensanctions import helpers as h
FORMATS = ["%d %b %Y", "%d %B %Y", "%Y", "%b %Y", "%B %Y"]
SDN = Dataset.require("us... | 36.078125 | 81 | 0.637289 | import json
from banal import ensure_list
from functools import lru_cache
from pantomime.types import JSON
from requests.exceptions import TooManyRedirects
from opensanctions.core import Dataset
from opensanctions import helpers as h
FORMATS = ["%d %b %Y", "%d %B %Y", "%Y", "%b %Y", "%B %Y"]
SDN = Dataset.require("us... | true | true |
790705dff7658fd0f54dc68f4be233c64ed3d9b8 | 18,305 | py | Python | mcfly/modelgen.py | wadpac/mcfly | c288ba227df0e7423dccde63f9886b025ceec269 | [
"Apache-2.0"
] | 1 | 2019-05-06T08:26:10.000Z | 2019-05-06T08:26:10.000Z | mcfly/modelgen.py | wadpac/mcfly | c288ba227df0e7423dccde63f9886b025ceec269 | [
"Apache-2.0"
] | null | null | null | mcfly/modelgen.py | wadpac/mcfly | c288ba227df0e7423dccde63f9886b025ceec269 | [
"Apache-2.0"
] | 1 | 2020-01-21T15:43:01.000Z | 2020-01-21T15:43:01.000Z | #
# mcfly
#
# Copyright 2017 Netherlands eScience Center
#
# 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 l... | 38.618143 | 92 | 0.667632 |
from keras.models import Sequential
from keras.layers import Dense, Activation, Convolution1D, Lambda, \
Convolution2D, Flatten, \
Reshape, LSTM, Dropout, TimeDistributed, BatchNormalization, \
GlobalAveragePooling1D, Bidirectional
from keras.layers import CuDNNLSTM
from keras.regularizer... | true | true |
790705e67f37b4b782a257841c59890a230aee52 | 14,405 | py | Python | pulp/apis/gurobi_api.py | smipperat/pulp | b13f6e75bd0d0132180d0ee9333b2351c8327d66 | [
"MIT"
] | 1 | 2022-01-19T04:02:46.000Z | 2022-01-19T04:02:46.000Z | pulp/apis/gurobi_api.py | smipperat/pulp | b13f6e75bd0d0132180d0ee9333b2351c8327d66 | [
"MIT"
] | 1 | 2021-11-19T07:21:48.000Z | 2021-11-19T07:21:48.000Z | pulp/apis/gurobi_api.py | smipperat/pulp | b13f6e75bd0d0132180d0ee9333b2351c8327d66 | [
"MIT"
] | 1 | 2022-01-14T17:15:38.000Z | 2022-01-14T17:15:38.000Z | # PuLP : Python LP Modeler
# Version 1.4.2
# Copyright (c) 2002-2005, Jean-Sebastien Roy (js@jeannot.org)
# Modifications Copyright (c) 2007- Stuart Anthony Mitchell (s.mitchell@auckland.ac.nz)
# $Id:solvers.py 1791 2008-04-23 22:54:34Z smit023 $
# Permission is hereby granted, free of charge, to any person obtaining... | 41.512968 | 112 | 0.567581 |
from .core import LpSolver_CMD, LpSolver, subprocess, PulpSolverError, clock, log
from .core import gurobi_path
import os
from uuid import uuid4
import sys
from .. import constants
import warnings
# to import the gurobipy name into the module scope
gurobipy = None
class GUROBI(LpSolver):
... | true | true |
79070661e6fe22285dee8d3984c5e77158a8c8d2 | 5,093 | py | Python | spider.py | edroot/busgov_spider | 8247da7c98c1fab20a29369d274ff4d87f70a5d6 | [
"Apache-2.0"
] | null | null | null | spider.py | edroot/busgov_spider | 8247da7c98c1fab20a29369d274ff4d87f70a5d6 | [
"Apache-2.0"
] | null | null | null | spider.py | edroot/busgov_spider | 8247da7c98c1fab20a29369d274ff4d87f70a5d6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# =========================================================================
# Author Eduard Kabrinskyi <soulroot@gmail.com> Skype: soulroot@hotmail.com
# =========================================================================
# =========================
# Main APP defin... | 34.412162 | 122 | 0.531317 |
import logging
import os
import requests
from lxml import html
import time
from random import choice
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import create_engine, Table, Column, Integer, String, MetaData, ForeignKey
from sqlalchemy.orm import Session
from sqlalchemy import f... | true | true |
7907067f5c31951f95dd837db1647147344f6e85 | 3,172 | py | Python | core/tests.py | leonunesbs/aaafuria-rebon-backend | a969eab64b4968574f2d4ed0d746ca7cc63bf82b | [
"MIT"
] | 1 | 2022-02-23T01:04:51.000Z | 2022-02-23T01:04:51.000Z | core/tests.py | leonunesbs/aaafuria-rebon-backend | a969eab64b4968574f2d4ed0d746ca7cc63bf82b | [
"MIT"
] | 65 | 2021-12-12T13:20:58.000Z | 2022-03-29T17:03:43.000Z | core/tests.py | leonunesbs/aaafuria-rebon-backend | a969eab64b4968574f2d4ed0d746ca7cc63bf82b | [
"MIT"
] | 1 | 2022-03-06T17:50:49.000Z | 2022-03-06T17:50:49.000Z | from datetime import datetime, timedelta
import requests
from decouple import config
from django.contrib.auth.models import User
from django.test import TestCase
from django.utils import timezone
from .models import Socio
class ModelTest(TestCase):
def setUp(self):
Socio(
user=User.objects.c... | 33.041667 | 90 | 0.533733 | from datetime import datetime, timedelta
import requests
from decouple import config
from django.contrib.auth.models import User
from django.test import TestCase
from django.utils import timezone
from .models import Socio
class ModelTest(TestCase):
def setUp(self):
Socio(
user=User.objects.c... | true | true |
790706fd037b1cafec446abf5bd47829d039f68b | 8,665 | py | Python | tests/test_root_versioning_integration.py | ninox-iot/tuf | 5115cfc764a8316b5a857ce7d978d9a2b6909e11 | [
"MIT"
] | null | null | null | tests/test_root_versioning_integration.py | ninox-iot/tuf | 5115cfc764a8316b5a857ce7d978d9a2b6909e11 | [
"MIT"
] | null | null | null | tests/test_root_versioning_integration.py | ninox-iot/tuf | 5115cfc764a8316b5a857ce7d978d9a2b6909e11 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
<Program Name>
test_root_versioning_integration.py
<Author>
Evan Cordell.
<Started>
July 21, 2016.
<Copyright>
See LICENSE for licensing information.
<Purpose>
Test root versioning for efficient root key rotation.
"""
from __future__ import print_function
from __future__ import... | 37.349138 | 98 | 0.734795 |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import os
import logging
import tempfile
import shutil
import sys
if sys.version_info >= (2, 7):
import unittest
else:
import unittest2 as unittest
import tuf
i... | true | true |
790707004cff4fdd9940b29429745fc5fa573ac4 | 19,632 | py | Python | schicexplorer/scHicCluster.py | joachimwolff/scHiCExplorer | 8aebb444f3968d398c260690c89c9cd0e3186f0e | [
"MIT"
] | 10 | 2019-12-09T04:11:18.000Z | 2021-03-24T15:29:06.000Z | schicexplorer/scHicCluster.py | joachimwolff/scHiCExplorer | 8aebb444f3968d398c260690c89c9cd0e3186f0e | [
"MIT"
] | 2 | 2020-12-24T12:32:18.000Z | 2021-01-11T09:03:34.000Z | schicexplorer/scHicCluster.py | joachimwolff/scHiCExplorer | 8aebb444f3968d398c260690c89c9cd0e3186f0e | [
"MIT"
] | 2 | 2019-12-09T04:11:21.000Z | 2020-12-24T12:26:46.000Z | import argparse
import os
from multiprocessing import Process, Queue
import time
import logging
log = logging.getLogger(__name__)
from scipy import linalg
import cooler
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.cm import get_cmap
from sklearn.cluster import KMeans, Spectr... | 52.491979 | 195 | 0.596781 | import argparse
import os
from multiprocessing import Process, Queue
import time
import logging
log = logging.getLogger(__name__)
from scipy import linalg
import cooler
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.cm import get_cmap
from sklearn.cluster import KMeans, Spectr... | true | true |
7907072f331999b7edbfd2c9b5f70c307d6055ee | 3,687 | py | Python | meta_logger.py | rlaboulaye/transformer | 119195b2be1d2a3418141a73536d5167e97e06ed | [
"MIT"
] | null | null | null | meta_logger.py | rlaboulaye/transformer | 119195b2be1d2a3418141a73536d5167e97e06ed | [
"MIT"
] | 5 | 2021-03-18T21:07:06.000Z | 2022-03-11T23:30:49.000Z | meta_logger.py | rlaboulaye/transformer | 119195b2be1d2a3418141a73536d5167e97e06ed | [
"MIT"
] | null | null | null | import os
import json
import datetime
import numpy as np
from matplotlib import pyplot as plt
class MetaLogger(object):
def __init__(self, meta_config, config, task_directory, load_directory=None, load_epoch=None):
self.results_directory = os.path.join('meta_results', str(datetime.datetime.now()))
... | 41.897727 | 155 | 0.606184 | import os
import json
import datetime
import numpy as np
from matplotlib import pyplot as plt
class MetaLogger(object):
def __init__(self, meta_config, config, task_directory, load_directory=None, load_epoch=None):
self.results_directory = os.path.join('meta_results', str(datetime.datetime.now()))
... | true | true |
79070771acf73f2d1f4277d16824ac90848904c4 | 5,619 | py | Python | sdno-link-monitor/mie/snmpoper.py | openov2/sdno-monitoring | 7ca338dd34db36cd5a5ec574137578bac656df2a | [
"CC-BY-4.0"
] | null | null | null | sdno-link-monitor/mie/snmpoper.py | openov2/sdno-monitoring | 7ca338dd34db36cd5a5ec574137578bac656df2a | [
"CC-BY-4.0"
] | null | null | null | sdno-link-monitor/mie/snmpoper.py | openov2/sdno-monitoring | 7ca338dd34db36cd5a5ec574137578bac656df2a | [
"CC-BY-4.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2016-2017 China Telecommunication Co., Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lice... | 42.89313 | 82 | 0.479267 |
import traceback
import subprocess
from dotdict import DotDict
from xlogger import klog
oid = DotDict({
"ipAdEntAddr": ".1.3.6.1.2.1.4.20.1.1",
"ipAdEntIfIndex": ".1.3.6.1.2.1.4.20.1.2",
"ipAdEntNetMask": ".1.3.6.1.2.1.4.20.1.3",
"ipAdEntB... | true | true |
790707b3806087a104bed7112b6abaf0389030df | 1,142 | py | Python | Implementations/Conditional-Variational-Autoencoder/plot_utils.py | jaywonchung/Learning-ML | 5298318686144a78bed42d979e10fbd9979c0159 | [
"MIT"
] | 10 | 2019-01-18T10:32:36.000Z | 2022-03-14T08:40:23.000Z | Implementations/Conditional-Variational-Autoencoder/plot_utils.py | jaywonchung/Learning-ML | 5298318686144a78bed42d979e10fbd9979c0159 | [
"MIT"
] | null | null | null | Implementations/Conditional-Variational-Autoencoder/plot_utils.py | jaywonchung/Learning-ML | 5298318686144a78bed42d979e10fbd9979c0159 | [
"MIT"
] | null | null | null | import torchvision
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
def display_and_save_batch(title, batch, data, save=True, display=True):
"""Display and save batch of image using plt"""
im = torchvision.utils.make_grid(batch, nrow=int(batch.shape[0]**0.5))
plt.title(title)
plt.im... | 39.37931 | 101 | 0.643608 | import torchvision
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
def display_and_save_batch(title, batch, data, save=True, display=True):
im = torchvision.utils.make_grid(batch, nrow=int(batch.shape[0]**0.5))
plt.title(title)
plt.imshow(np.transpose(im.cpu().numpy(), (1, 2, 0)), cmap... | true | true |
790708d75974359baeaa5c9eaae0b5dd0526eb90 | 178 | py | Python | twitter_crawlers/tweepy_crawler/setup.py | MCardus/GuruFinder | cfa6b9fb0401a0fd9e637c5549b69d49b6b857e5 | [
"MIT"
] | null | null | null | twitter_crawlers/tweepy_crawler/setup.py | MCardus/GuruFinder | cfa6b9fb0401a0fd9e637c5549b69d49b6b857e5 | [
"MIT"
] | 1 | 2021-06-01T22:28:57.000Z | 2021-06-01T22:28:57.000Z | twitter_crawlers/tweepy_crawler/setup.py | MCardus/GuruFinder | cfa6b9fb0401a0fd9e637c5549b69d49b6b857e5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from distutils.core import setup
setup(
name='tweepy_crawler',
version='0.1',
license='MIT',
long_description=open('README.md').read(),
)
| 16.181818 | 46 | 0.657303 |
from distutils.core import setup
setup(
name='tweepy_crawler',
version='0.1',
license='MIT',
long_description=open('README.md').read(),
)
| true | true |
790709c7d3c09f621cff124c60d865458ae55151 | 822 | py | Python | orlov/libs/workspace/fixture.py | coppelia517/orlov | d7ed6c061432b99ab2b75e0262db293e444fe6be | [
"MIT"
] | null | null | null | orlov/libs/workspace/fixture.py | coppelia517/orlov | d7ed6c061432b99ab2b75e0262db293e444fe6be | [
"MIT"
] | null | null | null | orlov/libs/workspace/fixture.py | coppelia517/orlov | d7ed6c061432b99ab2b75e0262db293e444fe6be | [
"MIT"
] | null | null | null | """ Orlov Module : workspace module fixture. """
import os
import logging
import pytest
from orlov.libs.workspace import Workspace
logger = logging.getLogger(__name__)
@pytest.fixture(scope='session')
def workspace(request) -> Workspace:
""" Workspace Factory Fixture.
Yields:
directory(Workspace): ... | 27.4 | 68 | 0.678832 | import os
import logging
import pytest
from orlov.libs.workspace import Workspace
logger = logging.getLogger(__name__)
@pytest.fixture(scope='session')
def workspace(request) -> Workspace:
logger.debug('Setup of test structure.')
if request.config.getoption('workspace'):
result_dir = request.co... | true | true |
79070a37c6849ec01a26042f84b09163c6188f06 | 643 | py | Python | dataPlotter.py | ethantsai/nlwhistlers | 1b8cabf96e4fbb9a032bb4cd03797d65fe7a144b | [
"MIT"
] | 1 | 2021-05-24T20:46:20.000Z | 2021-05-24T20:46:20.000Z | dataPlotter.py | ethantsai/nlwhistlers | 1b8cabf96e4fbb9a032bb4cd03797d65fe7a144b | [
"MIT"
] | null | null | null | dataPlotter.py | ethantsai/nlwhistlers | 1b8cabf96e4fbb9a032bb4cd03797d65fe7a144b | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
lines = open("for_james.csv").read().splitlines()
data = [[float(x) for x in lines[i].split(", ")] for i in range(len(lines))]
# each item in data is a list of floats that can be passed to plt.hist
for i in range(9):
plt.... | 40.1875 | 103 | 0.682737 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
lines = open("for_james.csv").read().splitlines()
data = [[float(x) for x in lines[i].split(", ")] for i in range(len(lines))]
for i in range(9):
plt.hist(data[i], bins=np.logspace(1, 3, 20))
plt.title(f'Precipitatin... | true | true |
79070a39084122784f83decadf7c9b2e86fcb249 | 4,016 | py | Python | transformers4rec/tf/block/dlrm.py | Jwmc999/Transformers4Rec | e6cdf13a7c0102303c0258120274f88b2d42c9c2 | [
"Apache-2.0"
] | 415 | 2021-09-20T20:47:34.000Z | 2022-03-31T16:51:03.000Z | transformers4rec/tf/block/dlrm.py | Jwmc999/Transformers4Rec | e6cdf13a7c0102303c0258120274f88b2d42c9c2 | [
"Apache-2.0"
] | 128 | 2021-09-21T07:19:38.000Z | 2022-03-31T15:08:27.000Z | transformers4rec/tf/block/dlrm.py | Jwmc999/Transformers4Rec | e6cdf13a7c0102303c0258120274f88b2d42c9c2 | [
"Apache-2.0"
] | 44 | 2021-09-23T07:25:36.000Z | 2022-03-29T04:17:53.000Z | #
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 37.185185 | 98 | 0.680777 |
from typing import List, Optional, Union, cast
import tensorflow as tf
from merlin_standard_lib import Schema, Tag
from ..features.continuous import ContinuousFeatures
from ..features.embedding import EmbeddingFeatures
from ..tabular.base import TabularBlock
from .base import Block, BlockType
class... | true | true |
79070a691786b7d34291df055a14a81595740595 | 75 | py | Python | python__OOP/09.inheritance_exercise/01.person/child.py | EmilianStoyanov/Projects-in-SoftUni | e83996670fe00424a158905d537a7bbbeee8fb59 | [
"MIT"
] | 1 | 2020-07-14T12:32:47.000Z | 2020-07-14T12:32:47.000Z | python__OOP/09.inheritance_exercise/01.person/child.py | EmilianStoyanov/Projects-in-SoftUni | e83996670fe00424a158905d537a7bbbeee8fb59 | [
"MIT"
] | null | null | null | python__OOP/09.inheritance_exercise/01.person/child.py | EmilianStoyanov/Projects-in-SoftUni | e83996670fe00424a158905d537a7bbbeee8fb59 | [
"MIT"
] | null | null | null | from Person_1.project.person import Person
class Child(Person):
pass
| 12.5 | 42 | 0.76 | from Person_1.project.person import Person
class Child(Person):
pass
| true | true |
79070a6bbd847ff83c3a657630a4d6d85784302a | 1,363 | py | Python | mvpa2/tests/test_misc_plot.py | mortonne/PyMVPA | 98644c5cd9733edd39fac746ea7cf67398674645 | [
"MIT"
] | null | null | null | mvpa2/tests/test_misc_plot.py | mortonne/PyMVPA | 98644c5cd9733edd39fac746ea7cf67398674645 | [
"MIT"
] | null | null | null | mvpa2/tests/test_misc_plot.py | mortonne/PyMVPA | 98644c5cd9733edd39fac746ea7cf67398674645 | [
"MIT"
] | null | null | null | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the PyMVPA package for the
# copyright and license terms.
#
### ### ### ### ###... | 29 | 78 | 0.612619 | true | true | |
79070aec9110a122228a870b6404344568d47a77 | 3,680 | py | Python | spider/python/tutorial/pipelines.py | ferryhang/spider_job | 871309c86df8dd9abc37798415686344242210e2 | [
"MIT"
] | 322 | 2018-08-06T17:44:23.000Z | 2022-03-31T02:42:54.000Z | spider/python/tutorial/pipelines.py | ferryhang/spider_job | 871309c86df8dd9abc37798415686344242210e2 | [
"MIT"
] | 10 | 2019-03-16T03:57:17.000Z | 2022-03-17T07:51:17.000Z | spider/python/tutorial/pipelines.py | ferryhang/spider_job | 871309c86df8dd9abc37798415686344242210e2 | [
"MIT"
] | 116 | 2018-08-07T02:02:28.000Z | 2022-03-24T08:15:55.000Z | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import pymongo
import datetime
from scrapy.conf import settings
# 学历列表
educations = ("不限","大专","本科","硕士","博士")
#修正学历 有些职位中的学历明显... | 29.44 | 84 | 0.580435 |
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import pymongo
import datetime
from scrapy.conf import settings
# 学历列表
educations = ("不限","大专","本科","硕士","博士")
#修正学历 有些职位中的学历明显不一致。需要修正
def clean_education(edu,body):
if edu not in educations:
for i in educations:
if i in bod... | true | true |
79070bbbfd11ab08a9c1e746c305db66b5ba891c | 87,593 | py | Python | pandas/core/arrays/categorical.py | getschomp/pandas | 85dc1713bc6a1064f4afdf2a907bc9c72cdc364b | [
"BSD-3-Clause"
] | 1 | 2019-01-31T00:35:27.000Z | 2019-01-31T00:35:27.000Z | pandas/core/arrays/categorical.py | getschomp/pandas | 85dc1713bc6a1064f4afdf2a907bc9c72cdc364b | [
"BSD-3-Clause"
] | null | null | null | pandas/core/arrays/categorical.py | getschomp/pandas | 85dc1713bc6a1064f4afdf2a907bc9c72cdc364b | [
"BSD-3-Clause"
] | null | null | null | # pylint: disable=E1101,W0232
import numpy as np
from warnings import warn
import textwrap
from pandas import compat
from pandas.compat import u, lzip
from pandas._libs import lib, algos as libalgos
from pandas.core.dtypes.generic import (
ABCSeries, ABCIndexClass, ABCCategoricalIndex)
from pandas.core.dtypes.mi... | 34.122711 | 79 | 0.576176 |
import numpy as np
from warnings import warn
import textwrap
from pandas import compat
from pandas.compat import u, lzip
from pandas._libs import lib, algos as libalgos
from pandas.core.dtypes.generic import (
ABCSeries, ABCIndexClass, ABCCategoricalIndex)
from pandas.core.dtypes.missing import isna, notna
from... | true | true |
79070c2d3b2c86b7e751cc1403b35459fe05349e | 163,986 | py | Python | python/ccxt/okex.py | pphszx/ccxt | 5df54f840a4144d7efad5fd02190e2239f325ec9 | [
"MIT"
] | 1 | 2021-02-10T21:29:07.000Z | 2021-02-10T21:29:07.000Z | python/ccxt/okex.py | niki-johnson/ccxt | 8dd609995c5462a32e505210047d4fa5d41c53c8 | [
"MIT"
] | null | null | null | python/ccxt/okex.py | niki-johnson/ccxt | 8dd609995c5462a32e505210047d4fa5d41c53c8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
# -----------------------------------------------------------------------------
try:
basestri... | 47.17664 | 521 | 0.469924 |
ge import Exchange
try:
basestring
except NameError:
basestring = str
import hashlib
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import PermissionDenied
from ccxt.base.errors import AccountSuspended
from ccxt.base.errors import Argu... | true | true |
79070c3df17af284200d5bc7b0d6c56f78213d26 | 7,245 | py | Python | src/train_amp.py | suiyizhao/Pytorch-speedup | a9d4b0accc703035559ac6f42daddf8b1f0eb40a | [
"MIT"
] | 3 | 2021-11-15T01:43:11.000Z | 2021-12-06T03:14:36.000Z | src/train_amp.py | suiyizhao/Template | a9d4b0accc703035559ac6f42daddf8b1f0eb40a | [
"MIT"
] | null | null | null | src/train_amp.py | suiyizhao/Template | a9d4b0accc703035559ac6f42daddf8b1f0eb40a | [
"MIT"
] | null | null | null | import sys
import time
import torch
import random
import argparse
import numpy as np
import torch.nn as nn
import torchvision.transforms as transforms
from torchvision import datasets
from torch.utils.data import DataLoader
# new #
import torch.cuda.amp as amp
def printParaNum(model):
'''
function: pri... | 41.4 | 130 | 0.580814 | import sys
import time
import torch
import random
import argparse
import numpy as np
import torch.nn as nn
import torchvision.transforms as transforms
from torchvision import datasets
from torch.utils.data import DataLoader
import torch.cuda.amp as amp
def printParaNum(model):
total_params = sum(p.num... | true | true |
79070c51c152d01c88b859e9c7282d79bc2ef5a2 | 1,593 | py | Python | tests/test_05_weight.py | VolumeFi/somm-wbtc-eth-test-cellar | 862b9a5c747ac2622c216073ce3d3f753d45db78 | [
"Apache-2.0"
] | null | null | null | tests/test_05_weight.py | VolumeFi/somm-wbtc-eth-test-cellar | 862b9a5c747ac2622c216073ce3d3f753d45db78 | [
"Apache-2.0"
] | null | null | null | tests/test_05_weight.py | VolumeFi/somm-wbtc-eth-test-cellar | 862b9a5c747ac2622c216073ce3d3f753d45db78 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
import pytest
def test_weight(WBTC, WETH, accounts, SwapRouter, NonfungiblePositionManager, CellarPoolShareContract):
ACCURACY = 10 ** 6
SwapRouter.exactOutputSingle([WETH, WBTC, 3000, accounts[0], 2 ** 256 - 1, 10 ** 7, 2 * 10 ** 18, 0], {"from": accounts[0], "value": 2 * 10 ** 18})
WB... | 49.78125 | 151 | 0.700565 |
import pytest
def test_weight(WBTC, WETH, accounts, SwapRouter, NonfungiblePositionManager, CellarPoolShareContract):
ACCURACY = 10 ** 6
SwapRouter.exactOutputSingle([WETH, WBTC, 3000, accounts[0], 2 ** 256 - 1, 10 ** 7, 2 * 10 ** 18, 0], {"from": accounts[0], "value": 2 * 10 ** 18})
WBTC.approve(CellarP... | true | true |
79070cbabc52296c664029e2c39b4d5a3ed1e19a | 20,649 | py | Python | lib/python3.8/site-packages/ansible_collections/community/aws/plugins/modules/sns_topic.py | cjsteel/python3-venv-ansible-2.10.5 | c95395c4cae844dc66fddde9b4343966f4b2ecd5 | [
"Apache-1.1"
] | null | null | null | lib/python3.8/site-packages/ansible_collections/community/aws/plugins/modules/sns_topic.py | cjsteel/python3-venv-ansible-2.10.5 | c95395c4cae844dc66fddde9b4343966f4b2ecd5 | [
"Apache-1.1"
] | null | null | null | lib/python3.8/site-packages/ansible_collections/community/aws/plugins/modules/sns_topic.py | cjsteel/python3-venv-ansible-2.10.5 | c95395c4cae844dc66fddde9b4343966f4b2ecd5 | [
"Apache-1.1"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
module: sns_topic
short_description: Manages A... | 39.256654 | 162 | 0.638239 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
module: sns_topic
short_description: Manages AWS SNS topics and subscriptions
version_added: 1.0.0
description:
- The M(community.aws.sns_topic) module allows you to create, delete, and manage subscript... | true | true |
79070cf8be8d1e450b0e741b7984ba9e1ae73ce7 | 1,799 | py | Python | modules/subscribers/flottsbro/flottsbro.py | KTH/alvares | 75f1006b79c8bc319385230ba1e0b7fa0d4fea10 | [
"MIT"
] | null | null | null | modules/subscribers/flottsbro/flottsbro.py | KTH/alvares | 75f1006b79c8bc319385230ba1e0b7fa0d4fea10 | [
"MIT"
] | 3 | 2020-03-05T12:21:23.000Z | 2021-09-22T14:36:24.000Z | modules/subscribers/flottsbro/flottsbro.py | KTH/alvares | 75f1006b79c8bc319385230ba1e0b7fa0d4fea10 | [
"MIT"
] | null | null | null | __author__ = 'tinglev'
import logging
import requests
from requests import HTTPError, ConnectTimeout, RequestException
from modules import environment
from modules.subscribers.slack import slack_util
from modules.event_system.event_system import subscribe_to_event, unsubscribe_from_event
from modules import deployment... | 31.561404 | 117 | 0.740411 | __author__ = 'tinglev'
import logging
import requests
from requests import HTTPError, ConnectTimeout, RequestException
from modules import environment
from modules.subscribers.slack import slack_util
from modules.event_system.event_system import subscribe_to_event, unsubscribe_from_event
from modules import deployment... | true | true |
79070d17a4163f46519228f051f77c1390ac6edb | 1,285 | py | Python | tf2onnx/tflite/LessOptions.py | LoicDagnas/tensorflow-onnx | 6691850e79047d05d85017573170fd8240393b57 | [
"Apache-2.0"
] | 1,473 | 2018-03-16T02:47:33.000Z | 2022-03-31T03:43:52.000Z | tf2onnx/tflite/LessOptions.py | LoicDagnas/tensorflow-onnx | 6691850e79047d05d85017573170fd8240393b57 | [
"Apache-2.0"
] | 1,208 | 2018-03-14T09:58:49.000Z | 2022-03-31T17:56:20.000Z | tf2onnx/tflite/LessOptions.py | LoicDagnas/tensorflow-onnx | 6691850e79047d05d85017573170fd8240393b57 | [
"Apache-2.0"
] | 350 | 2018-04-03T03:48:40.000Z | 2022-03-30T11:23:55.000Z | # SPDX-License-Identifier: Apache-2.0
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: tflite
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class LessOptions(object):
__slots__ = ['_tab']
@classmethod
def GetRootAs(cls, buf, offset=0... | 32.125 | 114 | 0.705837 |
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class LessOptions(object):
__slots__ = ['_tab']
@classmethod
def GetRootAs(cls, buf, offset=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = LessOptions()
x.Init(buf,... | true | true |
79070d96eac5ea66dfc9f2206e334c33bd46075f | 1,285 | py | Python | selfdrive/loggerd/deleter.py | JoeOIVOV/ArnePilot | 82c71c6f5af1ba504b748940f22cc0ac98692662 | [
"MIT"
] | 116 | 2018-03-07T09:00:10.000Z | 2020-04-06T18:37:45.000Z | selfdrive/loggerd/deleter.py | JoeOIVOV/ArnePilot | 82c71c6f5af1ba504b748940f22cc0ac98692662 | [
"MIT"
] | 66 | 2020-04-09T20:27:57.000Z | 2022-01-27T14:39:24.000Z | selfdrive/loggerd/deleter.py | JoeOIVOV/ArnePilot | 82c71c6f5af1ba504b748940f22cc0ac98692662 | [
"MIT"
] | 154 | 2020-04-08T21:41:22.000Z | 2022-03-17T21:05:33.000Z | #!/usr/bin/env python3
import os
import shutil
import threading
from selfdrive.swaglog import cloudlog
from selfdrive.loggerd.config import ROOT, get_available_bytes, get_available_percent
from selfdrive.loggerd.uploader import listdir_by_creation
from selfdrive.dragonpilot.dashcam import DASHCAM_FREESPACE_LIMIT
MIN_B... | 28.555556 | 85 | 0.714397 |
import os
import shutil
import threading
from selfdrive.swaglog import cloudlog
from selfdrive.loggerd.config import ROOT, get_available_bytes, get_available_percent
from selfdrive.loggerd.uploader import listdir_by_creation
from selfdrive.dragonpilot.dashcam import DASHCAM_FREESPACE_LIMIT
MIN_BYTES = 5 * 1024 * 1024... | true | true |
79070deeea73b6884a348bbda16cd804b305ec0a | 1,614 | py | Python | application/server/main.py | EgoPro1/InceptionV2 | c24c7ded53445fe409aaa46b7eeabeb93a7b0ef7 | [
"MIT"
] | 1 | 2021-09-04T23:15:43.000Z | 2021-09-04T23:15:43.000Z | application/server/main.py | EgoPro1/InceptionV2 | c24c7ded53445fe409aaa46b7eeabeb93a7b0ef7 | [
"MIT"
] | null | null | null | application/server/main.py | EgoPro1/InceptionV2 | c24c7ded53445fe409aaa46b7eeabeb93a7b0ef7 | [
"MIT"
] | null | null | null | import uvicorn
from fastapi import (FastAPI, File, UploadFile)
from starlette.responses import RedirectResponse
from tensorflow.python.keras.preprocessing import image as imgx
import requests
from PIL import Image
from application.components import predict, read_imagefile
from application.schema import Symptom
from app... | 28.821429 | 79 | 0.724907 | import uvicorn
from fastapi import (FastAPI, File, UploadFile)
from starlette.responses import RedirectResponse
from tensorflow.python.keras.preprocessing import image as imgx
import requests
from PIL import Image
from application.components import predict, read_imagefile
from application.schema import Symptom
from app... | true | true |
79070e2d3f5dc8ddb6b9307a549f19b4bd0e6bb5 | 26,734 | py | Python | pynq/lib/logictools/tests/test_fsm_generator.py | michalkouril/PYNQ | c72febc2decc83816f40b91a7f60e11fe707c248 | [
"BSD-3-Clause"
] | 1,537 | 2016-09-26T22:51:50.000Z | 2022-03-31T13:33:54.000Z | pynq/lib/logictools/tests/test_fsm_generator.py | michalkouril/PYNQ | c72febc2decc83816f40b91a7f60e11fe707c248 | [
"BSD-3-Clause"
] | 414 | 2016-10-03T21:12:10.000Z | 2022-03-21T14:55:02.000Z | pynq/lib/logictools/tests/test_fsm_generator.py | michalkouril/PYNQ | c72febc2decc83816f40b91a7f60e11fe707c248 | [
"BSD-3-Clause"
] | 826 | 2016-09-23T22:29:43.000Z | 2022-03-29T11:02:09.000Z | # Copyright (c) 2016, Xilinx, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of con... | 39.842027 | 79 | 0.625533 |
from random import randint
from math import ceil
import numpy as np
import pytest
from pynq import Overlay
from pynq.tests.util import user_answer_yes
from pynq.lib.logictools.waveform import bitstring_to_int
from pynq.lib.logictools.waveform import wave_to_bitstring
from pynq.lib.logictoo... | true | true |
79070f25dcdb2e976bc31713d7f6ab46debfc137 | 2,487 | py | Python | medium/python3/c0288_609_find-duplicate-file-in-system/00_leetcode_0288.py | drunkwater/leetcode | 8cc4a07763e71efbaedb523015f0c1eff2927f60 | [
"Ruby"
] | null | null | null | medium/python3/c0288_609_find-duplicate-file-in-system/00_leetcode_0288.py | drunkwater/leetcode | 8cc4a07763e71efbaedb523015f0c1eff2927f60 | [
"Ruby"
] | null | null | null | medium/python3/c0288_609_find-duplicate-file-in-system/00_leetcode_0288.py | drunkwater/leetcode | 8cc4a07763e71efbaedb523015f0c1eff2927f60 | [
"Ruby"
] | 3 | 2018-02-09T02:46:48.000Z | 2021-02-20T08:32:03.000Z | # DRUNKWATER TEMPLATE(add description and prototypes)
# Question Title and Description on leetcode.com
# Function Declaration and Function Prototypes on leetcode.com
#609. Find Duplicate File in System
#Given a list of directory info including directory path, and all the files with contents in this directory, you need ... | 65.447368 | 242 | 0.737837 |
# :type paths: List[str]
# :rtype: List[List[str]]
# """
| true | true |
79070f851445a53e05d0643bcd5bbf8d376690ef | 6,665 | py | Python | grr/gui/api_regression_http.py | nickamon/grr | ad1936c74728de00db90f6fafa47892b54cfc92d | [
"Apache-2.0"
] | null | null | null | grr/gui/api_regression_http.py | nickamon/grr | ad1936c74728de00db90f6fafa47892b54cfc92d | [
"Apache-2.0"
] | 1 | 2018-05-08T21:15:51.000Z | 2018-05-08T21:15:51.000Z | grr/gui/api_regression_http.py | nickamon/grr | ad1936c74728de00db90f6fafa47892b54cfc92d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Base test classes for API handlers tests."""
# pylint:mode=test
import json
import logging
import os
import threading
import portpicker
import requests
from google.protobuf import json_format
from grr import gui
from grr_api_client.connectors import http_connector
from grr.gui import api_au... | 31.14486 | 79 | 0.722731 |
import json
import logging
import os
import threading
import portpicker
import requests
from google.protobuf import json_format
from grr import gui
from grr_api_client.connectors import http_connector
from grr.gui import api_auth_manager
from grr.gui import api_call_router
from grr.gui import api_value_renderers
... | true | true |
79070fbf711c1071af30c28295f6d1d93fd1595d | 2,683 | py | Python | taln2016/icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk_contrib/classifier/numrange.py | hectormartinez/rougexstem | 32da9eab253cb88fc1882e59026e8b5b40900a25 | [
"Apache-2.0"
] | null | null | null | taln2016/icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk_contrib/classifier/numrange.py | hectormartinez/rougexstem | 32da9eab253cb88fc1882e59026e8b5b40900a25 | [
"Apache-2.0"
] | null | null | null | taln2016/icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk_contrib/classifier/numrange.py | hectormartinez/rougexstem | 32da9eab253cb88fc1882e59026e8b5b40900a25 | [
"Apache-2.0"
] | null | null | null | # Natural Language Toolkit - Range
# Represents a range of numbers, not an immutable object and can be modified by include
# Capable of performing operations on ranges
#
# Author: Sumukh Ghodke <sumukh dot ghodke at gmail dot com>
#
# URL: <http://nltk.sf.net>
# This software is distributed under GPL, for license inf... | 38.328571 | 135 | 0.611256 |
from nltk_contrib.classifier.exceptions import systemerror as se
DELTA = 0.000001
class Range:
def __init__(self, lower = 0, upper = 0, upper_includes_max=False):
self.__delta_added = False
if upper < lower:
raise se.SystemError('Lower limit ' + str(lower) + ' cannot be greater... | true | true |
79071029fd42374964d12f513e9c510bdc7400eb | 10,072 | py | Python | tensorflow/python/kernel_tests/variable_ops_test.py | AlexChrisF/udacity | b7f85a74058fc63ccb7601c418450ab934ef5953 | [
"Apache-2.0"
] | 522 | 2016-06-08T02:15:50.000Z | 2022-03-02T05:30:36.000Z | tensorflow/python/kernel_tests/variable_ops_test.py | AlexChrisF/udacity | b7f85a74058fc63ccb7601c418450ab934ef5953 | [
"Apache-2.0"
] | 48 | 2016-07-26T00:11:55.000Z | 2022-02-23T13:36:33.000Z | tensorflow/python/kernel_tests/variable_ops_test.py | AlexChrisF/udacity | b7f85a74058fc63ccb7601c418450ab934ef5953 | [
"Apache-2.0"
] | 108 | 2016-06-16T15:34:05.000Z | 2022-03-12T13:23:11.000Z | # Copyright 2015 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
#
# Unless required by applica... | 41.110204 | 80 | 0.700655 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import errors
from tensorflow.python.framework import ops
from tensorflow.python.framework impo... | true | true |
790710a4696737e320d90c8c3b766f346cca7bef | 2,133 | py | Python | bot.py | sagol/umorilibot | 89e4bdc9771c21326768171099ee9872dc40b194 | [
"MIT"
] | 1 | 2021-02-19T11:13:24.000Z | 2021-02-19T11:13:24.000Z | bot.py | sagol/umorilibot | 89e4bdc9771c21326768171099ee9872dc40b194 | [
"MIT"
] | null | null | null | bot.py | sagol/umorilibot | 89e4bdc9771c21326768171099ee9872dc40b194 | [
"MIT"
] | null | null | null | from sources import Sources
from stories import Stories
class Bot():
def __init__(self, config):
self.url = config.get_url()
self.sources = None
self.stories = None
def load(self):
self.sources = Sources(self.url)
self.stories = Stories(self.sources)
... | 34.403226 | 95 | 0.547586 | from sources import Sources
from stories import Stories
class Bot():
def __init__(self, config):
self.url = config.get_url()
self.sources = None
self.stories = None
def load(self):
self.sources = Sources(self.url)
self.stories = Stories(self.sources)
... | true | true |
79071170e9dbb393696a52dfc7f26f101793ac87 | 165 | py | Python | plugins/data/gan/digitsDataPluginGan/__init__.py | wills2133/digits-ssd | addf2fda32291a02a7c602b9d58d37ca71afe79d | [
"BSD-3-Clause"
] | 4,552 | 2015-03-17T17:24:11.000Z | 2022-03-27T04:07:58.000Z | plugins/data/gan/digitsDataPluginGan/__init__.py | wills2133/digits-ssd | addf2fda32291a02a7c602b9d58d37ca71afe79d | [
"BSD-3-Clause"
] | 1,994 | 2015-03-17T21:46:44.000Z | 2022-03-19T18:20:29.000Z | plugins/data/gan/digitsDataPluginGan/__init__.py | wills2133/digits-ssd | addf2fda32291a02a7c602b9d58d37ca71afe79d | [
"BSD-3-Clause"
] | 1,791 | 2015-03-17T17:51:05.000Z | 2022-03-08T13:44:40.000Z | # Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
from __future__ import absolute_import
from .data import DataIngestion
__all__ = ['DataIngestion']
| 23.571429 | 63 | 0.787879 |
from __future__ import absolute_import
from .data import DataIngestion
__all__ = ['DataIngestion']
| true | true |
7907119ded5016468228022e0aeb09611a106f15 | 2,231 | py | Python | Python/find-k-pairs-with-smallest-sums.py | RideGreg/LeetCode | b70818b1e6947bf29519a24f78816e022ebab59e | [
"MIT"
] | 1 | 2022-01-30T06:55:28.000Z | 2022-01-30T06:55:28.000Z | Python/find-k-pairs-with-smallest-sums.py | RideGreg/LeetCode | b70818b1e6947bf29519a24f78816e022ebab59e | [
"MIT"
] | null | null | null | Python/find-k-pairs-with-smallest-sums.py | RideGreg/LeetCode | b70818b1e6947bf29519a24f78816e022ebab59e | [
"MIT"
] | 1 | 2021-12-31T03:56:39.000Z | 2021-12-31T03:56:39.000Z | # Time: O(k * log(min(n, m, k))), where n is the size of num1, and m is the size of num2.
# Space: O(min(n, m, k))
# You are given two integer arrays nums1
# and nums2 sorted in ascending order and an integer k.
#
# Define a pair (u,v) which consists of one element
# from the first array and one element from the seco... | 27.54321 | 90 | 0.53922 |
from heapq import heappush, heappop
class Solution(object):
def kSmallestPairs(self, nums1, nums2, k):
pairs = []
if len(nums1) > len(nums2):
tmp = self.kSmallestPairs(nums2, nums1, k)
for pair in tmp:
pairs.append([pair[1], p... | true | true |
790711f44d3bd07658ab5643189d3e8a06e23288 | 5,910 | py | Python | tests/python/pants_test/backend/graph_info/tasks/test_list_targets.py | rahuliyer95/pants | 50ee5cc8bd9ab40ad13c3c28ccbc4e7f189292ec | [
"Apache-2.0"
] | null | null | null | tests/python/pants_test/backend/graph_info/tasks/test_list_targets.py | rahuliyer95/pants | 50ee5cc8bd9ab40ad13c3c28ccbc4e7f189292ec | [
"Apache-2.0"
] | null | null | null | tests/python/pants_test/backend/graph_info/tasks/test_list_targets.py | rahuliyer95/pants | 50ee5cc8bd9ab40ad13c3c28ccbc4e7f189292ec | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
from textwrap import dedent
import pytest
from pants.backend.jvm.artifact import Artifact
from pants.backend.jvm.repository import Repository
from pants.backend.jvm.scala_artif... | 31.774194 | 101 | 0.494585 |
import os
from textwrap import dedent
import pytest
from pants.backend.jvm.artifact import Artifact
from pants.backend.jvm.repository import Repository
from pants.backend.jvm.scala_artifact import ScalaArtifact
from pants.backend.jvm.targets.java_library import JavaLibrary
from pants.backend.python.targets.python_... | true | true |
7907135da0f963d80a425f52deab8e3b6f5b62c0 | 15,763 | py | Python | osxphotos/cli/about.py | oPromessa/osxphotos | 0d7e324f0262093727147b9f22ed275e962e8725 | [
"MIT"
] | null | null | null | osxphotos/cli/about.py | oPromessa/osxphotos | 0d7e324f0262093727147b9f22ed275e962e8725 | [
"MIT"
] | null | null | null | osxphotos/cli/about.py | oPromessa/osxphotos | 0d7e324f0262093727147b9f22ed275e962e8725 | [
"MIT"
] | null | null | null | """about command for osxphotos CLI"""
from textwrap import dedent
import click
from osxphotos._constants import OSXPHOTOS_URL
from osxphotos._version import __version__
MIT_LICENSE = """
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documen... | 50.848387 | 104 | 0.748588 |
from textwrap import dedent
import click
from osxphotos._constants import OSXPHOTOS_URL
from osxphotos._version import __version__
MIT_LICENSE = """
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal... | true | true |
7907144cfa4b569479c86296f45c647d9b00f6ab | 3,590 | py | Python | cinfo/triager.py | EliadCohen/cinfo | 70acd2c4c47aee4dc12b0a9e0e6cdfe2b6d902e9 | [
"Apache-2.0"
] | null | null | null | cinfo/triager.py | EliadCohen/cinfo | 70acd2c4c47aee4dc12b0a9e0e6cdfe2b6d902e9 | [
"Apache-2.0"
] | null | null | null | cinfo/triager.py | EliadCohen/cinfo | 70acd2c4c47aee4dc12b0a9e0e6cdfe2b6d902e9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Arie Bregman
#
# 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 agree... | 34.854369 | 78 | 0.591086 |
import crayons
import importlib
import logging
import os
import sys
from cinfo.config import Config
from cinfo.exceptions import usage as usage_exc
LOG = logging.getLogger(__name__)
class Triager(object):
def __init__(self, config_file, source_name=None, target_name=None):
self.config_file... | true | true |
7907153f7348c34677e0563a3a2828ed9d361e52 | 282 | py | Python | chat/urls.py | tawhidularefindcc/Django-Speech-to-text-Chat | 51a3c531f99da829c7f59310ed9947d5f535c7ba | [
"MIT"
] | 18 | 2020-01-31T11:42:46.000Z | 2022-02-12T17:22:36.000Z | chat/urls.py | tawhidularefindcc/Django-Speech-to-text-Chat | 51a3c531f99da829c7f59310ed9947d5f535c7ba | [
"MIT"
] | null | null | null | chat/urls.py | tawhidularefindcc/Django-Speech-to-text-Chat | 51a3c531f99da829c7f59310ed9947d5f535c7ba | [
"MIT"
] | 10 | 2020-02-09T01:06:57.000Z | 2022-03-01T02:05:42.000Z | from django.urls import path
from . import views
app_name = "chat"
urlpatterns = [
path('', views.home, name='home'),
path('post/', views.post, name='post'),
path('messages/', views.messages, name='messages'),
path('upload/', views.upload, name='views.upload'),
]
| 23.5 | 55 | 0.641844 | from django.urls import path
from . import views
app_name = "chat"
urlpatterns = [
path('', views.home, name='home'),
path('post/', views.post, name='post'),
path('messages/', views.messages, name='messages'),
path('upload/', views.upload, name='views.upload'),
]
| true | true |
7907162d4b8b3873075fa92023988b32715a97db | 62 | py | Python | test/test_132_pattern.py | spencercjh/sync-leetcode-today-problem-python3-example | 4957e5eadb697334741df0fc297bec2edaa9e2ab | [
"Apache-2.0"
] | null | null | null | test/test_132_pattern.py | spencercjh/sync-leetcode-today-problem-python3-example | 4957e5eadb697334741df0fc297bec2edaa9e2ab | [
"Apache-2.0"
] | null | null | null | test/test_132_pattern.py | spencercjh/sync-leetcode-today-problem-python3-example | 4957e5eadb697334741df0fc297bec2edaa9e2ab | [
"Apache-2.0"
] | null | null | null | solution = 132Pattern()
assert X == solution.find132pattern( ) | 31 | 38 | 0.758065 | solution = 132Pattern()
assert X == solution.find132pattern( ) | false | true |
790716691a1cc9ac048c175ccfa4a0605f8cf294 | 1,328 | py | Python | numba/cuda/tests/cudapy/test_deprecation.py | svrakitin/numba | 830a2c7ccc410f270677b0b241f9b8acc2598101 | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | numba/cuda/tests/cudapy/test_deprecation.py | svrakitin/numba | 830a2c7ccc410f270677b0b241f9b8acc2598101 | [
"BSD-2-Clause",
"Apache-2.0"
] | 1 | 2019-08-29T21:03:09.000Z | 2019-08-29T21:04:26.000Z | numba/cuda/tests/cudapy/test_deprecation.py | svrakitin/numba | 830a2c7ccc410f270677b0b241f9b8acc2598101 | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | import warnings
from contextlib import contextmanager
from numba.tests.support import override_config, TestCase
from numba.cuda.testing import skip_on_cudasim
from numba import cuda
from numba.core import types
from numba.cuda.testing import SerialMixin
import unittest
@skip_on_cudasim("Skipped on simulator")
class ... | 30.181818 | 65 | 0.653614 | import warnings
from contextlib import contextmanager
from numba.tests.support import override_config, TestCase
from numba.cuda.testing import skip_on_cudasim
from numba import cuda
from numba.core import types
from numba.cuda.testing import SerialMixin
import unittest
@skip_on_cudasim("Skipped on simulator")
class ... | true | true |
790716bf91b361f85620be2e04340fe297d1b360 | 7,516 | py | Python | Server/checkin.py | varetic/HEU-Checkin-COVID-19 | 03507e60087125adc03e7b6e160d1b88128dae43 | [
"MIT"
] | 6 | 2021-01-18T06:21:45.000Z | 2021-02-01T08:24:04.000Z | Server/checkin.py | varetic/HEU-Checkin-COVID-19 | 03507e60087125adc03e7b6e160d1b88128dae43 | [
"MIT"
] | null | null | null | Server/checkin.py | varetic/HEU-Checkin-COVID-19 | 03507e60087125adc03e7b6e160d1b88128dae43 | [
"MIT"
] | 1 | 2020-09-02T03:58:42.000Z | 2020-09-02T03:58:42.000Z | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
"""
平安行动自动打卡
请事先安装好 lxml 和 requests 模块
pip install lxml requests
然后修改 27-31 行为自己的数据,未使用的变量保持原样即可
如有需要请自行配置 149-171 行的 SMTP 发信或 174-177 行的 Server 酱微信提醒
Created on 2020-04-13 20:20
@author: ZhangJiawei & Liu Chongpeng & Liu Lu
"""
import requests
import lxml.html
i... | 41.524862 | 149 | 0.562932 |
import requests
import lxml.html
import re
import json
import random
import time
import smtplib
import traceback
myid = "STUDENTID"
mypass = "PASSWORD"
mybound = "BOUNDFIELDS"
mydata = r'FORMDATA'
title = ""
msg = ""
proxies = {"http": None, "https": None}
headers = {
"Accept": "text/html,application/xhtm... | true | true |
7907176c72d8480869915c1f61fc92cd1e229bf5 | 5,343 | py | Python | main_test.py | WenZhihao666/TREND | ca4b17139b5f24d44d9421fed92021eb7a95ed6d | [
"MIT"
] | 2 | 2022-03-21T05:30:46.000Z | 2022-03-21T05:35:37.000Z | main_test.py | WenZhihao666/TREND | ca4b17139b5f24d44d9421fed92021eb7a95ed6d | [
"MIT"
] | null | null | null | main_test.py | WenZhihao666/TREND | ca4b17139b5f24d44d9421fed92021eb7a95ed6d | [
"MIT"
] | null | null | null | import sys
sys.path.append('../')
import torch
import numpy as np
import random
import math
import time
import argparse
from data_tlp_cite import DataHelper_t
from torch.utils.data import DataLoader
from model import Model
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRe... | 41.418605 | 109 | 0.688564 | import sys
sys.path.append('../')
import torch
import numpy as np
import random
import math
import time
import argparse
from data_tlp_cite import DataHelper_t
from torch.utils.data import DataLoader
from model import Model
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRe... | true | true |
7907177ab357f99cc18d74cefb8094ccd7cbf455 | 63,787 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_network_interfaces_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 3 | 2020-06-23T02:25:27.000Z | 2021-09-07T18:48:11.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_network_interfaces_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 510 | 2019-07-17T16:11:19.000Z | 2021-08-02T08:38:32.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_07_01/aio/operations/_network_interfaces_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 5 | 2019-09-04T12:51:37.000Z | 2020-09-16T07:28:40.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 52.284426 | 354 | 0.680107 |
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.... | true | true |
7907188b3a86de5b78cf320d8b128b1c60427cb3 | 10,628 | py | Python | tensorflow/contrib/model_pruning/python/pruning_test.py | khanhlvg/tensorflow | a59b74ccaafae59d616ecf08204d63023ff6f49c | [
"Apache-2.0"
] | 2 | 2019-06-28T17:43:04.000Z | 2019-06-28T17:43:07.000Z | tensorflow/contrib/model_pruning/python/pruning_test.py | khanhlvg/tensorflow | a59b74ccaafae59d616ecf08204d63023ff6f49c | [
"Apache-2.0"
] | 8 | 2019-07-08T10:09:18.000Z | 2019-09-26T20:55:43.000Z | tensorflow/contrib/model_pruning/python/pruning_test.py | khanhlvg/tensorflow | a59b74ccaafae59d616ecf08204d63023ff6f49c | [
"Apache-2.0"
] | 1 | 2020-07-27T13:51:52.000Z | 2020-07-27T13:51:52.000Z | # Copyright 2017 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
#
# Unless required by applica... | 41.84252 | 80 | 0.684136 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.contrib.model_pruning.python import pruning
from tensorflow.python.framework import constant_op
from tensorflow.python.ops import math_ops
from tensorflow.pyth... | true | true |
790718cc5c6d7c13093c48cc4b586fa7fd6fc109 | 2,125 | py | Python | spider/utilities/util_urlfilter.py | charlesXu86/PSpider | 98277905508d706d9b0ea2ac2854b41ae0b06fe3 | [
"BSD-2-Clause"
] | 1 | 2022-02-21T03:30:52.000Z | 2022-02-21T03:30:52.000Z | spider/utilities/util_urlfilter.py | charlesXu86/PSpider | 98277905508d706d9b0ea2ac2854b41ae0b06fe3 | [
"BSD-2-Clause"
] | null | null | null | spider/utilities/util_urlfilter.py | charlesXu86/PSpider | 98277905508d706d9b0ea2ac2854b41ae0b06fe3 | [
"BSD-2-Clause"
] | null | null | null | # _*_ coding: utf-8 _*_
"""
util_urlfilter.py by xianhu
"""
import re
import pybloom_live
from .util_config import CONFIG_URLPATTERN_ALL
class UrlFilter(object):
"""
class of UrlFilter, to filter url by regexs and (bloomfilter or set)
"""
def __init__(self, black_patterns=(CONFIG_URLPATTERN_ALL,), ... | 31.716418 | 128 | 0.618824 |
import re
import pybloom_live
from .util_config import CONFIG_URLPATTERN_ALL
class UrlFilter(object):
def __init__(self, black_patterns=(CONFIG_URLPATTERN_ALL,), white_patterns=(r"^http",), capacity=None):
self._re_black_list = [re.compile(pattern, flags=re.IGNORECASE) for pattern in black_patterns] i... | true | true |
79071902bf06f1aa91df391214ad289f5b2fa66a | 41,449 | py | Python | _py2tmp/testing/utils.py | DalavanCloud/tmppy | cdde676ba9d5011b7d2a46a9852e5986b90edbbc | [
"Apache-2.0"
] | 1 | 2018-09-01T18:14:26.000Z | 2018-09-01T18:14:26.000Z | _py2tmp/testing/utils.py | DalavanCloud/tmppy | cdde676ba9d5011b7d2a46a9852e5986b90edbbc | [
"Apache-2.0"
] | null | null | null | _py2tmp/testing/utils.py | DalavanCloud/tmppy | cdde676ba9d5011b7d2a46a9852e5986b90edbbc | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2017 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 requir... | 41.699195 | 202 | 0.547806 |
import inspect
import json
import os
import tempfile
import unittest
import textwrap
import re
import sys
import itertools
import subprocess
from functools import wraps
import difflib
import pytest
import py2tmp_test_config as config
import typed_ast.ast3 as ast
from _py2tmp import (
ast_to_ir3,
... | true | true |
79071923a801566d232e587f0c64e2832498d90a | 17,588 | py | Python | src/command_modules/azure-cli-acr/azure/cli/command_modules/acr/_params.py | IamPeterPan/azure-cli | 458a7641bf706601d22ee5b5e6435aab7ec95bca | [
"MIT"
] | null | null | null | src/command_modules/azure-cli-acr/azure/cli/command_modules/acr/_params.py | IamPeterPan/azure-cli | 458a7641bf706601d22ee5b5e6435aab7ec95bca | [
"MIT"
] | 3 | 2021-03-26T00:25:36.000Z | 2022-03-29T22:03:55.000Z | src/command_modules/azure-cli-acr/azure/cli/command_modules/acr/_params.py | IamPeterPan/azure-cli | 458a7641bf706601d22ee5b5e6435aab7ec95bca | [
"MIT"
] | 1 | 2020-07-13T22:28:09.000Z | 2020-07-13T22:28:09.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 71.495935 | 301 | 0.712702 |
import argparse
from argcomplete.completers import FilesCompleter
from knack.arguments import CLIArgumentType
from azure.mgmt.containerregistry.v2018_09_01.models import (
PasswordName,
WebhookStatus,
WebhookAction,
PolicyStatus,
RunStatus,
TaskStatus,
BaseImageTriggerType
)
from azur... | true | true |
79071bac861e3f16bc973a0233f8ef4a74035a95 | 97 | py | Python | randt/__init__.py | pordino/FalcomBot-cogs | 869371b5e9a9395d84dfa186ddbb0b1f56771975 | [
"MIT"
] | 9 | 2018-10-12T07:04:29.000Z | 2021-06-12T03:20:01.000Z | randt/__init__.py | pordino/FalcomBot-cogs | 869371b5e9a9395d84dfa186ddbb0b1f56771975 | [
"MIT"
] | 4 | 2018-10-22T19:43:20.000Z | 2021-07-21T09:15:43.000Z | randt/__init__.py | pordino/FalcomBot-cogs | 869371b5e9a9395d84dfa186ddbb0b1f56771975 | [
"MIT"
] | 9 | 2018-11-20T14:04:11.000Z | 2021-09-20T13:21:35.000Z | from .randt import RandomizationTools
def setup(bot):
bot.add_cog(RandomizationTools(bot))
| 16.166667 | 40 | 0.773196 | from .randt import RandomizationTools
def setup(bot):
bot.add_cog(RandomizationTools(bot))
| true | true |
79071bd33cb93a8554f6f7e4058d472eab17121b | 349 | py | Python | propel_app/routing.py | syz247179876/e_mall | f94e39e091e098242342f532ae371b8ff127542f | [
"Apache-2.0"
] | 7 | 2021-04-10T13:20:56.000Z | 2022-03-29T15:00:29.000Z | propel_app/routing.py | syz247179876/E_mall | f94e39e091e098242342f532ae371b8ff127542f | [
"Apache-2.0"
] | 9 | 2021-05-11T03:53:31.000Z | 2022-03-12T00:58:03.000Z | propel_app/routing.py | syz247179876/E_mall | f94e39e091e098242342f532ae371b8ff127542f | [
"Apache-2.0"
] | 2 | 2020-11-24T08:59:22.000Z | 2020-11-24T14:10:59.000Z | # -*- coding: utf-8 -*-
# @Time : 2020/8/8 下午4:22
# @Author : 司云中
# @File : routing.py
# @Software: Pycharm
from django.urls import path, re_path
websocket_urlpatterns = [
# 官方解释path可能存在某种bug,用re_path既可以支持正则,也可以支持path路由匹配规则
re_path(r'concern_notice',), # 用户店铺关注,当店主上架新商品的时候进行商品推送
re_path(r'buy_notice',... | 23.266667 | 61 | 0.681948 |
from django.urls import path, re_path
websocket_urlpatterns = [
re_path(r'concern_notice',),
re_path(r'buy_notice',),
] | true | true |
79071bee9c5723cb68ba7fed21f1681008610963 | 1,151 | py | Python | conf/tests.py | dyndeploy-test/timestrap | 0335836398401910d8cf248d6aebfcf70838e39d | [
"BSD-2-Clause"
] | 1 | 2019-01-23T02:17:04.000Z | 2019-01-23T02:17:04.000Z | conf/tests.py | usmanakram232/timestrap | 851bddae883452bbe4987932e95953b71b2a95b7 | [
"BSD-2-Clause"
] | 4 | 2021-03-09T00:41:40.000Z | 2022-02-12T05:49:22.000Z | conf/tests.py | usmanakram232/timestrap | 851bddae883452bbe4987932e95953b71b2a95b7 | [
"BSD-2-Clause"
] | null | null | null | from django.contrib.auth.models import User
from django.test import TestCase
from .models import Conf, Site, SitePermission
class ConfTestCase(TestCase):
def test_conf_created(self):
site = Site.objects.create(domain='test.site', name='Test Site')
self.assertIsInstance(site.conf, Conf)
class S... | 35.96875 | 74 | 0.67159 | from django.contrib.auth.models import User
from django.test import TestCase
from .models import Conf, Site, SitePermission
class ConfTestCase(TestCase):
def test_conf_created(self):
site = Site.objects.create(domain='test.site', name='Test Site')
self.assertIsInstance(site.conf, Conf)
class S... | true | true |
79071c10fd1355f406a1e2cf968a687a0a05f5a8 | 2,272 | py | Python | src/oci/network_load_balancer/models/work_request_log_entry_collection.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/network_load_balancer/models/work_request_log_entry_collection.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/network_load_balancer/models/work_request_log_entry_collection.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 32 | 245 | 0.680458 |
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel
from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class WorkRequestLogEntryCollection(object):
def __init__(self, **kwargs):
self.swagger_types = {
'items': ... | true | true |
79071c807a3437341d65eb7d59be48b0a5a3ecd5 | 18,062 | py | Python | google/cloud/datastore_v1/services/datastore/transports/grpc.py | LaudateCorpus1/python-datastore | b1f955b8d410392174092cb8131673a10ccc33ec | [
"Apache-2.0"
] | 50 | 2020-03-07T16:55:45.000Z | 2022-03-25T12:10:12.000Z | google/cloud/datastore_v1/services/datastore/transports/grpc.py | LaudateCorpus1/python-datastore | b1f955b8d410392174092cb8131673a10ccc33ec | [
"Apache-2.0"
] | 161 | 2020-02-07T00:46:20.000Z | 2022-03-16T20:02:16.000Z | google/cloud/datastore_v1/services/datastore/transports/grpc.py | LaudateCorpus1/python-datastore | b1f955b8d410392174092cb8131673a10ccc33ec | [
"Apache-2.0"
] | 28 | 2020-02-07T00:55:36.000Z | 2022-03-03T06:07:03.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... | 42.800948 | 87 | 0.62972 |
import warnings
from typing import Callable, Dict, Optional, Sequence, Tuple, Union
from google.api_core import grpc_helpers
from google.api_core import gapic_v1
import google.auth
from google.auth import credentials as ga_credentials
from google.auth.transport.grpc import SslCredentials
import g... | true | true |
79071db7886198fa699378735eefa00c44913e2d | 8,152 | py | Python | env/lib/python3.8/site-packages/sentry_sdk/integrations/asgi.py | crimergio/linux_test | 5e688a06884ab10b4eaaad10a5d0df417a1c9b31 | [
"CC-BY-4.0"
] | null | null | null | env/lib/python3.8/site-packages/sentry_sdk/integrations/asgi.py | crimergio/linux_test | 5e688a06884ab10b4eaaad10a5d0df417a1c9b31 | [
"CC-BY-4.0"
] | null | null | null | env/lib/python3.8/site-packages/sentry_sdk/integrations/asgi.py | crimergio/linux_test | 5e688a06884ab10b4eaaad10a5d0df417a1c9b31 | [
"CC-BY-4.0"
] | null | null | null | """
An ASGI middleware.
Based on Tom Christie's `sentry-asgi <https://github.com/encode/sentry-asgi>`_.
"""
import asyncio
import inspect
import urllib
from sentry_sdk._functools import partial
from sentry_sdk._types import MYPY
from sentry_sdk.hub import Hub, _should_send_default_pii
from sentry_sdk.integrations._w... | 34.837607 | 161 | 0.59421 |
import asyncio
import inspect
import urllib
from sentry_sdk._functools import partial
from sentry_sdk._types import MYPY
from sentry_sdk.hub import Hub, _should_send_default_pii
from sentry_sdk.integrations._wsgi_common import _filter_headers
from sentry_sdk.utils import (
ContextVar,
event_from_exception,
... | true | true |
79071e08338ccf76b011c1ef1b95723dd45f0284 | 4,434 | py | Python | rpiweather/server.py | wbkang/rpi-repo | fc2b770f99cc2405fbf6855f9f961c4f6aed99cb | [
"MIT"
] | null | null | null | rpiweather/server.py | wbkang/rpi-repo | fc2b770f99cc2405fbf6855f9f961c4f6aed99cb | [
"MIT"
] | null | null | null | rpiweather/server.py | wbkang/rpi-repo | fc2b770f99cc2405fbf6855f9f961c4f6aed99cb | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import RPi.GPIO as GPIO
import time
import threading
import logging
import pandas as pd
import numpy as np
from tzlocal import get_localzone
from flask import Flask, render_template, url_for, request
logging.basicConfig(level=logging.INFO,
format='%(asctime)s - %(threadName)... | 27.886792 | 99 | 0.58525 |
import RPi.GPIO as GPIO
import time
import threading
import logging
import pandas as pd
import numpy as np
from tzlocal import get_localzone
from flask import Flask, render_template, url_for, request
logging.basicConfig(level=logging.INFO,
format='%(asctime)s - %(threadName)s - %(name)s - %(level... | true | true |
79071e3b22da102021d04ee58c22ca5f558e2f7b | 11,178 | py | Python | helpers.py | vg2691994/mock_frb_injection_results | a4747e5ef38ed2171af22e40816bf75afc7e192d | [
"MIT"
] | null | null | null | helpers.py | vg2691994/mock_frb_injection_results | a4747e5ef38ed2171af22e40816bf75afc7e192d | [
"MIT"
] | null | null | null | helpers.py | vg2691994/mock_frb_injection_results | a4747e5ef38ed2171af22e40816bf75afc7e192d | [
"MIT"
] | null | null | null | #!/home/observer/miniconda2/bin/python
import numpy as N
import sys, os
import logging as L
import subprocess as S
from collections import namedtuple
from sigpyproc.Readers import FilReader as F
sys.path.append("/home/vgupta/Codes/Fake_FRBs/")
from Furby_reader import Furby_reader
class FileNotFound(Exception):
pas... | 34.079268 | 281 | 0.643049 |
import numpy as N
import sys, os
import logging as L
import subprocess as S
from collections import namedtuple
from sigpyproc.Readers import FilReader as F
sys.path.append("/home/vgupta/Codes/Fake_FRBs/")
from Furby_reader import Furby_reader
class FileNotFound(Exception):
pass
class Observation():
def __init__... | true | true |
79071ee9fe7f49640ed19449e3f774d5649ae15f | 1,040 | py | Python | tests/test_client.py | huangwanquan/python-orion-client | 33a430b47ac8cc311d852d838b1f1e1409b5b322 | [
"Apache-2.0"
] | null | null | null | tests/test_client.py | huangwanquan/python-orion-client | 33a430b47ac8cc311d852d838b1f1e1409b5b322 | [
"Apache-2.0"
] | null | null | null | tests/test_client.py | huangwanquan/python-orion-client | 33a430b47ac8cc311d852d838b1f1e1409b5b322 | [
"Apache-2.0"
] | 1 | 2021-09-30T09:07:14.000Z | 2021-09-30T09:07:14.000Z | #!/usr/bin/env python3
# Software Name: ngsildclient
# SPDX-FileCopyrightText: Copyright (c) 2021 Orange
# SPDX-License-Identifier: Apache 2.0
#
# This software is distributed under the Apache 2.0;
# see the NOTICE file for more details.
#
# Author: Fabien BATTELLO <fabien.battello@orange.com> et al.
# SPDX-License-Id... | 28.108108 | 83 | 0.721154 |
import logging
from ngsildclient.api.client import Client, Vendor
from .common import mocked_connected
logger = logging.getLogger(__name__)
def test_api_is_connected(requests_mock):
requests_mock.get("http://localhost:1026/ngsi-ld/v1/entities", status_code=200)
client = Client()
assert client... | true | true |
79071f35cc4c3888455c1fe89db96efe7cbe3d8d | 31,267 | py | Python | xsd-fu/python/genshi/output.py | jburel/ome-model | 4817c8dfcbe3bfbeafe899c489657769d7ebca60 | [
"BSD-2-Clause"
] | 476 | 2015-01-07T08:59:53.000Z | 2022-02-11T09:46:06.000Z | xsd-fu/python/genshi/output.py | jburel/ome-model | 4817c8dfcbe3bfbeafe899c489657769d7ebca60 | [
"BSD-2-Clause"
] | 82 | 2015-01-15T12:30:43.000Z | 2022-01-06T02:56:53.000Z | xsd-fu/python/genshi/output.py | jburel/ome-model | 4817c8dfcbe3bfbeafe899c489657769d7ebca60 | [
"BSD-2-Clause"
] | 99 | 2015-01-14T19:53:45.000Z | 2021-08-11T15:17:26.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2009 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | 37.134204 | 82 | 0.521604 |
from itertools import chain
import re
from genshi.core import escape, Attrs, Markup, Namespace, QName, StreamEventKind
from genshi.core import START, END, TEXT, XML_DECL, DOCTYPE, START_NS, END_NS, \
START_CDATA, END_CDATA, PI, COMMENT, XML_NAMESPACE
__all__ = ['encode', 'get_ser... | true | true |
79071fba79fcbe4f8abb339625905d2d0f62c917 | 14,770 | py | Python | models/model.py | DagothHertil/NNVEP-SRN-Deblur | c092fec78dfe73ce6247a56f1e16ab4f4576d6b0 | [
"MIT"
] | null | null | null | models/model.py | DagothHertil/NNVEP-SRN-Deblur | c092fec78dfe73ce6247a56f1e16ab4f4576d6b0 | [
"MIT"
] | null | null | null | models/model.py | DagothHertil/NNVEP-SRN-Deblur | c092fec78dfe73ce6247a56f1e16ab4f4576d6b0 | [
"MIT"
] | null | null | null | from __future__ import print_function
import os
import time
import random
import datetime
import scipy.misc
import numpy as np
import tensorflow as tf
import tensorflow.contrib.slim as slim
from datetime import datetime
from util.util import *
from util.BasicConvLSTMCell import *
class DEBLUR(object):
def __init_... | 46.30094 | 121 | 0.565471 | from __future__ import print_function
import os
import time
import random
import datetime
import scipy.misc
import numpy as np
import tensorflow as tf
import tensorflow.contrib.slim as slim
from datetime import datetime
from util.util import *
from util.BasicConvLSTMCell import *
class DEBLUR(object):
def __init_... | true | true |
790720cba5e6becaf5be0336c2f2ab24b0d0d12e | 21,274 | py | Python | qiskit/visualization/gate_map.py | navaneethsdk/qiskit-terra | 66a029f2a67c14dbf34857d172b088d75d152b55 | [
"Apache-2.0"
] | null | null | null | qiskit/visualization/gate_map.py | navaneethsdk/qiskit-terra | 66a029f2a67c14dbf34857d172b088d75d152b55 | [
"Apache-2.0"
] | 12 | 2018-09-21T12:02:18.000Z | 2018-09-25T09:14:59.000Z | qiskit/visualization/gate_map.py | navaneethsdk/qiskit-terra | 66a029f2a67c14dbf34857d172b088d75d152b55 | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 35.754622 | 95 | 0.512363 |
import math
import numpy as np
from qiskit.exceptions import QiskitError
from .matplotlib import HAS_MATPLOTLIB
from .exceptions import VisualizationError
class _GraphDist():
def __init__(self, size, ax, x=True):
self.size = size
self.ax = ax
self.x = x
@property
d... | true | true |
7907234ce747ad9312d8cc9fd355b23c721cfba2 | 21,323 | py | Python | quex/input/files/specifier/counter.py | Liby99/quex | 45f3d21d5df3307376e175cca2d8473e26cb5622 | [
"MIT"
] | null | null | null | quex/input/files/specifier/counter.py | Liby99/quex | 45f3d21d5df3307376e175cca2d8473e26cb5622 | [
"MIT"
] | 1 | 2022-01-31T18:08:44.000Z | 2022-01-31T18:08:44.000Z | quex/input/files/specifier/counter.py | raccoonmonk/quex | 20ffe451df9fd49bdc216ce45b8263fa228670e5 | [
"MIT"
] | null | null | null | # Project Quex (http://quex.sourceforge.net); License: MIT;
# (C) 2005-2020 Frank-Rene Schaefer;
#_______________________________________________________________________________
from quex.input.setup import NotificationDB
from quex.input.regular_expression.pattern import Patt... | 44.238589 | 111 | 0.60892 |
from quex.input.setup import NotificationDB
from quex.input.regular_expression.pattern import Pattern_Prep
import quex.input.regular_expression.core as regular_expression
from quex.input.code.base import SourceRef, \
... | true | true |
7907242b23cf204f4c037253cd0304a004a2efb1 | 6,371 | py | Python | contrib/discodex/lib/discodex/models.py | kostis/disco | 200ca4afef9851139b122928e409d1d3186be646 | [
"BSD-3-Clause"
] | 1 | 2016-08-23T06:45:18.000Z | 2016-08-23T06:45:18.000Z | contrib/discodex/lib/discodex/models.py | dimazest/disco | 9175f863d6f83f2a918c851c9eed88019adf7f24 | [
"BSD-3-Clause"
] | null | null | null | contrib/discodex/lib/discodex/models.py | dimazest/disco | 9175f863d6f83f2a918c851c9eed88019adf7f24 | [
"BSD-3-Clause"
] | null | null | null | import errno, os
from django.db import models
from django.http import Http404, HttpResponseServerError
from discodex.restapi.resource import Resource, Collection
from discodex.restapi.resource import (HttpResponseAccepted,
HttpResponseCreated,
... | 33.182292 | 85 | 0.578402 | import errno, os
from django.db import models
from django.http import Http404, HttpResponseServerError
from discodex.restapi.resource import Resource, Collection
from discodex.restapi.resource import (HttpResponseAccepted,
HttpResponseCreated,
... | false | true |
7907243674e9e866161964f1907b28118b6c5588 | 7,238 | py | Python | test/functional/test_f_xcompat.py | farleyb-amazon/aws-encryption-sdk-python | 7950abd73ee333407d2dadd02ef2d57c3df464cf | [
"Apache-2.0"
] | 95 | 2018-08-20T23:10:00.000Z | 2022-02-17T02:54:32.000Z | test/functional/test_f_xcompat.py | farleyb-amazon/aws-encryption-sdk-python | 7950abd73ee333407d2dadd02ef2d57c3df464cf | [
"Apache-2.0"
] | 220 | 2018-08-01T20:56:29.000Z | 2022-03-28T18:12:35.000Z | test/functional/test_f_xcompat.py | farleyb-amazon/aws-encryption-sdk-python | 7950abd73ee333407d2dadd02ef2d57c3df464cf | [
"Apache-2.0"
] | 63 | 2018-08-01T19:37:33.000Z | 2022-03-20T17:14:15.000Z | # Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | 39.336957 | 116 | 0.678088 |
import base64
import json
import logging
import os
import sys
from collections import defaultdict
import attr
import pytest
import six
import aws_encryption_sdk
from aws_encryption_sdk.exceptions import InvalidKeyIdError
from aws_encryption_sdk.identifiers import EncryptionKeyType, WrappingAlgorithm
from ... | true | true |
79072489b95e13f5dbe0e9f2641b90061a79a26f | 894 | py | Python | home_app/views.py | xjati46/agoraschool | 98e9c6510f50a9ee87b5a6e3627466d244f7a617 | [
"MIT"
] | null | null | null | home_app/views.py | xjati46/agoraschool | 98e9c6510f50a9ee87b5a6e3627466d244f7a617 | [
"MIT"
] | null | null | null | home_app/views.py | xjati46/agoraschool | 98e9c6510f50a9ee87b5a6e3627466d244f7a617 | [
"MIT"
] | null | null | null | from django.views.generic import TemplateView, CreateView, UpdateView
from django.urls import reverse_lazy
from home_app import forms
from django.contrib.auth.mixins import LoginRequiredMixin
from account_app.models import CustomUser
# Create your views here.
class IndexView(TemplateView):
template_name = 'home_... | 27.090909 | 69 | 0.787472 | from django.views.generic import TemplateView, CreateView, UpdateView
from django.urls import reverse_lazy
from home_app import forms
from django.contrib.auth.mixins import LoginRequiredMixin
from account_app.models import CustomUser
class IndexView(TemplateView):
template_name = 'home_app/index.html'
class P... | true | true |
7907253ab43db2fa4c6358f03b0c7aa789a281fb | 1,290 | py | Python | messages.py | Cedric0303/Vaccination-Notifier | 167d3acfb35a904bbf2b1f49451c2cb32a606c96 | [
"MIT"
] | 2 | 2021-07-02T05:03:34.000Z | 2021-07-06T10:32:24.000Z | messages.py | Cedric0303/Vaccination-Notifier | 167d3acfb35a904bbf2b1f49451c2cb32a606c96 | [
"MIT"
] | null | null | null | messages.py | Cedric0303/Vaccination-Notifier | 167d3acfb35a904bbf2b1f49451c2cb32a606c96 | [
"MIT"
] | null | null | null | """
strings and logic related to composing notifications
"""
HELLO_STATUS = "Hello! I'm Vaccination Notifier"
HELLO_MESSAGE = (
"Hello there!\n"
"\n"
"I'm Vaccination Notifier. This is just a message to let you know I'm running and "
"to test our notification configuration. I'll check for changes to yo... | 30.714286 | 90 | 0.675969 |
HELLO_STATUS = "Hello! I'm Vaccination Notifier"
HELLO_MESSAGE = (
"Hello there!\n"
"\n"
"I'm Vaccination Notifier. This is just a message to let you know I'm running and "
"to test our notification configuration. I'll check for changes to your "
"vaccination status once every {delay} minutes---unl... | true | true |
79072576249906be7c00308ba8ececc40ddbf15a | 1,923 | py | Python | src/quantum/azext_quantum/vendored_sdks/azure_mgmt_quantum/models/target_description_py3.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 2 | 2021-06-05T17:51:26.000Z | 2021-11-17T11:17:56.000Z | src/quantum/azext_quantum/vendored_sdks/azure_mgmt_quantum/models/target_description_py3.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 3 | 2020-05-27T20:16:26.000Z | 2020-07-23T19:46:49.000Z | src/quantum/azext_quantum/vendored_sdks/azure_mgmt_quantum/models/target_description_py3.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 5 | 2020-05-09T17:47:09.000Z | 2020-10-01T19:52:06.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 40.0625 | 158 | 0.632345 |
from msrest.serialization import Model
class TargetDescription(Model):
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'description': {'key': 'description', 'type': 'str'},
'accepted_data_formats': {'key': 'acceptedDataForm... | true | true |
7907258972bbefc6cc9463d808def2868ecddece | 4,207 | py | Python | src/csi_rover_controls/deprecated/simple_rover_controller.py | BhargavRE25/Rover-Machine-Learning | af48811ceb08acae1dda76473d294f362178dcbe | [
"MIT"
] | 3 | 2020-09-21T17:15:08.000Z | 2020-09-25T01:08:19.000Z | src/csi_rover_controls/deprecated/simple_rover_controller.py | columbia-university-robotics/vehicle-machine-learning | af48811ceb08acae1dda76473d294f362178dcbe | [
"MIT"
] | null | null | null | src/csi_rover_controls/deprecated/simple_rover_controller.py | columbia-university-robotics/vehicle-machine-learning | af48811ceb08acae1dda76473d294f362178dcbe | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import rospy
import math
from std_msgs.msg import Float64
from geometry_msgs.msg import Twist
class SimpleRoverController:
def __init__(self):
self.namespace = rospy.get_param("name_space", "scout_1")
self.w_s = rospy.get_param("wheel_separation", 1.7680) #... | 43.822917 | 131 | 0.651058 |
import rospy
import math
from std_msgs.msg import Float64
from geometry_msgs.msg import Twist
class SimpleRoverController:
def __init__(self):
self.namespace = rospy.get_param("name_space", "scout_1")
self.w_s = rospy.get_param("wheel_separation", 1.7680)
self.w_r = ro... | true | true |
7907258f4a7819efea66d391d5c390958abf5e17 | 598 | py | Python | server/djangoapp/admin.py | RafaelJon/agfzb-CloudAppDevelopment_Capstone | 006ea1affddb409e5a43659a7e9adca479e2d104 | [
"Apache-2.0"
] | null | null | null | server/djangoapp/admin.py | RafaelJon/agfzb-CloudAppDevelopment_Capstone | 006ea1affddb409e5a43659a7e9adca479e2d104 | [
"Apache-2.0"
] | null | null | null | server/djangoapp/admin.py | RafaelJon/agfzb-CloudAppDevelopment_Capstone | 006ea1affddb409e5a43659a7e9adca479e2d104 | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
# from .models import related models
from .models import CarMake, CarModel
# Register your models here.
# CarModelInline class
class CarModelInline(admin.StackedInline):
model = CarModel.car_makes.through
extra = 3
# CarModelAdmin class
class CarModelAdmin(admin.ModelAdmin):
... | 26 | 44 | 0.77592 | from django.contrib import admin
from .models import CarMake, CarModel
class CarModelInline(admin.StackedInline):
model = CarModel.car_makes.through
extra = 3
class CarModelAdmin(admin.ModelAdmin):
list_display = ['name']
class CarMakeAdmin(admin.ModelAdmin):
inlines = [CarModelInline]
list... | true | true |
79072799f7f744d11592756ce43654976d9a7ea8 | 1,619 | py | Python | tests/test_nexus.py | ghuls/weblogo | 7eab5d1b8a8ec38786fa426af84bd77950835524 | [
"MIT"
] | 108 | 2015-08-21T10:39:22.000Z | 2022-03-04T22:10:49.000Z | tests/test_nexus.py | ghuls/weblogo | 7eab5d1b8a8ec38786fa426af84bd77950835524 | [
"MIT"
] | 60 | 2015-07-21T22:55:52.000Z | 2022-03-24T21:20:00.000Z | tests/test_nexus.py | ghuls/weblogo | 7eab5d1b8a8ec38786fa426af84bd77950835524 | [
"MIT"
] | 40 | 2015-08-04T00:18:23.000Z | 2021-12-30T13:41:54.000Z | #!/usr/bin/env python
import unittest
from weblogo.seq_io._nexus import Nexus
from . import data_stream
class test_nexus(unittest.TestCase):
def test_create(self):
n = Nexus()
self.assertNotEqual(n, None)
def test_parse_f0(self):
f = data_stream("nexus/test_Nexus_input.nex")
... | 23.463768 | 62 | 0.536751 |
import unittest
from weblogo.seq_io._nexus import Nexus
from . import data_stream
class test_nexus(unittest.TestCase):
def test_create(self):
n = Nexus()
self.assertNotEqual(n, None)
def test_parse_f0(self):
f = data_stream("nexus/test_Nexus_input.nex")
n = Nexus(f)
... | true | true |
7907286715e94bb49b19784d5b7f49124bdf474c | 7,922 | py | Python | docs/conf.py | metaist/pageit | 11c2ade12d527c582585af482c285b9b38895861 | [
"MIT"
] | 1 | 2015-06-29T11:44:45.000Z | 2015-06-29T11:44:45.000Z | docs/conf.py | metaist/pageit | 11c2ade12d527c582585af482c285b9b38895861 | [
"MIT"
] | 1 | 2015-02-24T18:07:21.000Z | 2015-02-25T02:15:47.000Z | docs/conf.py | metaist/pageit | 11c2ade12d527c582585af482c285b9b38895861 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# coding: utf-8
# This file is execfile()d with the current directory set to its containing
# dir. Note that not all possible configuration values are present in this
# autogenerated file. All configuration values have a default; values that are
# commented out serve to show the default.
import sys
... | 32.072874 | 79 | 0.709038 |
import sys
import os
import sphinx_rtd_theme
sys.path.insert(0, os.path.abspath(os.path.join('..')))
import pageit
extensions = ['sphinx.ext.doctest', 'sphinx.ext.autodoc',
'sphinxcontrib.napoleon']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'... | true | true |
79072a399bbddc97922d302380458fcac9f3431b | 5,076 | py | Python | chart-generation/charts/vaccines.py | maldins46/CovidTracker | 6a50e780935de62e07c691fae2363c290aae5795 | [
"MIT"
] | null | null | null | chart-generation/charts/vaccines.py | maldins46/CovidTracker | 6a50e780935de62e07c691fae2363c290aae5795 | [
"MIT"
] | 13 | 2020-11-04T22:39:55.000Z | 2022-03-02T10:27:45.000Z | chart-generation/charts/vaccines.py | maldins46/CovidTracker | 6a50e780935de62e07c691fae2363c290aae5795 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Charts about the national vaccines data.
@author: riccardomaldini
"""
import matplotlib.pyplot as plt
import matplotlib.ticker as mtick
from data_extractors.vaccines_regions import benchmark_dict, marche_df
from data_extractors.vaccines_italy import italy_df
from data... | 38.165414 | 125 | 0.718676 |
import matplotlib.pyplot as plt
import matplotlib.ticker as mtick
from data_extractors.vaccines_regions import benchmark_dict, marche_df
from data_extractors.vaccines_italy import italy_df
from data_extractors.area_names import area_names_dict
from matplotlib.dates import MonthLocator
import utils
def adm_doses_it... | true | true |
79072ab4b8bdee5c0b7cdf45787af5e634de5c1e | 607 | py | Python | setup.py | Annabelle-Brown/q2-autopepsirf | 76fded20b4b7064885c2124e0e32895321b976c4 | [
"Apache-2.0"
] | null | null | null | setup.py | Annabelle-Brown/q2-autopepsirf | 76fded20b4b7064885c2124e0e32895321b976c4 | [
"Apache-2.0"
] | 4 | 2022-01-18T22:50:00.000Z | 2022-03-21T17:47:42.000Z | setup.py | Annabelle-Brown/q2-autopepsirf | 76fded20b4b7064885c2124e0e32895321b976c4 | [
"Apache-2.0"
] | 1 | 2021-11-18T22:38:31.000Z | 2021-11-18T22:38:31.000Z | #!/usr/bin/env python
from setuptools import setup, find_packages
import versioneer
setup(
name="q2-autopepsirf",
version=versioneer.get_version(),
cmdclass = versioneer.get_cmdclass(),
packages = find_packages(),
package_data={},
author="Annabelle Brown",
author_email="annabel... | 28.904762 | 80 | 0.672158 |
from setuptools import setup, find_packages
import versioneer
setup(
name="q2-autopepsirf",
version=versioneer.get_version(),
cmdclass = versioneer.get_cmdclass(),
packages = find_packages(),
package_data={},
author="Annabelle Brown",
author_email="annabelle811@live.com",
... | true | true |
79072afff678c079754fc12a9c38b39101e119b0 | 2,459 | py | Python | freesas/__init__.py | kif/freesas | d4e468726e1c2486814ff07871d49dfadf77e437 | [
"MIT"
] | 7 | 2015-06-30T13:13:43.000Z | 2021-12-22T07:13:02.000Z | freesas/__init__.py | kif/freesas | d4e468726e1c2486814ff07871d49dfadf77e437 | [
"MIT"
] | 47 | 2015-07-20T13:15:55.000Z | 2022-03-27T07:51:38.000Z | freesas/__init__.py | kif/freesas | d4e468726e1c2486814ff07871d49dfadf77e437 | [
"MIT"
] | 3 | 2015-04-30T07:41:49.000Z | 2021-08-19T00:20:23.000Z | # coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2015-2018 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to d... | 37.830769 | 79 | 0.697031 | true | true | |
79072b679ba04a231086536469f530efc9e5d1c6 | 7,817 | py | Python | sdk/finbourne_insights/models/audit_process.py | finbourne/finbourne-insights-sdk-python | 33ea49f0157def867405725013218d6f29cc2ee0 | [
"MIT"
] | null | null | null | sdk/finbourne_insights/models/audit_process.py | finbourne/finbourne-insights-sdk-python | 33ea49f0157def867405725013218d6f29cc2ee0 | [
"MIT"
] | null | null | null | sdk/finbourne_insights/models/audit_process.py | finbourne/finbourne-insights-sdk-python | 33ea49f0157def867405725013218d6f29cc2ee0 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
FINBOURNE Insights API
FINBOURNE Technology # noqa: E501
The version of the OpenAPI document: 0.0.238
Contact: info@finbourne.com
Generated by: https://openapi-generator.tech
"""
try:
from inspect import getfullargspec
except ImportError:
from inspect import getargs... | 29.277154 | 140 | 0.584751 |
try:
from inspect import getfullargspec
except ImportError:
from inspect import getargspec as getfullargspec
import pprint
import re
import six
from finbourne_insights.configuration import Configuration
class AuditProcess(object):
openapi_types = {
'name': 'str',
'run_id': 'str',
... | true | true |
79072c12edc6880eee5bb281b85b99ff6406f425 | 3,130 | py | Python | revolt/channel.py | XiehCanCode/revolt.py | 0b14143610f544d73ba9dde02adedafc51d76228 | [
"MIT"
] | null | null | null | revolt/channel.py | XiehCanCode/revolt.py | 0b14143610f544d73ba9dde02adedafc51d76228 | [
"MIT"
] | null | null | null | revolt/channel.py | XiehCanCode/revolt.py | 0b14143610f544d73ba9dde02adedafc51d76228 | [
"MIT"
] | null | null | null | from __future__ import annotations
from typing import TYPE_CHECKING, cast
from .enums import ChannelType
from .messageable import Messageable
if TYPE_CHECKING:
from .state import State
from .types import Channel as ChannelPayload
from .types import DMChannel as DMChannelPayload
from .types import Gro... | 33.655914 | 123 | 0.66869 | from __future__ import annotations
from typing import TYPE_CHECKING, cast
from .enums import ChannelType
from .messageable import Messageable
if TYPE_CHECKING:
from .state import State
from .types import Channel as ChannelPayload
from .types import DMChannel as DMChannelPayload
from .types import Gro... | true | true |
79072c9ca36518bd1ff26768bbdaf965cafced64 | 224 | py | Python | exercicios/Lista3/Q3.py | AlexandrePeBrito/CursoUdemyPython | 3de58cb30c9f333b32078309847179ff3f9d7e22 | [
"MIT"
] | null | null | null | exercicios/Lista3/Q3.py | AlexandrePeBrito/CursoUdemyPython | 3de58cb30c9f333b32078309847179ff3f9d7e22 | [
"MIT"
] | null | null | null | exercicios/Lista3/Q3.py | AlexandrePeBrito/CursoUdemyPython | 3de58cb30c9f333b32078309847179ff3f9d7e22 | [
"MIT"
] | null | null | null | #Faça um algoritmo utilizando o comando while que mostra uma
#contagem regressiva na tela, iniciando em 10 e terminando
#em O. Mostrar uma mensagem “FIM!" após a contagem.
i=11
while(i!=0):
i-=1
print(i)
print("FIM") | 28 | 60 | 0.71875 |
i=11
while(i!=0):
i-=1
print(i)
print("FIM") | true | true |
79072ccd68791b7d45ddef5230c0f168cbea543a | 38,620 | py | Python | official/vision/beta/modeling/layers/detection_generator.py | SuwoongHeo/models | fc2d4b695d931f79e63d8069b6a04b2877a6553f | [
"Apache-2.0"
] | 2 | 2021-11-03T05:14:54.000Z | 2021-11-09T11:56:14.000Z | official/vision/beta/modeling/layers/detection_generator.py | GangababuGB/models | 10ef6bbe39bb5ac3d0e2755dc60b6843d39d395c | [
"Apache-2.0"
] | null | null | null | official/vision/beta/modeling/layers/detection_generator.py | GangababuGB/models | 10ef6bbe39bb5ac3d0e2755dc60b6843d39d395c | [
"Apache-2.0"
] | 1 | 2021-10-03T08:34:26.000Z | 2021-10-03T08:34:26.000Z | # Copyright 2021 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
#
# Unless required by applica... | 45.275498 | 85 | 0.674029 |
import contextlib
from typing import List, Optional, Mapping
import tensorflow as tf
from official.vision.beta.ops import box_ops
from official.vision.beta.ops import nms
from official.vision.beta.ops import preprocess_ops
def _generate_detections_v1(boxes: tf.Tensor,
score... | true | true |
79072d0993a2a9e2468a7e746218cce0e5832973 | 3,334 | py | Python | examples/django-test-app/project/settings.py | zmiklank/s2i-python-container | efa47c5af11a98df18ce7c905332149770f938c3 | [
"Apache-2.0"
] | null | null | null | examples/django-test-app/project/settings.py | zmiklank/s2i-python-container | efa47c5af11a98df18ce7c905332149770f938c3 | [
"Apache-2.0"
] | null | null | null | examples/django-test-app/project/settings.py | zmiklank/s2i-python-container | efa47c5af11a98df18ce7c905332149770f938c3 | [
"Apache-2.0"
] | null | null | null | """
Django settings for project project.
Generated by 'django-admin startproject' using Django 1.8.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
import djang... | 28.016807 | 74 | 0.695861 |
import django
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'y*b^6p#z&cm2)8rzgbp2i4k*+rg2h%60l*bmf6hg&ro!z0-ael'
DEBUG = True
# SECURITY WARNING: do not use '*' on production or use some HTTP(S) proxy
ALLOWED_HOSTS = ['*']
# Application definition
INSTALLED... | true | true |
79072d403b5317b350eabb968cb7bc42d90b1b98 | 3,419 | py | Python | Sketches/RJL/bittorrent/BitTorrent/BitTorrent/BeautifulSupe.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 12 | 2015-10-20T10:22:01.000Z | 2021-07-19T10:09:44.000Z | Sketches/RJL/bittorrent/BitTorrent/BitTorrent/BeautifulSupe.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 17 | 2015-01-05T21:06:22.000Z | 2015-12-07T20:45:44.000Z | Sketches/RJL/bittorrent/BitTorrent/BitTorrent/BeautifulSupe.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 7 | 2015-07-28T09:17:17.000Z | 2021-11-07T02:29:41.000Z | # A very very minimal BeautifulSoup immitation.
#
# BS uses SGMLlib to parse, which converts everything to lower case.
# This uses real xml parsing to mimic the parts of BS we use.
import xml.dom.minidom
def _getText(node):
nodelist = node.childNodes
rc = []
for node in nodelist:
if node.nodeType ... | 25.706767 | 85 | 0.497221 |
import xml.dom.minidom
def _getText(node):
nodelist = node.childNodes
rc = []
for node in nodelist:
if node.nodeType == node.TEXT_NODE:
rc.append(str(node.data))
return rc
def _getNodesAsTags(root):
nodelist = root.childNodes
tags = []
for node in nodelist:
... | true | true |
79072d68a7e2cd63b1a041a77c3242738c18fde5 | 2,641 | py | Python | code/doiainn/doiainn/settings.py | bbenko/doiainn | feba5f963ee8018b9cf79b42f97a7f31af2e5583 | [
"MIT"
] | null | null | null | code/doiainn/doiainn/settings.py | bbenko/doiainn | feba5f963ee8018b9cf79b42f97a7f31af2e5583 | [
"MIT"
] | null | null | null | code/doiainn/doiainn/settings.py | bbenko/doiainn | feba5f963ee8018b9cf79b42f97a7f31af2e5583 | [
"MIT"
] | null | null | null | """
Django settings for doiainn project.
Generated by 'django-admin startproject' using Django 1.8.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build path... | 25.640777 | 71 | 0.702385 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'fbrywz7o3a1=vf-+4luwn5h)!kt-xzghqtm#^3(epwcwcp^jws'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
79072e5fc4433edc8f0a0a35a9c43e91bb6b764d | 7,248 | py | Python | macro_lib/growth/solow.py | zhaoy17/Macro_lib | 44c1fd16ae139bbfe6616d1bdca55420fd1695f7 | [
"Apache-2.0"
] | 2 | 2020-03-24T07:02:20.000Z | 2020-03-24T07:02:27.000Z | macro_lib/growth/solow.py | zhaoy17/Macro_lib | 44c1fd16ae139bbfe6616d1bdca55420fd1695f7 | [
"Apache-2.0"
] | null | null | null | macro_lib/growth/solow.py | zhaoy17/Macro_lib | 44c1fd16ae139bbfe6616d1bdca55420fd1695f7 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import pandas as pd
import matlibplot.pyplot as plt
'''
Simulating Solow-Swan model, which attempts to model the long-run economic growth
by looking at capital accumulation (K), population growth (L) and technological
progress, which results in increase in productivity. It models the total product... | 30.453782 | 111 | 0.560706 | import numpy as np
import pandas as pd
import matlibplot.pyplot as plt
class solow:
def __init__(self, A=2.87, k0=3.5, delta = 0.08, s = 0.1, n = 0.015, alpha = 0.36, t0 = 1956, tmax = 2060):
self._A = A
self._k0 = k0
self._k = k0
self._delta = delta
self._s = s
sel... | true | true |
79072ecbaf7146f0b35ba3fb0dc12f5ddb30f1d3 | 506 | py | Python | nexus/bot/handlers/__init__.py | RobbiNespu/hyperboria | 7db858386f1a20e8d49bc16f53bfd7f1e4d03f7e | [
"Unlicense"
] | 54 | 2021-01-07T03:02:36.000Z | 2022-03-28T17:19:29.000Z | nexus/bot/handlers/__init__.py | the-superpirate/hyperboria | 74776166158d07b199677f9738862e5f1fa54367 | [
"Unlicense"
] | 10 | 2021-01-08T17:38:59.000Z | 2022-02-28T14:34:45.000Z | nexus/bot/handlers/__init__.py | the-superpirate/hyperboria | 74776166158d07b199677f9738862e5f1fa54367 | [
"Unlicense"
] | 16 | 2020-12-28T18:31:44.000Z | 2022-02-22T15:00:53.000Z | from . import (
admin,
ban,
close,
contact,
copyright,
donate,
download,
emoji,
help,
legacy,
noop,
roll,
search,
settings,
shortlink,
start,
stop,
submit,
top_missed,
view,
vote,
)
__all__ = ['admin', 'ban', 'contact', 'copyright', 'c... | 18.071429 | 98 | 0.51581 | from . import (
admin,
ban,
close,
contact,
copyright,
donate,
download,
emoji,
help,
legacy,
noop,
roll,
search,
settings,
shortlink,
start,
stop,
submit,
top_missed,
view,
vote,
)
__all__ = ['admin', 'ban', 'contact', 'copyright', 'c... | true | true |
79072f542ccf13bca8fa1c484ef91e52bfb5242f | 5,959 | py | Python | malss/app/learning_curve.py | canard0328/malss | 976ebdb6e4bee52a0dbb65e0ddeed767cfe39591 | [
"MIT"
] | 37 | 2015-02-22T20:12:20.000Z | 2021-02-05T11:12:28.000Z | malss/app/learning_curve.py | canard0328/malss | 976ebdb6e4bee52a0dbb65e0ddeed767cfe39591 | [
"MIT"
] | 8 | 2015-01-07T14:53:41.000Z | 2018-02-11T08:00:19.000Z | malss/app/learning_curve.py | canard0328/malss | 976ebdb6e4bee52a0dbb65e0ddeed767cfe39591 | [
"MIT"
] | 7 | 2015-01-08T14:53:26.000Z | 2020-07-26T13:03:10.000Z | # coding: utf-8
import os
import numpy as np
import copy
from PyQt5.QtWidgets import (QPushButton, QScrollArea)
from PyQt5.QtCore import QThread, pyqtSignal
from multiprocessing import Process, Manager
from ..malss import MALSS
from .waiting_animation import WaitingAnimation
from .rfpimp import oob_importanc... | 34.847953 | 107 | 0.5756 |
import os
import numpy as np
import copy
from PyQt5.QtWidgets import (QPushButton, QScrollArea)
from PyQt5.QtCore import QThread, pyqtSignal
from multiprocessing import Process, Manager
from ..malss import MALSS
from .waiting_animation import WaitingAnimation
from .rfpimp import oob_importances
from .learni... | true | true |
79072fc503eadda6e5ae8defe25b3a7ba294b2e8 | 455 | py | Python | setup_python_package/queries/get_package_author_name.py | LucaCappelletti94/setup_python_package | 61b5f3cff1ed3181f932293c63c4fcb71cbe0062 | [
"MIT"
] | 5 | 2019-09-17T14:46:35.000Z | 2020-06-06T08:17:02.000Z | setup_python_package/queries/get_package_author_name.py | LucaCappelletti94/setup_python_package | 61b5f3cff1ed3181f932293c63c4fcb71cbe0062 | [
"MIT"
] | 2 | 2020-12-18T01:47:55.000Z | 2020-12-25T10:08:30.000Z | setup_python_package/queries/get_package_author_name.py | LucaCappelletti94/setup_python_package | 61b5f3cff1ed3181f932293c63c4fcb71cbe0062 | [
"MIT"
] | null | null | null | from userinput import userinput
from ..utils import load_repository_author_name
def get_package_author_name() -> str:
"""Return the package author name to be used."""
return userinput(
name="python_package_author_name",
label="Enter the python package author name to use.",
default=load... | 26.764706 | 61 | 0.648352 | from userinput import userinput
from ..utils import load_repository_author_name
def get_package_author_name() -> str:
return userinput(
name="python_package_author_name",
label="Enter the python package author name to use.",
default=load_repository_author_name(),
validator="non_emp... | true | true |
79073053df7e3eef7c63daa9c208a2a275f12015 | 14,067 | py | Python | Lib/site-packages/PyQt5/examples/opengl/grabber.py | dipivan/my-first-blog | 07c2b7ba631c747ac85bbd32fcedb9305474b7b8 | [
"bzip2-1.0.6"
] | 2 | 2020-11-09T23:56:54.000Z | 2021-07-29T23:15:59.000Z | PyQt5_gpl-5.8/examples/opengl/grabber.py | ArjandeV/iracing-overlay | 6286348d78f1538f64928ec867cafc65124eea3d | [
"MIT"
] | null | null | null | PyQt5_gpl-5.8/examples/opengl/grabber.py | ArjandeV/iracing-overlay | 6286348d78f1538f64928ec867cafc65124eea3d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2015 Riverbank Computing Limited.
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
##
## This file is part of the examples of PyQt.
##
## $QT_BEGIN_LICENS... | 35.522727 | 145 | 0.603967 |
if i == 0:
sign = +1.0
else:
sign = -1.0
self.gl.glNormal3d(0.0, 0.0, sign)
self.gl.glBegin(self.gl.GL_QUAD_STRIP)
for j in range(toothCount+1):
angle = 2.0 * math.pi * j / toothCount
self.gl.... | true | true |
7907335812e378d83c592760a69e195c81a6ff01 | 868 | py | Python | components/fighter.py | StormCloud71/tdl-roguelike-tute | d43765b0cff5123b72d4d9aaa87ee174c3562162 | [
"CNRI-Python"
] | null | null | null | components/fighter.py | StormCloud71/tdl-roguelike-tute | d43765b0cff5123b72d4d9aaa87ee174c3562162 | [
"CNRI-Python"
] | null | null | null | components/fighter.py | StormCloud71/tdl-roguelike-tute | d43765b0cff5123b72d4d9aaa87ee174c3562162 | [
"CNRI-Python"
] | null | null | null | class Fighter:
def __init__(self, hp, defense, power):
self.max_hp = hp
self.hp = hp
self.defense = defense
self.power = power
def take_damage(self, amount):
results=[]
self.hp -= amount
if self.hp<0:
results.append({'dead':self.owner})
... | 33.384615 | 84 | 0.56106 | class Fighter:
def __init__(self, hp, defense, power):
self.max_hp = hp
self.hp = hp
self.defense = defense
self.power = power
def take_damage(self, amount):
results=[]
self.hp -= amount
if self.hp<0:
results.append({'dead':self.owner})
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.