hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1746246f4d9d3b9861ee94c29e33ea27526d921c | 23 | py | Python | dynamic_preferences/__init__.py | mirk8xr/django-dynamic-preferences | 456df7a1d0d36e8cf3d613438e9cd76a241acc1e | [
"BSD-3-Clause"
] | null | null | null | dynamic_preferences/__init__.py | mirk8xr/django-dynamic-preferences | 456df7a1d0d36e8cf3d613438e9cd76a241acc1e | [
"BSD-3-Clause"
] | null | null | null | dynamic_preferences/__init__.py | mirk8xr/django-dynamic-preferences | 456df7a1d0d36e8cf3d613438e9cd76a241acc1e | [
"BSD-3-Clause"
] | 2 | 2017-04-10T09:34:18.000Z | 2021-02-25T05:35:40.000Z | __version__ = "0.7.15"
| 11.5 | 22 | 0.652174 | __version__ = "0.7.15"
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
62667c3d7687034bbce3f7e93685dc9d61db1e90 | 123 | py | Python | halotools/sim_manager/setup_package.py | pllim/halotools | 6499cff09e7e0f169e4f425ee265403f6be816e8 | [
"BSD-3-Clause"
] | 83 | 2015-01-15T14:54:16.000Z | 2021-12-09T11:28:02.000Z | halotools/sim_manager/setup_package.py | pllim/halotools | 6499cff09e7e0f169e4f425ee265403f6be816e8 | [
"BSD-3-Clause"
] | 579 | 2015-01-14T15:57:37.000Z | 2022-01-13T18:58:44.000Z | halotools/sim_manager/setup_package.py | pllim/halotools | 6499cff09e7e0f169e4f425ee265403f6be816e8 | [
"BSD-3-Clause"
] | 70 | 2015-01-14T15:15:58.000Z | 2021-12-22T18:18:31.000Z | """
"""
| 15.375 | 75 | 0.634146 | """
"""
def get_package_data():
return {
'halotools.sim_manager.tests': ['data/dummy_halocat_0.07812.list']}
| 0 | 0 | 0 | 0 | 0 | 91 | 0 | 0 | 23 |
59833554f2ba906974c362f5903e733e23c4744a | 876 | py | Python | algorithms/math/recursive_greatest_common_divisor.py | yashaswiadyalu/python | f12050990c064f20d27947084edd3ce57863efb6 | [
"MIT"
] | 204 | 2018-09-19T15:34:56.000Z | 2022-03-16T20:45:55.000Z | algorithms/math/recursive_greatest_common_divisor.py | yashaswiadyalu/python | f12050990c064f20d27947084edd3ce57863efb6 | [
"MIT"
] | 44 | 2018-10-02T03:02:29.000Z | 2021-10-06T15:18:08.000Z | algorithms/math/recursive_greatest_common_divisor.py | yashaswiadyalu/python | f12050990c064f20d27947084edd3ce57863efb6 | [
"MIT"
] | 177 | 2018-10-02T02:47:08.000Z | 2022-03-17T03:51:36.000Z | """
In mathematics, the greatest common divisor (gcd) of two or more integers,
which are not all zero, is the largest positive integer that divides each of the integers.
For example, the gcd of 8 and 12 is 4.
https://en.wikipedia.org/wiki/Greatest_common_divisor
Due to limited recursion depth this algorithm is not ... | 32.444444 | 100 | 0.636986 | """
In mathematics, the greatest common divisor (gcd) of two or more integers,
which are not all zero, is the largest positive integer that divides each of the integers.
For example, the gcd of 8 and 12 is 4.
» https://en.wikipedia.org/wiki/Greatest_common_divisor
Due to limited recursion depth this algorithm is not... | 2 | 0 | 0 | 0 | 0 | 393 | 0 | 0 | 23 |
53f3f04082698e9f1805080ec268f4a4de9614ee | 3,727 | py | Python | zhym/TestImg_hande_only_table1.py | yanmeizhao/MyMmdetection | ae369f88b1faa87b32688c7ca770ec67f0a5c8d1 | [
"Apache-2.0"
] | 1 | 2019-07-30T01:31:30.000Z | 2019-07-30T01:31:30.000Z | zhym/TestImg_hande_only_table1.py | yanmeizhao/MyMmdetection | ae369f88b1faa87b32688c7ca770ec67f0a5c8d1 | [
"Apache-2.0"
] | null | null | null | zhym/TestImg_hande_only_table1.py | yanmeizhao/MyMmdetection | ae369f88b1faa87b32688c7ca770ec67f0a5c8d1 | [
"Apache-2.0"
] | null | null | null | import os
from mmdet.apis import init_detector, inference_detector
config_file = 'configs_zhym/faster_rcnn_r50_fpn_1x_voc_handeonlytable.py'
checkpoint_file = 'work_dirs/faster_rcnn_r50_fpn_1x_handeonlytable/epoch_10.pth'
#config_file = 'configs_zhym/cascade_mask_rcnn_r101_fpn_1x_four_points.py'
#checkpoint_file = 'w... | 39.231579 | 204 | 0.696002 | import os
import cv2
import mmcv
import numpy as np
from mmcv.image import imread, imwrite
from mmcv import color_val
from mmdet.apis import init_detector, inference_detector
config_file = 'configs_zhym/faster_rcnn_r50_fpn_1x_voc_handeonlytable.py'
checkpoint_file = 'work_dirs/faster_rcnn_r50_fpn_1x_handeonlytable/epo... | 0 | 0 | 0 | 0 | 0 | 2,240 | 0 | -2 | 156 |
518f42be8ddf60dfeeab9843302688710e9fd4a0 | 948 | py | Python | done/18-4-python-oo-practice/serial.py | demohack/yute | 2fb136118733394e3595bf707cb32f1b7b2aede0 | [
"MIT"
] | null | null | null | done/18-4-python-oo-practice/serial.py | demohack/yute | 2fb136118733394e3595bf707cb32f1b7b2aede0 | [
"MIT"
] | 17 | 2021-03-24T14:59:50.000Z | 2022-03-05T23:52:31.000Z | done/18-4-python-oo-practice/serial.py | demohack/yute | 2fb136118733394e3595bf707cb32f1b7b2aede0 | [
"MIT"
] | null | null | null | """Python serial number generator."""
s = SerialGenerator(4)
s.generate()
s.generate()
| 20.170213 | 76 | 0.57384 | """Python serial number generator."""
class SerialGenerator:
"""Machine to create unique incrementing serial numbers.
>>> serial = SerialGenerator(start=100)
>>> serial.generate()
100
>>> serial.generate()
101
>>> serial.generate()
102
>>> serial.reset()
>>> serial.gen... | 3 | 0 | 0 | 836 | 0 | 0 | 0 | 0 | 23 |
0ad29b03ae8b324bb53dd5a8e9ccb0f6355cebd6 | 107,999 | py | Python | pst.py | btolab/PANhunt | 3fca018d1c6e36d374c18d7345c4a71059c73d3a | [
"BSD-3-Clause"
] | null | null | null | pst.py | btolab/PANhunt | 3fca018d1c6e36d374c18d7345c4a71059c73d3a | [
"BSD-3-Clause"
] | null | null | null | pst.py | btolab/PANhunt | 3fca018d1c6e36d374c18d7345c4a71059c73d3a | [
"BSD-3-Clause"
] | null | null | null | #! /usr/bin/env python
#
# Copyright (c) 2014, Dionach Ltd. All rights reserved. See LICENSE file.
#
# By BB
# based on MS-PST Microsoft specification for PST file format [MS-PST].pdf v2.1
#
import struct, datetime, math, os, sys, unicodedata, re, argparse, itertools, string
import progressbar
error_log_list = []
... | 48.08504 | 263 | 0.612182 | #! /usr/bin/env python
#
# Copyright (c) 2014, Dionach Ltd. All rights reserved. See LICENSE file.
#
# By BB
# based on MS-PST Microsoft specification for PST file format [MS-PST].pdf v2.1
#
import struct, datetime, math, os, sys, unicodedata, re, argparse, itertools, string
import progressbar
class PSTException(Ex... | 0 | 2,260 | 0 | 94,014 | 0 | 2,218 | 0 | 0 | 1,276 |
97670336a25763b3b30ba76cb087cbb3a93e0734 | 1,926 | py | Python | masd/algorithms/ungherese.py | ale-cci/Appunti | 9aa76eb46b7a984776f50260e598c9de1fa6317a | [
"MIT"
] | null | null | null | masd/algorithms/ungherese.py | ale-cci/Appunti | 9aa76eb46b7a984776f50260e598c9de1fa6317a | [
"MIT"
] | null | null | null | masd/algorithms/ungherese.py | ale-cci/Appunti | 9aa76eb46b7a984776f50260e598c9de1fa6317a | [
"MIT"
] | null | null | null | '''
d_ij = matrice dei costi
per ogni colonna trovo il minimo della colonna
a ogni elemento della colonna sottraggo il minimo (d0)
si ottiene una nuova matrice con pesi >= 0
---
stessa operazione con le righe (d1)
---
ottengo matrice di coefficienti d2
assegnamento rappresentato da matrice X
dove x_ij = 1 se i ... | 26.027027 | 102 | 0.7108 | '''
d_ij = matrice dei costi
per ogni colonna trovo il minimo della colonna
a ogni elemento della colonna sottraggo il minimo (d0)
si ottiene una nuova matrice con pesi >= 0
---
stessa operazione con le righe (d1)
---
ottengo matrice di coefficienti d2
assegnamento rappresentato da matrice X
dove x_ij = 1 se i ... | 10 | 0 | 0 | 0 | 0 | 5 | 0 | 0 | 22 |
d1a9bd1097cbb623ba8b10a3de4121e881e15bcd | 1,357 | py | Python | code/alert_properties.py | rmorgan10/AlertMonitoring | 40965ea36fb001ac7d0fc0248478768cd9a89bec | [
"BSD-3-Clause"
] | 1 | 2020-10-18T18:08:48.000Z | 2020-10-18T18:08:48.000Z | code/alert_properties.py | rmorgan10/AlertMonitoring | 40965ea36fb001ac7d0fc0248478768cd9a89bec | [
"BSD-3-Clause"
] | 4 | 2020-10-19T15:51:27.000Z | 2021-01-22T22:01:26.000Z | code/alert_properties.py | rmorgan10/AlertMonitoring | 40965ea36fb001ac7d0fc0248478768cd9a89bec | [
"BSD-3-Clause"
] | null | null | null | # A class to collect alert properties
| 30.840909 | 83 | 0.557848 | # A class to collect alert properties
import glob
import os
import pandas as pd
class Alert:
def __init__(self, row):
self.ra = float(row['RA [deg]'])
self.dec = float(row['Dec [deg]'])
self.err90 = float(row['Error90 [arcmin]'])
self.err50 = float(row['Error50 [arcmin]']... | 0 | 0 | 0 | 1,099 | 0 | 119 | 0 | -24 | 122 |
04edfc128cc7fef52c0869ec8e34b5915ce793c0 | 1,180 | py | Python | examples/M4_competition/download_data_M4.py | LeoTafti/darts | 210605fafb730de564e3d723ab3919ed94da42b9 | [
"Apache-2.0"
] | 3,756 | 2020-06-22T13:33:41.000Z | 2022-03-31T23:28:40.000Z | examples/M4_competition/download_data_M4.py | LeoTafti/darts | 210605fafb730de564e3d723ab3919ed94da42b9 | [
"Apache-2.0"
] | 578 | 2020-06-17T17:04:14.000Z | 2022-03-31T11:42:37.000Z | examples/M4_competition/download_data_M4.py | LeoTafti/darts | 210605fafb730de564e3d723ab3919ed94da42b9 | [
"Apache-2.0"
] | 384 | 2020-06-22T13:33:54.000Z | 2022-03-31T22:55:35.000Z | """Downloading data from the M4 competition
"""
if __name__ == "__main__":
data_frequencies = ['Yearly', 'Quarterly', 'Monthly', 'Weekly', 'Daily', 'Hourly']
datapath = "./dataset/"
url = "https://github.com/Mcompetitions/M4-methods/raw/master/Dataset/{}.csv"
download(datapath, url, 'M4-info')
... | 27.44186 | 90 | 0.602542 | """Downloading data from the M4 competition
"""
import os
import requests
def download(datapath, url, name, split=None):
os.makedirs(datapath, exist_ok=True)
if split is not None:
namesplit = split + "/" + name
else:
namesplit = name
url = url.format(namesplit)
file_path = os... | 0 | 0 | 0 | 0 | 0 | 646 | 0 | -18 | 68 |
b7a0960b05d13c74be641bedd1ea16d745df8dc9 | 1,738 | py | Python | GoldenGrinAnonymous.py | ohmyitsdan/GoldenGrinAnonymous | dc7f65af12e49e3de4869d60ee9221d109ae1bc7 | [
"MIT"
] | null | null | null | GoldenGrinAnonymous.py | ohmyitsdan/GoldenGrinAnonymous | dc7f65af12e49e3de4869d60ee9221d109ae1bc7 | [
"MIT"
] | null | null | null | GoldenGrinAnonymous.py | ohmyitsdan/GoldenGrinAnonymous | dc7f65af12e49e3de4869d60ee9221d109ae1bc7 | [
"MIT"
] | null | null | null | import math
import keyboard
# Betting Breakdown
initFee = 1500000
prefCard = 500000
infamous = 3000000
safe1 = 1000000
safe2 = 3300000
safe3 = 6500000
target = 1000000000
ct = 1
print(f'\nWelcome to your grind-less \'Golden Grin Anonymous\' Achievement!\n')
currentSpend = int(input('What is your current spend amoun... | 25.940299 | 94 | 0.629459 | import time
import math
import keyboard
# Betting Breakdown
initFee = 1500000
prefCard = 500000
infamous = 3000000
safe1 = 1000000
safe2 = 3300000
safe3 = 6500000
target = 1000000000
ct = 1
print(f'\nWelcome to your grind-less \'Golden Grin Anonymous\' Achievement!\n')
currentSpend = int(input('What is your current... | 0 | 0 | 0 | 0 | 0 | 408 | 0 | -10 | 45 |
f8570fcb4bce71708acbc200208e26e570367cbe | 375 | py | Python | statify/renderers.py | aufdenpunkt/django-statify | c99b527683d326ecd70dea714cd1522fbc5608c4 | [
"BSD-3-Clause"
] | null | null | null | statify/renderers.py | aufdenpunkt/django-statify | c99b527683d326ecd70dea714cd1522fbc5608c4 | [
"BSD-3-Clause"
] | null | null | null | statify/renderers.py | aufdenpunkt/django-statify | c99b527683d326ecd70dea714cd1522fbc5608c4 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# 3rd party imports
# Project imports
| 20.833333 | 58 | 0.669333 | # -*- coding: utf-8 -*-
#
# 3rd party imports
from django_medusa.renderers import DiskStaticSiteRenderer
# Project imports
from statify.models import URL
class UrlsRenderer(DiskStaticSiteRenderer):
def get_paths(self):
paths = []
urls = URL.objects.filter(is_valid=True)
for url in urls:
... | 0 | 0 | 0 | 195 | 0 | 0 | 0 | 46 | 67 |
7bddec9da1fac479748f377b304673d3cb459745 | 949 | py | Python | condense.py | innovate-invent/python-musings | 0b58a3aea54adfcb55ef3dbd4652828efcb25c8e | [
"MIT"
] | null | null | null | condense.py | innovate-invent/python-musings | 0b58a3aea54adfcb55ef3dbd4652828efcb25c8e | [
"MIT"
] | null | null | null | condense.py | innovate-invent/python-musings | 0b58a3aea54adfcb55ef3dbd4652828efcb25c8e | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
pass #TODO | 28.757576 | 77 | 0.600632 | import pysam
from CigarIterator import CigarIterator, appendOrInc
def condense(record: pysam.AlignedSegment):
if record.reference_length == 0:
# No work needs to be done
return
seq = ""
qual = []
ops = []
itr = CigarIterator(record)
clipped = itr.skipClipped()
if clipped:
... | 0 | 0 | 0 | 0 | 0 | 818 | 0 | 22 | 67 |
32aa4df811b3d6088038a5059a9de369672b42c4 | 6,894 | py | Python | waveglow/models/waveglow_teacher.py | yandex-research/distill-nf | b804289b88e9bf1736f29b7e8b0b25614b08a924 | [
"Apache-2.0"
] | 7 | 2021-06-23T08:21:50.000Z | 2021-11-18T17:32:58.000Z | waveglow/models/waveglow_teacher.py | yandex-research/distill-nf | b804289b88e9bf1736f29b7e8b0b25614b08a924 | [
"Apache-2.0"
] | 1 | 2021-12-09T05:19:40.000Z | 2021-12-10T06:23:25.000Z | waveglow/models/waveglow_teacher.py | yandex-research/distill-nf | b804289b88e9bf1736f29b7e8b0b25614b08a924 | [
"Apache-2.0"
] | null | null | null | """
WaveGlow teacher wrapper
"""
| 43.0875 | 145 | 0.589788 | """
WaveGlow teacher wrapper
"""
from functools import lru_cache
import numpy as np
import torch
from models.waveglow import WaveGlow
class WaveGlowTeacher(WaveGlow):
""" A WaveGlow model optimized for use as a teacher in distillation """
@classmethod
def load(cls, path, fp16=True, train=False, devi... | 0 | 1,145 | 0 | 5,563 | 0 | 0 | 0 | 13 | 136 |
43278a4f75adc3ba6f1e211712961e9f3b1fe18e | 4,535 | py | Python | tests/framework/AnalyticModels/optimizing/plotWalk3d.py | rinelson456/raven | 1114246136a2f72969e75b5e99a11b35500d4eef | [
"Apache-2.0"
] | 159 | 2017-03-24T21:07:06.000Z | 2022-03-20T13:44:40.000Z | tests/framework/AnalyticModels/optimizing/plotWalk3d.py | rinelson456/raven | 1114246136a2f72969e75b5e99a11b35500d4eef | [
"Apache-2.0"
] | 1,667 | 2017-03-27T14:41:22.000Z | 2022-03-31T19:50:06.000Z | tests/framework/AnalyticModels/optimizing/plotWalk3d.py | rinelson456/raven | 1114246136a2f72969e75b5e99a11b35500d4eef | [
"Apache-2.0"
] | 95 | 2017-03-24T21:05:03.000Z | 2022-03-08T17:30:22.000Z | # Copyright 2017 Battelle Energy Alliance, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | 34.356061 | 154 | 0.655347 | # Copyright 2017 Battelle Energy Alliance, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 26 | 22 |
de273ff0b25434b0dfa52b5e87d8dfccaab15b41 | 3,009 | py | Python | coldwallet/crypto.py | Anthchirp/python-coldwallet | 3d36b9322a4a596d06a78793d68aca17f6d13077 | [
"BSD-3-Clause"
] | null | null | null | coldwallet/crypto.py | Anthchirp/python-coldwallet | 3d36b9322a4a596d06a78793d68aca17f6d13077 | [
"BSD-3-Clause"
] | null | null | null | coldwallet/crypto.py | Anthchirp/python-coldwallet | 3d36b9322a4a596d06a78793d68aca17f6d13077 | [
"BSD-3-Clause"
] | 1 | 2020-08-14T02:30:35.000Z | 2020-08-14T02:30:35.000Z | # Coldwallet encryption related functions. This is the heart of coldwallet.
from __future__ import absolute_import, division, print_function
import base64
import math
import os
import coldwallet.aes
import pylibscrypt
def disable_randomness():
'''Make the random number generator produce deterministic (ie. non-ran... | 38.576923 | 110 | 0.740445 | # Coldwallet encryption related functions. This is the heart of coldwallet.
from __future__ import absolute_import, division, print_function
import base64
import math
import os
import coldwallet.aes
import pylibscrypt
def disable_randomness():
'''Make the random number generator produce deterministic (ie. non-ran... | 0 | 0 | 0 | 0 | 0 | 204 | 0 | 0 | 24 |
0df61cd55b30e0b3fa9f65343e0cc0106a7172fa | 4,958 | py | Python | src/ramstk/models/programdb/action/record.py | TahaEntezari/ramstk | f82e5b31ef5c4e33cc02252263247b99a9abe129 | [
"BSD-3-Clause"
] | 26 | 2019-05-15T02:03:47.000Z | 2022-02-21T07:28:11.000Z | src/ramstk/models/programdb/action/record.py | TahaEntezari/ramstk | f82e5b31ef5c4e33cc02252263247b99a9abe129 | [
"BSD-3-Clause"
] | 815 | 2019-05-10T12:31:52.000Z | 2022-03-31T12:56:26.000Z | src/ramstk/models/programdb/action/record.py | TahaEntezari/ramstk | f82e5b31ef5c4e33cc02252263247b99a9abe129 | [
"BSD-3-Clause"
] | 9 | 2019-04-20T23:06:29.000Z | 2022-01-24T21:21:04.000Z | # pylint: disable=duplicate-code
# -*- coding: utf-8 -*-
#
# ramstk.models.action.record.py is part of The RAMSTK Project
#
# All rights reserved.
# Copyright since 2007 Doyle "weibullguy" Rowland doyle.rowland <AT> reliaqual <DOT> com
"""RAMSTKAction Table Module."""
# Standard Library Imports
# Third Party Im... | 35.414286 | 88 | 0.64885 | # pylint: disable=duplicate-code
# -*- coding: utf-8 -*-
#
# ramstk.models.action.record.py is part of The RAMSTK Project
#
# All rights reserved.
# Copyright since 2007 Doyle "weibullguy" Rowland doyle.rowland <AT> reliaqual <DOT> com
"""RAMSTKAction Table Module."""
# Standard Library Imports
from datetime imp... | 0 | 0 | 0 | 4,353 | 0 | 0 | 0 | 119 | 133 |
f5100452d343a876e37e519f48919a3f203b63e3 | 13,293 | py | Python | src/api/dcps/python/test/test_type_checkers.py | brezillon/opensplice | 725ae9d949c83fce1746bd7d8a154b9d0a81fe3e | [
"Apache-2.0"
] | 133 | 2017-11-09T02:10:00.000Z | 2022-03-29T09:45:10.000Z | src/api/dcps/python/test/test_type_checkers.py | brezillon/opensplice | 725ae9d949c83fce1746bd7d8a154b9d0a81fe3e | [
"Apache-2.0"
] | 131 | 2017-11-07T14:48:43.000Z | 2022-03-13T15:30:47.000Z | src/api/dcps/python/test/test_type_checkers.py | brezillon/opensplice | 725ae9d949c83fce1746bd7d8a154b9d0a81fe3e | [
"Apache-2.0"
] | 94 | 2017-11-09T02:26:19.000Z | 2022-02-24T06:38:25.000Z | #
# Vortex OpenSplice
#
# This software and documentation are Copyright 2006 to TO_YEAR ADLINK
# Technology Limited, its affiliated companies and licensors. All rights
# reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in ... | 51.523256 | 109 | 0.698262 | #
# Vortex OpenSplice
#
# This software and documentation are Copyright 2006 to TO_YEAR ADLINK
# Technology Limited, its affiliated companies and licensors. All rights
# reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in ... | 0 | 0 | 0 | 12,280 | 0 | 0 | 0 | -17 | 90 |
a45c6650efeef92d6157c4a9a8948139dbd687f7 | 1,730 | py | Python | teamspirit/users/models.py | etienne86/oc_p13_team_spirit | fd3d45618d349ecd0a03e63c4a7e9c1044eeffaa | [
"MIT"
] | null | null | null | teamspirit/users/models.py | etienne86/oc_p13_team_spirit | fd3d45618d349ecd0a03e63c4a7e9c1044eeffaa | [
"MIT"
] | null | null | null | teamspirit/users/models.py | etienne86/oc_p13_team_spirit | fd3d45618d349ecd0a03e63c4a7e9c1044eeffaa | [
"MIT"
] | null | null | null | """Contain the models related to the app ``users``."""
| 29.322034 | 73 | 0.669942 | """Contain the models related to the app ``users``."""
from django.contrib.auth.base_user import AbstractBaseUser
from django.contrib.auth.models import PermissionsMixin
from django.db import models
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
from teamspirit.users.managers ... | 0 | 0 | 0 | 1,367 | 0 | 0 | 0 | 150 | 157 |
7180c2cb782283af9965665c625700a77fe90027 | 2,094 | py | Python | scripts/ingestors/rwis/process_idot_awos.py | trentford/iem | 7264d24f2d79a3cd69251a09758e6531233a732f | [
"MIT"
] | 1 | 2019-10-07T17:01:24.000Z | 2019-10-07T17:01:24.000Z | scripts/ingestors/rwis/process_idot_awos.py | trentford/iem | 7264d24f2d79a3cd69251a09758e6531233a732f | [
"MIT"
] | null | null | null | scripts/ingestors/rwis/process_idot_awos.py | trentford/iem | 7264d24f2d79a3cd69251a09758e6531233a732f | [
"MIT"
] | null | null | null | """Process AWOS METAR file"""
from __future__ import print_function
import re
import sys
import os
import datetime
import ftplib
import subprocess
import tempfile
from io import StringIO
from pyiem import util
INCOMING = "/mesonet/data/incoming"
def fetch_files():
"""Fetch files """
props = util.get_propert... | 28.684932 | 77 | 0.579274 | """Process AWOS METAR file"""
from __future__ import print_function
import re
import sys
import os
import datetime
import ftplib
import subprocess
import tempfile
from io import StringIO
from pyiem import util
INCOMING = "/mesonet/data/incoming"
def fetch_files():
"""Fetch files """
props = util.get_propert... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
be915c81082067a81a8b1706489e596e884a6466 | 101 | py | Python | abc/abc033/abc033c.py | c-yan/atcoder | 940e49d576e6a2d734288fadaf368e486480a948 | [
"MIT"
] | 1 | 2019-08-21T00:49:34.000Z | 2019-08-21T00:49:34.000Z | abc/abc033/abc033c.py | c-yan/atcoder | 940e49d576e6a2d734288fadaf368e486480a948 | [
"MIT"
] | null | null | null | abc/abc033/abc033c.py | c-yan/atcoder | 940e49d576e6a2d734288fadaf368e486480a948 | [
"MIT"
] | null | null | null | S = input()
result = 0
for s in S.split('+'):
if s.count('0') == 0:
result += 1
print(result)
| 12.625 | 23 | 0.524752 | S = input()
result = 0
for s in S.split('+'):
if s.count('0') == 0:
result += 1
print(result)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
eac53b2d01f44a07353fd2b12387db5da97ec33d | 246 | py | Python | config.py | sweetcolor/internet_market_scraper | f7eb8c9ade2c0a956ba5d5b7e6173010c85afed6 | [
"MIT"
] | null | null | null | config.py | sweetcolor/internet_market_scraper | f7eb8c9ade2c0a956ba5d5b7e6173010c85afed6 | [
"MIT"
] | null | null | null | config.py | sweetcolor/internet_market_scraper | f7eb8c9ade2c0a956ba5d5b7e6173010c85afed6 | [
"MIT"
] | null | null | null | import os
CACHE_DIRECTORY = os.path.join(os.path.expanduser('~'), os.path.join('temp', 'cache'))
RESULT_DIRECTORY = os.path.join(os.path.expanduser('~'), os.path.join('temp', 'result'))
# CACHE_DIRECTORY = 'cache'
# RESULT_DIRECTORY = 'result'
| 30.75 | 88 | 0.699187 | import os
CACHE_DIRECTORY = os.path.join(os.path.expanduser('~'), os.path.join('temp', 'cache'))
RESULT_DIRECTORY = os.path.join(os.path.expanduser('~'), os.path.join('temp', 'result'))
# CACHE_DIRECTORY = 'cache'
# RESULT_DIRECTORY = 'result'
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ed10715519696688a209a2c646cfeefc39085f2d | 4,443 | py | Python | SimpleIncrementor.py | Gru80/SimpleIncrementor | e470800d55d27485394c612e654b7624310b84d9 | [
"MIT"
] | null | null | null | SimpleIncrementor.py | Gru80/SimpleIncrementor | e470800d55d27485394c612e654b7624310b84d9 | [
"MIT"
] | null | null | null | SimpleIncrementor.py | Gru80/SimpleIncrementor | e470800d55d27485394c612e654b7624310b84d9 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: UTF-8 -*-
'''
This is a plugin for the Sublime Text Editor
https://www.sublimetext.com/
Replace all occurences of the currently selected text in the document with an incrementing number.
Some options are provided:
* Start with an offset
* Use fixed number of digits (fill up with lead... | 29.818792 | 98 | 0.610623 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
'''
This is a plugin for the Sublime Text Editor
https://www.sublimetext.com/
Replace all occurences of the currently selected text in the document with an incrementing number.
Some options are provided:
* Start with an offset
* Use fixed number of digits (fill up with lead... | 0 | 0 | 0 | 3,502 | 0 | 42 | 0 | -3 | 229 |
73660730c4b825462ce529960c64f5330d37ce50 | 1,421 | py | Python | s3-lambda-textract-cdktf/helpers/layers.py | iobreaker/serverless-patterns | 58991f19f6566637c336471a37ba7def49e8a9ad | [
"MIT-0"
] | null | null | null | s3-lambda-textract-cdktf/helpers/layers.py | iobreaker/serverless-patterns | 58991f19f6566637c336471a37ba7def49e8a9ad | [
"MIT-0"
] | null | null | null | s3-lambda-textract-cdktf/helpers/layers.py | iobreaker/serverless-patterns | 58991f19f6566637c336471a37ba7def49e8a9ad | [
"MIT-0"
] | null | null | null | """
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: MIT-0
"""
import urllib3
import shutil
import zipfile
from .hash import getFileSha256Hash
import os
PILLOW_MODULE_DOWNLOAD_FILE_NAME = "pillow_layer_module.zip"
def downloadPillowLayerFile(directory: str, url: str, file_... | 30.234043 | 90 | 0.693878 | """
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: MIT-0
"""
import urllib3
import shutil
import zipfile
from .hash import getFileSha256Hash
import os
PILLOW_MODULE_DOWNLOAD_FILE_NAME = "pillow_layer_module.zip"
def downloadPillowLayerFile(directory: str, url: str, file_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7a18b8fb25edcb421a3fd9ecf0b06851c9c9dd7f | 966 | py | Python | tests/unit/apis/test_settings.py | linji0801/amazon-s3-find-and-forget | 9005fded8176faaee1e12cc42dc57f7d7b861a0d | [
"Apache-2.0"
] | null | null | null | tests/unit/apis/test_settings.py | linji0801/amazon-s3-find-and-forget | 9005fded8176faaee1e12cc42dc57f7d7b861a0d | [
"Apache-2.0"
] | null | null | null | tests/unit/apis/test_settings.py | linji0801/amazon-s3-find-and-forget | 9005fded8176faaee1e12cc42dc57f7d7b861a0d | [
"Apache-2.0"
] | null | null | null |
import pytest
pytestmark = [pytest.mark.unit, pytest.mark.api, pytest.mark.settings]
| 28.411765 | 70 | 0.668737 | import json
from types import SimpleNamespace
import pytest
from mock import patch
from backend.lambdas.settings import handlers
pytestmark = [pytest.mark.unit, pytest.mark.api, pytest.mark.settings]
@patch("backend.lambdas.settings.handlers.get_config")
def test_it_process_queue(mock_config):
mock_config.retu... | 0 | 739 | 0 | 0 | 0 | 0 | 0 | 27 | 112 |
8dc2e570aad8b8b5478e75861962a8499c8352ea | 4,036 | py | Python | venv/Lib/site-packages/keystoneauth1/identity/v3/application_credential.py | prasoon-uta/IBM-coud-storage | 82a6876316715efbd0b492d0d467dde0ab26a56b | [
"Apache-2.0"
] | 48 | 2015-05-02T16:19:10.000Z | 2021-12-17T19:01:17.000Z | venv/Lib/site-packages/keystoneauth1/identity/v3/application_credential.py | prasoon-uta/IBM-coud-storage | 82a6876316715efbd0b492d0d467dde0ab26a56b | [
"Apache-2.0"
] | 1 | 2019-12-04T13:48:10.000Z | 2019-12-04T13:48:10.000Z | venv/Lib/site-packages/keystoneauth1/identity/v3/application_credential.py | prasoon-uta/IBM-coud-storage | 82a6876316715efbd0b492d0d467dde0ab26a56b | [
"Apache-2.0"
] | 46 | 2015-05-23T14:04:35.000Z | 2022-02-17T12:33:50.000Z | # Copyright 2018 SUSE Linux GmbH
#
# 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... | 44.844444 | 79 | 0.644698 | # Copyright 2018 SUSE Linux GmbH
#
# 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... | 0 | 0 | 0 | 3,295 | 0 | 0 | 0 | 21 | 69 |
14b28a98370a160b7a6bac3ee8dfd1c783eb75ed | 8,559 | py | Python | examples/textbook/explode_evolved_star.py | joshuawall/amuse | c2034074ee76c08057c4faa96c32044ab40952e9 | [
"Apache-2.0"
] | 1 | 2019-12-28T22:47:51.000Z | 2019-12-28T22:47:51.000Z | examples/textbook/explode_evolved_star.py | joshuawall/amuse | c2034074ee76c08057c4faa96c32044ab40952e9 | [
"Apache-2.0"
] | null | null | null | examples/textbook/explode_evolved_star.py | joshuawall/amuse | c2034074ee76c08057c4faa96c32044ab40952e9 | [
"Apache-2.0"
] | 2 | 2021-11-19T04:41:37.000Z | 2021-11-20T02:11:17.000Z | import numpy
import os.path
from amuse.test.amusetest import get_path_to_results
try:
from matplotlib import pyplot
HAS_MATPLOTLIB = True
from amuse.plot import plot, semilogy, xlabel, ylabel, loglog
except ImportError:
HAS_MATPLOTLIB = False
from amuse.units import units
from amuse.units import generi... | 39.995327 | 80 | 0.628578 | import numpy
import os.path
from amuse.test.amusetest import get_path_to_results
try:
from matplotlib import pyplot
HAS_MATPLOTLIB = True
from amuse.plot import plot, semilogy, xlabel, ylabel, loglog
except ImportError:
HAS_MATPLOTLIB = False
from amuse.units import units
from amuse.units import generi... | 0 | 0 | 0 | 0 | 0 | 4,240 | 0 | 14 | 114 |
135557c6b0473025cabcad2d123a29466285591d | 1,317 | py | Python | client/verta/verta/_cli/__init__.py | Vafilor/modeldb | 57e617fa64368e7c5c8ae186955e3e28b39fd5a9 | [
"Apache-2.0"
] | null | null | null | client/verta/verta/_cli/__init__.py | Vafilor/modeldb | 57e617fa64368e7c5c8ae186955e3e28b39fd5a9 | [
"Apache-2.0"
] | null | null | null | client/verta/verta/_cli/__init__.py | Vafilor/modeldb | 57e617fa64368e7c5c8ae186955e3e28b39fd5a9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from . import remote
from . import branch
from . import commit
from . import blob
cli.add_command(init)
cli.add_command(remote.remote)
cli.add_command(branch.branch)
cli.add_command(branch.checkout)
cli.add_command(branch.log)
cli.add_command(commit.add)
cli.add_command(commit.rm)
cli.add_c... | 24.849057 | 95 | 0.736522 | # -*- coding: utf-8 -*-
import os
import click
from .._internal_utils import _config_utils
from . import remote
from . import branch
from . import commit
from . import blob
@click.group()
def cli():
"""ModelDB versioning CLI for snapshotting and tracking model ingredients."""
pass
@click.command()
def i... | 0 | 699 | 0 | 0 | 0 | 0 | 0 | 1 | 115 |
61dd8412dbdb1f81e6f9fd7fcaad21f34bed6416 | 5,382 | py | Python | tests/test_scientific/test_brownian.py | jfaccioni/clovars | 64e24286a2dc185490384aeb08027d88eb9462c4 | [
"MIT"
] | null | null | null | tests/test_scientific/test_brownian.py | jfaccioni/clovars | 64e24286a2dc185490384aeb08027d88eb9462c4 | [
"MIT"
] | null | null | null | tests/test_scientific/test_brownian.py | jfaccioni/clovars | 64e24286a2dc185490384aeb08027d88eb9462c4 | [
"MIT"
] | null | null | null | import unittest
if __name__ == '__main__':
unittest.main()
| 48.053571 | 118 | 0.607952 | import random
import unittest
from clovars.scientific import brownian_motion, bounded_brownian_motion, reflect_around_interval, triangular_wave
class TestBrownian(unittest.TestCase):
"""Class representing unit-tests for clovars.scientific.brownian_motion module."""
def test_bounded_brownian_motion_returns_va... | 0 | 0 | 0 | 5,164 | 0 | 0 | 0 | 84 | 68 |
1ba5ae030771231bf80a5f38f201d1e26faa28a1 | 4,612 | py | Python | pyformlang/finite_automaton/nondeterministic_transition_function.py | YaccConstructor/pyformlang | df640e13524c5d835ddcdedf25d8246fc73d7b88 | [
"MIT"
] | null | null | null | pyformlang/finite_automaton/nondeterministic_transition_function.py | YaccConstructor/pyformlang | df640e13524c5d835ddcdedf25d8246fc73d7b88 | [
"MIT"
] | 1 | 2020-07-22T11:40:30.000Z | 2020-07-22T11:40:30.000Z | pyformlang/finite_automaton/nondeterministic_transition_function.py | YaccConstructor/pyformlang | df640e13524c5d835ddcdedf25d8246fc73d7b88 | [
"MIT"
] | null | null | null | """
A nondeterministic transition function
"""
| 30.143791 | 84 | 0.58196 | """
A nondeterministic transition function
"""
import copy
from typing import Set
from .state import State
from .symbol import Symbol
class NondeterministicTransitionFunction(object):
""" A nondeterministic transition function in a finite automaton.
The difference with a deterministic transition is that the... | 0 | 0 | 0 | 4,453 | 0 | 0 | 0 | -1 | 112 |
e9493de09e87b4f9f1b79fed10ada95277c07938 | 663 | py | Python | scripts/__V2/login.py | AutoCoinDCF/NEW_API | f4abc48fff907a0785372b941afcd67e62eec825 | [
"Apache-2.0"
] | null | null | null | scripts/__V2/login.py | AutoCoinDCF/NEW_API | f4abc48fff907a0785372b941afcd67e62eec825 | [
"Apache-2.0"
] | null | null | null | scripts/__V2/login.py | AutoCoinDCF/NEW_API | f4abc48fff907a0785372b941afcd67e62eec825 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*-coding:utf-8-*-
# net login
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
import codecs
driver = webdriver.PhantomJS()
#driver = webdriver.Firefox(executable_path='/usr/local/bin/geckodriver')
driver.get('https://gw.ict.ac.cn/srun_portal_pc.php?a... | 23.678571 | 73 | 0.766214 | #!/usr/bin/env python
# -*-coding:utf-8-*-
# net login
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
import codecs
import os
driver = webdriver.PhantomJS()
#driver = webdriver.Firefox(executable_path='/usr/local/bin/geckodriver')
driver.get('https://gw.ict.ac.cn/srun_porta... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -12 | 22 |
c854f1df1820a7eee9b465b150768785d9183c01 | 6,520 | py | Python | research/cv/PDarts/src/model.py | mindspore-ai/models | 9127b128e2961fd698977e918861dadfad00a44c | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/PDarts/src/model.py | mindspore-ai/models | 9127b128e2961fd698977e918861dadfad00a44c | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/PDarts/src/model.py | mindspore-ai/models | 9127b128e2961fd698977e918861dadfad00a44c | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2022 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
#
# less required by applicable law or agreed to i... | 35.824176 | 96 | 0.560276 | # Copyright 2022 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
#
# less required by applicable law or agreed to i... | 0 | 0 | 0 | 5,605 | 0 | 0 | 0 | 56 | 136 |
b4e81a402d50896e82c564f3d102fbcebb31b5ca | 196 | py | Python | Crafting_Quality_Code_UniToronto/week2_testing/lecture/dict.py | bounty030/Coursera | ff265343635a0109b6deab31f2a112d304d020cb | [
"MIT"
] | 1 | 2021-01-17T15:13:49.000Z | 2021-01-17T15:13:49.000Z | Crafting_Quality_Code_UniToronto/week2_testing/lecture/dict.py | bounty030/Coursera | ff265343635a0109b6deab31f2a112d304d020cb | [
"MIT"
] | null | null | null | Crafting_Quality_Code_UniToronto/week2_testing/lecture/dict.py | bounty030/Coursera | ff265343635a0109b6deab31f2a112d304d020cb | [
"MIT"
] | 1 | 2021-01-17T15:13:16.000Z | 2021-01-17T15:13:16.000Z |
if __name__ == '__main__':
expected1 = {'c': 2, 'b': 2, 'a': 1}
expected2 = {'a': 1, 'b': 2, 'c': 2}
a = change(expected1)
print(expected1 == a) | 15.076923 | 40 | 0.469388 |
def change(d):
d['a'] = 0
if __name__ == '__main__':
expected1 = {'c': 2, 'b': 2, 'a': 1}
expected2 = {'a': 1, 'b': 2, 'c': 2}
a = change(expected1)
print(expected1 == a) | 0 | 0 | 0 | 0 | 0 | 9 | 0 | 0 | 23 |
5f7ed9bbec03310b3305a59cb7263e14fbf57ac3 | 353,613 | py | Python | src/sage/combinat/finite_state_machine.py | drvinceknight/sage | 00199fb220aa173d8585b9e90654dafd3247d82d | [
"BSL-1.0"
] | 2 | 2015-08-11T05:05:47.000Z | 2019-05-15T17:27:25.000Z | src/sage/combinat/finite_state_machine.py | kaushik94/sage | 00199fb220aa173d8585b9e90654dafd3247d82d | [
"BSL-1.0"
] | null | null | null | src/sage/combinat/finite_state_machine.py | kaushik94/sage | 00199fb220aa173d8585b9e90654dafd3247d82d | [
"BSL-1.0"
] | 1 | 2020-07-24T12:04:03.000Z | 2020-07-24T12:04:03.000Z | # -*- coding: utf-8 -*-
r"""
Finite State Machines, Automata, Transducers
This module adds support for finite state machines, automata and
transducers. See classes :class:`Automaton` and :class:`Transducer`
(or the more general class :class:`FiniteStateMachine`) and the
:ref:`examples <finite_state_machine_examples>` ... | 35.965521 | 208 | 0.522803 | # -*- coding: utf-8 -*-
r"""
Finite State Machines, Automata, Transducers
This module adds support for finite state machines, automata and
transducers. See classes :class:`Automaton` and :class:`Transducer`
(or the more general class :class:`FiniteStateMachine`) and the
:ref:`examples <finite_state_machine_examples>` ... | 3 | 5,715 | 0 | 305,342 | 0 | 0 | 0 | 233 | 516 |
ae682c8b47e3967aa9600e8dd17c4ff5a6d2a51d | 3,202 | py | Python | lambda/email/email_lambda.py | defCoding/anilist-to-mal-sync | a56e546c9c8eb8c756d71942ec9fd2187a2a9cf5 | [
"MIT"
] | null | null | null | lambda/email/email_lambda.py | defCoding/anilist-to-mal-sync | a56e546c9c8eb8c756d71942ec9fd2187a2a9cf5 | [
"MIT"
] | null | null | null | lambda/email/email_lambda.py | defCoding/anilist-to-mal-sync | a56e546c9c8eb8c756d71942ec9fd2187a2a9cf5 | [
"MIT"
] | null | null | null | import json
import os
import boto3
import secrets
import time
def lambda_handler(event, context):
"""
Sends an email notification to user with MAL OAuth link.
Args:
event (dict): AWS triggering event
context (dict): AWS context
Returns:
(dict): JSON response to triggering even... | 31.70297 | 144 | 0.55965 | import json
import os
import boto3
import secrets
import time
def lambda_handler(event, context):
"""
Sends an email notification to user with MAL OAuth link.
Args:
event (dict): AWS triggering event
context (dict): AWS context
Returns:
(dict): JSON response to triggering even... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4dc2e9135de4ba5558a0707747e3bfb85be2b7bf | 1,396 | py | Python | plexlibrary/utils.py | aelfa/python-plexlibrary | 58a99606c502b56bcb57953411803f613e531bcc | [
"BSD-3-Clause"
] | 208 | 2017-10-01T20:21:52.000Z | 2022-03-25T12:48:24.000Z | plexlibrary/utils.py | aelfa/python-plexlibrary | 58a99606c502b56bcb57953411803f613e531bcc | [
"BSD-3-Clause"
] | 109 | 2017-10-02T07:04:59.000Z | 2021-11-28T10:08:51.000Z | plexlibrary/utils.py | aelfa/python-plexlibrary | 58a99606c502b56bcb57953411803f613e531bcc | [
"BSD-3-Clause"
] | 51 | 2018-02-24T18:16:20.000Z | 2021-11-26T21:44:12.000Z | # -*- coding: utf-8 -*-
| 23.661017 | 61 | 0.550143 | # -*- coding: utf-8 -*-
from datetime import datetime
import ruamel.yaml
class Colors(object):
RED = u'\033[1;31m'
BLUE = u'\033[1;34m'
CYAN = u'\033[1;36m'
GREEN = u'\033[0;32m'
RESET = u'\033[0;0m'
BOLD = u'\033[;1m'
REVERSE = u'\033[;7m'
class YAMLBase(object):
def __init__(self,... | 0 | 0 | 0 | 943 | 0 | 307 | 0 | 5 | 114 |
74e31db24980299137e2dba371ce4d3974a253e2 | 1,177 | py | Python | tutorials/pl_video_5_database/auth.py | P-ranjal/pushups-logger | 5df87fe3f3513fcb91abe15b49eed14974c6fe9b | [
"MIT"
] | 10 | 2020-07-21T09:32:56.000Z | 2021-07-15T10:10:52.000Z | tutorials/pl_video_5_database/auth.py | P-ranjal/pushups-logger | 5df87fe3f3513fcb91abe15b49eed14974c6fe9b | [
"MIT"
] | 1 | 2021-12-13T20:47:03.000Z | 2021-12-13T20:47:03.000Z | tutorials/pl_video_5_database/auth.py | P-ranjal/pushups-logger | 5df87fe3f3513fcb91abe15b49eed14974c6fe9b | [
"MIT"
] | 15 | 2021-09-03T18:52:25.000Z | 2022-03-23T07:12:23.000Z | from flask import Blueprint
auth = Blueprint('auth', __name__)
| 22.634615 | 103 | 0.686491 | from flask import Blueprint, render_template, url_for, request, redirect
from werkzeug.security import generate_password_hash
from .models import User
from . import db
auth = Blueprint('auth', __name__)
@auth.route('/signup')
def signup():
return render_template('signup.html')
@auth.route('/signup', methods=['... | 0 | 853 | 0 | 0 | 0 | 0 | 0 | 74 | 181 |
a12d5595bbf31fa577ed2ee632ecb89e19523728 | 2,961 | py | Python | interlib/set.py | D-Programming-Man/Pseudo | 13d39b31754a37d637ca4e39361b66b5a91c9d2c | [
"MIT"
] | null | null | null | interlib/set.py | D-Programming-Man/Pseudo | 13d39b31754a37d637ca4e39361b66b5a91c9d2c | [
"MIT"
] | 13 | 2020-10-21T22:49:36.000Z | 2020-12-07T22:08:03.000Z | interlib/set.py | D-Programming-Man/Pseudo | 13d39b31754a37d637ca4e39361b66b5a91c9d2c | [
"MIT"
] | null | null | null |
help_manual = " Syntax: \n" \
" Set <variable_name> [equal] to (<variable>/<number>/<string>/<list>/<table>) \n" \
" \n" \
" Examples: \n" \
" Set x to \"Hello World\" \n" \
" Set y equal to 1232 \n" \
" Set z to [1, 3 , 4, \"hm... | 32.184783 | 174 | 0.634583 | from interlib.utility import key_var_check
from interlib.utility import print_line
from interlib.utility import inter_data_type
from interlib.utility import list_dict_checker
help_manual = " Syntax: \n" \
" Set <variable_name> [equal] to (<variable>/<number>/<string>/<list>/<table>) \n" \
... | 0 | 0 | 0 | 0 | 0 | 1,687 | 0 | 87 | 111 |
35862c22704c47d50ca3de19ade81c7c79f57b64 | 963 | py | Python | py/libs/assetexchange_shared/client/basic.py | ddesmond/assetexchange | 0f8133b449b41595e22f27f3970bec7ebeee19c1 | [
"MIT"
] | null | null | null | py/libs/assetexchange_shared/client/basic.py | ddesmond/assetexchange | 0f8133b449b41595e22f27f3970bec7ebeee19c1 | [
"MIT"
] | null | null | null | py/libs/assetexchange_shared/client/basic.py | ddesmond/assetexchange | 0f8133b449b41595e22f27f3970bec7ebeee19c1 | [
"MIT"
] | null | null | null |
try:
from urllib.request import urlopen, Request
except ImportError:
| 23.487805 | 67 | 0.608515 | import json
try:
from urllib.request import urlopen, Request
except ImportError:
from urllib2 import urlopen, Request
def call_basic_func(port, service, function, input, timeout):
# prepare url
url = "http://127.0.0.1:" + str(port) + "/.assetexchange/basic"
# prepare timeout
if timeout == 0:... | 0 | 0 | 0 | 0 | 0 | 813 | 0 | 5 | 71 |
0d3f8f4387b5ae6ced5e41d7387fe84b5678da0e | 819 | py | Python | bikeheap.py | nicktimko/heapo | 9aef802e365304a85007463674c99e50c3e29634 | [
"PSF-2.0"
] | null | null | null | bikeheap.py | nicktimko/heapo | 9aef802e365304a85007463674c99e50c3e29634 | [
"PSF-2.0"
] | null | null | null | bikeheap.py | nicktimko/heapo | 9aef802e365304a85007463674c99e50c3e29634 | [
"PSF-2.0"
] | null | null | null | '''
>>> heap = BikeHeap([4, 2, 1, 3])
>>> heap.pop()
1
>>> heap.pop()
2
'''
if __name__ == '__main__':
import doctest
print(doctest.testmod())
| 18.2 | 66 | 0.59707 | '''
>>> heap = BikeHeap([4, 2, 1, 3])
>>> heap.pop()
1
>>> heap.pop()
2
'''
import heapq
class BikeHeap(object):
def __init__(self, heap):
self.heap = heap
heapq.heapify(self.heap)
def __repr__(self):
return '{}({})'.format(self.__class__.__name__, self.heap)
def __len__(self):
... | 0 | 0 | 0 | 628 | 0 | 0 | 0 | -9 | 46 |
82ba1046786a2e1a0a460240ef1e2dd952a409f3 | 1,394 | py | Python | setup.py | melinath/philo | 61b73fe068172f02d6c47e2b5387161919ec9618 | [
"0BSD"
] | 2 | 2019-07-08T02:31:06.000Z | 2019-07-08T02:31:57.000Z | setup.py | melinath/philo | 61b73fe068172f02d6c47e2b5387161919ec9618 | [
"0BSD"
] | null | null | null | setup.py | melinath/philo | 61b73fe068172f02d6c47e2b5387161919ec9618 | [
"0BSD"
] | null | null | null | #!/usr/bin/env python
import os
from setuptools import setup, find_packages
version = __import__('philo').VERSION
setup(
name = 'philo',
version = '.'.join([str(v) for v in version]),
url = "http://philocms.org/",
description = "A foundation for developing web content management systems.",
long_description =... | 27.88 | 83 | 0.667145 | #!/usr/bin/env python
import os
from setuptools import setup, find_packages
version = __import__('philo').VERSION
setup(
name = 'philo',
version = '.'.join([str(v) for v in version]),
url = "http://philocms.org/",
description = "A foundation for developing web content management systems.",
long_description =... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8485555a4159399f238c1140f08f9284e64dc49d | 1,622 | py | Python | examples_scalability/demo_fast_convergence.py | microprediction/winning | f03b74fc87cfe4b317a3b0ac3e165bc5e49a39fc | [
"MIT"
] | 22 | 2021-03-05T21:52:44.000Z | 2022-03-31T20:40:52.000Z | examples_scalability/demo_fast_convergence.py | terragord7/winning | 669e2bac5a6c1cc5cadc99f9d2ae485d954b75d0 | [
"MIT"
] | 1 | 2021-10-20T21:15:19.000Z | 2021-10-20T21:15:19.000Z | examples_scalability/demo_fast_convergence.py | terragord7/winning | 669e2bac5a6c1cc5cadc99f9d2ae485d954b75d0 | [
"MIT"
] | 3 | 2020-12-09T03:16:05.000Z | 2021-06-24T20:26:23.000Z | PLOTS=True
unit = 0.05
L = 500
if __name__=='__main__':
demo()
| 41.589744 | 149 | 0.673243 | from winning.lattice_plot import densitiesPlot
from winning.lattice import skew_normal_density, mean_of_density, implicit_state_prices, winner_of_many, sample_winner_of_many
from winning.lattice_calibration import solve_for_implied_offsets, state_prices_from_offsets, densities_from_offsets
import numpy as np
PLOTS=Tru... | 0 | 0 | 0 | 0 | 0 | 1,207 | 0 | 213 | 133 |
029cc27343a7d3920b0fc3d87845df59d917c17c | 816 | py | Python | prerun.py | jobovy/galpy-repl | 86d81de0bd7685bd979b627bed7808e3acc2df53 | [
"MIT"
] | null | null | null | prerun.py | jobovy/galpy-repl | 86d81de0bd7685bd979b627bed7808e3acc2df53 | [
"MIT"
] | null | null | null | prerun.py | jobovy/galpy-repl | 86d81de0bd7685bd979b627bed7808e3acc2df53 | [
"MIT"
] | null | null | null | # A set of Python commands to pre-run for the galpy.org/repl redirect
# Install astroquery
import micropip
await micropip.install('astroquery')
# Install galpy
await micropip.install('https://www.galpy.org/wheelhouse/galpy-latest-py3-none-any.whl')
# Turn off warnings
import warnings
from galpy.util import galpyWarning... | 37.090909 | 115 | 0.816176 | # A set of Python commands to pre-run for the galpy.org/repl redirect
# Install astroquery
import micropip
await micropip.install('astroquery')
# Install galpy
await micropip.install('https://www.galpy.org/wheelhouse/galpy-latest-py3-none-any.whl')
# Turn off warnings
import warnings
from galpy.util import galpyWarning... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
799c5d7a6bd2508e88501b8857ae8849255bbfa3 | 240 | py | Python | Pi/app.py | madhurgupta10/Automatic-Fish-Feeder | cffb49de95d0080f630f09b353653d80eace661a | [
"Apache-2.0"
] | 4 | 2018-06-28T05:40:03.000Z | 2020-03-08T02:27:17.000Z | Pi/app.py | madhurgupta10/Automatic-Fish-Feeder | cffb49de95d0080f630f09b353653d80eace661a | [
"Apache-2.0"
] | null | null | null | Pi/app.py | madhurgupta10/Automatic-Fish-Feeder | cffb49de95d0080f630f09b353653d80eace661a | [
"Apache-2.0"
] | null | null | null | from fishfeeder import FishFeeder
import firebase
url = "{your firebase url}"
while True:
result = firebase.get(url)
if (result['action'] == True):
FishFeeder().FeedNow(0, 90)
firebase.put(url, {'action': False}) | 20 | 44 | 0.641667 | from fishfeeder import FishFeeder
import firebase
url = "{your firebase url}"
while True:
result = firebase.get(url)
if (result['action'] == True):
FishFeeder().FeedNow(0, 90)
firebase.put(url, {'action': False}) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0ddae8c995ed97349e47411d71055dd1d6b8ab29 | 2,427 | py | Python | tests/test_peak_properties.py | jacr20/pax | d64d0ae4e4ec3e9bb3e61065ed92e9ea23328940 | [
"BSD-3-Clause"
] | 17 | 2016-04-24T12:02:03.000Z | 2021-07-19T19:39:47.000Z | tests/test_peak_properties.py | jacr20/pax | d64d0ae4e4ec3e9bb3e61065ed92e9ea23328940 | [
"BSD-3-Clause"
] | 300 | 2016-04-01T15:29:57.000Z | 2021-01-03T23:59:45.000Z | tests/test_peak_properties.py | jacr20/pax | d64d0ae4e4ec3e9bb3e61065ed92e9ea23328940 | [
"BSD-3-Clause"
] | 20 | 2016-04-14T15:11:26.000Z | 2021-09-18T06:39:09.000Z | from __future__ import division
import unittest
if __name__ == '__main__':
unittest.main()
| 37.921875 | 106 | 0.658426 | from __future__ import division
import unittest
import numpy as np
from numpy import testing as np_testing
from pax.plugins.peak_processing.BasicProperties import integrate_until_fraction, put_w_in_center_of_field
class TestPeakProperties(unittest.TestCase):
def test_integrate_until_fraction(self):
# Te... | 0 | 0 | 0 | 2,139 | 0 | 0 | 0 | 100 | 90 |
c1499693144f5e9b369a97a5f4daf9ab135f676d | 625 | py | Python | tests/test_profiler.py | anudeepsamaiya/django_profiler | 497e57a44340ecee148699940b1f3530874c2a2a | [
"MIT"
] | null | null | null | tests/test_profiler.py | anudeepsamaiya/django_profiler | 497e57a44340ecee148699940b1f3530874c2a2a | [
"MIT"
] | null | null | null | tests/test_profiler.py | anudeepsamaiya/django_profiler | 497e57a44340ecee148699940b1f3530874c2a2a | [
"MIT"
] | 1 | 2020-04-11T15:05:23.000Z | 2020-04-11T15:05:23.000Z |
def test_profile_decorator(dump_dir):
"""Only test if the profile decorator is written correctly.
"""
assert fn() == 2, "fn with no parameters failed."
assert fn_with_parameters(5) == 5, "fn with parameters failed."
| 20.16129 | 67 | 0.6592 | import time
import pytest
from pyprofile import profile
@pytest.fixture
def dump_dir(tmp_path):
d = tmp_path / "pyprofile_test_dumps"
d.mkdir()
return d
def test_profile_decorator(dump_dir):
"""Only test if the profile decorator is written correctly.
"""
@profile(dump_dir=dump_dir)
def... | 0 | 255 | 0 | 0 | 0 | 0 | 0 | -10 | 144 |
cda381e73acefa2ad1f7ad18e8e62ee5d4f16510 | 2,528 | py | Python | strings/__init__.py | AileenLumina/dwarf | 5fc3b1b532290a474d17f84694dae1d0d53be7b4 | [
"MIT"
] | null | null | null | strings/__init__.py | AileenLumina/dwarf | 5fc3b1b532290a474d17f84694dae1d0d53be7b4 | [
"MIT"
] | null | null | null | strings/__init__.py | AileenLumina/dwarf | 5fc3b1b532290a474d17f84694dae1d0d53be7b4 | [
"MIT"
] | null | null | null | """Externalized strings for better structure and easier localization"""
setup_greeting = """
Dwarf - First run configuration
Insert your bot's token, or enter 'cancel' to cancel the setup:"""
not_a_token = "Invalid input. Restart Dwarf and repeat the configuration process."
choose_prefix = """Choose a prefix. A pr... | 32.410256 | 85 | 0.716377 | """Externalized strings for better structure and easier localization"""
setup_greeting = """
Dwarf - First run configuration
Insert your bot's token, or enter 'cancel' to cancel the setup:"""
not_a_token = "Invalid input. Restart Dwarf and repeat the configuration process."
choose_prefix = """Choose a prefix. A pr... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3c59ebfb0f93e4980d81653f15d23ef32b3d89a9 | 4,692 | py | Python | tests/test_scope_manager.py | kbh2o/slash | 532b7e3acdf46103ece5b86f21c29f9b58587289 | [
"BSD-3-Clause"
] | 70 | 2015-12-05T12:33:10.000Z | 2022-03-03T04:56:58.000Z | tests/test_scope_manager.py | kbh2o/slash | 532b7e3acdf46103ece5b86f21c29f9b58587289 | [
"BSD-3-Clause"
] | 711 | 2015-10-06T11:01:48.000Z | 2022-02-09T12:40:47.000Z | tests/test_scope_manager.py | kbh2o/slash | 532b7e3acdf46103ece5b86f21c29f9b58587289 | [
"BSD-3-Clause"
] | 37 | 2015-10-13T11:00:51.000Z | 2022-02-08T07:28:11.000Z | # pylint: disable=redefined-outer-name
from .utils.suite_writer import Suite
def test_requirement_mismatch_end_of_module():
"""Test that unmet requirements at end of file(module) still enable scope manager to detect the end and properly pop contextx"""
suite = Suite()
num_files = 3
num_tests_per_fil... | 30.666667 | 132 | 0.66347 | # pylint: disable=redefined-outer-name
import collections
import functools
import itertools
import pytest
import slash
from slash.core.scope_manager import ScopeManager, get_current_scope
from .utils import make_runnable_tests
from .utils.suite_writer import Suite
def test_requirement_mismatch_end_of_module():
"... | 0 | 1,671 | 0 | 484 | 0 | 1,499 | 0 | 34 | 316 |
19346741bfacb214c72a76ffb440bfbbe83af104 | 32,188 | py | Python | modules/PLSR.py | jernelv/SpecAnalysis | 175875ea14f200ecd5de8eaa5b228c32c6621e46 | [
"MIT"
] | 5 | 2021-01-04T10:30:12.000Z | 2022-03-25T10:31:19.000Z | modules/PLSR.py | jernelv/SpecAnalysis | 175875ea14f200ecd5de8eaa5b228c32c6621e46 | [
"MIT"
] | null | null | null | modules/PLSR.py | jernelv/SpecAnalysis | 175875ea14f200ecd5de8eaa5b228c32c6621e46 | [
"MIT"
] | 5 | 2020-11-17T13:07:47.000Z | 2021-08-28T15:03:02.000Z | from __future__ import print_function
import scipy.signal
#from sklearn.model_selection import LeavePOut
#from sklearn.model_selection import KFold
#### this
'''functions_to_wrap = [[matplotlib.axes.Axes,'pcolormesh'],
[matplotlib.figure.Figure,'colorbar'],
[matplotlib.figure... | 42.917333 | 182 | 0.657015 | from __future__ import print_function
import fns
import numpy as np
import os
import matplotlib.pyplot as plt
import matplotlib
import scipy.signal
from scipy import signal
#from sklearn.model_selection import LeavePOut
#from sklearn.model_selection import KFold
from sklearn.model_selection import ShuffleSplit
from skl... | 0 | 58 | 0 | 23,532 | 0 | 5,461 | 0 | 187 | 709 |
a03e0b10a5d8e2360238fded84f6753612e5c8fc | 2,982 | py | Python | src/check_docker_container/check_docker_container.py | BlackZork/check_docker_container | 4568ac24a69940d5efcd316d4b8a26069dcdbdff | [
"MIT"
] | 2 | 2021-09-20T00:45:19.000Z | 2021-11-27T09:35:11.000Z | src/check_docker_container/check_docker_container.py | BlackZork/check_docker_container | 4568ac24a69940d5efcd316d4b8a26069dcdbdff | [
"MIT"
] | null | null | null | src/check_docker_container/check_docker_container.py | BlackZork/check_docker_container | 4568ac24a69940d5efcd316d4b8a26069dcdbdff | [
"MIT"
] | null | null | null | #!python
"""Check if docker container is running"""
if __name__ == '__main__':
main()
| 25.487179 | 115 | 0.557009 | #!python
"""Check if docker container is running"""
import argparse
import subprocess
import re
import nagiosplugin
class ContainerState:
def __init__(self, state: str, content: str, is_paused: bool):
self.state = state
self.content = content
self.is_paused = is_paused
class Container(n... | 0 | 339 | 0 | 2,366 | 0 | 0 | 0 | -24 | 205 |
abc9d3d5be2b40831b42aa3d20376d6f1cb4eaeb | 9,403 | py | Python | src/s_iSpin_10min_plots.py | ashimgiyanani/ProjectTemplate_python | 3135e8976aac751049a6da34a550db0fe045f0bb | [
"BSD-3-Clause"
] | null | null | null | src/s_iSpin_10min_plots.py | ashimgiyanani/ProjectTemplate_python | 3135e8976aac751049a6da34a550db0fe045f0bb | [
"BSD-3-Clause"
] | null | null | null | src/s_iSpin_10min_plots.py | ashimgiyanani/ProjectTemplate_python | 3135e8976aac751049a6da34a550db0fe045f0bb | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Jul 29 07:57:54 2020
@author: papalk
"""
# Code logbook
# 10.02.2021 - Handover from Alkistis
# changed filename to filename[0] due to variable type error
# Changing from df.ix[...,0] to df.loc[..., df.columns[0]] due to a newer pandas version
import sys
import datetime as ... | 44.563981 | 240 | 0.696373 | # -*- coding: utf-8 -*-
"""
Created on Wed Jul 29 07:57:54 2020
@author: papalk
"""
# Code logbook
# 10.02.2021 - Handover from Alkistis
# changed filename to filename[0] due to variable type error
# Changing from df.ix[...,0] to df.loc[..., df.columns[0]] due to a newer pandas version
import sys
import datetime as ... | 6 | 0 | 0 | 0 | 0 | 0 | 0 | 46 | 110 |
74a17973868b8405492f752954532503abd913b9 | 1,478 | py | Python | Course1/Week2/6_fibonacci_sum_last_digit.py | sinhars/Data-Structures-And-Algorithms | 92f42ac347a69260a28cfb37d3013bfe9b045448 | [
"MIT"
] | null | null | null | Course1/Week2/6_fibonacci_sum_last_digit.py | sinhars/Data-Structures-And-Algorithms | 92f42ac347a69260a28cfb37d3013bfe9b045448 | [
"MIT"
] | null | null | null | Course1/Week2/6_fibonacci_sum_last_digit.py | sinhars/Data-Structures-And-Algorithms | 92f42ac347a69260a28cfb37d3013bfe9b045448 | [
"MIT"
] | null | null | null | # Uses python3
import sys
if __name__ == '__main__':
input = sys.stdin.readline()
n = int(input)
print(fibonacci_sum_faster(n))
| 27.886792 | 100 | 0.593369 | # Uses python3
import sys
def fibonacci_sum_naive(n):
if n <= 1:
return n
previous = 0
current = 1
sum = 1
for _ in range(n - 1):
previous, current = current, previous + current
sum += current
return sum % 10
def fibonacci_sum_fast(n):
if n <= 1:
return n
... | 0 | 0 | 0 | 0 | 0 | 1,264 | 0 | 0 | 72 |
8f7cb8c7fb06b389e9f4be8127c24d6efe69be22 | 1,234 | py | Python | sugar/templatetags/text_tags.py | acdha/django-sugar | cd41b8160e22856818cb1ce1df6fe83f9882ac36 | [
"BSD-3-Clause"
] | 2 | 2015-12-01T01:14:32.000Z | 2015-12-01T13:51:54.000Z | sugar/templatetags/text_tags.py | acdha/django-sugar | cd41b8160e22856818cb1ce1df6fe83f9882ac36 | [
"BSD-3-Clause"
] | null | null | null | sugar/templatetags/text_tags.py | acdha/django-sugar | cd41b8160e22856818cb1ce1df6fe83f9882ac36 | [
"BSD-3-Clause"
] | 2 | 2015-06-09T09:10:08.000Z | 2021-03-17T14:08:24.000Z | # encoding: utf-8
from django import template
register = template.Library()
| 18.69697 | 77 | 0.623987 | # encoding: utf-8
import re
from django import template
register = template.Library()
@register.filter
def truncchar(value, arg):
'''
Truncate after a certain number of characters.
Source: http://www.djangosnippets.org/snippets/194/
Notes
-----
Super stripped down filter to truncate after... | 3 | 1,072 | 0 | 0 | 0 | 0 | 0 | -12 | 92 |
30dd9d8b5666d553624f3f398eb4c42b85c0a46c | 197 | py | Python | public/python/yellow_led.py | pabloegpf1/GPIO-Express | 0c39568e5798b1e93069afab42427759f5f0a313 | [
"MIT"
] | null | null | null | public/python/yellow_led.py | pabloegpf1/GPIO-Express | 0c39568e5798b1e93069afab42427759f5f0a313 | [
"MIT"
] | null | null | null | public/python/yellow_led.py | pabloegpf1/GPIO-Express | 0c39568e5798b1e93069afab42427759f5f0a313 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(27,GPIO.OUT)
GPIO.output(27,GPIO.HIGH)
time.sleep(2)
GPIO.output(27,GPIO.LOW)
| 15.153846 | 25 | 0.756345 | #!/usr/bin/env python
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(27,GPIO.OUT)
GPIO.output(27,GPIO.HIGH)
time.sleep(2)
GPIO.output(27,GPIO.LOW)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c4884895e617d8312daf555d7a5e58ceb6705ef5 | 18,741 | py | Python | joulescope_ui/recording_viewer_device_v2.py | jetperch/pyjoulescope_ui | 0324562dafc1ad2ae4a6a8cd8d073582863bf394 | [
"Apache-2.0"
] | 31 | 2018-12-13T16:13:02.000Z | 2021-09-28T09:57:50.000Z | joulescope_ui/recording_viewer_device_v2.py | jetperch/pyjoulescope_ui | 0324562dafc1ad2ae4a6a8cd8d073582863bf394 | [
"Apache-2.0"
] | 144 | 2019-02-12T14:58:02.000Z | 2022-03-24T12:06:17.000Z | joulescope_ui/recording_viewer_device_v2.py | jetperch/pyjoulescope_ui | 0324562dafc1ad2ae4a6a8cd8d073582863bf394 | [
"Apache-2.0"
] | 7 | 2019-07-04T16:34:54.000Z | 2021-03-24T16:25:06.000Z | # Copyright 2018 Jetperch LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 38.482546 | 108 | 0.567953 | # Copyright 2018 Jetperch LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 14 | 694 | 0 | 17,099 | 0 | 0 | 0 | 80 | 267 |
c61b3c3a6dae08904316a919aedc1d74066916de | 3,496 | py | Python | examples/python/cancellation/client.py | arghyadip01/grpc | 9e10bfc8a096ef91a327e22f84f10c0fabff4417 | [
"Apache-2.0"
] | 36,552 | 2015-02-26T17:30:13.000Z | 2022-03-31T22:41:33.000Z | examples/python/cancellation/client.py | SanjanaSingh897/grpc | 2d858866eb95ce5de8ccc8c35189a12733d8ca79 | [
"Apache-2.0"
] | 23,536 | 2015-02-26T17:50:56.000Z | 2022-03-31T23:39:42.000Z | examples/python/cancellation/client.py | SanjanaSingh897/grpc | 2d858866eb95ce5de8ccc8c35189a12733d8ca79 | [
"Apache-2.0"
] | 11,050 | 2015-02-26T17:22:10.000Z | 2022-03-31T10:12:35.000Z | # Copyright 2019 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 wri... | 34.613861 | 81 | 0.658181 | # Copyright 2019 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 wri... | 0 | 0 | 0 | 0 | 0 | 2,330 | 0 | 36 | 204 |
d64c7c0ae5f7486716af9d390676fe3fcb47970b | 405 | py | Python | cha_bebe/galeria/migrations/0002_album_capa.py | intelektos/Cha_bebe | 23df4af3901413c9c50e73bd305ade165c81001b | [
"MIT"
] | null | null | null | cha_bebe/galeria/migrations/0002_album_capa.py | intelektos/Cha_bebe | 23df4af3901413c9c50e73bd305ade165c81001b | [
"MIT"
] | 9 | 2020-06-08T03:31:08.000Z | 2022-01-13T02:44:42.000Z | cha_bebe/galeria/migrations/0002_album_capa.py | intelektos/Cha_bebe | 23df4af3901413c9c50e73bd305ade165c81001b | [
"MIT"
] | 1 | 2020-06-01T17:43:20.000Z | 2020-06-01T17:43:20.000Z | # Generated by Django 3.0.6 on 2020-05-14 20:41
| 21.315789 | 85 | 0.595062 | # Generated by Django 3.0.6 on 2020-05-14 20:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('galeria', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='album',
name='capa',
field=... | 0 | 0 | 0 | 291 | 0 | 0 | 0 | 19 | 46 |
19c4fa0d09483af5d6bddd0f9df81daca40d46e3 | 1,379 | py | Python | Paths/New Tab with Overlaps.py | harbortype/glyphs-scripts | 792785ac706d2cdf6ec5e7ea5282178e8ef54d83 | [
"Apache-2.0"
] | 23 | 2018-07-28T23:50:32.000Z | 2021-08-31T09:52:00.000Z | Paths/New Tab with Overlaps.py | harbortype/glyphs-scripts | 792785ac706d2cdf6ec5e7ea5282178e8ef54d83 | [
"Apache-2.0"
] | 2 | 2021-05-03T12:06:01.000Z | 2021-11-13T17:33:29.000Z | Paths/New Tab with Overlaps.py | harbortype/glyphs-scripts | 792785ac706d2cdf6ec5e7ea5282178e8ef54d83 | [
"Apache-2.0"
] | 1 | 2020-02-21T09:48:06.000Z | 2020-02-21T09:48:06.000Z | #MenuTitle: New Tab with Overlaps
# -*- coding: utf-8 -*-
from __future__ import division, print_function, unicode_literals
__doc__="""
Opens a new Edit tab containing all glyphs that contain overlaps.
"""
thisFont = Glyphs.font # frontmost font
master_ids = [master.id for master in thisFont.masters] # all the master ... | 30.644444 | 76 | 0.75417 | #MenuTitle: New Tab with Overlaps
# -*- coding: utf-8 -*-
from __future__ import division, print_function, unicode_literals
__doc__="""
Opens a new Edit tab containing all glyphs that contain overlaps.
"""
import copy
thisFont = Glyphs.font # frontmost font
master_ids = [master.id for master in thisFont.masters] # al... | 0 | 0 | 0 | 0 | 0 | 404 | 0 | -10 | 46 |
265411f87b72e76316c668e81bd373a1cadf6fbf | 33,403 | py | Python | src/main.py | ChocolateEye/Math-and-Chemistry-Bot | 2e44eb21fb962e79a14b110009c75a13929adef2 | [
"MIT"
] | 5 | 2020-12-02T16:17:07.000Z | 2021-11-20T07:51:27.000Z | src/main.py | ChocolateEye/Math-and-Chemistry-Bot | 2e44eb21fb962e79a14b110009c75a13929adef2 | [
"MIT"
] | null | null | null | src/main.py | ChocolateEye/Math-and-Chemistry-Bot | 2e44eb21fb962e79a14b110009c75a13929adef2 | [
"MIT"
] | 1 | 2022-02-16T19:23:51.000Z | 2022-02-16T19:23:51.000Z | import discord
from discord.ext import commands
intents = discord.Intents.default()
intents.members = True
intents.reactions = True
intents.messages = True
client = commands.Bot(command_prefix = '//', intents = intents)
client.remove_command("help")
client.run("bot token here")
| 62.31903 | 388 | 0.592851 | import random
import datetime
import asyncio
import math
import matplotlib.pyplot as plt
import numpy as np
import os
import json
import discord
from discord.ext import commands
intents = discord.Intents.default()
intents.members = True
intents.reactions = True
intents.messages = True
client = commands.Bot(command_pref... | 0 | 32,528 | 0 | 0 | 0 | 0 | 0 | -46 | 640 |
a7a400dd0f6ec96242a8200780d4b168fcc473a9 | 18,024 | py | Python | latency_search.py | jiuyecao/Opt-CoInfer | 60f29a28c34d3bf9b2f23c98bb8e98caf1abc4f0 | [
"MIT"
] | 1 | 2022-03-01T09:34:12.000Z | 2022-03-01T09:34:12.000Z | latency_search.py | Anonymity2022/Opt-CoInfer | 60f29a28c34d3bf9b2f23c98bb8e98caf1abc4f0 | [
"MIT"
] | null | null | null | latency_search.py | Anonymity2022/Opt-CoInfer | 60f29a28c34d3bf9b2f23c98bb8e98caf1abc4f0 | [
"MIT"
] | null | null | null | #coding=utf-8
import random
import argparse
global accuracy_loss_constraint, latency_constraint,optimal_scheme,avaliable_scheme,avaliable_evaluated_scheme
import warnings
warnings.filterwarnings("ignore")
# User define the following parameters, 10000 as a loose constraint means the constraint actually has no infl... | 48.845528 | 506 | 0.674933 | #coding=utf-8
import numpy
import random
import torch
from sklearn.gaussian_process import GaussianProcessRegressor
from sklearn.gaussian_process.kernels import Matern
from scipy.stats import norm
import random
import os
from numpy import argmax
import argparse
global accuracy_loss_constraint, latency_constr... | 6 | 0 | 0 | 0 | 0 | 14,063 | 0 | 42 | 457 |
e7b13db3d60af216a9f52452d46ca5d1945110b0 | 12,300 | py | Python | VAE/model_maker.py | BensonRen/AEM_DIM_Bench | 1ff82bfdcd6b0a736bf184f0bcb8a533743aacbb | [
"MIT"
] | 1 | 2022-01-08T22:07:31.000Z | 2022-01-08T22:07:31.000Z | VAE/model_maker.py | BensonRen/AEM_DIM_Bench | 1ff82bfdcd6b0a736bf184f0bcb8a533743aacbb | [
"MIT"
] | null | null | null | VAE/model_maker.py | BensonRen/AEM_DIM_Bench | 1ff82bfdcd6b0a736bf184f0bcb8a533743aacbb | [
"MIT"
] | null | null | null | """
This is the module where the model is defined. It uses the nn.Module as backbone to create the network structure
"""
# Own modules
# Built in
# Libs
# Pytorch module
import torch.nn as nn
"""
class Decoder(nn.Module):
def __init__(self, flags):
super(Decoder, self).__init__(... | 43.772242 | 121 | 0.551789 | """
This is the module where the model is defined. It uses the nn.Module as backbone to create the network structure
"""
# Own modules
# Built in
import math
# Libs
import numpy as np
# Pytorch module
import torch.nn as nn
import torch.nn.functional as F
import torch
class VAE(nn.Module):
def _... | 0 | 0 | 0 | 6,997 | 0 | 0 | 0 | -12 | 117 |
3e6984b5a209bdec5d3dcb1eec9351a89355202e | 827 | py | Python | pylex/config/lexer_dict_config.py | subhajeet2107/pylexer | 64336fb14299a56116e58c3016261b3f5509510d | [
"MIT"
] | null | null | null | pylex/config/lexer_dict_config.py | subhajeet2107/pylexer | 64336fb14299a56116e58c3016261b3f5509510d | [
"MIT"
] | null | null | null | pylex/config/lexer_dict_config.py | subhajeet2107/pylexer | 64336fb14299a56116e58c3016261b3f5509510d | [
"MIT"
] | null | null | null | """
* This file is part of the subhajeet2107/pylexer package.
*
* (c) Subhajeet Dey <subhajeet2107@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
"""
| 24.323529 | 65 | 0.753325 | """
* This file is part of the subhajeet2107/pylexer package.
*
* (c) Subhajeet Dey <subhajeet2107@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
"""
from pylex.config.lexer_config import LexerConfig
from pylex.config.token_defination imp... | 0 | 0 | 0 | 460 | 0 | 0 | 0 | 64 | 67 |
cba59782f47fa957c6bae9d0a91ab2916e84638a | 13,117 | py | Python | scripts/020migr-01x.py | vertexproject/synapse-regression | a4639acd581a68493e63df1639f416969527fa1f | [
"Apache-2.0"
] | 1 | 2019-01-31T23:18:59.000Z | 2019-01-31T23:18:59.000Z | scripts/020migr-01x.py | vertexproject/synapse-regression | a4639acd581a68493e63df1639f416969527fa1f | [
"Apache-2.0"
] | null | null | null | scripts/020migr-01x.py | vertexproject/synapse-regression | a4639acd581a68493e63df1639f416969527fa1f | [
"Apache-2.0"
] | null | null | null | '''
Generate an 0.1.x cortex for testing migration to 0.2.x
'''
import asyncio
import synapse.lib.version as s_version
assert s_version.version == (0, 1, 56)
DESTPATH_CORTEX = 'cortexes/0.1.56-migr'
DESTPATH_SVC = 'cortexes/0.1.56-migr/stormsvc'
DESTPATH_ASSETS = 'assets/0.1.56-migr'
if __name__ == '__main__':
a... | 38.02029 | 110 | 0.514752 | '''
Generate an 0.1.x cortex for testing migration to 0.2.x
'''
import os
import json
import shutil
import asyncio
import hashlib
import synapse.common as s_common
import synapse.cortex as s_cortex
import synapse.lib.cell as s_cell
import synapse.lib.module as s_module
import synapse.lib.version as s_version
import s... | 0 | 0 | 11,443 | 925 | 0 | 0 | 0 | 73 | 337 |
1a18878e942b8022f8dd24edaf079318e0e3cb84 | 7,149 | py | Python | GUI_handler.py | xrayian/PhysicsX | 5211a43f79a179609144619ecbefa95d69379793 | [
"Apache-2.0"
] | 2 | 2019-12-07T09:29:59.000Z | 2019-12-27T23:45:54.000Z | GUI_handler.py | xrayian/PhysicsX | 5211a43f79a179609144619ecbefa95d69379793 | [
"Apache-2.0"
] | null | null | null | GUI_handler.py | xrayian/PhysicsX | 5211a43f79a179609144619ecbefa95d69379793 | [
"Apache-2.0"
] | null | null | null | import PySimpleGUI as sg
from support import Velocity, Distance, Time, Acceleration
from os import getlogin
from re import sub
error_count = 0
sg.set_options(element_padding=(5,5),icon="images/icon.ico",)
sg.change_look_and_feel('blueMono')
layout = [
[sg.Text('Initial Velocity'), sg.InputText(focus=Tru... | 47.344371 | 303 | 0.590152 | import PySimpleGUI as sg
from support import Velocity, Distance, Time, Acceleration
from os import getlogin
from re import sub
error_count = 0
def parse_data(string, default = None, zero = 0):
global error_count
if string == "":
return default
else:
try:
return float... | 11 | 0 | 0 | 0 | 0 | 425 | 0 | 0 | 23 |
d34ea667ce7eaa4e845915382405956244ee3598 | 3,398 | py | Python | crypto/encrypted-communications/crypto_commons/asymmetric/asymmetric.py | nanzggits/sdctf-2021 | fcddb506f5f798a264fc17e5588c0f5b7d5fbb2c | [
"MIT"
] | 6 | 2021-05-17T21:04:31.000Z | 2022-01-01T23:28:18.000Z | crypto/encrypted-communications/crypto_commons/asymmetric/asymmetric.py | acmucsd/sdctf-2021 | fcddb506f5f798a264fc17e5588c0f5b7d5fbb2c | [
"MIT"
] | null | null | null | crypto/encrypted-communications/crypto_commons/asymmetric/asymmetric.py | acmucsd/sdctf-2021 | fcddb506f5f798a264fc17e5588c0f5b7d5fbb2c | [
"MIT"
] | 1 | 2021-05-29T02:18:30.000Z | 2021-05-29T02:18:30.000Z | import random
from crypto_commons.generic import long_to_bytes, multiply
from crypto_commons.rsa.rsa_commons import ensure_long, modinv, lcm_multi
"""
Here are some less popular asymmetric cryptosystems:
- Damgard-Jurik
- Paillier (same as Damgard Jurik for s = 1)
"""
def paillier_encrypt(m, g, n, r):
"""
E... | 26.341085 | 73 | 0.575927 | import random
from crypto_commons.generic import long_to_bytes, multiply, factorial
from crypto_commons.rsa.rsa_commons import ensure_long, modinv, lcm_multi
"""
Here are some less popular asymmetric cryptosystems:
- Damgard-Jurik
- Paillier (same as Damgard Jurik for s = 1)
"""
def paillier_encrypt(m, g, n, r):
... | 0 | 0 | 0 | 0 | 0 | 557 | 0 | 11 | 54 |
d742a8f62ce69d50a5f6e561170e826811f173ee | 1,903 | py | Python | src/runescape_old/Runescape_old_data.py | Peilonrayz/recipe_forest | 5d84e143b9a4f4ab139b8b3bce423517822c6f91 | [
"MIT"
] | null | null | null | src/runescape_old/Runescape_old_data.py | Peilonrayz/recipe_forest | 5d84e143b9a4f4ab139b8b3bce423517822c6f91 | [
"MIT"
] | null | null | null | src/runescape_old/Runescape_old_data.py | Peilonrayz/recipe_forest | 5d84e143b9a4f4ab139b8b3bce423517822c6f91 | [
"MIT"
] | null | null | null | mats = [
Mat(**m)
for m in [
{
"name": "Bronze",
"smithing": 1,
"forging": 15,
"forging_levels": [1],
"forging_burial": False,
},
{
"name": "Iron",
"smithing": 2,
"forging": 40,
"f... | 25.039474 | 50 | 0.352601 | mats = [
Mat(**m)
for m in [
{
"name": "Bronze",
"smithing": 1,
"forging": 15,
"forging_levels": [1],
"forging_burial": False,
},
{
"name": "Iron",
"smithing": 2,
"forging": 40,
"f... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e8ae73b679d90773c7e94e9811a24a970cf99181 | 1,655 | py | Python | src/cmcandy/Python_language_Answers/_0004.py | ch98road/leetcode | a9b4be54a169b30f6711809b892dd1f79f2a17e7 | [
"MIT"
] | null | null | null | src/cmcandy/Python_language_Answers/_0004.py | ch98road/leetcode | a9b4be54a169b30f6711809b892dd1f79f2a17e7 | [
"MIT"
] | null | null | null | src/cmcandy/Python_language_Answers/_0004.py | ch98road/leetcode | a9b4be54a169b30f6711809b892dd1f79f2a17e7 | [
"MIT"
] | 1 | 2020-11-26T03:01:12.000Z | 2020-11-26T03:01:12.000Z |
if __name__ == '__main__':
s = Solution()
nums1 = [1, 2, 3]
nums2 = [2, 3, 4, 5]
# nums1 = [0, 0]
# nums2 = [0, 0]
print(s.findMedianSortedArrays(nums1=nums1, nums2=nums2))
| 27.583333 | 61 | 0.39577 | from typing import List
class Solution:
def findMedianSortedArrays(self, nums1: List[int],
nums2: List[int]) -> float:
# 首先需要知道长度
len1 = len(nums1)
len2 = len(nums2)
# 交换值,这里保证了nums1是比较短的数组
if len1 > len2:
tmp = nums1
n... | 93 | 0 | 0 | 1,377 | 0 | 0 | 0 | 2 | 45 |
334e19a0852221e0278f7a8f1e2e69f913e1c65b | 5,590 | py | Python | turnsole/model.py | Antonio-hi/turnsole | 201e852f6a8699843760fcf4884b7aa6208ab296 | [
"MIT"
] | 1 | 2021-03-05T10:09:56.000Z | 2021-03-05T10:09:56.000Z | turnsole/model.py | Antonio-hi/turnsole | 201e852f6a8699843760fcf4884b7aa6208ab296 | [
"MIT"
] | null | null | null | turnsole/model.py | Antonio-hi/turnsole | 201e852f6a8699843760fcf4884b7aa6208ab296 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @Author : Lyu Kui
# @Email : 9428.al@gmail.com
# @Created Date : 2021-02-24 13:58:46
# @Last Modified : 2021-03-05 18:14:17
# @Description :
if __name__ == '__main__':
model = EasyDet(phi=0)
model.summary()
import time
import numpy as np
x = np.random.... | 37.516779 | 109 | 0.530054 | # -*- coding: utf-8 -*-
# @Author : Lyu Kui
# @Email : 9428.al@gmail.com
# @Created Date : 2021-02-24 13:58:46
# @Last Modified : 2021-03-05 18:14:17
# @Description :
import tensorflow as tf
from .nets.efficientnet import EfficientNetB0, EfficientNetB1, EfficientNetB2, EfficientNetB3
from .nets.effi... | 24 | 0 | 0 | 0 | 0 | 4,675 | 0 | 146 | 114 |
fdb3e670f4df9283255b2e51daea9be043b18deb | 3,077 | py | Python | PygameFloatObjects/examples/circle_example.py | MrComboF10/PygameFloatObjects | e139a3b542d1ef2d54604e2769827c9da6d2cee3 | [
"MIT"
] | null | null | null | PygameFloatObjects/examples/circle_example.py | MrComboF10/PygameFloatObjects | e139a3b542d1ef2d54604e2769827c9da6d2cee3 | [
"MIT"
] | null | null | null | PygameFloatObjects/examples/circle_example.py | MrComboF10/PygameFloatObjects | e139a3b542d1ef2d54604e2769827c9da6d2cee3 | [
"MIT"
] | null | null | null |
# circle_example()
| 25.01626 | 108 | 0.644459 | from PygameFloatObjects.objects import *
def resize_circle(screen, screen_size, float_circle, float_font, font_text, font_color, ratio):
# clear screen
screen.fill((0, 0, 0))
# set new float circle radius
new_circle_radius = ratio * float_circle.get_float_radius()
# update float rect
float_c... | 0 | 0 | 0 | 0 | 0 | 2,967 | 0 | 19 | 68 |
fbaf88f5eb5f3ead2d85328be4d84297eecebdb4 | 1,666 | py | Python | examples/widgets/effectwidget3_advanced.py | Galland/kivy | 95a6bf279883d706f645e4629c16d5ee1038f0ec | [
"MIT"
] | 9 | 2016-09-03T07:20:01.000Z | 2020-05-21T14:44:48.000Z | examples/widgets/effectwidget3_advanced.py | Galland/kivy | 95a6bf279883d706f645e4629c16d5ee1038f0ec | [
"MIT"
] | 6 | 2020-01-31T18:04:48.000Z | 2021-06-05T10:53:55.000Z | examples/widgets/effectwidget3_advanced.py | Galland/kivy | 95a6bf279883d706f645e4629c16d5ee1038f0ec | [
"MIT"
] | 4 | 2016-09-10T15:27:54.000Z | 2020-03-27T22:05:31.000Z | '''
This example demonstrates creating and usind an AdvancedEffectBase. In
this case, we use it to efficiently pass the touch coordinates into the shader.
'''
from kivy.base import runTouchApp
from kivy.lang import Builder
effect_string = '''
uniform vec2 touch;
vec4 effect(vec4 color, sampler2D texture, vec2 tex_c... | 26.03125 | 79 | 0.67467 | '''
This example demonstrates creating and usind an AdvancedEffectBase. In
this case, we use it to efficiently pass the touch coordinates into the shader.
'''
from kivy.base import runTouchApp
from kivy.properties import ListProperty
from kivy.lang import Builder
from kivy.uix.effectwidget import EffectWidget, Advance... | 0 | 0 | 0 | 726 | 0 | 0 | 0 | 64 | 90 |
d9cc4bd981391c19f9bf7d7e3f5eaa43030cb2ed | 12,142 | py | Python | exp0005/train1.py | hirune924/kaggle-HuBMAP | e4c2008378eb773db551cee52380bfccdf3a10fa | [
"Apache-2.0"
] | null | null | null | exp0005/train1.py | hirune924/kaggle-HuBMAP | e4c2008378eb773db551cee52380bfccdf3a10fa | [
"Apache-2.0"
] | null | null | null | exp0005/train1.py | hirune924/kaggle-HuBMAP | e4c2008378eb773db551cee52380bfccdf3a10fa | [
"Apache-2.0"
] | null | null | null | ####################
# Import Libraries
####################
import cv2
#from sklearn import model_selection
from omegaconf import OmegaConf
cv2.setNumThreads(0)
####################
# Utils
####################
####################
# Config
####################
conf_dict = {'batch_size': 8,#32,
'epoc... | 37.591331 | 156 | 0.565228 | ####################
# Import Libraries
####################
import os
import sys
import cv2
import numpy as np
import pandas as pd
import pytorch_lightning as pl
from pytorch_lightning.metrics import Accuracy
from pytorch_lightning import loggers
from pytorch_lightning import seed_everything
from pytorch_lightning im... | 33 | 0 | 0 | 8,677 | 0 | 1,592 | 0 | 231 | 580 |
4011ca77bfb0d17039209384edff99a24db49296 | 732 | py | Python | hw1/metrics/average_session_time/collect_counts_to_file/mapper.py | alexsyrom/shad_bigdata | e22ad5e95cfb8a606d4f3727f731b340e39cdecd | [
"MIT"
] | null | null | null | hw1/metrics/average_session_time/collect_counts_to_file/mapper.py | alexsyrom/shad_bigdata | e22ad5e95cfb8a606d4f3727f731b340e39cdecd | [
"MIT"
] | null | null | null | hw1/metrics/average_session_time/collect_counts_to_file/mapper.py | alexsyrom/shad_bigdata | e22ad5e95cfb8a606d4f3727f731b340e39cdecd | [
"MIT"
] | null | null | null | #!/shared/anaconda/bin/python
# encoding=utf8
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from builtins import map
import sys
import codecs
reload(sys)
sys.setdefaultencoding('utf8')
sys.stdin = codecs.getreader('utf8')(sys.stdin, errors='ignore')
... | 20.914286 | 64 | 0.773224 | #!/shared/anaconda/bin/python
# encoding=utf8
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from builtins import bytes, chr
from builtins import str
from builtins import dict
from builtins import object
from builtins import range
from builtins import map
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 25 | 177 |
836f46b8249549cfe9db555c9ba7b0e246a7f47d | 2,892 | py | Python | error_reporting/tests/unit/test__gapic.py | DaveCheez/google-cloud-python | fc03d4d41f13e9d13db7206438163b3a471fdabd | [
"Apache-2.0"
] | 2 | 2021-11-26T07:08:43.000Z | 2022-03-07T20:20:04.000Z | error_reporting/tests/unit/test__gapic.py | DaveCheez/google-cloud-python | fc03d4d41f13e9d13db7206438163b3a471fdabd | [
"Apache-2.0"
] | null | null | null | error_reporting/tests/unit/test__gapic.py | DaveCheez/google-cloud-python | fc03d4d41f13e9d13db7206438163b3a471fdabd | [
"Apache-2.0"
] | 1 | 2020-04-14T10:47:41.000Z | 2020-04-14T10:47:41.000Z | # Copyright 2017 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 36.607595 | 87 | 0.730636 | # Copyright 2017 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 0 | 143 | 0 | 2,097 | 0 | 0 | 0 | -16 | 92 |
de5b472342d358feb4e1a695df12e73f9a4245b9 | 5,403 | py | Python | pyNTCIREVAL/metrics/ncu.py | mpkato/pyNTCIREVAL | db0b342fbd385936a8a5db31533fb020743c3137 | [
"MIT"
] | 20 | 2016-12-19T10:19:17.000Z | 2021-07-03T18:38:25.000Z | pyNTCIREVAL/metrics/ncu.py | mpkato/pyNTCIREVAL | db0b342fbd385936a8a5db31533fb020743c3137 | [
"MIT"
] | 3 | 2017-12-24T01:27:27.000Z | 2018-01-20T14:54:21.000Z | pyNTCIREVAL/metrics/ncu.py | mpkato/pyNTCIREVAL | db0b342fbd385936a8a5db31533fb020743c3137 | [
"MIT"
] | 1 | 2017-02-25T02:34:40.000Z | 2017-02-25T02:34:40.000Z |
def p_u():
'''
Uniform stop probability function
where the stop probability is the same for all the relevant documents,
i.e. 1/(# relevant documents).
'''
return func
def p_gu(stops):
'''
Graded-uniform stop probability function
where the stop probability is defined for each releva... | 36.02 | 120 | 0.642421 | from .grade_metric import GradeMetric
import types
class NCU(GradeMetric):
'''
NCU (Normalised Cumulative Utility)
See Sakai. T. and Robertson, S.: Modelling A User Population for Designing Information Retrieval Metrics, EVIA 2008.
Args:
xrelnum: the number of judged X-rel docs (including 0-r... | 0 | 0 | 0 | 3,737 | 0 | 639 | 0 | 7 | 237 |
7eb21d816b491f2d24f46f36844fc9ee8f7a718e | 1,833 | py | Python | lambda/automations/remove_tag.py | hyperglance/aws-rule-automations | b770b2687ffa04a6bad857f3ed6505cf57985022 | [
"MIT"
] | null | null | null | lambda/automations/remove_tag.py | hyperglance/aws-rule-automations | b770b2687ffa04a6bad857f3ed6505cf57985022 | [
"MIT"
] | null | null | null | lambda/automations/remove_tag.py | hyperglance/aws-rule-automations | b770b2687ffa04a6bad857f3ed6505cf57985022 | [
"MIT"
] | 3 | 2021-06-14T04:31:42.000Z | 2021-12-05T23:56:37.000Z | """
This automation attempts to remove a tag for a resource, identified as above or below the configured threshold
by Hyperglance Rule(s)
This automation will operate across accounts, where the appropriate IAM Role exists.
"""
import logging
import processing.automation_utils as utils
logger = logging.getLogger()
l... | 24.44 | 110 | 0.558647 | """
This automation attempts to remove a tag for a resource, identified as above or below the configured threshold
by Hyperglance Rule(s)
This automation will operate across accounts, where the appropriate IAM Role exists.
"""
import logging
import processing.automation_utils as utils
logger = logging.getLogger()
l... | 0 | 0 | 0 | 0 | 0 | 786 | 0 | 0 | 23 |
31e3b04e581943e1a356d811ce94a841c6eb327f | 923 | py | Python | Helper.py | davidmwilson/sample-python-Mar2018 | 1eec7442668fb60a321b879ea6167cdcb44e8ea6 | [
"MIT"
] | null | null | null | Helper.py | davidmwilson/sample-python-Mar2018 | 1eec7442668fb60a321b879ea6167cdcb44e8ea6 | [
"MIT"
] | null | null | null | Helper.py | davidmwilson/sample-python-Mar2018 | 1eec7442668fb60a321b879ea6167cdcb44e8ea6 | [
"MIT"
] | null | null | null | '''
This file contains helper functions
'''
def format_cmd_line(cmdline, day):
'''
Name: formatCmdLine
Input: raw command line
date
Output: final command line
Purpose: take a cmd line template and substitute in dates
according to handful of pr... | 27.969697 | 67 | 0.617551 | '''
This file contains helper functions
'''
from datetime import timedelta
def date_range(start_date, end_date):
'''
Name: dateRange
Input: start date
end date
Output: list of dates
Purpose: generate list of dates between start and end
'''
# now re... | 0 | 0 | 0 | 0 | 350 | 0 | 0 | 9 | 45 |
af36d94d0e2f8841d635ae23a80d8dd35597ddbb | 1,599 | py | Python | junn/io/file_lists.py | modsim/junn | a40423b98c6a3739dd0b2ba02d546a5db91f9215 | [
"BSD-2-Clause"
] | null | null | null | junn/io/file_lists.py | modsim/junn | a40423b98c6a3739dd0b2ba02d546a5db91f9215 | [
"BSD-2-Clause"
] | null | null | null | junn/io/file_lists.py | modsim/junn | a40423b98c6a3739dd0b2ba02d546a5db91f9215 | [
"BSD-2-Clause"
] | null | null | null | """File list helper functions."""
import re
def generate_glob_and_replacer(search, replace):
"""
Prepare a wildcard pattern for globbing and replacing.
:param search:
:param replace:
:return:
"""
replace = generate_replacer(search, replace)
glob_pattern = prepare_for_regex(search, tas... | 20.5 | 78 | 0.602251 | """File list helper functions."""
import re
def generate_glob_and_replacer(search, replace):
"""
Prepare a wildcard pattern for globbing and replacing.
:param search:
:param replace:
:return:
"""
replace = generate_replacer(search, replace)
glob_pattern = prepare_for_regex(search, tas... | 0 | 0 | 0 | 0 | 0 | 437 | 0 | 0 | 50 |
c26b922a65f29ea9d7b6686a72d16bf849a4f4ee | 1,625 | py | Python | money_bot/utils/markups.py | summer-school-2019/Money-bot | c74c4abb8a496a6423d9916e5bf8aeec23d191aa | [
"MIT"
] | 3 | 2019-08-19T13:01:12.000Z | 2019-10-11T06:38:03.000Z | money_bot/utils/markups.py | summer-school-2019/money-bot | c74c4abb8a496a6423d9916e5bf8aeec23d191aa | [
"MIT"
] | 27 | 2019-08-18T11:41:35.000Z | 2019-08-22T08:45:40.000Z | money_bot/utils/markups.py | summer-school-2019/Money-bot | c74c4abb8a496a6423d9916e5bf8aeec23d191aa | [
"MIT"
] | 1 | 2021-12-16T23:14:42.000Z | 2021-12-16T23:14:42.000Z | from aiogram.utils.callback_data import CallbackData
earn_factory = CallbackData("earn", "skip")
add_tasks_factory = CallbackData("add_tasks", "data")
| 36.931818 | 115 | 0.756308 | from aiogram import types
from aiogram.utils.callback_data import CallbackData
from money_bot.utils.strings import ADD_TASKS_MENU_TEXT, EARN_MENU_TEXT, MAIN_MENU_BUTTONS_LABELS
earn_factory = CallbackData("earn", "skip")
add_tasks_factory = CallbackData("add_tasks", "data")
def get_main_menu_markup():
btns_text... | 0 | 0 | 0 | 0 | 0 | 1,252 | 0 | 80 | 137 |
142d22661732ca16a783f0d30d8e3b370f328aab | 4,123 | py | Python | qa-webapp-tests/csv_importer/clean_up_records.py | cesarvh/qa-automation | 2bbdeda6f811e4bf40975658b3d8440cd3b4eff7 | [
"ECL-2.0"
] | null | null | null | qa-webapp-tests/csv_importer/clean_up_records.py | cesarvh/qa-automation | 2bbdeda6f811e4bf40975658b3d8440cd3b4eff7 | [
"ECL-2.0"
] | 25 | 2019-10-30T20:10:29.000Z | 2021-11-05T23:48:17.000Z | qa-webapp-tests/csv_importer/clean_up_records.py | cesarvh/qa-automation | 2bbdeda6f811e4bf40975658b3d8440cd3b4eff7 | [
"ECL-2.0"
] | 6 | 2019-02-20T17:16:42.000Z | 2020-07-08T22:46:33.000Z | import requests
import sys
import datetime
try:
from http.client import HTTPConnection
except ImportError:
requests.packages.urllib3.connectionpool.HTTPConnection = MyHTTPConnection
requests.packages.urllib3.connectionpool.HTTPConnectionPool.ConnectionCls = MyHTTPConnection
# HTTPS
requests.packages.urllib3.connec... | 34.940678 | 125 | 0.689061 | import requests
import regex as re
import sys
import socket
import ssl
import datetime
try:
from http.client import HTTPConnection
except ImportError:
from httplib import HTTPConnection
from requests.packages.urllib3.connection import VerifiedHTTPSConnection
class MyHTTPConnection(HTTPConnection):
def connect(s... | 0 | 0 | 0 | 484 | 0 | 1,716 | 0 | 42 | 202 |
03df7be861e0be415f21ea706784bc2090bdf90e | 2,170 | py | Python | lib/optim/build.py | pprp/pytorch-cifar-model-zoo | e7e68d8162a77aee2161bcd3cd70c20ddd7ef7ab | [
"MIT"
] | 23 | 2021-12-16T02:08:51.000Z | 2022-03-31T00:21:22.000Z | lib/optim/build.py | pprp/pytorch-cifar-tricks | e7e68d8162a77aee2161bcd3cd70c20ddd7ef7ab | [
"MIT"
] | 3 | 2021-12-26T13:28:01.000Z | 2022-03-21T08:31:15.000Z | lib/optim/build.py | pprp/pytorch-cifar-tricks | e7e68d8162a77aee2161bcd3cd70c20ddd7ef7ab | [
"MIT"
] | 5 | 2022-01-03T14:53:59.000Z | 2022-02-10T02:24:51.000Z | import torch.optim as optim
| 29.726027 | 77 | 0.531797 | import torch.optim as optim
from .adamw import AdamW
from .adabound import AdaBound, AdaBoundW
from .asam import SAM, ASAM
def build_optimizer(model, args):
if args.optims == "sgd":
optimizer = optim.SGD(
filter(lambda p: p.requires_grad, model.parameters()),
lr=args.lr,
... | 0 | 0 | 0 | 0 | 0 | 2,023 | 0 | 29 | 89 |
74b4a3f8850ece871caac28796759390364809f4 | 139 | py | Python | SAM2017/user_profile/urls.py | jpavelw/sam-2017 | 2f1eba1d8fc91bfc0c53483f46cc6d60fa6d00fd | [
"MIT"
] | 1 | 2016-08-31T16:49:17.000Z | 2016-08-31T16:49:17.000Z | SAM2017/user_profile/urls.py | jpavelw/sam-2017 | 2f1eba1d8fc91bfc0c53483f46cc6d60fa6d00fd | [
"MIT"
] | null | null | null | SAM2017/user_profile/urls.py | jpavelw/sam-2017 | 2f1eba1d8fc91bfc0c53483f46cc6d60fa6d00fd | [
"MIT"
] | null | null | null | from django.conf.urls import url
urlpatterns = [
url(r'^$', 'user_profile.views.profile', name="user_profile"),
]
| 19.857143 | 66 | 0.697842 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', 'user_profile.views.profile', name="user_profile"),
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | -2 | 22 |
99abbff041369ff47030a8e018bce680d7f202ed | 8,182 | py | Python | munimap/print_requests.py | MrSnyder/bielefeldGEOCLIENT | 17c78b43fc2055d23a1bc4b5091da164756bf767 | [
"Apache-2.0"
] | 2 | 2022-02-07T13:20:45.000Z | 2022-02-14T21:40:06.000Z | munimap/print_requests.py | MrSnyder/bielefeldGEOCLIENT | 17c78b43fc2055d23a1bc4b5091da164756bf767 | [
"Apache-2.0"
] | 4 | 2021-06-17T07:53:53.000Z | 2021-12-17T10:55:48.000Z | munimap/print_requests.py | MrSnyder/bielefeldGEOCLIENT | 17c78b43fc2055d23a1bc4b5091da164756bf767 | [
"Apache-2.0"
] | 2 | 2021-06-01T09:41:55.000Z | 2022-02-14T17:33:33.000Z | from __future__ import division
import re
import logging
log = logging.getLogger(__name__)
MISSING = object()
PRINT_NAME_REGEX = re.compile(r'^[0-9a-zA-Z_\.\-]+$')
| 32.859438 | 111 | 0.605353 | from __future__ import division
import re
from werkzeug.exceptions import BadRequest
from flask import current_app
from munimap.grid import Grid
import logging
log = logging.getLogger(__name__)
MISSING = object()
def parse_value(params, key, func, default=MISSING):
if default is MISSING:
# required ar... | 0 | 3,076 | 0 | 1,635 | 0 | 2,782 | 0 | 37 | 482 |
e0aeb69df014c9a6bb0944ae2d7d1e9033e4a4f8 | 5,632 | py | Python | Modules/Loadable/Plots/Testing/Python/PlotsSelfTest.py | forfullstack/slicersources-src | 91bcecf037a27f3fad4c0ab57e8286fc258bb0f5 | [
"Apache-2.0"
] | null | null | null | Modules/Loadable/Plots/Testing/Python/PlotsSelfTest.py | forfullstack/slicersources-src | 91bcecf037a27f3fad4c0ab57e8286fc258bb0f5 | [
"Apache-2.0"
] | null | null | null | Modules/Loadable/Plots/Testing/Python/PlotsSelfTest.py | forfullstack/slicersources-src | 91bcecf037a27f3fad4c0ab57e8286fc258bb0f5 | [
"Apache-2.0"
] | null | null | null |
#
# PlotsSelfTest
#
#
# PlotsSelfTestWidget
#
#
# PlotsSelfTestLogic
#
| 32.935673 | 115 | 0.68892 | import os
import unittest
import vtk, qt, ctk, slicer
from slicer.ScriptedLoadableModule import *
#
# PlotsSelfTest
#
class PlotsSelfTest(ScriptedLoadableModule):
def __init__(self, parent):
ScriptedLoadableModule.__init__(self, parent)
self.parent.title = "PlotsSelfTest"
self.parent.categories = ["Test... | 0 | 0 | 0 | 5,367 | 0 | 0 | 0 | 10 | 180 |
2f9e17e9664aad34733bd9fdd9f0df727ab36cda | 7,405 | py | Python | utils/toolkit.py | eLeVeNnN/fastorch | 7b73548b1b25c81dd41e4fc9cc7afb61bf8a5d2d | [
"MIT"
] | null | null | null | utils/toolkit.py | eLeVeNnN/fastorch | 7b73548b1b25c81dd41e4fc9cc7afb61bf8a5d2d | [
"MIT"
] | null | null | null | utils/toolkit.py | eLeVeNnN/fastorch | 7b73548b1b25c81dd41e4fc9cc7afb61bf8a5d2d | [
"MIT"
] | null | null | null | import torch.nn as nn
import torch.optim as optim
| 36.840796 | 124 | 0.520324 | import numpy as np
import torch.nn as nn
from torch.nn.modules.loss import _Loss
from torch.optim.optimizer import Optimizer
import torch.optim as optim
class ProgressBar(object):
def __init__(self,
max_iter: int = 1,
verbose: int = 1,
bar_nums: int = 20,
... | 0 | 0 | 0 | 1,990 | 0 | 5,093 | 0 | 37 | 227 |
c0a984092f028bc031c552bd5178bb8eb54691f9 | 5,494 | py | Python | corr/corr_load.py | cmolder/voyager-analysis | a44dcc4df88eaaa83e451eead39846c9eed985f4 | [
"MIT"
] | null | null | null | corr/corr_load.py | cmolder/voyager-analysis | a44dcc4df88eaaa83e451eead39846c9eed985f4 | [
"MIT"
] | null | null | null | corr/corr_load.py | cmolder/voyager-analysis | a44dcc4df88eaaa83e451eead39846c9eed985f4 | [
"MIT"
] | null | null | null | """Compute correlation between access history and next prefetch,
using load traces.
Need to run from above corr/ directory. If you still get an error,
try export PYTHONPATH=.
"""
import time
from utils.load import get_open_function
from utils.load_trace import get_instructions
from utils.logging import log_progress
... | 36.384106 | 106 | 0.638151 | """Compute correlation between access history and next prefetch,
using load traces.
Need to run from above corr/ directory. If you still get an error,
try export PYTHONPATH=.
"""
import argparse
import time
from utils.load import get_open_function
from utils.load_trace import get_instructions
from utils.logging impor... | 0 | 0 | 0 | 2,908 | 0 | 580 | 0 | -6 | 92 |
8b4addbb43fa421cea80cb0bfe023f54f404e3ad | 6,411 | py | Python | c_mock_generator/generate_mock.py | BjoernLange/C-Mock-Generator | 91f0e331abf54dc5b6706796c02341e23b2e06d7 | [
"MIT"
] | null | null | null | c_mock_generator/generate_mock.py | BjoernLange/C-Mock-Generator | 91f0e331abf54dc5b6706796c02341e23b2e06d7 | [
"MIT"
] | 3 | 2020-06-07T12:48:17.000Z | 2020-07-26T12:52:45.000Z | c_mock_generator/generate_mock.py | BjoernLange/C-Mock-Generator | 91f0e331abf54dc5b6706796c02341e23b2e06d7 | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
main()
| 34.842391 | 79 | 0.6545 | import argparse
import os
from typing import Iterable, Tuple, List, Optional
from .module_definition import Module, Method, ParameterDocumentation
from .module_definition.exceptions import MockGeneratorError
from .util import CodeBuilder, TemplateFormatter, read_lines
def line_starts_with_documentation(line: str) ->... | 0 | 162 | 0 | 3,253 | 0 | 2,470 | 0 | 137 | 340 |
3d0efe650cbfc962d3f0b737e1aa9610e7336754 | 15,627 | py | Python | tests/unit/threat_intel_downloader/test_main.py | opsbay/streamalert | 557fb3f604661cdd9bd36486cccc8ce3a34bd1f1 | [
"Apache-2.0"
] | null | null | null | tests/unit/threat_intel_downloader/test_main.py | opsbay/streamalert | 557fb3f604661cdd9bd36486cccc8ce3a34bd1f1 | [
"Apache-2.0"
] | 1 | 2018-08-08T03:26:58.000Z | 2018-08-08T03:26:58.000Z | tests/unit/threat_intel_downloader/test_main.py | opsbay/streamalert | 557fb3f604661cdd9bd36486cccc8ce3a34bd1f1 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2017-present, Airbnb 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 in writing, sof... | 41.34127 | 93 | 0.651949 | """
Copyright 2017-present, Airbnb 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 in writing, sof... | 0 | 14,385 | 0 | 0 | 0 | 0 | 0 | 384 | 289 |
ee62108b17d42c736856b8733f3ae4635f8dc080 | 596 | py | Python | qctests/EN_range_check.py | BillMills/AutoQC | cb56fa5bb2115170ec204edd84e2d69ce84be820 | [
"MIT"
] | 17 | 2015-01-31T00:35:58.000Z | 2020-10-26T19:01:46.000Z | qctests/EN_range_check.py | castelao/AutoQC | eb85422c1a6a5ff965a1ef96b3cb29240a66b506 | [
"MIT"
] | 163 | 2015-01-21T03:44:42.000Z | 2022-01-09T22:03:12.000Z | qctests/EN_range_check.py | BillMills/AutoQC | cb56fa5bb2115170ec204edd84e2d69ce84be820 | [
"MIT"
] | 11 | 2015-06-04T14:32:22.000Z | 2021-04-11T05:18:09.000Z | """
Implements the global range check used in the EN quality control
system.
"""
def test(p, parameters):
"""
Runs the quality control check on profile p and returns a numpy array
of quality control decisions with False where the data value has
passed the check and True where it failed.
"""
... | 24.833333 | 74 | 0.644295 | """
Implements the global range check used in the EN quality control
system.
"""
def test(p, parameters):
"""
Runs the quality control check on profile p and returns a numpy array
of quality control decisions with False where the data value has
passed the check and True where it failed.
"""
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
829dcf41a8949e0e449237d9b5a16d2d1449e4c8 | 6,241 | py | Python | threading_util/pausable_thread.py | SDRAST/support | ebe081692fc8c892c1389156e979d5baa7f8f0e6 | [
"Apache-2.0"
] | null | null | null | threading_util/pausable_thread.py | SDRAST/support | ebe081692fc8c892c1389156e979d5baa7f8f0e6 | [
"Apache-2.0"
] | null | null | null | threading_util/pausable_thread.py | SDRAST/support | ebe081692fc8c892c1389156e979d5baa7f8f0e6 | [
"Apache-2.0"
] | null | null | null | import logging
module_logger = logging.getLogger(__name__)
__all__ = ["iterativeRun", "Pause", "PausableThread", "PausableThreadCallback"]
def iterativeRun(run_fn):
"""
A decorator for running functions repeatedly inside a PausableThread.
Allows one to pause and stop the thread while its repeatedly calli... | 27.986547 | 100 | 0.571703 | import logging
import threading
import time
module_logger = logging.getLogger(__name__)
__all__ = ["iterativeRun", "Pause", "PausableThread", "PausableThreadCallback"]
def iterativeRun(run_fn):
"""
A decorator for running functions repeatedly inside a PausableThread.
Allows one to pause and stop the thre... | 0 | 0 | 0 | 5,319 | 0 | 280 | 0 | -15 | 139 |
861046f2185daf66208a051d17e44c2d4a82f4e2 | 1,013 | py | Python | python/bin/use_gene_id_for_missing_gene_names.py | jennomics/single-cell | 34c951511e2be071fe3a8e11511d8ff5de8f540f | [
"MIT"
] | 3 | 2020-11-14T02:19:34.000Z | 2022-03-09T17:00:52.000Z | python/bin/use_gene_id_for_missing_gene_names.py | jennomics/single-cell | 34c951511e2be071fe3a8e11511d8ff5de8f540f | [
"MIT"
] | 7 | 2020-06-02T18:51:13.000Z | 2021-07-08T22:48:45.000Z | python/bin/use_gene_id_for_missing_gene_names.py | jennomics/single-cell | 34c951511e2be071fe3a8e11511d8ff5de8f540f | [
"MIT"
] | 2 | 2021-04-21T17:19:10.000Z | 2021-05-22T14:26:13.000Z | #!/bin/env python3
"""
If gene name is simply totally missing, use the gene ID for the gene name.
(Don't confuse this with the case in which there is actualy a gene name
embeded in the gene id, for which you would want to use the utility
'extract_name_embedded_in_gene_id.py'.)
"""
# command line interface (making t... | 25.325 | 85 | 0.662389 | #!/bin/env python3
"""
If gene name is simply totally missing, use the gene ID for the gene name.
(Don't confuse this with the case in which there is actualy a gene name
embeded in the gene id, for which you would want to use the utility
'extract_name_embedded_in_gene_id.py'.)
"""
import argparse
import gtfez
def pa... | 0 | 0 | 0 | 0 | 0 | 551 | 0 | -15 | 91 |
22a2ab9b0ebf3d05d6af95bfe871d127bdeb4b36 | 1,334 | py | Python | model/Schedule.py | shionart/test_flask | f27477357bcfe939012f5a38523f238fa84de85b | [
"MIT",
"Unlicense"
] | 1 | 2021-07-22T14:57:31.000Z | 2021-07-22T14:57:31.000Z | model/Schedule.py | shionart/test_flask | f27477357bcfe939012f5a38523f238fa84de85b | [
"MIT",
"Unlicense"
] | null | null | null | model/Schedule.py | shionart/test_flask | f27477357bcfe939012f5a38523f238fa84de85b | [
"MIT",
"Unlicense"
] | null | null | null | from apscheduler.schedulers.background import BackgroundScheduler
# The "apscheduler." prefix is hard coded
scheduler = BackgroundScheduler({
'apscheduler.executors.default': {
'class': 'apscheduler.executors.pool:ThreadPoolExecutor',
'max_workers': '60'
},
'apscheduler.executors.processpo... | 32.536585 | 93 | 0.598951 | from model.Control import Control
from model.Sensor import Sensor
from apscheduler.schedulers.background import BackgroundScheduler
# The "apscheduler." prefix is hard coded
scheduler = BackgroundScheduler({
'apscheduler.executors.default': {
'class': 'apscheduler.executors.pool:ThreadPoolExecutor',
... | 0 | 0 | 0 | 763 | 0 | 0 | 0 | 22 | 66 |
28be2a632bb1b6e14ddbeb0afac9fa4520012efa | 390 | py | Python | archived/consoletest.py | CubeFlix/emos | 7f84100908e78384c82777ec3bee0cc1b130cefb | [
"MIT"
] | 1 | 2021-05-26T17:41:07.000Z | 2021-05-26T17:41:07.000Z | archived/consoletest.py | CubeFlix/emos | 7f84100908e78384c82777ec3bee0cc1b130cefb | [
"MIT"
] | null | null | null | archived/consoletest.py | CubeFlix/emos | 7f84100908e78384c82777ec3bee0cc1b130cefb | [
"MIT"
] | null | null | null | import os
size = os.get_terminal_size()
rows, cols = size.lines, size.columns
data_to_add = b'Hello, world!'
data = bytes((rows * cols) * b' ')
data = data_to_add + data[len(data_to_add) : ]
for row in range(rows):
start = row * cols
end = start + cols
write(str(data[start : end], 'utf-8'))
write('\n')
| 17.727273 | 46 | 0.666667 | import sys
import os
def write(string):
sys.stdout.write(string)
sys.stdout.flush()
size = os.get_terminal_size()
rows, cols = size.lines, size.columns
data_to_add = b'Hello, world!'
data = bytes((rows * cols) * b' ')
data = data_to_add + data[len(data_to_add) : ]
for row in range(rows):
start = row * cols
end... | 0 | 0 | 0 | 0 | 0 | 43 | 0 | -11 | 45 |
958f06b3471de3581f85d8b7924fb17c7793dd42 | 4,820 | py | Python | pricelist/models.py | WillieIlus/jobscorner | ed3734468ea0e88a306a1d29bc876562e940f4fb | [
"bzip2-1.0.6"
] | 2 | 2020-04-12T13:18:35.000Z | 2021-04-02T04:18:17.000Z | pricelist/models.py | WillieIlus/jobscorner | ed3734468ea0e88a306a1d29bc876562e940f4fb | [
"bzip2-1.0.6"
] | 3 | 2020-02-11T23:58:53.000Z | 2020-09-06T18:46:17.000Z | pricelist/models.py | WillieIlus/jobscorner | ed3734468ea0e88a306a1d29bc876562e940f4fb | [
"bzip2-1.0.6"
] | 1 | 2020-08-17T08:29:41.000Z | 2020-08-17T08:29:41.000Z | from __future__ import unicode_literals
# what this moddule does is displaying the price median price, minunum and maximum price and displaying the companies that offer the services
# it goes this way a model to display the activity and the prices
# what is the price of printing and a banner 1 meter squared on roland
... | 32.789116 | 141 | 0.681743 | from __future__ import unicode_literals
from builtins import super
import numpy as np
from django.db import models
from django.urls import reverse
from django.utils.text import slugify
# what this moddule does is displaying the price median price, minunum and maximum price and displaying the companies that offer the... | 0 | 0 | 0 | 3,812 | 0 | 0 | 0 | 74 | 293 |
9c7547f725e65ef0319f9a63015b38a4e864c966 | 2,138 | py | Python | tests/apps/minimal2/config/settings.py | blazelibs/blazeweb | b120a6a2e38c8b53da2b73443ff242e2d1438053 | [
"BSD-3-Clause"
] | null | null | null | tests/apps/minimal2/config/settings.py | blazelibs/blazeweb | b120a6a2e38c8b53da2b73443ff242e2d1438053 | [
"BSD-3-Clause"
] | 6 | 2016-11-01T18:42:34.000Z | 2020-11-16T16:52:14.000Z | tests/apps/minimal2/config/settings.py | blazelibs/blazeweb | b120a6a2e38c8b53da2b73443ff242e2d1438053 | [
"BSD-3-Clause"
] | 1 | 2020-01-22T18:20:46.000Z | 2020-01-22T18:20:46.000Z | from __future__ import print_function
from os import path
basedir = path.dirname(path.dirname(__file__))
app_package = path.basename(basedir)
| 23.494505 | 78 | 0.661366 | from __future__ import print_function
from os import path
from blazeweb.config import DefaultSettings
basedir = path.dirname(path.dirname(__file__))
app_package = path.basename(basedir)
class Default(DefaultSettings):
def init(self):
self.dirs.base = basedir
self.app_package = app_package
... | 0 | 0 | 0 | 1,734 | 0 | 0 | 0 | 22 | 230 |
0d33204beaccc33b5fa77749025dc9e04c89d176 | 2,955 | py | Python | TimeRange.py | SanthoshS20/Sudoku-Challenge | 2e7402c473b5c303e97bfa3535b6e46534bf1d0f | [
"Apache-2.0"
] | null | null | null | TimeRange.py | SanthoshS20/Sudoku-Challenge | 2e7402c473b5c303e97bfa3535b6e46534bf1d0f | [
"Apache-2.0"
] | null | null | null | TimeRange.py | SanthoshS20/Sudoku-Challenge | 2e7402c473b5c303e97bfa3535b6e46534bf1d0f | [
"Apache-2.0"
] | null | null | null | lines = []
with open('Time.txt') as f:
lines = f.readlines()
f.close()
total_lines = len(lines)
TimeTakenInDays = dict()
DifficultLevelInEachDays = dict()
day = 1
for index in range(total_lines):
if(index!=0):
difficultLevel, Time = lines[index].split(" ")
TimeTakenInDays["Day "+str(day-1)] = ... | 27.616822 | 85 | 0.607445 | lines = []
with open('Time.txt') as f:
lines = f.readlines()
f.close()
total_lines = len(lines)
TimeTakenInDays = dict()
DifficultLevelInEachDays = dict()
day = 1
for index in range(total_lines):
if(index!=0):
difficultLevel, Time = lines[index].split(" ")
TimeTakenInDays["Day "+str(day-1)] = ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
13732902169601c5b96f9035d2641c2704e3729a | 1,339 | py | Python | lambda/function/valueextraction/test_classes.py | LouisLoison/deepblooGit | 4691509acc252c887f428e693c72fa30d8f18a47 | [
"Apache-2.0"
] | null | null | null | lambda/function/valueextraction/test_classes.py | LouisLoison/deepblooGit | 4691509acc252c887f428e693c72fa30d8f18a47 | [
"Apache-2.0"
] | null | null | null | lambda/function/valueextraction/test_classes.py | LouisLoison/deepblooGit | 4691509acc252c887f428e693c72fa30d8f18a47 | [
"Apache-2.0"
] | null | null | null | import unittest
if __name__ == '__main__':
unittest.main()
| 34.333333 | 94 | 0.652726 | import unittest
from classes import *
class TestClassUnit(unittest.TestCase):
def setUp(self):
self.unit1 = Unit("kilowatt", "power")
self.unit2 = Unit("kW", "power")
def test_attributes(self):
"""Test whether the attributes were correctly assigned"""
# Test with unit full nam... | 0 | 0 | 0 | 1,204 | 0 | 0 | 0 | 0 | 68 |
5dc54e4673a11ed0255507be3766ee629180e1ed | 5,380 | py | Python | mmocr/datasets/base_dataset.py | yuexy/mmocr | 82488024db159266e66ea6b0d6f84a5a18e87362 | [
"Apache-2.0"
] | 2,261 | 2021-04-08T03:45:41.000Z | 2022-03-31T23:37:46.000Z | mmocr/datasets/base_dataset.py | yuexy/mmocr | 82488024db159266e66ea6b0d6f84a5a18e87362 | [
"Apache-2.0"
] | 789 | 2021-04-08T05:40:13.000Z | 2022-03-31T09:42:39.000Z | mmocr/datasets/base_dataset.py | yuexy/mmocr | 82488024db159266e66ea6b0d6f84a5a18e87362 | [
"Apache-2.0"
] | 432 | 2021-04-08T03:56:16.000Z | 2022-03-30T18:44:43.000Z | # Copyright (c) OpenMMLab. All rights reserved.
| 32.02381 | 75 | 0.569331 | # Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
from mmcv.utils import print_log
from mmdet.datasets.builder import DATASETS
from mmdet.datasets.pipelines import Compose
from torch.utils.data import Dataset
from mmocr.datasets.builder import build_loader
@DATASETS.register_module()
class BaseDatas... | 0 | 5,081 | 0 | 0 | 0 | 0 | 0 | 94 | 156 |
458e196363715df31a63162c01d08a23e0f42486 | 3,221 | py | Python | dvc/objects/diff.py | annmary-roy/dvc | eefede92b204084ad418ed300ac4eb480d696421 | [
"Apache-2.0"
] | null | null | null | dvc/objects/diff.py | annmary-roy/dvc | eefede92b204084ad418ed300ac4eb480d696421 | [
"Apache-2.0"
] | 66 | 2021-03-29T09:02:26.000Z | 2022-03-30T13:09:33.000Z | dvc/objects/diff.py | annmary-roy/dvc | eefede92b204084ad418ed300ac4eb480d696421 | [
"Apache-2.0"
] | null | null | null | from typing import TYPE_CHECKING
if TYPE_CHECKING:
ADD = "add"
MODIFY = "modify"
DELETE = "delete"
UNCHANGED = "unchanged"
ROOT = ("",)
| 23.683824 | 71 | 0.588327 | from dataclasses import dataclass, field
from typing import TYPE_CHECKING, List, Optional, Tuple
if TYPE_CHECKING:
from .file import HashFile
ADD = "add"
MODIFY = "modify"
DELETE = "delete"
UNCHANGED = "unchanged"
@dataclass
class TreeEntry:
in_cache: bool
key: Tuple[str]
obj: Optional["HashFile"] =... | 0 | 1,257 | 0 | 0 | 0 | 1,633 | 0 | 47 | 140 |
8ebf57f798435311aa471271c473c4df844dc059 | 1,143 | py | Python | setup.py | kngwyu/intrinsic-rewards | c2a8f98c0fd9292dc90f8857fa5ddb763ba8b994 | [
"Apache-2.0"
] | 8 | 2019-09-22T12:13:05.000Z | 2022-03-31T11:52:13.000Z | setup.py | kngwyu/intrinsic-rewards | c2a8f98c0fd9292dc90f8857fa5ddb763ba8b994 | [
"Apache-2.0"
] | 2 | 2019-07-29T08:57:28.000Z | 2019-11-29T10:35:35.000Z | setup.py | kngwyu/intrinsic-rewards | c2a8f98c0fd9292dc90f8857fa5ddb763ba8b994 | [
"Apache-2.0"
] | 1 | 2020-03-24T01:38:27.000Z | 2020-03-24T01:38:27.000Z | import io
import re
from setuptools import find_packages, setup
with io.open("int_rew/__init__.py", "rt", encoding="utf8") as f:
version = re.search(r"__version__ = \"(.*?)\"", f.read()).group(1)
setup(
name="intrinsic_rewards",
version=version,
url="https://github.com/kngwyu/intrinsic_rewards",
... | 32.657143 | 78 | 0.63692 | import io
import re
from setuptools import find_packages, setup
with io.open("int_rew/__init__.py", "rt", encoding="utf8") as f:
version = re.search(r"__version__ = \"(.*?)\"", f.read()).group(1)
setup(
name="intrinsic_rewards",
version=version,
url="https://github.com/kngwyu/intrinsic_rewards",
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f39d50bf7ed0edab4d1e0f39dcd916514d0e71d7 | 1,353 | py | Python | source/location/migrations/0001_initial.py | kssvrk/teletrack | ce8e1ce0fcb333875fd54d1a69a59f265c0e2396 | [
"BSD-3-Clause"
] | null | null | null | source/location/migrations/0001_initial.py | kssvrk/teletrack | ce8e1ce0fcb333875fd54d1a69a59f265c0e2396 | [
"BSD-3-Clause"
] | null | null | null | source/location/migrations/0001_initial.py | kssvrk/teletrack | ce8e1ce0fcb333875fd54d1a69a59f265c0e2396 | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 3.1.2 on 2020-10-17 14:58
import django.contrib.gis.db.models.fields
| 36.567568 | 120 | 0.604582 | # Generated by Django 3.1.2 on 2020-10-17 14:58
import django.contrib.gis.db.models.fields
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
n... | 0 | 0 | 0 | 1,163 | 0 | 0 | 0 | 30 | 67 |
55ab91521c1b171d35f42ae28297981c244edf1a | 735 | py | Python | Mundo2/Desafio069.py | Marcoakira/Desafios_Python_do_Curso_Guanabara | c49b774148a2232f8f3c21b83e3dc97610480757 | [
"MIT"
] | null | null | null | Mundo2/Desafio069.py | Marcoakira/Desafios_Python_do_Curso_Guanabara | c49b774148a2232f8f3c21b83e3dc97610480757 | [
"MIT"
] | null | null | null | Mundo2/Desafio069.py | Marcoakira/Desafios_Python_do_Curso_Guanabara | c49b774148a2232f8f3c21b83e3dc97610480757 | [
"MIT"
] | null | null | null | # Desafio069 quantas pessoas tem mais de 18, quantos homens, quantas mulheres com menos de 20.
maiorDeIdade = int()
homens = int()
mulheresMenor = int()
while True:
idade = int(input('Qual a idade? '))
sexo = input('M para masculino, e F para feminino ').strip().lower()
if idade > 18:
maiorDeIdad... | 28.269231 | 94 | 0.643537 | # Desafio069 quantas pessoas tem mais de 18, quantos homens, quantas mulheres com menos de 20.
maiorDeIdade = int()
homens = int()
mulheresMenor = int()
while True:
idade = int(input('Qual a idade? '))
sexo = input('M para masculino, e F para feminino ').strip().lower()
if idade > 18:
maiorDeIdad... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |