hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | 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 209 | max_issues_repo_name stringlengths 5 121 | 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 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2d15090890b5f8c08420208655d93187f3798213 | 17,364 | py | Python | python/craftassist/mc_memory.py | anoushkt/craftassist | c200af65e52e800f0f0cc540fe836b644383349d | [
"MIT"
] | 1 | 2021-04-13T06:01:03.000Z | 2021-04-13T06:01:03.000Z | python/craftassist/mc_memory.py | anoushkt/craftassist | c200af65e52e800f0f0cc540fe836b644383349d | [
"MIT"
] | null | null | null | python/craftassist/mc_memory.py | anoushkt/craftassist | c200af65e52e800f0f0cc540fe836b644383349d | [
"MIT"
] | null | null | null | """
Copyright (c) Facebook, Inc. and its affiliates.
"""
import os
import random
import sys
from typing import Optional, List
from build_utils import npy_to_blocks_list
import minecraft_specs
import dance
PERCEPTION_RANGE = 64
BASE_AGENT_ROOT = os.path.join(os.path.dirname(__file__), "..")
sys.path.append(BASE_AGENT_... | 37.023454 | 161 | 0.580396 |
a6d1e27896fa24a1e2aab87d859a10cb3c0ad47d | 229 | py | Python | examples/include_no_requirements.py | f0k/tqdm | ebda7120efef500f6a7c8dea80e5ea6f47090803 | [
"MIT"
] | 1 | 2019-02-01T04:33:53.000Z | 2019-02-01T04:33:53.000Z | examples/include_no_requirements.py | f0k/tqdm | ebda7120efef500f6a7c8dea80e5ea6f47090803 | [
"MIT"
] | 6 | 2019-09-10T14:12:32.000Z | 2020-02-26T15:50:56.000Z | examples/include_no_requirements.py | f0k/tqdm | ebda7120efef500f6a7c8dea80e5ea6f47090803 | [
"MIT"
] | 1 | 2020-06-27T07:34:32.000Z | 2020-06-27T07:34:32.000Z | # How to import tqdm without enforcing it as a dependency
try:
from tqdm import tqdm
except ImportError:
def tqdm(*args, **kwargs):
if args:
return args[0]
return kwargs.get('iterable', None)
| 22.9 | 57 | 0.633188 |
2c2f7f5e0dd541f194455f77238fcea00268fdcb | 297 | py | Python | dump/callback_compile.py | conductiveIT/pymunk-1 | 61de8b2e652503356ac14a2d648cc11aa6a8070f | [
"MIT"
] | 670 | 2015-01-01T19:10:15.000Z | 2022-03-29T23:05:47.000Z | dump/callback_compile.py | reter695/pymunk | 9e9d3bf14cd57f61006588b1c56fefc21b453733 | [
"MIT"
] | 122 | 2015-01-02T19:06:19.000Z | 2022-03-20T19:44:25.000Z | dump/callback_compile.py | reter695/pymunk | 9e9d3bf14cd57f61006588b1c56fefc21b453733 | [
"MIT"
] | 222 | 2015-01-28T03:34:52.000Z | 2022-03-27T06:44:52.000Z | import os
os.system("gcc -mrtd -O3 -shared -fno-omit-frame-pointer -std=gnu99 -fPIC -ffast-math -m32 -c callback.c")
#os.system("gcc -O1 -std=gnu99 -fPIC -ffast-math -c callback.c")
#os.system("gcc -dynamiclib ex.o -o libex.dylib")
os.system("gcc -shared -mrtd callback.o -o callback.dll")
| 42.428571 | 107 | 0.690236 |
d8a747e460706c434dfedfb56f1adc27134824c4 | 4,678 | py | Python | models/Mobile_Net_V3_SSD.py | chuliuT/MobileNet_V3_SSD.pytorch | f28e38fd197e8eff72346dc70f2b8430111edac1 | [
"MIT"
] | 4 | 2020-04-01T02:17:04.000Z | 2022-01-16T07:17:28.000Z | models/Mobile_Net_V3_SSD.py | chuliuT/MobileNet_V3_SSD.pytorch | f28e38fd197e8eff72346dc70f2b8430111edac1 | [
"MIT"
] | null | null | null | models/Mobile_Net_V3_SSD.py | chuliuT/MobileNet_V3_SSD.pytorch | f28e38fd197e8eff72346dc70f2b8430111edac1 | [
"MIT"
] | 5 | 2020-01-07T03:52:46.000Z | 2020-05-17T12:36:11.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from layers import *
from data import coco,voc
import torchvision.transforms as transforms
import torchvision.models as models
import torch.backends.cudnn as cudnn
import os
from models.mobile_net_v3 import mobilenetv... | 39.310924 | 90 | 0.53292 |
28789848c68e98effdcbe2d8048d8d093e895ba4 | 833 | py | Python | rpi/cartographer.py | RimorRes/MDRS_Rover | a46f9a2482febd588d621a51a784bee648198c4d | [
"MIT"
] | 7 | 2021-09-18T11:18:53.000Z | 2022-02-17T21:57:58.000Z | rpi/cartographer.py | RimorRes/MDRS_Rover | a46f9a2482febd588d621a51a784bee648198c4d | [
"MIT"
] | 8 | 2021-10-29T19:27:00.000Z | 2022-02-04T15:32:03.000Z | rpi/cartographer.py | RimorRes/MDRS_Rover | a46f9a2482febd588d621a51a784bee648198c4d | [
"MIT"
] | 3 | 2021-09-24T13:56:33.000Z | 2021-11-27T08:54:10.000Z | import csv
from datetime import datetime
def create_csv_file(file_path):
"""
Creates output file for the
recorded data
args:
file path: Path object
"""
with open(file_path, 'w', newline='') as f:
writer = csv.writer(f)
# Write headers
writer.writerow(
... | 20.317073 | 50 | 0.492197 |
1bbe9e1e355c98df6bf2773fc93b77ff0859c23a | 1,820 | py | Python | ATLASEventService.py | nikmagini/pilot | 1c84fcf6f7e43b669d2357326cdbe06382ac829f | [
"Apache-2.0"
] | 13 | 2015-02-19T17:17:10.000Z | 2021-12-22T06:48:02.000Z | ATLASEventService.py | nikmagini/pilot | 1c84fcf6f7e43b669d2357326cdbe06382ac829f | [
"Apache-2.0"
] | 85 | 2015-01-06T15:01:51.000Z | 2018-11-29T09:03:35.000Z | ATLASEventService.py | nikmagini/pilot | 1c84fcf6f7e43b669d2357326cdbe06382ac829f | [
"Apache-2.0"
] | 22 | 2015-06-09T12:08:29.000Z | 2018-11-20T10:07:01.000Z | # Class definition:
# ATLASEventService
# This class is inheriting from the main Event Service class
# Instances are generated with ExperimentFactory via pUtil::getEventService()
# Implemented as a singleton class
# http://stackoverflow.com/questions/42558/python-and-the-singleton-pattern
# PanDA Pilot modul... | 33.090909 | 104 | 0.671978 |
1bb0ef5f4e273ec1887e2fa6cff9bfe68c20699e | 1,908 | py | Python | oneflow/python/test/ops/test_TestDataTypeAttr.py | Gavin-Hoang/oneflow | 38d9e15d22c6c62827456b097a1d50adda67ca9b | [
"Apache-2.0"
] | 1 | 2020-12-04T03:06:16.000Z | 2020-12-04T03:06:16.000Z | oneflow/python/test/ops/test_TestDataTypeAttr.py | weibao918/oneflow | 320038ff5efd948516f7259442190f9b31f75027 | [
"Apache-2.0"
] | null | null | null | oneflow/python/test/ops/test_TestDataTypeAttr.py | weibao918/oneflow | 320038ff5efd948516f7259442190f9b31f75027 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow 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 applicable law or agr... | 34.071429 | 110 | 0.730608 |
40169fb8a9b0c522b6a29a423abbcd8318c57d72 | 21,094 | py | Python | tornado/options.py | takluyver/tornado | 34903f9e1a99441b2729bbe6f1d65d46cf352ea7 | [
"Apache-2.0"
] | 1 | 2016-01-04T07:40:28.000Z | 2016-01-04T07:40:28.000Z | tornado/options.py | takluyver/tornado | 34903f9e1a99441b2729bbe6f1d65d46cf352ea7 | [
"Apache-2.0"
] | 1 | 2017-09-19T09:52:54.000Z | 2017-09-19T09:52:54.000Z | tornado/options.py | takluyver/tornado | 34903f9e1a99441b2729bbe6f1d65d46cf352ea7 | [
"Apache-2.0"
] | 1 | 2016-09-12T09:32:32.000Z | 2016-09-12T09:32:32.000Z | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 35.692047 | 80 | 0.610126 |
f4c0187f5eb9f98c127b8aab39fcfbe3028dd27d | 2,770 | py | Python | position.py | jorenham/webcam-vr | 4f442b7ac1441cf794decdf243361d93b7315d68 | [
"Apache-2.0"
] | 1 | 2018-04-13T20:28:37.000Z | 2018-04-13T20:28:37.000Z | position.py | jorenham/webcam-vr | 4f442b7ac1441cf794decdf243361d93b7315d68 | [
"Apache-2.0"
] | null | null | null | position.py | jorenham/webcam-vr | 4f442b7ac1441cf794decdf243361d93b7315d68 | [
"Apache-2.0"
] | null | null | null | import numpy as np
from imutils.video import VideoStream
from imutils import face_utils
import argparse
import imutils
import time
import dlib
import cv2
SHAPE_PREDICTOR = 'shape_predictor_5_face_landmarks.dat'
def get_stream():
# initialize the video stream and allow the cammera sensor to warmup
print("[INF... | 26.893204 | 91 | 0.638989 |
8db95063425054bf0e797ecd38120d2e4a65de73 | 1,433 | py | Python | tests/middleware/test_https_redirect.py | deliseev/starlette | 4fe6319211a8766b72d2a603f2ada3faba922914 | [
"BSD-3-Clause"
] | 6,974 | 2018-06-25T13:56:49.000Z | 2022-03-31T21:33:04.000Z | tests/middleware/test_https_redirect.py | deliseev/starlette | 4fe6319211a8766b72d2a603f2ada3faba922914 | [
"BSD-3-Clause"
] | 1,221 | 2018-06-25T15:31:07.000Z | 2022-03-31T09:14:59.000Z | tests/middleware/test_https_redirect.py | deliseev/starlette | 4fe6319211a8766b72d2a603f2ada3faba922914 | [
"BSD-3-Clause"
] | 810 | 2018-06-25T16:07:52.000Z | 2022-03-30T16:34:12.000Z | from starlette.applications import Starlette
from starlette.middleware.httpsredirect import HTTPSRedirectMiddleware
from starlette.responses import PlainTextResponse
def test_https_redirect_middleware(test_client_factory):
app = Starlette()
app.add_middleware(HTTPSRedirectMiddleware)
@app.route("/")
... | 37.710526 | 71 | 0.72575 |
32c5f582df711ef69200a11c6f62889cd36e5d75 | 49,584 | py | Python | neutron/tests/unit/db/test_l3_dvr_db.py | knodir/neutron | ac4e28478ac8a8a0c9f5c5785f6a6bcf532c66b8 | [
"Apache-2.0"
] | null | null | null | neutron/tests/unit/db/test_l3_dvr_db.py | knodir/neutron | ac4e28478ac8a8a0c9f5c5785f6a6bcf532c66b8 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | neutron/tests/unit/db/test_l3_dvr_db.py | knodir/neutron | ac4e28478ac8a8a0c9f5c5785f6a6bcf532c66b8 | [
"Apache-2.0"
] | 2 | 2020-03-15T01:24:15.000Z | 2020-07-22T20:34:26.000Z | # Copyright (c) 2014 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 required by applic... | 44.589928 | 79 | 0.58892 |
87cf3345eec16cea8cce3c58fb75d517ca7c520d | 5,574 | py | Python | contrib/seeds/makeseeds.py | Blockchain-Solutions-BCS/bsmcoin-core | 4c63fc8cc57caf23629cf5078719841225a04537 | [
"MIT"
] | null | null | null | contrib/seeds/makeseeds.py | Blockchain-Solutions-BCS/bsmcoin-core | 4c63fc8cc57caf23629cf5078719841225a04537 | [
"MIT"
] | null | null | null | contrib/seeds/makeseeds.py | Blockchain-Solutions-BCS/bsmcoin-core | 4c63fc8cc57caf23629cf5078719841225a04537 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Generate seeds.txt from Pieter's DNS seeder
#
NSEEDS=512
MAX_SEEDS_PER_ASN=2
MIN_BLOCKS = 337600
# These are hosts that have been observed to be behaving strangely (e.g.
# aggressively connecting to every node).
SUSPICIOUS_HOSTS = set([
"130.211.129.106", "178.63.107.226",
"83.81.1... | 32.788235 | 186 | 0.5601 |
73a5a8ae21b10ab20c1cbf5a95dd79df58b5df0d | 3,284 | py | Python | telegram_text2audio_bot.py | Makeroni/text2audiobot | 3667cbe8d50042eab9005cf72865808a52f7e9cc | [
"Apache-2.0"
] | null | null | null | telegram_text2audio_bot.py | Makeroni/text2audiobot | 3667cbe8d50042eab9005cf72865808a52f7e9cc | [
"Apache-2.0"
] | null | null | null | telegram_text2audio_bot.py | Makeroni/text2audiobot | 3667cbe8d50042eab9005cf72865808a52f7e9cc | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Install FFMpeg: apt-get install ffmpeg
# Install Telebot: git clone https://github.com/eternnoir/pyTelegramBotAPI.git
# Install Espeak apt-get install espeak
# Sustituir BASE_PATH por la ruta dodne se van a guardar los textos y los audio
# Crear una carpeta llamada "text" y otra "audio" en BASE_PA... | 35.311828 | 147 | 0.66352 |
e916d64944d2f5af541c91a8a3497e7605a1ff50 | 18,549 | py | Python | py/DREAM/Output/KineticQuantity.py | chalmersplasmatheory/DREAM | 715637ada94f5e35db16f23c2fd49bb7401f4a27 | [
"MIT"
] | 12 | 2020-09-07T11:19:10.000Z | 2022-02-17T17:40:19.000Z | py/DREAM/Output/KineticQuantity.py | chalmersplasmatheory/DREAM | 715637ada94f5e35db16f23c2fd49bb7401f4a27 | [
"MIT"
] | 110 | 2020-09-02T15:29:24.000Z | 2022-03-09T09:50:01.000Z | py/DREAM/Output/KineticQuantity.py | chalmersplasmatheory/DREAM | 715637ada94f5e35db16f23c2fd49bb7401f4a27 | [
"MIT"
] | 3 | 2021-05-21T13:24:31.000Z | 2022-02-11T14:43:12.000Z | # Base class for kinetic (radius + momentum + time) quantities
#
import matplotlib.animation as animation
import matplotlib.pyplot as plt
import numpy as np
import scipy
from matplotlib import animation
from . OutputException import OutputException
from . UnknownQuantity import UnknownQuantity
from .. import GeriMa... | 38.166667 | 268 | 0.564181 |
daf05ae792e49e7232a8bfb981d5ef79bf27f2ed | 905 | py | Python | problems/leetcode/lt-912.py | neerajp99/algorithms | 1d6885d2a895821ac511fa8a46913d34db2511ca | [
"MIT"
] | 1 | 2021-06-17T07:59:42.000Z | 2021-06-17T07:59:42.000Z | problems/leetcode/lt-912.py | neerajp99/algorithms | 1d6885d2a895821ac511fa8a46913d34db2511ca | [
"MIT"
] | null | null | null | problems/leetcode/lt-912.py | neerajp99/algorithms | 1d6885d2a895821ac511fa8a46913d34db2511ca | [
"MIT"
] | 1 | 2022-01-13T08:42:31.000Z | 2022-01-13T08:42:31.000Z | # 912. Sort an Array
"""
Given an array of integers nums, sort the array in ascending order.
Input: nums = [5,2,3,1]
Output: [1,2,3,5]
"""
# Using Merge Sort
class Solution:
def sortArray(self, nums: List[int]) -> List[int]:
def merge_sorts(unsortedList):
def merge_list(leftSideArray... | 41.136364 | 108 | 0.607735 |
012c8cb8c097ee1af275eeaf94f8033b99810185 | 10,547 | py | Python | test/hooks/test_hooks.py | bronsen/schemathesis | bf60043af9f9271dddd7bb74a4fa55b94a2fa27e | [
"MIT"
] | null | null | null | test/hooks/test_hooks.py | bronsen/schemathesis | bf60043af9f9271dddd7bb74a4fa55b94a2fa27e | [
"MIT"
] | null | null | null | test/hooks/test_hooks.py | bronsen/schemathesis | bf60043af9f9271dddd7bb74a4fa55b94a2fa27e | [
"MIT"
] | null | null | null | import pytest
from hypothesis import HealthCheck, given, settings
import schemathesis
from schemathesis.hooks import HookContext, HookDispatcher, HookScope
@pytest.fixture(autouse=True)
def reset_hooks():
yield
schemathesis.hooks.unregister_all()
@pytest.fixture(params=["direct", "named"])
def global_hook(... | 28.428571 | 109 | 0.690054 |
137e4ec8501c79515e4d19f2c30776ecf5c26293 | 1,044 | py | Python | packer.py | kyReid/Password-Cracker | 2cdc3e23d7bf6ddc924b791458f653d2d3d3c758 | [
"MIT"
] | null | null | null | packer.py | kyReid/Password-Cracker | 2cdc3e23d7bf6ddc924b791458f653d2d3d3c758 | [
"MIT"
] | null | null | null | packer.py | kyReid/Password-Cracker | 2cdc3e23d7bf6ddc924b791458f653d2d3d3c758 | [
"MIT"
] | null | null | null | import packer.bruteforce
import packer.dictionary
import packer.parse
args = packer.parse.get_args()
if args.dict:
if args.plock_file.lower().endswith('.zip'):
packer.dictionary.dictionary_zip(args.wordlist, args.plock_file)
if args.plock_file.lower().endswith('.pdf'):
packer.dictionary.dictio... | 38.666667 | 72 | 0.704023 |
41b14fe71949899b13ea65dfd2712ae05cc2752e | 345 | py | Python | solutions/1165_single_row_keyboard.py | YiqunPeng/leetcode_pro | 7e6376984f9baec49a5e827d98330fe3d1b656f0 | [
"MIT"
] | null | null | null | solutions/1165_single_row_keyboard.py | YiqunPeng/leetcode_pro | 7e6376984f9baec49a5e827d98330fe3d1b656f0 | [
"MIT"
] | null | null | null | solutions/1165_single_row_keyboard.py | YiqunPeng/leetcode_pro | 7e6376984f9baec49a5e827d98330fe3d1b656f0 | [
"MIT"
] | null | null | null | class Solution:
def calculateTime(self, keyboard: str, word: str) -> int:
"""Hash table.
Running time: O(n) where n is the length of word.
"""
d = {keyboard[i]:i for i in range(26)}
res = 0
p = 0
for w in word:
res += abs(d[w] - p)
p =... | 24.642857 | 61 | 0.463768 |
670ef9258ef90deaf95d1c423887ea1166b8e654 | 1,205 | py | Python | src/keri/app/cli/commands/sign.py | pfeairheller/keripy | a765caf5f99a0b909ddcd5f0c67df4e14e2cde8f | [
"Apache-2.0"
] | 10 | 2021-06-09T16:15:32.000Z | 2022-03-28T22:14:11.000Z | src/keri/app/cli/commands/sign.py | pfeairheller/keripy | a765caf5f99a0b909ddcd5f0c67df4e14e2cde8f | [
"Apache-2.0"
] | 47 | 2021-06-17T20:00:02.000Z | 2022-03-31T20:20:44.000Z | src/keri/app/cli/commands/sign.py | pfeairheller/keripy | a765caf5f99a0b909ddcd5f0c67df4e14e2cde8f | [
"Apache-2.0"
] | 6 | 2021-06-10T11:24:25.000Z | 2022-01-28T08:07:43.000Z | # -*- encoding: utf-8 -*-
"""
KERI
keri.kli.commands module
"""
import argparse
from keri import kering
from keri.app import habbing
parser = argparse.ArgumentParser(description='Sign an arbitrary string')
parser.set_defaults(handler=lambda args: sign(args))
parser.add_argument('--name', '-n', help='Human readable r... | 28.023256 | 97 | 0.575104 |
473aafca6ff0d9127f70d2fa5765158e0d915024 | 91 | py | Python | src/villages/apps.py | pwelzel/bornhack-website | af794e6a2fba06e09626259c7768feb30ff394be | [
"BSD-3-Clause"
] | null | null | null | src/villages/apps.py | pwelzel/bornhack-website | af794e6a2fba06e09626259c7768feb30ff394be | [
"BSD-3-Clause"
] | null | null | null | src/villages/apps.py | pwelzel/bornhack-website | af794e6a2fba06e09626259c7768feb30ff394be | [
"BSD-3-Clause"
] | null | null | null | from django.apps import AppConfig
class VillagesConfig(AppConfig):
name = 'villages'
| 15.166667 | 33 | 0.758242 |
3e6452b76c59b02a983f7e38a04d42ff6e9c3e5d | 1,069 | py | Python | liminal/runners/airflow/dag/__init__.py | ZionCervello/incubator-liminal | 6be6e6ac8216267b4aeb18cace43a019d2005003 | [
"Apache-2.0"
] | 107 | 2020-07-27T07:26:27.000Z | 2022-03-30T14:29:34.000Z | liminal/runners/airflow/dag/__init__.py | ZionCervello/incubator-liminal | 6be6e6ac8216267b4aeb18cace43a019d2005003 | [
"Apache-2.0"
] | 29 | 2020-10-20T13:13:18.000Z | 2022-01-20T09:25:26.000Z | liminal/runners/airflow/dag/__init__.py | ZionCervello/incubator-liminal | 6be6e6ac8216267b4aeb18cace43a019d2005003 | [
"Apache-2.0"
] | 38 | 2020-07-26T17:07:57.000Z | 2022-03-07T21:56:45.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... | 38.178571 | 82 | 0.786717 |
8ece34409021689ec1b4c671613859e6a37bf6c3 | 5,069 | py | Python | scripts/devops_tasks/install_python_version.py | praveenkuttappan/azure-sdk-for-python | 4b79413667b7539750a6c7dde15737013a3d4bd5 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | scripts/devops_tasks/install_python_version.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | scripts/devops_tasks/install_python_version.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | import platform
import json
import argparse
import urllib
import urllib.request
from subprocess import check_call, CalledProcessError
import sys
import os
import zipfile
import tarfile
import time
from packaging.version import Version
from packaging.version import parse
from packaging.version import InvalidVersion
# ... | 32.082278 | 225 | 0.641152 |
0c2fcc40de4ed66c94578835f1c5fc5cce57edbc | 531 | py | Python | app1/models/roles.py | loitd/myflask | 276db36c698c440dc4f1af42ca34961294234ab3 | [
"Apache-2.0"
] | null | null | null | app1/models/roles.py | loitd/myflask | 276db36c698c440dc4f1af42ca34961294234ab3 | [
"Apache-2.0"
] | 4 | 2021-02-08T20:55:21.000Z | 2022-01-06T22:51:00.000Z | app1/models/roles.py | loitd/myflask | 276db36c698c440dc4f1af42ca34961294234ab3 | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
from sqlalchemy import Sequence, text
from sqlalchemy.orm import sessionmaker
from app1 import db, loginmgr
class Role(db.Model):
__tablename__ = 'tbl_roles'
__bind_key__ = None # No Bind Key -> default db
id = db.Column(db.Integer, Sequence('role_id_seq'), primary_key=True, a... | 37.928571 | 93 | 0.717514 |
0bb56ab1daff26f4340ad6feb01e65c269bd8374 | 74 | py | Python | examples/3-python/hello.py | skipperkongen/hello-docker | 177993cfbcba1c32b3dd6fd4a0468005b70f3865 | [
"Apache-2.0"
] | null | null | null | examples/3-python/hello.py | skipperkongen/hello-docker | 177993cfbcba1c32b3dd6fd4a0468005b70f3865 | [
"Apache-2.0"
] | null | null | null | examples/3-python/hello.py | skipperkongen/hello-docker | 177993cfbcba1c32b3dd6fd4a0468005b70f3865 | [
"Apache-2.0"
] | null | null | null | from time import sleep
while True:
print('Hello world')
sleep(1) | 14.8 | 24 | 0.662162 |
30993eb79dea40176653280c9ea4718afb4ba319 | 9,191 | py | Python | platform/server/detect.py | funexpected/godot | c9a4e5cdbdf5e38d0c9bcc36abeebbb09fdd8398 | [
"MIT",
"Apache-2.0",
"CC-BY-4.0",
"Unlicense"
] | 2 | 2019-10-23T11:27:37.000Z | 2021-12-06T12:02:31.000Z | platform/server/detect.py | funexpected/godot | c9a4e5cdbdf5e38d0c9bcc36abeebbb09fdd8398 | [
"MIT",
"Apache-2.0",
"CC-BY-4.0",
"Unlicense"
] | 8 | 2020-03-03T13:35:53.000Z | 2021-08-19T10:57:47.000Z | platform/server/detect.py | funexpected/godot | c9a4e5cdbdf5e38d0c9bcc36abeebbb09fdd8398 | [
"MIT",
"Apache-2.0",
"CC-BY-4.0",
"Unlicense"
] | 2 | 2021-04-08T18:14:27.000Z | 2022-02-28T10:52:34.000Z | import os
import platform
import sys
# This file is mostly based on platform/x11/detect.py.
# If editing this file, make sure to apply relevant changes here too.
def is_active():
return True
def get_name():
return "Server"
def get_program_suffix():
if sys.platform == "darwin":
return "osx"
... | 35.624031 | 109 | 0.621151 |
38a0c50df09fff43d9639f961e473f5798d7cb5a | 6,176 | py | Python | reciprocalspaceship/dataseries.py | kmdalton/reciprocalspaceship | 50655f077cb670ee86e88480f54621780c8e9f0d | [
"MIT"
] | null | null | null | reciprocalspaceship/dataseries.py | kmdalton/reciprocalspaceship | 50655f077cb670ee86e88480f54621780c8e9f0d | [
"MIT"
] | 3 | 2021-08-23T19:21:03.000Z | 2021-08-23T21:11:14.000Z | reciprocalspaceship/dataseries.py | JBGreisman/reciprocalspaceship | cf936cca64c5c387ace505416a047318efa9375f | [
"MIT"
] | null | null | null | import pandas as pd
import reciprocalspaceship as rs
class DataSeries(pd.Series):
"""
One-dimensional ndarray with axis labels, representing a slice
of a DataSet. DataSeries objects inherit methods from ``pd.Series``,
and as such have support for statistical methods that automatically
exclude missi... | 30.423645 | 96 | 0.579339 |
3c655c50d249566db0801f2c4b450699cea5865c | 4,403 | py | Python | chunckedparse.py | zstewar1/ALOLoader | ff60adba860734e6ede08f2d5e22b25cd36b094b | [
"MIT"
] | null | null | null | chunckedparse.py | zstewar1/ALOLoader | ff60adba860734e6ede08f2d5e22b25cd36b094b | [
"MIT"
] | null | null | null | chunckedparse.py | zstewar1/ALOLoader | ff60adba860734e6ede08f2d5e22b25cd36b094b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import aloobj
import argparse
import collections
import json
import pprint
import struct
import sys
def load_format(file):
return {int(k): v for k,v in json.load(file).items()}
def parse_chunked(format, buf):
chunk_data = collections.defaultdict(list)
while buf:
chunk_id, ... | 31.676259 | 88 | 0.574608 |
e4f9cf5ffe3becb4ec6f34b66a5d9867b47256f1 | 391 | py | Python | WebMirror/management/rss_parser_funcs/feed_parse_extractPankajtranslationWordpressCom.py | fake-name/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 193 | 2016-08-02T22:04:35.000Z | 2022-03-09T20:45:41.000Z | WebMirror/management/rss_parser_funcs/feed_parse_extractPankajtranslationWordpressCom.py | fake-name/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 533 | 2016-08-23T20:48:23.000Z | 2022-03-28T15:55:13.000Z | WebMirror/management/rss_parser_funcs/feed_parse_extractPankajtranslationWordpressCom.py | rrosajp/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 19 | 2015-08-13T18:01:08.000Z | 2021-07-12T17:13:09.000Z |
def extractPankajtranslationWordpressCom(item):
'''
Parser for 'pankajtranslation.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
if "WATTT" in item['tags']:
return buildReleaseMessageWithTyp... | 26.066667 | 89 | 0.7289 |
97d82ea697363cb8eaa6f850e72458c2a1140940 | 3,858 | py | Python | commands/preupgrade/__init__.py | brianjmurrell/leapp-repository | 0060a1c0f0502e33ed7b0bb14506d7274304b647 | [
"Apache-2.0"
] | null | null | null | commands/preupgrade/__init__.py | brianjmurrell/leapp-repository | 0060a1c0f0502e33ed7b0bb14506d7274304b647 | [
"Apache-2.0"
] | null | null | null | commands/preupgrade/__init__.py | brianjmurrell/leapp-repository | 0060a1c0f0502e33ed7b0bb14506d7274304b647 | [
"Apache-2.0"
] | null | null | null | import os
import sys
import uuid
from leapp.cli.commands import command_utils
from leapp.cli.commands.upgrade import breadcrumbs, util
from leapp.config import get_config
from leapp.exceptions import CommandError, LeappError
from leapp.logger import configure_logger
from leapp.utils.audit import Execution
from leapp.u... | 45.388235 | 117 | 0.722395 |
f1abaa3dfb6f716d937cefdc1f756d398cab2b25 | 1,303 | py | Python | bufrtools/util/bitmath.py | ocefpaf/bufrtools | c9d71532cdbb0d5bc1e2402d3387b5470d4a0546 | [
"MIT"
] | null | null | null | bufrtools/util/bitmath.py | ocefpaf/bufrtools | c9d71532cdbb0d5bc1e2402d3387b5470d4a0546 | [
"MIT"
] | null | null | null | bufrtools/util/bitmath.py | ocefpaf/bufrtools | c9d71532cdbb0d5bc1e2402d3387b5470d4a0546 | [
"MIT"
] | 1 | 2021-06-17T00:09:38.000Z | 2021-06-17T00:09:38.000Z | #!/usr/bin/env python
#-*- coding: utf-8 -*-
"""Utility functions for bit mangling."""
def shift_uint(value: int, full_bitlength: int, bit_offset: int, bitlen: int) -> bytes:
"""Shifts an unsigned integer and returns the byte array of the shifted value."""
shift = full_bitlength - bitlen - bit_offset
outp... | 38.323529 | 99 | 0.642364 |
4377496113f3b19aaad009cefb3975de774cb73c | 41,881 | py | Python | zulip_bots/zulip_bots/game_handler.py | dimisjim/python-zulip-api | 095d5d8f4e1854a98025b8ee92d004fe373d6a88 | [
"Apache-2.0"
] | 351 | 2017-07-07T22:44:48.000Z | 2022-03-30T04:52:12.000Z | zulip_bots/zulip_bots/game_handler.py | dimisjim/python-zulip-api | 095d5d8f4e1854a98025b8ee92d004fe373d6a88 | [
"Apache-2.0"
] | 631 | 2017-07-06T18:56:47.000Z | 2022-03-16T20:32:50.000Z | zulip_bots/zulip_bots/game_handler.py | dimisjim/python-zulip-api | 095d5d8f4e1854a98025b8ee92d004fe373d6a88 | [
"Apache-2.0"
] | 371 | 2017-07-06T19:56:29.000Z | 2022-03-31T16:07:30.000Z | import json
import logging
import random
import re
from copy import deepcopy
from typing import Any, Dict, List, Tuple
from zulip_bots.lib import BotHandler
class BadMoveException(Exception):
def __init__(self, message: str) -> None:
self.message = message
def __str__(self) -> str:
return se... | 39.43597 | 121 | 0.561734 |
8936995facc903360636de6fd7c56bd02cd425f4 | 6,303 | py | Python | src/pymap3d/tests/test_geodetic.py | wrlssqi/pymap3d | bd91a5ff4e9066eb33fead3006ba9de191e2c5e5 | [
"BSD-2-Clause"
] | 116 | 2020-02-23T02:04:18.000Z | 2022-03-29T00:19:37.000Z | src/pymap3d/tests/test_geodetic.py | wrlssqi/pymap3d | bd91a5ff4e9066eb33fead3006ba9de191e2c5e5 | [
"BSD-2-Clause"
] | 19 | 2020-03-02T08:13:46.000Z | 2022-03-30T17:50:00.000Z | src/pymap3d/tests/test_geodetic.py | wrlssqi/pymap3d | bd91a5ff4e9066eb33fead3006ba9de191e2c5e5 | [
"BSD-2-Clause"
] | 28 | 2020-02-24T11:56:03.000Z | 2022-03-29T02:29:37.000Z | import pytest
from pytest import approx
from math import radians, nan, sqrt, isnan
import pymap3d as pm
lla0 = (42, -82, 200)
rlla0 = (radians(lla0[0]), radians(lla0[1]), lla0[2])
xyz0 = (660675.2518247, -4700948.68316, 4245737.66222)
ELL = pm.Ellipsoid()
A = ELL.semimajor_axis
B = ELL.semiminor_axis
atol_dist = 1... | 28.138393 | 98 | 0.592734 |
4886bbbb6fa5ef88b71363b9bfc9104b6a1fa2e9 | 2,616 | py | Python | tests/codegen/allocation_lifetime_test.py | tobiasholenstein/dace | 38fb56d12b59aa8dfe8bb1ff0068e29c5c75efc9 | [
"BSD-3-Clause"
] | null | null | null | tests/codegen/allocation_lifetime_test.py | tobiasholenstein/dace | 38fb56d12b59aa8dfe8bb1ff0068e29c5c75efc9 | [
"BSD-3-Clause"
] | null | null | null | tests/codegen/allocation_lifetime_test.py | tobiasholenstein/dace | 38fb56d12b59aa8dfe8bb1ff0068e29c5c75efc9 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2019-2020 ETH Zurich and the DaCe authors. All rights reserved.
""" Tests different allocation lifetimes. """
import dace
import numpy as np
N = dace.symbol('N')
def test_alloc_persistent_register():
""" Tries to allocate persistent register array. Should fail. """
@dace.program
de... | 29.727273 | 80 | 0.580657 |
28ee0316bb0fbc3d3715e9cbdcc24c63bdd82d0f | 475 | py | Python | scripts/table_reader_demo.py | kekec14/pyLSV2 | 9280e04364816bdadd5d20282d76c52a133a96e1 | [
"MIT"
] | null | null | null | scripts/table_reader_demo.py | kekec14/pyLSV2 | 9280e04364816bdadd5d20282d76c52a133a96e1 | [
"MIT"
] | null | null | null | scripts/table_reader_demo.py | kekec14/pyLSV2 | 9280e04364816bdadd5d20282d76c52a133a96e1 | [
"MIT"
] | null | null | null |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
import pathlib
from pyLSV2 import TableReader
logging.basicConfig(level=logging.DEBUG)
if __name__ == "__main__":
data_dir = pathlib.Path('../data/')
for subfolder in ('table_itnc530', 'table_pilot640', 'table_tnc640'):
current_folder =... | 22.619048 | 73 | 0.665263 |
e9d41e539b436c9200856ad9d4b0db7c5ddd9d2a | 27,866 | py | Python | venv/Lib/site-packages/mysql-connector-2.2.9/tests/__init__.py | hyd2018/Python-site-packages | be02187ce7773ad735c1f0ad7a73d59e4578ffdb | [
"MIT"
] | null | null | null | venv/Lib/site-packages/mysql-connector-2.2.9/tests/__init__.py | hyd2018/Python-site-packages | be02187ce7773ad735c1f0ad7a73d59e4578ffdb | [
"MIT"
] | null | null | null | venv/Lib/site-packages/mysql-connector-2.2.9/tests/__init__.py | hyd2018/Python-site-packages | be02187ce7773ad735c1f0ad7a73d59e4578ffdb | [
"MIT"
] | null | null | null | # MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
# MySQL Connector/Python is licensed under the terms of the GPLv2
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
# MySQL Connectors. There are special exceptio... | 30.825221 | 79 | 0.608196 |
2d8554e5040a14df82126771ba99a4a0230423a5 | 462 | py | Python | core/base/generator.py | nanato12/private-line-bot | 862ccdb7ed1aa0299d94927b7207133842732fa4 | [
"MIT"
] | 4 | 2021-06-13T20:20:23.000Z | 2022-03-23T01:25:30.000Z | core/base/generator.py | nanato12/private-line-bot | 862ccdb7ed1aa0299d94927b7207133842732fa4 | [
"MIT"
] | null | null | null | core/base/generator.py | nanato12/private-line-bot | 862ccdb7ed1aa0299d94927b7207133842732fa4 | [
"MIT"
] | null | null | null | from abc import ABCMeta, abstractmethod
from ast import Constant, Expr
class BaseGenerator(metaclass=ABCMeta):
ast_body: list
def _ast_add_license(self) -> None:
"""append Expr to ast body"""
with open("LICENSE") as license_file:
self.ast_body.append(
Expr(value=C... | 24.315789 | 71 | 0.616883 |
9f1a8c668377131709916d202aba9773029de2f1 | 1,423 | py | Python | 301/removeinvalidparentheses.py | cccccccccccccc/Myleetcode | fb3fa6df7c77feb2d252feea7f3507569e057c70 | [
"Apache-2.0"
] | null | null | null | 301/removeinvalidparentheses.py | cccccccccccccc/Myleetcode | fb3fa6df7c77feb2d252feea7f3507569e057c70 | [
"Apache-2.0"
] | null | null | null | 301/removeinvalidparentheses.py | cccccccccccccc/Myleetcode | fb3fa6df7c77feb2d252feea7f3507569e057c70 | [
"Apache-2.0"
] | null | null | null | from typing import List
class Solution:
def isValid(self, s: str) ->bool:
count = 0
for i in s:
if i == '(':
count+=1
if i == ')':
count -=1
if count< 0:
return False
return count == 0
def dfs(self,s: str... | 27.901961 | 65 | 0.367533 |
5602f140263b47b43c11fc9847b020ed726de216 | 3,706 | py | Python | experiments/Sample_Conv_Expt.py | BethanyL/PDEKoopman2 | 0006a312c3dae21e50aa55c7a0b2855b399eb66a | [
"MIT"
] | 10 | 2020-11-03T18:40:18.000Z | 2022-03-14T20:16:08.000Z | experiments/Sample_Conv_Expt.py | BethanyL/PDEKoopman2 | 0006a312c3dae21e50aa55c7a0b2855b399eb66a | [
"MIT"
] | null | null | null | experiments/Sample_Conv_Expt.py | BethanyL/PDEKoopman2 | 0006a312c3dae21e50aa55c7a0b2855b399eb66a | [
"MIT"
] | 4 | 2021-05-27T16:30:23.000Z | 2022-03-14T20:16:09.000Z | """Sample experiment file using convolutional layers for autoencoder."""
import random as r
import sys
from tensorflow import keras
from tensorflow.keras.regularizers import l1_l2
from tensorflow.keras.activations import relu
from utils import run_experiment, getdatasize
# Add the architecture path for the DenseResB... | 34.962264 | 75 | 0.635186 |
490037e9fdeb1cbbbb9ca29a65c6fe940f45ccad | 4,552 | py | Python | parcellearning/gauss/gauss.py | kristianeschenburg/parcellearning | 93811f7d11c1c5583d8f541c7629dbbaa1785304 | [
"BSD-3-Clause"
] | 6 | 2017-07-03T23:11:29.000Z | 2022-01-04T16:41:57.000Z | parcellearning/gauss/gauss.py | kristianeschenburg/parcellearning | 93811f7d11c1c5583d8f541c7629dbbaa1785304 | [
"BSD-3-Clause"
] | null | null | null | parcellearning/gauss/gauss.py | kristianeschenburg/parcellearning | 93811f7d11c1c5583d8f541c7629dbbaa1785304 | [
"BSD-3-Clause"
] | 1 | 2018-04-24T18:01:19.000Z | 2018-04-24T18:01:19.000Z | from parcellearning.conv.gausconv import GAUSConv
import numpy as np
import dgl
from dgl import data
from dgl.data import DGLDataset
import dgl.function as fn
from dgl.nn.pytorch import edge_softmax
import torch
import torch.nn as nn
import torch.nn.functional as F
class GAUSS(nn.Module):
"""
Instantiate a... | 32.985507 | 89 | 0.496485 |
26c2d54867a46ea3ed773162912b6ef5fb627f17 | 1,978 | py | Python | my_school/my_school/wsgi.py | coderfromanotherearth/School-GIS | 5675972f8dca8f28172da0cdfc3824a87b33d831 | [
"MIT"
] | null | null | null | my_school/my_school/wsgi.py | coderfromanotherearth/School-GIS | 5675972f8dca8f28172da0cdfc3824a87b33d831 | [
"MIT"
] | 1 | 2020-06-05T22:36:02.000Z | 2020-06-05T22:36:02.000Z | my_school/my_school/wsgi.py | joelabrahamkeerickal/School-GIS | 5675972f8dca8f28172da0cdfc3824a87b33d831 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2017 OSGeo
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 ... | 40.367347 | 79 | 0.725986 |
cab4821738bf9a5214d40a91b01d0a0bef67b876 | 38,840 | py | Python | GUI/Mserial.py | manatee-fluidics/Manatee | 7a1da6393589bde69745c89b47853bd4259333f9 | [
"Apache-2.0"
] | null | null | null | GUI/Mserial.py | manatee-fluidics/Manatee | 7a1da6393589bde69745c89b47853bd4259333f9 | [
"Apache-2.0"
] | null | null | null | GUI/Mserial.py | manatee-fluidics/Manatee | 7a1da6393589bde69745c89b47853bd4259333f9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Feb 07 20:57:35 2017
@author: User
"""
from math import sqrt, exp
import struct
import serial
import time
from math import log
import numpy as np
import multiprocessing as mp
import queue
from threading import Thread
from threading import Event as tEvent
"""
overwrite set... | 38.228346 | 299 | 0.590474 |
2e16920464d4ac6fbdebc9c30bca641521b90d56 | 11,042 | py | Python | gsshapy/orm/snw.py | Aquaveo/gsshapy | dcba14b6e2870524fb743eab00a9ffdd0ad31f40 | [
"BSD-3-Clause"
] | 7 | 2019-05-23T07:33:50.000Z | 2022-02-15T21:44:37.000Z | gsshapy/orm/snw.py | Aquaveo/gsshapy | dcba14b6e2870524fb743eab00a9ffdd0ad31f40 | [
"BSD-3-Clause"
] | 31 | 2016-09-20T17:13:51.000Z | 2019-05-29T11:47:04.000Z | gsshapy/orm/snw.py | Aquaveo/gsshapy | dcba14b6e2870524fb743eab00a9ffdd0ad31f40 | [
"BSD-3-Clause"
] | 12 | 2016-07-08T20:32:00.000Z | 2021-04-19T16:22:40.000Z | """
********************************************************************************
* Name: SnowSimulationModel
* Author: Nathan Swain
* Created On: May 16, 2013
* Copyright: (c) Brigham Young University 2013
* License: BSD 2-Clause
********************************************************************************
"""
f... | 36.684385 | 139 | 0.556783 |
a609fd191e01dcb47c50d3130133f42bfedb2e97 | 108,136 | py | Python | src/tests/unit/fixtures/platform/mock_process.py | fslds/carbon-black-cloud-sdk-python | 248a3c63d6b36d6fcdbcb3f51fb7751f062ed372 | [
"MIT"
] | 24 | 2020-10-16T22:07:38.000Z | 2022-03-24T14:58:03.000Z | src/tests/unit/fixtures/platform/mock_process.py | fslds/carbon-black-cloud-sdk-python | 248a3c63d6b36d6fcdbcb3f51fb7751f062ed372 | [
"MIT"
] | 63 | 2020-10-26T18:26:15.000Z | 2022-03-31T17:31:02.000Z | src/tests/unit/fixtures/platform/mock_process.py | fslds/carbon-black-cloud-sdk-python | 248a3c63d6b36d6fcdbcb3f51fb7751f062ed372 | [
"MIT"
] | 10 | 2020-11-09T11:54:23.000Z | 2022-03-24T20:44:00.000Z | """Mock responses for process queries."""
GET_PROCESS_RESP = {}
GET_PROCESS_VALIDATION_RESP = {
"valid": True,
"value_search_query": False
}
GET_PROCESS_VALIDATION_RESP_INVALID = {
"invalid_message": "Invalid Query Parameter",
"valid": False,
"value_search_query": False,
"invalid_trigger_offs... | 37.915849 | 203 | 0.492759 |
945032684fd35ccdff9775b831412e14c11e286e | 20,939 | py | Python | silx/math/test/test_HistogramndLut_nominal.py | vincefn/silx | 4b239abfc90d2fa7d6ab61425f8bfc7b83c0f444 | [
"CC0-1.0",
"MIT"
] | 1 | 2016-10-26T11:05:46.000Z | 2016-10-26T11:05:46.000Z | silx/math/test/test_HistogramndLut_nominal.py | vincefn/silx | 4b239abfc90d2fa7d6ab61425f8bfc7b83c0f444 | [
"CC0-1.0",
"MIT"
] | 7 | 2016-10-19T09:27:26.000Z | 2020-01-24T13:26:56.000Z | silx/math/test/test_HistogramndLut_nominal.py | payno/silx | 13301e61627f98fa837008250ac74a0627a7a560 | [
"CC0-1.0",
"MIT"
] | null | null | null | # coding: utf-8
# /*##########################################################################
# Copyright (C) 2016 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# i... | 35.67121 | 80 | 0.570132 |
53de379f48364f457acd42685817961b8a032b82 | 1,988 | py | Python | cms/migrations/0017_pagetype.py | Mario-Kart-Felix/django-cms | 6d68439fe7fd59d000f99e27c1f2135a3f9c816a | [
"BSD-3-Clause"
] | 5,659 | 2015-01-01T02:42:30.000Z | 2020-10-07T02:38:29.000Z | cms/migrations/0017_pagetype.py | rpep/django-cms | 53dddb106f45963f9f8393d434b4313fa3bbdf54 | [
"BSD-3-Clause"
] | 3,264 | 2015-01-02T10:11:48.000Z | 2020-10-08T13:15:07.000Z | cms/migrations/0017_pagetype.py | rpep/django-cms | 53dddb106f45963f9f8393d434b4313fa3bbdf54 | [
"BSD-3-Clause"
] | 2,132 | 2015-01-01T11:28:21.000Z | 2020-10-06T09:09:11.000Z | from django.db import migrations, models
def update_descendants(parent, **data):
parent.children.update(**data)
for child in parent.children.iterator():
update_descendants(child, **data)
def migrate_to_page_types(apps, schema_editor):
Page = apps.get_model('cms', 'Page')
db_alias = schema_e... | 31.555556 | 85 | 0.635312 |
a7c94b3d222890f1dda096e5c44650b91a21b0fd | 7,332 | py | Python | textory/textures.py | sebiegli/textory | 8cf5110d40dbf7898e9f4186b233e3abf4cd24f9 | [
"MIT"
] | null | null | null | textory/textures.py | sebiegli/textory | 8cf5110d40dbf7898e9f4186b233e3abf4cd24f9 | [
"MIT"
] | null | null | null | textory/textures.py | sebiegli/textory | 8cf5110d40dbf7898e9f4186b233e3abf4cd24f9 | [
"MIT"
] | null | null | null | #! /usr/bin/python
# -*- coding: utf-8 -*-
import numpy as np
import functools
import dask.array as da
from .util import neighbour_diff_squared, _dask_neighbour_diff_squared, _win_view_stat, window_sum, xr_wrapper
@xr_wrapper
def variogram(x, lag=1, win_size=5, win_geom="square", **kwargs):
"""
Calculate move... | 28.752941 | 122 | 0.614157 |
102ed9caf6d5236c31873fcd5208412e9712ea9d | 10,144 | py | Python | silx/opencl/sift/test/test_convol.py | vallsv/silx | 834bfe9272af99096faa360e1ad96291bf46a2ac | [
"CC0-1.0",
"MIT"
] | 1 | 2017-08-03T15:51:42.000Z | 2017-08-03T15:51:42.000Z | silx/opencl/sift/test/test_convol.py | vallsv/silx | 834bfe9272af99096faa360e1ad96291bf46a2ac | [
"CC0-1.0",
"MIT"
] | 7 | 2016-10-19T09:27:26.000Z | 2020-01-24T13:26:56.000Z | silx/opencl/sift/test/test_convol.py | vallsv/silx | 834bfe9272af99096faa360e1ad96291bf46a2ac | [
"CC0-1.0",
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Project: Sift implementation in Python + OpenCL
# https://github.com/silx-kit/silx
#
# Copyright (C) 2013-2017 European Synchrotron Radiation Facility, Grenoble, France
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy... | 44.884956 | 148 | 0.590694 |
cb2337bcf788afccdc9c5a689352e723a99564df | 41,681 | py | Python | sdk/search/azure-search-documents/azure/search/documents/_internal/_generated/operations/_documents_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/search/azure-search-documents/azure/search/documents/_internal/_generated/operations/_documents_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | 2 | 2021-11-03T06:10:36.000Z | 2021-12-01T06:29:39.000Z | sdk/search/azure-search-documents/azure/search/documents/_internal/_generated/operations/_documents_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | 1 | 2021-05-19T02:55:10.000Z | 2021-05-19T02:55:10.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 50.461259 | 160 | 0.670161 |
e8788c9fc7223a38447cc88811a67ef9cd5dd611 | 218 | py | Python | World/Object/Unit/Pet/model.py | sundayz/idewave-core | 5bdb88892173c9c3e8c85f431cf9b5dbd9f23941 | [
"Apache-2.0"
] | 10 | 2019-06-29T19:24:52.000Z | 2021-02-21T22:45:57.000Z | World/Object/Unit/Pet/model.py | sundayz/idewave-core | 5bdb88892173c9c3e8c85f431cf9b5dbd9f23941 | [
"Apache-2.0"
] | 4 | 2019-08-15T07:03:36.000Z | 2021-06-02T13:01:25.000Z | World/Object/Unit/Pet/model.py | sundayz/idewave-core | 5bdb88892173c9c3e8c85f431cf9b5dbd9f23941 | [
"Apache-2.0"
] | 8 | 2019-06-30T22:47:48.000Z | 2021-02-20T19:21:30.000Z | from World.Object.Unit.model import Unit
from World.Object.Constants.HighGuid import HighGuid
class Pet(Unit):
def __init__(self):
super().__init__()
self.high_guid = HighGuid.HIGHGUID_PET.value
| 21.8 | 52 | 0.724771 |
71170500c123e08d326c6b1f5370d9c4000903df | 8,358 | py | Python | tests/test_models_albert.py | liuzh91/gluon-nlp | 189bbdcc56d8e58aa908963949687b99ff9a3cff | [
"Apache-2.0"
] | null | null | null | tests/test_models_albert.py | liuzh91/gluon-nlp | 189bbdcc56d8e58aa908963949687b99ff9a3cff | [
"Apache-2.0"
] | null | null | null | tests/test_models_albert.py | liuzh91/gluon-nlp | 189bbdcc56d8e58aa908963949687b99ff9a3cff | [
"Apache-2.0"
] | null | null | null | import pytest
import numpy as np
from numpy.testing import assert_allclose
import mxnet as mx
import tempfile
from gluonnlp.models.albert import AlbertModel, AlbertForMLM, AlbertForPretrain,\
list_pretrained_albert, get_pretrained_albert
mx.npx.set_np()
def get_test_cfg():
vocab_size = 500
num_token_types... | 47.220339 | 137 | 0.717755 |
5502fb25a1b152675ef52545696485dca9a83678 | 11,982 | py | Python | tests/apps/courses/test_templates_course_run_detail.py | Verisage/richie | 8a78d3bc6cde74d6252cbfc51a2d195e26be64fc | [
"MIT"
] | null | null | null | tests/apps/courses/test_templates_course_run_detail.py | Verisage/richie | 8a78d3bc6cde74d6252cbfc51a2d195e26be64fc | [
"MIT"
] | null | null | null | tests/apps/courses/test_templates_course_run_detail.py | Verisage/richie | 8a78d3bc6cde74d6252cbfc51a2d195e26be64fc | [
"MIT"
] | null | null | null | """
End-to-end tests for the course run detail view
"""
from datetime import datetime
from unittest import mock
from django.utils import timezone
import pytz
from cms.test_utils.testcases import CMSTestCase
from richie.apps.core.factories import UserFactory
from richie.apps.courses.factories import (
CategoryFac... | 40.208054 | 94 | 0.614505 |
f68643981530822059227a47bb3016d4498914e8 | 3,488 | py | Python | local_configs/11.2/b0_c0s32.py | wzpscott/SegformerDistillation | 6558757f5071251410e90270e197755860a6f41c | [
"DOC"
] | null | null | null | local_configs/11.2/b0_c0s32.py | wzpscott/SegformerDistillation | 6558757f5071251410e90270e197755860a6f41c | [
"DOC"
] | null | null | null | local_configs/11.2/b0_c0s32.py | wzpscott/SegformerDistillation | 6558757f5071251410e90270e197755860a6f41c | [
"DOC"
] | null | null | null | _base_ = [
'../_base_/datasets/ade20k_repeat.py',
'../_base_/default_runtime.py',
'../_base_/schedules/schedule_160k_adamw.py'
]
norm_cfg = dict(type='SyncBN', requires_grad=True)
c = 0
s = 32
model = dict(
type='SDModule',
cfg_s=dict(
type='EncoderDecoder',
pretrained='pretrained/m... | 35.232323 | 95 | 0.527523 |
ff21384752551fb894f5be2364c426f7649632ff | 1,288 | py | Python | mysqlconnection.py | Elizandtech/tennis_paradise | bf97dc2e5a357ff906480cc35e3f5da868c9ff57 | [
"MIT"
] | 1 | 2019-07-24T05:31:30.000Z | 2019-07-24T05:31:30.000Z | mysqlconnection.py | Elizandtech/tennis_paradise | bf97dc2e5a357ff906480cc35e3f5da868c9ff57 | [
"MIT"
] | 5 | 2019-07-24T14:55:09.000Z | 2019-07-24T17:46:06.000Z | mysqlconnection.py | Elizandtech/tennis_paradise | bf97dc2e5a357ff906480cc35e3f5da868c9ff57 | [
"MIT"
] | 1 | 2019-07-24T16:12:59.000Z | 2019-07-24T16:12:59.000Z | import pymysql.cursors
class MySQLConnection:
def __init__(self, db):
connection = pymysql.connect(host = 'localhost',
user = 'root',
password = 'root',
db = db,
... | 34.810811 | 77 | 0.468944 |
afdd0e9768e7a838236b2f03be9a6131d27c199e | 1,938 | py | Python | webhook.py | xiangflight/tb2lark-notification | 00ad16cf6d4a703b83bbedc6e296f40355101f8c | [
"Apache-2.0"
] | null | null | null | webhook.py | xiangflight/tb2lark-notification | 00ad16cf6d4a703b83bbedc6e296f40355101f8c | [
"Apache-2.0"
] | null | null | null | webhook.py | xiangflight/tb2lark-notification | 00ad16cf6d4a703b83bbedc6e296f40355101f8c | [
"Apache-2.0"
] | null | null | null | from flask import Flask, request, jsonify
import requests
import json
app = Flask(__name__)
@app.route('/hook', methods=['POST'])
def web_hook():
"""
transfer station of teambition's webhook to feishu's webhook
"""
# resolve teambition's request, maybe we need some authentication
signature = req... | 30.28125 | 90 | 0.46646 |
8e48b184bccaa6d9588206ad78f04c09d01fb167 | 22,346 | py | Python | sphinx/util/typing.py | danieleades/sphinx | 1c98aea126919b218766371e1fdf308a1167e95f | [
"BSD-2-Clause"
] | null | null | null | sphinx/util/typing.py | danieleades/sphinx | 1c98aea126919b218766371e1fdf308a1167e95f | [
"BSD-2-Clause"
] | 1,662 | 2015-01-02T11:45:27.000Z | 2015-01-03T12:21:29.000Z | sphinx/util/typing.py | danieleades/sphinx | 1c98aea126919b218766371e1fdf308a1167e95f | [
"BSD-2-Clause"
] | null | null | null | """The composite types for Sphinx."""
import sys
import typing
from struct import Struct
from types import TracebackType
from typing import Any, Callable, Dict, Generator, List, Optional, Tuple, Type, TypeVar, Union
from docutils import nodes
from docutils.parsers.rst.states import Inliner
from sphinx.deprecation im... | 40.92674 | 96 | 0.579925 |
8831015b63c7713127a53e0f09c6877448c3167a | 458 | py | Python | 2015/17/part1.py | timofurrer/aoc-2020 | 446b688a57601d9891f520e43b7f822c373a6ff4 | [
"MIT"
] | null | null | null | 2015/17/part1.py | timofurrer/aoc-2020 | 446b688a57601d9891f520e43b7f822c373a6ff4 | [
"MIT"
] | null | null | null | 2015/17/part1.py | timofurrer/aoc-2020 | 446b688a57601d9891f520e43b7f822c373a6ff4 | [
"MIT"
] | null | null | null | from pathlib import Path
with (Path(__file__).parent / "input.txt").open() as puzzle_input_file:
puzzle_input_raw = puzzle_input_file.read()
import itertools
TOTAL_EGGNOG = 150
containers = [int(x) for x in puzzle_input_raw.splitlines()]
all_combinations = itertools.chain(*(itertools.combinations(containers, x)... | 35.230769 | 115 | 0.770742 |
c4707f77c85d5637a7753cbc10d78b3dc565f674 | 3,937 | py | Python | tests/test_workload.py | dogfish182/tf-restore-helper | 51b5c45d5c9e012bcce33db3f4c0355010113f55 | [
"MIT"
] | null | null | null | tests/test_workload.py | dogfish182/tf-restore-helper | 51b5c45d5c9e012bcce33db3f4c0355010113f55 | [
"MIT"
] | 191 | 2021-05-03T18:29:39.000Z | 2022-03-29T10:18:33.000Z | tests/test_workload.py | dogfish182/tf-restore-helper | 51b5c45d5c9e012bcce33db3f4c0355010113f55 | [
"MIT"
] | null | null | null | """Test cases for the Workload object."""
import json
import logging
import os
from os.path import abspath
from os.path import dirname
from os.path import join
from typing import Any
from typing import Dict
from typing import List
from unittest.mock import MagicMock
from unittest.mock import patch
import boto3 # type... | 32.00813 | 84 | 0.707137 |
cc06c8bcead588a0dff27450085b089185cebe49 | 2,536 | py | Python | kubernetes/test/test_batch_v2alpha1_api.py | kevingessner/python | 3f4d09d260cf0839fae8173852c69e0419188454 | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_batch_v2alpha1_api.py | kevingessner/python | 3f4d09d260cf0839fae8173852c69e0419188454 | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_batch_v2alpha1_api.py | kevingessner/python | 3f4d09d260cf0839fae8173852c69e0419188454 | [
"Apache-2.0"
] | 1 | 2018-07-19T16:37:20.000Z | 2018-07-19T16:37:20.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.9.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
im... | 19.067669 | 105 | 0.614353 |
bf63acf7cd43858d169271e4bbcc5878a1f70620 | 6,303 | py | Python | ajax_forms/tests/settings.py | chrisspen/django-ajax-forms | da5031192a46aaa2fe3de5d6984b376755c9e429 | [
"BSD-3-Clause"
] | null | null | null | ajax_forms/tests/settings.py | chrisspen/django-ajax-forms | da5031192a46aaa2fe3de5d6984b376755c9e429 | [
"BSD-3-Clause"
] | 29 | 2017-09-30T09:45:56.000Z | 2021-03-01T14:40:23.000Z | ajax_forms/tests/settings.py | chrisspen/django-ajax-forms | da5031192a46aaa2fe3de5d6984b376755c9e429 | [
"BSD-3-Clause"
] | 9 | 2017-05-12T11:48:47.000Z | 2018-07-13T12:07:58.000Z | # Django settings for ajax_forms project.
import os
#import sys
#sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
#PROJECT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '../..'))
PROJECT_DIR = os.path.dirname(__file__)
DEBUG = True
ADMINS = (
# ('Your Name', 'yo... | 34.255435 | 108 | 0.655402 |
7d7bef87434f0f2e6b2ea6d2bf4d7f5703ba124b | 11,455 | py | Python | salt/modules/zk_concurrency.py | ifraixedes/saltstack-salt | b54becb8b43cc9b7c00b2c0bc637ac534dc62896 | [
"Apache-2.0"
] | 9,425 | 2015-01-01T05:59:24.000Z | 2022-03-31T20:44:05.000Z | salt/modules/zk_concurrency.py | ifraixedes/saltstack-salt | b54becb8b43cc9b7c00b2c0bc637ac534dc62896 | [
"Apache-2.0"
] | 33,507 | 2015-01-01T00:19:56.000Z | 2022-03-31T23:48:20.000Z | salt/modules/zk_concurrency.py | ifraixedes/saltstack-salt | b54becb8b43cc9b7c00b2c0bc637ac534dc62896 | [
"Apache-2.0"
] | 5,810 | 2015-01-01T19:11:45.000Z | 2022-03-31T02:37:20.000Z | """
Concurrency controls in zookeeper
=========================================================================
:depends: kazoo
:configuration: See :py:mod:`salt.modules.zookeeper` for setup instructions.
This module allows you to acquire and release a slot. This is primarily useful
for ensureing that no more than N ... | 28.07598 | 107 | 0.619293 |
19920ed4a82575f3f29c2876a67bb711cb979fd2 | 299 | py | Python | manage.py | zbidwell/heltour | 3895142695096a81cc65c3fefb7d4501ed796f46 | [
"MIT"
] | 41 | 2016-08-17T19:58:42.000Z | 2021-11-08T10:52:07.000Z | manage.py | zbidwell/heltour | 3895142695096a81cc65c3fefb7d4501ed796f46 | [
"MIT"
] | 257 | 2016-08-17T22:29:05.000Z | 2022-01-13T00:42:05.000Z | manage.py | zbidwell/heltour | 3895142695096a81cc65c3fefb7d4501ed796f46 | [
"MIT"
] | 31 | 2016-09-23T23:36:14.000Z | 2022-01-14T17:05:08.000Z | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("HELTOUR_ENV", "LIVE")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "heltour.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| 24.916667 | 71 | 0.759197 |
48c9c3bf9374f207390eb41d7763a4f430968d82 | 333 | py | Python | python/fedml/cross_silo/hierarchical/communication_manager.py | ray-ruisun/FedML | 24ff30d636bb70f64e94e9ca205375033597d3dd | [
"Apache-2.0"
] | null | null | null | python/fedml/cross_silo/hierarchical/communication_manager.py | ray-ruisun/FedML | 24ff30d636bb70f64e94e9ca205375033597d3dd | [
"Apache-2.0"
] | null | null | null | python/fedml/cross_silo/hierarchical/communication_manager.py | ray-ruisun/FedML | 24ff30d636bb70f64e94e9ca205375033597d3dd | [
"Apache-2.0"
] | null | null | null | from ...core.distributed.client.client_manager import ClientManager
class CommunicationManager(ClientManager):
def __init__(self, args, comm, rank, size, backend):
super().__init__(args, comm, rank, size, backend)
def register_message_receive_handlers(self):
pass
def run(self):
s... | 25.615385 | 67 | 0.696697 |
17fb060ee81671ad05da2395a4ae35699161c3c8 | 5,431 | py | Python | examples/server_example.py | christian-oudard/AIOPyFix | cb9e9372075e6119c0ef363d2095b3b6fddafcf3 | [
"CC0-1.0"
] | null | null | null | examples/server_example.py | christian-oudard/AIOPyFix | cb9e9372075e6119c0ef363d2095b3b6fddafcf3 | [
"CC0-1.0"
] | null | null | null | examples/server_example.py | christian-oudard/AIOPyFix | cb9e9372075e6119c0ef363d2095b3b6fddafcf3 | [
"CC0-1.0"
] | null | null | null | import asyncio
from enum import Enum
import logging
from aiopyfix.connection import ConnectionState, MessageDirection
from aiopyfix.engine import FIXEngine
from aiopyfix.message import FIXMessage
from aiopyfix.server_connection import FIXServer
class Side(Enum):
buy = 1
sell = 2
class Server(FIXEngine):
... | 53.245098 | 120 | 0.692874 |
a80b5e663077a9d52ebcbb1ab4ad5709b8b389ef | 3,673 | py | Python | cgeexample.py | tirimid/cgengine | 5df905f094dd867bed256cb6cccee2e02a5eb849 | [
"MIT"
] | null | null | null | cgeexample.py | tirimid/cgengine | 5df905f094dd867bed256cb6cccee2e02a5eb849 | [
"MIT"
] | null | null | null | cgeexample.py | tirimid/cgengine | 5df905f094dd867bed256cb6cccee2e02a5eb849 | [
"MIT"
] | 1 | 2022-01-23T12:03:12.000Z | 2022-01-23T12:03:12.000Z | # MIT License
#
# Copyright (c) 2021 tirimid
#
# 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, ... | 31.93913 | 86 | 0.622924 |
45401c7d152dd8fee93f34af829c2b2fabba104e | 247 | py | Python | tests/example_projects/broken_fizzbuzz/example_tests/test_broken.py | DrSerpent/drserpent | 7b99a76a4633f76819b5da25f31dff57807cb35c | [
"MIT"
] | 4 | 2018-05-12T07:36:21.000Z | 2018-07-27T10:57:56.000Z | tests/example_projects/broken_fizzbuzz/example_tests/test_broken.py | DrSerpent/DrSerpent | 7b99a76a4633f76819b5da25f31dff57807cb35c | [
"MIT"
] | null | null | null | tests/example_projects/broken_fizzbuzz/example_tests/test_broken.py | DrSerpent/DrSerpent | 7b99a76a4633f76819b5da25f31dff57807cb35c | [
"MIT"
] | 1 | 2018-05-07T11:17:56.000Z | 2018-05-07T11:17:56.000Z | import os, sys
from broken_context import *
def test_fail():
return Expect(Fizzbuzz.run(3)).to_equal('HEY')
def test_error():
raise Exception('this failed deliberately')
def test_no_return():
Expect(Fizzbuzz.run(5)).to_equal('YES')
| 20.583333 | 50 | 0.716599 |
dfb0ef73f0b2cfc809bde860232b10bb7dbcc991 | 33,752 | py | Python | evaluation_functions.py | sitnarf/echo-clustering | be5bd26d271da1bc468c02f822503a420aa53211 | [
"MIT"
] | null | null | null | evaluation_functions.py | sitnarf/echo-clustering | be5bd26d271da1bc468c02f822503a420aa53211 | [
"MIT"
] | null | null | null | evaluation_functions.py | sitnarf/echo-clustering | be5bd26d271da1bc468c02f822503a420aa53211 | [
"MIT"
] | null | null | null | import logging
from dataclasses import dataclass
from functools import partial, reduce
from multiprocessing.pool import Pool
from statistics import mean, stdev, StatisticsError
# noinspection Mypy
from typing import Iterable, Optional, Any, Dict, Union, TypedDict, Callable, Tuple, TypeVar, Mapping
from typing import Li... | 30.407207 | 121 | 0.66085 |
f9f7b7019917580dc1fc470d944c36c3c5e83ab0 | 123 | py | Python | abc/abc142/abc142c-3.py | c-yan/atcoder | 940e49d576e6a2d734288fadaf368e486480a948 | [
"MIT"
] | 1 | 2019-08-21T00:49:34.000Z | 2019-08-21T00:49:34.000Z | abc/abc142/abc142c-3.py | c-yan/atcoder | 940e49d576e6a2d734288fadaf368e486480a948 | [
"MIT"
] | null | null | null | abc/abc142/abc142c-3.py | c-yan/atcoder | 940e49d576e6a2d734288fadaf368e486480a948 | [
"MIT"
] | null | null | null | N = int(input())
A = list(map(int, input().split()))
rev = [0] * N
for i in range(N):
rev[A[i] - 1] = i+1
print(*rev)
| 15.375 | 35 | 0.512195 |
7053ccf93baa6aa6b7a6ad86852971c38817e18a | 4,011 | py | Python | pixelart_image.py | blobbeliblob/pixelart_converter | 2347796d287bdcd370f6ae98026229b5f8da2d64 | [
"MIT"
] | null | null | null | pixelart_image.py | blobbeliblob/pixelart_converter | 2347796d287bdcd370f6ae98026229b5f8da2d64 | [
"MIT"
] | null | null | null | pixelart_image.py | blobbeliblob/pixelart_converter | 2347796d287bdcd370f6ae98026229b5f8da2d64 | [
"MIT"
] | null | null | null | '''
author: Camilo Hernández
This script takes an image file and converts it into pixelart based on the given initial parameters
file_name # this should point to the name of the image file (without the file extension)
file_format # this should be the type of file
new_file_appendix # this should be what is added to th... | 35.495575 | 165 | 0.68013 |
a68aee7aa8f896eeae0901d1e0144b6f435c5d8b | 2,234 | py | Python | python/paddle/tests/test_progressbar.py | Li-fAngyU/Paddle | e548f65f96697830035a28f9070b40829408ccdb | [
"Apache-2.0"
] | 8 | 2016-08-15T07:02:27.000Z | 2016-08-24T09:34:00.000Z | python/paddle/tests/test_progressbar.py | Li-fAngyU/Paddle | e548f65f96697830035a28f9070b40829408ccdb | [
"Apache-2.0"
] | 1 | 2022-01-28T07:23:22.000Z | 2022-01-28T07:23:22.000Z | python/paddle/tests/test_progressbar.py | Li-fAngyU/Paddle | e548f65f96697830035a28f9070b40829408ccdb | [
"Apache-2.0"
] | 1 | 2022-03-02T11:36:03.000Z | 2022-03-02T11:36:03.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... | 31.027778 | 74 | 0.598926 |
ca371e8e4877886b139363b3b510e9fc80053593 | 13,537 | py | Python | sympy/functions/elementary/tests/test_hyperbolic.py | pernici/sympy | 5e6e3b71da777f5b85b8ca2d16f33ed020cf8a41 | [
"BSD-3-Clause"
] | 2 | 2015-11-13T16:40:57.000Z | 2017-09-15T15:37:19.000Z | sympy/functions/elementary/tests/test_hyperbolic.py | jegerjensen/sympy | 3a43310f1957a21a6f095fe2801cc05b5268a2c7 | [
"BSD-3-Clause"
] | 1 | 2016-06-13T01:29:51.000Z | 2016-06-14T00:38:27.000Z | sympy/functions/elementary/tests/test_hyperbolic.py | jegerjensen/sympy | 3a43310f1957a21a6f095fe2801cc05b5268a2c7 | [
"BSD-3-Clause"
] | null | null | null | from sympy import symbols, Symbol, sinh, nan, oo, zoo, pi, asinh, acosh, log, sqrt, \
coth, I, cot, E, tanh, tan, cosh, cos, S, sin, Rational, atanh, acoth, \
Integer, O, exp
from sympy.utilities.pytest import XFAIL
def test_sinh():
x, y = symbols('x,y')
k = Symbol('k', integer=True)
ass... | 28.498947 | 85 | 0.543695 |
e858da065cdcb11412c30ebe0275ca6759b7678b | 89 | py | Python | screens/apps.py | neosergio/transit-advertising-screen-cms | 9c27d4d7ed9fe598c1c48ca96ee5d10f619c8683 | [
"Apache-2.0"
] | 1 | 2020-10-30T08:30:34.000Z | 2020-10-30T08:30:34.000Z | screens/apps.py | neosergio/transit-advertising-screen-cms | 9c27d4d7ed9fe598c1c48ca96ee5d10f619c8683 | [
"Apache-2.0"
] | 7 | 2020-06-05T23:08:42.000Z | 2022-02-10T12:08:54.000Z | screens/apps.py | neosergio/transit-advertising-screen-cms | 9c27d4d7ed9fe598c1c48ca96ee5d10f619c8683 | [
"Apache-2.0"
] | 1 | 2020-10-30T08:30:47.000Z | 2020-10-30T08:30:47.000Z | from django.apps import AppConfig
class ScreensConfig(AppConfig):
name = 'screens'
| 14.833333 | 33 | 0.752809 |
eec60c82bf5f6565a7b27311046565c69db4436d | 470 | py | Python | test_hermes/test_log.py | transifex/hermes | cbe9f6f3fc61bf2e1dcabc55ab6bdb4a67d49267 | [
"BSD-3-Clause"
] | 2 | 2015-07-07T22:48:51.000Z | 2015-12-11T10:09:12.000Z | test_hermes/test_log.py | transifex/hermes | cbe9f6f3fc61bf2e1dcabc55ab6bdb4a67d49267 | [
"BSD-3-Clause"
] | 1 | 2015-03-18T17:19:20.000Z | 2015-03-18T17:19:20.000Z | test_hermes/test_log.py | transifex/hermes | cbe9f6f3fc61bf2e1dcabc55ab6bdb4a67d49267 | [
"BSD-3-Clause"
] | 2 | 2018-10-23T17:00:59.000Z | 2021-03-18T12:16:35.000Z | from unittest import TestCase
from hermes import log as hermes_log
from multiprocessing import current_process
class LogTestCase(TestCase):
def test_get_logger_creates_logger_and_adds_handler_only_once(self):
logger = hermes_log.get_logger(current_process())
self.assertIsNotNone(logger)
s... | 31.333333 | 72 | 0.761702 |
7a9c6fbbf43610638ea8ceb2b2ce0a0b1fef1a93 | 8,832 | py | Python | movo_common/movo_third_party/simple_grasping/scripts/pick_and_place.py | syc7446/kinova-movo | 28bec5bb61517f970071782a32ac58e92c67f0df | [
"BSD-3-Clause"
] | 1 | 2021-06-24T19:20:01.000Z | 2021-06-24T19:20:01.000Z | movo_common/movo_third_party/simple_grasping/scripts/pick_and_place.py | syc7446/kinova-movo | 28bec5bb61517f970071782a32ac58e92c67f0df | [
"BSD-3-Clause"
] | null | null | null | movo_common/movo_third_party/simple_grasping/scripts/pick_and_place.py | syc7446/kinova-movo | 28bec5bb61517f970071782a32ac58e92c67f0df | [
"BSD-3-Clause"
] | 1 | 2020-01-21T11:05:24.000Z | 2020-01-21T11:05:24.000Z | #!/usr/bin/env python
# Copyright 2013-2014, Unbounded Robotics, 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 copyright
# ... | 42.873786 | 126 | 0.660666 |
dd48fbfb8571b262736fd6ec3ef747b4c7acc768 | 1,891 | py | Python | rastervision/data/label_store/chip_classification_geojson_store.py | carderne/raster-vision | 915fbcd3263d8f2193e65c2cd0eb53e050a47a01 | [
"Apache-2.0"
] | 3 | 2020-07-05T04:04:18.000Z | 2021-02-05T16:19:55.000Z | rastervision/data/label_store/chip_classification_geojson_store.py | carderne/raster-vision | 915fbcd3263d8f2193e65c2cd0eb53e050a47a01 | [
"Apache-2.0"
] | null | null | null | rastervision/data/label_store/chip_classification_geojson_store.py | carderne/raster-vision | 915fbcd3263d8f2193e65c2cd0eb53e050a47a01 | [
"Apache-2.0"
] | 1 | 2020-04-27T15:21:53.000Z | 2020-04-27T15:21:53.000Z | from rastervision.data.label import ChipClassificationLabels
from rastervision.data.label_store import LabelStore
from rastervision.data.label_store.utils import boxes_to_geojson
from rastervision.data.label_source import ChipClassificationLabelSource
from rastervision.data.vector_source import GeoJSONVectorSource
from... | 36.365385 | 79 | 0.684823 |
be18177c10ddd0dbdd5deadc20af44b5dbed48f5 | 824 | py | Python | 1. Python/Control Structures/3. Smallest Positive Number/smallese_positive.py | theparitoshkumar/Data-Structures-Algorithms-using-python | 445b9dee56bca637f21267114cc1686d333ea4c4 | [
"Apache-2.0"
] | 1 | 2021-12-05T18:02:15.000Z | 2021-12-05T18:02:15.000Z | 1. Python/Control Structures/3. Smallest Positive Number/smallese_positive.py | theparitoshkumar/Data-Structures-Algorithms-using-python | 445b9dee56bca637f21267114cc1686d333ea4c4 | [
"Apache-2.0"
] | null | null | null | 1. Python/Control Structures/3. Smallest Positive Number/smallese_positive.py | theparitoshkumar/Data-Structures-Algorithms-using-python | 445b9dee56bca637f21267114cc1686d333ea4c4 | [
"Apache-2.0"
] | null | null | null | """
In the following exercise you will finish writing smallest_positive which is a function that finds the smallest positive number in a list.
"""
def smallest_positive(in_list):
# TODO: Define a control structure that finds the smallest positive
# number in in_list and returns the correct smallest number.
... | 32.96 | 138 | 0.658981 |
4aa983a4b81f0080c47d86182164f607ecfb6269 | 18,295 | py | Python | rllib/utils/exploration/curiosity.py | jamesliu/ray | 11ab412db1fa3603a3006e8ed414e80dd1f11c0c | [
"Apache-2.0"
] | 3 | 2020-12-12T05:10:44.000Z | 2021-04-12T21:52:47.000Z | rllib/utils/exploration/curiosity.py | jamesliu/ray | 11ab412db1fa3603a3006e8ed414e80dd1f11c0c | [
"Apache-2.0"
] | 227 | 2021-10-01T08:00:01.000Z | 2021-12-28T16:47:26.000Z | rllib/utils/exploration/curiosity.py | gramhagen/ray | c18caa4db36d466718bdbcb2229aa0b2dc03da1f | [
"Apache-2.0"
] | 1 | 2020-12-02T06:26:20.000Z | 2020-12-02T06:26:20.000Z | from gym.spaces import Discrete, MultiDiscrete, Space
import numpy as np
from typing import Optional, Tuple, Union
from ray.rllib.models.action_dist import ActionDistribution
from ray.rllib.models.catalog import ModelCatalog
from ray.rllib.models.modelv2 import ModelV2
from ray.rllib.models.tf.tf_action_dist import Ca... | 45.397022 | 79 | 0.623558 |
393316a3d8ccfe5bf4d6123a037737cb7503f8fd | 1,447 | py | Python | library/webdriver_manager/chrome.py | batu1579/NCUT-library-auto-answer | d8b8a37548e3b58b6e030323b116450cc4c3178a | [
"MIT"
] | 1 | 2021-08-12T15:45:06.000Z | 2021-08-12T15:45:06.000Z | library/webdriver_manager/chrome.py | batu1579/NCUT-library-auto-answer | d8b8a37548e3b58b6e030323b116450cc4c3178a | [
"MIT"
] | null | null | null | library/webdriver_manager/chrome.py | batu1579/NCUT-library-auto-answer | d8b8a37548e3b58b6e030323b116450cc4c3178a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
import logging
import os
from .driver import ChromeDriver
from .logger import log
from .manager import DriverManager
from .utils import ChromeType, os_type
class ChromeDriverManager(DriverManager):
def __init__(self, version="latest",
os_type=os_type(),
... | 37.102564 | 107 | 0.587422 |
8dc87648ab80cd40fb9305e1e131aa8adf587d72 | 14,778 | py | Python | DylMath.py | FrankWSamuelson/merge-sort | 524b3f355228f97e3b4ac8b10b993e8558a20cd9 | [
"CC0-1.0"
] | null | null | null | DylMath.py | FrankWSamuelson/merge-sort | 524b3f355228f97e3b4ac8b10b993e8558a20cd9 | [
"CC0-1.0"
] | null | null | null | DylMath.py | FrankWSamuelson/merge-sort | 524b3f355228f97e3b4ac8b10b993e8558a20cd9 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/python3.6
import ROC1
import numpy as np
np.set_printoptions(threshold=np.inf)
np.seterr(all="ignore")
from multiprocessing import Pool
from scipy.interpolate import interp1d
from scipy.stats import norm
try:
import matplotlib
matplotlib.use('QT4Agg')
import matplotlib.pyplot as plt
font: dict = {'size' ... | 38.584856 | 324 | 0.649817 |
d4eb842e9ecbd9f52f8f62a46f68a5b7323e1c80 | 466 | py | Python | examples/raven_django_example/urls.py | ucamhal/ravenpy | 64d2a94c160f2d81ba622858b2367d55e1912129 | [
"MIT"
] | 1 | 2019-04-26T23:58:13.000Z | 2019-04-26T23:58:13.000Z | examples/raven_django_example/urls.py | ucamhal/ravenpy | 64d2a94c160f2d81ba622858b2367d55e1912129 | [
"MIT"
] | null | null | null | examples/raven_django_example/urls.py | ucamhal/ravenpy | 64d2a94c160f2d81ba622858b2367d55e1912129 | [
"MIT"
] | null | null | null | from django.conf.urls.defaults import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', 'raven_django_example.app.views.home', name='home'),
url(r'^private/$', 'raven_django_example.app.views.p... | 33.285714 | 81 | 0.716738 |
96c0bdf4b01d6cc46228b48a41a1b0b5335f8697 | 1,650 | py | Python | keras/mixed_precision/get_layer_policy_test.py | Halo9Pan/dive-keras | 7d4c5572fa3a9fc2542a1314d06c555f67575cb0 | [
"Apache-2.0"
] | 37,222 | 2017-12-13T00:52:55.000Z | 2022-03-31T22:34:35.000Z | keras/mixed_precision/get_layer_policy_test.py | amirsadafi/keras | f1e9c76675981ee6683f54a3ce569212d551d12d | [
"Apache-2.0"
] | 7,624 | 2017-12-13T01:03:40.000Z | 2022-03-31T23:57:24.000Z | keras/mixed_precision/get_layer_policy_test.py | amirsadafi/keras | f1e9c76675981ee6683f54a3ce569212d551d12d | [
"Apache-2.0"
] | 14,914 | 2017-12-13T02:30:46.000Z | 2022-03-30T14:49:16.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... | 35.106383 | 80 | 0.72303 |
9f35d24ec08f85d2f9131f0ebb5c26c8b7d9609f | 8,461 | py | Python | modules/photons_canvas/animations/registered/color_cycle.py | Djelibeybi/photons | bc0aa91771d8e88fd3c691fb58f18cb876f292ec | [
"MIT"
] | 51 | 2020-07-03T08:34:48.000Z | 2022-03-16T10:56:08.000Z | modules/photons_canvas/animations/registered/color_cycle.py | delfick/photons | bc0aa91771d8e88fd3c691fb58f18cb876f292ec | [
"MIT"
] | 81 | 2020-07-03T08:13:59.000Z | 2022-03-31T23:02:54.000Z | modules/photons_canvas/animations/registered/color_cycle.py | Djelibeybi/photons | bc0aa91771d8e88fd3c691fb58f18cb876f292ec | [
"MIT"
] | 8 | 2020-07-24T23:48:20.000Z | 2021-05-24T17:20:16.000Z | from photons_canvas.animations import Animation, an_animation
from photons_canvas import point_helpers as php
from delfick_project.norms import dictobj, sb
from collections import defaultdict
import random
import math
changers = {}
class changer:
def __init__(self, name):
self.name = name
def __cal... | 27.924092 | 100 | 0.600756 |
a928c878dec9538acd23ade3ad869f6a4fa04362 | 415 | py | Python | graphene_django_app/wsgi.py | piash222/graphql_django_app | 00556b7b40010d59973da1483d19c8f5bab6ead6 | [
"MIT"
] | null | null | null | graphene_django_app/wsgi.py | piash222/graphql_django_app | 00556b7b40010d59973da1483d19c8f5bab6ead6 | [
"MIT"
] | 4 | 2021-03-19T01:00:13.000Z | 2021-09-22T18:46:54.000Z | graphene_django_app/wsgi.py | piash222/graphql_django_app | 00556b7b40010d59973da1483d19c8f5bab6ead6 | [
"MIT"
] | null | null | null | """
WSGI config for graphene_django_app project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('... | 24.411765 | 79 | 0.79759 |
e7f73dabc777389832b0d2a8d5119668ad1ef85a | 1,055 | py | Python | aston/spectra/math.py | bovee/Aston | 315871346df72b3e8fcfa9943e8a3519e60299ff | [
"BSD-3-Clause"
] | 13 | 2015-07-16T19:02:50.000Z | 2022-03-29T08:17:51.000Z | aston/spectra/math.py | larsyunker/Aston | 315871346df72b3e8fcfa9943e8a3519e60299ff | [
"BSD-3-Clause"
] | 13 | 2015-12-16T05:17:35.000Z | 2021-06-07T10:45:53.000Z | aston/spectra/math.py | larsyunker/Aston | 315871346df72b3e8fcfa9943e8a3519e60299ff | [
"BSD-3-Clause"
] | 6 | 2017-03-24T20:18:26.000Z | 2021-12-01T04:16:59.000Z | import numpy as np
from scipy.sparse import dia_matrix
from scipy.sparse import lil_matrix
# TODO: implementations of Stein & Scott 1994 algorithms
def find_spectrum_match(spec, spec_lib, method='euclidian'):
"""
Find spectrum in spec_lib most similar to spec.
"""
# filter out any points with abundan... | 37.678571 | 76 | 0.637915 |
f1b327b26bf23d7d8fb39fcdab10f1aa2a8f6813 | 8,132 | py | Python | src/oscar/apps/basket/middleware.py | akiyoko/oscar_sandbox | b384f1c0b5f297fd4b84509a575f6766a48630a5 | [
"BSD-3-Clause"
] | 68 | 2016-11-06T05:07:57.000Z | 2021-12-17T09:17:38.000Z | src/oscar/apps/basket/middleware.py | akiyoko/oscar_sandbox | b384f1c0b5f297fd4b84509a575f6766a48630a5 | [
"BSD-3-Clause"
] | null | null | null | src/oscar/apps/basket/middleware.py | akiyoko/oscar_sandbox | b384f1c0b5f297fd4b84509a575f6766a48630a5 | [
"BSD-3-Clause"
] | 28 | 2016-12-04T07:12:50.000Z | 2021-02-06T21:13:15.000Z | from django.conf import settings
from django.contrib import messages
from django.core.signing import BadSignature, Signer
from django.utils.functional import SimpleLazyObject, empty
from django.utils.translation import ugettext_lazy as _
from oscar.core.loading import get_class, get_model
Applicator = get_class('offe... | 39.285024 | 99 | 0.622356 |
a3fef552a3c7c0c51ab7b6c3635a9fa25c41c561 | 7,976 | py | Python | eggs/Paste-1.7.5.1-py2.7.egg/paste/modpython.py | salayhin/talkofacta | 8b5a14245dd467bb1fda75423074c4840bd69fb7 | [
"MIT"
] | 19 | 2015-05-01T19:59:03.000Z | 2021-12-09T08:03:16.000Z | eggs/Paste-1.7.5.1-py2.7.egg/paste/modpython.py | salayhin/talkofacta | 8b5a14245dd467bb1fda75423074c4840bd69fb7 | [
"MIT"
] | 1 | 2018-01-03T15:26:49.000Z | 2018-01-03T15:26:49.000Z | eggs/Paste-1.7.5.1-py2.7.egg/paste/modpython.py | salayhin/talkofacta | 8b5a14245dd467bb1fda75423074c4840bd69fb7 | [
"MIT"
] | 30 | 2015-03-25T19:40:07.000Z | 2021-05-28T22:59:26.000Z | """WSGI Paste wrapper for mod_python. Requires Python 2.2 or greater.
Example httpd.conf section for a Paste app with an ini file::
<Location />
SetHandler python-program
PythonHandler paste.modpython
PythonOption paste.ini /some/location/your/pasteconfig.ini
</Location>
Or if yo... | 31.525692 | 89 | 0.587262 |
ad768dc759142b771f842938fbdd318ada95944a | 1,574 | py | Python | tests/artifactcli/operation/test_list.py | arcizan/artifact-cli | 1b4ddcd8bb3c32899fa385eefd128829c8cdd6e5 | [
"Apache-2.0"
] | 10 | 2015-01-11T14:43:57.000Z | 2020-05-08T06:18:30.000Z | tests/artifactcli/operation/test_list.py | arcizan/artifact-cli | 1b4ddcd8bb3c32899fa385eefd128829c8cdd6e5 | [
"Apache-2.0"
] | 34 | 2015-01-04T17:37:54.000Z | 2019-11-11T17:11:24.000Z | tests/artifactcli/operation/test_list.py | arcizan/artifact-cli | 1b4ddcd8bb3c32899fa385eefd128829c8cdd6e5 | [
"Apache-2.0"
] | 4 | 2015-01-11T07:05:33.000Z | 2021-11-17T04:26:32.000Z | import unittest
from datetime import datetime
from artifactcli.artifact import *
from artifactcli.driver import *
from artifactcli.operation import *
from artifactcli.repository import Repository
class TestListOperation(unittest.TestCase):
def test_run(self):
arts = [
Artifact(BasicInfo('com.... | 46.294118 | 91 | 0.559085 |
2c759063e4527468359fa2020243efc55c5b071b | 10,281 | py | Python | tests_obsolete/extension/pipeline_/multi_output/test_pipeline_multi_output.py | akmaru/veriloggen | 74f998139e8cf613f7703fa4cffd571bbf069bbc | [
"Apache-2.0"
] | 232 | 2015-09-01T16:07:48.000Z | 2022-03-28T14:53:28.000Z | tests_obsolete/extension/pipeline_/multi_output/test_pipeline_multi_output.py | akmaru/veriloggen | 74f998139e8cf613f7703fa4cffd571bbf069bbc | [
"Apache-2.0"
] | 34 | 2015-08-21T09:13:03.000Z | 2022-03-21T23:52:44.000Z | tests_obsolete/extension/pipeline_/multi_output/test_pipeline_multi_output.py | akmaru/veriloggen | 74f998139e8cf613f7703fa4cffd571bbf069bbc | [
"Apache-2.0"
] | 46 | 2015-09-24T14:39:57.000Z | 2022-02-23T21:59:56.000Z | from __future__ import absolute_import
from __future__ import print_function
import veriloggen
import pipeline_multi_output
expected_verilog = """
module test;
reg CLK;
reg RST;
reg [32-1:0] x;
reg vx;
wire rx;
reg [32-1:0] y;
reg vy;
wire ry;
wire [32-1:0] z;
wire vz;
reg rz;
wire [32-1:0] a;
... | 19.809249 | 107 | 0.481276 |
8d2c4c7fff4b901e1ebbf43a20958cbdc097198c | 6,102 | py | Python | utils/dataset_DCL.py | LichenYang-Jeffrey/DCL-with-Efficient-B7 | 84940c96a8c7926c630a7a6d5bfd5c6e52a57c2e | [
"MIT"
] | 4 | 2020-05-28T08:47:39.000Z | 2020-11-16T08:23:26.000Z | utils/dataset_DCL.py | LichenYang-Jeffrey/DCL-with-Efficient-B7 | 84940c96a8c7926c630a7a6d5bfd5c6e52a57c2e | [
"MIT"
] | null | null | null | utils/dataset_DCL.py | LichenYang-Jeffrey/DCL-with-Efficient-B7 | 84940c96a8c7926c630a7a6d5bfd5c6e52a57c2e | [
"MIT"
] | null | null | null | # coding=utf8
from __future__ import division
import os
import torch
import torch.utils.data as data
import pandas
import random
import numpy as np
import PIL.Image as Image
from PIL import ImageStat
import pdb
def random_sample(img_names, labels):
anno_dict = {}
img_list = []
anno_list = []
for img, ... | 34.089385 | 139 | 0.603573 |
949ede9cabc23cbb3bac987a4cfc2a30f47bdb68 | 1,540 | py | Python | r3c0n/engines/virustotal.py | markgacoka/r3c0n | ac64614d10d176b9de2170ce8758a6aa75d75f54 | [
"MIT"
] | 4 | 2022-03-06T16:42:23.000Z | 2022-03-09T02:29:08.000Z | r3c0n/engines/virustotal.py | markgacoka/r3c0n | ac64614d10d176b9de2170ce8758a6aa75d75f54 | [
"MIT"
] | null | null | null | r3c0n/engines/virustotal.py | markgacoka/r3c0n | ac64614d10d176b9de2170ce8758a6aa75d75f54 | [
"MIT"
] | 1 | 2022-03-07T03:37:51.000Z | 2022-03-07T03:37:51.000Z | from r3c0nutils.user_agent import GET_UA
import requests
class VirusTotal:
def __init__(self, domain):
self.domain = domain
self.subdomain_lst = []
def virustotal_script(self, domain):
VT_API_KEY = ""
if VT_API_KEY == "":
print("No VirusTotal API key configured", "... | 40.526316 | 135 | 0.592857 |
014345399a4480b4e10c8d289234af1a57629612 | 8,633 | py | Python | docs/conf.py | fakedrtom/cancer_gemini | e2dd5cf056004409b58f1e2d98589f847a7e0e2f | [
"MIT"
] | 221 | 2015-01-13T20:04:50.000Z | 2022-02-02T10:41:02.000Z | docs/conf.py | fakedrtom/cancer_gemini | e2dd5cf056004409b58f1e2d98589f847a7e0e2f | [
"MIT"
] | 441 | 2015-01-12T20:00:41.000Z | 2022-01-21T08:58:41.000Z | docs/conf.py | fakedrtom/cancer_gemini | e2dd5cf056004409b58f1e2d98589f847a7e0e2f | [
"MIT"
] | 111 | 2015-01-27T10:53:47.000Z | 2021-12-22T14:21:19.000Z | # -*- coding: utf-8 -*-
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys
imp... | 32.454887 | 104 | 0.699062 |
91db43f3b84a9f3581c5d4311378cd4fc20fd8b7 | 591 | py | Python | Chapter 3/sequence-tuples.py | JoeBugajski/python-examples | c32472900a68aca43d699c610f6f50638b9ddb98 | [
"MIT"
] | null | null | null | Chapter 3/sequence-tuples.py | JoeBugajski/python-examples | c32472900a68aca43d699c610f6f50638b9ddb98 | [
"MIT"
] | null | null | null | Chapter 3/sequence-tuples.py | JoeBugajski/python-examples | c32472900a68aca43d699c610f6f50638b9ddb98 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2009-2017 BHG http://bw.org/
# unlike lists, tuples are not mutable. They are bound in parentheses like this:
x = ( 1, 2, 3, 4, 5 )
# if you uncomment this next line and run the file:
# x[2] = 69
# you can see the error you'd get for trying to
# alter an immutable tuple
# Tuples... | 28.142857 | 80 | 0.698816 |
add98c61650b845bd60146215b0352b2338bfde4 | 67,425 | py | Python | tests/unit/modules/test_debian_ip.py | fake-name/salt | d8f04936e4407f51946e32e8166159778f6c31a5 | [
"Apache-2.0"
] | null | null | null | tests/unit/modules/test_debian_ip.py | fake-name/salt | d8f04936e4407f51946e32e8166159778f6c31a5 | [
"Apache-2.0"
] | null | null | null | tests/unit/modules/test_debian_ip.py | fake-name/salt | d8f04936e4407f51946e32e8166159778f6c31a5 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
:codeauthor: Jayesh Kariya <jayeshk@saltstack.com>
"""
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
from collections import OrderedDict as odict
import tempfile
import os
# Import Salt Testing Libs
from tests.support.mixins import Loader... | 40.181764 | 106 | 0.39033 |
57afe9c903c677907e50d2e094d56d5750c56899 | 4,566 | py | Python | scripts/histogram.py | souryadey/mlp-ondevice-training | 5d740f9051c1d4348b43780bb3f3b67a8d888a21 | [
"MIT"
] | 2 | 2021-11-17T04:21:28.000Z | 2021-12-17T17:16:53.000Z | scripts/histogram.py | souryadey/mlp-ondevice-training | 5d740f9051c1d4348b43780bb3f3b67a8d888a21 | [
"MIT"
] | null | null | null | scripts/histogram.py | souryadey/mlp-ondevice-training | 5d740f9051c1d4348b43780bb3f3b67a8d888a21 | [
"MIT"
] | null | null | null | #Mahdi
#This file reads the output from the simulator
#and generates the histogram based on the values and accuracy
import matplotlib.pyplot as plt
import struct
import math
import sys
########################## ONLY CHANGE THIS SECTION ###########################
int_bits = 5
frac_bits = 10
base = 2
#################... | 31.93007 | 95 | 0.601621 |
c2f2d69d040c8b646e369fa93196145d1c869ced | 2,225 | py | Python | changewall.py | bisho1995/python-change-wallpaper | 7b7aedf0b51236ed382252baa2a6a3d4a19b593e | [
"MIT"
] | null | null | null | changewall.py | bisho1995/python-change-wallpaper | 7b7aedf0b51236ed382252baa2a6a3d4a19b593e | [
"MIT"
] | null | null | null | changewall.py | bisho1995/python-change-wallpaper | 7b7aedf0b51236ed382252baa2a6a3d4a19b593e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from urllib.request import Request, urlopen
import urllib
from bs4 import BeautifulSoup
import json
from random import randint
import requests
import subprocess
import imghdr
import os
if len(sys.argv)<2:
print("Provide Name.")
exit()
if len(sys.argv)>2:
pri... | 31.785714 | 144 | 0.735281 |
7c86d4ac2ac986614bf92c4cdf46e03dd5003456 | 33,311 | py | Python | pypy/lib-python/3/test/test_contextlib.py | Clear-Sight/cython-vs-pypy-performance | a81df5e1dbc115468ddfd60670ddfad448a5c992 | [
"MIT"
] | 1 | 2021-06-02T23:02:09.000Z | 2021-06-02T23:02:09.000Z | pypy/lib-python/3/test/test_contextlib.py | Clear-Sight/cython-vs-pypy-performance | a81df5e1dbc115468ddfd60670ddfad448a5c992 | [
"MIT"
] | 1 | 2021-03-30T18:08:41.000Z | 2021-03-30T18:08:41.000Z | pypy/lib-python/3/test/test_contextlib.py | Clear-Sight/cython-vs-pypy-performance | a81df5e1dbc115468ddfd60670ddfad448a5c992 | [
"MIT"
] | null | null | null | """Unit tests for contextlib.py, and other context managers."""
import asyncio
import io
import sys
import tempfile
import threading
import unittest
from contextlib import * # Tests __all__
from test import support
import weakref
class TestAbstractContextManager(unittest.TestCase):
def test_enter(self):
... | 31.455146 | 80 | 0.576957 |
9dc7f10269fd139752b5183078e9f7461746cc4a | 30,214 | py | Python | data_gen/test3.py | UILXELA/Cooperative-3D-Object-Detection-Using-Shared-Raw-LIDAR-Data | 84b3c792fcea5c618737855cd0d65c7b7b6e16f6 | [
"MIT"
] | 6 | 2021-03-04T06:16:55.000Z | 2022-01-11T07:12:16.000Z | data_gen/test3.py | UILXELA/Cooperative-3D-Object-Detection-Using-Shared-Raw-LIDAR-Data | 84b3c792fcea5c618737855cd0d65c7b7b6e16f6 | [
"MIT"
] | null | null | null | data_gen/test3.py | UILXELA/Cooperative-3D-Object-Detection-Using-Shared-Raw-LIDAR-Data | 84b3c792fcea5c618737855cd0d65c7b7b6e16f6 | [
"MIT"
] | 2 | 2021-04-07T01:43:19.000Z | 2021-12-06T14:47:36.000Z | #!/usr/bin/env python
# Copyright (c) 2019 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
import math
import glob
import os
import sys
import argparse
import logging
i... | 38.39136 | 213 | 0.624611 |
b8ff61eaa94c563e39e5005924c400ab1d5b2ef3 | 485 | py | Python | models/__init__.py | Skhaki18/APS360 | 4a386fc8ee14802bcb5ef25eefc234160673896a | [
"MIT"
] | 1 | 2022-02-09T20:35:05.000Z | 2022-02-09T20:35:05.000Z | models/__init__.py | Skhaki18/APS360 | 4a386fc8ee14802bcb5ef25eefc234160673896a | [
"MIT"
] | null | null | null | models/__init__.py | Skhaki18/APS360 | 4a386fc8ee14802bcb5ef25eefc234160673896a | [
"MIT"
] | null | null | null | from models.pretrain import pretrainedResNet, pretrainedMobileNetLarge,pretrainedMobileLowRes, fine_tuningResNet, fine_tuningMobileNet
def get_model(model_type, **kwargs):
models = {
# 'ResNet': pretrainedResNet,
'resnet50': pretrainedResNet,
'mobile1': pretrainedMobileNetLarge,
'mo... | 40.416667 | 134 | 0.725773 |
85ad17f6bbe7a36a8065e804cc6a6bd07f64a755 | 1,118 | py | Python | winlogbeat/tests/system/test_config.py | dneg/beats | d4817cdfd5b451093db8bfbf91d3493b84de23d0 | [
"Apache-2.0"
] | null | null | null | winlogbeat/tests/system/test_config.py | dneg/beats | d4817cdfd5b451093db8bfbf91d3493b84de23d0 | [
"Apache-2.0"
] | null | null | null | winlogbeat/tests/system/test_config.py | dneg/beats | d4817cdfd5b451093db8bfbf91d3493b84de23d0 | [
"Apache-2.0"
] | 1 | 2019-11-29T12:31:15.000Z | 2019-11-29T12:31:15.000Z | from winlogbeat import BaseTest
"""
Contains tests for config parsing.
"""
class Test(BaseTest):
def test_valid_config(self):
"""
With -configtest and an error in the configuration, it should
return a non-zero error code.
"""
self.render_config_template(
ignor... | 27.268293 | 69 | 0.559034 |
c4b8065b96b697f577a41ba80648f28d69efe6b7 | 13,843 | py | Python | tests/test_unit/test_detect_type.py | baldurmen/CleverCSV | a7c7c812f2dc220b8f45f3409daac6e933bc44a2 | [
"MIT"
] | 989 | 2019-02-22T12:14:17.000Z | 2022-03-28T01:33:20.000Z | tests/test_unit/test_detect_type.py | baldurmen/CleverCSV | a7c7c812f2dc220b8f45f3409daac6e933bc44a2 | [
"MIT"
] | 27 | 2019-12-22T00:09:28.000Z | 2022-03-30T22:45:50.000Z | tests/test_unit/test_detect_type.py | baldurmen/CleverCSV | a7c7c812f2dc220b8f45f3409daac6e933bc44a2 | [
"MIT"
] | 55 | 2019-10-22T13:09:53.000Z | 2022-01-03T04:28:26.000Z | # -*- coding: utf-8 -*-
"""
Unit tests for the type detection.
Author: Gertjan van den Burg
"""
import unittest
from clevercsv.detect_type import TypeDetector
from clevercsv.detect_type import type_score
from clevercsv.dialect import SimpleDialect
class TypeDetectorTestCase(unittest.TestCase):
def setUp(self... | 31.822989 | 123 | 0.453803 |
4a48723370220f5bab345a2e81cf021b7de575a7 | 1,408 | py | Python | data-hub-api/apps/cdms_api/tests/integration/customer_addresses/test_delete.py | uktrade/data-hub-api-old | 5ecf093d88692870982a638ced45de6a82d55672 | [
"MIT"
] | null | null | null | data-hub-api/apps/cdms_api/tests/integration/customer_addresses/test_delete.py | uktrade/data-hub-api-old | 5ecf093d88692870982a638ced45de6a82d55672 | [
"MIT"
] | 18 | 2016-04-04T12:42:45.000Z | 2016-09-01T07:21:05.000Z | data-hub-api/apps/cdms_api/tests/integration/customer_addresses/test_delete.py | uktrade/data-hub-api-old | 5ecf093d88692870982a638ced45de6a82d55672 | [
"MIT"
] | 1 | 2016-06-01T15:45:21.000Z | 2016-06-01T15:45:21.000Z | from ....exceptions import CDMSNotFoundException
from .existing_customer_address_test_case import ExistingCustomerAddressTestCase
class TestDelete(ExistingCustomerAddressTestCase):
def test_delete_cascade(self):
"""
Client delete on Account deletes 2 child CustomerAddresses
"""
se... | 42.666667 | 81 | 0.698153 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.