hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7193f6e01897e3e8a2c39a33cc6cfcfad2301fb | 63,187 | py | Python | tests/test_h3.py | SouvikGhosh05/aioquic | da566b8ee616b9c83d51f0f5ad0521393119f40f | [
"BSD-3-Clause"
] | null | null | null | tests/test_h3.py | SouvikGhosh05/aioquic | da566b8ee616b9c83d51f0f5ad0521393119f40f | [
"BSD-3-Clause"
] | null | null | null | tests/test_h3.py | SouvikGhosh05/aioquic | da566b8ee616b9c83d51f0f5ad0521393119f40f | [
"BSD-3-Clause"
] | null | null | null | import binascii
import contextlib
import copy
from unittest import TestCase
from aioquic.buffer import Buffer, encode_uint_var
from aioquic.h3.connection import (
H3_ALPN,
ErrorCode,
FrameType,
FrameUnexpected,
H3Connection,
MessageError,
Setting,
SettingsError,
StreamType,
enco... | 34.699066 | 90 | 0.500593 | import binascii
import contextlib
import copy
from unittest import TestCase
from aioquic.buffer import Buffer, encode_uint_var
from aioquic.h3.connection import (
H3_ALPN,
ErrorCode,
FrameType,
FrameUnexpected,
H3Connection,
MessageError,
Setting,
SettingsError,
StreamType,
enco... | true | true |
f7193fce1fa7b0ba46bf2b1d2e9a114b6453e540 | 2,901 | py | Python | scripts/md_to_html.py | fossabot/granite | 7eab82126d0cddb4fdad0c3ba2c6f431eea19cfb | [
"MIT"
] | null | null | null | scripts/md_to_html.py | fossabot/granite | 7eab82126d0cddb4fdad0c3ba2c6f431eea19cfb | [
"MIT"
] | 3 | 2021-02-06T17:29:31.000Z | 2021-05-27T20:48:58.000Z | scripts/md_to_html.py | fossabot/granite | 7eab82126d0cddb4fdad0c3ba2c6f431eea19cfb | [
"MIT"
] | 2 | 2021-02-02T23:07:50.000Z | 2021-03-27T22:06:27.000Z | #! /usr/bin/env python3
# Script from https://gist.github.com/jiffyclub/5015986
# This script turns Markdown into HTML using the Python markdown library and wraps the result in a
# complete HTML document with default Bootstrap styling so that it's immediately printable.
# Requires the python libraries jinja2, markdo... | 29.30303 | 120 | 0.612203 |
# Requires the python libraries jinja2, markdown, and mdx_smartypants.
import argparse
import sys
import jinja2
import markdown
# To install dependencies in a virtualenv:
# $ py -3 -3 venv .venv
# $ .venv/Scripts/activate
# $ pip install jinja2
# $ pip install markdown
#
# To install dependencies... | true | true |
f7193fdcc986cc8bca9f6efe5170d075ac0c3ace | 7,030 | py | Python | dm_control/rl/specs_test.py | 1nadequacy/dm_control | a55474768cf0a6d570fe4a376802630027ad5f01 | [
"Apache-2.0"
] | null | null | null | dm_control/rl/specs_test.py | 1nadequacy/dm_control | a55474768cf0a6d570fe4a376802630027ad5f01 | [
"Apache-2.0"
] | null | null | null | dm_control/rl/specs_test.py | 1nadequacy/dm_control | a55474768cf0a6d570fe4a376802630027ad5f01 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The dm_control Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 34.975124 | 80 | 0.683642 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl.testing import absltest
from dm_control.rl import specs as array_spec
import numpy as np
import six
class ArraySpecTest(absltest.TestCase):
def testShapeTypeError(self):
with... | true | true |
f7193fe758b15f3c5dd4561b3624e25cf35dca18 | 4,536 | py | Python | Model_test.py | JoeTao-097/Multi-REZ-Evalution-for-Breast-Ultrasound-Images | 344d64ad2fe9d790c49e8005b3abee219d362278 | [
"Apache-2.0"
] | null | null | null | Model_test.py | JoeTao-097/Multi-REZ-Evalution-for-Breast-Ultrasound-Images | 344d64ad2fe9d790c49e8005b3abee219d362278 | [
"Apache-2.0"
] | null | null | null | Model_test.py | JoeTao-097/Multi-REZ-Evalution-for-Breast-Ultrasound-Images | 344d64ad2fe9d790c49e8005b3abee219d362278 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Aug 2 17:32:52 2021
@author: jiangyt
"""
from Tools import *
from tensorflow import keras
from tensorflow.keras.layers import Dense, Activation, Flatten, Dropout, Input, BatchNormalization
from tensorflow.keras.layers import Conv2D, MaxPooling2D, add, AveragePooli... | 47.747368 | 123 | 0.646825 |
from Tools import *
from tensorflow import keras
from tensorflow.keras.layers import Dense, Activation, Flatten, Dropout, Input, BatchNormalization
from tensorflow.keras.layers import Conv2D, MaxPooling2D, add, AveragePooling2D, ZeroPadding2D, GlobalAveragePooling2D
from tensorflow.keras.models import Model, Seq... | true | true |
f7194033eec50c8f02954cf2105d80b049769652 | 9,394 | py | Python | prepare_data.py | Euro2xx/gansformer | 83403cdb49e049e3b4d9f3472577f2ee73f7ba64 | [
"MIT"
] | 1,172 | 2021-03-02T02:00:44.000Z | 2022-03-31T02:46:45.000Z | prepare_data.py | Euro2xx/gansformer | 83403cdb49e049e3b4d9f3472577f2ee73f7ba64 | [
"MIT"
] | 37 | 2021-03-03T14:11:11.000Z | 2022-03-12T15:40:15.000Z | prepare_data.py | Euro2xx/gansformer | 83403cdb49e049e3b4d9f3472577f2ee73f7ba64 | [
"MIT"
] | 138 | 2021-03-02T06:37:10.000Z | 2022-03-30T14:59:09.000Z | # import warnings filter
from warnings import simplefilter
# ignore all future warnings
simplefilter(action = "ignore", category = FutureWarning)
import os
import sys
import tqdm
import time
import json
import glob
import gdown
import urllib
import zipfile
import hashlib
import argparse
import numpy as np
from traini... | 43.091743 | 200 | 0.597828 |
from warnings import simplefilter
simplefilter(action = "ignore", category = FutureWarning)
import os
import sys
import tqdm
import time
import json
import glob
import gdown
import urllib
import zipfile
import hashlib
import argparse
import numpy as np
from training import misc
from dnnlib import EasyDict
import d... | true | true |
f71940e708f2c32d5f339366201b373baa9e265f | 5,092 | py | Python | venv/Lib/site-packages/pandas/tests/series/indexing/test_get.py | arnoyu-hub/COMP0016miemie | 59af664dcf190eab4f93cefb8471908717415fea | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pandas/tests/series/indexing/test_get.py | arnoyu-hub/COMP0016miemie | 59af664dcf190eab4f93cefb8471908717415fea | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pandas/tests/series/indexing/test_get.py | arnoyu-hub/COMP0016miemie | 59af664dcf190eab4f93cefb8471908717415fea | [
"MIT"
] | null | null | null | import numpy as np
import pytest
import pandas as pd
from pandas import Series
import pandas._testing as tm
def test_get():
# GH 6383
s = Series(
np.array(
[
43,
48,
60,
48,
50,
... | 23.683721 | 88 | 0.434014 | import numpy as np
import pytest
import pandas as pd
from pandas import Series
import pandas._testing as tm
def test_get():
s = Series(
np.array(
[
43,
48,
60,
48,
50,
51,
... | true | true |
f71940f58176a96989ec11a785988a65b24d32a1 | 1,157 | py | Python | venv/Scripts/get_first_company.py | ZUSM0/zynoPYsis | 0cbe84d60a9611eac4daed82176477939bf79183 | [
"MIT"
] | null | null | null | venv/Scripts/get_first_company.py | ZUSM0/zynoPYsis | 0cbe84d60a9611eac4daed82176477939bf79183 | [
"MIT"
] | null | null | null | venv/Scripts/get_first_company.py | ZUSM0/zynoPYsis | 0cbe84d60a9611eac4daed82176477939bf79183 | [
"MIT"
] | null | null | null | #!c:\users\user\pycharmprojects\sinopse de filmes\venv\scripts\python.exe
# -*- coding: utf-8 -*-
"""
get_first_company.py
Usage: get_first_company "company name"
Search for the given name and print the best matching result.
"""
import sys
# Import the IMDbPY package.
try:
import imdb
except ImportError:
pr... | 21.425926 | 79 | 0.684529 |
import sys
try:
import imdb
except ImportError:
print('You need to install the IMDbPY package!')
sys.exit(1)
if len(sys.argv) != 2:
print('Only one argument is required:')
print(' %s "company name"' % sys.argv[0])
sys.exit(2)
name = sys.argv[1]
i = imdb.IMDb()
try:
results =... | true | true |
f7194132aff142671554e00669a4cc1f9a014680 | 5,299 | py | Python | MathExample.py | AdityaSavara/CiteSoft_Py | f3a68666966565d4eb130e457cb11d285b56b4c5 | [
"BSD-3-Clause"
] | null | null | null | MathExample.py | AdityaSavara/CiteSoft_Py | f3a68666966565d4eb130e457cb11d285b56b4c5 | [
"BSD-3-Clause"
] | null | null | null | MathExample.py | AdityaSavara/CiteSoft_Py | f3a68666966565d4eb130e457cb11d285b56b4c5 | [
"BSD-3-Clause"
] | null | null | null | import sys
import math
try:
import CiteSoft
except:
import os #The below lines are to allow CiteSoftLocal to be called regardless of user's working directory.
lenOfFileName = len(os.path.basename(__file__)) #This is the name of **this** file.
absPathWithoutFileName = os.path.abspath(__file__)[0:-1*lenOf... | 58.230769 | 449 | 0.780336 | import sys
import math
try:
import CiteSoft
except:
import os
lenOfFileName = len(os.path.basename(__file__)) #This is the name of **this** file.
absPathWithoutFileName = os.path.abspath(__file__)[0:-1*lenOfFileName]
sys.path.append(absPathWithoutFileName)
import CiteSoftLocal as CiteSoft
#Her... | true | true |
f719414c0fab3fa82e996e4adda1253ef5777ac1 | 141 | py | Python | performance_test/torch_deploy/__init__.py | Lionelsy/SQL-Injection-Detection-via-Deep-Learning | 5f1958822af98a99172df524eef6e921e6fa6724 | [
"MIT"
] | 1 | 2022-01-18T17:08:52.000Z | 2022-01-18T17:08:52.000Z | performance_test/torch_deploy/__init__.py | Lionelsy/SQL-Injection-Detection-via-Deep-Learning | 5f1958822af98a99172df524eef6e921e6fa6724 | [
"MIT"
] | null | null | null | performance_test/torch_deploy/__init__.py | Lionelsy/SQL-Injection-Detection-via-Deep-Learning | 5f1958822af98a99172df524eef6e921e6fa6724 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @Time : 2020/12/14
# @Author : Shuyu ZHANG
# @FileName: __init__.py
# @Software: PyCharm
# @Description: Here
| 17.625 | 24 | 0.609929 | true | true | |
f71941bb492d02c50d6770e3abc0974c97079478 | 1,354 | py | Python | rclpy/services/minimal_client/setup.py | flynneva/examples | 16bffa238dfa3ff305f14b1ec75ed41dce634ffb | [
"Apache-2.0"
] | null | null | null | rclpy/services/minimal_client/setup.py | flynneva/examples | 16bffa238dfa3ff305f14b1ec75ed41dce634ffb | [
"Apache-2.0"
] | null | null | null | rclpy/services/minimal_client/setup.py | flynneva/examples | 16bffa238dfa3ff305f14b1ec75ed41dce634ffb | [
"Apache-2.0"
] | null | null | null | from setuptools import setup
package_name = 'examples_rclpy_minimal_client'
setup(
name=package_name,
version='0.9.1',
packages=[package_name],
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + package_name, ['package.xml'... | 33.85 | 95 | 0.661004 | from setuptools import setup
package_name = 'examples_rclpy_minimal_client'
setup(
name=package_name,
version='0.9.1',
packages=[package_name],
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + package_name, ['package.xml'... | true | true |
f71942098bb86e0175943366277c2cc371a401db | 1,735 | py | Python | api/migrations/0001_initial.py | psingla1210/django-rest-api | db9fa70e3eeb747399b275e79688dfa4974a00ee | [
"MIT"
] | null | null | null | api/migrations/0001_initial.py | psingla1210/django-rest-api | db9fa70e3eeb747399b275e79688dfa4974a00ee | [
"MIT"
] | 4 | 2021-03-19T11:31:00.000Z | 2022-02-10T14:07:26.000Z | api/migrations/0001_initial.py | psingla1210/django-rest-api | db9fa70e3eeb747399b275e79688dfa4974a00ee | [
"MIT"
] | null | null | null | # Generated by Django 2.2 on 2020-06-21 14:10
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='TwistedUser',
... | 51.029412 | 266 | 0.641499 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='TwistedUser',
fields=[
('id', models.Au... | true | true |
f71942734c2781f9110c7944a358f060b7b5ed9c | 1,138 | py | Python | frappe/utils/connections.py | erpnext-tm/frappe | 7b470f28e1cf00b0659c01e06a2d0a4693b28d98 | [
"MIT"
] | null | null | null | frappe/utils/connections.py | erpnext-tm/frappe | 7b470f28e1cf00b0659c01e06a2d0a4693b28d98 | [
"MIT"
] | null | null | null | frappe/utils/connections.py | erpnext-tm/frappe | 7b470f28e1cf00b0659c01e06a2d0a4693b28d98 | [
"MIT"
] | null | null | null | import socket
from six.moves.urllib.parse import urlparse
from frappe import get_conf
REDIS_KEYS = ("redis_cache", "redis_queue", "redis_socketio")
def is_open(ip, port, timeout=10):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(timeout)
try:
s.connect((ip, int(port)))
s.shutdown(socket... | 24.212766 | 72 | 0.746924 | import socket
from six.moves.urllib.parse import urlparse
from frappe import get_conf
REDIS_KEYS = ("redis_cache", "redis_queue", "redis_socketio")
def is_open(ip, port, timeout=10):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(timeout)
try:
s.connect((ip, int(port)))
s.shutdown(socket... | true | true |
f71943a375acd8972ca01d50dd31b6166bd90ebe | 606 | py | Python | demo.py | peter-jim/offchain-algorithm | c148fd1e3dffca9a42a4206c516533aae51d1ae1 | [
"Apache-2.0"
] | null | null | null | demo.py | peter-jim/offchain-algorithm | c148fd1e3dffca9a42a4206c516533aae51d1ae1 | [
"Apache-2.0"
] | null | null | null | demo.py | peter-jim/offchain-algorithm | c148fd1e3dffca9a42a4206c516533aae51d1ae1 | [
"Apache-2.0"
] | 1 | 2021-04-17T06:34:32.000Z | 2021-04-17T06:34:32.000Z | import requests
def demo():
'''
非小号API获取信息
:return btc,eth,eos ... pirce
'''
print("start")
#接口教程链接 https://github.com/xiaohao2019/API-docs/blob/master/PublicApi_CN.md
url = "https://fxhapi.feixiaohao.com/public/v1/ticker/"
#传入参数 start=[integer](指定结果集的开始排名) limit=[integer](指定结果集的最大... | 23.307692 | 79 | 0.580858 | import requests
def demo():
print("start")
url = "https://fxhapi.feixiaohao.com/public/v1/ticker/"
start = "start=" + str(0)+"&"
limit = "limit=" + str(10)
print(url+"?"+start+limit)
try:
response = requests.get(url=url+"?"+start+limit)
for item in response.json():
... | true | true |
f7194440cda8d5fbed1979d6f1691cf0e20dcc13 | 1,544 | py | Python | benchmark/Python/Savina/PingPong.py | Feliix42/lingua-franca | af312ca8d37d9246dcb1d77fdc254a0dbd61b2bc | [
"BSD-2-Clause"
] | 1 | 2020-11-13T02:05:57.000Z | 2020-11-13T02:05:57.000Z | benchmark/Python/Savina/PingPong.py | Feliix42/lingua-franca | af312ca8d37d9246dcb1d77fdc254a0dbd61b2bc | [
"BSD-2-Clause"
] | null | null | null | benchmark/Python/Savina/PingPong.py | Feliix42/lingua-franca | af312ca8d37d9246dcb1d77fdc254a0dbd61b2bc | [
"BSD-2-Clause"
] | 1 | 2020-10-20T12:30:38.000Z | 2020-10-20T12:30:38.000Z | from LinguaFrancaBase.constants import * #Useful constants
from LinguaFrancaBase.functions import * #Useful helper functions
from LinguaFrancaBase.classes import * #Useful classes
import sys
import copy
sys.setrecursionlimit(100000)
EXPECTED = 10000
class _Ping:
count = 1000000
pingsLeft = count
def __ini... | 29.132075 | 127 | 0.668394 | from LinguaFrancaBase.constants import *
from LinguaFrancaBase.functions import *
from LinguaFrancaBase.classes import *
import sys
import copy
sys.setrecursionlimit(100000)
EXPECTED = 10000
class _Ping:
count = 1000000
pingsLeft = count
def __init__(self, **kwargs):
self.__dict__.update(kwargs... | true | true |
f719453dae93648775b69c46831ebbe5c6081c50 | 3,822 | py | Python | pygasus/storage/sql/query_builder.py | talismud/pygasus | fb01c8bd51003b5a008b572182a96bad86ef769f | [
"BSD-3-Clause"
] | 2 | 2021-11-18T09:35:10.000Z | 2021-11-18T14:46:32.000Z | pygasus/storage/sql/query_builder.py | talismud/pygasus | fb01c8bd51003b5a008b572182a96bad86ef769f | [
"BSD-3-Clause"
] | null | null | null | pygasus/storage/sql/query_builder.py | talismud/pygasus | fb01c8bd51003b5a008b572182a96bad86ef769f | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2021, LE GOFF Vincent
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the... | 39.8125 | 79 | 0.68786 |
from pygasus.storage.query_builder import AbstractQueryBuilder
class SQLQueryBuilder(AbstractQueryBuilder):
def _get_table(self, field):
model = field.__model__
model_name = getattr(
model.__config__, "model_name", model.__name__.lower()
)
... | true | true |
f719456656da103360e5cac1aae1790b2a55d482 | 20,904 | py | Python | octavia/amphorae/drivers/haproxy/rest_api_driver.py | acdc-cloud/openstack-octavia | f68460ddd31f9b09d59fff876f103324078473a6 | [
"Apache-2.0"
] | null | null | null | octavia/amphorae/drivers/haproxy/rest_api_driver.py | acdc-cloud/openstack-octavia | f68460ddd31f9b09d59fff876f103324078473a6 | [
"Apache-2.0"
] | null | null | null | octavia/amphorae/drivers/haproxy/rest_api_driver.py | acdc-cloud/openstack-octavia | f68460ddd31f9b09d59fff876f103324078473a6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2015 Rackspace
#
# 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
#
# Un... | 41.975904 | 79 | 0.591179 |
import functools
import hashlib
import time
import warnings
from oslo_log import log as logging
import requests
import simplejson
import six
from stevedore import driver as stevedore_driver
from octavia.amphorae.driver_exceptions import exceptions as driver_except
from octavia.amphorae.drivers import dr... | true | true |
f71945ac8b27591fea8b5cba11d2e49aa0f11109 | 8,813 | py | Python | __init__.py | mastnym/cbpi-SimpleCascadeHysteresis | 06e0a5d46868aaf7fef304eaed3308dc9b5ed269 | [
"MIT"
] | null | null | null | __init__.py | mastnym/cbpi-SimpleCascadeHysteresis | 06e0a5d46868aaf7fef304eaed3308dc9b5ed269 | [
"MIT"
] | null | null | null | __init__.py | mastnym/cbpi-SimpleCascadeHysteresis | 06e0a5d46868aaf7fef304eaed3308dc9b5ed269 | [
"MIT"
] | null | null | null | import time
from modules import cbpi
from modules.core.controller import KettleController
from modules.core.props import Property
@cbpi.controller
class SimpleCascadeHysteresis(KettleController):
"""
This hysteresis controls MashTun temp. It creates hysteresis on HLT temp not allowing it to reach
much hig... | 44.510101 | 214 | 0.641439 | import time
from modules import cbpi
from modules.core.controller import KettleController
from modules.core.props import Property
@cbpi.controller
class SimpleCascadeHysteresis(KettleController):
pos_off_desc = "Positive value indicating possibility to go above target temp with actor still switched on. If target ... | true | true |
f719467cb68b35eb1744903f1645e3dc36285aae | 182 | py | Python | Others/joi/joi2021yo1b/a/main.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 2 | 2020-06-12T09:54:23.000Z | 2021-05-04T01:34:07.000Z | Others/joi/joi2021yo1b/a/main.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 961 | 2020-06-23T07:26:22.000Z | 2022-03-31T21:34:52.000Z | Others/joi/joi2021yo1b/a/main.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
def main():
a, b, c = map(int, input().split())
if a <= c < b:
print(1)
else:
print(0)
if __name__ == "__main__":
main()
| 12.133333 | 39 | 0.434066 |
def main():
a, b, c = map(int, input().split())
if a <= c < b:
print(1)
else:
print(0)
if __name__ == "__main__":
main()
| true | true |
f719472b0ea2f7adf53faaf80d9dfeb1915076da | 286 | py | Python | awswrangler/__metadata__.py | Thiago-Dantas/aws-data-wrangler | b13fcd8d169feb3219b4b4fff025dc6089cfe03b | [
"Apache-2.0"
] | 1 | 2021-04-27T12:56:28.000Z | 2021-04-27T12:56:28.000Z | awswrangler/__metadata__.py | Thiago-Dantas/aws-data-wrangler | b13fcd8d169feb3219b4b4fff025dc6089cfe03b | [
"Apache-2.0"
] | 63 | 2021-05-31T08:35:17.000Z | 2022-03-28T08:12:04.000Z | awswrangler/__metadata__.py | kukushking/aws-data-wrangler | c91188472f96b222c943b35b3b082c0ba5e54745 | [
"Apache-2.0"
] | null | null | null | """Metadata Module.
Source repository: https://github.com/awslabs/aws-data-wrangler
Documentation: https://aws-data-wrangler.readthedocs.io/
"""
__title__: str = "awswrangler"
__description__: str = "Pandas on AWS."
__version__: str = "2.8.0"
__license__: str = "Apache License 2.0"
| 23.833333 | 63 | 0.734266 |
__title__: str = "awswrangler"
__description__: str = "Pandas on AWS."
__version__: str = "2.8.0"
__license__: str = "Apache License 2.0"
| true | true |
f71949204a3a8f20fdd5c84ef0a61e2047469716 | 7,418 | py | Python | 4course/theory_of_pl/course/test.py | soul-catcher/sibsutis | 5d7d88ffabbe445052927eb6c6097697df672997 | [
"WTFPL"
] | 10 | 2021-08-28T08:44:57.000Z | 2022-03-06T16:29:51.000Z | 4course/theory_of_pl/course/test.py | soul-catcher/sibsutis | 5d7d88ffabbe445052927eb6c6097697df672997 | [
"WTFPL"
] | null | null | null | 4course/theory_of_pl/course/test.py | soul-catcher/sibsutis | 5d7d88ffabbe445052927eb6c6097697df672997 | [
"WTFPL"
] | 6 | 2021-09-06T07:26:18.000Z | 2021-12-16T16:11:10.000Z | import unittest
import utils
from grammar import Grammar
class SplitByCommasTest(unittest.TestCase):
def test_simple(self):
self.assertEqual(['A', 'B', 'C'], utils.split_by('A, B, C', ','))
def test_without_space(self):
self.assertEqual(['A', 'B', 'C'], utils.split_by('A,B,C', ','))
def... | 30.780083 | 88 | 0.383392 | import unittest
import utils
from grammar import Grammar
class SplitByCommasTest(unittest.TestCase):
def test_simple(self):
self.assertEqual(['A', 'B', 'C'], utils.split_by('A, B, C', ','))
def test_without_space(self):
self.assertEqual(['A', 'B', 'C'], utils.split_by('A,B,C', ','))
def... | true | true |
f7194a37fbd1fbc139636447bb1502e8a31ec9fb | 1,257 | py | Python | backend2/venv/lib/python3.9/site-packages/authlib/jose/rfc7517/_cryptography_key.py | anushkas-bot/cube.js | fc5f66e20a7073fcdb1f279440bcd582c5ccc9da | [
"Cube",
"Apache-2.0",
"MIT"
] | 3,172 | 2017-11-11T05:54:14.000Z | 2022-03-31T23:59:59.000Z | backend2/venv/lib/python3.9/site-packages/authlib/jose/rfc7517/_cryptography_key.py | anushkas-bot/cube.js | fc5f66e20a7073fcdb1f279440bcd582c5ccc9da | [
"Cube",
"Apache-2.0",
"MIT"
] | 397 | 2017-11-11T02:49:06.000Z | 2022-03-31T21:02:37.000Z | backend2/venv/lib/python3.9/site-packages/authlib/jose/rfc7517/_cryptography_key.py | anushkas-bot/cube.js | fc5f66e20a7073fcdb1f279440bcd582c5ccc9da | [
"Cube",
"Apache-2.0",
"MIT"
] | 387 | 2017-11-18T08:59:56.000Z | 2022-03-15T18:37:37.000Z | from cryptography.x509 import load_pem_x509_certificate
from cryptography.hazmat.primitives.serialization import (
load_pem_private_key, load_pem_public_key, load_ssh_public_key,
)
from cryptography.hazmat.backends import default_backend
from authlib.common.encoding import to_bytes
def load_pem_key(raw, ssh_type=... | 35.914286 | 86 | 0.747017 | from cryptography.x509 import load_pem_x509_certificate
from cryptography.hazmat.primitives.serialization import (
load_pem_private_key, load_pem_public_key, load_ssh_public_key,
)
from cryptography.hazmat.backends import default_backend
from authlib.common.encoding import to_bytes
def load_pem_key(raw, ssh_type=... | true | true |
f7194ab1a937921f6752fb9ea13a7ad2b345d88f | 2,008 | py | Python | tests/conftest.py | amosbastian/python-fpl | 3db8e0029d7cf07111db61ddee0b37b17b051bcd | [
"MIT"
] | 217 | 2018-01-17T10:03:07.000Z | 2022-03-12T06:13:02.000Z | tests/conftest.py | amosbastian/python-fpl | 3db8e0029d7cf07111db61ddee0b37b17b051bcd | [
"MIT"
] | 84 | 2018-04-23T09:56:16.000Z | 2022-02-11T16:19:58.000Z | tests/conftest.py | amosbastian/python-fpl | 3db8e0029d7cf07111db61ddee0b37b17b051bcd | [
"MIT"
] | 88 | 2018-04-21T08:07:16.000Z | 2022-02-25T03:43:54.000Z | import aiohttp
import pytest
import os
from fpl import FPL
from fpl.models import Fixture, H2HLeague, User, ClassicLeague, Team, Gameweek
from tests.test_classic_league import classic_league_data
from tests.test_fixture import fixture_data
from tests.test_h2h_league import h2h_league_data
from tests.test_team import t... | 23.08046 | 78 | 0.744024 | import aiohttp
import pytest
import os
from fpl import FPL
from fpl.models import Fixture, H2HLeague, User, ClassicLeague, Team, Gameweek
from tests.test_classic_league import classic_league_data
from tests.test_fixture import fixture_data
from tests.test_h2h_league import h2h_league_data
from tests.test_team import t... | true | true |
f7194ae6ce49e55ac49b2ee6f18f31f1b76f58c1 | 35,332 | py | Python | test/test_restful.py | ueno/keylime | 480c9b107c155e7a20442afe3be929cf5d50fb86 | [
"Apache-2.0"
] | null | null | null | test/test_restful.py | ueno/keylime | 480c9b107c155e7a20442afe3be929cf5d50fb86 | [
"Apache-2.0"
] | null | null | null | test/test_restful.py | ueno/keylime | 480c9b107c155e7a20442afe3be929cf5d50fb86 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
'''
SPDX-License-Identifier: Apache-2.0
Copyright 2017 Massachusetts Institute of Technology.
NOTE:
This unittest is being used as a procedural test.
The tests must be run in-order and CANNOT be parallelized!
Tests all but two RESTful interfaces:
* agent's POST /v2/keys/vkey
- Done by C... | 38.997792 | 140 | 0.635656 |
import sys
import signal
import unittest
import subprocess
import time
import os
import base64
import threading
import shutil
import errno
from pathlib import Path
import dbus
import simplejson as json
from keylime import config
from keylime import tornado_requests
from keylime.requests_client import RequestsClient... | true | true |
f7194b8167f283797e8754a97cb5a389e35e14ce | 2,442 | py | Python | hello_fastapi_project/hello_fastapi/backend/app/alembic/env.py | KimSoungRyoul/PersistenceLayerInPythonApplication | 2431553a6cdd913babd546adc6c9376855eb3438 | [
"MIT"
] | 2 | 2021-11-01T08:08:13.000Z | 2021-11-01T08:11:51.000Z | hello_fastapi_project/hello_fastapi/backend/app/alembic/env.py | KimSoungRyoul/PersistenceLayerInPythonApplication | 2431553a6cdd913babd546adc6c9376855eb3438 | [
"MIT"
] | null | null | null | hello_fastapi_project/hello_fastapi/backend/app/alembic/env.py | KimSoungRyoul/PersistenceLayerInPythonApplication | 2431553a6cdd913babd546adc6c9376855eb3438 | [
"MIT"
] | null | null | null | from __future__ import with_statement
import os
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config fil... | 27.75 | 87 | 0.72154 | from __future__ import with_statement
import os
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
config = context.config
fileConfig(config.config_file_name)
# for 'autogenerate' support
# from myapp import mymodel
# target_metadata = mymodel.Bas... | true | true |
f7194cecc0e0ff877121d721d5f9416a213d7ec6 | 129 | py | Python | dan_socket/base.py | fredericowu/dan_socket | 12ccbd8333b76889f6ee2050c78aba67f0a86533 | [
"Apache-2.0"
] | null | null | null | dan_socket/base.py | fredericowu/dan_socket | 12ccbd8333b76889f6ee2050c78aba67f0a86533 | [
"Apache-2.0"
] | null | null | null | dan_socket/base.py | fredericowu/dan_socket | 12ccbd8333b76889f6ee2050c78aba67f0a86533 | [
"Apache-2.0"
] | null | null | null | import socket
class BaseConnection:
PROTOCOL = {
"TCP": socket.SOCK_STREAM,
"UDP": socket.SOCK_DGRAM
}
| 14.333333 | 34 | 0.604651 | import socket
class BaseConnection:
PROTOCOL = {
"TCP": socket.SOCK_STREAM,
"UDP": socket.SOCK_DGRAM
}
| true | true |
f7194df8986a3f798477abbd22f0e92a006cfa20 | 967 | py | Python | valid-sudoku/valid-sudoku.py | Atri10/Leet-code---Atri_Patel | 49fc59b9147a44ab04a66128fbb2ef259b5f7b7c | [
"MIT"
] | 1 | 2021-10-10T20:21:18.000Z | 2021-10-10T20:21:18.000Z | valid-sudoku/valid-sudoku.py | Atri10/Leet-code---Atri_Patel | 49fc59b9147a44ab04a66128fbb2ef259b5f7b7c | [
"MIT"
] | null | null | null | valid-sudoku/valid-sudoku.py | Atri10/Leet-code---Atri_Patel | 49fc59b9147a44ab04a66128fbb2ef259b5f7b7c | [
"MIT"
] | null | null | null | class Solution:
def isValidSudoku(self, board: List[List[str]]) -> bool:
BZip = list(zip(*board))
def Checkline(li):
temp = [i for i in li if i!="."]
return len(set(temp))==len(temp)
def check_row(board):
for i in b... | 31.193548 | 83 | 0.458118 | class Solution:
def isValidSudoku(self, board: List[List[str]]) -> bool:
BZip = list(zip(*board))
def Checkline(li):
temp = [i for i in li if i!="."]
return len(set(temp))==len(temp)
def check_row(board):
for i in b... | true | true |
f7194e480fb8f963b01db5fe2fb064378758697e | 11,918 | py | Python | instabot/api/api_video.py | danomaj/instabot | 769e41587a1aaeb50b89f0bf9d3933123e6ddbcc | [
"Apache-2.0"
] | 1 | 2022-01-23T09:25:50.000Z | 2022-01-23T09:25:50.000Z | instabot/api/api_video.py | danomaj/instabot | 769e41587a1aaeb50b89f0bf9d3933123e6ddbcc | [
"Apache-2.0"
] | null | null | null | instabot/api/api_video.py | danomaj/instabot | 769e41587a1aaeb50b89f0bf9d3933123e6ddbcc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import copy
import json
import os
import re
import shutil
import subprocess
import time
from requests_toolbelt import MultipartEncoder
from . import config
def download_video(
self,
media_id,
filename=None,
media=False,
folder="videos"
):
video_urls = []
if not me... | 32.831956 | 78 | 0.523662 |
import copy
import json
import os
import re
import shutil
import subprocess
import time
from requests_toolbelt import MultipartEncoder
from . import config
def download_video(
self,
media_id,
filename=None,
media=False,
folder="videos"
):
video_urls = []
if not media:
self.media... | true | true |
f7194ea7dd6a75befd86621e8258b956db12dfa2 | 1,839 | py | Python | audiospec.py | MountainRange/mobius_score | fc900ab456b3e3431cfa6d9684b97ec6321d0a23 | [
"MIT"
] | null | null | null | audiospec.py | MountainRange/mobius_score | fc900ab456b3e3431cfa6d9684b97ec6321d0a23 | [
"MIT"
] | null | null | null | audiospec.py | MountainRange/mobius_score | fc900ab456b3e3431cfa6d9684b97ec6321d0a23 | [
"MIT"
] | null | null | null |
import numpy as np
import librosa
from tqdm import tqdm
from audiomisc import ks_key
from constants import VERTICALCUTOFF, FFT_SIZE, FFT_HOP
def stft(x, fft_size, hopsamp):
window = np.hanning(fft_size)
return np.array([np.fft.rfft(window*x[i:i+fft_size])
for i in range(0, len(x)-fft_siz... | 36.058824 | 86 | 0.594889 |
import numpy as np
import librosa
from tqdm import tqdm
from audiomisc import ks_key
from constants import VERTICALCUTOFF, FFT_SIZE, FFT_HOP
def stft(x, fft_size, hopsamp):
window = np.hanning(fft_size)
return np.array([np.fft.rfft(window*x[i:i+fft_size])
for i in range(0, len(x)-fft_siz... | true | true |
f7194ee4f7406065cad234d9d9516182a66c1fdd | 4,936 | py | Python | catalog/views.py | singdingo/django_local_library | e6928ce96d37e5f233a5eda89dcf63c04a551a2d | [
"MIT"
] | null | null | null | catalog/views.py | singdingo/django_local_library | e6928ce96d37e5f233a5eda89dcf63c04a551a2d | [
"MIT"
] | null | null | null | catalog/views.py | singdingo/django_local_library | e6928ce96d37e5f233a5eda89dcf63c04a551a2d | [
"MIT"
] | null | null | null | from django.contrib.auth.decorators import permission_required
from django.shortcuts import render, get_object_or_404
from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin
from .models import Book, Author, BookInstance, Genre
from django.views import generic
from django.views.generic.edit i... | 32.261438 | 117 | 0.6953 | from django.contrib.auth.decorators import permission_required
from django.shortcuts import render, get_object_or_404
from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin
from .models import Book, Author, BookInstance, Genre
from django.views import generic
from django.views.generic.edit i... | true | true |
f7194f009ff4f9095f19defc8b8b945fae4f793a | 698 | py | Python | PyCharm/Exercicios/Aula17/ex078.py | fabiodarice/Python | 15ec1c7428f138be875111ac98ba38cf2eec1a93 | [
"MIT"
] | null | null | null | PyCharm/Exercicios/Aula17/ex078.py | fabiodarice/Python | 15ec1c7428f138be875111ac98ba38cf2eec1a93 | [
"MIT"
] | null | null | null | PyCharm/Exercicios/Aula17/ex078.py | fabiodarice/Python | 15ec1c7428f138be875111ac98ba38cf2eec1a93 | [
"MIT"
] | null | null | null | # Importação de bibliotecas
# Título do programa
print('\033[1;34;40mMAIOR E MENOR VALORES NA LISTA\033[m')
# Objetos
valores = list()
# Lógica
for c in range(0, 5):
valores.append(int(input(f'\033[30mDigite um valor para a Posição {c}:\033[m ')))
maior = max(valores)
menor = min(valores)
print('=-' * 30)
pr... | 22.516129 | 85 | 0.636103 |
print('\033[1;34;40mMAIOR E MENOR VALORES NA LISTA\033[m')
valores = list()
for c in range(0, 5):
valores.append(int(input(f'\033[30mDigite um valor para a Posição {c}:\033[m ')))
maior = max(valores)
menor = min(valores)
print('=-' * 30)
print(f'Você digitou os valores {valores}')
print(f'O maior valor... | true | true |
f7194f875486f67d1eadb26fc5e87f6bfaed4596 | 6,237 | py | Python | detect/image_detector.py | Prasad9/Detect-Flags-SSD | c0d662bde99ed8df33d72bd06d61d5eb869d31a5 | [
"MIT"
] | 13 | 2017-11-08T07:09:13.000Z | 2022-03-28T07:09:47.000Z | detect/image_detector.py | Prasad9/Detect-Flags-SSD | c0d662bde99ed8df33d72bd06d61d5eb869d31a5 | [
"MIT"
] | 3 | 2018-03-08T04:30:19.000Z | 2019-01-03T15:47:24.000Z | detect/image_detector.py | Prasad9/Detect-Flags-SSD | c0d662bde99ed8df33d72bd06d61d5eb869d31a5 | [
"MIT"
] | 5 | 2018-01-15T15:26:44.000Z | 2021-08-18T08:02:51.000Z | from __future__ import print_function
import mxnet as mx
import numpy as np
from timeit import default_timer as timer
from dataset.iterator import DetTestImageIter
import cv2
class ImageDetector(object):
"""
SSD detector which hold a detection network and wraps detection API
Parameters:
----------
symbol : mx.Sy... | 29.842105 | 137 | 0.674683 | from __future__ import print_function
import mxnet as mx
import numpy as np
from timeit import default_timer as timer
from dataset.iterator import DetTestImageIter
import cv2
class ImageDetector(object):
def __init__(self, symbol, model_prefix, epoch, data_shape, mean_pixels, \
classes, thresh = 0.6, plot_confid... | true | true |
f7194f9c5decb291e54561f76b15458cea4e4f8b | 357 | py | Python | aliexpress/api/rest/MarketingRedefiningGetactlist.py | bayborodin/aliexpress-sdk | 89935adf46412d8d054fa80a19153971279c4106 | [
"MIT"
] | 3 | 2021-03-10T16:46:43.000Z | 2022-03-29T15:28:50.000Z | aliexpress/api/rest/MarketingRedefiningGetactlist.py | bayborodin/aliexpress-sdk | 89935adf46412d8d054fa80a19153971279c4106 | [
"MIT"
] | null | null | null | aliexpress/api/rest/MarketingRedefiningGetactlist.py | bayborodin/aliexpress-sdk | 89935adf46412d8d054fa80a19153971279c4106 | [
"MIT"
] | 2 | 2021-10-30T17:09:34.000Z | 2021-11-25T11:50:52.000Z | from aliexpress.api.base import RestApi
class AliexpressMarketingRedefiningGetactlistRequest(RestApi):
def __init__(self, domain="gw.api.taobao.com", port=80):
RestApi.__init__(self, domain, port)
self.param_seller_coupon_activity_api_query = None
def getapiname(self):
return "aliexpr... | 32.454545 | 62 | 0.756303 | from aliexpress.api.base import RestApi
class AliexpressMarketingRedefiningGetactlistRequest(RestApi):
def __init__(self, domain="gw.api.taobao.com", port=80):
RestApi.__init__(self, domain, port)
self.param_seller_coupon_activity_api_query = None
def getapiname(self):
return "aliexpr... | true | true |
f7194fa0d3317f35e8c12bcca9423aaf27363280 | 981 | py | Python | tests/test_del_contact.py | aogn/python_train | 40131b24633c9771452813872061ca5335edecd8 | [
"Apache-2.0"
] | null | null | null | tests/test_del_contact.py | aogn/python_train | 40131b24633c9771452813872061ca5335edecd8 | [
"Apache-2.0"
] | null | null | null | tests/test_del_contact.py | aogn/python_train | 40131b24633c9771452813872061ca5335edecd8 | [
"Apache-2.0"
] | null | null | null | from models.contact import Contact
import random
import allure
def test_delete_some_contact(app, db, check_ui):
with allure.step('Check contact'):
if len(db.get_contact_list()) == 0:
app.contact.creation(Contact(first_name="test"))
with allure.step('Given a contact list and contact to delet... | 44.590909 | 125 | 0.699286 | from models.contact import Contact
import random
import allure
def test_delete_some_contact(app, db, check_ui):
with allure.step('Check contact'):
if len(db.get_contact_list()) == 0:
app.contact.creation(Contact(first_name="test"))
with allure.step('Given a contact list and contact to delet... | true | true |
f7194fe7656b09b6c529b0342d12157fb1da984f | 710 | py | Python | tests/apps/minimal2/application.py | blazelibs/blazeweb | b120a6a2e38c8b53da2b73443ff242e2d1438053 | [
"BSD-3-Clause"
] | null | null | null | tests/apps/minimal2/application.py | blazelibs/blazeweb | b120a6a2e38c8b53da2b73443ff242e2d1438053 | [
"BSD-3-Clause"
] | 6 | 2016-11-01T18:42:34.000Z | 2020-11-16T16:52:14.000Z | tests/apps/minimal2/application.py | blazelibs/blazeweb | b120a6a2e38c8b53da2b73443ff242e2d1438053 | [
"BSD-3-Clause"
] | 1 | 2020-01-22T18:20:46.000Z | 2020-01-22T18:20:46.000Z | from os import path
from blazeutils import prependsitedir
from blazeweb.application import WSGIApp
from blazeweb.middleware import full_wsgi_stack
from minimal2.config import settings as settingsmod
from blazeweb.scripting import application_entry
# make sure our base module gets put on the path
try:
import minima... | 25.357143 | 61 | 0.773239 | from os import path
from blazeutils import prependsitedir
from blazeweb.application import WSGIApp
from blazeweb.middleware import full_wsgi_stack
from minimal2.config import settings as settingsmod
from blazeweb.scripting import application_entry
try:
import minimal2
except ImportError:
prependsitedir(path... | true | true |
f719503e9bb94c5fe728360593ebcf3637d9ab4e | 17,459 | py | Python | src/graphtastic/clustering.py | richardtjornhammar/graphtastic | 1e64d408ffb3e09d5ad068986c847032d5cfdcbd | [
"Apache-2.0"
] | 1 | 2022-02-08T09:53:38.000Z | 2022-02-08T09:53:38.000Z | src/graphtastic/clustering.py | richardtjornhammar/graphtastic | 1e64d408ffb3e09d5ad068986c847032d5cfdcbd | [
"Apache-2.0"
] | null | null | null | src/graphtastic/clustering.py | richardtjornhammar/graphtastic | 1e64d408ffb3e09d5ad068986c847032d5cfdcbd | [
"Apache-2.0"
] | 1 | 2022-03-24T12:37:05.000Z | 2022-03-24T12:37:05.000Z | """
Copyright 2022 RICHARD TJÖRNHAMMAR
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... | 48.497222 | 462 | 0.452145 | import numpy as np
import typing
import sys
try :
from numba import jit
bUseNumba = True
except ImportError :
print ( "ImportError:"," NUMBA. WILL NOT USE IT")
bUseNumba = False
except OSError:
print ( "OSError:"," NUMBA. WILL NOT USE IT")
bUseNumba = False
if bUseNumb... | true | true |
f719505a712591c9db61d06ce1e597d8da79a187 | 235 | py | Python | orb_simulator/lexer/regex_ast/regex_epsilon_node.py | dmguezjaviersnet/IA-Sim-Comp-Project | 8165b9546efc45f98091a3774e2dae4f45942048 | [
"MIT"
] | 1 | 2022-01-19T22:49:09.000Z | 2022-01-19T22:49:09.000Z | orb_simulator/lexer/regex_ast/regex_epsilon_node.py | dmguezjaviersnet/IA-Sim-Comp-Project | 8165b9546efc45f98091a3774e2dae4f45942048 | [
"MIT"
] | 15 | 2021-11-10T14:25:02.000Z | 2022-02-12T19:17:11.000Z | orb_simulator/lexer/regex_ast/regex_epsilon_node.py | dmguezjaviersnet/IA-Sim-Comp-Project | 8165b9546efc45f98091a3774e2dae4f45942048 | [
"MIT"
] | null | null | null | from lexer.regex_ast.regex_atomic_node import AtomicNode
from automaton import Automaton
class EpsilonNode(AtomicNode):
def eval(self):
return Automaton(number_of_states=1, initial_state=0, finalStates=[0], transitions={}) | 39.166667 | 94 | 0.787234 | from lexer.regex_ast.regex_atomic_node import AtomicNode
from automaton import Automaton
class EpsilonNode(AtomicNode):
def eval(self):
return Automaton(number_of_states=1, initial_state=0, finalStates=[0], transitions={}) | true | true |
f71950d1cafe3ade67ae0b9180b0da8119152a85 | 4,293 | py | Python | experiments/steven/disentanglement/pointmass/disentanglement_rig.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/steven/disentanglement/pointmass/disentanglement_rig.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/steven/disentanglement/pointmass/disentanglement_rig.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | import os.path as osp
import torch.nn.functional as F
import multiworld.envs.mujoco as mwmj
import rlkit.misc.hyperparameter as hyp
from rlkit.launchers.launcher_util import run_experiment
from rlkit.launchers.experiments.disentanglement.launcher import \
disentangled_grill_her_twin_sac_experiment
from rlkit.t... | 32.278195 | 127 | 0.575355 | import os.path as osp
import torch.nn.functional as F
import multiworld.envs.mujoco as mwmj
import rlkit.misc.hyperparameter as hyp
from rlkit.launchers.launcher_util import run_experiment
from rlkit.launchers.experiments.disentanglement.launcher import \
disentangled_grill_her_twin_sac_experiment
from rlkit.t... | true | true |
f71951497f2af63f6a8b59d46f752d982dea0860 | 8,150 | py | Python | python/paddle/fluid/tests/unittests/ir/inference/test_trt_activation_pass.py | TochkaAI/Paddle | 481ee79fc92304f33165f7ed0679f16c36862cea | [
"Apache-2.0"
] | 3 | 2021-06-08T14:24:36.000Z | 2021-06-08T14:24:38.000Z | python/paddle/fluid/tests/unittests/ir/inference/test_trt_activation_pass.py | chenyanlei1/Paddle | f249a5f05f0f5832279244d88c8cb4eaaad1fbd4 | [
"Apache-2.0"
] | 1 | 2021-03-17T07:53:43.000Z | 2021-03-17T07:53:43.000Z | python/paddle/fluid/tests/unittests/ir/inference/test_trt_activation_pass.py | chenyanlei1/Paddle | f249a5f05f0f5832279244d88c8cb4eaaad1fbd4 | [
"Apache-2.0"
] | 1 | 2021-06-17T06:52:01.000Z | 2021-06-17T06:52:01.000Z | # Copyright (c) 2020 PaddlePaddle 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 appli... | 35.58952 | 89 | 0.699755 |
import os
import shutil
import unittest
import numpy as np
from inference_pass_test import InferencePassTest
import paddle.fluid as fluid
import paddle.fluid.core as core
from paddle.fluid.core import PassVersionChecker
from paddle.fluid.core import AnalysisConfig
class TensorRTSubgraphPassActivationTes... | true | true |
f71951e82d394762ce0671379de3793e5bb9983b | 1,903 | py | Python | UnitTests/test_battery_sensor_features_extractor.py | naveenkambham/big_five_personality_machine_learning | a4d673e7e72287f2448b6a7b2729e5231b4f7ab2 | [
"MIT"
] | 8 | 2021-02-22T22:12:32.000Z | 2022-03-25T15:18:28.000Z | UnitTests/test_battery_sensor_features_extractor.py | naveenkambham/big_five_personality_machine_learning | a4d673e7e72287f2448b6a7b2729e5231b4f7ab2 | [
"MIT"
] | 1 | 2020-12-29T18:59:39.000Z | 2021-01-13T17:41:25.000Z | UnitTests/test_battery_sensor_features_extractor.py | naveenkambham/big_five_personality_machine_learning | a4d673e7e72287f2448b6a7b2729e5231b4f7ab2 | [
"MIT"
] | 4 | 2021-04-08T11:36:33.000Z | 2022-02-18T14:12:47.000Z | """
Developer : Naveen Kambham
Description: Unit testing for battery sensor feature extractor code. Majority of the data extraction code has to be tested visually by looking at the plots distributions.
"""
#Importing the required libraries.
import unittest
import numpy as np
from FeatureExtraction import battery_senso... | 38.836735 | 171 | 0.656332 |
import unittest
import numpy as np
from FeatureExtraction import battery_sensor_features_extractor
class BatterySensorTestCase(unittest.TestCase):
def test_TakeMostProbableTimeInStudy(self):
result= battery_sensor_features_extractor.TakeMostProbableTimeInStudy([1,1,1,1,2,2,3,3,3,3,3,3,3,3... | true | true |
f7195383ef1c320e1cc9ce4ac28c29823e011af1 | 2,059 | py | Python | graph.py | jacgonzalez/Graph_Art | ea724c3e659aca63107ae9a59cb646f8aba821c6 | [
"MIT"
] | null | null | null | graph.py | jacgonzalez/Graph_Art | ea724c3e659aca63107ae9a59cb646f8aba821c6 | [
"MIT"
] | null | null | null | graph.py | jacgonzalez/Graph_Art | ea724c3e659aca63107ae9a59cb646f8aba821c6 | [
"MIT"
] | null | null | null | import math
points = [[4,1], [4,2], [4,3],
[3,1], [3,2], [3,3],
[2,1], [2,2], [2,3],
[1,1], [1,2], [1,3]]
def distance(point1, point2):
return math.sqrt(((point2[0] - point1[0])**2) + ((point2[1] - point1[1])**2))
def k_neighbors(i, points, k):
"""
i: index of a point
... | 21.447917 | 81 | 0.592521 | import math
points = [[4,1], [4,2], [4,3],
[3,1], [3,2], [3,3],
[2,1], [2,2], [2,3],
[1,1], [1,2], [1,3]]
def distance(point1, point2):
return math.sqrt(((point2[0] - point1[0])**2) + ((point2[1] - point1[1])**2))
def k_neighbors(i, points, k):
distancias_point_i = []
poi... | true | true |
f71953db54832094263b29e4d88077938efd3aed | 5,989 | py | Python | test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_inheritance_operations.py | amrElroumy/autorest.python | b37af1779f6d53b4fa0d92da62151f8133006f98 | [
"MIT"
] | null | null | null | test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_inheritance_operations.py | amrElroumy/autorest.python | b37af1779f6d53b4fa0d92da62151f8133006f98 | [
"MIT"
] | null | null | null | test/vanilla/Expected/AcceptanceTests/BodyComplex/bodycomplex/aio/operations/_inheritance_operations.py | amrElroumy/autorest.python | b37af1779f6d53b4fa0d92da62151f8133006f98 | [
"MIT"
] | null | null | null | # 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 ... | 43.398551 | 106 | 0.674236 |
from typing import Any, Callable, Dict, Generic, Optional, TypeVar
import warnings
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
map_error,
)
from azure.core.pipeline import PipelineResponse
from azure.core.pipel... | true | true |
f7195404dfad6b9a9dd9872526043575b12c080b | 3,669 | py | Python | trafficModel.py | Mobility-simulation/IDM_Program | ac33674373d8560b440562acb5acf82ae5bf4fc6 | [
"Unlicense"
] | null | null | null | trafficModel.py | Mobility-simulation/IDM_Program | ac33674373d8560b440562acb5acf82ae5bf4fc6 | [
"Unlicense"
] | null | null | null | trafficModel.py | Mobility-simulation/IDM_Program | ac33674373d8560b440562acb5acf82ae5bf4fc6 | [
"Unlicense"
] | null | null | null | import tkinter as tk
from system.operation import Operation
from model.world import World
import settings
root = tk.Tk()
img = tk.PhotoImage(file='png/sports-car.png')
root.tk.call('wm', 'iconphoto', root._w, img)
menu = tk.Menu(root)
root.config(menu=menu)
root.protocol("WM_DELETE_WINDOW", lambda: op.terminate(root... | 29.829268 | 75 | 0.706187 | import tkinter as tk
from system.operation import Operation
from model.world import World
import settings
root = tk.Tk()
img = tk.PhotoImage(file='png/sports-car.png')
root.tk.call('wm', 'iconphoto', root._w, img)
menu = tk.Menu(root)
root.config(menu=menu)
root.protocol("WM_DELETE_WINDOW", lambda: op.terminate(root... | true | true |
f719543be7e7a689ebcb0b8ad3fa69e2a94998d6 | 3,217 | py | Python | setup.py | groupserver/gs.profile.status.send | d33c7ab535565d185a2ef95bf00c92b9ffeb8af7 | [
"ZPL-2.1"
] | null | null | null | setup.py | groupserver/gs.profile.status.send | d33c7ab535565d185a2ef95bf00c92b9ffeb8af7 | [
"ZPL-2.1"
] | null | null | null | setup.py | groupserver/gs.profile.status.send | d33c7ab535565d185a2ef95bf00c92b9ffeb8af7 | [
"ZPL-2.1"
] | null | null | null | # -*- coding: utf-8 -*-
############################################################################
#
# Copyright © 2012, 2013, 2014, 2015 OnlineGroups.net and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should ... | 38.297619 | 76 | 0.618278 | true | true | |
f71954b599b64b8d33b4eb0854424d9b156c78cd | 64,577 | py | Python | test/integration/component/test_redundant_router_network_rules.py | lafferty/cshv3 | ee0ff7ac240bd24e19db6bd3fb9869dd087442ba | [
"Apache-2.0"
] | 2 | 2015-05-19T05:04:30.000Z | 2016-09-07T00:33:17.000Z | test/integration/component/test_redundant_router_network_rules.py | lafferty/cshv3 | ee0ff7ac240bd24e19db6bd3fb9869dd087442ba | [
"Apache-2.0"
] | null | null | null | test/integration/component/test_redundant_router_network_rules.py | lafferty/cshv3 | ee0ff7ac240bd24e19db6bd3fb9869dd087442ba | [
"Apache-2.0"
] | 2 | 2017-07-07T14:49:03.000Z | 2018-07-31T06:38:42.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 45.253679 | 128 | 0.429843 |
from nose.plugins.attrib import attr
from marvin.integration.lib.base import *
from marvin.integration.lib.utils import *
from marvin.integration.lib.common import *
from marvin.cloudstackTestCase import cloudstackTestCase
from marvin.cloudstackAPI import *
class Services:
def __init__(self):
... | true | true |
f719550eb352bbb1095167f47a860d9ae8edd55b | 283 | py | Python | src/com/python/socket/udp_client.py | Leeo1124/pythonDemo | 72e2209c095301a3f1f61edfe03ea69c3c05be40 | [
"Apache-2.0"
] | null | null | null | src/com/python/socket/udp_client.py | Leeo1124/pythonDemo | 72e2209c095301a3f1f61edfe03ea69c3c05be40 | [
"Apache-2.0"
] | null | null | null | src/com/python/socket/udp_client.py | Leeo1124/pythonDemo | 72e2209c095301a3f1f61edfe03ea69c3c05be40 | [
"Apache-2.0"
] | null | null | null | '''
Created on 2016年8月10日
@author: Administrator
'''
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
for data in [b'Michael', b'Tracy', b'Sarah']:
# 发送数据:
s.sendto(data, ('127.0.0.1', 9999))
# 接收数据:
print(s.recv(1024).decode('utf-8'))
s.close() | 17.6875 | 52 | 0.636042 | import socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
for data in [b'Michael', b'Tracy', b'Sarah']:
s.sendto(data, ('127.0.0.1', 9999))
print(s.recv(1024).decode('utf-8'))
s.close() | true | true |
f71955e2cbcdd5db22e26670801fd917e9622190 | 431 | py | Python | app/core/migrations/0005_recipe_image.py | JopeAlgorta/django-recipe-api | a92ae3b206682564d147618f83794edaf2c9a785 | [
"MIT"
] | null | null | null | app/core/migrations/0005_recipe_image.py | JopeAlgorta/django-recipe-api | a92ae3b206682564d147618f83794edaf2c9a785 | [
"MIT"
] | null | null | null | app/core/migrations/0005_recipe_image.py | JopeAlgorta/django-recipe-api | a92ae3b206682564d147618f83794edaf2c9a785 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.14 on 2020-07-31 14:42
import core.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0004_recipe'),
]
operations = [
migrations.AddField(
model_name='recipe',
name='image',
... | 21.55 | 93 | 0.62181 |
import core.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0004_recipe'),
]
operations = [
migrations.AddField(
model_name='recipe',
name='image',
field=models.ImageField(null=True, u... | true | true |
f71956fe3c17887634434668acacfe3048dd4355 | 4,815 | py | Python | src/mem/ruby/network/garnet/GarnetNetwork.py | NickSica/gem5 | 87ffe8b4f75f3a6938144e4edc1ba0ba6f3f0610 | [
"BSD-3-Clause"
] | null | null | null | src/mem/ruby/network/garnet/GarnetNetwork.py | NickSica/gem5 | 87ffe8b4f75f3a6938144e4edc1ba0ba6f3f0610 | [
"BSD-3-Clause"
] | null | null | null | src/mem/ruby/network/garnet/GarnetNetwork.py | NickSica/gem5 | 87ffe8b4f75f3a6938144e4edc1ba0ba6f3f0610 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2008 Princeton University
# Copyright (c) 2009 Advanced Micro Devices, 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: redistributions of source code must retain the above c... | 55.344828 | 258 | 0.727726 |
from m5.params import *
from m5.proxy import *
from m5.objects.Network import RubyNetwork
from m5.objects.BasicRouter import BasicRouter
from m5.objects.ClockedObject import ClockedObject
class GarnetNetwork(RubyNetwork):
type = 'GarnetNetwork'
cxx_header = "mem/ruby/network/garne... | true | true |
f71957077b0dab80c0b89a88133f80aa1b7d1e31 | 23,266 | py | Python | data_generators/data_options.py | Zack-Quintana/underdog-devs-ds-a | 743c1b977eb52c1ca536df927ab1474949f1bd90 | [
"MIT"
] | null | null | null | data_generators/data_options.py | Zack-Quintana/underdog-devs-ds-a | 743c1b977eb52c1ca536df927ab1474949f1bd90 | [
"MIT"
] | null | null | null | data_generators/data_options.py | Zack-Quintana/underdog-devs-ds-a | 743c1b977eb52c1ca536df927ab1474949f1bd90 | [
"MIT"
] | null | null | null | import string
from itertools import chain
from math import ceil, floor
from random import randint, choice, random, choices, shuffle
male_first_names = (
"Liam", "Noah", "Oliver", "Elijah", "William", "James", "Benjamin", "Lucas",
"Henry", "Alexander", "Mason", "Michael", "Ethan", "Daniel", "Jacob",
"Logan"... | 65.538028 | 80 | 0.568297 | import string
from itertools import chain
from math import ceil, floor
from random import randint, choice, random, choices, shuffle
male_first_names = (
"Liam", "Noah", "Oliver", "Elijah", "William", "James", "Benjamin", "Lucas",
"Henry", "Alexander", "Mason", "Michael", "Ethan", "Daniel", "Jacob",
"Logan"... | true | true |
f719579272f6a91654381f1c2c1b0fc8aede760f | 1,559 | py | Python | channels/streamedit.py | leigh123linux/streamtuner2 | 43ded3a68bcf3d968a99c849d779fc8c3fb3d8d8 | [
"MIT"
] | 1 | 2019-03-03T19:58:01.000Z | 2019-03-03T19:58:01.000Z | channels/streamedit.py | leigh123linux/streamtuner2 | 43ded3a68bcf3d968a99c849d779fc8c3fb3d8d8 | [
"MIT"
] | null | null | null | channels/streamedit.py | leigh123linux/streamtuner2 | 43ded3a68bcf3d968a99c849d779fc8c3fb3d8d8 | [
"MIT"
] | null | null | null | # api: streamtuner2
# title: Stream entry editor
# description: Allows to inspect and modify station/stream entries.
# version: 0.6
# type: feature
# category: ui
# config: -
# priority: core
#
# Editing dialog for stream entries. Available in
# the context and main menu. Most useful for
# changing bookmarks, or even ... | 27.839286 | 105 | 0.628608 |
from uikit import *
import channels
from config import *
from copy import copy
class streamedit (AuxiliaryWindow):
fields = [
"favicon", "format", "genre", "homepage", "playing", "title", "url", "extra"
]
def open(self, mw):
self.main.configwin.load_config(self.main.r... | true | true |
f71957e4865285d50289aa6cd3aa2a4c44bdc813 | 260 | py | Python | lucky-four.py | omar115/codechef | 7634b085bb906e4ef29e6ae08bdbe82add2aa345 | [
"MIT"
] | null | null | null | lucky-four.py | omar115/codechef | 7634b085bb906e4ef29e6ae08bdbe82add2aa345 | [
"MIT"
] | null | null | null | lucky-four.py | omar115/codechef | 7634b085bb906e4ef29e6ae08bdbe82add2aa345 | [
"MIT"
] | null | null | null | t = int(input())
i=0
while i < t:
st = str(input())
length = len(st)
j = 0
cnt = 0
while j < length:
num = int(st[j])
#print(num)
if num == 4:
cnt = cnt + 1
j=j+1
print(cnt)
i=i+1 | 16.25 | 25 | 0.388462 | t = int(input())
i=0
while i < t:
st = str(input())
length = len(st)
j = 0
cnt = 0
while j < length:
num = int(st[j])
if num == 4:
cnt = cnt + 1
j=j+1
print(cnt)
i=i+1 | true | true |
f71958930d922f66399bb7f49e57cab4ab83d335 | 12,028 | py | Python | hfc/protos/peer/collection_pb2.py | roviso/hyberledger-py | 908dd597e0822f99cf618f235dd517824ba44bc4 | [
"Apache-2.0"
] | 389 | 2016-09-18T11:50:10.000Z | 2022-03-29T21:45:40.000Z | hfc/protos/peer/collection_pb2.py | regrlomon/fabric-sdk-py | 57ddc125cd0627c602d55b300d3e0ba50600ea9e | [
"Apache-2.0"
] | 112 | 2017-08-18T00:32:21.000Z | 2022-02-25T18:55:57.000Z | hfc/protos/peer/collection_pb2.py | regrlomon/fabric-sdk-py | 57ddc125cd0627c602d55b300d3e0ba50600ea9e | [
"Apache-2.0"
] | 268 | 2016-10-12T02:56:58.000Z | 2022-03-30T09:50:54.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: hfc/protos/peer/collection.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
... | 45.388679 | 1,115 | 0.786415 |
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default()
from hfc.protos.common import policies_pb2 as hfc_dot_pr... | true | true |
f7195995fd51c5d254684ca38dffb1faa4bb8fd0 | 594 | py | Python | tests/__init__.py | techthiyanes/ml_things | ddeeb16c55cf1d55cf80963217a8d1bffd0913cc | [
"Apache-2.0"
] | 153 | 2020-10-10T05:12:16.000Z | 2022-03-17T07:48:42.000Z | tests/__init__.py | techthiyanes/ml_things | ddeeb16c55cf1d55cf80963217a8d1bffd0913cc | [
"Apache-2.0"
] | 21 | 2020-09-15T22:52:43.000Z | 2022-02-21T15:27:16.000Z | tests/__init__.py | techthiyanes/ml_things | ddeeb16c55cf1d55cf80963217a8d1bffd0913cc | [
"Apache-2.0"
] | 42 | 2020-10-11T07:33:32.000Z | 2022-03-11T01:43:54.000Z | # coding=utf-8
# Copyright 2020 George Mihaila.
#
# 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 agr... | 39.6 | 74 | 0.760943 | true | true | |
f7195a417bd65f657d54400929963ce73b5b19d7 | 14,584 | py | Python | qiskit/quantum_info/operators/measures.py | KOLANICH/qiskit-terra | 3947f258ddb31a2b8dd17aff5d2d041d29d74601 | [
"Apache-2.0"
] | 1 | 2021-04-28T14:37:16.000Z | 2021-04-28T14:37:16.000Z | qiskit/quantum_info/operators/measures.py | timgates42/qiskit-terra | 3947f258ddb31a2b8dd17aff5d2d041d29d74601 | [
"Apache-2.0"
] | 6 | 2021-01-17T17:56:08.000Z | 2021-04-01T12:40:21.000Z | qiskit/quantum_info/operators/measures.py | timgates42/qiskit-terra | 3947f258ddb31a2b8dd17aff5d2d041d29d74601 | [
"Apache-2.0"
] | 2 | 2021-03-07T07:58:54.000Z | 2021-04-28T03:40:49.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017.
#
# 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 derivative wo... | 38.582011 | 88 | 0.637959 |
import warnings
import numpy as np
from scipy import sparse
from qiskit.exceptions import QiskitError
from qiskit.circuit.gate import Gate
from qiskit.quantum_info.operators.base_operator import BaseOperator
from qiskit.quantum_info.operators.operator import Operator
from qiskit.quantum_info.operators.ch... | true | true |
f7195bbf84421b2fed723996ef1806b0e3e52004 | 2,465 | py | Python | backend/fleet_management/tests/test_crypto.py | OtisRed/pah-fm | 68a306fce5593a6f79711fa473a91bc8163b01df | [
"MIT"
] | 8 | 2019-08-09T11:06:16.000Z | 2021-10-05T14:56:31.000Z | backend/fleet_management/tests/test_crypto.py | OtisRed/pah-fm | 68a306fce5593a6f79711fa473a91bc8163b01df | [
"MIT"
] | 382 | 2018-10-17T19:05:30.000Z | 2022-02-10T07:09:45.000Z | backend/fleet_management/tests/test_crypto.py | OtisRed/pah-fm | 68a306fce5593a6f79711fa473a91bc8163b01df | [
"MIT"
] | 45 | 2018-10-17T17:04:04.000Z | 2021-10-05T14:30:35.000Z | from secrets import randbits
from django.conf import settings
from rest_framework.test import APISimpleTestCase
from fleet_management.crypto import (
sign,
verify,
inverse_of,
is_prime,
find_prime,
find_p_q_phi,
find_pair_of_keys,
hash_dict,
)
class CryptoTest(APISimpleTestCase):
... | 34.236111 | 79 | 0.627586 | from secrets import randbits
from django.conf import settings
from rest_framework.test import APISimpleTestCase
from fleet_management.crypto import (
sign,
verify,
inverse_of,
is_prime,
find_prime,
find_p_q_phi,
find_pair_of_keys,
hash_dict,
)
class CryptoTest(APISimpleTestCase):
... | true | true |
f7195c0c364fe7bce695c427067417d2cf71be24 | 3,496 | py | Python | bindings/python/ensmallen/datasets/string/pontibacterchinhatensis.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/pontibacterchinhatensis.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/pontibacterchinhatensis.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Pontibacter chinhatensis.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--prote... | 33.295238 | 223 | 0.67992 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen import Graph
def PontibacterChinhatensis(
directed: bool = False,
preprocess: bool = True,
load_nodes: bool = True,
verbose: int = 2,
cache: bool = True,
cache_path: str = "graphs/s... | true | true |
f7195c158eefd24c981c80cfe2493d7d0991e7c0 | 1,263 | py | Python | jesse/indicators/supersmoother.py | noenfugler/jesse | 217a3168620a755c1a9576d9deb27105db7dccf8 | [
"MIT"
] | 1 | 2021-03-25T09:25:49.000Z | 2021-03-25T09:25:49.000Z | jesse/indicators/supersmoother.py | noenfugler/jesse | 217a3168620a755c1a9576d9deb27105db7dccf8 | [
"MIT"
] | null | null | null | jesse/indicators/supersmoother.py | noenfugler/jesse | 217a3168620a755c1a9576d9deb27105db7dccf8 | [
"MIT"
] | 1 | 2021-09-28T16:23:40.000Z | 2021-09-28T16:23:40.000Z | from typing import Union
import numpy as np
from numba import njit
from jesse.helpers import get_candle_source, slice_candles
def supersmoother(candles: np.ndarray, period: int = 14, source_type: str = "close", sequential: bool = False) -> Union[
float, np.ndarray]:
"""
Super Smoother Filter 2pole Butte... | 28.066667 | 120 | 0.638163 | from typing import Union
import numpy as np
from numba import njit
from jesse.helpers import get_candle_source, slice_candles
def supersmoother(candles: np.ndarray, period: int = 14, source_type: str = "close", sequential: bool = False) -> Union[
float, np.ndarray]:
candles = slice_candles(candles, sequent... | true | true |
f7195cbfea553513473b2df5d5bf67f1cff230ba | 12,078 | py | Python | cellrank/pl/_circular_projection.py | WeilerP/cellrank | c8c2b9f6bd2448861fb414435aee7620ca5a0bad | [
"BSD-3-Clause"
] | 172 | 2020-03-19T19:50:53.000Z | 2022-03-28T09:36:04.000Z | cellrank/pl/_circular_projection.py | WeilerP/cellrank | c8c2b9f6bd2448861fb414435aee7620ca5a0bad | [
"BSD-3-Clause"
] | 702 | 2020-03-19T08:09:04.000Z | 2022-03-30T09:55:14.000Z | cellrank/pl/_circular_projection.py | WeilerP/cellrank | c8c2b9f6bd2448861fb414435aee7620ca5a0bad | [
"BSD-3-Clause"
] | 17 | 2020-04-07T03:11:02.000Z | 2022-02-02T20:39:16.000Z | from typing import Any, Tuple, Union, Mapping, Callable, Optional, Sequence
from typing_extensions import Literal
from enum import auto
from types import MappingProxyType
from pathlib import Path
import scvelo as scv
from anndata import AnnData
from cellrank import logging as logg
from cellrank.tl import Lineage
from... | 35.946429 | 119 | 0.626925 | from typing import Any, Tuple, Union, Mapping, Callable, Optional, Sequence
from typing_extensions import Literal
from enum import auto
from types import MappingProxyType
from pathlib import Path
import scvelo as scv
from anndata import AnnData
from cellrank import logging as logg
from cellrank.tl import Lineage
from... | true | true |
f7195d706b8209cba3d1242687affeb52b7f4d89 | 10,085 | py | Python | app/recipe/tests/test_recipe_api.py | ajayhb/recipe-app | 226b1f4cce34412833a943e92d77f1f85775a2fc | [
"MIT"
] | null | null | null | app/recipe/tests/test_recipe_api.py | ajayhb/recipe-app | 226b1f4cce34412833a943e92d77f1f85775a2fc | [
"MIT"
] | null | null | null | app/recipe/tests/test_recipe_api.py | ajayhb/recipe-app | 226b1f4cce34412833a943e92d77f1f85775a2fc | [
"MIT"
] | null | null | null | import tempfile
import os
from PIL import Image
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
from decimal import Decimal
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Recipe, Tag, Ingredient
from ... | 34.186441 | 78 | 0.64115 | import tempfile
import os
from PIL import Image
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
from decimal import Decimal
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Recipe, Tag, Ingredient
from ... | true | true |
f7195f13467831480cf8e17b1264da8851ad2e64 | 21,774 | py | Python | quant/platform/kucoin.py | yfjelley/thenextquant | 5a2c4324ea390b513632ed2cc64d53314624e4ba | [
"MIT"
] | 2 | 2021-09-22T08:41:55.000Z | 2021-11-05T01:45:27.000Z | quant/platform/kucoin.py | mrganer/thenextquant | 52fb22f5df20d43cb275a08adad81dc97f25a712 | [
"MIT"
] | 1 | 2019-10-25T05:25:28.000Z | 2019-10-25T05:25:28.000Z | quant/platform/kucoin.py | mrganer/thenextquant | 52fb22f5df20d43cb275a08adad81dc97f25a712 | [
"MIT"
] | 4 | 2019-11-29T03:12:34.000Z | 2021-09-19T02:59:29.000Z | # -*- coding:utf-8 -*-
"""
Kucoin Trade module.
https://docs.kucoin.com
Author: HuangTao
Date: 2019/08/01
Email: huangtao@ifclover.com
"""
import json
import copy
import hmac
import base64
import hashlib
from urllib.parse import urljoin
from quant.error import Error
from quant.utils import tools
from quant.utils... | 37.412371 | 133 | 0.596445 |
import json
import copy
import hmac
import base64
import hashlib
from urllib.parse import urljoin
from quant.error import Error
from quant.utils import tools
from quant.utils import logger
from quant.const import KUCOIN
from quant.order import Order
from quant.asset import Asset, AssetSubscribe
from quant.tasks imp... | true | true |
f7195fe4de87239beab23f5be618730dc300a65f | 14,645 | py | Python | RAdam.py | blnm/RSE | 6a3f0dd858ea4b6dafcfb1d97bb979e101d9911c | [
"MIT"
] | 40 | 2020-04-24T01:03:12.000Z | 2022-03-20T18:19:30.000Z | RAdam.py | blnm/RSE | 6a3f0dd858ea4b6dafcfb1d97bb979e101d9911c | [
"MIT"
] | 4 | 2021-09-09T13:26:09.000Z | 2022-03-31T18:37:05.000Z | RAdam.py | blnm/RSE | 6a3f0dd858ea4b6dafcfb1d97bb979e101d9911c | [
"MIT"
] | 7 | 2020-11-25T14:26:09.000Z | 2022-01-29T10:18:40.000Z | import tensorflow as tf
from tensorflow.python.eager import context
from tensorflow.python.framework import ops
from tensorflow.python.ops import clip_ops
from tensorflow.python.ops import control_flow_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.ops import resource_variable_ops
from ten... | 49.476351 | 120 | 0.629157 | import tensorflow as tf
from tensorflow.python.eager import context
from tensorflow.python.framework import ops
from tensorflow.python.ops import clip_ops
from tensorflow.python.ops import control_flow_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.ops import resource_variable_ops
from ten... | true | true |
f7196003d3c4be36ba4db4ea82b6856d51483928 | 18,496 | py | Python | btclib/ecc/ssa.py | dginst/btclib | 70932afe32167449e369d4e2911b1bf741c0f5d2 | [
"MIT"
] | 16 | 2019-01-04T22:21:17.000Z | 2020-02-01T10:41:28.000Z | btclib/ecc/ssa.py | dginst/BitcoinBlockchainTechnology | 70932afe32167449e369d4e2911b1bf741c0f5d2 | [
"MIT"
] | 20 | 2018-05-24T18:47:12.000Z | 2018-12-22T09:52:09.000Z | btclib/ecc/ssa.py | dginst/BitcoinBlockchainTechnology | 70932afe32167449e369d4e2911b1bf741c0f5d2 | [
"MIT"
] | 9 | 2018-05-16T09:53:32.000Z | 2019-01-03T13:49:37.000Z | #!/usr/bin/env python3
# Copyright (C) 2017-2022 The btclib developers
#
# This file is part of btclib. It is subject to the license terms in the
# LICENSE file found in the top-level directory of this distribution.
#
# No part of btclib including this file, may be copied, modified, propagated,
# or distributed except... | 31.243243 | 88 | 0.655872 |
import secrets
from dataclasses import InitVar, dataclass
from hashlib import sha256
from typing import List, Optional, Sequence, Tuple, Type, Union
from btclib.alias import BinaryData, HashF, Integer, JacPoint, Octets, Point
from btclib.bip32.bip32 import BIP32Key
from btclib.ecc.curve import Curve, secp25... | true | true |
f71960081cd60ffe81c41f006c1585cf0ab6b33d | 763 | py | Python | river/metrics/smape.py | brcharron/creme | 25290780f6bba0eb030215194e81b120d0219389 | [
"BSD-3-Clause"
] | 1 | 2020-12-04T18:56:19.000Z | 2020-12-04T18:56:19.000Z | river/metrics/smape.py | brcharron/creme | 25290780f6bba0eb030215194e81b120d0219389 | [
"BSD-3-Clause"
] | null | null | null | river/metrics/smape.py | brcharron/creme | 25290780f6bba0eb030215194e81b120d0219389 | [
"BSD-3-Clause"
] | null | null | null | from . import base
__all__ = ['SMAPE']
class SMAPE(base.MeanMetric, base.RegressionMetric):
"""Symmetric mean absolute percentage error.
Examples
--------
>>> from river import metrics
>>> y_true = [0, 0.07533, 0.07533, 0.07533, 0.07533, 0.07533, 0.07533, 0.0672, 0.0672]
>>> y_pred = [0, ... | 21.8 | 90 | 0.549148 | from . import base
__all__ = ['SMAPE']
class SMAPE(base.MeanMetric, base.RegressionMetric):
def _eval(self, y_true, y_pred):
den = abs(y_true) + abs(y_pred)
if den == 0:
return 0.
return 2. * abs(y_true - y_pred) / den
def get(self):
return 100 * super().get()
| true | true |
f7196073162dfb6d958cbb439ef46151f867a863 | 371,245 | py | Python | pandas/core/generic.py | rhshadrach/pandas | 8f51c998e84feeac6cb760a9f12baf6948cd5922 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2021-08-06T14:07:02.000Z | 2021-08-06T14:07:02.000Z | pandas/core/generic.py | jdsurya/pandas | 777c0f90c6067c636fcd76ce003a8fbfcc311d7b | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/core/generic.py | jdsurya/pandas | 777c0f90c6067c636fcd76ce003a8fbfcc311d7b | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2021-02-03T11:02:42.000Z | 2021-02-03T11:02:42.000Z | import collections
from datetime import timedelta
import functools
import gc
import json
import operator
import pickle
import re
from textwrap import dedent
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
FrozenSet,
Hashable,
List,
Mapping,
Optional,
Sequence,
Set,
... | 33.135041 | 104 | 0.529394 | import collections
from datetime import timedelta
import functools
import gc
import json
import operator
import pickle
import re
from textwrap import dedent
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
FrozenSet,
Hashable,
List,
Mapping,
Optional,
Sequence,
Set,
... | true | true |
f719607b2a4e7f5eac2478307ce00dc1f2055669 | 2,541 | py | Python | e3sm_to_cmip/cmor_handlers/zos.py | xylar/e3sm_to_cmip | 4fbe8fc91475eae26df839d0cd8062c4b8dc16ae | [
"MIT"
] | 7 | 2018-05-03T12:30:06.000Z | 2022-01-20T23:52:02.000Z | e3sm_to_cmip/cmor_handlers/zos.py | xylar/e3sm_to_cmip | 4fbe8fc91475eae26df839d0cd8062c4b8dc16ae | [
"MIT"
] | 91 | 2018-05-02T21:11:30.000Z | 2022-03-30T20:25:07.000Z | e3sm_to_cmip/cmor_handlers/zos.py | xylar/e3sm_to_cmip | 4fbe8fc91475eae26df839d0cd8062c4b8dc16ae | [
"MIT"
] | 7 | 2018-05-15T02:07:34.000Z | 2021-06-30T18:20:33.000Z |
"""
compute Sea Surface Height Above Geoid, zos
"""
from __future__ import absolute_import, division, print_function
import xarray
import logging
from e3sm_to_cmip import mpas
from e3sm_to_cmip.util import print_message
# 'MPAS' as a placeholder for raw variables needed
RAW_VARIABLES = ['MPASO', 'MPAS_mesh', 'MPAS_... | 28.233333 | 76 | 0.648564 |
from __future__ import absolute_import, division, print_function
import xarray
import logging
from e3sm_to_cmip import mpas
from e3sm_to_cmip.util import print_message
RAW_VARIABLES = ['MPASO', 'MPAS_mesh', 'MPAS_map']
VAR_NAME = 'zos'
VAR_UNITS = 'm'
TABLE = 'CMIP6_Omon.json'
def handle(infiles, tables, user_... | true | true |
f719619a72f865368354a85f0cae0766341013ef | 1,087 | py | Python | supports/mover-performance-test/run_ssm_mover.py | MajorJason/SSM | 3341585165ac10a47ddeed0e1d5e2467db482b99 | [
"Apache-2.0"
] | 199 | 2017-04-19T06:37:24.000Z | 2022-03-31T12:14:22.000Z | supports/mover-performance-test/run_ssm_mover.py | Dam1029/SSM | d459811728980258f4ebd0b81022620b750863fe | [
"Apache-2.0"
] | 1,091 | 2017-04-14T07:09:55.000Z | 2022-01-20T11:15:54.000Z | supports/mover-performance-test/run_ssm_mover.py | Dam1029/SSM | d459811728980258f4ebd0b81022620b750863fe | [
"Apache-2.0"
] | 170 | 2017-04-14T03:45:30.000Z | 2022-03-31T12:14:24.000Z | import sys
import time
from util import *
size = sys.argv[1]
num = sys.argv[2]
#The data dir is named by case. Please see prepare.sh
case = size + "_" + num
log = sys.argv[3]
#Either "allssd" or "alldisk"
action = sys.argv[4]
if action == "allssd":
rid = submit_rule("file: path matches \"/" + case + "/*\"| allss... | 24.155556 | 72 | 0.678933 | import sys
import time
from util import *
size = sys.argv[1]
num = sys.argv[2]
case = size + "_" + num
log = sys.argv[3]
action = sys.argv[4]
if action == "allssd":
rid = submit_rule("file: path matches \"/" + case + "/*\"| allssd")
elif action == "alldisk":
rid = submit_rule("file: path matches \"/" + cas... | true | true |
f71962cca1d8ea20c86aa01378d38c3db9829b67 | 9,032 | py | Python | example_conda_pkg/descriptors.py | dajtmullaj/example_conda_pkg | 7c2bf657d14c714608e653d7218fa3cd658a6297 | [
"MIT"
] | null | null | null | example_conda_pkg/descriptors.py | dajtmullaj/example_conda_pkg | 7c2bf657d14c714608e653d7218fa3cd658a6297 | [
"MIT"
] | null | null | null | example_conda_pkg/descriptors.py | dajtmullaj/example_conda_pkg | 7c2bf657d14c714608e653d7218fa3cd658a6297 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat Oct 3 21:21:19 2020
Project: chemplot (Chemical Space Visualization)
Content: Descriptor operation methods
@author: murat cihan sorkun
"""
from rdkit import Chem
from rdkit.Chem import AllChem
import pandas as pd
import math
import mordred
from mordred import Calculator, d... | 39.441048 | 206 | 0.704052 |
from rdkit import Chem
from rdkit.Chem import AllChem
import pandas as pd
import math
import mordred
from mordred import Calculator, descriptors
from sklearn.linear_model import Lasso, LogisticRegression
from sklearn.feature_selection import SelectFromModel
from sklearn.preprocessing import StandardScaler
def get_m... | true | true |
f71962fa2355f2d2493a845f387b9126cf69d7d6 | 69,118 | py | Python | neutron/tests/unit/api/v2/test_base.py | mcadariu/neutron | 35494af5a25efb8b314941ab85b44923654f6acc | [
"Apache-2.0"
] | 1 | 2018-07-04T07:59:31.000Z | 2018-07-04T07:59:31.000Z | neutron/tests/unit/api/v2/test_base.py | ljzjohnson/neutron | d78664321482c15981a09642985a540195e754e3 | [
"Apache-2.0"
] | null | null | null | neutron/tests/unit/api/v2/test_base.py | ljzjohnson/neutron | d78664321482c15981a09642985a540195e754e3 | [
"Apache-2.0"
] | 1 | 2018-08-28T17:13:16.000Z | 2018-08-28T17:13:16.000Z | # Copyright (c) 2012 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | 42.017021 | 79 | 0.589036 |
import os
import mock
from neutron_lib.api import attributes
from neutron_lib.api import converters
from neutron_lib.callbacks import registry
from neutron_lib import constants
from neutron_lib import context
from neutron_lib import exceptions as n_exc
from neutron_lib import fixture
from neutron_lib.pl... | true | true |
f719631a516cc8db5629534c7d6fe3350cae0be1 | 30,892 | py | Python | tests/integrate_test/samples/sample_builtin/0_0_5/governance/governance.py | bayeshack2016/icon-service | 36cab484d2e41548d7f2f74526f127ee3a4423fc | [
"Apache-2.0"
] | 52 | 2018-08-24T02:28:43.000Z | 2021-07-06T04:44:22.000Z | tests/integrate_test/samples/sample_builtin/0_0_5/governance/governance.py | bayeshack2016/icon-service | 36cab484d2e41548d7f2f74526f127ee3a4423fc | [
"Apache-2.0"
] | 62 | 2018-09-17T06:59:16.000Z | 2021-12-15T06:02:51.000Z | tests/integrate_test/samples/sample_builtin/0_0_5/governance/governance.py | bayeshack2016/icon-service | 36cab484d2e41548d7f2f74526f127ee3a4423fc | [
"Apache-2.0"
] | 35 | 2018-09-14T02:42:10.000Z | 2022-02-05T10:34:46.000Z | # -*- coding: utf-8 -*-
# Copyright 2018 ICON Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 36.515366 | 109 | 0.605529 |
from iconservice import *
TAG = 'Governance'
DEBUG = False
CURRENT = 'current'
NEXT = 'next'
STATUS = 'status'
DEPLOY_TX_HASH = 'deployTxHash'
AUDIT_TX_HASH = 'auditTxHash'
VALID_STATUS_KEYS = [STATUS, DEPLOY_TX_HASH, AUDIT_TX_HASH]
STATUS_PENDING = 'pending'
STATUS_ACTIVE = 'active'
STATUS_INACTIVE ... | true | true |
f719631ce5568ca0573b1aff26b681add708c145 | 5,186 | py | Python | lib/matplotlib/backends/qt_compat.py | pmarshwx/matplotlib | 12be528dbf2114f7c25abf60de8100cb2d4494af | [
"MIT",
"BSD-3-Clause"
] | null | null | null | lib/matplotlib/backends/qt_compat.py | pmarshwx/matplotlib | 12be528dbf2114f7c25abf60de8100cb2d4494af | [
"MIT",
"BSD-3-Clause"
] | null | null | null | lib/matplotlib/backends/qt_compat.py | pmarshwx/matplotlib | 12be528dbf2114f7c25abf60de8100cb2d4494af | [
"MIT",
"BSD-3-Clause"
] | null | null | null | """ A Qt API selector that can be used to switch between PyQt and PySide.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import os
from matplotlib import rcParams, verbose
# Available APIs.
QT_API_PYQT = 'PyQt4' # API is not set here;... | 33.895425 | 79 | 0.642885 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import os
from matplotlib import rcParams, verbose
QT_API_PYQT = 'PyQt4'
QT_API_PYQTv2 = 'PyQt4v2'
QT_API_PYSIDE = 'PySide'
QT_API_PYQT5 = 'PyQt5'
ETS = dict(pyqt=(QT_API_PYQ... | true | true |
f71963b2a8fde56239fbbd548e6a4f71526ae07c | 70,771 | py | Python | controllers/req.py | waidyanatha/deprecated.sambro-eden | 62e180703a2f16d5f8fcd532335d8287b76a8175 | [
"MIT"
] | 1 | 2016-12-22T09:31:22.000Z | 2016-12-22T09:31:22.000Z | controllers/req.py | waidyanatha/deprecated.sambro-eden | 62e180703a2f16d5f8fcd532335d8287b76a8175 | [
"MIT"
] | null | null | null | controllers/req.py | waidyanatha/deprecated.sambro-eden | 62e180703a2f16d5f8fcd532335d8287b76a8175 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Request Management
"""
module = request.controller
resourcename = request.function
if not settings.has_module(module):
raise HTTP(404, body="Module disabled: %s" % module)
# -----------------------------------------------------------------------------
def index():
""" Module'... | 41.9508 | 145 | 0.445889 |
module = request.controller
resourcename = request.function
if not settings.has_module(module):
raise HTTP(404, body="Module disabled: %s" % module)
def index():
return s3db.cms_index(module, alt_function="index_alt")
def index_alt():
redirect(URL(f="req", args=["search"]))
def is_affiliate... | true | true |
f7196479819c081e316242e97b6c71d0635143b6 | 249 | py | Python | ACM/NAQ16/G.py | zzh8829/CompetitiveProgramming | 36f36b10269b4648ca8be0b08c2c49e96abede25 | [
"MIT"
] | 1 | 2017-10-01T00:51:39.000Z | 2017-10-01T00:51:39.000Z | ACM/NAQ16/G.py | zzh8829/CompetitiveProgramming | 36f36b10269b4648ca8be0b08c2c49e96abede25 | [
"MIT"
] | null | null | null | ACM/NAQ16/G.py | zzh8829/CompetitiveProgramming | 36f36b10269b4648ca8be0b08c2c49e96abede25 | [
"MIT"
] | null | null | null | sa = input()
la = len(sa)
a = int(sa)
import math
num = 0
i = 0
while True:
i += 1
num += math.log10(i)
if(math.ceil(num) >= la- 100):
print(i, num, la)
if(math.ceil(num) == la):
print(i)
if(math.ceil(num) > la):
break
| 10.375 | 32 | 0.522088 | sa = input()
la = len(sa)
a = int(sa)
import math
num = 0
i = 0
while True:
i += 1
num += math.log10(i)
if(math.ceil(num) >= la- 100):
print(i, num, la)
if(math.ceil(num) == la):
print(i)
if(math.ceil(num) > la):
break
| true | true |
f719651f1696393c8cda5badd8ce6c3c1ce02286 | 3,397 | py | Python | browser_history/cli.py | RobertWetzler/browser-history | bce5438e8b697e9be70d3747d0b9835c6c1324bc | [
"Apache-2.0"
] | null | null | null | browser_history/cli.py | RobertWetzler/browser-history | bce5438e8b697e9be70d3747d0b9835c6c1324bc | [
"Apache-2.0"
] | null | null | null | browser_history/cli.py | RobertWetzler/browser-history | bce5438e8b697e9be70d3747d0b9835c6c1324bc | [
"Apache-2.0"
] | null | null | null | """This module defines functions and globals required for the
command line interface of browser-history."""
import sys
import argparse
from browser_history import get_history, generic, browsers, utils
# get list of all implemented browser by finding subclasses of generic.Browser
AVAILABLE_BROWSERS = ', '.join(b.__nam... | 37.32967 | 109 | 0.548719 |
import sys
import argparse
from browser_history import get_history, generic, browsers, utils
AVAILABLE_BROWSERS = ', '.join(b.__name__ for b in generic.Browser.__subclasses__())
AVAILABLE_FORMATS = ', '.join(generic.Outputs.formats)
def make_parser():
parser_ = argparse.ArgumentParser(description='''
... | true | true |
f7196672dac355b888cbfce65b0f4b2221ebe267 | 30,455 | py | Python | testing/test_basic.py | yaccz/pytest-twisted | 5dc4efc5d335da0172fec02e48076aacef4bf75d | [
"BSD-3-Clause"
] | null | null | null | testing/test_basic.py | yaccz/pytest-twisted | 5dc4efc5d335da0172fec02e48076aacef4bf75d | [
"BSD-3-Clause"
] | null | null | null | testing/test_basic.py | yaccz/pytest-twisted | 5dc4efc5d335da0172fec02e48076aacef4bf75d | [
"BSD-3-Clause"
] | null | null | null | import sys
import textwrap
import pytest
# https://docs.python.org/3/whatsnew/3.5.html#pep-492-coroutines-with-async-and-await-syntax
ASYNC_AWAIT = sys.version_info >= (3, 5)
# https://docs.python.org/3/whatsnew/3.6.html#pep-525-asynchronous-generators
ASYNC_GENERATORS = sys.version_info >= (3, 6)
timeout = 15
#... | 26.691499 | 125 | 0.663044 | import sys
import textwrap
import pytest
>= (3, 6)
timeout = 15
def force_plural(name):
if name in {"error", "warning"}:
return name + "s"
return name
def assert_outcomes(run_result, outcomes):
formatted_output = format_run_result_output_for_assert(run_result)
try:
result_out... | true | true |
f71966a40eb176b3c19c2ff7f010677d27b381e5 | 2,799 | py | Python | channel-api/tests/integration/conftest.py | xcantera/demo-provide-baseline | 985f391973fa6ca0761104b55077fded28f152fc | [
"CC0-1.0"
] | 3 | 2020-11-17T23:19:20.000Z | 2021-03-29T15:08:56.000Z | channel-api/tests/integration/conftest.py | xcantera/demo-provide-baseline | 985f391973fa6ca0761104b55077fded28f152fc | [
"CC0-1.0"
] | null | null | null | channel-api/tests/integration/conftest.py | xcantera/demo-provide-baseline | 985f391973fa6ca0761104b55077fded28f152fc | [
"CC0-1.0"
] | 1 | 2020-12-11T00:26:33.000Z | 2020-12-11T00:26:33.000Z | import pytest
from http import HTTPStatus
import urllib
import requests
from src import repos
from libtrustbridge.utils.conf import env_s3_config, env_queue_config, env
NOTIFICATIONS_REPO = env_queue_config('NOTIFICATIONS_REPO')
DELIVERY_OUTBOX_REPO = env_queue_config('DELIVERY_OUTBOX_REPO')
SUBSCRIPTIONS_REPO = env_... | 31.1 | 89 | 0.71597 | import pytest
from http import HTTPStatus
import urllib
import requests
from src import repos
from libtrustbridge.utils.conf import env_s3_config, env_queue_config, env
NOTIFICATIONS_REPO = env_queue_config('NOTIFICATIONS_REPO')
DELIVERY_OUTBOX_REPO = env_queue_config('DELIVERY_OUTBOX_REPO')
SUBSCRIPTIONS_REPO = env_... | true | true |
f71968c2bfbb4980fde3dad9d2991f5150aef9eb | 2,841 | py | Python | setup.py | blazelibs/blazeweb | b120a6a2e38c8b53da2b73443ff242e2d1438053 | [
"BSD-3-Clause"
] | null | null | null | setup.py | blazelibs/blazeweb | b120a6a2e38c8b53da2b73443ff242e2d1438053 | [
"BSD-3-Clause"
] | 6 | 2016-11-01T18:42:34.000Z | 2020-11-16T16:52:14.000Z | setup.py | blazelibs/blazeweb | b120a6a2e38c8b53da2b73443ff242e2d1438053 | [
"BSD-3-Clause"
] | 1 | 2020-01-22T18:20:46.000Z | 2020-01-22T18:20:46.000Z | import os
try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
# pip install -e .[develop]
develop_requires = [
'WebTest',
'ScriptTest',
'coverage',
'docutils',
'minimoc... | 28.128713 | 78 | 0.67793 | import os
try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
develop_requires = [
'WebTest',
'ScriptTest',
'coverage',
'docutils',
'minimock',
'nose',
]
cdir = o... | true | true |
f71969a63ad11dd00ce0c7b25f5d250f148a897c | 2,807 | py | Python | crossbaker/samples/declarative/signals/pytoqml1/main.py | josephkirk/MeshBaker | e4f75193074cc92d12f953d6cad3a2a599f63ead | [
"MIT"
] | null | null | null | crossbaker/samples/declarative/signals/pytoqml1/main.py | josephkirk/MeshBaker | e4f75193074cc92d12f953d6cad3a2a599f63ead | [
"MIT"
] | 5 | 2018-10-09T02:43:14.000Z | 2018-10-12T13:00:09.000Z | crossbaker/samples/declarative/signals/pytoqml1/main.py | josephkirk/CrossBaker | e4f75193074cc92d12f953d6cad3a2a599f63ead | [
"MIT"
] | null | null | null | #!/usr/bin/python
#############################################################################
##
## Copyright (C) 2016 The Qt Company Ltd.
## Contact: http://www.qt.io/licensing/
##
## This file is part of the Qt for Python examples of the Qt Toolkit.
##
## $QT_BEGIN_LICENSE:BSD$
## You may use this file under the t... | 38.452055 | 100 | 0.695048 | true | true | |
f7196a03c814613734c343483b20f67cde46b40d | 260 | py | Python | w02-calling-functions/checkpoint-boxes/boxes.py | carloswm85/2021-cs111-programming-with-functions | 73cc376e3f0de60aa0150d33ec95568d217096ec | [
"Unlicense"
] | null | null | null | w02-calling-functions/checkpoint-boxes/boxes.py | carloswm85/2021-cs111-programming-with-functions | 73cc376e3f0de60aa0150d33ec95568d217096ec | [
"Unlicense"
] | null | null | null | w02-calling-functions/checkpoint-boxes/boxes.py | carloswm85/2021-cs111-programming-with-functions | 73cc376e3f0de60aa0150d33ec95568d217096ec | [
"Unlicense"
] | null | null | null | import math
items = int(input("Enter the number of items: "))
items_box = int(input("Enter the number of items per box: "))
boxes = math.ceil(items / items_box)
print(f"For {items} items, packing {items_box} items in each box, you will need {boxes} boxes.") | 32.5 | 96 | 0.711538 | import math
items = int(input("Enter the number of items: "))
items_box = int(input("Enter the number of items per box: "))
boxes = math.ceil(items / items_box)
print(f"For {items} items, packing {items_box} items in each box, you will need {boxes} boxes.") | true | true |
f7196aad36071501a72c16f5e95b38ddb5f8950b | 902 | py | Python | turbo/turbo_encoder.py | DaulPavid/pyturbo | 878e0b1b514c043f1b4ea5cd5268b23c0df5192e | [
"MIT"
] | 9 | 2018-10-17T17:02:05.000Z | 2022-03-03T18:58:32.000Z | turbo/turbo_encoder.py | akshay230994/pyturbo | 878e0b1b514c043f1b4ea5cd5268b23c0df5192e | [
"MIT"
] | 2 | 2018-10-16T16:57:57.000Z | 2020-04-14T13:34:40.000Z | turbo/turbo_encoder.py | akshay230994/pyturbo | 878e0b1b514c043f1b4ea5cd5268b23c0df5192e | [
"MIT"
] | 4 | 2019-12-23T18:42:29.000Z | 2022-01-19T12:08:35.000Z | #
# Turbo Encoder
#
import numpy as np
from .rsc import RSC
class TurboEncoder:
def __init__(self, interleaver):
self.interleaver = interleaver
self.block_size = len(self.interleaver)
self.encoders = 2 * [RSC()]
def reset(self):
for e in self.encoders:
e.reset()
... | 25.055556 | 73 | 0.618625 |
import numpy as np
from .rsc import RSC
class TurboEncoder:
def __init__(self, interleaver):
self.interleaver = interleaver
self.block_size = len(self.interleaver)
self.encoders = 2 * [RSC()]
def reset(self):
for e in self.encoders:
e.reset()
def interlea... | true | true |
f7196b897dd7d74bfa6480c1e1542bf851614cfa | 534 | py | Python | src/package/scanner.py | buckler-project/armoury | 3d4c1bb9e8af190ba95d60d502b39699848d1e62 | [
"MIT"
] | 1 | 2019-02-02T06:21:21.000Z | 2019-02-02T06:21:21.000Z | src/package/scanner.py | buckler-project/armoury | 3d4c1bb9e8af190ba95d60d502b39699848d1e62 | [
"MIT"
] | 5 | 2019-01-28T00:59:15.000Z | 2019-01-31T10:35:36.000Z | src/package/scanner.py | buckler-project/armoury | 3d4c1bb9e8af190ba95d60d502b39699848d1e62 | [
"MIT"
] | null | null | null | from package import package
parent_path = '.scanners'
config_path = 'scanner.yml'
class Scanner(package.Package):
def __init__(self, url, name, auther):
super().__init__(url, name, auther)
self.parent_path = parent_path
self.config_path = config_path
class ScannerFactory(package.PackageF... | 26.7 | 57 | 0.694757 | from package import package
parent_path = '.scanners'
config_path = 'scanner.yml'
class Scanner(package.Package):
def __init__(self, url, name, auther):
super().__init__(url, name, auther)
self.parent_path = parent_path
self.config_path = config_path
class ScannerFactory(package.PackageF... | true | true |
f7196bd5fe213fbeb54a87c93b46f43e8cb1f118 | 2,742 | py | Python | inference_speed.py | wmcnally/evopose2d | ea05b818044d8d84e9cbbee778bc465be59ebd59 | [
"MIT"
] | 75 | 2020-11-18T05:07:42.000Z | 2022-03-27T03:25:16.000Z | inference_speed.py | wmcnally/evopose2d | ea05b818044d8d84e9cbbee778bc465be59ebd59 | [
"MIT"
] | 26 | 2020-11-29T17:45:44.000Z | 2022-03-22T15:30:31.000Z | inference_speed.py | wmcnally/evopose2d | ea05b818044d8d84e9cbbee778bc465be59ebd59 | [
"MIT"
] | 8 | 2020-11-25T02:59:53.000Z | 2022-03-27T10:53:59.000Z | import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import tensorflow as tf
from dataset.dataloader import load_tfds
from time import time
import argparse
from nets.simple_basline import SimpleBaseline
from nets.evopose2d import EvoPose
from nets.hrnet import HRNet
from utils import detect_hardware
def speed_test(stra... | 32.258824 | 82 | 0.610139 | import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import tensorflow as tf
from dataset.dataloader import load_tfds
from time import time
import argparse
from nets.simple_basline import SimpleBaseline
from nets.evopose2d import EvoPose
from nets.hrnet import HRNet
from utils import detect_hardware
def speed_test(stra... | true | true |
f7196c255322af385bffc89c3fcffebd8bcec16e | 8,295 | py | Python | tango/common/util.py | allenai/tango | 80c90caefae4ad1c3f8472718ddada912cd8fcf9 | [
"Apache-2.0"
] | 52 | 2021-09-24T17:52:34.000Z | 2022-03-29T22:55:02.000Z | tango/common/util.py | allenai/tango | 80c90caefae4ad1c3f8472718ddada912cd8fcf9 | [
"Apache-2.0"
] | 90 | 2021-09-29T04:23:29.000Z | 2022-03-31T21:23:02.000Z | tango/common/util.py | allenai/tango | 80c90caefae4ad1c3f8472718ddada912cd8fcf9 | [
"Apache-2.0"
] | 8 | 2021-11-13T01:56:22.000Z | 2022-02-27T03:29:42.000Z | import importlib
import pkgutil
import signal
import string
import sys
import traceback
from contextlib import contextmanager
from datetime import datetime, tzinfo
from pathlib import Path
from typing import Iterable, Optional, Set, Tuple, Union
import pytz
from .aliases import PathOrStr
from .exceptions import SigTe... | 31.067416 | 108 | 0.660277 | import importlib
import pkgutil
import signal
import string
import sys
import traceback
from contextlib import contextmanager
from datetime import datetime, tzinfo
from pathlib import Path
from typing import Iterable, Optional, Set, Tuple, Union
import pytz
from .aliases import PathOrStr
from .exceptions import SigTe... | true | true |
f7196d520e18090ae1a9e39c71b4703d717c0c07 | 184 | py | Python | ddq_1/lang/fol_quant.py | jadnohra/connect | 8eb21e6f122898094447bc3d5edb3053d5a2adf2 | [
"Unlicense"
] | null | null | null | ddq_1/lang/fol_quant.py | jadnohra/connect | 8eb21e6f122898094447bc3d5edb3053d5a2adf2 | [
"Unlicense"
] | 6 | 2021-03-19T12:06:56.000Z | 2022-03-12T00:23:09.000Z | ddq_1/lang/fol_quant.py | jadnohra/connect | 8eb21e6f122898094447bc3d5edb3053d5a2adf2 | [
"Unlicense"
] | null | null | null | '''
References:
- Symbolic Logic, Copi, p.396
'''
from .fol_lang import Wff, PropVarWff, BinaryWff, PropositionalVariable, NegWff
class QuantRule:
def applies_to():
pass | 18.4 | 79 | 0.701087 | from .fol_lang import Wff, PropVarWff, BinaryWff, PropositionalVariable, NegWff
class QuantRule:
def applies_to():
pass | true | true |
f7196e814752cab4ff82754c55fd3672bc8fd585 | 29,282 | py | Python | google/ads/google_ads/v6/proto/resources/ad_group_pb2.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v6/proto/resources/ad_group_pb2.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v6/proto/resources/ad_group_pb2.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads/v6/resources/ad_group.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection... | 73.205 | 4,007 | 0.800287 |
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default()
from google.ads.google_ads.v6.proto.common import custom... | true | true |
f719701d150a3482167aae75965a980e8a9f516b | 2,199 | py | Python | backend/wazzle_33192/urls.py | crowdbotics-apps/wazzle-33192 | 6203ab17b0c80344f1b15d1d5452bfdd2e6559bd | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/wazzle_33192/urls.py | crowdbotics-apps/wazzle-33192 | 6203ab17b0c80344f1b15d1d5452bfdd2e6559bd | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/wazzle_33192/urls.py | crowdbotics-apps/wazzle-33192 | 6203ab17b0c80344f1b15d1d5452bfdd2e6559bd | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """wazzle_33192 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-... | 34.904762 | 87 | 0.710778 |
from django.contrib import admin
from django.urls import path, include, re_path
from django.views.generic.base import TemplateView
from allauth.account.views import confirm_email
from rest_framework import permissions
from drf_yasg.views import get_schema_view
from drf_yasg import openapi
urlpatterns = [
path("",... | true | true |
f71970c5e8e3cf8ece041b681a8768c3ae4e47b1 | 1,079 | py | Python | codenerix_pos/admin.py | centrologic/django-codenerix-pos | 449c54971c510aba2326797ab7aaf3a0b5f6c3ab | [
"Apache-2.0"
] | 3 | 2017-07-19T15:24:26.000Z | 2017-12-22T01:35:28.000Z | codenerix_pos/admin.py | centrologic/django-codenerix-pos | 449c54971c510aba2326797ab7aaf3a0b5f6c3ab | [
"Apache-2.0"
] | null | null | null | codenerix_pos/admin.py | centrologic/django-codenerix-pos | 449c54971c510aba2326797ab7aaf3a0b5f6c3ab | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# django-codenerix-pos
#
# Codenerix GNU
#
# Project URL : http://www.codenerix.com
#
# 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/license... | 31.735294 | 114 | 0.776645 |
from django.contrib import admin
from .models import POS, POSSlot, POSPlant, POSZone, POSProduct, POSHardware, POSOperator, POSLog, POSGroupProduct
admin.site.register(POSPlant)
admin.site.register(POSZone)
admin.site.register(POSHardware)
admin.site.register(POSGroupProduct)
admin.site.register(P... | true | true |
f71970cd94b344b2aafb1578c85a08cee5366ca7 | 20,090 | py | Python | script.py | lawlie8/Mr.Hyde | c3d2c04de6343580b4b14cbd2319737ed0b3a73e | [
"MIT"
] | 3 | 2020-06-04T10:02:35.000Z | 2020-06-05T11:44:02.000Z | script.py | lawlie8/Mr.Hyde | c3d2c04de6343580b4b14cbd2319737ed0b3a73e | [
"MIT"
] | null | null | null | script.py | lawlie8/Mr.Hyde | c3d2c04de6343580b4b14cbd2319737ed0b3a73e | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import tkinter as tk
from tkinter import *
from tkinter.ttk import *
from Crypto import Random
from Crypto.Cipher import AES
from Crypto.Hash import SHA256
import os
import os.path
from os import listdir
from os.path import isfile, join
#import time
import ctypes
#import threading
import hashlib
impo... | 49.482759 | 318 | 0.541563 |
import tkinter as tk
from tkinter import *
from tkinter.ttk import *
from Crypto import Random
from Crypto.Cipher import AES
from Crypto.Hash import SHA256
import os
import os.path
from os import listdir
from os.path import isfile, join
import ctypes
import hashlib
import random
import binascii
try:
def is_admi... | true | true |
f719721f94c03312a66a5dd67b5e3f239bdd431b | 1,925 | py | Python | setup.py | unclemedia0/phasiakon | fe6cef9b8c3d8f7da0a9ef3b18f9c2ea0ec08dc0 | [
"MIT"
] | null | null | null | setup.py | unclemedia0/phasiakon | fe6cef9b8c3d8f7da0a9ef3b18f9c2ea0ec08dc0 | [
"MIT"
] | null | null | null | setup.py | unclemedia0/phasiakon | fe6cef9b8c3d8f7da0a9ef3b18f9c2ea0ec08dc0 | [
"MIT"
] | null | null | null | from distutils.core import setup
try:
with open("README.md","r") as fh:
long_description = fh.read()
except:
long_description = 'Taxation7% by UncleMedia'
setup(
name = 'phasiakon', # How you named your package folder (MyLib)
packages = ['phasiakon'], # Chose the same as "name"
vers... | 55 | 147 | 0.660779 | from distutils.core import setup
try:
with open("README.md","r") as fh:
long_description = fh.read()
except:
long_description = 'Taxation7% by UncleMedia'
setup(
name = 'phasiakon',
packages = ['phasiakon'],
version = '0.1',
license='MIT',
description = 'Taxation7%... | true | true |
f719733841763fd63a92a93738e9a161aaffbe6e | 4,753 | py | Python | momus/VHRED/split-examples-by-token.py | ourDirection/ourDirection | b99ed67a8cc0fe5016e03fe3b5ad083b7f8bbdc0 | [
"Apache-2.0"
] | null | null | null | momus/VHRED/split-examples-by-token.py | ourDirection/ourDirection | b99ed67a8cc0fe5016e03fe3b5ad083b7f8bbdc0 | [
"Apache-2.0"
] | null | null | null | momus/VHRED/split-examples-by-token.py | ourDirection/ourDirection | b99ed67a8cc0fe5016e03fe3b5ad083b7f8bbdc0 | [
"Apache-2.0"
] | null | null | null | """
Takes as input a binarized dialogue corpus, splits the examples by a certain token and shuffles it
Example run:
python split-examples-by-token.py Training.dialogues.pkl 2 Training_SplitByDialogues.dialogues --join_last_two_examples
@author Iulian Vlad Serban
"""
import collections
import numpy
import math
im... | 35.736842 | 208 | 0.722281 |
import collections
import numpy
import math
import operator
import os
import sys
import logging
import cPickle
from collections import Counter
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger('text2dict')
def safe_pickle(obj, filename):
if os.path.isfile(filename):
logger.info("Overwri... | true | true |
f719736b5b137de7082002cec486dbcda1835bae | 1,497 | py | Python | tapis_cli/commands/taccapis/v2/systems/roles_show.py | shwetagopaul92/tapis-cli-ng | 6f424b8352c0d034d4f5547fac21d5c8dd097a7f | [
"BSD-3-Clause"
] | null | null | null | tapis_cli/commands/taccapis/v2/systems/roles_show.py | shwetagopaul92/tapis-cli-ng | 6f424b8352c0d034d4f5547fac21d5c8dd097a7f | [
"BSD-3-Clause"
] | null | null | null | tapis_cli/commands/taccapis/v2/systems/roles_show.py | shwetagopaul92/tapis-cli-ng | 6f424b8352c0d034d4f5547fac21d5c8dd097a7f | [
"BSD-3-Clause"
] | null | null | null | from agavepy.agave import AgaveError
from tapis_cli.display import Verbosity
from tapis_cli.clients.services.mixins import ServiceIdentifier, Username
from . import API_NAME, SERVICE_VERSION
from .models import SystemRole
from .formatters import SystemsFormatOne
__all__ = ['SystemsRolesShow']
class SystemsRolesShow... | 33.266667 | 79 | 0.669339 | from agavepy.agave import AgaveError
from tapis_cli.display import Verbosity
from tapis_cli.clients.services.mixins import ServiceIdentifier, Username
from . import API_NAME, SERVICE_VERSION
from .models import SystemRole
from .formatters import SystemsFormatOne
__all__ = ['SystemsRolesShow']
class SystemsRolesShow... | true | true |
f719761c09d3fa035769e8bee81a2d948a8ad1b9 | 255 | py | Python | tests/test_example.py | skylifewww/handball | 853190e44037086b7749cb8f62d9df6577b379fd | [
"MIT"
] | null | null | null | tests/test_example.py | skylifewww/handball | 853190e44037086b7749cb8f62d9df6577b379fd | [
"MIT"
] | null | null | null | tests/test_example.py | skylifewww/handball | 853190e44037086b7749cb8f62d9df6577b379fd | [
"MIT"
] | null | null | null | from handball.core.test import TestCase
from handball.users.factories import UserFactory
class TestExample(TestCase):
def test_example(self):
UserFactory()
resp = self.client.get('/')
self.assertEqual(resp.status_code, 200)
| 23.181818 | 48 | 0.709804 | from handball.core.test import TestCase
from handball.users.factories import UserFactory
class TestExample(TestCase):
def test_example(self):
UserFactory()
resp = self.client.get('/')
self.assertEqual(resp.status_code, 200)
| true | true |
f719771bdcfb47ab5315aba6e6e1b06f312f1af0 | 792 | py | Python | samples/client/petstore/python-experimental/test/test_parent.py | MalcolmScoffable/openapi-generator | 73605a0c0e0c825286c95123c63678ba75b44d5c | [
"Apache-2.0"
] | 4 | 2020-07-24T07:02:57.000Z | 2022-01-08T17:37:38.000Z | samples/client/petstore/python-experimental/test/test_parent.py | MalcolmScoffable/openapi-generator | 73605a0c0e0c825286c95123c63678ba75b44d5c | [
"Apache-2.0"
] | 7 | 2021-05-12T00:00:20.000Z | 2022-02-27T11:23:35.000Z | samples/client/petstore/python-experimental/test/test_parent.py | MalcolmScoffable/openapi-generator | 73605a0c0e0c825286c95123c63678ba75b44d5c | [
"Apache-2.0"
] | 2 | 2020-04-24T15:18:41.000Z | 2021-12-07T09:39:40.000Z | # coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
... | 20.842105 | 174 | 0.667929 |
from __future__ import absolute_import
import unittest
import petstore_api
class TestParent(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def testParent(self):
s
if __name__ == '__main__':
unittest.main()
| true | true |
f71977e9459670b106619a17c0921c378ddd8285 | 166 | py | Python | tests/model_control/detailed/transf_Quantization/model_control_one_enabled_Quantization_LinearTrend_Seasonal_Hour_SVR.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | tests/model_control/detailed/transf_Quantization/model_control_one_enabled_Quantization_LinearTrend_Seasonal_Hour_SVR.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 1 | 2019-11-30T23:39:38.000Z | 2019-12-01T04:34:35.000Z | tests/model_control/detailed/transf_Quantization/model_control_one_enabled_Quantization_LinearTrend_Seasonal_Hour_SVR.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Quantization'] , ['LinearTrend'] , ['Seasonal_Hour'] , ['SVR'] ); | 41.5 | 88 | 0.759036 | import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Quantization'] , ['LinearTrend'] , ['Seasonal_Hour'] , ['SVR'] ); | true | true |
f71979aaf903ff6353153012c1f5c64b155b2d5a | 6,406 | py | Python | libs/python/multicore_sorted/drafts/py_merge/multicore_sorted.py | denis-ryzhkov/antiques | 6a67bf606c1b49cc413df26bfdf00d392b605f88 | [
"MIT"
] | null | null | null | libs/python/multicore_sorted/drafts/py_merge/multicore_sorted.py | denis-ryzhkov/antiques | 6a67bf606c1b49cc413df26bfdf00d392b605f88 | [
"MIT"
] | null | null | null | libs/python/multicore_sorted/drafts/py_merge/multicore_sorted.py | denis-ryzhkov/antiques | 6a67bf606c1b49cc413df26bfdf00d392b605f88 | [
"MIT"
] | null | null | null | """
>>> DRAFT "py_merge"! <<<
Builtin "sorted()" function, but using all CPU cores available for speedup!
It supports all kwargs of "sorted()": "cmp", "key" and "reverse",
however items of "iterable" and all of these kwargs should be picklable:
https://docs.python.org/2/library/pickle.html#what-can-be-pickled-and-unp... | 28.471111 | 118 | 0.635498 | ted']
nctools import cmp_to_key
from multiprocessing import cpu_count, Pool
= kwargs.pop('processes', None)
if processes is None:
try:
processes = cpu_count()
except NotImplementedError:
processes = 1
if processes < 2:
return sorted(iterable, **kwargs)
... | true | true |
f7197a79112a1c5cebafd40d2898d9834ee03a99 | 15,162 | py | Python | test/simulator_tests/birth_death_simulator_test.py | YosefLab/SingleCellLineageTracing | d9133fc80c8314e7935fde037dd86111cac47447 | [
"MIT"
] | 52 | 2019-05-14T02:06:24.000Z | 2022-03-27T05:22:56.000Z | test/simulator_tests/birth_death_simulator_test.py | sbradford2/Cassiopeia | 010072b307f7eadbf10dc4af8b2165e48f1736a7 | [
"MIT"
] | 88 | 2019-06-07T15:07:45.000Z | 2022-03-22T14:40:03.000Z | test/simulator_tests/birth_death_simulator_test.py | sbradford2/Cassiopeia | 010072b307f7eadbf10dc4af8b2165e48f1736a7 | [
"MIT"
] | 17 | 2019-05-17T00:46:16.000Z | 2022-03-25T00:39:18.000Z | import unittest
import networkx as nx
import numpy as np
from typing import List, Tuple
from cassiopeia.data.CassiopeiaTree import CassiopeiaTree
from cassiopeia.mixins import TreeSimulatorError
from cassiopeia.simulator.BirthDeathFitnessSimulator import (
BirthDeathFitnessSimulator,
)
import cassiopeia.data.u... | 36.186158 | 80 | 0.595502 | import unittest
import networkx as nx
import numpy as np
from typing import List, Tuple
from cassiopeia.data.CassiopeiaTree import CassiopeiaTree
from cassiopeia.mixins import TreeSimulatorError
from cassiopeia.simulator.BirthDeathFitnessSimulator import (
BirthDeathFitnessSimulator,
)
import cassiopeia.data.u... | true | true |
f7197adb438e0099947d4309aa51de3f15e7c419 | 2,615 | py | Python | src/sparkload.py | jbalint/spark | caccf1cd9122dd4a7dc0f26a57ee4a649056aa6f | [
"CNRI-Jython"
] | 1 | 2015-05-21T20:00:12.000Z | 2015-05-21T20:00:12.000Z | src/sparkload.py | jbalint/spark | caccf1cd9122dd4a7dc0f26a57ee4a649056aa6f | [
"CNRI-Jython"
] | null | null | null | src/sparkload.py | jbalint/spark | caccf1cd9122dd4a7dc0f26a57ee4a649056aa6f | [
"CNRI-Jython"
] | null | null | null | #!/usr/bin/env jython
#*****************************************************************************#
#* Copyright (c) 2004-2008, SRI International. *#
#* All rights reserved. *#
#* ... | 70.675676 | 80 | 0.518164 |
al.version import *
from spark.main import main
| true | true |
f7197b8026a171a1b01fc519f2c5d4c23b3f4e4d | 7,153 | py | Python | tests/test_other_scripts.py | vaibhavad/ParlAI | 8960fab4cb7b7063df6023d8734adc8881dfed6e | [
"MIT"
] | 2 | 2017-09-20T21:49:51.000Z | 2018-08-12T06:58:10.000Z | tests/test_other_scripts.py | vaibhavad/ParlAI | 8960fab4cb7b7063df6023d8734adc8881dfed6e | [
"MIT"
] | 1 | 2021-01-22T08:11:01.000Z | 2021-01-22T08:11:01.000Z | tests/test_other_scripts.py | vaibhavad/ParlAI | 8960fab4cb7b7063df6023d8734adc8881dfed6e | [
"MIT"
] | 1 | 2021-01-07T11:45:03.000Z | 2021-01-07T11:45:03.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Catch all for a number of "other" scripts.
"""
import os
import unittest
import parlai.utils.testing as testing_uti... | 35.063725 | 87 | 0.562282 |
import os
import unittest
import parlai.utils.testing as testing_utils
class TestConvertToParlaiFormat(unittest.TestCase):
def test_convert(self):
from parlai.scripts.convert_data_to_parlai_format import (
ConvertDataToParlaiFormat,
)
with testing_utils.tempdir() as tmp... | true | true |
f7197c8fd871714cbb61cb9b004d8a0b6f5dd33a | 1,297 | py | Python | sr700api/utils.py | AlexGS74/sr700api | 22fc79c0e02ef66f4ef92f9c8b4a56c04fe09c4a | [
"MIT"
] | 5 | 2017-10-15T21:58:55.000Z | 2020-09-02T05:12:32.000Z | sr700api/utils.py | AlexGS74/sr700api | 22fc79c0e02ef66f4ef92f9c8b4a56c04fe09c4a | [
"MIT"
] | null | null | null | sr700api/utils.py | AlexGS74/sr700api | 22fc79c0e02ef66f4ef92f9c8b4a56c04fe09c4a | [
"MIT"
] | 1 | 2018-08-25T23:27:53.000Z | 2018-08-25T23:27:53.000Z | """
MIT License
Copyright (c) 2017 int3ll3ct.ly@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge,... | 40.53125 | 78 | 0.781033 | def f_to_c(deg_f):
return (deg_f - 32.0)/1.8
def c_to_f(deg_c):
return deg_c * 1.8 + 32.0
| true | true |
f7197ce5cfde61155bd0c88a6aa247110b8af814 | 10,671 | py | Python | tests/test_camera.py | netmanchris/abodepy | cd7b5527cc2becd12763d949057fe0184e0395d2 | [
"MIT"
] | null | null | null | tests/test_camera.py | netmanchris/abodepy | cd7b5527cc2becd12763d949057fe0184e0395d2 | [
"MIT"
] | null | null | null | tests/test_camera.py | netmanchris/abodepy | cd7b5527cc2becd12763d949057fe0184e0395d2 | [
"MIT"
] | null | null | null | """Test the Abode camera class."""
import os
import unittest
import requests_mock
import abodepy
import abodepy.helpers.constants as CONST
import tests.mock as MOCK
import tests.mock.devices.ir_camera as IRCAMERA
import tests.mock.login as LOGIN
import tests.mock.oauth_claims as OAUTH_CLAIMS
import tests.mock.logout ... | 37.181185 | 79 | 0.607722 | import os
import unittest
import requests_mock
import abodepy
import abodepy.helpers.constants as CONST
import tests.mock as MOCK
import tests.mock.devices.ir_camera as IRCAMERA
import tests.mock.login as LOGIN
import tests.mock.oauth_claims as OAUTH_CLAIMS
import tests.mock.logout as LOGOUT
import tests.mock.panel a... | true | true |
f7197da9b6e226e3c5a5e47bd5f775747c208e82 | 13,187 | py | Python | kws_streaming/train/train.py | ssccutyy/KWS-Transformer | 7ae6d2e8fce1a293d88eedc0dbfacae726151a08 | [
"Apache-2.0"
] | 1 | 2022-03-13T07:52:15.000Z | 2022-03-13T07:52:15.000Z | kws_streaming/train/train.py | ssccutyy/KWS-Transformer | 7ae6d2e8fce1a293d88eedc0dbfacae726151a08 | [
"Apache-2.0"
] | null | null | null | kws_streaming/train/train.py | ssccutyy/KWS-Transformer | 7ae6d2e8fce1a293d88eedc0dbfacae726151a08 | [
"Apache-2.0"
] | 1 | 2022-03-11T12:33:27.000Z | 2022-03-11T12:33:27.000Z | # coding=utf-8
# Copyright (c) 2021, Arm Limited and Contributors.
# SPDX-License-Identifier: Apache-2.0
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Lic... | 42.401929 | 159 | 0.705543 |
import json
from types import SimpleNamespace
import os.path
import pprint
from absl import logging
import numpy as np
import tensorflow.compat.v1 as tf
import tensorflow_addons as tfa
import kws_streaming.data.input_data as input_data
from kws_streaming.models import models
from kws_streaming.models i... | true | true |
f7197ec8accb7480f7e6eca284267bccdb20df57 | 5,965 | py | Python | test/functional/rpc_users.py | mrmikeo/GAU-Core | 6f56bb73d0736a4245c22391314d6ba55de0e0d8 | [
"MIT"
] | 2 | 2020-08-25T18:02:32.000Z | 2021-08-23T09:40:41.000Z | test/functional/rpc_users.py | mrmikeo/GAU-Core | 6f56bb73d0736a4245c22391314d6ba55de0e0d8 | [
"MIT"
] | null | null | null | test/functional/rpc_users.py | mrmikeo/GAU-Core | 6f56bb73d0736a4245c22391314d6ba55de0e0d8 | [
"MIT"
] | 2 | 2020-08-06T20:56:42.000Z | 2020-11-23T03:11:17.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test multiple RPC users."""
from test_framework.test_framework import BitcoinTestFramework
from test_f... | 38.733766 | 129 | 0.61425 |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import str_to_b64str, assert_equal
import os
import http.client
import urllib.parse
class HTTPBasicsTest (BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 2
def setup_chain(self):
su... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.