hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
382a66090cbc637de5dba15c667706de81f23deb | 6,184 | py | Python | tools/fileinfo/features/hashes/test.py | stepanek-m/retdec-regression-tests | 12b834b14ede2826fec451368fa8192ab00ddadf | [
"MIT"
] | null | null | null | tools/fileinfo/features/hashes/test.py | stepanek-m/retdec-regression-tests | 12b834b14ede2826fec451368fa8192ab00ddadf | [
"MIT"
] | null | null | null | tools/fileinfo/features/hashes/test.py | stepanek-m/retdec-regression-tests | 12b834b14ede2826fec451368fa8192ab00ddadf | [
"MIT"
] | null | null | null | from regression_tests import *
# https://github.com/avast-tl/retdec/issues/246
# Test for ordinals that are translated by YARA/pefile LUT.
# https://github.com/avast-tl/retdec/issues/246
# Test for ordinals that are NOT translated by YARA/pefile LUT.
# https://github.com/avast-tl/retdec/issues/121
# Test export ha... | 44.489209 | 157 | 0.717497 | from regression_tests import *
class TestAllHashes(Test):
settings = TestSettings(
tool='fileinfo',
input='input.ex',
args='--verbose --json'
)
def test_correctly_analyzes_input_file(self):
assert self.fileinfo.succeeded
self.assertEqual(self.fileinfo.output['impor... | 4,142 | 1,321 | 178 |
1fa5faf6bbace23e616e3ce02efd35eb93ca8bca | 5,750 | py | Python | strange_case/support/jinja.py | colinta/StrangeCase | 822634d986020bc35d49f5355ec4823690372cd5 | [
"BSD-2-Clause-FreeBSD"
] | 10 | 2015-11-05T01:38:29.000Z | 2021-06-09T06:35:27.000Z | strange_case/support/jinja.py | colinta/StrangeCase | 822634d986020bc35d49f5355ec4823690372cd5 | [
"BSD-2-Clause-FreeBSD"
] | 9 | 2019-07-17T15:21:43.000Z | 2021-09-08T01:08:00.000Z | strange_case/support/jinja.py | colinta/StrangeCase | 822634d986020bc35d49f5355ec4823690372cd5 | [
"BSD-2-Clause-FreeBSD"
] | 2 | 2016-06-01T01:51:22.000Z | 2017-03-16T00:11:39.000Z | """
Jinja support adds the following abilities:
1. Adds a ``YamlFrontMatterLoader``, which searchs the beginning of the file for
YAML between two lines of an equal number of three or more dashes.
These lines are stripped off before rendering.
2. Jinja has nice support for displaying errors, but the YAML front m... | 38.333333 | 107 | 0.654957 | """
Jinja support adds the following abilities:
1. Adds a ``YamlFrontMatterLoader``, which searchs the beginning of the file for
YAML between two lines of an equal number of three or more dashes.
These lines are stripped off before rendering.
2. Jinja has nice support for displaying errors, but the YAML front m... | 692 | 41 | 147 |
47d85faea5c883a5e1d6fa08edc7df5a87431f15 | 975 | py | Python | plots/histogram_by_vars.py | carolmb/viewing-profiles-of-scientific-articles | 6a9248ea0dc458488b7f1556f358692529d2faf6 | [
"Unlicense"
] | null | null | null | plots/histogram_by_vars.py | carolmb/viewing-profiles-of-scientific-articles | 6a9248ea0dc458488b7f1556f358692529d2faf6 | [
"Unlicense"
] | null | null | null | plots/histogram_by_vars.py | carolmb/viewing-profiles-of-scientific-articles | 6a9248ea0dc458488b7f1556f358692529d2faf6 | [
"Unlicense"
] | null | null | null | import matplotlib.pyplot as plt
from read_file import select_original_breakpoints
from collections import defaultdict
if __name__ == '__main__':
N = 5
slopes, intervals = select_original_breakpoints(N, 'segm/segmented_curves_filtered.txt')
slopes_hist = defaultdict(lambda: [])
intervals_hist = defaul... | 30.46875 | 92 | 0.630769 | import matplotlib.pyplot as plt
from read_file import select_original_breakpoints
from collections import defaultdict
if __name__ == '__main__':
N = 5
slopes, intervals = select_original_breakpoints(N, 'segm/segmented_curves_filtered.txt')
slopes_hist = defaultdict(lambda: [])
intervals_hist = defaul... | 0 | 0 | 0 |
4718604bd73bed2d3cac8b729d35b99f89e7762c | 1,127 | py | Python | helper.py | ai-xiaotong/face-benchmark | 4a4a336be6df72699120d6f0a4b7160904375cb0 | [
"MIT"
] | 1 | 2020-04-20T02:19:54.000Z | 2020-04-20T02:19:54.000Z | helper.py | ai-xiaotong/face-benchmark | 4a4a336be6df72699120d6f0a4b7160904375cb0 | [
"MIT"
] | null | null | null | helper.py | ai-xiaotong/face-benchmark | 4a4a336be6df72699120d6f0a4b7160904375cb0 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
import base64
import numpy as np
| 29.657895 | 77 | 0.580302 | # -*- coding:utf-8 -*-
import base64
import numpy as np
def b64encode_image(path):
with open(path, 'rb') as f:
return base64.b64encode(f.read())
def roc(gts, scores, start=0.10, stop=0.60, step=0.001):
FARs, TARs, THs = [], [], []
for TH in np.arange(start, stop, step):
# FA, FN, TA, TN ... | 1,000 | 0 | 69 |
df701f2d105b1708eb401f9c85266218d6c91b8a | 3,082 | py | Python | myprodigy/filters.py | acdh-oeaw/nerdpool | fd03148797e13fb815164da5a6f9a8f27a873cbd | [
"MIT"
] | null | null | null | myprodigy/filters.py | acdh-oeaw/nerdpool | fd03148797e13fb815164da5a6f9a8f27a873cbd | [
"MIT"
] | 3 | 2021-03-30T09:41:55.000Z | 2021-06-10T07:52:29.000Z | myprodigy/filters.py | acdh-oeaw/nerdpool | fd03148797e13fb815164da5a6f9a8f27a873cbd | [
"MIT"
] | null | null | null | # generated by appcreator
import django_filters
from django import forms
from dal import autocomplete
from vocabs.filters import generous_concept_filter
from vocabs.models import SkosConcept
from .models import (
NerDataSet,
NerSample,
Dataset,
Example,
ProdigyServer)
| 30.514851 | 74 | 0.623621 | # generated by appcreator
import django_filters
from django import forms
from dal import autocomplete
from vocabs.filters import generous_concept_filter
from vocabs.models import SkosConcept
from .models import (
NerDataSet,
NerSample,
Dataset,
Example,
ProdigyServer)
class NerDataSetListFilter(... | 0 | 2,721 | 69 |
996e98649bd1c0fcdd10a1cf00a85529b17d2699 | 8,683 | py | Python | quantus/helpers/asserts.py | sebastian-lapuschkin/Quantus | c3b8a9fb2018f34bd89ba38efa2b2b8c38128b3f | [
"MIT"
] | null | null | null | quantus/helpers/asserts.py | sebastian-lapuschkin/Quantus | c3b8a9fb2018f34bd89ba38efa2b2b8c38128b3f | [
"MIT"
] | null | null | null | quantus/helpers/asserts.py | sebastian-lapuschkin/Quantus | c3b8a9fb2018f34bd89ba38efa2b2b8c38128b3f | [
"MIT"
] | null | null | null | import numpy as np
from typing import Callable, Tuple, Union
def assert_model_predictions_deviations(
y_pred: float, y_pred_perturb: float, threshold: float = 0.01
):
"""Check that model predictions does not deviate more than a given threshold."""
if abs(y_pred - y_pred_perturb) > threshold:
retu... | 37.266094 | 116 | 0.636186 | import numpy as np
from typing import Callable, Tuple, Union
def attributes_check(metric):
# https://towardsdatascience.com/5-ways-to-control-attributes-in-python-an-example-led-guide-2f5c9b8b1fb0
attr = metric.__dict__
if "perturb_func" in attr:
if not callable(attr["perturb_func"]):
... | 2,050 | 0 | 138 |
16a389816d716b337415b5f804d1104c90b00258 | 1,807 | py | Python | vika/services/svc_football.py | jtprogru/vika | 6bf59dbad169cdb3a10f354e6df0c99cb5d98988 | [
"WTFPL"
] | null | null | null | vika/services/svc_football.py | jtprogru/vika | 6bf59dbad169cdb3a10f354e6df0c99cb5d98988 | [
"WTFPL"
] | null | null | null | vika/services/svc_football.py | jtprogru/vika | 6bf59dbad169cdb3a10f354e6df0c99cb5d98988 | [
"WTFPL"
] | null | null | null | import json
import urllib.request
from collections import defaultdict
from datetime import datetime
| 38.446809 | 115 | 0.546209 | import json
import urllib.request
from collections import defaultdict
from datetime import datetime
def calculate_match_points(team1, team2, score1, score2):
if score1 == score2:
return {team1: 1, team2: 1}
elif score1 > score2:
return {team1: 3, team2: 0}
else:
return {team1: 0, t... | 1,639 | -6 | 72 |
3fc3e9f3b2734409dcca83f3085ff6d769cb2068 | 932 | py | Python | tupianpaqu.py | smithgoo/python3Learn | d0c066c10887db3942ca285b86ce464463998aad | [
"MIT"
] | 1 | 2019-05-30T08:08:34.000Z | 2019-05-30T08:08:34.000Z | tupianpaqu.py | smithgoo/python3Learn | d0c066c10887db3942ca285b86ce464463998aad | [
"MIT"
] | null | null | null | tupianpaqu.py | smithgoo/python3Learn | d0c066c10887db3942ca285b86ce464463998aad | [
"MIT"
] | null | null | null | import requests
import re
import urllib
from lxml import etree
from bs4 import BeautifulSoup
headers ={"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1","Referer": "http://fanyi.baidu.com/translate?aldtype=16047&quer... | 24.526316 | 273 | 0.671674 | import requests
import re
import urllib
from lxml import etree
from bs4 import BeautifulSoup
headers ={"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1","Referer": "http://fanyi.baidu.com/translate?aldtype=16047&quer... | 0 | 0 | 0 |
73ce7ef8ed248550dfab3bc0f0a69940c43f962b | 1,083 | py | Python | cuenca/resources/sessions.py | andreshndz/cuenca-python | ca9f0f078584f1458e71baeb4cd15fcc55b40397 | [
"MIT"
] | null | null | null | cuenca/resources/sessions.py | andreshndz/cuenca-python | ca9f0f078584f1458e71baeb4cd15fcc55b40397 | [
"MIT"
] | null | null | null | cuenca/resources/sessions.py | andreshndz/cuenca-python | ca9f0f078584f1458e71baeb4cd15fcc55b40397 | [
"MIT"
] | null | null | null | import datetime as dt
from typing import ClassVar, Optional, cast
from cuenca_validations.types import SessionRequest, SessionType
from pydantic import AnyUrl
from pydantic.dataclasses import dataclass
from .. import http
from .base import Creatable, Queryable, Retrievable
@dataclass
| 25.785714 | 74 | 0.660203 | import datetime as dt
from typing import ClassVar, Optional, cast
from cuenca_validations.types import SessionRequest, SessionType
from pydantic import AnyUrl
from pydantic.dataclasses import dataclass
from .. import http
from .base import Creatable, Queryable, Retrievable
@dataclass
class Session(Creatable, Retrie... | 456 | 316 | 22 |
8269437bef9cc43ad86c3a68364cb0485afec37e | 7,132 | py | Python | statsd_rabbitmq/utils.py | fake-name/statsd-rabbitmq | 2d6193862551085654f4e6a3b600e5dd6f86d37c | [
"Apache-2.0"
] | null | null | null | statsd_rabbitmq/utils.py | fake-name/statsd-rabbitmq | 2d6193862551085654f4e6a3b600e5dd6f86d37c | [
"Apache-2.0"
] | null | null | null | statsd_rabbitmq/utils.py | fake-name/statsd-rabbitmq | 2d6193862551085654f4e6a3b600e5dd6f86d37c | [
"Apache-2.0"
] | null | null | null | # -*- coding: iso-8859-15 -*-
# Copyright (c) 2014 The New York Times Company
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 31.982063 | 119 | 0.581884 | # -*- coding: iso-8859-15 -*-
# Copyright (c) 2014 The New York Times Company
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 1,960 | 0 | 216 |
400eaf28ca8f72e61fb7e5a13a81f9035fb62aca | 3,051 | py | Python | candidate_matching/benchmarks/CML/main.py | jimzhu/OpenCTR-benchmarks | e8e723cd7a0ef5ddd40e735b85ce7669955a3a99 | [
"Apache-2.0"
] | 59 | 2021-10-31T13:59:37.000Z | 2022-03-31T12:05:55.000Z | candidate_matching/benchmarks/CML/main.py | jimzhu/OpenCTR-benchmarks | e8e723cd7a0ef5ddd40e735b85ce7669955a3a99 | [
"Apache-2.0"
] | 5 | 2021-12-06T12:11:21.000Z | 2022-03-18T06:21:13.000Z | candidate_matching/benchmarks/CML/main.py | jimzhu/OpenCTR-benchmarks | e8e723cd7a0ef5ddd40e735b85ce7669955a3a99 | [
"Apache-2.0"
] | 17 | 2021-10-21T10:44:09.000Z | 2022-03-24T11:35:09.000Z | import sys
sys.path.append("../../external/CollMetric/")
import numpy as np
import tensorflow as tf
import os
from datetime import datetime
from sampler import WarpSampler
from CML_utils import Evaluator, Monitor, parse_args, dataset_to_uimatrix
from CML import CML, optimize
if __name__ == '__main__':
args = pars... | 44.867647 | 116 | 0.639135 | import sys
sys.path.append("../../external/CollMetric/")
import numpy as np
import tensorflow as tf
import os
from datetime import datetime
from sampler import WarpSampler
from CML_utils import Evaluator, Monitor, parse_args, dataset_to_uimatrix
from CML import CML, optimize
if __name__ == '__main__':
args = pars... | 0 | 0 | 0 |
04747478c722ad5dd0a34299f99bd45a70b0f364 | 404 | py | Python | Barras.py | ByronEncinas/Aprendo-Python | 4ab3fa6593ec75ce52139235014b53ff1c77f775 | [
"CC0-1.0"
] | null | null | null | Barras.py | ByronEncinas/Aprendo-Python | 4ab3fa6593ec75ce52139235014b53ff1c77f775 | [
"CC0-1.0"
] | null | null | null | Barras.py | ByronEncinas/Aprendo-Python | 4ab3fa6593ec75ce52139235014b53ff1c77f775 | [
"CC0-1.0"
] | null | null | null | import matplotlib.pyplot as plt
x = [1,2,3]
y = [1,2,1]
yerrormin = [0.1,0.5,0.9]
yerrormax = [0.2,0.4,0.6]
xerror = 0.5
yerror = [yerrormin, yerrormax]
plt.plot(x,y,'o')
plt.errorbar(x,y,yerr=yerror, xerr=xerror, fmt='o', ecolor='black',elinewidth=2, capsize=5,capthick=2, barsabove=False, errorevery=1, lolims=False... | 25.25 | 216 | 0.670792 | import matplotlib.pyplot as plt
x = [1,2,3]
y = [1,2,1]
yerrormin = [0.1,0.5,0.9]
yerrormax = [0.2,0.4,0.6]
xerror = 0.5
yerror = [yerrormin, yerrormax]
plt.plot(x,y,'o')
plt.errorbar(x,y,yerr=yerror, xerr=xerror, fmt='o', ecolor='black',elinewidth=2, capsize=5,capthick=2, barsabove=False, errorevery=1, lolims=False... | 0 | 0 | 0 |
6ecb57ef2a041c906a4a4705f0dce689c201b5c0 | 973 | py | Python | examples/capture_average.py | shiqi1994/EasyPySpin | 4b44745dfbf06a9790f166137de03a95a1ff7f62 | [
"MIT"
] | 47 | 2019-12-03T14:01:16.000Z | 2022-03-19T13:07:09.000Z | examples/capture_average.py | shiqi1994/EasyPySpin | 4b44745dfbf06a9790f166137de03a95a1ff7f62 | [
"MIT"
] | 6 | 2020-03-31T07:28:49.000Z | 2021-10-06T00:14:40.000Z | examples/capture_average.py | shiqi1994/EasyPySpin | 4b44745dfbf06a9790f166137de03a95a1ff7f62 | [
"MIT"
] | 10 | 2020-04-29T08:58:55.000Z | 2022-03-17T10:48:33.000Z | """
Example of capturing the average image width VideoCaptureEX class.
The averaged image can reduce random noise.
"""
import EasyPySpin
import cv2
if __name__ == "__main__":
main()
| 23.731707 | 66 | 0.567318 | """
Example of capturing the average image width VideoCaptureEX class.
The averaged image can reduce random noise.
"""
import EasyPySpin
import cv2
def main():
cap = EasyPySpin.VideoCaptureEX(0)
cap.average_num = 3
print("Press key to change average number")
print("k : average_num += 1")
print("j... | 761 | 0 | 23 |
49bd0217dfbd28b4282b652b446ae18299b6f397 | 2,036 | py | Python | ovn_octavia_provider/common/utils.py | wpexia/ovn-octavia-provider | e9bf916b928005ee232a637e5e49d829cc84f074 | [
"Apache-2.0"
] | 5 | 2020-02-24T13:25:50.000Z | 2021-11-20T11:33:02.000Z | ovn_octavia_provider/common/utils.py | openstack/ovn-octavia-provider | f257fc1a2411c22c07b6cf5b53fc86e5c8449b69 | [
"Apache-2.0"
] | null | null | null | ovn_octavia_provider/common/utils.py | openstack/ovn-octavia-provider | f257fc1a2411c22c07b6cf5b53fc86e5c8449b69 | [
"Apache-2.0"
] | 1 | 2021-11-29T14:18:33.000Z | 2021-11-29T14:18:33.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 39.153846 | 79 | 0.680747 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 754 | 0 | 46 |
38fb100fd5469fdaa8ba317319958d95e5d35297 | 220 | py | Python | 09_07_pr_03.py | Madhav2204/Python-vs-code | 6b845573f6e9f77cccf8f67913ad4de05da6593c | [
"Apache-2.0"
] | null | null | null | 09_07_pr_03.py | Madhav2204/Python-vs-code | 6b845573f6e9f77cccf8f67913ad4de05da6593c | [
"Apache-2.0"
] | null | null | null | 09_07_pr_03.py | Madhav2204/Python-vs-code | 6b845573f6e9f77cccf8f67913ad4de05da6593c | [
"Apache-2.0"
] | null | null | null |
for i in range(2, 21):
with open(f"tables/Multiplication_table_of_{i}.txt", 'w') as f:
for j in range(1, 11):
f.write(f"{i}X{j}={i*j}")
if j!=10:
f.write('\n')
| 27.5 | 68 | 0.45 |
for i in range(2, 21):
with open(f"tables/Multiplication_table_of_{i}.txt", 'w') as f:
for j in range(1, 11):
f.write(f"{i}X{j}={i*j}")
if j!=10:
f.write('\n')
| 0 | 0 | 0 |
7b0cad841a7189c7e9e46e0d48da08f50ba54688 | 3,675 | py | Python | agent/ip_traffic.py | irtlab/netmon | e85d342dd6b228db61cfffb20425f7e10f7f4d11 | [
"MIT"
] | null | null | null | agent/ip_traffic.py | irtlab/netmon | e85d342dd6b228db61cfffb20425f7e10f7f4d11 | [
"MIT"
] | 2 | 2021-10-10T18:53:56.000Z | 2021-10-10T18:57:55.000Z | agent/ip_traffic.py | irtlab/netmon | e85d342dd6b228db61cfffb20425f7e10f7f4d11 | [
"MIT"
] | null | null | null | """
Module Name:
ip_traffic.py
Description:
Module provides functionality to monitor IP traffic.
Authors:
Columbia University, the Internet Real-Time Lab (IRT Lab). 2018-2019.
"""
import random
import db
import utils
from scapy.all import sniff
from datetime import datetime
def run_ip_traffic_monitor(d... | 31.956522 | 138 | 0.690884 | """
Module Name:
ip_traffic.py
Description:
Module provides functionality to monitor IP traffic.
Authors:
Columbia University, the Internet Real-Time Lab (IRT Lab). 2018-2019.
"""
import random
import db
import utils
from scapy.all import sniff
from datetime import datetime
def run_ip_traffic_monitor(d... | 1,380 | 0 | 24 |
45506584e6b50e487886121cf454285748787970 | 8,378 | py | Python | iota_dust_manager/__init__.py | F-Node-Karlsruhe/iota-dust-manager | b84d89583536bd2e7408d7963468c29a02a36351 | [
"MIT"
] | null | null | null | iota_dust_manager/__init__.py | F-Node-Karlsruhe/iota-dust-manager | b84d89583536bd2e7408d7963468c29a02a36351 | [
"MIT"
] | null | null | null | iota_dust_manager/__init__.py | F-Node-Karlsruhe/iota-dust-manager | b84d89583536bd2e7408d7963468c29a02a36351 | [
"MIT"
] | null | null | null | """
iota-dust-manager
A thread safe, stateless python package that manages your receiving dust address.
"""
__version__ = "0.1.5"
__author__ = 'F-Node-Karlsruhe'
import iota_client
import threading
IOTA_DUST = 1_000_000
IOTA_PER_DUST_TRANSACTION = 100_000
class DustManager:
"""Create a DustManager.
:par... | 33.782258 | 128 | 0.602769 | """
iota-dust-manager
A thread safe, stateless python package that manages your receiving dust address.
"""
__version__ = "0.1.5"
__author__ = 'F-Node-Karlsruhe'
import iota_client
import threading
IOTA_DUST = 1_000_000
IOTA_PER_DUST_TRANSACTION = 100_000
class DustManager:
"""Create a DustManager.
:par... | 4,182 | 0 | 108 |
ac0689ffa4413658ea6462a8e44676b79cb4428e | 634 | py | Python | djsuperadmin/models.py | bnznamco/insuperadmin | 5817d8e46feeec757cc874485690e02600036a7c | [
"MIT"
] | 1 | 2019-04-30T15:21:24.000Z | 2019-04-30T15:21:24.000Z | djsuperadmin/models.py | bnznamco/insuperadmin | 5817d8e46feeec757cc874485690e02600036a7c | [
"MIT"
] | null | null | null | djsuperadmin/models.py | bnznamco/insuperadmin | 5817d8e46feeec757cc874485690e02600036a7c | [
"MIT"
] | null | null | null | from django.db import models
from hvad.models import TranslatableModel, TranslatedFields
from django.utils.translation import ugettext_lazy as _
| 26.416667 | 74 | 0.700315 | from django.db import models
from hvad.models import TranslatableModel, TranslatedFields
from django.utils.translation import ugettext_lazy as _
class BaseContent(TranslatableModel):
identifier = models.CharField(max_length=200)
translations = TranslatedFields(
permalink=models.CharField(max_length=20... | 28 | 413 | 46 |
891266c2049e537dbf28b17dc4743d6e9dcd1619 | 63 | py | Python | problem/10000~19999/16204/16204.py3.py | njw1204/BOJ-AC | 1de41685725ae4657a7ff94e413febd97a888567 | [
"MIT"
] | 1 | 2019-04-19T16:37:44.000Z | 2019-04-19T16:37:44.000Z | problem/10000~19999/16204/16204.py3.py | njw1204/BOJ-AC | 1de41685725ae4657a7ff94e413febd97a888567 | [
"MIT"
] | 1 | 2019-04-20T11:42:44.000Z | 2019-04-20T11:42:44.000Z | problem/10000~19999/16204/16204.py3.py | njw1204/BOJ-AC | 1de41685725ae4657a7ff94e413febd97a888567 | [
"MIT"
] | 3 | 2019-04-19T16:37:47.000Z | 2021-10-25T00:45:00.000Z | n,m,k=map(int,input().split())
a=min(m,k)+min(n-m,n-k)
print(a) | 21 | 30 | 0.603175 | n,m,k=map(int,input().split())
a=min(m,k)+min(n-m,n-k)
print(a) | 0 | 0 | 0 |
4a738775905b44c4112288962d7416fda215d917 | 19,031 | py | Python | tests/transformations/geo_relinking.py | kais-siala/wurst | 448dd4e9e0bfbde956c2913222222509ff2b14e1 | [
"BSD-2-Clause"
] | null | null | null | tests/transformations/geo_relinking.py | kais-siala/wurst | 448dd4e9e0bfbde956c2913222222509ff2b14e1 | [
"BSD-2-Clause"
] | null | null | null | tests/transformations/geo_relinking.py | kais-siala/wurst | 448dd4e9e0bfbde956c2913222222509ff2b14e1 | [
"BSD-2-Clause"
] | null | null | null | from wurst.transformations.geo import *
import pytest
@pytest.fixture(scope="function")
| 26.505571 | 82 | 0.305081 | from wurst.transformations.geo import *
import pytest
@pytest.fixture(scope="function")
def defaults():
data = [
{
"name": "A",
"reference product": "B",
"unit": "C",
"location": "SE",
"exchanges": [
{
"type": ... | 18,655 | 0 | 275 |
e3d1fbc0b4b3c9b4f0fa5d33b7fa14433aaefb99 | 28 | py | Python | reports/__init__.py | OdooTestNet/School-Mangement | 3c613a2ecdb88965d847acd294e70a875f5af5e2 | [
"Unlicense"
] | null | null | null | reports/__init__.py | OdooTestNet/School-Mangement | 3c613a2ecdb88965d847acd294e70a875f5af5e2 | [
"Unlicense"
] | null | null | null | reports/__init__.py | OdooTestNet/School-Mangement | 3c613a2ecdb88965d847acd294e70a875f5af5e2 | [
"Unlicense"
] | null | null | null | # from.import invoice_report | 28 | 28 | 0.857143 | # from.import invoice_report | 0 | 0 | 0 |
94a5bb68f3af932c62cbeb6c6ef25fd7ad126819 | 3,956 | py | Python | edapy/utils.py | Arc-rendezvous/edapy | a6d4b61dd97d320586afbc4fc51ed4ad112b453b | [
"Apache-2.0"
] | 1 | 2021-06-16T04:12:27.000Z | 2021-06-16T04:12:27.000Z | edapy/utils.py | Arc-rendezvous/edapy | a6d4b61dd97d320586afbc4fc51ed4ad112b453b | [
"Apache-2.0"
] | null | null | null | edapy/utils.py | Arc-rendezvous/edapy | a6d4b61dd97d320586afbc4fc51ed4ad112b453b | [
"Apache-2.0"
] | null | null | null | import numpy as np
import pandas as pd
def batch(l, b=1, n=None):
"""
Create batch from iterable.
Parameters
----------
l : list
list to create batches from
b : int, optional, [default = 1]
batch size
n : int, optional, [default = None]
if None: len(batches[-1]) < ... | 28.257143 | 81 | 0.471436 | import numpy as np
import pandas as pd
def batch(l, b=1, n=None):
"""
Create batch from iterable.
Parameters
----------
l : list
list to create batches from
b : int, optional, [default = 1]
batch size
n : int, optional, [default = None]
if None: len(batches[-1]) < ... | 1,503 | 0 | 46 |
7940d215729bb1d0d44578f29e286b297a252b4f | 3,737 | py | Python | autobot/handler/response/replymarkupbuilder.py | andreacioni/AutoBot | 6cfcaf3a36adf6ba15c93f517fbc08ac9f93b389 | [
"BSD-3-Clause"
] | 1 | 2019-05-16T10:08:35.000Z | 2019-05-16T10:08:35.000Z | autobot/handler/response/replymarkupbuilder.py | andreacioni/AutoBot | 6cfcaf3a36adf6ba15c93f517fbc08ac9f93b389 | [
"BSD-3-Clause"
] | null | null | null | autobot/handler/response/replymarkupbuilder.py | andreacioni/AutoBot | 6cfcaf3a36adf6ba15c93f517fbc08ac9f93b389 | [
"BSD-3-Clause"
] | 2 | 2018-12-24T23:51:28.000Z | 2019-05-16T15:53:56.000Z | import logging
from telegram import ReplyKeyboardMarkup, ReplyKeyboardRemove, KeyboardButton
from autobot import AutoBotConstants
from autobot.configuration import AutoBotConfig | 49.171053 | 145 | 0.630185 | import logging
from telegram import ReplyKeyboardMarkup, ReplyKeyboardRemove, KeyboardButton
from autobot import AutoBotConstants
from autobot.configuration import AutoBotConfig
class ReplyMarkupBuilder(object):
_logger = logging.getLogger(__name__)
@classmethod
def build_keyboard(cls, config, entr... | 0 | 3,535 | 23 |
258f55403b2af51184eef7df2d5ca098459ebf9d | 15,020 | py | Python | gluonnlp/data/stream.py | indhub/gluon-nlp | 15b1acfa3e126805b742770a73141b4ebdec0c10 | [
"Apache-2.0"
] | null | null | null | gluonnlp/data/stream.py | indhub/gluon-nlp | 15b1acfa3e126805b742770a73141b4ebdec0c10 | [
"Apache-2.0"
] | null | null | null | gluonnlp/data/stream.py | indhub/gluon-nlp | 15b1acfa3e126805b742770a73141b4ebdec0c10 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License... | 42.191011 | 100 | 0.621505 | # coding: utf-8
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License... | 6,416 | 0 | 291 |
f338190f82c8bacc5a16386a0b00eed7292b055a | 1,686 | py | Python | services_portal_site/middleware.py | cedadev/ceda-services-portal | 5c9637a598018f73fce05640e596b5ece3250382 | [
"BSD-3-Clause"
] | null | null | null | services_portal_site/middleware.py | cedadev/ceda-services-portal | 5c9637a598018f73fce05640e596b5ece3250382 | [
"BSD-3-Clause"
] | 38 | 2021-01-21T14:36:09.000Z | 2022-03-21T12:38:44.000Z | services_portal_site/middleware.py | cedadev/ceda-services-portal | 5c9637a598018f73fce05640e596b5ece3250382 | [
"BSD-3-Clause"
] | null | null | null | '''
Created on Oct 11, 2017
@author: William Tucker
'''
import logging
from django.conf import settings
from django.contrib.auth import logout, login, get_user_model
logger = logging.getLogger(__name__)
class LoginMiddleware():
"""
Middleware that checks for a valid login in the request
and logs the ... | 27.193548 | 79 | 0.596679 | '''
Created on Oct 11, 2017
@author: William Tucker
'''
import logging
from django.conf import settings
from django.contrib.auth import logout, login, get_user_model
logger = logging.getLogger(__name__)
class LoginMiddleware():
"""
Middleware that checks for a valid login in the request
and logs the ... | 1,296 | 0 | 54 |
eb6bd83eb366077f5703c83ef5e921b864665245 | 252 | py | Python | model/case/__init__.py | waaaaaaz/TestRelay2 | 220d85fb0f53e468c5216336147609d5337cfb1c | [
"MIT"
] | null | null | null | model/case/__init__.py | waaaaaaz/TestRelay2 | 220d85fb0f53e468c5216336147609d5337cfb1c | [
"MIT"
] | 1 | 2021-06-02T02:40:03.000Z | 2021-06-02T02:40:03.000Z | model/case/__init__.py | waaaaaaz/TestRelay2 | 220d85fb0f53e468c5216336147609d5337cfb1c | [
"MIT"
] | null | null | null | # coding: utf-8
from sqkb_api_testing.model.case.http_case import HttpCase
from sqkb_api_testing.model.case.mysql_case import MySQLCase
from sqkb_api_testing.model.case.rpc_case import RPCCase
from sqkb_api_testing.model.case.wait_case import WaitCase | 42 | 60 | 0.865079 | # coding: utf-8
from sqkb_api_testing.model.case.http_case import HttpCase
from sqkb_api_testing.model.case.mysql_case import MySQLCase
from sqkb_api_testing.model.case.rpc_case import RPCCase
from sqkb_api_testing.model.case.wait_case import WaitCase | 0 | 0 | 0 |
3d752da8179f9983b0c606bd89594a3cf8544e1c | 4,610 | py | Python | ctt-server/plugins/jmeter.py | pjakovits/radon-ctt | 8c73e05a83ef66bd6e9dba6608d2bee089df7e86 | [
"Apache-2.0"
] | null | null | null | ctt-server/plugins/jmeter.py | pjakovits/radon-ctt | 8c73e05a83ef66bd6e9dba6608d2bee089df7e86 | [
"Apache-2.0"
] | null | null | null | ctt-server/plugins/jmeter.py | pjakovits/radon-ctt | 8c73e05a83ef66bd6e9dba6608d2bee089df7e86 | [
"Apache-2.0"
] | null | null | null | import os
import requests
import shutil
import tempfile
from zipfile import ZipFile, ZIP_DEFLATED
from flask import current_app
name = 'JMeter'
plugin_name = 'jmeter'
plugin_type = 'radon.policies.testing.JMeterLoadTest'
"""
'SimpleJMeterLoadTest': {
'type': 'radon.policies.testing.JMeterLoadTest',
'properti... | 41.531532 | 119 | 0.680043 | import os
import requests
import shutil
import tempfile
from zipfile import ZipFile, ZIP_DEFLATED
from flask import current_app
name = 'JMeter'
plugin_name = 'jmeter'
plugin_type = 'radon.policies.testing.JMeterLoadTest'
"""
'SimpleJMeterLoadTest': {
'type': 'radon.policies.testing.JMeterLoadTest',
'properti... | 3,942 | 0 | 69 |
dfe5fdb549f6913a6b90b0e9c398de0445d239a1 | 2,418 | py | Python | built_ins/xml_bins.py | chainren/python-learn | 5e48e96c4bb212806b9ae0954fdb368abdcf9ba3 | [
"Apache-2.0"
] | null | null | null | built_ins/xml_bins.py | chainren/python-learn | 5e48e96c4bb212806b9ae0954fdb368abdcf9ba3 | [
"Apache-2.0"
] | 16 | 2020-02-12T03:09:30.000Z | 2022-03-12T00:08:59.000Z | built_ins/xml_bins.py | chainren/python-learn | 5e48e96c4bb212806b9ae0954fdb368abdcf9ba3 | [
"Apache-2.0"
] | null | null | null | # -- coding: utf-8 --
# xml解析 dom sax
from xml.parsers.expat import ParserCreate
from urllib import request
xml = r'''<?xml version="1.0"?>
<ol>
<li><a href="/python">Python</a></li>
<li><a href="/ruby">Ruby</a></li>
</ol>
'''
handler = DefaultSaxHandler()
parser = ParserCreate()
parser.StartElementHandler ... | 23.475728 | 134 | 0.607527 | # -- coding: utf-8 --
# xml解析 dom sax
from xml.parsers.expat import ParserCreate
from urllib import request
class DefaultSaxHandler(object):
def start_element(self, name, attrs):
print('sax:start_element:%s, attrs:%s' %(name, attrs))
def end_element(self, name):
print('sax:end_element:%s' % ... | 1,349 | 93 | 256 |
879fbfb71879d697b60e7abf15683720ef573ef0 | 3,213 | py | Python | src/hypertrace/agent/instrumentation/instrumentation_definitions.py | hypertrace/pythonagent | 283e18c61807f4ae653d147be9ff1424b0b0a6eb | [
"Apache-2.0"
] | 4 | 2021-05-19T16:16:26.000Z | 2022-01-16T04:48:43.000Z | src/hypertrace/agent/instrumentation/instrumentation_definitions.py | hypertrace/pythonagent | 283e18c61807f4ae653d147be9ff1424b0b0a6eb | [
"Apache-2.0"
] | 48 | 2021-04-27T07:25:48.000Z | 2021-08-30T21:27:27.000Z | src/hypertrace/agent/instrumentation/instrumentation_definitions.py | hypertrace/pythonagent | 283e18c61807f4ae653d147be9ff1424b0b0a6eb | [
"Apache-2.0"
] | null | null | null | '''this module acts as a driver for instrumentation definitions + application'''
import logging
FLASK_KEY = 'flask'
DJANGO_KEY = 'django'
GRPC_SERVER_KEY = 'grpc:server'
GRPC_CLIENT_KEY = 'grpc:client'
POSTGRESQL_KEY = 'postgresql'
MYSQL_KEY = 'mysql'
REQUESTS_KEY = 'requests'
AIOHTTP_CLIENT_KEY = 'aiohttp:client'
SU... | 43.418919 | 119 | 0.746343 | '''this module acts as a driver for instrumentation definitions + application'''
import logging
FLASK_KEY = 'flask'
DJANGO_KEY = 'django'
GRPC_SERVER_KEY = 'grpc:server'
GRPC_CLIENT_KEY = 'grpc:client'
POSTGRESQL_KEY = 'postgresql'
MYSQL_KEY = 'mysql'
REQUESTS_KEY = 'requests'
AIOHTTP_CLIENT_KEY = 'aiohttp:client'
SU... | 0 | 0 | 0 |
7d799aa3d0e6a6b58e9e084f9b26aba6cce72240 | 168 | py | Python | json1/algorithm.py | kyclark/configcode | ca060d5a6a00d64a277165302f90691067a9925e | [
"MIT"
] | null | null | null | json1/algorithm.py | kyclark/configcode | ca060d5a6a00d64a277165302f90691067a9925e | [
"MIT"
] | null | null | null | json1/algorithm.py | kyclark/configcode | ca060d5a6a00d64a277165302f90691067a9925e | [
"MIT"
] | null | null | null | import json
import os
| 18.666667 | 65 | 0.642857 | import json
import os
def config() -> dict:
file = os.path.join(os.path.dirname(__file__), 'config.json')
with open(file) as fh:
return json.load(fh)
| 122 | 0 | 23 |
beb0b9fb6641d9418708565ba7a98eed651a7f4a | 32 | py | Python | models/__init__.py | entn-at/pykaldi2 | a94503bb940b5671665d152f2773e78b73a631a3 | [
"MIT"
] | 3 | 2020-11-13T10:38:42.000Z | 2022-01-17T20:59:07.000Z | models/__init__.py | Diamondfan/pykaldi2 | 60b7f6cdd5b1c88fdeb302c5e1f13d5d92d2c83b | [
"MIT"
] | null | null | null | models/__init__.py | Diamondfan/pykaldi2 | 60b7f6cdd5b1c88fdeb302c5e1f13d5d92d2c83b | [
"MIT"
] | null | null | null | from . import lstm, transformer
| 16 | 31 | 0.78125 | from . import lstm, transformer
| 0 | 0 | 0 |
f4593a136b97d74fec18e88bcca01b09dbeef96e | 4,370 | py | Python | opaal/opaal/distributed/termination_detection.py | sen-uni-kn/tartar | 5148f8737ab39c09aa0ca4907b1af7c44cf8b8a0 | [
"MIT"
] | null | null | null | opaal/opaal/distributed/termination_detection.py | sen-uni-kn/tartar | 5148f8737ab39c09aa0ca4907b1af7c44cf8b8a0 | [
"MIT"
] | null | null | null | opaal/opaal/distributed/termination_detection.py | sen-uni-kn/tartar | 5148f8737ab39c09aa0ca4907b1af7c44cf8b8a0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
### BEGIN LICENSE
# Copyright (C) 2010 Mads Chr. Olesen <mchro@cs.aau.dk>
#This program is free software: you can redistribute it and/or modify it
#under the terms of the GNU General Public License version 3, as published
#by the Free Software Foundation.
#
#This program is distributed in the ... | 38.672566 | 127 | 0.670023 | # -*- coding: utf-8 -*-
### BEGIN LICENSE
# Copyright (C) 2010 Mads Chr. Olesen <mchro@cs.aau.dk>
#This program is free software: you can redistribute it and/or modify it
#under the terms of the GNU General Public License version 3, as published
#by the Free Software Foundation.
#
#This program is distributed in the ... | 2,626 | 0 | 215 |
525113a09e66f512f8fe22c9ef30a7225bfb764d | 2,144 | py | Python | alarmClock/windows/newAlarm.py | Eric-The-Read/alarmClock | 70623cac3f13de48c5eeeb8ed6264ad3a8d49f4e | [
"MIT"
] | null | null | null | alarmClock/windows/newAlarm.py | Eric-The-Read/alarmClock | 70623cac3f13de48c5eeeb8ed6264ad3a8d49f4e | [
"MIT"
] | null | null | null | alarmClock/windows/newAlarm.py | Eric-The-Read/alarmClock | 70623cac3f13de48c5eeeb8ed6264ad3a8d49f4e | [
"MIT"
] | null | null | null | import PySimpleGUI as sg
from alarmClock.clock import Clock
from alarmClock.settings import dayList, hourList, minuteList, periodList, clocks
def newAlarm():
'''Opens window to create a new alarm, and select days in which alarm plays.'''
layout = [
[
sg.Combo(hourList, size=(3, 1), key="-H... | 42.039216 | 134 | 0.507463 | import PySimpleGUI as sg
from alarmClock.clock import Clock
from alarmClock.settings import dayList, hourList, minuteList, periodList, clocks
def newAlarm():
'''Opens window to create a new alarm, and select days in which alarm plays.'''
layout = [
[
sg.Combo(hourList, size=(3, 1), key="-H... | 0 | 0 | 0 |
5f230d76e6828208abb98ffbb36828dc5533f469 | 1,463 | py | Python | main.py | Beatrix-droid/python_dev_jobs_web_scraper | 1f80a35e9d13a7629dbfc696b2e6afe86aa43951 | [
"MIT"
] | null | null | null | main.py | Beatrix-droid/python_dev_jobs_web_scraper | 1f80a35e9d13a7629dbfc696b2e6afe86aa43951 | [
"MIT"
] | null | null | null | main.py | Beatrix-droid/python_dev_jobs_web_scraper | 1f80a35e9d13a7629dbfc696b2e6afe86aa43951 | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup
import requests
import time
if __name__ == "__main__":
while True:
find_jobs()
time_wait = 10
time.sleep(time_wait*60)
print(f"waiting {time_wait} minutes")
| 26.6 | 73 | 0.656186 | from bs4 import BeautifulSoup
import requests
import time
def find_jobs():
html_text = requests.get("https://www.reed.co.uk/jobs/python-jobs").text
soup = BeautifulSoup(html_text, "lxml")
jobs = soup.find_all("article", class_="job-result")
for index, job in enumerate(jobs):
with open(f"job_posts/{index}.txt"... | 1,242 | 0 | 23 |
ca53f98bb5f19ad42d7c378a3606412b9abf292d | 84 | py | Python | pinpayments/tests/__init__.py | neon-jungle/django-pinpayments | ad8ac853f043e7291f2251c7afdf0e7f1df36915 | [
"Unlicense"
] | 11 | 2015-02-01T08:22:47.000Z | 2021-04-15T03:52:17.000Z | pinpayments/tests/__init__.py | neon-jungle/django-pinpayments | ad8ac853f043e7291f2251c7afdf0e7f1df36915 | [
"Unlicense"
] | 18 | 2015-01-18T03:43:44.000Z | 2021-07-04T22:46:29.000Z | pinpayments/tests/__init__.py | neon-jungle/django-pinpayments | ad8ac853f043e7291f2251c7afdf0e7f1df36915 | [
"Unlicense"
] | 7 | 2015-05-30T08:41:06.000Z | 2020-03-09T07:09:39.000Z | from pinpayments.tests.models import *
from pinpayments.tests.templatetags import *
| 28 | 44 | 0.833333 | from pinpayments.tests.models import *
from pinpayments.tests.templatetags import *
| 0 | 0 | 0 |
9a938c1d687d5da888500b5d97ff161b9267ea52 | 301 | py | Python | awesome_autodl/utils/__init__.py | yashsmehta/Awesome-AutoDL | 8c6b626a81398d71bbc8b8e28e13307279b8281e | [
"MIT"
] | null | null | null | awesome_autodl/utils/__init__.py | yashsmehta/Awesome-AutoDL | 8c6b626a81398d71bbc8b8e28e13307279b8281e | [
"MIT"
] | null | null | null | awesome_autodl/utils/__init__.py | yashsmehta/Awesome-AutoDL | 8c6b626a81398d71bbc8b8e28e13307279b8281e | [
"MIT"
] | null | null | null | ##################################################
# Copyright (c) Xuanyi Dong [GitHub D-X-Y], 2021 #
##################################################
from .yaml import load_yaml
from .yaml import dump_yaml
from .check import check_paper_and_correct_format
from .check import check_and_sort_by_date
| 37.625 | 50 | 0.534884 | ##################################################
# Copyright (c) Xuanyi Dong [GitHub D-X-Y], 2021 #
##################################################
from .yaml import load_yaml
from .yaml import dump_yaml
from .check import check_paper_and_correct_format
from .check import check_and_sort_by_date
| 0 | 0 | 0 |
740ad2507f559e8e3043d2519b7e72357833b1e8 | 40 | py | Python | ctaplot/io/__init__.py | vuillaut/CTAPLOT | 3a7757f6e2487806ca87e41fcd123ccfbd4b964c | [
"MIT"
] | 5 | 2018-07-03T16:13:29.000Z | 2021-02-22T13:59:57.000Z | ctaplot/io/__init__.py | vuillaut/CTAPLOT | 3a7757f6e2487806ca87e41fcd123ccfbd4b964c | [
"MIT"
] | 39 | 2020-03-10T16:52:45.000Z | 2022-01-26T14:13:40.000Z | ctaplot/io/__init__.py | vuillaut/CTAPLOT | 3a7757f6e2487806ca87e41fcd123ccfbd4b964c | [
"MIT"
] | 6 | 2019-11-22T10:01:23.000Z | 2021-09-20T12:32:34.000Z | from .io import *
from .dataset import * | 20 | 22 | 0.725 | from .io import *
from .dataset import * | 0 | 0 | 0 |
1fdf77585fd1a3f6d2f1ed1af3d89d4e505f2e73 | 112 | py | Python | archon/model/orders.py | tebzzz/archon | 5276e06ccc2e08e034473108a4dd8e36b6ba6078 | [
"MIT"
] | 78 | 2018-09-20T12:50:42.000Z | 2021-12-17T11:44:03.000Z | archon/model/orders.py | tebzzz/archon | 5276e06ccc2e08e034473108a4dd8e36b6ba6078 | [
"MIT"
] | 49 | 2018-11-18T16:58:27.000Z | 2019-09-29T18:41:51.000Z | archon/model/orders.py | tebzzz/archon | 5276e06ccc2e08e034473108a4dd8e36b6ba6078 | [
"MIT"
] | 21 | 2018-09-20T11:31:50.000Z | 2021-10-19T17:01:47.000Z |
ORDER_SIDE_BUY = "BUY"
ORDER_SIDE_SELL = "SELL"
BITMEX_ORDER_SIDE_BUY = "Buy"
BITMEX_ORDER_SIDE_SELL = "Sell" | 16 | 31 | 0.767857 |
ORDER_SIDE_BUY = "BUY"
ORDER_SIDE_SELL = "SELL"
BITMEX_ORDER_SIDE_BUY = "Buy"
BITMEX_ORDER_SIDE_SELL = "Sell" | 0 | 0 | 0 |
64a76364d75e50bdd41656b3feafc9d81e9fc40d | 748 | py | Python | helpers/PlotSolution.py | alonw/image-classifier-102 | f7b6415a7992fdb766d45f3200e49d0e8453bff8 | [
"MIT"
] | null | null | null | helpers/PlotSolution.py | alonw/image-classifier-102 | f7b6415a7992fdb766d45f3200e49d0e8453bff8 | [
"MIT"
] | null | null | null | helpers/PlotSolution.py | alonw/image-classifier-102 | f7b6415a7992fdb766d45f3200e49d0e8453bff8 | [
"MIT"
] | null | null | null | # TODO: Display an image along with the top 5 classes | 35.619048 | 78 | 0.680481 | # TODO: Display an image along with the top 5 classes
def plot_solution(image_path, model):
# Sets up our plot
plt.figure(figsize = (6,10))
ax = plt.subplot(2,1,1)
# Set up title
flower_num = image_path.split('/')[2]
title_ = cat_to_name[flower_num] # Calls dictionary for name
# Plot flower
... | 673 | 0 | 22 |
eeb847d7dfcb9a42c65709f96bd5a4de568765ca | 260 | py | Python | backend/apps/tags/handlers.py | brainless/sanctuary | 1d157b8e9105ee426d9ef8655623a4ef17ae0a37 | [
"MIT"
] | null | null | null | backend/apps/tags/handlers.py | brainless/sanctuary | 1d157b8e9105ee426d9ef8655623a4ef17ae0a37 | [
"MIT"
] | null | null | null | backend/apps/tags/handlers.py | brainless/sanctuary | 1d157b8e9105ee426d9ef8655623a4ef17ae0a37 | [
"MIT"
] | null | null | null | from typing import List
from fastapi import APIRouter
from .tags import tags
tags_router = APIRouter()
@tags_router.get("/", response_model=List[str])
async def list_tags():
"""
List of all tag slugs
:return: List[str]
"""
return tags
| 15.294118 | 47 | 0.676923 | from typing import List
from fastapi import APIRouter
from .tags import tags
tags_router = APIRouter()
@tags_router.get("/", response_model=List[str])
async def list_tags():
"""
List of all tag slugs
:return: List[str]
"""
return tags
| 0 | 0 | 0 |
2d66141a687845a166453cab40a540edfd8e9e5c | 6,037 | py | Python | tests/parser/test_nightscout.py | simli26/tconnectsync | 1314c4e6746e5943ed9cb601200cb28ff3361f6a | [
"MIT"
] | 47 | 2021-02-06T05:52:43.000Z | 2022-03-26T17:20:53.000Z | tests/parser/test_nightscout.py | simli26/tconnectsync | 1314c4e6746e5943ed9cb601200cb28ff3361f6a | [
"MIT"
] | 33 | 2021-03-15T22:36:47.000Z | 2022-03-18T13:06:30.000Z | tests/parser/test_nightscout.py | simli26/tconnectsync | 1314c4e6746e5943ed9cb601200cb28ff3361f6a | [
"MIT"
] | 37 | 2021-03-15T03:39:03.000Z | 2022-02-26T00:39:53.000Z | #!/usr/bin/env python3
import unittest
from tconnectsync.parser.nightscout import NightscoutEntry, InvalidBolusTypeException
if __name__ == '__main__':
unittest.main() | 30.80102 | 85 | 0.43134 | #!/usr/bin/env python3
import unittest
from tconnectsync.parser.nightscout import NightscoutEntry, InvalidBolusTypeException
class TestNightscoutEntry(unittest.TestCase):
def test_basal(self):
self.assertEqual(
NightscoutEntry.basal(
value=1.05,
duration_mins=30... | 5,593 | 24 | 246 |
118b4b521b479825d41beb93cab253c6bf9e76f8 | 2,040 | py | Python | model/DHS_resnext_back.py | lartpang/DHSNet-PyTorch | a0651b7086a895a3bb3663d15366afd47fc41f6d | [
"MIT"
] | 3 | 2019-10-23T04:30:03.000Z | 2020-10-27T03:17:52.000Z | model/DHS_resnext_back.py | lartpang/DHSNet-PyTorch | a0651b7086a895a3bb3663d15366afd47fc41f6d | [
"MIT"
] | null | null | null | model/DHS_resnext_back.py | lartpang/DHSNet-PyTorch | a0651b7086a895a3bb3663d15366afd47fc41f6d | [
"MIT"
] | 2 | 2019-05-19T03:27:04.000Z | 2020-09-24T09:29:16.000Z | import torch
import torch.nn.functional as F
from torch import nn
from model import ResNeXt101
| 29.142857 | 67 | 0.523529 | import torch
import torch.nn.functional as F
from torch import nn
from model import ResNeXt101
class R3Net(nn.Module):
def __init__(self, new_block):
super(R3Net, self).__init__()
self.upsample = lambda x: F.interpolate(
x, scale_factor=2, mode='nearest'
)
... | 2,049 | 2 | 80 |
b4921781a101064b578b45079ea65e008f3c4763 | 2,178 | py | Python | kerosene_mnist/main.py | banctilrobitaille/kerosene-mnist | 6f1f39c575e9b32df254b2ae9b1e7ff25ea99378 | [
"MIT"
] | null | null | null | kerosene_mnist/main.py | banctilrobitaille/kerosene-mnist | 6f1f39c575e9b32df254b2ae9b1e7ff25ea99378 | [
"MIT"
] | null | null | null | kerosene_mnist/main.py | banctilrobitaille/kerosene-mnist | 6f1f39c575e9b32df254b2ae9b1e7ff25ea99378 | [
"MIT"
] | null | null | null | import logging
import torchvision
from kerosene.config.parsers import YamlConfigurationParser
from kerosene.config.trainers import RunConfiguration
from kerosene.events import Event
from kerosene.events.handlers.console import PrintTrainingStatus, PrintModelTrainersStatus
from kerosene.events.handlers.visdom import Pl... | 51.857143 | 120 | 0.79798 | import logging
import torchvision
from kerosene.config.parsers import YamlConfigurationParser
from kerosene.config.trainers import RunConfiguration
from kerosene.events import Event
from kerosene.events.handlers.console import PrintTrainingStatus, PrintModelTrainersStatus
from kerosene.events.handlers.visdom import Pl... | 0 | 0 | 0 |
8169cad7f51c512b76782c551c8321dea37ccacf | 12,606 | py | Python | youtube-8m-ensemble/inference-pre-ensemble.py | wangheda/youtube-8m | 07e54b387ee027cb58b0c14f5eb7c88cfa516d58 | [
"Apache-2.0"
] | 196 | 2017-06-16T12:06:56.000Z | 2022-02-18T10:50:43.000Z | youtube-8m-ensemble/inference-pre-ensemble.py | wangheda/youtube-8m | 07e54b387ee027cb58b0c14f5eb7c88cfa516d58 | [
"Apache-2.0"
] | 5 | 2017-08-04T02:37:34.000Z | 2018-10-27T18:32:38.000Z | youtube-8m-ensemble/inference-pre-ensemble.py | wangheda/youtube-8m | 07e54b387ee027cb58b0c14f5eb7c88cfa516d58 | [
"Apache-2.0"
] | 71 | 2017-06-20T15:04:13.000Z | 2021-10-06T16:43:32.000Z | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 38.432927 | 138 | 0.682373 | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 7,514 | 0 | 115 |
34781f9f6c68c42580f01b8e1e3ecd122d840d09 | 736 | py | Python | code-slicer/joern/projects/octopus/python/octopus-tools/octopus/shelltool/ResultProcessor.py | bstee615/ReVeal | fc22d0d54a3a23d4e0bc45a249b7eea22749685e | [
"MIT"
] | 63 | 2020-09-24T07:51:45.000Z | 2022-03-24T03:34:43.000Z | code-slicer/joern/projects/octopus/python/octopus-tools/octopus/shelltool/ResultProcessor.py | smartcontract-detect-yzu/ReVeal | ca31b783384b4cdb09b69950e48f79fa0748ef1d | [
"MIT"
] | 16 | 2020-08-04T16:26:46.000Z | 2022-03-08T03:13:33.000Z | code-slicer/joern/projects/octopus/python/octopus-tools/octopus/shelltool/ResultProcessor.py | smartcontract-detect-yzu/ReVeal | ca31b783384b4cdb09b69950e48f79fa0748ef1d | [
"MIT"
] | 29 | 2020-09-08T17:27:07.000Z | 2022-03-31T22:32:39.000Z | #!/usr/bin/env python3
| 25.37931 | 53 | 0.535326 | #!/usr/bin/env python3
class BaseResultProcessor:
def __init__(self, result):
self.result = result
@staticmethod
def value(element,key):
prop = element['properties'].get(key,[])
if len(prop) == 0:
return None
return prop[0]['value']
@staticmethod
def id(e... | 463 | 177 | 72 |
4cc95b5f1eb7d150eba879c8c9c2bf603b7f95be | 39,673 | py | Python | upvote/gae/cron/bit9_syncing.py | farmersbusinessnetwork/upvote | a59653db40fabc43807e6f82cf68161fc50a7305 | [
"Apache-2.0"
] | null | null | null | upvote/gae/cron/bit9_syncing.py | farmersbusinessnetwork/upvote | a59653db40fabc43807e6f82cf68161fc50a7305 | [
"Apache-2.0"
] | 1 | 2018-11-06T20:51:36.000Z | 2018-11-06T20:51:36.000Z | upvote/gae/cron/bit9_syncing.py | farmersbusinessnetwork/upvote | a59653db40fabc43807e6f82cf68161fc50a7305 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 36.734259 | 113 | 0.729489 | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 5,012 | 124 | 357 |
1d7c053ab9249d12fae51a17d8280053c3c25c61 | 9,594 | py | Python | docker/src/clawpack-5.3.1/pyclaw/examples/euler_gravity_3d/visitHDF5XDMF.py | ian-r-rose/visualization | ed6d9fab95eb125e7340ab3fad3ed114ed3214af | [
"CC-BY-4.0"
] | 11 | 2017-01-04T18:19:48.000Z | 2021-02-21T01:46:33.000Z | docker/src/clawpack-5.3.1/pyclaw/examples/euler_gravity_3d/visitHDF5XDMF.py | ian-r-rose/visualization | ed6d9fab95eb125e7340ab3fad3ed114ed3214af | [
"CC-BY-4.0"
] | 8 | 2016-09-22T20:49:51.000Z | 2019-09-06T23:28:13.000Z | docker/src/clawpack-5.3.1/pyclaw/examples/euler_gravity_3d/visitHDF5XDMF.py | ian-r-rose/visualization | ed6d9fab95eb125e7340ab3fad3ed114ed3214af | [
"CC-BY-4.0"
] | 13 | 2016-09-22T20:20:06.000Z | 2020-07-13T14:48:32.000Z | #!/usr/bin/env python
# encoding: utf-8
"""
!-----------------------------------------------------------------------
! HDF5 and XDMF routines for creating output files for VisIt.
!-----------------------------------------------------------------------
"""
import os,sys
import h5py
from numpy import *
# Write a 2D HD... | 46.8 | 149 | 0.526579 | #!/usr/bin/env python
# encoding: utf-8
"""
!-----------------------------------------------------------------------
! HDF5 and XDMF routines for creating output files for VisIt.
!-----------------------------------------------------------------------
"""
import os,sys
import h5py
from numpy import *
# Write a 2D HD... | 8,764 | 0 | 154 |
037eba463814fc7430e8893db1753ffa0b4e0111 | 3,471 | py | Python | softnms_rotate.py | ZhangGongjie/Soft-NMS-for-Rotated-Rectangles | 52f274c16e68685f894ca0c5154a046ac658e490 | [
"MIT"
] | 16 | 2019-05-09T13:51:46.000Z | 2022-03-20T15:58:28.000Z | softnms_rotate.py | DefTruth/Soft-NMS-for-Rotated-Rectangles | 52f274c16e68685f894ca0c5154a046ac658e490 | [
"MIT"
] | null | null | null | softnms_rotate.py | DefTruth/Soft-NMS-for-Rotated-Rectangles | 52f274c16e68685f894ca0c5154a046ac658e490 | [
"MIT"
] | 2 | 2019-08-05T03:03:29.000Z | 2022-03-20T15:59:08.000Z | # -*- coding: utf-8 -*-
# Soft NMS for rotated rectangle, cpu implementation.
# Author: Gongjie Zhang
# GongjieZhang@ntu.edu.sg
# or GongjieZhang007@gmail.com
import numpy as np
import cv2
def softnms_rotate_cpu(boxes, scores, iou_threshold, final_threshold=0.001):
"""
:param boxes: format [x_c, y_c, w, h, t... | 30.447368 | 158 | 0.516854 | # -*- coding: utf-8 -*-
# Soft NMS for rotated rectangle, cpu implementation.
# Author: Gongjie Zhang
# GongjieZhang@ntu.edu.sg
# or GongjieZhang007@gmail.com
import numpy as np
import cv2
def softnms_rotate_cpu(boxes, scores, iou_threshold, final_threshold=0.001):
"""
:param boxes: format [x_c, y_c, w, h, t... | 0 | 0 | 0 |
54fbc656c3c2d700d937d8f62c82c50a0001ec0c | 2,289 | py | Python | SUMMARIZING-DATA-WITH-STATISTICS_Rajan_06Apr/code.py | rajan19933/ga-learner-dsmp-repo | c0b77164236b6f3f5cecd598351e557d9ed5d5a1 | [
"MIT"
] | null | null | null | SUMMARIZING-DATA-WITH-STATISTICS_Rajan_06Apr/code.py | rajan19933/ga-learner-dsmp-repo | c0b77164236b6f3f5cecd598351e557d9ed5d5a1 | [
"MIT"
] | null | null | null | SUMMARIZING-DATA-WITH-STATISTICS_Rajan_06Apr/code.py | rajan19933/ga-learner-dsmp-repo | c0b77164236b6f3f5cecd598351e557d9ed5d5a1 | [
"MIT"
] | null | null | null | # --------------
#Header files
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#path of the data file- path
data = pd.read_csv(path)
#Code starts here
data['Gender'] = data['Gender'].replace('-','Agender')
#print(data['Gender'])
gender_count = data['Gender'].value_counts()
#print(g... | 23.357143 | 88 | 0.691568 | # --------------
#Header files
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#path of the data file- path
data = pd.read_csv(path)
#Code starts here
data['Gender'] = data['Gender'].replace('-','Agender')
#print(data['Gender'])
gender_count = data['Gender'].value_counts()
#print(g... | 0 | 0 | 0 |
2fb7b7ee2bb27c9dd256235c93f0786ae6402924 | 1,570 | py | Python | setup.py | priya1puresoftware/jsons | 65092a0a99a89abb0bd1aa0e68a99e25b12d96c4 | [
"MIT"
] | null | null | null | setup.py | priya1puresoftware/jsons | 65092a0a99a89abb0bd1aa0e68a99e25b12d96c4 | [
"MIT"
] | null | null | null | setup.py | priya1puresoftware/jsons | 65092a0a99a89abb0bd1aa0e68a99e25b12d96c4 | [
"MIT"
] | null | null | null | import os
from setuptools import setup
here = os.path.abspath(os.path.dirname(__file__))
meta_info = {}
with open(os.path.join(here, 'jsons', '_package_info.py'), 'r') as f:
exec(f.read(), meta_info)
with open('README.md', 'r') as f:
long_description = f.read()
setup(
name=meta_info['__title__'],
ve... | 27.54386 | 69 | 0.589809 | import os
from setuptools import setup
here = os.path.abspath(os.path.dirname(__file__))
meta_info = {}
with open(os.path.join(here, 'jsons', '_package_info.py'), 'r') as f:
exec(f.read(), meta_info)
with open('README.md', 'r') as f:
long_description = f.read()
setup(
name=meta_info['__title__'],
ve... | 0 | 0 | 0 |
1dbb3a4ec307cc8e3bc972ba1ca885f05dc4e5f0 | 85 | py | Python | elabjournal/elabjournal/SamplesAndSeries.py | matthijsbrouwer/elabjournal-python | 4063b01993f0bf17ea2857009c1bedc5ace8b87b | [
"Apache-2.0"
] | 2 | 2021-06-29T11:17:27.000Z | 2022-01-11T18:41:49.000Z | elabjournal/elabjournal/SamplesAndSeries.py | matthijsbrouwer/elabjournal-python | 4063b01993f0bf17ea2857009c1bedc5ace8b87b | [
"Apache-2.0"
] | null | null | null | elabjournal/elabjournal/SamplesAndSeries.py | matthijsbrouwer/elabjournal-python | 4063b01993f0bf17ea2857009c1bedc5ace8b87b | [
"Apache-2.0"
] | 1 | 2019-06-06T13:23:11.000Z | 2019-06-06T13:23:11.000Z | from .eLABJournalPager import *
| 14.166667 | 41 | 0.788235 | from .eLABJournalPager import *
class SamplesAndSeries(eLABJournalPager):
pass | 0 | 30 | 23 |
923873e2632c557346e117fac64715848e5fd1d8 | 1,442 | py | Python | Toolbox/divide_and_conquer/inversions.py | felipe1120gomez/Data_Structures_and_Algorithms | 168e56f39201cadf375476a3bec976e99a391d4a | [
"MIT"
] | null | null | null | Toolbox/divide_and_conquer/inversions.py | felipe1120gomez/Data_Structures_and_Algorithms | 168e56f39201cadf375476a3bec976e99a391d4a | [
"MIT"
] | null | null | null | Toolbox/divide_and_conquer/inversions.py | felipe1120gomez/Data_Structures_and_Algorithms | 168e56f39201cadf375476a3bec976e99a391d4a | [
"MIT"
] | null | null | null | # Uses python3
import sys
def sort_list(left, right):
'''MergeSort(𝐴) returns a sorted array 𝐴 and the number of inversions in 𝐴.'''
sort_a = list()
count = 0
while left and right:
first_l = left[0]
first_r = right[0]
if first_l <= first_r:
sort_a.append(first_l... | 26.703704 | 82 | 0.613731 | # Uses python3
import sys
def sort_list(left, right):
'''MergeSort(𝐴) returns a sorted array 𝐴 and the number of inversions in 𝐴.'''
sort_a = list()
count = 0
while left and right:
first_l = left[0]
first_r = right[0]
if first_l <= first_r:
sort_a.append(first_l... | 0 | 0 | 0 |
8b149f8492a472a2de223f896423db1f86d6ef81 | 2,080 | py | Python | fss17/project/Utils/StatsUtils/CrossVal.py | rahlk/fss17 | 49e22c4ad01ff751f24c3e5702b7fa36a3a18e96 | [
"Apache-2.0"
] | null | null | null | fss17/project/Utils/StatsUtils/CrossVal.py | rahlk/fss17 | 49e22c4ad01ff751f24c3e5702b7fa36a3a18e96 | [
"Apache-2.0"
] | null | null | null | fss17/project/Utils/StatsUtils/CrossVal.py | rahlk/fss17 | 49e22c4ad01ff751f24c3e5702b7fa36a3a18e96 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function, division
from pdb import set_trace
import pandas as pd
from sklearn.model_selection import StratifiedKFold
from sklearn.model_selection import LeaveOneOut
from itertools import islice
| 31.044776 | 120 | 0.561058 | from __future__ import print_function, division
from pdb import set_trace
import pandas as pd
from sklearn.model_selection import StratifiedKFold
from sklearn.model_selection import LeaveOneOut
from itertools import islice
class TrainTestValidate:
def __init__(self):
pass
@classmeth... | 699 | 1,067 | 73 |
48b735ba732200fe4cd9410a128d4d624bbf2075 | 11,496 | py | Python | src/cnn/train.py | jordiae/DeepLearning-MAI | e12b6975d8de6cbe89f812bf691a7f7e95213552 | [
"MIT"
] | 1 | 2021-02-25T04:54:01.000Z | 2021-02-25T04:54:01.000Z | src/cnn/train.py | jordiae/DeepLearning-MAI | e12b6975d8de6cbe89f812bf691a7f7e95213552 | [
"MIT"
] | 2 | 2021-04-30T21:15:57.000Z | 2021-09-08T01:58:29.000Z | src/cnn/train.py | jordiae/DeepLearning-MAI | e12b6975d8de6cbe89f812bf691a7f7e95213552 | [
"MIT"
] | null | null | null | import torch
import argparse
import os
import logging
import torch.nn as nn
import torch.optim as optim
import albumentations as A
from albumentations.pytorch import ToTensorV2
from cnn.evaluate import evaluate, prettify_eval
from cnn.dataset import Mit67Dataset
import json
from torch.utils.tensorboard import SummaryWr... | 44.215385 | 117 | 0.592641 | import torch
import argparse
import os
import logging
import torch.nn as nn
import torch.optim as optim
import albumentations as A
from albumentations.pytorch import ToTensorV2
from cnn.evaluate import evaluate, prettify_eval
from cnn.dataset import Mit67Dataset
import json
from torch.utils.tensorboard import SummaryWr... | 10,989 | 0 | 46 |
10763705c0db7d612a40657e4801c6b4ce299bf8 | 4,238 | py | Python | thatkitebot/__main__.py | GalacticB69/thatkitebot | d07ca24d5906c504d4275e9efe1c0713510b8c44 | [
"MIT"
] | null | null | null | thatkitebot/__main__.py | GalacticB69/thatkitebot | d07ca24d5906c504d4275e9efe1c0713510b8c44 | [
"MIT"
] | null | null | null | thatkitebot/__main__.py | GalacticB69/thatkitebot | d07ca24d5906c504d4275e9efe1c0713510b8c44 | [
"MIT"
] | null | null | null | # ------------------------------------------------------------------------------
# MIT License
#
# Copyright (c) 2019-2021 ThatRedKite
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software with... | 35.024793 | 118 | 0.674611 | # ------------------------------------------------------------------------------
# MIT License
#
# Copyright (c) 2019-2021 ThatRedKite
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software with... | 1,004 | 11 | 76 |
69ed0b271779fcee5489802da70399ca9f7492eb | 35 | py | Python | s3_parquetifier/__init__.py | siakon89/s3-parquetifier | 48a8ff836779d4c22c357b0f4ce59d6a650f9dfa | [
"MIT"
] | 6 | 2019-04-22T18:33:06.000Z | 2022-02-16T18:47:18.000Z | s3_parquetifier/__init__.py | siakon89/s3-parquetifier | 48a8ff836779d4c22c357b0f4ce59d6a650f9dfa | [
"MIT"
] | 5 | 2019-05-30T11:06:43.000Z | 2021-06-25T15:36:42.000Z | s3_parquetifier/__init__.py | siakon89/s3-parquetifier | 48a8ff836779d4c22c357b0f4ce59d6a650f9dfa | [
"MIT"
] | 3 | 2019-04-23T09:23:21.000Z | 2022-02-16T18:47:19.000Z | from .models import S3Parquetifier
| 17.5 | 34 | 0.857143 | from .models import S3Parquetifier
| 0 | 0 | 0 |
7fa8560456f0f722c33e89eeccc198dfbfe6e7b2 | 3,910 | py | Python | Emotions/src/spark-queries.py | kksante/Earths_Emotion_Tracker | 49011d35dc875302851172b30755592c2b35ed4f | [
"Apache-2.0"
] | null | null | null | Emotions/src/spark-queries.py | kksante/Earths_Emotion_Tracker | 49011d35dc875302851172b30755592c2b35ed4f | [
"Apache-2.0"
] | null | null | null | Emotions/src/spark-queries.py | kksante/Earths_Emotion_Tracker | 49011d35dc875302851172b30755592c2b35ed4f | [
"Apache-2.0"
] | null | null | null | from pyspark import SparkContext, SparkConf
from pyspark.sql import SQLContext
from pyspark.sql.types import *
from pyspark.sql.functions import udf
from pyspark.sql.functions import col
from pyspark.sql.types import StringType, DoubleType, IntegerType
from abbreviations_dict import tofullname, toevent
from operator im... | 37.238095 | 108 | 0.592583 | from pyspark import SparkContext, SparkConf
from pyspark.sql import SQLContext
from pyspark.sql.types import *
from pyspark.sql.functions import udf
from pyspark.sql.functions import col
from pyspark.sql.types import StringType, DoubleType, IntegerType
from abbreviations_dict import tofullname, toevent
from operator im... | 196 | 0 | 69 |
9c6d398844e7f0a0aececa3d63321ff80550891b | 5,127 | py | Python | higgins/datasets/messaging_datasets.py | bfortuner/higgins | c8ab098c1496ee9b45efc3fc667d894d86031f67 | [
"MIT"
] | null | null | null | higgins/datasets/messaging_datasets.py | bfortuner/higgins | c8ab098c1496ee9b45efc3fc667d894d86031f67 | [
"MIT"
] | null | null | null | higgins/datasets/messaging_datasets.py | bfortuner/higgins | c8ab098c1496ee9b45efc3fc667d894d86031f67 | [
"MIT"
] | null | null | null | SEND_MESSAGE_DATASET_TRAIN = [
{
"query": "Text mom I love her",
"actions": [
{
"action": "SendMessage",
"params": {
"recipient": "mom",
"body": "I love her",
"application": "???"
... | 31.262195 | 152 | 0.401989 | SEND_MESSAGE_DATASET_TRAIN = [
{
"query": "Text mom I love her",
"actions": [
{
"action": "SendMessage",
"params": {
"recipient": "mom",
"body": "I love her",
"application": "???"
... | 0 | 0 | 0 |
accf4f94c1bf8bd6bc70f29aaae0873dee3797a9 | 707 | py | Python | examples/geomopt/01-geomeTRIC.py | pavanell/pyscf | c0d19e499685e95dbf4c879539ad3a3ceb6934e2 | [
"Apache-2.0"
] | 2 | 2019-05-28T05:25:56.000Z | 2019-11-09T02:16:43.000Z | examples/geomopt/01-geomeTRIC.py | pavanell/pyscf | c0d19e499685e95dbf4c879539ad3a3ceb6934e2 | [
"Apache-2.0"
] | 2 | 2019-09-16T17:58:31.000Z | 2019-09-22T17:26:01.000Z | examples/geomopt/01-geomeTRIC.py | pavanell/pyscf | c0d19e499685e95dbf4c879539ad3a3ceb6934e2 | [
"Apache-2.0"
] | 1 | 2019-11-09T02:13:16.000Z | 2019-11-09T02:13:16.000Z | #!/usr/bin/env python
'''
Use geomeTRIC library to optimize the molecular geometry.
'''
from pyscf import gto, scf
from pyscf.geomopt.geometric_solver import optimize
mol = gto.M(atom='N 0 0 0; N 0 0 1.2', basis='ccpvdz')
mf = scf.RHF(mol)
#
# geometry optimization for HF
#
mol_eq = optimize(mf)
print(mol_eq.atom_c... | 20.794118 | 57 | 0.680339 | #!/usr/bin/env python
'''
Use geomeTRIC library to optimize the molecular geometry.
'''
from pyscf import gto, scf
from pyscf.geomopt.geometric_solver import optimize
mol = gto.M(atom='N 0 0 0; N 0 0 1.2', basis='ccpvdz')
mf = scf.RHF(mol)
#
# geometry optimization for HF
#
mol_eq = optimize(mf)
print(mol_eq.atom_c... | 0 | 0 | 0 |
2ddc2c560b265ea8691154025e3045e9c0599aa7 | 3,110 | py | Python | ppmessage/core/utils/randomidenticon.py | gamert/ppmessage | dd4aaf29154679a093b2431d5e34af889ab16932 | [
"Apache-2.0"
] | 6 | 2017-11-03T17:31:52.000Z | 2020-06-14T09:14:36.000Z | ppmessage/core/utils/randomidenticon.py | gamert/ppmessage | dd4aaf29154679a093b2431d5e34af889ab16932 | [
"Apache-2.0"
] | 1 | 2017-02-21T01:07:22.000Z | 2017-04-07T04:48:02.000Z | ppmessage/core/utils/randomidenticon.py | gamert/ppmessage | dd4aaf29154679a093b2431d5e34af889ab16932 | [
"Apache-2.0"
] | 16 | 2017-08-08T01:25:47.000Z | 2019-09-17T16:32:06.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2010-2016 PPMessage.
# Guijin Ding, dingguijin@gmail.com.
# All rights reserved.
#
# core/utils/randomidenticon.py
#
import os
import json
import logging
IDENTICON_PPMESSAGE_STORE = True
_global_random_identicon_list = None
if __name__ == "__main__":
print(random_identi... | 28.272727 | 100 | 0.70836 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2010-2016 PPMessage.
# Guijin Ding, dingguijin@gmail.com.
# All rights reserved.
#
# core/utils/randomidenticon.py
#
import os
import json
import logging
IDENTICON_PPMESSAGE_STORE = True
_global_random_identicon_list = None
def _ppmessage_identicon_prefix(_string):
from... | 2,502 | 0 | 258 |
f5a013fee13c4f1ea41cca392174e431d5c5dad5 | 184 | py | Python | Functions/Global Variable/Global.py | Adi-19/Python | 734b5c4c1008233f93a18a500dd47d03583c52be | [
"MIT"
] | null | null | null | Functions/Global Variable/Global.py | Adi-19/Python | 734b5c4c1008233f93a18a500dd47d03583c52be | [
"MIT"
] | null | null | null | Functions/Global Variable/Global.py | Adi-19/Python | 734b5c4c1008233f93a18a500dd47d03583c52be | [
"MIT"
] | 1 | 2020-10-07T08:51:00.000Z | 2020-10-07T08:51:00.000Z | var = "Good"
show()
print("outside function var1 is ", var1)
print("var is ",var)
| 16.727273 | 41 | 0.570652 | var = "Good"
def show():
global var1
var1 = "morning"
print("In function var is", var)
show()
print("outside function var1 is ", var1)
print("var is ",var)
| 67 | 0 | 23 |
65eb7be400705909dd0ab0d284dc05e7d8a8441c | 8,625 | py | Python | npc_engine/server/control_service.py | npc-engine/npc-engine | 0047794e96369c23515f794a1e77009c516a382c | [
"MIT"
] | 12 | 2021-11-10T21:03:19.000Z | 2022-03-21T21:55:34.000Z | npc_engine/server/control_service.py | npc-engine/npc-engine | 0047794e96369c23515f794a1e77009c516a382c | [
"MIT"
] | 1 | 2021-12-05T14:51:44.000Z | 2021-12-05T14:51:44.000Z | npc_engine/server/control_service.py | npc-engine/npc-engine | 0047794e96369c23515f794a1e77009c516a382c | [
"MIT"
] | null | null | null | """Module that implements control service."""
from multiprocessing import Process
import asyncio
import json
import zmq
import zmq.asyncio
from npc_engine import services
from npc_engine.server.metadata_manager import MetadataManager
from jsonrpc import JSONRPCResponseManager, Dispatcher
from loguru import l... | 39.383562 | 93 | 0.606029 | """Module that implements control service."""
from multiprocessing import Process
import asyncio
import json
import zmq
import zmq.asyncio
from npc_engine import services
from npc_engine.server.metadata_manager import MetadataManager
from jsonrpc import JSONRPCResponseManager, Dispatcher
from loguru import l... | 0 | 0 | 0 |
072340015e4276671f71e15e65e1bff755ea7a74 | 4,133 | py | Python | contrib/inventory/vagrant.py | Container-Projects/ansible-provider-docs | 100b695b0b0c4d8d08af362069557ffc735d0d7e | [
"PSF-2.0",
"BSD-2-Clause",
"MIT"
] | 37 | 2017-08-15T15:02:43.000Z | 2021-07-23T03:44:31.000Z | contrib/inventory/vagrant.py | Container-Projects/ansible-provider-docs | 100b695b0b0c4d8d08af362069557ffc735d0d7e | [
"PSF-2.0",
"BSD-2-Clause",
"MIT"
] | 12 | 2018-01-10T05:25:25.000Z | 2021-11-28T06:55:48.000Z | contrib/inventory/vagrant.py | Container-Projects/ansible-provider-docs | 100b695b0b0c4d8d08af362069557ffc735d0d7e | [
"PSF-2.0",
"BSD-2-Clause",
"MIT"
] | 49 | 2017-08-15T09:52:13.000Z | 2022-03-21T17:11:54.000Z | #!/usr/bin/env python
"""
Vagrant external inventory script. Automatically finds the IP of the booted vagrant vm(s), and
returns it under the host group 'vagrant'
Example Vagrant configuration using this script:
config.vm.provision :ansible do |ansible|
ansible.playbook = "./provision/your_playbook.yml"
... | 30.614815 | 112 | 0.676264 | #!/usr/bin/env python
"""
Vagrant external inventory script. Automatically finds the IP of the booted vagrant vm(s), and
returns it under the host group 'vagrant'
Example Vagrant configuration using this script:
config.vm.provision :ansible do |ansible|
ansible.playbook = "./provision/your_playbook.yml"
... | 374 | 0 | 44 |
9c565f64c6d04ccc5d1c5457f4cf3faae6c884f1 | 2,903 | py | Python | examples/language_model/gpt/predict.py | JeremyZhao1998/PaddleNLP | 5a34684a7f0c8a186043fed386be4b62cb85fb15 | [
"Apache-2.0"
] | 7,091 | 2021-02-05T13:56:25.000Z | 2022-03-31T11:42:50.000Z | examples/language_model/gpt/predict.py | JeremyZhao1998/PaddleNLP | 5a34684a7f0c8a186043fed386be4b62cb85fb15 | [
"Apache-2.0"
] | 844 | 2021-02-10T01:09:29.000Z | 2022-03-31T12:12:58.000Z | examples/language_model/gpt/predict.py | JeremyZhao1998/PaddleNLP | 5a34684a7f0c8a186043fed386be4b62cb85fb15 | [
"Apache-2.0"
] | 1,035 | 2021-02-05T14:26:48.000Z | 2022-03-31T11:42:57.000Z | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
# Copyright (c) 2020 TsinghuaAI Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses... | 35.839506 | 94 | 0.68102 | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
# Copyright (c) 2020 TsinghuaAI Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses... | 1,278 | -10 | 154 |
919f8645cec215ba1b51f210805ac9085cc7dbd3 | 17,200 | py | Python | tools/compbio/dotknot/mwis.py | PeterKoza/Galaxy-fmfi | 2c201b7cca694905412452a707ec69b2111f72c7 | [
"CC-BY-3.0"
] | null | null | null | tools/compbio/dotknot/mwis.py | PeterKoza/Galaxy-fmfi | 2c201b7cca694905412452a707ec69b2111f72c7 | [
"CC-BY-3.0"
] | null | null | null | tools/compbio/dotknot/mwis.py | PeterKoza/Galaxy-fmfi | 2c201b7cca694905412452a707ec69b2111f72c7 | [
"CC-BY-3.0"
] | null | null | null | """
DotKnot: software for RNA pseudoknot prediction
Copyright (C) 2010-2011 Jana Sperschneider
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the L... | 50.292398 | 184 | 0.552674 | """
DotKnot: software for RNA pseudoknot prediction
Copyright (C) 2010-2011 Jana Sperschneider
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the L... | 0 | 0 | 0 |
08394270021b47ba07ca3670928bf58c6f8e4d7d | 5,760 | py | Python | COMET/misc_plugins/TelegramResponderPlugins/RaspberryPiPlugins.py | dallaval5u/COMET | 8c5793faafe2797dd4100507aa0fe1e71cf9f6c0 | [
"MIT"
] | null | null | null | COMET/misc_plugins/TelegramResponderPlugins/RaspberryPiPlugins.py | dallaval5u/COMET | 8c5793faafe2797dd4100507aa0fe1e71cf9f6c0 | [
"MIT"
] | null | null | null | COMET/misc_plugins/TelegramResponderPlugins/RaspberryPiPlugins.py | dallaval5u/COMET | 8c5793faafe2797dd4100507aa0fe1e71cf9f6c0 | [
"MIT"
] | null | null | null | import re, os
def do_get_light_config(value, TelegramResponder):
"""Light? - Gives you the possible light configurations"""
for val in value.values():
if val.strip() == "Light?":
if (
"433MHz_Transiever"
in TelegramResponder.main.default_values_dict["setting... | 43.308271 | 85 | 0.448785 | import re, os
def do_get_light_config(value, TelegramResponder):
"""Light? - Gives you the possible light configurations"""
for val in value.values():
if val.strip() == "Light?":
if (
"433MHz_Transiever"
in TelegramResponder.main.default_values_dict["setting... | 0 | 0 | 0 |
22604bd2360d68fb2805721ecafb4bc2248fa39e | 1,778 | py | Python | master/test_master.py | moon657/IEEE1588-PTP | 0d52eebb893d194b09842985dbbfe66740a71e0e | [
"MIT"
] | 1 | 2017-05-12T03:10:56.000Z | 2017-05-12T03:10:56.000Z | master/test_master.py | moon657/IEEE1588-PTP | 0d52eebb893d194b09842985dbbfe66740a71e0e | [
"MIT"
] | null | null | null | master/test_master.py | moon657/IEEE1588-PTP | 0d52eebb893d194b09842985dbbfe66740a71e0e | [
"MIT"
] | null | null | null | #-------------------------------------------------------------------------------
# Name: Raspberry Pi Socket Client
# Purpose:
#
# Author: Vaibhav
#
# Created: 20/08/2014
# Copyright: (c) Vaibhav 2014
# Licence: <your licence>
#-------------------------------------------------------------... | 25.4 | 81 | 0.556243 | #-------------------------------------------------------------------------------
# Name: Raspberry Pi Socket Client
# Purpose:
#
# Author: Vaibhav
#
# Created: 20/08/2014
# Copyright: (c) Vaibhav 2014
# Licence: <your licence>
#-------------------------------------------------------------... | 1,089 | 0 | 103 |
d81dc5d957479d6adb2759654e5e7c34d411e4cc | 4,780 | py | Python | FaedoGuerraBot.py | Delfad0r/faedo-guerra-bot | 9a1318d48bb7eaab63bbffa5ef68e9076146d9ad | [
"Apache-2.0"
] | 1 | 2019-05-22T12:49:06.000Z | 2019-05-22T12:49:06.000Z | FaedoGuerraBot.py | Delfad0r/faedo-guerra-bot | 9a1318d48bb7eaab63bbffa5ef68e9076146d9ad | [
"Apache-2.0"
] | null | null | null | FaedoGuerraBot.py | Delfad0r/faedo-guerra-bot | 9a1318d48bb7eaab63bbffa5ef68e9076146d9ad | [
"Apache-2.0"
] | null | null | null | import copy
import getpass
import numpy as np
import pickle
import time
import shutil
import subprocess
import os
import random
import sys
from FGBconstants import *
import game_engine, game_graphics, telegram_bot, report
channel_name = '@FaedoGuerraBotChannel'
print('Username UZ: ', end = '')
username = input()
pa... | 40.854701 | 211 | 0.669456 | import copy
import getpass
import numpy as np
import pickle
import time
import shutil
import subprocess
import os
import random
import sys
from FGBconstants import *
import game_engine, game_graphics, telegram_bot, report
channel_name = '@FaedoGuerraBotChannel'
def upload_image_ssh(src, dest):
global username, ... | 3,160 | 0 | 244 |
37ad5f842b5780cbb5a3acccbecc643655c2e5de | 47 | py | Python | __init__.py | yinziyan1206/nado_utils | ab73776945ded94d86f632750514fae448e98a60 | [
"MIT"
] | null | null | null | __init__.py | yinziyan1206/nado_utils | ab73776945ded94d86f632750514fae448e98a60 | [
"MIT"
] | null | null | null | __init__.py | yinziyan1206/nado_utils | ab73776945ded94d86f632750514fae448e98a60 | [
"MIT"
] | null | null | null | __author__ = 'ziyan.yin'
__version__ = '1.0.2'
| 15.666667 | 24 | 0.680851 | __author__ = 'ziyan.yin'
__version__ = '1.0.2'
| 0 | 0 | 0 |
9b265a1e330bee9dec50c80efb85d5e768e5e6a9 | 564 | py | Python | tests/test_kicad_io.py | SAFedorov/bfieldtools | 7e64bc2033670f01d2b90df2210b60743731a948 | [
"BSD-3-Clause"
] | 17 | 2020-05-22T19:39:39.000Z | 2022-03-15T19:03:09.000Z | tests/test_kicad_io.py | SAFedorov/bfieldtools | 7e64bc2033670f01d2b90df2210b60743731a948 | [
"BSD-3-Clause"
] | 27 | 2020-05-20T14:22:41.000Z | 2022-01-10T18:30:12.000Z | tests/test_kicad_io.py | SAFedorov/bfieldtools | 7e64bc2033670f01d2b90df2210b60743731a948 | [
"BSD-3-Clause"
] | 8 | 2020-08-12T10:30:50.000Z | 2022-03-22T12:21:33.000Z | import numpy as np
import os
from bfieldtools import kicad_io
from bfieldtools.utils import load_example_mesh
from .test_mesh_conductor import _fake_mesh_conductor, _fake_streamfunction
import pytest
| 19.448276 | 75 | 0.661348 | import numpy as np
import os
from bfieldtools import kicad_io
from bfieldtools.utils import load_example_mesh
from .test_mesh_conductor import _fake_mesh_conductor, _fake_streamfunction
import pytest
def test_kicad_io():
s = _fake_streamfunction()
c = s.mesh_conductor
lp = s.discretize(6)
kicad_i... | 338 | 0 | 23 |
aef7b74fb803248391c3a1f3bd1810d91cef610d | 1,991 | py | Python | unsorted_map.py | carlb15/Python | fa58835d532126c4cfb0baf4cb8d9d8a0e2703d2 | [
"MIT"
] | 2 | 2017-05-04T05:44:24.000Z | 2019-09-29T23:32:28.000Z | unsorted_map.py | carlb15/Python | fa58835d532126c4cfb0baf4cb8d9d8a0e2703d2 | [
"MIT"
] | null | null | null | unsorted_map.py | carlb15/Python | fa58835d532126c4cfb0baf4cb8d9d8a0e2703d2 | [
"MIT"
] | null | null | null | """Unsorted Table Map Implementation."""
from MapBase import MapBase
class UnsortedTableMap(MapBase):
"""
Class that relies on storing key-value pairs in
arbitrary order within a Python list.
"""
def __init__(self):
"""Initialize the unsorted list."""
self._table = []
def __getitem__(self, k):... | 20.739583 | 64 | 0.607233 | """Unsorted Table Map Implementation."""
from MapBase import MapBase
class UnsortedTableMap(MapBase):
"""
Class that relies on storing key-value pairs in
arbitrary order within a Python list.
"""
def __init__(self):
"""Initialize the unsorted list."""
self._table = []
def __getitem__(self, k):... | 0 | 0 | 0 |
67b80703825e3ad040cdcf72d8dd2707ed85b70d | 3,447 | py | Python | SVM/Kernel.py | ruiyuanlu/MachineLearningImplementation | 22f3d6869b5a1cb48dd8db4388420ad3e3ef7aa6 | [
"MIT"
] | null | null | null | SVM/Kernel.py | ruiyuanlu/MachineLearningImplementation | 22f3d6869b5a1cb48dd8db4388420ad3e3ef7aa6 | [
"MIT"
] | null | null | null | SVM/Kernel.py | ruiyuanlu/MachineLearningImplementation | 22f3d6869b5a1cb48dd8db4388420ad3e3ef7aa6 | [
"MIT"
] | null | null | null | # coding=utf8
import warnings
import numpy as np
class AbstractSVMKernel(object):
'''
核函数类的基类, 计算核函数与内积
'''
class LinearKernel(AbstractSVMKernel):
'''
线性核函数类
np.dot(xi.T, xj)
'''
def __call__(self, xi, xj):
'''
线性核内积
np.dot(xi, xj.T)
... | 25.533333 | 87 | 0.504497 | # coding=utf8
import warnings
import numpy as np
class AbstractSVMKernel(object):
'''
核函数类的基类, 计算核函数与内积
'''
def __init__(self, **kernel_params):
pass
def __call__(self, xi, xj):
raise NotImplementedError('Abstract inner product not implemented.')
class LinearK... | 116 | 0 | 58 |
441a8d4e7996ca131605bce7abc1d8fc46307eb1 | 2,331 | py | Python | rest/blog/articles/models.py | PatrickCmd/GraphQL-and-REST | bb6fc674396b795ed01a497e74194b67a860db33 | [
"MIT"
] | null | null | null | rest/blog/articles/models.py | PatrickCmd/GraphQL-and-REST | bb6fc674396b795ed01a497e74194b67a860db33 | [
"MIT"
] | null | null | null | rest/blog/articles/models.py | PatrickCmd/GraphQL-and-REST | bb6fc674396b795ed01a497e74194b67a860db33 | [
"MIT"
] | null | null | null | from datetime import datetime
from blog import db
| 29.884615 | 78 | 0.642643 | from datetime import datetime
from blog import db
class Category(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String, nullable=False)
description = db.Column(db.Text, nullable=True)
def __init__(self, name, description=None):
self.name = name
self.desc... | 1,061 | 1,171 | 46 |
6cdfba992a8dacb54f15f2c59663fef80bde65af | 3,457 | py | Python | datasets/TwoByTwoLines.py | rist-ro/argo | a10c33346803239db8a64c104db7f22ec4e05bef | [
"MIT"
] | 4 | 2020-12-07T19:13:13.000Z | 2022-01-30T18:52:18.000Z | datasets/TwoByTwoLines.py | rist-ro/argo | a10c33346803239db8a64c104db7f22ec4e05bef | [
"MIT"
] | 12 | 2020-09-25T22:41:28.000Z | 2022-02-09T23:46:34.000Z | datasets/TwoByTwoLines.py | rist-ro/argo | a10c33346803239db8a64c104db7f22ec4e05bef | [
"MIT"
] | 2 | 2021-03-02T18:31:04.000Z | 2021-03-02T21:56:43.000Z | """
Module for managing the IRIS dataset
"""
import numpy as np
from .Dataset import Dataset
DATASET_SIZE = 15
class TwoByTwoLines(Dataset):
"""
This class manage the dataset
, properties of the datasets are uniquely determined
by the params dictionary
It compares the parameters and complete t... | 27.436508 | 93 | 0.590686 | """
Module for managing the IRIS dataset
"""
import numpy as np
from .Dataset import Dataset
DATASET_SIZE = 15
class TwoByTwoLines(Dataset):
"""
This class manage the dataset
, properties of the datasets are uniquely determined
by the params dictionary
It compares the parameters and complete t... | 2,069 | 0 | 158 |
cf43d88fc6b28ffb7a079c719c1e349f03cbb446 | 2,081 | py | Python | qcodes/widgets/sidebar_widget/sidebar_widget.py | nulinspiratie/Qcodes | d050d38ac83f532523a39549c3247dfa6096a36e | [
"MIT"
] | 2 | 2017-02-27T06:02:39.000Z | 2019-06-03T04:56:59.000Z | qcodes/widgets/sidebar_widget/sidebar_widget.py | nulinspiratie/Qcodes | d050d38ac83f532523a39549c3247dfa6096a36e | [
"MIT"
] | 50 | 2017-04-12T04:03:15.000Z | 2022-03-09T00:41:43.000Z | qcodes/widgets/sidebar_widget/sidebar_widget.py | nulinspiratie/Qcodes | d050d38ac83f532523a39549c3247dfa6096a36e | [
"MIT"
] | null | null | null | import atexit
from IPython.display import display
from ipywidgets.widgets import *
from traitlets import Unicode, List, Bool, Int, Dict
from qcodes.widgets import display_auto
| 29.309859 | 67 | 0.674195 | import atexit
from IPython.display import display
from ipywidgets.widgets import *
from traitlets import Unicode, List, Bool, Int, Dict
from qcodes.widgets import display_auto
class SidebarWidget(DOMWidget):
_view_name = Unicode('SidebarView').tag(sync=True)
_view_module = Unicode('sidebar').tag(sync=True)... | 1,074 | 804 | 23 |
485cad4ffcc5f0b345efb170b142918fceded062 | 189 | py | Python | Lesson9/programming_lang.py | shinkai-tester/python_beginner | a934328c9a50241cc3f02a423060e16aab53b425 | [
"Apache-2.0"
] | 2 | 2021-06-01T13:24:04.000Z | 2021-06-01T13:27:47.000Z | Lesson9/programming_lang.py | shinkai-tester/python_beginner | a934328c9a50241cc3f02a423060e16aab53b425 | [
"Apache-2.0"
] | null | null | null | Lesson9/programming_lang.py | shinkai-tester/python_beginner | a934328c9a50241cc3f02a423060e16aab53b425 | [
"Apache-2.0"
] | null | null | null | N = int(input())
lang = set(input().split())
one = set(lang)
alll = set(lang)
for i in range(N - 1):
lang = set(input().split())
one |= lang
alll &= lang
print(alll)
print(one) | 17.181818 | 31 | 0.57672 | N = int(input())
lang = set(input().split())
one = set(lang)
alll = set(lang)
for i in range(N - 1):
lang = set(input().split())
one |= lang
alll &= lang
print(alll)
print(one) | 0 | 0 | 0 |
dc292b2fc1a41eabb71fc274884841527fb8c7fd | 5,264 | py | Python | pkr/environment.py | splisson-altair/pkr | be2135a8eec96e8ede0d47536aaac9872cf60edd | [
"Apache-2.0"
] | null | null | null | pkr/environment.py | splisson-altair/pkr | be2135a8eec96e8ede0d47536aaac9872cf60edd | [
"Apache-2.0"
] | null | null | null | pkr/environment.py | splisson-altair/pkr | be2135a8eec96e8ede0d47536aaac9872cf60edd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright© 1986-2018 Altair Engineering Inc.
"""Module with the pkr environment"""
import yaml
from builtins import object
from .utils import HashableDict, ensure_definition_matches, get_pkr_path, merge
ENV_FOLDER = 'env'
class Environment(object):
"""Class for loading and holding pk... | 30.08 | 79 | 0.590995 | # -*- coding: utf-8 -*-
# Copyright© 1986-2018 Altair Engineering Inc.
"""Module with the pkr environment"""
import yaml
from builtins import object
from .utils import HashableDict, ensure_definition_matches, get_pkr_path, merge
ENV_FOLDER = 'env'
class Environment(object):
"""Class for loading and holding pk... | 896 | 0 | 81 |
fde68e3b33daa8bcf6c0783cf0106af348d1c158 | 743 | py | Python | tests/test_core.py | sugatoray/genespeak | c3f57ad9fbedd5845fd279adcd83826b9a32e952 | [
"MIT"
] | 5 | 2022-01-16T12:12:09.000Z | 2022-03-11T23:17:43.000Z | tests/test_core.py | sugatoray/genespeak | c3f57ad9fbedd5845fd279adcd83826b9a32e952 | [
"MIT"
] | 3 | 2022-01-21T05:00:18.000Z | 2022-01-30T10:00:30.000Z | tests/test_core.py | sugatoray/genespeak | c3f57ad9fbedd5845fd279adcd83826b9a32e952 | [
"MIT"
] | null | null | null | # TODO: write proper tests
if __name__ == "__main__":
test_reconstruction()
| 28.576923 | 164 | 0.561238 | # TODO: write proper tests
def test_reconstruction():
from genespeak import text_to_dna, dna_to_text
texts = {"ascii": "A good life", "utf-8": "A good life 👍!..."}
schemas = [
"ACGT",
"GATC",
"ATGC",
]
for schema in schemas:
for strategy, text in texts.items():
... | 641 | 0 | 22 |
d335068632931d834488f9e56374ffa07f90b37d | 918 | py | Python | test/test_amino_acids.py | hammerlab/pepdata | 2f1bad79f8084545227f4a7f895bbf08a6fb6fdc | [
"Apache-2.0"
] | 24 | 2015-03-13T03:52:27.000Z | 2017-12-09T08:46:05.000Z | test/test_amino_acids.py | openvax/pepdata | 2f1bad79f8084545227f4a7f895bbf08a6fb6fdc | [
"Apache-2.0"
] | 8 | 2015-01-30T18:31:31.000Z | 2017-09-27T13:18:44.000Z | test/test_amino_acids.py | hammerlab/pepdata | 2f1bad79f8084545227f4a7f895bbf08a6fb6fdc | [
"Apache-2.0"
] | 10 | 2015-01-08T20:33:39.000Z | 2017-08-03T14:38:33.000Z | from nose.tools import eq_
from pepdata.amino_acid_alphabet import (
canonical_amino_acids,
canonical_amino_acid_letters,
extended_amino_acids,
extended_amino_acid_letters,
)
| 34 | 66 | 0.797386 | from nose.tools import eq_
from pepdata.amino_acid_alphabet import (
canonical_amino_acids,
canonical_amino_acid_letters,
extended_amino_acids,
extended_amino_acid_letters,
)
def test_canonical_amino_acids():
assert len(canonical_amino_acids) == 20
def test_canonical_amino_acids_letters():
ass... | 635 | 0 | 92 |
7f0760d5362fd41e3874df975e4ed7df8ec29971 | 3,057 | py | Python | tuesmon_ncurses/ui/views/projects.py | tuesmoncom/tuesmon-ncurses | 21cd4c39f2eed13e7fe42cac0e70d752f76382ca | [
"Apache-2.0"
] | null | null | null | tuesmon_ncurses/ui/views/projects.py | tuesmoncom/tuesmon-ncurses | 21cd4c39f2eed13e7fe42cac0e70d752f76382ca | [
"Apache-2.0"
] | null | null | null | tuesmon_ncurses/ui/views/projects.py | tuesmoncom/tuesmon-ncurses | 21cd4c39f2eed13e7fe42cac0e70d752f76382ca | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
tuesmon_ncurses.ui.views.projects
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
import functools
import urwid
from tuesmon_ncurses.ui.widgets import generic, projects
from . import base
from .backlog import ProjectBacklogSubView
from .milestones import ProjectMilestoneSubView
from .issues import... | 31.515464 | 86 | 0.635918 | # -*- coding: utf-8 -*-
"""
tuesmon_ncurses.ui.views.projects
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
import functools
import urwid
from tuesmon_ncurses.ui.widgets import generic, projects
from . import base
from .backlog import ProjectBacklogSubView
from .milestones import ProjectMilestoneSubView
from .issues import... | 2,211 | 369 | 95 |
82ad07ac41b7eebbea882cc6f11f501fe34982a5 | 590 | py | Python | packages/mono-upnp.py | mhutch/bockbuild | 0d989e2d0259d17d41a195f8d28b3844a4652e7b | [
"MIT"
] | null | null | null | packages/mono-upnp.py | mhutch/bockbuild | 0d989e2d0259d17d41a195f8d28b3844a4652e7b | [
"MIT"
] | null | null | null | packages/mono-upnp.py | mhutch/bockbuild | 0d989e2d0259d17d41a195f8d28b3844a4652e7b | [
"MIT"
] | null | null | null |
MonoUpnpPackage ()
| 26.818182 | 59 | 0.679661 | class MonoUpnpPackage (GitHubTarballPackage):
def __init__ (self):
GitHubTarballPackage.__init__ (self, 'mono', 'mono-upnp',
'0.1.2', 'b374ed41c566bc6ad50b3513218458b711e508db',
configure = './autogen.sh --prefix="%{prefix}"')
self.configure_flags = [
'--disable-tests',
]
self.sources.extend ([
#... | 477 | 24 | 69 |
1e86b41eeb9ba4a8087e4e65c9f63b7fbd3fc611 | 5,376 | py | Python | Python kode/functionStorage_v4.py | ChristianMark/Arduino-Den-ultimative-spillekonsol- | b18be1e91ac06baf2e68ae45e1b0c04185e97bea | [
"MIT"
] | null | null | null | Python kode/functionStorage_v4.py | ChristianMark/Arduino-Den-ultimative-spillekonsol- | b18be1e91ac06baf2e68ae45e1b0c04185e97bea | [
"MIT"
] | null | null | null | Python kode/functionStorage_v4.py | ChristianMark/Arduino-Den-ultimative-spillekonsol- | b18be1e91ac06baf2e68ae45e1b0c04185e97bea | [
"MIT"
] | null | null | null | import ftplib
| 32.780488 | 86 | 0.526414 | import ftplib
def uploadFileToWeb(filename, server, user, password, subdir):
session = ftplib.FTP(str(server),str(user),str(password)) #open ftp session
session.cwd(str(subdir)) #define subdirectory on ftp
file = open(str(filename),'rb') #open file in read binary mode
query = "STOR " + f... | 5,066 | 0 | 288 |
21bb640e91c6d85eefe42b8c0956dd1ef3d64645 | 10,525 | py | Python | Legify/Holes.py | vectronic/freecad-legify-macros | ff5782adcc2f1e0724432ffb58ccdea91d594add | [
"MIT"
] | 18 | 2019-01-22T10:40:26.000Z | 2022-02-27T23:42:39.000Z | Legify/Holes.py | vectronic/freecad-legify-macros | ff5782adcc2f1e0724432ffb58ccdea91d594add | [
"MIT"
] | 3 | 2018-10-16T18:15:06.000Z | 2020-03-15T16:15:52.000Z | Legify/Holes.py | vectronic/freecad-legify-macros | ff5782adcc2f1e0724432ffb58ccdea91d594add | [
"MIT"
] | 3 | 2019-09-22T18:27:19.000Z | 2021-04-14T10:47:04.000Z | # coding: UTF-8
from FreeCAD import Console, Placement, Rotation, Vector
import Part
import Sketcher
from Legify.Common import *
| 49.413146 | 117 | 0.646841 | # coding: UTF-8
from FreeCAD import Console, Placement, Rotation, Vector
import Part
import Sketcher
from Legify.Common import *
class HolesRenderer:
def __init__(self):
Console.PrintMessage("HolesRenderer\n")
self.doc = None
self.brick = None
self.width = None
self.dep... | 10,246 | 125 | 23 |
bce66ef1d5acf2467c683fae70f1ea66f6ccd9b2 | 23,406 | py | Python | poium/wda/__init__.py | yaoJeffer/poium | 68bce81c8648c184f4349543e97630fb92c7138b | [
"Apache-2.0"
] | 174 | 2019-11-28T02:01:55.000Z | 2022-03-13T03:20:42.000Z | poium/wda/__init__.py | yaoJeffer/poium | 68bce81c8648c184f4349543e97630fb92c7138b | [
"Apache-2.0"
] | 20 | 2020-01-14T16:28:51.000Z | 2022-03-25T11:47:05.000Z | poium/wda/__init__.py | yaoJeffer/poium | 68bce81c8648c184f4349543e97630fb92c7138b | [
"Apache-2.0"
] | 82 | 2019-12-22T07:43:15.000Z | 2022-03-13T03:20:43.000Z | import time
from poium.common import logging
from poium.settings import Setting
from poium.processing import processing, screenshots_name
from poium.common.assert_des import insert_assert
LOCATOR_LIST = [
"id",
"name",
"text",
"nameContains",
"label",
"xpath",
"labelContains",
"classNa... | 31.502019 | 105 | 0.510425 | import time
from poium.common import logging
from poium.settings import Setting
from poium.processing import processing, screenshots_name
from poium.common.assert_des import insert_assert
LOCATOR_LIST = [
"id",
"name",
"text",
"nameContains",
"label",
"xpath",
"labelContains",
"classNa... | 1,865 | 23,037 | 46 |
967013f1e42eb89a6abe48e06320ccc9aa157768 | 11,435 | py | Python | tf_kde/benchmark/runner.py | AstroViking/tf-kde | a13deff0384b8d91af1d71909762242ff9b3e54e | [
"WTFPL"
] | 1 | 2021-11-19T03:00:47.000Z | 2021-11-19T03:00:47.000Z | tf_kde/benchmark/runner.py | AstroViking/tf-kde | a13deff0384b8d91af1d71909762242ff9b3e54e | [
"WTFPL"
] | 2 | 2020-11-06T14:05:46.000Z | 2021-02-12T17:39:00.000Z | tf_kde/benchmark/runner.py | AstroViking/tf-kde | a13deff0384b8d91af1d71909762242ff9b3e54e | [
"WTFPL"
] | 2 | 2021-06-14T09:25:16.000Z | 2021-11-19T03:00:49.000Z | import tensorflow as tf
import numpy as np
from zfit import ztypes
from zfit_benchmark.timer import Timer
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import inspect
from decimal import Decimal
from scipy.interpolate import UnivariateSpline
from tf_kde.benchmark import distributions as ava... | 33.931751 | 211 | 0.664801 | import tensorflow as tf
import numpy as np
from zfit import ztypes
from zfit_benchmark.timer import Timer
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import inspect
from decimal import Decimal
from scipy.interpolate import UnivariateSpline
from tf_kde.benchmark import distributions as ava... | 10,117 | 0 | 322 |
c4c4d5718bf617ce233d777af7e5cf10f6aac908 | 458 | py | Python | test.py | mwhavens/chess | 1f472caea9e314b4dc1ca074d6312e094b8b9c59 | [
"MIT"
] | null | null | null | test.py | mwhavens/chess | 1f472caea9e314b4dc1ca074d6312e094b8b9c59 | [
"MIT"
] | null | null | null | test.py | mwhavens/chess | 1f472caea9e314b4dc1ca074d6312e094b8b9c59 | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
print(MyClass.__dict__['var3'])
clzz = MyClass()
clzz.my_method()
| 18.32 | 36 | 0.59607 | class MyClass:
__var2 = 'var2'
var3 = 'var3'
def __init__(self):
self.__var1 = 'var1'
def normal_method(self):
print(self.__var1)
@classmethod
def class_method(cls):
print(cls.__var2)
def my_method(self):
print(self.__var1)
print(self.__var2)
... | 173 | 156 | 22 |
a1f74c658b35e8e1718e81c568876b01cb135a61 | 431 | py | Python | changes/api/node_details.py | vault-the/changes | 37e23c3141b75e4785cf398d015e3dbca41bdd56 | [
"Apache-2.0"
] | 443 | 2015-01-03T16:28:39.000Z | 2021-04-26T16:39:46.000Z | changes/api/node_details.py | vault-the/changes | 37e23c3141b75e4785cf398d015e3dbca41bdd56 | [
"Apache-2.0"
] | 12 | 2015-07-30T19:07:16.000Z | 2016-11-07T23:11:21.000Z | changes/api/node_details.py | vault-the/changes | 37e23c3141b75e4785cf398d015e3dbca41bdd56 | [
"Apache-2.0"
] | 47 | 2015-01-09T10:04:00.000Z | 2020-11-18T17:58:19.000Z | from __future__ import absolute_import
from changes.api.base import APIView
from changes.models.node import Node
| 25.352941 | 65 | 0.682135 | from __future__ import absolute_import
from changes.api.base import APIView
from changes.models.node import Node
class NodeDetailsAPIView(APIView):
def get(self, node_id):
node = Node.query.get(node_id)
if node is None:
return '', 404
context = self.serialize(node)
co... | 254 | 13 | 49 |
c710c97e550bfb3ab98fa9152150993c46576719 | 3,276 | py | Python | supersuit/vector/concat_vec_env.py | FaramaFoundation/SuperSuit | 0d7e5e20d4e488adae9c9915e7690931ac53de67 | [
"MIT"
] | null | null | null | supersuit/vector/concat_vec_env.py | FaramaFoundation/SuperSuit | 0d7e5e20d4e488adae9c9915e7690931ac53de67 | [
"MIT"
] | null | null | null | supersuit/vector/concat_vec_env.py | FaramaFoundation/SuperSuit | 0d7e5e20d4e488adae9c9915e7690931ac53de67 | [
"MIT"
] | null | null | null | import numpy as np
from .single_vec_env import SingleVecEnv
import gym.vector
from gym.vector.utils import concatenate, iterate, create_empty_array
from gym.spaces import Discrete
@iterate.register(Discrete)
| 32.76 | 86 | 0.608364 | import numpy as np
from .single_vec_env import SingleVecEnv
import gym.vector
from gym.vector.utils import concatenate, iterate, create_empty_array
from gym.spaces import Discrete
def transpose(ll):
return [[ll[i][j] for i in range(len(ll))] for j in range(len(ll[0]))]
@iterate.register(Discrete)
def iterate_di... | 2,707 | 20 | 337 |
a15a2c976ee18c3117b30ea41926c8f499328569 | 13,308 | py | Python | GlobalPhone/dictionaries.py | MontrealCorpusTools/MFA-reorganization-scripts | 8c7a2bdbee6b17b5d06e9d5d267386f37773a70d | [
"MIT"
] | 28 | 2018-02-27T08:36:48.000Z | 2022-03-17T15:29:34.000Z | GlobalPhone/dictionaries.py | MontrealCorpusTools/MFA-reorganization-scripts | 8c7a2bdbee6b17b5d06e9d5d267386f37773a70d | [
"MIT"
] | null | null | null | GlobalPhone/dictionaries.py | MontrealCorpusTools/MFA-reorganization-scripts | 8c7a2bdbee6b17b5d06e9d5d267386f37773a70d | [
"MIT"
] | 5 | 2017-01-06T19:39:24.000Z | 2022-01-15T08:32:52.000Z | import os
from collections import defaultdict
full_names = {
'AR': 'Arabic',
'BG': 'Bulgarian',
'CH': 'Mandarin',
'CH_char': 'Mandarin',
'EN': 'English',
'WU': 'Cantonese',
'CR': 'Croatian',
... | 41.981073 | 235 | 0.53404 | import os
from collections import defaultdict
full_names = {
'AR': 'Arabic',
'BG': 'Bulgarian',
'CH': 'Mandarin',
'CH_char': 'Mandarin',
'EN': 'English',
'WU': 'Cantonese',
'CR': 'Croatian',
... | 1,435 | 0 | 46 |
fef2dbdf7939029991a9ebb80a5192eda981285e | 24,234 | py | Python | docs/notebooks/05_reconstructing_the_light_curve_of_stars.py | eserie/wax-ml | 9cf92ff5c41ea681fd3eaaf4560b3380f986ee1e | [
"MIT",
"ECL-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 42 | 2021-06-14T16:27:54.000Z | 2022-03-23T09:51:42.000Z | docs/notebooks/05_reconstructing_the_light_curve_of_stars.py | eserie/wax-ml | 9cf92ff5c41ea681fd3eaaf4560b3380f986ee1e | [
"MIT",
"ECL-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2021-10-01T12:45:29.000Z | 2021-10-03T18:06:39.000Z | docs/notebooks/05_reconstructing_the_light_curve_of_stars.py | eserie/wax-ml | 9cf92ff5c41ea681fd3eaaf4560b3380f986ee1e | [
"MIT",
"ECL-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 5 | 2021-06-11T12:32:41.000Z | 2022-02-17T16:13:15.000Z | # -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# formats: ipynb,py,md
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.13.3
# kernelspec:
# display_name: Python 3 (ipykernel)
# language: python
# name: python... | 29.662179 | 268 | 0.682966 | # -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# formats: ipynb,py,md
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.13.3
# kernelspec:
# display_name: Python 3 (ipykernel)
# language: python
# name: python... | 5,070 | 153 | 360 |
45b55261b26fa5ae0d0a6aa3d7d59813e6759301 | 1,345 | py | Python | data-structures/graphs.py | Flor91/Data-Structures-and-Algorithms | 0bfac03d3714417adff7545c589f48f6b91ede8b | [
"MIT"
] | 8 | 2020-05-17T16:57:35.000Z | 2022-01-27T12:27:23.000Z | data-structures/graphs.py | Flor91/Data-Structures-and-Algorithms | 0bfac03d3714417adff7545c589f48f6b91ede8b | [
"MIT"
] | null | null | null | data-structures/graphs.py | Flor91/Data-Structures-and-Algorithms | 0bfac03d3714417adff7545c589f48f6b91ede8b | [
"MIT"
] | 5 | 2020-05-17T16:56:54.000Z | 2021-11-24T16:25:11.000Z | # Generate a graph with:
# Vertices
V = {"a", "b", "c", "d", "e"}
# Edges
E = {"ab", "ac", "bd", "cd", "de"}
# Create the dictionary with graph elements
graph_elements = { "a" : ["b","c"],
"b" : ["a", "d"],
"c" : ["a", "d"],
"d" : ["e"],
"e" : ["d"]
... | 24.017857 | 62 | 0.450558 | # Generate a graph with:
# Vertices
V = {"a", "b", "c", "d", "e"}
# Edges
E = {"ab", "ac", "bd", "cd", "de"}
class graph:
def __init__(self, gdict=None):
if gdict is None:
gdict = []
self.gdict = gdict
def get_vertices(self):
"""
Print graph vertices
"""... | 531 | 231 | 23 |
ec3c40a7d3dda9816b235db746d74f4d8ad92f8f | 2,041 | py | Python | Cogs/MainUtility.py | maxhuebner/scrim-tool | 0babe8e25adcf8ee4f9a0d49f17c983c04cfff72 | [
"MIT"
] | 1 | 2022-03-25T10:39:37.000Z | 2022-03-25T10:39:37.000Z | Cogs/MainUtility.py | maxhuebner/scrim-tool | 0babe8e25adcf8ee4f9a0d49f17c983c04cfff72 | [
"MIT"
] | null | null | null | Cogs/MainUtility.py | maxhuebner/scrim-tool | 0babe8e25adcf8ee4f9a0d49f17c983c04cfff72 | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
import scrimdb as db
import interactions
| 29.57971 | 69 | 0.607545 | import discord
from discord.ext import commands
import scrimdb as db
import interactions
class MainUtility(interactions.Extension):
def __init__(self, client):
self.client: interactions.Client = client
@commands.Cog.listener()
async def on_ready(self):
print("Log:", self.bot.user)
# @... | 118 | 1,786 | 46 |
578a9c6c4953951a7de387cd1fed25ac967fc995 | 5,046 | py | Python | demo.py | EdwardjkFeng/RAFT | 756902fa429283218969a8285324a7dfbe81020e | [
"BSD-3-Clause"
] | null | null | null | demo.py | EdwardjkFeng/RAFT | 756902fa429283218969a8285324a7dfbe81020e | [
"BSD-3-Clause"
] | null | null | null | demo.py | EdwardjkFeng/RAFT | 756902fa429283218969a8285324a7dfbe81020e | [
"BSD-3-Clause"
] | null | null | null | import sys
import argparse
import os
import cv2
import glob
import numpy as np
import torch
from PIL import Image
import gc
from torch.profiler import profile, record_function, ProfilerActivity
import time
sys.path.append('core')
from core.raft import RAFT
from core.utils import flow_viz
from core.utils.utils impor... | 35.286713 | 148 | 0.624851 | import sys
import argparse
import os
import cv2
import glob
import numpy as np
import torch
from PIL import Image
import gc
from torch.profiler import profile, record_function, ProfilerActivity
import time
sys.path.append('core')
from core.raft import RAFT
from core.utils import flow_viz
from core.utils.utils impor... | 3,593 | 0 | 91 |
e52e4119be8d73e02db8ef1c246118c123dfa913 | 2,163 | py | Python | ostester/ccodegen.py | benstreb/os-test-harness | 2ebf63b0518534ca740a41280723d9e5fd75a4b6 | [
"0BSD"
] | null | null | null | ostester/ccodegen.py | benstreb/os-test-harness | 2ebf63b0518534ca740a41280723d9e5fd75a4b6 | [
"0BSD"
] | null | null | null | ostester/ccodegen.py | benstreb/os-test-harness | 2ebf63b0518534ca740a41280723d9e5fd75a4b6 | [
"0BSD"
] | null | null | null | import logging
import shutil
import os.path
from jinja2 import Environment, PackageLoader
from . import utils
import ostester
env = Environment(loader=PackageLoader('ostester', 'templates'),
trim_blocks=True,
lstrip_blocks=True)
env.filters['header_to_function_name'] = utils.heade... | 33.276923 | 71 | 0.679149 | import logging
import shutil
import os.path
from jinja2 import Environment, PackageLoader
from . import utils
import ostester
env = Environment(loader=PackageLoader('ostester', 'templates'),
trim_blocks=True,
lstrip_blocks=True)
env.filters['header_to_function_name'] = utils.heade... | 1,061 | 0 | 46 |
cbc121b9e37f2a9a03a4309e4cd2396dfd7a42e2 | 1,173 | py | Python | tests/test_model_run.py | LucaCappelletti94/keras_metrics | 2af59d26f7134a65e8332a29a3f7ae712b928f0e | [
"MIT"
] | null | null | null | tests/test_model_run.py | LucaCappelletti94/keras_metrics | 2af59d26f7134a65e8332a29a3f7ae712b928f0e | [
"MIT"
] | null | null | null | tests/test_model_run.py | LucaCappelletti94/keras_metrics | 2af59d26f7134a65e8332a29a3f7ae712b928f0e | [
"MIT"
] | null | null | null | import numpy as np
from extra_keras_metrics import (get_complete_binary_metrics,
get_minimal_multiclass_metrics)
from tensorflow.keras.layers import Dense
from tensorflow.keras.models import Sequential
def test_binary_model_run():
"""Test that all metrics actually work when used w... | 29.325 | 75 | 0.637681 | import numpy as np
from extra_keras_metrics import (get_complete_binary_metrics,
get_minimal_multiclass_metrics)
from tensorflow.keras.layers import Dense
from tensorflow.keras.models import Sequential
def test_binary_model_run():
"""Test that all metrics actually work when used w... | 0 | 0 | 0 |
c5bdc90c4d4622c1d5257cc45d91563779e940b2 | 803 | py | Python | Models/User.py | SeanABoyer/Home_Texting_DB-API | e41e926fbe46faa285c279034e270ac2dd9a913c | [
"Apache-2.0"
] | null | null | null | Models/User.py | SeanABoyer/Home_Texting_DB-API | e41e926fbe46faa285c279034e270ac2dd9a913c | [
"Apache-2.0"
] | null | null | null | Models/User.py | SeanABoyer/Home_Texting_DB-API | e41e926fbe46faa285c279034e270ac2dd9a913c | [
"Apache-2.0"
] | 1 | 2020-11-04T04:46:10.000Z | 2020-11-04T04:46:10.000Z | import datetime
from Other.SharedResources import db, g_user
| 36.5 | 90 | 0.611457 | import datetime
from Other.SharedResources import db, g_user
class User(db.Model):
__tablename__ = "User"
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(30), unique=True, nullable=False)
password = db.Column(db.String(45), nullable=False)
phoneNumber = db.Column... | 299 | 418 | 24 |
35f754bfaf6ed81e41a059a2e8875bf26e576809 | 51 | py | Python | ddu_dirty_mnist/__init__.py | BlackHC/ddu_dirty_mnist | fdd4e0a4d5496bc3e3ba80359dd7cd67f564d955 | [
"Apache-2.0"
] | 3 | 2021-06-30T13:57:59.000Z | 2021-12-05T18:55:35.000Z | ddu_dirty_mnist/__init__.py | BlackHC/ddu_dirty_mnist | fdd4e0a4d5496bc3e3ba80359dd7cd67f564d955 | [
"Apache-2.0"
] | null | null | null | ddu_dirty_mnist/__init__.py | BlackHC/ddu_dirty_mnist | fdd4e0a4d5496bc3e3ba80359dd7cd67f564d955 | [
"Apache-2.0"
] | 1 | 2021-07-09T16:36:11.000Z | 2021-07-09T16:36:11.000Z | __version__ = "1.0.1"
from .dirty_mnist import *
| 10.2 | 26 | 0.686275 | __version__ = "1.0.1"
from .dirty_mnist import *
| 0 | 0 | 0 |
5dfd46f6c293126c9b934ec77f0c1d85d804407b | 1,288 | py | Python | compute.py | mpi3d/sigfm | 5bdcf5df70616ce1e4371c67b46bb06c88dd5924 | [
"MIT"
] | 2 | 2021-10-12T17:32:24.000Z | 2021-11-19T12:09:15.000Z | compute.py | mpi3d/sigfm | 5bdcf5df70616ce1e4371c67b46bb06c88dd5924 | [
"MIT"
] | null | null | null | compute.py | mpi3d/sigfm | 5bdcf5df70616ce1e4371c67b46bb06c88dd5924 | [
"MIT"
] | null | null | null | import os
import cv2 as cv
import numpy as np
if __name__ == "__main__":
compute_finger('fingerprints/finger-0', 'fingerprints/clear.png',
'fingerprints/finger-0.npz')
| 32.2 | 78 | 0.528727 | import os
import cv2 as cv
import numpy as np
def compute_finger(images_path: str, clear_path: str, save_path: str) -> None:
finger = []
sift = cv.SIFT_create()
clear: np.ndarray = cv.imread(clear_path, 0)
for root, _, files in os.walk(images_path):
for file in files:
if file.ends... | 1,070 | 0 | 23 |
13888b5d56c53c05586ca7dbbbcd8dadda43b2ba | 4,849 | py | Python | habitat_baselines/rl/models/rnn_state_encoder.py | yilundu/crl | 6adf009d30f292cdc995eb70bab500b0033c11d4 | [
"MIT"
] | 17 | 2021-05-07T20:32:45.000Z | 2021-12-09T13:31:08.000Z | habitat_baselines/rl/models/rnn_state_encoder.py | yilundu/crl | 6adf009d30f292cdc995eb70bab500b0033c11d4 | [
"MIT"
] | null | null | null | habitat_baselines/rl/models/rnn_state_encoder.py | yilundu/crl | 6adf009d30f292cdc995eb70bab500b0033c11d4 | [
"MIT"
] | 1 | 2021-09-20T08:51:37.000Z | 2021-09-20T08:51:37.000Z | import torch
import torch.nn as nn
| 32.986395 | 136 | 0.570633 | import torch
import torch.nn as nn
class RNNStateEncoder(nn.Module):
def __init__(
self,
input_size: int,
hidden_size: int,
num_layers: int = 1,
rnn_type: str = "GRU",
):
r"""An RNN for encoding the state in RL.
Supports masking the hidden state during ... | 1,333 | 3,457 | 23 |
ab925ae7a31f712afc2f0cd972122c4d672df630 | 1,930 | py | Python | dashboard/migrations/0053_auto_20210916_2210.py | chennisden/otis-web | 57a1de9c1c3baa2cda09d30c59462a528aa3ba00 | [
"MIT"
] | 15 | 2021-08-28T18:18:37.000Z | 2022-03-13T07:48:15.000Z | dashboard/migrations/0053_auto_20210916_2210.py | chennisden/otis-web | 57a1de9c1c3baa2cda09d30c59462a528aa3ba00 | [
"MIT"
] | 65 | 2021-08-20T02:37:27.000Z | 2022-02-07T17:19:23.000Z | dashboard/migrations/0053_auto_20210916_2210.py | chennisden/otis-web | 57a1de9c1c3baa2cda09d30c59462a528aa3ba00 | [
"MIT"
] | 31 | 2020-01-09T02:35:29.000Z | 2022-03-13T07:48:18.000Z | # Generated by Django 3.2.7 on 2021-09-17 02:10
import dashboard.models
import django.core.validators
from django.db import migrations, models
| 41.956522 | 257 | 0.653368 | # Generated by Django 3.2.7 on 2021-09-17 02:10
import dashboard.models
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dashboard', '0052_auto_20210916_2115'),
]
operations = [
migrations.AlterField(
... | 0 | 1,762 | 23 |