hexsha
stringlengths
40
40
size
int64
7
1.04M
ext
stringclasses
10 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
4
247
max_stars_repo_name
stringlengths
4
125
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
125
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
125
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.77
618k
max_line_length
int64
1
1.02M
alphanum_fraction
float64
0
1
original_content
stringlengths
7
1.04M
filtered:remove_function_no_docstring
int64
-102
942k
filtered:remove_class_no_docstring
int64
-354
977k
filtered:remove_delete_markers
int64
0
60.1k
ea4838d1b97595b551548482c1d2bb4259ba3a7e
8,103
py
Python
views/view.py
edchelstephens/django-rest-utils
15cee427149217d1e53384281894f91e9653b6b4
[ "BSD-3-Clause" ]
1
2022-02-20T01:37:25.000Z
2022-02-20T01:37:25.000Z
views/view.py
edchelstephens/django-rest-utils
15cee427149217d1e53384281894f91e9653b6b4
[ "BSD-3-Clause" ]
null
null
null
views/view.py
edchelstephens/django-rest-utils
15cee427149217d1e53384281894f91e9653b6b4
[ "BSD-3-Clause" ]
null
null
null
"""Module for views wrappers.""" from typing import Optional, List, Dict, Union from django.conf import settings from django.views.generic.base import View from django.http.response import JsonResponse, HttpResponse from rest_framework.views import APIView from rest_framework.response import Response from rest_fram...
31.165385
104
0.629273
"""Module for views wrappers.""" from typing import Optional, List, Dict, Union from django.conf import settings from django.views.generic.base import View from django.http.response import JsonResponse, HttpResponse from rest_framework.views import APIView from rest_framework.response import Response from rest_fram...
0
0
0
bf409a2f226a3e16369d3334f9022698965c2407
691
py
Python
setup.py
hulk-1/sublime-backup-cli
1508426c320d233ccf7639df75e2c9dbee8777bd
[ "Apache-2.0" ]
3
2019-07-16T05:21:53.000Z
2019-10-22T13:50:23.000Z
setup.py
hulk-1/sublime-backup-cli
1508426c320d233ccf7639df75e2c9dbee8777bd
[ "Apache-2.0" ]
1
2019-10-22T13:52:49.000Z
2019-10-22T13:52:49.000Z
setup.py
hulk-1/sublime-backup-cli
1508426c320d233ccf7639df75e2c9dbee8777bd
[ "Apache-2.0" ]
5
2019-10-22T13:50:24.000Z
2021-07-27T20:34:33.000Z
from setuptools import setup with open("README.md", "r") as fh: long_description = fh.read() setup( name='sublime-backup', version='0.3', py_modules=['cli'], author = 'nishantwrp', author_email = 'mittalnishant14@outlook.com', long_description=long_description, long_description_content...
27.64
86
0.657019
from setuptools import setup with open("README.md", "r") as fh: long_description = fh.read() setup( name='sublime-backup', version='0.3', py_modules=['cli'], author = 'nishantwrp', author_email = 'mittalnishant14@outlook.com', long_description=long_description, long_description_content...
0
0
0
5eb0eb9854fe86ca24d110dc547435616474b02a
4,919
py
Python
paneldata_pipeline/topics.py
ddionrails/data-pipeline
40ca8c1e5eaead6db8008a8fd5c589ea3ebaf7d2
[ "BSD-3-Clause" ]
null
null
null
paneldata_pipeline/topics.py
ddionrails/data-pipeline
40ca8c1e5eaead6db8008a8fd5c589ea3ebaf7d2
[ "BSD-3-Clause" ]
11
2019-08-28T15:13:46.000Z
2021-11-02T06:44:41.000Z
paneldata_pipeline/topics.py
ddionrails/data-pipeline
40ca8c1e5eaead6db8008a8fd5c589ea3ebaf7d2
[ "BSD-3-Clause" ]
null
null
null
"""Provides the functionality to create a topic tree JSON file.""" import json from pathlib import Path from typing import Any, Dict, List, Optional, TypedDict, Union import pandas LANGUAGES = dict(en="", de="_de") class LeafNode(TypedDict): """A Node referencing a Concept""" title: str key: str ty...
31.735484
90
0.589144
"""Provides the functionality to create a topic tree JSON file.""" import json from pathlib import Path from typing import Any, Dict, List, Optional, TypedDict, Union import pandas LANGUAGES = dict(en="", de="_de") class LeafNode(TypedDict): """A Node referencing a Concept""" title: str key: str ty...
3,468
739
154
6190c399878fa6349ae57d322b87254242345881
856
py
Python
cmdb/util/perms.py
6cloud/6cloud_cmdb
7e36eb6da13d10362c9812774ba3c82e82a76eec
[ "Apache-2.0" ]
1
2018-10-27T17:31:18.000Z
2018-10-27T17:31:18.000Z
cmdb/util/perms.py
6cloud/6cloud_cmdb
7e36eb6da13d10362c9812774ba3c82e82a76eec
[ "Apache-2.0" ]
2
2021-02-08T20:23:48.000Z
2021-06-10T20:42:56.000Z
cmdb/util/perms.py
6cloud/6cloud_cmdb
7e36eb6da13d10362c9812774ba3c82e82a76eec
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- from rest_framework.permissions import BasePermission, DjangoModelPermissions, DjangoObjectPermissions from system.models import User, Role
29.517241
102
0.725467
# -*- coding: utf-8 -*- from rest_framework.permissions import BasePermission, DjangoModelPermissions, DjangoObjectPermissions from system.models import User, Role class CustomPermission(BasePermission): def has_object_permission(self, request, view, obj): return request.username == obj def has_pe...
435
103
150
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
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']}
91
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...
393
0
23
60c94ed5f163fd983bec8804d12d89541e6a8831
1,397
py
Python
mao_era/management/commands/reparent_pages.py
kingsdigitallab/mao-django
79225212868f35d96d323ec8878bfd2ec9187978
[ "MIT" ]
null
null
null
mao_era/management/commands/reparent_pages.py
kingsdigitallab/mao-django
79225212868f35d96d323ec8878bfd2ec9187978
[ "MIT" ]
null
null
null
mao_era/management/commands/reparent_pages.py
kingsdigitallab/mao-django
79225212868f35d96d323ec8878bfd2ec9187978
[ "MIT" ]
null
null
null
from django.core.management.base import BaseCommand from django.db import transaction from ...models import (HomePage, ObjectBiographiesPage, ObjectBiographyPage, SourcePage, SourcesPage)
41.088235
76
0.604152
from django.core.management.base import BaseCommand from django.db import transaction from ...models import (HomePage, ObjectBiographiesPage, ObjectBiographyPage, SourcePage, SourcesPage) class Command(BaseCommand): help = 'Move all object biography pages and source pages under their ' \ ...
980
181
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 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...
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...
2,240
0
46
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.""" 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...
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...
0
0
0
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...
49,587
44,635
2,881
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 ...
5
0
22
5866eef41c41e230d1e5d244e9515821ab57b038
12,579
py
Python
okama/plots.py
servnk/okama
50232226437496aae67f98906c5c0634ee285cc7
[ "MIT" ]
null
null
null
okama/plots.py
servnk/okama
50232226437496aae67f98906c5c0634ee285cc7
[ "MIT" ]
null
null
null
okama/plots.py
servnk/okama
50232226437496aae67f98906c5c0634ee285cc7
[ "MIT" ]
null
null
null
import itertools from typing import List, Optional, Union from matplotlib import pyplot as plt from .asset_list import AssetList from .common.helpers import Float from .frontier.single_period import EfficientFrontier from .settings import default_ticker class Plots(AssetList): """ Plotting tools collection ...
39.806962
128
0.584546
import itertools from typing import List, Optional, Union from matplotlib import pyplot as plt from .asset_list import AssetList from .common.helpers import Float from .frontier.single_period import EfficientFrontier from .settings import default_ticker class Plots(AssetList): """ Plotting tools collection ...
516
0
54
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 import glob import os import pandas as pd
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]']...
1,174
-9
107
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 """ import os import requests 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(...
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...
646
0
23
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 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...
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...
408
0
23
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 from django_medusa.renderers import DiskStaticSiteRenderer # Project imports from statify.models import URL
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: ...
147
22
49
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
import pysam from CigarIterator import CigarIterator, appendOrInc 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: ...
818
0
23
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 """ 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 sample_inputs_for(self, spect, sigma=1....
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...
3,013
0
106
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
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...
204
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 from datetime imp...
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
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 ...
10,719
1,561
46
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``.""" 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 ...
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 ...
146
1,221
23
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
c0d79cf9add0c3046e65ed825aa8c5eb35aeb539
1,172
py
Python
bvc/models/treasury.py
Vayel/GUCEM-BVC
e5645dec332756d3c9db083abf2c8f3625a10d4d
[ "WTFPL" ]
2
2016-09-23T18:02:40.000Z
2017-04-28T18:35:59.000Z
bvc/models/treasury.py
Vayel/GUCEM-BVC
e5645dec332756d3c9db083abf2c8f3625a10d4d
[ "WTFPL" ]
82
2016-09-26T14:38:31.000Z
2018-02-12T18:47:12.000Z
bvc/models/treasury.py
Vayel/GUCEM-BVC
e5645dec332756d3c9db083abf2c8f3625a10d4d
[ "WTFPL" ]
null
null
null
from django.db import models from django.core.exceptions import ObjectDoesNotExist
25.478261
86
0.693686
from django.db import models from django.core.exceptions import ObjectDoesNotExist def get_previous_treasury(id_): try: return TreasuryOperation.objects.get(id=id_-1).stock except ObjectDoesNotExist: return 0 def get_treasury(): try: return TreasuryOperation.objects.latest('id')....
543
454
92
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
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
fa279acec731fd90c91aff4d02f5d936763c2cc8
6,825
py
Python
robot_ws/src/robot_bringup/launch/nsra_moveit.launch.py
NS-Robotics/NSRA2
86dbd504ed268fa951c61b010924bea6faff5a43
[ "BSD-3-Clause" ]
null
null
null
robot_ws/src/robot_bringup/launch/nsra_moveit.launch.py
NS-Robotics/NSRA2
86dbd504ed268fa951c61b010924bea6faff5a43
[ "BSD-3-Clause" ]
null
null
null
robot_ws/src/robot_bringup/launch/nsra_moveit.launch.py
NS-Robotics/NSRA2
86dbd504ed268fa951c61b010924bea6faff5a43
[ "BSD-3-Clause" ]
null
null
null
import os import yaml from launch import LaunchDescription from launch_ros.actions import Node from launch.actions import ExecuteProcess, DeclareLaunchArgument from launch.substitutions import Command, FindExecutable, LaunchConfiguration, PathJoinSubstitution from ament_index_python.packages import get_package_share_di...
31.597222
325
0.619487
import os import yaml from launch import LaunchDescription from launch_ros.actions import Node from launch.actions import ExecuteProcess, DeclareLaunchArgument from launch.substitutions import Command, FindExecutable, LaunchConfiguration, PathJoinSubstitution from ament_index_python.packages import get_package_share_di...
6,326
0
69
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...
2,543
0
211
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
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 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")
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...
684
0
22
668d543614e31bc7e1ee6ac14f929debe3906495
916
py
Python
localization/apps.py
establishment/django-establishment
ad1d04fe9efc748e2fba5b4bc67446d2a4cf12f6
[ "CC0-1.0" ]
1
2017-04-27T19:35:42.000Z
2017-04-27T19:35:42.000Z
localization/apps.py
establishment/django-establishment
ad1d04fe9efc748e2fba5b4bc67446d2a4cf12f6
[ "CC0-1.0" ]
null
null
null
localization/apps.py
establishment/django-establishment
ad1d04fe9efc748e2fba5b4bc67446d2a4cf12f6
[ "CC0-1.0" ]
null
null
null
from django.apps import AppConfig from django.conf import settings
29.548387
89
0.724891
from django.apps import AppConfig from django.conf import settings def ensure_default_language(): from .models import Language try: Language.objects.get(id=1) except Exception: try: Language.objects.create(name="English", local_name="English", iso_code="eng") except Exc...
692
85
69
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...
956
0
54
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...
4,240
0
92
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 -*- 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...
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
0
0
a4f449361d04f73e246062e6808f58b5fa4c8ccd
1,083
py
Python
oelint_adv/rule_base/rule_vars_bbclassextends.py
skycaptain/oelint-adv
ff67d3149cf8b1de2b0b2d158a68f4e2cf5e9e46
[ "BSD-2-Clause" ]
null
null
null
oelint_adv/rule_base/rule_vars_bbclassextends.py
skycaptain/oelint-adv
ff67d3149cf8b1de2b0b2d158a68f4e2cf5e9e46
[ "BSD-2-Clause" ]
null
null
null
oelint_adv/rule_base/rule_vars_bbclassextends.py
skycaptain/oelint-adv
ff67d3149cf8b1de2b0b2d158a68f4e2cf5e9e46
[ "BSD-2-Clause" ]
null
null
null
from oelint_adv.cls_rule import Rule from oelint_parser.cls_item import Variable
41.653846
114
0.588181
from oelint_adv.cls_rule import Rule from oelint_parser.cls_item import Variable class VarBbclassextend(Rule): def __init__(self): super().__init__(id='oelint.var.bbclassextend', severity='info', message='BBCLASSEXTEND should be set if possible') def ...
917
8
76
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 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...
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
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 """ 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...
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...
154
0
108
64128d742c77eb39ea55a053c783a5b7068a25bc
1,071
py
Python
services/core/VolttronCentral/volttroncentral/resource_directory.py
Entek-Technical-Services/BEMOSS3.5
581a205b4129530474a5ceee93cb36ef62992d4c
[ "BSD-3-Clause" ]
73
2017-07-11T21:46:41.000Z
2022-03-11T03:35:25.000Z
services/core/VolttronCentral/volttroncentral/resource_directory.py
Entek-Technical-Services/BEMOSS3.5
581a205b4129530474a5ceee93cb36ef62992d4c
[ "BSD-3-Clause" ]
19
2017-10-10T22:06:15.000Z
2022-03-28T21:03:33.000Z
services/core/VolttronCentral/volttroncentral/resource_directory.py
Entek-Technical-Services/BEMOSS3.5
581a205b4129530474a5ceee93cb36ef62992d4c
[ "BSD-3-Clause" ]
36
2017-06-24T00:17:03.000Z
2022-03-31T13:58:36.000Z
import contextlib import os import shelve from .registry import PlatformRegistry
26.775
71
0.580766
import contextlib import os import shelve from .registry import PlatformRegistry class ResourceDirectory: def __init__(self): self._datafile = os.path.join(os.environ['VOLTTRON_HOME'], 'data/resources.shelve') def save_object(key, data): if not i...
892
71
23
df580d90dc51102943202cb2497c0b87fabad9ff
4,352
py
Python
papi_sdk/models/hotel_info.py
stanislav-losev/papi-sdk-python
4a296745d626ef13c6d1170e9d3569cb1c37eb3c
[ "MIT" ]
1
2020-12-30T13:06:41.000Z
2020-12-30T13:06:41.000Z
papi_sdk/models/hotel_info.py
stanislav-losev/papi-sdk-python
4a296745d626ef13c6d1170e9d3569cb1c37eb3c
[ "MIT" ]
2
2021-01-18T07:57:29.000Z
2021-06-23T11:04:14.000Z
papi_sdk/models/hotel_info.py
stanislav-losev/papi-sdk-python
4a296745d626ef13c6d1170e9d3569cb1c37eb3c
[ "MIT" ]
3
2020-12-30T13:09:45.000Z
2020-12-30T13:42:33.000Z
from datetime import time from typing import List, Optional from pydantic import BaseModel, Field from papi_sdk.models.base import BaseResponse
21.229268
56
0.700827
from datetime import time from typing import List, Optional from pydantic import BaseModel, Field from papi_sdk.models.base import BaseResponse class HotelInfoRequest(BaseModel): id: str language: str class AmenityGroup(BaseModel): amenities: List[str] group_name: Optional[str] class Description...
0
3,630
552
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 import os driver = webdriver.PhantomJS() #driver = webdriver.Firefox(executable_path='/usr/local/bin/geckodriver') driver.get('https://gw.ict.ac.cn/srun_porta...
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
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...
2,273
0
81
d0c0672955a392d3debf27ac64849b0b73eb088c
1,422
py
Python
dummyapis/views.py
chYash/Testing-Api
bf7e8035f81c723496f1a6adddeab0bfeb2752c5
[ "MIT" ]
null
null
null
dummyapis/views.py
chYash/Testing-Api
bf7e8035f81c723496f1a6adddeab0bfeb2752c5
[ "MIT" ]
null
null
null
dummyapis/views.py
chYash/Testing-Api
bf7e8035f81c723496f1a6adddeab0bfeb2752c5
[ "MIT" ]
null
null
null
from django.shortcuts import render from rest_framework.decorators import api_view from django.http import HttpResponse, JsonResponse from django.views.decorators.csrf import csrf_exempt from rest_framework import status from rest_framework.response import Response from .models import * from .serializers import * from...
30.255319
64
0.81083
from django.shortcuts import render from rest_framework.decorators import api_view from django.http import HttpResponse, JsonResponse from django.views.decorators.csrf import csrf_exempt from rest_framework import status from rest_framework.response import Response from .models import * from .serializers import * from...
162
428
92
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)
9
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>` ...
6,819
0
587
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
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 -*- from datetime import datetime import ruamel.yaml
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,...
913
176
230
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, 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') @auth.route('/signup', methods=['POST']) @ auth.route('/login') @ auth.route('/login'...
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=['...
701
0
110
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
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" \ ...
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" \ ...
1,687
0
23
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
import json try: from urllib.request import urlopen, Request except ImportError: from urllib2 import urlopen, Request
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:...
813
0
23
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 ''' import heapq 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): ...
384
2
265
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
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
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...
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...
1,207
0
23
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
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
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 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 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...
2,062
23
77
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
import time import pytest from pyprofile import profile @pytest.fixture def test_profile_decorator(dump_dir): """Only test if the profile decorator is written correctly. """ @profile(dump_dir=dump_dir) @profile() assert fn() == 2, "fn with no parameters failed." assert fn_with_parameters...
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...
192
0
74
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
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 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(): "...
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(): "...
3,514
11
239
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 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...
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...
28,463
588
115
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""" import argparse import subprocess import re import nagiosplugin @nagiosplugin.guarded 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...
2,346
202
248
ff2d1f827478a4d9ae39c3a2e96d1f21adbc1562
11,659
py
Python
fedn/fedn/clients/reducer/plots.py
jadali17/fedn
00c622388e6b59b23ff09754650b4897791d8a9f
[ "Apache-2.0" ]
1
2021-01-16T03:05:23.000Z
2021-01-16T03:05:23.000Z
fedn/fedn/clients/reducer/plots.py
jadali17/fedn
00c622388e6b59b23ff09754650b4897791d8a9f
[ "Apache-2.0" ]
null
null
null
fedn/fedn/clients/reducer/plots.py
jadali17/fedn
00c622388e6b59b23ff09754650b4897791d8a9f
[ "Apache-2.0" ]
1
2021-01-16T03:05:38.000Z
2021-01-16T03:05:38.000Z
import pymongo import json import numpy import plotly.graph_objs as go from datetime import datetime,timedelta import plotly import os from fedn.common.storage.db.mongo import connect_to_mongodb
35.012012
109
0.53641
import pymongo import json import numpy import plotly.graph_objs as go from datetime import datetime,timedelta import plotly import os from fedn.common.storage.db.mongo import connect_to_mongodb class Plot: def __init__(self): try: self.mdb = connect_to_mongodb() self.alliance = se...
10,725
716
23
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 ...
0
0
0
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 ...
1,264
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 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...
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...
0
0
0
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
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,...
10,435
0
907
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...
2,330
0
69
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 from django.db import migrations, models
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
291
23
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. """ import copy thisFont = Glyphs.font # frontmost font master_ids = [master.id for master in thisFont.masters] # al...
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...
404
0
23
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 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...
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...
32,063
0
440
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 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...
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...
14,069
0
273
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 import math # Libs import numpy as np # Pytorch module import torch.nn as nn import torch.nn.functional as F import torch """ class Decoder(nn....
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
6,997
25
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. """ from pylex.config.lexer_config import LexerConfig from pylex.config.token_defination imp...
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...
323
0
72
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 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...
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...
11,842
499
119
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...
425
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, 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): ...
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): ...
557
0
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
55265cd62cce242431d5c3e9243ad98fc1719413
904
py
Python
bookmarks/actions/models.py
mp5maker/django
a2d38e2e9973e755afce1bd0ccb17e58f3db7e33
[ "MIT" ]
null
null
null
bookmarks/actions/models.py
mp5maker/django
a2d38e2e9973e755afce1bd0ccb17e58f3db7e33
[ "MIT" ]
13
2020-02-12T00:14:20.000Z
2022-02-10T08:46:42.000Z
bookmarks/actions/models.py
mp5maker/django
a2d38e2e9973e755afce1bd0ccb17e58f3db7e33
[ "MIT" ]
null
null
null
from django.db import models from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.fields import GenericForeignKey
23.179487
64
0.643805
from django.db import models from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.fields import GenericForeignKey class Action(models.Model): user = models.ForeignKey( User, related_name="actions", db_inde...
0
681
23
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
from typing import List 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...
1,450
-6
49
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 : import tensorflow as tf from .nets.efficientnet import EfficientNetB0, EfficientNetB1, EfficientNetB2, EfficientNetB3 from .nets.effi...
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...
4,699
0
46
28343120a82f0ad353610fd53956f8cb3bf271dc
1,008
py
Python
Groups/Group_ID_6/SIFT_and_RESIFT/Code_files/sift.py
sonaldangi12/DataScience
3d7cd529a96f37c2ef179ee408e2c6d8744d746a
[ "MIT" ]
5
2020-12-13T07:53:22.000Z
2020-12-20T18:49:27.000Z
Groups/Group_ID_6/SIFT_and_RESIFT/Code_files/sift.py
Gulnaz-Tabassum/DataScience
1fd771f873a9bc0800458fd7c05e228bb6c4e8a0
[ "MIT" ]
null
null
null
Groups/Group_ID_6/SIFT_and_RESIFT/Code_files/sift.py
Gulnaz-Tabassum/DataScience
1fd771f873a9bc0800458fd7c05e228bb6c4e8a0
[ "MIT" ]
24
2020-12-12T11:23:28.000Z
2021-10-04T13:09:38.000Z
from libs import *
56
128
0.779762
from libs import * def SIFT_algo(training_image,training_gray,test_image,test_gray): #test_gray = cv2.cvtColor(test_image, cv2.COLOR_RGB2GRAY) #training_gray = cv2.cvtColor(training_image, cv2.COLOR_RGB2GRAY) # Creating SIFT Object sift = cv2.SIFT_create() # Detecting features ...
967
0
22
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
from PygameFloatObjects.objects import * # 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...
2,967
0
46
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.properties import ListProperty from kivy.lang import Builder from kivy.uix.effectwidget import EffectWidget, Advance...
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...
527
119
126
4d0ed4ed46b2081c3bacc309febdc41a216b030d
718
py
Python
tests/fraction_tests/test_lt.py
lycantropos/rithm
61ae1614411ab0ce7feb403fdf93b71f49231ec1
[ "MIT" ]
null
null
null
tests/fraction_tests/test_lt.py
lycantropos/rithm
61ae1614411ab0ce7feb403fdf93b71f49231ec1
[ "MIT" ]
null
null
null
tests/fraction_tests/test_lt.py
lycantropos/rithm
61ae1614411ab0ce7feb403fdf93b71f49231ec1
[ "MIT" ]
null
null
null
from typing import Union from hypothesis import given from tests.utils import (FractionWithBuiltin, IntWithBuiltin, equivalence) from . import strategies @given(strategies.fractions_with_builtins, strategies.fractions_or_ints_with_builtins)
34.190476
77
0.651811
from typing import Union from hypothesis import given from tests.utils import (FractionWithBuiltin, IntWithBuiltin, equivalence) from . import strategies @given(strategies.fractions_with_builtins, strategies.fractions_or_ints_with_builtins) def test_connectio...
394
0
22
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 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...
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...
9,716
49
532
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 bytes, chr from builtins import str from builtins import dict from builtins import object from builtins import range from builtins import map ...
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
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...
2,000
240
46
03356f01967a8b617450e2beff23d2006d513315
2,427
py
Python
tests/test_signal.py
julienbourdeau/algoliasearch-django
885c9f1af4a70ce544709e3968120d2ab839df68
[ "MIT" ]
null
null
null
tests/test_signal.py
julienbourdeau/algoliasearch-django
885c9f1af4a70ce544709e3968120d2ab839df68
[ "MIT" ]
null
null
null
tests/test_signal.py
julienbourdeau/algoliasearch-django
885c9f1af4a70ce544709e3968120d2ab839df68
[ "MIT" ]
null
null
null
import time from django.test import TestCase from algoliasearch_django import algolia_engine from algoliasearch_django import get_adapter from algoliasearch_django import register from algoliasearch_django import unregister from algoliasearch_django import raw_search from algoliasearch_django import clear_index from ...
36.772727
79
0.685208
import time from django.test import TestCase from algoliasearch_django import algolia_engine from algoliasearch_django import get_adapter from algoliasearch_django import register from algoliasearch_django import unregister from algoliasearch_django import raw_search from algoliasearch_django import clear_index from ...
1,806
205
23
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
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...
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...
1,283
0
235
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...
786
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 ''' 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...
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
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...
437
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 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")
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...
1,252
0
92
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 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 requests.packages.urllib3.connectionpool.HTTPConnection =...
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...
2,102
46
143
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 from .adamw import AdamW from .adabound import AdaBound, AdaBoundW from .asam import SAM, ASAM
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, ...
2,023
0
23
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 from . import views 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
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 from werkzeug.exceptions import BadRequest from flask import current_app from munimap.grid import Grid 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...
7,147
346
414
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
import os import unittest import vtk, qt, ctk, slicer from slicer.ScriptedLoadableModule import * # # PlotsSelfTest # # # PlotsSelfTestWidget # # # PlotsSelfTestLogic # class PlotsSelfTestLogic(ScriptedLoadableModuleLogic): """This class should implement all the actual computation done by your module. The inte...
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...
4,036
58
238