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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ba6fce0160df84d020fba5eefe2c1e098cea01b2 | 2,452 | py | Python | athletes/migrations/0005_auto_20150726_1356.py | shermanng10/superathletebuilder | dbaf98d5bbb5d93575985a89f244d1732b16c7bc | [
"MIT"
] | null | null | null | athletes/migrations/0005_auto_20150726_1356.py | shermanng10/superathletebuilder | dbaf98d5bbb5d93575985a89f244d1732b16c7bc | [
"MIT"
] | null | null | null | athletes/migrations/0005_auto_20150726_1356.py | shermanng10/superathletebuilder | dbaf98d5bbb5d93575985a89f244d1732b16c7bc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.utils.timezone import utc
| 37.723077 | 130 | 0.600326 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('athletes', '0004_auto_20150726_1354'),
]
operations = [
migrations.Add... | 0 | 2,268 | 23 |
b4c979b1a85f9d3c76e877cf4bee69447f6ed157 | 13,689 | py | Python | pandasdmx/util.py | aboddie/pandaSDMX | 224bf7c86ca159628e0087c8041be6cf9228f4c5 | [
"Apache-2.0"
] | null | null | null | pandasdmx/util.py | aboddie/pandaSDMX | 224bf7c86ca159628e0087c8041be6cf9228f4c5 | [
"Apache-2.0"
] | null | null | null | pandasdmx/util.py | aboddie/pandaSDMX | 224bf7c86ca159628e0087c8041be6cf9228f4c5 | [
"Apache-2.0"
] | null | null | null | import logging
import typing
from collections.abc import Iterator
from enum import Enum
from functools import lru_cache
from typing import Any, Dict, Mapping, Tuple, TypeVar, Union
import pydantic
import requests
from pydantic import Field, ValidationError, validator
from pydantic.class_validators import make_generic_... | 31.6875 | 88 | 0.614508 | import logging
import typing
from collections.abc import Iterator
from enum import Enum
from functools import lru_cache
from typing import Any, Dict, Mapping, Tuple, TypeVar, Union
import pydantic
import requests
from pydantic import Field, ValidationError, validator
from pydantic.class_validators import make_generic_... | 870 | 136 | 240 |
f2351bf4bc6d8fdde57423269322066f1bdce93c | 4,026 | py | Python | SLpackage/private/pacbio/pythonpkgs/pysiv2/lib/python2.7/site-packages/pysiv2/custom/test_mapping_stats.py | fanglab/6mASCOPE | 3f1fdcb7693ff152f17623ce549526ec272698b1 | [
"BSD-3-Clause"
] | 5 | 2022-02-20T07:10:02.000Z | 2022-03-18T17:47:53.000Z | SLpackage/private/pacbio/pythonpkgs/pysiv2/lib/python2.7/site-packages/pysiv2/custom/test_mapping_stats.py | fanglab/6mASCOPE | 3f1fdcb7693ff152f17623ce549526ec272698b1 | [
"BSD-3-Clause"
] | null | null | null | SLpackage/private/pacbio/pythonpkgs/pysiv2/lib/python2.7/site-packages/pysiv2/custom/test_mapping_stats.py | fanglab/6mASCOPE | 3f1fdcb7693ff152f17623ce549526ec272698b1 | [
"BSD-3-Clause"
] | null | null | null |
"""
Test report metrics for a mapping job.
"""
import unittest
import logging
import numpy
from pbcore.io import AlignmentSet, ConsensusAlignmentSet
from pbcommand.models import FileTypes
from pysiv2.custom.base import TestReportStatistics, setUpFindAlignments
log = logging.getLogger(__name__)
class TestMapping... | 39.087379 | 93 | 0.640338 |
"""
Test report metrics for a mapping job.
"""
import unittest
import logging
import numpy
from pbcore.io import AlignmentSet, ConsensusAlignmentSet
from pbcommand.models import FileTypes
from pysiv2.custom.base import TestReportStatistics, setUpFindAlignments
log = logging.getLogger(__name__)
class TestMapping... | 75 | 0 | 27 |
7d85f5c4d7d7a95c065cd6ae12589c977c5172ae | 2,809 | py | Python | src/CalculatorTests.py | krishnaeleti/travisbuildtestforcalc | 21b205e1faa7bc2b8c52b471d11bcd791f55c309 | [
"MIT"
] | null | null | null | src/CalculatorTests.py | krishnaeleti/travisbuildtestforcalc | 21b205e1faa7bc2b8c52b471d11bcd791f55c309 | [
"MIT"
] | null | null | null | src/CalculatorTests.py | krishnaeleti/travisbuildtestforcalc | 21b205e1faa7bc2b8c52b471d11bcd791f55c309 | [
"MIT"
] | null | null | null | import unittest
from Calculator import Calculator
from CsvReader import CsvReader
from pprint import pprint
if __name__ == '__main__':
unittest.main()
| 42.560606 | 108 | 0.683161 | import unittest
from Calculator import Calculator
from CsvReader import CsvReader
from pprint import pprint
class MyTestCase(unittest.TestCase):
def setUp(self) -> None:
self.calculator = Calculator()
def test_instantiate_calculator(self):
self.assertIsInstance(self.calculator, Calculator)
... | 2,343 | 15 | 293 |
c7898babfcac022cdb9e50aff522d71e64fa290b | 17,984 | py | Python | elevenclock/lang/lang_sv.py | npsand/ElevenClock | 1663a0be7c1f2cb0bafc5d1e1a71083ac6348c80 | [
"Apache-2.0"
] | null | null | null | elevenclock/lang/lang_sv.py | npsand/ElevenClock | 1663a0be7c1f2cb0bafc5d1e1a71083ac6348c80 | [
"Apache-2.0"
] | null | null | null | elevenclock/lang/lang_sv.py | npsand/ElevenClock | 1663a0be7c1f2cb0bafc5d1e1a71083ac6348c80 | [
"Apache-2.0"
] | null | null | null | # INSTRUCTIONS
# Translate the text and write it between the "
# EXAMPLE: original -> "This text is in english: value {0}"
# translation -> "Aquest text està en anglès: valor {0}"
# So it would look like: "ORIGINAL_TEXT" : "TRANSLATED_TEXT",
# If you see sth like {0}, {1}, maintain it on th... | 63.77305 | 340 | 0.662978 | # INSTRUCTIONS
# Translate the text and write it between the "
# EXAMPLE: original -> "This text is in english: value {0}"
# translation -> "Aquest text està en anglès: valor {0}"
# So it would look like: "ORIGINAL_TEXT" : "TRANSLATED_TEXT",
# If you see sth like {0}, {1}, maintain it on th... | 0 | 0 | 0 |
e0b86ec8638677da4750164aa1a69d48931c8c6b | 343 | py | Python | py/builtin/testing/test_set.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | 1 | 2019-05-27T00:58:46.000Z | 2019-05-27T00:58:46.000Z | py/builtin/testing/test_set.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | null | null | null | py/builtin/testing/test_set.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | null | null | null | # some small tests to see whether sets are there and work
from py.builtin import set, frozenset
| 22.866667 | 57 | 0.586006 | # some small tests to see whether sets are there and work
from py.builtin import set, frozenset
def test_simple():
s = set([1, 2, 3, 4])
assert s == set([3, 4, 2, 1])
s1 = s.union(set([5, 6]))
assert 5 in s1
assert 1 in s1
def test_frozenset():
s = set([frozenset([0, 1]), frozenset([1, 0])])
... | 200 | 0 | 46 |
3d20dcda26b226fce3faed4077727e57f3460cb2 | 224 | py | Python | settings/constants.py | MykhaiIo/heart-attention | 44d4760bd3f571e5080c25156d53ac5cc57921af | [
"MIT"
] | null | null | null | settings/constants.py | MykhaiIo/heart-attention | 44d4760bd3f571e5080c25156d53ac5cc57921af | [
"MIT"
] | null | null | null | settings/constants.py | MykhaiIo/heart-attention | 44d4760bd3f571e5080c25156d53ac5cc57921af | [
"MIT"
] | null | null | null | import os
DATA_FOLDER = 'data'
TRAIN_CSV = os.path.join(DATA_FOLDER, 'train.csv')
VAL_CSV = os.path.join(DATA_FOLDER, 'val.csv')
MODEL_FOLDER = 'models'
SAVED_ESTIMATOR = os.path.join(MODEL_FOLDER, 'LGBMClassifier.pickle') | 28 | 69 | 0.758929 | import os
DATA_FOLDER = 'data'
TRAIN_CSV = os.path.join(DATA_FOLDER, 'train.csv')
VAL_CSV = os.path.join(DATA_FOLDER, 'val.csv')
MODEL_FOLDER = 'models'
SAVED_ESTIMATOR = os.path.join(MODEL_FOLDER, 'LGBMClassifier.pickle') | 0 | 0 | 0 |
27aa8358b400b7cfd05aa44cb4fa8afb3e2f30d6 | 3,303 | py | Python | main.py | AlfredoCU/Classifications | 12d168c391029d104e56109bb5f54555aaff8f0c | [
"MIT"
] | null | null | null | main.py | AlfredoCU/Classifications | 12d168c391029d104e56109bb5f54555aaff8f0c | [
"MIT"
] | null | null | null | main.py | AlfredoCU/Classifications | 12d168c391029d104e56109bb5f54555aaff8f0c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Nov 8 19:23:20 2020
@author: alfredocu
"""
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklear... | 32.70297 | 105 | 0.64063 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Nov 8 19:23:20 2020
@author: alfredocu
"""
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklear... | 0 | 0 | 0 |
fafef9b84f9edcbac5e06dbb9431d7c3761ad75b | 7,928 | py | Python | im_lib_test.py | erinmrichards/SG_enrichment | 4d3f1baa17928c358d6fe2b598d9f74949111b27 | [
"MIT"
] | 1 | 2021-12-15T06:37:50.000Z | 2021-12-15T06:37:50.000Z | im_lib_test.py | erinmrichards/SG_enrichment | 4d3f1baa17928c358d6fe2b598d9f74949111b27 | [
"MIT"
] | null | null | null | im_lib_test.py | erinmrichards/SG_enrichment | 4d3f1baa17928c358d6fe2b598d9f74949111b27 | [
"MIT"
] | 1 | 2021-12-15T06:37:04.000Z | 2021-12-15T06:37:04.000Z | import unittest
import im_lib
import numpy
#class CountObjectsTest(unittest.TestCase):
#@classmethod
#def setUpClass(clc):
#print("\nRunning CountObjects class setUp...")
#@classmethod
#def tearDownClass(clc):
#print("\nRunning CountObjects class tearDown...")
#def setUp(sel... | 33.451477 | 95 | 0.661075 | import unittest
import im_lib
import numpy
class MaskObjectTest(unittest.TestCase):
@classmethod
def setUpClass(clc):
print("\nRunning MaskObject class setUp...")
@classmethod
def tearDownClass(clc):
print("\nRunning MaskObject class tearDown...")
def setUp(self):
print(... | 6,061 | 1,243 | 115 |
64ce2f8c12afd6cf2ef40cf1b31a965c4d681989 | 2,354 | py | Python | docs/sphinxext/flickr.py | glangsto/pyspeckit | 346b24fb828d1d33c7891cdde7609723e51af34c | [
"MIT"
] | 79 | 2015-03-03T15:06:20.000Z | 2022-03-27T21:29:47.000Z | docs/sphinxext/flickr.py | glangsto/pyspeckit | 346b24fb828d1d33c7891cdde7609723e51af34c | [
"MIT"
] | 240 | 2015-01-04T02:59:12.000Z | 2021-11-13T15:11:14.000Z | docs/sphinxext/flickr.py | glangsto/pyspeckit | 346b24fb828d1d33c7891cdde7609723e51af34c | [
"MIT"
] | 68 | 2015-03-02T12:23:12.000Z | 2022-02-28T10:26:36.000Z | from docutils import nodes
from docutils.parsers.rst import directives
CODE = """\
<object width="%(width)i" height="%(height)i">
<param name="flashvars" value="offsite=true&lang=en-us&page_show_url=%2Fphotos%2F75341362%40N04%2Fsets%2F72157629059614751%2Fshow%2F&page_show_back_url=%2Fphotos%2F75341362%40N04%2Fsets%2... | 44.415094 | 403 | 0.694987 | from docutils import nodes
from docutils.parsers.rst import directives
CODE = """\
<object width="%(width)i" height="%(height)i">
<param name="flashvars" value="offsite=true&lang=en-us&page_show_url=%2Fphotos%2F75341362%40N04%2Fsets%2F72157629059614751%2Fshow%2F&page_show_back_url=%2Fphotos%2F75341362%40N04%2Fsets%2... | 171 | 12 | 73 |
f44b1e2a33c35dd2dd5bfdaad7507c40defa447e | 3,035 | py | Python | holotalk/holotalk/load_and_train.py | whitejetyeh/Insight | aa219c2ddf9fae7241ca5db5fabfa0a65f07c9e3 | [
"MIT"
] | 1 | 2019-10-06T01:58:03.000Z | 2019-10-06T01:58:03.000Z | holotalk/holotalk/load_and_train.py | whitejetyeh/Insight | aa219c2ddf9fae7241ca5db5fabfa0a65f07c9e3 | [
"MIT"
] | 7 | 2020-01-28T23:02:33.000Z | 2022-02-10T00:24:25.000Z | holotalk/holotalk/load_and_train.py | whitejetyeh/Insight | aa219c2ddf9fae7241ca5db5fabfa0a65f07c9e3 | [
"MIT"
] | null | null | null | '''
Convolutional AutoEncoder
This code serves to load a pretrained model and to train for more epochs with
selected data.
'''
import LRsymmetrizer as sym
import tensorflow as tf
import tensorflow.keras as keras
from keras.preprocessing import image
from keras.models import Model, model_from_json, load_model
import os,... | 34.488636 | 101 | 0.714003 | '''
Convolutional AutoEncoder
This code serves to load a pretrained model and to train for more epochs with
selected data.
'''
import LRsymmetrizer as sym
import tensorflow as tf
import tensorflow.keras as keras
from keras.preprocessing import image
from keras.models import Model, model_from_json, load_model
import os,... | 0 | 0 | 0 |
a4d01dd62ded34a1f09a5df98930cdc685264ea7 | 142 | py | Python | flaml/scheduler/__init__.py | wuchihsu/FLAML | 54d303a95ab8615ec298a5a7a530f8d1d477bf68 | [
"MIT"
] | 1,747 | 2020-12-05T00:14:58.000Z | 2022-03-31T20:54:09.000Z | flaml/scheduler/__init__.py | wuchihsu/FLAML | 54d303a95ab8615ec298a5a7a530f8d1d477bf68 | [
"MIT"
] | 229 | 2020-12-14T06:19:16.000Z | 2022-03-31T05:20:27.000Z | flaml/scheduler/__init__.py | wuchihsu/FLAML | 54d303a95ab8615ec298a5a7a530f8d1d477bf68 | [
"MIT"
] | 260 | 2020-12-13T09:24:41.000Z | 2022-03-27T04:09:51.000Z | from .trial_scheduler import TrialScheduler
from .online_scheduler import OnlineScheduler, OnlineSuccessiveDoublingScheduler, ChaChaScheduler
| 47.333333 | 97 | 0.901408 | from .trial_scheduler import TrialScheduler
from .online_scheduler import OnlineScheduler, OnlineSuccessiveDoublingScheduler, ChaChaScheduler
| 0 | 0 | 0 |
d230c015a45584478b5c41ae1f44af579f185abb | 1,150 | py | Python | chapter9.py | rpmva/Python1 | c642070eea506dfce3863d5534a616668dcf5575 | [
"MIT"
] | null | null | null | chapter9.py | rpmva/Python1 | c642070eea506dfce3863d5534a616668dcf5575 | [
"MIT"
] | null | null | null | chapter9.py | rpmva/Python1 | c642070eea506dfce3863d5534a616668dcf5575 | [
"MIT"
] | null | null | null | #Chapter 9 notes
#1
#states = {} <- dictionary
#states = {"Virginia": "Richmond", "Maryland": "Annapolis", "New York": "Albany"}
#print states . . . {'Maryland': 'Annapolis', 'New York': 'Albany', 'Virginia': 'Richmond'}
#states['Oregon'] = 'Salem' <- adding something to the dictionary
#states.pop(Oregon) = Salem; Stat... | 33.823529 | 91 | 0.606087 | #Chapter 9 notes
#1
#states = {} <- dictionary
#states = {"Virginia": "Richmond", "Maryland": "Annapolis", "New York": "Albany"}
#print states . . . {'Maryland': 'Annapolis', 'New York': 'Albany', 'Virginia': 'Richmond'}
#states['Oregon'] = 'Salem' <- adding something to the dictionary
#states.pop(Oregon) = Salem; Stat... | 0 | 0 | 0 |
c54ec92bd4c8d9781606b671fe08eb9276fe1ad3 | 2,670 | py | Python | Neural-Networks-main/AlgoNet/core/AlgoNet/RNN.py | eugenennamdi/Machine-Learning | 39fee05a857b7bc9ffdd8a1c228719c0a32cbbaf | [
"Apache-2.0"
] | 23 | 2021-12-30T05:11:55.000Z | 2022-02-18T18:01:50.000Z | Neural-Networks-main/AlgoNet/core/AlgoNet/RNN.py | eugenennamdi/Machine-Learning | 39fee05a857b7bc9ffdd8a1c228719c0a32cbbaf | [
"Apache-2.0"
] | 3 | 2022-01-02T00:35:46.000Z | 2022-01-18T05:03:45.000Z | Neural-Networks-main/AlgoNet/core/AlgoNet/RNN.py | eugenennamdi/Machine-Learning | 39fee05a857b7bc9ffdd8a1c228719c0a32cbbaf | [
"Apache-2.0"
] | 6 | 2021-12-27T21:10:46.000Z | 2022-02-18T12:33:58.000Z | # Copyright Fortior Blockchain, LLLP 2021
# Imports
import numpy as np
import pandas as pd
from pandas_datareader import data
ALGO = data.DataReader("ALGO-USD",
start='2019-9-18',
end='2021-9-14',
data_source='yahoo')
import matplotlib.pyplot as p... | 28.404255 | 88 | 0.724719 | # Copyright Fortior Blockchain, LLLP 2021
# Imports
import numpy as np
import pandas as pd
from pandas_datareader import data
ALGO = data.DataReader("ALGO-USD",
start='2019-9-18',
end='2021-9-14',
data_source='yahoo')
import matplotlib.pyplot as p... | 0 | 0 | 0 |
81a350830da5c371c8a29cec49f4b1f6e74c5ea1 | 1,562 | py | Python | .github/workflows/link-check/to_sheets.py | lucascr91/mais | a137328d683a0252a6159e9135f1326157cd018f | [
"MIT"
] | 290 | 2020-10-14T17:18:21.000Z | 2022-03-31T20:56:07.000Z | .github/workflows/link-check/to_sheets.py | lucascr91/mais | a137328d683a0252a6159e9135f1326157cd018f | [
"MIT"
] | 756 | 2020-10-09T16:37:57.000Z | 2022-03-31T18:28:18.000Z | .github/workflows/link-check/to_sheets.py | lucascr91/mais | a137328d683a0252a6159e9135f1326157cd018f | [
"MIT"
] | 81 | 2020-10-15T18:21:42.000Z | 2022-03-31T03:25:13.000Z | import base64
import csv
import json
import os
from google.oauth2 import service_account
from googleapiclient.discovery import build
if __name__ == "__main__":
spreadsheet_id = os.environ["SPREADSHEET_ID"]
range_name = os.environ["RANGE_NAME"]
credential = os.environ["GDOCS_SERVICE_ACCOUNT"]
cre... | 25.193548 | 72 | 0.685019 | import base64
import csv
import json
import os
from google.oauth2 import service_account
from googleapiclient.discovery import build
def encode_credential(credential):
credential = json.dumps(credential)
credential = credential.encode("utf-8")
credential = base64.b64encode(credential)
return credenti... | 982 | 0 | 92 |
306a7fa2f72c22b56a0c8d838d7c1fce1e6a0de3 | 364 | py | Python | listings/migrations/0002_auto_20190825_0220.py | matheus-francisco/air-ap-django | a6166891b4c9de45f22b697fcb2449773b3e60e3 | [
"MIT"
] | 1 | 2020-06-28T20:23:49.000Z | 2020-06-28T20:23:49.000Z | listings/migrations/0002_auto_20190825_0220.py | matheusfrancisco/air-ap-django | a6166891b4c9de45f22b697fcb2449773b3e60e3 | [
"MIT"
] | null | null | null | listings/migrations/0002_auto_20190825_0220.py | matheusfrancisco/air-ap-django | a6166891b4c9de45f22b697fcb2449773b3e60e3 | [
"MIT"
] | 1 | 2019-11-25T12:33:48.000Z | 2019-11-25T12:33:48.000Z | # Generated by Django 2.2.4 on 2019-08-25 02:20
from django.db import migrations
| 19.157895 | 47 | 0.585165 | # Generated by Django 2.2.4 on 2019-08-25 02:20
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('listings', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='listing',
old_name='discription',
... | 0 | 258 | 23 |
8a4e816e955e4a2a9f0d76ed1d455f2c174d1e7d | 612 | py | Python | tensorflow_data_validation/types.py | AndreaPi/data-validation | e62ee101a9cab32406ea204fe87186400222ce5f | [
"Apache-2.0"
] | null | null | null | tensorflow_data_validation/types.py | AndreaPi/data-validation | e62ee101a9cab32406ea204fe87186400222ce5f | [
"Apache-2.0"
] | null | null | null | tensorflow_data_validation/types.py | AndreaPi/data-validation | e62ee101a9cab32406ea204fe87186400222ce5f | [
"Apache-2.0"
] | null | null | null | """Types."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import apache_beam as beam
import numpy as np
from tensorflow_data_validation.types_compat import Dict, Text, Union
FeatureName = Union[bytes, Text]
# Feature type enum value.
FeatureNameStati... | 24.48 | 75 | 0.797386 | """Types."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import apache_beam as beam
import numpy as np
from tensorflow_data_validation.types_compat import Dict, Text, Union
FeatureName = Union[bytes, Text]
# Feature type enum value.
FeatureNameStati... | 0 | 0 | 0 |
ed11f487d06fd4e77a331494e8f8f65f4672ec8e | 102 | py | Python | src/gluonts/model/canonical/__init__.py | lovvge/gluon-ts | 284376138f41968bec0a4cb05b274c8ee259493a | [
"Apache-2.0"
] | 2 | 2019-09-05T05:39:03.000Z | 2020-11-08T17:07:04.000Z | src/gluonts/model/canonical/__init__.py | lovvge/gluon-ts | 284376138f41968bec0a4cb05b274c8ee259493a | [
"Apache-2.0"
] | null | null | null | src/gluonts/model/canonical/__init__.py | lovvge/gluon-ts | 284376138f41968bec0a4cb05b274c8ee259493a | [
"Apache-2.0"
] | null | null | null | # Relative imports
from ._estimator import CanonicalRNNEstimator
__all__ = ["CanonicalRNNEstimator"]
| 20.4 | 45 | 0.823529 | # Relative imports
from ._estimator import CanonicalRNNEstimator
__all__ = ["CanonicalRNNEstimator"]
| 0 | 0 | 0 |
7d8b840ab2090979f45f6a513482eed31f48f46a | 3,712 | py | Python | lab6/transition.py | Ovhagen/EDAN20 | 403b72c332baf23b48d6f698fa0e9d06e66e5fa0 | [
"MIT"
] | null | null | null | lab6/transition.py | Ovhagen/EDAN20 | 403b72c332baf23b48d6f698fa0e9d06e66e5fa0 | [
"MIT"
] | null | null | null | lab6/transition.py | Ovhagen/EDAN20 | 403b72c332baf23b48d6f698fa0e9d06e66e5fa0 | [
"MIT"
] | null | null | null | """
Transitions for Nivre's parser
The parser state consists of the stack, the queue, and the partial graph
The partial graph is represented as a dictionary
"""
__author__ = "Pierre Nugues"
import conll
import dparser
def shift(stack, queue, graph):
"""
Shift the first word in the queue onto the stack
:... | 23.643312 | 87 | 0.601832 | """
Transitions for Nivre's parser
The parser state consists of the stack, the queue, and the partial graph
The partial graph is represented as a dictionary
"""
__author__ = "Pierre Nugues"
import conll
import dparser
def shift(stack, queue, graph):
"""
Shift the first word in the queue onto the stack
:... | 0 | 0 | 0 |
2ce8017db10da0b41d63c5082e08fa66a922bd17 | 7,430 | py | Python | models/generator.py | affromero/SMILE | 931510d69b2e33f2fe633563833c50a7408f89ef | [
"MIT"
] | 20 | 2020-10-07T15:44:38.000Z | 2022-02-25T10:08:22.000Z | models/generator.py | affromero/SMILE | 931510d69b2e33f2fe633563833c50a7408f89ef | [
"MIT"
] | 1 | 2022-03-11T03:19:14.000Z | 2022-03-11T03:53:59.000Z | models/generator.py | affromero/SMILE | 931510d69b2e33f2fe633563833c50a7408f89ef | [
"MIT"
] | 1 | 2021-11-03T11:15:52.000Z | 2021-11-03T11:15:52.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
from models.utils import print_debug
from misc.utils import PRINT
from models.utils import weights_init
from misc.normalization import AdainResBlk, ResBlk, MODResBlk, Conv2DMod
import numpy as np
# ----------------- #
# --- GENERATOR --- #
# --------... | 35.89372 | 79 | 0.501077 | import torch
import torch.nn as nn
import torch.nn.functional as F
from models.utils import print_debug
from misc.utils import PRINT
from models.utils import weights_init
from misc.normalization import AdainResBlk, ResBlk, MODResBlk, Conv2DMod
import numpy as np
class HighPass(nn.Module):
def __init__(self, w_hpf... | 6,801 | 11 | 286 |
95d856e929943d7a2b8afee7bff1ac05a825b266 | 763 | py | Python | tests/conftest.py | BuildForSDG/team-214-backend | f1aff9c27d7b7588b4bbb2bc68956b35051d4506 | [
"MIT"
] | 1 | 2020-05-20T16:32:33.000Z | 2020-05-20T16:32:33.000Z | tests/conftest.py | BuildForSDG/team-214-backend | f1aff9c27d7b7588b4bbb2bc68956b35051d4506 | [
"MIT"
] | 23 | 2020-05-19T07:12:53.000Z | 2020-06-21T03:57:54.000Z | tests/conftest.py | BuildForSDG/team-214-backend | f1aff9c27d7b7588b4bbb2bc68956b35051d4506 | [
"MIT"
] | 1 | 2020-05-18T14:18:12.000Z | 2020-05-18T14:18:12.000Z | import pytest
from sme_financing.main import create_app, db
@pytest.fixture(scope="session")
@pytest.fixture(scope="session")
@pytest.fixture(scope="session")
@pytest.fixture(scope="class")
| 19.075 | 49 | 0.677588 | import pytest
from sme_financing.main import create_app, db
@pytest.fixture(scope="session")
def app():
flask_app = create_app(config_name="testing")
ctx = flask_app.app_context()
ctx.push()
yield flask_app
ctx.pop()
@pytest.fixture(scope="session")
def test_client(app):
flask_app = crea... | 476 | 0 | 88 |
15eec461ea96bfe7d739c83d4c884c5533b931dd | 829 | py | Python | Hard/023_Merge_k_Sorted_Lists.py | ChenKuanSun/LeetCode | f346ad5c75d81907fa05cfc5dd3fe6bfd45c66bd | [
"MIT"
] | null | null | null | Hard/023_Merge_k_Sorted_Lists.py | ChenKuanSun/LeetCode | f346ad5c75d81907fa05cfc5dd3fe6bfd45c66bd | [
"MIT"
] | null | null | null | Hard/023_Merge_k_Sorted_Lists.py | ChenKuanSun/LeetCode | f346ad5c75d81907fa05cfc5dd3fe6bfd45c66bd | [
"MIT"
] | null | null | null | """
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.
Example:
Input:
[
1->4->5,
1->3->4,
2->6
]
Output: 1->1->2->3->4->4->5->6
"""
# Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.... | 23.027778 | 98 | 0.553679 | """
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.
Example:
Input:
[
1->4->5,
1->3->4,
2->6
]
Output: 1->1->2->3->4->4->5->6
"""
# Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.... | 0 | 444 | 22 |
75de98668e46d651a1485c4c3bae5beb8927e941 | 86 | py | Python | app/constants/auth.py | 1995chen/jingdong_financial | 0d3542fc91c28cf051d57775ab529f789fbdbba1 | [
"MIT"
] | 1 | 2022-03-09T13:05:14.000Z | 2022-03-09T13:05:14.000Z | app/constants/auth.py | 1995chen/jingdong_financial | 0d3542fc91c28cf051d57775ab529f789fbdbba1 | [
"MIT"
] | null | null | null | app/constants/auth.py | 1995chen/jingdong_financial | 0d3542fc91c28cf051d57775ab529f789fbdbba1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
| 12.285714 | 23 | 0.523256 | # -*- coding: utf-8 -*-
class Role(object):
User = "User"
Leader = "Leader"
| 0 | 38 | 23 |
edb2030f599c7cd888f0e9cade4aff0475dec6e0 | 530 | py | Python | UI/updater.py | BrunoTh/ETS2Autopilot | 72762d4161866a876c11f39ba22eadd8f2aff9a9 | [
"MIT"
] | 86 | 2017-07-04T17:03:33.000Z | 2022-03-06T01:00:56.000Z | UI/updater.py | ionut14309/ETS2Autopilot | 23c39e5e2dd32330094b38f1aeb3ada55519e65b | [
"MIT"
] | 17 | 2017-07-19T11:09:20.000Z | 2021-03-17T16:48:06.000Z | UI/updater.py | BrunoTh/ETS2Autopilot | 72762d4161866a876c11f39ba22eadd8f2aff9a9 | [
"MIT"
] | 18 | 2017-07-28T00:50:05.000Z | 2021-09-24T06:09:27.000Z | from PyQt5.QtWidgets import QMainWindow, QApplication
from PyQt5 import QtGui
from UI.ui_updater import Ui_MainWindow
from database import Settings
| 19.62963 | 53 | 0.654717 | from PyQt5.QtWidgets import QMainWindow, QApplication
from PyQt5 import QtGui
from UI.ui_updater import Ui_MainWindow
from database import Settings
class UpdaterUI(object):
def __init__(self):
self.window = QMainWindow()
self.ui = Ui_MainWindow()
self.ui.setupUi(self.window)
def show(... | 194 | 3 | 184 |
36e7a1f975b415904f291a1e0168c15fbf6a75f2 | 1,857 | py | Python | release/stubs.min/System/Windows/Forms/__init___parts/MouseEventArgs.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | release/stubs.min/System/Windows/Forms/__init___parts/MouseEventArgs.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | release/stubs.min/System/Windows/Forms/__init___parts/MouseEventArgs.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | class MouseEventArgs(EventArgs):
"""
Provides data for the System.Windows.Forms.Control.MouseUp,System.Windows.Forms.Control.MouseDown,and System.Windows.Forms.Control.MouseMove events.
MouseEventArgs(button: MouseButtons,clicks: int,x: int,y: int,delta: int)
"""
def Instance(self):
""" This function ... | 32.017241 | 160 | 0.701669 | class MouseEventArgs(EventArgs):
"""
Provides data for the System.Windows.Forms.Control.MouseUp,System.Windows.Forms.Control.MouseDown,and System.Windows.Forms.Control.MouseMove events.
MouseEventArgs(button: MouseButtons,clicks: int,x: int,y: int,delta: int)
"""
def Instance(self):
""" This function ... | 0 | 0 | 0 |
bed9e268ecc5e655935ec0e5b75b154e88ee1c5f | 21,915 | py | Python | addons/cats-blender-plugin-0-19-0/tools/decimation.py | trisadmeslek/V-Sekai-Blender-tools | 0d8747387c58584b50c69c61ba50a881319114f8 | [
"MIT"
] | 725 | 2020-06-30T00:12:35.000Z | 2021-11-07T03:10:44.000Z | addons/cats-blender-plugin-0-19-0/tools/decimation.py | trisadmeslek/V-Sekai-Blender-tools | 0d8747387c58584b50c69c61ba50a881319114f8 | [
"MIT"
] | 144 | 2017-12-27T20:57:07.000Z | 2020-06-27T13:58:40.000Z | addons/cats-blender-plugin-0-19-0/tools/decimation.py | trisadmeslek/V-Sekai-Blender-tools | 0d8747387c58584b50c69c61ba50a881319114f8 | [
"MIT"
] | 106 | 2020-07-04T02:56:27.000Z | 2021-11-07T08:54:11.000Z | # MIT License
# Copyright (c) 2018 Hotox
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the 'Software'), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish,... | 39.344704 | 137 | 0.561488 | # MIT License
# Copyright (c) 2018 Hotox
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the 'Software'), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish,... | 17,445 | 2,729 | 198 |
43559551055b662051f10a56ed79df6943e5764f | 968 | py | Python | config/keys.py | S4TURN0/atomic-python | 7c0fa71a2d7e5d2b65d257b465f5a59bba7bc5ca | [
"MIT"
] | 1 | 2021-07-30T02:10:58.000Z | 2021-07-30T02:10:58.000Z | config/keys.py | S4TURN0/atomic-python | 7c0fa71a2d7e5d2b65d257b465f5a59bba7bc5ca | [
"MIT"
] | 2 | 2021-05-31T15:27:02.000Z | 2021-06-03T01:04:02.000Z | config/keys.py | S4TURN0/atomic-python | 7c0fa71a2d7e5d2b65d257b465f5a59bba7bc5ca | [
"MIT"
] | null | null | null | import random,json | 21.511111 | 49 | 0.639463 | import random,json
def random_api(api):
try:
keys = get_api(api)
key = random.randrange(len(keys))
return keys[key]
except:
keys = get_api(api)['api']
cookies = get_api(api)['cookie']
key = random.randrange(len(keys))
cookie = random.randrange(len(key... | 693 | 0 | 257 |
849a817d06232c4bec9f6d426a3bc57fb8c508bf | 506 | py | Python | Python/Python For Absolute Beginner/83 Akhbaar Padhke Sunaao.py | omkarsutar1255/Python-Data | 169d0c54b23d9dd5a7f1aea41ab385121c3b3c63 | [
"CC-BY-3.0"
] | null | null | null | Python/Python For Absolute Beginner/83 Akhbaar Padhke Sunaao.py | omkarsutar1255/Python-Data | 169d0c54b23d9dd5a7f1aea41ab385121c3b3c63 | [
"CC-BY-3.0"
] | null | null | null | Python/Python For Absolute Beginner/83 Akhbaar Padhke Sunaao.py | omkarsutar1255/Python-Data | 169d0c54b23d9dd5a7f1aea41ab385121c3b3c63 | [
"CC-BY-3.0"
] | null | null | null |
if __name__ == '__main__':
import requests
import json
url = ('http://newsapi.org/v2/top-headlines?'
'country=us&'
'apiKey=9b8a6a83887b4da4ace3d23b91e57e89')
response = requests.get(url)
text = response.text
my_json = json.loads(text)
for ... | 24.095238 | 56 | 0.586957 | def speak(str):
from win32com.client import Dispatch
speak = Dispatch("SAPI.SpVoice")
speak.speak(str)
if __name__ == '__main__':
import requests
import json
url = ('http://newsapi.org/v2/top-headlines?'
'country=us&'
'apiKey=9b8a6a83887b4da4ace3d23b91e... | 95 | 0 | 22 |
867b92891baec3b0ba415031bdeb25a44ec8b184 | 1,086 | py | Python | django/ratelist/models.py | phantomhieve/cashcenter | 642a496c5e60847f4c4a6cc2c80b957ae2d6285b | [
"MIT"
] | null | null | null | django/ratelist/models.py | phantomhieve/cashcenter | 642a496c5e60847f4c4a6cc2c80b957ae2d6285b | [
"MIT"
] | 4 | 2021-04-08T22:00:11.000Z | 2021-09-22T19:42:08.000Z | django/ratelist/models.py | phantomhieve/cashcenter | 642a496c5e60847f4c4a6cc2c80b957ae2d6285b | [
"MIT"
] | null | null | null | from djongo import models
from django.contrib.auth.models import User
| 35.032258 | 100 | 0.666667 | from djongo import models
from django.contrib.auth.models import User
class RatelistData(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE)
category = models.CharField(null=False, max_length=255)
item = models.CharField(null=False, max_length=255)
hsn = models.CharFiel... | 106 | 860 | 46 |
d9a7cf17041642c4a49b7983da66853b2340b120 | 442 | py | Python | myfamily/fabfile.py | fortyMiles/my-family | d827b7fa36753726318fcf9e55d0b482fdf8323d | [
"BSD-3-Clause"
] | null | null | null | myfamily/fabfile.py | fortyMiles/my-family | d827b7fa36753726318fcf9e55d0b482fdf8323d | [
"BSD-3-Clause"
] | null | null | null | myfamily/fabfile.py | fortyMiles/my-family | d827b7fa36753726318fcf9e55d0b482fdf8323d | [
"BSD-3-Clause"
] | null | null | null | # -*- coding:utf-8 -*-
from __future__ import with_statement
import os
import argparse
from fabric.api import *
from fabric.contrib.console import confirm
# add fabric function here
if __name__ == '__main__':
parser = argparse.ArgumentParser()
# add argument to parser
# parser.add_argument()
args =... | 21.047619 | 44 | 0.701357 | # -*- coding:utf-8 -*-
from __future__ import with_statement
import os
import argparse
from fabric.api import *
from fabric.contrib.console import confirm
# add fabric function here
if __name__ == '__main__':
parser = argparse.ArgumentParser()
# add argument to parser
# parser.add_argument()
args =... | 0 | 0 | 0 |
506f8223c1e30603a1d1050fa932b28f3f3fc98f | 3,143 | py | Python | api/v1/login.py | muslax/aces-api | 9d56f68277c284bd6985e13dca7f993e9db1b70f | [
"MIT"
] | null | null | null | api/v1/login.py | muslax/aces-api | 9d56f68277c284bd6985e13dca7f993e9db1b70f | [
"MIT"
] | 1 | 2020-08-17T04:17:58.000Z | 2020-08-17T04:17:58.000Z | api/v1/login.py | muslax/aces-api | 9d56f68277c284bd6985e13dca7f993e9db1b70f | [
"MIT"
] | 2 | 2020-08-16T11:59:34.000Z | 2020-08-26T05:35:07.000Z | import logging
from datetime import datetime, timedelta
from typing import Any, List, Optional
from fastapi import APIRouter, Depends, HTTPException, Security, status
from fastapi.security import OAuth2PasswordRequestForm
from jose import JWTError, jwt
from passlib.context import CryptContext
from pydantic import Base... | 34.538462 | 92 | 0.716513 | import logging
from datetime import datetime, timedelta
from typing import Any, List, Optional
from fastapi import APIRouter, Depends, HTTPException, Security, status
from fastapi.security import OAuth2PasswordRequestForm
from jose import JWTError, jwt
from passlib.context import CryptContext
from pydantic import Base... | 1,256 | 0 | 66 |
a2c8f9e94ead28760b5841319c22ba2cead30c83 | 410 | py | Python | Python-programs/newlist.py | manavbansalcoder/Hacktoberfest2021 | ba20770f070bf9c0b02a8fe2bcbeb72cd559e428 | [
"CC0-1.0"
] | null | null | null | Python-programs/newlist.py | manavbansalcoder/Hacktoberfest2021 | ba20770f070bf9c0b02a8fe2bcbeb72cd559e428 | [
"CC0-1.0"
] | null | null | null | Python-programs/newlist.py | manavbansalcoder/Hacktoberfest2021 | ba20770f070bf9c0b02a8fe2bcbeb72cd559e428 | [
"CC0-1.0"
] | null | null | null | t=int(input())
while(t>0):
t=t-1
n=int(input())
a=input().split()
for i in range(n):
a[i]=int(a[i])
b=[0]
c=0
d=0
for i in range(-1,-n,-1):
if(a[i]==a[i-1]):
c=c+0
d=d+1
else:
c=c+1+d
d=0
b.appen... | 17.083333 | 35 | 0.339024 | t=int(input())
while(t>0):
t=t-1
n=int(input())
a=input().split()
for i in range(n):
a[i]=int(a[i])
b=[0]
c=0
d=0
for i in range(-1,-n,-1):
if(a[i]==a[i-1]):
c=c+0
d=d+1
else:
c=c+1+d
d=0
b.appen... | 0 | 0 | 0 |
cf517bb33ce5778e59286275a80a0c8ab7355d52 | 37 | py | Python | tictactoe/game/__init__.py | luisds95/tictactoe-python | 9765556372e303943bea82b85264e3fdca25a254 | [
"MIT"
] | null | null | null | tictactoe/game/__init__.py | luisds95/tictactoe-python | 9765556372e303943bea82b85264e3fdca25a254 | [
"MIT"
] | null | null | null | tictactoe/game/__init__.py | luisds95/tictactoe-python | 9765556372e303943bea82b85264e3fdca25a254 | [
"MIT"
] | null | null | null | from tictactoe.game.play import Game
| 18.5 | 36 | 0.837838 | from tictactoe.game.play import Game
| 0 | 0 | 0 |
230f57029f796a408a23ea15dd232add284f77e6 | 436 | py | Python | txweb/log.py | devdave/txWeb | e447fbefd16134cb2f83323c04c20c41638d7da3 | [
"MIT"
] | null | null | null | txweb/log.py | devdave/txWeb | e447fbefd16134cb2f83323c04c20c41638d7da3 | [
"MIT"
] | 4 | 2020-11-03T19:59:05.000Z | 2021-06-02T03:22:25.000Z | txweb/log.py | devdave/txWeb | e447fbefd16134cb2f83323c04c20c41638d7da3 | [
"MIT"
] | null | null | null | """
Currently just a stupid bridge between twisted.logger and user applications
"""
# from logging import getLogger as stdlib_getLogger, Logger
from twisted import logger
def getLogger(namespace: str = None) -> logger.Logger:
"""
Just an adapted to mimic python's logging getLogger to twisted's Logger... | 27.25 | 81 | 0.713303 | """
Currently just a stupid bridge between twisted.logger and user applications
"""
# from logging import getLogger as stdlib_getLogger, Logger
from twisted import logger
def getLogger(namespace: str = None) -> logger.Logger:
"""
Just an adapted to mimic python's logging getLogger to twisted's Logger... | 0 | 0 | 0 |
121d341ada0477f11c766f5d0de33388ccd812dc | 2,168 | bzl | Python | avionics/firmware/monitors/build_rules.bzl | leozz37/makani | c94d5c2b600b98002f932e80a313a06b9285cc1b | [
"Apache-2.0"
] | 1,178 | 2020-09-10T17:15:42.000Z | 2022-03-31T14:59:35.000Z | avionics/firmware/monitors/build_rules.bzl | leozz37/makani | c94d5c2b600b98002f932e80a313a06b9285cc1b | [
"Apache-2.0"
] | 1 | 2020-05-22T05:22:35.000Z | 2020-05-22T05:22:35.000Z | avionics/firmware/monitors/build_rules.bzl | leozz37/makani | c94d5c2b600b98002f932e80a313a06b9285cc1b | [
"Apache-2.0"
] | 107 | 2020-09-10T17:29:30.000Z | 2022-03-18T09:00:14.000Z | """This module contains monitor genrules."""
load("//lib/bazel:py_rules.bzl", "py_binary")
| 31.882353 | 72 | 0.585793 | """This module contains monitor genrules."""
load("//lib/bazel:py_rules.bzl", "py_binary")
def _monitor_genrule(monitor_name, name, deps, **kwargs):
py_binary(
name = "generate_" + name,
srcs = [
"//avionics/firmware/monitors:generate_" + monitor_name +
"_monitor.py",
... | 1,823 | 0 | 253 |
f81e877f703a45f50e56f90f169d90c0d93ffb11 | 7,065 | py | Python | tasks/tasks_fetch_entity.py | xyla-io/almacen | 7b7f235dc7939777f971f1b5eadd5621e980c15e | [
"MIT"
] | 2 | 2020-10-15T22:12:17.000Z | 2020-10-26T07:17:17.000Z | tasks/tasks_fetch_entity.py | xyla-io/almacen | 7b7f235dc7939777f971f1b5eadd5621e980c15e | [
"MIT"
] | null | null | null | tasks/tasks_fetch_entity.py | xyla-io/almacen | 7b7f235dc7939777f971f1b5eadd5621e980c15e | [
"MIT"
] | null | null | null | import models
import re
from . import base
from . import tasks_fetch_currency_exchange
from abc import abstractproperty
from typing import TypeVar, List, Optional | 38.606557 | 132 | 0.754706 | import models
import re
from . import base
from . import tasks_fetch_currency_exchange
from abc import abstractproperty
from typing import TypeVar, List, Optional
class ParseTagsMutationSpecifier:
parser: Optional[str]
channel: str
entity: str
id_column: str
name_column: str
@classmethod
def task_parse... | 5,975 | 812 | 115 |
32adb0a7e29e0f470078518502fb878106ff769d | 2,240 | py | Python | gui/src/core/seriation_test.py | retallickj/qca-embedding | 96fd37a3ecd4beacb04ad1cb193d65d0b48ceab2 | [
"MIT"
] | 1 | 2017-11-02T20:38:20.000Z | 2017-11-02T20:38:20.000Z | gui/src/core/seriation_test.py | retallickj/qca-embedding | 96fd37a3ecd4beacb04ad1cb193d65d0b48ceab2 | [
"MIT"
] | null | null | null | gui/src/core/seriation_test.py | retallickj/qca-embedding | 96fd37a3ecd4beacb04ad1cb193d65d0b48ceab2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from PyQt4 import QtGui
from parse_qca import parse_qca_file
from auxil import qca_to_coef, hash_problem
import sys
from pprint import pprint
from random import shuffle
import numpy as np
#
#class QCACell(QtGui.QWidget):
# ''' '''
#
# def __init__(self, parent=None):
#... | 22.857143 | 76 | 0.506696 | #!/usr/bin/env python
from PyQt4 import QtGui
from parse_qca import parse_qca_file
from auxil import qca_to_coef, hash_problem
import sys
from pprint import pprint
from random import shuffle
import numpy as np
#
#class QCACell(QtGui.QWidget):
# ''' '''
#
# def __init__(self, parent=None):
#... | 0 | 0 | 0 |
911e4732aec58a2456526ebb044f220524aceebf | 1,925 | py | Python | demo/seq_design_plots.py | AndrewKirby2/data_synthesis | 656858137a348fd5dcb57bcd04bdfece2b9eac1b | [
"MIT"
] | null | null | null | demo/seq_design_plots.py | AndrewKirby2/data_synthesis | 656858137a348fd5dcb57bcd04bdfece2b9eac1b | [
"MIT"
] | null | null | null | demo/seq_design_plots.py | AndrewKirby2/data_synthesis | 656858137a348fd5dcb57bcd04bdfece2b9eac1b | [
"MIT"
] | null | null | null | import numpy as np
from matplotlib import pyplot as plt
from sklearn.gaussian_process import GaussianProcessRegressor
from sklearn.gaussian_process.kernels import RBF, ConstantKernel as C
np.random.seed(1)
# First the noiseless case
X = np.array([3.])
# Observations
y = np.array([0.])
# Mesh the input space for ... | 29.166667 | 79 | 0.698182 | import numpy as np
from matplotlib import pyplot as plt
from sklearn.gaussian_process import GaussianProcessRegressor
from sklearn.gaussian_process.kernels import RBF, ConstantKernel as C
np.random.seed(1)
# First the noiseless case
X = np.array([3.])
# Observations
y = np.array([0.])
# Mesh the input space for ... | 0 | 0 | 0 |
0a6cb1ba2d56605ef2f3adab8fa75752343b94c9 | 190 | py | Python | tethys_datasets/views.py | CI-WATER/django-tethys_datasets | 504963a720693931a1fa1a899d5492548672216f | [
"BSD-2-Clause"
] | null | null | null | tethys_datasets/views.py | CI-WATER/django-tethys_datasets | 504963a720693931a1fa1a899d5492548672216f | [
"BSD-2-Clause"
] | null | null | null | tethys_datasets/views.py | CI-WATER/django-tethys_datasets | 504963a720693931a1fa1a899d5492548672216f | [
"BSD-2-Clause"
] | null | null | null | from django.shortcuts import render
def home(request):
"""
Home page for Tethys Datasets
"""
context = {}
return render(request, 'tethys_datasets/home.html', context)
| 17.272727 | 64 | 0.663158 | from django.shortcuts import render
def home(request):
"""
Home page for Tethys Datasets
"""
context = {}
return render(request, 'tethys_datasets/home.html', context)
| 0 | 0 | 0 |
70ac291a2f8d8d101ef79b35618e90e52733bfb2 | 294 | py | Python | molsysmt/tests/basic/convert/test_convert_from_Molsysmt_MolSys.py | uibcdf/MolModMTs | 4f6b6f671a9fa3e73008d1e9c48686d5f20a6573 | [
"MIT"
] | null | null | null | molsysmt/tests/basic/convert/test_convert_from_Molsysmt_MolSys.py | uibcdf/MolModMTs | 4f6b6f671a9fa3e73008d1e9c48686d5f20a6573 | [
"MIT"
] | null | null | null | molsysmt/tests/basic/convert/test_convert_from_Molsysmt_MolSys.py | uibcdf/MolModMTs | 4f6b6f671a9fa3e73008d1e9c48686d5f20a6573 | [
"MIT"
] | null | null | null | """
Unit and regression test for the convert module of the molsysmt package.
"""
# Import package, test suite, and other packages as needed
import molsysmt as msm
import numpy as np
import os
# Whole systems (selection='all' and structure_indices='all')
# Selection
## Multiple outputs
| 15.473684 | 72 | 0.744898 | """
Unit and regression test for the convert module of the molsysmt package.
"""
# Import package, test suite, and other packages as needed
import molsysmt as msm
import numpy as np
import os
# Whole systems (selection='all' and structure_indices='all')
# Selection
## Multiple outputs
| 0 | 0 | 0 |
5b906ad62973b7dacfdbfd71c1137a6a0753f356 | 2,158 | py | Python | src/devil/fg_size_scoring/__init__.py | MichiganCOG/devil | 296115cd5f4952c7dc65bbcaaf2d1d5c55ef5d35 | [
"MIT"
] | 8 | 2021-05-13T02:37:16.000Z | 2021-09-22T09:28:52.000Z | src/devil/fg_size_scoring/__init__.py | MichiganCOG/devil | 296115cd5f4952c7dc65bbcaaf2d1d5c55ef5d35 | [
"MIT"
] | 3 | 2021-07-30T11:55:56.000Z | 2022-03-24T04:33:46.000Z | src/devil/fg_size_scoring/__init__.py | MichiganCOG/devil | 296115cd5f4952c7dc65bbcaaf2d1d5c55ef5d35 | [
"MIT"
] | 1 | 2021-06-10T08:43:12.000Z | 2021-06-10T08:43:12.000Z | import numpy as np
from .. import get_spaced_index_list
from ..features import BinaryForegroundMaskComputer
class ForegroundSizeScorer(object):
"""Scores the size of the foreground as a percentage of the average mask size over the entire frame area."""
def score_foreground_size(self, fg_masks):
"""S... | 44.040816 | 118 | 0.721501 | import numpy as np
from .. import get_spaced_index_list
from ..features import BinaryForegroundMaskComputer
class ForegroundSizeScorer(object):
"""Scores the size of the foreground as a percentage of the average mask size over the entire frame area."""
def score_foreground_size(self, fg_masks):
"""S... | 0 | 0 | 0 |
dd98247b363ebc4645dbf8fb294c1db02206bf5b | 21,280 | py | Python | pdf_tchotchke/bookmarks/bkmk.py | lord-zo/pdf_tchotchke | deca0dfef24bb445b5f3698af968b9d23f812a09 | [
"MIT"
] | null | null | null | pdf_tchotchke/bookmarks/bkmk.py | lord-zo/pdf_tchotchke | deca0dfef24bb445b5f3698af968b9d23f812a09 | [
"MIT"
] | null | null | null | pdf_tchotchke/bookmarks/bkmk.py | lord-zo/pdf_tchotchke | deca0dfef24bb445b5f3698af968b9d23f812a09 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# bkmk.py
# Author: Lorenzo Van Muñoz
# Last updated Dec 31, 2020
'''
A script to generate pdf bookmarks in cpdf,gs,pdftk syntaxes
This script uses regular expressions to identify
relevant bookmark information and to typeset the syntaxes.
It also supports conversion between the different suppo... | 39.117647 | 156 | 0.595348 | #!/usr/bin/env python3
# bkmk.py
# Author: Lorenzo Van Muñoz
# Last updated Dec 31, 2020
'''
A script to generate pdf bookmarks in cpdf,gs,pdftk syntaxes
This script uses regular expressions to identify
relevant bookmark information and to typeset the syntaxes.
It also supports conversion between the different suppo... | 0 | 0 | 0 |
680c4ee5f251b39fc71e051c06aef3322766fffb | 290 | py | Python | jobboardscraper/organizations/urls.py | dillonko/jobboardscraper | 21d662c3bad2e054c3b43f648e5b276339ee1d32 | [
"BSD-3-Clause"
] | null | null | null | jobboardscraper/organizations/urls.py | dillonko/jobboardscraper | 21d662c3bad2e054c3b43f648e5b276339ee1d32 | [
"BSD-3-Clause"
] | 5 | 2020-12-09T20:45:28.000Z | 2021-12-14T10:38:50.000Z | jobboardscraper/organizations/urls.py | dillonko/jobboardscraper | 21d662c3bad2e054c3b43f648e5b276339ee1d32 | [
"BSD-3-Clause"
] | null | null | null | from django.conf.urls import url
from .views import OrganizationDetailView, OrganizationListView
urlpatterns = [
url(r'^(?P<slug>[-\w]+)/$', OrganizationDetailView.as_view(), name='organization_detail'),
url(r'^$', OrganizationListView.as_view(), name='organization_list'),
]
| 22.307692 | 94 | 0.72069 | from django.conf.urls import url
from .views import OrganizationDetailView, OrganizationListView
urlpatterns = [
url(r'^(?P<slug>[-\w]+)/$', OrganizationDetailView.as_view(), name='organization_detail'),
url(r'^$', OrganizationListView.as_view(), name='organization_list'),
]
| 0 | 0 | 0 |
1a1bd084432375ac8dbb5ac87027b72e59cbffd4 | 44,156 | py | Python | sktime/transformations/base.py | abdkg/sktime | 889090193b28dd1b36fd97efcc29115df1393838 | [
"BSD-3-Clause"
] | 1 | 2019-12-23T16:57:14.000Z | 2019-12-23T16:57:14.000Z | sktime/transformations/base.py | abdkg/sktime | 889090193b28dd1b36fd97efcc29115df1393838 | [
"BSD-3-Clause"
] | null | null | null | sktime/transformations/base.py | abdkg/sktime | 889090193b28dd1b36fd97efcc29115df1393838 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""
Base class template for transformers.
class name: BaseTransformer
Covers all types of transformers.
Type and behaviour of transformer is determined by the following tags:
"scitype:transform-input" tag with valu... | 41.461033 | 88 | 0.590248 | # -*- coding: utf-8 -*-
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""
Base class template for transformers.
class name: BaseTransformer
Covers all types of transformers.
Type and behaviour of transformer is determined by the following tags:
"scitype:transform-input" tag with valu... | 136 | 0 | 27 |
f49bd1a3037b9a0bca1909067b4ba9b73fd382ae | 71 | py | Python | h5Nastran/h5Nastran/h5/__init__.py | ACea15/pyNastran | 5ffc37d784b52c882ea207f832bceb6b5eb0e6d4 | [
"BSD-3-Clause"
] | 293 | 2015-03-22T20:22:01.000Z | 2022-03-14T20:28:24.000Z | h5Nastran/h5Nastran/h5/__init__.py | ACea15/pyNastran | 5ffc37d784b52c882ea207f832bceb6b5eb0e6d4 | [
"BSD-3-Clause"
] | 512 | 2015-03-14T18:39:27.000Z | 2022-03-31T16:15:43.000Z | h5Nastran/h5Nastran/h5/__init__.py | ACea15/pyNastran | 5ffc37d784b52c882ea207f832bceb6b5eb0e6d4 | [
"BSD-3-Clause"
] | 136 | 2015-03-19T03:26:06.000Z | 2022-03-25T22:14:54.000Z | """
The h5 module is organized like the resulting h5 file's groups.
""" | 23.666667 | 63 | 0.71831 | """
The h5 module is organized like the resulting h5 file's groups.
""" | 0 | 0 | 0 |
01402bfeeeae4848a9688066569764a782a201be | 1,175 | py | Python | src/nodes/topk_reducer.py | PatricioIribarneCatella/TP-NBA-statistics | e5a9a67a56614c63e4761316403e8ba6181ba447 | [
"MIT"
] | null | null | null | src/nodes/topk_reducer.py | PatricioIribarneCatella/TP-NBA-statistics | e5a9a67a56614c63e4761316403e8ba6181ba447 | [
"MIT"
] | null | null | null | src/nodes/topk_reducer.py | PatricioIribarneCatella/TP-NBA-statistics | e5a9a67a56614c63e4761316403e8ba6181ba447 | [
"MIT"
] | null | null | null | import sys
import json
import argparse
from os import path
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
from reducers.topk import TopkReducer
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='Top K reducer NBA',
formatter_cla... | 22.596154 | 75 | 0.579574 | import sys
import json
import argparse
from os import path
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
from reducers.topk import TopkReducer
def main(rid, num_workers, k_number, config):
with open(config) as f:
config_data = json.load(f)
reducer = TopkReducer(rid, num_worker... | 175 | 0 | 23 |
4b3e7dcd0f506b8199e52697e028c157cf3b54f0 | 8,347 | py | Python | tests/fixtures/kube.py | gmarkey/k8s-snapshots | 35a5125c6241f0eb35e04b69f9f6e512d718b4fb | [
"BSD-2-Clause"
] | 326 | 2017-01-07T17:08:19.000Z | 2022-03-28T05:54:51.000Z | tests/fixtures/kube.py | gmarkey/k8s-snapshots | 35a5125c6241f0eb35e04b69f9f6e512d718b4fb | [
"BSD-2-Clause"
] | 96 | 2017-01-25T15:42:35.000Z | 2021-11-06T04:06:41.000Z | tests/fixtures/kube.py | gmarkey/k8s-snapshots | 35a5125c6241f0eb35e04b69f9f6e512d718b4fb | [
"BSD-2-Clause"
] | 66 | 2017-02-03T21:40:42.000Z | 2021-08-15T17:27:40.000Z | import contextlib
from typing import Dict, Iterable, Optional, Tuple, List, Any, Type, Hashable, \
NamedTuple, Generator, Callable
from unittest import mock
from unittest.mock import MagicMock, Mock
import structlog
import pykube
import pytest
from _pytest.fixtures import FixtureRequest
from k8s_snapshots import ... | 25.92236 | 80 | 0.59147 | import contextlib
from typing import Dict, Iterable, Optional, Tuple, List, Any, Type, Hashable, \
NamedTuple, Generator, Callable
from unittest import mock
from unittest.mock import MagicMock, Mock
import structlog
import pykube
import pytest
from _pytest.fixtures import FixtureRequest
from k8s_snapshots import ... | 2,834 | 1,394 | 134 |
e3e3b26f4a12e00683dea044ee47fe00944fcc41 | 11,074 | py | Python | src/config_params.py | softsys4ai/causal-config-labyrinth | 4f50f9ff15429b0ac6ad0a99fbe4cfdd17e360fc | [
"MIT"
] | 15 | 2022-01-20T12:35:35.000Z | 2022-03-24T16:25:24.000Z | src/config_params.py | softsys4ai/unicorn | 4f50f9ff15429b0ac6ad0a99fbe4cfdd17e360fc | [
"MIT"
] | 14 | 2022-01-23T00:20:00.000Z | 2022-02-22T01:40:43.000Z | src/config_params.py | softsys4ai/causal-config-labyrinth | 4f50f9ff15429b0ac6ad0a99fbe4cfdd17e360fc | [
"MIT"
] | 1 | 2022-02-23T08:59:24.000Z | 2022-02-23T08:59:24.000Z | import os
import sys
import subprocess
import traceback
class ConfigParams(object):
"""This class is used to create different confiuration space for jetson tx1
"""
def set_big_core_status(self, cpu_name, status):
"""This function is used set core status (enable or disable)
@input:
... | 47.123404 | 144 | 0.57197 | import os
import sys
import subprocess
import traceback
class ConfigParams(object):
"""This class is used to create different confiuration space for jetson tx1
"""
def __init__(self, cfg, cur_config, cur_sys,
big_cores, columns):
print("[STATUS]: Initializing ConfigParams C... | 2,084 | 0 | 26 |
3563ee567509c5dc8fe257ec4553884ba5a3a056 | 1,989 | py | Python | artworks/urls.py | mnosinov/artworks_project | b6901ff83c1cd370ce1539f09b464ecb995e1ce3 | [
"MIT"
] | null | null | null | artworks/urls.py | mnosinov/artworks_project | b6901ff83c1cd370ce1539f09b464ecb995e1ce3 | [
"MIT"
] | null | null | null | artworks/urls.py | mnosinov/artworks_project | b6901ff83c1cd370ce1539f09b464ecb995e1ce3 | [
"MIT"
] | null | null | null | from django.urls import path
from .views import index, InsertSampleDataView, \
GenreListView, GenreDetailView, GenreUpdateView, GenreDeleteView, GenreCreateView, \
AuthorListView, AuthorDetailView, AuthorUpdateView, AuthorDeleteView, AuthorCreateView, \
ArtworkListView, ArtworkDetailView, ArtworkUpdateView,... | 62.15625 | 111 | 0.732529 | from django.urls import path
from .views import index, InsertSampleDataView, \
GenreListView, GenreDetailView, GenreUpdateView, GenreDeleteView, GenreCreateView, \
AuthorListView, AuthorDetailView, AuthorUpdateView, AuthorDeleteView, AuthorCreateView, \
ArtworkListView, ArtworkDetailView, ArtworkUpdateView,... | 0 | 0 | 0 |
72607d54fcc5eef96c2e8f2f9a7c3eb6cef41a30 | 59 | py | Python | Chapter 01/Chap01_Example1.32.py | bpbpublications/Programming-Techniques-using-Python | 49b785f37e95a3aad1d36cef51e219ac56e5e9f0 | [
"MIT"
] | null | null | null | Chapter 01/Chap01_Example1.32.py | bpbpublications/Programming-Techniques-using-Python | 49b785f37e95a3aad1d36cef51e219ac56e5e9f0 | [
"MIT"
] | null | null | null | Chapter 01/Chap01_Example1.32.py | bpbpublications/Programming-Techniques-using-Python | 49b785f37e95a3aad1d36cef51e219ac56e5e9f0 | [
"MIT"
] | null | null | null | #\\ --- backslash
print("I am here for the backslash\\")
| 19.666667 | 39 | 0.610169 | #\\ --- backslash
print("I am here for the backslash\\")
| 0 | 0 | 0 |
67fdb600ace0357bf7740af51ba96aa599f981ad | 117 | py | Python | applications/office_panel/admin.py | szypkiwonsz/Physiotherapy-Management-System | 36decab47890e2f4be259c8796f47324ffad28fe | [
"MIT"
] | null | null | null | applications/office_panel/admin.py | szypkiwonsz/Physiotherapy-Management-System | 36decab47890e2f4be259c8796f47324ffad28fe | [
"MIT"
] | 8 | 2020-08-17T14:36:02.000Z | 2022-03-12T00:33:50.000Z | applications/office_panel/admin.py | szypkiwonsz/Physiotherapy-Management-System | 36decab47890e2f4be259c8796f47324ffad28fe | [
"MIT"
] | null | null | null | from django.contrib import admin
from applications.office_panel.models import Patient
admin.site.register(Patient)
| 19.5 | 52 | 0.846154 | from django.contrib import admin
from applications.office_panel.models import Patient
admin.site.register(Patient)
| 0 | 0 | 0 |
ab535307120791d1a006ad845667f298fee948f7 | 857 | py | Python | catalog/tests/integration/models.py | dem4ply/quetzalcoatl | f9f72dc72f0da4f264c33128dc01b79f9fda5f2a | [
"WTFPL"
] | null | null | null | catalog/tests/integration/models.py | dem4ply/quetzalcoatl | f9f72dc72f0da4f264c33128dc01b79f9fda5f2a | [
"WTFPL"
] | 5 | 2021-03-18T23:01:10.000Z | 2021-09-22T18:28:27.000Z | catalog/tests/integration/models.py | dem4ply/quetzalcoatl | f9f72dc72f0da4f264c33128dc01b79f9fda5f2a | [
"WTFPL"
] | null | null | null | from catalog.tasks import scan_catalog, update_catalog
from chibi_gob_mx import catalog
import datetime
import unittest
from unittest.mock import patch, Mock
from catalog.factories import (
Catalog as Catalog_factory,
Catalog_with_id as Catalog_with_id_factory
)
from catalog.models import Catalog_pulse, Cat... | 27.645161 | 72 | 0.707118 | from catalog.tasks import scan_catalog, update_catalog
from chibi_gob_mx import catalog
import datetime
import unittest
from unittest.mock import patch, Mock
from catalog.factories import (
Catalog as Catalog_factory,
Catalog_with_id as Catalog_with_id_factory
)
from catalog.models import Catalog_pulse, Cat... | 454 | 26 | 49 |
77cfe83f9640f9085b301da94a09ca6496e4c640 | 716 | py | Python | shellexample.py | mpentler/edinbustrack | 18d08052a95907cca117cb6367da45ef64153e38 | [
"MIT"
] | 1 | 2017-12-07T18:38:30.000Z | 2017-12-07T18:38:30.000Z | shellexample.py | mpentler/edinbustrack | 18d08052a95907cca117cb6367da45ef64153e38 | [
"MIT"
] | 4 | 2017-12-07T15:15:09.000Z | 2020-04-26T21:34:41.000Z | shellexample.py | mpentler/edinbustrack | 18d08052a95907cca117cb6367da45ef64153e38 | [
"MIT"
] | null | null | null | # Edinburgh bus tracker - simple example output to a shell
# (c) Mark Pentler 2017
from edinbustrack import *
import os
from time import sleep
# setup our variables first. stop id and url are definable in case they change them
stop_id = "36232626" # grabbed from the mybustracker website
stop_name = get_stop_name(stop... | 28.64 | 83 | 0.684358 | # Edinburgh bus tracker - simple example output to a shell
# (c) Mark Pentler 2017
from edinbustrack import *
import os
from time import sleep
# setup our variables first. stop id and url are definable in case they change them
stop_id = "36232626" # grabbed from the mybustracker website
stop_name = get_stop_name(stop... | 0 | 0 | 0 |
80f1eb9c3a8de8272b6f44d9585bc600082a6618 | 46 | py | Python | pySPACE/tests/unittests/nodes/feature_generation/__init__.py | pyspace/pyspace | 763e62c0e7fa7cfcb19ccee1a0333c4f7e68ae62 | [
"BSD-3-Clause"
] | 32 | 2015-02-20T09:03:09.000Z | 2022-02-25T22:32:52.000Z | pySPACE/tests/unittests/nodes/feature_generation/__init__.py | pyspace/pyspace | 763e62c0e7fa7cfcb19ccee1a0333c4f7e68ae62 | [
"BSD-3-Clause"
] | 5 | 2015-05-18T15:08:40.000Z | 2020-03-05T19:18:01.000Z | pySPACE/tests/unittests/nodes/feature_generation/__init__.py | pyspace/pyspace | 763e62c0e7fa7cfcb19ccee1a0333c4f7e68ae62 | [
"BSD-3-Clause"
] | 18 | 2015-09-28T07:16:38.000Z | 2021-01-20T13:52:19.000Z | """ Unittests for nodes.feature_generation"""
| 23 | 45 | 0.76087 | """ Unittests for nodes.feature_generation"""
| 0 | 0 | 0 |
339cf5f6dac862489d3c1d5a082175cfb504a006 | 4,985 | py | Python | darts/tests/models/filtering/test_filters.py | shaginhekvs/darts | 145a30f8c9f3fb18ca33cf7b6d183da262d054c4 | [
"Apache-2.0"
] | null | null | null | darts/tests/models/filtering/test_filters.py | shaginhekvs/darts | 145a30f8c9f3fb18ca33cf7b6d183da262d054c4 | [
"Apache-2.0"
] | null | null | null | darts/tests/models/filtering/test_filters.py | shaginhekvs/darts | 145a30f8c9f3fb18ca33cf7b6d183da262d054c4 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import pandas as pd
from sklearn.gaussian_process.kernels import RBF, ExpSineSquared
from darts.models import GaussianProcessFilter
from darts.models.filtering.moving_average import MovingAverage
from darts.models.filtering.kalman_filter import KalmanFilter
from darts import TimeSeries
from darts.ut... | 36.123188 | 86 | 0.688666 | import numpy as np
import pandas as pd
from sklearn.gaussian_process.kernels import RBF, ExpSineSquared
from darts.models import GaussianProcessFilter
from darts.models.filtering.moving_average import MovingAverage
from darts.models.filtering.kalman_filter import KalmanFilter
from darts import TimeSeries
from darts.ut... | 1,773 | 2,391 | 145 |
7e95928a0784cff11e16904a215d1c7c5dc13fe0 | 1,429 | py | Python | networks/decoder.py | MrChenFeng/Project-Template | 42a335c6abb710bbae6407cbb0ca461533bc12f9 | [
"MIT"
] | null | null | null | networks/decoder.py | MrChenFeng/Project-Template | 42a335c6abb710bbae6407cbb0ca461533bc12f9 | [
"MIT"
] | null | null | null | networks/decoder.py | MrChenFeng/Project-Template | 42a335c6abb710bbae6407cbb0ca461533bc12f9 | [
"MIT"
] | null | null | null | import torch.nn as nn
from .base_model import Up_Conv_Block
class Decoder(nn.Module):
"""
Args:
N_p (int): The sum of the poses
N_z (int): The dimensions of the noise
"""
| 34.02381 | 68 | 0.568929 | import torch.nn as nn
from .base_model import Up_Conv_Block
class Decoder(nn.Module):
"""
Args:
N_p (int): The sum of the poses
N_z (int): The dimensions of the noise
"""
def __init__(self, h, w, p_dim=320, c_dim=320):
super(Decoder, self).__init__()
Fconv_layers = [
... | 1,174 | 0 | 54 |
9fb7f93ba058e57f23e93d22a758c61b872072a4 | 4,653 | py | Python | sparse_operation_kit/documents/tutorials/DLRM/dataset.py | aalbersk/DeepRec | f673a950780959b44dcda99398880a1d883ab338 | [
"Apache-2.0"
] | 292 | 2021-12-24T03:24:33.000Z | 2022-03-31T15:41:05.000Z | sparse_operation_kit/documents/tutorials/DLRM/dataset.py | aalbersk/DeepRec | f673a950780959b44dcda99398880a1d883ab338 | [
"Apache-2.0"
] | 72 | 2021-10-09T04:59:09.000Z | 2022-03-31T11:27:54.000Z | sparse_operation_kit/documents/tutorials/DLRM/dataset.py | aalbersk/DeepRec | f673a950780959b44dcda99398880a1d883ab338 | [
"Apache-2.0"
] | 75 | 2021-12-24T04:48:21.000Z | 2022-03-29T10:13:39.000Z | """
Copyright (c) 2021, NVIDIA CORPORATION.
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 ... | 39.769231 | 110 | 0.602622 | """
Copyright (c) 2021, NVIDIA CORPORATION.
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 ... | 2,832 | 0 | 53 |
a2747b2142f626061b57825c6ac20316d827f02b | 7,416 | py | Python | amromics/libs/element_finder.py | hoangnguyen177/amromics | 18f8c130ead373edd9c9380aade9edda31157682 | [
"MIT"
] | null | null | null | amromics/libs/element_finder.py | hoangnguyen177/amromics | 18f8c130ead373edd9c9380aade9edda31157682 | [
"MIT"
] | 7 | 2021-06-04T01:21:01.000Z | 2022-01-08T22:02:07.000Z | amromics/libs/element_finder.py | hoangnguyen177/amromics | 18f8c130ead373edd9c9380aade9edda31157682 | [
"MIT"
] | 1 | 2021-08-22T01:58:46.000Z | 2021-08-22T01:58:46.000Z | # -*- coding: utf-8 -*-
"""
Detect genes using blast
Revision history:
----------------
2020-02-13: Amromics created
"""
from __future__ import division, print_function, absolute_import
import subprocess
import os, shutil, glob
import re
import sys
import argparse
def blast(sample,db,output, identity=90, threads... | 31.828326 | 273 | 0.560005 | # -*- coding: utf-8 -*-
"""
Detect genes using blast
Revision history:
----------------
2020-02-13: Amromics created
"""
from __future__ import division, print_function, absolute_import
import subprocess
import os, shutil, glob
import re
import sys
import argparse
def search_amr(sample,output,threads=1):
db=... | 4,295 | 0 | 200 |
1ccd33378c88b1307460d4de28686b6d04859b05 | 2,894 | py | Python | pyci/tests/api/publish/test_pypi.py | iliapolo/pyrelease | 85784c556a0760d560378ef6edcfb32ab87048a5 | [
"Apache-2.0"
] | 5 | 2018-05-03T15:20:12.000Z | 2019-12-13T20:19:47.000Z | pyci/tests/api/publish/test_pypi.py | iliapolo/pyci | 85784c556a0760d560378ef6edcfb32ab87048a5 | [
"Apache-2.0"
] | 54 | 2018-04-09T06:34:50.000Z | 2020-03-30T06:13:39.000Z | pyci/tests/api/publish/test_pypi.py | iliapolo/pyrelease | 85784c556a0760d560378ef6edcfb32ab87048a5 | [
"Apache-2.0"
] | null | null | null | #############################################################################
# Copyright (c) 2018 Eli Polonsky. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http... | 33.264368 | 93 | 0.670698 | #############################################################################
# Copyright (c) 2018 Eli Polonsky. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http... | 1,786 | 0 | 138 |
31929ae5059f8e2d8c95294b7248d49cb625cdae | 174 | py | Python | hamcrest_unit_test/object_import.py | keis/PyHamcrest | 4202bf32a37405057d74db21de5aa7380202263d | [
"BSD-3-Clause"
] | null | null | null | hamcrest_unit_test/object_import.py | keis/PyHamcrest | 4202bf32a37405057d74db21de5aa7380202263d | [
"BSD-3-Clause"
] | null | null | null | hamcrest_unit_test/object_import.py | keis/PyHamcrest | 4202bf32a37405057d74db21de5aa7380202263d | [
"BSD-3-Clause"
] | null | null | null | from hamcrest import *
try:
except TypeError:
print 'Object class defined at ' + getattr(object, '__file__', 'NOWHERE')
raise
| 19.333333 | 77 | 0.66092 | from hamcrest import *
try:
class MyTest(object):
pass
except TypeError:
print 'Object class defined at ' + getattr(object, '__file__', 'NOWHERE')
raise
| 0 | 13 | 26 |
b16d3c00a2d511b39e3410fb1152d3d46b3c62b0 | 2,354 | py | Python | code/lowestcost_search/sol_328.py | bhavinjawade/project-euler-solutions | 56bf6a282730ed4b9b875fa081cf4509d9939d98 | [
"Apache-2.0"
] | 2 | 2020-07-16T08:16:32.000Z | 2020-10-01T07:16:48.000Z | code/lowestcost_search/sol_328.py | Psingh12354/project-euler-solutions | 56bf6a282730ed4b9b875fa081cf4509d9939d98 | [
"Apache-2.0"
] | null | null | null | code/lowestcost_search/sol_328.py | Psingh12354/project-euler-solutions | 56bf6a282730ed4b9b875fa081cf4509d9939d98 | [
"Apache-2.0"
] | 1 | 2021-05-07T18:06:08.000Z | 2021-05-07T18:06:08.000Z |
# -*- coding: utf-8 -*-
'''
File name: code\lowestcost_search\sol_328.py
Author: Vaidic Joshi
Date created: Oct 20, 2018
Python Version: 3.x
'''
# Solution to Project Euler Problem #328 :: Lowest-cost Search
#
# For more information see:
# https://projecteuler.net/problem=328
# Problem Statement
''... | 50.085106 | 193 | 0.724724 |
# -*- coding: utf-8 -*-
'''
File name: code\lowestcost_search\sol_328.py
Author: Vaidic Joshi
Date created: Oct 20, 2018
Python Version: 3.x
'''
# Solution to Project Euler Problem #328 :: Lowest-cost Search
#
# For more information see:
# https://projecteuler.net/problem=328
# Problem Statement
''... | 0 | 0 | 0 |
b072c49e27346ac83d3c732f50cfdf93bbc13737 | 1,558 | py | Python | caffenet.py | amasky/cnn | b5aa3e2195f91f8b5390adb1212aebe87318e976 | [
"MIT"
] | 4 | 2016-03-28T15:01:05.000Z | 2016-12-22T17:15:09.000Z | caffenet.py | masaki-y/Deep-Learning-with-Chainer | b5aa3e2195f91f8b5390adb1212aebe87318e976 | [
"MIT"
] | 1 | 2016-10-24T03:33:25.000Z | 2016-12-07T05:42:56.000Z | caffenet.py | masaki-y/Deep-Learning-with-Chainer | b5aa3e2195f91f8b5390adb1212aebe87318e976 | [
"MIT"
] | 3 | 2016-09-09T12:42:20.000Z | 2016-12-26T16:18:24.000Z | import chainer
import chainer.functions as F
import chainer.links as L
import numpy as np
| 36.232558 | 78 | 0.571245 | import chainer
import chainer.functions as F
import chainer.links as L
import numpy as np
class CaffeNet(chainer.Chain):
def __init__(self):
super(self.__class__, self).__init__(
conv1=L.Convolution2D(3, 96, ksize=11, stride=4),
conv2=L.Convolution2D(96, 256, ksize=5, pad=2),
... | 1,355 | 9 | 104 |
0a67d71e72e7c09815fb7ee305b3f9b0378d9291 | 16,036 | py | Python | foreshadow/tests/test_transformers/test_transformers.py | adithyabsk/foreshadow | ca2e927c396ae0d61923b287d6e32e142f3ba96f | [
"Apache-2.0"
] | 25 | 2018-07-26T17:30:31.000Z | 2021-02-23T22:54:01.000Z | foreshadow/tests/test_transformers/test_transformers.py | adithyabsk/foreshadow | ca2e927c396ae0d61923b287d6e32e142f3ba96f | [
"Apache-2.0"
] | 150 | 2018-11-02T18:09:12.000Z | 2020-05-15T01:01:35.000Z | foreshadow/tests/test_transformers/test_transformers.py | adithyabsk/foreshadow | ca2e927c396ae0d61923b287d6e32e142f3ba96f | [
"Apache-2.0"
] | 1 | 2019-02-20T22:24:00.000Z | 2019-02-20T22:24:00.000Z | import pytest
from foreshadow.cachemanager import CacheManager
from foreshadow.utils import get_transformer
from foreshadow.utils.testing import get_file_path
@pytest.fixture()
def smart_child():
"""Get a defined SmartTransformer subclass, TestSmartTransformer.
Note:
Always returns StandardScaler... | 27.888696 | 79 | 0.686268 | import pytest
from foreshadow.cachemanager import CacheManager
from foreshadow.utils import get_transformer
from foreshadow.utils.testing import get_file_path
def test_transformer_keep_cols():
import pandas as pd
from foreshadow.concrete import StandardScaler as CustomScaler
boston_path = get_file_path(... | 2,019 | 72 | 252 |
c526352dac2ffb891e1bedaea41b28e7baa046b3 | 543 | py | Python | code/early_stopping_example.py | leetschau/h2o | f28cbb43090d181689e01084607043116b036c26 | [
"MIT"
] | 93 | 2016-12-09T11:13:04.000Z | 2022-03-28T15:35:51.000Z | code/early_stopping_example.py | NivedhithaE/h2o | c077af549ab539b5f71218155f11e5fe3c25042c | [
"MIT"
] | 5 | 2016-12-27T08:55:16.000Z | 2017-12-22T09:42:36.000Z | code/early_stopping_example.py | NivedhithaE/h2o | c077af549ab539b5f71218155f11e5fe3c25042c | [
"MIT"
] | 114 | 2016-12-10T17:03:40.000Z | 2021-10-30T00:46:50.000Z | import h2o
h2o.init()
datasets = "https://raw.githubusercontent.com/DarrenCook/h2o/bk/datasets/"
data = h2o.import_file(datasets + "iris_wheader.csv")
y = "class"
x = data.names
x.remove(y)
train, valid, test = data.split_frame([0.75,0.15])
from h2o.estimators.random_forest import H2ORandomForestEstimator
m = H2ORand... | 25.857143 | 74 | 0.755064 | import h2o
h2o.init()
datasets = "https://raw.githubusercontent.com/DarrenCook/h2o/bk/datasets/"
data = h2o.import_file(datasets + "iris_wheader.csv")
y = "class"
x = data.names
x.remove(y)
train, valid, test = data.split_frame([0.75,0.15])
from h2o.estimators.random_forest import H2ORandomForestEstimator
m = H2ORand... | 0 | 0 | 0 |
6cfba6f9b5b7fec6717cafee87001ad25abde3b6 | 2,763 | py | Python | fable/fable_sources/libtbx/topological_sort.py | hickerson/bbn | 17ef63ad1717553ab2abb50592f8de79228c8523 | [
"MIT"
] | 4 | 2016-09-30T15:03:39.000Z | 2021-03-25T13:27:08.000Z | fable/fable_sources/libtbx/topological_sort.py | hickerson/bbn | 17ef63ad1717553ab2abb50592f8de79228c8523 | [
"MIT"
] | 1 | 2018-04-18T14:41:18.000Z | 2018-04-20T19:33:52.000Z | fable/fable_sources/libtbx/topological_sort.py | hickerson/bbn | 17ef63ad1717553ab2abb50592f8de79228c8523 | [
"MIT"
] | 3 | 2016-04-19T18:20:30.000Z | 2019-04-03T14:54:29.000Z | from __future__ import division
def strongly_connected_components(
successors_by_node,
omit_single_node_components=True,
low_infinite=2**30):
"""
successors_by_node = {
"node1": ["successor1", "successor2"],
"node2": ["successor1", "successor3"]
}
http://en.wikipedia.org/wiki/Tarjan%27s_strong... | 28.193878 | 79 | 0.650742 | from __future__ import division
def stable(connections):
ranks = {}
for node, deps in connections:
assert node not in ranks
ranks[node] = len(ranks)
deps_by_node = {}
for node, deps in connections:
deps_by_node[node] = deps
for d in deps:
if (d not in ranks):
ranks[d] = len(ranks)
... | 2,037 | 0 | 69 |
8043eb1b98bbf5eefa08ce46a782c4c4494192df | 5,047 | py | Python | rules/archive/src/fasta_utils.py | cmdoret/Acastellanii_genome_analysis | ae5111597431d1170cee0739c0fa258c97b8e65c | [
"MIT"
] | 5 | 2019-07-29T09:41:12.000Z | 2022-02-17T03:10:35.000Z | rules/archive/src/fasta_utils.py | cmdoret/Acastellanii_genome_analysis | ae5111597431d1170cee0739c0fa258c97b8e65c | [
"MIT"
] | null | null | null | rules/archive/src/fasta_utils.py | cmdoret/Acastellanii_genome_analysis | ae5111597431d1170cee0739c0fa258c97b8e65c | [
"MIT"
] | 1 | 2019-12-05T08:19:33.000Z | 2019-12-05T08:19:33.000Z | # Misc functions to operate on fasta files in the frame of the A. castellanii
# genome analysis project
# cmdoret, 20190502
from Bio import SeqIO
from BCBio import GFF
import time
import re
import os
def safe_request(fun):
"""
Wraps function requesting data to allow safe errors and retry.
Parameters
... | 31.154321 | 88 | 0.582524 | # Misc functions to operate on fasta files in the frame of the A. castellanii
# genome analysis project
# cmdoret, 20190502
from Bio import SeqIO
from BCBio import GFF
import time
import re
import os
def safe_request(fun):
"""
Wraps function requesting data to allow safe errors and retry.
Parameters
... | 462 | 0 | 27 |
5854ca8e78d8f1f094e5e781dde13f5c7ed9d917 | 5,602 | py | Python | expression_builder/tests/test_logic.py | django-advance-utils/expression-builder | 08dab5780ae3a8be90c4daa6b9950ad1af4d87a4 | [
"MIT"
] | null | null | null | expression_builder/tests/test_logic.py | django-advance-utils/expression-builder | 08dab5780ae3a8be90c4daa6b9950ad1af4d87a4 | [
"MIT"
] | null | null | null | expression_builder/tests/test_logic.py | django-advance-utils/expression-builder | 08dab5780ae3a8be90c4daa6b9950ad1af4d87a4 | [
"MIT"
] | null | null | null | import unittest
from expression_builder.expression_builder import ExpressionBuilder
# noinspection PyPep8Naming
| 35.232704 | 86 | 0.642628 | import unittest
from expression_builder.expression_builder import ExpressionBuilder
class LogicTests(unittest.TestCase):
# noinspection PyPep8Naming
def setUp(self):
self.exp = ExpressionBuilder()
def test_true(self):
result = self.exp.run_statement("true;")
self.assertEqual(Tru... | 4,420 | 15 | 1,048 |
6e5c8c9e3d2ab309657b1740c69d12fda94ee218 | 531 | py | Python | controllers/playlistExtractor.py | M-ArafatZaman/LyricsFinder | 6b9b8d65ce0a77c4083ebb276797301de62f46d1 | [
"MIT"
] | null | null | null | controllers/playlistExtractor.py | M-ArafatZaman/LyricsFinder | 6b9b8d65ce0a77c4083ebb276797301de62f46d1 | [
"MIT"
] | null | null | null | controllers/playlistExtractor.py | M-ArafatZaman/LyricsFinder | 6b9b8d65ce0a77c4083ebb276797301de62f46d1 | [
"MIT"
] | null | null | null | # Static typing
from typing import List
def getTrackName(apiResponse) -> List[str]:
'''
This function returns the string name of a single track from the reponse provided by the spotify API.
https://developer.spotify.com/console/get-playlist-tracks/
'''
name = apiResponse['track']['name']
artist... | 26.55 | 105 | 0.659134 | # Static typing
from typing import List
def getTrackName(apiResponse) -> List[str]:
'''
This function returns the string name of a single track from the reponse provided by the spotify API.
https://developer.spotify.com/console/get-playlist-tracks/
'''
name = apiResponse['track']['name']
artist... | 0 | 0 | 0 |
eb1762b6c5acd0f18415f1bcea184e7163ca6281 | 2,120 | py | Python | plugins/butia/pybot/drivers/ax.py | RodPy/Turtlebots.activity | f885d7d2e5d710c01294ae60da995dfb0eb36b21 | [
"MIT"
] | null | null | null | plugins/butia/pybot/drivers/ax.py | RodPy/Turtlebots.activity | f885d7d2e5d710c01294ae60da995dfb0eb36b21 | [
"MIT"
] | null | null | null | plugins/butia/pybot/drivers/ax.py | RodPy/Turtlebots.activity | f885d7d2e5d710c01294ae60da995dfb0eb36b21 | [
"MIT"
] | 1 | 2020-06-17T15:44:16.000Z | 2020-06-17T15:44:16.000Z |
RD_VERSION = 0x00
WRITE_INFO = 0x01
READ_INFO = 0x02
SEND_RAW = 0x03
| 25.238095 | 82 | 0.588208 |
RD_VERSION = 0x00
WRITE_INFO = 0x01
READ_INFO = 0x02
SEND_RAW = 0x03
def getVersion(dev):
dev.send([RD_VERSION])
raw = dev.read(3)
return raw[1] + raw[2] * 256
def writeInfo(dev, motor_id, regstart, value):
msg = [WRITE_INFO, motor_id, regstart, value / 256, value % 256]
dev.send(msg)
raw = ... | 1,841 | 0 | 207 |
db7593529fbb1b96b1e34faaf8135dc1bf1e9e8d | 2,149 | py | Python | policykit/integrations/discord/auth_backends.py | hozzjss/policykit | 8d00418d2caacf81cf1faacaf81ca1b2da6f6a48 | [
"MIT"
] | null | null | null | policykit/integrations/discord/auth_backends.py | hozzjss/policykit | 8d00418d2caacf81cf1faacaf81ca1b2da6f6a48 | [
"MIT"
] | null | null | null | policykit/integrations/discord/auth_backends.py | hozzjss/policykit | 8d00418d2caacf81cf1faacaf81ca1b2da6f6a48 | [
"MIT"
] | null | null | null | from django.contrib.auth.backends import BaseBackend
from django.contrib.auth.models import User
from integrations.discord.models import DiscordCommunity, DiscordUser
from urllib import parse
import urllib.request
import json
import logging
logger = logging.getLogger(__name__)
| 39.796296 | 139 | 0.65007 | from django.contrib.auth.backends import BaseBackend
from django.contrib.auth.models import User
from integrations.discord.models import DiscordCommunity, DiscordUser
from urllib import parse
import urllib.request
import json
import logging
logger = logging.getLogger(__name__)
class DiscordBackend(BaseBackend):
... | 1,780 | 13 | 77 |
57a795df85663bb5663faae53fe8b86145337055 | 60 | py | Python | epiinfo/__init__.py | Epi-Info/Epi-Info-Python-Package | 8a089e1ab997676e97ccbb7f9c61ec6f7d1bc8c3 | [
"Apache-2.0"
] | null | null | null | epiinfo/__init__.py | Epi-Info/Epi-Info-Python-Package | 8a089e1ab997676e97ccbb7f9c61ec6f7d1bc8c3 | [
"Apache-2.0"
] | null | null | null | epiinfo/__init__.py | Epi-Info/Epi-Info-Python-Package | 8a089e1ab997676e97ccbb7f9c61ec6f7d1bc8c3 | [
"Apache-2.0"
] | null | null | null | from epiinfo import CSUtilities
from epiinfo import randata
| 20 | 31 | 0.866667 | from epiinfo import CSUtilities
from epiinfo import randata
| 0 | 0 | 0 |
4a2a2b4cce4142cd3fd1db5441bc733518a8f6f3 | 504 | py | Python | miau.py | NelsonGomesNeto/ProgramC | e743b1b869f58f7f3022d18bac00c5e0b078562e | [
"MIT"
] | 3 | 2018-12-18T13:39:42.000Z | 2021-06-23T18:05:18.000Z | miau.py | NelsonGomesNeto/ProgramC | e743b1b869f58f7f3022d18bac00c5e0b078562e | [
"MIT"
] | 1 | 2018-11-02T21:32:40.000Z | 2018-11-02T22:47:12.000Z | miau.py | NelsonGomesNeto/ProgramC | e743b1b869f58f7f3022d18bac00c5e0b078562e | [
"MIT"
] | 6 | 2018-10-27T14:07:52.000Z | 2019-11-14T13:49:29.000Z |
# Q = int(input())
while (True):
try:
x,n = input().split()
x = float(x)
n = int(n)
print( '{:.4f}'.format(search(x,n)) )
except:
break
| 14 | 39 | 0.529762 | def expf(v,e):
if e == 1:
return v
ans = expf(v,e//2)
ans = ans*ans
if e%2 == 0:
return ans
return ans*v
pass
def search(v,n):
if v == 0 or v == 1:
return v
else :
begin = 0
end = max(v,1.0)
mid = 0
while end-begin > 0.000001:
mid = (begin+end)/2
if expf(mid,n) > v:
end = mid
else :
... | 310 | 0 | 45 |
d6c3ea15a4654023415ca8bfa7b6f9dd5ea0cf15 | 421 | py | Python | python/416PartitionEqualSubsetSum.py | zuisixian/LeetCode | 851498561e5006d4803151cff467864d36a1dc2e | [
"MIT"
] | null | null | null | python/416PartitionEqualSubsetSum.py | zuisixian/LeetCode | 851498561e5006d4803151cff467864d36a1dc2e | [
"MIT"
] | 1 | 2018-01-20T16:25:13.000Z | 2018-01-20T16:25:13.000Z | python/416PartitionEqualSubsetSum.py | zuisixian/LeetCode | 851498561e5006d4803151cff467864d36a1dc2e | [
"MIT"
] | 1 | 2018-01-09T14:08:06.000Z | 2018-01-09T14:08:06.000Z |
# !usr/bin/env python
# -*- coding:utf-8 -*-
if __name__ == "__main__":
print("hello")
| 18.304348 | 67 | 0.484561 |
# !usr/bin/env python
# -*- coding:utf-8 -*-
class Solution(object):
def canPartition(self, nums):
"""
:param nums: List(int)
:return:bool
"""
sum_val = 0
bits = 1
for num in nums:
sum_val += num
bits |= bits << num
return... | 0 | 301 | 23 |
e45ea71f6988eedf4511ae3ac3739a0a5d2513de | 1,162 | py | Python | bytes-booze/Team python 2/part1.py | AE-nv/aedvent-code-2021 | 7ce199d6be5f6cce2e61a9c0d26afd6d064a86a7 | [
"MIT"
] | 1 | 2021-12-02T12:09:11.000Z | 2021-12-02T12:09:11.000Z | bytes-booze/Team python 2/part1.py | AE-nv/aedvent-code-2021 | 7ce199d6be5f6cce2e61a9c0d26afd6d064a86a7 | [
"MIT"
] | null | null | null | bytes-booze/Team python 2/part1.py | AE-nv/aedvent-code-2021 | 7ce199d6be5f6cce2e61a9c0d26afd6d064a86a7 | [
"MIT"
] | 1 | 2021-12-01T21:14:41.000Z | 2021-12-01T21:14:41.000Z | if __name__ == '__main__':
with open("input.txt", 'r') as f:
data = f.readlines()
dancers="abcdefghijklmnop"
print(dancers)
instructions = data[0].strip().split(',')
for i in range(0, 1000000000):
for instruction in instructions:
command=instruction[0]
pars ... | 33.2 | 67 | 0.479346 | if __name__ == '__main__':
with open("input.txt", 'r') as f:
data = f.readlines()
dancers="abcdefghijklmnop"
print(dancers)
instructions = data[0].strip().split(',')
for i in range(0, 1000000000):
for instruction in instructions:
command=instruction[0]
pars ... | 0 | 0 | 0 |
8aea300c7c80841bf7e80289ca017204ec7df05b | 108 | py | Python | tests/syntax/annotated_name_global.py | friendly-traceback/friendly-traceback | 4f6785f14c271a4d6412ef19c140f9d380cdbcbf | [
"MIT"
] | 45 | 2021-07-06T03:30:20.000Z | 2022-03-16T17:30:58.000Z | tests/syntax/annotated_name_global.py | friendly-traceback/friendly-traceback | 4f6785f14c271a4d6412ef19c140f9d380cdbcbf | [
"MIT"
] | 110 | 2021-06-28T11:48:46.000Z | 2022-03-25T20:41:25.000Z | tests/syntax/annotated_name_global.py | friendly-traceback/friendly-traceback | 4f6785f14c271a4d6412ef19c140f9d380cdbcbf | [
"MIT"
] | 4 | 2021-07-05T20:56:39.000Z | 2021-11-11T20:24:34.000Z | # SyntaxError: annotated name 'var' can't be global
var = 0
foo() | 15.428571 | 51 | 0.62963 | # SyntaxError: annotated name 'var' can't be global
def foo():
global var
var:int = 1
var = 0
foo() | 20 | 0 | 22 |
dc6dc6f905ae88e1707691b85288bddeec342a46 | 1,285 | py | Python | test/rg_test.py | outkine/rgkit | eb5d80c0d1815cc016bf7c584310120991760cc8 | [
"Unlicense"
] | 1 | 2021-11-04T22:19:59.000Z | 2021-11-04T22:19:59.000Z | test/rg_test.py | outkine/rgkit | eb5d80c0d1815cc016bf7c584310120991760cc8 | [
"Unlicense"
] | null | null | null | test/rg_test.py | outkine/rgkit | eb5d80c0d1815cc016bf7c584310120991760cc8 | [
"Unlicense"
] | 2 | 2021-02-16T09:37:47.000Z | 2021-11-04T22:30:51.000Z | import ast
import pkg_resources
import unittest
from rgkit.settings import settings
from rgkit import rg
map_data = ast.literal_eval(
open(pkg_resources.resource_filename('rgkit', 'maps/default.py')).read())
settings.init_map(map_data)
| 30.595238 | 77 | 0.635019 | import ast
import pkg_resources
import unittest
from rgkit.settings import settings
from rgkit import rg
map_data = ast.literal_eval(
open(pkg_resources.resource_filename('rgkit', 'maps/default.py')).read())
settings.init_map(map_data)
class TestRG(unittest.TestCase):
def test_center(self):
self.ass... | 766 | 11 | 265 |
92c52c7719ca81b1fe5641da0de2cb19c8f71f79 | 844 | py | Python | coordinate_descent_svc/base_svm.py | Kubskiii/svm_coordinate_descent | faa7168d9b90dced05324b612d12484cb6381bdf | [
"MIT"
] | null | null | null | coordinate_descent_svc/base_svm.py | Kubskiii/svm_coordinate_descent | faa7168d9b90dced05324b612d12484cb6381bdf | [
"MIT"
] | null | null | null | coordinate_descent_svc/base_svm.py | Kubskiii/svm_coordinate_descent | faa7168d9b90dced05324b612d12484cb6381bdf | [
"MIT"
] | null | null | null | from sklearn.linear_model._base import LinearClassifierMixin, SparseCoefMixin
from sklearn.base import BaseEstimator
from sklearn.utils import check_X_y
from sklearn.utils.multiclass import unique_labels
from abc import abstractmethod
import numpy as np
| 31.259259 | 89 | 0.638626 | from sklearn.linear_model._base import LinearClassifierMixin, SparseCoefMixin
from sklearn.base import BaseEstimator
from sklearn.utils import check_X_y
from sklearn.utils.multiclass import unique_labels
from abc import abstractmethod
import numpy as np
class BaseSVM(BaseEstimator, LinearClassifierMixin, SparseCoefM... | 390 | 175 | 23 |
fcdc04c1945b98787166bc6d3717755d05232f19 | 2,480 | py | Python | SECDataTools/GetData/_cli.py | tnieds/SECDataTools | a29bfdafa673c9978df92ccc467909cce487c317 | [
"MIT"
] | 22 | 2018-01-16T09:33:04.000Z | 2021-11-10T03:20:08.000Z | SECDataTools/GetData/_cli.py | tnieds/SECDataTools | a29bfdafa673c9978df92ccc467909cce487c317 | [
"MIT"
] | null | null | null | SECDataTools/GetData/_cli.py | tnieds/SECDataTools | a29bfdafa673c9978df92ccc467909cce487c317 | [
"MIT"
] | 9 | 2018-04-03T13:32:46.000Z | 2022-01-22T01:54:39.000Z | import sys, argparse
parser = argparse.ArgumentParser(
description='''Download and extract zip archive(s) from
https://www.sec.gov/dera/data/financial-statement-data-sets.html.''')
parser.add_argument(
'-path',
type=str,
help='''Directory path that zip archives will be saved to. May be absolute
... | 34.929577 | 81 | 0.697581 | import sys, argparse
parser = argparse.ArgumentParser(
description='''Download and extract zip archive(s) from
https://www.sec.gov/dera/data/financial-statement-data-sets.html.''')
parser.add_argument(
'-path',
type=str,
help='''Directory path that zip archives will be saved to. May be absolute
... | 0 | 0 | 0 |
c09e4ebe1afc91820a7c60eae7150d087c63e24a | 13,269 | py | Python | briefmetrics/web/views/report.py | shazow/briefmetrics | b6ca5ac0980ae00ccc160e6456e36ade8a3e2eeb | [
"MIT"
] | 18 | 2020-02-06T23:31:43.000Z | 2022-02-09T00:32:42.000Z | briefmetrics/web/views/report.py | shazow/briefmetrics | b6ca5ac0980ae00ccc160e6456e36ade8a3e2eeb | [
"MIT"
] | 8 | 2020-02-08T23:00:46.000Z | 2021-07-27T20:52:12.000Z | briefmetrics/web/views/report.py | shazow/briefmetrics | b6ca5ac0980ae00ccc160e6456e36ade8a3e2eeb | [
"MIT"
] | 1 | 2020-07-09T12:59:27.000Z | 2020-07-09T12:59:27.000Z | from itertools import groupby
from unstdlib import now, get_many
from sqlalchemy import orm
from briefmetrics import api, model, tasks
from briefmetrics.web.environment import Response, httpexceptions
from briefmetrics.lib.controller import Controller, Context
from briefmetrics.lib.exceptions import APIControllerError... | 38.46087 | 179 | 0.670133 | from itertools import groupby
from unstdlib import now, get_many
from sqlalchemy import orm
from briefmetrics import api, model, tasks
from briefmetrics.web.environment import Response, httpexceptions
from briefmetrics.lib.controller import Controller, Context
from briefmetrics.lib.exceptions import APIControllerError... | 12,177 | 255 | 199 |
5805412b102e975a4c5e68f78412b44e89156bba | 6,064 | py | Python | skylearn/modules/decision_tree.py | sherwyn11/Skylearn.py | ab3069950a2f58222ccb9eefc1740f8896a0ea40 | [
"MIT"
] | 1 | 2020-05-17T21:24:34.000Z | 2020-05-17T21:24:34.000Z | skylearn/modules/decision_tree.py | sherwyn11/Skylearn.py | ab3069950a2f58222ccb9eefc1740f8896a0ea40 | [
"MIT"
] | null | null | null | skylearn/modules/decision_tree.py | sherwyn11/Skylearn.py | ab3069950a2f58222ccb9eefc1740f8896a0ea40 | [
"MIT"
] | 1 | 2020-04-26T11:11:08.000Z | 2020-04-26T11:11:08.000Z | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from flask import session
from sklearn.preprocessing import StandardScaler, LabelEncoder
from sklearn.model_selection import train_test_split, cross_val_score, KFold
from sklearn.tree import DecisionTreeClassifier, plot_tree
fr... | 28.739336 | 76 | 0.561675 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from flask import session
from sklearn.preprocessing import StandardScaler, LabelEncoder
from sklearn.model_selection import train_test_split, cross_val_score, KFold
from sklearn.tree import DecisionTreeClassifier, plot_tree
fr... | 5,429 | 0 | 46 |
11566d06747c0e121665c83105f4a86b6937232e | 108,628 | py | Python | catalogService_test/vcloudtest.py | sassoftware/-catalog-service | 4b68af224842a2e93f7a4bacdac1fc262ae7b917 | [
"Apache-2.0"
] | 3 | 2015-06-10T19:31:17.000Z | 2017-11-29T07:04:12.000Z | catalogService_test/vcloudtest.py | sassoftware/-catalog-service | 4b68af224842a2e93f7a4bacdac1fc262ae7b917 | [
"Apache-2.0"
] | null | null | null | catalogService_test/vcloudtest.py | sassoftware/-catalog-service | 4b68af224842a2e93f7a4bacdac1fc262ae7b917 | [
"Apache-2.0"
] | 2 | 2016-02-04T00:51:15.000Z | 2020-07-24T00:22:44.000Z | # vim: set fileencoding=utf-8 :
#
# Copyright (c) SAS Institute Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 56.48882 | 1,045 | 0.661901 | # vim: set fileencoding=utf-8 :
#
# Copyright (c) SAS Institute Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 30,406 | 76,502 | 92 |
cdbece1a7302da0ca0d501750b3a762b938eae60 | 3,491 | py | Python | src/test/pan_angle/calculate_point.py | chrisspen/homebot | cd1a5a2bddcb90d50a00e67b94297942827fbc61 | [
"MIT"
] | 8 | 2017-11-19T01:42:59.000Z | 2021-02-08T09:18:58.000Z | src/test/pan_angle/calculate_point.py | chrisspen/homebot | cd1a5a2bddcb90d50a00e67b94297942827fbc61 | [
"MIT"
] | 24 | 2017-02-14T16:50:02.000Z | 2017-06-07T18:38:20.000Z | src/test/pan_angle/calculate_point.py | chrisspen/homebot | cd1a5a2bddcb90d50a00e67b94297942827fbc61 | [
"MIT"
] | 6 | 2017-05-17T03:07:05.000Z | 2019-11-14T09:33:06.000Z | #!/usr/bin/env python
"""
given a point relative to the baseframe, calculate the necessary pan+tilt angle to point camera at it
given a pan+tilt angle, calculate the point relative to the base frame
"""
import unittest
#https://github.com/ros/geometry/blob/hydro-devel/tf/src/tf/transformations.py
from tf import trans... | 34.91 | 104 | 0.582641 | #!/usr/bin/env python
"""
given a point relative to the baseframe, calculate the necessary pan+tilt angle to point camera at it
given a pan+tilt angle, calculate the point relative to the base frame
"""
import unittest
#https://github.com/ros/geometry/blob/hydro-devel/tf/src/tf/transformations.py
from tf import trans... | 2,889 | 10 | 104 |
661f92d3e39c740aea21825c2ca35633d050e1e6 | 2,377 | py | Python | webkin/scaffold.py | mr-karan/castle | 5b22cf7b2888036df03af814ee84560c9ab6a3f8 | [
"MIT"
] | 52 | 2017-02-01T16:17:09.000Z | 2022-01-04T06:15:39.000Z | webkin/scaffold.py | mr-karan/castle | 5b22cf7b2888036df03af814ee84560c9ab6a3f8 | [
"MIT"
] | 7 | 2017-11-17T11:14:21.000Z | 2022-03-11T23:17:13.000Z | webkin/scaffold.py | mr-karan/castle | 5b22cf7b2888036df03af814ee84560c9ab6a3f8 | [
"MIT"
] | 7 | 2017-02-01T16:00:22.000Z | 2020-12-17T12:26:11.000Z | import logging
from os import getenv
__all__ = ['log', 'check_for_tokens']
logging.basicConfig(level=logging.INFO,
format='%(levelname)s: %(asctime)s -'
' %(funcName)s - %(message)s')
log = logging.getLogger('webkin')
| 37.140625 | 109 | 0.634413 | import logging
from os import getenv
__all__ = ['log', 'check_for_tokens']
logging.basicConfig(level=logging.INFO,
format='%(levelname)s: %(asctime)s -'
' %(funcName)s - %(message)s')
log = logging.getLogger('webkin')
def check_for_tokens():
log.debug('Checking for token... | 2,092 | 0 | 23 |
075d6ab68c9909fa6fbd2a00d8c70a663b839dee | 1,017 | py | Python | dautils/conf.py | diabloxenon/dautils | 064307b0fd9bbca2adcc7df5c6a0289954c74d58 | [
"MIT"
] | null | null | null | dautils/conf.py | diabloxenon/dautils | 064307b0fd9bbca2adcc7df5c6a0289954c74d58 | [
"MIT"
] | null | null | null | dautils/conf.py | diabloxenon/dautils | 064307b0fd9bbca2adcc7df5c6a0289954c74d58 | [
"MIT"
] | null | null | null | """ This module contains configuration utilities. """
import json
import os
FJSON = 'dautils.json'
def file_exists(tocheck):
""" Checks whether a file exists.
:param tocheck: The path of the file.
:returns: True if the file exists.
"""
return os.path.isfile(tocheck)
def read_rc():
""" Re... | 20.755102 | 68 | 0.637168 | """ This module contains configuration utilities. """
import json
import os
FJSON = 'dautils.json'
def file_exists(tocheck):
""" Checks whether a file exists.
:param tocheck: The path of the file.
:returns: True if the file exists.
"""
return os.path.isfile(tocheck)
def read_rc():
""" Re... | 0 | 0 | 0 |
fcb3831fe739af46294a7ee043f9cd887b8feec7 | 222 | py | Python | ch5-blog-app/blog/urls.py | benikim/beni-django | 56a3024c93cd30bcd2f934ad304917eda827e8bd | [
"MIT"
] | 16 | 2020-09-04T17:35:45.000Z | 2021-11-02T15:06:04.000Z | ch5-blog-app/blog/urls.py | benikim/beni-django | 56a3024c93cd30bcd2f934ad304917eda827e8bd | [
"MIT"
] | 32 | 2020-02-12T16:03:14.000Z | 2021-09-22T18:37:38.000Z | ch5-blog-app/blog/urls.py | benikim/beni-django | 56a3024c93cd30bcd2f934ad304917eda827e8bd | [
"MIT"
] | 8 | 2020-09-24T17:28:58.000Z | 2022-01-13T11:58:47.000Z | from django.urls import path
from .views import BlogDetailView, BlogListView
urlpatterns = [
path('post/<int:pk>/', BlogDetailView.as_view(), name='post_detail'),
path('', BlogListView.as_view(), name='home'),
]
| 24.666667 | 73 | 0.702703 | from django.urls import path
from .views import BlogDetailView, BlogListView
urlpatterns = [
path('post/<int:pk>/', BlogDetailView.as_view(), name='post_detail'),
path('', BlogListView.as_view(), name='home'),
]
| 0 | 0 | 0 |
f424431253d18eadd9cc573ad9a24a57f71c3f93 | 625 | py | Python | scripts/thrust_test.py | chutsu/red | 792d075896a70ad841a0951ecd7b4d412c57a422 | [
"BSD-4-Clause"
] | 1 | 2021-06-30T15:46:32.000Z | 2021-06-30T15:46:32.000Z | scripts/thrust_test.py | chutsu/red | 792d075896a70ad841a0951ecd7b4d412c57a422 | [
"BSD-4-Clause"
] | null | null | null | scripts/thrust_test.py | chutsu/red | 792d075896a70ad841a0951ecd7b4d412c57a422 | [
"BSD-4-Clause"
] | null | null | null | from time import sleep
import rospy
from geometry_msgs.msg import Quaternion
from geometry_msgs.msg import Vector3
from mavros_msgs.msg import Thrust
from mavros_msgs.msg import AttitudeTarget
node = rospy.init_node("thrust_test")
rate = rospy.Rate(20) # Hz
pub = rospy.Publisher('/mavros/setpoint_raw/attitude', Att... | 26.041667 | 84 | 0.7136 | from time import sleep
import rospy
from geometry_msgs.msg import Quaternion
from geometry_msgs.msg import Vector3
from mavros_msgs.msg import Thrust
from mavros_msgs.msg import AttitudeTarget
node = rospy.init_node("thrust_test")
rate = rospy.Rate(20) # Hz
pub = rospy.Publisher('/mavros/setpoint_raw/attitude', Att... | 0 | 0 | 0 |
da4aeeec2556daf2c80d848bd33bb3c7e4d477a3 | 462 | py | Python | smtp/gsetup.py | hwase0ng/klseScrappers | 367ac86b603fad35c4983b04f9e72d4694d4bc31 | [
"MIT"
] | 3 | 2020-05-27T06:01:12.000Z | 2021-11-29T20:56:06.000Z | smtp/gsetup.py | hwase0ng/klseScrappers | 367ac86b603fad35c4983b04f9e72d4694d4bc31 | [
"MIT"
] | 3 | 2020-03-08T14:45:16.000Z | 2021-12-13T19:47:14.000Z | smtp/gsetup.py | hwase0ng/klseScrappers | 367ac86b603fad35c4983b04f9e72d4694d4bc31 | [
"MIT"
] | null | null | null | """
Created on Mar 8, 2020
@author: hwase
"""
import settings as S
import yagmail
if __name__ == '__main__':
contents = ['This is the body, and here is just text http://somedomain/image.png',
'You can find an audio file attached.', '/local/path/song.mp3']
# yagmail.register(sender... | 30.8 | 97 | 0.660173 | """
Created on Mar 8, 2020
@author: hwase
"""
import settings as S
import yagmail
if __name__ == '__main__':
contents = ['This is the body, and here is just text http://somedomain/image.png',
'You can find an audio file attached.', '/local/path/song.mp3']
# yagmail.register(sender... | 0 | 0 | 0 |
f97c56a3649f2ae4d9558636fff18bf138c54d10 | 1,896 | py | Python | src/pathfinder.py | agingrasc/blitz2017 | 78d38d3782cfd4588ed1fcd1897064c34cc1b204 | [
"MIT"
] | null | null | null | src/pathfinder.py | agingrasc/blitz2017 | 78d38d3782cfd4588ed1fcd1897064c34cc1b204 | [
"MIT"
] | null | null | null | src/pathfinder.py | agingrasc/blitz2017 | 78d38d3782cfd4588ed1fcd1897064c34cc1b204 | [
"MIT"
] | null | null | null | from game import Game, TAVERN, TavernTile
import math
| 33.857143 | 90 | 0.649789 | from game import Game, TAVERN, TavernTile
import math
def get_our_hero_id(game):
for hero in game.heroes:
if hero.name == "Natural 20":
return hero.id
class Pathfinder:
def __init__(self, game):
assert isinstance(game, Game)
self.game = game
self.our_he... | 1,584 | -4 | 262 |
98ef460843e2e6e62531e036f3d4d82a96a84b7a | 2,438 | py | Python | lianjia/lianjia/items.py | Bruceey/PythonSpider | 4d64c45ca41d449f4950915887ef786ae812e7fa | [
"MIT"
] | 3 | 2021-05-21T03:31:35.000Z | 2021-07-03T11:39:05.000Z | lianjia/lianjia/items.py | Bruceey/PythonSpider | 4d64c45ca41d449f4950915887ef786ae812e7fa | [
"MIT"
] | null | null | null | lianjia/lianjia/items.py | Bruceey/PythonSpider | 4d64c45ca41d449f4950915887ef786ae812e7fa | [
"MIT"
] | 3 | 2021-04-14T15:09:00.000Z | 2021-12-13T14:37:54.000Z | # Define here the models for your scraped items
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/items.html
import scrapy
if __name__ == '__main__':
item = LianjiaItem()
item['联系方式'] = 'fasgseg'
for k, v in item.items():
print(k, v) | 23 | 53 | 0.576702 | # Define here the models for your scraped items
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/items.html
import scrapy
class LianjiaItem(scrapy.Item):
# 新房
collection = 'xinFang'
省份 = scrapy.Field()
城市 = scrapy.Field()
区域位置 = scrapy.Field()
小区 = scrapy.Field()
别名 = ... | 0 | 2,715 | 23 |
8f9823426670fdabd7a06936000ba1b874ff43ab | 976 | py | Python | section2/video5/oware/server/__main__.py | PacktPublishing/Mastering-Python-3.x-3rd-Edition | addfb6b1ecbc788030be119318386e1261ba6f2a | [
"MIT"
] | 6 | 2019-04-10T17:27:30.000Z | 2021-11-08T13:10:37.000Z | section2/video5/oware/server/__main__.py | PacktPublishing/Mastering-Python-3.x | 526f2d02266fa6c0a5badf892f2db177b2f52f64 | [
"MIT"
] | 2 | 2021-06-01T23:45:41.000Z | 2021-06-02T00:07:56.000Z | section2/video5/oware/server/__main__.py | PacktPublishing/Mastering-Python-3.x-3rd-Edition | addfb6b1ecbc788030be119318386e1261ba6f2a | [
"MIT"
] | 8 | 2019-01-30T01:59:47.000Z | 2022-03-01T06:03:06.000Z | """Minimal Oware server
This server doesn't actually implement the Oware game. It simply
allows a single client to connect, and speaks the game protocol well
enough to allow that client to run.
"""
import pickle
import socket
from ..model.board import Board
from ..util import ByteFIFO
if __name__ == '__main__':
... | 21.217391 | 68 | 0.564549 | """Minimal Oware server
This server doesn't actually implement the Oware game. It simply
allows a single client to connect, and speaks the game protocol well
enough to allow that client to run.
"""
import pickle
import socket
from ..model.board import Board
from ..util import ByteFIFO
def main():
board = Board(... | 625 | 0 | 23 |
a5b6994d19063fd117b1d86378fb7cf4323d7b7f | 1,644 | py | Python | Example code/Adafruit Dashboard/send data to simulated feed with paho-mqtt publish.py | SeekingAura/IoTCurseUTP | f98dda90f544e78b92733a5ed403fb56c943fc97 | [
"MIT"
] | null | null | null | Example code/Adafruit Dashboard/send data to simulated feed with paho-mqtt publish.py | SeekingAura/IoTCurseUTP | f98dda90f544e78b92733a5ed403fb56c943fc97 | [
"MIT"
] | null | null | null | Example code/Adafruit Dashboard/send data to simulated feed with paho-mqtt publish.py | SeekingAura/IoTCurseUTP | f98dda90f544e78b92733a5ed403fb56c943fc97 | [
"MIT"
] | 1 | 2019-06-20T21:59:06.000Z | 2019-06-20T21:59:06.000Z | # Import standard python modules
import threading
import time
import os
import sys
# Import paho MQTT client.
import paho.mqtt.client as mqtt
# Define callback functions which will be called when certain events happen.
# Define Functions for Threading
if __name__ == "__main__":
if(len(sys.argv)!=2):
sys.stderr... | 26.516129 | 76 | 0.750608 | # Import standard python modules
import threading
import time
import os
import sys
# Import paho MQTT client.
import paho.mqtt.client as mqtt
# Define callback functions which will be called when certain events happen.
def on_connect(client, userdata, flags, rc):
# Connected function will be called when the client c... | 426 | 0 | 67 |
6012de73d77efe30a12d9588cb10eb8c9bf74da1 | 1,033 | py | Python | Text2Mel/dataset.py | joisino/chainer-ETTTS | aa06b60e08a36402e72ea2660fe8de0e6f690b1d | [
"MIT"
] | 31 | 2017-12-24T12:49:07.000Z | 2022-02-25T16:33:39.000Z | Text2Mel/dataset.py | joisino/chainer-ETTTS | aa06b60e08a36402e72ea2660fe8de0e6f690b1d | [
"MIT"
] | null | null | null | Text2Mel/dataset.py | joisino/chainer-ETTTS | aa06b60e08a36402e72ea2660fe8de0e6f690b1d | [
"MIT"
] | 4 | 2018-09-05T03:25:51.000Z | 2019-11-21T03:59:14.000Z | import os
import numpy as np
import chainer
| 29.514286 | 79 | 0.541142 | import os
import numpy as np
import chainer
class SynthesisDataset(chainer.dataset.DatasetMixin):
def __init__(self, directory):
self.directory = directory
allfiles = os.listdir(directory)
self.bases = []
for f in allfiles:
if f[-8:] == '_mel.npy':
self.... | 853 | 32 | 103 |
8bdc017c55b6c0d0301ccaa66b55bd75b1b7d722 | 6,247 | py | Python | OpenGLES/GLKit/glkmath/vector2.py | pome-ta/pystaGLES | f52b51dd1364f87b22a12d7527482b76e7fab0bb | [
"MIT"
] | null | null | null | OpenGLES/GLKit/glkmath/vector2.py | pome-ta/pystaGLES | f52b51dd1364f87b22a12d7527482b76e7fab0bb | [
"MIT"
] | null | null | null | OpenGLES/GLKit/glkmath/vector2.py | pome-ta/pystaGLES | f52b51dd1364f87b22a12d7527482b76e7fab0bb | [
"MIT"
] | null | null | null | # coding: utf-8
import math
import ctypes
from objc_util import parse_struct
glk2 = parse_struct('{glkvec2=fff}')
'GLKVector2Make', 'GLKVector2MakeWithArray', 'GLKVector2Length', 'GLKVector2Distance', 'GLKVector2Negate', 'GLKVector2Normalize', 'GLKVector2AddScalar', 'GLKVector2SubtractSc... | 24.594488 | 521 | 0.714103 | # coding: utf-8
import math
import ctypes
from objc_util import parse_struct
class xy(ctypes.Structure):
_fields_ = [
('x', ctypes.c_float),
('y', ctypes.c_float),
]
class st(ctypes.Structure):
_fields_ = [
('s', ctypes.c_float),
('t', ctypes.c_float),
]
class float2(ctypes.Structure):
_... | 4,034 | 375 | 759 |
69c0a4b9503b191cf2caff06950e91d998bb7841 | 1,117 | py | Python | transforms/relatedactors.py | crits/mcrits | 5ea142ea277976c1694ca878cb4a4a4928341507 | [
"BSD-2-Clause"
] | 29 | 2015-01-09T17:30:17.000Z | 2019-07-26T18:19:55.000Z | transforms/relatedactors.py | crits/mcrits | 5ea142ea277976c1694ca878cb4a4a4928341507 | [
"BSD-2-Clause"
] | null | null | null | transforms/relatedactors.py | crits/mcrits | 5ea142ea277976c1694ca878cb4a4a4928341507 | [
"BSD-2-Clause"
] | 10 | 2015-04-22T21:49:34.000Z | 2019-08-16T06:57:14.000Z | from MaltegoTransform import *
from mcrits_utils import *
crits = mcrits()
me = MaltegoTransform()
me.parseArguments(sys.argv)
id_ = me.getVar('id')
crits_type = me.getVar('crits_type')
for result in crits.get_related(crits_type, id_, 'Actor'):
# For each related object, get the details.
obj = crits.get_sing... | 34.90625 | 63 | 0.585497 | from MaltegoTransform import *
from mcrits_utils import *
crits = mcrits()
me = MaltegoTransform()
me.parseArguments(sys.argv)
id_ = me.getVar('id')
crits_type = me.getVar('crits_type')
for result in crits.get_related(crits_type, id_, 'Actor'):
# For each related object, get the details.
obj = crits.get_sing... | 0 | 0 | 0 |
38c5940cbda5ed9d93092b9d10d436f03f4aadde | 73,055 | py | Python | pylacuna/tests/test_map.py | miketwo/pylacuna | ef2144cef6d5793b75e9c82018d434e0ff2b2c46 | [
"MIT"
] | null | null | null | pylacuna/tests/test_map.py | miketwo/pylacuna | ef2144cef6d5793b75e9c82018d434e0ff2b2c46 | [
"MIT"
] | null | null | null | pylacuna/tests/test_map.py | miketwo/pylacuna | ef2144cef6d5793b75e9c82018d434e0ff2b2c46 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
import os
import unittest
from mock import patch, MagicMock, ANY, call
import pylacuna.core.map
import ast
from sys import version_info
if version_info.major == 2:
import __builtin__ as builtins # pylint:disable=import-error
else:
import builtins # pylint:disable=import-err... | 24.697431 | 79 | 0.442762 | #!/usr/bin/env python
import sys
import os
import unittest
from mock import patch, MagicMock, ANY, call
import pylacuna.core.map
import ast
from sys import version_info
if version_info.major == 2:
import __builtin__ as builtins # pylint:disable=import-error
else:
import builtins # pylint:disable=import-err... | 794 | 12 | 126 |
0abd772ee0ab41462a8c9b47fe78cb63f355ef84 | 1,165 | py | Python | 12_Nguyen_Lam_Manh_Tuyen/1.6.py | lpython2006e/exercies | 84343eae57d86708a7984aa02f77183a4688a508 | [
"MIT"
] | null | null | null | 12_Nguyen_Lam_Manh_Tuyen/1.6.py | lpython2006e/exercies | 84343eae57d86708a7984aa02f77183a4688a508 | [
"MIT"
] | null | null | null | 12_Nguyen_Lam_Manh_Tuyen/1.6.py | lpython2006e/exercies | 84343eae57d86708a7984aa02f77183a4688a508 | [
"MIT"
] | 8 | 2020-07-10T14:13:54.000Z | 2020-08-03T08:17:50.000Z | #Write a guessing game where the user has to guess a secret number.
# After every guess the program tells the user whether their number was too large or too small.
# At the end the number of tries needed should be printed.
# It counts only as one try if they input the same number multiple times consecutively.
import ra... | 38.833333 | 95 | 0.68412 | #Write a guessing game where the user has to guess a secret number.
# After every guess the program tells the user whether their number was too large or too small.
# At the end the number of tries needed should be printed.
# It counts only as one try if they input the same number multiple times consecutively.
import ra... | 0 | 0 | 0 |
92bb77748c5a27612f3a9ba60f9e990fb4105d93 | 1,691 | py | Python | helpers/file_helper.py | aaron2708/pdf-tool-gui | d7410db9141beeccd51bb634003407fb6fbde129 | [
"MIT"
] | null | null | null | helpers/file_helper.py | aaron2708/pdf-tool-gui | d7410db9141beeccd51bb634003407fb6fbde129 | [
"MIT"
] | 2 | 2021-09-08T02:14:05.000Z | 2022-01-13T02:56:51.000Z | helpers/file_helper.py | aaron2708/pdf-tool-gui | d7410db9141beeccd51bb634003407fb6fbde129 | [
"MIT"
] | null | null | null | import os
from tkinter import filedialog, messagebox
from dialogs.password_prompt import askpassword
DOCUMENT_PATH = os.path.expanduser("~")
FILETYPE_ALL = ("All types", "*.*")
FILETYPE_PDF = ("PDF File", "*.pdf")
FILETYPE_CSV = ("CSV File", "*.csv")
DIALOG_TITLE = "Select {} file"
SAVE_DIALOG_TITLE = "Save as {} fil... | 24.507246 | 95 | 0.655825 | import os
from tkinter import filedialog, messagebox
from dialogs.password_prompt import askpassword
DOCUMENT_PATH = os.path.expanduser("~")
FILETYPE_ALL = ("All types", "*.*")
FILETYPE_PDF = ("PDF File", "*.pdf")
FILETYPE_CSV = ("CSV File", "*.csv")
DIALOG_TITLE = "Select {} file"
SAVE_DIALOG_TITLE = "Save as {} fil... | 1,225 | 0 | 138 |
1ec901f462288dbaad1589dc77f818bdd280eb04 | 104 | py | Python | schoolport/app_interaction/apps.py | yotink522/schoolport | c6cfd0230ca05fb44f77c2f27c7e200828547bd5 | [
"MIT"
] | null | null | null | schoolport/app_interaction/apps.py | yotink522/schoolport | c6cfd0230ca05fb44f77c2f27c7e200828547bd5 | [
"MIT"
] | null | null | null | schoolport/app_interaction/apps.py | yotink522/schoolport | c6cfd0230ca05fb44f77c2f27c7e200828547bd5 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
| 17.333333 | 38 | 0.788462 | from django.apps import AppConfig
class AppInteractionConfig(AppConfig):
name = 'app_interaction'
| 0 | 46 | 23 |
a3ee1e57a36a339f0c24300056ca9134c4614df7 | 1,152 | py | Python | megatron/model/fused_bias_dropout.py | igor0/gpt-neox | 3ad61952c290669d3741c01f767d41fdee5215c5 | [
"Apache-2.0"
] | 1,871 | 2020-12-22T14:44:29.000Z | 2022-03-31T14:21:40.000Z | megatron/model/fused_bias_dropout.py | igor0/gpt-neox | 3ad61952c290669d3741c01f767d41fdee5215c5 | [
"Apache-2.0"
] | 300 | 2020-12-23T17:51:43.000Z | 2022-03-30T17:34:42.000Z | megatron/model/fused_bias_dropout.py | igor0/gpt-neox | 3ad61952c290669d3741c01f767d41fdee5215c5 | [
"Apache-2.0"
] | 235 | 2020-12-23T19:45:19.000Z | 2022-03-31T20:33:47.000Z | import torch
import torch.nn.functional as F
from typing import Optional
from torch import Tensor
# flags required to enable jit fusion kernels
torch._C._jit_set_profiling_mode(False)
torch._C._jit_set_profiling_executor(False)
torch._C._jit_override_can_fuse_on_cpu(True)
torch._C._jit_override_can_fuse_on_gpu(True)
... | 33.882353 | 113 | 0.763889 | import torch
import torch.nn.functional as F
from typing import Optional
from torch import Tensor
# flags required to enable jit fusion kernels
torch._C._jit_set_profiling_mode(False)
torch._C._jit_set_profiling_executor(False)
torch._C._jit_override_can_fuse_on_cpu(True)
torch._C._jit_override_can_fuse_on_gpu(True)
... | 701 | 0 | 90 |
a8f6e5df5472916192af057ac1f30d9af744c426 | 4,416 | py | Python | src/zenml/cli/container_registry.py | svenaoki/zenml | b94dff83f0e7c8ab29e99d6b42a0c906a3512b63 | [
"Apache-2.0"
] | 565 | 2021-08-14T14:00:32.000Z | 2022-03-31T12:58:08.000Z | src/zenml/cli/container_registry.py | svenaoki/zenml | b94dff83f0e7c8ab29e99d6b42a0c906a3512b63 | [
"Apache-2.0"
] | 159 | 2021-08-16T08:27:10.000Z | 2022-03-31T14:07:30.000Z | src/zenml/cli/container_registry.py | svenaoki/zenml | b94dff83f0e7c8ab29e99d6b42a0c906a3512b63 | [
"Apache-2.0"
] | 64 | 2021-08-31T02:33:01.000Z | 2022-03-31T12:58:12.000Z | # Copyright (c) ZenML GmbH 2021. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 31.769784 | 104 | 0.715806 | # Copyright (c) ZenML GmbH 2021. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 0 | 0 | 0 |