hexsha stringlengths 40 40 | size int64 5 2.06M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 248 | max_stars_repo_name stringlengths 5 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | 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 3 248 | max_issues_repo_name stringlengths 5 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringdate 2015-01-01 00:00:47 2022-03-31 23:42:18 ⌀ | max_issues_repo_issues_event_max_datetime stringdate 2015-01-01 17:43:30 2022-03-31 23:59:58 ⌀ | max_forks_repo_path stringlengths 3 248 | max_forks_repo_name stringlengths 5 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 5 2.06M | avg_line_length float64 1 1.02M | max_line_length int64 3 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dfb68a5201db3b2abf55a2e729e1d1531d27950c | 77 | py | Python | src/buildercore/external.py | elifesciences/builder | 161829686f777f7ac7f97bd970395886ba5089c1 | [
"MIT"
] | 11 | 2017-03-01T18:00:30.000Z | 2021-12-10T05:11:02.000Z | src/buildercore/external.py | elifesciences/builder | 161829686f777f7ac7f97bd970395886ba5089c1 | [
"MIT"
] | 397 | 2016-07-08T14:39:46.000Z | 2022-03-30T12:45:09.000Z | src/buildercore/external.py | elifesciences/builder | 161829686f777f7ac7f97bd970395886ba5089c1 | [
"MIT"
] | 14 | 2016-07-13T08:33:28.000Z | 2020-04-22T21:42:21.000Z | import subprocess
def execute(cmd):
return subprocess.check_output(cmd)
| 15.4 | 39 | 0.779221 |
dfb696c1a314cee61ccd51a38771b72300f8407a | 648 | py | Python | Round 2/data_packing.py | kamyu104/GoogleCodeJam-2014 | ff29a677f502168eb0b92d6928ad6983d2622017 | [
"MIT"
] | 10 | 2016-04-10T22:50:54.000Z | 2021-04-17T18:17:02.000Z | Round 2/data_packing.py | kamyu104/GoogleCodeJam-2014 | ff29a677f502168eb0b92d6928ad6983d2622017 | [
"MIT"
] | null | null | null | Round 2/data_packing.py | kamyu104/GoogleCodeJam-2014 | ff29a677f502168eb0b92d6928ad6983d2622017 | [
"MIT"
] | 10 | 2016-07-19T08:43:38.000Z | 2021-07-22T22:38:44.000Z | # Copyright (c) 2021 kamyu. All rights reserved.
#
# Google Code Jam 2014 Round 2 - Problem A. Data Packing
# https://codingcompetitions.withgoogle.com/codejam/round/0000000000432fed/0000000000432b8d
#
# Time: O(NlogN)
# Space: O(1)
#
def data_packing():
N, X = map(int, raw_input().strip().split())
S = map(in... | 24.923077 | 91 | 0.598765 |
dfb71ae9c49c8ec75050dd6031ca98dd54f66f9f | 18,950 | py | Python | BiModNeuroCNN/training/bimodal_classification.py | cfcooney/BiModNeuroCNN | f79da6150b4186bcbc15d876394f4af8a47076d0 | [
"MIT"
] | 4 | 2020-10-31T21:20:12.000Z | 2022-01-05T16:13:07.000Z | BiModNeuroCNN/training/bimodal_classification.py | cfcooney/BiModNeuroCNN | f79da6150b4186bcbc15d876394f4af8a47076d0 | [
"MIT"
] | null | null | null | BiModNeuroCNN/training/bimodal_classification.py | cfcooney/BiModNeuroCNN | f79da6150b4186bcbc15d876394f4af8a47076d0 | [
"MIT"
] | null | null | null | """
Description: Class for training CNNs using a nested cross-validation method. Train on the inner_fold to obtain
optimized hyperparameters. Train outer_fold to obtain classification performance.
"""
from braindecode.datautil.iterators import BalancedBatchSizeIterator
from braindecode.experiments.stopcriteria imp... | 57.95107 | 154 | 0.644063 |
dfb822e8f7cafa7cb423cc71ade94b740d42328b | 7,462 | py | Python | simple_task_repeater/str_app.py | lavrpetrov/simple-task-repeater | cd56ed52143ac31171fc757c6e1f7740bebe1ed4 | [
"MIT"
] | null | null | null | simple_task_repeater/str_app.py | lavrpetrov/simple-task-repeater | cd56ed52143ac31171fc757c6e1f7740bebe1ed4 | [
"MIT"
] | null | null | null | simple_task_repeater/str_app.py | lavrpetrov/simple-task-repeater | cd56ed52143ac31171fc757c6e1f7740bebe1ed4 | [
"MIT"
] | 1 | 2021-04-20T15:38:44.000Z | 2021-04-20T15:38:44.000Z | import datetime
from collections import Counter
from functools import wraps
from dateparser import parse as parse_date
from calmlib import get_current_date, get_current_datetime, to_date, trim
from .base import Task
from .str_database import STRDatabase
from .telegram_bot import TelegramBot, command, catch_errors
DE... | 32.163793 | 107 | 0.590592 |
dfb8674c6f7746d9692d1c11fcd1c8fdb24ebb98 | 258 | py | Python | Strings/conversion-operation.py | tverma332/python3 | 544c4ec9c726c37293c8da5799f50575cc50852d | [
"MIT"
] | 3 | 2022-03-28T09:10:08.000Z | 2022-03-29T10:47:56.000Z | Strings/conversion-operation.py | tverma332/python3 | 544c4ec9c726c37293c8da5799f50575cc50852d | [
"MIT"
] | 1 | 2022-03-27T11:52:58.000Z | 2022-03-27T11:52:58.000Z | Strings/conversion-operation.py | tverma332/python3 | 544c4ec9c726c37293c8da5799f50575cc50852d | [
"MIT"
] | null | null | null | # lower , title , upper operations on string
x = "spider"
y = "MAN"
v=x.upper() # all letters will become uppercase
w=y.lower() # all letters will become lowercase
z=y.title() # only first letter will become upper and rest of all lowercase
print(v,w,z)
| 19.846154 | 75 | 0.705426 |
dfb9067db6876e985a83eb3d9d6219b06ce32b30 | 1,197 | py | Python | setup.py | adadesions/sfcpy | d395218ae9f72fed378c30ad604923373b7fbf3f | [
"MIT"
] | 2 | 2019-08-28T19:30:32.000Z | 2020-03-28T16:17:01.000Z | setup.py | adadesions/sfcpy | d395218ae9f72fed378c30ad604923373b7fbf3f | [
"MIT"
] | 5 | 2021-03-18T22:53:57.000Z | 2022-03-11T23:42:38.000Z | setup.py | adadesions/sfcpy | d395218ae9f72fed378c30ad604923373b7fbf3f | [
"MIT"
] | null | null | null | """Setup script for sfcpy"""
import os.path
from setuptools import setup
# The directory containing this file
HERE = os.path.abspath(os.path.dirname(__file__))
# The text of the README file
with open(os.path.join(HERE, "README.md"), encoding='utf-8') as fid:
README = fid.read()
# This call to setup() does all t... | 29.925 | 73 | 0.652464 |
dfb94390c72e2b9eb210dfba78b3240cd00784e2 | 7,921 | py | Python | make_DigitalCommons_spreadsheet.py | lsulibraries/CWBR_DigitalCommons | 6eb994d08d6de088075cde82f6dc2b3aed15bdda | [
"Apache-2.0"
] | null | null | null | make_DigitalCommons_spreadsheet.py | lsulibraries/CWBR_DigitalCommons | 6eb994d08d6de088075cde82f6dc2b3aed15bdda | [
"Apache-2.0"
] | null | null | null | make_DigitalCommons_spreadsheet.py | lsulibraries/CWBR_DigitalCommons | 6eb994d08d6de088075cde82f6dc2b3aed15bdda | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import csv
import os
from collections import namedtuple
import string
from nameparser import HumanName
def csv_to_dict(filename):
file_dict = dict()
with open(filename, 'r', newline='', encoding='utf-8') as csvfile:
csvreader = csv.reader(csvfile, delimiter='\t', quotechar='"'... | 36.004545 | 112 | 0.550562 |
dfb9a74f5e09588db5c20e479a0c85f0735ce76b | 7,524 | py | Python | pip_services3_redis/cache/RedisCache.py | pip-services-python/pip-services-redis-python | ecb2e667ab266af0274b0891a19e802cb256766a | [
"MIT"
] | null | null | null | pip_services3_redis/cache/RedisCache.py | pip-services-python/pip-services-redis-python | ecb2e667ab266af0274b0891a19e802cb256766a | [
"MIT"
] | null | null | null | pip_services3_redis/cache/RedisCache.py | pip-services-python/pip-services-redis-python | ecb2e667ab266af0274b0891a19e802cb256766a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from typing import Optional, Any
import redis
from pip_services3_commons.config import IConfigurable, ConfigParams
from pip_services3_commons.errors import ConfigException, InvalidStateException
from pip_services3_commons.refer import IReferenceable, IReferences
from pip_services3_commons.run i... | 37.064039 | 158 | 0.636895 |
dfbade8328cd7332030b49fd40ed470582f05c91 | 7,392 | py | Python | main/model/property.py | lipis/gae-init-magic | 6b1e0b50f8e5200cb2dacebca9ac65e796b241a9 | [
"MIT"
] | 1 | 2018-10-26T13:33:20.000Z | 2018-10-26T13:33:20.000Z | main/model/property.py | lipis/gae-init-magic | 6b1e0b50f8e5200cb2dacebca9ac65e796b241a9 | [
"MIT"
] | 652 | 2018-10-26T12:28:08.000Z | 2021-08-02T09:13:48.000Z | main/model/property.py | lipis/gae-init-magic | 6b1e0b50f8e5200cb2dacebca9ac65e796b241a9 | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import absolute_import
from google.appengine.ext import ndb
from api import fields
import model
import util
class Property(model.Base):
name = ndb.StringProperty(required=True)
rank = ndb.IntegerProperty(default=0)
verbose_name = ndb.StringProperty(default='')
show_on_view ... | 38.701571 | 123 | 0.652056 |
dfbc302b59b318fa83066ffc6aa91c4caa2533da | 1,189 | py | Python | tests/test_request.py | pauleveritt/wired_components | a9072d5fc48680d5ff895887842ffd0f06bc0081 | [
"MIT"
] | 1 | 2019-09-15T12:30:44.000Z | 2019-09-15T12:30:44.000Z | tests/test_request.py | pauleveritt/wired_components | a9072d5fc48680d5ff895887842ffd0f06bc0081 | [
"MIT"
] | null | null | null | tests/test_request.py | pauleveritt/wired_components | a9072d5fc48680d5ff895887842ffd0f06bc0081 | [
"MIT"
] | null | null | null | import pytest
from wired import ServiceContainer
@pytest.fixture
def request_container(registry, simple_root) -> ServiceContainer:
from wired_components.request import wired_setup as request_setup
from wired_components.resource import IRoot
from wired_components.url import IUrl, Url
# Outside system ... | 31.289474 | 69 | 0.764508 |
dfbd03cf9bf0d42acbc4621a1653916d133bdb8e | 958 | py | Python | Charts and Graphs/LollipopCharts.py | aprakash7/Buildyourown | 58f0530ea84bf9e91f258d947610ea1e93d7d456 | [
"MIT"
] | null | null | null | Charts and Graphs/LollipopCharts.py | aprakash7/Buildyourown | 58f0530ea84bf9e91f258d947610ea1e93d7d456 | [
"MIT"
] | null | null | null | Charts and Graphs/LollipopCharts.py | aprakash7/Buildyourown | 58f0530ea84bf9e91f258d947610ea1e93d7d456 | [
"MIT"
] | 1 | 2021-05-31T04:20:54.000Z | 2021-05-31T04:20:54.000Z | # -*- coding: utf-8 -*-
"""
Created on Mon May 17 21:24:53 2021
@author: Akshay Prakash
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
table = pd.read_csv(r'\1617table.csv')
table.head()
plt.hlines(y= np.arange(1, 21), xmin = 0, xmax = table['Pts'], color = 'skyblue')
plt.p... | 30.903226 | 84 | 0.583507 |
dfbf2ca5c949daa624f3881dc6dcb4567701067b | 1,126 | py | Python | python/merge-kml-files/merge-kml-files.py | bmaupin/graveyard | 71d52fe6589ce13dfe7433906d1aa50df48c9f94 | [
"MIT"
] | 1 | 2019-11-23T10:44:58.000Z | 2019-11-23T10:44:58.000Z | python/merge-kml-files/merge-kml-files.py | bmaupin/graveyard | 71d52fe6589ce13dfe7433906d1aa50df48c9f94 | [
"MIT"
] | 8 | 2020-07-16T07:14:12.000Z | 2020-10-14T17:25:33.000Z | python/merge-kml-files/merge-kml-files.py | bmaupin/graveyard | 71d52fe6589ce13dfe7433906d1aa50df48c9f94 | [
"MIT"
] | 1 | 2019-11-23T10:45:00.000Z | 2019-11-23T10:45:00.000Z | #!/usr/bin/env python
import sys
import lxml.etree
def main():
if len(sys.argv) < 3:
sys.stderr.write('ERROR: Must provide at least 2 KML files to merge\n')
sys.exit('Usage: {} FILE1 FILE2 ...'.format(sys.argv[0]))
first_kml_root = lxml.etree.parse(sys.argv[1]).getroot()
first_kml_ns... | 31.277778 | 79 | 0.599467 |
dfbf59c5b26596753447f4f968efc9068d24fa0b | 3,829 | py | Python | tccli/services/partners/v20180321/help.py | tarnover/tencentcloud-cli | 5b0537913a33884a20d7663405a8aa1c2276b41a | [
"Apache-2.0"
] | null | null | null | tccli/services/partners/v20180321/help.py | tarnover/tencentcloud-cli | 5b0537913a33884a20d7663405a8aa1c2276b41a | [
"Apache-2.0"
] | null | null | null | tccli/services/partners/v20180321/help.py | tarnover/tencentcloud-cli | 5b0537913a33884a20d7663405a8aa1c2276b41a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
DESC = "partners-2018-03-21"
INFO = {
"AgentPayDeals": {
"params": [
{
"name": "OwnerUin",
"desc": "订单所有者uin"
},
{
"name": "AgentPay",
"desc": "代付标志,1:代付;0:自付"
},
{
"name": "DealNames",
"desc": "订单号数组"
}
... | 19.049751 | 68 | 0.404022 |
dfbfef0fe41686291ae36ae72197b63006cb0f9c | 83,387 | py | Python | src/main/python/lib/default/__init__.py | emilybache/texttest-runner | 2d5c42b8d37699a2cbcb8f19af7c271d6ad1024a | [
"MIT"
] | null | null | null | src/main/python/lib/default/__init__.py | emilybache/texttest-runner | 2d5c42b8d37699a2cbcb8f19af7c271d6ad1024a | [
"MIT"
] | null | null | null | src/main/python/lib/default/__init__.py | emilybache/texttest-runner | 2d5c42b8d37699a2cbcb8f19af7c271d6ad1024a | [
"MIT"
] | null | null | null |
""" The default configuration, from which all others should be derived """
import os, plugins, sandbox, console, rundependent, comparetest, batch, performance, subprocess, operator, logging
from copy import copy
from string import Template
from fnmatch import fnmatch
from threading import Thread
# For back-compatibi... | 52.876982 | 316 | 0.651193 |
dfc3450cc6a455bca7329de3130cbc552b8baa62 | 747 | py | Python | 2019/10 October/dp10302019.py | vishrutkmr7/DailyPracticeProblemsDIP | d1bfbc75f2024736c22c05385f753a90ddcfa0f5 | [
"MIT"
] | 5 | 2019-08-06T02:34:41.000Z | 2022-01-08T03:03:16.000Z | 2019/10 October/dp10302019.py | ourangzeb/DailyPracticeProblemsDIP | 66c07af88754e5d59b243e3ee9f02db69f7c0a77 | [
"MIT"
] | 15 | 2021-06-01T14:04:16.000Z | 2022-03-08T21:17:22.000Z | 2019/10 October/dp10302019.py | ourangzeb/DailyPracticeProblemsDIP | 66c07af88754e5d59b243e3ee9f02db69f7c0a77 | [
"MIT"
] | 4 | 2019-09-19T20:00:05.000Z | 2021-08-16T11:31:51.000Z | # This problem was recently asked by LinkedIn:
# Given a non-empty array where each element represents a digit of a non-negative integer, add one to the integer.
# The most significant digit is at the front of the array and each element in the array contains only one digit.
# Furthermore, the integer does not have lea... | 28.730769 | 114 | 0.619813 |
dfc40c993839966190091cb6ae4333cb9d7b2cc3 | 1,122 | py | Python | kbr/run_utils.py | brugger/kbr-tools | 95c8f8274e28b986e7fd91c8404026433488c940 | [
"MIT"
] | 1 | 2021-02-02T09:47:40.000Z | 2021-02-02T09:47:40.000Z | kbr/run_utils.py | brugger/kbr-tools | 95c8f8274e28b986e7fd91c8404026433488c940 | [
"MIT"
] | 1 | 2021-08-04T13:00:00.000Z | 2021-08-04T13:00:00.000Z | kbr/run_utils.py | brugger/kbr-tools | 95c8f8274e28b986e7fd91c8404026433488c940 | [
"MIT"
] | null | null | null | import subprocess
import sys
import os
class ExecutionInfo:
def __init__(self, p_status: int, stdout: str, stderr: str):
self.p_status = p_status
self.stdout = stdout
self.stderr = stderr
def exit_fail(msg: str = "") -> None:
print(msg)
sys.exit(-1)
def exit_ok(msg: str = "") ... | 23.375 | 123 | 0.632799 |
dfc40d4989f8ef494b36888ba91588827d76ffc5 | 2,614 | py | Python | tests/client/test_files.py | philopon/datapane | d7d69865d4def0cbe6eb334acd9edeb829dd67e6 | [
"Apache-2.0"
] | 481 | 2020-04-25T05:40:21.000Z | 2022-03-30T22:04:35.000Z | tests/client/test_files.py | tig/datapane | defae6776e73b07191c0a5804a50b284ec3c9a63 | [
"Apache-2.0"
] | 74 | 2020-04-28T10:47:35.000Z | 2022-03-14T15:50:55.000Z | tests/client/test_files.py | admariner/datapane | c440eaf07bd1c1f2de3ff952e0fd8c78d636aa8f | [
"Apache-2.0"
] | 41 | 2020-07-21T16:30:21.000Z | 2022-02-21T22:50:27.000Z | from pathlib import Path
import altair as alt
import folium
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import plotly.graph_objects as p_go
import pytest
from bokeh.layouts import column
from bokeh.models import ColumnDataSource
from bokeh.plotting import figure
from pandas.io.formats.style ... | 26.948454 | 121 | 0.694721 |
dfc53823fb3adccd40e9762c665f5bb3deecbf27 | 95 | py | Python | instance/config.py | antomuli/News_Highlight | 9feb33c0a32fa78cd93f5ab2c74942a8ca281701 | [
"Unlicense"
] | 2 | 2020-03-23T23:16:51.000Z | 2020-04-26T21:15:11.000Z | instance/config.py | antomuli/News_Highlight | 9feb33c0a32fa78cd93f5ab2c74942a8ca281701 | [
"Unlicense"
] | null | null | null | instance/config.py | antomuli/News_Highlight | 9feb33c0a32fa78cd93f5ab2c74942a8ca281701 | [
"Unlicense"
] | null | null | null | NEWS_API_KEY= '138b22df68394ecbaa9c9af0d0377adb'
SECRET_KEY= 'f9bf78b9a18ce6d46a0cd2b0b86df9da' | 47.5 | 48 | 0.905263 |
dfc5ea1ec35f681b24bc22174c17b45b8de95235 | 1,417 | py | Python | twirp/logging.py | batchar2/twirpy | e5940a2a038926844098def09748953287071747 | [
"Unlicense"
] | 51 | 2020-05-23T22:31:53.000Z | 2022-03-08T19:14:04.000Z | twirp/logging.py | batchar2/twirpy | e5940a2a038926844098def09748953287071747 | [
"Unlicense"
] | 20 | 2020-05-15T10:20:38.000Z | 2022-02-06T23:21:56.000Z | twirp/logging.py | batchar2/twirpy | e5940a2a038926844098def09748953287071747 | [
"Unlicense"
] | 10 | 2020-05-29T09:55:49.000Z | 2021-10-16T00:14:04.000Z | import os
import logging
import sys
import structlog
from structlog.stdlib import LoggerFactory, add_log_level
_configured = False
def configure(force = False):
"""
Configures logging & structlog modules
Keyword Arguments:
force: Force to reconfigure logging.
"""
global _configured
if ... | 22.140625 | 57 | 0.628088 |
dfc68640fe94c25498745f6373d4a8f15e6f9a5f | 878 | py | Python | setup.py | Arkq/pyexec | ec90b0aaff80996155d033bd722ff59c9259460e | [
"MIT"
] | null | null | null | setup.py | Arkq/pyexec | ec90b0aaff80996155d033bd722ff59c9259460e | [
"MIT"
] | null | null | null | setup.py | Arkq/pyexec | ec90b0aaff80996155d033bd722ff59c9259460e | [
"MIT"
] | null | null | null | # setup.py
# Copyright (c) 2015-2017 Arkadiusz Bokowy
#
# This file is a part of pyexec.
#
# This project is licensed under the terms of the MIT license.
from setuptools import setup
import pyexec
with open("README.rst") as f:
long_description = f.read()
setup(
name="pyexec",
version=pyexec.__version__... | 25.085714 | 62 | 0.654897 |
dfc68f46a49d56c4e9d2e4ea5761354ae3746b5b | 323 | py | Python | tests/func_eqconstr.py | andyjost/Sprite | 7ecd6fc7d48d7f62da644e48c12c7b882e1a2929 | [
"MIT"
] | 1 | 2022-03-16T16:37:11.000Z | 2022-03-16T16:37:11.000Z | tests/func_eqconstr.py | andyjost/Sprite | 7ecd6fc7d48d7f62da644e48c12c7b882e1a2929 | [
"MIT"
] | null | null | null | tests/func_eqconstr.py | andyjost/Sprite | 7ecd6fc7d48d7f62da644e48c12c7b882e1a2929 | [
"MIT"
] | null | null | null | '''Functional tests for the equational constraint.'''
import cytest # from ./lib; must be first
class TestEqConstr(cytest.FunctionalTestCase):
SOURCE_DIR = 'data/curry/eqconstr/'
PRINT_SKIPPED_GOALS = True
# RUN_ONLY = ['a0_.[02468][048]', 'a0b0c0_.[037][048]', 'prog0.'] # A subset for quick checks.
# SKIP = [... | 32.3 | 96 | 0.693498 |
dfc7144f2268699316911b76b5597b6509452a54 | 4,898 | py | Python | data-sources/kbr/authority-persons-marc-to-csv.py | kbrbe/beltrans-data-integration | 951ae3941b22a6fe0a8d30079bdf6f4f0a55f092 | [
"MIT"
] | null | null | null | data-sources/kbr/authority-persons-marc-to-csv.py | kbrbe/beltrans-data-integration | 951ae3941b22a6fe0a8d30079bdf6f4f0a55f092 | [
"MIT"
] | 21 | 2022-02-14T10:58:52.000Z | 2022-03-28T14:04:40.000Z | data-sources/kbr/authority-persons-marc-to-csv.py | kbrbe/beltrans-data-integration | 951ae3941b22a6fe0a8d30079bdf6f4f0a55f092 | [
"MIT"
] | null | null | null | #
# (c) 2022 Sven Lieber
# KBR Brussels
#
#import xml.etree.ElementTree as ET
import lxml.etree as ET
import os
import json
import itertools
import enchant
import hashlib
import csv
from optparse import OptionParser
import utils
import stdnum
NS_MARCSLIM = 'http://www.loc.gov/MARC21/slim'
ALL_NS = {'marc': NS_MARCSLI... | 43.732143 | 186 | 0.682115 |
dfc7e5a8bbc57e53f20590d631fe2b87c31a1671 | 3,886 | py | Python | promoterz/evaluationPool.py | emillj/gekkoJaponicus | d77c8c7a303b97a3643eb3f3c8b995b8b393f3f7 | [
"MIT"
] | null | null | null | promoterz/evaluationPool.py | emillj/gekkoJaponicus | d77c8c7a303b97a3643eb3f3c8b995b8b393f3f7 | [
"MIT"
] | null | null | null | promoterz/evaluationPool.py | emillj/gekkoJaponicus | d77c8c7a303b97a3643eb3f3c8b995b8b393f3f7 | [
"MIT"
] | 1 | 2021-11-29T20:18:25.000Z | 2021-11-29T20:18:25.000Z | #!/bin/python
import time
import random
from multiprocessing import Pool, Process, Pipe, TimeoutError
from multiprocessing.pool import ThreadPool
class EvaluationPool():
def __init__(self, EvaluationTool, Urls, poolsize):
self.EvaluationTool = EvaluationTool
self.Urls = Urls
self.lasttim... | 33.213675 | 97 | 0.587494 |
dfc9bea7af7becf02c3cd0e4f00d6640fee9f247 | 3,001 | py | Python | website/drawquest/apps/following/models.py | bopopescu/drawquest-web | 8d8f9149b6efeb65202809a5f8916386f58a1b3b | [
"BSD-3-Clause"
] | 19 | 2015-11-10T17:36:20.000Z | 2021-04-12T07:36:00.000Z | website/drawquest/apps/following/models.py | bopopescu/drawquest-web | 8d8f9149b6efeb65202809a5f8916386f58a1b3b | [
"BSD-3-Clause"
] | 1 | 2021-06-09T03:45:34.000Z | 2021-06-09T03:45:34.000Z | website/drawquest/apps/following/models.py | bopopescu/drawquest-web | 8d8f9149b6efeb65202809a5f8916386f58a1b3b | [
"BSD-3-Clause"
] | 6 | 2015-11-11T00:38:38.000Z | 2020-07-25T20:10:08.000Z | from canvas.cache_patterns import CachedCall
from drawquest import knobs
from drawquest.apps.drawquest_auth.models import User
from drawquest.apps.drawquest_auth.details_models import UserDetails
from drawquest.pagination import FakePaginator
def _sorted(users):
return sorted(users, key=lambda user: user.username... | 34.102273 | 92 | 0.65978 |
dfcaf8188821bfe0448579c92b86161cf07a8cb5 | 3,674 | py | Python | Python 3/PyGame/Matrix_based_3D/entities.py | DarkShadow4/python | 4cd94e0cf53ee06c9c31e9272572ca9656697c30 | [
"MIT"
] | null | null | null | Python 3/PyGame/Matrix_based_3D/entities.py | DarkShadow4/python | 4cd94e0cf53ee06c9c31e9272572ca9656697c30 | [
"MIT"
] | null | null | null | Python 3/PyGame/Matrix_based_3D/entities.py | DarkShadow4/python | 4cd94e0cf53ee06c9c31e9272572ca9656697c30 | [
"MIT"
] | 1 | 2020-08-19T17:25:22.000Z | 2020-08-19T17:25:22.000Z | import numpy as np
def translationMatrix(dx=0, dy=0, dz=0):
return np.array([[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0],
[dx, dy, dz, 1]])
def scalingMatrix(sx=1, sy=1, sz=1):
return np.array([[sx, 0, 0, 0],
[0, sy, 0... | 33.099099 | 106 | 0.459717 |
dfcb6f77810c69d9413f60d8f54a4f595fd87395 | 65 | py | Python | pytreearray/multiply.py | PhilipVinc/netket_dynamics | 6e8009098c279271cb0f289ba9e85c039bb284e4 | [
"Apache-2.0"
] | 2 | 2021-10-02T20:29:44.000Z | 2021-10-02T20:38:28.000Z | pytreearray/multiply.py | PhilipVinc/netket_dynamics | 6e8009098c279271cb0f289ba9e85c039bb284e4 | [
"Apache-2.0"
] | 11 | 2021-10-01T09:15:06.000Z | 2022-03-21T09:19:23.000Z | pytreearray/multiply.py | PhilipVinc/netket_dynamics | 6e8009098c279271cb0f289ba9e85c039bb284e4 | [
"Apache-2.0"
] | null | null | null | from ._src.multiply import multiply_outer as outer # noqa: F401
| 32.5 | 64 | 0.784615 |
dfcda9e0f1ad0a543490dfbdc63f6f36b102ec00 | 1,258 | py | Python | setup.py | utix/django-json-api | 938f78f664a4ecbabb9e678595926d1a580f9d0c | [
"MIT"
] | 7 | 2021-02-26T14:35:17.000Z | 2021-02-26T21:21:58.000Z | setup.py | utix/django-json-api | 938f78f664a4ecbabb9e678595926d1a580f9d0c | [
"MIT"
] | 7 | 2021-02-26T14:44:30.000Z | 2021-06-02T14:27:17.000Z | setup.py | utix/django-json-api | 938f78f664a4ecbabb9e678595926d1a580f9d0c | [
"MIT"
] | 1 | 2021-02-26T20:10:42.000Z | 2021-02-26T20:10:42.000Z | #!/usr/bin/env python
from os.path import join
from setuptools import find_packages, setup
# DEPENDENCIES
def requirements_from_pip(filename):
with open(filename, "r") as pip:
return [line.strip() for line in pip if not line.startswith("#") and line.strip()]
core_deps = requirements_from_pip("requireme... | 29.952381 | 90 | 0.692369 |
dfcf9bc6b50b9274d2e45ff7e0b6d1af9920cab0 | 1,632 | py | Python | youtube_dl/extractor/businessinsider.py | MOODesign/Youtube-videos-Download | 730c0d12a06f349907481570f1f2890251f7a181 | [
"Unlicense"
] | 16 | 2020-12-01T15:26:58.000Z | 2022-02-24T23:12:14.000Z | youtube_dl/extractor/businessinsider.py | MOODesign/Youtube-videos-Download | 730c0d12a06f349907481570f1f2890251f7a181 | [
"Unlicense"
] | 5 | 2021-02-20T10:30:00.000Z | 2021-06-01T21:12:31.000Z | youtube_dl/extractor/businessinsider.py | MOODesign/Youtube-videos-Download | 730c0d12a06f349907481570f1f2890251f7a181 | [
"Unlicense"
] | 7 | 2020-12-01T15:27:04.000Z | 2022-01-09T23:21:53.000Z | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from .jwplatform import JWPlatformIE
class BusinessInsiderIE(InfoExtractor):
_VALID_URL = r'https?://(?:[^/]+\.)?businessinsider\.(?:com|nl)/(?:[^/]+/)*(?P<id>[^/?#&]+)'
_TESTS = [{
'url': 'http://uk.businessins... | 37.953488 | 112 | 0.571078 |
dfcfb445e47c75ccbf0dd0f1527b09b9571a8702 | 578 | py | Python | map_house.py | renankalfa/python-0-ao-Data_Scientist | 2f61e1cbb1c5565da53cc1cd9aa5c3f5d1cacc88 | [
"MIT"
] | 1 | 2022-03-27T23:55:37.000Z | 2022-03-27T23:55:37.000Z | map_house.py | renankalfa/python-0-ao-Data_Scientist | 2f61e1cbb1c5565da53cc1cd9aa5c3f5d1cacc88 | [
"MIT"
] | null | null | null | map_house.py | renankalfa/python-0-ao-Data_Scientist | 2f61e1cbb1c5565da53cc1cd9aa5c3f5d1cacc88 | [
"MIT"
] | null | null | null | import plotly.express as px
import pandas as pd
data = pd.read_csv('kc_house_data.csv')
data_mapa = data[['id', 'lat', 'long', 'price']]
grafico1 = px.scatter_mapbox(data_mapa, lat='lat', lon='long',
hover_name='id', hover_data=['price'],
color_discrete_sequen... | 36.125 | 75 | 0.610727 |
dfcfba95af54686ffe34f16d2ea3725de4ec6aa5 | 1,561 | py | Python | scripts/api-timeboard.py | ryhennessy/hiring-engineers | f151fb593a016b38b92767ce48d217c3d57c492a | [
"Apache-2.0"
] | null | null | null | scripts/api-timeboard.py | ryhennessy/hiring-engineers | f151fb593a016b38b92767ce48d217c3d57c492a | [
"Apache-2.0"
] | null | null | null | scripts/api-timeboard.py | ryhennessy/hiring-engineers | f151fb593a016b38b92767ce48d217c3d57c492a | [
"Apache-2.0"
] | 1 | 2019-02-06T00:09:36.000Z | 2019-02-06T00:09:36.000Z | #!/usr/bin/python
from datadog import initialize, api
options = {
'api_key': '17370fa45ebc4a8184d3dde9f8189c38',
'app_key': 'b0d652bbd1d861656723c1a93bc1a2f22d493d57'
}
initialize(**options)
title = "Ryan Great Timeboard"
description = "My Timeboard that is super awesome"
graphs = [
{
"title": "My Metric ove... | 20.539474 | 73 | 0.547726 |
dfd10fcf278a06e3edb0f59aed0bddac1ebc200d | 732 | py | Python | Playground/Spin.py | fountainment/cherry-soda | 3dd0eb7d0b5503ba572ff2104990856ef7a87495 | [
"MIT"
] | 27 | 2020-01-16T08:20:54.000Z | 2022-03-29T20:40:15.000Z | Playground/Spin.py | fountainment/cherry-soda | 3dd0eb7d0b5503ba572ff2104990856ef7a87495 | [
"MIT"
] | 10 | 2022-01-07T14:07:27.000Z | 2022-03-19T18:13:44.000Z | Playground/Spin.py | fountainment/cherry-soda | 3dd0eb7d0b5503ba572ff2104990856ef7a87495 | [
"MIT"
] | 6 | 2019-12-27T10:04:07.000Z | 2021-12-15T17:29:24.000Z | import numpy as np
import math
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
def get_spin(radius_scale, height_scale, rounds):
xs, ys, zs = [], [], []
theta = 0.0
delta = 0.1
twopi = math.pi * 2.0
for i in range(int(rounds * twopi / delta)):
theta += delta
... | 23.612903 | 49 | 0.579235 |
dfd2a91be88a84783b35bd946e501cc258160953 | 1,911 | py | Python | bin/get_latest_rotation.py | rhots/automation | cfa97656885f4ff91e1c79af5eb8fa38a85c35a8 | [
"0BSD"
] | 1 | 2017-06-06T03:07:01.000Z | 2017-06-06T03:07:01.000Z | bin/get_latest_rotation.py | rhots/automation | cfa97656885f4ff91e1c79af5eb8fa38a85c35a8 | [
"0BSD"
] | 3 | 2016-12-19T21:09:53.000Z | 2017-02-14T03:32:18.000Z | bin/get_latest_rotation.py | rhots/automation | cfa97656885f4ff91e1c79af5eb8fa38a85c35a8 | [
"0BSD"
] | null | null | null | import os.path
from bs4 import BeautifulSoup
import requests
# Location of file to store latest known page number
LAST_KNOWN_PAGE_FILE = "/tmp/rotation_checker_latest"
# URL of forum thread where latest rotations are posted
ROTATION_FORUM_THREAD = "https://us.battle.net/forums/en/heroes/topic/17936383460"
def write_... | 27.695652 | 85 | 0.697541 |
dfd2e5bbf8ec59072195c98d519d767f6b535cb9 | 2,485 | py | Python | fidelis/credentials.py | semperstew/fidelis | 8766b1bfa5bac342faf61bf4302a0e822d0a0ec9 | [
"Apache-2.0"
] | null | null | null | fidelis/credentials.py | semperstew/fidelis | 8766b1bfa5bac342faf61bf4302a0e822d0a0ec9 | [
"Apache-2.0"
] | null | null | null | fidelis/credentials.py | semperstew/fidelis | 8766b1bfa5bac342faf61bf4302a0e822d0a0ec9 | [
"Apache-2.0"
] | null | null | null | # fidelis/credentials.py
import datetime
import requests
import threading
from dateutil.tz import tzlocal
from collections import namedtuple
def _local_now():
return datetime.datetime.now(tzlocal())
class FidelisCredentials(object):
"""Object to hold authentication credentials"""
_default_token_timeout = 10... | 25.10101 | 79 | 0.695775 |
dfd45fc42c8fe07d08d4459f4ff51b022c580213 | 6,254 | py | Python | pos_wechat/tests/test_wechat_order.py | nahualventure/pos-addons | 3c911c28c259967fb74e311ddcc8e6ca032c005d | [
"MIT"
] | null | null | null | pos_wechat/tests/test_wechat_order.py | nahualventure/pos-addons | 3c911c28c259967fb74e311ddcc8e6ca032c005d | [
"MIT"
] | null | null | null | pos_wechat/tests/test_wechat_order.py | nahualventure/pos-addons | 3c911c28c259967fb74e311ddcc8e6ca032c005d | [
"MIT"
] | 3 | 2021-06-15T05:45:42.000Z | 2021-07-27T12:28:53.000Z | # Copyright 2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# License MIT (https://opensource.org/licenses/MIT).
import logging
from odoo.addons.point_of_sale.tests.common import TestPointOfSaleCommon
try:
from unittest.mock import patch
except ImportError:
from mock import patch
_logger = l... | 35.942529 | 88 | 0.512312 |
dfd6670490ad28a09d2ea2ea84c8564b4b85c4b8 | 582 | py | Python | docker/settings.py | uw-it-aca/course-roster-lti | 599dad70e06bc85d3d862116c00e8ecf0e2e9c8c | [
"Apache-2.0"
] | null | null | null | docker/settings.py | uw-it-aca/course-roster-lti | 599dad70e06bc85d3d862116c00e8ecf0e2e9c8c | [
"Apache-2.0"
] | 53 | 2017-01-28T00:03:57.000Z | 2022-03-23T21:57:13.000Z | docker/settings.py | uw-it-aca/course-roster-lti | 599dad70e06bc85d3d862116c00e8ecf0e2e9c8c | [
"Apache-2.0"
] | null | null | null | from .base_settings import *
INSTALLED_APPS += [
'course_roster.apps.CourseRosterConfig',
'compressor',
]
COMPRESS_ROOT = '/static/'
COMPRESS_PRECOMPILERS = (('text/less', 'lessc {infile} {outfile}'),)
COMPRESS_OFFLINE = True
STATICFILES_FINDERS += ('compressor.finders.CompressorFinder',)
if os.getenv('ENV',... | 26.454545 | 72 | 0.735395 |
dfd9ba7258d16727355e98f49f13d4ad3a7818cc | 606 | py | Python | pylons/decorators/util.py | KinSai1975/Menira.py | ca275ce244ee4804444e1827ba60010a55acc07c | [
"BSD-3-Clause"
] | 118 | 2015-01-04T06:55:14.000Z | 2022-01-14T08:32:41.000Z | pylons/decorators/util.py | KinSai1975/Menira.py | ca275ce244ee4804444e1827ba60010a55acc07c | [
"BSD-3-Clause"
] | 21 | 2015-01-03T02:16:28.000Z | 2021-03-24T06:10:57.000Z | pylons/decorators/util.py | KinSai1975/Menira.py | ca275ce244ee4804444e1827ba60010a55acc07c | [
"BSD-3-Clause"
] | 53 | 2015-01-04T03:21:08.000Z | 2021-08-04T20:52:01.000Z | """Decorator internal utilities"""
import pylons
from pylons.controllers import WSGIController
def get_pylons(decorator_args):
"""Return the `pylons` object: either the :mod`~pylons` module or
the :attr:`~WSGIController._py_object` equivalent, searching a
decorator's *args for the latter
:attr:`~WSGI... | 31.894737 | 71 | 0.722772 |
dfdcfb5c19d0b0d911ba4d7178ec8d4e8e195552 | 1,191 | py | Python | blt_net/pcmad/config_pcmad.py | AlexD123123/BLT-net | 97a06795137e0d9fc9332bbb342ad3248db7dc37 | [
"Apache-2.0"
] | 1 | 2022-01-13T07:23:52.000Z | 2022-01-13T07:23:52.000Z | blt_net/pcmad/config_pcmad.py | AlexD123123/BLT-net | 97a06795137e0d9fc9332bbb342ad3248db7dc37 | [
"Apache-2.0"
] | null | null | null | blt_net/pcmad/config_pcmad.py | AlexD123123/BLT-net | 97a06795137e0d9fc9332bbb342ad3248db7dc37 | [
"Apache-2.0"
] | null | null | null | from yacs.config import CfgNode as CN
def get_cfg_defaults():
"""Get a yacs CfgNode object with default values for my_project."""
# Return a clone so that the defaults will not be altered
# This is for the "local variable" use pattern
return _C.clone()
_C = CN()
_C.SYSTEM = CN()
_C.config_name = 'roi_config_d... | 29.775 | 87 | 0.565071 |
dfdddf5fadff57862aa0a7599f33c1b1aa1825cf | 1,188 | py | Python | src/pylendingclub/wrapper/order.py | bbarney213/PyLendingClub-Wrapper | 7f2ef823a56bc87b7f88abf86498805c2c9ce3d3 | [
"BSD-3-Clause"
] | 2 | 2018-06-06T20:04:04.000Z | 2018-06-13T12:17:37.000Z | src/pylendingclub/wrapper/order.py | bbarney213/PyLendingClub | 7f2ef823a56bc87b7f88abf86498805c2c9ce3d3 | [
"BSD-3-Clause"
] | 4 | 2018-10-18T13:59:14.000Z | 2018-10-23T16:08:51.000Z | src/pylendingclub/wrapper/order.py | bbarney213/PyLendingClub | 7f2ef823a56bc87b7f88abf86498805c2c9ce3d3 | [
"BSD-3-Clause"
] | null | null | null | class Order(object):
def order(self):
return {
'loanId': self._loan_id,
'requestedAmount': self._amount,
'portfolioId': self._portfolio
}
def __init__(self, loan_id, amount, portfolio):
self._loan_id = int(loan_id)
self._amount = amount
... | 29.7 | 69 | 0.619529 |
dfdf748f02b9b943852a62e3f8521187d01d62ea | 2,175 | py | Python | app/__init__.py | muthash/Weconnect-api | d3434c99b96a911258dfb8e3ff68696a2021a64b | [
"MIT"
] | 1 | 2018-03-15T17:08:11.000Z | 2018-03-15T17:08:11.000Z | app/__init__.py | muthash/Weconnect-api | d3434c99b96a911258dfb8e3ff68696a2021a64b | [
"MIT"
] | 1 | 2018-02-28T21:26:04.000Z | 2018-03-01T07:19:05.000Z | app/__init__.py | muthash/Weconnect-api | d3434c99b96a911258dfb8e3ff68696a2021a64b | [
"MIT"
] | 1 | 2018-03-09T03:45:22.000Z | 2018-03-09T03:45:22.000Z | """ The create_app function wraps the creation of a new Flask object, and
returns it after it's loaded up with configuration settings
using app.config
"""
from flask import jsonify
from flask_api import FlaskAPI
from flask_cors import CORS
from flask_sqlalchemy import SQLAlchemy
from flask_jwt_extended import J... | 31.521739 | 83 | 0.686897 |
dfdfaf2898c9221e7f4f486f5412b4e767f314f2 | 3,821 | py | Python | tests/test_constraints.py | jayvdb/versions | 951bc3fd99b6a675190f11ee0752af1d7ff5b440 | [
"MIT"
] | 3 | 2015-02-20T04:02:25.000Z | 2021-04-06T14:42:21.000Z | tests/test_constraints.py | jayvdb/versions | 951bc3fd99b6a675190f11ee0752af1d7ff5b440 | [
"MIT"
] | 1 | 2019-07-07T06:37:01.000Z | 2019-07-07T06:37:01.000Z | tests/test_constraints.py | jayvdb/versions | 951bc3fd99b6a675190f11ee0752af1d7ff5b440 | [
"MIT"
] | 2 | 2019-07-07T05:40:29.000Z | 2021-04-06T14:42:23.000Z | from unittest import TestCase
from versions.constraints import Constraints, merge, ExclusiveConstraints
from versions.constraint import Constraint
class TestConstraints(TestCase):
def test_match(self):
self.assertTrue(Constraints.parse('>1,<2').match('1.5'))
def test_match_in(self):
self.as... | 40.221053 | 83 | 0.559016 |
dfe01ac7f7adb258b0362ce750c15bb90b3ecb5f | 520 | py | Python | run.py | bayusetiawan01/poj | 9c205ce298a2b3ca0d9c00b7d4a3fd05fecf326a | [
"MIT"
] | 25 | 2016-02-26T17:35:19.000Z | 2021-08-17T10:30:14.000Z | run.py | bayusetiawan01/poj | 9c205ce298a2b3ca0d9c00b7d4a3fd05fecf326a | [
"MIT"
] | 5 | 2016-04-27T16:52:46.000Z | 2021-04-24T10:06:16.000Z | run.py | bayusetiawan01/poj | 9c205ce298a2b3ca0d9c00b7d4a3fd05fecf326a | [
"MIT"
] | 6 | 2016-04-27T16:50:13.000Z | 2021-04-03T06:27:41.000Z | import sys
import subprocess
if __name__ == "__main__":
try:
executable = sys.argv[1]
input_filename = sys.argv[2]
output_filename = sys.argv[3]
tl = sys.argv[4]
except IndexError:
sys.exit(-1)
input_file = open(input_filename, "r")
output_file = open(output_fil... | 27.368421 | 118 | 0.634615 |
dfe12be6330b0968db19fa6ffe0881fb8fa8099d | 1,224 | py | Python | typefactory/constraints/numeric.py | stevemccartney/typefactory | 75c9eb9eec9a7b9488db9cc0d06352f4fd1de1d9 | [
"Apache-2.0"
] | null | null | null | typefactory/constraints/numeric.py | stevemccartney/typefactory | 75c9eb9eec9a7b9488db9cc0d06352f4fd1de1d9 | [
"Apache-2.0"
] | null | null | null | typefactory/constraints/numeric.py | stevemccartney/typefactory | 75c9eb9eec9a7b9488db9cc0d06352f4fd1de1d9 | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass
from numbers import Real
from typing import Optional
@dataclass
class MultipleOf:
param: Real
def __call__(self, value: Real) -> Optional[str]:
if value % self.param != 0:
return f"Value must be a multiple of {self.param}"
else:
return... | 20.745763 | 62 | 0.586601 |
dfe159b3edd0ee9b633d2a90e3ddecd214d799b8 | 4,580 | py | Python | Version Autonome/main.py | chiudidier/ProjetBloc5 | 214f401e5b35bc5894ecc3d20f338762b689f2ca | [
"CC0-1.0"
] | null | null | null | Version Autonome/main.py | chiudidier/ProjetBloc5 | 214f401e5b35bc5894ecc3d20f338762b689f2ca | [
"CC0-1.0"
] | null | null | null | Version Autonome/main.py | chiudidier/ProjetBloc5 | 214f401e5b35bc5894ecc3d20f338762b689f2ca | [
"CC0-1.0"
] | null | null | null | from taquin import *
from random import *
from math import *
#main
'''
old : ancienne façon de mélanger qui correspond à une manipulation du taquin. Plus à coder pour les élèves et pour faire des essais de profondeur
montxt='012345678'# position initiale = solution
montaquin=Taquin(montxt)#... | 24.491979 | 224 | 0.606332 |
dfe1a99576a2d37093ebe1a9717fd7144a854d6e | 1,870 | py | Python | bindings/python/test/test_objects.py | open-space-collective/open-space-toolkit-mathematics | 4b97f97f4aaa87bff848381a3519c6f764461378 | [
"Apache-2.0"
] | 5 | 2020-05-11T02:22:05.000Z | 2022-02-02T15:26:35.000Z | bindings/python/test/test_objects.py | open-space-collective/open-space-toolkit-mathematics | 4b97f97f4aaa87bff848381a3519c6f764461378 | [
"Apache-2.0"
] | 6 | 2020-01-05T20:18:18.000Z | 2021-10-14T09:36:44.000Z | bindings/python/test/test_objects.py | open-space-collective/open-space-toolkit-mathematics | 4b97f97f4aaa87bff848381a3519c6f764461378 | [
"Apache-2.0"
] | 2 | 2020-03-05T18:18:13.000Z | 2020-04-07T17:42:24.000Z | ################################################################################################################################################################
# @project Open Space Toolkit ▸ Mathematics
# @file bindings/python/test/test_objects.py
# @author Lucas Brémond <lucas@loftorbital.c... | 53.428571 | 160 | 0.535294 |
dfe2bc23e1d5c4fe435748a54d9f2a2f9b030af5 | 1,005 | py | Python | twemoji/mkqrc.py | ericosur/myqt | e96f77f99442c44e51a1dbe1ee93edfa09b3db0f | [
"MIT"
] | null | null | null | twemoji/mkqrc.py | ericosur/myqt | e96f77f99442c44e51a1dbe1ee93edfa09b3db0f | [
"MIT"
] | null | null | null | twemoji/mkqrc.py | ericosur/myqt | e96f77f99442c44e51a1dbe1ee93edfa09b3db0f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# coding: utf-8
''' helper to generate emoji.qrc '''
from glob import glob
import sys
import re
def output_qrc(arr, fn='emoji.qrc') -> None:
''' emoji.qrc '''
header = '''<RCC>
<qresource prefix="/">'''
footer = ''' </qresource>
</RCC>'''
with open(fn, 'wt', encoding='ut... | 22.333333 | 57 | 0.528358 |
dfe2c5242a263720a913b48fff9c5a2c72756ddd | 1,246 | py | Python | Python3-StandardLibrary/Chapter16_Web03_cgi.py | anliven/Reading-Code-Learning-Python | a814cab207bbaad6b5c69b9feeb8bf2f459baf2b | [
"Apache-2.0"
] | null | null | null | Python3-StandardLibrary/Chapter16_Web03_cgi.py | anliven/Reading-Code-Learning-Python | a814cab207bbaad6b5c69b9feeb8bf2f459baf2b | [
"Apache-2.0"
] | null | null | null | Python3-StandardLibrary/Chapter16_Web03_cgi.py | anliven/Reading-Code-Learning-Python | a814cab207bbaad6b5c69b9feeb8bf2f459baf2b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import cgi
form = cgi.FieldStorage() # 创建FieldStorage实例(应只创建一个)
name = form.getvalue('name', 'world') # CGI脚本通过getvalue方法获取值,这里默认值为world
print("""Content-type: text/html
<html>
<head>
<title>Greeting Page</title>
</head>
<body>
<h1>Hello, {}!</h1>
<form action='Chapter16_We... | 28.318182 | 73 | 0.699839 |
dfe2c9adf24a8776a39019cdfbf8a0a54e0be58c | 1,809 | py | Python | predefined_values.py | kovvik/bert_reader | 1b3b6a2bc29a026c64d2d7ba53ec5fabebf1f9e5 | [
"MIT"
] | null | null | null | predefined_values.py | kovvik/bert_reader | 1b3b6a2bc29a026c64d2d7ba53ec5fabebf1f9e5 | [
"MIT"
] | null | null | null | predefined_values.py | kovvik/bert_reader | 1b3b6a2bc29a026c64d2d7ba53ec5fabebf1f9e5 | [
"MIT"
] | null | null | null | # https://uefi.org/sites/default/files/resources/UEFI%20Spec%202_6.pdf
# N.2.2 Section Descriptor
section_types = {
"9876ccad47b44bdbb65e16f193c4f3db": {
"name": "Processor Generic",
"error_record_reference": {}
},
"dc3ea0b0a1444797b95b53fa242b6e1d": {
"name": "Processor Specific - ... | 29.177419 | 70 | 0.599779 |
dfe30fcd6927ef89f0f16539956bef3a4837e607 | 1,336 | py | Python | tests/filestack_helpers_test.py | SanthoshBala18/filestack-python | db55f3a27a4d073e1ba33d3d09a3def8da1a25e4 | [
"Apache-2.0"
] | 47 | 2017-01-28T12:27:18.000Z | 2021-07-02T16:29:04.000Z | tests/filestack_helpers_test.py | malarozi/filestack-python | 7109a9c20225532c95f0204d12649137c0de01a1 | [
"Apache-2.0"
] | 36 | 2017-01-25T23:48:33.000Z | 2022-01-29T22:33:12.000Z | tests/filestack_helpers_test.py | malarozi/filestack-python | 7109a9c20225532c95f0204d12649137c0de01a1 | [
"Apache-2.0"
] | 24 | 2017-01-24T23:57:32.000Z | 2022-01-29T22:34:34.000Z | import pytest
from filestack.helpers import verify_webhook_signature
@pytest.mark.parametrize('signature, expected_result', [
('57cbb25386c3d6ff758a7a75cf52ba02cf2b0a1a2d6d5dfb9c886553ca6011cb', True),
('incorrect-signature', False),
])
def test_webhook_verification(signature, expected_result):
secret = '... | 40.484848 | 105 | 0.695359 |
dfe42600497b94099e0a72123b092ceef56b943a | 4,558 | py | Python | pattern/check_multiples.py | Lostefra/TranslationCoherence | b7b09c475cc78842d9724161a8cbee372d41da08 | [
"MIT"
] | null | null | null | pattern/check_multiples.py | Lostefra/TranslationCoherence | b7b09c475cc78842d9724161a8cbee372d41da08 | [
"MIT"
] | null | null | null | pattern/check_multiples.py | Lostefra/TranslationCoherence | b7b09c475cc78842d9724161a8cbee372d41da08 | [
"MIT"
] | null | null | null | import rdflib
from rdflib.term import URIRef
from utilities.utility_functions import prefix
from utilities import constants
def has_equivalent(node, graph):
equivalents = list(graph.subjects(predicate=constants.EQUIVALENCE_PREDICATE, object=node)) + \
list(graph.subjects(predicate=constants.SYNONYMY_PR... | 54.915663 | 125 | 0.698113 |
dfe4a5779ee044b60ee7d70e0fc7668e972bffae | 5,875 | py | Python | app/main/views.py | Ammoh-Moringa/pitches | 2551f2c8e323066ebdde3f92046368d7c7759fa6 | [
"MIT"
] | null | null | null | app/main/views.py | Ammoh-Moringa/pitches | 2551f2c8e323066ebdde3f92046368d7c7759fa6 | [
"MIT"
] | null | null | null | app/main/views.py | Ammoh-Moringa/pitches | 2551f2c8e323066ebdde3f92046368d7c7759fa6 | [
"MIT"
] | null | null | null | from flask import render_template, request, redirect, url_for, abort
from flask_login import login_required, current_user
from . forms import PitchForm, CommentForm, CategoryForm
from .import main
from .. import db
from ..models import User, Pitch, Comments, PitchCategory, Votes
#display categories on the landing page... | 30.759162 | 116 | 0.683574 |
dfe61cbf2bb3b5a52f9141b8b81d778c054609e4 | 10,299 | py | Python | networks/classes/centernet/models/ModelCenterNet.py | ALIENK9/Kuzushiji-recognition | a18c1fbfa72b6bbbcfe4004148cd0e90531acf6b | [
"MIT"
] | 2 | 2019-09-15T08:52:38.000Z | 2019-09-15T08:58:58.000Z | networks/classes/centernet/models/ModelCenterNet.py | MatteoRizzo96/CognitiveServices | a5efeb8f585ae2ee0465ab25e587c4db0e2b32b3 | [
"MIT"
] | null | null | null | networks/classes/centernet/models/ModelCenterNet.py | MatteoRizzo96/CognitiveServices | a5efeb8f585ae2ee0465ab25e587c4db0e2b32b3 | [
"MIT"
] | 2 | 2020-11-06T07:29:56.000Z | 2020-11-06T07:33:27.000Z | import glob
import os
import pandas as pd
from tensorflow.python.keras.preprocessing.image import ImageDataGenerator
from typing import Dict, List, Union, Tuple
import numpy as np
import tensorflow as tf
from tensorflow.python.keras.callbacks import ModelCheckpoint, TensorBoard, LearningRateScheduler
from networks.c... | 40.869048 | 108 | 0.556656 |
dfe9372c929b790c9a52b80b77bdd70cddddba45 | 187 | py | Python | problem1.py | bakwc/PyCodeMonkey | 32ea3a8947133ee9f96bea269a5dfd7a5b264ac1 | [
"MIT"
] | null | null | null | problem1.py | bakwc/PyCodeMonkey | 32ea3a8947133ee9f96bea269a5dfd7a5b264ac1 | [
"MIT"
] | null | null | null | problem1.py | bakwc/PyCodeMonkey | 32ea3a8947133ee9f96bea269a5dfd7a5b264ac1 | [
"MIT"
] | null | null | null |
# find fibonacci number
def myFib(n):
pass
def tests():
assert myFib(1) == 1
assert myFib(2) == 1
assert myFib(3) == 2
assert myFib(4) == 3
assert myFib(5) == 5
| 15.583333 | 24 | 0.561497 |
dfea1cd7528525e57a90decbb00e4b3b1963212b | 4,114 | py | Python | tests/web/test_show_image.py | AndrewLorente/catsnap | 57427b8f61ef5185a41e49d55ffd7dd328777834 | [
"MIT"
] | 5 | 2015-11-23T18:40:00.000Z | 2019-03-22T06:54:04.000Z | tests/web/test_show_image.py | AndrewLorente/catsnap | 57427b8f61ef5185a41e49d55ffd7dd328777834 | [
"MIT"
] | 5 | 2016-04-07T15:35:53.000Z | 2019-02-10T23:00:32.000Z | tests/web/test_show_image.py | AndrewLorente/catsnap | 57427b8f61ef5185a41e49d55ffd7dd328777834 | [
"MIT"
] | 2 | 2015-12-02T16:44:05.000Z | 2017-09-29T23:17:33.000Z | from __future__ import unicode_literals
import json
from tests import TestCase, with_settings
from nose.tools import eq_
from catsnap import Client
from catsnap.table.image import Image, ImageResize
from catsnap.table.album import Album
class TestShowImage(TestCase):
@with_settings(aws={'bucket': 'snapcats'})
... | 39.557692 | 101 | 0.59018 |
dfec725778cb5fb317db1061f7feba9a3d3f7b10 | 554 | py | Python | tests/test_imgs2bw.py | antsfamily/improc | ceab171b0e61187fa2ced7c58540d5ffde79ebac | [
"MIT"
] | 2 | 2019-09-29T08:43:31.000Z | 2022-01-12T09:46:18.000Z | tests/test_imgs2bw.py | antsfamily/improc | ceab171b0e61187fa2ced7c58540d5ffde79ebac | [
"MIT"
] | null | null | null | tests/test_imgs2bw.py | antsfamily/improc | ceab171b0e61187fa2ced7c58540d5ffde79ebac | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2018-07-04 09:43:51
# @Author : Zhi Liu (zhiliu.mind@gmail.com)
# @Link : http://iridescent.ink
# @Version : $1.1$
import matplotlib.cm as cm
from matplotlib import pyplot as plt
import improc as imp
datafolder = '/mnt/d/DataSets/oi/nsi/classical/'
imgsp... | 19.103448 | 48 | 0.658845 |
dfec78daa3bbf2130e5e79b3fbc047fcd7c950b3 | 764 | py | Python | Un4/Un4.py | tonypithony/forktinypythonprojectsscripts | 3dae818c822ee7de6de021e9f46d02bfe05f7355 | [
"MIT"
] | null | null | null | Un4/Un4.py | tonypithony/forktinypythonprojectsscripts | 3dae818c822ee7de6de021e9f46d02bfe05f7355 | [
"MIT"
] | null | null | null | Un4/Un4.py | tonypithony/forktinypythonprojectsscripts | 3dae818c822ee7de6de021e9f46d02bfe05f7355 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""Jump the Five"""
import argparse
# --------------------------------------------------
def get_args():
parser = argparse.ArgumentParser(description='Jump the Five',
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('text', metavar='str', help='Input text'... | 25.466667 | 64 | 0.522251 |
dfed59a42f4a11efd34b43e01fd5f7beba8d46b6 | 169 | py | Python | tests/web_platform/css_grid_1/abspos/test_grid_positioned_items_gaps.py | jonboland/colosseum | cbf974be54fd7f6fddbe7285704cfaf7a866c5c5 | [
"BSD-3-Clause"
] | 71 | 2015-04-13T09:44:14.000Z | 2019-03-24T01:03:02.000Z | tests/web_platform/css_grid_1/abspos/test_grid_positioned_items_gaps.py | jonboland/colosseum | cbf974be54fd7f6fddbe7285704cfaf7a866c5c5 | [
"BSD-3-Clause"
] | 35 | 2019-05-06T15:26:09.000Z | 2022-03-28T06:30:33.000Z | tests/web_platform/css_grid_1/abspos/test_grid_positioned_items_gaps.py | jonboland/colosseum | cbf974be54fd7f6fddbe7285704cfaf7a866c5c5 | [
"BSD-3-Clause"
] | 139 | 2015-05-30T18:37:43.000Z | 2019-03-27T17:14:05.000Z | from tests.utils import W3CTestCase
class TestGridPositionedItemsGaps(W3CTestCase):
vars().update(W3CTestCase.find_tests(__file__, 'grid-positioned-items-gaps-'))
| 28.166667 | 82 | 0.804734 |
dff0a891ee94445188ef897fe40edf7b03e0dcdf | 18 | py | Python | src/__init__.py | PMantovani/pympu6050 | bab4e680d700d9ad62855958cdb93feaaa16060c | [
"MIT"
] | null | null | null | src/__init__.py | PMantovani/pympu6050 | bab4e680d700d9ad62855958cdb93feaaa16060c | [
"MIT"
] | null | null | null | src/__init__.py | PMantovani/pympu6050 | bab4e680d700d9ad62855958cdb93feaaa16060c | [
"MIT"
] | null | null | null | name = "pympu6050" | 18 | 18 | 0.722222 |
dff25402be58788805ce4000a620f3bec7823781 | 4,537 | py | Python | iocage/main.py | krcNAS/iocage | 13d87e92f8ba186b6c8b7f64a948f26a05586430 | [
"BSD-2-Clause"
] | null | null | null | iocage/main.py | krcNAS/iocage | 13d87e92f8ba186b6c8b7f64a948f26a05586430 | [
"BSD-2-Clause"
] | null | null | null | iocage/main.py | krcNAS/iocage | 13d87e92f8ba186b6c8b7f64a948f26a05586430 | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) 2014-2017, iocage
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted providing that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and th... | 33.858209 | 143 | 0.642054 |
dff2b9a17cc9997e289067d562ccf28b75fc10b3 | 425 | py | Python | bookinfo/models.py | dustfine/myPlaygroundSite | 02db3321e9959437c588575f9df1079d2d8d1ed9 | [
"MIT"
] | null | null | null | bookinfo/models.py | dustfine/myPlaygroundSite | 02db3321e9959437c588575f9df1079d2d8d1ed9 | [
"MIT"
] | null | null | null | bookinfo/models.py | dustfine/myPlaygroundSite | 02db3321e9959437c588575f9df1079d2d8d1ed9 | [
"MIT"
] | null | null | null | from django.db import models
# Create your models here.
class Publisher(models.Model):
id = models.AutoField(primary_key=True)
name = models.CharField(max_length=64, null=False, unique=True)
class Book(models.Model):
id = models.AutoField(primary_key=True)
name = models.CharField(max_length=64, null=... | 35.416667 | 85 | 0.757647 |
dff4072d877687a20524346adc49201f57ca4cea | 905 | py | Python | svety/tests.py | clemsciences/svety | 44a0c2ab5453e9d01b71b5a3f0e0e959740c2d90 | [
"MIT"
] | null | null | null | svety/tests.py | clemsciences/svety | 44a0c2ab5453e9d01b71b5a3f0e0e959740c2d90 | [
"MIT"
] | null | null | null | svety/tests.py | clemsciences/svety | 44a0c2ab5453e9d01b71b5a3f0e0e959740c2d90 | [
"MIT"
] | null | null | null | """
"""
import os
import unittest
from lxml import etree
from svety import PACKDIR
from svety import reader
from svety import retriever
__author__ = ["Clément Besnier <clemsciences@aol.com>", ]
class TestMain(unittest.TestCase):
"""
"""
def setUp(self) -> None:
self.filename = "hellqvist.xml... | 23.205128 | 60 | 0.667403 |
dff5479d5d3e3729b12a7cdf8fd0b259fd5d0c88 | 5,424 | py | Python | tests/internal/processes/test_generator.py | clausmichele/openeo-python-client | b20af2b24fcb12d0fce0e2acdb8afeeb881ff454 | [
"Apache-2.0"
] | 1 | 2021-04-01T13:15:35.000Z | 2021-04-01T13:15:35.000Z | tests/internal/processes/test_generator.py | clausmichele/openeo-python-client | b20af2b24fcb12d0fce0e2acdb8afeeb881ff454 | [
"Apache-2.0"
] | null | null | null | tests/internal/processes/test_generator.py | clausmichele/openeo-python-client | b20af2b24fcb12d0fce0e2acdb8afeeb881ff454 | [
"Apache-2.0"
] | null | null | null | from textwrap import dedent
from openeo.internal.processes.generator import PythonRenderer
from openeo.internal.processes.parse import Process
def test_render_basic():
process = Process.from_dict({
"id": "incr",
"description": "Increment a value",
"summary": "Increment a value",
"... | 28.851064 | 117 | 0.50295 |
dff6538ad1295913d7be8979ad8998c9e8d8ebc3 | 4,555 | py | Python | python/tests/range.py | mizuki-nana/coreVM | 1ff863b890329265a86ff46b0fdf7bac8e362f0e | [
"MIT"
] | 2 | 2017-02-12T21:59:54.000Z | 2017-02-13T14:57:48.000Z | python/tests/range.py | mizuki-nana/coreVM | 1ff863b890329265a86ff46b0fdf7bac8e362f0e | [
"MIT"
] | null | null | null | python/tests/range.py | mizuki-nana/coreVM | 1ff863b890329265a86ff46b0fdf7bac8e362f0e | [
"MIT"
] | null | null | null | # The MIT License (MIT)
# Copyright (c) 2015 Yanzheng Li
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the 'Software'), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify,... | 31.413793 | 80 | 0.591438 |
dff9aadffba2a29e37c671ac7172c7de73a82cb0 | 14,895 | py | Python | hyperion/generators/adapt_sequence_batch_generator.py | jsalt2019-diadet/hyperion | 14a11436d62f3c15cd9b1f70bcce3eafbea2f753 | [
"Apache-2.0"
] | 9 | 2019-09-22T05:19:59.000Z | 2022-03-05T18:03:37.000Z | hyperion/generators/adapt_sequence_batch_generator.py | jsalt2019-diadet/hyperion | 14a11436d62f3c15cd9b1f70bcce3eafbea2f753 | [
"Apache-2.0"
] | null | null | null | hyperion/generators/adapt_sequence_batch_generator.py | jsalt2019-diadet/hyperion | 14a11436d62f3c15cd9b1f70bcce3eafbea2f753 | [
"Apache-2.0"
] | 4 | 2019-10-10T06:34:05.000Z | 2022-03-05T18:03:56.000Z | """
Copyright 2018 Jesus Villalba (Johns Hopkins University)
Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from six.moves import xrange
import sys
import os
import argparse
import time
import c... | 34.320276 | 111 | 0.608728 |
dffa822e50735b496917f2c8ca75cc5ca8d78488 | 1,113 | py | Python | main.py | Lojlvenom/simple-python-blockchain | b226f81644daa066156aa5b9581c04cf4d47d0dc | [
"MIT"
] | null | null | null | main.py | Lojlvenom/simple-python-blockchain | b226f81644daa066156aa5b9581c04cf4d47d0dc | [
"MIT"
] | null | null | null | main.py | Lojlvenom/simple-python-blockchain | b226f81644daa066156aa5b9581c04cf4d47d0dc | [
"MIT"
] | null | null | null | import fastapi as _fastapi
import blockchain as _blockchain
app_desc = {
'title':'Simple python blockchain API',
'version':'1.0.0',
}
bc = _blockchain.Blockchain()
app = _fastapi.FastAPI(**app_desc)
def validade_blockchain():
if not bc._is_chain_valid():
return _fastapi.HTTPException(
... | 22.26 | 91 | 0.629829 |
dffa84ab01f78c539667e6f6871367dc2095eb09 | 1,747 | py | Python | setup.py | SanjeevaRDodlapati/Chem-Learn | 2db2e98061ee3dbb00ed20c51ea18b15956e298e | [
"MIT"
] | null | null | null | setup.py | SanjeevaRDodlapati/Chem-Learn | 2db2e98061ee3dbb00ed20c51ea18b15956e298e | [
"MIT"
] | null | null | null | setup.py | SanjeevaRDodlapati/Chem-Learn | 2db2e98061ee3dbb00ed20c51ea18b15956e298e | [
"MIT"
] | null | null | null | from glob import glob
import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='chemlearn',
version='0.0.0',
description='Deep learning for chemistry',
long_description=read('README.rst'),
author... | 36.395833 | 80 | 0.499714 |
dffe92bdb0898e53b6acb0b1fcb7c940caeeb1d9 | 49,731 | py | Python | scripts/tests_with_setup.py | rombie/contrail-test | a68c71d6f282142501a7e2e889bbb232fdd82dc3 | [
"Apache-2.0"
] | null | null | null | scripts/tests_with_setup.py | rombie/contrail-test | a68c71d6f282142501a7e2e889bbb232fdd82dc3 | [
"Apache-2.0"
] | null | null | null | scripts/tests_with_setup.py | rombie/contrail-test | a68c71d6f282142501a7e2e889bbb232fdd82dc3 | [
"Apache-2.0"
] | null | null | null | # Need to import path to test/fixtures and test/scripts/
# Ex : export PYTHONPATH='$PATH:/root/test/fixtures/:/root/test/scripts/'
#
# To run tests, you can do 'python -m testtools.run tests'. To run specific tests,
# You can do 'python -m testtools.run -l tests'
# Set the env variable PARAMS_FILE to point to your ini ... | 43.623684 | 247 | 0.632603 |
dfff599aef2fa931d79fa84797d0acce9a216f5a | 5,407 | py | Python | murder.py | lgrn/murder | 1e4582cc5fa8c31c35e70997daebd111f1badf4d | [
"Unlicense"
] | null | null | null | murder.py | lgrn/murder | 1e4582cc5fa8c31c35e70997daebd111f1badf4d | [
"Unlicense"
] | null | null | null | murder.py | lgrn/murder | 1e4582cc5fa8c31c35e70997daebd111f1badf4d | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
# murder 0.2.3
import sys
if sys.version_info[0] != (3):
sys.stdout.write("Sorry this software requires Python 3. This is Python {}.\n".format(sys.version_info[0]))
sys.exit(1)
import time
import requests
import json
import re
# Your "filename" file should contain one word per row. Do... | 32.769697 | 129 | 0.653227 |
dfff777451f2b530e80b5323a7284116b77ea627 | 703 | py | Python | cfn_review_bot/merge.py | biochimia/cfn-review-bot | 1c8a84b51f7c398c21725cb888a9ab694ddfbb56 | [
"Apache-2.0"
] | 1 | 2019-04-04T12:09:16.000Z | 2019-04-04T12:09:16.000Z | cfn_review_bot/merge.py | biochimia/cfn-review-bot | 1c8a84b51f7c398c21725cb888a9ab694ddfbb56 | [
"Apache-2.0"
] | null | null | null | cfn_review_bot/merge.py | biochimia/cfn-review-bot | 1c8a84b51f7c398c21725cb888a9ab694ddfbb56 | [
"Apache-2.0"
] | null | null | null | def _deep_merge_mapping(old, new):
merged = {}
merged.update(old)
for k, nv in new.items():
try:
ov = merged[k]
except KeyError:
merged[k] = nv
continue
merged[k] = deep_merge(ov, nv)
return merged
def _deep_merge_sequence(old, new):
r... | 20.676471 | 66 | 0.571835 |
5f0133420725ce23664fd5aac6eace5b4be90d9b | 324 | py | Python | 02_module/package_test/module1/my_sum.py | zzz0072/Python_Exercises | 9918aa8197a77ef237e5e60306c7785eca5cb1d3 | [
"BSD-2-Clause"
] | null | null | null | 02_module/package_test/module1/my_sum.py | zzz0072/Python_Exercises | 9918aa8197a77ef237e5e60306c7785eca5cb1d3 | [
"BSD-2-Clause"
] | null | null | null | 02_module/package_test/module1/my_sum.py | zzz0072/Python_Exercises | 9918aa8197a77ef237e5e60306c7785eca5cb1d3 | [
"BSD-2-Clause"
] | null | null | null | #/usr/bin/env python
from ..module2 import my_print
def my_sum(x, y):
result = x + y
my_print.my_print(result)
# To run method alone
if __name__ == "__main__":
import sys
if len(sys.argv) != 3:
print("%s str1 str2" % sys.argv[0])
raise SystemExit(1)
my_sum(sys.argv[1], sys.argv[2]... | 18 | 43 | 0.608025 |
5f018a5353d8adb9d68568f7a0b49dde04ed193e | 75 | py | Python | storch/models/__init__.py | STomoya/storch | 47754eecd5fb5404dd345f06fb0f8d3270a9e5b9 | [
"MIT"
] | null | null | null | storch/models/__init__.py | STomoya/storch | 47754eecd5fb5404dd345f06fb0f8d3270a9e5b9 | [
"MIT"
] | null | null | null | storch/models/__init__.py | STomoya/storch | 47754eecd5fb5404dd345f06fb0f8d3270a9e5b9 | [
"MIT"
] | null | null | null |
from multiscale import MultiScale
from patchgan import PatchDiscriminator
| 18.75 | 39 | 0.88 |
5f033434eab634732c27a8827763d152ae9391a1 | 1,054 | py | Python | repos/system_upgrade/el7toel8/actors/preparepythonworkround/tests/test_preparepythonworkaround.py | AloisMahdal/leapp-repository | 9ac2b8005750e8e56e5fde61e8762044d0f16257 | [
"Apache-2.0"
] | null | null | null | repos/system_upgrade/el7toel8/actors/preparepythonworkround/tests/test_preparepythonworkaround.py | AloisMahdal/leapp-repository | 9ac2b8005750e8e56e5fde61e8762044d0f16257 | [
"Apache-2.0"
] | 9 | 2020-01-07T12:48:59.000Z | 2020-01-16T10:44:34.000Z | repos/system_upgrade/el7toel8/actors/preparepythonworkround/tests/test_preparepythonworkaround.py | AloisMahdal/leapp-repository | 9ac2b8005750e8e56e5fde61e8762044d0f16257 | [
"Apache-2.0"
] | null | null | null | from os import symlink, path, access, X_OK
import pytest
from leapp.libraries.actor import workaround
from leapp.libraries.common.utils import makedirs
def fake_symlink(basedir):
def impl(source, target):
source_path = str(basedir.join(*source.lstrip('/').split('/')))
makedirs(source_path)
... | 32.9375 | 84 | 0.734345 |
5f03df5d79ef568c79e0a3f2f05ab7cc845b03d5 | 707 | py | Python | codility/equi_leader.py | py-in-the-sky/challenges | 4a36095de8cb56b4f9f83c241eafb13dfbeb4065 | [
"MIT"
] | null | null | null | codility/equi_leader.py | py-in-the-sky/challenges | 4a36095de8cb56b4f9f83c241eafb13dfbeb4065 | [
"MIT"
] | null | null | null | codility/equi_leader.py | py-in-the-sky/challenges | 4a36095de8cb56b4f9f83c241eafb13dfbeb4065 | [
"MIT"
] | null | null | null | """
https://codility.com/programmers/task/equi_leader/
"""
from collections import Counter, defaultdict
def solution(A):
def _is_equi_leader(i):
prefix_count_top = running_counts[top]
suffix_count_top = total_counts[top] - prefix_count_top
return (prefix_count_top * 2 > i + 1) and (suffi... | 24.37931 | 89 | 0.595474 |
5f049724d72ac2de8c5b11138f1e4b59bdb512ad | 1,744 | py | Python | src/harness/cu_pass/dpa_calculator/helpers/list_distributor/list_distributor.py | NSF-Swift/Spectrum-Access-System | 02cf3490c9fd0cec38074d3bdb3bca63bb7d03bf | [
"Apache-2.0"
] | null | null | null | src/harness/cu_pass/dpa_calculator/helpers/list_distributor/list_distributor.py | NSF-Swift/Spectrum-Access-System | 02cf3490c9fd0cec38074d3bdb3bca63bb7d03bf | [
"Apache-2.0"
] | null | null | null | src/harness/cu_pass/dpa_calculator/helpers/list_distributor/list_distributor.py | NSF-Swift/Spectrum-Access-System | 02cf3490c9fd0cec38074d3bdb3bca63bb7d03bf | [
"Apache-2.0"
] | null | null | null | from abc import ABC, abstractmethod
from typing import Any, List, TypeVar
from cu_pass.dpa_calculator.helpers.list_distributor.fractional_distribution.fractional_distribution import \
FractionalDistribution
RETURN_TYPE = TypeVar('RETURN_TYPE')
class ListDistributor(ABC):
def __init__(self, items_to_distribu... | 38.755556 | 110 | 0.725344 |
5f05166068ffa658a5a11fcc559025940e70a85b | 1,419 | py | Python | downloader.py | Luonic/tf-cnn-lstm-ocr-captcha | 9ac6202d546093d95083a32c71cdccb800dfdea2 | [
"MIT"
] | 10 | 2017-08-08T22:57:32.000Z | 2020-04-07T21:50:20.000Z | downloader.py | Luonic/tf-cnn-lstm-ocr-captcha | 9ac6202d546093d95083a32c71cdccb800dfdea2 | [
"MIT"
] | null | null | null | downloader.py | Luonic/tf-cnn-lstm-ocr-captcha | 9ac6202d546093d95083a32c71cdccb800dfdea2 | [
"MIT"
] | 5 | 2018-07-17T16:47:21.000Z | 2021-11-06T15:03:56.000Z | import urllib
import requests
import multiprocessing.pool
from multiprocessing import Pool
import uuid
import os
images_dir = os.path.join("data", "train")
small_letters = map(chr, range(ord('a'), ord('f')+1))
digits = map(chr, range(ord('0'), ord('9')+1))
base_16 = digits + small_letters
MAX_THREADS = 100
def capt... | 30.191489 | 143 | 0.547569 |
5f05920c4f06c4b47bf5845e7dd08b41ac585c06 | 7,679 | py | Python | code/Models.py | IGLICT/CMIC-Retrieval | d2f452517360f127d0a8175d55ba9f9491c152c2 | [
"MIT"
] | 29 | 2021-10-01T12:05:54.000Z | 2022-03-16T02:40:19.000Z | code/Models.py | IGLICT/CMIC-Retrieval | d2f452517360f127d0a8175d55ba9f9491c152c2 | [
"MIT"
] | 5 | 2021-12-20T12:25:58.000Z | 2022-03-10T19:08:32.000Z | code/Models.py | IGLICT/CMIC-Retrieval | d2f452517360f127d0a8175d55ba9f9491c152c2 | [
"MIT"
] | 1 | 2022-01-04T05:52:49.000Z | 2022-01-04T05:52:49.000Z | import jittor as jt
from jittor import nn, models
if jt.has_cuda:
jt.flags.use_cuda = 1 # jt.flags.use_cuda
class QueryEncoder(nn.Module):
def __init__(self, out_dim=128):
super(QueryEncoder, self).__init__()
self.dim = out_dim
self.resnet = models.resnet50(pretrained=False)
sel... | 36.393365 | 113 | 0.625602 |
5f05a35db2bf24e5cd3d450829e44e1d6868265e | 2,348 | py | Python | apps/agendas/tests/unit/selectors/test_doctor_profile_selector.py | victoraguilarc/agendas | 31b24a2d6350605b638b59062f297ef3f58e9879 | [
"MIT"
] | 2 | 2020-06-06T23:10:27.000Z | 2020-10-06T19:12:26.000Z | apps/agendas/tests/unit/selectors/test_doctor_profile_selector.py | victoraguilarc/medical-appointment | 31b24a2d6350605b638b59062f297ef3f58e9879 | [
"MIT"
] | 3 | 2021-04-08T20:44:38.000Z | 2021-09-22T19:04:16.000Z | apps/agendas/tests/unit/selectors/test_doctor_profile_selector.py | victoraguilarc/agendas | 31b24a2d6350605b638b59062f297ef3f58e9879 | [
"MIT"
] | 1 | 2020-10-10T14:07:37.000Z | 2020-10-10T14:07:37.000Z | # -*- coding: utf-8 -*-
import pytest
from django.db.models import QuerySet
from rest_framework.exceptions import NotFound
from apps.accounts.response_codes import INVALID_TOKEN
from apps.accounts.selectors.pending_action_selector import PendingActionSelector
from apps.accounts.tests.factories.pending_action import P... | 35.044776 | 93 | 0.774702 |
5f0603321cb19a9d08d78984f4e1439bd2f1a90c | 121 | py | Python | python/testData/findUsages/GlobalUsages.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/findUsages/GlobalUsages.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/findUsages/GlobalUsages.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | <caret>search_variable = 1
def function():
global search_variable
search_variable = 2
print(search_variable) | 20.166667 | 26 | 0.735537 |
5f06913d44d8487508a5267f1e736e022aea0e78 | 379 | py | Python | backend/api/tests/models/location_tests.py | Pachwenko/ember-django-example | cfed8a4519e307ea72a097336f9b07bfa5ee576f | [
"MIT"
] | null | null | null | backend/api/tests/models/location_tests.py | Pachwenko/ember-django-example | cfed8a4519e307ea72a097336f9b07bfa5ee576f | [
"MIT"
] | 1 | 2022-01-17T00:51:15.000Z | 2022-01-17T00:51:15.000Z | backend/api/tests/models/location_tests.py | Pachwenko/ember-django-example | cfed8a4519e307ea72a097336f9b07bfa5ee576f | [
"MIT"
] | null | null | null | from decimal import Decimal
import pytest
from api.tests.factories.location import LocationFactory
# potentially helpful fixtures provided by pytest-django
# https://pytest-django.readthedocs.io/en/latest/helpers.html#fixtures
@pytest.mark.django_db()
def test_create_rental():
LocationFactory(
lat=Decim... | 23.6875 | 70 | 0.759894 |
5f073a6e60f359858de246c60af2ab6ba1d0660b | 293 | py | Python | dias/dia.py | GU1LH3RME-LIMA/pythonWebjs | 4786ef3b900f3b45522a0d3f0c4b83e1e68ae25b | [
"MIT"
] | null | null | null | dias/dia.py | GU1LH3RME-LIMA/pythonWebjs | 4786ef3b900f3b45522a0d3f0c4b83e1e68ae25b | [
"MIT"
] | null | null | null | dias/dia.py | GU1LH3RME-LIMA/pythonWebjs | 4786ef3b900f3b45522a0d3f0c4b83e1e68ae25b | [
"MIT"
] | null | null | null | import datetime
from flask import Flask, render_template
'''
algoritmo simples para definir se o dia é par ou impar
'''
app = Flask(__name__)
@app.route("/")
def index():
hoje=datetime.datetime.now()#objeto recebera a data atual
return render_template("index.html",dia=hoje.day)
| 22.538462 | 61 | 0.723549 |
5f0795f4ecbd539f9866bfa75241bdbacd313bed | 1,532 | py | Python | catalog/views/api.py | iraquitan/catalog-app-flask | 563981ddc8d55c62428cd4811bdea73ee8f8a846 | [
"MIT"
] | null | null | null | catalog/views/api.py | iraquitan/catalog-app-flask | 563981ddc8d55c62428cd4811bdea73ee8f8a846 | [
"MIT"
] | null | null | null | catalog/views/api.py | iraquitan/catalog-app-flask | 563981ddc8d55c62428cd4811bdea73ee8f8a846 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
* Created by PyCharm.
* Project: catalog
* Author name: Iraquitan Cordeiro Filho
* Author login: pma007
* File: api
* Date: 2/26/16
* Time: 11:26
* To change this template use File | Settings | File Templates.
"""
from flask import Blueprint, jsonify
from catalog.models import Categ... | 30.039216 | 79 | 0.719321 |
5f0912cfcdcc52bdc014aa57f2387fcc7c7c1a0f | 1,854 | py | Python | tests/test_debug.py | HazemElAgaty/psycopg2-pgevents | c0952608777052ea2cb90d8c78802ad03f8f3da1 | [
"MIT"
] | 11 | 2019-07-12T17:25:36.000Z | 2021-06-07T12:51:31.000Z | tests/test_debug.py | HazemElAgaty/psycopg2-pgevents | c0952608777052ea2cb90d8c78802ad03f8f3da1 | [
"MIT"
] | 5 | 2020-06-21T14:58:21.000Z | 2021-09-06T09:34:32.000Z | tests/test_debug.py | HazemElAgaty/psycopg2-pgevents | c0952608777052ea2cb90d8c78802ad03f8f3da1 | [
"MIT"
] | 4 | 2019-07-12T17:25:37.000Z | 2021-07-13T13:26:58.000Z | from pytest import raises
from psycopg2_pgevents import debug
from psycopg2_pgevents.debug import log, set_debug
class TestDebug:
def test_set_debug_disabled(self):
debug._DEBUG_ENABLED = True
set_debug(False)
assert not debug._DEBUG_ENABLED
def test_set_debug_enabled(self):
... | 27.264706 | 90 | 0.600863 |
5f0a52e79ef2f2c527b1cb664f5e0e589f53a413 | 1,148 | py | Python | abstracto-application/installer/src/main/docker/deployment/python/templates_deploy.py | Sheldan/abstracto | cef46737c5f34719c80c71aa9cd68bc53aea9a68 | [
"MIT"
] | 5 | 2020-05-27T14:18:51.000Z | 2021-03-24T09:23:09.000Z | abstracto-application/installer/src/main/docker/deployment/python/templates_deploy.py | Sheldan/abstracto | cef46737c5f34719c80c71aa9cd68bc53aea9a68 | [
"MIT"
] | 5 | 2020-05-29T21:53:53.000Z | 2021-05-26T12:19:16.000Z | abstracto-application/installer/src/main/docker/deployment/python/templates_deploy.py | Sheldan/abstracto | cef46737c5f34719c80c71aa9cd68bc53aea9a68 | [
"MIT"
] | null | null | null | import glob
import os
import sqlalchemy as db
from sqlalchemy.sql import text
def deploy_template_folder(db_config, folder):
engine = db.create_engine('postgresql://%s:%s@%s:%s/%s' % (db_config.user, db_config.password, db_config.host, db_config.port, db_config.database))
if not os.path.isdir(folder):
... | 37.032258 | 166 | 0.642857 |
5f0a965a14ab29cfb59691e71680ca0613d8037e | 8,466 | py | Python | src/external.py | erick-dsnk/Electric | 7e8aad1f792321d7839717ed97b641bee7a4a64e | [
"Apache-2.0"
] | null | null | null | src/external.py | erick-dsnk/Electric | 7e8aad1f792321d7839717ed97b641bee7a4a64e | [
"Apache-2.0"
] | null | null | null | src/external.py | erick-dsnk/Electric | 7e8aad1f792321d7839717ed97b641bee7a4a64e | [
"Apache-2.0"
] | null | null | null | ######################################################################
# EXTERNAL #
######################################################################
from Classes.Metadata import Metadata
from subprocess import PIPE, Popen
from extension import *
from col... | 46.516484 | 155 | 0.583038 |
5f0b1b6f16ccc30241e064e1c6cda37d2700becb | 3,242 | py | Python | testing/regrid/testGhostedDistArray.py | xylar/cdat | 8a5080cb18febfde365efc96147e25f51494a2bf | [
"BSD-3-Clause"
] | 62 | 2018-03-30T15:46:56.000Z | 2021-12-08T23:30:24.000Z | testing/regrid/testGhostedDistArray.py | xylar/cdat | 8a5080cb18febfde365efc96147e25f51494a2bf | [
"BSD-3-Clause"
] | 114 | 2018-03-21T01:12:43.000Z | 2021-07-05T12:29:54.000Z | testing/regrid/testGhostedDistArray.py | CDAT/uvcdat | 5133560c0c049b5c93ee321ba0af494253b44f91 | [
"BSD-3-Clause"
] | 14 | 2018-06-06T02:42:47.000Z | 2021-11-26T03:27:00.000Z | import distarray
import numpy
import unittest
from mpi4py import MPI
class TestGhostedDistArray(unittest.TestCase):
"""
Test distributed array
"""
def setUp(self):
pass
def test_test0(self):
"""
Test constructors
"""
da = distarray.ghZeros( (2,3), numpy.flo... | 26.57377 | 77 | 0.507403 |
5f0b9146ca28c5866c71c4fff522e7ed582731d7 | 3,900 | py | Python | cir/user_views.py | wafield/cir | 123d4bfe3e5bb4b0d605de486a91a0cb7eb34e4c | [
"MIT"
] | null | null | null | cir/user_views.py | wafield/cir | 123d4bfe3e5bb4b0d605de486a91a0cb7eb34e4c | [
"MIT"
] | null | null | null | cir/user_views.py | wafield/cir | 123d4bfe3e5bb4b0d605de486a91a0cb7eb34e4c | [
"MIT"
] | 1 | 2018-06-23T21:11:53.000Z | 2018-06-23T21:11:53.000Z | import json
from django.contrib.auth import authenticate, login, logout
from django.http import HttpResponse
from django.utils import timezone
from django.contrib.auth.signals import user_logged_in
from cir.models import *
VISITOR_ROLE = 'visitor'
def login_view(request):
response = {}
email = request.REQUE... | 39 | 87 | 0.661282 |
5f0bcf77d0e89f7eeb81cfefde1fb86ef9a0fc3f | 2,844 | py | Python | LeetCode/Python3/HashTable/451. Sort Characters By Frequency.py | WatsonWangZh/CodingPractice | dc057dd6ea2fc2034e14fd73e07e73e6364be2ae | [
"MIT"
] | 11 | 2019-09-01T22:36:00.000Z | 2021-11-08T08:57:20.000Z | LeetCode/Python3/HashTable/451. Sort Characters By Frequency.py | WatsonWangZh/LeetCodePractice | dc057dd6ea2fc2034e14fd73e07e73e6364be2ae | [
"MIT"
] | null | null | null | LeetCode/Python3/HashTable/451. Sort Characters By Frequency.py | WatsonWangZh/LeetCodePractice | dc057dd6ea2fc2034e14fd73e07e73e6364be2ae | [
"MIT"
] | 2 | 2020-05-27T14:58:52.000Z | 2020-05-27T15:04:17.000Z | # Given a string, sort it in decreasing order based on the frequency of characters.
# Example 1:
# Input:
# "tree"
# Output:
# "eert"
# Explanation:
# 'e' appears twice while 'r' and 't' both appear once.
# So 'e' must appear before both 'r' and 't'. Therefore "eetr" is also a valid answer.
# Example 2:
# Input:
# "... | 27.61165 | 86 | 0.522504 |
5f0bf2755cfa5ea302283c30bc9e0ccfd4f8893d | 1,837 | py | Python | ttkinter_app.py | bombero2020/python_tools | 393092609c4555e47b9789eb3fcb614ea25fdef9 | [
"MIT"
] | null | null | null | ttkinter_app.py | bombero2020/python_tools | 393092609c4555e47b9789eb3fcb614ea25fdef9 | [
"MIT"
] | null | null | null | ttkinter_app.py | bombero2020/python_tools | 393092609c4555e47b9789eb3fcb614ea25fdef9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import tkinter as tk
from tkinter import ttk
class HashCorpFrame(ttk.Frame):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.name_entry = ttk.Entry(self)
self.name_entry.pack()
self.greet_button = ttk.But... | 27.41791 | 66 | 0.616222 |
5f0dcd6e6a26bb27177e11fcbcba91b603bd720d | 8,513 | py | Python | api/src/dojo.py | mosoriob/dojo | 71bba04c4fdc4224320087b4c400fcba91b6597d | [
"MIT"
] | 1 | 2021-10-08T00:47:58.000Z | 2021-10-08T00:47:58.000Z | api/src/dojo.py | mosoriob/dojo | 71bba04c4fdc4224320087b4c400fcba91b6597d | [
"MIT"
] | null | null | null | api/src/dojo.py | mosoriob/dojo | 71bba04c4fdc4224320087b4c400fcba91b6597d | [
"MIT"
] | null | null | null |
import uuid
from typing import List
from elasticsearch import Elasticsearch
from elasticsearch.exceptions import NotFoundError
from fastapi import APIRouter, Response, status
from validation import DojoSchema
from src.settings import settings
import logging
logger = logging.getLogger(__name__)
router = APIRouter... | 35.470833 | 127 | 0.649595 |
5f0f752c5211938014f35ccb9166c1413d779264 | 3,313 | py | Python | test/test_prob_models.py | sylar233/de-identification | 44731e9c22de647063bd82a19936b4c5a144ea6e | [
"Apache-2.0"
] | 5 | 2016-11-07T12:54:51.000Z | 2018-12-15T00:20:26.000Z | test/test_prob_models.py | sylar233/de-identification | 44731e9c22de647063bd82a19936b4c5a144ea6e | [
"Apache-2.0"
] | 5 | 2016-07-05T06:06:31.000Z | 2016-07-27T05:21:36.000Z | test/test_prob_models.py | sylar233/de-identification | 44731e9c22de647063bd82a19936b4c5a144ea6e | [
"Apache-2.0"
] | 3 | 2018-07-18T07:32:43.000Z | 2021-11-05T05:25:55.000Z | from django.test import TestCase
from common.data_utilities import DataUtils
from prob_models.dep_graph import DependencyGraph
from prob_models.jtree import JunctionTree
import common.constant as c
TESTING_FILE = c.TEST_DATA_PATH
"""
The test file has for fields, and the dependency graph would be a complete graph.
... | 35.244681 | 209 | 0.677634 |
5f10c305acc4e613b5656eb25e050b130ecbb7b2 | 631 | py | Python | examples/house_prices_kaggle.py | ChillBoss/ml_automation | 50d42b3cd5a3bb2f7a91e4c53bf3bbfe7a3b1741 | [
"MIT"
] | null | null | null | examples/house_prices_kaggle.py | ChillBoss/ml_automation | 50d42b3cd5a3bb2f7a91e4c53bf3bbfe7a3b1741 | [
"MIT"
] | null | null | null | examples/house_prices_kaggle.py | ChillBoss/ml_automation | 50d42b3cd5a3bb2f7a91e4c53bf3bbfe7a3b1741 | [
"MIT"
] | null | null | null | # Regression Task, assumption is that the data is in the right directory
# data can be taken from https://www.kaggle.com/c/house-prices-advanced-regression-techniques/data
import os
import ml_automation
if __name__ == '__main__':
data_dir = os.path.join(os.path.dirname(__file__), 'data')
f_train = os.path.jo... | 30.047619 | 98 | 0.66561 |
5f10f60ec6549819aee0320bd7db378dfb94aabf | 3,232 | py | Python | src/bel_commons/explorer_toolbox.py | cthoyt/pybel-web | a27f30617b9209d5531a6b65760597f8d45e9957 | [
"MIT"
] | 2 | 2019-07-17T16:17:44.000Z | 2019-07-18T17:05:36.000Z | src/bel_commons/explorer_toolbox.py | cthoyt/pybel-web | a27f30617b9209d5531a6b65760597f8d45e9957 | [
"MIT"
] | 3 | 2020-04-25T17:30:58.000Z | 2020-04-25T17:32:11.000Z | src/bel_commons/explorer_toolbox.py | cthoyt/pybel-web | a27f30617b9209d5531a6b65760597f8d45e9957 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Constants for building the biological network explorer's transformations toolbox."""
from typing import List, Tuple
from pybel.struct.pipeline.decorators import mapped
# Default NetworkX explorer toolbox functions (name, button text, description)
_explorer_toolbox = (
('collapse_to_ge... | 40.911392 | 115 | 0.697401 |
5f140a8d48047d7ddb5cd0c7677d6976d0a7cec0 | 827 | py | Python | threatstack/v1/client.py | giany/threatstack-python-client | c9e0a4bed55685d3a032c6f1a03261d44de64c4a | [
"MIT"
] | 4 | 2018-03-14T21:51:46.000Z | 2020-01-06T17:25:53.000Z | threatstack/v1/client.py | giany/threatstack-python-client | c9e0a4bed55685d3a032c6f1a03261d44de64c4a | [
"MIT"
] | 4 | 2018-01-17T19:58:29.000Z | 2018-04-13T17:03:01.000Z | threatstack/v1/client.py | giany/threatstack-python-client | c9e0a4bed55685d3a032c6f1a03261d44de64c4a | [
"MIT"
] | 6 | 2018-01-15T18:46:25.000Z | 2022-02-17T10:13:35.000Z | """
V1 Client
"""
from threatstack.base import BaseClient
from threatstack.v1 import resources
class Client(BaseClient):
BASE_URL = "https://app.threatstack.com/api/v1/"
def __init__(self, api_key=None, org_id=None, user_id=None, timeout=None):
BaseClient.__init__(self, api_key=api_key, timeout=ti... | 27.566667 | 78 | 0.665054 |
5f14372008e665aac666215605a53db7e9d8af9a | 5,930 | py | Python | djangocms_newsletter/admin/mailinglist.py | nephila/djangocms-newsletter | 5ebd8d3e1e2c85b2791d0261a954469f2548c840 | [
"BSD-3-Clause"
] | null | null | null | djangocms_newsletter/admin/mailinglist.py | nephila/djangocms-newsletter | 5ebd8d3e1e2c85b2791d0261a954469f2548c840 | [
"BSD-3-Clause"
] | null | null | null | djangocms_newsletter/admin/mailinglist.py | nephila/djangocms-newsletter | 5ebd8d3e1e2c85b2791d0261a954469f2548c840 | [
"BSD-3-Clause"
] | 2 | 2021-03-15T13:33:53.000Z | 2021-05-18T20:34:47.000Z | """ModelAdmin for MailingList"""
from datetime import datetime
from django.contrib import admin
from django.conf.urls.defaults import url
from django.conf.urls.defaults import patterns
from django.utils.encoding import smart_str
from django.core.urlresolvers import reverse
from django.shortcuts import get_object_or_40... | 47.063492 | 96 | 0.663238 |
5f18561e37fb0a33a844c99a5051aea7c8863cea | 4,263 | py | Python | lib/train/recorder.py | rurusasu/OrigNet | 3b3384cb3d09b52c7c98bb264901285f006e51c1 | [
"Apache-2.0"
] | null | null | null | lib/train/recorder.py | rurusasu/OrigNet | 3b3384cb3d09b52c7c98bb264901285f006e51c1 | [
"Apache-2.0"
] | null | null | null | lib/train/recorder.py | rurusasu/OrigNet | 3b3384cb3d09b52c7c98bb264901285f006e51c1 | [
"Apache-2.0"
] | 1 | 2021-09-24T01:24:05.000Z | 2021-09-24T01:24:05.000Z | import os
import sys
from collections import deque, defaultdict
from typing import Dict, Union
sys.path.append("../../")
import torch
import torchvision.utils as vutils
from tensorboardX import SummaryWriter
class SmoothedValue(object):
"""Track a series of values and provide access to smoothed values over a
... | 29 | 80 | 0.569317 |
5f1970116641c3a579674b0a3cde7a6940267ce4 | 5,642 | py | Python | scrapytest/spiders.py | coderatchet/scrapy-test | 4f5febfca05d267dc98df94e65a403210ce39d81 | [
"Apache-2.0"
] | null | null | null | scrapytest/spiders.py | coderatchet/scrapy-test | 4f5febfca05d267dc98df94e65a403210ce39d81 | [
"Apache-2.0"
] | null | null | null | scrapytest/spiders.py | coderatchet/scrapy-test | 4f5febfca05d267dc98df94e65a403210ce39d81 | [
"Apache-2.0"
] | null | null | null | import logging
import re
from datetime import datetime
import scrapy
from scrapy.http import Response
# noinspection PyUnresolvedReferences
import scrapytest.db
from scrapytest.config import config
from scrapytest.types import Article
from scrapytest.utils import merge_dict
log = logging.getLogger(__name__)
class ... | 40.589928 | 119 | 0.63045 |
5f19f6344a219107ca416c8c6abd1b139dea3270 | 6,490 | py | Python | src/lib/parsers/parseskipfish.py | Project-Prismatica/Prism-Shell | 006d04fdabbe51c4a3fd642e05ba276251f1bba4 | [
"MIT"
] | null | null | null | src/lib/parsers/parseskipfish.py | Project-Prismatica/Prism-Shell | 006d04fdabbe51c4a3fd642e05ba276251f1bba4 | [
"MIT"
] | null | null | null | src/lib/parsers/parseskipfish.py | Project-Prismatica/Prism-Shell | 006d04fdabbe51c4a3fd642e05ba276251f1bba4 | [
"MIT"
] | 1 | 2018-02-22T02:18:48.000Z | 2018-02-22T02:18:48.000Z | #!/usr/bin/python
# parseskipfish.py
#
# By Adrien de Beaupre adriendb@gmail.com | adrien@intru-shun.ca
# Copyright 2011 Intru-Shun.ca Inc.
# v0.09
# 16 October 2011
#
# The current version of these scripts are at: http://dshield.handers.org/adebeaupre/ossams-parser.tgz
#
# Parses skipfish HTML and JSON outp... | 38.402367 | 130 | 0.686441 |
5f1c1c275c8674c941378ad94c7d52f05e79ddd2 | 14,861 | py | Python | userge/plugins/admin/gban.py | wildyvpn-network/bot | 87459495000bd6004b8f62a9cb933c164da9ef29 | [
"MIT"
] | null | null | null | userge/plugins/admin/gban.py | wildyvpn-network/bot | 87459495000bd6004b8f62a9cb933c164da9ef29 | [
"MIT"
] | null | null | null | userge/plugins/admin/gban.py | wildyvpn-network/bot | 87459495000bd6004b8f62a9cb933c164da9ef29 | [
"MIT"
] | null | null | null | """ setup gban """
# Copyright (C) 2020 by UsergeTeam@Github, < https://github.com/UsergeTeam >.
#
# This file is part of < https://github.com/UsergeTeam/Userge > project,
# and is released under the "GNU v3.0 License Agreement".
# Please see < https://github.com/uaudith/Userge/blob/master/LICENSE >
#
# All rights res... | 43.200581 | 95 | 0.554942 |
5f203d4af3e16b58b2caf10d5df99a539d4f0417 | 41 | py | Python | user/tests/test_verifycode.py | Hrsn2861/pysat-server | 72224bb0e6af8ef825eaf3259587698b5639b8a5 | [
"MIT"
] | null | null | null | user/tests/test_verifycode.py | Hrsn2861/pysat-server | 72224bb0e6af8ef825eaf3259587698b5639b8a5 | [
"MIT"
] | 7 | 2020-06-06T01:55:39.000Z | 2022-02-10T11:46:31.000Z | user/tests/test_verifycode.py | Hrsnnnn/pysat-server | 72224bb0e6af8ef825eaf3259587698b5639b8a5 | [
"MIT"
] | null | null | null | """pytest for user.models.verifycode
"""
| 13.666667 | 36 | 0.707317 |
5f20ed53742e88f3bc18e3804150cf7252de73ee | 7,638 | py | Python | src/python/codebay/common/runcommand.py | nakedible/vpnease-l2tp | 0fcda6a757f2bc5c37f4753b3cd8b1c6d282db5c | [
"WTFPL"
] | 5 | 2015-04-16T08:36:17.000Z | 2017-05-12T17:20:12.000Z | src/python/codebay/common/runcommand.py | nakedible/vpnease-l2tp | 0fcda6a757f2bc5c37f4753b3cd8b1c6d282db5c | [
"WTFPL"
] | null | null | null | src/python/codebay/common/runcommand.py | nakedible/vpnease-l2tp | 0fcda6a757f2bc5c37f4753b3cd8b1c6d282db5c | [
"WTFPL"
] | 4 | 2015-03-19T14:39:51.000Z | 2019-01-23T08:22:55.000Z | """
Codebay process running utils.
@group Running commands: run, call
@group Preexec functions: chroot, cwd
@var PASS:
Specifies that the given file descriptor should be passed directly
to the parent. Given as an argument to run.
@var FAIL:
Specifies that if output is received for the given file descriptor,
a... | 32.092437 | 129 | 0.615213 |
5f268730f61e34ddeec03c49cb3a27cf05cffa58 | 545 | py | Python | SourceCode/Module2/escape_sequences.py | hackettccp/CIS106SampleCode | 0717fa0f6dc0c48bc51f16ab44e7425b186a35c3 | [
"MIT"
] | 1 | 2019-10-23T03:25:43.000Z | 2019-10-23T03:25:43.000Z | SourceCode/Module2/escape_sequences.py | hackettccp/CIS106 | 0717fa0f6dc0c48bc51f16ab44e7425b186a35c3 | [
"MIT"
] | null | null | null | SourceCode/Module2/escape_sequences.py | hackettccp/CIS106 | 0717fa0f6dc0c48bc51f16ab44e7425b186a35c3 | [
"MIT"
] | null | null | null | """
Demonstrates escape sequences in strings
"""
#Line Feed escape sequence.
output1 = "First part \n Second part"
print(output1)
#********************************#
print()
#Double quotes escape sequence.
output2 = "The book \"War and Peace\" is very long"
print(output2)
#********************************#
p... | 18.793103 | 51 | 0.577982 |