hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | 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 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | 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 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
185ef4745136e865feee01cc32066c253ee11595 | 2,955 | py | Python | cheritest/trunk/tests/cp2/test_cp2_csc_neg.py | tupipa/beri | cef1b41d52592cfa7454ddf59f9f2994e447cd66 | [
"Apache-2.0"
] | 36 | 2015-05-29T16:47:19.000Z | 2022-02-08T21:16:26.000Z | cheritest/trunk/tests/cp2/test_cp2_csc_neg.py | tupipa/beri | cef1b41d52592cfa7454ddf59f9f2994e447cd66 | [
"Apache-2.0"
] | 1 | 2015-10-14T13:05:21.000Z | 2015-10-19T20:34:03.000Z | cheritest/trunk/tests/cp2/test_cp2_csc_neg.py | tupipa/beri | cef1b41d52592cfa7454ddf59f9f2994e447cd66 | [
"Apache-2.0"
] | 15 | 2015-06-11T07:10:58.000Z | 2021-06-18T05:14:54.000Z | #-
# Copyright (c) 2012 Michael Roe
# All rights reserved.
#
# This software was developed by SRI International and the University of
# Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237
# ("CTSRD"), as part of the DARPA CRASH research programme.
#
# @BERI_LICENSE_HEADER_START@
#
# Licensed to BER... | 42.214286 | 123 | 0.744839 |
8a481d30bcce4c95cafd611e467f23de8286391a | 2,253 | py | Python | tests/st/ops/ascend/vector/test_apply_proximal_gradient_descent_001.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 286 | 2020-06-23T06:40:44.000Z | 2022-03-30T01:27:49.000Z | tests/st/ops/ascend/vector/test_apply_proximal_gradient_descent_001.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 10 | 2020-07-31T03:26:59.000Z | 2021-12-27T15:00:54.000Z | tests/st/ops/ascend/vector/test_apply_proximal_gradient_descent_001.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 30 | 2020-07-17T01:04:14.000Z | 2021-12-27T14:05:19.000Z | # Copyright 2020 Huawei Technologies Co., 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 to... | 38.186441 | 124 | 0.692854 |
09d195aed60ccad016c1a9aa42d00280e71dbe9a | 5,133 | py | Python | tests/test_parse.py | j-hui/Coqtail | ab7cc9b7ae5988ab5fbc1fd5526f4fbec6cadb2d | [
"MIT"
] | null | null | null | tests/test_parse.py | j-hui/Coqtail | ab7cc9b7ae5988ab5fbc1fd5526f4fbec6cadb2d | [
"MIT"
] | null | null | null | tests/test_parse.py | j-hui/Coqtail | ab7cc9b7ae5988ab5fbc1fd5526f4fbec6cadb2d | [
"MIT"
] | null | null | null | # -*- coding: utf8 -*-
"""
File: test_parse.py
Author: Wolf Honore
Description: Unit tests for parsing in coqtail.py.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import pytest
from coqtail import NoDotError, UnmatchedError, _get_message_range, _st... | 37.742647 | 83 | 0.455094 |
0366407316303d56dc29325b786a290747ecda5f | 4,468 | py | Python | storm_analysis/diagnostics/sCMOS/configure.py | bintulab/storm-analysis | 71ae493cbd17ddb97938d0ae2032d97a0eaa76b2 | [
"CNRI-Python"
] | null | null | null | storm_analysis/diagnostics/sCMOS/configure.py | bintulab/storm-analysis | 71ae493cbd17ddb97938d0ae2032d97a0eaa76b2 | [
"CNRI-Python"
] | null | null | null | storm_analysis/diagnostics/sCMOS/configure.py | bintulab/storm-analysis | 71ae493cbd17ddb97938d0ae2032d97a0eaa76b2 | [
"CNRI-Python"
] | null | null | null | #!/usr/bin/env python
"""
Configure folder for sCMOS testing.
Hazen 09/17
"""
import numpy
import os
import storm_analysis
import storm_analysis.sa_library.parameters as parameters
import storm_analysis.simulator.emitters_on_grid as emittersOnGrid
import storm_analysis.simulator.emitters_uniform_random as emittersUn... | 34.635659 | 92 | 0.605864 |
ff39024bf0cc30ac88dafab5d24a654adf9ba80c | 5,496 | py | Python | redata/backends/sql_alchemy.py | mociarain/redata | fc4e9826ab47920677383c97e51b6a8bdbd58a4b | [
"MIT"
] | null | null | null | redata/backends/sql_alchemy.py | mociarain/redata | fc4e9826ab47920677383c97e51b6a8bdbd58a4b | [
"MIT"
] | null | null | null | redata/backends/sql_alchemy.py | mociarain/redata | fc4e9826ab47920677383c97e51b6a8bdbd58a4b | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
from decimal import Decimal
from sqlalchemy import Date, Interval, case, cast, desc, distinct, func, select, text
from sqlalchemy.schema import MetaData
from redata.backends.base import DB
from redata.metric import Metric
class SqlAlchemy(DB):
METRIC_TO_FUNC = {
... | 31.405714 | 85 | 0.605349 |
6a84fcaf0bc5cb2d546e81edf9ef6c80242d0fb0 | 965 | py | Python | src/utils_cyber.py | Snedashkovsky/knowledge_graph_research | 2695850815fa2fcd28d43b371923601aaee68d6f | [
"MIT"
] | 4 | 2021-01-19T10:01:41.000Z | 2021-08-22T18:16:46.000Z | src/utils_cyber.py | Snedashkovsky/knowledge_graph_research | 2695850815fa2fcd28d43b371923601aaee68d6f | [
"MIT"
] | null | null | null | src/utils_cyber.py | Snedashkovsky/knowledge_graph_research | 2695850815fa2fcd28d43b371923601aaee68d6f | [
"MIT"
] | 1 | 2021-06-13T09:23:23.000Z | 2021-06-13T09:23:23.000Z | from time import sleep
from tqdm.notebook import tqdm
from src.utils_bash import create_cyberlink
from config import CYBER_ACCOUNT_NAME
def create_cl(account_name, from_hash, to_hash, print_message):
cyberlink_hash, cyberlink_error = \
create_cyberlink(
account_name=account_name,
... | 35.740741 | 100 | 0.706736 |
aa4a2772e5c848511ede4ec9b231f84f01c22019 | 9,762 | py | Python | timelock.py | GONQ/timelock | 5341002a19233f0a9ff95a8dd7937652e270e366 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | timelock.py | GONQ/timelock | 5341002a19233f0a9ff95a8dd7937652e270e366 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | timelock.py | GONQ/timelock | 5341002a19233f0a9ff95a8dd7937652e270e366 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# timelock python library - time shifts to stop multiple instances of a script
# (c) 2018, Ber Saxon (GONQ) <auto@eagle.icu> https://eagle.icu
# License: use or redistribution subject to license included herewith.
# This copyright notice must be included with any fork or distribution.
# ------... | 39.362903 | 92 | 0.544151 |
fab9b3676a45e9a89185cc7185d552f8be19f0af | 850 | py | Python | samples/tutorial-optimizer-local.py | Richard-L-Johnson/pyalgotrader | ad2bcc6b25c06c66eee4a8d522ce844504d8ec62 | [
"Apache-2.0"
] | 3,719 | 2015-01-06T09:00:02.000Z | 2022-03-31T20:55:01.000Z | samples/tutorial-optimizer-local.py | Richard-L-Johnson/pyalgotrader | ad2bcc6b25c06c66eee4a8d522ce844504d8ec62 | [
"Apache-2.0"
] | 122 | 2015-01-01T17:06:22.000Z | 2022-03-22T13:33:38.000Z | samples/tutorial-optimizer-local.py | Richard-L-Johnson/pyalgotrader | ad2bcc6b25c06c66eee4a8d522ce844504d8ec62 | [
"Apache-2.0"
] | 1,428 | 2015-01-01T17:07:38.000Z | 2022-03-31T10:02:37.000Z | import itertools
from pyalgotrade.optimizer import local
from pyalgotrade.barfeed import quandlfeed
import rsi2
def parameters_generator():
instrument = ["ibm"]
entrySMA = range(150, 251)
exitSMA = range(5, 16)
rsiPeriod = range(2, 11)
overBoughtThreshold = range(75, 96)
overSoldThreshold = ra... | 32.692308 | 110 | 0.72 |
31fb5a1bf714041d01f291097fa8560c4346c9ea | 5,828 | py | Python | tests/argsupporttest.py | dylanShark/pomgen | 311dc718e4796b0b03de65a318e264df9a44bbde | [
"BSD-3-Clause"
] | 32 | 2020-01-17T11:00:33.000Z | 2022-03-17T02:46:41.000Z | tests/argsupporttest.py | dylanShark/pomgen | 311dc718e4796b0b03de65a318e264df9a44bbde | [
"BSD-3-Clause"
] | 19 | 2020-01-08T02:30:29.000Z | 2021-02-21T08:43:40.000Z | tests/argsupporttest.py | dylanShark/pomgen | 311dc718e4796b0b03de65a318e264df9a44bbde | [
"BSD-3-Clause"
] | 10 | 2019-12-29T06:53:56.000Z | 2021-11-22T15:28:50.000Z | """
Copyright (c) 2018, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
from common import argsupport
from crawl import bazel
import unittest
PASTRY_PACKAGES = ["projects/li... | 51.122807 | 134 | 0.733013 |
a8bf6f31bf284c130884d9e74963a78c0c362858 | 49 | py | Python | ktrain/version.py | haansanghavi/ktrain | 89b21c31f67333f6fa18e19a2aa6dab7f02f2ed6 | [
"Apache-2.0"
] | 2 | 2020-06-21T11:43:11.000Z | 2020-08-07T15:09:05.000Z | ktrain/version.py | Shifath472533/ktrain | 3228f336ba5be4d317538c1b79f8ad0259892b2d | [
"Apache-2.0"
] | null | null | null | ktrain/version.py | Shifath472533/ktrain | 3228f336ba5be4d317538c1b79f8ad0259892b2d | [
"Apache-2.0"
] | null | null | null | __all__ = ['__version__']
__version__ = '0.16.3'
| 16.333333 | 25 | 0.673469 |
fe19ea0f49909341da173b2522e5eae4ef9c08e0 | 2,150 | py | Python | filelock/__init__.py | voider1/FileLock | 686c654738a5f0d5cb51c7ee3cd7767fd6185e4d | [
"BSD-3-Clause"
] | null | null | null | filelock/__init__.py | voider1/FileLock | 686c654738a5f0d5cb51c7ee3cd7767fd6185e4d | [
"BSD-3-Clause"
] | null | null | null | filelock/__init__.py | voider1/FileLock | 686c654738a5f0d5cb51c7ee3cd7767fd6185e4d | [
"BSD-3-Clause"
] | null | null | null | class FileLockError(Exception):
pass
class SetFileLockError(Exception):
pass
def lock_factory():
write_locked_files = set([])
read_locked_files = set([])
def set_write_lock(filename):
nonlocal write_locked_files
if filename in write_locked_files:
raise SetFileLockErr... | 30.28169 | 79 | 0.712558 |
0227cf605065d4870118786c1c3755e409895f1f | 445 | py | Python | common/hooks/logger_hooks.py | albalabkin/PyCats | b3fa09e116f38cebbb66faef16785e2795d80aa9 | [
"Apache-2.0"
] | null | null | null | common/hooks/logger_hooks.py | albalabkin/PyCats | b3fa09e116f38cebbb66faef16785e2795d80aa9 | [
"Apache-2.0"
] | null | null | null | common/hooks/logger_hooks.py | albalabkin/PyCats | b3fa09e116f38cebbb66faef16785e2795d80aa9 | [
"Apache-2.0"
] | null | null | null | import logging
from common.pycats_facade import PyCatsFacade
def pytest_runtest_logstart(nodeid, location):
PyCatsFacade().logger.logger.name = nodeid
PyCatsFacade().logger.switch_test(location[2])
def pytest_exception_interact(node, call, report):
if PyCatsFacade().logger.log_level == logging.INFO:
... | 27.8125 | 62 | 0.741573 |
c4c95868ae467c81115c21d1dbee16554fa3ba7c | 11,068 | py | Python | modules/tools/navigation/planning/provider_mobileye.py | seeclong/apollo | 99c8afb5ebcae2a3c9359a156a957ff03944b27b | [
"Apache-2.0"
] | 27 | 2019-04-06T02:27:14.000Z | 2021-11-27T13:47:06.000Z | modules/tools/navigation/planning/provider_mobileye.py | seeclong/apollo | 99c8afb5ebcae2a3c9359a156a957ff03944b27b | [
"Apache-2.0"
] | 7 | 2021-03-10T18:14:25.000Z | 2022-02-27T04:46:46.000Z | modules/tools/navigation/planning/provider_mobileye.py | seeclong/apollo | 99c8afb5ebcae2a3c9359a156a957ff03944b27b | [
"Apache-2.0"
] | 38 | 2019-04-15T10:58:37.000Z | 2022-01-27T08:52:39.000Z | #!/usr/bin/env python
###############################################################################
# Copyright 2017 The Apollo Authors. 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 ... | 36.649007 | 80 | 0.598482 |
eca1be659896b1591fdbf3d1ef9780078d634761 | 1,306 | py | Python | compute_miou.py | mcever/psa | bf58bb3be5d9f3826b25b4d85445102161d84b79 | [
"MIT"
] | null | null | null | compute_miou.py | mcever/psa | bf58bb3be5d9f3826b25b4d85445102161d84b79 | [
"MIT"
] | null | null | null | compute_miou.py | mcever/psa | bf58bb3be5d9f3826b25b4d85445102161d84b79 | [
"MIT"
] | null | null | null | """
takes path to ground truths and predicitons and computes mIOU
testing with png images where BW pixel values are class numbers
"""
from metrics import RunningConfusionMatrix as RCM
import scipy
import numpy as np
import argparse
import os
def compute_miou(gt_path, pred_path):
CM = RCM(list(range(21)))
p... | 28.391304 | 81 | 0.676876 |
2384ad9faef8cb41a4600b17e24f0c6db9e340f0 | 6,096 | py | Python | data/bin/irsToJSON.py | suyetake/Kalicos | 19497105c11df8e4e078b06bd7a2b0a135e67961 | [
"MIT"
] | 1 | 2018-08-13T15:55:13.000Z | 2018-08-13T15:55:13.000Z | data/bin/irsToJSON.py | suyetake/Kalicos | 19497105c11df8e4e078b06bd7a2b0a135e67961 | [
"MIT"
] | 8 | 2017-10-19T00:05:22.000Z | 2018-10-25T00:16:14.000Z | data/bin/irsToJSON.py | suyetake/Kalicos | 19497105c11df8e4e078b06bd7a2b0a135e67961 | [
"MIT"
] | 15 | 2017-09-23T21:02:22.000Z | 2019-09-12T00:41:39.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Python 3 script for transforming IRS CSV data (files named all_nonprofits.csv, for example) into organization JSON
files in the output directory
Example:
python3 irsToJSON.py all_nonprofits.csv json_output_dir/
Restrictions on what is converted to JSON (for examp... | 43.234043 | 318 | 0.646982 |
8326e4a35bedcef515a4c39d56af439b7227eaf5 | 3,375 | py | Python | redditclone/settings/base.py | fergbrain/redditclone | 050b3da43341c6f6f688918c6172f571d4f2b781 | [
"BSD-3-Clause"
] | null | null | null | redditclone/settings/base.py | fergbrain/redditclone | 050b3da43341c6f6f688918c6172f571d4f2b781 | [
"BSD-3-Clause"
] | null | null | null | redditclone/settings/base.py | fergbrain/redditclone | 050b3da43341c6f6f688918c6172f571d4f2b781 | [
"BSD-3-Clause"
] | null | null | null | import os
import sys
# PATH vars
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
root = lambda *x: os.path.join(BASE_DIR, *x)
sys.path.insert(0, root('apps'))
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'CHANGE THIS!!!'
# SECURITY WARNING: don't run with ... | 24.280576 | 107 | 0.666667 |
8f0199c637024688e1467a9843972ec3d46c42d7 | 3,408 | py | Python | app/app/settings.py | tupt0101/recipe-app-api | b9fa0f375f142d4efbcc98d2fb8d03d0de4d16b5 | [
"MIT"
] | null | null | null | app/app/settings.py | tupt0101/recipe-app-api | b9fa0f375f142d4efbcc98d2fb8d03d0de4d16b5 | [
"MIT"
] | null | null | null | app/app/settings.py | tupt0101/recipe-app-api | b9fa0f375f142d4efbcc98d2fb8d03d0de4d16b5 | [
"MIT"
] | null | null | null | """
Django settings for app project.
Generated by 'django-admin startproject' using Django 3.2.6.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from pathlib imp... | 25.818182 | 91 | 0.69777 |
3536dd1deba41b12c62e4d26e2480b134dd5c5f9 | 1,440 | py | Python | xlsxwriter/test/comparison/test_chart_format08.py | dthadi3/XlsxWriter | f1801e82240aa9c746ce14948ef95990b83162cf | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2020-07-01T07:24:37.000Z | 2020-07-01T07:24:37.000Z | xlsxwriter/test/comparison/test_chart_format08.py | dthadi3/XlsxWriter | f1801e82240aa9c746ce14948ef95990b83162cf | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxwriter/test/comparison/test_chart_format08.py | dthadi3/XlsxWriter | f1801e82240aa9c746ce14948ef95990b83162cf | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2020, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | 24.40678 | 79 | 0.532639 |
2753633de2995376137e8c83b49d263fe8355684 | 836 | py | Python | catalogue/migrations/0007_auto_20211201_1026.py | Parveen3300/Reans | 6dfce046b01099284a8c945a04600ed83e5099a4 | [
"Apache-2.0"
] | null | null | null | catalogue/migrations/0007_auto_20211201_1026.py | Parveen3300/Reans | 6dfce046b01099284a8c945a04600ed83e5099a4 | [
"Apache-2.0"
] | null | null | null | catalogue/migrations/0007_auto_20211201_1026.py | Parveen3300/Reans | 6dfce046b01099284a8c945a04600ed83e5099a4 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.2.8 on 2021-12-01 10:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('catalogue', '0006_rename_color_product_product_color'),
]
operations = [
migrations.AlterField(
model_name='product',
... | 34.833333 | 219 | 0.583732 |
660e0d7059ea4f0cc6ba4d428973861003bfece2 | 4,282 | py | Python | scripts/rust/check_rust_licenses.py | oshunter/fuchsia | 2196fc8c176d01969466b97bba3f31ec55f7767b | [
"BSD-3-Clause"
] | 2 | 2020-08-16T15:32:35.000Z | 2021-11-07T20:09:46.000Z | scripts/rust/check_rust_licenses.py | oshunter/fuchsia | 2196fc8c176d01969466b97bba3f31ec55f7767b | [
"BSD-3-Clause"
] | null | null | null | scripts/rust/check_rust_licenses.py | oshunter/fuchsia | 2196fc8c176d01969466b97bba3f31ec55f7767b | [
"BSD-3-Clause"
] | 1 | 2021-08-15T04:29:11.000Z | 2021-08-15T04:29:11.000Z | #!/usr/bin/env python3
#
# Copyright 2017 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# A script to fetch missing LICENSE files when building a vendored repo
# Should be run from top-level of third_party/rust_crates re... | 31.485294 | 108 | 0.578935 |
fd87910b19586bcd6d55ebbb04af256a98e98401 | 1,438 | py | Python | models/sergiy_trans_minnie_v1_m6m8m10/alignermodule.py | emitch/SEAMLeSS | cae21c67316ed36529fdc2e470a105a9f847975c | [
"MIT"
] | 4 | 2018-12-17T18:45:57.000Z | 2021-04-29T16:30:42.000Z | models/sergiy_trans_minnie_v1_m6m8m10/alignermodule.py | emitch/SEAMLeSS | cae21c67316ed36529fdc2e470a105a9f847975c | [
"MIT"
] | 19 | 2019-01-02T19:09:12.000Z | 2020-12-14T18:50:47.000Z | models/sergiy_trans_minnie_v1_m6m8m10/alignermodule.py | emitch/SEAMLeSS | cae21c67316ed36529fdc2e470a105a9f847975c | [
"MIT"
] | 2 | 2020-03-18T01:24:03.000Z | 2022-01-06T06:19:58.000Z | from torch import nn
from torch.autograd import Variable
import numpy as np
import torch
import os
import math
from residuals import res_warp_img, res_warp_res
class Aligner(nn.Module):
def initc(self, m, mult=1):
m.weight.data *= mult
def __init__(self, fms=[2, 16, 2], k=7, initc_mult=1.0):
... | 27.653846 | 75 | 0.590403 |
cca7cefd4d53754fc10b36d84975da6cc09f4012 | 28,227 | py | Python | tests/test_fields.py | damlanisa/drf-extra-fields | 4e06a9773e27dcf4219628c6ae8c9a4c9722b237 | [
"Apache-2.0"
] | null | null | null | tests/test_fields.py | damlanisa/drf-extra-fields | 4e06a9773e27dcf4219628c6ae8c9a4c9722b237 | [
"Apache-2.0"
] | null | null | null | tests/test_fields.py | damlanisa/drf-extra-fields | 4e06a9773e27dcf4219628c6ae8c9a4c9722b237 | [
"Apache-2.0"
] | null | null | null | import base64
import copy
import datetime
import django
import imghdr
import os
import pytest
import pytz
from django.core.exceptions import ValidationError
from django.test import TestCase, override_settings
from mock import patch
from psycopg2._range import NumericRange, DateTimeTZRange, DateRange
from rest_framewor... | 37.486056 | 117 | 0.632019 |
d9021da72b75dae6d12cd0ac9d4f0dd810599d40 | 2,272 | py | Python | src/oci/appmgmt_control/models/monitored_instance_collection.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/appmgmt_control/models/monitored_instance_collection.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/appmgmt_control/models/monitored_instance_collection.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 32 | 245 | 0.677377 |
f67846cb0ff88bcdb1a8e4d1600c3226f173991d | 6,957 | py | Python | statsforecast/core.py | anasofiavazquez/statsforecast | 3d8f452550241abdb7a34b8e627398b30ac7093a | [
"MIT"
] | 1 | 2022-03-09T03:57:25.000Z | 2022-03-09T03:57:25.000Z | statsforecast/core.py | anasofiavazquez/statsforecast | 3d8f452550241abdb7a34b8e627398b30ac7093a | [
"MIT"
] | null | null | null | statsforecast/core.py | anasofiavazquez/statsforecast | 3d8f452550241abdb7a34b8e627398b30ac7093a | [
"MIT"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/core.ipynb (unless otherwise specified).
__all__ = ['StatsForecast']
# Cell
import inspect
import logging
from concurrent.futures import ProcessPoolExecutor
from functools import partial
import numpy as np
import pandas as pd
# Internal Cell
logging.basicConfig(
f... | 37.605405 | 105 | 0.58416 |
4ec3e000fd0ff2719a8f90ba0a5331c935e88ceb | 2,939 | py | Python | backend/mp/apps/questionnarie/migrations/0001_initial.py | shidashui/mymp | 75d81906908395ece1c8d12249d6afc4bd2d0704 | [
"MIT"
] | 1 | 2020-03-14T12:33:24.000Z | 2020-03-14T12:33:24.000Z | backend/mp/apps/questionnarie/migrations/0001_initial.py | shidashui/mymp | 75d81906908395ece1c8d12249d6afc4bd2d0704 | [
"MIT"
] | 8 | 2021-03-19T00:59:11.000Z | 2022-03-12T00:19:38.000Z | backend/mp/apps/questionnarie/migrations/0001_initial.py | shidashui/mymp | 75d81906908395ece1c8d12249d6afc4bd2d0704 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.4 on 2020-03-26 14:27
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Questionnaire',
fields=[
('id', models.Auto... | 41.985714 | 114 | 0.556312 |
32ee46619bc19cf4f759ad0cb7a39acb122ff0c0 | 4,061 | py | Python | src/problem2.py | dandanT-T/08-Exam1-201920 | 0a1e18f37ec5318ef42d81d9a8304c2347d7d845 | [
"MIT"
] | null | null | null | src/problem2.py | dandanT-T/08-Exam1-201920 | 0a1e18f37ec5318ef42d81d9a8304c2347d7d845 | [
"MIT"
] | null | null | null | src/problem2.py | dandanT-T/08-Exam1-201920 | 0a1e18f37ec5318ef42d81d9a8304c2347d7d845 | [
"MIT"
] | null | null | null | """
Exam 1, problem 2.
Authors: David Mutchler, Vibha Alangar, Matt Boutell, Dave Fisher,
Mark Hays, Amanda Stouder, Aaron Wilkin, their colleagues,
and Zhicheng Kai.
""" # DO: 1. PUT YOUR NAME IN THE ABOVE LINE.
import math
def main():
""" Calls the TEST functions in this module. """
t... | 33.01626 | 79 | 0.475991 |
06d0241de09b462586474990709609c082f659fe | 9,318 | py | Python | src/trainer.py | jjonhwa/Optuna_and_Knowledge-Distllation | 166641fcdffc5b1f6e017ef917a3b0ff5ff516d6 | [
"MIT"
] | null | null | null | src/trainer.py | jjonhwa/Optuna_and_Knowledge-Distllation | 166641fcdffc5b1f6e017ef917a3b0ff5ff516d6 | [
"MIT"
] | null | null | null | src/trainer.py | jjonhwa/Optuna_and_Knowledge-Distllation | 166641fcdffc5b1f6e017ef917a3b0ff5ff516d6 | [
"MIT"
] | null | null | null | """PyTorch trainer module.
- Author: Jongkuk Lim, Junghoon Kim
- Contact: lim.jeikei@gmail.com, placidus36@gmail.com
"""
import os
import shutil
from typing import Optional, Tuple, Union
import numpy as np
import wandb
import torch
import torch.nn as nn
import torch.optim as optim
import torchvision
from sklearn.met... | 31.268456 | 122 | 0.553445 |
0f318b340fd25e487dcba778de85d4c5773ec11f | 1,884 | py | Python | tools/ota_e2e_tests/aws_ota_test/aws_ota_test_case_greater_version_max_block_config.py | qizengqizeng/amazon-freertos | 4700a45ba620e61c4da019160fbb9cbdf9d81b1e | [
"MIT"
] | 6 | 2020-04-29T19:18:17.000Z | 2021-08-23T05:21:53.000Z | tools/ota_e2e_tests/aws_ota_test/aws_ota_test_case_greater_version_max_block_config.py | qizengqizeng/amazon-freertos | 4700a45ba620e61c4da019160fbb9cbdf9d81b1e | [
"MIT"
] | 11 | 2020-06-17T12:58:37.000Z | 2021-12-10T12:28:15.000Z | tools/ota_e2e_tests/aws_ota_test/aws_ota_test_case_greater_version_max_block_config.py | qizengqizeng/amazon-freertos | 4700a45ba620e61c4da019160fbb9cbdf9d81b1e | [
"MIT"
] | 13 | 2019-12-31T21:22:09.000Z | 2022-03-07T15:55:27.000Z | """
FreeRTOS
Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
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 righ... | 40.085106 | 95 | 0.760616 |
7e01a7fb9843dccac4f053b3854d35bfa95f2af2 | 7,916 | py | Python | NESS/Planck/Planck_Final_Map_Generator.py | drtobybrown/AncillaryDataButton | 129d282c0891a2e8fcb808847befb431d7242fd7 | [
"MIT"
] | 1 | 2021-09-08T00:16:00.000Z | 2021-09-08T00:16:00.000Z | NESS/Planck/Planck_Final_Map_Generator.py | drtobybrown/AncillaryDataButton | 129d282c0891a2e8fcb808847befb431d7242fd7 | [
"MIT"
] | null | null | null | NESS/Planck/Planck_Final_Map_Generator.py | drtobybrown/AncillaryDataButton | 129d282c0891a2e8fcb808847befb431d7242fd7 | [
"MIT"
] | 2 | 2019-10-17T20:01:58.000Z | 2021-05-13T17:26:32.000Z | # Identify location
import socket
location = socket.gethostname()
if location == 'saruman':
dropbox = '/home/herdata/spx7cjc/Dropbox/'
# Import smorgasbord
import os
import sys
import numpy as np
import scipy.ndimage
import multiprocessing as mp
import matplotlib.pyplot as plt
import warnings
warnings.filterwarni... | 41.229167 | 183 | 0.640475 |
86070fee7ba64ccad76fc906487ae3b7067055ca | 54,753 | py | Python | cosmoprimo/interpolator.py | cosmodesi/cosmoprimo | a0d466418f6f5af80d446627109ce11bfb46f8b5 | [
"BSD-3-Clause"
] | 2 | 2022-01-07T12:20:01.000Z | 2022-01-22T20:34:03.000Z | cosmoprimo/interpolator.py | cosmodesi/cosmoprimo | a0d466418f6f5af80d446627109ce11bfb46f8b5 | [
"BSD-3-Clause"
] | null | null | null | cosmoprimo/interpolator.py | cosmodesi/cosmoprimo | a0d466418f6f5af80d446627109ce11bfb46f8b5 | [
"BSD-3-Clause"
] | null | null | null | """
Utilities for power spectrum and correlation function interpolations.
Useful classes are :class:`PowerSpectrumInterpolator1D`, :class:`PowerSpectrumInterpolator2D`,
:class:`CorrelationFunctionInterpolator1D`, :class:`CorrelationFunctionInterpolator2D`.
"""
import inspect
import numpy as np
from scipy import inter... | 37.070413 | 168 | 0.599821 |
4cd89779bff3c707edf76b35ace3c3a1ae5cb237 | 1,073 | py | Python | src/olympia/devhub/models.py | osamamagdy/addons-server | f7326c94d1d40c71eca991242288edf799146182 | [
"BSD-3-Clause"
] | 843 | 2016-02-09T13:00:37.000Z | 2022-03-20T19:17:06.000Z | src/olympia/devhub/models.py | osamamagdy/addons-server | f7326c94d1d40c71eca991242288edf799146182 | [
"BSD-3-Clause"
] | 10,187 | 2016-02-05T23:51:05.000Z | 2022-03-31T15:24:44.000Z | src/olympia/devhub/models.py | osamamagdy/addons-server | f7326c94d1d40c71eca991242288edf799146182 | [
"BSD-3-Clause"
] | 551 | 2016-02-08T20:32:16.000Z | 2022-03-15T16:49:24.000Z | import uuid
from datetime import datetime
from django.db import models
import olympia.core.logger
from olympia.addons.models import Addon
from olympia.amo.fields import PositiveAutoField
from olympia.amo.models import ModelBase
from olympia.users.models import UserProfile
log = olympia.core.logger.getLogger('devh... | 26.170732 | 86 | 0.738117 |
9eb9f8c08b87c5da8b1ac67635d20d9023808251 | 730 | py | Python | twitter/larav-bot/ereport.py | ravivooda/utils | 01f8fe21984e560ae7660fe71d14944125944dfd | [
"MIT"
] | null | null | null | twitter/larav-bot/ereport.py | ravivooda/utils | 01f8fe21984e560ae7660fe71d14944125944dfd | [
"MIT"
] | null | null | null | twitter/larav-bot/ereport.py | ravivooda/utils | 01f8fe21984e560ae7660fe71d14944125944dfd | [
"MIT"
] | null | null | null | # Import smtplib for the actual sending function
import smtplib
# Import the email modules we'll need
from email.mime.text import MIMEText
def send_email(message="", subject="EReport of Twitter Bot"):
msg = MIMEText(message)
msg['Subject'] = subject
# Send the message via our own SMTP server, but don't ... | 26.071429 | 81 | 0.647945 |
e773134b8a055ed561785373a2a6f467e0926deb | 1,495 | py | Python | my_classes/.history/ModulesPackages_PackageNamespaces/example1/module1_20210726141052.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | my_classes/.history/ModulesPackages_PackageNamespaces/example1/module1_20210726141052.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | my_classes/.history/ModulesPackages_PackageNamespaces/example1/module1_20210726141052.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | from pprint import pprint
print('----------- Running {0} --------'.format(__name__))
def pprint_dict(header, d):
print('\n\n-----------------')
print('****** {0} *****'.format(header))
for key, value in d.items():
pass(key, value)
print('----------------------\n\n')
pprint_dict('module1.glob... | 31.145833 | 119 | 0.505686 |
0aeb725095a825f42572fe357d6aae538c74ca19 | 3,443 | py | Python | src/pretix/base/services/waitinglist.py | prereg/prereg | 5000c279a801fa2260009b15dd90e3bd4f447785 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/pretix/base/services/waitinglist.py | prereg/prereg | 5000c279a801fa2260009b15dd90e3bd4f447785 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/pretix/base/services/waitinglist.py | prereg/prereg | 5000c279a801fa2260009b15dd90e3bd4f447785 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import sys
from datetime import timedelta
from django.db.models import Q
from django.dispatch import receiver
from django.utils.timezone import now
from django_scopes import scopes_disabled
from pretix.base.models import Event, User, WaitingListEntry
from pretix.base.models.waitinglist import WaitingListException
fro... | 37.021505 | 110 | 0.625908 |
7702224aad35d30fc502983dcdeeb740be46fcbc | 677 | py | Python | attacks/rsa/known_d.py | jvdsn/crypto-attacks | df37f112c28687efd105b7770b1baa4c53a71ad8 | [
"MIT"
] | 139 | 2020-10-26T00:43:15.000Z | 2022-03-28T20:00:46.000Z | attacks/rsa/known_d.py | jvdsn/crypto-attacks | df37f112c28687efd105b7770b1baa4c53a71ad8 | [
"MIT"
] | 6 | 2021-06-21T05:59:04.000Z | 2022-02-17T22:50:42.000Z | attacks/rsa/known_d.py | jvdsn/crypto-attacks | df37f112c28687efd105b7770b1baa4c53a71ad8 | [
"MIT"
] | 22 | 2021-07-01T08:42:54.000Z | 2022-03-20T20:27:18.000Z | from math import gcd
from random import randint
def factorize(N, e, d):
"""
Recovers the prime factors from a modulus if the public exponent and private exponent are known.
:param N: the modulus
:param e: the public exponent
:param d: the private exponent
:return: a tuple containing the prime ... | 27.08 | 100 | 0.524372 |
9ca03079e2359a9e6e222675ca160c3812d020c1 | 4,387 | py | Python | benchmark/startQiskit_QC1109.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_QC1109.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_QC1109.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=5
# total number=48
import cirq
import qiskit
from qiskit import IBMQ
from qiskit.providers.ibmq import least_busy
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from ma... | 32.496296 | 165 | 0.620925 |
4a8bc3838c2df4f45b6d1f37fd338d0c9e3a72d6 | 980 | py | Python | sheetsu/tests/test_update.py | widdildialog/dialogflowV2 | 49cd26256d54e4add65887d00a8c5bf19932261e | [
"Apache-2.0"
] | 8 | 2017-08-14T16:13:47.000Z | 2022-01-01T18:12:48.000Z | sheetsu/tests/test_update.py | widdildialog/dialogflow | f7bfabc31836a8524241c0ae44f3f14bc5de2d52 | [
"Apache-2.0"
] | 6 | 2017-11-29T10:36:56.000Z | 2021-06-01T22:02:28.000Z | sheetsu/tests/test_update.py | widdildialog/dialogflow | f7bfabc31836a8524241c0ae44f3f14bc5de2d52 | [
"Apache-2.0"
] | 4 | 2017-11-23T11:03:37.000Z | 2019-12-25T07:44:36.000Z | import json
from unittest import TestCase
from unittest.mock import MagicMock, patch
from sheetsu import SheetsuClient
class SheetsuApiUpdateTestCase(TestCase):
""""""
def setUp(self):
super(SheetsuApiUpdateTestCase, self).setUp()
self.kwargs = {
"spreadsheet_id": "<spreadsheet_... | 29.69697 | 78 | 0.57449 |
b1c6e8f01fc4e31ad47d7fc555281c4e08898993 | 402 | py | Python | mujoco_py_derivatives/__init__.py | MinRegret/mujoco-py-derivatives | e3649d9079d1cc77d0f536d3bbcf456a2ccc8f89 | [
"MIT"
] | null | null | null | mujoco_py_derivatives/__init__.py | MinRegret/mujoco-py-derivatives | e3649d9079d1cc77d0f536d3bbcf456a2ccc8f89 | [
"MIT"
] | null | null | null | mujoco_py_derivatives/__init__.py | MinRegret/mujoco-py-derivatives | e3649d9079d1cc77d0f536d3bbcf456a2ccc8f89 | [
"MIT"
] | null | null | null | import os
import sys
from importlib.machinery import ExtensionFileLoader
DIR = os.path.abspath(os.path.dirname(__file__))
python_version = str(sys.version_info.major) + str(sys.version_info.minor)
cymjd = ExtensionFileLoader(
"cymjd", os.path.join(DIR, "cymjd.cpython-{}-x86_64-linux-gnu.so".format(python_version))... | 30.923077 | 93 | 0.78607 |
ddf12473051e7633551d336b3ad775b8016ea636 | 3,093 | py | Python | pyspeckit/spectrum/models/inherited_voigtfitter.py | migueldvb/pyspeckit | fa7d875da7c684c8f6aaa3ba206ef3ff2e196652 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | pyspeckit/spectrum/models/inherited_voigtfitter.py | migueldvb/pyspeckit | fa7d875da7c684c8f6aaa3ba206ef3ff2e196652 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | pyspeckit/spectrum/models/inherited_voigtfitter.py | migueldvb/pyspeckit | fa7d875da7c684c8f6aaa3ba206ef3ff2e196652 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | """
====================
Voigt Profile Fitter
====================
"""
import model
import numpy as np
try:
import scipy.special
scipyOK = True
except ImportError:
scipyOK = False
def voigt(xarr,amp,xcen,sigma,gamma,normalized=False):
"""
Normalized Voigt profile
z = (x+i*gam)/(sig*sqrt(2))
... | 30.93 | 91 | 0.602974 |
4478fc46fd7c798b25d8feeeff1397621d94035f | 5,379 | py | Python | python_modules/dagster-dask/dagster_dask/engine.py | jake-billings/dagster | 7a1548a1f246c48189f3d8109e831b744bceb7d4 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster-dask/dagster_dask/engine.py | jake-billings/dagster | 7a1548a1f246c48189f3d8109e831b744bceb7d4 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster-dask/dagster_dask/engine.py | jake-billings/dagster | 7a1548a1f246c48189f3d8109e831b744bceb7d4 | [
"Apache-2.0"
] | null | null | null | import itertools
import dask
import dask.distributed
from dagster import check
from dagster.core.engine.engine_base import IEngine
from dagster.core.events import DagsterEvent
from dagster.core.execution.context.system import SystemPipelineExecutionContext
from dagster.core.execution.plan.plan import ExecutionPlan
... | 41.697674 | 100 | 0.617215 |
8b7830ad3d21b66a67a9cf4a200f29ad3aa8c402 | 30,654 | py | Python | lib/charms/layer/openstack.py | lolwww/charm-openstack-integrator | 3d0ac0601bc7105e1a2975a1d1438916a1d7dcbb | [
"Apache-2.0"
] | null | null | null | lib/charms/layer/openstack.py | lolwww/charm-openstack-integrator | 3d0ac0601bc7105e1a2975a1d1438916a1d7dcbb | [
"Apache-2.0"
] | null | null | null | lib/charms/layer/openstack.py | lolwww/charm-openstack-integrator | 3d0ac0601bc7105e1a2975a1d1438916a1d7dcbb | [
"Apache-2.0"
] | null | null | null | import binascii
import json
import re
import os
import subprocess
import time
from base64 import b64decode, b64encode
from ipaddress import ip_address, ip_network
from pathlib import Path
from traceback import format_exc
from urllib.request import urlopen
import yaml
from charmhelpers.core import hookenv
from charmhe... | 34.993151 | 79 | 0.569257 |
781186b8f92c86cf2380b38fd811cd1d7e064dd4 | 1,552 | py | Python | setup.py | jackypheno/wilson | 81c905c7c1e4cf26b5d5a1a2b7b316f1f4f9d285 | [
"MIT"
] | 24 | 2018-04-16T15:01:39.000Z | 2022-01-26T07:16:22.000Z | setup.py | jackypheno/wilson | 81c905c7c1e4cf26b5d5a1a2b7b316f1f4f9d285 | [
"MIT"
] | 85 | 2018-04-27T08:17:00.000Z | 2022-02-22T16:47:14.000Z | setup.py | jackypheno/wilson | 81c905c7c1e4cf26b5d5a1a2b7b316f1f4f9d285 | [
"MIT"
] | 17 | 2018-04-27T07:59:35.000Z | 2022-02-09T22:46:05.000Z | from setuptools import find_packages, setup
with open("wilson/_version.py") as f:
exec(f.read())
with open("README.md", encoding="utf-8") as f:
LONG_DESCRIPTION = f.read()
setup(
name="wilson",
version=__version__,
author="Jason Aebischer, David M. Straub",
author_email="jason.aebischer@tum.d... | 28.740741 | 81 | 0.559923 |
0f1c989097d858bc1c3d69bc1e294dbb48d102e7 | 968 | py | Python | tests/test_request_object.py | VinceBackpack/asks | 98682ef8ebbc556574054a8c084838cd482edfbc | [
"MIT"
] | null | null | null | tests/test_request_object.py | VinceBackpack/asks | 98682ef8ebbc556574054a8c084838cd482edfbc | [
"MIT"
] | null | null | null | tests/test_request_object.py | VinceBackpack/asks | 98682ef8ebbc556574054a8c084838cd482edfbc | [
"MIT"
] | null | null | null | # pylint: disable=no-member
import h11
from asks.request_object import RequestProcessor
def _catch_response(monkeypatch, headers, data):
req = RequestProcessor(None, 'get', "toot-toot", None)
events = [
h11._events.Response(status_code=200, headers=headers),
h11._events.Data(data=data),
... | 27.657143 | 80 | 0.676653 |
96273fa1d1204173ea8379ee3df79eba16c77498 | 1,559 | py | Python | src/input/DIRReader.py | pkouvaros/venus2_vnncomp21 | 57e9608041d230b5d78c4f2afb890b81035436a1 | [
"BSD-2-Clause"
] | null | null | null | src/input/DIRReader.py | pkouvaros/venus2_vnncomp21 | 57e9608041d230b5d78c4f2afb890b81035436a1 | [
"BSD-2-Clause"
] | null | null | null | src/input/DIRReader.py | pkouvaros/venus2_vnncomp21 | 57e9608041d230b5d78c4f2afb890b81035436a1 | [
"BSD-2-Clause"
] | null | null | null | # ************
# File: DIRReader.py
# Top contributors (to current version):
# Panagiotis Kouvaros (panagiotis.kouvaros@gmail.com)
# This file is part of the Venus project.
# Copyright: 2019-2021 by the authors listed in the AUTHORS file in the
# top-level directory.
# License: BSD 2-Clause (see the file LICENSE in t... | 28.345455 | 79 | 0.601026 |
75be425073dc4cf2800ad27c20de166b6176f9d0 | 1,998 | py | Python | chapter4/process_crawler.py | ianzhengnan/pachong | 7edeff31f0ddb9cb1a3594677c3bf97b57bd7720 | [
"MIT"
] | 1 | 2017-06-20T12:25:35.000Z | 2017-06-20T12:25:35.000Z | chapter4/process_crawler.py | ianzhengnan/pachong | 7edeff31f0ddb9cb1a3594677c3bf97b57bd7720 | [
"MIT"
] | null | null | null | chapter4/process_crawler.py | ianzhengnan/pachong | 7edeff31f0ddb9cb1a3594677c3bf97b57bd7720 | [
"MIT"
] | null | null | null |
import time
import threading
import multiprocessing
from chapter3.downloader import Downloader
from chapter3.mongo_cache import MongoCache
from chapter4.alexa_cb import AlexaCallback
from chapter4.mongo_queue import MongoQueue
SLEEP_TIME = 1
def threaded_crawler(cache=None, max_threads=10):
"""
Crawl this we... | 26.289474 | 89 | 0.635135 |
6762d33ef90379165492427172e4e15271636f2e | 890 | py | Python | test/samples/gtk/gtkstatusbar.py | ABEMBARKA/monoUI | 5fda266ad2db8f89580a40b525973d86cd8de939 | [
"MIT"
] | 1 | 2019-08-13T15:22:12.000Z | 2019-08-13T15:22:12.000Z | test/samples/gtk/gtkstatusbar.py | ABEMBARKA/monoUI | 5fda266ad2db8f89580a40b525973d86cd8de939 | [
"MIT"
] | null | null | null | test/samples/gtk/gtkstatusbar.py | ABEMBARKA/monoUI | 5fda266ad2db8f89580a40b525973d86cd8de939 | [
"MIT"
] | 1 | 2019-08-13T15:22:17.000Z | 2019-08-13T15:22:17.000Z | #!/usr/bin/env python
# example gtkstatusbar.py
import pygtk
pygtk.require('2.0')
import gtk
class Statusbar:
def delete_event(self, widget, event, data=None):
gtk.main_quit()
return False
def __init__(self):
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.set_title... | 21.707317 | 63 | 0.607865 |
ff287f4d89876abf8894a28a0bf50e03a0b0f4bc | 2,404 | py | Python | tests/test_snapshot.py | tonybaloney/fastapi-icontract | 32938977836670b66e2692821aa40f6c3fa9dc26 | [
"MIT"
] | 21 | 2021-02-13T11:45:17.000Z | 2022-03-19T00:07:25.000Z | tests/test_snapshot.py | tonybaloney/fastapi-icontract | 32938977836670b66e2692821aa40f6c3fa9dc26 | [
"MIT"
] | 14 | 2021-03-06T11:19:06.000Z | 2022-01-28T09:58:06.000Z | tests/test_snapshot.py | tonybaloney/fastapi-icontract | 32938977836670b66e2692821aa40f6c3fa9dc26 | [
"MIT"
] | 1 | 2021-06-13T04:34:46.000Z | 2021-06-13T04:34:46.000Z | import unittest
from typing import Optional, Tuple, List, Any
import fastapi
import httpx
import fastapi_icontract
app = fastapi.FastAPI()
@app.post("/passes_snapshot_without_name")
@fastapi_icontract.snapshot(lambda lst: lst[:], name="lst")
@fastapi_icontract.ensure(lambda result, OLD: len(OLD.lst) == result)
asy... | 32.931507 | 80 | 0.695923 |
e0d73211138dcfdb83343f89a14c2e06688c8342 | 2,298 | py | Python | tests/test_embedding.py | koaning/whatlies | f369d57365a6717660f55ecc995b4fd1d1a39cdf | [
"Apache-2.0"
] | 18 | 2022-01-30T08:49:38.000Z | 2022-03-24T14:48:50.000Z | tests/test_embedding.py | koaning/whatlies | f369d57365a6717660f55ecc995b4fd1d1a39cdf | [
"Apache-2.0"
] | 26 | 2022-01-26T19:57:24.000Z | 2022-03-06T18:47:47.000Z | tests/test_embedding.py | koaning/whatlies | f369d57365a6717660f55ecc995b4fd1d1a39cdf | [
"Apache-2.0"
] | 1 | 2022-03-31T10:03:55.000Z | 2022-03-31T10:03:55.000Z | import pytest
import numpy as np
from whatlies import Embedding, EmbeddingSet
@pytest.fixture
def emb():
x = Embedding("x", [0.0, 1.0])
y = Embedding("y", [1.0, 0.0])
z = Embedding("z", [0.5, 0.5])
return EmbeddingSet(x, y, z)
def test_emb_dist(emb):
assert np.isclose(emb["x"].distance(emb["x"]... | 25.820225 | 86 | 0.599217 |
c7da9c0c03ef047384012208977c1ba1657d23a9 | 341 | py | Python | 17_Greedy/Step02/gamjapark.py | StudyForCoding/BEAKJOON | 84e1c5e463255e919ccf6b6a782978c205420dbf | [
"MIT"
] | null | null | null | 17_Greedy/Step02/gamjapark.py | StudyForCoding/BEAKJOON | 84e1c5e463255e919ccf6b6a782978c205420dbf | [
"MIT"
] | 3 | 2020-11-04T05:38:53.000Z | 2021-03-02T02:15:19.000Z | 17_Greedy/Step02/gamjapark.py | StudyForCoding/BEAKJOON | 84e1c5e463255e919ccf6b6a782978c205420dbf | [
"MIT"
] | null | null | null | import sys
N = int(sys.stdin.readline())
time = []
for i in range(N):
(s, f) = map(int, sys.stdin.readline().split())
time.append((s, f))
time = sorted(time, key=lambda x :(x[1], x[0]))
s, f = time[0][0], time[0][1]
count = 1
for i in range(1, N):
(new_s, new_f) = time[i]
if new_s >= f:
count += 1
s, f = new_... | 20.058824 | 48 | 0.580645 |
23b9418685b1ad6b3a47894f2841b76631927686 | 21,869 | py | Python | apphub/image_generation/pggan/pggan_torch.py | Phillistan16/fastestimator | 54c9254098aee89520814ed54b6e6016b821424f | [
"Apache-2.0"
] | null | null | null | apphub/image_generation/pggan/pggan_torch.py | Phillistan16/fastestimator | 54c9254098aee89520814ed54b6e6016b821424f | [
"Apache-2.0"
] | null | null | null | apphub/image_generation/pggan/pggan_torch.py | Phillistan16/fastestimator | 54c9254098aee89520814ed54b6e6016b821424f | [
"Apache-2.0"
] | 1 | 2020-04-28T12:16:10.000Z | 2020-04-28T12:16:10.000Z | #
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under ... | 42.546693 | 120 | 0.631808 |
09098bec23281af47e835daa26b81dccca6d2e2c | 22,972 | py | Python | src/pds_doi_service/core/db/doi_database.py | NASA-PDS/pds-doi-service | b994381a5757700229865e8fe905553559684e0d | [
"Apache-2.0"
] | 2 | 2020-11-03T19:29:11.000Z | 2021-09-26T01:42:41.000Z | src/pds_doi_service/core/db/doi_database.py | NASA-PDS/pds-doi-service | b994381a5757700229865e8fe905553559684e0d | [
"Apache-2.0"
] | 222 | 2020-05-07T21:05:23.000Z | 2021-12-16T22:14:54.000Z | src/pds_doi_service/core/db/doi_database.py | NASA-PDS/pds-doi-service | b994381a5757700229865e8fe905553559684e0d | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2020–21, by the California Institute of Technology. ALL RIGHTS
# RESERVED. United States Government Sponsorship acknowledged. Any commercial
# use must be negotiated with the Office of Technology Transfer at the
# California Institute of Technology.
#
"""
===============
doi_database.py
=============... | 36.176378 | 119 | 0.632596 |
4d17dcc310d6f9f87fc030b1995589f24ce3d64f | 12,655 | py | Python | Overboard AI.py | brandonesford/Overboard-AI | 234a26d55a585fe8f8f8577ba83260439f74a0b9 | [
"MIT"
] | null | null | null | Overboard AI.py | brandonesford/Overboard-AI | 234a26d55a585fe8f8f8577ba83260439f74a0b9 | [
"MIT"
] | null | null | null | Overboard AI.py | brandonesford/Overboard-AI | 234a26d55a585fe8f8f8577ba83260439f74a0b9 | [
"MIT"
] | null | null | null | import copy
import sys
import random
import numpy as np
inf = float('inf')
directions = ('left', 'right', 'down', 'up')
p1_init_peices = 18
p2_init_peices = 18
difficulty = 4
# 1 is B, 2 is R, 0 is empty
init_board = np.array([[1, 1, 2, 1, 1, 2],
[2, 2, 1, 1, 1, 2],
[2, ... | 33.302632 | 87 | 0.528408 |
12f9f48ffb935d6e8abc64888792aa3dfbb01329 | 3,081 | py | Python | enas_lm/src/tpu/data_utils.py | yick2232/google-research | 99021ebda945e232abdcc592f2cea1375b3c84f7 | [
"Apache-2.0"
] | 11 | 2020-01-29T07:25:04.000Z | 2022-03-05T16:01:21.000Z | enas_lm/src/tpu/data_utils.py | RubensZimbres/google-research | 562c7c6ef959cb3cb382b1b660ccc45e8f5289c4 | [
"Apache-2.0"
] | 13 | 2020-01-28T22:19:53.000Z | 2022-02-10T00:39:26.000Z | enas_lm/src/tpu/data_utils.py | RubensZimbres/google-research | 562c7c6ef959cb3cb382b1b660ccc45e8f5289c4 | [
"Apache-2.0"
] | 2 | 2020-02-27T11:09:49.000Z | 2021-08-25T07:32:15.000Z | # coding=utf-8
# Copyright 2019 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 36.678571 | 79 | 0.697825 |
0bfa2ea9e1f4c377d81fe24437bceac11b0e7f23 | 2,630 | py | Python | userbot/modules/createstickers.py | bryanasfuk/Baphomet | bf3c3d9589511534ad848b3aa0b59e3d6b113282 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 16 | 2021-03-26T15:39:48.000Z | 2021-12-15T07:27:25.000Z | userbot/modules/createstickers.py | bryanasfuk/Baphomet | bf3c3d9589511534ad848b3aa0b59e3d6b113282 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 2 | 2021-04-23T06:45:58.000Z | 2021-07-05T11:48:45.000Z | userbot/modules/createstickers.py | bryanasfuk/Baphomet | bf3c3d9589511534ad848b3aa0b59e3d6b113282 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 111 | 2021-02-20T16:18:48.000Z | 2022-03-28T22:17:29.000Z | # Random RGB Sticklet by @PhycoNinja13b
# modified by @UniBorg
# ported to userbot by @heyworld & thanks to @Xcruzhd2 for Fonts
import io
import os
import random
import textwrap
from PIL import Image, ImageDraw, ImageFont
from telethon.tl.types import InputMessagesFilterDocument
from userbot.events import register
... | 29.550562 | 101 | 0.674905 |
dd3e19e126434a2fe88454e1148bc93e44767b5c | 1,048 | py | Python | 2015/day19/day19.py | Time0o/advent-of-code | fa4ef67e690cb134ea1bbbb5a350f4f53c0fb73a | [
"MIT"
] | null | null | null | 2015/day19/day19.py | Time0o/advent-of-code | fa4ef67e690cb134ea1bbbb5a350f4f53c0fb73a | [
"MIT"
] | null | null | null | 2015/day19/day19.py | Time0o/advent-of-code | fa4ef67e690cb134ea1bbbb5a350f4f53c0fb73a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
from typing import List, Tuple
def count_modifications(molecule: str,
replacements: List[Tuple[str, str]]) -> int:
modifications = set()
for source, target in replacements:
i = 0
while i < len(molecule):
try:
... | 24.952381 | 74 | 0.545802 |
7598ca1a2d096b0ed7d25b0f081b9436b5840174 | 2,859 | py | Python | byceps/services/news/channel_service.py | GSH-LAN/byceps | ab8918634e90aaa8574bd1bb85627759cef122fe | [
"BSD-3-Clause"
] | 33 | 2018-01-16T02:04:51.000Z | 2022-03-22T22:57:29.000Z | byceps/services/news/channel_service.py | GSH-LAN/byceps | ab8918634e90aaa8574bd1bb85627759cef122fe | [
"BSD-3-Clause"
] | 7 | 2019-06-16T22:02:03.000Z | 2021-10-02T13:45:31.000Z | byceps/services/news/channel_service.py | GSH-LAN/byceps | ab8918634e90aaa8574bd1bb85627759cef122fe | [
"BSD-3-Clause"
] | 14 | 2019-06-01T21:39:24.000Z | 2022-03-14T17:56:43.000Z | """
byceps.services.news.channel_service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2021 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from __future__ import annotations
from typing import Optional, Sequence
from ...database import db
from ...typing import BrandID
from .... | 26.229358 | 67 | 0.691501 |
2978beac08e44c869fe272daef8175ce95b3bb48 | 15,542 | py | Python | train.py | minhpqn/transfer-learning-conv-ai | b04cc2a851528811516641b9f4cfd6de2a194b94 | [
"MIT"
] | null | null | null | train.py | minhpqn/transfer-learning-conv-ai | b04cc2a851528811516641b9f4cfd6de2a194b94 | [
"MIT"
] | null | null | null | train.py | minhpqn/transfer-learning-conv-ai | b04cc2a851528811516641b9f4cfd6de2a194b94 | [
"MIT"
] | 1 | 2021-10-02T16:54:03.000Z | 2021-10-02T16:54:03.000Z | # Copyright (c) 2019-present, HuggingFace Inc.
# All rights reserved. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree.
import os
import math
import logging
from pprint import pformat
from argparse import ArgumentParser
from collections import ... | 61.920319 | 182 | 0.715738 |
478725d8b9d6501f80de8d124f8bbbe163788786 | 2,166 | py | Python | cmsplugin_gallery/utils.py | samirasnoun/django_cms_gallery_image | 7792aa06a60877d86c022e73b60d0d669e79cb74 | [
"BSD-3-Clause"
] | 2 | 2021-01-12T12:41:12.000Z | 2021-08-20T03:36:24.000Z | cmsplugin_gallery/utils.py | samirasnoun/django_cms_gallery_image | 7792aa06a60877d86c022e73b60d0d669e79cb74 | [
"BSD-3-Clause"
] | 3 | 2020-05-29T18:09:18.000Z | 2021-06-16T11:02:08.000Z | cmsplugin_gallery/utils.py | samirasnoun/django_cms_gallery_image | 7792aa06a60877d86c022e73b60d0d669e79cb74 | [
"BSD-3-Clause"
] | 2 | 2021-02-07T18:21:04.000Z | 2021-04-17T21:49:15.000Z | import glob
import os
import threading
from django.conf import settings
localdata = threading.local()
localdata.TEMPLATES = tuple()
TEMPLATES = localdata.TEMPLATES
def autodiscover_templates():
'''
Autodiscovers cmsplugin_gallery templates the way
'django.template.loaders.filesystem.Loader' and
'dja... | 31.391304 | 85 | 0.631579 |
cf073ebc6829599c8301d25e968529636c6f83c4 | 21,095 | py | Python | phono3py/cui/phono3py_argparse.py | mhuels/phono3py | d19abc654c29d06b88d06cda50ed8dba4450d336 | [
"BSD-3-Clause"
] | null | null | null | phono3py/cui/phono3py_argparse.py | mhuels/phono3py | d19abc654c29d06b88d06cda50ed8dba4450d336 | [
"BSD-3-Clause"
] | null | null | null | phono3py/cui/phono3py_argparse.py | mhuels/phono3py | d19abc654c29d06b88d06cda50ed8dba4450d336 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (C) 2015 Atsushi Togo
# All rights reserved.
#
# This file is part of phonopy.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notic... | 45.26824 | 79 | 0.597677 |
46700fb6cc510db9aee0e876c8bdcea731839269 | 2,660 | py | Python | toscaparser/artifacts.py | onecommons/tosca-parser | 72642bc7b9e0c0ffddcc0d750d791fc70a02b02f | [
"Apache-2.0"
] | 1 | 2021-11-30T14:45:27.000Z | 2021-11-30T14:45:27.000Z | toscaparser/artifacts.py | onecommons/tosca-parser | 72642bc7b9e0c0ffddcc0d750d791fc70a02b02f | [
"Apache-2.0"
] | null | null | null | toscaparser/artifacts.py | onecommons/tosca-parser | 72642bc7b9e0c0ffddcc0d750d791fc70a02b02f | [
"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
# d... | 31.294118 | 83 | 0.67782 |
c247f569fc402626cfc0d35822276a1be5ad883f | 781 | py | Python | mysite/pages/migrations/0011_workshopdescriptionplugin.py | raccoongang/socraticqs2 | 06201005136ee139846f857dbb2f518736e441de | [
"Apache-2.0"
] | 3 | 2015-11-20T07:33:28.000Z | 2017-01-15T23:33:50.000Z | mysite/pages/migrations/0011_workshopdescriptionplugin.py | raccoongang/socraticqs2 | 06201005136ee139846f857dbb2f518736e441de | [
"Apache-2.0"
] | 28 | 2015-07-14T11:33:24.000Z | 2017-11-17T15:21:22.000Z | mysite/pages/migrations/0011_workshopdescriptionplugin.py | raccoongang/socraticqs2 | 06201005136ee139846f857dbb2f518736e441de | [
"Apache-2.0"
] | 4 | 2015-04-29T09:04:59.000Z | 2017-07-19T14:11:16.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cms', '0012_auto_20150607_2207'),
('pages', '0010_childpersonalguidesplugin_parentpersonalguidesplugin'),
]
operations = [
... | 28.925926 | 148 | 0.59283 |
70c03e4459745516f1e7d00ba8de3ac29471c891 | 646 | py | Python | mayan/apps/appearance/admin.py | PetchyZ/Mayan-EDMS | 8448b08048b68a2c7c168ad0fb3a5e5bda9d560d | [
"Apache-2.0"
] | 2 | 2022-02-22T05:30:11.000Z | 2022-03-08T03:55:14.000Z | mayan/apps/appearance/admin.py | PetchyZ/Mayan-EDMS | 8448b08048b68a2c7c168ad0fb3a5e5bda9d560d | [
"Apache-2.0"
] | null | null | null | mayan/apps/appearance/admin.py | PetchyZ/Mayan-EDMS | 8448b08048b68a2c7c168ad0fb3a5e5bda9d560d | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from .models import Theme, UserThemeSetting ,CurrentTheme #add CurrentTheme model
@admin.register(Theme)
class ThemeAdmin(admin.ModelAdmin):
list_display = ('label',)
search_fields = ('label',)
@admin.register(UserThemeSetting)
class UserThemeSettingAdmin(admin.ModelAdmin):... | 25.84 | 81 | 0.721362 |
10ff42a41e7f67fedb44e95c62e8c28f9a93a8ea | 1,709 | py | Python | ebttools/gui/__init__.py | mgotz/EBT_evaluation | ec39845b61dc599850fb19915c0f1365ac521e9b | [
"MIT"
] | null | null | null | ebttools/gui/__init__.py | mgotz/EBT_evaluation | ec39845b61dc599850fb19915c0f1365ac521e9b | [
"MIT"
] | null | null | null | ebttools/gui/__init__.py | mgotz/EBT_evaluation | ec39845b61dc599850fb19915c0f1365ac521e9b | [
"MIT"
] | null | null | null | import os
import warnings
defaultAPI = 'pyqt'
#ensure API v2 for pyqt (native python data types) pyqt5 only offers this API
#hopefully setting it for PyQt5 does not cause errors
import sip
RequiredAPINames = ("QVariant","QString") #those I definitly use
OptionalAPINames = ("QDate", "QDateTime", "QTextStream"... | 31.072727 | 101 | 0.709772 |
e5424e8a6e615820b4a1a5f2ee7e7e87dd0b22af | 1,597 | py | Python | python/paddle/fluid/tests/unittests/ngraph/test_conv2d_ngraph_op.py | hshen14/Paddle | 0962be9c800d29e0804fc3135163bdfba1564c61 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/ngraph/test_conv2d_ngraph_op.py | hshen14/Paddle | 0962be9c800d29e0804fc3135163bdfba1564c61 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/ngraph/test_conv2d_ngraph_op.py | hshen14/Paddle | 0962be9c800d29e0804fc3135163bdfba1564c61 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018 PaddlePaddle Authors. 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 appli... | 30.132075 | 74 | 0.767063 |
a35604a86dd5e5fc685a324d6e9787268f3504ea | 69,742 | py | Python | jenkins_jobs/modules/triggers.py | theforeman/jenkins-job-builder | 0ba5c0a1652363b12cd2eedf818beb882984b7ca | [
"Apache-2.0"
] | 1 | 2015-12-01T03:24:43.000Z | 2015-12-01T03:24:43.000Z | jenkins_jobs/modules/triggers.py | theforeman/jenkins-job-builder | 0ba5c0a1652363b12cd2eedf818beb882984b7ca | [
"Apache-2.0"
] | 3 | 2016-03-15T16:04:44.000Z | 2018-02-27T10:38:24.000Z | jenkins_jobs/modules/triggers.py | theforeman/jenkins-job-builder | 0ba5c0a1652363b12cd2eedf818beb882984b7ca | [
"Apache-2.0"
] | 1 | 2016-03-15T16:02:38.000Z | 2016-03-15T16:02:38.000Z | # Copyright 2012 Hewlett-Packard Development Company, L.P.
#
# 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... | 44.168461 | 91 | 0.598434 |
215a313dade997a55d21c1716474bcc7df6195d7 | 1,062 | py | Python | pytg2/result_parser.py | luckydonald/pytg2 | 69812948cd8b98c43cc10e5269f0df5531c0b354 | [
"MIT"
] | 6 | 2015-03-23T17:37:48.000Z | 2017-02-26T04:59:31.000Z | pytg2/result_parser.py | luckydonald/pytg2 | 69812948cd8b98c43cc10e5269f0df5531c0b354 | [
"MIT"
] | 1 | 2015-05-16T16:24:19.000Z | 2015-05-17T16:39:04.000Z | pytg2/result_parser.py | luckydonald/pytg2 | 69812948cd8b98c43cc10e5269f0df5531c0b354 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
__author__ = 'luckydonald'
from .encoding import to_unicode as u
from .encoding import to_native as n
from .exceptions import IllegalResponseException, NoResponse
import logging
logger = logging.getLogger(__name__)
def raw(value):
return value
def nothing(value):
if value:
raise Illegal... | 25.285714 | 90 | 0.749529 |
2ab69fcf70db86948c5996054c4e6d4cd5af551f | 554 | py | Python | sailor/assetcentral/constants.py | SAP/project-sailor | 26dea330e1ebae4c1f680970c253df9f2fbc9e72 | [
"MIT",
"BSD-2-Clause",
"Apache-2.0"
] | 19 | 2021-03-02T12:27:48.000Z | 2022-03-31T15:24:41.000Z | sailor/assetcentral/constants.py | SAP/project-sailor | 26dea330e1ebae4c1f680970c253df9f2fbc9e72 | [
"MIT",
"BSD-2-Clause",
"Apache-2.0"
] | 75 | 2021-03-04T16:58:47.000Z | 2022-03-31T08:31:06.000Z | sailor/assetcentral/constants.py | SAP/project-sailor | 26dea330e1ebae4c1f680970c253df9f2fbc9e72 | [
"MIT",
"BSD-2-Clause",
"Apache-2.0"
] | 2 | 2021-11-08T12:45:05.000Z | 2022-02-27T18:42:13.000Z | """Please store all the constants here."""
VIEW_MODELS = '/services/api/v1/models'
VIEW_EQUIPMENT = '/services/api/v1/equipment'
VIEW_FUNCTIONAL_LOCATIONS = '/services/api/v1/floc'
VIEW_NOTIFICATIONS = '/services/api/v1/notification'
VIEW_OBJECTS = '/services/api/v1/objects/'
VIEW_MODEL_INDICATORS = '/services/api/v1/... | 39.571429 | 52 | 0.774368 |
f9037396a5f2d7d456ffa357b19670f445fd5a25 | 1,331 | py | Python | Assignment 5/T49_CSE3_TAMAL BAG _PracticeProblem2.py | tamalbag117/PCC-CS393 | 1c11f0e03ba6a138e57900f458d094f2d6654c0a | [
"MIT"
] | null | null | null | Assignment 5/T49_CSE3_TAMAL BAG _PracticeProblem2.py | tamalbag117/PCC-CS393 | 1c11f0e03ba6a138e57900f458d094f2d6654c0a | [
"MIT"
] | null | null | null | Assignment 5/T49_CSE3_TAMAL BAG _PracticeProblem2.py | tamalbag117/PCC-CS393 | 1c11f0e03ba6a138e57900f458d094f2d6654c0a | [
"MIT"
] | null | null | null | # Question 1:
# code
def starValue(arr, n):
star = 0
for i in arr:
star = star + 1 if (i % n == 0) else star
return star
def getStarValues(arr):
star_values = [starValue(arr[0:i], v) for i, v in enumerate(arr)]
for a, b in zip(arr, star_values):
print(f"Star va... | 19.865672 | 89 | 0.602554 |
2ea84ac6cb57f8d85b083349f3ba4826b120d61a | 3,671 | py | Python | demos/gensim_lda_use_model.py | mikedelong/aarhus | 0c0e94fadd65be8428fe3bd2c92928e1b23fc2a1 | [
"Apache-2.0"
] | null | null | null | demos/gensim_lda_use_model.py | mikedelong/aarhus | 0c0e94fadd65be8428fe3bd2c92928e1b23fc2a1 | [
"Apache-2.0"
] | 7 | 2017-01-13T19:04:57.000Z | 2017-01-23T14:10:53.000Z | demos/gensim_lda_use_model.py | mikedelong/aarhus | 0c0e94fadd65be8428fe3bd2c92928e1b23fc2a1 | [
"Apache-2.0"
] | null | null | null | import json
import logging
import os
import random
import re
import string
import nltk
from gensim import corpora
from gensim import utils
from nltk.stem.snowball import SnowballStemmer
logging.basicConfig(format='%(asctime)s : %(levelname)s :: %(message)s', level=logging.DEBUG)
stemmer = SnowballStemmer("english")
... | 37.845361 | 120 | 0.728684 |
22944007091435b718571e0c89fe7d59f82de2ab | 5,301 | py | Python | examples/abod_example.py | lallouslab/Pyod | e20a45f2982b2ee66dad63824264d05b3cb21511 | [
"BSD-2-Clause"
] | 2 | 2020-11-04T13:45:17.000Z | 2021-08-06T02:03:51.000Z | examples/abod_example.py | LiDan456/Pyod | 1bee06200c5e8c86977bbdec896b624af2c2e05a | [
"BSD-2-Clause"
] | null | null | null | examples/abod_example.py | LiDan456/Pyod | 1bee06200c5e8c86977bbdec896b624af2c2e05a | [
"BSD-2-Clause"
] | 1 | 2021-01-23T17:21:17.000Z | 2021-01-23T17:21:17.000Z | # -*- coding: utf-8 -*-
"""Example of using Angle-base outlier detection (ABOD) for outlier detection
"""
# Author: Yue Zhao <yuezhao@cs.toronto.edu>
# License: BSD 2 clause
from __future__ import division
from __future__ import print_function
import os
import sys
# temporary solution for relative imports in case py... | 36.308219 | 79 | 0.666101 |
03a977808be67e90cb875e4760c3f730aa4f9084 | 3,520 | py | Python | apiserver/feeds/sitemap.py | jason-s13r/qotnews | 387c6fe64b8943d1b85296979826ed184948edeb | [
"MIT"
] | 2 | 2021-04-29T05:44:23.000Z | 2021-08-29T13:57:21.000Z | apiserver/feeds/sitemap.py | master5o1/qotnews | 2f4db8833b7e06584eed4705929cbaee7b060c5d | [
"MIT"
] | null | null | null | apiserver/feeds/sitemap.py | master5o1/qotnews | 2f4db8833b7e06584eed4705929cbaee7b060c5d | [
"MIT"
] | null | null | null | import logging
logging.basicConfig(
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level=logging.DEBUG)
if __name__ == '__main__':
import sys
sys.path.insert(0,'.')
from datetime import datetime
from bs4 import BeautifulSoup
import settings
from utils import clean
from misc.ti... | 34.174757 | 106 | 0.635795 |
207d6dd872664c766390a3a553ffb3c014a4af68 | 685 | py | Python | run.py | mseemann-tgm/flask-vue-spa | 5f82b54876d87228f6914c5ba9c5f20526317cc5 | [
"MIT"
] | null | null | null | run.py | mseemann-tgm/flask-vue-spa | 5f82b54876d87228f6914c5ba9c5f20526317cc5 | [
"MIT"
] | null | null | null | run.py | mseemann-tgm/flask-vue-spa | 5f82b54876d87228f6914c5ba9c5f20526317cc5 | [
"MIT"
] | null | null | null | from flask import Flask, render_template, jsonify
from random import *
from flask_cors import CORS
import requests
app = Flask(__name__,
static_folder = "./dist/static",
template_folder = "./dist")
cors = CORS(app, resources={r"/api/*": {"origins": "*"}})
@app.route('/api/random')
def random_n... | 24.464286 | 73 | 0.633577 |
3c1545256c3535c43c101757bafc3e5d4110361e | 9,436 | py | Python | fflib/common/table.py | BigSmitty72/FFballPython | 8dd15d2753ce9df59b6e4393629eb065f8e5e304 | [
"BSD-3-Clause"
] | 44 | 2015-08-17T02:46:43.000Z | 2018-09-06T17:38:49.000Z | fflib/common/table.py | twbarber/espnff | 35f328aaad2cdf331a5bd5bd5c1cc70a50e525b1 | [
"BSD-3-Clause"
] | 2 | 2015-09-12T18:27:39.000Z | 2016-08-27T17:11:43.000Z | fflib/common/table.py | twbarber/espnff | 35f328aaad2cdf331a5bd5bd5c1cc70a50e525b1 | [
"BSD-3-Clause"
] | 9 | 2015-09-09T22:16:52.000Z | 2017-06-30T00:16:11.000Z | import re
class Table(object):
def __init__(self, title, columns):
self.title = title
self.columns = columns
self.rows = []
def add_row(self, values):
self.rows.append(values)
class StandingsTable(Table):
def __init__(self, html):
parsed_html = self.parse_html(... | 29.579937 | 109 | 0.503603 |
6a35f6cf2e8797dc9c05aa342eb8b29a64170410 | 1,960 | py | Python | pyleecan/Methods/Slot/HoleM54/build_geometry.py | tobsen2code/pyleecan | 5b1ded9e389e0c79ed7b7c878b6e939f2d9962e9 | [
"Apache-2.0"
] | 95 | 2019-01-23T04:19:45.000Z | 2022-03-17T18:22:10.000Z | pyleecan/Methods/Slot/HoleM54/build_geometry.py | mjfwest/pyleecan | 6946c863bea62d13f100def2d3f905c9de8721d0 | [
"Apache-2.0"
] | 366 | 2019-02-20T07:15:08.000Z | 2022-03-31T13:37:23.000Z | pyleecan/Methods/Slot/HoleM54/build_geometry.py | mjfwest/pyleecan | 6946c863bea62d13f100def2d3f905c9de8721d0 | [
"Apache-2.0"
] | 74 | 2019-01-24T01:47:31.000Z | 2022-02-25T05:44:42.000Z | # -*- coding: utf-8 -*-
from numpy import pi, exp
from ....Classes.Arc1 import Arc1
from ....Classes.Arc3 import Arc3
from ....Classes.Segment import Segment
from ....Classes.SurfLine import SurfLine
from ....Functions.Geometry.inter_line_circle import inter_line_circle
from ....Functions.labels import HOLEV_LAB, HOL... | 29.253731 | 88 | 0.661224 |
18cd4c8e0d4a356d887da91ecd6ea6f23ee4f3b4 | 1,100 | py | Python | mchap/application/cli.py | PlantandFoodResearch/MCHap | ea25c3af889275d742e64e722ceeed0f7201f690 | [
"MIT"
] | 9 | 2022-01-14T18:27:47.000Z | 2022-01-31T09:22:22.000Z | mchap/application/cli.py | PlantandFoodResearch/MCHap | ea25c3af889275d742e64e722ceeed0f7201f690 | [
"MIT"
] | 12 | 2022-01-13T21:21:08.000Z | 2022-03-13T04:31:31.000Z | mchap/application/cli.py | PlantandFoodResearch/MCHap | ea25c3af889275d742e64e722ceeed0f7201f690 | [
"MIT"
] | null | null | null | import sys
import argparse
from mchap.application import assemble
from mchap.application import call
from mchap.application import call_exact
from mchap.application import pedigraph
def main():
parser = argparse.ArgumentParser(
"Bayesian assemby of micro-haplotypes in polyploids"
)
subprograms =... | 28.205128 | 75 | 0.604545 |
dbf6e1b8fc06a21dae46f32a940bfc77d4fbd6e6 | 6,915 | py | Python | components/server/src/routes/auth.py | m-zakeri/quality-time | 531931f0d8d4f5d262ea98445868158e41d268da | [
"Apache-2.0"
] | null | null | null | components/server/src/routes/auth.py | m-zakeri/quality-time | 531931f0d8d4f5d262ea98445868158e41d268da | [
"Apache-2.0"
] | null | null | null | components/server/src/routes/auth.py | m-zakeri/quality-time | 531931f0d8d4f5d262ea98445868158e41d268da | [
"Apache-2.0"
] | null | null | null | """Login/logout."""
import base64
import hashlib
import logging
import os
import re
import string
from datetime import datetime, timedelta, timezone
from http.cookies import Morsel
from typing import Union, cast
import bottle
from ldap3 import ALL, Connection, Server
from ldap3.core import exceptions
from pymongo.dat... | 47.363014 | 120 | 0.722198 |
227ea55e23405ec6e0c1a5ff634b10cc64ade329 | 8,574 | py | Python | logrotate/skel/usr/lib/python2.7/ensurepip/__init__.py | sroettger/35c3ctf_chals | 3d64486e6adddb3a3f3d2c041242b88b50abdb8d | [
"Apache-2.0"
] | 15 | 2019-07-10T16:50:17.000Z | 2022-01-23T14:28:17.000Z | logrotate/skel/usr/lib/python2.7/ensurepip/__init__.py | sroettger/35c3ctf_chals | 3d64486e6adddb3a3f3d2c041242b88b50abdb8d | [
"Apache-2.0"
] | 2 | 2020-01-18T11:19:04.000Z | 2021-04-27T13:30:33.000Z | logrotate/skel/usr/lib/python2.7/ensurepip/__init__.py | sroettger/35c3ctf_chals | 3d64486e6adddb3a3f3d2c041242b88b50abdb8d | [
"Apache-2.0"
] | 4 | 2020-01-09T20:14:30.000Z | 2021-04-23T07:47:27.000Z | #! /usr/bin/python2.7
from __future__ import print_function
import glob
import os
import os.path
import pkgutil
import shutil
import sys
import tempfile
__all__ = ["version", "bootstrap"]
def _ensurepip_is_disabled_in_debian():
if True:
print ('''\
ensurepip is disabled in Debian/Ubuntu for the system p... | 33.232558 | 157 | 0.627129 |
31d136f714e7d53323e15e4c7aff949d7953ca2a | 50,626 | py | Python | include/wxPython/wx/lib/agw/ribbon/buttonbar.py | SWEN-712/screen-reader-brandonp728 | e30c25ad2d10ce632fac0548696a61a872328f59 | [
"bzip2-1.0.6"
] | 3 | 2019-10-06T15:39:39.000Z | 2020-09-29T23:51:50.000Z | include/wxPython/wx/lib/agw/ribbon/buttonbar.py | SWEN-712/screen-reader-brandonp728 | e30c25ad2d10ce632fac0548696a61a872328f59 | [
"bzip2-1.0.6"
] | 9 | 2021-03-18T23:10:27.000Z | 2022-03-11T23:43:55.000Z | include/wxPython/wx/lib/agw/ribbon/buttonbar.py | SWEN-712/screen-reader-brandonp728 | e30c25ad2d10ce632fac0548696a61a872328f59 | [
"bzip2-1.0.6"
] | 2 | 2019-03-11T05:06:49.000Z | 2019-03-22T21:48:49.000Z | # -*- coding: utf-8 -*-
#----------------------------------------------------------------------------
# Name: buttonbar.py
# Purpose:
#
# Author: Andrea Gavana <andrea.gavana@gmail.com>
#
# Created:
# Version:
# Date:
# Licence: wxWindows license
# Tags: phoenix-port, unittest, documented, py... | 38.064662 | 320 | 0.622427 |
e6af611cc8aadbdfb9ee9125248b28e9cd65a5d5 | 9,907 | py | Python | yarnspawner/spawner.py | georgepachitariu/yarnspawner | e83e31686e15b81ddef2209cc8a20f9b5197c026 | [
"BSD-3-Clause"
] | null | null | null | yarnspawner/spawner.py | georgepachitariu/yarnspawner | e83e31686e15b81ddef2209cc8a20f9b5197c026 | [
"BSD-3-Clause"
] | null | null | null | yarnspawner/spawner.py | georgepachitariu/yarnspawner | e83e31686e15b81ddef2209cc8a20f9b5197c026 | [
"BSD-3-Clause"
] | null | null | null | import skein
from jupyterhub.spawner import Spawner
from jupyterhub.traitlets import Command, ByteSpecification
from traitlets import Unicode, Dict, Integer, List
from tornado import gen
_STOPPED_STATES = {'FAILED', 'KILLED', 'FINISHED'}
class YarnSpawner(Spawner):
"""A spawner for starting singleuser instances... | 31.450794 | 107 | 0.5484 |
48999979805e813a428855695c6c9b9f90ca82af | 1,180 | py | Python | kdotp_generator/_to_matrix.py | yjiang-iop/kdotp-generator | 51a0c19e95ff5536a9d0cc031953952055373d05 | [
"Apache-2.0"
] | 1 | 2021-12-17T02:09:31.000Z | 2021-12-17T02:09:31.000Z | kdotp_generator/_to_matrix.py | yjiang-iop/kdotp-generator | 51a0c19e95ff5536a9d0cc031953952055373d05 | [
"Apache-2.0"
] | null | null | null | kdotp_generator/_to_matrix.py | yjiang-iop/kdotp-generator | 51a0c19e95ff5536a9d0cc031953952055373d05 | [
"Apache-2.0"
] | null | null | null | # Adapted from the kdotp-symmetry package by: Dominik Gresch <greschd@gmx.ch> © 2017-2018, ETH Zurich, Institut für Theoretische Physik
"""
Defines a function to convert an operator into matrix form.
"""
import types
import sympy as sp
def to_matrix(
*,
operator,
basis,
to_vector_fct,
K_VEC = No... | 28.780488 | 136 | 0.667797 |
98118bd4a91fb4accb8adeaa0ccb54457db42ec6 | 3,557 | py | Python | stonesoup/hypothesiser/distance.py | Isaac-JenkinsRA/Stone-Soup | 54c9c7dca8162dadaa58e85933cf10a0f86ce1e1 | [
"MIT"
] | null | null | null | stonesoup/hypothesiser/distance.py | Isaac-JenkinsRA/Stone-Soup | 54c9c7dca8162dadaa58e85933cf10a0f86ce1e1 | [
"MIT"
] | null | null | null | stonesoup/hypothesiser/distance.py | Isaac-JenkinsRA/Stone-Soup | 54c9c7dca8162dadaa58e85933cf10a0f86ce1e1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from .base import Hypothesiser
from ..base import Property
from ..measures import Measure
from ..predictor import Predictor
from ..types.detection import MissedDetection
from ..types.hypothesis import SingleDistanceHypothesis
from ..types.multihypothesis import MultipleHypothesis
from ..updater ... | 39.087912 | 93 | 0.649424 |
eb72f453c63c5016beb33a7d36a85680f82b6f05 | 1,769 | py | Python | cccatalog-api/cccatalog/api/serializers/oauth2_serializers.py | soffieswan044/cccatalog-api | 61d599c2cd2b792f914635ad90347f188e8ea0db | [
"MIT"
] | 122 | 2018-09-12T13:49:37.000Z | 2021-12-05T07:04:59.000Z | cccatalog-api/cccatalog/api/serializers/oauth2_serializers.py | soffieswan044/cccatalog-api | 61d599c2cd2b792f914635ad90347f188e8ea0db | [
"MIT"
] | 500 | 2018-04-30T15:26:43.000Z | 2021-06-07T16:28:44.000Z | cccatalog-api/cccatalog/api/serializers/oauth2_serializers.py | krysal/cccatalog-api | 2cc7e4bb4c10c457cd078f415334fbb1a6720eca | [
"MIT"
] | 144 | 2018-08-11T17:11:50.000Z | 2022-01-12T20:39:09.000Z | from rest_framework import serializers
from cccatalog.api.models import OAuth2Registration
from oauth2_provider.models import Application
class OAuth2RegistrationSerializer(serializers.ModelSerializer):
class Meta:
model = OAuth2Registration
fields = ('name', 'description', 'email')
class OAuth2... | 36.854167 | 79 | 0.663652 |
0d5436b128521a65384253427d63166cfb8700b1 | 8,987 | py | Python | ansys/dpf/core/operators/min_max/min_max_inc.py | jfthuong/pydpf-core | bf2895ebc546e0004f759289bfc9a23196559ac3 | [
"MIT"
] | 18 | 2021-10-16T10:38:29.000Z | 2022-03-29T11:26:42.000Z | ansys/dpf/core/operators/min_max/min_max_inc.py | jfthuong/pydpf-core | bf2895ebc546e0004f759289bfc9a23196559ac3 | [
"MIT"
] | 79 | 2021-10-11T23:18:54.000Z | 2022-03-29T14:53:14.000Z | ansys/dpf/core/operators/min_max/min_max_inc.py | jfthuong/pydpf-core | bf2895ebc546e0004f759289bfc9a23196559ac3 | [
"MIT"
] | 5 | 2021-11-29T18:35:37.000Z | 2022-03-16T16:49:21.000Z | """
min_max_inc
===============
Autogenerated DPF operator classes.
"""
from warnings import warn
from ansys.dpf.core.dpf_operator import Operator
from ansys.dpf.core.inputs import Input, _Inputs
from ansys.dpf.core.outputs import Output, _Outputs
from ansys.dpf.core.operators.specification import PinSpecification, Spe... | 30.464407 | 92 | 0.559809 |
1c7e4000b564f1b5437620c3f9e4960989728877 | 29,067 | py | Python | examples/conll2003_example/run_ner.py | fangd123/TextBrewer | 866f4363d9bd964f00aa60b0db5e9252a7905448 | [
"Apache-2.0"
] | 1,121 | 2020-03-02T02:24:00.000Z | 2022-03-31T06:33:49.000Z | examples/conll2003_example/run_ner.py | fangd123/TextBrewer | 866f4363d9bd964f00aa60b0db5e9252a7905448 | [
"Apache-2.0"
] | 85 | 2020-03-04T09:46:17.000Z | 2022-03-30T09:33:35.000Z | examples/conll2003_example/run_ner.py | fangd123/TextBrewer | 866f4363d9bd964f00aa60b0db5e9252a7905448 | [
"Apache-2.0"
] | 200 | 2020-03-02T07:23:21.000Z | 2022-03-30T08:26:24.000Z | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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 cop... | 54.432584 | 184 | 0.644098 |
40d2ba1ba9f37b5e15688bdd9ac72d8984aa2fd2 | 3,880 | py | Python | sdk/python/pulumi_aws/get_autoscaling_groups.py | sibuthomasmathew/pulumi-aws | 6351f2182eb6f693d4e09e4136c385adfa0ab674 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/get_autoscaling_groups.py | sibuthomasmathew/pulumi-aws | 6351f2182eb6f693d4e09e4136c385adfa0ab674 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/get_autoscaling_groups.py | sibuthomasmathew/pulumi-aws | 6351f2182eb6f693d4e09e4136c385adfa0ab674 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from . import _utilities... | 36.952381 | 222 | 0.677835 |
dbb8530e8be03ef9451910a440cce77af5010abd | 17,414 | py | Python | src/snowflake/connector/telemetry_oob.py | corford/snowflake-connector-python | 6cec12333927ac4f85bc0c9317dde7baf7097364 | [
"Apache-2.0"
] | 1 | 2021-08-06T07:21:09.000Z | 2021-08-06T07:21:09.000Z | src/snowflake/connector/telemetry_oob.py | corford/snowflake-connector-python | 6cec12333927ac4f85bc0c9317dde7baf7097364 | [
"Apache-2.0"
] | 37 | 2021-08-11T23:22:14.000Z | 2021-08-12T22:27:15.000Z | src/snowflake/connector/telemetry_oob.py | corford/snowflake-connector-python | 6cec12333927ac4f85bc0c9317dde7baf7097364 | [
"Apache-2.0"
] | 2 | 2021-05-21T10:52:52.000Z | 2021-05-21T13:34:37.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012-2021 Snowflake Computing Inc. All right reserved.
#
import datetime
import json
import logging
import uuid
from collections import namedtuple
from queue import Queue
from typing import Optional
from .compat import OK
from .description import CLIENT_... | 33.879377 | 123 | 0.590502 |
f49c1c0d2a9e5f1fb8abdc6636c5e5edb56e0eb8 | 403 | py | Python | Green_Roof_MapPy/warsaw/load.py | martazaryn/green-roofs-mappping | 1b94c0fd1f48aeffbfbc6e2162000ff5f83e7fea | [
"MIT"
] | 3 | 2017-04-03T15:26:03.000Z | 2017-10-20T13:46:12.000Z | Green_Roof_MapPy/warsaw/load.py | martazaryn/green-roofs-mappping | 1b94c0fd1f48aeffbfbc6e2162000ff5f83e7fea | [
"MIT"
] | null | null | null | Green_Roof_MapPy/warsaw/load.py | martazaryn/green-roofs-mappping | 1b94c0fd1f48aeffbfbc6e2162000ff5f83e7fea | [
"MIT"
] | null | null | null | import os
# from django.contrib.gis.utils import LayerMapping
# from .models import GreenRoof
# green_roofs = {
# 'district' : 'DISTRICT',
# 'roof_address' : 'ADDRESS',
# 'roof_type' : 'TYPE',
# 'area' : 'AREA',
# 'total_place_area' : 'TOTAL_AREA',
# 'access' : 'ACCESS',
# 'ownership_type' ... | 23.705882 | 51 | 0.578164 |
b2fdbc6ff5079341885b77ad4c05722c20a59e8a | 580 | py | Python | chapter_2/add.py | salimsuprayogi/learn_to_program_with_python_3 | 1590871f0475c00ad29b21178f3c781742191f6f | [
"MIT"
] | null | null | null | chapter_2/add.py | salimsuprayogi/learn_to_program_with_python_3 | 1590871f0475c00ad29b21178f3c781742191f6f | [
"MIT"
] | null | null | null | chapter_2/add.py | salimsuprayogi/learn_to_program_with_python_3 | 1590871f0475c00ad29b21178f3c781742191f6f | [
"MIT"
] | null | null | null | # I say thank you Irv Kalb
# Allow me to learn to use your source code
# Source Code : https://github.com/Apress/learn-to-prog-w-python-3
# By : Source code for 'Learn to Program with Python 3' by Irv Kalb
# Author : Salim Suprayogi
# Rewrite the code to learn and understand the code
# Menulis ula... | 30.526316 | 91 | 0.717241 |
a96e06b4ba765db68d72931b105e2c1d3667f564 | 784 | py | Python | var/spack/repos/builtin/packages/bitlbee/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2,360 | 2017-11-06T08:47:01.000Z | 2022-03-31T14:45:33.000Z | var/spack/repos/builtin/packages/bitlbee/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13,838 | 2017-11-04T07:49:45.000Z | 2022-03-31T23:38:39.000Z | var/spack/repos/builtin/packages/bitlbee/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1,793 | 2017-11-04T07:45:50.000Z | 2022-03-30T14:31:53.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Bitlbee(AutotoolsPackage):
"""An IRC to other chat networks gateway."""
homepage = "h... | 35.636364 | 95 | 0.75 |
3575ecc8e44abd898ca11291610515c93eecb634 | 258,062 | py | Python | src/numpy/core/tests/test_multiarray.py | cthdidIT/sjoelbak-ocr | 3256125af3882ea53c848e6fd30d67dc46b64899 | [
"MIT"
] | 4 | 2018-11-27T01:35:30.000Z | 2022-01-27T01:17:11.000Z | build/numpy/numpy/core/tests/test_multiarray.py | agladstein/SimPrily_update | 05caea299e2a48a7fe37be68e8b1619eaaa7ac5d | [
"MIT"
] | null | null | null | build/numpy/numpy/core/tests/test_multiarray.py | agladstein/SimPrily_update | 05caea299e2a48a7fe37be68e8b1619eaaa7ac5d | [
"MIT"
] | 1 | 2018-11-27T01:35:33.000Z | 2018-11-27T01:35:33.000Z | from __future__ import division, absolute_import, print_function
import collections
import tempfile
import sys
import shutil
import warnings
import operator
import io
import itertools
import functools
import ctypes
import os
import gc
from contextlib import contextmanager
if sys.version_info[0] >= 3:
import builti... | 37.530832 | 588 | 0.519178 |
f1eda1148f3e48803c2d8404149f751364754f24 | 637 | py | Python | tests/test_pubsub.py | yudame/portfolio | 936b92e39e764e0e511c4203a978e240a0a90714 | [
"MIT"
] | 5 | 2021-11-21T01:36:02.000Z | 2022-01-28T23:16:51.000Z | tests/test_pubsub.py | yudame/portfolio | 936b92e39e764e0e511c4203a978e240a0a90714 | [
"MIT"
] | 1 | 2021-12-29T13:20:17.000Z | 2021-12-29T13:20:17.000Z | tests/test_pubsub.py | yudame/portfolio | 936b92e39e764e0e511c4203a978e240a0a90714 | [
"MIT"
] | null | null | null | import sys
import os
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.dirname(SCRIPT_DIR))
from src.popoto.redis_db import POPOTO_REDIS_DB
from src import popoto
class MyPublishableModel(popoto.Model):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)... | 24.5 | 56 | 0.66876 |
8f51168eeed4f95f995f58f3ed8d7d5272db647f | 2,737 | py | Python | mindspore/_extends/graph_kernel/expanders/bias_add.py | GeekHee/mindspore | 896b8e5165dd0a900ed5a39e0fb23525524bf8b0 | [
"Apache-2.0"
] | null | null | null | mindspore/_extends/graph_kernel/expanders/bias_add.py | GeekHee/mindspore | 896b8e5165dd0a900ed5a39e0fb23525524bf8b0 | [
"Apache-2.0"
] | null | null | null | mindspore/_extends/graph_kernel/expanders/bias_add.py | GeekHee/mindspore | 896b8e5165dd0a900ed5a39e0fb23525524bf8b0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Huawei Technologies Co., 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 to... | 43.444444 | 85 | 0.611984 |
8cd2681c8da8b96ab0de41fe52d590ed9abca4d8 | 5,701 | py | Python | homeassistant/components/huisbaasje/__init__.py | mburget/core | 01fcc41aa067bce649721fa1d04c800b6576eb02 | [
"Apache-2.0"
] | 1 | 2021-03-23T07:20:03.000Z | 2021-03-23T07:20:03.000Z | homeassistant/components/huisbaasje/__init__.py | Chreece/core | e97f7a96562a8d263f54ff6e759a18dce01198d2 | [
"Apache-2.0"
] | 51 | 2020-08-03T07:30:44.000Z | 2022-03-22T06:02:42.000Z | homeassistant/components/huisbaasje/__init__.py | Chreece/core | e97f7a96562a8d263f54ff6e759a18dce01198d2 | [
"Apache-2.0"
] | null | null | null | """The Huisbaasje integration."""
from datetime import timedelta
import logging
import async_timeout
from huisbaasje import Huisbaasje, HuisbaasjeException
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.core import HomeAssistant
fro... | 33.733728 | 88 | 0.680056 |
7c4bb4afd897e7d9509d32acbeedebe210529520 | 7,861 | py | Python | examples/huobi_swap/strategy.py | ckelsel/huobi_futures_Python | e022d3d79c4b4f05e71a5e520e16483e3a691a44 | [
"MIT"
] | 186 | 2020-10-26T12:30:37.000Z | 2022-03-26T21:21:16.000Z | examples/huobi_swap/strategy.py | ckelsel/huobi_futures_Python | e022d3d79c4b4f05e71a5e520e16483e3a691a44 | [
"MIT"
] | 43 | 2020-02-07T01:24:06.000Z | 2020-10-21T06:38:08.000Z | examples/huobi_swap/strategy.py | ckelsel/huobi_futures_Python | e022d3d79c4b4f05e71a5e520e16483e3a691a44 | [
"MIT"
] | 84 | 2020-10-24T02:56:11.000Z | 2022-03-24T14:35:23.000Z | # -*- coding:utf-8 -*-
"""
简单卖平策略,仅做演示使用
Author: Qiaoxiaofeng
Date: 2020/01/10
Email: andyjoe318@gmail.com
"""
# 策略实现
import time
from alpha import const
from alpha.utils import tools
from alpha.utils import logger
from alpha.config import config
from alpha.market import Market
from alpha.trade import Trade
from alp... | 39.109453 | 149 | 0.62562 |
53bc501dfc5e3e34047a1d9354ff4a89a7bb9745 | 4,389 | py | Python | unit_tests/services/test_charge_id_service.py | LandRegistry/search-api | 512d8cf0e56025fb1db10ad3cdf5345a0efd2923 | [
"MIT"
] | null | null | null | unit_tests/services/test_charge_id_service.py | LandRegistry/search-api | 512d8cf0e56025fb1db10ad3cdf5345a0efd2923 | [
"MIT"
] | null | null | null | unit_tests/services/test_charge_id_service.py | LandRegistry/search-api | 512d8cf0e56025fb1db10ad3cdf5345a0efd2923 | [
"MIT"
] | 1 | 2021-04-11T05:24:50.000Z | 2021-04-11T05:24:50.000Z | from unittest import TestCase
from unittest.mock import patch
from search_api.constants.charge_id import ChargeId
from search_api.exceptions import ApplicationError
from search_api.utilities.charge_id \
import is_valid_charge_id, encode_charge_id, decode_charge_id, add_prefix, remove_prefix, encode_base_31, \
d... | 42.201923 | 111 | 0.748918 |
557d8e8c1d828aedc49a7a5ac90eb57484eede8d | 6,878 | py | Python | orio/tool/ZestyParser/Parser.py | parsabee/Orio | 64de0f7ee422483b60a9f02793472e20e864aa08 | [
"MIT"
] | 24 | 2015-01-26T03:14:19.000Z | 2021-09-27T23:10:12.000Z | orio/tool/ZestyParser/Parser.py | parsabee/Orio | 64de0f7ee422483b60a9f02793472e20e864aa08 | [
"MIT"
] | 30 | 2015-04-17T18:14:27.000Z | 2021-05-30T15:01:47.000Z | orio/tool/ZestyParser/Parser.py | parsabee/Orio | 64de0f7ee422483b60a9f02793472e20e864aa08 | [
"MIT"
] | 20 | 2015-02-11T08:20:19.000Z | 2022-01-15T17:55:00.000Z | # ZestyParser 0.8.1 -- Parses in Python zestily
# Copyright (C) 2006-2007 Adam Atlas
#
# 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 r... | 36.780749 | 265 | 0.61893 |
5fb052b5e3943caf9ff8a75125b9c17d6fdf8526 | 392 | py | Python | pattern matching/suffix_array_bisect.py | mkoryor/Python | 837ec4c03130dc4cb919fb5f1eeb4d31206790e4 | [
"Unlicense"
] | null | null | null | pattern matching/suffix_array_bisect.py | mkoryor/Python | 837ec4c03130dc4cb919fb5f1eeb4d31206790e4 | [
"Unlicense"
] | null | null | null | pattern matching/suffix_array_bisect.py | mkoryor/Python | 837ec4c03130dc4cb919fb5f1eeb4d31206790e4 | [
"Unlicense"
] | null | null | null |
from bisect import bisect_left, bisect_right
strls = ['a', 'awkward', 'awl', 'awls', 'axe', 'axes', 'bee']
# t = 'This is the world.$'
t = 'banana$'
suffixes = sorted([t[i:] for i in range(len(t))])
print(len(suffixes))
print(suffixes)
# Get range of elements with ‘aw’ as a prefix
st, en = bisect_left(strls... | 13.517241 | 61 | 0.614796 |
b6f1e9c8f96828bd7cc38ef151a5ae6cc004de13 | 1,245 | py | Python | env/Lib/site-packages/coverage/version.py | camilorojase/GithubActionsTest | 7b448e365d31ec84bf55b68033a88bb00e8e5358 | [
"MIT"
] | null | null | null | env/Lib/site-packages/coverage/version.py | camilorojase/GithubActionsTest | 7b448e365d31ec84bf55b68033a88bb00e8e5358 | [
"MIT"
] | null | null | null | env/Lib/site-packages/coverage/version.py | camilorojase/GithubActionsTest | 7b448e365d31ec84bf55b68033a88bb00e8e5358 | [
"MIT"
] | null | null | null | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""The version and URL for coverage.py"""
# This file is exec'ed in setup.py, don't import anything!
# Same semantics as sys.version_info.
version_info = (6, 3, 2,... | 36.617647 | 80 | 0.668273 |
a243183e2f816b0b80d2a91ad585756e6a1563ec | 220 | py | Python | contrib/wallettools/walletchangepass.py | Open-Source-Coins/EXE | ae4c4aee320052d38a26da4676e2b3954f32aaab | [
"MIT"
] | 2 | 2015-01-05T01:54:07.000Z | 2015-01-26T02:05:06.000Z | contrib/wallettools/walletchangepass.py | Open-Source-Coins/EXE | ae4c4aee320052d38a26da4676e2b3954f32aaab | [
"MIT"
] | null | null | null | contrib/wallettools/walletchangepass.py | Open-Source-Coins/EXE | ae4c4aee320052d38a26da4676e2b3954f32aaab | [
"MIT"
] | 6 | 2015-04-02T12:07:58.000Z | 2018-01-01T19:16:55.000Z | from jsonrpc import ServiceProxy
access = ServiceProxy("http://127.0.0.1:9988")
pwd = raw_input("Enter old wallet passphrase: ")
pwd2 = raw_input("Enter new wallet passphrase: ")
access.walletpassphrasechange(pwd, pwd2)
| 36.666667 | 49 | 0.768182 |
29b2951aec51b4e4f81bac9326ee21dbd9ec7eb0 | 3,417 | py | Python | qa/rpc-tests/mempool_resurrect_test.py | AYCH-Inc/aych.doge | 10a5e93a055ab5f239c5447a5fe05283af09e293 | [
"MIT"
] | 23 | 2018-01-23T18:10:57.000Z | 2022-02-15T23:27:53.000Z | qa/rpc-tests/mempool_resurrect_test.py | AYCH-Inc/aych.doge | 10a5e93a055ab5f239c5447a5fe05283af09e293 | [
"MIT"
] | 24 | 2018-02-01T01:17:58.000Z | 2020-11-12T00:21:10.000Z | qa/rpc-tests/mempool_resurrect_test.py | AYCH-Inc/aych.doge | 10a5e93a055ab5f239c5447a5fe05283af09e293 | [
"MIT"
] | 18 | 2018-01-26T15:54:13.000Z | 2021-12-11T23:48:15.000Z | #!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test resurrection of mined transactions when
# the blockchain is re-organized.
#
from test_framework.test... | 39.275862 | 96 | 0.657009 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.