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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4729617395af2416efcaa130869d5946a99d3d54 | 224 | py | Python | note24/order_system (3)/test2.py | icexmoon/python-learning-notes | 838c91d896404290b89992b6517be1b6a79df41f | [
"MIT"
] | null | null | null | note24/order_system (3)/test2.py | icexmoon/python-learning-notes | 838c91d896404290b89992b6517be1b6a79df41f | [
"MIT"
] | null | null | null | note24/order_system (3)/test2.py | icexmoon/python-learning-notes | 838c91d896404290b89992b6517be1b6a79df41f | [
"MIT"
] | null | null | null |
macroCommand = MacroCommand()
macroCommand() | 22.4 | 38 | 0.651786 | class MacroCommand():
def __init__(self, commands:list):
self.commands = commands
def __call__(self):
for command in self.commands:
command()
macroCommand = MacroCommand()
macroCommand() | 104 | 0 | 75 |
3a8ceb9c5e6bc6cf5b6a418a391cb2131fc167b1 | 339 | py | Python | graph_generator.py | zhaofeng-shu33/triangle_counting | 4a2f92ed005868f39934d983c6a633c888f8ccd8 | [
"Apache-2.0"
] | null | null | null | graph_generator.py | zhaofeng-shu33/triangle_counting | 4a2f92ed005868f39934d983c6a633c888f8ccd8 | [
"Apache-2.0"
] | 1 | 2019-10-01T08:59:46.000Z | 2019-10-04T14:06:49.000Z | graph_generator.py | zhaofeng-shu33/triangle_counting | 4a2f92ed005868f39934d983c6a633c888f8ccd8 | [
"Apache-2.0"
] | 1 | 2019-11-10T08:59:51.000Z | 2019-11-10T08:59:51.000Z | import struct
import os
BUILD_DIR = os.environ.get('BUILD_DIR', 'build')
if __name__ == '__main__':
f = open(os.path.join(BUILD_DIR, 'test_io.bin'), 'wb')
f.write(struct.pack('6I',0,1,2,0,1,2))
f.close()
f = open(os.path.join(BUILD_DIR, 'test_io_false.bin'), 'wb')
f.write(struct.pack('5I',0,1,1,2,... | 24.214286 | 64 | 0.619469 | import struct
import os
BUILD_DIR = os.environ.get('BUILD_DIR', 'build')
if __name__ == '__main__':
f = open(os.path.join(BUILD_DIR, 'test_io.bin'), 'wb')
f.write(struct.pack('6I',0,1,2,0,1,2))
f.close()
f = open(os.path.join(BUILD_DIR, 'test_io_false.bin'), 'wb')
f.write(struct.pack('5I',0,1,1,2,... | 0 | 0 | 0 |
4aea924e177a43d62285a6e6b23098f4fa4e3f5d | 9,999 | py | Python | figure1_additional.py | ashindin/Inclined_sweeps_HAARP | 547eca3d64a4043ba92c59333d009371863d79e4 | [
"MIT"
] | 1 | 2020-07-11T03:48:55.000Z | 2020-07-11T03:48:55.000Z | figure1_additional.py | ashindin/Inclined_sweeps_HAARP | 547eca3d64a4043ba92c59333d009371863d79e4 | [
"MIT"
] | null | null | null | figure1_additional.py | ashindin/Inclined_sweeps_HAARP | 547eca3d64a4043ba92c59333d009371863d79e4 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
plt.rcParams.update({'font.size': 18})
pol_thres=0.7
xlsx_filename='/home/ashindin/owncloud/0002_see_incl/Data_1_5.83.xlsx'
table=pd.read_excel(xlsx_filename, index_col=None, header=None)
Ex, Ey, Ez, h, X, T, n2, labs =[],[],[],[],[],[],[],[]
fo... | 40.481781 | 124 | 0.557956 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
plt.rcParams.update({'font.size': 18})
pol_thres=0.7
xlsx_filename='/home/ashindin/owncloud/0002_see_incl/Data_1_5.83.xlsx'
table=pd.read_excel(xlsx_filename, index_col=None, header=None)
Ex, Ey, Ez, h, X, T, n2, labs =[],[],[],[],[],[],[],[]
fo... | 0 | 0 | 0 |
fea688429f87982fb8a93218e858284b0251c00a | 33,835 | py | Python | src/python/process_scripts/map_characters.py | abd5ge/movievis | 1945b12128f8324dde5778bf7fffb7fc6d9b6cf3 | [
"MIT"
] | 2 | 2020-04-12T21:50:57.000Z | 2020-04-13T03:26:17.000Z | src/python/process_scripts/map_characters.py | abd5ge/movievis | 1945b12128f8324dde5778bf7fffb7fc6d9b6cf3 | [
"MIT"
] | 7 | 2020-11-13T18:45:29.000Z | 2022-03-12T00:23:54.000Z | src/python/process_scripts/map_characters.py | abd5ge/movievis | 1945b12128f8324dde5778bf7fffb7fc6d9b6cf3 | [
"MIT"
] | 2 | 2020-04-12T21:54:50.000Z | 2020-04-16T04:53:54.000Z | from __future__ import unicode_literals
import argparse
import csv
import json
import re
import os
import unicodedata
import itertools
import concurrent.futures
# import editdistance
import pandas as pd
try:
import pylcs
except:
print("Could not import pylcs; falling back to py_common_subseq")
import py_c... | 42.506281 | 173 | 0.597429 | from __future__ import unicode_literals
import argparse
import csv
import json
import re
import os
import unicodedata
import itertools
import concurrent.futures
# import editdistance
import pandas as pd
try:
import pylcs
def lcs(s1, s2):
return pylcs.lcs(s1, s2)
except:
print("Could not import pyl... | 18,809 | 12,773 | 853 |
63599d2a530e91d2e1d53e1418f911f544a0d91a | 295 | py | Python | tests/test_graphical_units/test_functions.py | osuzdalev/manim-1 | adab2430645637a5e7e73832d3a6ff9e7d390159 | [
"MIT"
] | 2 | 2021-08-22T14:51:53.000Z | 2021-10-17T16:01:24.000Z | tests/test_graphical_units/test_functions.py | osuzdalev/manim-1 | adab2430645637a5e7e73832d3a6ff9e7d390159 | [
"MIT"
] | null | null | null | tests/test_graphical_units/test_functions.py | osuzdalev/manim-1 | adab2430645637a5e7e73832d3a6ff9e7d390159 | [
"MIT"
] | 1 | 2021-03-31T20:46:51.000Z | 2021-03-31T20:46:51.000Z | from manim import *
from tests.test_graphical_units.testing.frames_comparison import frames_comparison
__module_test__ = "functions"
@frames_comparison
| 26.818182 | 87 | 0.762712 | from manim import *
from tests.test_graphical_units.testing.frames_comparison import frames_comparison
__module_test__ = "functions"
@frames_comparison
def test_FunctionGraph(scene):
graph = FunctionGraph(lambda x: 2 * np.cos(0.5 * x), x_range=[-PI, PI], color=BLUE)
scene.add(graph)
| 118 | 0 | 22 |
49ec8ce77ae6074466a6eae762a33a328017ef91 | 1,000 | py | Python | dcm/tests/store/test_local_dir.py | joshy/dcm | 7ee44b93f2d3c3f3638244791da9fdf9c331a9bb | [
"MIT"
] | 11 | 2021-05-07T08:37:56.000Z | 2022-03-23T17:05:08.000Z | dcm/tests/store/test_local_dir.py | joshy/dcm | 7ee44b93f2d3c3f3638244791da9fdf9c331a9bb | [
"MIT"
] | 4 | 2021-08-05T02:18:09.000Z | 2022-03-17T00:24:13.000Z | dcm/tests/store/test_local_dir.py | joshy/dcm | 7ee44b93f2d3c3f3638244791da9fdf9c331a9bb | [
"MIT"
] | 2 | 2021-08-04T06:33:42.000Z | 2022-01-12T12:09:22.000Z | import os
from pathlib import Path
from contextlib import AsyncExitStack
from tempfile import TemporaryDirectory
from glob import glob
import pydicom
from pytest import mark
from ...store.local_dir import LocalDir
from ..conftest import dicom_dir, dicom_files
@mark.asyncio
@mark.asyncio
| 27.027027 | 66 | 0.682 | import os
from pathlib import Path
from contextlib import AsyncExitStack
from tempfile import TemporaryDirectory
from glob import glob
import pydicom
from pytest import mark
from ...store.local_dir import LocalDir
from ..conftest import dicom_dir, dicom_files
@mark.asyncio
async def test_gen_chunks(make_local_dir... | 660 | 0 | 44 |
f2ba582488da19c49c781d84a748100228d2a6ee | 3,834 | py | Python | src/feature_selection.py | Benetti-Hub/Multiphase-Flow-Regimes | bd80439453469c0d6ff353dd42a2b00b2828bd2e | [
"Apache-2.0"
] | null | null | null | src/feature_selection.py | Benetti-Hub/Multiphase-Flow-Regimes | bd80439453469c0d6ff353dd42a2b00b2828bd2e | [
"Apache-2.0"
] | null | null | null | src/feature_selection.py | Benetti-Hub/Multiphase-Flow-Regimes | bd80439453469c0d6ff353dd42a2b00b2828bd2e | [
"Apache-2.0"
] | null | null | null | '''Utility functions for the Feature Selection Notebook'''
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.model_selection import StratifiedKFold
from sklearn.metrics import accuracy_score, f1_score
import lightgbm as lgbm
def plot_ANOVA(imp_f_classif, save=True):
'''
Plo... | 31.42623 | 106 | 0.619718 | '''Utility functions for the Feature Selection Notebook'''
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.model_selection import StratifiedKFold
from sklearn.metrics import accuracy_score, f1_score
import lightgbm as lgbm
def plot_ANOVA(imp_f_classif, save=True):
'''
Plo... | 0 | 0 | 0 |
9d8b56b7dd586d93afc47913b1898f5ab7883e14 | 341 | py | Python | tagging/migrations/0004_merge_20180921_1247.py | strugo/django-tagging | c7720535556c5f15aef0aaf392000b0c97965537 | [
"BSD-3-Clause"
] | 1 | 2021-02-14T18:49:18.000Z | 2021-02-14T18:49:18.000Z | tagging/migrations/0004_merge_20180921_1247.py | strugo/django-tagging | c7720535556c5f15aef0aaf392000b0c97965537 | [
"BSD-3-Clause"
] | null | null | null | tagging/migrations/0004_merge_20180921_1247.py | strugo/django-tagging | c7720535556c5f15aef0aaf392000b0c97965537 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-09-21 12:47
from __future__ import unicode_literals
from django.db import migrations
| 20.058824 | 49 | 0.665689 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-09-21 12:47
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('tagging', '0003_adapt_max_tag_length'),
('tagging', '0003_auto_20161115_0906'),
]
... | 0 | 169 | 23 |
d136f1527e08ce39d7b8a7e660f9c6532911f3ed | 1,509 | py | Python | shopyo/app.py | MrSunshyne/shopyo | cd3fe9942841743007f109e51469e8497680a678 | [
"MIT"
] | 1 | 2020-04-05T13:03:11.000Z | 2020-04-05T13:03:11.000Z | shopyo/app.py | MrSunshyne/shopyo | cd3fe9942841743007f109e51469e8497680a678 | [
"MIT"
] | null | null | null | shopyo/app.py | MrSunshyne/shopyo | cd3fe9942841743007f109e51469e8497680a678 | [
"MIT"
] | null | null | null | from flask import Flask, redirect
from flask_wtf.csrf import CSRFProtect
from addon import db, login_manager, ma
from config import app_config
app = create_app('development')
if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0')
| 30.795918 | 69 | 0.777336 | from flask import Flask, redirect
from flask_wtf.csrf import CSRFProtect
from addon import db, login_manager, ma
from config import app_config
def create_app(config_name):
app = Flask(__name__)
app.config.from_object(app_config[config_name])
db.init_app(app)
ma.init_app(app)
login_manager.init_a... | 1,238 | 0 | 23 |
0489731e34107e54ace58ece45592ae663e898e0 | 13,780 | py | Python | test/dynamics/models/test_generator_models.py | mtreinish/qiskit-dynamics | 1c2abca01e4f1bf4c66431103340ecd6c5f67817 | [
"Apache-2.0"
] | null | null | null | test/dynamics/models/test_generator_models.py | mtreinish/qiskit-dynamics | 1c2abca01e4f1bf4c66431103340ecd6c5f67817 | [
"Apache-2.0"
] | null | null | null | test/dynamics/models/test_generator_models.py | mtreinish/qiskit-dynamics | 1c2abca01e4f1bf4c66431103340ecd6c5f67817 | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | 35.153061 | 99 | 0.603338 | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | 1,852 | 0 | 112 |
7dbb46434026418f35f91a9285c0767203877e0b | 4,354 | py | Python | im_v2/ccxt/data/extract/download_historical_data.py | alphamatic/amp | 5018137097159415c10eaa659a2e0de8c4e403d4 | [
"BSD-3-Clause"
] | 5 | 2021-08-10T23:16:44.000Z | 2022-03-17T17:27:00.000Z | im_v2/ccxt/data/extract/download_historical_data.py | alphamatic/amp | 5018137097159415c10eaa659a2e0de8c4e403d4 | [
"BSD-3-Clause"
] | 330 | 2021-06-10T17:28:22.000Z | 2022-03-31T00:55:48.000Z | im_v2/ccxt/data/extract/download_historical_data.py | alphamatic/amp | 5018137097159415c10eaa659a2e0de8c4e403d4 | [
"BSD-3-Clause"
] | 6 | 2021-06-10T17:20:32.000Z | 2022-03-28T08:08:03.000Z | #!/usr/bin/env python
"""
Script to download historical data from CCXT.
Use as:
# Download data for CCXT for trading universe `v03` from 2019-01-01 to now:
> download_historical_data.py \
--dst_dir 'test' \
--universe 'v03' \
--start_datetime '2019-01-01'
Import as:
import im_v2.ccxt.data.extract.dow... | 30.447552 | 80 | 0.628158 | #!/usr/bin/env python
"""
Script to download historical data from CCXT.
Use as:
# Download data for CCXT for trading universe `v03` from 2019-01-01 to now:
> download_historical_data.py \
--dst_dir 'test' \
--universe 'v03' \
--start_datetime '2019-01-01'
Import as:
import im_v2.ccxt.data.extract.dow... | 3,588 | 0 | 46 |
7dc34db5f2dc00dd11e93a3fc1b4656f6a345054 | 509 | py | Python | hw4_ch.py | AeliaKavington/sel-1 | 1d1af349a567a50c14a7e3ece2fa44e119ddb777 | [
"MIT"
] | null | null | null | hw4_ch.py | AeliaKavington/sel-1 | 1d1af349a567a50c14a7e3ece2fa44e119ddb777 | [
"MIT"
] | null | null | null | hw4_ch.py | AeliaKavington/sel-1 | 1d1af349a567a50c14a7e3ece2fa44e119ddb777 | [
"MIT"
] | null | null | null | import pytest
from time import sleep
from selenium import webdriver
@pytest.fixture
| 28.277778 | 68 | 0.740668 | import pytest
from time import sleep
from selenium import webdriver
@pytest.fixture
def driver(request):
wd = webdriver.Chrome(executable_path='./chromedriver')
print(wd.capabilities)
request.addfinalizer(wd.quit)
return wd
def test_example(driver):
driver.get("http://localhost/litecart/en/")
... | 379 | 0 | 45 |
590d8de8bf744cdfaa4d9f3f82d36a9864edf3bf | 25,183 | py | Python | python/handler.py | kgladstone/thesis | 6e35fbd7c2cd08e868ce5c36cd64e8025c9e5f53 | [
"BSD-3-Clause"
] | null | null | null | python/handler.py | kgladstone/thesis | 6e35fbd7c2cd08e868ce5c36cd64e8025c9e5f53 | [
"BSD-3-Clause"
] | null | null | null | python/handler.py | kgladstone/thesis | 6e35fbd7c2cd08e868ce5c36cd64e8025c9e5f53 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""
Filename: handler.py
Author: Keith Gladstone
Description:
This file is the heart of the program
It handles all vehicle allocation and repositioning
Contains trip_buffer, trip_location_hash_table, etc.
"""
import csv
import sys
from collections import deque
from math im... | 43.796522 | 98 | 0.64611 | #!/usr/bin/env python
"""
Filename: handler.py
Author: Keith Gladstone
Description:
This file is the heart of the program
It handles all vehicle allocation and repositioning
Contains trip_buffer, trip_location_hash_table, etc.
"""
import csv
import sys
from collections import deque
from math im... | 0 | 0 | 0 |
914cfd77d3892cb4712872995721e9e8cf776aec | 1,212 | py | Python | core/forms.py | Jokotoye18/DjangoEcommerce | ce17e7a36cff72623f67eb01221bdec323ebfb31 | [
"MIT"
] | null | null | null | core/forms.py | Jokotoye18/DjangoEcommerce | ce17e7a36cff72623f67eb01221bdec323ebfb31 | [
"MIT"
] | 4 | 2021-03-30T14:22:12.000Z | 2021-06-10T19:35:45.000Z | core/forms.py | Jokotoye18/DjangoEcommerce | ce17e7a36cff72623f67eb01221bdec323ebfb31 | [
"MIT"
] | null | null | null | from django import forms
from .models import BillingAddress
from django_countries.fields import CountryField
from django_countries.widgets import CountrySelectWidget
PAYMENT_METHOD = (
('S', 'stripe'),
('P', 'paypal')
) | 46.615385 | 130 | 0.70132 | from django import forms
from .models import BillingAddress
from django_countries.fields import CountryField
from django_countries.widgets import CountrySelectWidget
PAYMENT_METHOD = (
('S', 'stripe'),
('P', 'paypal')
)
class BillingAddressForm(forms.ModelForm):
same_billing_address = forms.BooleanField(... | 0 | 960 | 23 |
1059d59a682bc6b834dfb4596560d911b23842dc | 485 | py | Python | sea/contrib/extensions/celery/cmd.py | leesnhyun/sea | 40796be02b43ad1a1e79c54765b755fe67442e36 | [
"MIT"
] | null | null | null | sea/contrib/extensions/celery/cmd.py | leesnhyun/sea | 40796be02b43ad1a1e79c54765b755fe67442e36 | [
"MIT"
] | null | null | null | sea/contrib/extensions/celery/cmd.py | leesnhyun/sea | 40796be02b43ad1a1e79c54765b755fe67442e36 | [
"MIT"
] | null | null | null | import sys
from celery.__main__ import main as celerymain
from sea.cli import jobm
@jobm.job("async_task", proxy=True, help="invoke celery cmds for async tasks")
@jobm.job("bus", proxy=True, help="invoke celery cmds for bus")
| 21.086957 | 78 | 0.665979 | import sys
from celery.__main__ import main as celerymain
from sea.cli import jobm
def celery(argv, app):
sys.argv = (
["celery"] + argv + ["-A", "app.extensions:{app}".format(app=app)]
)
return celerymain()
@jobm.job("async_task", proxy=True, help="invoke celery cmds for async tasks")
def asy... | 185 | 0 | 67 |
37788a8ca874e96f8e6c2587f107172bb4db2bb4 | 7,274 | py | Python | src/third_party/wiredtiger/test/suite/test_verbose03.py | benety/mongo | 203430ac9559f82ca01e3cbb3b0e09149fec0835 | [
"Apache-2.0"
] | null | null | null | src/third_party/wiredtiger/test/suite/test_verbose03.py | benety/mongo | 203430ac9559f82ca01e3cbb3b0e09149fec0835 | [
"Apache-2.0"
] | null | null | null | src/third_party/wiredtiger/test/suite/test_verbose03.py | benety/mongo | 203430ac9559f82ca01e3cbb3b0e09149fec0835 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Public Domain 2014-present MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a com... | 47.855263 | 135 | 0.678994 | #!/usr/bin/env python
#
# Public Domain 2014-present MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a com... | 5,039 | 440 | 22 |
b69313242ff3954bc2e977fe3a858149821e416d | 257 | py | Python | app/api/db/petition_test_data.py | ChegeBryan/politico | 746ef4c76931928ef145593092c8b391421a50fd | [
"MIT"
] | 1 | 2021-09-08T13:17:03.000Z | 2021-09-08T13:17:03.000Z | app/api/db/petition_test_data.py | ChegeBryan/politico | 746ef4c76931928ef145593092c8b391421a50fd | [
"MIT"
] | 62 | 2019-02-04T07:08:32.000Z | 2021-05-06T19:49:03.000Z | app/api/db/petition_test_data.py | ChegeBryan/politico | 746ef4c76931928ef145593092c8b391421a50fd | [
"MIT"
] | 5 | 2019-02-11T18:21:14.000Z | 2022-02-25T07:41:07.000Z | # petition test dummy data
petition = {
"office": 1,
"contested_by": 2,
"body": "some string",
"evidence": ['https://image.url']
}
invalid_petition_data = {
"office": "Not integer",
"body": 2,
"evidence": "Not a list of url"
}
| 17.133333 | 37 | 0.571984 | # petition test dummy data
petition = {
"office": 1,
"contested_by": 2,
"body": "some string",
"evidence": ['https://image.url']
}
invalid_petition_data = {
"office": "Not integer",
"body": 2,
"evidence": "Not a list of url"
}
| 0 | 0 | 0 |
873a65b9ef155fde35bc54bd1a84d03fd2c17704 | 451 | py | Python | src/kedro_devops/pipelines/data_engineering/nodes/transform_uppercase.py | julianlrcsumz/kedro-devops | 873fbd35a1c47d1b97786e516d70b1b9ece83664 | [
"MIT"
] | null | null | null | src/kedro_devops/pipelines/data_engineering/nodes/transform_uppercase.py | julianlrcsumz/kedro-devops | 873fbd35a1c47d1b97786e516d70b1b9ece83664 | [
"MIT"
] | null | null | null | src/kedro_devops/pipelines/data_engineering/nodes/transform_uppercase.py | julianlrcsumz/kedro-devops | 873fbd35a1c47d1b97786e516d70b1b9ece83664 | [
"MIT"
] | 4 | 2021-10-15T13:36:53.000Z | 2021-11-12T16:16:50.000Z | import pandas as pd
from requests import Response
def transform_uppercase(data_set: Response) -> pd.DataFrame:
"""
Transform a lowercase dataframe to uppercase.
Args:
data (pd.DataFrame): A raw dataframe
Returns:
pd.DataFrame: An uppercase dataframe
"""
json_data = data_set.j... | 23.736842 | 60 | 0.68071 | import pandas as pd
from requests import Response
def transform_uppercase(data_set: Response) -> pd.DataFrame:
"""
Transform a lowercase dataframe to uppercase.
Args:
data (pd.DataFrame): A raw dataframe
Returns:
pd.DataFrame: An uppercase dataframe
"""
json_data = data_set.j... | 0 | 0 | 0 |
23660dc491a39ae78ddad366f825d8b7d3630c41 | 535 | py | Python | CURSO UDEMY/TEORICAS/5.py | CamilliCerutti/Exercicios-de-Python-curso-em-video | 6571a5c5cb7b4398352a7778c55588c0c16f13c2 | [
"MIT"
] | null | null | null | CURSO UDEMY/TEORICAS/5.py | CamilliCerutti/Exercicios-de-Python-curso-em-video | 6571a5c5cb7b4398352a7778c55588c0c16f13c2 | [
"MIT"
] | null | null | null | CURSO UDEMY/TEORICAS/5.py | CamilliCerutti/Exercicios-de-Python-curso-em-video | 6571a5c5cb7b4398352a7778c55588c0c16f13c2 | [
"MIT"
] | null | null | null | frase = 'O rato roeu a roupa do rei de roma'
tamanho = len(frase)
contador = 0
nova_string = ''
print(frase)
while True:
input_do_usuario = input('Qual letra voce deseja colocar maiuscula: ')
if input_do_usuario not in frase:
print('Escolha uma letra que esteja no texto')
else:
break
whi... | 21.4 | 74 | 0.657944 | frase = 'O rato roeu a roupa do rei de roma'
tamanho = len(frase)
contador = 0
nova_string = ''
print(frase)
while True:
input_do_usuario = input('Qual letra voce deseja colocar maiuscula: ')
if input_do_usuario not in frase:
print('Escolha uma letra que esteja no texto')
else:
break
whi... | 0 | 0 | 0 |
9cf65e28a279c6041cf2dd8a3d2c3545e5e2c9ed | 2,994 | py | Python | Layer.py | orishamir/OriScapy | 68acbe9c4ccefcdf611de58277e64a4055111a58 | [
"MIT"
] | null | null | null | Layer.py | orishamir/OriScapy | 68acbe9c4ccefcdf611de58277e64a4055111a58 | [
"MIT"
] | null | null | null | Layer.py | orishamir/OriScapy | 68acbe9c4ccefcdf611de58277e64a4055111a58 | [
"MIT"
] | null | null | null | from abc import ABCMeta, abstractmethod
from colorama import init, Fore, Style
RST = Style.RESET_ALL
init() | 31.851064 | 147 | 0.514696 | from abc import ABCMeta, abstractmethod
from colorama import init, Fore, Style
RST = Style.RESET_ALL
init()
class Layer(metaclass=ABCMeta):
def __truediv__(self, other):
if hasattr(self, 'data'):
self.data = self.data / other
else:
self.data = other
return self
... | 2,183 | 681 | 23 |
0a0859528945a7b944482442b0ffc658d0dc05f9 | 18,295 | py | Python | fsl/utils/path.py | physimals/fslpy | 10dd3f996c79d402c65cf0af724b8b00082d5176 | [
"Apache-2.0"
] | null | null | null | fsl/utils/path.py | physimals/fslpy | 10dd3f996c79d402c65cf0af724b8b00082d5176 | [
"Apache-2.0"
] | null | null | null | fsl/utils/path.py | physimals/fslpy | 10dd3f996c79d402c65cf0af724b8b00082d5176 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# path.py - Utility functions for working with file/directory paths.
#
# Author: Paul McCarthy <pauldmccarthy@gmail.com>
#
"""This module contains a few utility functions for working with file system
paths.
.. autosummary::
:nosignatures:
deepest
shallowest
allFiles
hasExt
a... | 31.166951 | 108 | 0.607598 | #!/usr/bin/env python
#
# path.py - Utility functions for working with file/directory paths.
#
# Author: Paul McCarthy <pauldmccarthy@gmail.com>
#
"""This module contains a few utility functions for working with file system
paths.
.. autosummary::
:nosignatures:
deepest
shallowest
allFiles
hasExt
a... | 0 | 0 | 0 |
45a3d4d8a1f127580265a0a3c5979a90f99be58c | 2,219 | py | Python | implementation/data_io.py | rpalo/masters-thesis | fcc0beb933634b17dbe41bde982e947204fd498b | [
"MIT"
] | null | null | null | implementation/data_io.py | rpalo/masters-thesis | fcc0beb933634b17dbe41bde982e947204fd498b | [
"MIT"
] | null | null | null | implementation/data_io.py | rpalo/masters-thesis | fcc0beb933634b17dbe41bde982e947204fd498b | [
"MIT"
] | null | null | null | """Data I/O: Import and export data to other useable formats."""
import csv
from pathlib import Path
from model import Job
def import_csv(filename, base_dir=Path("data/")):
"""Converts CSV files with the relevant data (see columns below) to
a list of Jobs.
"""
datafile = base_dir / filename
with ... | 36.377049 | 85 | 0.545291 | """Data I/O: Import and export data to other useable formats."""
import csv
from pathlib import Path
from model import Job
def import_csv(filename, base_dir=Path("data/")):
"""Converts CSV files with the relevant data (see columns below) to
a list of Jobs.
"""
datafile = base_dir / filename
with ... | 0 | 0 | 0 |
4b6df05e93d40512d05614cf34c5a45fa482901a | 3,203 | py | Python | main.py | dilynfullerton/turing | f175b14b1fb1afe9f2bfeebd1cc069eef6658706 | [
"CC0-1.0"
] | 3 | 2016-07-20T08:46:55.000Z | 2018-05-14T11:27:41.000Z | main.py | dilynfullerton/turing | f175b14b1fb1afe9f2bfeebd1cc069eef6658706 | [
"CC0-1.0"
] | null | null | null | main.py | dilynfullerton/turing | f175b14b1fb1afe9f2bfeebd1cc069eef6658706 | [
"CC0-1.0"
] | null | null | null | from turing import turing_machine_from_file
from turing import tape_from_file
from turing import Tape
main()
| 31.401961 | 80 | 0.652825 | from turing import turing_machine_from_file
from turing import tape_from_file
from turing import Tape
def main():
# busy_beaver3 = turing_machine_from_file('examples/bb3.txt')
# busy_beaver3.compute(
# input_tape='examples/bb3_input.txt',
# print_results=False)
#
# busy_beaver4 = turin... | 3,068 | 0 | 23 |
3494f87ceb9d94ec03be1cb6fd48f0923ce4c7df | 7,460 | py | Python | tests/jaxpr_effects_test.py | mbmccoy/jax | 74346f464bc8369d81964305fcf05f95f43fb2d3 | [
"Apache-2.0"
] | null | null | null | tests/jaxpr_effects_test.py | mbmccoy/jax | 74346f464bc8369d81964305fcf05f95f43fb2d3 | [
"Apache-2.0"
] | 3 | 2022-01-24T06:14:55.000Z | 2022-02-14T06:15:38.000Z | tests/jaxpr_effects_test.py | mbmccoy/jax | 74346f464bc8369d81964305fcf05f95f43fb2d3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 29.959839 | 78 | 0.684316 | # Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 5,524 | 442 | 314 |
7c48d9a6536a3ab26943aaff46659b78907afae2 | 14,748 | py | Python | stage3/06-install-jamulus/files/midi-jamulus-xtouchmini-16ch.py | kdoren/pi-gen | f4421d81bf6b90232e5d39878e03016005324f92 | [
"BSD-3-Clause"
] | null | null | null | stage3/06-install-jamulus/files/midi-jamulus-xtouchmini-16ch.py | kdoren/pi-gen | f4421d81bf6b90232e5d39878e03016005324f92 | [
"BSD-3-Clause"
] | null | null | null | stage3/06-install-jamulus/files/midi-jamulus-xtouchmini-16ch.py | kdoren/pi-gen | f4421d81bf6b90232e5d39878e03016005324f92 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python3
#
# Midi routing layer between jack and jamulus
# For Behringer X-Touch Mini MIDI controller
#
# Layer A: control 8 jamulus channels 0-7 (slider controls ALSA master level)
# Layer B: Control 8 jamulus channels 8-15 (slider controls ALSA capture level)
#
# Rotary encoder has 2 states (push to t... | 38.108527 | 128 | 0.62978 | #!/usr/bin/python3
#
# Midi routing layer between jack and jamulus
# For Behringer X-Touch Mini MIDI controller
#
# Layer A: control 8 jamulus channels 0-7 (slider controls ALSA master level)
# Layer B: Control 8 jamulus channels 8-15 (slider controls ALSA capture level)
#
# Rotary encoder has 2 states (push to t... | 5,567 | 0 | 113 |
04625ef97b3d9a70d91769d8ccbc3dd7efc12726 | 1,082 | py | Python | tools/filters/axt_to_fasta.py | blankenberg/galaxy-data-resource | ca32a1aafd64948f489a4e5cf88096f32391b1d9 | [
"CC-BY-3.0"
] | 2 | 2016-02-23T00:09:14.000Z | 2019-02-11T07:48:44.000Z | tools/filters/axt_to_fasta.py | blankenberg/galaxy-data-resource | ca32a1aafd64948f489a4e5cf88096f32391b1d9 | [
"CC-BY-3.0"
] | 1 | 2015-02-21T18:48:19.000Z | 2015-02-27T15:50:32.000Z | tools/filters/axt_to_fasta.py | blankenberg/galaxy-data-resource | ca32a1aafd64948f489a4e5cf88096f32391b1d9 | [
"CC-BY-3.0"
] | 6 | 2015-05-27T13:09:50.000Z | 2019-02-11T07:48:46.000Z | #!/usr/bin/env python
"""
Adapted from bx/scripts/axt_to_fasta.py
"""
from galaxy import eggs
import pkg_resources
pkg_resources.require( "bx-python" )
import sys
import bx.align.axt
# $$$ this should be moved to a bx.align.fasta module
if __name__ == "__main__": main()
| 21.64 | 66 | 0.654344 | #!/usr/bin/env python
"""
Adapted from bx/scripts/axt_to_fasta.py
"""
from galaxy import eggs
import pkg_resources
pkg_resources.require( "bx-python" )
import sys
import bx.align.axt
def usage(s=None):
message = """
axt_to_fasta species1 species2 < axt_file > fasta_file
"""
if (s == None): sys.exit (message)
else:... | 735 | 0 | 69 |
5b924eaa5c7595b402c7d9e6b8d0304889589068 | 809 | py | Python | hackerrank/30 Days of Code/Day 5 - Loops/test.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | 4 | 2020-07-24T01:59:50.000Z | 2021-07-24T15:14:08.000Z | hackerrank/30 Days of Code/Day 5 - Loops/test.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | null | null | null | hackerrank/30 Days of Code/Day 5 - Loops/test.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | null | null | null | import io
import unittest
from contextlib import redirect_stdout
import solution
if __name__ == '__main__':
unittest.main()
| 28.892857 | 46 | 0.363412 | import io
import unittest
from contextlib import redirect_stdout
import solution
class TestQ(unittest.TestCase):
def test_case_0(self):
text_trap = io.StringIO()
with redirect_stdout(text_trap):
solution.main(2)
self.assertEqual(text_trap.getvalue(),
'... | 618 | 10 | 49 |
92f341927ed4dd0d4741361b5318c57e665127b7 | 52,243 | py | Python | networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py | Gitweijie/first_project | e27ec5a03b20022a66c994c0ee89ef7023cc5c29 | [
"Apache-2.0"
] | null | null | null | networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py | Gitweijie/first_project | e27ec5a03b20022a66c994c0ee89ef7023cc5c29 | [
"Apache-2.0"
] | null | null | null | networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py | Gitweijie/first_project | e27ec5a03b20022a66c994c0ee89ef7023cc5c29 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Cisco Systems, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 45.271231 | 79 | 0.604866 | # Copyright 2014 Cisco Systems, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 14,360 | 32,425 | 280 |
e14c362ef033e9d01558bffaeb08648350895f3c | 995 | py | Python | src/models/client.py | fibasile/ticket-gateway | 811a216281a17150adca3edf691f9cf5a1478d2f | [
"MIT"
] | null | null | null | src/models/client.py | fibasile/ticket-gateway | 811a216281a17150adca3edf691f9cf5a1478d2f | [
"MIT"
] | null | null | null | src/models/client.py | fibasile/ticket-gateway | 811a216281a17150adca3edf691f9cf5a1478d2f | [
"MIT"
] | null | null | null | """
Define the Channel model
"""
from . import db
from .abc import BaseModel, MetaBaseModel
from binascii import hexlify
import os
KEY_LENGTH = 64
class Client(db.Model, BaseModel, metaclass=MetaBaseModel):
""" The Channel model """
__tablename__ = 'client'
slug = db.Column(db.String(300), primary_key=T... | 27.638889 | 72 | 0.657286 | """
Define the Channel model
"""
from . import db
from .abc import BaseModel, MetaBaseModel
from binascii import hexlify
import os
KEY_LENGTH = 64
class Client(db.Model, BaseModel, metaclass=MetaBaseModel):
""" The Channel model """
__tablename__ = 'client'
slug = db.Column(db.String(300), primary_key=T... | 60 | 0 | 26 |
1c6561b063054a6ec52921b6fecd24fdbfbcb829 | 3,209 | py | Python | electrum/tests/test_three_keys_transaction.py | mgrychow/electrum-vault | a15b0fc5db4e83801cd7f1ba3defd56daa0b058a | [
"MIT"
] | 8 | 2020-03-18T21:55:38.000Z | 2021-03-01T12:54:47.000Z | electrum/tests/test_three_keys_transaction.py | mgrychow/electrum-vault | a15b0fc5db4e83801cd7f1ba3defd56daa0b058a | [
"MIT"
] | 6 | 2020-07-10T13:17:21.000Z | 2021-04-26T11:47:22.000Z | electrum/tests/test_three_keys_transaction.py | mgrychow/electrum-vault | a15b0fc5db4e83801cd7f1ba3defd56daa0b058a | [
"MIT"
] | 8 | 2020-05-10T11:04:15.000Z | 2021-05-06T14:51:46.000Z | from collections import namedtuple
from typing import List
from unittest import TestCase
from electrum import Transaction
from electrum.three_keys.multikey_generator import MultiKeyScriptGenerator
from electrum.three_keys.transaction import ThreeKeysTransaction, TxType
TX = '0200000001eaa85f4446a8d48b345592b7bc540678... | 38.202381 | 317 | 0.714241 | from collections import namedtuple
from typing import List
from unittest import TestCase
from electrum import Transaction
from electrum.three_keys.multikey_generator import MultiKeyScriptGenerator
from electrum.three_keys.transaction import ThreeKeysTransaction, TxType
TX = '0200000001eaa85f4446a8d48b345592b7bc540678... | 2,232 | 47 | 337 |
483a6d2c7223c8cfe9fb9a0e0968b1ec56d31e1b | 2,745 | py | Python | sirius/matrices.py | natebunnyfield/sirius | b57863e9d5f241ee8a3c7c2b43bf0da5b85d486c | [
"BSD-3-Clause"
] | 1 | 2019-10-01T17:15:24.000Z | 2019-10-01T17:15:24.000Z | sirius/matrices.py | natebunnyfield/sirius | b57863e9d5f241ee8a3c7c2b43bf0da5b85d486c | [
"BSD-3-Clause"
] | null | null | null | sirius/matrices.py | natebunnyfield/sirius | b57863e9d5f241ee8a3c7c2b43bf0da5b85d486c | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from math import ceil
import os
import yaml
CONFIG_DIR = os.path.abspath(os.path.join(__file__, '..', 'shipping_configs'))
# ups ground
UPS_GROUND_ZIP_TO_ZONE = yaml.load(open(os.path.join(CONFIG_DIR, 'ups_ground_zip_to_zone.yaml'), 'r'))
UPS_GROUND_ZONE_WEIGHT_PRICE =... | 35.192308 | 114 | 0.668488 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from math import ceil
import os
import yaml
CONFIG_DIR = os.path.abspath(os.path.join(__file__, '..', 'shipping_configs'))
# ups ground
UPS_GROUND_ZIP_TO_ZONE = yaml.load(open(os.path.join(CONFIG_DIR, 'ups_ground_zip_to_zone.yaml'), 'r'))
UPS_GROUND_ZONE_WEIGHT_PRICE =... | 0 | 0 | 0 |
0b23c6c86af91d41e4d8bda165dad1aab59afd10 | 16,743 | py | Python | music.py | edvinassaikevicius/Discord_Music_Bot | 931f64c76d3164626ddee27ef00bfef443ca27a6 | [
"MIT"
] | null | null | null | music.py | edvinassaikevicius/Discord_Music_Bot | 931f64c76d3164626ddee27ef00bfef443ca27a6 | [
"MIT"
] | null | null | null | music.py | edvinassaikevicius/Discord_Music_Bot | 931f64c76d3164626ddee27ef00bfef443ca27a6 | [
"MIT"
] | null | null | null | import re
import random
import discord
import lavalink
from discord.ext import commands
import asyncio
import fileRead
url_rx = re.compile(r'https?://(?:www\.)?.+')
"""
Robert A. USF Computer Science
A cog to hold all of the functions used to play music for the bot.
""" | 49.979104 | 217 | 0.61351 | import re
import random
import discord
import lavalink
from discord.ext import commands
import asyncio
import fileRead
url_rx = re.compile(r'https?://(?:www\.)?.+')
"""
Robert A. USF Computer Science
A cog to hold all of the functions used to play music for the bot.
"""
class music(commands.Cog):
def __init__(self... | 8,180 | 8,239 | 54 |
579cdee2a6b24c2118b16d29b2ea7f8695a96d6a | 4,766 | py | Python | notebooks/vacc_booster_gap.py | pbarber/ni-covid-tweets | fd108d8d570aafe4dca6741066af8c2ef92e6b03 | [
"MIT"
] | 1 | 2021-12-13T23:08:45.000Z | 2021-12-13T23:08:45.000Z | notebooks/vacc_booster_gap.py | aarong1/ni-covid-tweets | cbe1e2bc4333b31cdf4e281ed04fc77743938faa | [
"MIT"
] | 18 | 2021-03-30T19:45:37.000Z | 2022-02-02T18:36:17.000Z | notebooks/vacc_booster_gap.py | aarong1/ni-covid-tweets | cbe1e2bc4333b31cdf4e281ed04fc77743938faa | [
"MIT"
] | 1 | 2021-12-13T23:08:32.000Z | 2021-12-13T23:08:32.000Z | # %%
import datetime
import pandas
import altair
from plot_shared import plot_points_average_and_trend
# %%
df = pandas.read_csv('https://api.coronavirus.data.gov.uk/v2/data?areaType=nation&metric=cumPeopleVaccinatedFirstDoseByPublishDate&metric=cumPeopleVaccinatedSecondDoseByPublishDate&format=csv')
df.rename(column... | 46.72549 | 193 | 0.652749 | # %%
import datetime
import pandas
import altair
from plot_shared import plot_points_average_and_trend
# %%
df = pandas.read_csv('https://api.coronavirus.data.gov.uk/v2/data?areaType=nation&metric=cumPeopleVaccinatedFirstDoseByPublishDate&metric=cumPeopleVaccinatedSecondDoseByPublishDate&format=csv')
df.rename(column... | 0 | 0 | 0 |
12d73c6d2017c67c4a8634393e9f0c3835f37434 | 2,369 | py | Python | stock/strategy/gapup.py | shenzhongqiang/cnstock_py | 2bb557657a646acb9d20d3ce78e15cf68390f8ea | [
"MIT"
] | 2 | 2016-10-31T04:05:11.000Z | 2017-04-17T08:46:53.000Z | stock/strategy/gapup.py | shenzhongqiang/cnstock_py | 2bb557657a646acb9d20d3ce78e15cf68390f8ea | [
"MIT"
] | null | null | null | stock/strategy/gapup.py | shenzhongqiang/cnstock_py | 2bb557657a646acb9d20d3ce78e15cf68390f8ea | [
"MIT"
] | null | null | null | import sys
import copy
import numpy as np
import pandas as pd
from sklearn.svm import SVR
import matplotlib.pyplot as plt
from matplotlib.finance import candlestick
from matplotlib.dates import date2num, WeekdayLocator, DateFormatter, MONDAY, MonthLocator
from stock.utils.symbol_util import *
from stock.globalvar impor... | 28.890244 | 90 | 0.67919 | import sys
import copy
import numpy as np
import pandas as pd
from sklearn.svm import SVR
import matplotlib.pyplot as plt
from matplotlib.finance import candlestick
from matplotlib.dates import date2num, WeekdayLocator, DateFormatter, MONDAY, MonthLocator
from stock.utils.symbol_util import *
from stock.globalvar impor... | 0 | 0 | 0 |
99b469d88749b5c5e4fcfb6f7404572eef939fc6 | 62 | py | Python | mplibtest.py | stroblme/hqsp-stqft | c2f8f8964648578755d3938bf8658e4c834548e8 | [
"MIT"
] | null | null | null | mplibtest.py | stroblme/hqsp-stqft | c2f8f8964648578755d3938bf8658e4c834548e8 | [
"MIT"
] | null | null | null | mplibtest.py | stroblme/hqsp-stqft | c2f8f8964648578755d3938bf8658e4c834548e8 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
plt.plot(range(10))
plt.show() | 20.666667 | 31 | 0.774194 | import matplotlib.pyplot as plt
plt.plot(range(10))
plt.show() | 0 | 0 | 0 |
87496910ea9ab1a763212c44a602527db390c55c | 1,317 | py | Python | cli/test/functional/test_step_functions.py | mattsb42/accretion | 7cce5f4ed6d290bd9314b116be91417ded6b0f64 | [
"Apache-2.0"
] | 1 | 2019-10-19T11:18:17.000Z | 2019-10-19T11:18:17.000Z | cli/test/functional/test_step_functions.py | mattsb42/accretion | 7cce5f4ed6d290bd9314b116be91417ded6b0f64 | [
"Apache-2.0"
] | 13 | 2019-06-10T07:03:26.000Z | 2019-11-06T01:09:38.000Z | cli/test/functional/test_step_functions.py | mattsb42/accretion | 7cce5f4ed6d290bd9314b116be91417ded6b0f64 | [
"Apache-2.0"
] | null | null | null | """Functional tests for ``accretion_cli._stepfunctions``."""
import json
import pytest
from accretion_cli._templates.services.stepfunctions import _artifact_builder_workflow, _replication_listener_workflow
from .functional_test_utils import load_vector
pytestmark = [pytest.mark.local, pytest.mark.functional]
| 29.266667 | 118 | 0.759301 | """Functional tests for ``accretion_cli._stepfunctions``."""
import json
import pytest
from accretion_cli._templates.services.stepfunctions import _artifact_builder_workflow, _replication_listener_workflow
from .functional_test_utils import load_vector
pytestmark = [pytest.mark.local, pytest.mark.functional]
def ... | 931 | 0 | 69 |
1e2b33389dc089f41107ab2ec2a2cb95a2e849f3 | 5,167 | py | Python | tests/test_tweet_sentiment.py | chrisfalter/BLM | eeb3eb3e011ec2ec02a21f90451422b5e22c2b9e | [
"MIT"
] | 1 | 2021-06-13T15:55:49.000Z | 2021-06-13T15:55:49.000Z | tests/test_tweet_sentiment.py | chrisfalter/BLM | eeb3eb3e011ec2ec02a21f90451422b5e22c2b9e | [
"MIT"
] | null | null | null | tests/test_tweet_sentiment.py | chrisfalter/BLM | eeb3eb3e011ec2ec02a21f90451422b5e22c2b9e | [
"MIT"
] | null | null | null | import pytest
from src.tweet_sentiment import (
EmoScores,
PronounCounts,
SentimentAnalysis,
summarize_sentiment,
_get_emotion_scores,
_get_pronoun_counts,
_get_sentiment
)
sample_text = "It was the best of times, it was the worst of times, " \
"it was the age of wisdom, it was the ag... | 35.881944 | 108 | 0.689375 | import pytest
from src.tweet_sentiment import (
EmoScores,
PronounCounts,
SentimentAnalysis,
summarize_sentiment,
_get_emotion_scores,
_get_pronoun_counts,
_get_sentiment
)
sample_text = "It was the best of times, it was the worst of times, " \
"it was the age of wisdom, it was the ag... | 3,863 | 0 | 276 |
a8ff93872dcb01832b50b6a88d9561e1d8f9eda9 | 2,765 | py | Python | Banking-Inferences(Inferential-Statistics)/code.py | RohanBarghare/ga-learner-dsmp-repo | ec5aa9697d79da48b6e3446d2a9bc4f0544560c9 | [
"MIT"
] | null | null | null | Banking-Inferences(Inferential-Statistics)/code.py | RohanBarghare/ga-learner-dsmp-repo | ec5aa9697d79da48b6e3446d2a9bc4f0544560c9 | [
"MIT"
] | null | null | null | Banking-Inferences(Inferential-Statistics)/code.py | RohanBarghare/ga-learner-dsmp-repo | ec5aa9697d79da48b6e3446d2a9bc4f0544560c9 | [
"MIT"
] | null | null | null | # --------------
import pandas as pd
import scipy.stats as stats
import math
import numpy as np
import warnings
warnings.filterwarnings('ignore')
#Sample_Size
sample_size=2000
#Z_Critical Score
z_critical = stats.norm.ppf(q = 0.95)
# path [File location variable]
data=pd.read_csv(path)
#Cod... | 27.929293 | 88 | 0.670163 | # --------------
import pandas as pd
import scipy.stats as stats
import math
import numpy as np
import warnings
warnings.filterwarnings('ignore')
#Sample_Size
sample_size=2000
#Z_Critical Score
z_critical = stats.norm.ppf(q = 0.95)
# path [File location variable]
data=pd.read_csv(path)
#Cod... | 0 | 0 | 0 |
090738636e324433c3033993224836a0912177a0 | 3,453 | py | Python | face_streaming_server.py | PNUIOTLAB/face_recognition_client | ee44ebbc8e76cb940577dd9ce31fe06a09c18de6 | [
"BSL-1.0"
] | null | null | null | face_streaming_server.py | PNUIOTLAB/face_recognition_client | ee44ebbc8e76cb940577dd9ce31fe06a09c18de6 | [
"BSL-1.0"
] | null | null | null | face_streaming_server.py | PNUIOTLAB/face_recognition_client | ee44ebbc8e76cb940577dd9ce31fe06a09c18de6 | [
"BSL-1.0"
] | null | null | null | import cv2
import time
import threading
from flask import Response, Flask
import time
import os
import sys
import socket
import select
# Flask 객체로 Image frame 전달
global video_frame
video_frame = None
# 다양한 브라우저에서 프레임들의 thread-safe 출력을 잠근다.
global thread_lock
thread_lock = threading.Lock()
# Raspberry Camera에 접근하기 위한... | 31.108108 | 313 | 0.637706 | import cv2
import time
import threading
from flask import Response, Flask
import time
import os
import sys
import socket
import select
# Flask 객체로 Image frame 전달
global video_frame
video_frame = None
# 다양한 브라우저에서 프레임들의 thread-safe 출력을 잠근다.
global thread_lock
thread_lock = threading.Lock()
# Raspberry Camera에 접근하기 위한... | 1,528 | 0 | 91 |
c5bc60fc16c77b9e8d2c61a215a4fe4027b0f78b | 1,401 | py | Python | LeetCode/python-R1/0024- 两两交换链表中的节点/V1.py | huuuuusy/Programming-Practice-Everyday | c78b368ab0439d85b8a69f6d9c8154d708bafc9c | [
"Apache-2.0"
] | 4 | 2019-08-27T11:28:03.000Z | 2020-12-24T07:10:22.000Z | LeetCode/python-R1/0024- 两两交换链表中的节点/V1.py | huuuuusy/Programming-Practice-Everyday | c78b368ab0439d85b8a69f6d9c8154d708bafc9c | [
"Apache-2.0"
] | null | null | null | LeetCode/python-R1/0024- 两两交换链表中的节点/V1.py | huuuuusy/Programming-Practice-Everyday | c78b368ab0439d85b8a69f6d9c8154d708bafc9c | [
"Apache-2.0"
] | 4 | 2019-09-20T09:44:01.000Z | 2020-12-24T07:10:23.000Z | """
@Author: huuuuusy
@GitHub: https://github.com/huuuuusy
系统: Ubuntu 18.04
IDE: VS Code 1.37
工具: python == 3.7.3
"""
"""
思路:
暴力解法,直接取出所有元素,排序后再存入新的链表中
结果:
执行用时 : 48 ms, 在所有 Python3 提交中击败了76.77%的用户
内存消耗 : 13.8 MB, 在所有 Python3 提交中击败了5.93%的用户
"""
# 定义链表
if __name__ == "__main__":
l1 = L... | 23.35 | 65 | 0.540328 | """
@Author: huuuuusy
@GitHub: https://github.com/huuuuusy
系统: Ubuntu 18.04
IDE: VS Code 1.37
工具: python == 3.7.3
"""
"""
思路:
暴力解法,直接取出所有元素,排序后再存入新的链表中
结果:
执行用时 : 48 ms, 在所有 Python3 提交中击败了76.77%的用户
内存消耗 : 13.8 MB, 在所有 Python3 提交中击败了5.93%的用户
"""
# 定义链表
class ListNode:
def __init__(self,x):
sel... | 46 | 703 | 72 |
9f592c9983e58816d6a9a02264b3012dba617a05 | 1,290 | py | Python | logger.py | Anu1996rag/PythonLogging | 3231c76c680a20df27182e99ffcc116f95b5f864 | [
"MIT"
] | null | null | null | logger.py | Anu1996rag/PythonLogging | 3231c76c680a20df27182e99ffcc116f95b5f864 | [
"MIT"
] | null | null | null | logger.py | Anu1996rag/PythonLogging | 3231c76c680a20df27182e99ffcc116f95b5f864 | [
"MIT"
] | null | null | null | # this file creates new log files in the particular folders created by the
# createFolder file and generates separate log files for separate programs
import os,inspect
import logging,logging.config
from createFolder import createFolder
# logging levels
loglevel = "debug"
if loglevel.upper() == "DEBUG":
loglevel... | 26.326531 | 110 | 0.717054 | # this file creates new log files in the particular folders created by the
# createFolder file and generates separate log files for separate programs
import os,inspect
import logging,logging.config
from createFolder import createFolder
# logging levels
loglevel = "debug"
if loglevel.upper() == "DEBUG":
loglevel... | 600 | 0 | 46 |
e0c9ffa5cddba48275d62feb92bcea844dd90204 | 2,764 | py | Python | app.py | galaxyxxxxx/audio2img | d44a34de1fb7c6bcd5dc3ba40704077a457e9c48 | [
"MIT"
] | null | null | null | app.py | galaxyxxxxx/audio2img | d44a34de1fb7c6bcd5dc3ba40704077a457e9c48 | [
"MIT"
] | null | null | null | app.py | galaxyxxxxx/audio2img | d44a34de1fb7c6bcd5dc3ba40704077a457e9c48 | [
"MIT"
] | 1 | 2021-01-27T05:47:03.000Z | 2021-01-27T05:47:03.000Z | from flask import Flask, render_template, request, jsonify,redirect, url_for
from werkzeug.utils import secure_filename
import requests
import random
import json
import os
import time
import xlrd
from flask_cors import CORS
from requests_toolbelt import MultipartEncoder
app = Flask(__name__)
#CORS(app, supports_crede... | 31.05618 | 118 | 0.613965 | from flask import Flask, render_template, request, jsonify,redirect, url_for
from werkzeug.utils import secure_filename
import requests
import random
import json
import os
import time
import xlrd
from flask_cors import CORS
from requests_toolbelt import MultipartEncoder
app = Flask(__name__)
#CORS(app, supports_crede... | 2,160 | 0 | 89 |
758f9f954011f69548b7ff155de4e6d303ed3998 | 756 | py | Python | easy/count-primes.py | therealabdi2/LeetcodeQuestions | 4c45ee836482a2c7b59906f7a7a99b5b3fa17317 | [
"MIT"
] | null | null | null | easy/count-primes.py | therealabdi2/LeetcodeQuestions | 4c45ee836482a2c7b59906f7a7a99b5b3fa17317 | [
"MIT"
] | null | null | null | easy/count-primes.py | therealabdi2/LeetcodeQuestions | 4c45ee836482a2c7b59906f7a7a99b5b3fa17317 | [
"MIT"
] | null | null | null | """Count the number of prime numbers less than a non-negative number, n.
Example 1:
Input: n = 10
Output: 4
Explanation: There are 4 prime numbers less than 10, they are 2, 3, 5, 7.
Example 2:
Input: n = 0
Output: 0
Example 3:
Input: n = 1
Output: 0"""
import math
s = Solution()
print(s.countPrimes(12))
| 19.894737 | 78 | 0.589947 | """Count the number of prime numbers less than a non-negative number, n.
Example 1:
Input: n = 10
Output: 4
Explanation: There are 4 prime numbers less than 10, they are 2, 3, 5, 7.
Example 2:
Input: n = 0
Output: 0
Example 3:
Input: n = 1
Output: 0"""
import math
class Solution:
def countPrimes(self, n: in... | 399 | -6 | 49 |
1cab8e10520f9ed00a854568085670a24e8869bf | 1,041 | py | Python | train/grid_search.py | veritas9872/Knowledge-Distillation-Task | d260b1057c96cfc52af8ff7a0775befbd102f59d | [
"MIT"
] | 2 | 2020-02-16T13:30:27.000Z | 2021-01-18T14:18:26.000Z | train/grid_search.py | veritas9872/Knowledge-Distillation-Task | d260b1057c96cfc52af8ff7a0775befbd102f59d | [
"MIT"
] | null | null | null | train/grid_search.py | veritas9872/Knowledge-Distillation-Task | d260b1057c96cfc52af8ff7a0775befbd102f59d | [
"MIT"
] | null | null | null | """
Code for applying grid search to find the best parameters for knowledge distillation.
The distillation ratio and temperature parameters are being tuned in this search.
"""
import torch
from train.distill_knowledge import main
from utils.options import knowledge_distillation_options
if __name__ == '__main__':
... | 31.545455 | 91 | 0.673391 | """
Code for applying grid search to find the best parameters for knowledge distillation.
The distillation ratio and temperature parameters are being tuned in this search.
"""
import torch
from train.distill_knowledge import main
from utils.options import knowledge_distillation_options
def grid_search():
options... | 561 | 0 | 23 |
6ee110a8e3ab8f33b2314a11563292fe766bc8bb | 1,121 | py | Python | psst.py | Thomas-Hirsch/airflow-dags | 37b1e9a44dbfd508c1f6b86c712d699bfdff4ca2 | [
"Apache-2.0"
] | null | null | null | psst.py | Thomas-Hirsch/airflow-dags | 37b1e9a44dbfd508c1f6b86c712d699bfdff4ca2 | [
"Apache-2.0"
] | null | null | null | psst.py | Thomas-Hirsch/airflow-dags | 37b1e9a44dbfd508c1f6b86c712d699bfdff4ca2 | [
"Apache-2.0"
] | null | null | null | from datetime import datetime, timedelta
import airflow
from airflow import DAG
from airflow.contrib.operators.kubernetes_pod_operator import KubernetesPodOperator
from airflow.utils.dates import days_ago
# GLOBAL ENV VARIABLES
IMAGE_VERSION = "v1.0.0"
IMAGE = f"593291632749.dkr.ecr.eu-west-1.amazonaws.com/airflow-ps... | 24.911111 | 89 | 0.711864 | from datetime import datetime, timedelta
import airflow
from airflow import DAG
from airflow.contrib.operators.kubernetes_pod_operator import KubernetesPodOperator
from airflow.utils.dates import days_ago
# GLOBAL ENV VARIABLES
IMAGE_VERSION = "v1.0.0"
IMAGE = f"593291632749.dkr.ecr.eu-west-1.amazonaws.com/airflow-ps... | 0 | 0 | 0 |
dd078f8b597fc5457e2c4a5dbf2b958195904e31 | 661 | py | Python | boofuzz/boofuzz/connections/ip_constants.py | mrTavas/owasp-fstm-auto | 6e9ff36e46d885701c7419db3eca15f12063a7f3 | [
"CC0-1.0"
] | 2 | 2021-05-05T12:03:01.000Z | 2021-06-04T14:27:15.000Z | boofuzz/boofuzz/connections/ip_constants.py | mrTavas/owasp-fstm-auto | 6e9ff36e46d885701c7419db3eca15f12063a7f3 | [
"CC0-1.0"
] | null | null | null | boofuzz/boofuzz/connections/ip_constants.py | mrTavas/owasp-fstm-auto | 6e9ff36e46d885701c7419db3eca15f12063a7f3 | [
"CC0-1.0"
] | 2 | 2021-05-05T12:03:09.000Z | 2021-06-04T14:27:21.000Z | """
This file contains constants for the IPv4 protocol.
.. versionchanged:: 0.2.0
ip_constants has been moved into the connections subpackage.
The full path is now boofuzz.connections.ip_constants
"""
IPV4_PROTOCOL_UDP = 0x11
#: Theoretical maximum length of a UDP packet, based on constraints in the UDP
#: pac... | 38.882353 | 78 | 0.779123 | """
This file contains constants for the IPv4 protocol.
.. versionchanged:: 0.2.0
ip_constants has been moved into the connections subpackage.
The full path is now boofuzz.connections.ip_constants
"""
IPV4_PROTOCOL_UDP = 0x11
#: Theoretical maximum length of a UDP packet, based on constraints in the UDP
#: pac... | 0 | 0 | 0 |
31e33b4f971db68d33d49ba1581c6e72c9b06d43 | 4,183 | py | Python | mdcs/explore.py | knc6/MDCS-api-tools | eb51a1124e3daf2c4c1e968395f66e85c22b92f9 | [
"CC0-1.0"
] | null | null | null | mdcs/explore.py | knc6/MDCS-api-tools | eb51a1124e3daf2c4c1e968395f66e85c22b92f9 | [
"CC0-1.0"
] | null | null | null | mdcs/explore.py | knc6/MDCS-api-tools | eb51a1124e3daf2c4c1e968395f66e85c22b92f9 | [
"CC0-1.0"
] | null | null | null | #! /usr/bin/env python
import requests
from collections import OrderedDict
from utils import check_response
def select_all(host,user,pswd,cert=None,format=None):
"""Get all data from the MDCS server
Inputs:
host - string, URL of MDCS instance
user - string, username of desired account on M... | 41.415842 | 87 | 0.643318 | #! /usr/bin/env python
import requests
from collections import OrderedDict
from utils import check_response
def select_all(host,user,pswd,cert=None,format=None):
"""Get all data from the MDCS server
Inputs:
host - string, URL of MDCS instance
user - string, username of desired account on M... | 0 | 0 | 0 |
d3e0669a72fd4a4883dec6a69028023f6abf7602 | 45,858 | py | Python | aerospike_helpers/expressions/list.py | mcoberly2/aerospike-client-python | d405891f0d6d8b2fc14f78841370bc6a1d302494 | [
"Apache-2.0"
] | null | null | null | aerospike_helpers/expressions/list.py | mcoberly2/aerospike-client-python | d405891f0d6d8b2fc14f78841370bc6a1d302494 | [
"Apache-2.0"
] | null | null | null | aerospike_helpers/expressions/list.py | mcoberly2/aerospike-client-python | d405891f0d6d8b2fc14f78841370bc6a1d302494 | [
"Apache-2.0"
] | null | null | null | ##########################################################################
# Copyright 2013-2021 Aerospike, 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/... | 44.009597 | 180 | 0.62748 | ##########################################################################
# Copyright 2013-2021 Aerospike, 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/... | 0 | 0 | 0 |
f63c55bac69dfb491106ccd06c919a0136dd5de3 | 885 | py | Python | files/split.py | acepj60/MkCheck | 7765cfad3e7ef198945fa2fe70c1b3cb8f9e5290 | [
"Unlicense"
] | 1 | 2021-11-06T23:02:22.000Z | 2021-11-06T23:02:22.000Z | files/split.py | whiterabb17/MkCheck | 567ab17743209e08e5d8d391a8eaf217cb0dd3c5 | [
"Unlicense"
] | null | null | null | files/split.py | whiterabb17/MkCheck | 567ab17743209e08e5d8d391a8eaf217cb0dd3c5 | [
"Unlicense"
] | null | null | null | #/usr/bin/env python3
my_file = '/opt/MkCheck/files/tiks.txt'
sorting = True
hold_lines = []
with open(my_file,'r') as text_file:
for row in text_file:
hold_lines.append(row)
outer_count = 1
line_count = 0
while sorting:
count = 0
increment = (outer_count-1) * 51
left = len(hold_lines) - increme... | 28.548387 | 81 | 0.6 | #/usr/bin/env python3
my_file = '/opt/MkCheck/files/tiks.txt'
sorting = True
hold_lines = []
with open(my_file,'r') as text_file:
for row in text_file:
hold_lines.append(row)
outer_count = 1
line_count = 0
while sorting:
count = 0
increment = (outer_count-1) * 51
left = len(hold_lines) - increme... | 0 | 0 | 0 |
468df631c0ced920bcc593cd678b29e0a5f82a05 | 3,710 | py | Python | websauna/system/form/fields.py | maikroeder/websauna | fd266cf5e4761cd4c1f3e33be47ad8358b4c6afa | [
"CNRI-Python"
] | null | null | null | websauna/system/form/fields.py | maikroeder/websauna | fd266cf5e4761cd4c1f3e33be47ad8358b4c6afa | [
"CNRI-Python"
] | null | null | null | websauna/system/form/fields.py | maikroeder/websauna | fd266cf5e4761cd4c1f3e33be47ad8358b4c6afa | [
"CNRI-Python"
] | 1 | 2021-04-15T17:35:57.000Z | 2021-04-15T17:35:57.000Z | import enum
import json
import colander
import deform
from websauna.compat.typing import Union
from websauna.compat.typing import Callable
from websauna.system.model.json import NestedMutationDict, NestedMutationList, json_serializer
def defer_widget_values(widget: type, values_callback: Callable, **kwargs) -> defo... | 30.162602 | 145 | 0.634232 | import enum
import json
import colander
import deform
from websauna.compat.typing import Union
from websauna.compat.typing import Callable
from websauna.system.model.json import NestedMutationDict, NestedMutationList, json_serializer
def defer_widget_values(widget: type, values_callback: Callable, **kwargs) -> defo... | 347 | 0 | 80 |
c5d192f0d3e6f2a85910c1d1c34a01b007447f70 | 4,044 | py | Python | code/Examples/Python/HelloWorld/HelloWorldPublisher.py | xander-m2k/Fast-DDS-docs | 13e20cd24e159cdb5f2e7ab1fdb87880c2370aa0 | [
"Apache-2.0"
] | null | null | null | code/Examples/Python/HelloWorld/HelloWorldPublisher.py | xander-m2k/Fast-DDS-docs | 13e20cd24e159cdb5f2e7ab1fdb87880c2370aa0 | [
"Apache-2.0"
] | null | null | null | code/Examples/Python/HelloWorld/HelloWorldPublisher.py | xander-m2k/Fast-DDS-docs | 13e20cd24e159cdb5f2e7ab1fdb87880c2370aa0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 Proyectos y Sistemas de Mantenimiento SL (eProsima).
#
# 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... | 35.165217 | 117 | 0.691642 | # Copyright 2022 Proyectos y Sistemas de Mantenimiento SL (eProsima).
#
# 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... | 2,824 | 22 | 234 |
86f75c2522b6bfb188910c0c2dfff8de507bbbd7 | 772 | py | Python | mainapp/accounts/admin.py | mfjimenezco/django-adminlte-base | 00384e62e408e43b5a178bd180d7fb4aff134b2b | [
"MIT"
] | null | null | null | mainapp/accounts/admin.py | mfjimenezco/django-adminlte-base | 00384e62e408e43b5a178bd180d7fb4aff134b2b | [
"MIT"
] | null | null | null | mainapp/accounts/admin.py | mfjimenezco/django-adminlte-base | 00384e62e408e43b5a178bd180d7fb4aff134b2b | [
"MIT"
] | null | null | null | """
Account admin register.
"""
# Django
from django.contrib import admin
from django.contrib import messages
# Models
from accounts.models import UserRequest
@admin.register(UserRequest)
class UserRequestAdmin(admin.ModelAdmin):
"""User Request Admin"""
list_display = (
'username',
'email',... | 22.705882 | 80 | 0.619171 | """
Account admin register.
"""
# Django
from django.contrib import admin
from django.contrib import messages
# Models
from accounts.models import UserRequest
@admin.register(UserRequest)
class UserRequestAdmin(admin.ModelAdmin):
"""User Request Admin"""
list_display = (
'username',
'email',... | 246 | 0 | 26 |
b8169855ec0aaf15dc5d25cc4a2e7fb043cb45d6 | 33 | py | Python | tests/__init__.py | fundamentals-of-data-science/ct1 | 26a0abf06fd4324636d7944369d6a8be2d66ec71 | [
"MIT"
] | null | null | null | tests/__init__.py | fundamentals-of-data-science/ct1 | 26a0abf06fd4324636d7944369d6a8be2d66ec71 | [
"MIT"
] | 134 | 2020-12-14T08:21:54.000Z | 2022-03-31T21:06:13.000Z | tests/__init__.py | fundamentals-of-data-science/ct1 | 26a0abf06fd4324636d7944369d6a8be2d66ec71 | [
"MIT"
] | null | null | null | """Unit test package for ct1."""
| 16.5 | 32 | 0.636364 | """Unit test package for ct1."""
| 0 | 0 | 0 |
a9fc4344ed64e93da9a289bce09caae40d52fb57 | 141 | py | Python | src/compath_resources/exporters/__init__.py | ComPath/resources | e8da7b511c2b558b8fd0bf38888b512008ac1ba3 | [
"MIT"
] | 3 | 2018-05-14T14:46:39.000Z | 2019-06-20T10:28:26.000Z | src/compath_resources/exporters/__init__.py | ComPath/compath-resources | e8da7b511c2b558b8fd0bf38888b512008ac1ba3 | [
"MIT"
] | 13 | 2020-03-28T13:36:32.000Z | 2021-01-19T15:00:07.000Z | src/compath_resources/exporters/__init__.py | ComPath/resources | e8da7b511c2b558b8fd0bf38888b512008ac1ba3 | [
"MIT"
] | 1 | 2021-12-01T09:49:59.000Z | 2021-12-01T09:49:59.000Z | # -*- coding: utf-8 -*-
"""Exporters for ComPath resources."""
from .bel import get_bel # noqa:F401
from .rdf import get_rdf # noqa:F401
| 20.142857 | 38 | 0.666667 | # -*- coding: utf-8 -*-
"""Exporters for ComPath resources."""
from .bel import get_bel # noqa:F401
from .rdf import get_rdf # noqa:F401
| 0 | 0 | 0 |
a1bafe40f9d60a18d8fce01e601bfa263bc96c72 | 183 | py | Python | bindings/python/examples/Restore.py | Fimbure/icebox-1 | 0b81992a53e1b410955ca89bdb6f8169d6f2da86 | [
"MIT"
] | 521 | 2019-03-29T15:44:08.000Z | 2022-03-22T09:46:19.000Z | bindings/python/examples/Restore.py | Fimbure/icebox-1 | 0b81992a53e1b410955ca89bdb6f8169d6f2da86 | [
"MIT"
] | 30 | 2019-06-04T17:00:49.000Z | 2021-09-08T20:44:19.000Z | bindings/python/examples/Restore.py | Fimbure/icebox-1 | 0b81992a53e1b410955ca89bdb6f8169d6f2da86 | [
"MIT"
] | 99 | 2019-03-29T16:04:13.000Z | 2022-03-28T16:59:34.000Z | import struct
from PyFDP.FDP import FDP
if __name__ == '__main__':
#fdp = FDP("7_SP1_x64")
fdp = FDP("8_1_x64")
#fdp = FDP("10_x64")
fdp.Restore()
| 15.25 | 27 | 0.551913 | import struct
from PyFDP.FDP import FDP
if __name__ == '__main__':
#fdp = FDP("7_SP1_x64")
fdp = FDP("8_1_x64")
#fdp = FDP("10_x64")
fdp.Restore()
| 0 | 0 | 0 |
1c400f0eed5bedcf15ac83b8b0358c7c54ae6b43 | 21 | py | Python | salad/__init__.py | Work4Labs/salad | 176869a4437103d501feb3035beaf162c2507435 | [
"BSD-3-Clause"
] | null | null | null | salad/__init__.py | Work4Labs/salad | 176869a4437103d501feb3035beaf162c2507435 | [
"BSD-3-Clause"
] | null | null | null | salad/__init__.py | Work4Labs/salad | 176869a4437103d501feb3035beaf162c2507435 | [
"BSD-3-Clause"
] | null | null | null | VERSION = "0.4.14.2"
| 10.5 | 20 | 0.571429 | VERSION = "0.4.14.2"
| 0 | 0 | 0 |
0664b5cd87247d123675d6ed514eb83e81d53698 | 3,755 | py | Python | utils/attention_plotter_utils.py | inboxedshoe/attention-learn-to-route | d9ebb13ec7e06fc5d2373c851a13913dab1594fc | [
"MIT"
] | null | null | null | utils/attention_plotter_utils.py | inboxedshoe/attention-learn-to-route | d9ebb13ec7e06fc5d2373c851a13913dab1594fc | [
"MIT"
] | null | null | null | utils/attention_plotter_utils.py | inboxedshoe/attention-learn-to-route | d9ebb13ec7e06fc5d2373c851a13913dab1594fc | [
"MIT"
] | null | null | null |
import numpy as np
import plotly.graph_objs as go
import networkx as nx
#creates the data graph instance
#this will create our initial plotly graph to display
| 29.108527 | 88 | 0.530226 |
import numpy as np
import plotly.graph_objs as go
import networkx as nx
#creates the data graph instance
def generate_graph(pts, instance=0, dictionary=True):
if not dictionary:
# temp demand list with depot and nodes
temp_demand = pts[instance][2]
temp_demand.insert(0, 0)
# temp... | 3,547 | 0 | 44 |
743b485b8add2d51b33af6b72fb698306723a312 | 2,848 | py | Python | GAparsimony/lhs/util/utilityLHS.py | misantam/GAparsimony | 0241092dc5d7741b5546151ff829167588e4f703 | [
"MIT"
] | null | null | null | GAparsimony/lhs/util/utilityLHS.py | misantam/GAparsimony | 0241092dc5d7741b5546151ff829167588e4f703 | [
"MIT"
] | 1 | 2021-12-05T10:24:55.000Z | 2021-12-05T11:01:25.000Z | GAparsimony/lhs/util/utilityLHS.py | misantam/GAparsimony | 0241092dc5d7741b5546151ff829167588e4f703 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import numpy as np
from .bclib import inner_product
| 28.19802 | 104 | 0.572331 | # -*- coding: utf-8 -*-
import numpy as np
from .bclib import inner_product
def isValidLHS_int(matrix):
for jcol in range(matrix.shape[1]):
total = 0
for irow in range(matrix.shape[0]):
total = total + matrix[irow, jcol]
if not total == int(matrix.shape[0] * (matrix.shape[0] + ... | 2,511 | 0 | 239 |
ca26151593854c11dd77251a6952907ae9d39bb6 | 5,212 | py | Python | browser/process.py | gocept/alphaflow | 4b797cb12fb52254b1884159fd9a8b899c739f7c | [
"ZPL-2.1",
"ZPL-2.0"
] | null | null | null | browser/process.py | gocept/alphaflow | 4b797cb12fb52254b1884159fd9a8b899c739f7c | [
"ZPL-2.1",
"ZPL-2.0"
] | null | null | null | browser/process.py | gocept/alphaflow | 4b797cb12fb52254b1884159fd9a8b899c739f7c | [
"ZPL-2.1",
"ZPL-2.0"
] | 1 | 2021-11-01T07:58:18.000Z | 2021-11-01T07:58:18.000Z | # Copyright (c) 2007 gocept gmbh & co. kg
# See also LICENSE.txt
# $Id$
"""Process related views"""
import zope.component
from Products.CMFCore.utils import getToolByName
from Products.Archetypes.config import UID_CATALOG
import Products.AlphaFlow.interfaces
import Products.AlphaFlow.process
from Products.AlphaFlow.... | 34.289474 | 76 | 0.646969 | # Copyright (c) 2007 gocept gmbh & co. kg
# See also LICENSE.txt
# $Id$
"""Process related views"""
import zope.component
from Products.CMFCore.utils import getToolByName
from Products.Archetypes.config import UID_CATALOG
import Products.AlphaFlow.interfaces
import Products.AlphaFlow.process
from Products.AlphaFlow.... | 3,572 | 23 | 424 |
93e18ce7f40ed19716c2eff6ecac85730cb2095f | 1,224 | py | Python | VimbaCam/ColorMap/ehtplot/build/lib/ehtplot/color/merge.py | zzpwahaha/VimbaCamJILA | 3baed1b5313e6c198d54a33c2c84357035d5146a | [
"MIT"
] | 1 | 2021-06-14T11:51:37.000Z | 2021-06-14T11:51:37.000Z | VimbaCam/ColorMap/ehtplot/build/lib/ehtplot/color/merge.py | zzpwahaha/VimbaCamJILA | 3baed1b5313e6c198d54a33c2c84357035d5146a | [
"MIT"
] | null | null | null | VimbaCam/ColorMap/ehtplot/build/lib/ehtplot/color/merge.py | zzpwahaha/VimbaCamJILA | 3baed1b5313e6c198d54a33c2c84357035d5146a | [
"MIT"
] | 2 | 2021-01-20T16:22:57.000Z | 2021-02-14T12:31:02.000Z | #!/usr/bin/env python3
#
# Copyright (C) 2018--2019 Chi-kwan Chan
# Copyright (C) 2018--2019 Steward Observatory
#
# This file is part of ehtplot.
#
# ehtplot is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, ei... | 37.090909 | 70 | 0.71732 | #!/usr/bin/env python3
#
# Copyright (C) 2018--2019 Chi-kwan Chan
# Copyright (C) 2018--2019 Steward Observatory
#
# This file is part of ehtplot.
#
# ehtplot is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, ei... | 51 | 0 | 23 |
4b966c0ae593681a28d86b6768f14fd6e0a06939 | 894 | py | Python | bot.py | ImGabe/vending-machine | bdb49968f7d0395b1771f19c5254afb9d948f42c | [
"MIT"
] | null | null | null | bot.py | ImGabe/vending-machine | bdb49968f7d0395b1771f19c5254afb9d948f42c | [
"MIT"
] | null | null | null | bot.py | ImGabe/vending-machine | bdb49968f7d0395b1771f19c5254afb9d948f42c | [
"MIT"
] | 1 | 2020-11-20T15:25:26.000Z | 2020-11-20T15:25:26.000Z | from pathlib import Path
import configparser
import json
import discord
from app import client, config
@client.event
def load_extensions(cogs: str) -> None:
'''
Loads all extensions recursively.\n
Params:
cogs: str
Relative path to cogs dir.
'''
for extension in Path(cogs).rgl... | 22.35 | 60 | 0.62528 | from pathlib import Path
import configparser
import json
import discord
from app import client, config
@client.event
async def on_ready():
await client.change_presence(
status=config['CLIENT']['STATUS'],
activity=discord.Game(config['CLIENT']['ACTIVITY']))
print('Up and running!')
def loa... | 168 | 0 | 22 |
671214d2338ab823f014d1f4f04fcba09906319f | 564 | py | Python | examples/tools/davidson_eigh.py | Warlocat/pyscf | 94c21e2e9745800c7efc7256de0d628fc60afc36 | [
"Apache-2.0"
] | 2 | 2019-05-28T05:25:56.000Z | 2019-11-09T02:16:43.000Z | examples/tools/davidson_eigh.py | lzypotato/pyscf | 94c21e2e9745800c7efc7256de0d628fc60afc36 | [
"Apache-2.0"
] | null | null | null | examples/tools/davidson_eigh.py | lzypotato/pyscf | 94c21e2e9745800c7efc7256de0d628fc60afc36 | [
"Apache-2.0"
] | 1 | 2019-11-09T02:13:16.000Z | 2019-11-09T02:13:16.000Z | #!/usr/bin/env python
'''
Calling davidson solver for the lowest eigenvalues of a Hermitian matrix
'''
import numpy
from pyscf import lib
n = 100
a = numpy.random.rand(n,n)
a = a + a.T
# Define the matrix-vector operation
# Define the preconditioner. It can be just the diagonal elements of the
# ma... | 20.142857 | 78 | 0.677305 | #!/usr/bin/env python
'''
Calling davidson solver for the lowest eigenvalues of a Hermitian matrix
'''
import numpy
from pyscf import lib
n = 100
a = numpy.random.rand(n,n)
a = a + a.T
# Define the matrix-vector operation
def matvec(x):
return a.dot(x)
# Define the preconditioner. It can be ju... | 14 | 0 | 23 |
3d79bf9dde091d861b40e8d30fad0af92b14e60d | 6,033 | py | Python | L_softmax/l_softmax.py | githubhjx/Deep-Learning- | 5a22fb5696d930ed334aa1cbf2b213956b1c7026 | [
"Apache-2.0"
] | null | null | null | L_softmax/l_softmax.py | githubhjx/Deep-Learning- | 5a22fb5696d930ed334aa1cbf2b213956b1c7026 | [
"Apache-2.0"
] | null | null | null | L_softmax/l_softmax.py | githubhjx/Deep-Learning- | 5a22fb5696d930ed334aa1cbf2b213956b1c7026 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import math
import uuid
import tensorflow as tf
margin = 4
beta = 100
scale = 0.99
beta_min = 0
eps = 0
c_map = []
k_map = []
c_m_n = lambda m, n: math.factorial(n) / math.factorial(m) / math.factorial(n - m)
for i in range(margin + 1):
c_map.append(c_m_n(i, margin))
k_map.append(math.cos(i ... | 37.943396 | 116 | 0.532405 | import numpy as np
import math
import uuid
import tensorflow as tf
margin = 4
beta = 100
scale = 0.99
beta_min = 0
eps = 0
c_map = []
k_map = []
c_m_n = lambda m, n: math.factorial(n) / math.factorial(m) / math.factorial(n - m)
for i in range(margin + 1):
c_map.append(c_m_n(i, margin))
k_map.append(math.cos(i ... | 5,028 | 0 | 69 |
f114e6783c5c73f9ca3b2209f92b1d2dec1ed046 | 701 | py | Python | pytorch_nst/config.py | tomsitter/pytorch-style-transfer-nbdev | 71ebd7a2f097ec94eac636b4e0c52a39fb66bdc6 | [
"Apache-2.0"
] | null | null | null | pytorch_nst/config.py | tomsitter/pytorch-style-transfer-nbdev | 71ebd7a2f097ec94eac636b4e0c52a39fb66bdc6 | [
"Apache-2.0"
] | 5 | 2021-09-08T02:55:55.000Z | 2022-03-12T01:00:56.000Z | pytorch_nst/config.py | tomsitter/pytorch-style-transfer-nbdev | 71ebd7a2f097ec94eac636b4e0c52a39fb66bdc6 | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: 01_config.ipynb (unless otherwise specified).
__all__ = ['device', 'imsize', 'normalization_mean', 'normalization_std', 'content_layers_default',
'style_layers_default']
# Cell
import torch
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
im... | 41.235294 | 99 | 0.728959 | # AUTOGENERATED! DO NOT EDIT! File to edit: 01_config.ipynb (unless otherwise specified).
__all__ = ['device', 'imsize', 'normalization_mean', 'normalization_std', 'content_layers_default',
'style_layers_default']
# Cell
import torch
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
im... | 0 | 0 | 0 |
07a62f6d7ebf94a24a8085c3c1373df54bd21409 | 874 | py | Python | geninfo/info/forms.py | genomika/geninfo | 0604bf65c57847500db84523a2c8707a12f7a5a8 | [
"MIT"
] | 3 | 2022-02-15T15:33:44.000Z | 2022-02-16T15:31:28.000Z | geninfo/info/forms.py | genomika/geninfo | 0604bf65c57847500db84523a2c8707a12f7a5a8 | [
"MIT"
] | null | null | null | geninfo/info/forms.py | genomika/geninfo | 0604bf65c57847500db84523a2c8707a12f7a5a8 | [
"MIT"
] | null | null | null | from django import forms
# from django.forms import ModelChoiceField
from .models import Incident
| 30.137931 | 89 | 0.602975 | from django import forms
# from django.forms import ModelChoiceField
from .models import Incident
class IncidentForm(forms.ModelForm):
class Meta:
model = Incident
fields = "__all__"
def clean(self):
status_type = self.cleaned_data["status_incident"]
end_date = self.cleaned_... | 643 | 110 | 23 |
439fcd1f7d1571e2b523084ad698125578bf666a | 530 | py | Python | tests/test_models.py | codingjoe/django-mail-auth | 21b102e511bd801f04fbb2328d846e625dac7f60 | [
"MIT"
] | 39 | 2019-04-12T22:44:55.000Z | 2021-12-12T06:03:47.000Z | tests/test_models.py | codingjoe/django-mail-auth | 21b102e511bd801f04fbb2328d846e625dac7f60 | [
"MIT"
] | 49 | 2019-05-28T10:58:51.000Z | 2022-03-29T00:33:18.000Z | tests/test_models.py | codingjoe/django-mail-auth | 21b102e511bd801f04fbb2328d846e625dac7f60 | [
"MIT"
] | 6 | 2019-08-07T06:16:38.000Z | 2022-02-25T12:14:13.000Z | import pytest
from django.db import IntegrityError
from mailauth.contrib.user import models
try:
import psycopg2
except ImportError:
psycopg2 = None
postgres_only = pytest.mark.skipif(
psycopg2 is None, reason="at least mymodule-1.1 required"
)
| 23.043478 | 72 | 0.739623 | import pytest
from django.db import IntegrityError
from mailauth.contrib.user import models
try:
import psycopg2
except ImportError:
psycopg2 = None
postgres_only = pytest.mark.skipif(
psycopg2 is None, reason="at least mymodule-1.1 required"
)
class TestEmailUser:
@postgres_only
def test_emai... | 201 | 44 | 23 |
906bf78de9d6afaf9d670aa83f0803631f27085d | 2,209 | py | Python | model.py | LucijanZgonik/Vislice | e82614929927438a13df349afedc39a4b19eb290 | [
"MIT"
] | null | null | null | model.py | LucijanZgonik/Vislice | e82614929927438a13df349afedc39a4b19eb290 | [
"MIT"
] | null | null | null | model.py | LucijanZgonik/Vislice | e82614929927438a13df349afedc39a4b19eb290 | [
"MIT"
] | null | null | null | STEVILO_DOVOLJENIH_NAPAK = 10
PRAVILNA_CRKA = '+'
NAPACNA_CRKA = '-'
PONOVLJENA_CRKA = 'o'
ZMAGA = 'W'
PORAZ = 'L'
bazen_besed = []
with open ("Vislice/besede.txt") as datoteka_bazena:
for beseda in datoteka_bazena:
bazen_besed.append(beseda.strip().lower())
impor... | 21.240385 | 63 | 0.466274 | STEVILO_DOVOLJENIH_NAPAK = 10
PRAVILNA_CRKA = '+'
NAPACNA_CRKA = '-'
PONOVLJENA_CRKA = 'o'
ZMAGA = 'W'
PORAZ = 'L'
class Igra:
def __init__(self,geslo,crke=None):
self.geslo = geslo
if crke is None:
self.crke = []
else:
self.crke = [c.lower() for c in cr... | 1,508 | -10 | 333 |
172ceb42551e8d4b82c6d6256ce9ad79098808ef | 830 | py | Python | Python/ex39.py | Anderson0312/Python | 1fd225378c55309640d584a4894393f7c40dc9ed | [
"MIT"
] | 1 | 2022-02-01T17:59:50.000Z | 2022-02-01T17:59:50.000Z | Python/ex39.py | Anderson0312/Python | 1fd225378c55309640d584a4894393f7c40dc9ed | [
"MIT"
] | null | null | null | Python/ex39.py | Anderson0312/Python | 1fd225378c55309640d584a4894393f7c40dc9ed | [
"MIT"
] | null | null | null | print('-=' * 15)
print('{:^30}'.format('LOJA SUPER BARATÃO'))
print('-=' * 15)
total = cont1000 = menor = cont = 0
nomemenor = ''
while True:
nomeP = str(input('Nome do produto: '))
preco = float(input('Preço: R$ '))
cont += 1
soun = ' '
print('-' * 30)
while soun not in 'SN':
soun = str... | 28.62069 | 69 | 0.543373 | print('-=' * 15)
print('{:^30}'.format('LOJA SUPER BARATÃO'))
print('-=' * 15)
total = cont1000 = menor = cont = 0
nomemenor = ''
while True:
nomeP = str(input('Nome do produto: '))
preco = float(input('Preço: R$ '))
cont += 1
soun = ' '
print('-' * 30)
while soun not in 'SN':
soun = str... | 0 | 0 | 0 |
7da5f84d5906da12c0ab908da3370cab26295fcb | 3,525 | py | Python | scratch/regression/rolling_validation/plot_losses.py | finn-dodgson/DeepHalos | 86e0ac6c24ac97a0a2a0a60a7ea3721a04bd050c | [
"MIT"
] | 2 | 2021-07-26T10:56:33.000Z | 2021-12-20T17:30:53.000Z | scratch/regression/rolling_validation/plot_losses.py | finn-dodgson/DeepHalos | 86e0ac6c24ac97a0a2a0a60a7ea3721a04bd050c | [
"MIT"
] | 1 | 2021-11-25T21:01:19.000Z | 2021-12-05T01:40:53.000Z | scratch/regression/rolling_validation/plot_losses.py | finn-dodgson/DeepHalos | 86e0ac6c24ac97a0a2a0a60a7ea3721a04bd050c | [
"MIT"
] | 1 | 2021-11-27T02:35:10.000Z | 2021-11-27T02:35:10.000Z | import numpy as np
import matplotlib.pyplot as plt
paths = '/Users/lls/Documents/deep_halos_files/regression/rolling_val/'
paths_all = [paths + '0dropout/', paths + '0.1dropout/', paths + '0.2dropout/', paths + '0.3dropout/',
paths + 'no_sim3/']
dropout_pc = ["0", "10", "20", "30", "40"]
f, axes = plt.s... | 40.517241 | 133 | 0.571348 | import numpy as np
import matplotlib.pyplot as plt
paths = '/Users/lls/Documents/deep_halos_files/regression/rolling_val/'
paths_all = [paths + '0dropout/', paths + '0.1dropout/', paths + '0.2dropout/', paths + '0.3dropout/',
paths + 'no_sim3/']
dropout_pc = ["0", "10", "20", "30", "40"]
f, axes = plt.s... | 0 | 0 | 0 |
48fdf11a4bd8b2ba7b22bc93b7ceb1470082f2cd | 5,618 | py | Python | ParticleField.py | l3alr0g/Hull-breach-analysis | 5128f6feeeb6b85bcc469e452ce904736e857839 | [
"MIT"
] | 3 | 2020-01-09T19:40:05.000Z | 2021-04-24T06:47:27.000Z | ParticleField.py | l3alr0g/Hull-breach-tracking | 7ce34488ec95f93f0afb571731757a1ce569673e | [
"MIT"
] | null | null | null | ParticleField.py | l3alr0g/Hull-breach-tracking | 7ce34488ec95f93f0afb571731757a1ce569673e | [
"MIT"
] | null | null | null | from panda3d.core import * # needs to be improved later on (maybe)
from ProceduralGen import *
from copy import deepcopy
from physX import engine, PhysXNode, LinArrayFormat, ArrayLinFormat
from NodeStates import State
| 48.017094 | 166 | 0.55429 | from panda3d.core import * # needs to be improved later on (maybe)
from ProceduralGen import *
from copy import deepcopy
from physX import engine, PhysXNode, LinArrayFormat, ArrayLinFormat
from NodeStates import State
class ParticleMesh:
def __init__(self,l,w,Vl,Vw,extraArgs):
'''
ParticleMesh... | 3,862 | 1,488 | 46 |
6e18fe03136a564e0edc71a067b8e64cc5d7d36e | 5,899 | py | Python | NasUnet/models/nas_unet.py | mlvc-lab/Segmentation-NAS | a9387a1546dacfa2dc6ee1f70366542a1552e541 | [
"MIT"
] | 4 | 2020-03-26T11:05:08.000Z | 2020-12-22T08:37:20.000Z | NasUnet/models/nas_unet.py | mlvc-lab/Segmentation-NAS | a9387a1546dacfa2dc6ee1f70366542a1552e541 | [
"MIT"
] | null | null | null | NasUnet/models/nas_unet.py | mlvc-lab/Segmentation-NAS | a9387a1546dacfa2dc6ee1f70366542a1552e541 | [
"MIT"
] | 3 | 2020-03-26T11:05:09.000Z | 2022-01-28T11:29:00.000Z | from util.prim_ops_set import *
from .fcn import FCNHead
from .base import BaseNet
from util.functional import *
from torch.nn.functional import interpolate
class BuildCell(nn.Module):
"""Build a cell from genotype"""
class NasUnet(BaseNet):
"""Construct a network"""
| 37.814103 | 118 | 0.579081 | from util.prim_ops_set import *
from .fcn import FCNHead
from .base import BaseNet
from util.functional import *
from torch.nn.functional import interpolate
class BuildCell(nn.Module):
"""Build a cell from genotype"""
def __init__(self, genotype, c_prev_prev, c_prev, c, cell_type, dropout_prob=0):
... | 5,438 | 0 | 170 |
1ef0fee033bf0679a68c77bee0f826dfd87bc8a2 | 1,348 | py | Python | metecho/api/migrations/0103_alter_task_status.py | RupertBarrow/Metecho | 322f7fab7e18063c38ee2e803b7a68212d87fe2c | [
"BSD-3-Clause"
] | 21 | 2020-04-02T21:39:58.000Z | 2022-01-31T19:43:47.000Z | metecho/api/migrations/0103_alter_task_status.py | RupertBarrow/Metecho | 322f7fab7e18063c38ee2e803b7a68212d87fe2c | [
"BSD-3-Clause"
] | 1,316 | 2020-03-30T21:56:34.000Z | 2022-03-01T10:08:56.000Z | metecho/api/migrations/0103_alter_task_status.py | oddbird/MetaShare | 71fb667eaea6990e9d89be13d9a47e76db2a6c46 | [
"BSD-3-Clause"
] | 21 | 2020-07-21T11:58:47.000Z | 2021-11-25T00:48:21.000Z | # Generated by Django 3.2.2 on 2021-05-13 15:34
from django.db import migrations, models
from metecho.api.models import TaskStatus
| 28.680851 | 87 | 0.597181 | # Generated by Django 3.2.2 on 2021-05-13 15:34
from django.db import migrations, models
from metecho.api.models import TaskStatus
def set_task_canceled_statuses(apps, schema_editor):
Task = apps.get_model("api", "Task")
for instance in Task.objects.filter(
status=TaskStatus.IN_PROGRESS, pr_is_open=... | 487 | 656 | 69 |
ae0e727020da9082f868380f9e604cec3980a139 | 3,278 | py | Python | kangrouter.py | TheSolvingMachine/kangrouter-py | 0e385372675978ad7f6c4e8daea54401564304b2 | [
"Apache-2.0"
] | 1 | 2017-11-07T22:36:24.000Z | 2017-11-07T22:36:24.000Z | kangrouter.py | TheSolvingMachine/kangrouter-py | 0e385372675978ad7f6c4e8daea54401564304b2 | [
"Apache-2.0"
] | null | null | null | kangrouter.py | TheSolvingMachine/kangrouter-py | 0e385372675978ad7f6c4e8daea54401564304b2 | [
"Apache-2.0"
] | null | null | null | import time
from tsm.common.app import exception
import requests
import json
from requests.packages.urllib3.util.retry import Retry
from requests.adapters import HTTPAdapter
KANGROUTER_WEBSERVICE_APPLICATION_ROOT="/kangrouter/srv/v1"
| 33.44898 | 70 | 0.599451 | import time
from tsm.common.app import exception
import requests
import json
from requests.packages.urllib3.util.retry import Retry
from requests.adapters import HTTPAdapter
KANGROUTER_WEBSERVICE_APPLICATION_ROOT="/kangrouter/srv/v1"
class KangRouterClient:
pathbase = "https://thesolvingmachine.com/kangrouter/srv... | 2,706 | 301 | 23 |
06345111138d441a5b029be39d16a41e55a74520 | 5,728 | py | Python | enCount/fastqs.py | mstrazar/enCount | dcff565ce96afe37aa8a41995637d00cce02360d | [
"MIT"
] | null | null | null | enCount/fastqs.py | mstrazar/enCount | dcff565ce96afe37aa8a41995637d00cce02360d | [
"MIT"
] | null | null | null | enCount/fastqs.py | mstrazar/enCount | dcff565ce96afe37aa8a41995637d00cce02360d | [
"MIT"
] | null | null | null | import os
import shutil
import requests
import hashlib
import tempfile
import datetime
from bson.objectid import ObjectId
import enCount
# populate list with currently queued jobs
submitted_downloads = dict(
(j.meta['file_path'], j) for j in enCount.queues.downloads.jobs
)
def get_file_path(e_acc, f_acc, f_url... | 34.506024 | 78 | 0.59602 | import os
import shutil
import requests
import hashlib
import tempfile
import datetime
from bson.objectid import ObjectId
import enCount
# populate list with currently queued jobs
submitted_downloads = dict(
(j.meta['file_path'], j) for j in enCount.queues.downloads.jobs
)
def _update_dbrec_status(dbrec_id, new... | 2,488 | 0 | 46 |
2a9b9fac2b90d7be9b56fb00bbe59ce86f2c68ac | 335 | py | Python | VT_gen_urls.py | sparklingSky/vt-gen-urls | fb0d23caa5c47627363ac8db0e4aa7f12d794a41 | [
"MIT"
] | 1 | 2017-04-27T06:54:08.000Z | 2017-04-27T06:54:08.000Z | VT_gen_urls.py | sparklingSky/vt-gen-urls | fb0d23caa5c47627363ac8db0e4aa7f12d794a41 | [
"MIT"
] | null | null | null | VT_gen_urls.py | sparklingSky/vt-gen-urls | fb0d23caa5c47627363ac8db0e4aa7f12d794a41 | [
"MIT"
] | null | null | null | __author__ = 'sparklingSky'
import ipcalc
f = open('VT_links.txt', 'w')
subnet = raw_input('Enter subnet with prefix in format 1.2.3.0/24: ')
for x in ipcalc.Network(subnet):
f.write('https://www.virustotal.com/en/ip-address/' + str(x) + '/information/' + '\n')
f.close()
print 'Completed. See the result in file... | 25.769231 | 90 | 0.683582 | __author__ = 'sparklingSky'
import ipcalc
f = open('VT_links.txt', 'w')
subnet = raw_input('Enter subnet with prefix in format 1.2.3.0/24: ')
for x in ipcalc.Network(subnet):
f.write('https://www.virustotal.com/en/ip-address/' + str(x) + '/information/' + '\n')
f.close()
print 'Completed. See the result in file... | 0 | 0 | 0 |
2ce45fac8db13d29869dc715eb1b786c4b40a0a5 | 4,051 | py | Python | navycut/contrib/auth/__init__.py | navycut/navycut | 1d49621105c7c4683d52a3d2c853ae7165b9dc0d | [
"MIT"
] | 13 | 2021-04-26T04:00:36.000Z | 2021-09-18T19:57:58.000Z | navycut/contrib/auth/__init__.py | FlaskAio/navycut | 40f378f1710a26645df8d726c4d1caf33097da50 | [
"MIT"
] | 21 | 2021-09-27T03:19:21.000Z | 2022-03-31T03:20:59.000Z | navycut/contrib/auth/__init__.py | FlaskAio/navycut | 40f378f1710a26645df8d726c4d1caf33097da50 | [
"MIT"
] | 7 | 2021-07-21T06:21:55.000Z | 2021-09-02T17:58:04.000Z | from flask_login import (
LoginManager as _LoginManager,
logout_user as _logout_user,
login_user as _login_user
)
from .models import User
from navycut.utils.security import check_password_hash
from navycut.errors.misc import DataTypeMismatchError
from .decorators import (
login_required as login_... | 31.161538 | 92 | 0.646013 | from flask_login import (
LoginManager as _LoginManager,
logout_user as _logout_user,
login_user as _login_user
)
from .models import User
from navycut.utils.security import check_password_hash
from navycut.errors.misc import DataTypeMismatchError
from .decorators import (
login_required as login_... | 357 | 13 | 71 |
b83c60d4492dc1f05faf5d5bbad4a6170cee1206 | 8,027 | py | Python | src/vm-builder-0.12.4+bzr489/build/lib.linux-x86_64-2.7/VMBuilder/util.py | cryptorinium/Num2 | e83ea5b18b7822c73699de2a667d189791c48fbb | [
"MIT"
] | null | null | null | src/vm-builder-0.12.4+bzr489/build/lib.linux-x86_64-2.7/VMBuilder/util.py | cryptorinium/Num2 | e83ea5b18b7822c73699de2a667d189791c48fbb | [
"MIT"
] | null | null | null | src/vm-builder-0.12.4+bzr489/build/lib.linux-x86_64-2.7/VMBuilder/util.py | cryptorinium/Num2 | e83ea5b18b7822c73699de2a667d189791c48fbb | [
"MIT"
] | null | null | null | #
# Uncomplicated VM Builder
# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3, as
# published by the Free Software Foundation.
#
# ... | 35.052402 | 140 | 0.639342 | #
# Uncomplicated VM Builder
# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3, as
# published by the Free Software Foundation.
#
# ... | 3,479 | 9 | 268 |
a8f1d9e916607551577ad10de7f094657e42fb01 | 20,490 | py | Python | mssqlclient.py | iptL-F4ck/mssqlproxy | c64bfe4ba05ad1f8e8a608692da94819f6652693 | [
"MIT"
] | null | null | null | mssqlclient.py | iptL-F4ck/mssqlproxy | c64bfe4ba05ad1f8e8a608692da94819f6652693 | [
"MIT"
] | null | null | null | mssqlclient.py | iptL-F4ck/mssqlproxy | c64bfe4ba05ad1f8e8a608692da94819f6652693 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (c) 2020 BlackArrow
#
#
# This product includes software developed by
# SecureAuth Corporation (https://www.secureauth.com/).
#
# Description: [MS-TDS] & [MC-SQLR] example.
#
# Original author:
# Alberto Solino (beto@coresecurity.com/@agsolino)
#
# Author:
# Pablo Martinez (https:/... | 37.052441 | 158 | 0.551147 | #!/usr/bin/env python
#
# Copyright (c) 2020 BlackArrow
#
#
# This product includes software developed by
# SecureAuth Corporation (https://www.secureauth.com/).
#
# Description: [MS-TDS] & [MC-SQLR] example.
#
# Original author:
# Alberto Solino (beto@coresecurity.com/@agsolino)
#
# Author:
# Pablo Martinez (https:/... | 13,115 | 3 | 675 |
400ff23eea96eef52d15f5da1e54e1282902b729 | 19,636 | py | Python | blesuite/cli/blesuite_cli.py | jreynders/BLESuite-1 | 1c3c15fc2d4e30c3f9c1a15e0268cae84685784b | [
"MIT"
] | 198 | 2016-08-04T05:45:38.000Z | 2022-02-17T08:30:58.000Z | blesuite/cli/blesuite_cli.py | jreynders/BLESuite-1 | 1c3c15fc2d4e30c3f9c1a15e0268cae84685784b | [
"MIT"
] | 13 | 2018-02-04T14:16:16.000Z | 2020-10-09T02:16:24.000Z | blesuite/cli/blesuite_cli.py | jreynders/BLESuite-1 | 1c3c15fc2d4e30c3f9c1a15e0268cae84685784b | [
"MIT"
] | 57 | 2016-08-08T04:24:04.000Z | 2022-01-24T08:43:02.000Z | import argparse
from blesuite.connection_manager import BLEConnectionManager
from blesuite_wrapper import ble_service_read, ble_service_read_async, ble_service_write, \
ble_handle_subscribe, ble_service_scan, ble_service_write_async, ble_run_smart_scan
from blesuite import utils
from blesuite.utils.print_helper imp... | 53.214092 | 120 | 0.503718 | import argparse
from blesuite.connection_manager import BLEConnectionManager
from blesuite_wrapper import ble_service_read, ble_service_read_async, ble_service_write, \
ble_handle_subscribe, ble_service_scan, ble_service_write_async, ble_run_smart_scan
from blesuite import utils
from blesuite.utils.print_helper imp... | 0 | 0 | 0 |
39aeba465593157cc9fb66cd31b7e29f8c8eba57 | 370 | py | Python | sample/sample1_make_notebook.py | mtb-beta/evernote-api-sample | ff441da01b7c8075ad31fca7d22127fe4ceb7866 | [
"MIT"
] | null | null | null | sample/sample1_make_notebook.py | mtb-beta/evernote-api-sample | ff441da01b7c8075ad31fca7d22127fe4ceb7866 | [
"MIT"
] | null | null | null | sample/sample1_make_notebook.py | mtb-beta/evernote-api-sample | ff441da01b7c8075ad31fca7d22127fe4ceb7866 | [
"MIT"
] | null | null | null | """
NOTE: ノートブックを作成するサンプル
"""
from decouple import config
from pyevernote import EvernoteApp
TOKEN = config("EVERNOTE_DEVELOPPER_TOKEN")
USE_SANDBOX = config("USE_SANDBOX", True, cast=bool)
if __name__ == "__main__":
main()
| 20.555556 | 68 | 0.751351 | """
NOTE: ノートブックを作成するサンプル
"""
from decouple import config
from pyevernote import EvernoteApp
TOKEN = config("EVERNOTE_DEVELOPPER_TOKEN")
USE_SANDBOX = config("USE_SANDBOX", True, cast=bool)
def main():
evernote_app = EvernoteApp(token=TOKEN, use_sandbox=USE_SANDBOX)
evernote_app.create_notebook("My Sample N... | 115 | 0 | 23 |
93c19bda05ff270d52ae3931fc78f2d516181331 | 422 | py | Python | avishan/migrations/0005_baseuser_language.py | Afshari9978/django-avishan | 67b997e1063a1f2cf17699eaa292a98844aa0fe9 | [
"MIT"
] | 1 | 2021-05-09T09:55:54.000Z | 2021-05-09T09:55:54.000Z | avishan/migrations/0005_baseuser_language.py | Afshari9978/django-avishan | 67b997e1063a1f2cf17699eaa292a98844aa0fe9 | [
"MIT"
] | null | null | null | avishan/migrations/0005_baseuser_language.py | Afshari9978/django-avishan | 67b997e1063a1f2cf17699eaa292a98844aa0fe9 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.3 on 2020-02-15 22:28
from django.db import migrations, models
| 22.210526 | 66 | 0.620853 | # Generated by Django 3.0.3 on 2020-02-15 22:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('avishan', '0004_usergroup_authenticate_with_phone_otp'),
]
operations = [
migrations.AddField(
model_name='baseuser',
... | 0 | 308 | 23 |
c36aea22e9c375be0d8543ddc1eba0ff9f8acd15 | 258 | py | Python | students/K33422/laboratory_works/Daria Plotskaya/lab_2/users/urls.py | olticher/ITMO_ICT_WebDevelopment_2021-2022 | 3de8728c29638d6733ad0664bf13e0d1eccae899 | [
"MIT"
] | null | null | null | students/K33422/laboratory_works/Daria Plotskaya/lab_2/users/urls.py | olticher/ITMO_ICT_WebDevelopment_2021-2022 | 3de8728c29638d6733ad0664bf13e0d1eccae899 | [
"MIT"
] | null | null | null | students/K33422/laboratory_works/Daria Plotskaya/lab_2/users/urls.py | olticher/ITMO_ICT_WebDevelopment_2021-2022 | 3de8728c29638d6733ad0664bf13e0d1eccae899 | [
"MIT"
] | null | null | null | from django.urls import path
from django.contrib.auth.views import LoginView
from .views import UserCreateFormView
urlpatterns = [
path("login/", LoginView.as_view(), name="login"),
path("register/", UserCreateFormView.as_view(), name="register")
]
| 28.666667 | 68 | 0.744186 | from django.urls import path
from django.contrib.auth.views import LoginView
from .views import UserCreateFormView
urlpatterns = [
path("login/", LoginView.as_view(), name="login"),
path("register/", UserCreateFormView.as_view(), name="register")
]
| 0 | 0 | 0 |
4d0fba564fa46a0b48e5aa0c5c73cd2775df2ea9 | 15,765 | py | Python | CLOUD_ML_newaccuracy_4person.py | qqxx6661/Trajectory-prediction | c5f783bdbb14c98e9d6be60c1624c65b9110b6b3 | [
"Apache-2.0"
] | 2 | 2018-09-27T06:57:28.000Z | 2019-07-13T12:15:48.000Z | CLOUD_ML_newaccuracy_4person.py | qqxx6661/Trajectory-prediction | c5f783bdbb14c98e9d6be60c1624c65b9110b6b3 | [
"Apache-2.0"
] | null | null | null | CLOUD_ML_newaccuracy_4person.py | qqxx6661/Trajectory-prediction | c5f783bdbb14c98e9d6be60c1624c65b9110b6b3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# coding=utf-8
import numpy as np
from sklearn.svm import SVC
from sklearn.externals import joblib
from sklearn import linear_model
from sklearn.neural_network import MLPClassifier
from sklearn.preprocessing import StandardScaler
from sklearn.tree import DecisionTreeClassifier
import time
... | 43.549724 | 101 | 0.577101 | #!/usr/bin/env python3
# coding=utf-8
import numpy as np
from sklearn.svm import SVC
from sklearn.externals import joblib
from sklearn import linear_model
from sklearn.neural_network import MLPClassifier
from sklearn.preprocessing import StandardScaler
from sklearn.tree import DecisionTreeClassifier
import time
def _... | 10,993 | 0 | 138 |
a8da6c27168c030127b89099f0e61debcd9543af | 3,829 | py | Python | src/automations/cms_automations/migrations/0001_initial.py | sebastianmanger/django-automations | 070e700d29ef68f1b27c7f016ee6a08c41be56fe | [
"MIT"
] | 20 | 2021-04-25T16:19:09.000Z | 2022-02-17T13:55:57.000Z | src/automations/cms_automations/migrations/0001_initial.py | sebastianmanger/django-automations | 070e700d29ef68f1b27c7f016ee6a08c41be56fe | [
"MIT"
] | 25 | 2021-11-21T14:39:59.000Z | 2022-02-01T11:32:17.000Z | src/automations/cms_automations/migrations/0001_initial.py | sebastianmanger/django-automations | 070e700d29ef68f1b27c7f016ee6a08c41be56fe | [
"MIT"
] | 4 | 2021-11-21T04:27:55.000Z | 2022-03-04T01:37:06.000Z | # Generated by Django 3.1.8 on 2021-05-02 11:09
import django.db.models.deletion
from django.db import migrations, models
| 33.587719 | 108 | 0.402455 | # Generated by Django 3.1.8 on 2021-05-02 11:09
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
("cms", "0022_auto_20180620_1551"),
]
operations = [
migrations.CreateModel(
... | 0 | 3,682 | 23 |
3771c6c2f4d9250af64216e9c17b431cf831fb7a | 988 | py | Python | ivy/ext/ivy_shortcodes.py | swsch/ivy | 4932cf7541acff13815be613b0f3335b21c86670 | [
"Unlicense"
] | null | null | null | ivy/ext/ivy_shortcodes.py | swsch/ivy | 4932cf7541acff13815be613b0f3335b21c86670 | [
"Unlicense"
] | null | null | null | ivy/ext/ivy_shortcodes.py | swsch/ivy | 4932cf7541acff13815be613b0f3335b21c86670 | [
"Unlicense"
] | null | null | null | import ivy
import sys
try:
import shortcodes
except ImportError:
shortcodes = None
# Use a single parser instance to parse all files.
parser = None
# The bare 'shortcodes' attribute for custom settings is deprecated.
if shortcodes:
@ivy.filters.register('node_text')
| 28.228571 | 73 | 0.601215 | import ivy
import sys
try:
import shortcodes
except ImportError:
shortcodes = None
# Use a single parser instance to parse all files.
parser = None
# The bare 'shortcodes' attribute for custom settings is deprecated.
if shortcodes:
@ivy.filters.register('node_text')
def render(text, node):
... | 677 | 0 | 26 |
72d447079357ad9532eb8adbf4c6e89fc73bc0c4 | 2,270 | py | Python | example_cycles/tests/benchmark_electric_propulsor.py | askprash/pyCycle | e0845d7e320b6cb47367734c26ec3410c9fa5bf7 | [
"Apache-2.0"
] | null | null | null | example_cycles/tests/benchmark_electric_propulsor.py | askprash/pyCycle | e0845d7e320b6cb47367734c26ec3410c9fa5bf7 | [
"Apache-2.0"
] | null | null | null | example_cycles/tests/benchmark_electric_propulsor.py | askprash/pyCycle | e0845d7e320b6cb47367734c26ec3410c9fa5bf7 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import unittest
import os
import openmdao.api as om
from openmdao.utils.assert_utils import assert_near_equal
import pycycle.api as pyc
from example_cycles.electric_propulsor import MPpropulsor
if __name__ == "__main__":
unittest.main() | 31.527778 | 79 | 0.644053 | import numpy as np
import unittest
import os
import openmdao.api as om
from openmdao.utils.assert_utils import assert_near_equal
import pycycle.api as pyc
from example_cycles.electric_propulsor import MPpropulsor
class ElectricPropulsorTestCase(unittest.TestCase):
def benchmark_case1(self):
prob =... | 1,924 | 30 | 51 |
836c857326383b2e3a35255f393ce2a2ae805a24 | 758 | py | Python | beta.py | SecDet65/bug-py | d311d6621e8d7edd0bf43ba632690c0842188f06 | [
"Apache-2.0"
] | null | null | null | beta.py | SecDet65/bug-py | d311d6621e8d7edd0bf43ba632690c0842188f06 | [
"Apache-2.0"
] | null | null | null | beta.py | SecDet65/bug-py | d311d6621e8d7edd0bf43ba632690c0842188f06 | [
"Apache-2.0"
] | null | null | null | import os
print(':::IMPORTANTE::: USE AS LETRAS CORRESPONDENTES => C (CESIUS), K (KELVIN) OU F (FIRENHEIT)\n\n')
temp = input('Qual temperatura quer saber? ')
tv = float(input('Digite o valor da temperatura: '))
if(temp == 'c'):
fah = ((tv * 1.8) + 32)
kel = (tv + 273.15)
cel = tv
print('Fah... | 30.32 | 105 | 0.53562 | import os
print(':::IMPORTANTE::: USE AS LETRAS CORRESPONDENTES => C (CESIUS), K (KELVIN) OU F (FIRENHEIT)\n\n')
temp = input('Qual temperatura quer saber? ')
tv = float(input('Digite o valor da temperatura: '))
if(temp == 'c'):
fah = ((tv * 1.8) + 32)
kel = (tv + 273.15)
cel = tv
print('Fah... | 0 | 0 | 0 |
0ff93bc15d5ca9cabbe6220722dd3204ded3de54 | 5,079 | py | Python | pi_awning_webthing/awning_webthing.py | grro/pi_awning_webthing | c3186b9947a74d9cc2a9ba4a079b9201e769ba25 | [
"Apache-2.0"
] | null | null | null | pi_awning_webthing/awning_webthing.py | grro/pi_awning_webthing | c3186b9947a74d9cc2a9ba4a079b9201e769ba25 | [
"Apache-2.0"
] | null | null | null | pi_awning_webthing/awning_webthing.py | grro/pi_awning_webthing | c3186b9947a74d9cc2a9ba4a079b9201e769ba25 | [
"Apache-2.0"
] | null | null | null | from webthing import (MultipleThings, Property, Thing, Value, WebThingServer)
from pi_awning_webthing.awning import Awning, AwningPropertyListener
from pi_awning_webthing.switch import Switch
from pi_awning_webthing.motor_tb6612Fng import load_tb6612fng
from time import sleep
import logging
import tornado.ioloop
... | 37.902985 | 129 | 0.573538 | from webthing import (MultipleThings, Property, Thing, Value, WebThingServer)
from pi_awning_webthing.awning import Awning, AwningPropertyListener
from pi_awning_webthing.switch import Switch
from pi_awning_webthing.motor_tb6612Fng import load_tb6612fng
from time import sleep
import logging
import tornado.ioloop
clas... | 4,233 | 47 | 312 |
b6c77329018b75234038e92dc58bc0aed4fb2fad | 1,154 | py | Python | q_functions.py | brett-daley/dqn-lambda | e1bbbaecf18cdc9f8edfbef8075b988a61e21235 | [
"MIT"
] | 19 | 2020-02-17T06:47:40.000Z | 2022-03-30T21:39:49.000Z | q_functions.py | brett-daley/dqn-lambda | e1bbbaecf18cdc9f8edfbef8075b988a61e21235 | [
"MIT"
] | 6 | 2020-01-28T23:11:31.000Z | 2022-02-10T00:39:48.000Z | q_functions.py | brett-daley/dqn-lambda | e1bbbaecf18cdc9f8edfbef8075b988a61e21235 | [
"MIT"
] | 5 | 2020-01-31T05:29:24.000Z | 2022-03-15T08:30:06.000Z | import tensorflow as tf
from tensorflow.python.layers.layers import *
| 38.466667 | 92 | 0.681109 | import tensorflow as tf
from tensorflow.python.layers.layers import *
def cartpole_mlp(state, n_actions, scope):
hidden = flatten(state) # flatten to make sure 2-D
with tf.variable_scope(scope, reuse=tf.AUTO_REUSE):
hidden = dense(hidden, units=512, activation=tf.nn.tanh)
hidden = dens... | 1,036 | 0 | 46 |
71a31accb034925ee37a6aa3d035b5ee027cd116 | 78,984 | py | Python | ctypesgen/test/testsuite.py | EPC-MSU/ctypesgen | 21979b7dce0382f3e78ca18efc552217c60c46ef | [
"BSD-2-Clause"
] | null | null | null | ctypesgen/test/testsuite.py | EPC-MSU/ctypesgen | 21979b7dce0382f3e78ca18efc552217c60c46ef | [
"BSD-2-Clause"
] | null | null | null | ctypesgen/test/testsuite.py | EPC-MSU/ctypesgen | 21979b7dce0382f3e78ca18efc552217c60c46ef | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: ascii -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
#
"""Simple test suite using unittest.
By clach04 (Chris Clark).
Calling:
python test/testsuite.py
or
cd test
./testsuite.py
Could use any unitest compatible test runner (nose, etc.)
Aims to test for regress... | 35.260714 | 106 | 0.309696 | #!/usr/bin/env python3
# -*- coding: ascii -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
#
"""Simple test suite using unittest.
By clach04 (Chris Clark).
Calling:
python test/testsuite.py
or
cd test
./testsuite.py
Could use any unitest compatible test runner (nose, etc.)
Aims to test for regress... | 58,852 | 5,623 | 790 |
ed6d3463406712dea80304bda0142186ee00fea2 | 16,056 | py | Python | stubs/micropython-latest-docstubs/lcd160cr.py | mattytrentini/micropython-stubs | 4d596273823b69e9e5bcf5fa67f249c374ee0bbc | [
"MIT"
] | null | null | null | stubs/micropython-latest-docstubs/lcd160cr.py | mattytrentini/micropython-stubs | 4d596273823b69e9e5bcf5fa67f249c374ee0bbc | [
"MIT"
] | null | null | null | stubs/micropython-latest-docstubs/lcd160cr.py | mattytrentini/micropython-stubs | 4d596273823b69e9e5bcf5fa67f249c374ee0bbc | [
"MIT"
] | null | null | null | """
control of LCD160CR display. See: https://docs.micropython.org/en/latest/library/lcd160cr.html
This module provides control of the MicroPython LCD160CR display.
"""
# source version: latest
# origin module:: micropython/docs/library/lcd160cr.rst
from typing import Any, Tuple
from .machine import SPI
# Orienta... | 36.995392 | 99 | 0.587506 | """
control of LCD160CR display. See: https://docs.micropython.org/en/latest/library/lcd160cr.html
This module provides control of the MicroPython LCD160CR display.
"""
# source version: latest
# origin module:: micropython/docs/library/lcd160cr.rst
from typing import Any, Tuple
from .machine import SPI
# Orienta... | 308 | 0 | 216 |
e7dbbf31cdb2c338a7b379e15fa035c48dea2d84 | 1,491 | py | Python | models/cnn/covnet4.py | pmwaniki/ppg-analysis | ae1c76ca8b0eb95a51e3f48eccb8d0a76e7abfbf | [
"MIT"
] | 2 | 2022-02-23T05:36:48.000Z | 2022-03-04T11:53:29.000Z | models/cnn/covnet4.py | pmwaniki/ppg-analysis | ae1c76ca8b0eb95a51e3f48eccb8d0a76e7abfbf | [
"MIT"
] | null | null | null | models/cnn/covnet4.py | pmwaniki/ppg-analysis | ae1c76ca8b0eb95a51e3f48eccb8d0a76e7abfbf | [
"MIT"
] | 1 | 2022-01-15T03:31:30.000Z | 2022-01-15T03:31:30.000Z |
import torch.nn as nn
import torch
import torch.nn.functional as F
# net=Convnet4(2,64,z_dim=32)
# t=torch.randn((5,2,320,300))
# output=net(t)
# output.shape
| 26.157895 | 57 | 0.625084 |
import torch.nn as nn
import torch
import torch.nn.functional as F
def convblock(in_channels,out_channels,pooling=True):
if pooling:
return nn.Sequential(
nn.BatchNorm2d(in_channels),
nn.Conv2d(in_channels,out_channels,3,padding=1),
# nn.BatchNorm2d(out_channels),
nn.ReLU()... | 1,142 | 12 | 174 |
0d32eda95a14559f5e27b04ec1d3aaa58203600c | 2,891 | py | Python | tdcsm-install.py | tdcoa/usage | 408091f77360fe29e14186b60746fd7d60713e42 | [
"MIT"
] | null | null | null | tdcsm-install.py | tdcoa/usage | 408091f77360fe29e14186b60746fd7d60713e42 | [
"MIT"
] | 4 | 2020-07-21T18:42:22.000Z | 2020-10-14T00:50:45.000Z | tdcsm-install.py | tdcoa/usage | 408091f77360fe29e14186b60746fd7d60713e42 | [
"MIT"
] | 1 | 2020-08-05T20:09:41.000Z | 2020-08-05T20:09:41.000Z | #! /usr/bin/env python
import sys
def check_python():
"Check if the correct python version is installed"
if sys.version_info < (3, 0):
raise SystemExit("Python2 is not supported. Try rerunning with python3 or download the latest **64-bit** version from https://www.python.org/downloads/")
if sys.maxsize <= 2**32:
... | 29.20202 | 155 | 0.667589 | #! /usr/bin/env python
import sys
def check_python():
"Check if the correct python version is installed"
if sys.version_info < (3, 0):
raise SystemExit("Python2 is not supported. Try rerunning with python3 or download the latest **64-bit** version from https://www.python.org/downloads/")
if sys.maxsize <= 2**32:
... | 1,868 | 0 | 161 |
4ae41ad49a05e26b0de3bd974202ec219d774141 | 3,657 | py | Python | psycho_embeddings/feature_extractor.py | MilaNLProc/psycho-embeddings | 2182076c1d455f8881858f0180852fe8a288f9b4 | [
"MIT"
] | null | null | null | psycho_embeddings/feature_extractor.py | MilaNLProc/psycho-embeddings | 2182076c1d455f8881858f0180852fe8a288f9b4 | [
"MIT"
] | null | null | null | psycho_embeddings/feature_extractor.py | MilaNLProc/psycho-embeddings | 2182076c1d455f8881858f0180852fe8a288f9b4 | [
"MIT"
] | null | null | null | from typing import Dict
from transformers.pipelines.base import GenericTensor, Pipeline
class NewFeatureExtractionPipeline(Pipeline):
"""
Feature extraction pipeline using no model head. This pipeline extracts the hidden states from the base
transformer, which can be used as features in downstream tasks.
... | 48.118421 | 119 | 0.655182 | from typing import Dict
from transformers.pipelines.base import GenericTensor, Pipeline
class NewFeatureExtractionPipeline(Pipeline):
"""
Feature extraction pipeline using no model head. This pipeline extracts the hidden states from the base
transformer, which can be used as features in downstream tasks.
... | 1,016 | 0 | 135 |
b5dbb0b0bcee643f1fd34734165384f8ac4f6dea | 5,494 | py | Python | tests/app/conftest.py | ZackPashkin/toloka-kit | 8f650e5d8cdded1949ca633cf78f9b851ce839bb | [
"Apache-2.0"
] | 153 | 2021-02-06T13:41:11.000Z | 2022-03-19T17:51:01.000Z | tests/app/conftest.py | ZackPashkin/toloka-kit | 8f650e5d8cdded1949ca633cf78f9b851ce839bb | [
"Apache-2.0"
] | 29 | 2021-01-15T12:54:37.000Z | 2022-02-07T07:45:32.000Z | tests/app/conftest.py | ZackPashkin/toloka-kit | 8f650e5d8cdded1949ca633cf78f9b851ce839bb | [
"Apache-2.0"
] | 17 | 2021-01-29T15:20:04.000Z | 2022-01-30T07:21:03.000Z | import pytest
from decimal import Decimal
@pytest.fixture
@pytest.fixture
@pytest.fixture
@pytest.fixture
@pytest.fixture
@pytest.fixture
| 29.223404 | 61 | 0.328176 | import pytest
from decimal import Decimal
@pytest.fixture
def app_map():
return {
'constraints_description': 'constraints description',
'default_item_price': Decimal(0.1),
'description': 'app description',
'examples': {},
'id': '123',
'image': 'image',
'inpu... | 5,212 | 0 | 132 |
18496a724ec7f11294f3696d4522309779f5f9f2 | 3,829 | py | Python | fairness/algorithms/zafar/fair-classification-master/disparate_mistreatment/synthetic_data_demo/decision_boundary_demo.py | yashwarlord/fairness-comparison | 366a4e4bb70498ac7498e4a98f50e3585f7881d3 | [
"Apache-2.0"
] | 146 | 2018-02-14T20:59:29.000Z | 2022-03-26T00:44:28.000Z | fairness/algorithms/zafar/fair-classification-master/disparate_mistreatment/synthetic_data_demo/decision_boundary_demo.py | yashwarlord/fairness-comparison | 366a4e4bb70498ac7498e4a98f50e3585f7881d3 | [
"Apache-2.0"
] | 6 | 2018-03-15T01:39:53.000Z | 2021-11-15T17:47:02.000Z | fairness/algorithms/zafar/fair-classification-master/disparate_mistreatment/synthetic_data_demo/decision_boundary_demo.py | yashwarlord/fairness-comparison | 366a4e4bb70498ac7498e4a98f50e3585f7881d3 | [
"Apache-2.0"
] | 50 | 2018-02-16T15:27:29.000Z | 2022-03-01T08:59:28.000Z | import os,sys
import numpy as np
from generate_synthetic_data import *
sys.path.insert(0, '../../fair_classification/') # the code for fair classification is in this directory
import utils as ut
import funcs_disp_mist as fdm
import plot_syn_boundaries as psb
def test_synthetic_data():
""" Generate the synthetic d... | 44.011494 | 217 | 0.68608 | import os,sys
import numpy as np
from generate_synthetic_data import *
sys.path.insert(0, '../../fair_classification/') # the code for fair classification is in this directory
import utils as ut
import funcs_disp_mist as fdm
import plot_syn_boundaries as psb
def test_synthetic_data():
""" Generate the synthetic d... | 447 | 0 | 47 |
7d1f457eda8d5e9c802cfb9bf88971d19416931d | 672 | py | Python | app.py | labulel/web-scraping-challenge | 02f5b49b99802ec018a1451387d4a5cba538213c | [
"Apache-2.0"
] | null | null | null | app.py | labulel/web-scraping-challenge | 02f5b49b99802ec018a1451387d4a5cba538213c | [
"Apache-2.0"
] | null | null | null | app.py | labulel/web-scraping-challenge | 02f5b49b99802ec018a1451387d4a5cba538213c | [
"Apache-2.0"
] | null | null | null | from flask import Flask, render_template, redirect
from flask_pymongo import PyMongo
import scrape_mars
app = Flask(__name__)
#use flask_pymongo to set up mongo connection
app.config ["MONGO_URI"] = "mongodb://localhost:27017/mars_app"
mongo = PyMongo(app)
@app.route("/")
@app.route("/scrape")
if __name__ =="__mai... | 24.888889 | 63 | 0.696429 | from flask import Flask, render_template, redirect
from flask_pymongo import PyMongo
import scrape_mars
app = Flask(__name__)
#use flask_pymongo to set up mongo connection
app.config ["MONGO_URI"] = "mongodb://localhost:27017/mars_app"
mongo = PyMongo(app)
@app.route("/")
def index():
#Find Mars data
Mars = ... | 276 | 0 | 44 |
3e7fdd30f2753e8e86e5f06e72426a7a4a2ba883 | 3,669 | py | Python | operators/teched21/unzip/script.py | thhapke/dilocal | 1d3c1b7b1a4513e9bff7efd77f680f66014ff499 | [
"MIT"
] | null | null | null | operators/teched21/unzip/script.py | thhapke/dilocal | 1d3c1b7b1a4513e9bff7efd77f680f66014ff499 | [
"MIT"
] | null | null | null | operators/teched21/unzip/script.py | thhapke/dilocal | 1d3c1b7b1a4513e9bff7efd77f680f66014ff499 | [
"MIT"
] | null | null | null | # For local development
#from utils.mock_di_api import mock_api
#api = mock_api(__file__,False)
import pandas as pd
import copy
import zipfile
import re
import io
from datetime import datetime
CREATE_SQL = False
api.set_port_callback('input',on_input) # datatype: message
| 40.318681 | 133 | 0.624693 | # For local development
#from utils.mock_di_api import mock_api
#api = mock_api(__file__,False)
import pandas as pd
import copy
import zipfile
import re
import io
from datetime import datetime
CREATE_SQL = False
def on_input(msg) :
api.logger.info('Unzip: {}'.format(msg.attributes['zipfile']))
try :
... | 3,366 | 0 | 23 |
857067ba58d9c2f2c4f08cd9db43c47d2da1d464 | 1,663 | py | Python | geolimes.py | akirsche/geoLIMES | 09f0f93f244fcdf056ea870c2524af15d3d757db | [
"MIT"
] | null | null | null | geolimes.py | akirsche/geoLIMES | 09f0f93f244fcdf056ea870c2524af15d3d757db | [
"MIT"
] | null | null | null | geolimes.py | akirsche/geoLIMES | 09f0f93f244fcdf056ea870c2524af15d3d757db | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from json import JSONDecodeError, loads
from os import makedirs
from os.path import exists, isdir
from urllib.error import HTTPError
from cache import Cache
from config import Config, ConfigNotValidError, load_config
from logger import InfoLogger
from mapper import Mapper... | 29.696429 | 130 | 0.644618 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from json import JSONDecodeError, loads
from os import makedirs
from os.path import exists, isdir
from urllib.error import HTTPError
from cache import Cache
from config import Config, ConfigNotValidError, load_config
from logger import InfoLogger
from mapper import Mapper... | 1,218 | -6 | 103 |
37eda14ffda685570b9da0c62550b975235a9f69 | 1,715 | py | Python | src/main/py/com/example/core/rdd/filter.py | brijeshdhaker/spark-python-examples | bb3504d21c073448c336c228f74449de68853b8d | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-07-18T16:23:56.000Z | 2021-07-18T16:23:56.000Z | src/main/py/com/example/core/rdd/filter.py | brijeshdhaker/spark-python-examples | bb3504d21c073448c336c228f74449de68853b8d | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/main/py/com/example/core/rdd/filter.py | brijeshdhaker/spark-python-examples | bb3504d21c073448c336c228f74449de68853b8d | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | #
import sys
import com.example.utils.commons as commons
from pyspark.sql import SparkSession
if __name__ == "__main__":
if len(sys.argv) != 1:
print("Usages: spark-file <in-path> <out-path>")
sys.exit(-1)
#
spark = SparkSession \
.builder \
.master("spark://spark-master:7077")\
.appN... | 28.583333 | 65 | 0.623324 | #
import sys
import com.example.utils.commons as commons
from pyspark.sql import SparkSession
if __name__ == "__main__":
if len(sys.argv) != 1:
print("Usages: spark-file <in-path> <out-path>")
sys.exit(-1)
def m_filter(element):
return element[4] > 30
#
spark = SparkSession \
.builder \
... | 28 | 0 | 23 |