hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0401599b259c818b191c532022ed908f5a7a63b2 | 1,155 | py | Python | __manifest__.py | danieldemedziuk/odoo12-work_schedule | 67f583472926e81aaf84d90aa5cff5a38a0149ef | [
"MIT"
] | null | null | null | __manifest__.py | danieldemedziuk/odoo12-work_schedule | 67f583472926e81aaf84d90aa5cff5a38a0149ef | [
"MIT"
] | 1 | 2021-07-01T11:45:58.000Z | 2021-07-07T13:40:09.000Z | __manifest__.py | danieldemedziuk/odoo12-work_schedule | 67f583472926e81aaf84d90aa5cff5a38a0149ef | [
"MIT"
] | 3 | 2020-11-05T14:06:26.000Z | 2021-03-20T00:43:40.000Z | # -*- coding: utf-8 -*-
{
'name': 'Work schedule',
'version': '1.0',
'author': 'Daniel Demedziuk',
'sequence': 110,
'summary': 'Projects, Employees, Schedule',
'company': 'Daniel Demedziuk',
'description': """
Work schedule of employees
==================================
This module provides... | 30.394737 | 201 | 0.624242 | # -*- coding: utf-8 -*-
{
'name': 'Work schedule',
'version': '1.0',
'author': 'Daniel Demedziuk',
'sequence': 110,
'summary': 'Projects, Employees, Schedule',
'company': 'Daniel Demedziuk',
'description': """
Work schedule of employees
==================================
This module provides... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0d357d0608fbe266eec21e0bf22de150016a09bf | 838 | py | Python | tests/gen_test.py | nim65s/mdmail | 10c9f4c422ea5bcdf3e687eb8c500ec4906ae9f9 | [
"BSD-2-Clause"
] | 56 | 2017-11-13T23:40:55.000Z | 2022-03-19T19:37:17.000Z | tests/gen_test.py | nim65s/mdmail | 10c9f4c422ea5bcdf3e687eb8c500ec4906ae9f9 | [
"BSD-2-Clause"
] | 4 | 2019-07-08T10:47:20.000Z | 2021-04-03T15:10:27.000Z | tests/gen_test.py | nim65s/mdmail | 10c9f4c422ea5bcdf3e687eb8c500ec4906ae9f9 | [
"BSD-2-Clause"
] | 9 | 2018-02-07T20:59:40.000Z | 2021-01-01T14:28:28.000Z | #!/usr/bin/env python
"""
A tool to generate html and txt file for a markdown file.
This is mainly used to generate test cases.
"""
if __name__ == '__main__':
main()
| 27.032258 | 104 | 0.682578 | #!/usr/bin/env python
"""
A tool to generate html and txt file for a markdown file.
This is mainly used to generate test cases.
"""
import argparse
import os
from io import open
import mdmail
def main():
parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawTextHelpFormatter)
par... | 0 | 0 | 0 | 0 | 0 | 581 | 0 | -28 | 113 |
244e7eb5f0e54c2259e9480dae8cf5e1507a7e4b | 12,077 | py | Python | train.py | RecoHut-Stanzas/S168471 | 7e0ac621c36f839e1df6876ec517d0ad00672790 | [
"BSD-3-Clause"
] | 37 | 2020-06-15T02:04:37.000Z | 2022-02-09T06:26:42.000Z | train.py | RecoHut-Stanzas/S168471 | 7e0ac621c36f839e1df6876ec517d0ad00672790 | [
"BSD-3-Clause"
] | 5 | 2020-08-06T13:16:34.000Z | 2022-02-04T07:29:29.000Z | train.py | RecoHut-Stanzas/S168471 | 7e0ac621c36f839e1df6876ec517d0ad00672790 | [
"BSD-3-Clause"
] | 11 | 2020-09-01T23:08:51.000Z | 2022-02-09T06:26:44.000Z | import argparse
import time
import gc
import os
import numpy as np
import torch
from torch.utils.data import DataLoader
from models.models import GroupIM
from utils.user_utils import TrainUserDataset, EvalUserDataset
from utils.group_utils import TrainGroupDataset, EvalGroupDataset
from eval.evaluate import evaluate_u... | 50.112033 | 120 | 0.655212 | import argparse
import time
import gc
import os
import numpy as np
import torch
from torch.utils.data import DataLoader
from models.models import GroupIM
from utils.user_utils import TrainUserDataset, EvalUserDataset
from utils.group_utils import TrainGroupDataset, EvalGroupDataset
from eval.evaluate import evaluate_u... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4400bb9e558de4f185705262b447d2c53bc2baf3 | 3,163 | py | Python | run_test.py | 2gunsu/SPL2021-FEN | a674df75da71290b8ab8ed330a453b1b2e94512c | [
"MIT"
] | 3 | 2021-05-25T05:15:09.000Z | 2021-12-30T07:04:45.000Z | run_test.py | 2gunsu/SPL2021-FEN | a674df75da71290b8ab8ed330a453b1b2e94512c | [
"MIT"
] | null | null | null | run_test.py | 2gunsu/SPL2021-FEN | a674df75da71290b8ab8ed330a453b1b2e94512c | [
"MIT"
] | null | null | null | import os
import yaml
import warnings
from argparse import ArgumentParser
from typing import Any, Union, Tuple
from detectron2.config import CfgNode
from detectron2.data import build_detection_test_loader
from detectron2.data.datasets import register_coco_instances
from detectron2.evaluation import COCOEvaluator, inf... | 41.077922 | 138 | 0.668037 | import os
import yaml
import warnings
from argparse import ArgumentParser
from typing import Any, Union, Tuple
from detectron2.config import get_cfg, CfgNode
from detectron2.data import build_detection_test_loader
from detectron2.data.datasets import register_coco_instances
from detectron2.evaluation import COCOEvalu... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 16 | 23 |
8314e2fc53745a40853791c109169353cd164e28 | 290 | py | Python | projects/code_combat/7_Sarven_Desert/329-Wandering_Souls/wandering_souls.py | only-romano/junkyard | b60a25b2643f429cdafee438d20f9966178d6f36 | [
"MIT"
] | null | null | null | projects/code_combat/7_Sarven_Desert/329-Wandering_Souls/wandering_souls.py | only-romano/junkyard | b60a25b2643f429cdafee438d20f9966178d6f36 | [
"MIT"
] | null | null | null | projects/code_combat/7_Sarven_Desert/329-Wandering_Souls/wandering_souls.py | only-romano/junkyard | b60a25b2643f429cdafee438d20f9966178d6f36 | [
"MIT"
] | null | null | null | while True:
enemies = hero.findEnemies()
for enemy in enemies:
while enemy.health > 0:
hero.attack(enemy)
items = hero.findItems()
for item in items:
while hero.distanceTo(item) > 2:
hero.moveXY(item.pos.x, item.pos.y)
| 26.363636 | 48 | 0.558621 | while True:
enemies = hero.findEnemies()
for enemy in enemies:
while enemy.health > 0:
hero.attack(enemy)
items = hero.findItems()
for item in items:
while hero.distanceTo(item) > 2:
hero.moveXY(item.pos.x, item.pos.y)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5f7bb77c03d84cef4b75a27947110c8f7f0b244d | 806 | py | Python | 2017/day01/day01.py | icemanblues/advent-of-code | eac937ac2762d1c8b8cec358a13af352e339446c | [
"Apache-2.0"
] | null | null | null | 2017/day01/day01.py | icemanblues/advent-of-code | eac937ac2762d1c8b8cec358a13af352e339446c | [
"Apache-2.0"
] | 2 | 2020-04-06T18:56:13.000Z | 2022-03-30T20:32:50.000Z | 2017/day01/day01.py | icemanblues/advent-of-code | eac937ac2762d1c8b8cec358a13af352e339446c | [
"Apache-2.0"
] | null | null | null |
day_num = "01"
day_title = "Inverse Captcha"
if __name__ == '__main__':
main()
| 17.911111 | 56 | 0.533499 | from typing import List
day_num = "01"
day_title = "Inverse Captcha"
def read_input(filename: str) -> List[str]:
with open(filename) as f:
content = [x.strip('\n') for x in f.readlines()]
return content
def part1():
line = read_input("input.txt")[0]
curr = line[len(line)-1]
count = 0
... | 0 | 0 | 0 | 0 | 0 | 600 | 0 | 2 | 114 |
242925589fb185a5ed756cf0b989e7439c3fdd36 | 1,777 | py | Python | mriseqplot/shapes.py | Sibgatulin/MRISeqPlot | 0ca93ac5ab6c4aba6e8f56fd12d5df416df2939c | [
"MIT"
] | null | null | null | mriseqplot/shapes.py | Sibgatulin/MRISeqPlot | 0ca93ac5ab6c4aba6e8f56fd12d5df416df2939c | [
"MIT"
] | 2 | 2020-06-23T15:07:06.000Z | 2020-06-23T15:08:39.000Z | mriseqplot/shapes.py | Sibgatulin/MRISeqPlot | 0ca93ac5ab6c4aba6e8f56fd12d5df416df2939c | [
"MIT"
] | null | null | null | import numpy as np
def trapezoid(t, t_start, t_flat_out, t_ramp_down):
""" A symmetrical trapezoid of unit height
Parameters
----------
t : array_like, 1D
Vector of time values, specifying the entire domain of the sequence
t_start : float
Moment in time when the gradient is switc... | 34.843137 | 86 | 0.631964 | import numpy as np
def rf_sinc(t, t_start, duration, side_lobes):
y = np.zeros_like(t)
idx_rf = (t > t_start) & (t < t_start + duration)
t_rf = t[idx_rf] - t_start - duration / 2
y[idx_rf] = np.sin(t_rf / duration * 2 * np.pi * (side_lobes + 1)) / t_rf
y[idx_rf] = y[idx_rf] / np.max(y[idx_rf])
... | 0 | 0 | 0 | 0 | 0 | 578 | 0 | 0 | 46 |
7affea990ac37fd96e99bc875bf3e170057bccc1 | 6,733 | py | Python | template.py | knightReigh/SinaSpider | dca7cd5e66c32866e2e697603dbfb2ecbb8a62d0 | [
"MIT"
] | 4 | 2018-03-02T11:11:53.000Z | 2019-01-20T00:05:58.000Z | template.py | knightReigh/SinaSpider | dca7cd5e66c32866e2e697603dbfb2ecbb8a62d0 | [
"MIT"
] | null | null | null | template.py | knightReigh/SinaSpider | dca7cd5e66c32866e2e697603dbfb2ecbb8a62d0 | [
"MIT"
] | null | null | null | def tempalte_PinkElegance(timecards, ignore_retweet=True):
""" A builder for template body: PinkElegance
Abandoned for incomplet js generation
Source: https://codepen.io/mo7hamed/pen/dRoMwo
"""
# build body
body_string = ""
for i in range(0, len(timecards.content)):
... | 61.209091 | 157 | 0.477499 | def tempalte_PinkElegance(timecards, ignore_retweet=True):
""" A builder for template body: PinkElegance
Abandoned for incomplet js generation
Source: https://codepen.io/mo7hamed/pen/dRoMwo
"""
# build body
body_string = ""
for i in range(0, len(timecards.content)):
... | 120 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
581abe937af4b9203e2451f8eb92730dc67f08f0 | 347 | py | Python | setup.py | thiagodk/python-event-emitter | 3767f852a8151a918a44572af679dfc00d3bff5c | [
"MIT"
] | null | null | null | setup.py | thiagodk/python-event-emitter | 3767f852a8151a918a44572af679dfc00d3bff5c | [
"MIT"
] | null | null | null | setup.py | thiagodk/python-event-emitter | 3767f852a8151a918a44572af679dfc00d3bff5c | [
"MIT"
] | null | null | null |
from distutils.core import setup
setup(
name="event-emitter-js",
version="0.1.2",
description="JavaScript-like EventEmitter class for Python 3",
author="Thiago Costa",
author_email="admin@rootbsd.info",
url="https://github.com/thiagodk/python-event-emitter",
package_dir={"": "src"},
pa... | 24.785714 | 66 | 0.680115 |
from distutils.core import setup
setup(
name="event-emitter-js",
version="0.1.2",
description="JavaScript-like EventEmitter class for Python 3",
author="Thiago Costa",
author_email="admin@rootbsd.info",
url="https://github.com/thiagodk/python-event-emitter",
package_dir={"": "src"},
pa... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
49dddc3c965ea40abf0f046e4452d7ddf809ce42 | 8,931 | py | Python | apps/core/files/base.py | ZhuoZhuoCrayon/bk-nodeman | 76cb71fcc971c2a0c2be161fcbd6b019d4a7a8ab | [
"MIT"
] | null | null | null | apps/core/files/base.py | ZhuoZhuoCrayon/bk-nodeman | 76cb71fcc971c2a0c2be161fcbd6b019d4a7a8ab | [
"MIT"
] | null | null | null | apps/core/files/base.py | ZhuoZhuoCrayon/bk-nodeman | 76cb71fcc971c2a0c2be161fcbd6b019d4a7a8ab | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making -(BlueKing-BK-NODEMAN) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the... | 40.049327 | 115 | 0.624006 | # -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-节点管理(BlueKing-BK-NODEMAN) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance ... | 1,236 | 2,882 | 0 | 4,404 | 0 | 0 | 0 | 200 | 314 |
3fb636122c6c24f5d484d3cabf472d868ae882bf | 2,562 | py | Python | make_alignment_mapper.py | leejz/scripts | ab23af0bac5a5051df83fb9f59f23e7c413fd81a | [
"MIT"
] | 1 | 2021-05-24T06:15:16.000Z | 2021-05-24T06:15:16.000Z | make_alignment_mapper.py | leejz/misc-scripts | ab23af0bac5a5051df83fb9f59f23e7c413fd81a | [
"MIT"
] | 1 | 2015-09-08T16:40:49.000Z | 2015-09-08T16:40:49.000Z | make_alignment_mapper.py | leejz/misc-scripts | ab23af0bac5a5051df83fb9f59f23e7c413fd81a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
--------------------------------------------------------------------------------
Created: Jackson Lee 2012
This script reads in the ecoli reference alignment in a particular format and
generates a mapping file which assigns a sequential count of each base pair to
the current alignment posi... | 32.846154 | 87 | 0.556987 | #!/usr/bin/env python
"""
--------------------------------------------------------------------------------
Created: Jackson Lee 2012
This script reads in the ecoli reference alignment in a particular format and
generates a mapping file which assigns a sequential count of each base pair to
the current alignment posi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
551165f70f57801d8c76d23d9c5de24e83f6ba2f | 2,004 | py | Python | adat/2010/scrape.py | korenmiklos/106 | 9925a2bda18915eb43d7bdd2b54d4d7aa113bc66 | [
"MIT"
] | 1 | 2018-04-07T20:44:45.000Z | 2018-04-07T20:44:45.000Z | adat/2010/scrape.py | korenmiklos/106 | 9925a2bda18915eb43d7bdd2b54d4d7aa113bc66 | [
"MIT"
] | null | null | null | adat/2010/scrape.py | korenmiklos/106 | 9925a2bda18915eb43d7bdd2b54d4d7aa113bc66 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
import re
OEVK_URL = 'http://www.valasztas.hu/dyn/pv10vt/vertaj-static/pv10vt/v11.html'
TELEPULES_URL = 'http://www.valasztas.hu/dyn/pv10vt/vertaj-static/pv10vt/maz/{}/oevk/{}/v12.html'
SZAVAZOKOR_URL = 'http://www.valasztas.hu/dyn/pv10vt/vertaj-static/pv10... | 37.811321 | 116 | 0.708084 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
import re
import csv
OEVK_URL = 'http://www.valasztas.hu/dyn/pv10vt/vertaj-static/pv10vt/v11.html'
TELEPULES_URL = 'http://www.valasztas.hu/dyn/pv10vt/vertaj-static/pv10vt/maz/{}/oevk/{}/v12.html'
SZAVAZOKOR_URL = 'http://www.valasztas.hu/dyn/pv10vt/vertaj-... | 4 | 0 | 0 | 0 | 0 | 349 | 0 | -11 | 91 |
61b7ad7324ad24b52a4494738a06ea629b0d5dc9 | 2,052 | py | Python | example.py | neural-dialogue-metrics/rouge | 0cecc508dfef0415c2611b21ed32629481a0b3f4 | [
"MIT"
] | 18 | 2019-03-18T15:35:18.000Z | 2022-03-23T04:30:12.000Z | example.py | ibrahim85/rouge | 0cecc508dfef0415c2611b21ed32629481a0b3f4 | [
"MIT"
] | 1 | 2019-04-15T07:57:45.000Z | 2019-04-15T07:57:45.000Z | example.py | ibrahim85/rouge | 0cecc508dfef0415c2611b21ed32629481a0b3f4 | [
"MIT"
] | 6 | 2019-04-14T21:57:09.000Z | 2021-03-06T18:05:02.000Z | #!/usr/bin/env python3
"""Examples."""
from rouge import rouge_n_sentence_level
from rouge import rouge_l_sentence_level
from rouge import rouge_n_summary_level
from rouge import rouge_l_summary_level
from rouge import rouge_w_sentence_level
from rouge import rouge_w_summary_level
if __name__ == '__main__':
# The ... | 38 | 85 | 0.714425 | #!/usr/bin/env python3
"""Examples."""
from rouge import rouge_n_sentence_level
from rouge import rouge_l_sentence_level
from rouge import rouge_n_summary_level
from rouge import rouge_l_summary_level
from rouge import rouge_w_sentence_level
from rouge import rouge_w_summary_level
if __name__ == '__main__':
# The ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
73c1352f66fe4d329735eed601197bbae418e7bb | 8,123 | py | Python | scripts/sisc/paper_plot_thread_scaling_7_pt_const_coeff.py | tareqmalas/girih | 0c126788937d189147be47115703b752235e585c | [
"BSD-3-Clause"
] | 7 | 2015-07-14T08:29:14.000Z | 2021-07-30T14:53:13.000Z | scripts/sisc/paper_plot_thread_scaling_7_pt_const_coeff.py | tareqmalas/girih | 0c126788937d189147be47115703b752235e585c | [
"BSD-3-Clause"
] | null | null | null | scripts/sisc/paper_plot_thread_scaling_7_pt_const_coeff.py | tareqmalas/girih | 0c126788937d189147be47115703b752235e585c | [
"BSD-3-Clause"
] | 3 | 2016-08-30T01:25:40.000Z | 2017-06-22T05:50:05.000Z | #!/usr/bin/env python
if __name__ == "__main__":
main()
| 31.854902 | 231 | 0.538102 | #!/usr/bin/env python
def main():
import sys
raw_data = load_csv(sys.argv[1])
k_l = set()
for k in raw_data:
k_l.add(get_stencil_num(k))
k_l = list(k_l)
# for ts in ['Naive', 'Dynamic-Intra-Diamond']
for k in k_l:
for is_dp in [1]:
for t in [0, 1]:
... | 0 | 0 | 0 | 0 | 0 | 7,948 | 0 | 0 | 104 |
a8f155a92d85688ba2dfde64076b6a238ae4f072 | 4,646 | py | Python | mbp99/man-meet-woman.py | wang0618/ascii-art | 7ce6f152541716034bf0a22d341a898b17e2865f | [
"MIT"
] | 1 | 2021-08-29T09:52:06.000Z | 2021-08-29T09:52:06.000Z | mbp99/man-meet-woman.py | wang0618/ascii-art | 7ce6f152541716034bf0a22d341a898b17e2865f | [
"MIT"
] | null | null | null | mbp99/man-meet-woman.py | wang0618/ascii-art | 7ce6f152541716034bf0a22d341a898b17e2865f | [
"MIT"
] | null | null | null | # Man meets Woman --mpb99
# https://web.archive.org/web/20000529140001/http://www.geocities.com/Tokyo/Market/4878/animman.htm
duration = 350
name = "Man meets Woman"
a = "\n"
frames = [
" "+a+
" "+a+
" (5)"+a+
" "+a+
" mpb99 "+a,
" "+a+
" "+a+
" (4)"+a+
" "+a+
" ... | 13.951952 | 99 | 0.174774 | # Man meets Woman --mpb99
# https://web.archive.org/web/20000529140001/http://www.geocities.com/Tokyo/Market/4878/animman.htm
duration = 350
name = "Man meets Woman"
a = "\n"
frames = [
" "+a+
" "+a+
" (5)"+a+
" "+a+
" mpb99 "+a,
" "+a+
" "+a+
" (4)"+a+
" "+a+
" ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b4a7e404253c8083fa334300d6e317a0aa8193a2 | 2,511 | py | Python | examples/component.py | YiuRULE/nats.py | 3a78ba4c385e2069daf5ff560aadc30968af1ccd | [
"Apache-2.0"
] | 184 | 2016-02-04T13:51:52.000Z | 2019-05-10T02:36:48.000Z | examples/component.py | YiuRULE/nats.py | 3a78ba4c385e2069daf5ff560aadc30968af1ccd | [
"Apache-2.0"
] | 48 | 2016-01-31T11:45:05.000Z | 2019-05-05T22:00:07.000Z | examples/component.py | YiuRULE/nats.py | 3a78ba4c385e2069daf5ff560aadc30968af1ccd | [
"Apache-2.0"
] | 35 | 2016-01-04T23:03:43.000Z | 2019-04-05T17:56:30.000Z | import asyncio
if __name__ == '__main__':
try:
asyncio.run(main())
except:
pass
| 25.363636 | 91 | 0.562724 | import asyncio
import time
import os
import signal
import nats
class Component:
def __init__(self):
self._nc = None
self._done = asyncio.Future()
async def connect(self, *args, **kwargs):
self._nc = await nats.connect(*args, **kwargs)
async def run_forever(self):
await se... | 0 | 0 | 2,095 | 216 | 0 | 0 | 0 | -40 | 135 |
dadda3883a72630c7414a7827f85e4bab08a89e0 | 11,096 | py | Python | gcloud/tests/taskflow3/models/taskflow/test_is_manual_intervention_required.py | DomineCore/bk-sops | 1461d7d80d979778cf9dafb62819c3234387fabc | [
"Apache-2.0"
] | 881 | 2019-03-25T02:45:42.000Z | 2022-03-30T09:10:49.000Z | gcloud/tests/taskflow3/models/taskflow/test_is_manual_intervention_required.py | DomineCore/bk-sops | 1461d7d80d979778cf9dafb62819c3234387fabc | [
"Apache-2.0"
] | 3,303 | 2019-03-25T04:18:03.000Z | 2022-03-31T11:52:03.000Z | gcloud/tests/taskflow3/models/taskflow/test_is_manual_intervention_required.py | DomineCore/bk-sops | 1461d7d80d979778cf9dafb62819c3234387fabc | [
"Apache-2.0"
] | 395 | 2019-03-25T02:53:36.000Z | 2022-03-31T08:37:28.000Z | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making PaaS (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance ... | 40.794118 | 120 | 0.523342 | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 27 | 241 | 0 | 9,885 | 0 | 0 | 0 | 84 | 153 |
b18bc123d4ddc09fe79be6fe8745b752b8c62111 | 341 | py | Python | example1/data/analyse.py | eocarragain/bagit-ro | f5fca3abad60c86b3c4f95948b5d64c3bc8e51c6 | [
"BSD-2-Clause"
] | 18 | 2016-03-01T14:57:37.000Z | 2020-06-07T08:01:57.000Z | example1/data/analyse.py | eocarragain/bagit-ro | f5fca3abad60c86b3c4f95948b5d64c3bc8e51c6 | [
"BSD-2-Clause"
] | 2 | 2016-04-22T09:45:24.000Z | 2017-04-21T08:43:55.000Z | example1/data/analyse.py | ResearchObject/bagit-ro-ex1 | 7f6daf3eaa3350e6b448ef051654ace56b962432 | [
"BSD-2-Clause"
] | 7 | 2016-05-09T23:00:12.000Z | 2020-06-07T08:01:59.000Z | #!/usr/bin/env python
import csv, sys
numbers = csv.reader(open(sys.argv[1]))
drinkers = []
for row in numbers:
if row[0] == "Name": continue # header row.. right?
name = row[0]
cups = sum(map(int, row[1:]))
drinkers.append([cups, name])
drinkers.sort()
drinkers.reverse()
for (cups, name) in drinkers:... | 21.3125 | 55 | 0.639296 | #!/usr/bin/env python
import csv,sys
numbers = csv.reader(open(sys.argv[1]))
drinkers = []
for row in numbers:
if row[0] == "Name": continue # header row.. right?
name = row[0]
cups = sum(map(int, row[1:]))
drinkers.append([cups, name])
drinkers.sort()
drinkers.reverse()
for (cups, name) in drinkers:
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -1 | 0 |
430cc71029ad99febeeaf34c105278f118d09773 | 4,596 | py | Python | tests/test_feature_extractor.py | sassy/budoux | e2a3698b529b1d748d0c4268b7628fb6210c42fc | [
"Apache-2.0"
] | null | null | null | tests/test_feature_extractor.py | sassy/budoux | e2a3698b529b1d748d0c4268b7628fb6210c42fc | [
"Apache-2.0"
] | null | null | null | tests/test_feature_extractor.py | sassy/budoux | e2a3698b529b1d748d0c4268b7628fb6210c42fc | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 29.461538 | 79 | 0.6151 | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 84 | 0 | 0 | 3,579 | 0 | 0 | 0 | 26 | 67 |
39160b61fde98578e8fd5227bd652487216405b5 | 89,488 | py | Python | CGATReport/Plugins/Plotter.py | AndreasHeger/CGATReport | 681e198cd13ef533f1c496645a1754b2e0829232 | [
"MIT"
] | 9 | 2015-02-14T16:53:58.000Z | 2022-01-03T20:22:42.000Z | CGATReport/Plugins/Plotter.py | AndreasHeger/CGATReport | 681e198cd13ef533f1c496645a1754b2e0829232 | [
"MIT"
] | 26 | 2015-01-29T15:39:02.000Z | 2018-02-14T09:04:21.000Z | CGATReport/Plugins/Plotter.py | AndreasHeger/CGATReport | 681e198cd13ef533f1c496645a1754b2e0829232 | [
"MIT"
] | 4 | 2015-11-25T17:11:11.000Z | 2022-01-03T20:22:45.000Z | """Mixin classes for Renderers that plot.
"""
from __future__ import unicode_literals
import numpy
import matplotlib
# matplotlib.use('Agg', warn=False)
# This does not work:
# Matplotlib might be imported beforehand? plt.switch_backend did not
# change the backend. The only option I found was to change my own
# matp... | 32.120603 | 88 | 0.530663 | """Mixin classes for Renderers that plot.
"""
from __future__ import unicode_literals
import os
import re
import math
import itertools
import datetime
import pandas
from CGATReport.ResultBlock import ResultBlock, ResultBlocks
from CGATReport.Plugins.Renderer import Renderer, NumpyMatrix, TableMatrix
from CGATReport.... | 0 | 0 | 0 | 82,692 | 0 | 456 | 0 | 140 | 800 |
f41d2d839f67d0ab2bd7e5f804f893ad192a9523 | 13,544 | py | Python | numba/cfg.py | teoliphant/numba | a2a05737b306853c86c61ef6620c2cc43cb28c18 | [
"BSD-2-Clause"
] | 3 | 2015-08-28T21:13:58.000Z | 2022-01-21T17:02:14.000Z | numba/cfg.py | teoliphant/numba | a2a05737b306853c86c61ef6620c2cc43cb28c18 | [
"BSD-2-Clause"
] | null | null | null | numba/cfg.py | teoliphant/numba | a2a05737b306853c86c61ef6620c2cc43cb28c18 | [
"BSD-2-Clause"
] | null | null | null | #! /usr/bin/env python
# ______________________________________________________________________
'''cfg
Defines the ControlFlowGraph class, which is used by the Numba
translator to perform accurate phi node generation.
When used as the main module, displays the control flow graph for
arguments of the form <module.modu... | 38.477273 | 79 | 0.589929 | #! /usr/bin/env python
# ______________________________________________________________________
'''cfg
Defines the ControlFlowGraph class, which is used by the Numba
translator to perform accurate phi node generation.
When used as the main module, displays the control flow graph for
arguments of the form <module.modu... | 0 | 966 | 0 | 10,292 | 0 | 1,326 | 0 | -10 | 114 |
83ca1dfbb90537bc2bfe3983b8e555fa672c0f0a | 548 | py | Python | tests/device/test_read_measured_value.py | Sensirion/python-shdlc-sfc5xxx | f9bd288a996ad969ee5bbb7f52b6e8f00fdf47e5 | [
"BSD-3-Clause"
] | null | null | null | tests/device/test_read_measured_value.py | Sensirion/python-shdlc-sfc5xxx | f9bd288a996ad969ee5bbb7f52b6e8f00fdf47e5 | [
"BSD-3-Clause"
] | null | null | null | tests/device/test_read_measured_value.py | Sensirion/python-shdlc-sfc5xxx | f9bd288a996ad969ee5bbb7f52b6e8f00fdf47e5 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# (c) Copyright 2020 Sensirion AG, Switzerland
from __future__ import absolute_import, division, print_function
| 26.095238 | 64 | 0.739051 | # -*- coding: utf-8 -*-
# (c) Copyright 2020 Sensirion AG, Switzerland
from __future__ import absolute_import, division, print_function
from sensirion_shdlc_sfc5xxx import Sfc5xxxScaling
import pytest
@pytest.mark.needs_device
@pytest.mark.parametrize("scaling", [
(Sfc5xxxScaling.NORMALIZED),
(Sfc5xxxScaling... | 0 | 322 | 0 | 0 | 0 | 0 | 0 | 21 | 67 |
3bd27665cdf5971e208ac1c0357146113ac4758c | 3,376 | py | Python | bot/admin_handlers.py | svirepovden/tg_support_bot | 6c3d163514722ca28ec20e17d8aea4deccba51fb | [
"BSD-3-Clause"
] | null | null | null | bot/admin_handlers.py | svirepovden/tg_support_bot | 6c3d163514722ca28ec20e17d8aea4deccba51fb | [
"BSD-3-Clause"
] | null | null | null | bot/admin_handlers.py | svirepovden/tg_support_bot | 6c3d163514722ca28ec20e17d8aea4deccba51fb | [
"BSD-3-Clause"
] | null | null | null | from telegram.ext import (CommandHandler, MessageHandler, Filters, ConversationHandler)
# TODO get questions in realtime while answering
chat_id = None # used for storing to what chat answer must go
SHOW_MESSAGES, REPLY, GET_ANSWER, CHAT_ACTIONS = range(4)
admin_conv_handler = ConversationHandler(
entry_... | 37.511111 | 97 | 0.651066 | from .actions import is_admin, get_messages, save_message, change_chat_status
from telegram.ext import (Updater, CommandHandler, MessageHandler, Filters, CallbackContext,
ConversationHandler)
def admin(update, context: CallbackContext):
if is_admin(update.message):
context.bot.se... | 0 | 0 | 0 | 0 | 0 | 2,260 | 0 | 108 | 183 |
7e6a5b3702a2080dcb8f11f87a82a64d967ae80f | 2,922 | py | Python | tests/unit/test_protocol.py | NicolasEhrhardt/python-driver | ead86ea5e01b94d09c9022a2f01348bd147f8af0 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_protocol.py | NicolasEhrhardt/python-driver | ead86ea5e01b94d09c9022a2f01348bd147f8af0 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_protocol.py | NicolasEhrhardt/python-driver | ead86ea5e01b94d09c9022a2f01348bd147f8af0 | [
"Apache-2.0"
] | null | null | null |
try:
import unittest2 as unittest
except ImportError:
| 31.76087 | 114 | 0.592402 |
try:
import unittest2 as unittest
except ImportError:
import unittest # noqa
from mock import Mock
from cassandra import ProtocolVersion
from cassandra.protocol import PrepareMessage, QueryMessage, ExecuteMessage
class MessageTest(unittest.TestCase):
def test_prepare_message(self):
"""
T... | 0 | 0 | 0 | 2,676 | 0 | 0 | 0 | 64 | 123 |
2ce6dab9da58e48ce193bc42999fa7752904e8ff | 448,678 | py | Python | tests/functional/basic/db/test_26.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | tests/functional/basic/db/test_26.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | tests/functional/basic/db/test_26.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | #coding:utf-8
#
# id: functional.basic.db.26
# title: Empty DB - RDB$SECURITY_CLASSES
# decription: Check for correct content of RDB$SECURITY_CLASSES in empty database.
# tracker_id:
# min_versions: ['2.5.7']
# versions: 3.0, 4.0
# qmid: functional.basic.db.db_26
from firebird.qa impor... | 56.544171 | 288 | 0.292785 | #coding:utf-8
#
# id: functional.basic.db.26
# title: Empty DB - RDB$SECURITY_CLASSES
# decription: Check for correct content of RDB$SECURITY_CLASSES in empty database.
# tracker_id:
# min_versions: ['2.5.7']
# versions: 3.0, 4.0
# qmid: functional.basic.db.db_26
import pytest
from fi... | 0 | 329 | 0 | 0 | 0 | 0 | 0 | 0 | 69 |
a1068525133ef72aa06682794691f21e5c9d6339 | 394 | py | Python | lean_bundle/h5_backend/datatypes.py | d-schiffner/lean-bundle | 1d83f2f5b84ba9480a5a07fe45b7e5b6c48e0dca | [
"MIT"
] | null | null | null | lean_bundle/h5_backend/datatypes.py | d-schiffner/lean-bundle | 1d83f2f5b84ba9480a5a07fe45b7e5b6c48e0dca | [
"MIT"
] | null | null | null | lean_bundle/h5_backend/datatypes.py | d-schiffner/lean-bundle | 1d83f2f5b84ba9480a5a07fe45b7e5b6c48e0dca | [
"MIT"
] | null | null | null | import h5py
import numpy as np
REF_DT = h5py.special_dtype(ref=h5py.Reference)
KEY_VALUE_DT = np.dtype([('key', h5py.special_dtype(vlen=str)), ('value', h5py.special_dtype(vlen=str))])
#special type for actor object types
USER_TYPE_DT = h5py.special_dtype(enum=('i', ACTOR_TYPE_MAP))
INTERACTIVE_LO_DT = h5py.special_d... | 35.818182 | 105 | 0.769036 | import h5py
import numpy as np
from ..utils.datatypes import *
REF_DT = h5py.special_dtype(ref=h5py.Reference)
KEY_VALUE_DT = np.dtype([('key', h5py.special_dtype(vlen=str)), ('value', h5py.special_dtype(vlen=str))])
#special type for actor object types
USER_TYPE_DT = h5py.special_dtype(enum=('i', ACTOR_TYPE_MAP))
IN... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 22 |
391a2bc3c09ffeb77290ec40e2ea8ac7ffb27dff | 574 | py | Python | fgt_transposer/write.py | MoAl78741/FortiGate-Config-Merger | 9e5b4829e2deae24c62e5b12902ec0120fe3d557 | [
"MIT"
] | null | null | null | fgt_transposer/write.py | MoAl78741/FortiGate-Config-Merger | 9e5b4829e2deae24c62e5b12902ec0120fe3d557 | [
"MIT"
] | null | null | null | fgt_transposer/write.py | MoAl78741/FortiGate-Config-Merger | 9e5b4829e2deae24c62e5b12902ec0120fe3d557 | [
"MIT"
] | null | null | null | import logging
log_msg = logging.getLogger(f"priLogger.{__name__}")
| 30.210526 | 81 | 0.689895 | from fgt_transposer.exceptions import BackupException
from os import path
import logging
log_msg = logging.getLogger(f"priLogger.{__name__}")
def write_config(newfile_name, files):
with open(newfile_name, "w") as nn:
newfile = files
lst_of_keys = newfile.keys()
for i in lst_of_keys:
... | 0 | 0 | 0 | 0 | 0 | 407 | 0 | 30 | 67 |
02719cc7b780d80317e269a27b4ec57c792c3aa5 | 362 | py | Python | mopidy/m3u/backend.py | stekern/mopidy | 94509cf70f2bd35ebb13e746dde135bfbe35ce0e | [
"Apache-2.0"
] | 2 | 2019-02-13T15:16:55.000Z | 2019-02-18T08:47:29.000Z | mopidy/m3u/backend.py | stekern/mopidy | 94509cf70f2bd35ebb13e746dde135bfbe35ce0e | [
"Apache-2.0"
] | 40 | 2019-02-13T09:33:00.000Z | 2019-02-19T13:21:12.000Z | mopidy/m3u/backend.py | stekern/mopidy | 94509cf70f2bd35ebb13e746dde135bfbe35ce0e | [
"Apache-2.0"
] | 1 | 2021-10-01T17:26:30.000Z | 2021-10-01T17:26:30.000Z | from __future__ import absolute_import, unicode_literals
| 22.625 | 69 | 0.748619 | from __future__ import absolute_import, unicode_literals
import pykka
from mopidy import backend
from . import playlists
class M3UBackend(pykka.ThreadingActor, backend.Backend):
uri_schemes = ['m3u']
def __init__(self, config, audio):
super(M3UBackend, self).__init__()
self.playlists = pla... | 0 | 0 | 0 | 214 | 0 | 0 | 0 | -2 | 92 |
b640ae3248e940a8341e0a31d9cb75d1327f5d4b | 1,884 | py | Python | Curso Em Video-python/PYTHON (MUNDO 1, MUNDO 2 E MUNDO 3)/exercicios/ex0094Unindo_dict_listas.py | AlamoVinicius/code-pratice | 924a3ff782caf3695bbeeac39fa02fb23781cd75 | [
"MIT"
] | null | null | null | Curso Em Video-python/PYTHON (MUNDO 1, MUNDO 2 E MUNDO 3)/exercicios/ex0094Unindo_dict_listas.py | AlamoVinicius/code-pratice | 924a3ff782caf3695bbeeac39fa02fb23781cd75 | [
"MIT"
] | null | null | null | Curso Em Video-python/PYTHON (MUNDO 1, MUNDO 2 E MUNDO 3)/exercicios/ex0094Unindo_dict_listas.py | AlamoVinicius/code-pratice | 924a3ff782caf3695bbeeac39fa02fb23781cd75 | [
"MIT"
] | null | null | null | """ Crie um programa que leia nome, sexo e idade de vrias pessoas, guardando os dados de cada pessoa em um
dicionrio e todos os dicionrios em uma lista. No final, msotre:
a - quantas pessoas foram cadastradas/ b - a mdia de idade do grupo/ c- uma lista com todas as mulheres.
d - uma lista com todas as pessoas com idade... | 37.68 | 115 | 0.66242 | """ Crie um programa que leia nome, sexo e idade de várias pessoas, guardando os dados de cada pessoa em um
dicionário e todos os dicionários em uma lista. No final, msotre:
a - quantas pessoas foram cadastradas/ b - a média de idade do grupo/ c- uma lista com todas as mulheres.
d - uma lista com todas as pessoas com i... | 40 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7286eb32f766700e67aec25ff5e57a270360fdf5 | 3,329 | py | Python | toolbox/data_handler.py | mlelarge/graph_neural_net | bd4ade9312d945b8baadc7709d134ea6af0fc0bb | [
"Apache-2.0"
] | 36 | 2020-03-18T18:56:20.000Z | 2022-03-31T13:39:09.000Z | toolbox/data_handler.py | mlelarge/graph_neural_net | bd4ade9312d945b8baadc7709d134ea6af0fc0bb | [
"Apache-2.0"
] | 11 | 2020-02-25T18:46:23.000Z | 2022-02-07T11:01:37.000Z | toolbox/data_handler.py | mlelarge/graph_neural_net | bd4ade9312d945b8baadc7709d134ea6af0fc0bb | [
"Apache-2.0"
] | 17 | 2020-02-25T18:29:48.000Z | 2022-03-31T13:39:42.000Z | from collections import namedtuple
Task = namedtuple('Task',['column_name','value']) | 31.40566 | 120 | 0.572244 | import pandas as pd
import os
from toolbox.utils import check_file
from collections import namedtuple,deque
class DataHandler():
def __init__(self,filepath) -> None:
self.filepath = filepath
self.data = pd.DataFrame()
self.read(filepath)
def write(self,filepath=''):
if... | 0 | 42 | 0 | 3,081 | 0 | 0 | 0 | 7 | 112 |
22e43818268c9c794932435f41c2180cf9b3e7db | 14,201 | py | Python | comtypes/server/register.py | junkmd/comtypes | 3be0028fad7ac414a43af592484b7608381e0615 | [
"MIT"
] | 1 | 2022-02-25T13:46:54.000Z | 2022-02-25T13:46:54.000Z | comtypes/server/register.py | junkmd/comtypes | 3be0028fad7ac414a43af592484b7608381e0615 | [
"MIT"
] | null | null | null | comtypes/server/register.py | junkmd/comtypes | 3be0028fad7ac414a43af592484b7608381e0615 | [
"MIT"
] | 1 | 2022-02-25T13:47:47.000Z | 2022-02-25T13:47:47.000Z | """comtypes.server.register - register and unregister a COM object.
Exports the UseCommandLine function. UseCommandLine is called with
the COM object classes that a module exposes. It parses the Windows
command line and takes the appropriate actions.
These command line options are supported:
/regserver - register t... | 37.469657 | 117 | 0.594958 | """comtypes.server.register - register and unregister a COM object.
Exports the UseCommandLine function. UseCommandLine is called with
the COM object classes that a module exposes. It parses the Windows
command line and takes the appropriate actions.
These command line options are supported:
/regserver - register t... | 0 | 0 | 0 | 10,394 | 0 | 1,495 | 0 | 140 | 282 |
0db440d4886e1de9666e887db833f804e052aceb | 428 | py | Python | src/waldur_rancher/tests/utils.py | geant-multicloud/MCMS-mastermind | 81333180f5e56a0bc88d7dad448505448e01f24e | [
"MIT"
] | 26 | 2017-10-18T13:49:58.000Z | 2021-09-19T04:44:09.000Z | src/waldur_rancher/tests/utils.py | geant-multicloud/MCMS-mastermind | 81333180f5e56a0bc88d7dad448505448e01f24e | [
"MIT"
] | 14 | 2018-12-10T14:14:51.000Z | 2021-06-07T10:33:39.000Z | src/waldur_rancher/tests/utils.py | geant-multicloud/MCMS-mastermind | 81333180f5e56a0bc88d7dad448505448e01f24e | [
"MIT"
] | 32 | 2017-09-24T03:10:45.000Z | 2021-10-16T16:41:09.000Z | import json
import pkg_resources
backend_node_response = json.loads(
pkg_resources.resource_stream(__name__, 'backend_node.json').read().decode()
)
| 25.176471 | 80 | 0.806075 | import copy
import json
import pkg_resources
from django.conf import settings
from django.test import override_settings
backend_node_response = json.loads(
pkg_resources.resource_stream(__name__, 'backend_node.json').read().decode()
)
def override_plugin_settings(**kwargs):
os_settings = copy.deepcopy(setti... | 0 | 0 | 0 | 0 | 0 | 163 | 0 | 21 | 89 |
7bed7bac0864f20a192d2398a2fa808183443d70 | 427 | py | Python | Physics250-ME21/conductingRing.py | illusion173/Physics250 | 69f2ffdb8af013e8b0739779861c1455b579ddaf | [
"MIT"
] | null | null | null | Physics250-ME21/conductingRing.py | illusion173/Physics250 | 69f2ffdb8af013e8b0739779861c1455b579ddaf | [
"MIT"
] | null | null | null | Physics250-ME21/conductingRing.py | illusion173/Physics250 | 69f2ffdb8af013e8b0739779861c1455b579ddaf | [
"MIT"
] | null | null | null |
Esubo = 8.854 * pow(10,-12)
k = 8.988 * pow(10,9)
chargeconstant = 1.602 * pow(10,-19)
conductingRing() | 21.35 | 93 | 0.613583 | import numpy as np
import math
Esubo = 8.854 * pow(10,-12)
k = 8.988 * pow(10,9)
chargeconstant = 1.602 * pow(10,-19)
def conductingRing():
charge = float(input("Input Charge: "))
radius = float(input("Radius: "))
distance = float(input("Distance: "))
electricField = ((k * charge * dis... | 0 | 0 | 0 | 0 | 0 | 264 | 0 | -13 | 67 |
ac35996dba9afde822b77d1b4ba444f9662895aa | 2,437 | py | Python | ben_ten_adventure/ui.py | Ben-10-Secret-of-the-Omnitrix-Game/Ben-10-Adventure | ede699de0369e6614665acc06b872f81bbb124c8 | [
"MIT"
] | 1 | 2021-01-16T21:48:32.000Z | 2021-01-16T21:48:32.000Z | ben_ten_adventure/ui.py | Ben-10-Secret-of-the-Omnitrix-Game/Ben-10-Adventure | ede699de0369e6614665acc06b872f81bbb124c8 | [
"MIT"
] | null | null | null | ben_ten_adventure/ui.py | Ben-10-Secret-of-the-Omnitrix-Game/Ben-10-Adventure | ede699de0369e6614665acc06b872f81bbb124c8 | [
"MIT"
] | null | null | null | import pygame
from pygame.transform import scale
HD = (1280, 720)
FULL_HD = (1920, 1080)
def vertical(size, startcolor, endcolor):
"""
Draws a vertical linear gradient filling the entire surface. Returns a
surface filled with the gradient (numeric is only 2-3 times faster).
"""
height = size[1]
... | 40.616667 | 111 | 0.61387 | import pygame_gui
import pygame
from pygame.transform import scale
from .game_engine import RESOLUTION, ga, manager
HD = (1280, 720)
FULL_HD = (1920, 1080)
def vertical(size, startcolor, endcolor):
"""
Draws a vertical linear gradient filling the entire surface. Returns a
surface filled with the gradie... | 0 | 0 | 0 | 0 | 0 | 1,503 | 0 | 23 | 68 |
e75405f656394553bba9f371073eac1ef69a8ee7 | 2,979 | py | Python | routes/internal_routes.py | Madpilot0/FlaskDashboard | 73fddbee9f04da415ffdbf6f4062d17dc777aed5 | [
"MIT"
] | 2 | 2018-12-15T03:55:23.000Z | 2021-03-23T09:23:25.000Z | routes/internal_routes.py | Madpilot0/FlaskDashboard | 73fddbee9f04da415ffdbf6f4062d17dc777aed5 | [
"MIT"
] | 2 | 2018-08-31T19:13:03.000Z | 2021-02-04T12:41:31.000Z | routes/internal_routes.py | Madpilot0/FlaskDashboard | 73fddbee9f04da415ffdbf6f4062d17dc777aed5 | [
"MIT"
] | 3 | 2020-08-21T02:19:16.000Z | 2021-03-10T19:15:07.000Z | from flask import Blueprint
from lib.Users import Users
from lib.Groups import Groups
from lib.Database import Database
internal_routes = Blueprint('internal_routes', __name__, template_folder='templates')
users = Users()
groups = Groups()
db = Database()
#Internal routes
#Users
#Groups | 27.841121 | 88 | 0.772071 | from flask import Blueprint, render_template, abort, session, redirect, url_for, request
from functools import wraps
from lib.Users import Users
from lib.Groups import Groups
from lib.Database import Database
import json
def requires_auth(f):
@wraps(f)
def decorated_auth(*args, **kwargs):
if 'username' not in sess... | 0 | 2,195 | 0 | 0 | 0 | 94 | 0 | 57 | 341 |
cb3a583cba047c6edf4fadbc326270db7a1780ab | 829 | py | Python | setup.py | akaariai/drf-fast-serializer | ff286e58f1a073a4fe6f256fe2279e9fb39bbcee | [
"MIT"
] | 27 | 2015-03-01T19:15:55.000Z | 2022-01-13T22:57:43.000Z | setup.py | akaariai/drf-fast-serializer | ff286e58f1a073a4fe6f256fe2279e9fb39bbcee | [
"MIT"
] | 1 | 2015-03-01T19:19:00.000Z | 2015-03-01T19:19:00.000Z | setup.py | akaariai/drf-fast-serializer | ff286e58f1a073a4fe6f256fe2279e9fb39bbcee | [
"MIT"
] | 8 | 2015-07-10T08:24:12.000Z | 2020-10-05T19:54:45.000Z | # -*- encoding: utf-8 -*-
from setuptools import setup
setup(
name="drf-fast-serializer",
version="0.1-dev",
description="A fast serializer mixin for Django request framework",
long_description=read('readme.md'),
url='https://github.com/akaariai/drf-fast-serializer',
license='MIT',
author=u'... | 31.884615 | 71 | 0.640531 | # -*- encoding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name="drf-fast-serializer",
version="0.1-dev",
description="A fast serializer mixin for Django request framework",
long_description=read('readme... | 6 | 0 | 0 | 0 | 0 | 66 | 0 | -12 | 44 |
102046e68e582ec40bf3e5235359ef4f4a81ca45 | 1,088 | py | Python | src/arbies/workers/image.py | broiledmeat/arbies | 29f3ce498dbd3265b1181dde62629df3deda0440 | [
"MIT"
] | null | null | null | src/arbies/workers/image.py | broiledmeat/arbies | 29f3ce498dbd3265b1181dde62629df3deda0440 | [
"MIT"
] | null | null | null | src/arbies/workers/image.py | broiledmeat/arbies | 29f3ce498dbd3265b1181dde62629df3deda0440 | [
"MIT"
] | null | null | null | from __future__ import annotations
| 32 | 78 | 0.651654 | from __future__ import annotations
from PIL import Image
from typing import Optional
from arbies import drawing
from arbies.drawing import HorizontalAlignment, VerticalAlignment
from arbies.manager import Manager, ConfigDict
from arbies.workers import Worker
class ImageWorker(Worker):
def __init__(self, manager: ... | 0 | 252 | 0 | 553 | 0 | 0 | 0 | 92 | 155 |
3c626024e40ae3dde1f4925204274dc99f9dec89 | 138 | py | Python | my/reading/goodreads.py | aluhrs13/HPI | e750666e30e8987f3a4c46755857dc85dd64446c | [
"MIT"
] | 1,026 | 2020-03-16T16:53:29.000Z | 2022-03-29T16:03:38.000Z | my/reading/goodreads.py | aluhrs13/HPI | e750666e30e8987f3a4c46755857dc85dd64446c | [
"MIT"
] | 102 | 2020-03-18T22:53:29.000Z | 2022-03-22T00:34:46.000Z | my/reading/goodreads.py | aluhrs13/HPI | e750666e30e8987f3a4c46755857dc85dd64446c | [
"MIT"
] | 50 | 2020-03-17T21:00:34.000Z | 2022-03-28T08:37:13.000Z | from my.core import warnings
warnings.medium('my.reading.goodreads is deprecated! Use my.goodreads instead!')
| 23 | 80 | 0.782609 | from my.core import warnings
warnings.medium('my.reading.goodreads is deprecated! Use my.goodreads instead!')
from ..goodreads import *
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 23 |
db28497c5293e87aa7f5a3bd4a943451b7e89387 | 4,551 | py | Python | flod_organisations/alembic/versions/20140123-0821-56aa02f54e74_converting_brreg_activity_codes_from_fixture_.py | Trondheim-kommune/Tilskuddsbasen | 4f8ce270ef7296069f8e43bfb4bf6a570a7a35d4 | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2017-10-17T12:15:28.000Z | 2017-10-17T12:15:28.000Z | flod_organisations/alembic/versions/20140123-0821-56aa02f54e74_converting_brreg_activity_codes_from_fixture_.py | Trondheim-kommune/Bookingbasen | 58235a5a1fd6ad291cb237e6ec9a67bfe8c463c6 | [
"BSD-2-Clause-FreeBSD"
] | 6 | 2021-03-22T17:15:52.000Z | 2022-01-13T00:39:58.000Z | flod_organisations/alembic/versions/20140123-0821-56aa02f54e74_converting_brreg_activity_codes_from_fixture_.py | Trondheim-kommune/Tilskuddsbasen | 4f8ce270ef7296069f8e43bfb4bf6a570a7a35d4 | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2019-09-09T13:35:03.000Z | 2019-09-09T13:35:03.000Z | # -*- coding: utf-8 -*-
"""Converting brreg_activity_codes from fixture to alembic migration
Revision ID: 56aa02f54e74
Revises: 357cc9fc466b
Create Date: 2014-01-23 08:21:22.953015
"""
# revision identifiers, used by Alembic.
revision = '56aa02f54e74'
down_revision = '357cc9fc466b'
| 27.920245 | 78 | 0.390024 | # -*- coding: utf-8 -*-
"""Converting brreg_activity_codes from fixture to alembic migration
Revision ID: 56aa02f54e74
Revises: 357cc9fc466b
Create Date: 2014-01-23 08:21:22.953015
"""
# revision identifiers, used by Alembic.
from sqlalchemy.sql import table, column
from sqlalchemy import String
revision = '56aa02f... | 20 | 0 | 0 | 0 | 0 | 4,111 | 0 | 28 | 113 |
d48aa0eeb406712e8546275fb2e2aae57dc24dde | 159 | py | Python | Python Fundamentals/2. Data Types and Variables/More Exercises/03. Decrypting Messages.py | a-shiro/SoftUni-Courses | 7d0ca6401017a28b5ff7e7fa3e5df8bba8ddbe77 | [
"MIT"
] | null | null | null | Python Fundamentals/2. Data Types and Variables/More Exercises/03. Decrypting Messages.py | a-shiro/SoftUni-Courses | 7d0ca6401017a28b5ff7e7fa3e5df8bba8ddbe77 | [
"MIT"
] | null | null | null | Python Fundamentals/2. Data Types and Variables/More Exercises/03. Decrypting Messages.py | a-shiro/SoftUni-Courses | 7d0ca6401017a28b5ff7e7fa3e5df8bba8ddbe77 | [
"MIT"
] | null | null | null | key = int(input())
lines = int(input())
decrypted = ""
for _ in range(lines):
letter = input()
decrypted += chr(ord(letter) + key)
print(decrypted) | 14.454545 | 39 | 0.616352 | key = int(input())
lines = int(input())
decrypted = ""
for _ in range(lines):
letter = input()
decrypted += chr(ord(letter) + key)
print(decrypted) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4c6f5a8d2924c4754159ef0ebec519f1097c6303 | 1,594 | py | Python | XML/pycopia/XML/SVG.py | kdart/pycopia | 1446fabaedf8c6bdd4ab1fc3f0ea731e0ef8da9d | [
"Apache-2.0"
] | 89 | 2015-03-26T11:25:20.000Z | 2022-01-12T06:25:14.000Z | XML/pycopia/XML/SVG.py | kdart/pycopia | 1446fabaedf8c6bdd4ab1fc3f0ea731e0ef8da9d | [
"Apache-2.0"
] | 1 | 2015-07-05T03:27:43.000Z | 2015-07-11T06:21:20.000Z | XML/pycopia/XML/SVG.py | kdart/pycopia | 1446fabaedf8c6bdd4ab1fc3f0ea731e0ef8da9d | [
"Apache-2.0"
] | 30 | 2015-04-30T01:35:54.000Z | 2022-01-12T06:19:49.000Z | #!/usr/bin/python2.7
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
# 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
... | 24.151515 | 82 | 0.71079 | #!/usr/bin/python2.7
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
# 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
... | 0 | 0 | 0 | 59 | 0 | 236 | 0 | 0 | 92 |
fb384f229420aa34cb7f12e50bd7903777f0a193 | 381 | py | Python | day3/day3.py | partridgems/advent2018 | c5b447a4df1f0ee3e28a656ee6597f605f2d7b79 | [
"MIT"
] | null | null | null | day3/day3.py | partridgems/advent2018 | c5b447a4df1f0ee3e28a656ee6597f605f2d7b79 | [
"MIT"
] | null | null | null | day3/day3.py | partridgems/advent2018 | c5b447a4df1f0ee3e28a656ee6597f605f2d7b79 | [
"MIT"
] | null | null | null |
main()
| 14.111111 | 66 | 0.551181 | import sys
import numpy
import re
def main():
fabric = numpy.zeros((1000,1000))
for claim in sys.stdin.readlines():
nums = [int(x) for x in re.split(' @ |,|: |x',claim)[1:]]
if len(nums) < 4:
continue
(b,l,t,r) = (nums[0],nums[1],nums[0]+nums[2],nums[1]+nums[3])
# print(b,t,l,r)
fabric[b:... | 0 | 0 | 0 | 0 | 0 | 307 | 0 | -32 | 89 |
5ab6f2c817b76a5338a950b54956ecb1e442d955 | 1,917 | py | Python | keystone/cmd/doctor/ldap.py | dtroyer/keystone | ba21db422d4f58c185e1b4414e118f723c33b959 | [
"Apache-2.0"
] | null | null | null | keystone/cmd/doctor/ldap.py | dtroyer/keystone | ba21db422d4f58c185e1b4414e118f723c33b959 | [
"Apache-2.0"
] | null | null | null | keystone/cmd/doctor/ldap.py | dtroyer/keystone | ba21db422d4f58c185e1b4414e118f723c33b959 | [
"Apache-2.0"
] | null | null | null | # 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
# distributed under t... | 36.169811 | 77 | 0.745436 | # 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
# distributed under t... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3f409adad054046b5315883c8e55c4733338b896 | 450 | py | Python | Arrangement/5568.py | miiiingi/algorithmstudy | 75eaf97e2c41d7edf32eb4a57d4d7685c9218aba | [
"MIT"
] | null | null | null | Arrangement/5568.py | miiiingi/algorithmstudy | 75eaf97e2c41d7edf32eb4a57d4d7685c9218aba | [
"MIT"
] | null | null | null | Arrangement/5568.py | miiiingi/algorithmstudy | 75eaf97e2c41d7edf32eb4a57d4d7685c9218aba | [
"MIT"
] | null | null | null | import itertools
list_num = list()
n = int(input())
k = int(input())
for _ in range(n) :
number = input()
list_num.append(number)
cat_num = itertools.combinations(list_num, k)
_answer = list()
for nums in cat_num :
num = itertools.permutations(nums, k)
for n in num :
str_sum = ''
for... | 21.428571 | 45 | 0.595556 | import itertools
list_num = list()
n = int(input())
k = int(input())
for _ in range(n) :
number = input()
list_num.append(number)
cat_num = itertools.combinations(list_num, k)
_answer = list()
for nums in cat_num :
num = itertools.permutations(nums, k)
for n in num :
str_sum = ''
for... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f0b9c3a404369231c434674735d3e6ae78005ca9 | 261,031 | py | Python | instances/passenger_demand/pas-20210422-1717-int16e/29.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null | instances/passenger_demand/pas-20210422-1717-int16e/29.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null | instances/passenger_demand/pas-20210422-1717-int16e/29.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null |
"""
PASSENGERS
"""
numPassengers = 30558
passenger_arriving = (
(11, 2, 10, 9, 2, 7, 2, 5, 2, 1, 1, 0, 0, 9, 8, 6, 8, 2, 5, 1, 5, 4, 1, 1, 1, 0), # 0
(9, 12, 9, 9, 8, 2, 1, 4, 2, 0, 1, 2, 0, 8, 6, 8, 5, 2, 5, 7, 3, 3, 1, 0, 2, 0), # 1
(4, 3, 8, 10, 7, 5, 1, 6, 4, 4, 1, 0, 0, 15, 10, 4, 8, 4, 5, 3, 2, 5, 1, 2, 1... | 279.17754 | 491 | 0.771966 |
"""
PASSENGERS
"""
numPassengers = 30558
passenger_arriving = (
(11, 2, 10, 9, 2, 7, 2, 5, 2, 1, 1, 0, 0, 9, 8, 6, 8, 2, 5, 1, 5, 4, 1, 1, 1, 0), # 0
(9, 12, 9, 9, 8, 2, 1, 4, 2, 0, 1, 2, 0, 8, 6, 8, 5, 2, 5, 7, 3, 3, 1, 0, 2, 0), # 1
(4, 3, 8, 10, 7, 5, 1, 6, 4, 4, 1, 0, 0, 15, 10, 4, 8, 4, 5, 3, 2, 5, 1, 2, 1... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6a1661feb3eadbed22acb7a1f2831cbf3dc0a31f | 6,002 | py | Python | tests/test_ghdl_testsuite.py | lionheart117/hdlConvertor | 935941471fbb592942776d2c46af2be0b14b9b06 | [
"MIT"
] | 1 | 2022-02-17T23:32:46.000Z | 2022-02-17T23:32:46.000Z | tests/test_ghdl_testsuite.py | curiousTauseef/hdlConvertor | 5041c2cca2d14f47237dc4e91fd3228a88bd01df | [
"MIT"
] | null | null | null | tests/test_ghdl_testsuite.py | curiousTauseef/hdlConvertor | 5041c2cca2d14f47237dc4e91fd3228a88bd01df | [
"MIT"
] | null | null | null | # import sys
import os
import sys
import unittest
from tests.extern_test_utils import generate_external_testcase_class
from tests.time_logging_test_runner import TimeLoggingTestRunner
if sys.version_info.major == 2:
FileNotFoundError = IOError
GHDL_ROOT = os.path.join(os.path.dirname(__file__), "ghdl")
# use th... | 40.281879 | 100 | 0.623292 | # import sys
import os
import sys
import unittest
from hdlConvertorAst.language import Language
from tests.extern_test_utils import generate_external_testcase_class, \
ExternTestSpec, check_git_submodule
from tests.file_utils import find_files
from tests.time_logging_test_runner import TimeLoggingTestRunner
if sy... | 0 | 0 | 0 | 0 | 4,356 | 0 | 0 | 83 | 94 |
57081792105256d9dd6d7742e02c6fbe86c8f49f | 601 | py | Python | python-questions-for-pratices/Question-88.py | siddharth-143/Python | 293f4643a3a13e3b82d23fd8922db54dbb0f12bc | [
"MIT"
] | null | null | null | python-questions-for-pratices/Question-88.py | siddharth-143/Python | 293f4643a3a13e3b82d23fd8922db54dbb0f12bc | [
"MIT"
] | null | null | null | python-questions-for-pratices/Question-88.py | siddharth-143/Python | 293f4643a3a13e3b82d23fd8922db54dbb0f12bc | [
"MIT"
] | null | null | null | """
Question 88 :
With a given list [12, 24,35, 24, 88,120, 155, 88, 120, 155],
write a program to print this list after removing all duplicate values
with original order reserved.
Hints : Use set() to store a number of values without duplicate.
"""
# Solution :
li = [12, 24,35, 24, 88,120, 155, 88,... | 20.033333 | 74 | 0.603993 | """
Question 88 :
With a given list [12, 24,35, 24, 88,120, 155, 88, 120, 155],
write a program to print this list after removing all duplicate values
with original order reserved.
Hints : Use set() to store a number of values without duplicate.
"""
# Solution :
def remove_duplicate(li):
new_lis... | 0 | 0 | 0 | 0 | 0 | 171 | 0 | 0 | 23 |
a69b107084d776967e5e8d71a7570a2c2abdcf48 | 5,591 | py | Python | src/schnetpack/datasets/omdb.py | sxie22/schnetpack | a421e7c121c7bdb2838fb30f887812110ecfa3c6 | [
"MIT"
] | null | null | null | src/schnetpack/datasets/omdb.py | sxie22/schnetpack | a421e7c121c7bdb2838fb30f887812110ecfa3c6 | [
"MIT"
] | null | null | null | src/schnetpack/datasets/omdb.py | sxie22/schnetpack | a421e7c121c7bdb2838fb30f887812110ecfa3c6 | [
"MIT"
] | 1 | 2022-02-10T17:39:11.000Z | 2022-02-10T17:39:11.000Z |
__all__ = ["OrganicMaterialsDatabase"]
| 38.826389 | 107 | 0.630478 | import logging
import os
import tarfile
from typing import List, Optional, Dict
from ase.io import read
import numpy as np
import torch
from schnetpack.data import *
from schnetpack.data import AtomsDataModuleError, AtomsDataModule
__all__ = ["OrganicMaterialsDatabase"]
class OrganicMaterialsDatabase(AtomsDataMod... | 0 | 0 | 0 | 5,292 | 0 | 0 | 0 | 34 | 223 |
bb22e5b12a23cf9898a8b386b4ed12add15908fc | 4,879 | py | Python | km3pipe/cmd.py | kabartay/km3pipe | 491c425486553e8986682d2b0614918dd23cc964 | [
"MIT"
] | 2 | 2017-01-19T17:22:49.000Z | 2020-04-18T14:00:38.000Z | km3pipe/cmd.py | kabartay/km3pipe | 491c425486553e8986682d2b0614918dd23cc964 | [
"MIT"
] | null | null | null | km3pipe/cmd.py | kabartay/km3pipe | 491c425486553e8986682d2b0614918dd23cc964 | [
"MIT"
] | null | null | null | # coding=utf-8
# Filename: cmd.py
"""
KM3Pipe command line utility.
Usage:
km3pipe test
km3pipe update [GIT_BRANCH]
km3pipe detx DET_ID [-m] [-t T0_SET] [-c CALIBR_ID]
km3pipe runtable [-n RUNS] [-s REGEX] [--temporary] DET_ID
km3pipe runinfo [--temporary] DET_ID RUN
km3pipe retrieve DET_ID RUN... | 30.685535 | 96 | 0.589465 | # coding=utf-8
# Filename: cmd.py
"""
KM3Pipe command line utility.
Usage:
km3pipe test
km3pipe update [GIT_BRANCH]
km3pipe detx DET_ID [-m] [-t T0_SET] [-c CALIBR_ID]
km3pipe runtable [-n RUNS] [-s REGEX] [--temporary] DET_ID
km3pipe runinfo [--temporary] DET_ID RUN
km3pipe retrieve DET_ID RUN... | 0 | 0 | 0 | 0 | 0 | 2,553 | 0 | 41 | 204 |
5fc233a9c384203a775a4a15b2f31cc660ce4031 | 11,803 | py | Python | parse_config.py | jdeuschel/DistrShiftsOnFacialData | 577c89ca0f9a31be0031f90990f0efe7548550f7 | [
"Apache-2.0"
] | null | null | null | parse_config.py | jdeuschel/DistrShiftsOnFacialData | 577c89ca0f9a31be0031f90990f0efe7548550f7 | [
"Apache-2.0"
] | null | null | null | parse_config.py | jdeuschel/DistrShiftsOnFacialData | 577c89ca0f9a31be0031f90990f0efe7548550f7 | [
"Apache-2.0"
] | null | null | null | from functools import reduce
from operator import getitem
# from logger import setup_logging
# helper functions to update config dict with custom cli options
def _set_by_path(tree, keys, value):
"""Set a value in a nested object in tree by sequence of keys."""
keys = keys.split(";")
_get_by_path(tree... | 45.222222 | 142 | 0.61908 | import os
import logging
from pathlib import Path
from functools import reduce, partial
from operator import getitem
from datetime import datetime
# from logger import setup_logging
from utils import read_yml, write_yml
import collections
import json
class Singleton(type):
_instances = {}
def __call__(cls, *a... | 0 | 4,635 | 0 | 5,839 | 0 | 573 | 0 | 4 | 268 |
e9fad6bdb4159e681b3eac8d471935bffe95ee70 | 20,457 | py | Python | alf/utils/data_buffer.py | Haichao-Zhang/alf_randperm_reproduce | d5223b7534ab20ca725aac940ad274ef806d1d3e | [
"Apache-2.0"
] | null | null | null | alf/utils/data_buffer.py | Haichao-Zhang/alf_randperm_reproduce | d5223b7534ab20ca725aac940ad274ef806d1d3e | [
"Apache-2.0"
] | null | null | null | alf/utils/data_buffer.py | Haichao-Zhang/alf_randperm_reproduce | d5223b7534ab20ca725aac940ad274ef806d1d3e | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019 Horizon Robotics. 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 applicab... | 39.114723 | 93 | 0.588698 | # Copyright (c) 2019 Horizon Robotics. 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 applicab... | 0 | 5,065 | 0 | 13,971 | 0 | 62 | 0 | 30 | 274 |
7e08175ea5c98010a48c0c4126af4cb1ccc72874 | 852 | py | Python | bytenet/utils.py | tindzk/bsnlp | 5b3e7ca746506e426b399490f9da6a31aee83f9e | [
"MIT"
] | 1 | 2017-03-31T08:50:30.000Z | 2017-03-31T08:50:30.000Z | bytenet/utils.py | tindzk/bsnlp | 5b3e7ca746506e426b399490f9da6a31aee83f9e | [
"MIT"
] | null | null | null | bytenet/utils.py | tindzk/bsnlp | 5b3e7ca746506e426b399490f9da6a31aee83f9e | [
"MIT"
] | null | null | null |
# If length -1, no validation data
| 28.4 | 71 | 0.639671 | import json
import codecs
import itertools
import numpy as np
# If length -1, no validation data
def loadDataSet(file, length = -1):
with codecs.open(file, encoding = 'utf-8') as f:
arr = json.load(f)
if length == -1: return arr, []
else:
assert(length * 2 <= len(arr))
... | 0 | 0 | 0 | 0 | 0 | 663 | 0 | -26 | 179 |
d5e00b75ff7eee48d6500ffb6e36796e8a82f344 | 8,836 | py | Python | sciencebeam_gym/tools/calculate_class_weights.py | elifesciences/sciencebeam-gym | 3ad654e08775e0c0cdd256753e14093bb5a42d44 | [
"MIT"
] | 25 | 2017-07-25T12:44:55.000Z | 2020-09-30T22:16:50.000Z | sciencebeam_gym/tools/calculate_class_weights.py | elifesciences/sciencebeam-gym | 3ad654e08775e0c0cdd256753e14093bb5a42d44 | [
"MIT"
] | 192 | 2017-11-29T08:57:03.000Z | 2022-03-29T18:44:41.000Z | sciencebeam_gym/tools/calculate_class_weights.py | elifesciences/sciencebeam-gym | 3ad654e08775e0c0cdd256753e14093bb5a42d44 | [
"MIT"
] | 6 | 2019-02-01T18:49:33.000Z | 2020-07-26T08:18:46.000Z | from __future__ import division
from __future__ import print_function
import logging
import numpy as np
def calculate_median_class_weight(class_frequencies):
"""
Perform median frequency balancing on the image files, given by the formula:
f = Median_freq_c / total_freq_c
where median_fre... | 31.44484 | 99 | 0.69081 | from __future__ import division
from __future__ import print_function
import argparse
import logging
import json
import numpy as np
import tensorflow as tf
from tensorflow.python.lib.io import file_io # pylint: disable=E0611
from tqdm import tqdm
from sciencebeam_gym.preprocess.color_map import (
parse_color_ma... | 0 | 0 | 0 | 0 | 1,705 | 5,168 | 0 | 225 | 665 |
02261c29290fe4010d7d7e887e89a38b7ba6e5d7 | 7,129 | py | Python | hring/src/Script/eval_test.py | anderson1008/Noculator | 411964ce333c3bd587840554efef6e61c0b9b4d5 | [
"MIT"
] | null | null | null | hring/src/Script/eval_test.py | anderson1008/Noculator | 411964ce333c3bd587840554efef6e61c0b9b4d5 | [
"MIT"
] | null | null | null | hring/src/Script/eval_test.py | anderson1008/Noculator | 411964ce333c3bd587840554efef6e61c0b9b4d5 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import sys
import os
import re
import fnmatch
import string
import my_print
import matplotlib.pyplot as plt
import get
work_dir = "/Users/Anderson/GoogleDrive/NOCulator/hring/src/bin"
#work_dir = "//Users/Anderson/Desktop/SweepAll_8x8/results/homo/8x8/design/17"
input_file = "bs_homo_8x... | 35.292079 | 399 | 0.612007 | #!/usr/bin/python
import sys
import os
import re
import fnmatch
import string
import my_print
import matplotlib.pyplot as plt
import get
work_dir = "/Users/Anderson/GoogleDrive/NOCulator/hring/src/bin"
#work_dir = "//Users/Anderson/Desktop/SweepAll_8x8/results/homo/8x8/design/17"
input_file = "bs_homo_8x... | 0 | 0 | 0 | 0 | 0 | 3,485 | 0 | 0 | 288 |
6c8f3c447a3418d5e3deacb73b0d781480bd55fa | 1,291 | py | Python | slybot/slybot/linkextractor/ecsv.py | hackrush01/portia | c7414034361fecada76e1693666674c274b0421a | [
"BSD-3-Clause"
] | 6,390 | 2015-01-01T17:05:13.000Z | 2022-03-31T08:20:12.000Z | slybot/slybot/linkextractor/ecsv.py | hackrush01/portia | c7414034361fecada76e1693666674c274b0421a | [
"BSD-3-Clause"
] | 442 | 2015-01-04T17:32:20.000Z | 2022-03-15T21:21:23.000Z | slybot/slybot/linkextractor/ecsv.py | hackrush01/portia | c7414034361fecada76e1693666674c274b0421a | [
"BSD-3-Clause"
] | 1,288 | 2015-01-09T05:54:20.000Z | 2022-03-31T03:21:51.000Z | from __future__ import absolute_import
# see http://docs.python.org/2/library/csv.html#csv-fmt-params
_FORMAT_PARAMETERS = (
('delimiter', ','),
('quotechar', '"'),
('doublequote', True),
('escapechar', None),
('lineterminator', '\r\n'),
('skipinitialspace', False),
('strict', False),
)
| 32.275 | 69 | 0.605732 | from __future__ import absolute_import
import csv
from six import string_types, StringIO, PY2
from scrapy.link import Link
from .base import BaseLinkExtractor
# see http://docs.python.org/2/library/csv.html#csv-fmt-params
_FORMAT_PARAMETERS = (
('delimiter', ','),
('quotechar', '"'),
('doublequote', True... | 0 | 0 | 0 | 828 | 0 | 0 | 0 | 32 | 113 |
b9fa5361dc7fe07bf7df8f28be4364d5c13ef73e | 4,251 | py | Python | tests/unit2/test_sprite_list.py | mlr07/arcade | 70a7046f094a05be1bf0935edeff0ccfb391e01c | [
"MIT"
] | null | null | null | tests/unit2/test_sprite_list.py | mlr07/arcade | 70a7046f094a05be1bf0935edeff0ccfb391e01c | [
"MIT"
] | null | null | null | tests/unit2/test_sprite_list.py | mlr07/arcade | 70a7046f094a05be1bf0935edeff0ccfb391e01c | [
"MIT"
] | null | null | null | import pytest
import arcade
def test_setitem(ctx):
"""Testing __setitem__"""
num_sprites = 10
spritelist = make_named_sprites(num_sprites)
# Assign the same item to the same slot
for i in range(num_sprites):
spritelist[i] = spritelist[i]
assert spritelist[i] == spritelist[i]
... | 29.93662 | 108 | 0.673253 | from array import array
import struct
import pytest
import arcade
def make_named_sprites(amount):
spritelist = arcade.SpriteList()
sprites = []
for i in range(amount):
c = i + 1
sprite = arcade.SpriteSolidColor(16, 16, (c, c, c, 1))
sprite.name = i
sprites.append(sprite)
... | 0 | 0 | 0 | 0 | 0 | 2,987 | 0 | -6 | 205 |
ec6c9ce6553ffbcbcafb4ba7323398e1655d6082 | 5,835 | py | Python | chibi_gob_mx_elasticsearch/cli.py | dem4ply/chibi_gob_mx_elasticsearch | 7b4a5b35ad79817db0f5d5cc6705f085b4708a1d | [
"WTFPL"
] | null | null | null | chibi_gob_mx_elasticsearch/cli.py | dem4ply/chibi_gob_mx_elasticsearch | 7b4a5b35ad79817db0f5d5cc6705f085b4708a1d | [
"WTFPL"
] | null | null | null | chibi_gob_mx_elasticsearch/cli.py | dem4ply/chibi_gob_mx_elasticsearch | 7b4a5b35ad79817db0f5d5cc6705f085b4708a1d | [
"WTFPL"
] | null | null | null | # -*- coding: utf-8 -*-
"""Console script for chibi_gob_mx_elasticsearch."""
import argparse
import sys
import argparse
import sys
from chibi.file import Chibi_path
import logging
logger = logging.getLogger( 'chibi_gob_mx_elasticsearch.cli' )
parser = argparse.ArgumentParser(
description=(
"descargar d... | 34.94012 | 79 | 0.53916 | # -*- coding: utf-8 -*-
"""Console script for chibi_gob_mx_elasticsearch."""
import random
import argparse
import sys
import argparse
import sys
from chibi.config import basic_config
from chibi.file import Chibi_path
from chibi.config import configuration
from chibi_gob_mx.open_data import Open_data
from chibi_gob_mx.... | 0 | 0 | 0 | 0 | 0 | 4,244 | 0 | 138 | 222 |
c1cf043a5b16063a92106928d163cd1776b47fcb | 4,657 | py | Python | datasets/dataset_utils.py | suddhu/MinkLoc3D | 11a2d2d3a96e74133b4aff635d456e22133babcd | [
"MIT"
] | null | null | null | datasets/dataset_utils.py | suddhu/MinkLoc3D | 11a2d2d3a96e74133b4aff635d456e22133babcd | [
"MIT"
] | null | null | null | datasets/dataset_utils.py | suddhu/MinkLoc3D | 11a2d2d3a96e74133b4aff635d456e22133babcd | [
"MIT"
] | null | null | null | # Author: Jacek Komorowski
# Warsaw University of Technology
from torch.utils.data import DataLoader
from datasets.samplers import BatchSampler
from MinkLoc3D.utils import MinkLocParams
def make_dataloaders(params: MinkLocParams):
"""
Create training and validation dataloaders that return groups of k=2 simila... | 46.108911 | 142 | 0.708825 | # Author: Jacek Komorowski
# Warsaw University of Technology
import numpy as np
import torch
from torch.utils.data import DataLoader
import MinkowskiEngine as ME
from datasets.tactileDataset import tactileDataset
from datasets.augmentation import TrainCloudTransform, TrainCloudSetTransform
from datasets.samplers impo... | 0 | 0 | 0 | 0 | 0 | 2,574 | 0 | 80 | 181 |
0f8ca47744a52c3f1507469b5558e68c1be7b0d4 | 23,813 | py | Python | pysnmp-with-texts/SYMME1T1.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/SYMME1T1.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/SYMME1T1.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module SYMME1T1 (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/neermitt/Dev/kusanagi/mibs.snmplabs.com/asn1/SYMME1T1
# Produced by pysmi-0.3.4 at Tue Jul 30 11:34:59 2019
# On host NEERMITT-M-J0NV platform Darwin version 18.6.0 by user neermitt
# Using Python version 3.7.4 (default, Jul 9 2019... | 123.38342 | 2,082 | 0.754504 | #
# PySNMP MIB module SYMME1T1 (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/neermitt/Dev/kusanagi/mibs.snmplabs.com/asn1/SYMME1T1
# Produced by pysmi-0.3.4 at Tue Jul 30 11:34:59 2019
# On host NEERMITT-M-J0NV platform Darwin version 18.6.0 by user neermitt
# Using Python version 3.7.4 (default, Jul 9 2019... | 0 | 0 | 0 | 3,021 | 0 | 0 | 0 | 0 | 205 |
773f3d414053d1514aceb10d5e3941b04bd8e910 | 989 | py | Python | alertlistener/main.py | ashleykelham/shift-your-alert-polcies-left | 1e5124b76d2ec5c6d4556d1730ea5a1bb3e6c797 | [
"Apache-2.0"
] | null | null | null | alertlistener/main.py | ashleykelham/shift-your-alert-polcies-left | 1e5124b76d2ec5c6d4556d1730ea5a1bb3e6c797 | [
"Apache-2.0"
] | null | null | null | alertlistener/main.py | ashleykelham/shift-your-alert-polcies-left | 1e5124b76d2ec5c6d4556d1730ea5a1bb3e6c797 | [
"Apache-2.0"
] | null | null | null | from google.cloud import datastore
client = datastore.Client()
| 28.257143 | 59 | 0.548028 | from google.cloud import datastore
import os
import json
client = datastore.Client()
def alerts(request):
kind = 'alerts-' + os.environ['ENV']
if request.method == 'POST' or request.method == 'PUT':
print(request.data)
request_json = request.get_json()
incident = request_json['inciden... | 0 | 0 | 0 | 0 | 0 | 880 | 0 | -22 | 67 |
126955d7d8c5255831ba84354f634ab3187c2a5a | 1,787 | py | Python | 02.py | anttuov/adventofcode-2017 | 36288be78479cc5309a59e09b6db87afcd4940cb | [
"MIT"
] | null | null | null | 02.py | anttuov/adventofcode-2017 | 36288be78479cc5309a59e09b6db87afcd4940cb | [
"MIT"
] | null | null | null | 02.py | anttuov/adventofcode-2017 | 36288be78479cc5309a59e09b6db87afcd4940cb | [
"MIT"
] | null | null | null | # http://adventofcode.com/2017/day/2
code = """5048 177 5280 5058 4504 3805 5735 220 4362 1809 1521 230 772 1088 178 1794
6629 3839 258 4473 5961 6539 6870 4140 4638 387 7464 229 4173 5706 185 271
5149 2892 5854 2000 256 3995 5250 249 3916 184 2497 210 4601 3955 1110 5340
153 468 550 126 495 142 385 144 165 188 609... | 40.613636 | 84 | 0.69446 | # http://adventofcode.com/2017/day/2
def checksum_1(code):
checksum = 0
for line in code.split("\n"):
numbers = list(map(int, line.split("\t")))
checksum += max(numbers) - min(numbers)
return checksum
def checksum_2(code):
checksum = 0
for line in code.split("\n"):
number... | 0 | 0 | 0 | 0 | 0 | 495 | 0 | 0 | 46 |
f15605049ae96ff1cf8f150412910b416ecdc828 | 723 | py | Python | Tensile/Tests/nightly/convolution_config/test_yaml.py | zjunweihit/Tensile | 68b73083c92eecc1b04eec1f006f28aea5628030 | [
"MIT"
] | null | null | null | Tensile/Tests/nightly/convolution_config/test_yaml.py | zjunweihit/Tensile | 68b73083c92eecc1b04eec1f006f28aea5628030 | [
"MIT"
] | null | null | null | Tensile/Tests/nightly/convolution_config/test_yaml.py | zjunweihit/Tensile | 68b73083c92eecc1b04eec1f006f28aea5628030 | [
"MIT"
] | null | null | null | import logging
log =logging.getLogger("testlog")
| 34.428571 | 82 | 0.676349 | import logging
from Tensile.SolutionStructs import Convolution
from YamlBuilder.YamlBuilder import YamlBuilder
log =logging.getLogger("testlog")
def test_yaml(request, tensile_client_dir, tmp_path):
z={} # problemType definition
conv = Convolution(z, 'ConvolutionForward',
config={'TensorAFormat'... | 0 | 0 | 0 | 0 | 0 | 554 | 0 | 52 | 67 |
ebd882d2681a13494693917b2277401b35c97a33 | 16,311 | py | Python | search_web/__init__.py | Ankitsinghprograms/search_web | 108aa097f89b4b393cb9c844d8e490920a0557ed | [
"MIT"
] | 3 | 2021-01-14T15:27:38.000Z | 2021-12-20T09:53:04.000Z | search_web/__init__.py | Ankitsinghprograms/search_web | 108aa097f89b4b393cb9c844d8e490920a0557ed | [
"MIT"
] | 1 | 2021-02-04T20:36:40.000Z | 2021-02-04T20:36:40.000Z | search_web/__init__.py | Ankitsinghprograms/search_web | 108aa097f89b4b393cb9c844d8e490920a0557ed | [
"MIT"
] | 1 | 2021-02-04T19:52:55.000Z | 2021-02-04T19:52:55.000Z | """
This module will Help You to Search on Different Websites like Google,Youtube,etc.
You can search on more than 25 websites very easily by just 2 lines of code.
Websites Supported:-
1.Google -google_search("Python")
2.Youtube -youtube_search("Python")
3.Bing -bing_search("Python")
4.Quora -quora_search("5 P... | 14.195822 | 109 | 0.639691 | """
This module will Help You to Search on Different Websites like Google,Youtube,etc.
You can search on more than 25 websites very easily by just 2 lines of code.
Websites Supported:-
1.Google -google_search("Python")
2.Youtube -youtube_search("Python")
3.Bing -bing_search("Python")
4.Quora -quora_search("5 P... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
87a3c0f164fbcc6a42b29d8f101106b4ea766cfe | 4,696 | py | Python | common/files.py | LordKBX/EbookCollection | 3e6ba33fb012b1dbb371704094b02cece66a7e80 | [
"MIT"
] | 1 | 2021-06-03T01:44:50.000Z | 2021-06-03T01:44:50.000Z | common/files.py | LordKBX/eBookCollection | 3e6ba33fb012b1dbb371704094b02cece66a7e80 | [
"MIT"
] | null | null | null | common/files.py | LordKBX/eBookCollection | 3e6ba33fb012b1dbb371704094b02cece66a7e80 | [
"MIT"
] | null | null | null | import os, sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
def get_file_size(file_name: str, human_readable: bool = True):
"""
Get file in size in given unit like KB, MB or GB
:param file_name:
:param human_readable:
:return:
"""
size = os.path.getsiz... | 31.945578 | 121 | 0.631814 | import os, sys, shutil
import hashlib
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
from common.vars import *
from common.MIME import *
def get_file_size(file_name: str, human_readable: bool = True):
"""
Get file in size in given unit like KB, MB or GB
:param file_name... | 0 | 0 | 0 | 0 | 0 | 2,876 | 0 | 9 | 296 |
f82d31f5b5597ffa1c312d086ef484f89b54b43b | 4,017 | py | Python | uformer/test.py | lulsheng/-AI-8- | 562365379c3e0191436537958a2519e4be905d4b | [
"Apache-2.0"
] | null | null | null | uformer/test.py | lulsheng/-AI-8- | 562365379c3e0191436537958a2519e4be905d4b | [
"Apache-2.0"
] | null | null | null | uformer/test.py | lulsheng/-AI-8- | 562365379c3e0191436537958a2519e4be905d4b | [
"Apache-2.0"
] | null | null | null | import os, sys
import argparse
from tqdm import tqdm
import paddle.nn as nn
import paddle
from x2paddle.torch2paddle import DataLoader
sys.path.append('/home/aistudio')
from utils.loader import get_testA_data
import utils
use_gpu = True
paddle.set_device('gpu:0') if use_gpu else paddle.get_device('cpu')
# from skimage... | 42.284211 | 109 | 0.744088 | import numpy as np
import os, sys
import argparse
from tqdm import tqdm
import paddle.nn as nn
import paddle
from x2paddle.torch2paddle import DataLoader
import paddle.nn.functional as F
sys.path.append('/home/aistudio')
import scipy.io as sio
from utils.loader import get_validation_data, get_testA_data
import utils
fr... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 58 | 154 |
80583d6ca6373271e97855d720a33839feef7440 | 20,630 | py | Python | server.py | Leslie-Fang/Seq2Seq-Vis | 71be2e246a7bc4c7a27912d3a735cbcf13b908ef | [
"Apache-2.0"
] | 436 | 2018-04-26T00:57:57.000Z | 2022-03-28T07:26:40.000Z | server.py | Leslie-Fang/Seq2Seq-Vis | 71be2e246a7bc4c7a27912d3a735cbcf13b908ef | [
"Apache-2.0"
] | 24 | 2018-04-28T08:09:04.000Z | 2022-02-26T03:35:37.000Z | server.py | Leslie-Fang/Seq2Seq-Vis | 71be2e246a7bc4c7a27912d3a735cbcf13b908ef | [
"Apache-2.0"
] | 72 | 2018-04-27T00:25:22.000Z | 2021-09-30T14:16:43.000Z | #!/usr/bin/env python3
import argparse
import os
os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE"
import connexion
import logging
# import umap
from sklearn.decomposition import PCA
from sklearn.manifold import MDS, TSNE
from s2s.lru import LRU
from s2s.project import S2SProject
__author__ = 'Hendrik Strobelt, Sebastia... | 33.49026 | 80 | 0.55269 | #!/usr/bin/env python3
import argparse
import os
import time
os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE"
import connexion
import logging
# import umap
from flask import send_from_directory, redirect, json
import numpy as np
from sklearn.decomposition import PCA
from sklearn.manifold import MDS, TSNE
from copy impor... | 0 | 261 | 0 | 0 | 0 | 15,261 | 0 | 53 | 521 |
652cec0c60fd17c92973aec0fbbe1a9e68631d80 | 13,761 | py | Python | build_and_train.py | akshaysharma21/Genre_Classification | 4a5a8f875ba77241a1241b995b304ed895d576a5 | [
"CC0-1.0"
] | null | null | null | build_and_train.py | akshaysharma21/Genre_Classification | 4a5a8f875ba77241a1241b995b304ed895d576a5 | [
"CC0-1.0"
] | null | null | null | build_and_train.py | akshaysharma21/Genre_Classification | 4a5a8f875ba77241a1241b995b304ed895d576a5 | [
"CC0-1.0"
] | null | null | null | #imports
import pandas as pd
import sklearn.utils, sklearn.preprocessing, sklearn.decomposition, sklearn.svm
import librosa
#plot_file(path)
#function to plot spectrograms
#Load and trim datasets to shread out useless info
filePath = 'D:\\fma_metadata\\tracks.csv'
df_tracks = pd.read_csv(filePath, index_col=0, hea... | 35.55814 | 147 | 0.594506 | #imports
import pandas as pd
import os
import ast
import sklearn as skl
import sklearn.utils, sklearn.preprocessing, sklearn.decomposition, sklearn.svm
import matplotlib.pyplot as plt
import numpy as np
import pylab
import librosa
import ffmpeg
import audioread
import sklearn
import librosa.display
import datetime
... | 0 | 0 | 0 | 0 | 0 | 11,993 | 0 | 108 | 490 |
b3e541794ca93c4f765c5a04c082c60d42c8e272 | 4,667 | py | Python | get_embeddings_ML.py | pauhsg/PS_SentimentAnalysis | fb7ebe4d2b05e1f86205708a13b5e238a0e1cba9 | [
"Apache-1.1"
] | null | null | null | get_embeddings_ML.py | pauhsg/PS_SentimentAnalysis | fb7ebe4d2b05e1f86205708a13b5e238a0e1cba9 | [
"Apache-1.1"
] | null | null | null | get_embeddings_ML.py | pauhsg/PS_SentimentAnalysis | fb7ebe4d2b05e1f86205708a13b5e238a0e1cba9 | [
"Apache-1.1"
] | null | null | null | #!/usr/bin/env python3
import numpy as np
import pandas as pd
import re
regex = re.compile('[^A-Za-z-]')
def extract_mean_word_vectors(data, vocabulary, embeddings):
'''
extracts mean of word vectors for each tweet
'''
print('> extracting mean of word vectors')
# get vocab equivalence to tweet... | 40.938596 | 139 | 0.686737 | #!/usr/bin/env python3
import numpy as np
import pandas as pd
import re
regex = re.compile('[^A-Za-zÀ-ÿ]')
def extract_mean_word_vectors(data, vocabulary, embeddings):
'''
extracts mean of word vectors for each tweet
'''
print('> extracting mean of word vectors')
# get vocab equivalence to twe... | 4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b23ea33c7149b1654de0bad4da0b73703df6ace9 | 1,861 | py | Python | parametrize/utils.py | MrMrRobat/parametrize | 3da69a3695bf9af66f194d21e0596d31e958dfa9 | [
"MIT"
] | 7 | 2021-05-09T22:31:08.000Z | 2021-10-20T12:27:40.000Z | parametrize/utils.py | Bobronium/parametrize | 3da69a3695bf9af66f194d21e0596d31e958dfa9 | [
"MIT"
] | 2 | 2021-05-15T19:22:42.000Z | 2021-11-21T11:24:10.000Z | parametrize/utils.py | Bobronium/parametrize | 3da69a3695bf9af66f194d21e0596d31e958dfa9 | [
"MIT"
] | 1 | 2021-11-21T11:01:16.000Z | 2021-11-21T11:01:16.000Z | import sys
from inspect import Signature
from types import CodeType, FunctionType
from typing import Any, Tuple
if sys.version_info >= (3, 8):
copy_code = CodeType.replace
else:
PY_36_37_CODE_ARGS: Tuple[str, ...] = (
"co_argcount",
"co_kwonlyargcount",
"co_nlocals",
"co_stacks... | 29.078125 | 86 | 0.619022 | import sys
from inspect import Signature
from types import CodeType, FunctionType
from typing import Any, Tuple
if sys.version_info >= (3, 8):
copy_code = CodeType.replace
else:
PY_36_37_CODE_ARGS: Tuple[str, ...] = (
"co_argcount",
"co_kwonlyargcount",
"co_nlocals",
"co_stacks... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7aedf0c8817932b2eee18bc17c9088890bda9cdb | 1,839 | py | Python | personalcrm/inventory/views.py | carlossgv/personalcrm-repo | 2fbe824a62d8976ce09817d75dfac7291ca3d28d | [
"MIT"
] | 2 | 2021-02-11T12:46:06.000Z | 2021-02-22T01:32:35.000Z | personalcrm/inventory/views.py | carlossgv/personalcrm-repo | 2fbe824a62d8976ce09817d75dfac7291ca3d28d | [
"MIT"
] | null | null | null | personalcrm/inventory/views.py | carlossgv/personalcrm-repo | 2fbe824a62d8976ce09817d75dfac7291ca3d28d | [
"MIT"
] | null | null | null |
# ! INVENTORY VIEWS
| 27.863636 | 82 | 0.612289 | from .forms import NewProductForm
from django.db import models
from django.shortcuts import render, resolve_url
from django.http.response import JsonResponse
from quote.models import Product, Brand, User
# ! INVENTORY VIEWS
def home(request):
return render(request, "inventory/index.html")
def get_inventory_inde... | 0 | 0 | 0 | 0 | 0 | 1,521 | 0 | 94 | 201 |
75bcdef2b0e596ed34971c0c6c64a759413453a2 | 39 | py | Python | python/dlr/metadata.py | ylc/neo-ai-dlr | a8afcafbcc8c43b734faf092b2f4dd7e8fe40ea0 | [
"Apache-2.0"
] | 446 | 2019-01-24T02:04:17.000Z | 2022-03-16T13:45:32.000Z | python/dlr/metadata.py | ylc/neo-ai-dlr | a8afcafbcc8c43b734faf092b2f4dd7e8fe40ea0 | [
"Apache-2.0"
] | 179 | 2019-01-24T10:03:34.000Z | 2022-03-19T02:06:56.000Z | python/dlr/metadata.py | ylc/neo-ai-dlr | a8afcafbcc8c43b734faf092b2f4dd7e8fe40ea0 | [
"Apache-2.0"
] | 111 | 2019-01-24T20:51:45.000Z | 2022-02-18T06:22:40.000Z | NAME = ['DLRModel']
VERSION = "1.9.1"
| 9.75 | 19 | 0.564103 | NAME = ['DLRModel']
VERSION = "1.9.1"
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0471a7c04e04c6ff309ba4131754c43b9d7d3c93 | 591 | py | Python | src/tests/test_example_task.py | kazqvaizer/arq-sqlalchemy-boilerplate | c14596ed358a061e6eb2a380f4bd962242b123f3 | [
"MIT"
] | 6 | 2021-12-20T14:49:14.000Z | 2022-03-21T14:32:49.000Z | src/tests/test_example_task.py | kazqvaizer/arq-sqlalchemy-boilerplate | c14596ed358a061e6eb2a380f4bd962242b123f3 | [
"MIT"
] | null | null | null | src/tests/test_example_task.py | kazqvaizer/arq-sqlalchemy-boilerplate | c14596ed358a061e6eb2a380f4bd962242b123f3 | [
"MIT"
] | null | null | null | import pytest
pytestmark = pytest.mark.asyncio
| 24.625 | 81 | 0.756345 | import pytest
from sqlalchemy import func
from sqlalchemy.future import select
from app.models import ExampleModel
from app.tasks import example_task
pytestmark = pytest.mark.asyncio
async def test_creates_new_entry(session):
await example_task()
count = (await session.execute(select(func.count(ExampleMode... | 0 | 0 | 358 | 0 | 0 | 0 | 0 | 48 | 135 |
eab37f54fd7dbe0be73d3f145040820fb90e8486 | 1,529 | py | Python | features_fixer/scaler/abstract.py | LudwikBielczynski/features_fixer | 43114e3d986265a1e6e34644d3734a361d3fa926 | [
"MIT"
] | null | null | null | features_fixer/scaler/abstract.py | LudwikBielczynski/features_fixer | 43114e3d986265a1e6e34644d3734a361d3fa926 | [
"MIT"
] | null | null | null | features_fixer/scaler/abstract.py | LudwikBielczynski/features_fixer | 43114e3d986265a1e6e34644d3734a361d3fa926 | [
"MIT"
] | null | null | null | from typing import TYPE_CHECKING
if TYPE_CHECKING:
| 28.849057 | 95 | 0.561805 | from abc import ABC, abstractmethod
from typing import TYPE_CHECKING, Optional
import pandas as pd
if TYPE_CHECKING:
from sklearn.base import TransformerMixin
class ScalerAbstract(ABC):
@property
@abstractmethod
def scaler(self) -> 'TransformerMixin':
pass
# TODO: Scale only numeric col... | 0 | 65 | 0 | 1,276 | 0 | 0 | 0 | 42 | 94 |
d174b348a6a886e5ebfeb1998bd2eefa9286562d | 34,287 | py | Python | savu/plugins/plugin_tools.py | nghia-vo/Savu | 1cf7343c141224643b2e1fb2f05e74448bc4fd58 | [
"Apache-2.0"
] | null | null | null | savu/plugins/plugin_tools.py | nghia-vo/Savu | 1cf7343c141224643b2e1fb2f05e74448bc4fd58 | [
"Apache-2.0"
] | null | null | null | savu/plugins/plugin_tools.py | nghia-vo/Savu | 1cf7343c141224643b2e1fb2f05e74448bc4fd58 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Diamond Light Source Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | 38.9625 | 85 | 0.593082 | # Copyright 2014 Diamond Light Source Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | 0 | 0 | 0 | 33,057 | 0 | 0 | 0 | 106 | 314 |
91c4447f40df9a13e4fd627871df6a5b7f822dad | 6,370 | py | Python | pylib/cqlshlib/test/ansi_colors.py | tomitakazutaka/cassandra | 5a04115973932202203d479db37eedc5a2d81778 | [
"Apache-2.0"
] | null | null | null | pylib/cqlshlib/test/ansi_colors.py | tomitakazutaka/cassandra | 5a04115973932202203d479db37eedc5a2d81778 | [
"Apache-2.0"
] | null | null | null | pylib/cqlshlib/test/ansi_colors.py | tomitakazutaka/cassandra | 5a04115973932202203d479db37eedc5a2d81778 | [
"Apache-2.0"
] | null | null | null | # 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"); you may ... | 32.5 | 104 | 0.574411 | # 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"); you may ... | 0 | 1,268 | 0 | 2,287 | 0 | 269 | 0 | -11 | 173 |
e0beb0bdd73cc0eda15d5ef0ac50d51f281f3f2e | 3,022 | py | Python | CNN/utils.py | ostrowskaaa/ReDust | e9ed30dd13f8b7dc32e4d9099df2bb22aa1d2ecb | [
"MIT"
] | 1 | 2020-12-27T22:09:32.000Z | 2020-12-27T22:09:32.000Z | CNN/utils.py | ostrowskaaa/ReDust | e9ed30dd13f8b7dc32e4d9099df2bb22aa1d2ecb | [
"MIT"
] | 5 | 2020-11-13T17:53:07.000Z | 2021-03-30T09:36:02.000Z | CNN/utils.py | ostrowskaaa/ReDust | e9ed30dd13f8b7dc32e4d9099df2bb22aa1d2ecb | [
"MIT"
] | null | null | null | import os
PATH = os.getcwd()
## ----- LOAD DATA ------
## ----- IMAGE AUGMENTATION -----
| 36.409639 | 136 | 0.605228 | import os
import numpy as np
from cv2 import cv2
from PIL import Image
import matplotlib.pyplot as plt
from tensorflow import keras
from keras.preprocessing.image import array_to_img, img_to_array, load_img
PATH = os.getcwd()
## ----- LOAD DATA ------
def load_data(folderName, photoType):
folderPath... | 0 | 0 | 0 | 0 | 0 | 2,614 | 0 | 65 | 236 |
ad176cf21c5302e22fe80155ad9383c77b3bf96b | 4,093 | py | Python | taobao_spider/taobao_spider/taobao_spider/spiders/TaobaoSpider.py | lj28478416/Taobao_Spider | d18675efc4bf8938bfe08f9f0e5de2e26d58a390 | [
"Apache-2.0"
] | null | null | null | taobao_spider/taobao_spider/taobao_spider/spiders/TaobaoSpider.py | lj28478416/Taobao_Spider | d18675efc4bf8938bfe08f9f0e5de2e26d58a390 | [
"Apache-2.0"
] | null | null | null | taobao_spider/taobao_spider/taobao_spider/spiders/TaobaoSpider.py | lj28478416/Taobao_Spider | d18675efc4bf8938bfe08f9f0e5de2e26d58a390 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
error_num = 0
| 44.978022 | 118 | 0.524554 | # -*- coding: utf-8 -*-
import scrapy
import json
from jsonpath import jsonpath
import re
from ..items import TaobaoSpiderItem
from ..settings import cookies
from urllib import parse
error_num = 0
class TaobaospiderSpider(scrapy.Spider):
name = 'TaobaoSpider'
# allowed_domains = ['taobao.com', 'tmall.com']
... | 9 | 0 | 0 | 3,870 | 0 | 0 | 0 | 5 | 176 |
76abd7e5c30c875c4d15aacee98dd95000ad0604 | 360 | py | Python | django_cbtools/signals.py | smarttradeapp/django_couchbase | d96b32977bdb0dbf1a6e891ab29ea7b69ac6bed4 | [
"BSD-3-Clause"
] | 6 | 2016-06-23T08:21:43.000Z | 2018-07-19T09:42:32.000Z | django_cbtools/signals.py | smarttradeapp/django_cbtools | d96b32977bdb0dbf1a6e891ab29ea7b69ac6bed4 | [
"BSD-3-Clause"
] | 26 | 2015-10-17T08:59:36.000Z | 2021-06-10T17:48:41.000Z | django_cbtools/signals.py | smarttradeapp/django_couchbase | d96b32977bdb0dbf1a6e891ab29ea7b69ac6bed4 | [
"BSD-3-Clause"
] | 8 | 2015-11-28T13:47:19.000Z | 2020-12-15T12:58:00.000Z | from django.db.models.signals import ModelSignal
cb_pre_save = ModelSignal(providing_args=["instance"], use_caching=True)
cb_post_save = ModelSignal(providing_args=["instance", "created"], use_caching=True)
cb_pre_delete = ModelSignal(providing_args=["instance"], use_caching=True)
cb_post_delete = ModelSignal(providi... | 45 | 84 | 0.808333 | from django.db.models.signals import ModelSignal
cb_pre_save = ModelSignal(providing_args=["instance"], use_caching=True)
cb_post_save = ModelSignal(providing_args=["instance", "created"], use_caching=True)
cb_pre_delete = ModelSignal(providing_args=["instance"], use_caching=True)
cb_post_delete = ModelSignal(providi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6b3f7a1b7b9bdbaf348944e853bd1155f8a549ef | 1,540 | py | Python | app/auth/views.py | annaadhiambo/The-Last-Pitch | cf611b846059df57f6f02ff69d9029946487aa6d | [
"MIT"
] | null | null | null | app/auth/views.py | annaadhiambo/The-Last-Pitch | cf611b846059df57f6f02ff69d9029946487aa6d | [
"MIT"
] | null | null | null | app/auth/views.py | annaadhiambo/The-Last-Pitch | cf611b846059df57f6f02ff69d9029946487aa6d | [
"MIT"
] | null | null | null | from .. import db
| 38.5 | 104 | 0.719481 | from flask import render_template,redirect,url_for, flash,request
from flask_login import login_user,logout_user,login_required
from . import auth
from ..models import User
from .forms import LoginForm,RegistrationForm
from .. import db
from ..email import mail_message
from flask_http_response import success, result, ... | 0 | 1,140 | 0 | 0 | 0 | 0 | 0 | 154 | 227 |
edb742b662287057e388a5535dd4c2d409e7dfb8 | 356 | py | Python | build/lib/django_simple_file_handler/urls.py | jonathanrickard/django-simple-file-handler | f714b93b941b3a677a8fd2a2eb425afaaa0a2d62 | [
"MIT"
] | 5 | 2020-09-17T16:41:01.000Z | 2021-05-21T22:42:56.000Z | build/lib/django_simple_file_handler/urls.py | jonathanrickard/django-simple-file-handler | f714b93b941b3a677a8fd2a2eb425afaaa0a2d62 | [
"MIT"
] | null | null | null | build/lib/django_simple_file_handler/urls.py | jonathanrickard/django-simple-file-handler | f714b93b941b3a677a8fd2a2eb425afaaa0a2d62 | [
"MIT"
] | 1 | 2021-01-09T13:04:38.000Z | 2021-01-09T13:04:38.000Z | from django.urls import (path)
from .views import (proxy_document, proxy_pdf)
app_name = 'django_simple_file_handler'
urlpatterns = [
path(
'documents/<proxy_slug>',
proxy_document,
name='proxy_document',
),
path(
'pdf/<proxy_slug>',
proxy_pdf,
name='pro... | 13.185185 | 39 | 0.564607 | from django.urls import (
path,
)
from .views import (
proxy_document,
proxy_pdf,
)
app_name = 'django_simple_file_handler'
urlpatterns = [
path(
'documents/<proxy_slug>',
proxy_document,
name='proxy_document',
),
path(
'pdf/<proxy_slug>',
proxy_pdf,... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 18 | 0 |
8f19b7cff4fb05679aff138284ee6c3240db012b | 3,209 | py | Python | conversationinsights-mynlu/mynlu/parsers/__init__.py | osswangxining/iot-app-enabler-conversation | 7c40a89072b1730869260320d77aa9856412424a | [
"Apache-2.0"
] | 4 | 2017-10-19T05:11:52.000Z | 2018-06-26T02:54:55.000Z | mynlu/parsers/__init__.py | osswangxining/conversationinsights-mynlu | d2a174af770a496ef220330cb6d5428f5f0114f6 | [
"Apache-2.0"
] | null | null | null | mynlu/parsers/__init__.py | osswangxining/conversationinsights-mynlu | d2a174af770a496ef220330cb6d5428f5f0114f6 | [
"Apache-2.0"
] | 1 | 2018-06-26T02:54:57.000Z | 2018-06-26T02:54:57.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from mynlu import pipeline
| 35.263736 | 104 | 0.682456 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import datetime
import io
import json
import logging
import os
import copy
from builtins import object
from builtins import str
from typing import Any
from typing import... | 0 | 1,160 | 0 | 1,319 | 0 | 0 | 0 | 88 | 466 |
1895571fa5dca0d9aea1f7538b31f47d0d2ee10a | 4,699 | py | Python | AutomatedTesting/Gem/PythonTests/physics/TestSuite_Main.py | aaarsene/o3de | 37e3b0226958974defd14dd6d808e8557dcd7345 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-09-13T00:01:12.000Z | 2021-09-13T00:01:12.000Z | AutomatedTesting/Gem/PythonTests/physics/TestSuite_Main.py | aaarsene/o3de | 37e3b0226958974defd14dd6d808e8557dcd7345 | [
"Apache-2.0",
"MIT"
] | null | null | null | AutomatedTesting/Gem/PythonTests/physics/TestSuite_Main.py | aaarsene/o3de | 37e3b0226958974defd14dd6d808e8557dcd7345 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-07-20T11:07:25.000Z | 2021-07-20T11:07:25.000Z | """
Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
# This suite consists of all test cases that are passing and have been verified.
import os
import sys
from .F... | 52.211111 | 184 | 0.786125 | """
Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
# This suite consists of all test cases that are passing and have been verified.
import pytest
import os
impo... | 0 | 3,946 | 0 | 0 | 0 | 0 | 0 | 20 | 91 |
85b2a7b8b24924295f931bb9285470d455b9b0b0 | 346 | py | Python | lib/algo/quark/test.py | tuaris/TidePool | 5d44fa11a7de3f5c05130d0ad4030671806cd501 | [
"BSD-3-Clause"
] | 3 | 2018-06-30T12:10:50.000Z | 2021-09-18T16:10:12.000Z | lib/algo/max_hash/test.py | tuaris/TidePool | 5d44fa11a7de3f5c05130d0ad4030671806cd501 | [
"BSD-3-Clause"
] | null | null | null | lib/algo/max_hash/test.py | tuaris/TidePool | 5d44fa11a7de3f5c05130d0ad4030671806cd501 | [
"BSD-3-Clause"
] | 9 | 2017-04-12T22:59:49.000Z | 2021-09-18T16:10:25.000Z | import quark_hash
from binascii import unhexlify
teststart = '700000005d385ba114d079970b29a9418fd0549e7d68a95c7f168621a314201000000000578586d149fd07b22f3a8a347c516de7052f034d2b76ff68e0d6ecff9b77a45489e3fd511732011df0731000';
testbin = unhexlify(teststart)
hash_bin = quark_hash.getPoWHash(testbin) | 34.6 | 175 | 0.904624 | import quark_hash
import weakref
import binascii
import StringIO
from binascii import unhexlify
teststart = '700000005d385ba114d079970b29a9418fd0549e7d68a95c7f168621a314201000000000578586d149fd07b22f3a8a347c516de7052f034d2b76ff68e0d6ecff9b77a45489e3fd511732011df0731000';
testbin = unhexlify(teststart)
hash_bin = quar... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -19 | 66 |
9e8f3ff788d8e8c6f67d82306f60aa368476c03b | 2,898 | py | Python | responsibility/responsibility.py | guwenbo/DesignPattern-Python | 3b7228595e9dd6ae5cb0df06b2b8a74ce2d774a9 | [
"Apache-2.0"
] | null | null | null | responsibility/responsibility.py | guwenbo/DesignPattern-Python | 3b7228595e9dd6ae5cb0df06b2b8a74ce2d774a9 | [
"Apache-2.0"
] | null | null | null | responsibility/responsibility.py | guwenbo/DesignPattern-Python | 3b7228595e9dd6ae5cb0df06b2b8a74ce2d774a9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
"""
if __name__ == '__main__':
hb = ConcreteHandlerB(Level(2))
ha = ConcreteHandlerA(Level(1), hb)
req = Request(Level(2), "Request with Level 2")
ha.handle_request(req)
| 21 | 83 | 0.612491 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
责任链模式
"""
class Level(object):
def __init__(self, value=None):
self._value = value
def __str__(self):
return str(self.value)
def equals(self, level):
if isinstance(level, Level):
return self.value == level.value... | 15 | 545 | 0 | 1,955 | 0 | 0 | 0 | 0 | 138 |
fb78fdfa960004a592bf5e8ced007003751dcda2 | 6,671 | py | Python | csalt/CASA_scripts/format_data.py | seanandrews/dsalt | 797c6c085b6cd0c82fa2a7c8b47d39d49815e7a6 | [
"MIT"
] | 2 | 2021-04-28T23:12:09.000Z | 2021-05-11T19:56:07.000Z | csalt/CASA_scripts/format_data.py | seanandrews/dsalt | 797c6c085b6cd0c82fa2a7c8b47d39d49815e7a6 | [
"MIT"
] | null | null | null | csalt/CASA_scripts/format_data.py | seanandrews/dsalt | 797c6c085b6cd0c82fa2a7c8b47d39d49815e7a6 | [
"MIT"
] | 1 | 2021-08-11T19:07:23.000Z | 2021-08-11T19:07:23.000Z | """
This CASA script (optionally) reduces an available (concatenated) MS by
time-averaging and sub-selecting a given velocity range. It is called
inside csalt.synthesize.make_data(), or can be used as a standalone script
for a real dataset as
casa -c format_data.py configs/gen_<cfg_file> <a... | 32.227053 | 80 | 0.640534 | """
This CASA script (optionally) reduces an available (concatenated) MS by
time-averaging and sub-selecting a given velocity range. It is called
inside csalt.synthesize.make_data(), or can be used as a standalone script
for a real dataset as
casa -c format_data.py configs/gen_<cfg_file> <a... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d44d5ec5c5d6b32d6e144b89c329e7a0745bad9a | 2,776 | py | Python | examples.py | ofirmanor/nicetable | a0110161657dc9da66ffb334677132f7f3af8511 | [
"MIT"
] | 6 | 2019-01-10T16:15:11.000Z | 2022-03-28T01:42:37.000Z | examples.py | ofirmanor/nicetable | a0110161657dc9da66ffb334677132f7f3af8511 | [
"MIT"
] | 1 | 2021-01-08T06:25:29.000Z | 2021-01-08T06:25:29.000Z | examples.py | ofirmanor/nicetable | a0110161657dc9da66ffb334677132f7f3af8511 | [
"MIT"
] | 1 | 2021-01-07T23:58:20.000Z | 2021-01-07T23:58:20.000Z | # Example: printing the list of builtin layouts
import json
from nicetable.nicetable import NiceTable
# from __future__ import annotations # only for Python 3.7 and up?
out = NiceTable(['Layout', 'Description'])
for layout in NiceTable.builtin_layouts():
out.append(layout)
print(out)
# Example: printi... | 34.271605 | 120 | 0.668588 | # Example: printing the list of builtin layouts
import json
from nicetable.nicetable import NiceTable
# from __future__ import annotations # only for Python 3.7 and up?
out = NiceTable(['Layout', 'Description'])
for layout in NiceTable.builtin_layouts():
out.append(layout)
print(out)
# Example: printi... | 34 | 0 | 0 | 218 | 0 | 0 | 0 | 0 | 23 |
824a966bc3f98387de4dd6b19297de88ea1261a3 | 505 | py | Python | forwarding_bot/vk/_bot.py | dhvcc/VK-TG-transfer-bot | 4a1570ca6f2b905bc015412b527ac58039eb2cef | [
"MIT"
] | 4 | 2020-09-19T18:59:01.000Z | 2020-10-13T13:34:45.000Z | forwarding_bot/vk/_bot.py | dhvcc/VK-TG-transfer-bot | 4a1570ca6f2b905bc015412b527ac58039eb2cef | [
"MIT"
] | 11 | 2020-09-24T09:07:06.000Z | 2022-03-10T12:21:34.000Z | forwarding_bot/vk/_bot.py | dhvcc/VK-TG-transfer-bot | 4a1570ca6f2b905bc015412b527ac58039eb2cef | [
"MIT"
] | 2 | 2020-10-11T13:30:09.000Z | 2020-10-22T07:08:21.000Z | import logging
logger = logging.getLogger(__name__)
| 22.954545 | 55 | 0.667327 | import logging
from vkbottle import User
from forwarding_bot.vk._middleware import middleware_bp
from ._blueprint import bot_bp
logger = logging.getLogger(__name__)
class VKBot:
def __init__(self, token: str):
self.bot = User(token)
self.bot.set_blueprints(middleware_bp, bot_bp)
def start(... | 0 | 0 | 0 | 313 | 0 | 0 | 0 | 47 | 91 |
dc0c6eb6c805d3ba32f728bbde54860ebb404adc | 5,022 | py | Python | choicesenum/django/fields.py | gustavo-depaula/python-choicesenum | f0ed55da28c444a99595137f3a60ed9d900c3312 | [
"BSD-3-Clause"
] | null | null | null | choicesenum/django/fields.py | gustavo-depaula/python-choicesenum | f0ed55da28c444a99595137f3a60ed9d900c3312 | [
"BSD-3-Clause"
] | null | null | null | choicesenum/django/fields.py | gustavo-depaula/python-choicesenum | f0ed55da28c444a99595137f3a60ed9d900c3312 | [
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
from __future__ import absolute_import, unicode_literals
try:
from django.utils.module_loading import import_string
except ImportError: # pragma: no cover, Django 1.6 compat
| 34.163265 | 95 | 0.579052 | # coding: utf-8
from __future__ import absolute_import, unicode_literals
from django.core import checks
from django.db import models
from django.utils.translation import gettext_lazy as _
try:
from django.utils.module_loading import import_string
except ImportError: # pragma: no cover, Django 1.6 compat
from... | 0 | 0 | 0 | 4,206 | 0 | 235 | 0 | 104 | 276 |
eae86aa1429fe11b7f7053d2e37f0b1844ebbabd | 79 | py | Python | src/ssg/__init__.py | a-rokay/static-site-generator | f44a6951beeb68bd5ae5cc3b02e71c636d853dc2 | [
"MIT"
] | 1 | 2021-09-21T22:45:17.000Z | 2021-09-21T22:45:17.000Z | src/ssg/__init__.py | a-rokay/static-site-generator | f44a6951beeb68bd5ae5cc3b02e71c636d853dc2 | [
"MIT"
] | 11 | 2021-09-13T14:12:34.000Z | 2021-10-04T21:09:18.000Z | src/ssg/__init__.py | a-rokay/static-site-generator | f44a6951beeb68bd5ae5cc3b02e71c636d853dc2 | [
"MIT"
] | 5 | 2021-09-14T19:29:43.000Z | 2021-11-04T19:58:06.000Z | import pathlib
import sys
sys.path.append(str(pathlib.Path(__file__).parent))
| 15.8 | 51 | 0.797468 | import pathlib
import sys
sys.path.append(str(pathlib.Path(__file__).parent))
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6263e624ebab3c675c7c6fecb0b26b6fa51802dc | 2,288 | py | Python | hatch_vcs/version_source.py | ofek/hatch-vcs | c5388d67192d9bf88191927a35f51705121784a1 | [
"MIT"
] | null | null | null | hatch_vcs/version_source.py | ofek/hatch-vcs | c5388d67192d9bf88191927a35f51705121784a1 | [
"MIT"
] | 1 | 2022-03-08T04:07:09.000Z | 2022-03-18T05:41:17.000Z | hatch_vcs/version_source.py | ofek/hatch-vcs | c5388d67192d9bf88191927a35f51705121784a1 | [
"MIT"
] | null | null | null | # SPDX-FileCopyrightText: 2022-present Ofek Lev <oss@ofek.dev>
#
# SPDX-License-Identifier: MIT
| 32.685714 | 77 | 0.668706 | # SPDX-FileCopyrightText: 2022-present Ofek Lev <oss@ofek.dev>
#
# SPDX-License-Identifier: MIT
from hatchling.version.source.plugin.interface import VersionSourceInterface
class VCSVersionSource(VersionSourceInterface):
PLUGIN_NAME = 'vcs'
def __init__(self, *args, **kwargs):
super(VCSVersionSource,... | 0 | 1,083 | 0 | 1,008 | 0 | 0 | 0 | 55 | 45 |
d73ac3c9452edba0b0b59e8de232220b9ef33e42 | 1,087 | py | Python | scripts/find_zone.py | MrCerealKiller/agros_paths | afbae25280541ddef2dff0bba69b052068d998d0 | [
"MIT"
] | null | null | null | scripts/find_zone.py | MrCerealKiller/agros_paths | afbae25280541ddef2dff0bba69b052068d998d0 | [
"MIT"
] | null | null | null | scripts/find_zone.py | MrCerealKiller/agros_paths | afbae25280541ddef2dff0bba69b052068d998d0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import rospy
from geodesy.utm import gridZone
def main():
"""
Simple utility script to find the UTM zone of WGS84 coords
"""
TAG = "[find_zone.main] "
lat = rospy.get_param('~lat', None)
lon = rospy.get_param('~lon', None)
# Check that at least lat and lon are provided
missing_args =... | 20.903846 | 60 | 0.636615 | #!/usr/bin/env python
import rospy
from geodesy.utm import gridZone
def main():
"""
Simple utility script to find the UTM zone of WGS84 coords
"""
TAG = "[find_zone.main] "
lat = rospy.get_param('~lat', None)
lon = rospy.get_param('~lon', None)
# Check that at least lat and lon are provided
missing_args =... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7ac35ca1f56e6121c03a2f94c88ea62eb273c365 | 417 | py | Python | gcloud/filter_functions.py | pantheon-ci-bot/etl-framework | 36d4c0d5c26ddd7c0bb2d2b99e3138b50a21c46f | [
"MIT"
] | 2 | 2017-03-01T20:09:06.000Z | 2019-02-08T17:10:16.000Z | gcloud/filter_functions.py | pantheon-ci-bot/etl-framework | 36d4c0d5c26ddd7c0bb2d2b99e3138b50a21c46f | [
"MIT"
] | 40 | 2015-10-10T15:02:21.000Z | 2020-03-17T22:32:04.000Z | gcloud/filter_functions.py | pantheon-ci-bot/etl-framework | 36d4c0d5c26ddd7c0bb2d2b99e3138b50a21c46f | [
"MIT"
] | 2 | 2018-11-14T21:50:58.000Z | 2022-03-07T20:59:27.000Z | """set of filter functions"""
import datetime
import uuid
def choose_current_date_partition():
"""gets the parition for current date"""
return datetime.date.today().strftime('$%Y%m%d')
def add_bigquery_insert_uuid(row):
"""formats output_row and adds a uuid to be inserted"""
output_row = dict()
... | 20.85 | 59 | 0.688249 | """set of filter functions"""
import datetime
import uuid
def choose_current_date_partition():
"""gets the parition for current date"""
return datetime.date.today().strftime('$%Y%m%d')
def add_bigquery_insert_uuid(row):
"""formats output_row and adds a uuid to be inserted"""
output_row = dict()
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4e8f4745274985a263ec4883d895332a482b971e | 2,937 | py | Python | server/problem_server/ocr_server.py | jun0911-cmyk/s-class-version-3.0 | b485b643f2cc62e81ca15bce52e6aff843f3459d | [
"MIT"
] | null | null | null | server/problem_server/ocr_server.py | jun0911-cmyk/s-class-version-3.0 | b485b643f2cc62e81ca15bce52e6aff843f3459d | [
"MIT"
] | null | null | null | server/problem_server/ocr_server.py | jun0911-cmyk/s-class-version-3.0 | b485b643f2cc62e81ca15bce52e6aff843f3459d | [
"MIT"
] | null | null | null | import pytesseract
pytesseract.pytesseract.tesseract_cmd = r'C:/Program Files/Tesseract-OCR/tesseract.exe'
img_height = 180
img_width = 180
image_name = 'test1.jpg'
model_name = '1627062415'
class_names = ['drawing', 'paper', 'problem']
model_path = 'C:/Users/jun09/OneDrive/Desktop/s-class_system_version/s-class_v... | 31.580645 | 149 | 0.695267 | import tensorflow as tf
import numpy as np
import pytesseract
import cv2
import json
import time
from tensorflow import keras
pytesseract.pytesseract.tesseract_cmd = r'C:/Program Files/Tesseract-OCR/tesseract.exe'
img_height = 180
img_width = 180
image_name = 'test1.jpg'
model_name = '1627062415'
class_names = ['dr... | 0 | 0 | 0 | 0 | 0 | 1,409 | 0 | -25 | 316 |
77ff6b6bfaabc0cad8a99a72c1b833c554b753c8 | 11,240 | py | Python | spy/compiler.py | pcostesi/spy | 6a352df1053fea60dd6bbc9932bc946e8fae1e3e | [
"OLDAP-2.6"
] | 1 | 2017-09-01T21:21:24.000Z | 2017-09-01T21:21:24.000Z | spy/compiler.py | pcostesi/spy | 6a352df1053fea60dd6bbc9932bc946e8fae1e3e | [
"OLDAP-2.6"
] | null | null | null | spy/compiler.py | pcostesi/spy | 6a352df1053fea60dd6bbc9932bc946e8fae1e3e | [
"OLDAP-2.6"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2011, 2012 Pablo A. Costesich <pcostesi@alu.itba.edu.ar>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of... | 36.258065 | 89 | 0.589057 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2011, 2012 Pablo A. Costesich <pcostesi@alu.itba.edu.ar>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of... | 0 | 343 | 0 | 3,548 | 1,997 | 1,863 | 0 | 62 | 332 |
2c4bbed56d2060a94133f5d39838f35c71f142a4 | 3,003 | py | Python | fMRI Tasks/WASABI bodymap/Stimulus Timing Test.py | canlab/WASABI_public | c10a33fcd8959ff9798eeec099a3f8954531661d | [
"MIT"
] | 1 | 2021-11-16T09:59:14.000Z | 2021-11-16T09:59:14.000Z | fMRI Tasks/WASABI bodymap/Stimulus Timing Test.py | canlab/WASABI_public | c10a33fcd8959ff9798eeec099a3f8954531661d | [
"MIT"
] | null | null | null | fMRI Tasks/WASABI bodymap/Stimulus Timing Test.py | canlab/WASABI_public | c10a33fcd8959ff9798eeec099a3f8954531661d | [
"MIT"
] | null | null | null | import timeit
# from datetime import datetime
import random
while True:
# startTime = timeit.default_timer()
# poll_for_change('IDLE')
# core.wait(5)
# command = random.randint(101,171)
command = 117
if poll_for_change('IDLE', poll_max=-1):
# startTime = datetime.now()
startTi... | 48.435484 | 156 | 0.651682 | import timeit
# from datetime import datetime
from medocControl import *
from psychopy import core
import random
while True:
# startTime = timeit.default_timer()
# poll_for_change('IDLE')
# core.wait(5)
# command = random.randint(101,171)
command = 117
if poll_for_change('IDLE', poll_max=-1): ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 | 44 |
e038dd34934518811ef8ccaa09dd09f2275f1656 | 5,351 | py | Python | saefportal/analyzer/analyzers/analyzer_comparison_dataset.py | harry-consulting/SAEF1 | 055d6e492ba76f90e3248b9da2985fdfe0c6b430 | [
"BSD-2-Clause"
] | null | null | null | saefportal/analyzer/analyzers/analyzer_comparison_dataset.py | harry-consulting/SAEF1 | 055d6e492ba76f90e3248b9da2985fdfe0c6b430 | [
"BSD-2-Clause"
] | null | null | null | saefportal/analyzer/analyzers/analyzer_comparison_dataset.py | harry-consulting/SAEF1 | 055d6e492ba76f90e3248b9da2985fdfe0c6b430 | [
"BSD-2-Clause"
] | 1 | 2020-12-16T15:02:52.000Z | 2020-12-16T15:02:52.000Z | from __future__ import absolute_import, unicode_literals
| 44.966387 | 116 | 0.646982 | from __future__ import absolute_import, unicode_literals
from saefportal.settings import COMPARISON_PROFILE_THRESHOLD
from .analyzer import Analyzer
from analyzer.models import ActualColumnProfile, ExpectedColumnProfile
from analyzer.enums import Column
def _calculate_change(ratio):
result = 0
for value in r... | 0 | 0 | 0 | 3,015 | 0 | 1,913 | 0 | 109 | 250 |
7ba651cd035605544502236d142bdb383f2797b4 | 16,843 | py | Python | mpython_conn.py | labplus-cn/mpython_conn | 566a281afed56cac0adad3885cb51d748be63e73 | [
"MIT"
] | 1 | 2020-06-16T08:03:56.000Z | 2020-06-16T08:03:56.000Z | mpython_conn.py | labplus-cn/mpython_conn | 566a281afed56cac0adad3885cb51d748be63e73 | [
"MIT"
] | null | null | null | mpython_conn.py | labplus-cn/mpython_conn | 566a281afed56cac0adad3885cb51d748be63e73 | [
"MIT"
] | 2 | 2020-09-24T05:23:03.000Z | 2020-11-25T06:39:15.000Z | # -*- coding:utf-8 -*-
# @Time : 2020/06/10
# @Author : Wu Wen Jie(6692776@qq.com)
# @FileName : mpython_conn.py
# @Description : A transfer protocol between mPython board and PC python
# @Version : 0.3.2
import inspect
import ctypes
def _async_raise(tid, exctype):
"""raises the exception, performs cleanup... | 34.026263 | 117 | 0.48869 | # -*- coding:utf-8 -*-
# @Time : 2020/06/10
# @Author : Wu Wen Jie(6692776@qq.com)
# @FileName : mpython_conn.py
# @Description : A transfer protocol between mPython board and PC python
# @Version : 0.3.2
from serial.tools.list_ports import comports as list_serial_ports
from serial import Serial
import threading... | 513 | 43 | 0 | 15,472 | 0 | 46 | 0 | 11 | 223 |
c6496b78286a6cb875dc7d76cb7bb13bb97a0c5d | 5,069 | py | Python | data.py | zxr931120/WGAN-for-studying | be05f7d0a32b571f899e4aa82135465262a0a7f7 | [
"MIT"
] | 132 | 2019-06-28T02:39:19.000Z | 2022-03-05T10:04:17.000Z | data.py | zxr931120/WGAN-for-studying | be05f7d0a32b571f899e4aa82135465262a0a7f7 | [
"MIT"
] | 1 | 2019-11-14T00:49:50.000Z | 2019-11-15T09:36:52.000Z | data.py | zxr931120/WGAN-for-studying | be05f7d0a32b571f899e4aa82135465262a0a7f7 | [
"MIT"
] | 32 | 2019-08-03T20:43:31.000Z | 2021-09-22T03:23:31.000Z |
# ==============================================================================
# = custom dataset =
# ==============================================================================
# ===================================================================... | 37.272059 | 151 | 0.580588 | import torchlib
from torch.utils.data import DataLoader, Dataset
from torchvision import datasets, transforms
class OnlyImage(Dataset):
def __init__(self, img_label_dataset):
self.img_label_dataset = img_label_dataset
def __len__(self):
return len(self.img_label_dataset)
def __getitem_... | 0 | 0 | 0 | 241 | 0 | 3,787 | 0 | 44 | 182 |
4a8006cc1715e24a963b1356d0f168161b4b4b96 | 2,150 | py | Python | dependencies/src/4Suite-XML-1.0.2/test/Xml/Xslt/Borrowed/mb_20030223.py | aleasims/Peach | bb56841e943d719d5101fee0a503ed34308eda04 | [
"MIT"
] | null | null | null | dependencies/src/4Suite-XML-1.0.2/test/Xml/Xslt/Borrowed/mb_20030223.py | aleasims/Peach | bb56841e943d719d5101fee0a503ed34308eda04 | [
"MIT"
] | null | null | null | dependencies/src/4Suite-XML-1.0.2/test/Xml/Xslt/Borrowed/mb_20030223.py | aleasims/Peach | bb56841e943d719d5101fee0a503ed34308eda04 | [
"MIT"
] | 1 | 2020-07-26T03:57:45.000Z | 2020-07-26T03:57:45.000Z | # a pretty straightforward Muenchian grouping test
sheet_1 = """<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes"/>
<xsl:key name="skills-by-mark" match="skill" use="@mark"/>
<xsl:template match="skill... | 29.054054 | 80 | 0.587907 | # a pretty straightforward Muenchian grouping test
from Xml.Xslt import test_harness
sheet_1 = """<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes"/>
<xsl:key name="skills-by-mark" match="skill" use="@m... | 0 | 0 | 0 | 0 | 0 | 245 | 0 | 12 | 46 |
9fa78deb2a18cf18221d0916963fbbc9bcac1a13 | 1,255 | py | Python | cheatsheet-startup-python/example-basic/advance/iteration-fun.py | seniortesting/cheatsheet-startup-parent | de0047d58e245427efa992f0f19c30bdec4f70f4 | [
"MIT"
] | null | null | null | cheatsheet-startup-python/example-basic/advance/iteration-fun.py | seniortesting/cheatsheet-startup-parent | de0047d58e245427efa992f0f19c30bdec4f70f4 | [
"MIT"
] | null | null | null | cheatsheet-startup-python/example-basic/advance/iteration-fun.py | seniortesting/cheatsheet-startup-parent | de0047d58e245427efa992f0f19c30bdec4f70f4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from collections.abc import Iterable
if __name__ == '__main__':
#
d = {'a': 1, 'b': 2, 'c': 3}
for key in d:
print(key,d[key])
#
for x in 'abc':
print(x)
#
iter=isinstance(['a','b','c'], Iterable)
print(iter)
# em... | 20.916667 | 50 | 0.508367 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from collections.abc import Iterable
def findMinAndMax(L):
if L is None:
raise TypeError('不能为空')
if len(L)==0:
return None,None
# 采用循环得到对应的最小值最大值
max=min=L[0]
for i in range(len(L)):
if L[i]>=max:
max= L[i]
... | 270 | 0 | 0 | 0 | 0 | 271 | 0 | 0 | 23 |