hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c4d7471256e25ad7b3d2bd3072925af32812e662 | 2,861 | py | Python | load_cifar10.py | ShangtongZhang/Crossprop | 8e23b36015d3f79e559d78c24473de21e49df123 | [
"Apache-2.0"
] | 8 | 2017-05-26T22:04:38.000Z | 2020-12-07T11:26:48.000Z | load_cifar10.py | ShangtongZhang/Crossprop | 8e23b36015d3f79e559d78c24473de21e49df123 | [
"Apache-2.0"
] | 1 | 2019-04-01T21:18:21.000Z | 2019-04-01T21:18:21.000Z | load_cifar10.py | ShangtongZhang/Crossprop | 8e23b36015d3f79e559d78c24473de21e49df123 | [
"Apache-2.0"
] | 3 | 2018-08-18T21:12:15.000Z | 2019-10-23T17:21:20.000Z | import numpy as np
import re
n_classes=10
image_width=32
image_height=32
image_depth=3
# regular expression that matches a datafile
r_data_file = re.compile('^data_batch_\d+')
# training and validate datasets as numpy n-d arrays,
# apropriate portions of which are ready to be fed to the placeholder variables
train_a... | 38.146667 | 94 | 0.673541 | import numpy as np
import cPickle
import re
import os
n_classes=10
image_width=32
image_height=32
image_depth=3
# regular expression that matches a datafile
r_data_file = re.compile('^data_batch_\d+')
# training and validate datasets as numpy n-d arrays,
# apropriate portions of which are ready to be fed to the plac... | 0 | 0 | 0 | 0 | 0 | 1,943 | 0 | -19 | 113 |
803989a8b549c188f5c951f5ad75eb9f384b8a1b | 336 | py | Python | Algorithms/EDSR/common.py | TheStarkor/SuperResolution | 823aa004b15d1477f685b31bef0c3d8e181741bf | [
"MIT"
] | null | null | null | Algorithms/EDSR/common.py | TheStarkor/SuperResolution | 823aa004b15d1477f685b31bef0c3d8e181741bf | [
"MIT"
] | 12 | 2020-03-24T18:01:50.000Z | 2022-02-10T01:22:39.000Z | Algorithms/EDSR/common.py | TheStarkor/SuperResolution | 823aa004b15d1477f685b31bef0c3d8e181741bf | [
"MIT"
] | null | null | null | import numpy as np
DIV2K_RGB_MEAN = np.array([0.4488, 0.4371, 0.4040]) * 255 | 25.846154 | 57 | 0.720238 | import numpy as np
import tensorflow as tf
DIV2K_RGB_MEAN = np.array([0.4488, 0.4371, 0.4040]) * 255
def normalize(x, rgb_mean=DIV2K_RGB_MEAN):
return (x - rgb_mean) / 127.5
def denormalize(x, rgb_mean=DIV2K_RGB_MEAN):
return x * 127.5 + rgb_mean
def pixel_shuffle(scale):
return lambda x: tf.nn.depth_to... | 0 | 0 | 0 | 0 | 0 | 166 | 0 | 2 | 91 |
623d27e794d6980c0fd08dc979d7d2c9c7f138d8 | 4,078 | py | Python | audio.py | ChavesLiu/pytorch-dc-tts | 29a1ab11f69b2c4316ae0a8766e995b96385a29f | [
"MIT"
] | 145 | 2018-09-01T04:43:52.000Z | 2022-03-29T07:40:01.000Z | audio.py | ChavesLiu/pytorch-dc-tts | 29a1ab11f69b2c4316ae0a8766e995b96385a29f | [
"MIT"
] | 21 | 2018-09-27T11:05:54.000Z | 2021-09-18T13:10:53.000Z | audio.py | ChavesLiu/pytorch-dc-tts | 29a1ab11f69b2c4316ae0a8766e995b96385a29f | [
"MIT"
] | 73 | 2018-08-30T07:39:43.000Z | 2022-02-16T15:26:43.000Z | """These methods are copied from https://github.com/Kyubyong/dc_tts/"""
import os
import copy
import librosa
import scipy.io.wavfile
import numpy as np
from tqdm import tqdm
from scipy import signal
from hparams import HParams as hp
def spectrogram2wav(mag):
'''# Generate wave file from linear magnitude spectro... | 29.338129 | 103 | 0.621138 | """These methods are copied from https://github.com/Kyubyong/dc_tts/"""
import os
import copy
import librosa
import scipy.io.wavfile
import numpy as np
from tqdm import tqdm
from scipy import signal
from hparams import HParams as hp
def spectrogram2wav(mag):
'''# Generate wave file from linear magnitude spectro... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
39cf279e7cf056e01243e023eba32bc26d7d555f | 84 | py | Python | app/tests/web/__init__.py | BrunoComitre/kollector | b436862a9ce613fc40734f4d27561dd7c2e8cd52 | [
"MIT"
] | null | null | null | app/tests/web/__init__.py | BrunoComitre/kollector | b436862a9ce613fc40734f4d27561dd7c2e8cd52 | [
"MIT"
] | null | null | null | app/tests/web/__init__.py | BrunoComitre/kollector | b436862a9ce613fc40734f4d27561dd7c2e8cd52 | [
"MIT"
] | null | null | null | # Copyright (c) DEV Corporation. All rights reserved.
# Licensed under MIT License.
| 28 | 53 | 0.761905 | # Copyright (c) DEV Corporation. All rights reserved.
# Licensed under MIT License.
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bdffeeca662ddf2dccc9b5b5c6641420dfd92135 | 4,348 | py | Python | medical/settings.py | Vpingdevil/medstore | 3e03fc825c4f8f370bed37ab24a0bb13ab0a97af | [
"MIT"
] | 2 | 2021-03-24T13:36:39.000Z | 2022-02-10T13:51:59.000Z | medical/settings.py | Vpingdevil/Django_Sample | 3e03fc825c4f8f370bed37ab24a0bb13ab0a97af | [
"MIT"
] | 44 | 2021-01-05T01:51:38.000Z | 2022-02-10T13:44:26.000Z | medical/settings.py | mukeshgurpude/medstore | 498b76acbeb9727e7a61560e4016b3577c2706d2 | [
"MIT"
] | 1 | 2020-10-28T09:26:01.000Z | 2020-10-28T09:26:01.000Z | """
Django settings for medical project.
Generated by 'django-admin startproject' using Django 3.0.8.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
#... | 24.564972 | 104 | 0.695492 | """
Django settings for medical project.
Generated by 'django-admin startproject' using Django 3.0.8.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
fr... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -5 | 48 |
1e9ac616e99b96fe02b67dfed8d407325434f66f | 185 | py | Python | tests/segment_test.py | mohammad-yazdani/nevis | 7e2e0ecac48bc28292c5c05362c1b473784e4bd8 | [
"MIT"
] | null | null | null | tests/segment_test.py | mohammad-yazdani/nevis | 7e2e0ecac48bc28292c5c05362c1b473784e4bd8 | [
"MIT"
] | 4 | 2021-04-06T18:27:00.000Z | 2022-02-10T03:16:04.000Z | tests/segment_test.py | mohammad-yazdani/nevis | 7e2e0ecac48bc28292c5c05362c1b473784e4bd8 | [
"MIT"
] | null | null | null | from deepsegment import DeepSegment
# The default language is 'en'
segmenter = DeepSegment('en')
segmenter.segment('I am Batman i live in gotham')
# ['I am Batman', 'i live in gotham']
| 30.833333 | 49 | 0.735135 | from deepsegment import DeepSegment
# The default language is 'en'
segmenter = DeepSegment('en')
segmenter.segment('I am Batman i live in gotham')
# ['I am Batman', 'i live in gotham']
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a23473ec9fe153350440cd8e629d051432f0de3e | 689 | py | Python | django_dhcp/models.py | weijia/django-dhcp | 625c031f5b969d48e7ad15bca75c460ddad20a00 | [
"BSD-3-Clause"
] | 1 | 2016-12-24T21:00:03.000Z | 2016-12-24T21:00:03.000Z | django_dhcp/models.py | weijia/django-dhcp | 625c031f5b969d48e7ad15bca75c460ddad20a00 | [
"BSD-3-Clause"
] | null | null | null | django_dhcp/models.py | weijia/django-dhcp | 625c031f5b969d48e7ad15bca75c460ddad20a00 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
| 36.263158 | 70 | 0.724238 | # -*- coding: utf-8 -*-
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.translation import ugettext_lazy as _
class NetworkNode(models.Model):
mac_address = models.CharField(max_length=12)
ip = models.IPAddressField(help_text=_('ip address'))
hostname = models.C... | 0 | 0 | 0 | 512 | 0 | 0 | 0 | 64 | 89 |
55d04f9339409ee2455fc215be80a7ce106572df | 1,645 | py | Python | scheduler/tests/strategy_proofness_tests.py | akshayka/gavel | 40a22a725f2e70478483e98c9b07c6fc588e0c40 | [
"MIT"
] | 67 | 2020-09-07T11:50:03.000Z | 2022-03-31T04:09:08.000Z | scheduler/tests/strategy_proofness_tests.py | akshayka/gavel | 40a22a725f2e70478483e98c9b07c6fc588e0c40 | [
"MIT"
] | 7 | 2020-09-27T01:41:59.000Z | 2022-03-25T05:16:43.000Z | scheduler/tests/strategy_proofness_tests.py | akshayka/gavel | 40a22a725f2e70478483e98c9b07c6fc588e0c40 | [
"MIT"
] | 12 | 2020-10-13T14:31:01.000Z | 2022-02-14T05:44:38.000Z | import sys; sys.path.append("..")
import numpy as np
np.set_printoptions(precision=3, suppress=True)
| 39.166667 | 87 | 0.722796 | import sys; sys.path.append("..")
from policies import max_min_fairness, max_min_fairness_strategy_proof
import random
import time
import numpy as np
np.set_printoptions(precision=3, suppress=True)
def test_strategy_proofness(unflattened_throughputs, cluster_spec, verbose=True):
policy = max_min_fairness_strateg... | 0 | 0 | 0 | 0 | 0 | 1,422 | 0 | 31 | 90 |
d727050d95e95eb3a40d36227984025117eb0137 | 1,665 | py | Python | src/server_function.py | hash89/kafka-client | ce4cbc3451c1b22190431fb42694b3b03765ae4e | [
"Apache-2.0"
] | 2 | 2016-07-07T20:27:50.000Z | 2016-11-30T14:08:40.000Z | src/server_function.py | hash89/kafka-cli | ce4cbc3451c1b22190431fb42694b3b03765ae4e | [
"Apache-2.0"
] | null | null | null | src/server_function.py | hash89/kafka-cli | ce4cbc3451c1b22190431fb42694b3b03765ae4e | [
"Apache-2.0"
] | 2 | 2016-07-20T08:44:02.000Z | 2020-12-17T11:49:10.000Z | import os
import os.path
# Exemple
# main.py server start
# main.py server start /home/user/kafka/config/server.propersties
# main.py server stop
# main.py server restart
# main.py server restart /home/user/kafka/config/server.propersties
KAFKA_HOME = str(os.getenv("KAFKA_HOME"))
LOG_DIR = "server.log"
... | 30.833333 | 91 | 0.637237 | import os
import os.path
from print_function import *
# Exemple
# main.py server start
# main.py server start /home/user/kafka/config/server.propersties
# main.py server stop
# main.py server restart
# main.py server restart /home/user/kafka/config/server.propersties
KAFKA_HOME = str(os.getenv("KAFKA_HOME"... | 0 | 0 | 0 | 0 | 0 | 1,123 | 0 | 7 | 123 |
99bef23c3de4831e5bf77daefe959fe9fde03f68 | 1,957 | py | Python | venv/lib/python3.8/site-packages/vsts/feature_management/v4_1/models/contributed_feature_state.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/vsts/feature_management/v4_1/models/contributed_feature_state.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/vsts/feature_management/v4_1/models/contributed_feature_state.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------------------------------------... | 46.595238 | 141 | 0.571794 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------------------------------------... | 0 | 0 | 0 | 1,327 | 0 | 0 | 0 | 17 | 50 |
c4cfe6449ce8c72776566a1b65fb222f5d8622dd | 6,253 | py | Python | gnucash_reports/reports/expenses_monthly.py | MeerkatLabs/gnucash-reporting | 109e06be3625ad7a106db989ce7047998639ce34 | [
"BSD-3-Clause"
] | null | null | null | gnucash_reports/reports/expenses_monthly.py | MeerkatLabs/gnucash-reporting | 109e06be3625ad7a106db989ce7047998639ce34 | [
"BSD-3-Clause"
] | 10 | 2017-10-22T20:55:19.000Z | 2017-12-19T04:50:43.000Z | gnucash_reports/reports/expenses_monthly.py | MeerkatLabs/gnucash-reporting | 109e06be3625ad7a106db989ce7047998639ce34 | [
"BSD-3-Clause"
] | 1 | 2016-03-01T18:59:58.000Z | 2016-03-01T18:59:58.000Z | """
Gathers up all of the expenses and breaks down the values by month.
"""
import time
from operator import itemgetter
from gnucash_reports.collate.bucket import PeriodCollate, CategoryCollate, AccountCollate
from gnucash_reports.collate.bucket_generation import decimal_generator
from gnucash_reports.collate.store im... | 38.838509 | 120 | 0.722853 | """
Gathers up all of the expenses and breaks down the values by month.
"""
import time
import math
from operator import itemgetter
from gnucash_reports.collate.bucket import PeriodCollate, CategoryCollate, AccountCollate
from gnucash_reports.collate.bucket_generation import decimal_generator
from gnucash_reports.coll... | 0 | 0 | 0 | 0 | 0 | 297 | 0 | -10 | 90 |
ec73d6b38540b72d81b0dc51968a6ec592a2d916 | 1,712 | py | Python | KNeighborsClassifier/app.py | GrishenkovP/model_deployment | 5bcb35802e6dd401c0f4eb8ce81b4165028de65a | [
"MIT"
] | null | null | null | KNeighborsClassifier/app.py | GrishenkovP/model_deployment | 5bcb35802e6dd401c0f4eb8ce81b4165028de65a | [
"MIT"
] | null | null | null | KNeighborsClassifier/app.py | GrishenkovP/model_deployment | 5bcb35802e6dd401c0f4eb8ce81b4165028de65a | [
"MIT"
] | null | null | null | from flask import Flask
app = Flask(__name__)
if __name__ == '__main__':
app.run(debug=True)
| 38.909091 | 82 | 0.610981 | import pandas as pd
import numpy as np
import sklearn
import joblib
from flask import Flask, render_template, request, url_for
app = Flask(__name__)
@app.route('/')
@app.route('/predict', methods=['GET', 'POST'])
def predict():
prediction_name_iris = 'Unknown'
prediction_foto_iris ='unknown'
... | 0 | 1,471 | 0 | 0 | 0 | 0 | 0 | 15 | 117 |
e6274df1bef9af693c83537770dc03e876dbb3b9 | 1,185 | py | Python | d13/a2.py | nikosgraser/aoc-2020 | f6b197eca161028f3e62cebc1b8e756898d545f5 | [
"0BSD"
] | null | null | null | d13/a2.py | nikosgraser/aoc-2020 | f6b197eca161028f3e62cebc1b8e756898d545f5 | [
"0BSD"
] | null | null | null | d13/a2.py | nikosgraser/aoc-2020 | f6b197eca161028f3e62cebc1b8e756898d545f5 | [
"0BSD"
] | null | null | null | from math import prod
with open('input', 'r') as fd:
bus_lines_raw = fd.readlines()[1].strip().split(',')
bus_lines = list(map(int, filter(lambda bl: bl != 'x', bus_lines_raw)))
bl_offsets = [i for i, n in enumerate(bus_lines_raw) if n != 'x']
# For an explanation of how this works, look up the Chinese Remaind... | 30.384615 | 103 | 0.643038 | from typing import Tuple
from math import prod
with open('input', 'r') as fd:
bus_lines_raw = fd.readlines()[1].strip().split(',')
bus_lines = list(map(int, filter(lambda bl: bl != 'x', bus_lines_raw)))
bl_offsets = [i for i, n in enumerate(bus_lines_raw) if n != 'x']
def bezout_coeff(a: int, b: int) -> Tuple[i... | 0 | 0 | 0 | 0 | 0 | 236 | 0 | 3 | 45 |
38e80ed2271239a233779d6f2b859f0eef046850 | 730 | py | Python | Season 07 - Databases in Python & Milestone Project 2/Milestone Project 2/Storing Books in Lists/utils/database.py | Pythobit/Python-tutorial | b0743eaa9c237c3578131ead1b3f2c295f11b7ee | [
"MIT"
] | 3 | 2021-02-19T18:33:00.000Z | 2021-08-03T14:56:50.000Z | Season 07 - Databases in Python & Milestone Project 2/Milestone Project 2/Storing Books in Lists/utils/database.py | barawalojas/Python-tutorial | 3f4b2b073e421888b3d62ff634658317d9abcb9b | [
"MIT"
] | 1 | 2021-07-10T14:37:57.000Z | 2021-07-20T09:51:39.000Z | Season 07 - Databases in Python & Milestone Project 2/Milestone Project 2/Storing Books in Lists/utils/database.py | barawalojas/Python-tutorial | 3f4b2b073e421888b3d62ff634658317d9abcb9b | [
"MIT"
] | 1 | 2021-08-02T05:39:38.000Z | 2021-08-02T05:39:38.000Z | """
Concerned with storing and returning books from a list.
"""
books = []
# def delete_book(name): # This is considered as a Bad Practice.
# for book in books:
# if book['name'] == name:
# books.remove(book)
"""
SCOPE - as in <line 26> : global books
states that books in local ... | 21.470588 | 78 | 0.609589 | """
Concerned with storing and returning books from a list.
"""
books = []
def add_book(name, author):
books.append({'name': name, 'author': author, 'read': False})
def get_all_books():
return books
def mark_book_as_read(name):
for book in books:
if book['name'] == name:
book['read... | 0 | 0 | 0 | 0 | 0 | 262 | 0 | 0 | 92 |
207a7b4b475bfc0cbd0bb077ecf82ede96622f87 | 192 | py | Python | examples/xspec_fit.py | zblz/gammapy | 49539f25886433abeedc8852387ab4cd73977006 | [
"BSD-3-Clause"
] | null | null | null | examples/xspec_fit.py | zblz/gammapy | 49539f25886433abeedc8852387ab4cd73977006 | [
"BSD-3-Clause"
] | null | null | null | examples/xspec_fit.py | zblz/gammapy | 49539f25886433abeedc8852387ab4cd73977006 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Fit and illustrate example spectral data in XSPEC format.
Run `xspec_fake.py` first to generate the example input file.
"""
| 32 | 63 | 0.760417 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Fit and illustrate example spectral data in XSPEC format.
Run `xspec_fake.py` first to generate the example input file.
"""
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2b588948131dca8b7dc22803edf75fa65bb1cbe2 | 5,311 | py | Python | utils/text_process.py | Young2019/TextGAN-PyTorch | 883078215fd091dbbd0a53c99be22c147fdedaf3 | [
"MIT"
] | 7 | 2020-05-23T05:39:30.000Z | 2022-03-18T09:52:38.000Z | utils/text_process.py | Young2019/TextGAN-PyTorch | 883078215fd091dbbd0a53c99be22c147fdedaf3 | [
"MIT"
] | 2 | 2020-06-16T12:06:12.000Z | 2020-06-16T13:49:44.000Z | utils/text_process.py | Young2019/TextGAN-PyTorch | 883078215fd091dbbd0a53c99be22c147fdedaf3 | [
"MIT"
] | 2 | 2021-04-22T06:18:48.000Z | 2021-04-30T09:15:54.000Z | # -*- coding: utf-8 -*-
# @Author : William
# @Project : TextGAN-william
# @FileName : text_process.py
# @Time : Created at 2019-05-14
# @Blog : http://zhiweil.ml/
# @Description :
# Copyrights (C) 2018. All Rights Reserved.
import nltk
import os
import torch
import config as cfg
de... | 30.699422 | 102 | 0.635285 | # -*- coding: utf-8 -*-
# @Author : William
# @Project : TextGAN-william
# @FileName : text_process.py
# @Time : Created at 2019-05-14
# @Blog : http://zhiweil.ml/
# @Description :
# Copyrights (C) 2018. All Rights Reserved.
import nltk
import os
import torch
import config as cfg
de... | 0 | 0 | 0 | 0 | 0 | 221 | 0 | 0 | 23 |
dd72ee9ea3c8993befebc7238339ee774273c6ef | 883 | py | Python | conoha/config.py | ttk1/conoha-cli | d1c68ee63e9c61a0a727a24206a1fd8aa4abcf13 | [
"MIT"
] | null | null | null | conoha/config.py | ttk1/conoha-cli | d1c68ee63e9c61a0a727a24206a1fd8aa4abcf13 | [
"MIT"
] | null | null | null | conoha/config.py | ttk1/conoha-cli | d1c68ee63e9c61a0a727a24206a1fd8aa4abcf13 | [
"MIT"
] | null | null | null | from os.path import expanduser, exists
from os import makedirs
conoha_home = expanduser('~/.conoha')
config_path = f'{conoha_home}/config.json'
credential_path = f'{conoha_home}/credential.json'
token_path = f'{conoha_home}/token.json'
if not exists(conoha_home):
makedirs(conoha_home)
| 23.864865 | 64 | 0.681767 | import json
from os.path import expanduser, exists
from os import makedirs
conoha_home = expanduser('~/.conoha')
config_path = f'{conoha_home}/config.json'
credential_path = f'{conoha_home}/credential.json'
token_path = f'{conoha_home}/token.json'
if not exists(conoha_home):
makedirs(conoha_home)
def get_config... | 0 | 0 | 0 | 0 | 0 | 459 | 0 | -10 | 137 |
71e8f16ea53193c560fb81cbd45dffe388d20cc8 | 6,706 | py | Python | library/python/pysandesh/test/sandesh_msg_test.py | atsgen/contrail-sandesh | 857c483697b88da94cd11ecfe2df3247c902bbb3 | [
"Apache-2.0"
] | 8 | 2015-01-08T17:36:08.000Z | 2019-09-18T01:49:18.000Z | library/python/pysandesh/test/sandesh_msg_test.py | atsgen/contrail-sandesh | 857c483697b88da94cd11ecfe2df3247c902bbb3 | [
"Apache-2.0"
] | 4 | 2015-01-12T21:26:04.000Z | 2020-12-22T15:48:55.000Z | library/python/pysandesh/test/sandesh_msg_test.py | atsgen/contrail-sandesh | 857c483697b88da94cd11ecfe2df3247c902bbb3 | [
"Apache-2.0"
] | 35 | 2015-02-26T18:19:18.000Z | 2020-02-05T09:49:47.000Z | #!/usr/bin/env python
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
#
# sandesh_msg_test
#
import unittest
import sys
sys.path.insert(1, sys.path[0]+'/../../../python')
# end SandeshSessionTestHelper
# end class SandeshMsgTest
if __name__ == '__main__':
unittest.main(verbosity=2, catch... | 38.988372 | 88 | 0.695347 | #!/usr/bin/env python
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
#
# sandesh_msg_test
#
import unittest
import sys
import os
import socket
import test_utils
import time
import uuid
from itertools import chain
sys.path.insert(1, sys.path[0]+'/../../../python')
from pysandesh.sandesh_base i... | 0 | 262 | 0 | 5,818 | 0 | 0 | 0 | 27 | 267 |
52485a34fe3c464fdb1d6586a8842240eacf1dd9 | 821 | py | Python | COS120/MPS/MP07/MP06.py | thejayhaykid/Python | 641c33b94762f0cace203dcf4cc121571625ab02 | [
"MIT"
] | null | null | null | COS120/MPS/MP07/MP06.py | thejayhaykid/Python | 641c33b94762f0cace203dcf4cc121571625ab02 | [
"MIT"
] | null | null | null | COS120/MPS/MP07/MP06.py | thejayhaykid/Python | 641c33b94762f0cace203dcf4cc121571625ab02 | [
"MIT"
] | null | null | null | side = 50
COUNT = 8
checker(side)
| 19.093023 | 55 | 0.493301 | from turtle import *
side = 50
COUNT = 8
def DrawBox(count,colorcount,side):
# determine color
if colorcount%2==0:
if count % 2 == 1:
fillcolor('#000000')
else:
fillcolor('#990000')
else:
if count % 2 == 1:
fillcolor('#990000')
else:
... | 0 | 0 | 0 | 0 | 0 | 718 | 0 | -1 | 68 |
ae625190cb1bcf2697aa3b2d14b4f4406dc644bb | 167 | py | Python | inclearn/lib/losses/__init__.py | sajjadahmadish/incremental_learning.pytorch | f01c1cf9cbafc930687a89dbdf7c1937d1ca2749 | [
"MIT"
] | null | null | null | inclearn/lib/losses/__init__.py | sajjadahmadish/incremental_learning.pytorch | f01c1cf9cbafc930687a89dbdf7c1937d1ca2749 | [
"MIT"
] | null | null | null | inclearn/lib/losses/__init__.py | sajjadahmadish/incremental_learning.pytorch | f01c1cf9cbafc930687a89dbdf7c1937d1ca2749 | [
"MIT"
] | null | null | null | # flake8: noqa
| 20.875 | 30 | 0.754491 | # flake8: noqa
from .base import *
from .distillation import *
from .metrics import *
from .regularizations import *
from .unsupervised import *
from .losses import *
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 20 | 132 |
e30d9d200104907a3adac3af1fb8103b332e6163 | 4,769 | py | Python | scripts/monitoring/cron-send-fluentd-depth.py | jianlongzhou/openshift-tools | 0f07cd092bde5a70dccde82c61124aed7bf22160 | [
"Apache-2.0"
] | 164 | 2015-07-29T17:35:04.000Z | 2021-12-16T16:38:04.000Z | scripts/monitoring/cron-send-fluentd-depth.py | jianlongzhou/openshift-tools | 0f07cd092bde5a70dccde82c61124aed7bf22160 | [
"Apache-2.0"
] | 3,634 | 2015-06-09T13:49:15.000Z | 2022-03-23T20:55:44.000Z | scripts/monitoring/cron-send-fluentd-depth.py | jianlongzhou/openshift-tools | 0f07cd092bde5a70dccde82c61124aed7bf22160 | [
"Apache-2.0"
] | 250 | 2015-06-08T19:53:11.000Z | 2022-03-01T04:51:23.000Z | #!/usr/bin/env python
"""
Fluentd queue check for v3
"""
from openshift_tools.monitoring.ocutil import OCUtil
import logging
logging.basicConfig(
format='%(asctime)s - %(relativeCreated)6d - %(levelname)-8s - %(message)s',
)
logger = logging.getLogger()
logger.setLevel(logging.INFO)
ocutil = OCUtil()
if __nam... | 38.772358 | 134 | 0.626546 | #!/usr/bin/env python
"""
Fluentd queue check for v3
"""
import argparse
import time
import subprocess
import math
from dateutil import parser
from datetime import datetime
from openshift_tools.monitoring.ocutil import OCUtil
from openshift_tools.monitoring.metric_sender import MetricSender
import logging
logging.... | 0 | 0 | 0 | 4,169 | 0 | 0 | 0 | 28 | 178 |
169e52fbc2b1a282357790b804f459eafd1aac75 | 2,512 | py | Python | apitest/migrations/0002_auto_20200612_1638.py | zhjfeng/test_manger | 7c9fd07b2c1f40aa371ff3a4fe0d13c842941aa1 | [
"Apache-2.0"
] | null | null | null | apitest/migrations/0002_auto_20200612_1638.py | zhjfeng/test_manger | 7c9fd07b2c1f40aa371ff3a4fe0d13c842941aa1 | [
"Apache-2.0"
] | null | null | null | apitest/migrations/0002_auto_20200612_1638.py | zhjfeng/test_manger | 7c9fd07b2c1f40aa371ff3a4fe0d13c842941aa1 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.0.7 on 2020-06-12 08:38
| 38.060606 | 184 | 0.558917 | # Generated by Django 3.0.7 on 2020-06-12 08:38
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('product', '0002_auto_20200610_2035'),
('apitest', '0001_initial'),
]
operations = [
migrations.Alte... | 159 | 0 | 0 | 2,312 | 0 | 0 | 0 | 30 | 68 |
92f03cfe2a7380187a7e52d5d7e3af121e7d9b85 | 4,108 | py | Python | pyupgrade/_plugins/mock.py | vivster7/pyupgrade | de7be58e4b0b34111d7096ddcae957153b697cb9 | [
"MIT"
] | null | null | null | pyupgrade/_plugins/mock.py | vivster7/pyupgrade | de7be58e4b0b34111d7096ddcae957153b697cb9 | [
"MIT"
] | null | null | null | pyupgrade/_plugins/mock.py | vivster7/pyupgrade | de7be58e4b0b34111d7096ddcae957153b697cb9 | [
"MIT"
] | null | null | null |
MOCK_MODULES = frozenset(('mock', 'mock.mock'))
| 27.026316 | 74 | 0.570594 | import ast
import functools
from typing import Iterable
from typing import List
from typing import Optional
from typing import Tuple
from tokenize_rt import Offset
from tokenize_rt import Token
from pyupgrade._ast_helpers import ast_to_offset
from pyupgrade._data import register
from pyupgrade._data import State
from... | 0 | 1,245 | 0 | 0 | 0 | 2,196 | 0 | 114 | 495 |
2d0c38449505a543591fc8047e4ddd863d5579e1 | 22,110 | py | Python | main.py | goo-goo-goo-joob/AirportPassengerTrafficOptimization | 883c7b489999b0df85a51b40e68a46dd6406d228 | [
"MIT"
] | 1 | 2021-12-11T17:09:02.000Z | 2021-12-11T17:09:02.000Z | main.py | goo-goo-goo-joob/AirportPassengerTrafficOptimization | 883c7b489999b0df85a51b40e68a46dd6406d228 | [
"MIT"
] | null | null | null | main.py | goo-goo-goo-joob/AirportPassengerTrafficOptimization | 883c7b489999b0df85a51b40e68a46dd6406d228 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
def main_spb(method):
"""
.
:param method: .
"""
mu1 = [1 / 87, 1 / 30, 1 / 70]
n_max1 = np.array([88, 26, 24])
lam1 = 28659.2 / (24 * 60 * 60)
p1 = [0.999, 0.999]
s_max = 120
s = np.ones(len(mu1))
t_max = 4 ... | 44.666667 | 121 | 0.564586 | import itertools
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import plotly.express as px
from scipy.optimize import minimize, LinearConstraint, NonlinearConstraint
from tqdm import tqdm
from utils import constraint_cost, calc_time, calc_cost, ConstraintTime, f_ey, f_conv, f_ideal, ... | 7,710 | 0 | 0 | 13,748 | 0 | 0 | 0 | 175 | 167 |
6b0f1fd1eecb822df314dfc2db85047024f7f04e | 7,047 | py | Python | GFTE-pos+text+img/train2.py | huabao97/New-GFTE | 11d48139b32d2b9ed10b2d4be2b51b9f7acf476c | [
"Apache-2.0"
] | 2 | 2022-03-14T05:40:27.000Z | 2022-03-17T02:13:06.000Z | GFTE-pos+text+img/train2.py | huabao97/New-GFTE | 11d48139b32d2b9ed10b2d4be2b51b9f7acf476c | [
"Apache-2.0"
] | 1 | 2022-03-24T20:37:44.000Z | 2022-03-24T20:37:44.000Z | GFTE-pos+text+img/train2.py | huabao97/New-GFTE | 11d48139b32d2b9ed10b2d4be2b51b9f7acf476c | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import argparse
import random
import torch
import torch.optim as optim
import torch.utils.data
import numpy as np
import os
import utils
from torch_geometric.data import DataLoader
from model2 import TbNet
from dataset2 import ScitsrDataset
parser = argparse.ArgumentParser()
parse... | 35.771574 | 117 | 0.689939 | from __future__ import print_function
import argparse
import random
import torch
import torch.optim as optim
import torch.utils.data
from torch.autograd import Variable
import numpy as np
import os
import utils
from torch_geometric.data import Data, Dataset,DataLoader
from torch_scatter import scatter_mean
import torch... | 15 | 0 | 0 | 0 | 0 | 1,355 | 0 | 43 | 178 |
d1f0c250945fb8953e5790d1e4c3bc42ddfff63c | 1,336 | py | Python | sandbox/degree_distribution_modified_watts_strogatz.py | benmaier/sixdegrees | 6fee5a4f81d91ec2ce92c8767add67b701651a85 | [
"MIT"
] | null | null | null | sandbox/degree_distribution_modified_watts_strogatz.py | benmaier/sixdegrees | 6fee5a4f81d91ec2ce92c8767add67b701651a85 | [
"MIT"
] | null | null | null | sandbox/degree_distribution_modified_watts_strogatz.py | benmaier/sixdegrees | 6fee5a4f81d91ec2ce92c8767add67b701651a85 | [
"MIT"
] | 1 | 2020-09-22T12:35:51.000Z | 2020-09-22T12:35:51.000Z | import sixdegrees
import numpy as np
import scipy.sparse as sprs
import matplotlib.pyplot as pl
N_meas = 1000
betas = np.logspace(-3,0,10)
k = 8.
N = 100
for beta in betas:
hist = np.zeros((N,))
for meas in range(N_meas):
_, row, col = sixdegrees.modified_small_world_network_coord_lists(
... | 20.553846 | 113 | 0.529192 | import sixdegrees
import numpy as np
import scipy.sparse as sprs
from scipy.special import binom
import matplotlib.pyplot as pl
def P_theory(N,k,beta,kmax):
k = int(k)
p0 = (1-beta+beta*(N-1)/k)**(-1)
P = np.zeros(kmax+1)
for c in range(kmax+1):
s = 0.
n = np.min([c,k])
... | 0 | 0 | 0 | 0 | 0 | 362 | 0 | 10 | 46 |
e9e43c933ed4c1a9555cbd21828c4921c0caaab9 | 1,803 | py | Python | character.py | navarro0/visual-novel-engine | 3d3bb2dc2af966ac7d282d759b6a3b9af91c03b6 | [
"MIT"
] | null | null | null | character.py | navarro0/visual-novel-engine | 3d3bb2dc2af966ac7d282d759b6a3b9af91c03b6 | [
"MIT"
] | null | null | null | character.py | navarro0/visual-novel-engine | 3d3bb2dc2af966ac7d282d759b6a3b9af91c03b6 | [
"MIT"
] | 1 | 2021-04-20T06:20:20.000Z | 2021-04-20T06:20:20.000Z |
##########################################################################
## Character ##
## -------------------------------------------------------------------- ##
## Class that defines an instance of an on-screen character sprite. Has ##
## various attribut... | 45.075 | 78 | 0.464226 | import pygame, copy
from pygame.locals import *
##########################################################################
## Character ##
## -------------------------------------------------------------------- ##
## Class that defines an instance of an on-scr... | 0 | 0 | 0 | 1,269 | 0 | 0 | 0 | 4 | 79 |
293bef3b1f93a630cb76e3e39d17a6acedb77968 | 2,868 | py | Python | test/mock_pool.py | qarnot/computing-python-sdk | cfee10a16bfdaf9e894317b04efd5563933b0ce4 | [
"Apache-2.0"
] | 11 | 2016-09-08T06:00:37.000Z | 2021-11-11T21:03:16.000Z | test/mock_pool.py | qarnot/computing-python-sdk | cfee10a16bfdaf9e894317b04efd5563933b0ce4 | [
"Apache-2.0"
] | 3 | 2020-01-20T23:00:32.000Z | 2021-04-26T08:09:05.000Z | test/mock_pool.py | qarnot/computing-python-sdk | cfee10a16bfdaf9e894317b04efd5563933b0ce4 | [
"Apache-2.0"
] | 5 | 2017-09-26T14:58:58.000Z | 2021-02-24T15:23:08.000Z |
default_json_pool = {
"previousState": "Closing",
"stateTransitionTime": "2021-03-18T14:34:51Z",
"previousStateTransitionTime": "2021-03-18T14:34:39Z",
"lastModified": "2021-03-18T14:34:51Z",
"elasticProperty": {
"isElastic": False,
"minTotalSlots": 1,
"maxTotalSlots"... | 30.510638 | 73 | 0.52371 |
default_json_pool = {
"previousState": "Closing",
"stateTransitionTime": "2021-03-18T14:34:51Z",
"previousStateTransitionTime": "2021-03-18T14:34:39Z",
"lastModified": "2021-03-18T14:34:51Z",
"elasticProperty": {
"isElastic": False,
"minTotalSlots": 1,
"maxTotalSlots"... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e80ab44355d520649340f06ef2a61674f2ee3ad1 | 824 | py | Python | gocdapi_tests/unittests/test_stage.py | andrewphilipsmith/gocdapi | 82eb37c6b00a918b6bcf4184a66cad7344cfaa2e | [
"MIT"
] | 8 | 2015-01-23T12:50:30.000Z | 2020-01-21T11:00:19.000Z | gocdapi_tests/unittests/test_stage.py | andrewphilipsmith/gocdapi | 82eb37c6b00a918b6bcf4184a66cad7344cfaa2e | [
"MIT"
] | 7 | 2015-01-27T23:17:05.000Z | 2016-06-08T15:27:07.000Z | gocdapi_tests/unittests/test_stage.py | andrewphilipsmith/gocdapi | 82eb37c6b00a918b6bcf4184a66cad7344cfaa2e | [
"MIT"
] | 2 | 2015-11-23T18:33:24.000Z | 2020-07-15T09:01:34.000Z | import unittest
if __name__ == '__main__':
unittest.main()
| 20.6 | 71 | 0.515777 | import unittest
from gocdapi.go import Go
from gocdapi.pipeline import Pipeline
from gocdapi.stage import Stage
class TestStage(unittest.TestCase):
DATA0 = {
"stages": [
{
"name": "Deploy"
},
{
"name": "tests"
}
],
... | 0 | 0 | 0 | 638 | 0 | 0 | 0 | 30 | 90 |
c546c4f5f1853c9544b509c4b251c8bb9310579b | 2,510 | py | Python | download_climate_data.py | shristov1/sofia_air_quality | 3913d7f3a5d79077a4be3cad28199e6f5fa1a497 | [
"MIT"
] | null | null | null | download_climate_data.py | shristov1/sofia_air_quality | 3913d7f3a5d79077a4be3cad28199e6f5fa1a497 | [
"MIT"
] | null | null | null | download_climate_data.py | shristov1/sofia_air_quality | 3913d7f3a5d79077a4be3cad28199e6f5fa1a497 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Jan 4 16:39:41 2021
This will be used to query an FTP server to download csv data from the sensors of interest.
@author: sHristov
"""
import os
import time
import datetime
import logging
import urllib.error
import requests
def download_data(sensor_nam... | 29.186047 | 113 | 0.634263 | # -*- coding: utf-8 -*-
"""
Created on Mon Jan 4 16:39:41 2021
This will be used to query an FTP server to download csv data from the sensors of interest.
@author: sHristov
"""
import os
import time
import datetime
import logging
import gzip
import typing
import urllib.error
import urllib.request
... | 0 | 0 | 0 | 0 | 396 | 0 | 0 | -34 | 165 |
d0a051aaadbacddc921cfd20414eb54780de1f80 | 2,420 | py | Python | test_onewire.py | gexpander/demo-py-examples | 9f6f2eb198c2329cba5a957e51dc50294555c17c | [
"MIT"
] | null | null | null | test_onewire.py | gexpander/demo-py-examples | 9f6f2eb198c2329cba5a957e51dc50294555c17c | [
"MIT"
] | null | null | null | test_onewire.py | gexpander/demo-py-examples | 9f6f2eb198c2329cba5a957e51dc50294555c17c | [
"MIT"
] | null | null | null | #!/bin/env python3
import gex
with gex.Client(gex.TrxRawUSB()) as client:
ow = gex.OneWire(client, 'ow')
# print("Presence: ", ow.test_presence())
print("Devices:", ow.search())
while True:
(a, b) = meas2(6558392391241695016, 1802309978572980008)
# a = meas(6558392391241695016)
... | 29.512195 | 95 | 0.52438 | #!/bin/env python3
import time
import gex
with gex.Client(gex.TrxRawUSB()) as client:
ow = gex.OneWire(client, 'ow')
# print("Presence: ", ow.test_presence())
print("Devices:", ow.search())
def meas(addr):
ow.write([0x44], addr=addr)
ow.wait_ready()
data = ow.query([0xBE], 9, ... | 6 | 0 | 0 | 0 | 0 | 518 | 0 | -10 | 76 |
0489b19b1019f989acfd42b649510c64e6668221 | 3,942 | py | Python | tests/bugs/core_5018_test.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | tests/bugs/core_5018_test.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | tests/bugs/core_5018_test.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | #coding:utf-8
#
# id: bugs.core_5018
# title: Regression: Non-indexed predicates may not be applied immediately after retrieval when tables are being joined
# decription:
# tracker_id: CORE-5018
# min_versions: ['3.0']
# versions: 3.0
# qmid: None
from firebird.qa import db_factory, is... | 29.2 | 126 | 0.56621 | #coding:utf-8
#
# id: bugs.core_5018
# title: Regression: Non-indexed predicates may not be applied immediately after retrieval when tables are being joined
# decription:
# tracker_id: CORE-5018
# min_versions: ['3.0']
# versions: 3.0
# qmid: None
import pytest
from firebird.qa import... | 0 | 162 | 0 | 0 | 0 | 0 | 0 | 0 | 46 |
360964eb12edc5c9041fbdbc7fb05671a8deea1a | 3,119 | py | Python | asyncDqn/adqn_agent.py | yipsang/tetris-rl | d8d8e13eabee1321c54e941725b788d7b26b04d0 | [
"MIT"
] | null | null | null | asyncDqn/adqn_agent.py | yipsang/tetris-rl | d8d8e13eabee1321c54e941725b788d7b26b04d0 | [
"MIT"
] | null | null | null | asyncDqn/adqn_agent.py | yipsang/tetris-rl | d8d8e13eabee1321c54e941725b788d7b26b04d0 | [
"MIT"
] | null | null | null | from torch import random
import torch.optim as optim
| 30.281553 | 96 | 0.633857 | from torch import random
import torch
from torch.nn.modules import linear
import torch.optim as optim
import torch.nn.functional as F
from torch.nn.utils import clip_grad_norm_
import logging
import numpy as np
import random
from value_network import ValueNetwork, ConvValueNetwork
class ADQNAgent:
def __init__(
... | 0 | 0 | 0 | 2,812 | 0 | 0 | 0 | 53 | 200 |
dea1673941648ce9ee45f5ded7b9c0386b54f847 | 958 | py | Python | SkyEspProj/sky_iot/globalvar.py | wiyixiao/iotLed | d60431d52f94aeed77d1956e08cd97f266a1f1e5 | [
"MIT"
] | null | null | null | SkyEspProj/sky_iot/globalvar.py | wiyixiao/iotLed | d60431d52f94aeed77d1956e08cd97f266a1f1e5 | [
"MIT"
] | null | null | null | SkyEspProj/sky_iot/globalvar.py | wiyixiao/iotLed | d60431d52f94aeed77d1956e08cd97f266a1f1e5 | [
"MIT"
] | null | null | null |
_init()
read_config() | 23.365854 | 73 | 0.65762 | from sky_iot.utils import UtilsTool
def _init():
global _global_dict
_global_dict = {}
def set_value(name, value):
_global_dict[name] = value
def get_value(name, defValue=None):
try:
return _global_dict[name]
except KeyError:
return defValue
_init()
def read_config():
set_va... | 24 | 0 | 0 | 0 | 0 | 776 | 0 | 14 | 137 |
131a0243216ceccf8d1aa34b1d428e9a1135febb | 1,267 | py | Python | setup_scripts/glint_system_create_user.py | m-conklin/glint | a7923e2b1474b2c9bacbb56dc4e0dd955323d794 | [
"Apache-2.0"
] | 3 | 2015-08-04T03:59:32.000Z | 2017-01-11T06:18:13.000Z | setup_scripts/glint_system_create_user.py | m-conklin/glint | a7923e2b1474b2c9bacbb56dc4e0dd955323d794 | [
"Apache-2.0"
] | 6 | 2015-03-05T20:05:23.000Z | 2021-07-14T00:23:25.000Z | setup_scripts/glint_system_create_user.py | m-conklin/glint | a7923e2b1474b2c9bacbb56dc4e0dd955323d794 | [
"Apache-2.0"
] | 4 | 2015-03-31T23:21:10.000Z | 2018-09-18T22:21:37.000Z | #!/usr/bin/python
import sys
#user and group id
id=171
if len(sys.argv) == 2:
if sys.argv[1] == "create-glint-user":
create_group()
add_user()
elif sys.argv[1] == "remove-glint-user":
remove_user()
#remove_group()
else:
show_usage()
else:
show_usage()
| 28.795455 | 146 | 0.632202 | #!/usr/bin/python
import sys,subprocess
#user and group id
id=171
def execute_command(cmd_args):
process = subprocess.Popen(cmd_args,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
out,err = process.communicate()
if err:
print "warning: %s"%err
return out,err
def create_group():
print "Cre... | 0 | 0 | 0 | 0 | 0 | 831 | 0 | 11 | 115 |
95fe6f84e582b8190c81b2e2f7861ae81fa978a7 | 1,426 | py | Python | tests/api/serializers/test_common_serializer.py | oil-rope/oil-and-rope | 6d59c87d4809f120417a90c1624952085486bb06 | [
"MIT"
] | 8 | 2019-08-27T20:08:22.000Z | 2021-07-23T22:49:47.000Z | tests/api/serializers/test_common_serializer.py | oil-rope/oil-and-rope | 6d59c87d4809f120417a90c1624952085486bb06 | [
"MIT"
] | 73 | 2020-03-11T18:07:29.000Z | 2022-03-28T18:07:47.000Z | tests/api/serializers/test_common_serializer.py | oil-rope/oil-and-rope | 6d59c87d4809f120417a90c1624952085486bb06 | [
"MIT"
] | 4 | 2020-02-22T19:44:17.000Z | 2022-03-08T09:42:45.000Z | from django.apps import apps
from common.constants import models
Profile = apps.get_model(models.PROFILE_MODEL)
| 35.65 | 97 | 0.697055 | from django.apps import apps
from django.test import TestCase
from model_bakery import baker
from rest_framework import serializers
from api.serializers.common import MappedSerializerMixin
from api.serializers.registration import UserSerializer
from common.constants import models
Profile = apps.get_model(models.PROFI... | 0 | 467 | 0 | 605 | 0 | 0 | 0 | 106 | 134 |
e155fe61ac68e87755dbb86a2686cbb4f177a93a | 904 | py | Python | code/lw_pickle.py | lwadya/boozehound | 62798a34ba9a647a2e0d3d36dfe52c5936a7377f | [
"MIT"
] | 2 | 2019-07-24T05:48:05.000Z | 2019-08-14T08:07:55.000Z | code/lw_pickle.py | lwadya/boozehound | 62798a34ba9a647a2e0d3d36dfe52c5936a7377f | [
"MIT"
] | null | null | null | code/lw_pickle.py | lwadya/boozehound | 62798a34ba9a647a2e0d3d36dfe52c5936a7377f | [
"MIT"
] | 2 | 2019-09-07T22:57:10.000Z | 2020-05-08T12:31:07.000Z | import os
import pickle
def var_to_pickle(var, filename):
'''
Writes the given variable to a pickle file
Args:
var (any): variable to be written to pickle file
filename (str): path and filename of pickle file
Returns:
None
'''
try:
with open(filename, 'wb') as... | 22.04878 | 63 | 0.574115 | import os
import pickle
def var_to_pickle(var, filename):
'''
Writes the given variable to a pickle file
Args:
var (any): variable to be written to pickle file
filename (str): path and filename of pickle file
Returns:
None
'''
try:
with open(filename, 'wb') as... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f316ce0cead8afcea7d5d43e146f7386044645c3 | 7,237 | py | Python | creme/tree/tree.py | koaning/creme | fea9594b0620b57edef0d986edc735a3a0977dc9 | [
"BSD-3-Clause"
] | 1 | 2019-08-24T00:04:19.000Z | 2019-08-24T00:04:19.000Z | creme/tree/tree.py | koaning/creme | fea9594b0620b57edef0d986edc735a3a0977dc9 | [
"BSD-3-Clause"
] | null | null | null | creme/tree/tree.py | koaning/creme | fea9594b0620b57edef0d986edc735a3a0977dc9 | [
"BSD-3-Clause"
] | null | null | null | import math
try:
GRAPHVIZ_INSTALLED = True
except ImportError:
GRAPHVIZ_INSTALLED = False
from .. import base
from .. import utils
def find_best_split(class_counts, feature_counts, split_enum):
"""
>>> class_counts = {'slow': 2, 'fast': 2}
>>> feature_counts = {
... 'grade': {
..... | 30.154167 | 97 | 0.58726 | import bisect
import collections
import functools
import math
import operator
try:
import graphviz
GRAPHVIZ_INSTALLED = True
except ImportError:
GRAPHVIZ_INSTALLED = False
from .. import base
from .. import utils
from . import enum
class Branch:
def __init__(self, feature, values, left, right, tre... | 4 | 54 | 0 | 4,862 | 0 | 81 | 0 | -31 | 229 |
a0b41781f7244ddaf211d01b65f1dfcd061b70aa | 2,734 | py | Python | ble2influx.py | theBASTI0N/ble-gateway | 31e5ac6c9fcfb12a401d0ee94a974b0fab8df867 | [
"MIT"
] | 11 | 2020-08-27T03:58:43.000Z | 2021-11-27T11:37:40.000Z | ble2influx.py | theBASTI0N/ble-gateway | 31e5ac6c9fcfb12a401d0ee94a974b0fab8df867 | [
"MIT"
] | 4 | 2020-08-18T11:12:15.000Z | 2021-03-10T23:42:57.000Z | ble2influx.py | theBASTI0N/ble-gateway | 31e5ac6c9fcfb12a401d0ee94a974b0fab8df867 | [
"MIT"
] | 5 | 2021-01-05T07:33:52.000Z | 2022-01-03T03:32:31.000Z | import config
influxCONFIG = config.get_config('influx')
ids = config.get_config('identifiers') | 30.377778 | 81 | 0.557791 | from influxdb import InfluxDBClient
import json
import config
import blegateway
influxCONFIG = config.get_config('influx')
ids = config.get_config('identifiers')
def INFLUX():
if influxCONFIG['user'] == None:
influxCONFIG['user'] = 'root'
if influxCONFIG['password'] == None:
influxCONFIG['pass... | 0 | 0 | 0 | 0 | 0 | 2,503 | 0 | 0 | 135 |
16677ad7acae3ecfeb8d91d2179d755044b7ff86 | 30,528 | py | Python | data_models/memory_data_models.py | ChrisHad/algorithm-reference-library | bded1b62ea801ea4f4f5bd0794c18cd81d4b2810 | [
"Apache-2.0"
] | null | null | null | data_models/memory_data_models.py | ChrisHad/algorithm-reference-library | bded1b62ea801ea4f4f5bd0794c18cd81d4b2810 | [
"Apache-2.0"
] | null | null | null | data_models/memory_data_models.py | ChrisHad/algorithm-reference-library | bded1b62ea801ea4f4f5bd0794c18cd81d4b2810 | [
"Apache-2.0"
] | null | null | null | """The data models used in ARL:
.. note::
There are two visibility formats:
:class:`BlockVisibility` is conceived as an ingest and calibration format. The visibility
data are kept in a block of shape (number antennas, number antennas, number channels,
number polarisation). One block is kept per integr... | 30.712274 | 110 | 0.569575 | """The data models used in ARL:
.. note::
There are two visibility formats:
:class:`BlockVisibility` is conceived as an ingest and calibration format. The visibility
data are kept in a block of shape (number antennas, number antennas, number channels,
number polarisation). One block is kept per integr... | 0 | 3,815 | 0 | 24,434 | 0 | 0 | 0 | 60 | 389 |
9e6efc22b2b9b79598553a9e54f0f484ff4cb2f3 | 291 | pyw | Python | tk13.pyw | ShreyaShreesh/tkinter_sample | 125aa75b855114b25c46b26ce574385f83eb99ad | [
"MIT"
] | null | null | null | tk13.pyw | ShreyaShreesh/tkinter_sample | 125aa75b855114b25c46b26ce574385f83eb99ad | [
"MIT"
] | null | null | null | tk13.pyw | ShreyaShreesh/tkinter_sample | 125aa75b855114b25c46b26ce574385f83eb99ad | [
"MIT"
] | null | null | null | #tk13.pyw
import tkinter as tk
root = tk.Tk()
root.geometry('300x200')
lb = tk.Label(text='This is a Label,This is a label,This is a Label')
ms = tk.Label(text='This is a Message.This is a a Message.This is a Message.This is a Message')
[widget.pack()for widget in (lb,ms)]
root.mainloop() | 29.1 | 95 | 0.71134 | #tk13.pyw
import tkinter as tk
root = tk.Tk()
root.geometry('300x200')
lb = tk.Label(text='This is a Label,This is a label,This is a Label')
ms = tk.Label(text='This is a Message.This is a a Message.This is a Message.This is a Message')
[widget.pack()for widget in (lb,ms)]
root.mainloop() | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ef1a9c6e481c3568b4dfcc83d8da74c4253af6bd | 4,333 | py | Python | 2a.combfiles_wo_main.py | JacksonIsaac/REDDprocessor | d65be95869432d737b562cd38f7d571d3529e169 | [
"MIT"
] | null | null | null | 2a.combfiles_wo_main.py | JacksonIsaac/REDDprocessor | d65be95869432d737b562cd38f7d571d3529e169 | [
"MIT"
] | null | null | null | 2a.combfiles_wo_main.py | JacksonIsaac/REDDprocessor | d65be95869432d737b562cd38f7d571d3529e169 | [
"MIT"
] | null | null | null | from itertools import izip_longest
outpath = "redd-test/"
dir = "redd-test/house_1/"
with open(dir+'channel_5_6.dat') as f3,\
open(dir+'channel_6_7.dat') as f4, open(dir+'channel_7_5.dat') as f5, open(dir+'channel_8_5.dat') as f6,\
open(dir+'channel_9_3.dat') as f7, open(dir+'channel_11_9.dat') as f8, open(d... | 54.848101 | 115 | 0.616894 | from itertools import izip_longest
outpath = "redd-test/"
dir = "redd-test/house_1/"
with open(dir+'channel_5_6.dat') as f3,\
open(dir+'channel_6_7.dat') as f4, open(dir+'channel_7_5.dat') as f5, open(dir+'channel_8_5.dat') as f6,\
open(dir+'channel_9_3.dat') as f7, open(dir+'channel_11_9.dat') as f8, open(d... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0a3ab33f2faccea09feffab6c640d9df006ada6e | 3,614 | py | Python | lintlizard/__init__.py | closeio/lintlizard | 8845d44b22985e9a8bdd120fd7af967a9cf83967 | [
"MIT"
] | 4 | 2020-11-19T18:57:13.000Z | 2021-05-26T20:09:19.000Z | lintlizard/__init__.py | closeio/lintlizard | 8845d44b22985e9a8bdd120fd7af967a9cf83967 | [
"MIT"
] | 36 | 2020-12-08T18:42:09.000Z | 2022-03-29T16:04:42.000Z | lintlizard/__init__.py | closeio/lintlizard | 8845d44b22985e9a8bdd120fd7af967a9cf83967 | [
"MIT"
] | 1 | 2021-06-02T19:40:45.000Z | 2021-06-02T19:40:45.000Z | from typing import Tuple
__version__ = '0.15.0'
Command = Tuple[str, ...]
TOOLS = [
CommandTool('flake8', default_files=()),
CommandTool(
'isort', run_params=('-c',), fix_params=(), default_files=('.',)
),
CommandTool('mypy'),
CommandTool(
'black',
run_params=('--check'... | 26.970149 | 76 | 0.580243 | import argparse
import subprocess
from typing import Iterable, Optional, Tuple
from attr import attrib, attrs
__version__ = '0.15.0'
Command = Tuple[str, ...]
@attrs(frozen=True)
class CommandTool:
executable: str = attrib()
run_params: Command = attrib(default=())
fix_params: Optional[Command] = attr... | 0 | 775 | 0 | 0 | 690 | 1,518 | 0 | 19 | 182 |
8ec74e0b23a8053f55434ea0967b6f5aabd195d1 | 2,051 | py | Python | backprop_numpy_saliency.py | li-li-github/saliency_visualization | 13f544d4d703a95d424c57523a67d0698221b301 | [
"MIT"
] | null | null | null | backprop_numpy_saliency.py | li-li-github/saliency_visualization | 13f544d4d703a95d424c57523a67d0698221b301 | [
"MIT"
] | null | null | null | backprop_numpy_saliency.py | li-li-github/saliency_visualization | 13f544d4d703a95d424c57523a67d0698221b301 | [
"MIT"
] | null | null | null | import numpy as np
import math
import matplotlib.pyplot as plt
from matplotlib import cm
# Create random input and output data
x = np.linspace(-math.pi, math.pi, 2000)
y = np.sin(x)
# Randomly initialize weights
a = np.random.randn()
b = np.random.randn()
c = np.random.randn()
d = np.random.randn()
learning_rate =... | 25.320988 | 87 | 0.61531 | import numpy as np
import math
import matplotlib.pyplot as plt
from matplotlib import cm
# Create random input and output data
x = np.linspace(-math.pi, math.pi, 2000)
y = np.sin(x)
def fn_3poly(x, a, b, c, d):
return a + b * x + c * x ** 2 + d * x ** 3
# Randomly initialize weights
a = np.random.randn()
b = n... | 0 | 0 | 0 | 0 | 0 | 54 | 0 | 0 | 23 |
84ce53c887f18a5b9c7ade832cc5f361cf29e6fd | 326 | py | Python | old-regressions/python/expr.2.py | muchang/z3test | e3e7739f98b7aa85427fcb8a39a4c675132a896e | [
"MIT"
] | 23 | 2015-04-20T08:51:00.000Z | 2021-11-15T12:20:59.000Z | old-regressions/python/expr.2.py | muchang/z3test | e3e7739f98b7aa85427fcb8a39a4c675132a896e | [
"MIT"
] | 18 | 2016-03-02T15:17:42.000Z | 2021-12-16T22:10:05.000Z | old-regressions/python/expr.2.py | muchang/z3test | e3e7739f98b7aa85427fcb8a39a4c675132a896e | [
"MIT"
] | 30 | 2015-05-30T15:29:17.000Z | 2022-02-25T15:58:58.000Z |
# Copyright (c) 2015 Microsoft Corporation
set_option(auto_config=True)
x, y = Ints('x y')
print eq(x + y, x + y)
print eq(x + y, y + x)
n = x + y
print eq(n, x + y)
# x2 is eq to x
x2 = Int('x')
print eq(x, x2)
# the integer variable x is not equal to
# the real variable x
print eq(Int('x'), Real('x'))
| 19.176471 | 42 | 0.619632 |
# Copyright (c) 2015 Microsoft Corporation
from z3 import *
set_option(auto_config=True)
x, y = Ints('x y')
print eq(x + y, x + y)
print eq(x + y, y + x)
n = x + y
print eq(n, x + y)
# x2 is eq to x
x2 = Int('x')
print eq(x, x2)
# the integer variable x is not equal to
# the real variable x
print eq(Int('x'), Real(... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -5 | 22 |
f65bf8b541c2f36dbe0c24099b7cceb6e60d6425 | 9,290 | py | Python | ai2gtp.py | bale-go/katrain-bots | 9d2c23275b6eeaa529c4a6827567e4e655c0b793 | [
"MIT"
] | null | null | null | ai2gtp.py | bale-go/katrain-bots | 9d2c23275b6eeaa529c4a6827567e4e655c0b793 | [
"MIT"
] | null | null | null | ai2gtp.py | bale-go/katrain-bots | 9d2c23275b6eeaa529c4a6827567e4e655c0b793 | [
"MIT"
] | null | null | null | # This is a script that turns a KaTrain AI into a sort-of GTP compatible bot
import json
import random
import sys
import time
import os
import json
import traceback
os.environ["KCFG_KIVY_LOG_LEVEL"] = os.environ.get("KCFG_KIVY_LOG_LEVEL", "warning")
from katrain.core.ai import generate_ai_move
from katrain.core.cons... | 41.106195 | 138 | 0.599569 | # This is a script that turns a KaTrain AI into a sort-of GTP compatible bot
import json
import random
import sys
import time
import os
import json
import traceback
import math
os.environ["KCFG_KIVY_LOG_LEVEL"] = os.environ.get("KCFG_KIVY_LOG_LEVEL", "warning")
from katrain.core.ai import generate_ai_move
from katra... | 0 | 0 | 0 | 0 | 0 | 1,733 | 0 | 52 | 90 |
6251beb2e7c5ea9af4af3192a77cb14ca570b47a | 19,436 | py | Python | cifar_net_search/syclop_cifar_convlstm_no_upsample_v01.py | sashkarivkind/imagewalker | 999e1ae78cfe1512e1be894d9e7891a7d0c41233 | [
"Apache-2.0"
] | 2 | 2021-04-28T13:33:45.000Z | 2021-11-09T14:31:09.000Z | cifar_net_search/syclop_cifar_convlstm_no_upsample_v01.py | sashkarivkind/imagewalker | 999e1ae78cfe1512e1be894d9e7891a7d0c41233 | [
"Apache-2.0"
] | null | null | null | cifar_net_search/syclop_cifar_convlstm_no_upsample_v01.py | sashkarivkind/imagewalker | 999e1ae78cfe1512e1be894d9e7891a7d0c41233 | [
"Apache-2.0"
] | 1 | 2021-03-07T13:25:59.000Z | 2021-03-07T13:25:59.000Z | '''
The follwing code runs a test lstm network on the CIFAR dataset
I will explicitly write the networks here for ease of understanding
One convlstm layer right after the first cnn
cnn_dropout = 0.4 rnn_dropout = 0.2 , WITH cnivlstm_dropout samples = 10, h = 256, epochs = 50, convlstm activation = relu - out.3732... | 73.901141 | 3,057 | 0.767339 | '''
The follwing code runs a test lstm network on the CIFAR dataset
I will explicitly write the networks here for ease of understanding
One convlstm layer right after the first cnn
cnn_dropout = 0.4 rnn_dropout = 0.2 , WITH cnivlstm_dropout samples = 10, h = 256, epochs = 50, convlstm activation = relu - out.3732... | 0 | 0 | 0 | 0 | 0 | 512 | 0 | -22 | 179 |
3e32da7b2cc95def1e538685b65c08ba5458bb2a | 397 | py | Python | tests/test_dependencies.py | nmnaughton/gym-softrobot | 7b7eb9bfb97f2e3d2c3e2f7df50ca96426a2482f | [
"MIT"
] | 10 | 2022-01-11T19:49:02.000Z | 2022-03-24T22:27:32.000Z | tests/test_dependencies.py | nmnaughton/gym-softrobot | 7b7eb9bfb97f2e3d2c3e2f7df50ca96426a2482f | [
"MIT"
] | 7 | 2022-01-15T07:48:53.000Z | 2022-03-07T17:43:44.000Z | tests/test_dependencies.py | nmnaughton/gym-softrobot | 7b7eb9bfb97f2e3d2c3e2f7df50ca96426a2482f | [
"MIT"
] | 2 | 2022-03-06T19:43:06.000Z | 2022-03-25T21:31:52.000Z |
""" Test Dependency Installation
The purpose is to check if core dependencies are installed properly.
Typically, failure to these tests indicate an incorrection installation
or wrong activation of the virtual environment (i.e. conda, venv, etc.).
"""
| 23.352941 | 72 | 0.755668 | import pytest
""" Test Dependency Installation
The purpose is to check if core dependencies are installed properly.
Typically, failure to these tests indicate an incorrection installation
or wrong activation of the virtual environment (i.e. conda, venv, etc.).
"""
def test_gym():
import gym
version = gym.ve... | 0 | 0 | 0 | 0 | 0 | 83 | 0 | -8 | 67 |
0c6ce640490f9208a1801caf8e64f61b44867518 | 110 | py | Python | test/deck.py | CDRPico/treys | b452565c9b386ad35c8eb108b62a9020834dc3b9 | [
"MIT"
] | 3 | 2019-10-04T14:36:51.000Z | 2022-02-12T00:21:26.000Z | test/deck.py | CDRPico/treys | b452565c9b386ad35c8eb108b62a9020834dc3b9 | [
"MIT"
] | null | null | null | test/deck.py | CDRPico/treys | b452565c9b386ad35c8eb108b62a9020834dc3b9 | [
"MIT"
] | 6 | 2018-11-11T09:19:13.000Z | 2021-05-31T18:12:08.000Z | from treys import Deck
from treys.card import pretty
d = Deck.fresh()
print(d)
print(pretty(d))
| 12.222222 | 33 | 0.736364 | from treys import Evaluator, Deck
from treys.card import pretty
d = Deck.fresh()
print(d)
print(pretty(d))
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 0 |
cef632827e2660e475081dc392175eaed57420c0 | 3,645 | py | Python | lib/gen_cmd.py | rahulmah/sample-cloud-native-toolchain-tutorial-20170720084529291 | 08540c0f083a25b5b4e7a4c839080fe54383038c | [
"Apache-2.0"
] | 1 | 2019-01-19T09:32:18.000Z | 2019-01-19T09:32:18.000Z | lib/gen_cmd.py | rahulmah/sample-cloud-native-toolchain-tutorial-20170720084529291 | 08540c0f083a25b5b4e7a4c839080fe54383038c | [
"Apache-2.0"
] | null | null | null | lib/gen_cmd.py | rahulmah/sample-cloud-native-toolchain-tutorial-20170720084529291 | 08540c0f083a25b5b4e7a4c839080fe54383038c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
r"""
This module provides command execution functions such as cmd_fnc and cmd_fnc_u.
"""
import sys
import subprocess
robot_env = 1
try:
except ImportError:
robot_env = 0
import gen_print as gp
import gen_valid as gv
import gen_misc as gm
if robot_env:
import gen_robot_print as grp
##... | 31.695652 | 79 | 0.493004 | #!/usr/bin/env python
r"""
This module provides command execution functions such as cmd_fnc and cmd_fnc_u.
"""
import sys
import subprocess
robot_env = 1
try:
from robot.libraries.BuiltIn import BuiltIn
except ImportError:
robot_env = 0
import gen_print as gp
import gen_valid as gv
import gen_misc as gm
if r... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 22 | 26 |
7214622577390765e94f741b493f49789af14165 | 299 | py | Python | dist/assets/code/seance1/8.py | Mistergix/deficode | 6460ec3e22d36b67cef6815d9977fba973ab139b | [
"MIT"
] | null | null | null | dist/assets/code/seance1/8.py | Mistergix/deficode | 6460ec3e22d36b67cef6815d9977fba973ab139b | [
"MIT"
] | 10 | 2018-07-11T22:40:57.000Z | 2018-11-24T21:05:14.000Z | dist/assets/code/seance1/8.py | Mistergix/deficode | 6460ec3e22d36b67cef6815d9977fba973ab139b | [
"MIT"
] | null | null | null | import turtle as trt
distance = 70
angle = 90
for compteur in range(4):
if compteur == 0:
trt.color("blue")
elif compteur == 1:
trt.color("red")
elif compteur == 2:
trt.color("green")
else :
trt.color("orange")
trt.write(compteur)
trt.forward(distance)
trt.left(angle)
trt.done()
| 14.238095 | 25 | 0.658863 | import turtle as trt
distance = 70
angle = 90
for compteur in range(4):
if compteur == 0:
trt.color("blue")
elif compteur == 1:
trt.color("red")
elif compteur == 2:
trt.color("green")
else :
trt.color("orange")
trt.write(compteur)
trt.forward(distance)
trt.left(angle)
trt.done()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a16d32be9721cae9f4d9ce1dea359c600aef3726 | 99,632 | py | Python | third_party/CppHeaderParser/CppHeaderParser/CppHeaderParser.py | alberthrocks/emscripten | f7bd758bc344e0602df108eae91ead9d31737f3a | [
"MIT"
] | 8 | 2015-04-15T16:23:11.000Z | 2020-04-07T13:38:25.000Z | third_party/CppHeaderParser/CppHeaderParser/CppHeaderParser.py | comforx/emscripten | f842201acec3c1edafb2916a76a8eb8d75474c2b | [
"MIT"
] | null | null | null | third_party/CppHeaderParser/CppHeaderParser/CppHeaderParser.py | comforx/emscripten | f842201acec3c1edafb2916a76a8eb8d75474c2b | [
"MIT"
] | null | null | null | #!/usr/bin/python
#
# Author: Jashua R. Cloutier (contact via sourceforge username:senexcanis)
#
# Copyright (C) 2010, Jashua R. Cloutier
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Re... | 42.432709 | 210 | 0.509294 | #!/usr/bin/python
#
# Author: Jashua R. Cloutier (contact via sourceforge username:senexcanis)
#
# Copyright (C) 2010, Jashua R. Cloutier
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Re... | 0 | 0 | 0 | 89,526 | 0 | 2,586 | 0 | -23 | 503 |
04ffb025f837f4a6a50c21ab19a5ce264ccf0817 | 3,424 | py | Python | csv_cti/blueprints/web_api/views/tiers.py | Osmond1689/csv-cti | 84be8241e9ba50f495b23775eb153e4129845474 | [
"MIT"
] | null | null | null | csv_cti/blueprints/web_api/views/tiers.py | Osmond1689/csv-cti | 84be8241e9ba50f495b23775eb153e4129845474 | [
"MIT"
] | null | null | null | csv_cti/blueprints/web_api/views/tiers.py | Osmond1689/csv-cti | 84be8241e9ba50f495b23775eb153e4129845474 | [
"MIT"
] | null | null | null |
#tiers | 31.703704 | 82 | 0.553446 | from csv_cti.blueprints.web_api import web_api
from flask import request,current_app,render_template
from csv_cti.blueprints.op.md5_token import encrypt_md5
from csv_cti.blueprints.op.tiers import Tiers_op
#tiers
@web_api.route('/tiers-add/',methods=['POST'])
def tiers_add():
return_data={}
r_token=request.jso... | 198 | 3,054 | 0 | 0 | 0 | 0 | 0 | 118 | 179 |
5d26a1ce29134293dc115d18657a2e0d5c5e239c | 1,754 | py | Python | lists/singly.py | nipuntalukdar/algodatasructs | a50058f355115b4d45864a04e0e0aa492f006d18 | [
"MIT"
] | null | null | null | lists/singly.py | nipuntalukdar/algodatasructs | a50058f355115b4d45864a04e0e0aa492f006d18 | [
"MIT"
] | null | null | null | lists/singly.py | nipuntalukdar/algodatasructs | a50058f355115b4d45864a04e0e0aa492f006d18 | [
"MIT"
] | null | null | null |
x = lst(1,2,3,4,5,6,7,8,9,10,11,12)
print x
x.move_even_to_end()
print x
x.reverse()
print x
| 26.179104 | 58 | 0.469213 | class lstnode(object):
def __init__(self, val):
self.val = val
self.next = None
def __str__(self):
return str(self.val)
class lst(object):
def __init__(self, *args):
self.begin = None
self.count = 0
self.end = {'blackhole' : 'yes', 'last' : None}
for ... | 0 | 0 | 0 | 1,607 | 0 | 0 | 0 | 0 | 45 |
8d5e64b85237cf92c1a2dfbc35b0671f7c84c4ff | 4,707 | py | Python | src/.ipynb_checkpoints/scikitmodel-checkpoint.py | ciwin/CD4ML-AWS-Serverless | 10a2dd697abbe4b80195fa147b50484626e87e27 | [
"MIT"
] | 1 | 2021-07-17T19:31:35.000Z | 2021-07-17T19:31:35.000Z | src/scikitmodel.py | ciwin/CD4ML-AWS-Serverless | 10a2dd697abbe4b80195fa147b50484626e87e27 | [
"MIT"
] | null | null | null | src/scikitmodel.py | ciwin/CD4ML-AWS-Serverless | 10a2dd697abbe4b80195fa147b50484626e87e27 | [
"MIT"
] | null | null | null | import argparse
import pandas as pd
import os
# from os.path import join
import sys
import logging
# import joblib
from sklearn.externals import joblib
from sklearn.tree import DecisionTreeRegressor
from sklearn.ensemble import RandomForestRegressor, AdaBoostRegressor, GradientBoostingRegressor
from sklearn import me... | 39.554622 | 108 | 0.681326 | import argparse
import pandas as pd
import numpy as np
import os
# from os.path import join
import sys
import logging
# import joblib
from sklearn.externals import joblib
from sklearn.tree import DecisionTreeRegressor
from sklearn.ensemble import RandomForestRegressor, AdaBoostRegressor, GradientBoostingRegressor... | 0 | 0 | 0 | 0 | 0 | 733 | 0 | 3 | 91 |
b298b18c0d51da2167b1f5b61a5c56a5a1445bf0 | 2,506 | py | Python | tests/test_simulation.py | fakecoinbase/Chia-Networkslashchia-blockchain | 84e6a4da18fb0a790a870cbd516f13c9bc7f0716 | [
"Apache-2.0"
] | null | null | null | tests/test_simulation.py | fakecoinbase/Chia-Networkslashchia-blockchain | 84e6a4da18fb0a790a870cbd516f13c9bc7f0716 | [
"Apache-2.0"
] | 1 | 2022-03-25T19:10:51.000Z | 2022-03-25T19:10:51.000Z | tests/test_simulation.py | fakecoinbase/Chia-Networkslashchia-blockchain | 84e6a4da18fb0a790a870cbd516f13c9bc7f0716 | [
"Apache-2.0"
] | null | null | null | from src.util.make_test_constants import make_test_constants_with_genesis
test_constants, bt = make_test_constants_with_genesis(
{
"DIFFICULTY_STARTING": 1000,
"MIN_ITERS_STARTING": 100000,
"NUMBER_ZERO_BITS_CHALLENGE_SIG": 1,
}
)
| 33.413333 | 83 | 0.616919 | import asyncio
import pytest
from typing import List
from tests.setup_nodes import setup_full_system
from src.util.ints import uint32
from src.types.full_block import FullBlock
from src.util.make_test_constants import make_test_constants_with_genesis
from tests.time_out_assert import time_out_assert, time_out_assert_cu... | 0 | 1,731 | 0 | 0 | 0 | 125 | 0 | 106 | 276 |
15ee04ffb99bd36c0a7796b9602c2b4330cffc60 | 1,024 | py | Python | wysdom/object_schema/resolve_arg_to_type.py | jetavator/wysdom | 4c67c82a9df66370da5cf5347abd7450a52d3d03 | [
"Apache-2.0"
] | 1 | 2021-04-20T07:40:28.000Z | 2021-04-20T07:40:28.000Z | wysdom/object_schema/resolve_arg_to_type.py | jetavator/wysdom | 4c67c82a9df66370da5cf5347abd7450a52d3d03 | [
"Apache-2.0"
] | 69 | 2020-05-13T07:13:49.000Z | 2021-05-06T18:26:21.000Z | wysdom/object_schema/resolve_arg_to_type.py | jetavator/wysdom | 4c67c82a9df66370da5cf5347abd7450a52d3d03 | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
from typing import Type, Union
from enum import Enum
import inspect
from ..base_schema import Schema
from ..dom import DOMElement
from ..base_schema import SchemaPrimitive, SchemaEnum
def resolve_arg_to_schema(arg: Union[Type, Schema]) -> Schema:
"""
Resolve an argument ... | 29.257143 | 75 | 0.654297 | from __future__ import annotations
from typing import Type, Union
from enum import Enum
import inspect
from ..base_schema import Schema
from ..dom import DOMElement
from ..base_schema import SchemaPrimitive, SchemaEnum
def resolve_arg_to_schema(arg: Union[Type, Schema]) -> Schema:
"""
Resolve an argument ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2b5b563c231306db3c66037d5986076ffff968c1 | 13,177 | py | Python | pro3/query_system/query.py | Jack-Lio/-Information-retrieval-2019 | 5c5eb675dbc6ff6977a759da07326b9629ff7f3f | [
"MIT"
] | null | null | null | pro3/query_system/query.py | Jack-Lio/-Information-retrieval-2019 | 5c5eb675dbc6ff6977a759da07326b9629ff7f3f | [
"MIT"
] | null | null | null | pro3/query_system/query.py | Jack-Lio/-Information-retrieval-2019 | 5c5eb675dbc6ff6977a759da07326b9629ff7f3f | [
"MIT"
] | null | null | null | ##############################
# support query serve for front web system
# filename:query.py
# author: liwei
# StuID: 1711350
# date: 2019.12.1
##############################
#
from whoosh import index
from flask import Flask
import logging
from data import get_teacher_info, pagerank
# from audio import *
ap... | 40.296636 | 111 | 0.496016 | ##############################
# support query serve for front web system
# filename:query.py
# author: liwei
# StuID: 1711350
# date: 2019.12.1
##############################
#查询构建
from whoosh import highlight
from whoosh import qparser
from whoosh import index
from flask import Flask
from flask import request... | 1,668 | 5,605 | 0 | 0 | 0 | 0 | 0 | 87 | 286 |
fd6b632483e6382f5a744fcfd5d23da93b55559b | 1,107 | py | Python | examples/plot_timeseries.py | tkarna/galene | a05463d3d0c9191c51893df4593d9ce0252d25fb | [
"MIT"
] | null | null | null | examples/plot_timeseries.py | tkarna/galene | a05463d3d0c9191c51893df4593d9ce0252d25fb | [
"MIT"
] | null | null | null | examples/plot_timeseries.py | tkarna/galene | a05463d3d0c9191c51893df4593d9ce0252d25fb | [
"MIT"
] | null | null | null | """
Make time series plots.
"""
import galene as ga
import datetime
data_id_list = [
'cmems-nrt',
'run001',
'run002',
]
var_list = ['slev', 'temp']
start_time = datetime.datetime(2016, 6, 1)
end_time = datetime.datetime(2018, 7, 1)
for var in var_list:
dataset_list = []
for data_id in data_id_lis... | 26.357143 | 79 | 0.577236 | """
Make time series plots.
"""
import galene as ga
import datetime
data_id_list = [
'cmems-nrt',
'run001',
'run002',
]
var_list = ['slev', 'temp']
start_time = datetime.datetime(2016, 6, 1)
end_time = datetime.datetime(2018, 7, 1)
for var in var_list:
dataset_list = []
for data_id in data_id_lis... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6e349517cf5e3a5d81a0f4dfdf4fcf82c9bd454a | 1,841 | py | Python | parametric_si/lars.py | takeuchi-lab/parametric-si | a2a0fe55200ef8cb2cccd1b1eb4856dab1fbd333 | [
"MIT"
] | 2 | 2022-02-09T07:59:37.000Z | 2022-03-09T18:47:13.000Z | parametric_si/lars.py | takeuchi-lab/parametric-si | a2a0fe55200ef8cb2cccd1b1eb4856dab1fbd333 | [
"MIT"
] | null | null | null | parametric_si/lars.py | takeuchi-lab/parametric-si | a2a0fe55200ef8cb2cccd1b1eb4856dab1fbd333 | [
"MIT"
] | null | null | null |
#TODO need to refactaring | 24.546667 | 99 | 0.49321 | import numpy as np
import copy
from . import cv
def knot_value(j,s_j,A,s,X):
X_A = X[:,A]
x_j = X[:,j]
P = (np.identity(X.shape[0])) - X_A @ np.linalg.inv(X_A.T @ X_A) @ X_A.T
temp = (P @ x_j) / (s_j - x_j @ X_A @ np.linalg.inv(X_A.T @ X_A) @ s)
return temp
#TODO need to refactaring
def lars(X,y... | 0 | 0 | 0 | 0 | 0 | 1,698 | 0 | -18 | 135 |
91c96be6b0c90e4cf12566b9211674a500d21d7d | 4,127 | py | Python | assignments/01/q2b.py | LiUzHiAn/stanford-tensorflow-tutorials | 8d6a6483985900519ea4512e2f047cdcf11ef8ba | [
"MIT"
] | null | null | null | assignments/01/q2b.py | LiUzHiAn/stanford-tensorflow-tutorials | 8d6a6483985900519ea4512e2f047cdcf11ef8ba | [
"MIT"
] | null | null | null | assignments/01/q2b.py | LiUzHiAn/stanford-tensorflow-tutorials | 8d6a6483985900519ea4512e2f047cdcf11ef8ba | [
"MIT"
] | null | null | null | """
three-layers logistic regression model for not-MNIST dataset
Got ~ 87% accuracy.
not-MNIST: http://yaroslavvb. blogspot. it/2011/09/notmnist-dataset.html
author: ANDY (andy929910266@gmail.com)
"""
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import tensorflow as tf
import time
import utils
# Define pa... | 33.827869 | 98 | 0.747516 | """
three-layers logistic regression model for not-MNIST dataset
Got ~ 87% accuracy.
not-MNIST: http://yaroslavvb. blogspot. it/2011/09/notmnist-dataset.html
author: ANDY (andy929910266@gmail.com)
"""
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import numpy as np
import tensorflow as tf
import time
impor... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 23 |
739be6b6166505d1450e7bc2b31fa1def015f2c7 | 14,617 | py | Python | tasktiger/__init__.py | affiliprint/tasktiger | a79f2d6fdcc79c5de3149f2dbce8bc83f910873d | [
"MIT"
] | 1 | 2018-12-16T06:16:19.000Z | 2018-12-16T06:16:19.000Z | tasktiger/__init__.py | xiaohanghang/tasktiger | cfd2eaabee635ce6f5f03ee5644e0d9782778d8b | [
"MIT"
] | null | null | null | tasktiger/__init__.py | xiaohanghang/tasktiger | cfd2eaabee635ce6f5f03ee5644e0d9782778d8b | [
"MIT"
] | null | null | null | from .task import Task
from .worker import Worker
__all__ = ['TaskTiger', 'Worker', 'Task',
# Exceptions
'JobTimeoutException', 'RetryException', 'StopRetry',
'TaskImportError', 'TaskNotFound',
# Retry methods
'fixed', 'linear', 'exponential',
# Sche... | 38.264398 | 94 | 0.603339 | import click
from collections import defaultdict
import importlib
import logging
import redis
import structlog
from .redis_scripts import RedisScripts
from ._internal import *
from .exceptions import *
from .retry import *
from .schedule import *
from .task import Task
from .worker import Worker
__all__ = ['TaskTige... | 0 | 1,456 | 0 | 11,466 | 0 | 0 | 0 | 5 | 290 |
d019d3375ffbe3f53848ee7fb37f5166e009fa98 | 93 | py | Python | MDAOfabric/__init__.py | LHoeffner/MDAOfabric | 266ad27d969df98518df453c4c9da606bea6304d | [
"MIT"
] | 1 | 2019-05-28T15:50:16.000Z | 2019-05-28T15:50:16.000Z | MDAOfabric/__init__.py | LHoeffner/MDAOfabric | 266ad27d969df98518df453c4c9da606bea6304d | [
"MIT"
] | null | null | null | MDAOfabric/__init__.py | LHoeffner/MDAOfabric | 266ad27d969df98518df453c4c9da606bea6304d | [
"MIT"
] | null | null | null | # auxiliary
# solvers
| 15.5 | 36 | 0.795699 | # auxiliary
from MDAOfabric.accessories import *
# solvers
from MDAOfabric.solvers import *
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 26 | 44 |
ed042e6c0269fea4543ca62d73123d29c845bfeb | 3,661 | py | Python | acq4/analysis/old/AnalysisPlotWidgetTemplate.py | ablot/acq4 | ba7cd340d9d0282640adb501d3788f8c0837e4c4 | [
"MIT"
] | null | null | null | acq4/analysis/old/AnalysisPlotWidgetTemplate.py | ablot/acq4 | ba7cd340d9d0282640adb501d3788f8c0837e4c4 | [
"MIT"
] | null | null | null | acq4/analysis/old/AnalysisPlotWidgetTemplate.py | ablot/acq4 | ba7cd340d9d0282640adb501d3788f8c0837e4c4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'AnalysisPlotWidgetTemplate.ui'
#
# Created: Mon Aug 16 15:31:49 2010
# by: PyQt4 UI code generator 4.5.4
#
# WARNING! All changes made in this file will be lost!
| 55.469697 | 155 | 0.754166 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'AnalysisPlotWidgetTemplate.ui'
#
# Created: Mon Aug 16 15:31:49 2010
# by: PyQt4 UI code generator 4.5.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_AnalysisPlotWidgetTemplate(obje... | 0 | 0 | 0 | 3,309 | 0 | 0 | 0 | 37 | 69 |
3f2edba17e96be67cada1cbc646e10326894c9cd | 50,314 | py | Python | src/sage/combinat/designs/bibd.py | Findstat/sage | d661c2c2bd18676014c151e9eec1e81ed12db9f6 | [
"BSL-1.0"
] | null | null | null | src/sage/combinat/designs/bibd.py | Findstat/sage | d661c2c2bd18676014c151e9eec1e81ed12db9f6 | [
"BSL-1.0"
] | null | null | null | src/sage/combinat/designs/bibd.py | Findstat/sage | d661c2c2bd18676014c151e9eec1e81ed12db9f6 | [
"BSL-1.0"
] | null | null | null | r"""
Balanced Incomplete Block Designs (BIBD)
This module gathers everything related to Balanced Incomplete Block Designs. One can build a
BIBD (or check that it can be built) with :func:`balanced_incomplete_block_design`::
sage: BIBD = designs.balanced_incomplete_block_design(7,3)
In particular, Sage can build ... | 34.485264 | 134 | 0.560162 | r"""
Balanced Incomplete Block Designs (BIBD)
This module gathers everything related to Balanced Incomplete Block Designs. One can build a
BIBD (or check that it can be built) with :func:`balanced_incomplete_block_design`::
sage: BIBD = designs.balanced_incomplete_block_design(7,3)
In particular, Sage can build ... | 0 | 0 | 0 | 8,612 | 0 | 0 | 0 | 35 | 68 |
ec66bf170e2d4485e98bdeb40c2d8632e11f2c57 | 4,194 | py | Python | tools/gen_ctrl.py | YC-Vertex/DTW-ASIC | cfa5038150033771061ffea1864eed84fa20d812 | [
"MIT"
] | null | null | null | tools/gen_ctrl.py | YC-Vertex/DTW-ASIC | cfa5038150033771061ffea1864eed84fa20d812 | [
"MIT"
] | null | null | null | tools/gen_ctrl.py | YC-Vertex/DTW-ASIC | cfa5038150033771061ffea1864eed84fa20d812 | [
"MIT"
] | null | null | null | import numpy as np
from GenPlayground import GenPlayground
if __name__ == '__main__':
np.set_printoptions(linewidth=200)
IP, IP_cycle, IP_pe = GenPlayground()
# print(IP_cycle)
# print(IP_pe)
Gen_CTRL(IP, IP_cycle, IP_pe)
| 32.261538 | 77 | 0.38865 | import numpy as np
from collections import OrderedDict
from GenPlayground import GenPlayground
def init_cycle(cycle, IP_cycle, ind_src, ind_sel):
assert len(ind_src) == len(ind_sel)
Arr = (IP_cycle == cycle)
Dict = OrderedDict()
src = ['o_tsrc', 'o_rsrc']
sel = ['o_sel0', 'o_sel1', 'o_sel2']
... | 0 | 0 | 0 | 0 | 0 | 3,866 | 0 | 14 | 68 |
c4d37604f86d09634d7a2c4073b5d4a69f67fcbf | 5,563 | py | Python | src/virtual-wan/azext_vwan/_help.py | mayank88mahajan/azure-cli-extensions | 8bd389a1877bffd14052bec5519ce75dc6fc34cf | [
"MIT"
] | 1 | 2019-05-10T19:58:09.000Z | 2019-05-10T19:58:09.000Z | src/virtual-wan/azext_vwan/_help.py | mayank88mahajan/azure-cli-extensions | 8bd389a1877bffd14052bec5519ce75dc6fc34cf | [
"MIT"
] | null | null | null | src/virtual-wan/azext_vwan/_help.py | mayank88mahajan/azure-cli-extensions | 8bd389a1877bffd14052bec5519ce75dc6fc34cf | [
"MIT"
] | 1 | 2021-07-28T14:50:54.000Z | 2021-07-28T14:50:54.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 24.082251 | 94 | 0.647133 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c3865aae6880eb61a131d9e1b386dd04e48e954e | 4,358 | py | Python | bot.py | olebittner/TwitchStickerBot | bccc08b00f6465c7335978825342cdb6e65d6e83 | [
"MIT"
] | 1 | 2019-01-01T16:17:41.000Z | 2019-01-01T16:17:41.000Z | bot.py | olebittner/TwitchStickerBot | bccc08b00f6465c7335978825342cdb6e65d6e83 | [
"MIT"
] | 3 | 2021-09-08T00:40:45.000Z | 2022-03-11T23:36:48.000Z | bot.py | olebittner/TwitchStickerBot | bccc08b00f6465c7335978825342cdb6e65d6e83 | [
"MIT"
] | null | null | null | import logging
from Utils import config_util
if __name__ == '__main__':
config = config_util.get_config()
logging.basicConfig(level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
if config_util.token_key in config and config[config_util.token_key] is... | 51.880952 | 135 | 0.600734 | import signal
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
from telegram import Sticker, InlineKeyboardButton, InlineKeyboardMarkup
import logging
from Utils import telegram_util, twitch_util, config_util
class TwitchStickersBot:
def __init__(self, token):
signal.signal(signal... | 0 | 0 | 0 | 3,617 | 0 | 0 | 0 | 123 | 89 |
7570b2a8b2bb15a2f96f9e28f427b03870293513 | 4,518 | py | Python | figuras/PycharmKayStatisticalReport/problem_2_4.py | bor9/estudiando_el_kay | 6e07908b8b0b5a5166dadce30001e6100e8304c3 | [
"MIT"
] | null | null | null | figuras/PycharmKayStatisticalReport/problem_2_4.py | bor9/estudiando_el_kay | 6e07908b8b0b5a5166dadce30001e6100e8304c3 | [
"MIT"
] | null | null | null | figuras/PycharmKayStatisticalReport/problem_2_4.py | bor9/estudiando_el_kay | 6e07908b8b0b5a5166dadce30001e6100e8304c3 | [
"MIT"
] | 1 | 2021-11-02T05:27:27.000Z | 2021-11-02T05:27:27.000Z | import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import norm
import math
import matplotlib.colors as colors
from matplotlib import cm
from matplotlib import rc
__author__ = 'ernesto'
# if use latex or mathtext
rc('text', usetex=False)
rc('mathtext', fontset='cm')
# auxiliar function for plot tick... | 30.527027 | 102 | 0.672421 | import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import norm
import math
import matplotlib.colors as colors
from matplotlib import cm
from matplotlib import rc
__author__ = 'ernesto'
# if use latex or mathtext
rc('text', usetex=False)
rc('mathtext', fontset='cm')
# auxiliar function for plot tick... | 0 | 0 | 0 | 0 | 0 | 642 | 0 | 0 | 22 |
79c80aedabde398624f51568a2ec3da86b080e3d | 15,731 | py | Python | lcmap_tap/PlotFrame/plotwindow.py | danzelenak-usgs/TAP_Tool | 4ae3f4105df47efaa57283b25019e398b32de7b9 | [
"Unlicense"
] | 2 | 2018-09-05T04:29:27.000Z | 2020-01-08T19:18:50.000Z | lcmap_tap/PlotFrame/plotwindow.py | danzelenak-usgs/TAP_Tool | 4ae3f4105df47efaa57283b25019e398b32de7b9 | [
"Unlicense"
] | 1 | 2018-08-10T18:32:50.000Z | 2018-08-10T18:32:50.000Z | lcmap_tap/PlotFrame/plotwindow.py | danzelenak-usgs/TAP_Tool | 4ae3f4105df47efaa57283b25019e398b32de7b9 | [
"Unlicense"
] | 1 | 2021-12-27T04:45:49.000Z | 2021-12-27T04:45:49.000Z | """Generate a matplotlib canvas and add it to a QWidget contained in a QMainWindow. This will provide the
display and interactions for the PyCCD plots."""
from lcmap_tap.logger import exc_handler
import sys
import matplotlib
matplotlib.use("Qt5Agg")
sys.excepthook = exc_handler
| 31.973577 | 116 | 0.582226 | """Generate a matplotlib canvas and add it to a QWidget contained in a QMainWindow. This will provide the
display and interactions for the PyCCD plots."""
from lcmap_tap.logger import log, exc_handler
from lcmap_tap.Plotting import POINTS, LINES
import sys
import datetime as dt
import numpy as np
import pkg_resource... | 0 | 0 | 0 | 14,956 | 0 | 0 | 0 | 223 | 266 |
d6bc51eaf527242c693f9f53bdf2e764bbd40814 | 254 | py | Python | corvid/util/files.py | afcarl/corvid | e257074edeac1e8dce4a737b60e93a9bea37b6b9 | [
"Apache-2.0"
] | 1 | 2019-04-15T13:49:39.000Z | 2019-04-15T13:49:39.000Z | corvid/util/files.py | afcarl/corvid | e257074edeac1e8dce4a737b60e93a9bea37b6b9 | [
"Apache-2.0"
] | null | null | null | corvid/util/files.py | afcarl/corvid | e257074edeac1e8dce4a737b60e93a9bea37b6b9 | [
"Apache-2.0"
] | 1 | 2020-09-02T13:49:52.000Z | 2020-09-02T13:49:52.000Z | """
Miscellaneous functions for working with files
"""
import os
def canonicalize_path(path: str):
"""Converts a path string to its canonical form (easier for comparisons)"""
return os.path.abspath(os.path.realpath(os.path.expanduser(path)))
| 21.166667 | 79 | 0.732283 | """
Miscellaneous functions for working with files
"""
import os
def canonicalize_path(path: str):
"""Converts a path string to its canonical form (easier for comparisons)"""
return os.path.abspath(os.path.realpath(os.path.expanduser(path)))
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b83eb1a7483c28cae2bffee78215639718cd2f68 | 1,929 | py | Python | src/mayapip/_internal/maya/maya_windows.py | jonntd/maya-pip | 2a579da17fe348053149d2ad4c45a2ff6efb60ed | [
"MIT"
] | 2 | 2019-03-05T04:11:44.000Z | 2019-03-05T07:26:53.000Z | src/mayapip/_internal/maya/maya_windows.py | jonntd/maya-pip | 2a579da17fe348053149d2ad4c45a2ff6efb60ed | [
"MIT"
] | null | null | null | src/mayapip/_internal/maya/maya_windows.py | jonntd/maya-pip | 2a579da17fe348053149d2ad4c45a2ff6efb60ed | [
"MIT"
] | null | null | null | import os
import _winreg
def get_python_executables():
"""
Find the Maya installation paths using _winreg. The path to the python
executable is extended from the installation path. The dictionary is made
up of keys that are made up of the Maya versions found installed and a
path to the executable... | 31.112903 | 80 | 0.572836 | import os
import _winreg
def get_python_executables():
"""
Find the Maya installation paths using _winreg. The path to the python
executable is extended from the installation path. The dictionary is made
up of keys that are made up of the Maya versions found installed and a
path to the executable... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a32915557c7c8dd17bd4c7ebb7aeab745484bd61 | 312 | bzl | Python | lib/output_files.bzl | alexeagle/bazel-lib | 02be4c5f47b476e686943f53ddd47a672a51a265 | [
"Apache-2.0"
] | 16 | 2021-11-08T15:03:49.000Z | 2022-03-23T19:38:32.000Z | lib/output_files.bzl | alexeagle/bazel-lib | 02be4c5f47b476e686943f53ddd47a672a51a265 | [
"Apache-2.0"
] | 29 | 2021-11-15T16:27:25.000Z | 2022-03-31T04:03:16.000Z | lib/output_files.bzl | alexeagle/bazel-lib | 02be4c5f47b476e686943f53ddd47a672a51a265 | [
"Apache-2.0"
] | 3 | 2021-12-09T00:27:42.000Z | 2022-03-30T20:14:00.000Z | """A rule that provides file(s) specific via DefaultInfo from a given target's DefaultInfo or OutputGroupInfo
"""
load(
"//lib/private:output_files.bzl",
_make_output_files = "make_output_files",
_output_files = "output_files",
)
output_files = _output_files
make_output_files = _make_output_files
| 26 | 109 | 0.762821 | """A rule that provides file(s) specific via DefaultInfo from a given target's DefaultInfo or OutputGroupInfo
"""
load(
"//lib/private:output_files.bzl",
_make_output_files = "make_output_files",
_output_files = "output_files",
)
output_files = _output_files
make_output_files = _make_output_files
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
29f99afcc40ecdf37624ef727bdd1e892bc5dd71 | 3,556 | py | Python | src/converter.py | salu133445/lakh-pianoroll-dataset | a8a8582254ff5f3225e792fa1ba1f939f0423080 | [
"MIT"
] | 59 | 2018-05-03T17:17:26.000Z | 2022-03-21T09:54:07.000Z | src/converter.py | salu133445/lakh-pianoroll-dataset | a8a8582254ff5f3225e792fa1ba1f939f0423080 | [
"MIT"
] | 4 | 2018-04-25T13:15:23.000Z | 2021-01-24T11:16:50.000Z | src/converter.py | salu133445/lakh-pianoroll-dataset | a8a8582254ff5f3225e792fa1ba1f939f0423080 | [
"MIT"
] | 8 | 2019-05-15T00:46:10.000Z | 2022-03-28T11:07:14.000Z | """This script converts a collection of MIDI files to multitrack pianorolls.
"""
import os
import json
import argparse
import warnings
import pretty_midi
from pypianoroll import Multitrack
from utils import make_sure_path_exists, change_prefix, findall_endswith
from config import CONFIG
if CONFIG['multicore']... | 35.207921 | 78 | 0.642576 | """This script converts a collection of MIDI files to multitrack pianorolls.
"""
import os
import json
import argparse
import warnings
import pretty_midi
from pypianoroll import Multitrack
from utils import make_sure_path_exists, change_prefix, findall_endswith
from config import CONFIG
if CONFIG['multicore']... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d44c94db376d5f7224fb18eee2ca5ce636a28c6c | 1,212 | py | Python | server/app/api/token_required.py | brulejr/flask-vue-crud | be4a1281184be7330c76e3d1dd3e936c8e07a7fe | [
"MIT"
] | null | null | null | server/app/api/token_required.py | brulejr/flask-vue-crud | be4a1281184be7330c76e3d1dd3e936c8e07a7fe | [
"MIT"
] | null | null | null | server/app/api/token_required.py | brulejr/flask-vue-crud | be4a1281184be7330c76e3d1dd3e936c8e07a7fe | [
"MIT"
] | null | null | null |
# required_token decorator
| 32.756757 | 86 | 0.575083 | from flask import request, current_app
import jwt
from app.models.auth import User
from app.api import api
# required_token decorator
def token_required(f):
def wrapper(*args, **kwargs):
auth_header = request.headers.get('Authorization')
current_user = None
if auth_header:
try... | 0 | 0 | 0 | 0 | 0 | 1,053 | 0 | 19 | 111 |
2c697b59bda67a7f33a79244efc025be23e606dd | 7,994 | py | Python | MimeCast/SumoLogic-Mimecast-Data-Collection/audit_collection.py | lghakamo-paf/sumologic-content | aa14674976c9265e93c8068193704ca23af1c0d7 | [
"Apache-2.0"
] | 81 | 2018-03-27T14:51:00.000Z | 2022-02-22T02:51:55.000Z | MimeCast/SumoLogic-Mimecast-Data-Collection/audit_collection.py | lghakamo-paf/sumologic-content | aa14674976c9265e93c8068193704ca23af1c0d7 | [
"Apache-2.0"
] | 17 | 2018-04-02T16:29:34.000Z | 2022-03-31T12:59:11.000Z | MimeCast/SumoLogic-Mimecast-Data-Collection/audit_collection.py | lghakamo-paf/sumologic-content | aa14674976c9265e93c8068193704ca23af1c0d7 | [
"Apache-2.0"
] | 70 | 2018-03-19T02:46:34.000Z | 2021-09-30T17:00:41.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Fetches audit log data from the Mimecast API and saves to a folder for Sumo Logic data collection"""
import logging
import os
import pickle
import datetime
import sys
from os.path import dirname, abspath
# Program Start
with open(os.path.join(os.path.join(dirname(d... | 41.419689 | 118 | 0.589317 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Fetches audit log data from the Mimecast API and saves to a folder for Sumo Logic data collection"""
import base64
import hashlib
import hmac
import json
import logging
import os
import pickle
import uuid
import time
import datetime
import sys
from os.path import dirna... | 0 | 0 | 0 | 0 | 0 | 5,599 | 0 | -61 | 225 |
36c7ebeccc6f1b963ba53c8b9d82cd0d4f8858f5 | 5,568 | py | Python | core/test_poly_parser.py | mike006322/PolynomialCalculator | bf56b0e773a3461ab2aa958d0d90e08f80a4d201 | [
"MIT"
] | null | null | null | core/test_poly_parser.py | mike006322/PolynomialCalculator | bf56b0e773a3461ab2aa958d0d90e08f80a4d201 | [
"MIT"
] | null | null | null | core/test_poly_parser.py | mike006322/PolynomialCalculator | bf56b0e773a3461ab2aa958d0d90e08f80a4d201 | [
"MIT"
] | null | null | null | import unittest
if __name__ == '__main__':
unittest.main()
| 40.941176 | 102 | 0.499282 | import unittest
from core.poly_parser import *
class TestParser(unittest.TestCase):
def test_find_corresponding_right_parenthesis(self):
test = "()"
self.assertEqual(find_corresponding_right_parenthesis(test, 0), 1)
test = "(abc)"
self.assertEqual(find_corresponding_right_parenthe... | 0 | 0 | 0 | 5,448 | 0 | 0 | 0 | 9 | 45 |
97181e2f23315d37a8d53783faa653353202cb03 | 3,974 | py | Python | Computer science/Programming languages/Python/Basics/Simple programs/Introduction to Python/topic.py | chanchanchong/PYTHON-TRACK-IN-HYPERSKILL | 462fe08ff4a2b183fd45a0235ab1ec7a788bd54c | [
"MIT"
] | null | null | null | Computer science/Programming languages/Python/Basics/Simple programs/Introduction to Python/topic.py | chanchanchong/PYTHON-TRACK-IN-HYPERSKILL | 462fe08ff4a2b183fd45a0235ab1ec7a788bd54c | [
"MIT"
] | null | null | null | Computer science/Programming languages/Python/Basics/Simple programs/Introduction to Python/topic.py | chanchanchong/PYTHON-TRACK-IN-HYPERSKILL | 462fe08ff4a2b183fd45a0235ab1ec7a788bd54c | [
"MIT"
] | null | null | null | # Theory: Introduction to Python
# Computer science has been around for a while, and
# programming languages are one of its main tools. These are
# designed to help us implement software to run on a computer.
# Just as natural languages for people, they serve as a
# communication tool, only between people and machines.... | 40.141414 | 95 | 0.755159 | # Theory: Introduction to Python
# Computer science has been around for a while, and
# programming languages are one of its main tools. These are
# designed to help us implement software to run on a computer.
# Just as natural languages for people, they serve as a
# communication tool, only between people and machines.... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b7a9f18814a5b7bd79ce29503dcbbeefe34c7382 | 11,746 | py | Python | jenkinsapi_tests/unittests/test_requester.py | leon-gh/jenkinsapi | 6d3bf94b34a521955dbb82c5ae7c2eba031af894 | [
"MIT"
] | 1 | 2019-05-09T11:49:39.000Z | 2019-05-09T11:49:39.000Z | jenkinsapi_tests/unittests/test_requester.py | leon-gh/jenkinsapi | 6d3bf94b34a521955dbb82c5ae7c2eba031af894 | [
"MIT"
] | null | null | null | jenkinsapi_tests/unittests/test_requester.py | leon-gh/jenkinsapi | 6d3bf94b34a521955dbb82c5ae7c2eba031af894 | [
"MIT"
] | null | null | null | from __future__ import print_function
| 28.718826 | 79 | 0.640048 | from __future__ import print_function
import pytest
import requests
from jenkinsapi.jenkins import Requester
from jenkinsapi.custom_exceptions import JenkinsAPIException
from mock import patch
def test_no_parameters_uses_default_values():
req = Requester()
assert isinstance(req, Requester)
assert req.user... | 0 | 927 | 0 | 786 | 0 | 9,120 | 0 | 45 | 800 |
4a6b7057bdfe4e83c14ee84826e583e22668baa9 | 4,247 | py | Python | app/views/money.py | hezmondo/lulu | 507a863f00086e827e4063d0666a4d97f10941c6 | [
"MIT"
] | null | null | null | app/views/money.py | hezmondo/lulu | 507a863f00086e827e4063d0666a4d97f10941c6 | [
"MIT"
] | null | null | null | app/views/money.py | hezmondo/lulu | 507a863f00086e827e4063d0666a4d97f10941c6 | [
"MIT"
] | null | null | null | from flask import Blueprint
money_bp = Blueprint('money_bp', __name__)
| 41.23301 | 113 | 0.701436 | from flask import Blueprint, flash, redirect, render_template, request, url_for
from flask_login import login_required
from app.dao.rent import get_all_rentcodes
from app.dao.money import get_acc_descs, get_moneydets, get_money_item, toggle_cleared
from app.main.money import collect_search_filter, mget_money_acc, mget... | 0 | 3,512 | 0 | 0 | 0 | 0 | 0 | 363 | 293 |
37faeca1f83dd4730bf51c1e2102c5d401b0585a | 1,396 | py | Python | decision-science/lab3/main.py | Foltrex/bsu | 769ddac58eddd5877e40949227998575fd4dec77 | [
"MIT"
] | 113 | 2017-02-02T13:09:21.000Z | 2022-03-14T08:54:41.000Z | decision-science/lab3/main.py | Foltrex/bsu | 769ddac58eddd5877e40949227998575fd4dec77 | [
"MIT"
] | 12 | 2017-04-14T12:01:50.000Z | 2022-03-08T22:47:22.000Z | decision-science/lab3/main.py | Drapegnik/bsu | 769ddac58eddd5877e40949227998575fd4dec77 | [
"MIT"
] | 78 | 2017-03-18T22:36:13.000Z | 2022-02-20T14:42:34.000Z | import os
import sys
from algorithms import dijkstra, floyd
TASK1_START = 0
print '-'*35 + '\ntask1 - shortest ways from ({})\n'.format(TASK1_START + 1) + '-'*35
g_list, g_mat = read_graph_list('task1.in')
dist, prev, table = dijkstra(g_list, TASK1_START)
user_interaction(prev, dist, g_mat)
write_debug_table('task... | 24.491228 | 99 | 0.541547 | import os
import sys
from algorithms import dijkstra, floyd
from utils import *
def dialog(size):
try:
node = int(raw_input('Please enter node number in [1, {}], or -1 for exit: '.format(size)))
if node == -1:
return -1
if node < 1 or node > size:
raise ValueError
... | 0 | 0 | 0 | 0 | 0 | 858 | 0 | -2 | 68 |
37efd995f9e98d6ad319826ae24a6853857bd6eb | 193 | py | Python | scripts/yl_servo_on.py | a825338908/laser_line_extraction | 7ce9484e80a9bd2b9abbd66f75de7838196d01f6 | [
"BSD-3-Clause"
] | null | null | null | scripts/yl_servo_on.py | a825338908/laser_line_extraction | 7ce9484e80a9bd2b9abbd66f75de7838196d01f6 | [
"BSD-3-Clause"
] | null | null | null | scripts/yl_servo_on.py | a825338908/laser_line_extraction | 7ce9484e80a9bd2b9abbd66f75de7838196d01f6 | [
"BSD-3-Clause"
] | null | null | null | bashCommand = "rostopic pub -1 /spray_onoff std_msgs/Float32 1.0"
import subprocess
process = subprocess.Popen(bashCommand.split(), stdout=subprocess.PIPE)
output, error = process.communicate() | 48.25 | 71 | 0.797927 | bashCommand = "rostopic pub -1 /spray_onoff std_msgs/Float32 1.0"
import subprocess
process = subprocess.Popen(bashCommand.split(), stdout=subprocess.PIPE)
output, error = process.communicate() | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
db97dac89d4ee5b5718baab12440ee5099c81ed5 | 850 | py | Python | main.py | embed-systems/action-sharepoint-upload | c95b1814d4f4127bbaf5d97513c93f6aa957bdc8 | [
"MIT"
] | null | null | null | main.py | embed-systems/action-sharepoint-upload | c95b1814d4f4127bbaf5d97513c93f6aa957bdc8 | [
"MIT"
] | null | null | null | main.py | embed-systems/action-sharepoint-upload | c95b1814d4f4127bbaf5d97513c93f6aa957bdc8 | [
"MIT"
] | null | null | null | import os
SITE_URL = os.getenv('SITE_URL')
USER = os.getenv('USER')
PASS = os.getenv('PASS')
DESTINATION = os.getenv('DESTINATION')
FILE = os.getenv('FILE')
FILE_ON_SERVER = os.getenv('FILE_ON_SERVER')
if __name__ == "__main__":
main()
| 26.5625 | 85 | 0.716471 | import os
from office365.sharepoint.client_context import ClientContext
SITE_URL = os.getenv('SITE_URL')
USER = os.getenv('USER')
PASS = os.getenv('PASS')
DESTINATION = os.getenv('DESTINATION')
FILE = os.getenv('FILE')
FILE_ON_SERVER = os.getenv('FILE_ON_SERVER')
def main():
ctx = ClientContext(SITE_URL).with_us... | 0 | 0 | 0 | 0 | 0 | 521 | 0 | 40 | 45 |
072afd68ab568d4e364bbf03f905cbbfe0fd449d | 15,538 | py | Python | crlapi/sl/clmodels/boosting.py | pclucas14/alma | dcb5dc55f2eec32bbe2d9cf7a256c1382658820d | [
"MIT"
] | 9 | 2021-11-24T21:09:32.000Z | 2022-03-29T21:51:35.000Z | crlapi/sl/clmodels/boosting.py | pclucas14/alma | dcb5dc55f2eec32bbe2d9cf7a256c1382658820d | [
"MIT"
] | null | null | null | crlapi/sl/clmodels/boosting.py | pclucas14/alma | dcb5dc55f2eec32bbe2d9cf7a256c1382658820d | [
"MIT"
] | 1 | 2022-02-24T18:33:40.000Z | 2022-02-24T18:33:40.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import torch.nn as nn
| 35.074492 | 145 | 0.597567 | # Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import torch
import torch.nn as nn
import torch.nn.functional as F
from crlapi.core import CLModel
from crlapi.sl.clmodel... | 0 | 0 | 0 | 14,917 | 0 | 109 | 0 | 18 | 270 |
14762532b0b2c9e0dc177730a543ef1db73e4310 | 77 | py | Python | pyinformix/requirements.py | homedepot/pyinformix | 06a037510f79d12557a0dc0b795e2a92eb79ecb3 | [
"Apache-2.0"
] | null | null | null | pyinformix/requirements.py | homedepot/pyinformix | 06a037510f79d12557a0dc0b795e2a92eb79ecb3 | [
"Apache-2.0"
] | null | null | null | pyinformix/requirements.py | homedepot/pyinformix | 06a037510f79d12557a0dc0b795e2a92eb79ecb3 | [
"Apache-2.0"
] | null | null | null | from ibm_db_sa import requirements
Requirements = requirements.Requirements
| 19.25 | 40 | 0.87013 | from ibm_db_sa import requirements
Requirements = requirements.Requirements
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4a0cfd206328400228d641cce69e03bc4e9b9e37 | 13,579 | py | Python | geoloc-server/ppmeasurements/util.py | muzammilar/passport | 7918561916fbcb5e82cd73d577873fb17a819d19 | [
"BSD-3-Clause"
] | 1 | 2021-12-06T01:32:56.000Z | 2021-12-06T01:32:56.000Z | geoloc-server/ppmeasurements/util.py | muzammilar/passport | 7918561916fbcb5e82cd73d577873fb17a819d19 | [
"BSD-3-Clause"
] | null | null | null | geoloc-server/ppmeasurements/util.py | muzammilar/passport | 7918561916fbcb5e82cd73d577873fb17a819d19 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
ppmeasurements.util
~~~~~~~~~~~~~~
This module contains utility functions for parsing information,
checking for non-global IP address, convert traceroutes to machine-readable
structures, etc.
:author: Muzammil Abdul Rehman
:copyright: Northeastern University 2... | 41.148485 | 198 | 0.579498 | # -*- coding: utf-8 -*-
"""
ppmeasurements.util
~~~~~~~~~~~~~~
This module contains utility functions for parsing information,
checking for non-global IP address, convert traceroutes to machine-readable
structures, etc.
:author: Muzammil Abdul Rehman
:copyright: Northeastern University © ... | 2 | 0 | 0 | 0 | 0 | 10,040 | 0 | -51 | 520 |
d183c408d61dd4345eb37ea3bf99acb7dca74e94 | 702 | py | Python | tests/test_issues.py | AdvaitDhingra/vector | 5ba111555bae20887e417c1e73101a940d06fc57 | [
"BSD-3-Clause"
] | 40 | 2020-03-26T13:28:36.000Z | 2022-03-23T22:14:35.000Z | tests/test_issues.py | AdvaitDhingra/vector | 5ba111555bae20887e417c1e73101a940d06fc57 | [
"BSD-3-Clause"
] | 66 | 2020-02-14T13:32:18.000Z | 2022-03-29T14:35:31.000Z | tests/test_issues.py | AdvaitDhingra/vector | 5ba111555bae20887e417c1e73101a940d06fc57 | [
"BSD-3-Clause"
] | 14 | 2020-01-29T22:03:33.000Z | 2022-03-16T02:46:25.000Z | # Copyright (c) 2019-2021, Jonas Eschle, Jim Pivarski, Eduardo Rodrigues, and Henry Schreiner.
#
# Distributed under the 3-clause BSD license, see accompanying file LICENSE
# or https://github.com/scikit-hep/vector for details.
| 31.909091 | 94 | 0.611111 | # Copyright (c) 2019-2021, Jonas Eschle, Jim Pivarski, Eduardo Rodrigues, and Henry Schreiner.
#
# Distributed under the 3-clause BSD license, see accompanying file LICENSE
# or https://github.com/scikit-hep/vector for details.
import pytest
import vector
def test_issue_99():
ak = pytest.importorskip("awkward")... | 0 | 0 | 0 | 0 | 0 | 420 | 0 | -16 | 69 |
0b99c956dd5378ae56695c4f64c892ade7598499 | 3,363 | py | Python | wavemaker/wave_stream.py | serban/wavemaker | 889772cb440b7eb64369a067eefcb96410d7f4f0 | [
"MIT"
] | 1 | 2021-03-12T09:12:47.000Z | 2021-03-12T09:12:47.000Z | wavemaker/wave_stream.py | serban/wavemaker | 889772cb440b7eb64369a067eefcb96410d7f4f0 | [
"MIT"
] | null | null | null | wavemaker/wave_stream.py | serban/wavemaker | 889772cb440b7eb64369a067eefcb96410d7f4f0 | [
"MIT"
] | null | null | null | # vim:set ts=8 sw=2 sts=2 et:
"""Store signals."""
SAMPLE_SIZE = 16 # In bits
| 34.670103 | 80 | 0.71127 | # vim:set ts=8 sw=2 sts=2 et:
"""Store signals."""
import itertools
import struct
import wave
SAMPLE_SIZE = 16 # In bits
class WaveStream(object):
"""A stream of PCM audio data."""
def __init__(self, channels, sample_rate, sample_size):
"""Initialize a WaveStream with integer samples.
Args:
c... | 0 | 713 | 0 | 2,500 | 0 | 0 | 0 | -23 | 90 |
fc9779bee5089a9ef47d3595e2681e0ce8a1ed46 | 70 | py | Python | tests/utils/__init__.py | brunns/brunns-matchers | b12dc13336501fce9a1e0631e439e21e6246d8ea | [
"MIT"
] | 1 | 2019-03-15T12:51:26.000Z | 2019-03-15T12:51:26.000Z | tests/utils/__init__.py | brunns/brunns-matchers | b12dc13336501fce9a1e0631e439e21e6246d8ea | [
"MIT"
] | 10 | 2019-02-20T21:10:27.000Z | 2022-03-01T22:36:00.000Z | tests/utils/__init__.py | brunns/brunns-matchers | b12dc13336501fce9a1e0631e439e21e6246d8ea | [
"MIT"
] | 1 | 2020-01-22T11:08:06.000Z | 2020-01-22T11:08:06.000Z | # encoding=utf-8
import logging
logger = logging.getLogger(__name__)
| 14 | 36 | 0.785714 | # encoding=utf-8
import logging
logger = logging.getLogger(__name__)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
14f75548223061656a5673adc5af9f552ce2ecb8 | 1,975 | py | Python | days/day064/exercises/038/nolan.py | alex-vegan/100daysofcode-with-python-course | b6c12316abe18274b7963371b8f0ed2fd549ef07 | [
"MIT"
] | 2 | 2018-10-28T17:12:37.000Z | 2018-10-28T17:12:39.000Z | days/day064/exercises/038/nolan.py | alex-vegan/100daysofcode-with-python-course | b6c12316abe18274b7963371b8f0ed2fd549ef07 | [
"MIT"
] | 3 | 2018-10-28T17:11:04.000Z | 2018-10-29T22:36:36.000Z | days/day064/exercises/038/nolan.py | alex-vegan/100daysofcode-with-python-course | b6c12316abe18274b7963371b8f0ed2fd549ef07 | [
"MIT"
] | null | null | null | import xml.etree.ElementTree as ET
import re
# from OMDB
xmlstring = '''<?xml version="1.0" encoding="UTF-8"?>
<root response="True">
<movie title="The Prestige" year="2006" rated="PG-13" released="20 Oct 2006" runtime="130 min" genre="Drama, Mystery, Sci-Fi" director="Christopher Nolan" />
<movie title="... | 41.145833 | 163 | 0.675443 | import xml.etree.ElementTree as ET
from pprint import pprint as pp
import re
# from OMDB
xmlstring = '''<?xml version="1.0" encoding="UTF-8"?>
<root response="True">
<movie title="The Prestige" year="2006" rated="PG-13" released="20 Oct 2006" runtime="130 min" genre="Drama, Mystery, Sci-Fi" director="Christ... | 0 | 0 | 0 | 0 | 190 | 0 | 0 | 10 | 48 |
ab2c83f37e99946fc18773939c89414615a8bd37 | 255 | py | Python | demo/sd/plot.py | fruchti/stm32f0board | 2a34fe2862dc1043e11d9e5f88738c12c327f3e3 | [
"0BSD"
] | 8 | 2019-01-27T08:03:38.000Z | 2021-06-30T09:02:38.000Z | demo/sd/plot.py | fruchti/stm32f0board | 2a34fe2862dc1043e11d9e5f88738c12c327f3e3 | [
"0BSD"
] | 2 | 2017-03-04T13:53:08.000Z | 2017-03-06T10:11:08.000Z | demo/sd/plot.py | fruchti/stm32f0board | 2a34fe2862dc1043e11d9e5f88738c12c327f3e3 | [
"0BSD"
] | 1 | 2018-05-28T18:57:14.000Z | 2018-05-28T18:57:14.000Z | #!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
data = np.genfromtxt('example-log.csv', delimiter = ',', skip_header = 4, names = ['t', 'T'])
plt.plot(data['t'] / 1e3, data['T'])
plt.ylabel('T/C')
plt.xlabel('t/s')
plt.show()
| 21.25 | 93 | 0.639216 | #!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
data = np.genfromtxt('example-log.csv', delimiter = ',', skip_header = 4, names = ['t', 'T'])
plt.plot(data['t'] / 1e3, data['T'])
plt.ylabel('T/°C')
plt.xlabel('t/s')
plt.show()
| 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
07cf36e890f823ac4a878d94ebeeb556914a2608 | 4,109 | py | Python | mimic3benchmark/scripts/extract_episodes_from_subjects.py | kwonoh/mimic3-benchmarks | 53ed33d2ba2c077a25a463edc36bcc7088453b4d | [
"MIT"
] | null | null | null | mimic3benchmark/scripts/extract_episodes_from_subjects.py | kwonoh/mimic3-benchmarks | 53ed33d2ba2c077a25a463edc36bcc7088453b4d | [
"MIT"
] | null | null | null | mimic3benchmark/scripts/extract_episodes_from_subjects.py | kwonoh/mimic3-benchmarks | 53ed33d2ba2c077a25a463edc36bcc7088453b4d | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import print_function
import argparse
import os
import sys
from mimic3benchmark.subject import read_stays, read_diagnoses, read_events, get_events_for_stay, add_hours_elpased_to_events
from mimic3benchmark.subject import convert_events_to_timeseries, get_first_v... | 46.168539 | 166 | 0.710148 | from __future__ import absolute_import
from __future__ import print_function
import argparse
import os
import sys
from mimic3benchmark.subject import read_stays, read_diagnoses, read_events, get_events_for_stay, add_hours_elpased_to_events
from mimic3benchmark.subject import convert_events_to_timeseries, get_first_v... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 61 | 0 |
43580ac6e43b2a1dd5ab256c6f4dbfb2e0abb5e8 | 278 | py | Python | main.py | faruk-ahmad/catsleep | abb447bfaa28db92faf35b1b3aed216b514aa4b5 | [
"MIT"
] | 5 | 2020-05-16T14:48:22.000Z | 2021-07-29T00:50:36.000Z | main.py | faruk-ahmad/catsleep | abb447bfaa28db92faf35b1b3aed216b514aa4b5 | [
"MIT"
] | null | null | null | main.py | faruk-ahmad/catsleep | abb447bfaa28db92faf35b1b3aed216b514aa4b5 | [
"MIT"
] | 1 | 2021-07-29T00:50:40.000Z | 2021-07-29T00:50:40.000Z | """ Main module to start the catsleep tool """
from catsleep.cat import catsleep as ct
def start_catsleep():
""" Starting point of catsleep """
catsp = ct.CatSleep()
catsp.catsleep_control()
if __name__ == '__main__':
start_catsleep()
| 16.352941 | 46 | 0.683453 | """ Main module to start the catsleep tool """
import os
import sys
from catsleep.cat import catsleep as ct
def start_catsleep():
""" Starting point of catsleep """
catsp = ct.CatSleep()
catsp.catsleep_control()
if __name__ == '__main__':
start_catsleep()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | -23 | 45 |
2b654a379369c67cf906be0dde2f0cc4a309e1ea | 14,281 | py | Python | util/sql.py | liuyq-617/TUT | 4a3782aebbd627ed5b7d1904d67ec9baa4cfa0df | [
"MIT"
] | null | null | null | util/sql.py | liuyq-617/TUT | 4a3782aebbd627ed5b7d1904d67ec9baa4cfa0df | [
"MIT"
] | null | null | null | util/sql.py | liuyq-617/TUT | 4a3782aebbd627ed5b7d1904d67ec9baa4cfa0df | [
"MIT"
] | null | null | null | ###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or us... | 41.514535 | 127 | 0.543029 | ###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or u... | 3 | 0 | 0 | 13,312 | 0 | 245 | 0 | -63 | 245 |
b2af9b6188dc1ce6f818c3715168e46e2d6b7c39 | 1,002 | py | Python | directory/migrations/0005_auto_20200404_1519.py | duongdo27/university-directory | 621d7b3592e158635e58dfa7051f1121618f8b82 | [
"MIT"
] | null | null | null | directory/migrations/0005_auto_20200404_1519.py | duongdo27/university-directory | 621d7b3592e158635e58dfa7051f1121618f8b82 | [
"MIT"
] | 5 | 2020-06-06T01:43:12.000Z | 2022-02-10T11:52:23.000Z | directory/migrations/0005_auto_20200404_1519.py | duongdo27/university-directory | 621d7b3592e158635e58dfa7051f1121618f8b82 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.4 on 2020-04-04 15:19
| 35.785714 | 116 | 0.592814 | # Generated by Django 2.2.4 on 2020-04-04 15:19
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('directory', '0004_student'),
]
operations = [
migrations.CreateModel(
name='Grade',
... | 0 | 0 | 0 | 855 | 0 | 0 | 0 | 30 | 68 |
8503e52307d007c99734efe5d4339b565b6ad9fd | 10,429 | py | Python | reviewboard/diffviewer/tests/test_forms.py | jeyaprabum/Reviewboard | fe4dc611ef961b12b6991a74faa24a22d393fb4a | [
"MIT"
] | 1 | 2019-08-20T03:39:04.000Z | 2019-08-20T03:39:04.000Z | reviewboard/diffviewer/tests/test_forms.py | jeyaprabum/Reviewboard | fe4dc611ef961b12b6991a74faa24a22d393fb4a | [
"MIT"
] | 1 | 2019-08-20T03:39:45.000Z | 2019-08-20T03:39:45.000Z | reviewboard/diffviewer/tests/test_forms.py | jeyaprabum/Reviewboard | fe4dc611ef961b12b6991a74faa24a22d393fb4a | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
| 35.114478 | 78 | 0.55432 | from __future__ import unicode_literals
import nose
from django.core.files.uploadedfile import SimpleUploadedFile
from kgb import SpyAgency
from reviewboard.admin.import_utils import has_module
from reviewboard.diffviewer.diffutils import (get_original_file,
get_patched_f... | 0 | 0 | 0 | 9,873 | 0 | 0 | 0 | 314 | 201 |
9ad727ae48709f4002d805eca86cd66a89bea364 | 6,282 | py | Python | django_graphene_starter/starter/mutations.py | ngshiheng/django-graphene-starter | 81151b0dc30ed6d1d493be611e930c749044941d | [
"MIT"
] | 9 | 2021-01-14T02:53:02.000Z | 2021-12-29T21:39:37.000Z | django_graphene_starter/starter/mutations.py | ngshiheng/django-graphene-starter | 81151b0dc30ed6d1d493be611e930c749044941d | [
"MIT"
] | 20 | 2021-01-28T00:49:06.000Z | 2022-01-14T19:04:27.000Z | django_graphene_starter/starter/mutations.py | ngshiheng/django-graphene-starter | 81151b0dc30ed6d1d493be611e930c749044941d | [
"MIT"
] | 2 | 2021-10-12T19:24:52.000Z | 2021-12-29T21:39:53.000Z |
# Reporter
# ^^^^^^^^
# Publication
# ^^^^^^^^^^^
# Article
# ^^^^^^^
| 29.492958 | 136 | 0.663642 | from django.contrib.auth.models import Permission
from graphene import ID, ClientIDMutation, Field, ResolveInfo, String
from graphql import GraphQLError
from graphql_jwt.decorators import login_required, permission_required, staff_member_required
from graphql_relay import from_global_id
from .models import Article, Pu... | 0 | 3,675 | 0 | 1,919 | 0 | 0 | 0 | 247 | 359 |
e8893e85a7915c77c1afbb8733e0a799aa458867 | 2,811 | py | Python | server.py | dipu-bd/esheba-bot | 733b3eb90839dc9d1a2c7e8b88b1d1a4b876af54 | [
"MIT"
] | 2 | 2018-02-21T11:52:58.000Z | 2018-02-21T15:18:23.000Z | server.py | dipu-bd/esheba-bot | 733b3eb90839dc9d1a2c7e8b88b1d1a4b876af54 | [
"MIT"
] | null | null | null | server.py | dipu-bd/esheba-bot | 733b3eb90839dc9d1a2c7e8b88b1d1a4b876af54 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Implements grpc modules"""
import time
import grpc
from service import service_pb2_grpc
from concurrent.futures import ThreadPoolExecutor
# end class
def run_server():
'''Runs the grpc server'''
port = '5000'
server = grpc.server(ThreadPoolExecutor(max_work... | 29.904255 | 79 | 0.630736 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Implements grpc modules"""
import time
import grpc
import service.service_pb2 as bot_pb
from service import service_pb2_grpc
from EshebaBot.esheba import EshebaBot
from concurrent.futures import ThreadPoolExecutor
class BotService(service_pb2_grpc.BotServiceServicer):
... | 0 | 0 | 0 | 1,996 | 0 | 0 | 0 | 32 | 67 |
8ab328734cf4e679cd9fa239961ea9b994a53be3 | 32,017 | py | Python | jams/date2dec.py | MuellerSeb/jams_python | 1bca04557da79d8f8a4c447f5ccc517c40ab7dfc | [
"MIT"
] | 9 | 2019-06-03T03:24:16.000Z | 2021-12-03T07:14:00.000Z | jams/date2dec.py | MuellerSeb/jams_python | 1bca04557da79d8f8a4c447f5ccc517c40ab7dfc | [
"MIT"
] | 6 | 2020-03-25T21:56:59.000Z | 2021-11-08T14:58:27.000Z | jams/date2dec.py | MuellerSeb/jams_python | 1bca04557da79d8f8a4c447f5ccc517c40ab7dfc | [
"MIT"
] | 5 | 2019-10-17T12:04:33.000Z | 2021-09-28T07:45:07.000Z | #!/usr/bin/env python
"""
date2dec : Converts calendar dates into decimal dates.
This module was written by Arndt Piayda and then enhanced and
maintained by Matthias Cuntz while at Department of Computational
Hydrosystems, Helmholtz Centre for Environmental Research - UFZ,
Leipzig, Germany, and continued by Matthias C... | 43.501359 | 143 | 0.541525 | #!/usr/bin/env python
"""
date2dec : Converts calendar dates into decimal dates.
This module was written by Arndt Piayda and then enhanced and
maintained by Matthias Cuntz while at Department of Computational
Hydrosystems, Helmholtz Centre for Environmental Research - UFZ,
Leipzig, Germany, and continued by Matthias C... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7ef29728a053d940e0509843c0cb6d3b105cdca3 | 1,533 | py | Python | euslint/test.py | knorth55/euslint | 86e7733e4c14b2a0929fc0e4ca30987fff8e5bc0 | [
"MIT"
] | 3 | 2020-01-21T10:01:18.000Z | 2021-11-17T14:00:53.000Z | euslint/test.py | knorth55/euslint | 86e7733e4c14b2a0929fc0e4ca30987fff8e5bc0 | [
"MIT"
] | null | null | null | euslint/test.py | knorth55/euslint | 86e7733e4c14b2a0929fc0e4ca30987fff8e5bc0 | [
"MIT"
] | null | null | null | from __future__ import print_function
| 30.058824 | 96 | 0.553816 | from __future__ import print_function
import sys
def test_parenthesis(result, filepath):
if result['parenthesis_open'] != result['parenthesis_close']:
print(
'{0}: parenthesis: # of open/close parenthesises doesn\'t match: {1} != {2}' # NOQA
.format(
filepath, res... | 0 | 0 | 0 | 0 | 0 | 1,387 | 0 | -11 | 115 |