hexsha
stringlengths
40
40
size
int64
2
1.02M
ext
stringclasses
10 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
4
245
max_stars_repo_name
stringlengths
6
130
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
10
max_stars_count
int64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
4
245
max_issues_repo_name
stringlengths
6
130
max_issues_repo_head_hexsha
stringlengths
40
40
max_issues_repo_licenses
listlengths
1
10
max_issues_count
int64
1
67k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
4
245
max_forks_repo_name
stringlengths
6
130
max_forks_repo_head_hexsha
stringlengths
40
40
max_forks_repo_licenses
listlengths
1
10
max_forks_count
int64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
2
1.02M
avg_line_length
float64
1
417k
max_line_length
int64
1
987k
alphanum_fraction
float64
0
1
content_no_comment
stringlengths
0
1.01M
is_comment_constant_removed
bool
1 class
is_sharp_comment_removed
bool
1 class
f702639b0a5a2b1ee290b9721b4444d46a26ff08
17,303
py
Python
python/generate_python_ctypes.py
arves100/allegro5
6187893e4ece9258136d864bf4b99cb9371d56c5
[ "BSD-3-Clause" ]
1
2020-02-19T10:56:38.000Z
2020-02-19T10:56:38.000Z
python/generate_python_ctypes.py
arves100/allegro5
6187893e4ece9258136d864bf4b99cb9371d56c5
[ "BSD-3-Clause" ]
null
null
null
python/generate_python_ctypes.py
arves100/allegro5
6187893e4ece9258136d864bf4b99cb9371d56c5
[ "BSD-3-Clause" ]
1
2019-04-15T18:02:27.000Z
2019-04-15T18:02:27.000Z
#!/usr/bin/env python import sys import re import optparse from ctypes import * """ This script will use the prototypes from "checkdocs.py -s" to concoct a 1:1 Python wrapper for Allegro. """ class _AL_UTF8String: pass class Allegro: def __init__(self): self.types = {} self.functions = {} ...
32.042593
78
0.46385
import sys import re import optparse from ctypes import * class _AL_UTF8String: pass class Allegro: def __init__(self): self.types = {} self.functions = {} self.constants = {} def add_struct(self, name): x = type(name, (Structure, ), {}) self.types[name] = x ...
true
true
f70265c426e2f1f8f9b431c4f8ec20ae69355199
3,292
py
Python
one_barangay/scripts/google_cloud_storage.py
PrynsTag/oneBarangay
6a8d56003d85b8385e91f5c5d81208619023c1ee
[ "Apache-2.0" ]
null
null
null
one_barangay/scripts/google_cloud_storage.py
PrynsTag/oneBarangay
6a8d56003d85b8385e91f5c5d81208619023c1ee
[ "Apache-2.0" ]
96
2021-08-28T12:37:02.000Z
2022-03-23T04:25:12.000Z
one_barangay/scripts/google_cloud_storage.py
PrynsTag/oneBarangay
6a8d56003d85b8385e91f5c5d81208619023c1ee
[ "Apache-2.0" ]
null
null
null
"""File for Google Cloud Storage.""" import logging import os import urllib.parse from pathlib import Path import aiohttp from aiofile import AIOFile from gcloud.aio.storage import Storage from google.cloud import storage from one_barangay.local_settings import logger async def async_upload_to_bucket( filepath:...
29.392857
94
0.670109
import logging import os import urllib.parse from pathlib import Path import aiohttp from aiofile import AIOFile from gcloud.aio.storage import Storage from google.cloud import storage from one_barangay.local_settings import logger async def async_upload_to_bucket( filepath: str, file_obj, gcs_path: str...
true
true
f70265d6f013c90b4be07e53a84444ab11712fa3
6,805
py
Python
exps/LFNA/basic-same.py
xgmiao/AutoDL-Projects
0dbbc286c9f56136291590136fffd513af881c36
[ "MIT" ]
1
2021-05-11T00:41:15.000Z
2021-05-11T00:41:15.000Z
exps/LFNA/basic-same.py
xgmiao/AutoDL-Projects
0dbbc286c9f56136291590136fffd513af881c36
[ "MIT" ]
null
null
null
exps/LFNA/basic-same.py
xgmiao/AutoDL-Projects
0dbbc286c9f56136291590136fffd513af881c36
[ "MIT" ]
null
null
null
##################################################### # Copyright (c) Xuanyi Dong [GitHub D-X-Y], 2021.04 # ##################################################### # python exps/LFNA/basic-same.py --srange 1-999 --env_version v1 --hidden_dim 16 # python exps/LFNA/basic-same.py --srange 1-999 --env_version v2 --hidden_dim...
33.688119
87
0.580309
t(), "model": model, "index": idx, "timestamp": env_info["{:}-timestamp".format(idx)], }, save_path, logger, ) logger.log("") per_timestamp_time.update(time.time() - start_time) start_time = time.time() ...
true
true
f70266abe169cc4c264c3fbf69d349d04e550aaa
1,206
py
Python
056_Merge_Intervals.py
adwardlee/leetcode_solutions
f386869161181e153e29165d8fff06492bb192f3
[ "MIT" ]
null
null
null
056_Merge_Intervals.py
adwardlee/leetcode_solutions
f386869161181e153e29165d8fff06492bb192f3
[ "MIT" ]
null
null
null
056_Merge_Intervals.py
adwardlee/leetcode_solutions
f386869161181e153e29165d8fff06492bb192f3
[ "MIT" ]
null
null
null
''' Given a collection of intervals, merge all overlapping intervals. Example 1: Input: intervals = [[1,3],[2,6],[8,10],[15,18]] Output: [[1,6],[8,10],[15,18]] Explanation: Since intervals [1,3] and [2,6] overlaps, merge them into [1,6]. Example 2: Input: intervals = [[1,4],[4,5]] Output: [[1,5]] Explanation: Interv...
29.414634
123
0.556385
class Solution: def merge(self, intervals: List[List[int]]) -> List[List[int]]: intervals = sorted(intervals, key = lambda x: x[0]) output = [] i = 0 if len(intervals) <= 1: return intervals while i < len(intervals) - 1: tmp = intervals[i] ...
true
true
f70266d5dff1d3d7c3f7c40adb716334cf21a6f6
426
py
Python
src/periodic_tasks_api/views.py
VladimirDominion/periodic_tasks_utils
c2f58fd5e6c154c17d95bd9e616f53fcf10a078d
[ "MIT" ]
null
null
null
src/periodic_tasks_api/views.py
VladimirDominion/periodic_tasks_utils
c2f58fd5e6c154c17d95bd9e616f53fcf10a078d
[ "MIT" ]
null
null
null
src/periodic_tasks_api/views.py
VladimirDominion/periodic_tasks_utils
c2f58fd5e6c154c17d95bd9e616f53fcf10a078d
[ "MIT" ]
null
null
null
from rest_framework import viewsets from periodic_tasks_api.models import CustomExtendedPeriodicTask from periodic_tasks_api.serializers import PeriodicTaskSerializer from periodic_tasks_api.filters import PeriodicTaskFilterSet class PeriodicTaskView(viewsets.ModelViewSet): queryset = CustomExtendedPeriodicTask....
35.5
65
0.86385
from rest_framework import viewsets from periodic_tasks_api.models import CustomExtendedPeriodicTask from periodic_tasks_api.serializers import PeriodicTaskSerializer from periodic_tasks_api.filters import PeriodicTaskFilterSet class PeriodicTaskView(viewsets.ModelViewSet): queryset = CustomExtendedPeriodicTask....
true
true
f70268226852644181840ef9f194176c95f6c74e
11,075
py
Python
network/switch.py
energieip/sol200-simulator
8e8aca9e25c972fd0d8d6cdfe06cbd7895ce90ac
[ "Apache-2.0" ]
null
null
null
network/switch.py
energieip/sol200-simulator
8e8aca9e25c972fd0d8d6cdfe06cbd7895ce90ac
[ "Apache-2.0" ]
null
null
null
network/switch.py
energieip/sol200-simulator
8e8aca9e25c972fd0d8d6cdfe06cbd7895ce90ac
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/python3 # coding: utf-8 from network.group import Group import paho.mqtt.client as mqtt from threading import Thread import time from log import logger import paho.mqtt.subscribe as subscribe import json import random import string class Switch(Thread): def __init__(self, broker_ip): Thread._...
39.695341
140
0.591332
from network.group import Group import paho.mqtt.client as mqtt from threading import Thread import time from log import logger import paho.mqtt.subscribe as subscribe import json import random import string class Switch(Thread): def __init__(self, broker_ip): Thread.__init__(self) self.broker...
true
true
f7026834a7a7d7b060fd2eab47981312a89bbc7e
4,063
py
Python
setup.py
mpbelhorn/OctoPrint-BedLevelVisualizer
77622c65a06a8eb3a12e9fad0281386334dc8314
[ "MIT" ]
null
null
null
setup.py
mpbelhorn/OctoPrint-BedLevelVisualizer
77622c65a06a8eb3a12e9fad0281386334dc8314
[ "MIT" ]
null
null
null
setup.py
mpbelhorn/OctoPrint-BedLevelVisualizer
77622c65a06a8eb3a12e9fad0281386334dc8314
[ "MIT" ]
null
null
null
# coding=utf-8 ######################################################################################################################## ### Do not forget to adjust the following variables to your own plugin. # The plugin's identifier, has to be unique plugin_identifier = "bedlevelvisualizer" # The plugin's python pa...
42.768421
140
0.707113
true
true
f702692290f1f965b54b54b17c0a5c2fc4387772
1,398
py
Python
tests/cases/py_client/parameter_name_conflict/client.py
koji8y/swagger-to
8c9201a71220b183aa55b10d61ec322008633f58
[ "MIT" ]
null
null
null
tests/cases/py_client/parameter_name_conflict/client.py
koji8y/swagger-to
8c9201a71220b183aa55b10d61ec322008633f58
[ "MIT" ]
null
null
null
tests/cases/py_client/parameter_name_conflict/client.py
koji8y/swagger-to
8c9201a71220b183aa55b10d61ec322008633f58
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # Automatically generated file by swagger_to. DO NOT EDIT OR APPEND ANYTHING! """Implements the client for test.""" # pylint: skip-file # pydocstyle: add-ignore=D105,D107,D401 import contextlib import json from typing import Any, BinaryIO, Dict, List, MutableMapping, Optional import requests i...
24.964286
95
0.615165
import contextlib import json from typing import Any, BinaryIO, Dict, List, MutableMapping, Optional import requests import requests.auth class RemoteCaller: def __init__(self, url_prefix: str, auth: Optional[requests.auth.AuthBase] = None) -> None: self.url_prefix = url_prefix self.auth =...
true
true
f702695464c85f76c6dbad36b5d94f9cc2ae757a
52,412
py
Python
caret_analyze/infra/lttng/records_provider_lttng.py
tier4/CARET_analyze
96f29eaaf1ff961f6410df38d938d421272f99f3
[ "Apache-2.0" ]
null
null
null
caret_analyze/infra/lttng/records_provider_lttng.py
tier4/CARET_analyze
96f29eaaf1ff961f6410df38d938d421272f99f3
[ "Apache-2.0" ]
12
2021-10-08T04:43:17.000Z
2022-03-22T10:42:53.000Z
caret_analyze/infra/lttng/records_provider_lttng.py
tier4/CARET_analyze
96f29eaaf1ff961f6410df38d938d421272f99f3
[ "Apache-2.0" ]
4
2021-12-14T05:47:14.000Z
2022-03-16T11:26:59.000Z
# Copyright 2021 Research Institute of Systems Planning, Inc. # # 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.128686
98
0.63869
from functools import cached_property from logging import getLogger from typing import Dict, List, Optional, Sequence, Tuple, Union from caret_analyze.value_objects.message_context import MessageContext, MessageContextType from .lttng import Lttng from .value_objects import PublisherValueLttng, Subscrip...
true
true
f7026a0eac2c1ee044ec2734f8fee2a9493d727c
2,977
py
Python
hexahue_map.py
kusuwada/hexahue
1c41a51fb40dbbfe24cf2c4d394808f932be6bb5
[ "MIT" ]
null
null
null
hexahue_map.py
kusuwada/hexahue
1c41a51fb40dbbfe24cf2c4d394808f932be6bb5
[ "MIT" ]
null
null
null
hexahue_map.py
kusuwada/hexahue
1c41a51fb40dbbfe24cf2c4d394808f932be6bb5
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # -*- coding:utf-8 -*- import yaml class HexahueMap(): def __init__(self, space_color): pink = (255, 0, 255) red = (255, 0, 0) green = (0, 255, 0) yellow = (255, 255, 0) blue = (0, 0, 255) sky = (0, 255, 255) white = (255, 255, 255) gray = (128, 128, 128) blac...
45.106061
67
0.59523
import yaml class HexahueMap(): def __init__(self, space_color): pink = (255, 0, 255) red = (255, 0, 0) green = (0, 255, 0) yellow = (255, 255, 0) blue = (0, 0, 255) sky = (0, 255, 255) white = (255, 255, 255) gray = (128, 128, 128) black = (0, 0, 0) self.hmap = {} self.hm...
true
true
f7026a4ae9f688521225dfaaa410970f7fe1bab1
90
py
Python
lesson_tasks/lesson6/num1.7.py
NikaEgorova/goiteens-python3-egorova
809059abf3464cbe4f0f116e52ce53534a0ca5ba
[ "MIT" ]
null
null
null
lesson_tasks/lesson6/num1.7.py
NikaEgorova/goiteens-python3-egorova
809059abf3464cbe4f0f116e52ce53534a0ca5ba
[ "MIT" ]
null
null
null
lesson_tasks/lesson6/num1.7.py
NikaEgorova/goiteens-python3-egorova
809059abf3464cbe4f0f116e52ce53534a0ca5ba
[ "MIT" ]
null
null
null
# 7 завдання for n in range(1, 101): print(n, "Я не буду їсти палички Бобо на уроці")
22.5
52
0.655556
for n in range(1, 101): print(n, "Я не буду їсти палички Бобо на уроці")
true
true
f7026b9e1ac955c01abf85c34e1a1742cdc43c1d
6,915
py
Python
SoftLayer/managers/ordering.py
corneil/softlayer-python
bbaf562fb76536c5cc652e356729723f38f48b66
[ "MIT" ]
1
2019-11-06T13:54:07.000Z
2019-11-06T13:54:07.000Z
SoftLayer/managers/ordering.py
underscorephil/softlayer-python
567540a328d5258e55594466127cd22b9a04a2ea
[ "MIT" ]
null
null
null
SoftLayer/managers/ordering.py
underscorephil/softlayer-python
567540a328d5258e55594466127cd22b9a04a2ea
[ "MIT" ]
1
2020-07-07T12:18:26.000Z
2020-07-07T12:18:26.000Z
""" SoftLayer.ordering ~~~~~~~~~~~~~~~~~~ Ordering Manager :license: MIT, see LICENSE for more details. """ class OrderingManager(object): """Manages hardware devices. :param SoftLayer.API.Client client: an API client instance """ def __init__(self, client): self.client = cl...
34.232673
79
0.599566
class OrderingManager(object): def __init__(self, client): self.client = client def get_packages_of_type(self, package_types, mask=None): package_service = self.client['Product_Package'] _filter = { 'type': { 'keyName': { 'operation': ...
true
true
f7026cd4a1731d33e95675f39f860e7e24cf332d
433
py
Python
BOJ/review/boj_14501.py
mrbartrns/swacademy_structure
778f0546030385237c383d81ec37d5bd9ed1272d
[ "MIT" ]
null
null
null
BOJ/review/boj_14501.py
mrbartrns/swacademy_structure
778f0546030385237c383d81ec37d5bd9ed1272d
[ "MIT" ]
null
null
null
BOJ/review/boj_14501.py
mrbartrns/swacademy_structure
778f0546030385237c383d81ec37d5bd9ed1272d
[ "MIT" ]
null
null
null
# BOJ 14501 import sys si = sys.stdin.readline t = [0] * 17 dp = [0] * 17 n = int(si()) for i in range(1, n + 1): m, o = map(int, si().split()) t[i] = m dp[i] = o def solve(n): ans = 0 for i in range(n, 0, -1): if i + t[i] > n + 1: dp[i] = dp[i + 1] else: ...
15.464286
56
0.418014
import sys si = sys.stdin.readline t = [0] * 17 dp = [0] * 17 n = int(si()) for i in range(1, n + 1): m, o = map(int, si().split()) t[i] = m dp[i] = o def solve(n): ans = 0 for i in range(n, 0, -1): if i + t[i] > n + 1: dp[i] = dp[i + 1] else: dp[i] = m...
true
true
f7026cf1cb17c940ba14868190ef89a631252ceb
1,663
py
Python
data/base_dataset.py
jaxondl/Recycle-GAN
d107d97e964d9d3921f36fe3c7837886f0f82eda
[ "MIT" ]
null
null
null
data/base_dataset.py
jaxondl/Recycle-GAN
d107d97e964d9d3921f36fe3c7837886f0f82eda
[ "MIT" ]
null
null
null
data/base_dataset.py
jaxondl/Recycle-GAN
d107d97e964d9d3921f36fe3c7837886f0f82eda
[ "MIT" ]
null
null
null
import torch.utils.data as data from PIL import Image import torchvision.transforms as transforms from torchvision.transforms import InterpolationMode class BaseDataset(data.Dataset): def __init__(self): super(BaseDataset, self).__init__() def name(self): return 'BaseDataset' def initiali...
35.382979
82
0.669874
import torch.utils.data as data from PIL import Image import torchvision.transforms as transforms from torchvision.transforms import InterpolationMode class BaseDataset(data.Dataset): def __init__(self): super(BaseDataset, self).__init__() def name(self): return 'BaseDataset' def initiali...
true
true
f7026dc30b9cca1f621e1e1f41f734e3e544092c
203
py
Python
tenx/apps.py
bpotvin-bccrc/colossus
fa5ca7ce4cfe794c7d2167acb868aa9167988941
[ "MIT" ]
2
2018-10-03T16:05:14.000Z
2019-03-08T23:01:29.000Z
tenx/apps.py
bpotvin-bccrc/colossus
fa5ca7ce4cfe794c7d2167acb868aa9167988941
[ "MIT" ]
3
2019-05-09T22:48:22.000Z
2020-06-05T18:52:05.000Z
tenx/apps.py
bpotvin-bccrc/colossus
fa5ca7ce4cfe794c7d2167acb868aa9167988941
[ "MIT" ]
4
2018-08-16T22:25:10.000Z
2021-02-19T16:10:15.000Z
""" Created Oct 19, 2017 @author: Spencer Vatrt-Watts (github.com/Spenca) """ from __future__ import unicode_literals from django.apps import AppConfig class TenxConfig(AppConfig): name = 'tenx'
15.615385
48
0.743842
from __future__ import unicode_literals from django.apps import AppConfig class TenxConfig(AppConfig): name = 'tenx'
true
true
f7026deba14677cec6bc3070ab5690249babe22c
5,966
py
Python
affine_cipher.py
premnagdeo/Cryptography
061b6557dd94d88ce9c669af8d6a6a414a834adc
[ "MIT" ]
1
2020-08-07T18:35:45.000Z
2020-08-07T18:35:45.000Z
affine_cipher.py
premnagdeo/Cryptography
061b6557dd94d88ce9c669af8d6a6a414a834adc
[ "MIT" ]
null
null
null
affine_cipher.py
premnagdeo/Cryptography
061b6557dd94d88ce9c669af8d6a6a414a834adc
[ "MIT" ]
null
null
null
import pyperclip import math class Affine_Cipher: def __init__(self): self.SYMBOLS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890 !?.' def check_key(self, key): keyA = key // len(self.SYMBOLS) keyB = key % len(self.SYMBOLS) # Weak Key Checks if keyA...
32.075269
138
0.483741
import pyperclip import math class Affine_Cipher: def __init__(self): self.SYMBOLS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890 !?.' def check_key(self, key): keyA = key // len(self.SYMBOLS) keyB = key % len(self.SYMBOLS) if keyA == 1: ...
true
true
f7026ec04664ba501e52f493107ef3d5daa3443c
711
py
Python
fantasyStocks/stocks/migrations/0004_auto_20151129_1625.py
ddsnowboard/FantasyStocks
ebf4cee0fdf3b66b803e0456363c470ddc700027
[ "Apache-2.0" ]
null
null
null
fantasyStocks/stocks/migrations/0004_auto_20151129_1625.py
ddsnowboard/FantasyStocks
ebf4cee0fdf3b66b803e0456363c470ddc700027
[ "Apache-2.0" ]
51
2015-05-20T13:57:19.000Z
2018-07-28T03:48:15.000Z
fantasyStocks/stocks/migrations/0004_auto_20151129_1625.py
ddsnowboard/FantasyStocks
ebf4cee0fdf3b66b803e0456363c470ddc700027
[ "Apache-2.0" ]
1
2016-08-07T13:41:22.000Z
2016-08-07T13:41:22.000Z
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import datetime from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('stocks', '0003_auto_20151129_1623'), ] operations = [ migrations.Alter...
26.333333
110
0.623066
from __future__ import unicode_literals from django.db import models, migrations import datetime from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('stocks', '0003_auto_20151129_1623'), ] operations = [ migrations.AlterField( mode...
true
true
f7026f66e04017736f515e9d6a921a954d009622
4,450
py
Python
05-Image-Descriptors/solution.py
brenov/ip-usp
06f9f16229a4587e38a3ae89fbe3394d5f1572fd
[ "MIT" ]
null
null
null
05-Image-Descriptors/solution.py
brenov/ip-usp
06f9f16229a4587e38a3ae89fbe3394d5f1572fd
[ "MIT" ]
null
null
null
05-Image-Descriptors/solution.py
brenov/ip-usp
06f9f16229a4587e38a3ae89fbe3394d5f1572fd
[ "MIT" ]
null
null
null
# Name: Breno Maurício de Freitas Viana # NUSP: 11920060 # Course Code: SCC5830 # Year/Semester: 2021/1 # Assignment 5: Image Descriptors import math import numpy as np import imageio from scipy import ndimage np.seterr(divide='ignore', invalid='ignore') LEVELS = 256 # ----- (1) Read Parameters # Get the locatio...
21.813725
80
0.596629
import math import numpy as np import imageio from scipy import ndimage np.seterr(divide='ignore', invalid='ignore') LEVELS = 256 f = input().rstrip() g = input().rstrip() b = int(input()) f = imageio.imread(f) g = imageio.imread(g) def luminance(img): N, M, _ = img.shape out = np.empty(i...
true
true
f7026fc2576bb460e599b24469ce8955bf0fcf3f
2,929
py
Python
tests/unit_tests/test_trunk_lock.py
miguelangel-nubla/teslajsonpy
b916ee5922c8df46414a14d5a6ee7e0a73b0af66
[ "Apache-2.0" ]
null
null
null
tests/unit_tests/test_trunk_lock.py
miguelangel-nubla/teslajsonpy
b916ee5922c8df46414a14d5a6ee7e0a73b0af66
[ "Apache-2.0" ]
null
null
null
tests/unit_tests/test_trunk_lock.py
miguelangel-nubla/teslajsonpy
b916ee5922c8df46414a14d5a6ee7e0a73b0af66
[ "Apache-2.0" ]
null
null
null
"""Test trunk lock.""" import pytest from tests.tesla_mock import TeslaMock from teslajsonpy.controller import Controller from teslajsonpy.trunk import TrunkLock def test_has_battery(monkeypatch): """Test has_battery().""" _mock = TeslaMock(monkeypatch) _controller = Controller(None) _data = _moc...
22.705426
52
0.697166
import pytest from tests.tesla_mock import TeslaMock from teslajsonpy.controller import Controller from teslajsonpy.trunk import TrunkLock def test_has_battery(monkeypatch): _mock = TeslaMock(monkeypatch) _controller = Controller(None) _data = _mock.data_request_vehicle() _lock = TrunkLock(_data,...
true
true
f70270dafa2d30a1ab08fdf17d8d43b8162686e1
782
py
Python
create_exe.py
hharzer/ytmusic-lib-tracker
b3564f802d0faa912b950bc64e5c84c944049a77
[ "MIT" ]
12
2020-07-21T21:32:48.000Z
2022-02-11T01:54:20.000Z
create_exe.py
hharzer/ytmusic-lib-tracker
b3564f802d0faa912b950bc64e5c84c944049a77
[ "MIT" ]
11
2020-07-20T22:45:31.000Z
2021-05-14T22:27:32.000Z
create_exe.py
hharzer/ytmusic-lib-tracker
b3564f802d0faa912b950bc64e5c84c944049a77
[ "MIT" ]
1
2022-02-17T23:51:38.000Z
2022-02-17T23:51:38.000Z
import sys from cx_Freeze import setup, Executable setup( name='YtMusic-Lib-Tracker', url='https://github.com/czifumasa/ytmusic-lib-tracker', author='Łukasz Lenart', author_email='lukasz.lenart912@gmail.com', version='0.1', license='MIT', description='Useful tools for youtube music. Exporti...
39.1
134
0.668798
import sys from cx_Freeze import setup, Executable setup( name='YtMusic-Lib-Tracker', url='https://github.com/czifumasa/ytmusic-lib-tracker', author='Łukasz Lenart', author_email='lukasz.lenart912@gmail.com', version='0.1', license='MIT', description='Useful tools for youtube music. Exporti...
true
true
f70271401af5bd2a93e5ae724aa2698ff1a032ff
5,666
py
Python
examples/python/TRSensors.py
mtrail/alphabot2-pi-zero
49693208b85c8b5edcce07574bdc770c7fe0e06e
[ "MIT" ]
1
2022-03-12T12:32:35.000Z
2022-03-12T12:32:35.000Z
examples/python/TRSensors.py
mtrail/alphabot2-pi-zero
49693208b85c8b5edcce07574bdc770c7fe0e06e
[ "MIT" ]
null
null
null
examples/python/TRSensors.py
mtrail/alphabot2-pi-zero
49693208b85c8b5edcce07574bdc770c7fe0e06e
[ "MIT" ]
1
2022-02-23T13:57:43.000Z
2022-02-23T13:57:43.000Z
#!/usr/bin/python # -*- coding:utf-8 -*- import RPi.GPIO as GPIO import time CS = 5 Clock = 25 Address = 24 DataOut = 23 Button = 7 class TRSensor(object): def __init__(self,numSensors = 5): self.numSensors = numSensors self.calibratedMin = [0] * self.numSensors self.calibratedMax = [1023] * self.numSensors ...
29.206186
74
0.680374
import RPi.GPIO as GPIO import time CS = 5 Clock = 25 Address = 24 DataOut = 23 Button = 7 class TRSensor(object): def __init__(self,numSensors = 5): self.numSensors = numSensors self.calibratedMin = [0] * self.numSensors self.calibratedMax = [1023] * self.numSensors self.last_value = 0 GPIO.setmode(GPIO...
true
true
f70271444a8a7d243bda48a6efd9534b633a6c2b
1,169
py
Python
server/openapi_server/controllers/text_date_annotation_controller.py
cascadianblue/phi-annotator
0da6c102ec1068e6b15c613e2a90a78f79d15935
[ "Apache-2.0" ]
null
null
null
server/openapi_server/controllers/text_date_annotation_controller.py
cascadianblue/phi-annotator
0da6c102ec1068e6b15c613e2a90a78f79d15935
[ "Apache-2.0" ]
19
2021-07-29T03:14:38.000Z
2022-03-01T06:03:14.000Z
server/openapi_server/controllers/text_date_annotation_controller.py
cascadianblue/phi-annotator
0da6c102ec1068e6b15c613e2a90a78f79d15935
[ "Apache-2.0" ]
null
null
null
import connexion from openapi_server.annotator.phi_types import PhiType from openapi_server.get_annotations import get_annotations from openapi_server.models.error import Error # noqa: E501 from openapi_server.models.text_date_annotation_request import \ TextDateAnnotationRequest # noqa: E501 from openapi_server....
35.424242
70
0.707442
import connexion from openapi_server.annotator.phi_types import PhiType from openapi_server.get_annotations import get_annotations from openapi_server.models.error import Error from openapi_server.models.text_date_annotation_request import \ TextDateAnnotationRequest from openapi_server.models.text_date_annotat...
true
true
f702724a2087738470998243ccd012825927600c
1,370
py
Python
fcos_core/solver/build.py
CityU-AIM-Group/SFPolypDA
3902577cf9549a65be7ba89e2c11a7115158b531
[ "BSD-2-Clause" ]
5
2021-12-17T10:55:54.000Z
2022-03-03T16:09:23.000Z
fcos_core/solver/build.py
CityU-AIM-Group/SFPolypDA
3902577cf9549a65be7ba89e2c11a7115158b531
[ "BSD-2-Clause" ]
null
null
null
fcos_core/solver/build.py
CityU-AIM-Group/SFPolypDA
3902577cf9549a65be7ba89e2c11a7115158b531
[ "BSD-2-Clause" ]
null
null
null
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import torch import logging from .lr_scheduler import WarmupMultiStepLR def make_optimizer(cfg, model): logger = logging.getLogger("fcos_core.trainer") params = [] for key, value in model.named_parameters(): if not value.requi...
34.25
79
0.652555
import torch import logging from .lr_scheduler import WarmupMultiStepLR def make_optimizer(cfg, model): logger = logging.getLogger("fcos_core.trainer") params = [] for key, value in model.named_parameters(): if not value.requires_grad: continue lr = cfg.SOLVER.BASE_LR ...
true
true
f702725052b1f21007cb4ab5b3c83889e16ebbf8
3,172
py
Python
src/processrunner/kitchenpatch.py
arobb/python-process-runner
e5265a052f501f533f6d0c8bbe3d70ab120b679f
[ "MIT" ]
3
2019-07-16T17:32:29.000Z
2021-11-08T05:00:26.000Z
src/processrunner/kitchenpatch.py
arobb/python-process-runner
e5265a052f501f533f6d0c8bbe3d70ab120b679f
[ "MIT" ]
null
null
null
src/processrunner/kitchenpatch.py
arobb/python-process-runner
e5265a052f501f533f6d0c8bbe3d70ab120b679f
[ "MIT" ]
2
2017-07-06T23:59:12.000Z
2019-07-16T17:32:32.000Z
# -*- coding: utf-8 -*- """Patched version of PyPi Kitchen's Python 3 getwriter function. Removes extraneous newlines.""" import codecs from kitchen.text.converters import to_bytes def getwriter(encoding): """Return a :class:`codecs.StreamWriter` that resists tracing back. :arg encoding: Encoding to use for...
40.151899
78
0.651009
import codecs from kitchen.text.converters import to_bytes def getwriter(encoding): class _StreamWriter(codecs.StreamWriter): # This is not the actual class that gets used but a replacement for # the actual class. # :C0111: We're implementing an API from the stdlib. Just po...
true
true
f702735ba5948c9492dc6dfb2c9ece987a5886b2
1,041
py
Python
tests/parser/bug.02.test.py
veltri/DLV2
944aaef803aa75e7ec51d7e0c2b0d964687fdd0e
[ "Apache-2.0" ]
null
null
null
tests/parser/bug.02.test.py
veltri/DLV2
944aaef803aa75e7ec51d7e0c2b0d964687fdd0e
[ "Apache-2.0" ]
null
null
null
tests/parser/bug.02.test.py
veltri/DLV2
944aaef803aa75e7ec51d7e0c2b0d964687fdd0e
[ "Apache-2.0" ]
null
null
null
input = """ colored(2,g) :- not diff_col(2,g). colored(2,y) :- not diff_col(2,y). colored(3,g) :- not diff_col(3,g). colored(3,y) :- not diff_col(3,y). diff_col(2,g) :- colored(2,y). diff_col(3,g) :- colored(3,y). diff_col(2,y) :- colored(2,g). diff_col(3,y) :- colored(3,g). no_stable :- colored(2,2), color...
31.545455
56
0.62536
input = """ colored(2,g) :- not diff_col(2,g). colored(2,y) :- not diff_col(2,y). colored(3,g) :- not diff_col(3,g). colored(3,y) :- not diff_col(3,y). diff_col(2,g) :- colored(2,y). diff_col(3,g) :- colored(3,y). diff_col(2,y) :- colored(2,g). diff_col(3,y) :- colored(3,g). no_stable :- colored(2,2), color...
true
true
f70273a4f204930ac82371643af949cac1c6a644
3,534
py
Python
src/rpdk/core/boto_helpers.py
wbingli/cloudformation-cli
75a39cb7f73596f01ce04c85967dea74fe5a893d
[ "Apache-2.0" ]
200
2019-12-02T03:33:37.000Z
2022-03-31T21:50:23.000Z
src/rpdk/core/boto_helpers.py
wbingli/cloudformation-cli
75a39cb7f73596f01ce04c85967dea74fe5a893d
[ "Apache-2.0" ]
353
2019-11-26T20:20:56.000Z
2022-03-31T00:53:05.000Z
src/rpdk/core/boto_helpers.py
wbingli/cloudformation-cli
75a39cb7f73596f01ce04c85967dea74fe5a893d
[ "Apache-2.0" ]
110
2019-11-26T21:58:16.000Z
2022-03-26T19:02:11.000Z
import logging from datetime import datetime import botocore.loaders import botocore.regions from boto3 import Session as Boto3Session from botocore.exceptions import ClientError from .exceptions import CLIMisconfiguredError, DownstreamError LOG = logging.getLogger(__name__) BOTO_CRED_KEYS = ("aws_access_key_id", "...
36.43299
88
0.665818
import logging from datetime import datetime import botocore.loaders import botocore.regions from boto3 import Session as Boto3Session from botocore.exceptions import ClientError from .exceptions import CLIMisconfiguredError, DownstreamError LOG = logging.getLogger(__name__) BOTO_CRED_KEYS = ("aws_access_key_id", "...
true
true
f702747b82118bbd64d8fc67a01e1f638cbb45dd
26,042
py
Python
src/transformersX/models/cutoffbert/modeling_cutoffbert.py
stevezheng23/fewshot_nlp_pt
aaca4658aaa48a5a45dfd7d5ee7282d7f7c74be2
[ "Apache-2.0" ]
2
2021-08-06T05:43:55.000Z
2022-03-17T22:31:21.000Z
src/transformersX/models/cutoffbert/modeling_cutoffbert.py
stevezheng23/fewshot_nlp_pt
aaca4658aaa48a5a45dfd7d5ee7282d7f7c74be2
[ "Apache-2.0" ]
null
null
null
src/transformersX/models/cutoffbert/modeling_cutoffbert.py
stevezheng23/fewshot_nlp_pt
aaca4658aaa48a5a45dfd7d5ee7282d7f7c74be2
[ "Apache-2.0" ]
null
null
null
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. 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 cop...
44.9
213
0.672183
import math import os import warnings import numpy as np from dataclasses import dataclass from typing import Optional, Tuple import torch import torch.utils.checkpoint import torch.nn.functional as F from packaging import version from torch import nn from torch.nn import BCEWithLogitsLoss, CrossEntro...
true
true
f702751fc715aa75b5c77b637dfcf7dfc73f80cd
3,001
py
Python
litex/build/lattice/bit_to_svf.py
osterwood/litex
db20cb172dc982c5879aa8080ec7aa18de181cc5
[ "ADSL" ]
1,501
2016-04-19T18:16:21.000Z
2022-03-31T17:46:31.000Z
litex/build/lattice/bit_to_svf.py
gregdavill/litex
230ba5f7baff2d6fe98fbb7eecabb48aaea250e4
[ "ADSL" ]
1,135
2016-04-19T05:49:14.000Z
2022-03-31T15:21:19.000Z
litex/build/lattice/bit_to_svf.py
gregdavill/litex
230ba5f7baff2d6fe98fbb7eecabb48aaea250e4
[ "ADSL" ]
357
2016-04-19T05:00:24.000Z
2022-03-31T11:28:32.000Z
#!/usr/bin/env python3 # Very basic bitstream to SVF converter # This file is Copyright (c) 2018 David Shah <dave@ds0.me> import sys import textwrap max_row_size = 100000 def bitreverse(x): y = 0 for i in range(8): if (x >> (7 - i)) & 1 == 1: y |= (1 << i) return y def bit_to_svf(bi...
27.53211
123
0.518494
import sys import textwrap max_row_size = 100000 def bitreverse(x): y = 0 for i in range(8): if (x >> (7 - i)) & 1 == 1: y |= (1 << i) return y def bit_to_svf(bit, svf): with open(bit, 'rb') as bitf: bs = bitf.read() idcode_cmd = bytes([0xE2, 0x00, 0x...
true
true
f702781d328a68fc3d131624d2296b76500bf539
2,425
py
Python
lib/spack/spack/container/images.py
cjy7117/spack
3582115d2af3ebd8156d742883c049e5b864eb2d
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
1
2020-09-02T11:55:57.000Z
2020-09-02T11:55:57.000Z
lib/spack/spack/container/images.py
cjy7117/spack
3582115d2af3ebd8156d742883c049e5b864eb2d
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
1
2021-03-23T17:08:14.000Z
2021-04-01T17:18:22.000Z
lib/spack/spack/container/images.py
cjy7117/spack
3582115d2af3ebd8156d742883c049e5b864eb2d
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
2
2020-01-10T18:54:54.000Z
2021-07-03T22:57:16.000Z
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) """Manages the details on the images used in the build and the run stage.""" import json import os.path #: Global variable...
32.77027
78
0.655258
import json import os.path _data = None def data(): global _data if not _data: json_dir = os.path.abspath(os.path.dirname(__file__)) json_file = os.path.join(json_dir, 'images.json') with open(json_file) as f: _data = json.load(f) return _data def build_info(ima...
true
true
f702783a2b2ea74ee55856da85cc7e661ba018dd
1,648
py
Python
misc/pythontools/processors/VolumeExtractChannel.py
grassofsky/modules
fe51de837fed6887228f2d3f8a455d5f4602d786
[ "BSD-2-Clause" ]
6
2019-01-31T09:38:31.000Z
2021-05-23T18:39:13.000Z
misc/pythontools/processors/VolumeExtractChannel.py
grassofsky/modules
fe51de837fed6887228f2d3f8a455d5f4602d786
[ "BSD-2-Clause" ]
65
2019-01-28T20:17:35.000Z
2022-02-25T08:08:03.000Z
misc/pythontools/processors/VolumeExtractChannel.py
grassofsky/modules
fe51de837fed6887228f2d3f8a455d5f4602d786
[ "BSD-2-Clause" ]
7
2019-09-15T20:06:03.000Z
2021-11-23T14:59:37.000Z
# Name: VolumeExtractChannel import inviwopy as ivw import numpy as np class VolumeExtractChannel(ivw.Processor): def __init__(self, id, name): ivw.Processor.__init__(self, id, name) self.inport = ivw.data.VolumeInport("inport") self.addInport(self.inport, owner=False) self.outpor...
33.632653
84
0.663835
import inviwopy as ivw import numpy as np class VolumeExtractChannel(ivw.Processor): def __init__(self, id, name): ivw.Processor.__init__(self, id, name) self.inport = ivw.data.VolumeInport("inport") self.addInport(self.inport, owner=False) self.outport = ivw.data.VolumeOutport("o...
true
true
f7027871d8f121fbe03c77a55263ef697ac25229
853
py
Python
devscripts/PREAMBLE.py
dish59742/dulwich
d7f1331cba0ca959e8b701265b0c1547191a4726
[ "Apache-2.0" ]
624
2018-01-25T02:40:53.000Z
2022-02-02T12:38:55.000Z
devscripts/PREAMBLE.py
dish59742/dulwich
d7f1331cba0ca959e8b701265b0c1547191a4726
[ "Apache-2.0" ]
358
2015-01-06T11:36:42.000Z
2022-03-20T01:09:47.000Z
devscripts/PREAMBLE.py
dish59742/dulwich
d7f1331cba0ca959e8b701265b0c1547191a4726
[ "Apache-2.0" ]
166
2015-01-09T21:10:40.000Z
2022-03-15T08:20:35.000Z
# Dulwich is dual-licensed under the Apache License, Version 2.0 and the GNU # General Public License as public by the Free Software Foundation; version 2.0 # or (at your option) any later version. You can redistribute it and/or # modify it under the terms of either of these two licenses. # # Unless required by applica...
50.176471
79
0.764361
true
true
f7027877a6531c952b6a1d6afa0ea1d9608db0c1
879
py
Python
twisted/web2/auth/basic.py
twonds/twisted
d6e270a465d371c3bed01bf369af497b77eb9f1e
[ "Unlicense", "MIT" ]
1
2021-01-27T19:11:21.000Z
2021-01-27T19:11:21.000Z
twisted/web2/auth/basic.py
twonds/twisted
d6e270a465d371c3bed01bf369af497b77eb9f1e
[ "Unlicense", "MIT" ]
null
null
null
twisted/web2/auth/basic.py
twonds/twisted
d6e270a465d371c3bed01bf369af497b77eb9f1e
[ "Unlicense", "MIT" ]
3
2017-01-04T01:24:15.000Z
2020-06-18T16:14:56.000Z
# -*- test-case-name: twisted.web2.test.test_httpauth -*- from twisted.cred import credentials, error from twisted.web2.auth.interfaces import ICredentialFactory from zope.interface import implements class BasicCredentialFactory(object): """ Credential Factory for HTTP Basic Authentication """ imple...
25.852941
59
0.641638
from twisted.cred import credentials, error from twisted.web2.auth.interfaces import ICredentialFactory from zope.interface import implements class BasicCredentialFactory(object): implements(ICredentialFactory) scheme = 'basic' def __init__(self, realm): self.realm = realm def getChallen...
true
true
f70278cea4e7162ad9cc5b7f21e6718f080b1563
15,383
py
Python
couchbase/management/buckets.py
kulabh/couchbase-python-client
eb52c53302dfa563e289f04af518d40b3921767b
[ "Apache-2.0" ]
null
null
null
couchbase/management/buckets.py
kulabh/couchbase-python-client
eb52c53302dfa563e289f04af518d40b3921767b
[ "Apache-2.0" ]
null
null
null
couchbase/management/buckets.py
kulabh/couchbase-python-client
eb52c53302dfa563e289f04af518d40b3921767b
[ "Apache-2.0" ]
null
null
null
from couchbase.management.admin import Admin from couchbase_core.mapper import BijectiveMapping, \ StringEnum, Identity, Timedelta, Bijection, StringEnumLoose from ..options import OptionBlockTimeOut, forward_args from couchbase.management.generic import GenericManager from typing import * from couchbase_core impor...
37.157005
213
0.595528
from couchbase.management.admin import Admin from couchbase_core.mapper import BijectiveMapping, \ StringEnum, Identity, Timedelta, Bijection, StringEnumLoose from ..options import OptionBlockTimeOut, forward_args from couchbase.management.generic import GenericManager from typing import * from couchbase_core impor...
true
true
f70279cf9a6103ce7baf015e8ef13fb314e9824c
5,629
py
Python
core/eolearn/core/eotask.py
dreampedia20/eo-learn
f4994a1d6e910ba5d6ad877726ac2367048a44a1
[ "MIT" ]
1
2019-04-08T02:26:40.000Z
2019-04-08T02:26:40.000Z
core/eolearn/core/eotask.py
dreampedia20/eo-learn
f4994a1d6e910ba5d6ad877726ac2367048a44a1
[ "MIT" ]
1
2019-11-27T09:44:40.000Z
2019-11-27T09:44:40.000Z
core/eolearn/core/eotask.py
dreampedia20/eo-learn
f4994a1d6e910ba5d6ad877726ac2367048a44a1
[ "MIT" ]
1
2019-01-30T09:08:23.000Z
2019-01-30T09:08:23.000Z
""" This module implements the core class hierarchy for implementing EO tasks. An EO task is any class the inherits from the abstract EOTask class. Each EO task has to implement the execute method; invoking __call__ on a EO task instance invokes the execute method. EO tasks are meant primarily to operate on EO patches ...
39.363636
119
0.696927
import sys import logging import datetime import inspect from collections import OrderedDict from abc import ABC, abstractmethod import attr from .utilities import FeatureParser LOGGER = logging.getLogger(__name__) class EOTask(ABC): def __new__(cls, *args, **kwargs): self = super().__new__(cls) ...
true
true
f7027ac26fa896bc6deaf3d010bd7334ab987560
1,875
py
Python
src/kol/request/RespondToTradeRequest.py
danheath/temppykol
7f9621b44df9f9d2d9fc0a5b2a06db116b9ccfab
[ "BSD-3-Clause" ]
19
2015-02-16T08:30:49.000Z
2020-05-01T06:06:33.000Z
src/kol/request/RespondToTradeRequest.py
danheath/temppykol
7f9621b44df9f9d2d9fc0a5b2a06db116b9ccfab
[ "BSD-3-Clause" ]
5
2015-01-13T23:01:54.000Z
2016-11-30T15:23:43.000Z
src/kol/request/RespondToTradeRequest.py
danheath/temppykol
7f9621b44df9f9d2d9fc0a5b2a06db116b9ccfab
[ "BSD-3-Clause" ]
19
2015-05-28T09:36:19.000Z
2022-03-15T23:19:29.000Z
from kol.request.GenericRequest import GenericRequest from kol.manager import PatternManager import kol.Error as Error from kol.util import Report class RespondToTradeRequest(GenericRequest): def __init__(self, session, tradeid, items=None, meat=0, message=""): super(RespondToTradeRequest, self).__sup...
50.675676
134
0.679467
from kol.request.GenericRequest import GenericRequest from kol.manager import PatternManager import kol.Error as Error from kol.util import Report class RespondToTradeRequest(GenericRequest): def __init__(self, session, tradeid, items=None, meat=0, message=""): super(RespondToTradeRequest, self).__sup...
true
true
f7027b3f06db28c8a66a60541055054a89ae5668
6,821
py
Python
env/lib/python3.8/site-packages/plotly/graph_objs/volume/_caps.py
acrucetta/Chicago_COVI_WebApp
a37c9f492a20dcd625f8647067394617988de913
[ "MIT", "Unlicense" ]
11,750
2015-10-12T07:03:39.000Z
2022-03-31T20:43:15.000Z
env/lib/python3.8/site-packages/plotly/graph_objs/volume/_caps.py
acrucetta/Chicago_COVI_WebApp
a37c9f492a20dcd625f8647067394617988de913
[ "MIT", "Unlicense" ]
2,951
2015-10-12T00:41:25.000Z
2022-03-31T22:19:26.000Z
env/lib/python3.8/site-packages/plotly/graph_objs/volume/_caps.py
acrucetta/Chicago_COVI_WebApp
a37c9f492a20dcd625f8647067394617988de913
[ "MIT", "Unlicense" ]
2,623
2015-10-15T14:40:27.000Z
2022-03-28T16:05:50.000Z
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Caps(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "volume" _path_str = "volume.caps" _valid_props = {"x", "y", "z"} # x # - @propert...
32.174528
82
0.511215
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Caps(_BaseTraceHierarchyType): _parent_path_str = "volume" _path_str = "volume.caps" _valid_props = {"x", "y", "z"} @property def x(self): return self["x"] ...
true
true
f7027bdbfcc7842b76bfb89ba52eca7263568712
1,768
py
Python
aliyun-python-sdk-cdn/aliyunsdkcdn/request/v20180510/DescribeCdnDeletedDomainsRequest.py
yndu13/aliyun-openapi-python-sdk
12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5
[ "Apache-2.0" ]
1,001
2015-07-24T01:32:41.000Z
2022-03-25T01:28:18.000Z
aliyun-python-sdk-cdn/aliyunsdkcdn/request/v20180510/DescribeCdnDeletedDomainsRequest.py
yndu13/aliyun-openapi-python-sdk
12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5
[ "Apache-2.0" ]
363
2015-10-20T03:15:00.000Z
2022-03-08T12:26:19.000Z
aliyun-python-sdk-cdn/aliyunsdkcdn/request/v20180510/DescribeCdnDeletedDomainsRequest.py
yndu13/aliyun-openapi-python-sdk
12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5
[ "Apache-2.0" ]
682
2015-09-22T07:19:02.000Z
2022-03-22T09:51:46.000Z
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
35.36
78
0.765271
from aliyunsdkcore.request import RpcRequest from aliyunsdkcdn.endpoint import endpoint_data class DescribeCdnDeletedDomainsRequest(RpcRequest): def __init__(self): RpcRequest.__init__(self, 'Cdn', '2018-05-10', 'DescribeCdnDeletedDomains') self.set_method('POST') if hasattr(self, "endpoint...
true
true
f7027cc40744bece58196657f7f41d0dc93f9bce
346
py
Python
week1/1.05 classes/step09 buffer.py
TheNovel/stepik-python-fundamentals-and-application
4bf6838cfdb2323da2d8d52cfe393d61a4bb70cc
[ "MIT" ]
null
null
null
week1/1.05 classes/step09 buffer.py
TheNovel/stepik-python-fundamentals-and-application
4bf6838cfdb2323da2d8d52cfe393d61a4bb70cc
[ "MIT" ]
null
null
null
week1/1.05 classes/step09 buffer.py
TheNovel/stepik-python-fundamentals-and-application
4bf6838cfdb2323da2d8d52cfe393d61a4bb70cc
[ "MIT" ]
null
null
null
class Buffer: def __init__(self): self.lst = list() def add(self, *a): for value in a: self.lst.append(value) while len(self.lst) >= 5: s = 0 for i in range(5): s += self.lst.pop(0) print(s) def get_current_part(self)...
20.352941
36
0.465318
class Buffer: def __init__(self): self.lst = list() def add(self, *a): for value in a: self.lst.append(value) while len(self.lst) >= 5: s = 0 for i in range(5): s += self.lst.pop(0) print(s) def get_current_part(self)...
true
true
f7027d1166fe593295d878cd3bf04e354cc16d40
2,262
py
Python
release/stubs.min/Autodesk/Revit/DB/__init___parts/GeometryObject.py
YKato521/ironpython-stubs
b1f7c580de48528490b3ee5791b04898be95a9ae
[ "MIT" ]
null
null
null
release/stubs.min/Autodesk/Revit/DB/__init___parts/GeometryObject.py
YKato521/ironpython-stubs
b1f7c580de48528490b3ee5791b04898be95a9ae
[ "MIT" ]
null
null
null
release/stubs.min/Autodesk/Revit/DB/__init___parts/GeometryObject.py
YKato521/ironpython-stubs
b1f7c580de48528490b3ee5791b04898be95a9ae
[ "MIT" ]
null
null
null
class GeometryObject(APIObject, IDisposable): """ The common base class for all geometric primitives. """ def Dispose(self): """ Dispose(self: APIObject,A_0: bool) """ pass def Equals(self, obj): """ Equals(self: GeometryObject,obj: object) -> bool Determines...
22.39604
221
0.598585
class GeometryObject(APIObject, IDisposable): def Dispose(self): pass def Equals(self, obj): pass def GetHashCode(self): pass def ReleaseManagedResources(self, *args): pass def ReleaseUnmanagedResources(self, *args): pass def __enter...
true
true
f7027dcd4d2737c0d58aa41af45dd91d95328e07
1,607
py
Python
handson2_q_qi.py
blacktanktop/techcircle_openai_handson
54ae9de6c488cbbff9bda1be11fd0ecd1e681049
[ "MIT" ]
1
2021-09-15T09:49:49.000Z
2021-09-15T09:49:49.000Z
handson2_q_qi.py
blacktanktop/techcircle_openai_handson
54ae9de6c488cbbff9bda1be11fd0ecd1e681049
[ "MIT" ]
null
null
null
handson2_q_qi.py
blacktanktop/techcircle_openai_handson
54ae9de6c488cbbff9bda1be11fd0ecd1e681049
[ "MIT" ]
null
null
null
import os import math import argparse import gym from agents.q_agent import Q, Agent, Trainer RECORD_PATH = os.path.join(os.path.dirname(__file__), "./upload") def main(episodes, render, monitor): env = gym.make("CartPole-v0") q = Q( env.action_space.n, env.observation_space, bin...
29.218182
117
0.634723
import os import math import argparse import gym from agents.q_agent import Q, Agent, Trainer RECORD_PATH = os.path.join(os.path.dirname(__file__), "./upload") def main(episodes, render, monitor): env = gym.make("CartPole-v0") q = Q( env.action_space.n, env.observation_space, bin...
true
true
f7027dff8780b6911154978d2292dd01768881d2
6,554
py
Python
data_related/data_augmentation/signal_augment.py
dertilo/speech-recognition
32dfd0a05480ecb3a4ea3eb9e28628da976e7065
[ "MIT" ]
1
2020-06-30T20:48:04.000Z
2020-06-30T20:48:04.000Z
data_related/data_augmentation/signal_augment.py
dertilo/speech-recognition
32dfd0a05480ecb3a4ea3eb9e28628da976e7065
[ "MIT" ]
null
null
null
data_related/data_augmentation/signal_augment.py
dertilo/speech-recognition
32dfd0a05480ecb3a4ea3eb9e28628da976e7065
[ "MIT" ]
null
null
null
import os import subprocess import numpy as np from tqdm import tqdm from typing import Dict MAX_FREQ = 7999 def to_str(v): if isinstance(v, tuple): s = " ".join(str(x) for x in v) elif isinstance(v, float) or isinstance(v, int): s = str(v) else: assert False return s def ...
34.677249
188
0.663412
import os import subprocess import numpy as np from tqdm import tqdm from typing import Dict MAX_FREQ = 7999 def to_str(v): if isinstance(v, tuple): s = " ".join(str(x) for x in v) elif isinstance(v, float) or isinstance(v, int): s = str(v) else: assert False return s def ...
true
true
f702808448a1116245a85dccb72d2041a69ba522
1,552
py
Python
appengine/swarming/swarming_bot/logging_utils_test.py
pombreda/swarming
c70f311f3db8f25752c793a0d7b36cf537d95580
[ "Apache-2.0" ]
null
null
null
appengine/swarming/swarming_bot/logging_utils_test.py
pombreda/swarming
c70f311f3db8f25752c793a0d7b36cf537d95580
[ "Apache-2.0" ]
null
null
null
appengine/swarming/swarming_bot/logging_utils_test.py
pombreda/swarming
c70f311f3db8f25752c793a0d7b36cf537d95580
[ "Apache-2.0" ]
1
2021-12-06T03:37:36.000Z
2021-12-06T03:37:36.000Z
#!/usr/bin/env python # Copyright 2014 The Swarming Authors. All rights reserved. # Use of this source code is governed by the Apache v2.0 license that can be # found in the LICENSE file. import logging import os import sys import tempfile import shutil import unittest import re # Import this first before manipulatin...
28.218182
78
0.706186
import logging import os import sys import tempfile import shutil import unittest import re import logging_utils ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, ROOT_DIR) import test_env test_env.setup_test_env() from depot_tools import auto_stub _LOG_HEADER = r'^%s...
true
true
f70281b724d555ee8d8ebda46c531d9ccbec388d
615
py
Python
frontends/pytorch/test/acap_regression/test_jit_add2.py
marbre/mlir-npcomp
30adf9e6b0c1e94db38050a9e143f20a5a461d17
[ "Apache-2.0" ]
null
null
null
frontends/pytorch/test/acap_regression/test_jit_add2.py
marbre/mlir-npcomp
30adf9e6b0c1e94db38050a9e143f20a5a461d17
[ "Apache-2.0" ]
null
null
null
frontends/pytorch/test/acap_regression/test_jit_add2.py
marbre/mlir-npcomp
30adf9e6b0c1e94db38050a9e143f20a5a461d17
[ "Apache-2.0" ]
null
null
null
# -*- Python -*- # This file is licensed under a pytorch-style license # See frontends/pytorch/LICENSE for license information. import torch import npcomp.frontends.pytorch as torch_mlir import npcomp.frontends.pytorch.test as test # RUN: %PYTHON %s | FileCheck %s dev = torch_mlir.mlir_device() t0 = torch.randn((4,4...
21.964286
56
0.691057
import torch import npcomp.frontends.pytorch as torch_mlir import npcomp.frontends.pytorch.test as test dev = torch_mlir.mlir_device() t0 = torch.randn((4,4), device=dev) t1 = torch.randn((4,4), device=dev) t2 = t0 + t1 t0_cpu = t0.to('cpu') t1_cpu = t1.to('cpu') t2_cpu = t2.to('cpu') print (t0_cpu, " +\n"...
true
true
f7028206768d52c2f42babdea8234119adef0637
2,800
py
Python
tests/st/ops/gpu/test_tanh_grad_grad_op.py
GuoSuiming/mindspore
48afc4cfa53d970c0b20eedfb46e039db2a133d5
[ "Apache-2.0" ]
3,200
2020-02-17T12:45:41.000Z
2022-03-31T20:21:16.000Z
tests/st/ops/gpu/test_tanh_grad_grad_op.py
zimo-geek/mindspore
665ec683d4af85c71b2a1f0d6829356f2bc0e1ff
[ "Apache-2.0" ]
176
2020-02-12T02:52:11.000Z
2022-03-28T22:15:55.000Z
tests/st/ops/gpu/test_tanh_grad_grad_op.py
zimo-geek/mindspore
665ec683d4af85c71b2a1f0d6829356f2bc0e1ff
[ "Apache-2.0" ]
621
2020-03-09T01:31:41.000Z
2022-03-30T03:43:19.000Z
# Copyright 2020 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
32.55814
78
0.706429
import numpy as np import pytest import mindspore.context as context import mindspore.nn as nn from mindspore import Tensor from mindspore.ops.operations import _grad_ops as G from mindspore.ops import composite as C context.set_context(mode=context.GRAPH_MODE, device_target="GPU") class NetTanhGrad(n...
true
true
f702829a908f8235e9093bc97a9d0edce1997f1f
379
py
Python
pokemon/permissions.py
pessman/pokemon_utils
cbe06ebe323cb38a35846274d812bdbe8d0ae8ca
[ "MIT" ]
1
2019-03-11T04:12:50.000Z
2019-03-11T04:12:50.000Z
pokemon/permissions.py
pessman/pokemon_utils
cbe06ebe323cb38a35846274d812bdbe8d0ae8ca
[ "MIT" ]
null
null
null
pokemon/permissions.py
pessman/pokemon_utils
cbe06ebe323cb38a35846274d812bdbe8d0ae8ca
[ "MIT" ]
2
2019-03-13T03:17:29.000Z
2019-04-04T20:06:50.000Z
from rest_framework.permissions import SAFE_METHODS, BasePermission class IsAdminOrReadOnly(BasePermission): """ The request is authenticated as an Admin user or is Read Only """ def has_permission(self, request, view): return bool( request.method in SAFE_METHODS or re...
25.266667
67
0.662269
from rest_framework.permissions import SAFE_METHODS, BasePermission class IsAdminOrReadOnly(BasePermission): def has_permission(self, request, view): return bool( request.method in SAFE_METHODS or request.user and request.user.is_staff )
true
true
f702830899c6877f2ce2b468190877e2a231b279
1,153
py
Python
stubborn.py
CrossRef/unreliable
874b58c0a0b4519bd679b8ad44d029427571653e
[ "MIT" ]
null
null
null
stubborn.py
CrossRef/unreliable
874b58c0a0b4519bd679b8ad44d029427571653e
[ "MIT" ]
null
null
null
stubborn.py
CrossRef/unreliable
874b58c0a0b4519bd679b8ad44d029427571653e
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 import argparse import io import sys from urllib.request import urlopen import urllib.error import time import datetime from retrying import retry URL = "http://unreliable.labs.crossref.org/error" ONE_SECOND=1000 ONE_HOUR=((ONE_SECOND*60)*60) ONE_DAY=(ONE_HOUR*24) @retry(wait_exponential_mul...
23.06
86
0.635733
import argparse import io import sys from urllib.request import urlopen import urllib.error import time import datetime from retrying import retry URL = "http://unreliable.labs.crossref.org/error" ONE_SECOND=1000 ONE_HOUR=((ONE_SECOND*60)*60) ONE_DAY=(ONE_HOUR*24) @retry(wait_exponential_multiplier=1000,wait_expo...
true
true
f702841d0fb9dd541a4a2ee7271135da879a7cdc
988
py
Python
isi_sdk_8_2_1/test/test_auth_id_ntoken_privilege_item.py
mohitjain97/isilon_sdk_python
a371f438f542568edb8cda35e929e6b300b1177c
[ "Unlicense" ]
24
2018-06-22T14:13:23.000Z
2022-03-23T01:21:26.000Z
isi_sdk_8_2_1/test/test_auth_id_ntoken_privilege_item.py
mohitjain97/isilon_sdk_python
a371f438f542568edb8cda35e929e6b300b1177c
[ "Unlicense" ]
46
2018-04-30T13:28:22.000Z
2022-03-21T21:11:07.000Z
isi_sdk_8_2_1/test/test_auth_id_ntoken_privilege_item.py
mohitjain97/isilon_sdk_python
a371f438f542568edb8cda35e929e6b300b1177c
[ "Unlicense" ]
29
2018-06-19T00:14:04.000Z
2022-02-08T17:51:19.000Z
# coding: utf-8 """ Isilon SDK Isilon SDK - Language bindings for the OneFS API # noqa: E501 OpenAPI spec version: 8 Contact: sdk@isilon.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import unittest import isi_sdk_8_2_1 from i...
24.097561
110
0.730769
from __future__ import absolute_import import unittest import isi_sdk_8_2_1 from isi_sdk_8_2_1.models.auth_id_ntoken_privilege_item import AuthIdNtokenPrivilegeItem from isi_sdk_8_2_1.rest import ApiException class TestAuthIdNtokenPrivilegeItem(unittest.TestCase): def setUp(self): pass def t...
true
true
f702853d97d6b0edd707b18d0e9385339233e089
97,990
py
Python
databricks/koalas/frame.py
abishekganesh72/koalas
40c2e209384d078ee75d08c7681d2e6a276ab834
[ "Apache-2.0" ]
null
null
null
databricks/koalas/frame.py
abishekganesh72/koalas
40c2e209384d078ee75d08c7681d2e6a276ab834
[ "Apache-2.0" ]
null
null
null
databricks/koalas/frame.py
abishekganesh72/koalas
40c2e209384d078ee75d08c7681d2e6a276ab834
[ "Apache-2.0" ]
null
null
null
# # Copyright (C) 2019 Databricks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
36.824502
100
0.535493
import re import warnings from functools import partial, reduce from typing import Any, Optional, List, Tuple, Union import numpy as np import pandas as pd from pandas.api.types import is_datetime64_dtype, is_datetime64tz_dtype, is_list_like, \ is_dict_like from pyspark import sql as spark from pys...
true
true
f70285bf0c127bd9449019b899b0766290314975
11,080
py
Python
CodeGenerator.py
vdominguez1993/PlantUMLCodeGenerator
61bf3f4f11962c041f1d7ee5cdc3889b473d278b
[ "Apache-2.0" ]
null
null
null
CodeGenerator.py
vdominguez1993/PlantUMLCodeGenerator
61bf3f4f11962c041f1d7ee5cdc3889b473d278b
[ "Apache-2.0" ]
null
null
null
CodeGenerator.py
vdominguez1993/PlantUMLCodeGenerator
61bf3f4f11962c041f1d7ee5cdc3889b473d278b
[ "Apache-2.0" ]
null
null
null
import argparse, subprocess, os, re from jinja2 import Environment, FileSystemLoader def GetBaseName(full_path): return os.path.basename(full_path) class PlantUMLCodeGeneration(): class StateType(): def __init__(self): self.entry = None self.during = None self.exit...
43.28125
117
0.568231
import argparse, subprocess, os, re from jinja2 import Environment, FileSystemLoader def GetBaseName(full_path): return os.path.basename(full_path) class PlantUMLCodeGeneration(): class StateType(): def __init__(self): self.entry = None self.during = None self.exit...
true
true
f70288269e894757296237fedfbe8a7b9a17cae6
889
py
Python
doc/examples/transform/plot_pyramid.py
paalge/scikit-image
f3c4b88b0610242b033449fd38c1118475f96a73
[ "BSD-3-Clause" ]
null
null
null
doc/examples/transform/plot_pyramid.py
paalge/scikit-image
f3c4b88b0610242b033449fd38c1118475f96a73
[ "BSD-3-Clause" ]
2
2016-01-08T18:30:49.000Z
2016-07-21T07:55:29.000Z
doc/examples/transform/plot_pyramid.py
paalge/scikit-image
f3c4b88b0610242b033449fd38c1118475f96a73
[ "BSD-3-Clause" ]
2
2017-05-09T13:33:37.000Z
2018-12-23T10:57:18.000Z
""" ==================== Build image pyramids ==================== The ``pyramid_gaussian`` function takes an image and yields successive images shrunk by a constant scale factor. Image pyramids are often used, e.g., to implement algorithms for denoising, texture discrimination, and scale- invariant detection. """ im...
24.694444
77
0.704162
import numpy as np import matplotlib.pyplot as plt from skimage import data from skimage.transform import pyramid_gaussian image = data.astronaut() rows, cols, dim = image.shape pyramid = tuple(pyramid_gaussian(image, downscale=2)) composite_image = np.zeros((rows, cols + cols / 2, 3), dtype=np.double) composite_i...
true
true
f70289491eddd352d457d19b402af7a9836267ff
4,623
py
Python
thrift/lib/py3/test/interactions/interaction_test.py
sakibguy/fbthrift
8123a9192519072e119ac9817c6b59a35b98b81c
[ "Apache-2.0" ]
2,112
2015-01-02T11:34:27.000Z
2022-03-31T16:30:42.000Z
thrift/lib/py3/test/interactions/interaction_test.py
sakibguy/fbthrift
8123a9192519072e119ac9817c6b59a35b98b81c
[ "Apache-2.0" ]
372
2015-01-05T10:40:09.000Z
2022-03-31T20:45:11.000Z
thrift/lib/py3/test/interactions/interaction_test.py
sakibguy/fbthrift
8123a9192519072e119ac9817c6b59a35b98b81c
[ "Apache-2.0" ]
582
2015-01-03T01:51:56.000Z
2022-03-31T02:01:09.000Z
# Copyright (c) Facebook, Inc. and its affiliates. # # 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 ...
35.837209
74
0.589011
import asyncio import unittest from blank_interaction.services import BlankServiceInterface from interaction.clients import Calculator from interaction.types import Point from thrift.py3.client import get_client, ClientType from .run_interaction import run_interaction class InteractionTest(unittest.Te...
true
true
f702895d53bfab5f192f3b620f6222bfa4a5bb35
18,264
py
Python
server.py
jonasswa/Guess-My-Search
2b36183a66bf55b163fc647117ee1b9c8f9cd543
[ "MIT" ]
1
2017-12-18T14:00:53.000Z
2017-12-18T14:00:53.000Z
server.py
soldox/Guess-My-Search
2b36183a66bf55b163fc647117ee1b9c8f9cd543
[ "MIT" ]
null
null
null
server.py
soldox/Guess-My-Search
2b36183a66bf55b163fc647117ee1b9c8f9cd543
[ "MIT" ]
null
null
null
from flask_socketio import SocketIO from flask import Flask, make_response, request, session from flask import render_template, session, url_for, redirect from threading import RLock from threading import Thread from utilslib import list_to_HTML_table from time import sleep from ClientStorage import Clients, User fr...
36.166337
143
0.636498
from flask_socketio import SocketIO from flask import Flask, make_response, request, session from flask import render_template, session, url_for, redirect from threading import RLock from threading import Thread from utilslib import list_to_HTML_table from time import sleep from ClientStorage import Clients, User fr...
true
true
f7028a63f253b20a569bb4743e35afa609f63526
6,332
py
Python
deeplabv3/datahandler.py
RajArPatra/Improvement-semantic-segmentation-using-clustring-and-class-voating
1e4b5fa5ccc462d88a68f3c88c8af31fa3f14b8b
[ "MIT" ]
null
null
null
deeplabv3/datahandler.py
RajArPatra/Improvement-semantic-segmentation-using-clustring-and-class-voating
1e4b5fa5ccc462d88a68f3c88c8af31fa3f14b8b
[ "MIT" ]
null
null
null
deeplabv3/datahandler.py
RajArPatra/Improvement-semantic-segmentation-using-clustring-and-class-voating
1e4b5fa5ccc462d88a68f3c88c8af31fa3f14b8b
[ "MIT" ]
3
2020-04-19T06:46:25.000Z
2020-04-24T07:48:15.000Z
from torch.utils.data import Dataset, DataLoader import glob import os import numpy as np import cv2 import torch from torchvision import transforms, utils from skimage.transform import resize class SegDataset(Dataset): """Segmentation Dataset""" def __init__(self, root_dir, imageFolder, maskFolder, transfor...
39.08642
162
0.58844
from torch.utils.data import Dataset, DataLoader import glob import os import numpy as np import cv2 import torch from torchvision import transforms, utils from skimage.transform import resize class SegDataset(Dataset): def __init__(self, root_dir, imageFolder, maskFolder, transform=None, seed=None, fraction=Non...
true
true
f7028b5259524a51a3a82357b0d2679eaf4c8043
4,277
py
Python
tests/utils/test_polydata_utils.py
UCL/scikit-surgeryvtk
7d88da36b509158a5385e15fb11f69923fa13fa5
[ "BSD-3-Clause" ]
9
2020-05-29T12:03:12.000Z
2021-06-17T07:14:16.000Z
tests/utils/test_polydata_utils.py
NMontanaBrown/scikit-surgeryvtk
85921775b72f40cdf4ee606ab83531758b0345bb
[ "BSD-3-Clause" ]
164
2020-05-20T07:57:47.000Z
2021-12-08T09:43:26.000Z
tests/utils/test_polydata_utils.py
SciKit-Surgery/scikit-surgeryvtk
75a2cb15f976348b844fea165bddf187efa722f0
[ "BSD-3-Clause" ]
2
2020-10-16T13:50:34.000Z
2021-11-05T13:08:08.000Z
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*- import pytest import vtk import numpy as np import sksurgeryvtk.utils.polydata_utils as pdu import sksurgeryvtk.models.vtk_surface_model as vbs def test_overlapping_bounds(): radius_0=10.0 radius_1=7.0 centre_1=5.0 radius_2=4.0 centre_2=15.0 rad...
34.216
105
0.715455
import pytest import vtk import numpy as np import sksurgeryvtk.utils.polydata_utils as pdu import sksurgeryvtk.models.vtk_surface_model as vbs def test_overlapping_bounds(): radius_0=10.0 radius_1=7.0 centre_1=5.0 radius_2=4.0 centre_2=15.0 radius_3=4.0 centre_3=0.0 sphere_0 = vtk....
true
true
f7028bb4aee8f166e5448402b874d8240dfcf7c0
3,540
py
Python
main.py
wellbs32/random-password-generator
65b75113cd84250b06892e48ebcc21bc54a5bdb5
[ "MIT" ]
null
null
null
main.py
wellbs32/random-password-generator
65b75113cd84250b06892e48ebcc21bc54a5bdb5
[ "MIT" ]
null
null
null
main.py
wellbs32/random-password-generator
65b75113cd84250b06892e48ebcc21bc54a5bdb5
[ "MIT" ]
null
null
null
import string import random # --- Defining Variables --- LOWER_ALPHABET = list(string.ascii_lowercase) DIGITS = list(string.digits) UPPER_ALPHABET = list(string.ascii_uppercase) SYMBOLS = list(string.punctuation) SYMBOLS_DELETE = ['"', "'", "(", ")", ",", ".", ":", ";", "[", "]", "|", "`", "{", "}"] for x in SYMBOLS...
29.5
175
0.549718
import string import random LOWER_ALPHABET = list(string.ascii_lowercase) DIGITS = list(string.digits) UPPER_ALPHABET = list(string.ascii_uppercase) SYMBOLS = list(string.punctuation) SYMBOLS_DELETE = ['"', "'", "(", ")", ",", ".", ":", ";", "[", "]", "|", "`", "{", "}"] for x in SYMBOLS_DELETE: SYMBOLS.remove(x)...
true
true
f7028c6e33cf3e1d7a434c522068735baf06981a
7,316
py
Python
melange/drivers/aws/aws_driver.py
Rydra/melange
5de67dd4eab506353ea05f30df6d250997e3c97f
[ "MIT" ]
7
2017-11-22T15:52:46.000Z
2022-01-17T23:01:24.000Z
melange/drivers/aws/aws_driver.py
Rydra/melange
5de67dd4eab506353ea05f30df6d250997e3c97f
[ "MIT" ]
1
2017-11-30T16:13:52.000Z
2019-02-12T14:51:54.000Z
melange/drivers/aws/aws_driver.py
Rydra/melange
5de67dd4eab506353ea05f30df6d250997e3c97f
[ "MIT" ]
3
2017-11-15T16:34:20.000Z
2022-01-24T11:05:54.000Z
# type: ignore import json import uuid from json import JSONDecodeError from typing import Tuple, Dict, List import boto3 from melange.drivers.interfaces import Queue, Topic, MessagingDriver, Message class AWSDriver(MessagingDriver): def __init__(self, **kwargs): super().__init__() self.max_num...
32.954955
118
0.562876
import json import uuid from json import JSONDecodeError from typing import Tuple, Dict, List import boto3 from melange.drivers.interfaces import Queue, Topic, MessagingDriver, Message class AWSDriver(MessagingDriver): def __init__(self, **kwargs): super().__init__() self.max_number_of_message...
true
true
f7028c9a3da8e2b02799a577a83179212a411809
3,411
py
Python
imsnpars/nparser/graph/builder.py
zentrum-lexikographie/IMSnPars
8d19aa1fc76b0277c861cec774ad81f62cd4e244
[ "Apache-2.0" ]
2
2020-09-28T09:30:22.000Z
2020-11-28T13:36:13.000Z
imsnpars/nparser/graph/builder.py
zentrum-lexikographie/IMSnPars
8d19aa1fc76b0277c861cec774ad81f62cd4e244
[ "Apache-2.0" ]
1
2020-08-13T14:11:45.000Z
2020-08-13T14:11:45.000Z
imsnpars/nparser/graph/builder.py
zentrum-lexikographie/IMSnPars
8d19aa1fc76b0277c861cec774ad81f62cd4e244
[ "Apache-2.0" ]
1
2020-11-28T14:32:56.000Z
2020-11-28T14:32:56.000Z
''' Created on 23.08.2017 @author: falensaa ''' import logging import sys import imsnpars.nparser.features import imsnpars.nparser.network import imsnpars.nparser.graph.features as gfeatures from imsnpars.nparser.graph import task, decoder from imsnpars.nparser.graph.mst import cle from imsnpars.nparser.labels impor...
37.076087
124
0.619173
import logging import sys import imsnpars.nparser.features import imsnpars.nparser.network import imsnpars.nparser.graph.features as gfeatures from imsnpars.nparser.graph import task, decoder from imsnpars.nparser.graph.mst import cle from imsnpars.nparser.labels import task as ltask def buildMSTDecoder(opts, featBu...
true
true
f7028cc13315d37bcb502995874600452971aa1d
6,903
py
Python
kubernetes/client/models/v1beta1_event_list.py
venukarnati92/python-1
3fabf9ed9f4758fb5133975a58fc147471e91d9d
[ "Apache-2.0" ]
1
2022-02-07T21:57:20.000Z
2022-02-07T21:57:20.000Z
kubernetes/client/models/v1beta1_event_list.py
venukarnati92/python-1
3fabf9ed9f4758fb5133975a58fc147471e91d9d
[ "Apache-2.0" ]
1
2022-03-01T03:37:57.000Z
2022-03-01T03:37:57.000Z
kubernetes/client/models/v1beta1_event_list.py
venukarnati92/python-1
3fabf9ed9f4758fb5133975a58fc147471e91d9d
[ "Apache-2.0" ]
null
null
null
# coding: utf-8 """ Kubernetes No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: release-1.22 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import si...
33.509709
312
0.623932
import pprint import re import six from kubernetes.client.configuration import Configuration class V1beta1EventList(object): openapi_types = { 'api_version': 'str', 'items': 'list[V1beta1Event]', 'kind': 'str', 'metadata': 'V1ListMeta' } attribute_map = { ...
true
true
f7028d4fe063a3a562eecc15b66515f81b9f692f
5,130
py
Python
bout.py
vishalbelsare/bout
4731566d2cc2e3cd6f2c4f9cef615a39a66d4516
[ "MIT" ]
null
null
null
bout.py
vishalbelsare/bout
4731566d2cc2e3cd6f2c4f9cef615a39a66d4516
[ "MIT" ]
null
null
null
bout.py
vishalbelsare/bout
4731566d2cc2e3cd6f2c4f9cef615a39a66d4516
[ "MIT" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- """Bout (read bank-out) extracts transactions from pdf bank statements. _ _ (_) (_) (_) _ _ _ _ _ _ _ _ _ (_) _ _ (_)(_)(_)(_)_ _ (_)(_)(_) _ (_) (_)(_)(_)(...
31.666667
114
0.554386
import io import logging import click import csv from collections import namedtuple from datetime import datetime logger = logging.getLogger("bout") profiles = {} Transaction = namedtuple("Transaction", ["id", "date", "payee", "memo", "amount"]) InvalidTransaction = namedtuple("InvalidTran...
true
true
f7028e106fb1937ccea8ec628aca73fc739aadb5
1,355
py
Python
colorizer.py
official71/ezmemo
46348885053372efd62fc3ab1c3b39e31681e053
[ "MIT" ]
null
null
null
colorizer.py
official71/ezmemo
46348885053372efd62fc3ab1c3b39e31681e053
[ "MIT" ]
11
2018-03-29T23:52:38.000Z
2018-04-26T17:44:43.000Z
colorizer.py
official71/ezmemo
46348885053372efd62fc3ab1c3b39e31681e053
[ "MIT" ]
null
null
null
from colored import * import staticconf """ You might find the colored documentation very useful: https://pypi.python.org/pypi/colored """ ENABLE_COLORIZER = staticconf.read_string('enable_colorizer', default='false').lower() == 'true' def colorizer_enabled(function): """do not colorize if it's not enabled""" ...
22.583333
96
0.678229
from colored import * import staticconf ENABLE_COLORIZER = staticconf.read_string('enable_colorizer', default='false').lower() == 'true' def colorizer_enabled(function): def wrapper(*args): if ENABLE_COLORIZER: return function(*args) elif args: return args[0] else...
true
true
f7028f059677a83cf6bbecfd7df23260f585b48f
785
py
Python
sdk/media/azure-mgmt-media/azure/mgmt/media/aio/__init__.py
vincenttran-msft/azure-sdk-for-python
348b56f9f03eeb3f7b502eed51daf494ffff874d
[ "MIT" ]
1
2022-02-01T18:50:12.000Z
2022-02-01T18:50:12.000Z
sdk/media/azure-mgmt-media/azure/mgmt/media/aio/__init__.py
vincenttran-msft/azure-sdk-for-python
348b56f9f03eeb3f7b502eed51daf494ffff874d
[ "MIT" ]
null
null
null
sdk/media/azure-mgmt-media/azure/mgmt/media/aio/__init__.py
vincenttran-msft/azure-sdk-for-python
348b56f9f03eeb3f7b502eed51daf494ffff874d
[ "MIT" ]
null
null
null
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
49.0625
114
0.636943
from ._azure_media_services import AzureMediaServices __all__ = ['AzureMediaServices'] from ._patch import patch_sdk patch_sdk()
true
true
f7028f58d5d64339a8ee0336fccba8b58dc44b75
33,617
py
Python
tests/unit/participants/test_views.py
dubesar/EvalAI
a38fbc8ff8c58f26fb2e61ef67e13055fb0c1f29
[ "BSD-3-Clause" ]
1
2019-11-08T05:23:11.000Z
2019-11-08T05:23:11.000Z
tests/unit/participants/test_views.py
dubesar/EvalAI
a38fbc8ff8c58f26fb2e61ef67e13055fb0c1f29
[ "BSD-3-Clause" ]
2
2019-07-19T04:17:48.000Z
2019-07-19T06:26:31.000Z
tests/unit/participants/test_views.py
Sanji515/EvalAI
888806063b0d6423fd35754e3c37aad02c2b05f7
[ "BSD-3-Clause" ]
1
2020-02-15T11:34:13.000Z
2020-02-15T11:34:13.000Z
from datetime import timedelta from django.core.urlresolvers import reverse_lazy from django.contrib.auth.models import User from django.utils import timezone from allauth.account.models import EmailAddress from rest_framework import status from rest_framework.test import APITestCase, APIClient from challenges.model...
39.089535
148
0.614124
from datetime import timedelta from django.core.urlresolvers import reverse_lazy from django.contrib.auth.models import User from django.utils import timezone from allauth.account.models import EmailAddress from rest_framework import status from rest_framework.test import APITestCase, APIClient from challenges.model...
true
true
f7029017ccc2630634311f5e276c0e3fb26d7895
6,132
py
Python
main.py
Ansaku/TempEmail-Bot
680e6456e9a9caa19df6e8cc3d6b2cb3ff998ff4
[ "Apache-2.0" ]
null
null
null
main.py
Ansaku/TempEmail-Bot
680e6456e9a9caa19df6e8cc3d6b2cb3ff998ff4
[ "Apache-2.0" ]
null
null
null
main.py
Ansaku/TempEmail-Bot
680e6456e9a9caa19df6e8cc3d6b2cb3ff998ff4
[ "Apache-2.0" ]
1
2022-03-23T23:36:29.000Z
2022-03-23T23:36:29.000Z
# copyright 2022 @Ansaku # Telegram @AnkiSatya # Instagram @satya_ask import telebot import requests from telebot.types import InlineKeyboardButton # Fillout Here The BotToken it gets from botfather further queries @AnkiSatya 0n telegram bot = telebot.TeleBot('**********************') while True: try: ...
66.652174
876
0.551696
import telebot import requests from telebot.types import InlineKeyboardButton bot = telebot.TeleBot('**********************') while True: try: keyboard = telebot.types.ReplyKeyboardMarkup(resize_keyboard=True) keyboard.add(InlineKeyboardButton(text='Buat email')) keyboard.a...
true
true
f7029380b00f9f11d71141fa3f7732ac4f5ba6c7
8,120
py
Python
lib/dnsServer/namecoindns.py
bankonmecoin/nmcontrol
49a879b98bb2885e3ba7c9fdf6dfe7e122e0edad
[ "FTL" ]
161
2015-01-08T19:45:20.000Z
2022-01-15T18:25:21.000Z
lib/dnsServer/namecoindns.py
bankonmecoin/nmcontrol
49a879b98bb2885e3ba7c9fdf6dfe7e122e0edad
[ "FTL" ]
77
2015-01-02T02:20:59.000Z
2020-05-25T08:33:56.000Z
lib/dnsServer/namecoindns.py
namecoin/nmcontrol
49a879b98bb2885e3ba7c9fdf6dfe7e122e0edad
[ "FTL" ]
36
2015-02-26T01:51:53.000Z
2022-01-15T18:25:45.000Z
#name_scan "d/yourdomain" 1 import sys, os #sys.path.append('/home/khal/sources/nmcontrol/lib/') import DNS import rpcClient import struct, listdns, base64, types, json, random #from jsonrpc import ServiceProxy from utils import * from common import * class Source(object): #def __init__(self): #self.server...
46.936416
172
0.491995
import sys, os import DNS import rpcClient import struct, listdns, base64, types, json, random from utils import * from common import * class Source(object): def isIP(self, host...
true
true
f702939c992f164058c986345c72844ea2c3df0a
2,852
py
Python
tests/data_tests/writer_tests/json_writer_test.py
alueschow/polymatheia
e46a38b3686139bbab3a2fcfaa914d4ca938654e
[ "MIT" ]
3
2020-09-15T15:15:34.000Z
2021-06-15T10:35:07.000Z
tests/data_tests/writer_tests/json_writer_test.py
alueschow/polymatheia
e46a38b3686139bbab3a2fcfaa914d4ca938654e
[ "MIT" ]
7
2020-09-03T12:53:34.000Z
2020-10-05T09:14:29.000Z
tests/data_tests/writer_tests/json_writer_test.py
alueschow/polymatheia
e46a38b3686139bbab3a2fcfaa914d4ca938654e
[ "MIT" ]
2
2020-10-13T09:12:21.000Z
2021-04-15T14:19:06.000Z
"""Tests for the :mod:`~polymatheia.data.writer` package.""" import json import os from shutil import rmtree from polymatheia.data import NavigableDict from polymatheia.data.writer import JSONWriter DOCUMENTS = [NavigableDict(r) for r in [ { 'id': '1', 'name': { 'first': 'A', ...
31.688889
68
0.471599
import json import os from shutil import rmtree from polymatheia.data import NavigableDict from polymatheia.data.writer import JSONWriter DOCUMENTS = [NavigableDict(r) for r in [ { 'id': '1', 'name': { 'first': 'A', 'last': 'Person' }, 'age': 32, '...
true
true
f70293b9def8f86852689095cc552b5b73ffc04b
13,289
py
Python
tests/unit/registry_test.py
TUNE-Archive/freight_forwarder
6ea4a49f474ec04abb8bb81b175c774a16b5312f
[ "MIT" ]
null
null
null
tests/unit/registry_test.py
TUNE-Archive/freight_forwarder
6ea4a49f474ec04abb8bb81b175c774a16b5312f
[ "MIT" ]
null
null
null
tests/unit/registry_test.py
TUNE-Archive/freight_forwarder
6ea4a49f474ec04abb8bb81b175c774a16b5312f
[ "MIT" ]
null
null
null
# -*- coding: utf-8; -*- from __future__ import unicode_literals, absolute_import import json import requests import six from tests import unittest, mock from freight_forwarder.registry import Registry, V1, V2 from freight_forwarder.registry.registry_base import RegistryBase, RegistryException from ..fa...
40.889231
117
0.658063
from __future__ import unicode_literals, absolute_import import json import requests import six from tests import unittest, mock from freight_forwarder.registry import Registry, V1, V2 from freight_forwarder.registry.registry_base import RegistryBase, RegistryException from ..factories.registry_factory...
true
true
f7029408ce730e634db3b1bb394319bb0bf2ed6b
127
py
Python
icevision/models/ross/efficientdet/loss_fn.py
ai-fast-track/mantisshrimp
cc6d6a4a048f6ddda2782b6593dcd6b083a673e4
[ "Apache-2.0" ]
580
2020-09-10T06:29:57.000Z
2022-03-29T19:34:54.000Z
icevision/models/ross/efficientdet/loss_fn.py
ai-fast-track/mantisshrimp
cc6d6a4a048f6ddda2782b6593dcd6b083a673e4
[ "Apache-2.0" ]
691
2020-09-05T03:08:34.000Z
2022-03-31T23:47:06.000Z
icevision/models/ross/efficientdet/loss_fn.py
lgvaz/mantisshrimp2
743cb7df0dae7eb1331fc2bb66fc9ca09db496cd
[ "Apache-2.0" ]
105
2020-09-09T10:41:35.000Z
2022-03-25T17:16:49.000Z
__all__ = ["loss_fn"] from icevision.imports import * def loss_fn(preds, targets) -> torch.Tensor: return preds["loss"]
15.875
44
0.692913
__all__ = ["loss_fn"] from icevision.imports import * def loss_fn(preds, targets) -> torch.Tensor: return preds["loss"]
true
true
f702941de4e407f4a88237e388c77641c7894dd9
416
py
Python
blog/migrations/0008_alter_post_content.py
samwel2000/portfolio-backend
a7cb50ffa34b9db64bc4532a9d79df0b082fd000
[ "MIT" ]
null
null
null
blog/migrations/0008_alter_post_content.py
samwel2000/portfolio-backend
a7cb50ffa34b9db64bc4532a9d79df0b082fd000
[ "MIT" ]
null
null
null
blog/migrations/0008_alter_post_content.py
samwel2000/portfolio-backend
a7cb50ffa34b9db64bc4532a9d79df0b082fd000
[ "MIT" ]
null
null
null
# Generated by Django 3.2.4 on 2021-09-11 12:44 import ckeditor_uploader.fields from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('blog', '0007_subscriber'), ] operations = [ migrations.AlterField( model_name='post', name='...
20.8
68
0.625
import ckeditor_uploader.fields from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('blog', '0007_subscriber'), ] operations = [ migrations.AlterField( model_name='post', name='content', field=ckeditor_uploader.f...
true
true
f702949d7e5cbdf335ceb60f0431804430f5686c
2,126
py
Python
tests/test_decorators.py
marwahaha/QSpectra
328a4f78af1473d65c011eb99b903c7f0ef1db32
[ "BSD-2-Clause" ]
14
2018-02-01T03:06:26.000Z
2021-09-16T02:50:31.000Z
tests/test_decorators.py
whaley-group-berkeley/qspectra
f0f971ea26c4595a9c7bd4ee98e31e9ba63451c6
[ "BSD-2-Clause" ]
5
2018-01-02T20:33:14.000Z
2021-11-12T23:59:20.000Z
tests/test_decorators.py
whaley-group-berkeley/qspectra
f0f971ea26c4595a9c7bd4ee98e31e9ba63451c6
[ "BSD-2-Clause" ]
7
2018-04-19T05:08:41.000Z
2021-09-16T01:45:24.000Z
import unittest from numpy.testing import assert_allclose from qspectra import polarization from qspectra.simulate import decorators class TestGetCallArgs(unittest.TestCase): def test(self): self.assertEqual( decorators._get_call_args(lambda a: None, 1), {'a': 1}) self.ass...
41.686275
80
0.601129
import unittest from numpy.testing import assert_allclose from qspectra import polarization from qspectra.simulate import decorators class TestGetCallArgs(unittest.TestCase): def test(self): self.assertEqual( decorators._get_call_args(lambda a: None, 1), {'a': 1}) self.ass...
true
true
f70295f364c9fa7735e9cab7413024d68698092b
64
py
Python
enthought/traits/ui/editors/check_list_editor.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
3
2016-12-09T06:05:18.000Z
2018-03-01T13:00:29.000Z
enthought/traits/ui/editors/check_list_editor.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
1
2020-12-02T00:51:32.000Z
2020-12-02T08:48:55.000Z
enthought/traits/ui/editors/check_list_editor.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
null
null
null
# proxy module from traitsui.editors.check_list_editor import *
21.333333
48
0.828125
from traitsui.editors.check_list_editor import *
true
true
f70296d97876b7039d6cd67bbecc249889c24636
4,957
py
Python
dataset_generation/ExtractSantini.py
YuHsin1998/EllSeg
91a532650ef809eef081a7ef9af5f1940fb37a37
[ "MIT" ]
1
2021-05-26T05:45:42.000Z
2021-05-26T05:45:42.000Z
dataset_generation/ExtractSantini.py
xiaohuaibaoguigui/EllSeg
ff56b255f8e650856aec9af23792e105897eba5c
[ "MIT" ]
null
null
null
dataset_generation/ExtractSantini.py
xiaohuaibaoguigui/EllSeg
ff56b255f8e650856aec9af23792e105897eba5c
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed May 29 16:16:57 2019 @author: rakshit """ import os import cv2 import argparse import matplotlib import numpy as np import deepdish as dd import scipy.io as scio print('Extracting Santini') parser = argparse.ArgumentParser() parser.add_argument('--noD...
33.046667
108
0.571717
import os import cv2 import argparse import matplotlib import numpy as np import deepdish as dd import scipy.io as scio print('Extracting Santini') parser = argparse.ArgumentParser() parser.add_argument('--noDisp', help='Specify flag to display labelled images', type=int) parser.add_argument('--path2ds', help='Path...
true
true
f70296f7f9d79a7e89f869920b8a89f1d9105870
38,097
py
Python
arkalos/app/arkalos_views/arkalos_common.py
kantale/arkalos
0e8776a2458b6be79ceea8d78c91fe8c067df50a
[ "AFL-3.0" ]
null
null
null
arkalos/app/arkalos_views/arkalos_common.py
kantale/arkalos
0e8776a2458b6be79ceea8d78c91fe8c067df50a
[ "AFL-3.0" ]
1
2017-06-20T13:59:24.000Z
2017-06-20T13:59:24.000Z
arkalos/app/arkalos_views/arkalos_common.py
kantale/arkalos
0e8776a2458b6be79ceea8d78c91fe8c067df50a
[ "AFL-3.0" ]
null
null
null
from django.http import HttpResponse from django.contrib.auth.models import User from django.contrib.auth import authenticate, login, logout from django.shortcuts import redirect from django.core.validators import URLValidator # https://stackoverflow.com/questions/7160737/python-how-to-validate-a-url-in-python-malf...
28.579895
236
0.590729
from django.http import HttpResponse from django.contrib.auth.models import User from django.contrib.auth import authenticate, login, logout from django.shortcuts import redirect from django.core.validators import URLValidator from django.core.exceptions import ValidationError, ObjectDoesNotExist from django.db.m...
true
true
f70297f48478ba961bd1e24c7eaa558a44b1e6f1
52,230
py
Python
app/venv/lib/python2.7/site-packages/numpy/lib/arraypad.py
anaheino/Ufo-sightings-map
64af02093f97737cbbdfd8af9e1aeb4d8aa8fcdc
[ "MIT" ]
652
2015-07-26T00:00:17.000Z
2022-02-24T18:30:04.000Z
app/venv/lib/python2.7/site-packages/numpy/lib/arraypad.py
anaheino/Ufo-sightings-map
64af02093f97737cbbdfd8af9e1aeb4d8aa8fcdc
[ "MIT" ]
75
2016-01-14T16:03:02.000Z
2020-04-29T22:51:53.000Z
app/venv/lib/python2.7/site-packages/numpy/lib/arraypad.py
anaheino/Ufo-sightings-map
64af02093f97737cbbdfd8af9e1aeb4d8aa8fcdc
[ "MIT" ]
40
2015-07-24T19:45:08.000Z
2021-11-01T14:54:56.000Z
""" The arraypad module contains a group of functions to pad values onto the edges of an n-dimensional array. """ from __future__ import division, absolute_import, print_function import numpy as np __all__ = ['pad'] ############################################################################### # Private utility ...
34.866489
79
0.579629
from __future__ import division, absolute_import, print_function import numpy as np __all__ = ['pad'] t, axis) slope = (end - edge_pad) / float(pad_amt) ramp_arr = ramp_arr * slope ramp_arr += edge_pad _round_ifneeded(ramp_arr, arr.dtype) return np.concatenate((ramp_arr.astype(arr.d...
true
true
f70298a7b694786f2a04821421d50d8e82091c26
5,488
py
Python
test/integration/src/py/test_bulk_transfers.py
emeseight/sifnode
cf52c0cf622fd5113c0a1a8f704e5f62ef3ae4c3
[ "Apache-2.0" ]
85
2020-10-24T07:35:55.000Z
2022-03-27T10:27:55.000Z
test/integration/src/py/test_bulk_transfers.py
emeseight/sifnode
cf52c0cf622fd5113c0a1a8f704e5f62ef3ae4c3
[ "Apache-2.0" ]
1,760
2020-10-24T07:37:17.000Z
2022-03-31T17:59:44.000Z
test/integration/src/py/test_bulk_transfers.py
emeseight/sifnode
cf52c0cf622fd5113c0a1a8f704e5f62ef3ae4c3
[ "Apache-2.0" ]
115
2020-10-31T07:32:38.000Z
2022-03-29T21:12:25.000Z
import copy import json import logging import pytest import burn_lock_functions import test_utilities from integration_env_credentials import sifchain_cli_credentials_for_test from pytest_utilities import generate_minimal_test_account from test_utilities import EthereumToSifchainTransferRequest, SifchaincliCredential...
44.983607
142
0.714103
import copy import json import logging import pytest import burn_lock_functions import test_utilities from integration_env_credentials import sifchain_cli_credentials_for_test from pytest_utilities import generate_minimal_test_account from test_utilities import EthereumToSifchainTransferRequest, SifchaincliCredential...
true
true
f702992dc148b3f53c8d0340cf67d9897004131c
5,174
py
Python
src/pip/_internal/build_env.py
atse/pip
b47b2fa8e6a70f2d8c93b14a1292bf6eb82b6355
[ "MIT" ]
null
null
null
src/pip/_internal/build_env.py
atse/pip
b47b2fa8e6a70f2d8c93b14a1292bf6eb82b6355
[ "MIT" ]
null
null
null
src/pip/_internal/build_env.py
atse/pip
b47b2fa8e6a70f2d8c93b14a1292bf6eb82b6355
[ "MIT" ]
null
null
null
"""Build Environment used for isolation during sdist building """ import logging import os import sys import textwrap from distutils.sysconfig import get_python_lib from sysconfig import get_paths from pip._vendor.pkg_resources import Requirement, VersionConflict, WorkingSet from pip import __file__ as pip_location ...
33.380645
78
0.603402
import logging import os import sys import textwrap from distutils.sysconfig import get_python_lib from sysconfig import get_paths from pip._vendor.pkg_resources import Requirement, VersionConflict, WorkingSet from pip import __file__ as pip_location from pip._internal.utils.misc import call_subprocess from pip._int...
true
true
f70299a27cf778ccd0e0029d544c3610372d7746
5,483
py
Python
src/negotiating_agent/test_agent/TU-Delft-Collaborative-AI-Negotiation/agents/random_agent/random_agent.py
HahaBill/CollaborativeAI
f771cd2f34774c74c58e49a7e983d6244ea35eff
[ "MIT" ]
1
2022-02-17T19:14:46.000Z
2022-02-17T19:14:46.000Z
src/negotiating_agent/test_agent/TU-Delft-Collaborative-AI-Negotiation/agents/random_agent/random_agent.py
HahaBill/CollaborativeAI
f771cd2f34774c74c58e49a7e983d6244ea35eff
[ "MIT" ]
null
null
null
src/negotiating_agent/test_agent/TU-Delft-Collaborative-AI-Negotiation/agents/random_agent/random_agent.py
HahaBill/CollaborativeAI
f771cd2f34774c74c58e49a7e983d6244ea35eff
[ "MIT" ]
null
null
null
import logging from random import randint import traceback from typing import cast, Dict, List, Set, Collection from geniusweb.actions.Accept import Accept from geniusweb.actions.Action import Action from geniusweb.actions.LearningDone import LearningDone from geniusweb.actions.Offer import Offer from geniusweb.action...
38.612676
157
0.655116
import logging from random import randint import traceback from typing import cast, Dict, List, Set, Collection from geniusweb.actions.Accept import Accept from geniusweb.actions.Action import Action from geniusweb.actions.LearningDone import LearningDone from geniusweb.actions.Offer import Offer from geniusweb.action...
true
true
f70299a88cbcaeb559e7429ab61fc8c936bbdd40
475
py
Python
src/constants.py
inwe-boku/windpower-decomposition-usa
e7b11c9fffc4864d2e4f3cb7e4c6f3cfaf469ff7
[ "MIT" ]
null
null
null
src/constants.py
inwe-boku/windpower-decomposition-usa
e7b11c9fffc4864d2e4f3cb7e4c6f3cfaf469ff7
[ "MIT" ]
null
null
null
src/constants.py
inwe-boku/windpower-decomposition-usa
e7b11c9fffc4864d2e4f3cb7e4c6f3cfaf469ff7
[ "MIT" ]
null
null
null
METER_TO_KM = 1e-3 ONE_TO_KILO = 1e3 KM_TO_METER = 1e3 KILO_TO_ONE = 1e3 # Average earth radius, see https://en.wikipedia.org/wiki/Earth_radius EARTH_RADIUS_KM = 6371.0088 # in reality air density varies between 1.14 and 1.42 in kg/m^3 AIR_DENSITY_RHO = 1.225 # of course this introduces a small mistake due to leap ...
29.6875
91
0.766316
METER_TO_KM = 1e-3 ONE_TO_KILO = 1e3 KM_TO_METER = 1e3 KILO_TO_ONE = 1e3 EARTH_RADIUS_KM = 6371.0088 AIR_DENSITY_RHO = 1.225 # Warning: in most cases it might be better to use mean() instead of sum()/HOURS_PER_YEAR HOURS_PER_YEAR = 8765.812536
true
true
f70299afa9fb9cd0c528109e36d8380ed2dbcbe6
1,064
py
Python
Python/add-binary.py
sm2774us/leetcode_interview_prep_2021
33b41bea66c266b733372d9a8b9d2965cd88bf8c
[ "Fair" ]
null
null
null
Python/add-binary.py
sm2774us/leetcode_interview_prep_2021
33b41bea66c266b733372d9a8b9d2965cd88bf8c
[ "Fair" ]
null
null
null
Python/add-binary.py
sm2774us/leetcode_interview_prep_2021
33b41bea66c266b733372d9a8b9d2965cd88bf8c
[ "Fair" ]
null
null
null
# Time: O(n) # Space: O(1) class Solution(object): # @param a, a string # @param b, a string # @return a string def addBinary(self, a, b): result, carry, val = "", 0, 0 for i in range(max(len(a), len(b))): val = carry if i < len(a): val += int(a[...
23.644444
73
0.451128
class Solution(object): def addBinary(self, a, b): result, carry, val = "", 0, 0 for i in range(max(len(a), len(b))): val = carry if i < len(a): val += int(a[-(i + 1)]) if i < len(b): val += int(b[-(i + 1)]) ...
true
true
f7029ae637a41736ba37b57a855102b48c280817
111,937
py
Python
sympy/core/tests/test_args.py
nishithshah2211/sympy
edc620ca662f7163637c7fb5823f22523b7f2fe9
[ "BSD-3-Clause" ]
1
2019-06-27T13:40:28.000Z
2019-06-27T13:40:28.000Z
sympy/core/tests/test_args.py
amitsaha/sympy
43ddfc644fd604a3dc0d4cac0aebfecd051917c1
[ "BSD-3-Clause" ]
null
null
null
sympy/core/tests/test_args.py
amitsaha/sympy
43ddfc644fd604a3dc0d4cac0aebfecd051917c1
[ "BSD-3-Clause" ]
null
null
null
"""Test whether all elements of cls.args are instances of Basic. """ # NOTE: keep tests sorted by (module, class name) key. If a class can't # be instantiated, add it here anyway with @SKIP("abstract class) (see # e.g. Function). import os import re import warnings import io from sympy import Basic, S, symbols, sqrt...
31.710198
135
0.778366
# be instantiated, add it here anyway with @SKIP("abstract class) (see # e.g. Function). import os import re import warnings import io from sympy import Basic, S, symbols, sqrt, sin, oo, Interval, exp from sympy.core.compatibility import range from sympy.utilities.pytest import XFAIL, SKIP from sympy.utilities.exce...
true
true
f7029b3beb7195ba068d85097363523b962ab536
136
py
Python
ARC076/ARC076e.py
VolgaKurvar/AtCoder
21acb489f1594bbb1cdc64fbf8421d876b5b476d
[ "Unlicense" ]
null
null
null
ARC076/ARC076e.py
VolgaKurvar/AtCoder
21acb489f1594bbb1cdc64fbf8421d876b5b476d
[ "Unlicense" ]
null
null
null
ARC076/ARC076e.py
VolgaKurvar/AtCoder
21acb489f1594bbb1cdc64fbf8421d876b5b476d
[ "Unlicense" ]
null
null
null
#ARC076e def main(): import sys input=sys.stdin.readline sys.setrecursionlimit(10**6) if __name__ == '__main__': main()
17
32
0.654412
def main(): import sys input=sys.stdin.readline sys.setrecursionlimit(10**6) if __name__ == '__main__': main()
true
true
f7029c9b1d4976a50cf98e8502601e9ea1b91175
337
py
Python
access/management/commands/access_create_internal_aliases.py
darkismus/kompassi
35dea2c7af2857a69cae5c5982b48f01ba56da1f
[ "CC-BY-3.0" ]
13
2015-11-29T12:19:12.000Z
2021-02-21T15:42:11.000Z
access/management/commands/access_create_internal_aliases.py
darkismus/kompassi
35dea2c7af2857a69cae5c5982b48f01ba56da1f
[ "CC-BY-3.0" ]
23
2015-04-29T19:43:34.000Z
2021-02-10T05:50:17.000Z
access/management/commands/access_create_internal_aliases.py
darkismus/kompassi
35dea2c7af2857a69cae5c5982b48f01ba56da1f
[ "CC-BY-3.0" ]
11
2015-09-20T18:59:00.000Z
2020-02-07T08:47:34.000Z
from django.core.management.base import BaseCommand from django.utils.timezone import now class Command(BaseCommand): args = '[event_slug...]' help = 'Create missing email aliases' def handle(*args, **opts): from access.models import InternalEmailAlias InternalEmailAlias.ensure_internal_...
24.071429
58
0.732938
from django.core.management.base import BaseCommand from django.utils.timezone import now class Command(BaseCommand): args = '[event_slug...]' help = 'Create missing email aliases' def handle(*args, **opts): from access.models import InternalEmailAlias InternalEmailAlias.ensure_internal_...
true
true
f7029d2c344fe7b18326f6b65133b21dcec1e3e7
956
py
Python
django_server/feedback_map/rest/tests/base.py
ForumViriumHelsinki/FVHFeedbackMap
cfbf3dd8715e34351fb1ba628ebb0c5eb82e78e0
[ "MIT" ]
null
null
null
django_server/feedback_map/rest/tests/base.py
ForumViriumHelsinki/FVHFeedbackMap
cfbf3dd8715e34351fb1ba628ebb0c5eb82e78e0
[ "MIT" ]
39
2020-12-30T11:03:49.000Z
2021-11-10T12:16:29.000Z
django_server/feedback_map/rest/tests/base.py
ForumViriumHelsinki/FVHFeedbackMap
cfbf3dd8715e34351fb1ba628ebb0c5eb82e78e0
[ "MIT" ]
1
2020-12-08T13:19:33.000Z
2020-12-08T13:19:33.000Z
from django.contrib.auth.models import User from rest_framework.test import APITestCase class FVHAPITestCase(APITestCase): def assert_dict_contains(self, superset, subset, path=''): for key, expected in subset.items(): full_path = path + key received = superset.get(key, None) ...
38.24
111
0.621339
from django.contrib.auth.models import User from rest_framework.test import APITestCase class FVHAPITestCase(APITestCase): def assert_dict_contains(self, superset, subset, path=''): for key, expected in subset.items(): full_path = path + key received = superset.get(key, None) ...
true
true
f7029dd1805bb86b5c26cdc6d17720b337162e8a
20,089
bzl
Python
packages/typescript/internal/ts_project.bzl
JiaLiPassion/rules_nodejs
2424d1e32b564fcc37b57d593b871461a62f3237
[ "Apache-2.0" ]
null
null
null
packages/typescript/internal/ts_project.bzl
JiaLiPassion/rules_nodejs
2424d1e32b564fcc37b57d593b871461a62f3237
[ "Apache-2.0" ]
null
null
null
packages/typescript/internal/ts_project.bzl
JiaLiPassion/rules_nodejs
2424d1e32b564fcc37b57d593b871461a62f3237
[ "Apache-2.0" ]
null
null
null
"ts_project rule" load("@build_bazel_rules_nodejs//:providers.bzl", "DeclarationInfo", "NpmPackageInfo", "declaration_info", "js_module_info", "run_node") _DEFAULT_TSC = ( # BEGIN-INTERNAL "@npm" + # END-INTERNAL "//typescript/bin:tsc" ) _ATTRS = { "args": attr.string_list(), "declaration_dir...
45.865297
157
0.662104
load("@build_bazel_rules_nodejs//:providers.bzl", "DeclarationInfo", "NpmPackageInfo", "declaration_info", "js_module_info", "run_node") _DEFAULT_TSC = ( "@npm" + "//typescript/bin:tsc" ) _ATTRS = { "args": attr.string_list(), "declaration_dir": attr.string(), "deps": attr.label_list(pr...
true
true
f7029df8f7bce93b2ecff06eff3a6b32d27d9d3d
140
py
Python
marrow/dsl/exc.py
marrow/dsl
79899531361aace5741a79de79304e1f7aaa600d
[ "MIT" ]
10
2018-02-23T07:13:29.000Z
2021-11-08T14:53:47.000Z
marrow/dsl/exc.py
marrow/dsl
79899531361aace5741a79de79304e1f7aaa600d
[ "MIT" ]
null
null
null
marrow/dsl/exc.py
marrow/dsl
79899531361aace5741a79de79304e1f7aaa600d
[ "MIT" ]
null
null
null
# encoding: utf-8 from __future__ import unicode_literals class TranslationError(Exception): """Failure to translate source.""" pass
14
39
0.757143
from __future__ import unicode_literals class TranslationError(Exception): pass
true
true
f7029e2387e943ad5f298a67c17e2e40f52d5567
362
py
Python
sample_problems/problems_with_solution57.py
adi01trip01/adi_workspace
f493b3ba84645eec3a57607243760a826880d1a3
[ "MIT" ]
null
null
null
sample_problems/problems_with_solution57.py
adi01trip01/adi_workspace
f493b3ba84645eec3a57607243760a826880d1a3
[ "MIT" ]
null
null
null
sample_problems/problems_with_solution57.py
adi01trip01/adi_workspace
f493b3ba84645eec3a57607243760a826880d1a3
[ "MIT" ]
null
null
null
# Write a Python program to get execution time for a Python method. import time def sum_of_n_numbers(x): start_time = time.time() s = 0 for i in range(1, x + 1): s = s + i end_time = time.time() return s, end_time - start_time n = 5 print("\nTime to sum of 1 to ", n, " and required time...
21.294118
95
0.632597
import time def sum_of_n_numbers(x): start_time = time.time() s = 0 for i in range(1, x + 1): s = s + i end_time = time.time() return s, end_time - start_time n = 5 print("\nTime to sum of 1 to ", n, " and required time to calculate is :", sum_of_n_numbers(n))
true
true
f7029e2981a4619967429d8979bc4eb77eb2ef8d
13,759
py
Python
kivy/input/providers/mtdev.py
DaleEMoore/kivy
3fc5a455d8f50c857866082091f09b834ecf64af
[ "MIT" ]
1
2017-10-25T03:23:36.000Z
2017-10-25T03:23:36.000Z
kivy/input/providers/mtdev.py
DaleEMoore/kivy
3fc5a455d8f50c857866082091f09b834ecf64af
[ "MIT" ]
null
null
null
kivy/input/providers/mtdev.py
DaleEMoore/kivy
3fc5a455d8f50c857866082091f09b834ecf64af
[ "MIT" ]
null
null
null
''' Native support for Multitouch devices on Linux, using libmtdev. =============================================================== The Mtdev project is a part of the Ubuntu Maverick multitouch architecture. You can read more on http://wiki.ubuntu.com/Multitouch To configure MTDev, it's preferable to use probesysfs p...
38.977337
79
0.49226
__all__ = ('MTDMotionEventProvider', 'MTDMotionEvent') import os from kivy.input.motionevent import MotionEvent from kivy.input.shape import ShapeRect class MTDMotionEvent(MotionEvent): def depack(self, args): self.is_touch = True if 'x' in args: self.sx = args['x'] else: ...
true
true
f7029ebf8b275c2961b1fda13c18da5f443bfc24
825
py
Python
backend/data_export/tests/test_dataset.py
arcada-uas/doccano
c29aece3dd4504eeaaa3466af0663bfe18b90dc1
[ "MIT" ]
2,082
2018-05-09T07:16:21.000Z
2019-12-01T16:41:50.000Z
backend/data_export/tests/test_dataset.py
arcada-uas/doccano
c29aece3dd4504eeaaa3466af0663bfe18b90dc1
[ "MIT" ]
365
2018-07-31T13:49:05.000Z
2019-11-29T11:25:17.000Z
backend/data_export/tests/test_dataset.py
arcada-uas/doccano
c29aece3dd4504eeaaa3466af0663bfe18b90dc1
[ "MIT" ]
476
2018-08-17T06:43:57.000Z
2019-12-01T09:47:08.000Z
import unittest from unittest.mock import MagicMock import pandas as pd from pandas.testing import assert_frame_equal from data_export.pipeline.dataset import Dataset class TestDataset(unittest.TestCase): def setUp(self): example = MagicMock() example.to_dict.return_value = {"data": "example"} ...
31.730769
75
0.672727
import unittest from unittest.mock import MagicMock import pandas as pd from pandas.testing import assert_frame_equal from data_export.pipeline.dataset import Dataset class TestDataset(unittest.TestCase): def setUp(self): example = MagicMock() example.to_dict.return_value = {"data": "example"} ...
true
true
f7029fff48454ff996b3fa84325dfe291ea89943
706
py
Python
src/python/grpcio_channelz/grpc_version.py
xeno14/grpc
ceb12c6be5f801997db976b564ddb14f95e46ce9
[ "Apache-2.0" ]
2
2019-08-15T18:29:13.000Z
2020-11-03T20:18:42.000Z
src/python/grpcio_channelz/grpc_version.py
xeno14/grpc
ceb12c6be5f801997db976b564ddb14f95e46ce9
[ "Apache-2.0" ]
2
2017-03-07T22:54:36.000Z
2017-04-14T15:17:36.000Z
src/python/grpcio_channelz/grpc_version.py
xeno14/grpc
ceb12c6be5f801997db976b564ddb14f95e46ce9
[ "Apache-2.0" ]
1
2021-08-03T19:12:54.000Z
2021-08-03T19:12:54.000Z
# Copyright 2018 The gRPC Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
39.222222
99
0.763456
VERSION = '1.23.0.dev0'
true
true
f702a06791c1c7d80d4cc9c623916b3a47b3c85a
15,279
py
Python
tools/external_converter_v2/parser/kill_fluid/fluid_helper.py
kiritigowda/Anakin
4ba2329153163590e11875dc6b4150031066915d
[ "Apache-2.0" ]
null
null
null
tools/external_converter_v2/parser/kill_fluid/fluid_helper.py
kiritigowda/Anakin
4ba2329153163590e11875dc6b4150031066915d
[ "Apache-2.0" ]
3
2018-06-22T09:08:44.000Z
2018-07-04T08:38:30.000Z
tools/external_converter_v2/parser/kill_fluid/fluid_helper.py
kiritigowda/Anakin
4ba2329153163590e11875dc6b4150031066915d
[ "Apache-2.0" ]
null
null
null
from ..proto import * from ..graph_io import * import paddle.fluid as fluid import numpy as np from paddle.fluid.core import VarDesc, AttrType def union(list_a, list_b): return list(set(list_a).union(set(list_b))) def difference(list_a, list_b): return list(set(list_a).difference(set(list_b))) class Edge_for_flu...
29.553191
116
0.698344
from ..proto import * from ..graph_io import * import paddle.fluid as fluid import numpy as np from paddle.fluid.core import VarDesc, AttrType def union(list_a, list_b): return list(set(list_a).union(set(list_b))) def difference(list_a, list_b): return list(set(list_a).difference(set(list_b))) class Edge_for_flu...
true
true
f702a16a4c7e987eab3c8054b87c6ed9a6452980
10,100
py
Python
myven/lib/python3.8/site-packages/ansible/modules/cloud/vmware/vcenter_folder.py
baltham/dne-dna-code
4a13309a790a670d2f07e635c9264a0c29976c6a
[ "MIT" ]
1
2021-04-02T08:08:39.000Z
2021-04-02T08:08:39.000Z
myven/lib/python3.8/site-packages/ansible/modules/cloud/vmware/vcenter_folder.py
baltham/dne-dna-code
4a13309a790a670d2f07e635c9264a0c29976c6a
[ "MIT" ]
null
null
null
myven/lib/python3.8/site-packages/ansible/modules/cloud/vmware/vcenter_folder.py
baltham/dne-dna-code
4a13309a790a670d2f07e635c9264a0c29976c6a
[ "MIT" ]
1
2020-05-03T01:13:16.000Z
2020-05-03T01:13:16.000Z
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'metadata...
39.76378
128
0.629307
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community' } DOCUMENTATION = r''' --- module: vcenter_folder short_description: Manage folders on given datacenter description...
true
true
f702a18d54a46af8e2dc11e1153545101f920c8d
10,971
py
Python
disturbance/components/approvals/email.py
KellyThomas/disturbance
d2096d39a199dc615b430dc43b1d0e05fab4c35f
[ "Apache-2.0" ]
null
null
null
disturbance/components/approvals/email.py
KellyThomas/disturbance
d2096d39a199dc615b430dc43b1d0e05fab4c35f
[ "Apache-2.0" ]
null
null
null
disturbance/components/approvals/email.py
KellyThomas/disturbance
d2096d39a199dc615b430dc43b1d0e05fab4c35f
[ "Apache-2.0" ]
null
null
null
import logging from django.core.mail import EmailMultiAlternatives, EmailMessage from django.utils.encoding import smart_text from django.core.urlresolvers import reverse from django.conf import settings from disturbance.components.emails.emails import TemplateEmailBase from ledger.accounts.models import EmailUser l...
35.970492
101
0.700939
import logging from django.core.mail import EmailMultiAlternatives, EmailMessage from django.utils.encoding import smart_text from django.core.urlresolvers import reverse from django.conf import settings from disturbance.components.emails.emails import TemplateEmailBase from ledger.accounts.models import EmailUser l...
true
true
f702a1d2e380b80b1174c5cef1e503b3d1000993
13,542
py
Python
etender_service.py
Bodyan37/robot_tests.broker.etender
be35364965d886312e0b6d803f985f2cfc981a94
[ "Apache-2.0" ]
null
null
null
etender_service.py
Bodyan37/robot_tests.broker.etender
be35364965d886312e0b6d803f985f2cfc981a94
[ "Apache-2.0" ]
null
null
null
etender_service.py
Bodyan37/robot_tests.broker.etender
be35364965d886312e0b6d803f985f2cfc981a94
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 - from iso8601 import parse_date from datetime import datetime, date, time, timedelta import dateutil.parser from pytz import timezone import os from decimal import Decimal import re TZ = timezone(os.environ['TZ'] if 'TZ' in os.environ else 'Europe/Kiev') def get_all_etender_dates(initial_tender...
35.920424
119
0.645326
from iso8601 import parse_date from datetime import datetime, date, time, timedelta import dateutil.parser from pytz import timezone import os from decimal import Decimal import re TZ = timezone(os.environ['TZ'] if 'TZ' in os.environ else 'Europe/Kiev') def get_all_etender_dates(initial_tender_data): tender_pe...
true
true
f702a1da97b07980eb0080e9eb0cd536cdc7c88d
28,785
py
Python
python/ray/tests/test_runtime_env.py
RaphaelCS/ray
5f4d9085d2452186bff563fb2856e643c4c82095
[ "Apache-2.0" ]
1
2022-02-24T02:38:04.000Z
2022-02-24T02:38:04.000Z
python/ray/tests/test_runtime_env.py
swag1ong/ray
fdbeef604692aa308973988b32405ec0d70f9f40
[ "Apache-2.0" ]
null
null
null
python/ray/tests/test_runtime_env.py
swag1ong/ray
fdbeef604692aa308973988b32405ec0d70f9f40
[ "Apache-2.0" ]
null
null
null
import os import pytest import sys import random import tempfile import requests from pathlib import Path import ray from ray.test_utils import (run_string_as_driver, run_string_as_driver_nonblocking) from ray._private.utils import (get_wheel_filename, get_master_wheel_url, ...
35.537037
79
0.640021
import os import pytest import sys import random import tempfile import requests from pathlib import Path import ray from ray.test_utils import (run_string_as_driver, run_string_as_driver_nonblocking) from ray._private.utils import (get_wheel_filename, get_master_wheel_url, ...
true
true
f702a468588e10d781ab9dbc62f627d8b569cd7c
262
py
Python
src/PostService/__init__.py
Group-13-Bachelor/Microservice
c7186953e6ef63d141ea148e74b6bbbe3242f71e
[ "MIT" ]
null
null
null
src/PostService/__init__.py
Group-13-Bachelor/Microservice
c7186953e6ef63d141ea148e74b6bbbe3242f71e
[ "MIT" ]
1
2022-02-14T09:31:04.000Z
2022-03-02T13:04:33.000Z
src/PostService/__init__.py
Group-13-Bachelor/Microservice
c7186953e6ef63d141ea148e74b6bbbe3242f71e
[ "MIT" ]
null
null
null
from flask import Flask from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///posts.db' app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False # app.config['FLASK_RUN_PORT'] = 5002 db = SQLAlchemy(app)
23.818182
60
0.774809
from flask import Flask from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///posts.db' app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False db = SQLAlchemy(app)
true
true
f702a49b0738bb825345e613e66c54392b82e80e
1,670
py
Python
test/test_get_account_plan.py
Danilka/APIv3-python-library
c96472f47d652d2e09e8b4a48a80e33fde06e7f1
[ "MIT" ]
null
null
null
test/test_get_account_plan.py
Danilka/APIv3-python-library
c96472f47d652d2e09e8b4a48a80e33fde06e7f1
[ "MIT" ]
null
null
null
test/test_get_account_plan.py
Danilka/APIv3-python-library
c96472f47d652d2e09e8b4a48a80e33fde06e7f1
[ "MIT" ]
null
null
null
# coding: utf-8 """ SendinBlue API SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at h...
40.731707
820
0.673653
from __future__ import absolute_import import unittest import sib_api_v3_sdk from sib_api_v3_sdk.models.get_account_plan import GetAccountPlan from sib_api_v3_sdk.rest import ApiException class TestGetAccountPlan(unittest.TestCase): def setUp(self): pass def tearDown(self): pass ...
true
true
f702a4a82b4b1953954629cd1af554b044385a86
5,977
py
Python
model/video_cnn.py
Fengdalu/LEARN-AN-EFFECTIVE-LIP-READING-MODEL-WITHOUT-PAINS
8d5eef415c19b4c5e161259b1222fbfec6a5edb0
[ "MIT" ]
92
2020-11-16T04:23:14.000Z
2022-02-28T19:29:18.000Z
model/video_cnn.py
echoyinke/learn-an-effective-lip-reading-model-without-pains
8d5eef415c19b4c5e161259b1222fbfec6a5edb0
[ "MIT" ]
21
2020-12-26T05:53:56.000Z
2022-01-26T06:47:18.000Z
model/video_cnn.py
echoyinke/learn-an-effective-lip-reading-model-without-pains
8d5eef415c19b4c5e161259b1222fbfec6a5edb0
[ "MIT" ]
22
2020-11-20T04:09:37.000Z
2021-12-25T13:27:27.000Z
# coding: utf-8 import math import numpy as np import torch import torch.nn as nn from torch.autograd import Variable import torch.nn.functional as F def conv3x3(in_planes, out_planes, stride=1): return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=1, bias=False) ...
31.624339
105
0.52953
import math import numpy as np import torch import torch.nn as nn from torch.autograd import Variable import torch.nn.functional as F def conv3x3(in_planes, out_planes, stride=1): return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=1, bias=False) def conv1x1(in_...
true
true
f702a59f427362751552fc4050a4365a830015ce
740
py
Python
hack-at-brown-2015/tweepy/__init__.py
hackatbrown/2015.hackatbrown.org
6e6e10b010421228deb562909a1c8bb4272b759f
[ "MIT" ]
24
2015-11-12T06:33:24.000Z
2019-04-16T11:11:13.000Z
hack-at-brown-2015/tweepy/__init__.py
hackatbrown/2015.hackatbrown.org
6e6e10b010421228deb562909a1c8bb4272b759f
[ "MIT" ]
3
2015-11-12T22:16:22.000Z
2021-08-09T07:00:27.000Z
hack-at-brown-2015/tweepy/__init__.py
hackatbrown/2015.hackatbrown.org
6e6e10b010421228deb562909a1c8bb4272b759f
[ "MIT" ]
7
2015-11-12T20:09:56.000Z
2020-12-16T17:59:02.000Z
# Tweepy # Copyright 2009-2010 Joshua Roesslein # See LICENSE for details. """ Tweepy Twitter API library """ __version__ = '3.2.0' __author__ = 'Joshua Roesslein' __license__ = 'MIT' from tweepy.models import Status, User, DirectMessage, Friendship, SavedSearch, SearchResults, ModelFactory, Category from tweepy.erro...
28.461538
117
0.793243
__version__ = '3.2.0' __author__ = 'Joshua Roesslein' __license__ = 'MIT' from tweepy.models import Status, User, DirectMessage, Friendship, SavedSearch, SearchResults, ModelFactory, Category from tweepy.error import TweepError from tweepy.api import API from tweepy.cache import Cache, MemoryCache, FileCache from ...
true
true
f702a73b23acce91aa9cdd7f67b38c7b12687972
162,774
py
Python
test/probe/test_sharder.py
masoud91/swift
19b2e3756521d050a95fb2808d4780d52e7be97f
[ "Apache-2.0" ]
3
2020-08-10T14:13:49.000Z
2021-08-08T10:21:31.000Z
test/probe/test_sharder.py
masoud91/swift
19b2e3756521d050a95fb2808d4780d52e7be97f
[ "Apache-2.0" ]
1
2021-02-02T09:35:05.000Z
2021-02-02T09:35:05.000Z
test/probe/test_sharder.py
masoud91/swift
19b2e3756521d050a95fb2808d4780d52e7be97f
[ "Apache-2.0" ]
null
null
null
# Copyright (c) 2017 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
49.930675
79
0.623613
import json import os import shutil import subprocess import uuid from nose import SkipTest import six from six.moves.urllib.parse import quote from swift.common import direct_client, utils from swift.common.manager import Manager from swift.common.memcached import MemcacheRing from swift.common.utils i...
true
true
f702a83360c91a0c7d5e24011db3653f658bd555
394
py
Python
test/test_google_search.py
mtkumar123/CSC510_Project_LectureAid
678e39596ca583eda961413118781bafa02c6f1d
[ "MIT" ]
null
null
null
test/test_google_search.py
mtkumar123/CSC510_Project_LectureAid
678e39596ca583eda961413118781bafa02c6f1d
[ "MIT" ]
45
2021-09-13T00:26:54.000Z
2021-09-30T01:12:53.000Z
test/test_google_search.py
mtkumar123/CSC510_Project_LectureAid
678e39596ca583eda961413118781bafa02c6f1d
[ "MIT" ]
2
2021-09-29T00:40:56.000Z
2021-10-17T14:28:25.000Z
import unittest from code.google_search import get_people_also_ask_links class TestGoogleSearch(unittest.TestCase): def setUp(self) -> None: pass def test_get_people_also_ask_links(self): """Test the get_people_also_ask_links method""" test = "principal components" result = get...
30.307692
56
0.72335
import unittest from code.google_search import get_people_also_ask_links class TestGoogleSearch(unittest.TestCase): def setUp(self) -> None: pass def test_get_people_also_ask_links(self): test = "principal components" result = get_people_also_ask_links(test) self.assertEqual(li...
true
true
f702aa423d4c47e5a80244f89f501ffc9d1a9a08
4,584
py
Python
cinder/tests/api/contrib/test_volume_image_metadata.py
CloudVPS/cinder
9097b9407b6ce16c7b5678682284a0ad0fcc652d
[ "Apache-2.0" ]
null
null
null
cinder/tests/api/contrib/test_volume_image_metadata.py
CloudVPS/cinder
9097b9407b6ce16c7b5678682284a0ad0fcc652d
[ "Apache-2.0" ]
null
null
null
cinder/tests/api/contrib/test_volume_image_metadata.py
CloudVPS/cinder
9097b9407b6ce16c7b5678682284a0ad0fcc652d
[ "Apache-2.0" ]
null
null
null
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0...
32.978417
77
0.681065
import datetime import json import uuid from xml.dom import minidom import webob from cinder.api import common from cinder.api.openstack.wsgi import MetadataXMLDeserializer from cinder.api.openstack.wsgi import XMLDeserializer from cinder import db from cinder import test from cinder.tests.api import ...
true
true