hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | 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 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | 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 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1d27619f84eeaea091527d2a297c6c8105d239b4 | 1,498 | py | Python | FinanceAnalysisAlgoTrading/08-Time-Series-Analysis_03-ETS-Decomposition.py | enriqueescobar-askida/Kinito.Finance | 5308748b64829ac798a858161f9b4a9e5829db44 | [
"MIT"
] | 2 | 2020-03-04T11:18:38.000Z | 2020-05-10T15:36:42.000Z | FinanceAnalysisAlgoTrading/08-Time-Series-Analysis_03-ETS-Decomposition.py | enriqueescobar-askida/Kinito.Finance | 5308748b64829ac798a858161f9b4a9e5829db44 | [
"MIT"
] | 6 | 2020-03-30T16:42:47.000Z | 2021-12-13T20:37:21.000Z | FinanceAnalysisAlgoTrading/08-Time-Series-Analysis_03-ETS-Decomposition.py | enriqueescobar-askida/Kinito.Finance | 5308748b64829ac798a858161f9b4a9e5829db44 | [
"MIT"
] | 1 | 2020-04-14T11:26:16.000Z | 2020-04-14T11:26:16.000Z | #!/usr/bin/env python
# coding: utf-8
# ___
#
# <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a>
# ___
# <center>*Copyright Pierian Data 2017*</center>
# <center>*For more information, visit us at www.pieriandata.com*</center>
# In[45]:
import pandas as pd
import numpy as np
import matp... | 39.421053 | 345 | 0.740988 |
1d27748eb13de2bf3569692ad4e13c82e0027061 | 2,727 | py | Python | src/rMETL/rMETL_utils.py | tjiangHIT/rMETL | 538c0e4058424d4a0aeaaf34ba8ba98a3b8a813b | [
"MIT"
] | 12 | 2018-06-07T08:27:31.000Z | 2022-01-26T01:24:52.000Z | src/rMETL/rMETL_utils.py | hitbc/rMETL | 1b6b8419c9412cc8c7420d18448b559157059b9e | [
"MIT"
] | 6 | 2019-01-19T10:59:00.000Z | 2021-07-16T15:26:32.000Z | src/rMETL/rMETL_utils.py | hitbc/rMETL | 1b6b8419c9412cc8c7420d18448b559157059b9e | [
"MIT"
] | 3 | 2018-06-08T07:02:39.000Z | 2020-03-05T05:00:41.000Z | #!/usr/bin/env python
# -*-coding:utf-8-*-
import logging
import os
from Bio import SeqIO
from rMETL.rMETL_cmdRunner import exe
def load_ref(ref_g):
logging.info("Loading reference genome...")
return SeqIO.to_dict(SeqIO.parse(ref_g, "fasta"))
def check_bai(file, tempdir):
'''
check the index of a BAM file.
'''
... | 27.545455 | 75 | 0.629996 |
1d27761664671ade7cc756d5f34ab5dc0f2e0406 | 6,596 | py | Python | test/generate_pickle_files_bot.py | Matuiss2/python-sc2 | dd93215d8b09b7ddacfd5c3cc4e9f43641d3f953 | [
"MIT"
] | null | null | null | test/generate_pickle_files_bot.py | Matuiss2/python-sc2 | dd93215d8b09b7ddacfd5c3cc4e9f43641d3f953 | [
"MIT"
] | null | null | null | test/generate_pickle_files_bot.py | Matuiss2/python-sc2 | dd93215d8b09b7ddacfd5c3cc4e9f43641d3f953 | [
"MIT"
] | null | null | null | import sys, os
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import sc2
from sc2 import Race
from sc2.player import Bot
from sc2.units import Units
from sc2.unit import Unit
from sc2.position import Point2, Point3
from sc2.ids.unit_typeid import UnitTypeId
from sc2.ids.upgrade_id import UpgradeId
f... | 31.409524 | 142 | 0.630534 |
1d27b036eb804aa301b916b7ed0b7884f75e1a0f | 7,947 | py | Python | tensorflow/python/data/kernel_tests/sequence_dataset_op_test.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 71 | 2017-05-25T16:02:15.000Z | 2021-06-09T16:08:08.000Z | tensorflow/python/data/kernel_tests/sequence_dataset_op_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 133 | 2017-04-26T16:49:49.000Z | 2019-10-15T11:39:26.000Z | tensorflow/python/data/kernel_tests/sequence_dataset_op_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 31 | 2018-09-11T02:17:17.000Z | 2021-12-15T10:33:35.000Z | # Copyright 2017 The TensorFlow 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 applica... | 37.842857 | 80 | 0.681012 |
1d27c1eedff6f9b4f747012a5db8a17b81d7052f | 1,166 | py | Python | account/views.py | inoks138/django-shop | 8a7454c7c12ccb8bc55033010adc66999094e4be | [
"BSD-3-Clause"
] | null | null | null | account/views.py | inoks138/django-shop | 8a7454c7c12ccb8bc55033010adc66999094e4be | [
"BSD-3-Clause"
] | null | null | null | account/views.py | inoks138/django-shop | 8a7454c7c12ccb8bc55033010adc66999094e4be | [
"BSD-3-Clause"
] | null | null | null | from django.contrib import messages
from django.contrib.auth import login, logout
from django.shortcuts import render, redirect
from .forms import AccountRegisterForm, AccountLoginForm
def register(request):
if request.method == 'POST':
form = AccountRegisterForm(request.POST)
if form.is_valid():
... | 31.513514 | 85 | 0.651801 |
1d27c2e9dfb4cc036d10416ede3728358cb4c16f | 2,277 | py | Python | tests/rulefit_test.py | csinva/interpretability-implementations-demos | 0223114225d0e077007b1ad49f63b64f3ff5ee15 | [
"MIT"
] | 102 | 2019-07-16T13:45:35.000Z | 2020-09-14T19:12:49.000Z | tests/rulefit_test.py | csinva/interpretability-workshop | db201be7723179a1f5ab20b242419a604edc9186 | [
"MIT"
] | 2 | 2020-01-03T20:47:14.000Z | 2020-01-03T21:17:39.000Z | tests/rulefit_test.py | csinva/interpretability-workshop | db201be7723179a1f5ab20b242419a604edc9186 | [
"MIT"
] | 8 | 2019-08-09T08:40:34.000Z | 2020-09-06T17:51:10.000Z | import numpy as np
from sklearn.ensemble import RandomForestRegressor, RandomForestClassifier
from sklearn.exceptions import ConvergenceWarning
from sklearn.utils._testing import ignore_warnings
from imodels.rule_set.rule_fit import RuleFitRegressor
from imodels.util.transforms import FriedScale
## Testing FriedScal... | 42.166667 | 144 | 0.626702 |
1d27dc7f809d669a2b489ec69f1f39624cc66209 | 47,749 | py | Python | kglib/utils/HelperFunctions.py | kgullikson88/gullikson-scripts | 8a9f00a6977dad8d4477eef1d664fd62e9ecab75 | [
"MIT"
] | 4 | 2016-02-22T02:34:32.000Z | 2018-11-02T02:31:58.000Z | kglib/utils/HelperFunctions.py | kgullikson88/gullikson-scripts | 8a9f00a6977dad8d4477eef1d664fd62e9ecab75 | [
"MIT"
] | null | null | null | kglib/utils/HelperFunctions.py | kgullikson88/gullikson-scripts | 8a9f00a6977dad8d4477eef1d664fd62e9ecab75 | [
"MIT"
] | 1 | 2018-03-19T13:59:25.000Z | 2018-03-19T13:59:25.000Z | """
Just a set of helper functions that I use often
VERY miscellaneous!
"""
from __future__ import print_function, absolute_import
import os
import logging
from astropy import units as u, constants
from astropy import convolution
from scipy.optimize import bisect
from scipy.stats import scoreatpercentile
from... | 34.955344 | 128 | 0.588976 |
1d27e894b20edc1682e55f44744491505dc180fe | 2,178 | py | Python | network_simulator/energyPolicy.py | brokenax3/network-simulator-py | 8ce238219010046aaf1063d546b4b7232a38d2fa | [
"MIT"
] | null | null | null | network_simulator/energyPolicy.py | brokenax3/network-simulator-py | 8ce238219010046aaf1063d546b4b7232a38d2fa | [
"MIT"
] | null | null | null | network_simulator/energyPolicy.py | brokenax3/network-simulator-py | 8ce238219010046aaf1063d546b4b7232a38d2fa | [
"MIT"
] | null | null | null | """ Transmission Policies
1. Picking the cheapest user and only transmitting once
2. Picking the cheapest users and transmitting until there is no more energy (Greedy)
3. Smart
returns energy consumption, energy shared and number of users serviced
"""
from . import envs
from .helpers import calcPowerTransmit
def noTr... | 27.225 | 89 | 0.678604 |
1d2803264e047f291e4d26a7d7218096e5a5aed5 | 12,974 | py | Python | armi/reactor/tests/test_geometry.py | bsculac/armi | 22399244a88e67fc09996981081f7d5aab7032b4 | [
"Apache-2.0"
] | null | null | null | armi/reactor/tests/test_geometry.py | bsculac/armi | 22399244a88e67fc09996981081f7d5aab7032b4 | [
"Apache-2.0"
] | null | null | null | armi/reactor/tests/test_geometry.py | bsculac/armi | 22399244a88e67fc09996981081f7d5aab7032b4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 TerraPower, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 40.670846 | 106 | 0.647295 |
1d28128ea3fbd8d0f1149227b1ccbaf9f730356b | 391 | py | Python | ibms_project/ibms/migrations/0007_auto_20180813_1604.py | mohdbakhrayba/ibms | 029e1f3bf108586289c65bb1d547f86851f9494f | [
"Apache-2.0"
] | 2 | 2019-09-07T20:39:29.000Z | 2021-09-16T12:02:16.000Z | ibms_project/ibms/migrations/0007_auto_20180813_1604.py | mohdbakhrayba/ibms | 029e1f3bf108586289c65bb1d547f86851f9494f | [
"Apache-2.0"
] | 11 | 2020-06-18T06:53:01.000Z | 2022-02-11T01:55:42.000Z | ibms_project/ibms/migrations/0007_auto_20180813_1604.py | mohdbakhrayba/ibms | 029e1f3bf108586289c65bb1d547f86851f9494f | [
"Apache-2.0"
] | 5 | 2016-01-18T04:36:48.000Z | 2017-09-07T06:38:28.000Z | # Generated by Django 2.1 on 2018-08-13 08:04
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('ibms', '0006_auto_20180813_1603'),
]
operations = [
migrations.RenameField(
model_name='serviceprioritymappings',
old_name='co... | 20.578947 | 49 | 0.616368 |
1d281307063b8f2f75fd2d116060a516523ed0d2 | 31,725 | py | Python | localstack/utils/cloudformation/template_deployer.py | varju/localstack | 6a2a26fbc5043f30e76b92456643339f6abf034d | [
"Apache-2.0"
] | 1 | 2019-09-17T05:57:23.000Z | 2019-09-17T05:57:23.000Z | localstack/utils/cloudformation/template_deployer.py | varju/localstack | 6a2a26fbc5043f30e76b92456643339f6abf034d | [
"Apache-2.0"
] | null | null | null | localstack/utils/cloudformation/template_deployer.py | varju/localstack | 6a2a26fbc5043f30e76b92456643339f6abf034d | [
"Apache-2.0"
] | 6 | 2019-07-10T10:27:54.000Z | 2021-04-08T09:59:54.000Z | import re
import json
import yaml
import logging
import traceback
from six import iteritems
from six import string_types
from localstack.utils import common
from localstack.config import DEFAULT_REGION
from localstack.utils.aws import aws_stack
ACTION_CREATE = 'create'
PLACEHOLDER_RESOURCE_NAME = '__resource_name__'
... | 40.935484 | 117 | 0.615477 |
1d281dde9c1120267d388dfb807cb73c7862bc51 | 3,304 | py | Python | Python/sorting/demoSorting.py | MatteoEsposito/ProgettoInItinereII-IngegneriaDegliAlgoritmi- | c37543d2bc1919d0cdad98dbc018eaf65f221cdf | [
"MIT"
] | null | null | null | Python/sorting/demoSorting.py | MatteoEsposito/ProgettoInItinereII-IngegneriaDegliAlgoritmi- | c37543d2bc1919d0cdad98dbc018eaf65f221cdf | [
"MIT"
] | null | null | null | Python/sorting/demoSorting.py | MatteoEsposito/ProgettoInItinereII-IngegneriaDegliAlgoritmi- | c37543d2bc1919d0cdad98dbc018eaf65f221cdf | [
"MIT"
] | null | null | null | import Sorting
import random
from time import time
def sortingTest(sortingFunc, inputList, secondPar = None, thirdPar = None):
"""
Run the given sorting function on the given list.
:param sortingFunc: the sorting function.
:param inputList: the input list.
:param secondPar: optional second paramet... | 37.545455 | 87 | 0.690375 |
1d2829dca1074ccdf8e166377fb9ef057afaa528 | 10,900 | py | Python | sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_05_01_preview/aio/operations/_proactive_detection_configurations_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_05_01_preview/aio/operations/_proactive_detection_configurations_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_05_01_preview/aio/operations/_proactive_detection_configurations_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 48.444444 | 214 | 0.721284 |
1d2851e68cff5e0b29d2edf048fd933df199e422 | 14,394 | py | Python | sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-01-24T08:54:57.000Z | 2022-01-24T08:54:57.000Z | sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 9 | 2022-03-25T19:35:49.000Z | 2022-03-31T06:09:47.000Z | sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-14T21:43:29.000Z | 2022-02-14T21:43:29.000Z | # pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRe... | 44.841121 | 236 | 0.635195 |
1d28647fdb5cd323d108b836a94fc3fa8d9b4157 | 4,993 | py | Python | alipay/aop/api/domain/AlipayEbppInvoiceEnterpriseexctrlEmployertitleModifyModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/AlipayEbppInvoiceEnterpriseexctrlEmployertitleModifyModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/AlipayEbppInvoiceEnterpriseexctrlEmployertitleModifyModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayEbppInvoiceEnterpriseexctrlEmployertitleModifyModel(object):
def __init__(self):
self._account_id = None
self._address = None
self._agreement_no = None
self.... | 31.012422 | 81 | 0.594232 |
1d286d50e7515967f16e53f55279764bf3aa0d8c | 1,405 | py | Python | setup.py | PeteHaitch/methtuple | 33e425aeb04fda01a52dfaf606fcb83f60b7e44b | [
"MIT"
] | 10 | 2015-08-18T18:57:40.000Z | 2021-05-11T04:50:01.000Z | setup.py | PeteHaitch/methtuple | 33e425aeb04fda01a52dfaf606fcb83f60b7e44b | [
"MIT"
] | 19 | 2015-02-02T00:29:20.000Z | 2022-03-23T05:15:01.000Z | setup.py | PeteHaitch/methtuple | 33e425aeb04fda01a52dfaf606fcb83f60b7e44b | [
"MIT"
] | 2 | 2018-02-07T11:05:18.000Z | 2021-05-11T04:50:04.000Z | import os
from setuptools import setup, find_packages
# Convert README.md to README.rst automagically
# http://stackoverflow.com/a/23265673
try:
from pypandoc import convert
read_md = lambda f: convert(f, 'rst')
except ImportError:
print("warning: pypandoc module not found, could not convert Markdown to R... | 29.893617 | 82 | 0.687544 |
1d289dca9f2aeebd052c4513da4e6900582b4230 | 1,740 | py | Python | predict.py | kappernie/udacity_image_classifier | fc6bbbb8104052f2603ea50c71808a659811631f | [
"MIT"
] | null | null | null | predict.py | kappernie/udacity_image_classifier | fc6bbbb8104052f2603ea50c71808a659811631f | [
"MIT"
] | null | null | null | predict.py | kappernie/udacity_image_classifier | fc6bbbb8104052f2603ea50c71808a659811631f | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
import torch
from torch import nn
from torch import tensor
from torch import optim
import torch.nn.functional as F
from torch.autograd import Variable
from torchvision import datasets, transforms
import torchvision.models as models
from collections import OrderedDict
i... | 33.461538 | 145 | 0.795977 |
1d28b65f94fbd4a1f9106d0c95338476067e2188 | 25,512 | py | Python | jesse/helpers.py | botzill/jesse | cff9e69446980ae739f5020964c4618638b2014d | [
"MIT"
] | null | null | null | jesse/helpers.py | botzill/jesse | cff9e69446980ae739f5020964c4618638b2014d | [
"MIT"
] | null | null | null | jesse/helpers.py | botzill/jesse | cff9e69446980ae739f5020964c4618638b2014d | [
"MIT"
] | null | null | null | import hashlib
import math
import os
import random
import string
import sys
import uuid
from typing import List, Tuple, Union, Any
from pprint import pprint
import arrow
import click
import numpy as np
CACHED_CONFIG = dict()
def app_currency() -> str:
from jesse.routes import router
return quote_asset(router... | 27.198294 | 140 | 0.62645 |
1d28cdbb72f74d52f1eff5f59b69d6dcad94468e | 9,998 | py | Python | src/doc/src/conf.py | concordusapps/python-cmislib | 628cca53ab05203920f7e7a063487be53b4a8d0a | [
"Apache-2.0"
] | 1 | 2019-05-31T12:30:02.000Z | 2019-05-31T12:30:02.000Z | src/doc/src/conf.py | concordusapps/python-cmislib | 628cca53ab05203920f7e7a063487be53b4a8d0a | [
"Apache-2.0"
] | null | null | null | src/doc/src/conf.py | concordusapps/python-cmislib | 628cca53ab05203920f7e7a063487be53b4a8d0a | [
"Apache-2.0"
] | 3 | 2019-07-11T03:08:58.000Z | 2022-01-05T10:27:15.000Z | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache Li... | 32.888158 | 80 | 0.714943 |
1d28e5e49462f836089b492990a4cb2fbb76a282 | 2,309 | py | Python | sdks/python/appcenter_sdk/models/ErrorAttachments.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | null | null | null | sdks/python/appcenter_sdk/models/ErrorAttachments.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 6 | 2019-10-23T06:38:53.000Z | 2022-01-22T07:57:58.000Z | sdks/python/appcenter_sdk/models/ErrorAttachments.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 2 | 2019-10-23T06:31:05.000Z | 2021-08-21T17:32:47.000Z | # coding: utf-8
"""
App Center Client
Microsoft Visual Studio App Center API # noqa: E501
OpenAPI spec version: preview
Contact: benedetto.abbenanti@gmail.com
Project Repository: https://github.com/b3nab/appcenter-sdks
"""
import pprint
import re # noqa: F401
import six
class ErrorAttachmen... | 27.819277 | 80 | 0.556518 |
1d292d8679cd9611cfe26413a816aa133ef89381 | 27,700 | py | Python | src/romt/crate.py | k3d3/romt | 2445777096a92979a236865d5e3a8106a779fa84 | [
"MIT"
] | null | null | null | src/romt/crate.py | k3d3/romt | 2445777096a92979a236865d5e3a8106a779fa84 | [
"MIT"
] | 1 | 2021-02-12T18:27:36.000Z | 2021-02-12T18:27:36.000Z | src/romt/crate.py | k3d3/romt | 2445777096a92979a236865d5e3a8106a779fa84 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# coding=utf-8
import argparse
import json
import os
from pathlib import Path
import re
from typing import Generator, List, Optional, Tuple
import urllib.parse
import git
import git.remote
from romt import base
from romt import common
from romt import error
import romt.download
# Name of ind... | 30.273224 | 81 | 0.581805 |
1d293d4ffe9d57349fa9bd9e6c6c94e438c07c45 | 1,398 | py | Python | src/olympia/yara/migrations/0001_initial.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 843 | 2016-02-09T13:00:37.000Z | 2022-03-20T19:17:06.000Z | src/olympia/yara/migrations/0001_initial.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 10,187 | 2016-02-05T23:51:05.000Z | 2022-03-31T15:24:44.000Z | src/olympia/yara/migrations/0001_initial.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 551 | 2016-02-08T20:32:16.000Z | 2022-03-15T16:49:24.000Z | # Generated by Django 2.2.5 on 2019-09-12 15:04
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import django_extensions.db.fields.json
import olympia.amo.models
class Migration(migrations.Migration):
initial = True
dependencies = [
('versions'... | 38.833333 | 158 | 0.63877 |
1d29692da01a7d52205e334eb0051116bea8a085 | 696 | py | Python | app/__init__.py | gth2103/spot-me | 604fd0906b4e84ea5c9010b944e64b9af6c40343 | [
"Apache-2.0"
] | null | null | null | app/__init__.py | gth2103/spot-me | 604fd0906b4e84ea5c9010b944e64b9af6c40343 | [
"Apache-2.0"
] | null | null | null | app/__init__.py | gth2103/spot-me | 604fd0906b4e84ea5c9010b944e64b9af6c40343 | [
"Apache-2.0"
] | null | null | null | import os
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
# from app.models import db
from flask_login import LoginManager
from flask_migrate import Migrate
db = SQLAlchemy()
app = Flask(__name__)
app.config['SECRET_KEY'] = 'secret'
migrate = Migrate(app, db)
def connect_to_db(app, db_uri=None):
... | 22.451613 | 91 | 0.748563 |
1d2970e5f160af27e82229314980d18bcda0cd83 | 750 | py | Python | attic/pre-deployment/tests/archiver_chart_test.py | ska-telescope/skampi | cd2f95bd56594888c8d0c3476824b438dfcfcf71 | [
"BSD-3-Clause"
] | null | null | null | attic/pre-deployment/tests/archiver_chart_test.py | ska-telescope/skampi | cd2f95bd56594888c8d0c3476824b438dfcfcf71 | [
"BSD-3-Clause"
] | 3 | 2019-10-25T13:38:56.000Z | 2022-03-30T09:13:33.000Z | attic/pre-deployment/tests/archiver_chart_test.py | ska-telescope/skampi | cd2f95bd56594888c8d0c3476824b438dfcfcf71 | [
"BSD-3-Clause"
] | 2 | 2019-11-04T09:59:06.000Z | 2020-05-07T11:05:42.000Z | import pytest
from resources.test_support.util import parse_yaml_str
@pytest.mark.no_deploy
def test_cm_service_definition_should_have_TANGO_HOST_set_to_databaseds_host(helm_adaptor):
chart = 'archiver'
a_release_name = 'any-release'
helm_templated_defs = helm_adaptor.template(chart, a_release_name, 'cm_... | 34.090909 | 91 | 0.741333 |
1d2973f9950acacd6ade9496dd8a384c7bf02461 | 6,408 | py | Python | tests/func/test_move.py | drorata/dvc | b6bc65fcbf269b94b7c1ce2d9dff641dedb039b0 | [
"Apache-2.0"
] | 2 | 2019-06-23T14:24:48.000Z | 2019-07-08T12:22:53.000Z | tests/func/test_move.py | drorata/dvc | b6bc65fcbf269b94b7c1ce2d9dff641dedb039b0 | [
"Apache-2.0"
] | null | null | null | tests/func/test_move.py | drorata/dvc | b6bc65fcbf269b94b7c1ce2d9dff641dedb039b0 | [
"Apache-2.0"
] | 1 | 2019-09-02T00:29:40.000Z | 2019-09-02T00:29:40.000Z | import os
from dvc.main import main
from dvc.exceptions import DvcException, MoveNotDataSourceError
from dvc.stage import Stage
from dvc.utils.stage import load_stage_file
from tests.basic_env import TestDvc, TestDvcGit
from tests.func.test_repro import TestRepro
from tests.utils import cd
class TestMove(TestDvc):
... | 32.861538 | 79 | 0.660268 |
1d299e5ddc568f65a1abd825ab3f4ab1080989fd | 4,462 | py | Python | main/tsys01.py | mouryarahul/micropython-pybd-expansion | 70bac920365682dda1ebe5c9517e73d4f678aa8b | [
"MIT"
] | null | null | null | main/tsys01.py | mouryarahul/micropython-pybd-expansion | 70bac920365682dda1ebe5c9517e73d4f678aa8b | [
"MIT"
] | null | null | null | main/tsys01.py | mouryarahul/micropython-pybd-expansion | 70bac920365682dda1ebe5c9517e73d4f678aa8b | [
"MIT"
] | null | null | null | #! /usr/bin/env python
#
# A micropython module to interface with MS5837-30BA and MS5837-02BA
# waterproof pressure and temperature sensors from BlueRobotics
#
# This file is part of micropyboard derived from Python Driver.
# https://github.com/bluerobotics/tsys01-python
#
# MIT License
#
# Copyright (c) 2020 Rahul Mou... | 32.569343 | 118 | 0.637382 |
1d29c4cedd449000b0d63305220d88cc830924f5 | 237 | py | Python | graphic_templates/grouped_bar_chart/graphic_config.py | cerealcommas/mashgraphics | ac17781736e64cf7b9b2601fd10e8772ebc7b306 | [
"MIT"
] | null | null | null | graphic_templates/grouped_bar_chart/graphic_config.py | cerealcommas/mashgraphics | ac17781736e64cf7b9b2601fd10e8772ebc7b306 | [
"MIT"
] | null | null | null | graphic_templates/grouped_bar_chart/graphic_config.py | cerealcommas/mashgraphics | ac17781736e64cf7b9b2601fd10e8772ebc7b306 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
COPY_GOOGLE_DOC_KEY = '1r20oDcN0nndK8niF5EAzee2Bl3FUGgWhWk2oyquw3RI'
USE_ASSETS = False
# Use these variables to override the default cache timeouts for this graphic
# DEFAULT_MAX_AGE = 20
# ASSETS_MAX_AGE = 300
| 23.7 | 77 | 0.805907 |
1d29c8fcf230a1644bf69a1f69125615d4365342 | 89 | py | Python | lewis_emulators/pt2025/interfaces/__init__.py | ISISComputingGroup/EPICS-DeviceEmulator | 026c2a14a16bb204ea7527e3765daa182cafa814 | [
"BSD-3-Clause"
] | 2 | 2020-10-20T16:49:13.000Z | 2021-02-19T10:41:44.000Z | lewis_emulators/pt2025/interfaces/__init__.py | ISISComputingGroup/EPICS-DeviceEmulator | 026c2a14a16bb204ea7527e3765daa182cafa814 | [
"BSD-3-Clause"
] | 9 | 2019-03-22T15:35:15.000Z | 2021-07-28T11:05:43.000Z | lewis_emulators/pt2025/interfaces/__init__.py | ISISComputingGroup/EPICS-DeviceEmulator | 026c2a14a16bb204ea7527e3765daa182cafa814 | [
"BSD-3-Clause"
] | 1 | 2020-10-21T17:02:44.000Z | 2020-10-21T17:02:44.000Z | from .stream_interface import Pt2025StreamInterface
__all__ = ['Pt2025StreamInterface']
| 22.25 | 51 | 0.842697 |
1d29d26393bce33871a1c98bfa268874762bdcc8 | 12,106 | py | Python | deepsim/deepsim/core/visual.py | aws-deepracer/deepsim | cad2639f525c2f94ec5c03d8b855cc65b0b8ee55 | [
"Apache-2.0"
] | 1 | 2022-03-25T07:20:49.000Z | 2022-03-25T07:20:49.000Z | deepsim/deepsim/core/visual.py | aws-deepracer/deepsim | cad2639f525c2f94ec5c03d8b855cc65b0b8ee55 | [
"Apache-2.0"
] | null | null | null | deepsim/deepsim/core/visual.py | aws-deepracer/deepsim | cad2639f525c2f94ec5c03d8b855cc65b0b8ee55 | [
"Apache-2.0"
] | null | null | null | #################################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"). ... | 32.896739 | 96 | 0.555262 |
1d2a223c56818f469f0f2154344bdb1c44289710 | 2,480 | py | Python | onadata/apps/logger/fields.py | amks1/kobocat | 0f36c75cc55345716558e8bece2ef48567896997 | [
"BSD-2-Clause"
] | 87 | 2015-02-10T23:36:28.000Z | 2022-01-31T00:51:10.000Z | onadata/apps/logger/fields.py | amks1/kobocat | 0f36c75cc55345716558e8bece2ef48567896997 | [
"BSD-2-Clause"
] | 443 | 2015-04-28T18:50:25.000Z | 2022-03-31T03:29:43.000Z | onadata/apps/logger/fields.py | amks1/kobocat | 0f36c75cc55345716558e8bece2ef48567896997 | [
"BSD-2-Clause"
] | 122 | 2015-01-13T16:27:44.000Z | 2022-01-24T09:35:56.000Z | # coding: utf-8
import collections
from django.core.exceptions import FieldError
from django.db import models
class LazyDefaultBooleanField(models.PositiveSmallIntegerField):
"""
Allows specifying a default value for a new field without having to rewrite
every row in the corresponding table when migratin... | 36.470588 | 82 | 0.645565 |
1d2a4513d641237d9ee7ab7ce3a2d6c80be0e6aa | 8,672 | py | Python | venv/lib/python3.6/site-packages/kubernetes/client/models/v1alpha1_policy_rule.py | DiptoChakrabarty/Kube-Automate | 2072d1aadd58eb405c7308ff5cfecbf50300ead3 | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/kubernetes/client/models/v1alpha1_policy_rule.py | DiptoChakrabarty/Kube-Automate | 2072d1aadd58eb405c7308ff5cfecbf50300ead3 | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/kubernetes/client/models/v1alpha1_policy_rule.py | DiptoChakrabarty/Kube-Automate | 2072d1aadd58eb405c7308ff5cfecbf50300ead3 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: release-1.15
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class V1alp... | 38.035088 | 566 | 0.64518 |
1d2a57dde4707cf86e6a6a093d7a74b30dac7915 | 1,142 | py | Python | Python-code-snippets-201-300/225-book-chapter-splitter.py | abartoha/python-snippets-ref | 04e4feada96077f0e849b277204c012194e8fbcd | [
"Unlicense"
] | null | null | null | Python-code-snippets-201-300/225-book-chapter-splitter.py | abartoha/python-snippets-ref | 04e4feada96077f0e849b277204c012194e8fbcd | [
"Unlicense"
] | null | null | null | Python-code-snippets-201-300/225-book-chapter-splitter.py | abartoha/python-snippets-ref | 04e4feada96077f0e849b277204c012194e8fbcd | [
"Unlicense"
] | null | null | null | """Code snippets vol-45-snippet-225
Split a book into seperate chapters as files.
Book needs to be converted to plain text first.
#tested and works on an adhd epub i found and converted to txt
stevepython.wordpress.com
Download all snippets so far:
https://wp.me/Pa5TU8-1yg
https://stackoverflow.com/questions/6014199... | 30.864865 | 95 | 0.717163 |
1d2a7cc84deddf4c7feefe820f46b5410454ba2e | 1,525 | py | Python | twitter_api/misc.py | ECrownofFire/chaos | 0cfbb85ab52654967909aef54eff3a0e62b641bd | [
"MIT"
] | 1,804 | 2017-05-23T02:34:27.000Z | 2017-05-26T00:44:44.000Z | twitter_api/misc.py | ECrownofFire/chaos | 0cfbb85ab52654967909aef54eff3a0e62b641bd | [
"MIT"
] | 345 | 2017-05-20T23:55:12.000Z | 2017-06-19T07:48:58.000Z | twitter_api/misc.py | ECrownofFire/chaos | 0cfbb85ab52654967909aef54eff3a0e62b641bd | [
"MIT"
] | 248 | 2017-05-23T02:00:07.000Z | 2017-05-26T00:00:28.000Z | from encryption import decrypt
def GetKeys(twitter_keys_path):
consumer_key = ''
consumer_secret = ''
access_token = ''
access_secret = ''
PATH = 'twitter_keys/'
l_files = ['consumer_key', 'consumer_secret', 'access_token', 'access_secret']
for k in l_files:
f = open(PATH + k, 'rb... | 35.465116 | 82 | 0.537705 |
1d2a8478c9b4633e992278b573132773fe8c0cfa | 1,665 | py | Python | mediagoblin/media_types/stl/__init__.py | acidburn0zzz/mediagoblin | 8fc57eaaa6e22358a1220a0baf589a4b20dd8cfe | [
"CC0-1.0"
] | 1 | 2018-12-19T00:05:55.000Z | 2018-12-19T00:05:55.000Z | mediagoblin/media_types/stl/__init__.py | acidburn0zzz/mediagoblin | 8fc57eaaa6e22358a1220a0baf589a4b20dd8cfe | [
"CC0-1.0"
] | null | null | null | mediagoblin/media_types/stl/__init__.py | acidburn0zzz/mediagoblin | 8fc57eaaa6e22358a1220a0baf589a4b20dd8cfe | [
"CC0-1.0"
] | null | null | null | # GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either versio... | 35.425532 | 77 | 0.770571 |
1d2affa8d7a212423d943509e0b5550a9d6f205a | 11,189 | py | Python | client/core/billing.py | vbohinc/CommunityCellularManager | ab330fcb1bc70ee3a8e9bcdac2846ab6c327f87c | [
"BSD-3-Clause"
] | null | null | null | client/core/billing.py | vbohinc/CommunityCellularManager | ab330fcb1bc70ee3a8e9bcdac2846ab6c327f87c | [
"BSD-3-Clause"
] | 3 | 2021-03-20T00:02:37.000Z | 2022-02-11T03:46:59.000Z | client/core/billing.py | vbohinc/CommunityCellularManager | ab330fcb1bc70ee3a8e9bcdac2846ab6c327f87c | [
"BSD-3-Clause"
] | null | null | null | """Credit management utilities.
Note that subscriber credit operations are handled in core.subscriber.
Copyright (c) 2016-present, Facebook, 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. An additional grant
of p... | 36.805921 | 83 | 0.669676 |
1d2b16e960d980ac6a6c28dff891b1d7297ce7c2 | 1,866 | py | Python | neural_pi/experiment.py | tarik/pi-snm-qde | 61b0d60b5e7a56454d313693c2d1a9694879f1dc | [
"MIT"
] | 8 | 2020-08-05T18:02:20.000Z | 2022-03-16T17:41:13.000Z | neural_pi/experiment.py | tarik/pi-snm-qde | 61b0d60b5e7a56454d313693c2d1a9694879f1dc | [
"MIT"
] | 1 | 2021-05-17T15:43:22.000Z | 2021-07-12T20:29:12.000Z | neural_pi/experiment.py | tarik/pi-snm-qde | 61b0d60b5e7a56454d313693c2d1a9694879f1dc | [
"MIT"
] | 1 | 2021-12-10T12:20:24.000Z | 2021-12-10T12:20:24.000Z | import os
import shutil
import tempfile
import sacred
from . import utils
class Experiment(sacred.Experiment):
_temp_dir: str
_artifacts_dir: str
def __init__(self, name, template=None, logger=None, runs_dir='runs', temp_dir='temp'):
super().__init__(name)
self._name = name # `self.pat... | 30.590164 | 100 | 0.64523 |
1d2b442dab461d46d34d9ac7352869b8c7cd28d0 | 5,736 | py | Python | tests/test_utils.py | xuefeicao/mmf | 2ff00626ec2bc6b56a543da0dc2869c548e81fec | [
"BSD-3-Clause"
] | null | null | null | tests/test_utils.py | xuefeicao/mmf | 2ff00626ec2bc6b56a543da0dc2869c548e81fec | [
"BSD-3-Clause"
] | null | null | null | tests/test_utils.py | xuefeicao/mmf | 2ff00626ec2bc6b56a543da0dc2869c548e81fec | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
import argparse
import itertools
import os
import platform
import random
import socket
import tempfile
import unittest
import pytorch_lightning as pl
import torch
from mmf.common.sample import Sample, SampleList
from mmf.utils.general import get_current_device
def ... | 28.969697 | 88 | 0.667887 |
1d2b85a49e89725429b54bd9113cbddb061a3203 | 11,891 | py | Python | api/test/api/responders_test/resource/test_scheduled_scans.py | korenlev/calipso-cvim | 39278a5cf09c40b26a8a143ccc0c8d437961abc2 | [
"Apache-2.0"
] | null | null | null | api/test/api/responders_test/resource/test_scheduled_scans.py | korenlev/calipso-cvim | 39278a5cf09c40b26a8a143ccc0c8d437961abc2 | [
"Apache-2.0"
] | null | null | null | api/test/api/responders_test/resource/test_scheduled_scans.py | korenlev/calipso-cvim | 39278a5cf09c40b26a8a143ccc0c8d437961abc2 | [
"Apache-2.0"
] | null | null | null | ###############################################################################
# Copyright (c) 2017-2020 Koren Lev (Cisco Systems), #
# Yaron Yogev (Cisco Systems), Ilia Abashin (Cisco Systems) and others #
# #
... | 47.947581 | 84 | 0.440081 |
1d2b916532ba3966abc4be0bccc64dc62b346db8 | 4,028 | py | Python | alipay/aop/api/request/AlipayFundJointaccountFundBtocTransferRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/request/AlipayFundJointaccountFundBtocTransferRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/request/AlipayFundJointaccountFundBtocTransferRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayFundJointaccountFundBtocTransferModel import AlipayFundJointaccountFundBtocTransferModel
class AlipayFundJointaccountFundBtocT... | 27.77931 | 148 | 0.649454 |
1d2ba4be7f83a952dae7b7a04bcc04398869bf07 | 129,663 | py | Python | libcloud/compute/drivers/openstack.py | cheald/libcloud | 1a3ebe5d60de6475a8a2384d864475de0abd73cf | [
"Apache-2.0"
] | null | null | null | libcloud/compute/drivers/openstack.py | cheald/libcloud | 1a3ebe5d60de6475a8a2384d864475de0abd73cf | [
"Apache-2.0"
] | null | null | null | libcloud/compute/drivers/openstack.py | cheald/libcloud | 1a3ebe5d60de6475a8a2384d864475de0abd73cf | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | 35.14855 | 120 | 0.559458 |
1d2ba93a6c0b2735e5fb83c942160f6fd35fd274 | 2,248 | py | Python | models/CC.py | stanstarks/C3 | 6008e9f30a19166f805e83c3022f5a332d5c5ca3 | [
"MIT"
] | 2 | 2019-06-10T02:26:47.000Z | 2020-06-07T10:18:58.000Z | models/CC.py | stanstarks/C3 | 6008e9f30a19166f805e83c3022f5a332d5c5ca3 | [
"MIT"
] | null | null | null | models/CC.py | stanstarks/C3 | 6008e9f30a19166f805e83c3022f5a332d5c5ca3 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
import pdb
class CrowdCounter(nn.Module):
def __init__(self, gpus, model_name):
super(CrowdCounter, self).__init__()
if model_name == 'AlexNet':
from .SCC_Model.AlexNet import AlexNet as net
elif model_name == '... | 37.466667 | 86 | 0.618772 |
1d2bec121b37213ecf5cf7b438a6ed5c37a32220 | 1,638 | py | Python | common/api.py | pythings/PythingsOS | 276b41a32af7fa0d5395b2bb308e611f784f9711 | [
"Apache-2.0"
] | 11 | 2020-01-15T14:25:48.000Z | 2021-11-25T04:21:18.000Z | common/api.py | Pythings/PythingsOS | 276b41a32af7fa0d5395b2bb308e611f784f9711 | [
"Apache-2.0"
] | 8 | 2021-02-04T16:41:57.000Z | 2022-03-29T21:57:15.000Z | common/api.py | pythings/PythingsOS | 276b41a32af7fa0d5395b2bb308e611f784f9711 | [
"Apache-2.0"
] | null | null | null |
import env
import logger
import json
try:
from http_extended import post
except ImportError:
from http import post
import gc
apiver='v1'
# Utility
def check_response(response):
if response['status'] not in [b'200', 200]:
try:
msg=response['content']
if not msg: msg=respons... | 34.851064 | 159 | 0.672161 |
1d2bf6dd0d9fb15833701cadd6892fd78c5527f1 | 9,758 | py | Python | coding.py | Glank/Galois | 72a630122962cd38e9c79bcf03d671fba09ed07e | [
"MIT"
] | 31 | 2015-05-08T09:22:33.000Z | 2020-11-30T11:14:18.000Z | coding.py | Glank/Galois | 72a630122962cd38e9c79bcf03d671fba09ed07e | [
"MIT"
] | 1 | 2018-05-08T12:33:45.000Z | 2018-05-18T09:19:12.000Z | coding.py | Glank/Galois | 72a630122962cd38e9c79bcf03d671fba09ed07e | [
"MIT"
] | 15 | 2016-03-05T13:03:56.000Z | 2021-09-08T17:53:42.000Z | import random
import math
import operator
import copy
from galois import *
class Matrix:
def __init__(self, rows=1, cols=1, data=[], fill=None):
self.rows = rows
self.cols = cols
if data:
self.data = data
self.rows = len(data)
self.cols = len(data[0])
... | 30.782334 | 73 | 0.516397 |
1d2c048de702e2d9f8dba15cadc85916eadaf3cf | 3,176 | py | Python | 2019/10/main.py | frenzymadness/aoc | c9018e757bae61a696e675a827aef873995abdd3 | [
"WTFPL"
] | 2 | 2020-12-04T09:45:38.000Z | 2020-12-07T14:06:12.000Z | 2019/10/main.py | frenzymadness/aoc | c9018e757bae61a696e675a827aef873995abdd3 | [
"WTFPL"
] | null | null | null | 2019/10/main.py | frenzymadness/aoc | c9018e757bae61a696e675a827aef873995abdd3 | [
"WTFPL"
] | null | null | null | import math
def _get_map(file):
map = []
with open(file) as f:
for line in f.readlines():
map_line = []
for x in line.rstrip():
map_line.append(x)
map.append(map_line)
return map
def _find_asteroid_pos(map, width, height, x, y, dx, dy):
pos... | 31.76 | 119 | 0.596977 |
1d2c09e453f6e9efe97267a817c0f5e7754e5fd2 | 11,122 | py | Python | molotov/tests/test_fmwk.py | jldiaz-uniovi/molotov | 137864eb4ca7301303af21aadadd3f735dd0d042 | [
"Apache-2.0"
] | 401 | 2017-01-25T13:42:37.000Z | 2022-03-27T21:29:18.000Z | molotov/tests/test_fmwk.py | jldiaz-uniovi/molotov | 137864eb4ca7301303af21aadadd3f735dd0d042 | [
"Apache-2.0"
] | 131 | 2017-01-19T20:34:40.000Z | 2022-03-02T12:49:32.000Z | molotov/tests/test_fmwk.py | jldiaz-uniovi/molotov | 137864eb4ca7301303af21aadadd3f735dd0d042 | [
"Apache-2.0"
] | 31 | 2017-01-26T01:18:55.000Z | 2022-03-25T15:11:42.000Z | import os
import signal
from molotov.session import get_session
from molotov.runner import Runner
from molotov.worker import Worker
from molotov.util import get_var, set_var, json_request, request, stop_reason
from molotov.api import (
scenario,
setup,
global_setup,
teardown,
global_teardown,
se... | 27.461728 | 87 | 0.578133 |
1d2c1a0237cc2add6c9b98bd6baa21c332d539f2 | 5,410 | py | Python | genomic_data_service/rnaseq/rnaget/constants.py | ENCODE-DCC/genomic-data-service | 954017a5bcc5f448fbe2867768186df5e066c67c | [
"MIT"
] | 3 | 2020-10-26T02:15:55.000Z | 2022-01-26T18:39:09.000Z | genomic_data_service/rnaseq/rnaget/constants.py | ENCODE-DCC/genomic-data-service | 954017a5bcc5f448fbe2867768186df5e066c67c | [
"MIT"
] | 3 | 2021-08-17T02:01:54.000Z | 2022-03-30T17:14:02.000Z | genomic_data_service/rnaseq/rnaget/constants.py | ENCODE-DCC/genomic-data-service | 954017a5bcc5f448fbe2867768186df5e066c67c | [
"MIT"
] | 1 | 2022-03-24T21:15:34.000Z | 2022-03-24T21:15:34.000Z | PROJECTS = [
{
'id': 'ENCODE',
'name': 'ENCODE: Encyclopedia of DNA Elements',
'description': 'The Encyclopedia of DNA Elements (ENCODE) Consortium is an international collaboration of research groups funded by the National Human Genome Research Institute (NHGRI). The goal of ENCODE is to bu... | 33.8125 | 1,036 | 0.616451 |
1d2c1d2398468b7ded76c43de802d85bb88ff643 | 25,951 | py | Python | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2021_08_01_preview/operations/_private_endpoint_connections_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2021-09-07T18:39:05.000Z | 2021-09-07T18:39:05.000Z | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2021_08_01_preview/operations/_private_endpoint_connections_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2021_08_01_preview/operations/_private_endpoint_connections_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 45.849823 | 257 | 0.691072 |
1d2c250ebe1e37d4412379239e0945889996febc | 802 | py | Python | utils/config.py | VVRud/u-segnet | d73579e5990505ef802f1be1d902127123df1963 | [
"Apache-2.0"
] | 8 | 2019-03-04T02:38:59.000Z | 2022-03-31T04:03:08.000Z | utils/config.py | VVRud/u-segnet | d73579e5990505ef802f1be1d902127123df1963 | [
"Apache-2.0"
] | null | null | null | utils/config.py | VVRud/u-segnet | d73579e5990505ef802f1be1d902127123df1963 | [
"Apache-2.0"
] | 1 | 2019-12-13T16:54:28.000Z | 2019-12-13T16:54:28.000Z | import json
from easydict import EasyDict
import os
def get_config_from_json(json_file):
"""
Get the config from a json file
:param json_file:
:return: config(namespace) or config(dictionary)
"""
# parse the configurations from the config json file provided
with open(json_file, 'r') as con... | 27.655172 | 65 | 0.694514 |
1d2c3841c80371c5da084f9184fd8ceb0ec2879a | 2,847 | py | Python | src/tests/ModMultiplierTest/ModMultiplierTester.py | wengwz/poseidon-spinalhdl | 16f60c4e21fc893622620a4d46d13bd31ac03d81 | [
"MIT"
] | 1 | 2022-01-16T18:20:12.000Z | 2022-01-16T18:20:12.000Z | src/tests/ModMultiplierTest/ModMultiplierTester.py | datenlord/poseidon-spinal | 601d097216e3929f2c576d7e7c68913a5ec5b22e | [
"MIT"
] | null | null | null | src/tests/ModMultiplierTest/ModMultiplierTester.py | datenlord/poseidon-spinal | 601d097216e3929f2c576d7e7c68913a5ec5b22e | [
"MIT"
] | null | null | null | import cocotb
import random
from cocotb.clock import Clock
from cocotb.result import TestSuccess
from cocotb.triggers import RisingEdge
from queue import Queue
from poseidon_python import finite_field as ff
CASES_NUM = 3000 # the number of test cases
class ModMultiplierTester:
def __init__(self, target):
... | 30.612903 | 84 | 0.594661 |
1d2c3aae674fdcdcf648c23d0f129cd536c80e3b | 12,000 | py | Python | src/ntimporters/todoist/importer.py | Nozbe/NTImporters | 12fa898efd41954b5c29bae383aba5ac56044e87 | [
"MIT"
] | 6 | 2022-01-03T07:07:18.000Z | 2022-03-21T08:13:49.000Z | src/ntimporters/todoist/importer.py | Nozbe/NTImporters | 12fa898efd41954b5c29bae383aba5ac56044e87 | [
"MIT"
] | 1 | 2022-02-02T13:01:05.000Z | 2022-02-10T12:01:17.000Z | src/ntimporters/todoist/importer.py | Nozbe/NTImporters | 12fa898efd41954b5c29bae383aba5ac56044e87 | [
"MIT"
] | 1 | 2022-02-10T11:53:55.000Z | 2022-02-10T11:53:55.000Z | """Todoist -> Nozbe importer"""
import functools
from dataclasses import dataclass
from typing import Optional
import openapi_client as nt
from dateutil.parser import isoparse
from ntimporters.utils import (
API_HOST,
ImportException,
add_to_project_group,
check_limits,
get_projects_per_team,
g... | 35.294118 | 100 | 0.609417 |
1d2c4014888b9177ca705ab7b4ae2c7f8532686e | 41 | py | Python | nectarchain/tools/__init__.py | frnbrun/nectarchain | 697b466f269c336c064d836dc619a1d286be039a | [
"BSD-3-Clause"
] | 5 | 2019-07-15T08:53:33.000Z | 2022-02-14T12:29:27.000Z | nectarchain/tools/__init__.py | jlenain/nectarchain | 7f01e3bae35d86634c94fa63428ef3e888d36ac3 | [
"BSD-3-Clause"
] | 12 | 2019-07-16T07:58:56.000Z | 2022-03-11T13:18:23.000Z | nectarchain/tools/__init__.py | jlenain/nectarchain | 7f01e3bae35d86634c94fa63428ef3e888d36ac3 | [
"BSD-3-Clause"
] | 7 | 2019-07-18T12:42:48.000Z | 2022-01-18T17:50:22.000Z |
"""nectarchain command line tools.
"""
| 8.2 | 34 | 0.658537 |
1d2c96d09e32fb809c682d04d016ae06fc1bc195 | 5,494 | py | Python | tests/test_metricdef.py | axonchisel/ax_metrics | a2db75c9ef9a9752997ccb112e8db68c1c8584a0 | [
"MIT"
] | 10 | 2016-08-26T18:57:28.000Z | 2021-09-19T19:21:16.000Z | tests/test_metricdef.py | axonchisel/ax_metrics | a2db75c9ef9a9752997ccb112e8db68c1c8584a0 | [
"MIT"
] | 1 | 2015-01-08T19:54:54.000Z | 2015-01-09T01:24:17.000Z | tests/test_metricdef.py | axonchisel/ax_metrics | a2db75c9ef9a9752997ccb112e8db68c1c8584a0 | [
"MIT"
] | 3 | 2015-01-08T23:32:58.000Z | 2016-09-23T02:38:26.000Z | """
Ax_Metrics - Test foundation metricdef package (not including MDefL parsing)
------------------------------------------------------------------------------
Author: Dan Kamins <dos at axonchisel dot net>
Copyright (c) 2014 Dan Kamins, AxonChisel.net
"""
# ----------------------------------------------------------... | 28.915789 | 78 | 0.573899 |
1d2c9f7c7ef791b4174c9bc6655f36f2d31c9659 | 1,390 | py | Python | LC/337.py | szhu3210/LeetCode_Solutions | 64747eb172c2ecb3c889830246f3282669516e10 | [
"MIT"
] | 2 | 2018-02-24T17:20:02.000Z | 2018-02-24T17:25:43.000Z | LC/337.py | szhu3210/LeetCode_Solutions | 64747eb172c2ecb3c889830246f3282669516e10 | [
"MIT"
] | null | null | null | LC/337.py | szhu3210/LeetCode_Solutions | 64747eb172c2ecb3c889830246f3282669516e10 | [
"MIT"
] | null | null | null | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def rob(self, root):
"""
:type root: TreeNode
:rtype: int
"""
## top down DP (mem... | 36.578947 | 156 | 0.532374 |
1d2d364a79b3075cc16d258995ea31357be4db63 | 5,250 | py | Python | skorecard/features_bucket_mapping.py | satya-pattnaik/skorecard | ba31821799985052ffb498569b41e969034ea28e | [
"MIT"
] | 31 | 2021-06-10T13:35:07.000Z | 2022-03-30T12:34:26.000Z | skorecard/features_bucket_mapping.py | satya-pattnaik/skorecard | ba31821799985052ffb498569b41e969034ea28e | [
"MIT"
] | 50 | 2021-06-10T10:56:34.000Z | 2022-01-26T18:23:31.000Z | skorecard/features_bucket_mapping.py | satya-pattnaik/skorecard | ba31821799985052ffb498569b41e969034ea28e | [
"MIT"
] | 2 | 2021-09-09T00:44:17.000Z | 2021-09-24T17:08:32.000Z | import yaml
import dataclasses
from skorecard.bucket_mapping import BucketMapping, merge_bucket_mapping
class FeaturesBucketMapping:
"""Stores a collection of features BucketMapping.
```python
from skorecard.bucket_mapping import BucketMapping
from skorecard.features_bucket_mapping import FeaturesBu... | 28.074866 | 111 | 0.60419 |
1d2d372badb281daa58e8ed85187b24dc8a68353 | 2,614 | py | Python | tests/test_functions.py | ritabt/petra | a7b391cdcd34f07ca201e2a396e141a3d2f12884 | [
"Apache-2.0"
] | null | null | null | tests/test_functions.py | ritabt/petra | a7b391cdcd34f07ca201e2a396e141a3d2f12884 | [
"Apache-2.0"
] | null | null | null | tests/test_functions.py | ritabt/petra | a7b391cdcd34f07ca201e2a396e141a3d2f12884 | [
"Apache-2.0"
] | 1 | 2020-04-13T20:12:26.000Z | 2020-04-13T20:12:26.000Z | from typing import cast, Callable
import petra as pt
import unittest
from ctypes import CFUNCTYPE, c_int32
program = pt.Program("module")
x, y = pt.Symbol(pt.Int32_t, "x"), pt.Symbol(pt.Int32_t, "y")
program.add_func("return_2", (), pt.Int32_t, pt.Block([pt.Return(pt.Int32(2))]))
program.add_func(
"call_retur... | 30.752941 | 87 | 0.607498 |
1d2d7e7b1b7d747b3ca733b1fa7ac00a0e0b40c4 | 940 | py | Python | 07-Game-Engine/EntityMineCraft.py | NguyenQuangBinh803/Python-Heritage | 7da72b2926cefc4903086a1cab7de3a64764d648 | [
"MIT"
] | 1 | 2021-01-10T12:06:26.000Z | 2021-01-10T12:06:26.000Z | 07-Game-Engine/EntityMineCraft.py | NguyenQuangBinh803/Python-Heritage | 7da72b2926cefc4903086a1cab7de3a64764d648 | [
"MIT"
] | null | null | null | 07-Game-Engine/EntityMineCraft.py | NguyenQuangBinh803/Python-Heritage | 7da72b2926cefc4903086a1cab7de3a64764d648 | [
"MIT"
] | null | null | null |
from ursina import *
from ursina.prefabs.first_person_controller import FirstPersonController
app = Ursina()
# Define a Voxel class.
# By setting the parent to scene and the model to 'cube' it becomes a 3d button.
class Voxel(Button):
def __init__(self, position=(0,0,0)):
super().__init__(
... | 24.102564 | 80 | 0.57234 |
1d2daf66f1b9770b9558daa45c153a32b4410727 | 1,709 | py | Python | affine/rref.py | OSU-slatelab/geometric-embedding-properties | 0436d86303439681ad74aa4d29a53a15953cbb88 | [
"MIT"
] | 3 | 2019-06-06T18:57:22.000Z | 2020-04-03T07:47:14.000Z | affine/rref.py | OSU-slatelab/geometric-embedding-properties | 0436d86303439681ad74aa4d29a53a15953cbb88 | [
"MIT"
] | null | null | null | affine/rref.py | OSU-slatelab/geometric-embedding-properties | 0436d86303439681ad74aa4d29a53a15953cbb88 | [
"MIT"
] | 1 | 2019-09-23T20:44:04.000Z | 2019-09-23T20:44:04.000Z | import numpy as np
def rref(B, tol=1e-8, debug=False):
A = B.copy()
rows, cols = A.shape
r = 0
pivots_pos = []
row_exchanges = np.arange(rows)
for c in range(cols):
if debug: print "Now at row", r, "and col", c, "with matrix:"; print A
## Find the pivot row:
pivot = np.argmax (np.abs (A[r:rows... | 32.865385 | 90 | 0.561147 |
1d2dc2271497ee8d7882f295a7456186352cdcad | 4,407 | py | Python | transformers/nlp/text_binary_count_transformer.py | h2oai/driverlessai-recipes | 508663ed6bd1961925fcb29fde268493fe40e9e8 | [
"Apache-2.0"
] | 194 | 2019-04-23T10:25:13.000Z | 2022-03-29T04:19:28.000Z | transformers/nlp/text_binary_count_transformer.py | h2oai/driverlessai-recipes | 508663ed6bd1961925fcb29fde268493fe40e9e8 | [
"Apache-2.0"
] | 50 | 2019-06-24T20:17:51.000Z | 2022-03-16T20:05:37.000Z | transformers/nlp/text_binary_count_transformer.py | h2oai/driverlessai-recipes | 508663ed6bd1961925fcb29fde268493fe40e9e8 | [
"Apache-2.0"
] | 85 | 2019-03-27T12:26:43.000Z | 2022-01-27T13:15:37.000Z | """Explainable Text transformer that uses binary counts of words using sklearn's CountVectorizer"""
import datatable as dt
import numpy as np
import pandas as pd
from h2oaicore.systemutils import IgnoreEntirelyError
from sklearn.feature_extraction.text import CountVectorizer
from h2oaicore.transformer_utils import Cus... | 45.43299 | 117 | 0.623327 |
1d2de81c45c9b5169619db873214091a18ff14e9 | 108,703 | py | Python | tensorlayer/prepro.py | lllcho/tensorlayer | 87591b4945a6a67dfb4ea797a575efae997fd9d2 | [
"Apache-2.0"
] | 14 | 2021-02-24T07:01:53.000Z | 2022-03-20T23:32:36.000Z | tensorlayer/prepro.py | lllcho/tensorlayer | 87591b4945a6a67dfb4ea797a575efae997fd9d2 | [
"Apache-2.0"
] | 1 | 2021-10-02T19:36:17.000Z | 2021-11-24T14:31:29.000Z | tensorlayer/prepro.py | lllcho/tensorlayer | 87591b4945a6a67dfb4ea797a575efae997fd9d2 | [
"Apache-2.0"
] | 5 | 2020-12-27T09:03:23.000Z | 2021-12-03T20:36:18.000Z | # -*- coding: utf-8 -*-
import threading, time, scipy, skimage
import numpy as np
import scipy.ndimage as ndi
# import tensorlayer as tl
from scipy import linalg
from scipy.ndimage.filters import gaussian_filter
from scipy.ndimage.interpolation import map_coordinates
from six.moves import range
from skimage import exp... | 34.076176 | 335 | 0.593452 |
1d2dead309895bb3d62ab986b665fc597dfd6d2e | 1,685 | py | Python | qurator/dinglehopper/tests/test_integ_word_error_rate_ocr.py | JKamlah/dinglehopper | 40ab1c07747e0bb888a7f06b249835e375235e71 | [
"Apache-2.0"
] | null | null | null | qurator/dinglehopper/tests/test_integ_word_error_rate_ocr.py | JKamlah/dinglehopper | 40ab1c07747e0bb888a7f06b249835e375235e71 | [
"Apache-2.0"
] | null | null | null | qurator/dinglehopper/tests/test_integ_word_error_rate_ocr.py | JKamlah/dinglehopper | 40ab1c07747e0bb888a7f06b249835e375235e71 | [
"Apache-2.0"
] | null | null | null | from __future__ import division, print_function
import os
import pytest
from lxml import etree as ET
from .. import word_error_rate, words, page_text, alto_text
data_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data')
@pytest.mark.integration
def test_word_error_rate_between_page_files():
#... | 38.295455 | 119 | 0.726409 |
1d2e1005d6880317a52745b922e5749ce61a5925 | 3,384 | py | Python | google-datacatalog-sisense-connector/src/google/datacatalog_connectors/sisense/addons/elasticube_dependency_printer.py | anugrah86/datacatalog-connectors-bi | 58cc57e12632cbd1e237b3d6930e519333c51f4e | [
"Apache-2.0"
] | 27 | 2020-04-27T21:55:49.000Z | 2022-02-18T22:09:13.000Z | google-datacatalog-sisense-connector/src/google/datacatalog_connectors/sisense/addons/elasticube_dependency_printer.py | anugrah86/datacatalog-connectors-bi | 58cc57e12632cbd1e237b3d6930e519333c51f4e | [
"Apache-2.0"
] | 36 | 2020-05-01T15:26:14.000Z | 2022-03-26T00:09:19.000Z | google-datacatalog-sisense-connector/src/google/datacatalog_connectors/sisense/addons/elasticube_dependency_printer.py | anugrah86/datacatalog-connectors-bi | 58cc57e12632cbd1e237b3d6930e519333c51f4e | [
"Apache-2.0"
] | 18 | 2020-04-30T22:14:09.000Z | 2022-01-13T10:28:03.000Z | #!/usr/bin/python
#
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 36.387097 | 77 | 0.60727 |
1d2e1711f5d8739b2676e52da1303d50e56d9f1d | 2,304 | py | Python | code/baselines/fasttext_vectorize_ru.py | RefalMachine/diachronic-wordnets | 29f525ae282dd45f1ecb1f0723d9266f4beee572 | [
"Apache-2.0"
] | 3 | 2020-11-22T15:28:09.000Z | 2022-01-25T21:28:58.000Z | code/baselines/fasttext_vectorize_ru.py | RefalMachine/diachronic-wordnets | 29f525ae282dd45f1ecb1f0723d9266f4beee572 | [
"Apache-2.0"
] | null | null | null | code/baselines/fasttext_vectorize_ru.py | RefalMachine/diachronic-wordnets | 29f525ae282dd45f1ecb1f0723d9266f4beee572 | [
"Apache-2.0"
] | 2 | 2020-11-22T15:27:50.000Z | 2021-09-05T11:17:53.000Z | import os
import sys
from collections import defaultdict
from ruwordnet.ruwordnet_reader import RuWordnet
from vectorizers.fasttext_vectorizer import FasttextVectorizer
def process_data(vectorizer, input_file, output_file):
with open(input_file, 'r', encoding='utf-8') as f:
dataset = f.read().l... | 39.724138 | 121 | 0.644965 |
1d2e19c69baa5986d4534d8b3a43f86ff240dd85 | 968 | py | Python | Chapter10/ch10/pool.py | clperez/Learn-Python-Programming-Second-Edition | e43fc293726c510e16475d7fb5551d5cbb5ee303 | [
"MIT"
] | 55 | 2018-07-04T10:12:15.000Z | 2022-03-03T19:51:54.000Z | Chapter10/ch10/pool.py | clperez/Learn-Python-Programming-Second-Edition | e43fc293726c510e16475d7fb5551d5cbb5ee303 | [
"MIT"
] | 6 | 2020-03-24T16:37:46.000Z | 2021-06-10T21:04:36.000Z | Chapter10/ch10/pool.py | clperez/Learn-Python-Programming-Second-Edition | e43fc293726c510e16475d7fb5551d5cbb5ee303 | [
"MIT"
] | 32 | 2018-07-10T05:56:31.000Z | 2021-09-04T23:19:42.000Z | from concurrent.futures import ThreadPoolExecutor, as_completed
from random import randint
import threading
def run(name):
value = randint(0, 10**2)
tname = threading.current_thread().name
print(f'Hi, I am {name} ({tname}) and my value is {value}')
return (name, value)
with ThreadPoolExecutor(max_wo... | 28.470588 | 63 | 0.706612 |
1d2e381e6a67fc7c729d5ce55ae17245d26ac37c | 12,467 | py | Python | stormlabeler/utils/human_polygons_test.py | thunderhoser/StormLabeler | 93c0613d03cf4d105f3252df92854a86e6ff38ba | [
"MIT"
] | 2 | 2021-11-29T14:26:40.000Z | 2021-12-29T06:20:50.000Z | stormlabeler/utils/human_polygons_test.py | thunderhoser/StormLabeler | 93c0613d03cf4d105f3252df92854a86e6ff38ba | [
"MIT"
] | null | null | null | stormlabeler/utils/human_polygons_test.py | thunderhoser/StormLabeler | 93c0613d03cf4d105f3252df92854a86e6ff38ba | [
"MIT"
] | 2 | 2021-02-12T19:34:10.000Z | 2021-11-29T14:26:43.000Z | """Unit tests for human_polygons.py."""
import unittest
import numpy
from stormlabeler.utils import polygons
from stormlabeler.utils import human_polygons
TOLERANCE = 1e-6
TOLERANCE_NUM_DECIMAL_PLACES = 6
# The following constants are used to test _vertex_list_to_polygon_list and
# _polygon_list_to_vertex_list.
TOY_... | 34.824022 | 80 | 0.701452 |
1d2e3d2efff8dbcfc5dbf7a2395c42c519c52312 | 1,487 | py | Python | 7/Lab7.py | aravindsuresh98/ML_LAB | 2dbd8075a2119c02ce31de4325763058e41b592c | [
"MIT"
] | 3 | 2018-12-26T18:03:56.000Z | 2019-08-28T09:09:02.000Z | 7/Lab7.py | aravindsuresh98/ML_LAB | 2dbd8075a2119c02ce31de4325763058e41b592c | [
"MIT"
] | null | null | null | 7/Lab7.py | aravindsuresh98/ML_LAB | 2dbd8075a2119c02ce31de4325763058e41b592c | [
"MIT"
] | 2 | 2018-12-09T17:40:12.000Z | 2019-10-01T04:08:10.000Z | """
Write a program to construct aBayesian network considering medical data. Use this model to demonstrate the diagnosis of heart patients using standard Heart Disease Data Set. You can use Java/Python ML library classes/API.
"""
import numpy as np
import pandas as pd
import csv
from pgmpy.estimators import Maximu... | 33.795455 | 222 | 0.752522 |
1d2e41fa3684a844181d56580d8488279b9658d1 | 13,383 | py | Python | tbonlineproject/post/views.py | nathangeffen/tbonline3 | 1b8a3af8d2dc1ee8083ca6638d025e94bd98f253 | [
"MIT"
] | null | null | null | tbonlineproject/post/views.py | nathangeffen/tbonline3 | 1b8a3af8d2dc1ee8083ca6638d025e94bd98f253 | [
"MIT"
] | 3 | 2021-06-08T23:57:13.000Z | 2022-01-13T03:42:01.000Z | tbonlineproject/post/views.py | nathangeffen/tbonline-2 | 0d5869197e66a0057fa07cb99f21dde7f5b47c30 | [
"MIT"
] | null | null | null | # Create your views here.
import datetime
import os
from django.contrib.auth.decorators import user_passes_test
from django.contrib.markup.templatetags.markup import markdown
from django.contrib import messages
from django.core.cache import cache
from django.core.urlresolvers import reverse
from django.forms.formset... | 41.562112 | 136 | 0.602481 |
1d2e6d6eaa03fbc368fdfcf9585918c7f9d6cbad | 3,912 | py | Python | cache-simulator/run_cache_eval.py | zdvresearch/fast15-paper-addons | 8001f658ba819202186bf84892f4718eefd021fe | [
"MIT"
] | null | null | null | cache-simulator/run_cache_eval.py | zdvresearch/fast15-paper-addons | 8001f658ba819202186bf84892f4718eefd021fe | [
"MIT"
] | null | null | null | cache-simulator/run_cache_eval.py | zdvresearch/fast15-paper-addons | 8001f658ba819202186bf84892f4718eefd021fe | [
"MIT"
] | null | null | null | import subprocess
import glob
import os
import sys
import shutil
import datetime
import threading
import subprocess
import shlex
import json
class Runner(threading.Thread):
def __init__(self, id, lock, config_dir, wip_dir, results_dir, failed_dir, config_filter):
threading.Thread.__init__(self)
sel... | 32.6 | 132 | 0.576176 |
1d2e7afdd8e9bc1b5f8ce58cf8fa905c63718a02 | 9,880 | py | Python | .util/deployment_checks.py | GoogleCloudPlatform/django-demo-app-unicodex | d916c48bd0a4ecb5aa7b9e0722d20ae7f59f3107 | [
"Apache-2.0"
] | 79 | 2019-10-01T14:00:52.000Z | 2022-03-28T13:27:00.000Z | .util/deployment_checks.py | GoogleCloudPlatform/django-demo-app-unicodex | d916c48bd0a4ecb5aa7b9e0722d20ae7f59f3107 | [
"Apache-2.0"
] | 7 | 2020-01-24T03:31:50.000Z | 2022-01-17T05:35:33.000Z | .util/deployment_checks.py | GoogleCloudPlatform/django-demo-app-unicodex | d916c48bd0a4ecb5aa7b9e0722d20ae7f59f3107 | [
"Apache-2.0"
] | 30 | 2019-10-09T01:10:47.000Z | 2022-03-28T13:27:23.000Z | import json
import subprocess
from io import StringIO
from urllib.parse import urlparse
import click
import googleapiclient
import httpx
from bs4 import BeautifulSoup as bs4
from dotenv import dotenv_values
from google.api_core import exceptions
from google.cloud import secretmanager as sml
from googleapiclient.discov... | 32.607261 | 88 | 0.628036 |
1d2e9bf7cdc45083432b2d159c0a8ec3cdb0301c | 9,788 | py | Python | scapy/scapy/scapypipes.py | jreynders/BLESuite-1 | 1c3c15fc2d4e30c3f9c1a15e0268cae84685784b | [
"MIT"
] | null | null | null | scapy/scapy/scapypipes.py | jreynders/BLESuite-1 | 1c3c15fc2d4e30c3f9c1a15e0268cae84685784b | [
"MIT"
] | null | null | null | scapy/scapy/scapypipes.py | jreynders/BLESuite-1 | 1c3c15fc2d4e30c3f9c1a15e0268cae84685784b | [
"MIT"
] | null | null | null | # This file is part of Scapy
# See http://www.secdev.org/projects/scapy for more informations
# Copyright (C) Philippe Biondi <phil@secdev.org>
# This program is published under a GPLv2 license
from __future__ import print_function
import socket
from scapy.modules.six.moves.queue import Queue, Empty
from scapy.pipetoo... | 23.472422 | 111 | 0.504087 |
1d2e9e7f1ca17c6f3b50d908132befbc5025bbe8 | 3,439 | py | Python | mozz_archiver/settings/local.py | michael-lazar/mozz-archiver | 12617d2efca91663699647654bcd3e40f5f388f2 | [
"BlueOak-1.0.0"
] | 9 | 2020-09-17T05:44:26.000Z | 2022-02-10T07:25:47.000Z | mozz_archiver/settings/local.py | michael-lazar/mozz-archiver | 12617d2efca91663699647654bcd3e40f5f388f2 | [
"BlueOak-1.0.0"
] | 9 | 2020-09-24T03:17:40.000Z | 2020-11-07T04:34:35.000Z | mozz_archiver/settings/local.py | michael-lazar/mozz-archiver | 12617d2efca91663699647654bcd3e40f5f388f2 | [
"BlueOak-1.0.0"
] | null | null | null | # Scrapy settings for mozz_archiver project
PROJECT_URL = "https://github.com/michael-lazar/mozz-archiver"
BOT_NAME = 'mozz_archiver'
VERSION = '1.1.0'
SPIDER_MODULES = ['mozz_archiver.spiders']
NEWSPIDER_MODULE = 'mozz_archiver.spiders'
# Crawl responsibly by identifying yourself (and your website) on the user-age... | 30.981982 | 99 | 0.790637 |
1d2ea14289388533eadef89d50e1fbfd19cae8a1 | 1,064 | py | Python | binary_support.py | pas256/snappy | 1581f1f62a823fbab458ac15f7a8e882f088bd35 | [
"Apache-2.0"
] | 2 | 2018-09-12T21:00:18.000Z | 2018-09-15T17:40:11.000Z | binary_support.py | pas256/snappy | 1581f1f62a823fbab458ac15f7a8e882f088bd35 | [
"Apache-2.0"
] | null | null | null | binary_support.py | pas256/snappy | 1581f1f62a823fbab458ac15f7a8e882f088bd35 | [
"Apache-2.0"
] | 1 | 2018-09-12T02:53:41.000Z | 2018-09-12T02:53:41.000Z | #!/usr/bin/env python
import boto3
import os
import json
print('Adding binary support ...')
client = boto3.client('apigateway')
env = os.environ.get('SERVERLESS_ENV')
proj_name = 'snappy'
response = client.get_rest_apis()
api_id = None
for api in response['items']:
if api['name'] == '{}-{}'.format(env, proj_n... | 27.282051 | 81 | 0.669173 |
1d2ebb6c4d80e31010d32c428e1823216513e050 | 1,183 | py | Python | staff/migrations/0001_initial.py | richardmobikasa/cash-assistance-platform | fafc117823c9bb7b5b6115d11c66afb459e1ec5f | [
"MIT"
] | 10 | 2020-10-02T20:03:08.000Z | 2022-01-05T17:27:54.000Z | staff/migrations/0001_initial.py | richardmobikasa/cash-assistance-platform | fafc117823c9bb7b5b6115d11c66afb459e1ec5f | [
"MIT"
] | 3 | 2020-10-06T14:44:28.000Z | 2020-10-07T15:33:23.000Z | staff/migrations/0001_initial.py | richardmobikasa/cash-assistance-platform | fafc117823c9bb7b5b6115d11c66afb459e1ec5f | [
"MIT"
] | 6 | 2020-09-22T22:39:38.000Z | 2021-07-13T06:45:53.000Z | # Generated by Django 3.0.9 on 2020-09-21 18:49
import app_ccf.encoder
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('app_ccf', '0001_initial'),
]
... | 38.16129 | 129 | 0.649197 |
1d2ed13630b9d4c9cf951b81afb8aef0c9e506b5 | 3,858 | py | Python | ml-agents-envs/mlagentsdev/envs/communicator_objects/unity_output_pb2.py | vkakerbeck/ml-agents-dev | e3a52b5787af06c07fbd945e2ac37bb3bf07ce0c | [
"Apache-2.0"
] | null | null | null | ml-agents-envs/mlagentsdev/envs/communicator_objects/unity_output_pb2.py | vkakerbeck/ml-agents-dev | e3a52b5787af06c07fbd945e2ac37bb3bf07ce0c | [
"Apache-2.0"
] | null | null | null | ml-agents-envs/mlagentsdev/envs/communicator_objects/unity_output_pb2.py | vkakerbeck/ml-agents-dev | e3a52b5787af06c07fbd945e2ac37bb3bf07ce0c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mlagentsdev/envs/communicator_objects/unity_output.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import m... | 45.928571 | 533 | 0.82478 |
1d2ede81da1c2bd69247d142d50d8681492f10c4 | 675 | py | Python | Subprogramas/digitos.py | jhonattanrgc21/python-exercises | f2355dfcb50001800ab4aac188e23d71dff8b6d8 | [
"MIT"
] | null | null | null | Subprogramas/digitos.py | jhonattanrgc21/python-exercises | f2355dfcb50001800ab4aac188e23d71dff8b6d8 | [
"MIT"
] | null | null | null | Subprogramas/digitos.py | jhonattanrgc21/python-exercises | f2355dfcb50001800ab4aac188e23d71dff8b6d8 | [
"MIT"
] | null | null | null | """
Dado un número de 4 dígitos desarrolle una función lógica que devuelva
verdadero si el resto de dividir por diez la suma de los tres primeros
dígitos es igual al cuarto dígito.
"""
# Declaracion de funciones
def comparar(num):
d4 = num % 10
d3 = (num // 10) % 10
d2 = (num // 10) // 10 % 10... | 27 | 75 | 0.588148 |
1d2ee4b679d1dbc9f2c8fb9b022df78c3c5ef11c | 1,168 | py | Python | 2021/25/solution1.py | frenzymadness/aoc | c9018e757bae61a696e675a827aef873995abdd3 | [
"WTFPL"
] | 2 | 2020-12-04T09:45:38.000Z | 2020-12-07T14:06:12.000Z | 2021/25/solution1.py | frenzymadness/aoc | c9018e757bae61a696e675a827aef873995abdd3 | [
"WTFPL"
] | null | null | null | 2021/25/solution1.py | frenzymadness/aoc | c9018e757bae61a696e675a827aef873995abdd3 | [
"WTFPL"
] | null | null | null | from copy import deepcopy
def print_map(map):
for row in map:
for c in row:
print(c, end="")
print()
with open("input.txt") as input_file:
lines = input_file.read().splitlines()
map = []
for line in lines:
map.append(list(line))
rounds = 0
print_map(map)
while True:
r... | 21.62963 | 66 | 0.509418 |
1d2ee946134b771403d0362a7388e214156c2f25 | 4,094 | py | Python | doc/jupyter_execute/examples/models/runtime_metrics_tags/runtime_metrics_tags.py | edshee/seldon-core | 78c10fbca16a5e2a0c25b9673aa3deb220070e26 | [
"Apache-2.0"
] | null | null | null | doc/jupyter_execute/examples/models/runtime_metrics_tags/runtime_metrics_tags.py | edshee/seldon-core | 78c10fbca16a5e2a0c25b9673aa3deb220070e26 | [
"Apache-2.0"
] | null | null | null | doc/jupyter_execute/examples/models/runtime_metrics_tags/runtime_metrics_tags.py | edshee/seldon-core | 78c10fbca16a5e2a0c25b9673aa3deb220070e26 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# # Runtime Metrics / Tags Example
#
#
# ## Prerequisites
#
# * Kind cluster with Seldon Installed
# * curl
# * s2i
# * seldon-core-analytics
#
#
# ## Setup Seldon Core
#
# Use the setup notebook to [Setup Cluster](https://docs.seldon.io/projects/seldon-core/en/latest/e... | 32.492063 | 960 | 0.667807 |
1d2f6afed0e9ba2be1451feb89073d8e2eb71f28 | 6,728 | py | Python | KRR/KRR_script_4_faulty.py | MadsAW/machine-learning-on-materials | 6101c7e3d12be54b12391c78442294198a39cc9b | [
"MIT"
] | 2 | 2018-10-10T09:32:34.000Z | 2019-03-28T08:42:31.000Z | KRR/KRR_script_4_faulty.py | MadsAW/machine-learning-on-materials | 6101c7e3d12be54b12391c78442294198a39cc9b | [
"MIT"
] | null | null | null | KRR/KRR_script_4_faulty.py | MadsAW/machine-learning-on-materials | 6101c7e3d12be54b12391c78442294198a39cc9b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 29 14:40:54 2018
@author: Simon
"""
def frange(x, y, jump):
while x < y:
yield x
x += jump
import os, sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from createLargerFeatureMatrix import simpleLargeMatri... | 32.980392 | 117 | 0.641647 |
1d2f98eb11ba05b6dfa86f89489b82559b0c03a8 | 968 | py | Python | python/hash_table/0846_hand_of_straights.py | linshaoyong/leetcode | ea052fad68a2fe0cbfa5469398508ec2b776654f | [
"MIT"
] | 6 | 2019-07-15T13:23:57.000Z | 2020-01-22T03:12:01.000Z | python/hash_table/0846_hand_of_straights.py | linshaoyong/leetcode | ea052fad68a2fe0cbfa5469398508ec2b776654f | [
"MIT"
] | null | null | null | python/hash_table/0846_hand_of_straights.py | linshaoyong/leetcode | ea052fad68a2fe0cbfa5469398508ec2b776654f | [
"MIT"
] | 1 | 2019-07-24T02:15:31.000Z | 2019-07-24T02:15:31.000Z | import collections
class Solution(object):
def isNStraightHand(self, hand, W):
"""
:type hand: List[int]
:type W: int
:rtype: bool
"""
count = collections.Counter(hand)
while count:
m = min(count)
for k in range(m, m + W):
... | 29.333333 | 73 | 0.482438 |
1d2faddea3b2430b34214236f230e8a564a88916 | 16,654 | py | Python | default.py | FoxBuru/ampache-xbmc-plugin | dd95c3decfd6e1fb8b94322927521f9834d5e378 | [
"MIT"
] | 3 | 2015-01-11T15:11:28.000Z | 2015-01-11T15:12:07.000Z | default.py | FoxBuru/ampache-xbmc-plugin | dd95c3decfd6e1fb8b94322927521f9834d5e378 | [
"MIT"
] | null | null | null | default.py | FoxBuru/ampache-xbmc-plugin | dd95c3decfd6e1fb8b94322927521f9834d5e378 | [
"MIT"
] | null | null | null | import sys, os, time, datetime, socket, random, hashlib
import xbmcplugin, xbmcgui, xbmcaddon, requests, xml.etree.ElementTree as ET
# Constants
__plugid__ = "plugin.audio.ampache"
__name__ = "Ampache"
__author__ = "FoxBuru"
ampache = xbmcaddon.Addon(id=__plugid__)
# Shared resources
BASE_RESOURCE_PATH = ... | 40.227053 | 255 | 0.608202 |
1d2fae2a36d24dd4fc323abff7501fc6f2b0aa67 | 4,880 | py | Python | gtld_data/zone_data.py | NCommander/gtld-innovation-health | 5dac47ce7678f8867e056eb361b4ddddbab109bd | [
"MIT"
] | null | null | null | gtld_data/zone_data.py | NCommander/gtld-innovation-health | 5dac47ce7678f8867e056eb361b4ddddbab109bd | [
"MIT"
] | null | null | null | gtld_data/zone_data.py | NCommander/gtld-innovation-health | 5dac47ce7678f8867e056eb361b4ddddbab109bd | [
"MIT"
] | null | null | null | # Copyright 2018 Michael Casadevall <michael@casadevall.pro>
#
# 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, mo... | 41.008403 | 96 | 0.675205 |
1d2fb5762f531421498e8a89ecd191cf6b50169e | 7,198 | py | Python | system_test/utils/testcase_env.py | yobennett/kafka | e582447adb4708731aff74aa294e7ce2b30b0a41 | [
"Apache-2.0"
] | 2 | 2016-06-27T03:11:17.000Z | 2016-06-27T03:11:18.000Z | system_test/utils/testcase_env.py | yobennett/kafka | e582447adb4708731aff74aa294e7ce2b30b0a41 | [
"Apache-2.0"
] | null | null | null | system_test/utils/testcase_env.py | yobennett/kafka | e582447adb4708731aff74aa294e7ce2b30b0a41 | [
"Apache-2.0"
] | 2 | 2018-08-22T09:36:15.000Z | 2021-01-14T11:41:07.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 41.367816 | 108 | 0.59072 |
1d3016506ec71316a72d09c2981cbae046b7a77a | 6,563 | py | Python | tecvalues.py | Binabh/TEC-Maps-of-Nepal | 394d6bfb45cf0718e9bbccb31afab4956af6adb3 | [
"MIT"
] | 4 | 2019-10-27T14:40:31.000Z | 2021-05-23T10:56:06.000Z | tecvalues.py | yxw027/TEC-Maps-of-Nepal | 9f76568402924115ff73608bf9814bb733719869 | [
"MIT"
] | 1 | 2022-03-12T00:45:22.000Z | 2022-03-12T00:45:22.000Z | tecvalues.py | yxw027/TEC-Maps-of-Nepal | 9f76568402924115ff73608bf9814bb733719869 | [
"MIT"
] | 2 | 2020-07-05T19:30:51.000Z | 2020-10-21T13:25:49.000Z | import georinex as gr
import math
import numpy as np
import pymap3d as pm
import glob
#getting satellite elevation and azimuth
def getsatElev(recposgeo,satpos):
slat,slon,shei= pm.ecef2geodetic(satpos[0], satpos[1], satpos[2], deg=True)
az,el,r = pm.geodetic2aer(slat, slon, shei, recposgeo[0], recposgeo[1], recposge... | 37.289773 | 161 | 0.705775 |
1d301dfe5494b13f475bfae33b289893d1b185f2 | 8,177 | py | Python | remote_params/osc.py | markkorput/pyRemoteParams | b96cc3d694f5715af40cf71865e7c2f550897a81 | [
"MIT"
] | null | null | null | remote_params/osc.py | markkorput/pyRemoteParams | b96cc3d694f5715af40cf71865e7c2f550897a81 | [
"MIT"
] | 2 | 2020-03-13T07:14:36.000Z | 2020-05-22T09:54:08.000Z | remote_params/osc.py | markkorput/pyRemoteParams | b96cc3d694f5715af40cf71865e7c2f550897a81 | [
"MIT"
] | null | null | null |
from oscpy.client import OSCClient
import logging, json
from .server import Remote
from .schema import schema_list
logger = logging.getLogger(__name__)
class Client:
'''
This Client class performs all server-to-client OSC communications.
The id given to the constructor specifies where all communications
sho... | 30.0625 | 186 | 0.687783 |
1d306711dc6137f2b9437abfdb83567951be5d8b | 44,624 | py | Python | ml_color_transfer.py | matthieuheitz/2020-JMIV-ground-metric-learning-graphs | ef927341f3f55163e159de2f5b385500106017cd | [
"MIT"
] | 1 | 2020-10-26T06:26:39.000Z | 2020-10-26T06:26:39.000Z | ml_color_transfer.py | matthieuheitz/2020-JMIV-ground-metric-learning-graphs | ef927341f3f55163e159de2f5b385500106017cd | [
"MIT"
] | 1 | 2020-10-26T06:30:46.000Z | 2020-11-02T15:19:58.000Z | ml_color_transfer.py | matthieuheitz/2020-JMIV-ground-metric-learning-graphs | ef927341f3f55163e159de2f5b385500106017cd | [
"MIT"
] | 1 | 2021-06-10T10:33:53.000Z | 2021-06-10T10:33:53.000Z | #!/usr/bin/env python
"""
ml_color_transfer.py
Functions for transferring colors of one image onto another.
"""
import os
import sys
if '--omp_num_threads' in sys.argv:
os.environ["OMP_NUM_THREADS"] = sys.argv[sys.argv.index('--omp_num_threads')+1]
import numpy as np
import matplotlib
import numpy.linalg
imp... | 48.242162 | 186 | 0.636675 |
1d308898384b5f7269ef85f5ba685ba48c220359 | 185 | py | Python | lib/rda.py | jermnelson/FRBR-Redis-Datastore | d44af821536b82f5fafa5bed7a51fa86e9a92243 | [
"Apache-2.0"
] | 1 | 2015-09-24T01:12:02.000Z | 2015-09-24T01:12:02.000Z | lib/rda.py | jermnelson/FRBR-Redis-Datastore | d44af821536b82f5fafa5bed7a51fa86e9a92243 | [
"Apache-2.0"
] | 1 | 2021-12-13T19:39:44.000Z | 2021-12-13T19:39:44.000Z | lib/rda.py | jermnelson/FRBR-Redis-Datastore | d44af821536b82f5fafa5bed7a51fa86e9a92243 | [
"Apache-2.0"
] | null | null | null | """
:mod:`rda` -- RDA Redis set-up and support
"""
__author__ = 'Jeremy Nelson'
import datetime,os,logging
import redis,urllib2,common
from lxml import etree
import namespaces as ns
| 18.5 | 44 | 0.740541 |
1d3097e838915d5b81c30d48ce19d34e664289b6 | 5,733 | py | Python | src/xhorizon/shell_junction/helpers.py | xh-diagrams/xhorizon | 20b3f2f0f621ca2a31c9f6a1d5fcd06692a700ce | [
"MIT"
] | null | null | null | src/xhorizon/shell_junction/helpers.py | xh-diagrams/xhorizon | 20b3f2f0f621ca2a31c9f6a1d5fcd06692a700ce | [
"MIT"
] | null | null | null | src/xhorizon/shell_junction/helpers.py | xh-diagrams/xhorizon | 20b3f2f0f621ca2a31c9f6a1d5fcd06692a700ce | [
"MIT"
] | null | null | null |
"""
Helpers for evaluating coordinate transformations at null shell junctions.
"""
import numpy as np
"""
Helpers.
"""
def set_ruv0(reg, r0=np.nan, u0=np.nan, v0=np.nan):
"""
Self-consistently fill all three values based on input.
For a shell junction, r0 should be nan and (u0 xor v0) should be finite.
For ... | 27.042453 | 128 | 0.655329 |
1d30a5a4394c2996b54687891588f96c08938c8a | 1,384 | py | Python | tests/test_blog/test_post_create.py | florimondmanca/personal-api | 6300f965d3f51d1bf5f10cf1eb15d673bd627631 | [
"MIT"
] | 4 | 2018-08-17T08:06:06.000Z | 2020-02-20T15:15:56.000Z | tests/test_blog/test_post_create.py | florimondmanca/personal-api | 6300f965d3f51d1bf5f10cf1eb15d673bd627631 | [
"MIT"
] | 2 | 2018-10-08T15:59:58.000Z | 2018-10-20T16:50:13.000Z | tests/test_blog/test_post_create.py | florimondmanca/personal-api | 6300f965d3f51d1bf5f10cf1eb15d673bd627631 | [
"MIT"
] | 1 | 2019-09-14T23:15:10.000Z | 2019-09-14T23:15:10.000Z | """Test creation of blog posts."""
from rest_framework.test import APITestCase
from tests.decorators import authenticated
from blog.factories import PostFactory
from .test_post_list import _POST_FIELDS
@authenticated
class PostCreateTest(APITestCase):
"""Test the post create endpoint."""
def setUp(self):
... | 30.086957 | 80 | 0.651012 |
1d30ad1cec9c09acb8ffc6b1b8176e3e39e66be7 | 6,733 | py | Python | src/dvc_objects/fs/utils.py | iterative/dvc-objects | dc54090092e5b726234899f83faf3bac99908f1a | [
"Apache-2.0"
] | null | null | null | src/dvc_objects/fs/utils.py | iterative/dvc-objects | dc54090092e5b726234899f83faf3bac99908f1a | [
"Apache-2.0"
] | 9 | 2021-12-13T07:37:21.000Z | 2022-03-28T22:16:25.000Z | src/dvc_objects/fs/utils.py | iterative/dvc-objects | dc54090092e5b726234899f83faf3bac99908f1a | [
"Apache-2.0"
] | null | null | null | import errno
import logging
import os
import shutil
import stat
import sys
from contextlib import contextmanager, suppress
from typing import TYPE_CHECKING, Iterator
from . import system
if TYPE_CHECKING:
from .base import AnyFSPath, FileSystem
from .callbacks import Callback
logger = logging.getLogger(__na... | 27.481633 | 112 | 0.614139 |
1d30c0180dbc8076db48c54ac1b2bf29c0adabe0 | 672 | py | Python | client/verta/verta/_swagger/_public/modeldb/model/ModeldbLogDatasetsResponse.py | CaptEmulation/modeldb | 78b10aca553e386554f9740db63466b1cf013a1a | [
"Apache-2.0"
] | 835 | 2017-02-08T20:14:24.000Z | 2020-03-12T17:37:49.000Z | client/verta/verta/_swagger/_public/modeldb/model/ModeldbLogDatasetsResponse.py | CaptEmulation/modeldb | 78b10aca553e386554f9740db63466b1cf013a1a | [
"Apache-2.0"
] | 651 | 2019-04-18T12:55:07.000Z | 2022-03-31T23:45:09.000Z | client/verta/verta/_swagger/_public/modeldb/model/ModeldbLogDatasetsResponse.py | CaptEmulation/modeldb | 78b10aca553e386554f9740db63466b1cf013a1a | [
"Apache-2.0"
] | 170 | 2017-02-13T14:49:22.000Z | 2020-02-19T17:59:12.000Z | # THIS FILE IS AUTO-GENERATED. DO NOT EDIT
from verta._swagger.base_type import BaseType
class ModeldbLogDatasetsResponse(BaseType):
def __init__(self, experiment_run=None):
required = {
"experiment_run": False,
}
self.experiment_run = experiment_run
for k, v in required.items():
if self... | 26.88 | 63 | 0.706845 |
1d30c8f7092c85c46d7bd71979431e2b52eaa58f | 8,374 | py | Python | venv/lib/python3.8/site-packages/fido2/pcsc.py | Nitrokey/nitrokey-app2 | ab66bbceb854e1f18987b0331528e86e3e7ff702 | [
"Apache-2.0"
] | 1 | 2021-11-23T12:54:35.000Z | 2021-11-23T12:54:35.000Z | venv/lib/python3.8/site-packages/fido2/pcsc.py | Nitrokey/nitrokey-app2 | ab66bbceb854e1f18987b0331528e86e3e7ff702 | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.8/site-packages/fido2/pcsc.py | Nitrokey/nitrokey-app2 | ab66bbceb854e1f18987b0331528e86e3e7ff702 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019 Yubico AB
# Copyright (c) 2019 Oleg Moiseenko
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
... | 34.891667 | 86 | 0.613566 |
1d30e9740f032967cb0ffbcf3b7df04e62fd18fc | 1,993 | py | Python | utility/cog/character/ability/list/_16_powered_shell.py | DrLarck/DiscordBallZ_ | c274e26efce4c5a757d258c54bc285d118618751 | [
"MIT"
] | 4 | 2020-01-19T13:53:43.000Z | 2020-01-20T13:34:17.000Z | utility/cog/character/ability/list/_16_powered_shell.py | DrLarck/DiscordBallZ_ | c274e26efce4c5a757d258c54bc285d118618751 | [
"MIT"
] | 18 | 2020-01-19T17:52:17.000Z | 2020-02-17T15:06:13.000Z | utility/cog/character/ability/list/_16_powered_shell.py | DrLarck/DiscordBallZ_ | c274e26efce4c5a757d258c54bc285d118618751 | [
"MIT"
] | 1 | 2020-01-19T16:33:19.000Z | 2020-01-19T16:33:19.000Z | """
Powered shell ability object
--
Author : DrLarck
Last update : 29/02/20 (DrLarck)
"""
# dependancies
import asyncio
# util
from utility.cog.character.ability.util.effect_checker import Effect_checker
from utility.cog.character.ability.ability import Ability
from utility.cog.displayer.move import Move_displayer... | 25.883117 | 104 | 0.633718 |
1d30f8e478f9f825e40ea429e81cfdc20268a130 | 2,741 | py | Python | examples/onemax_minimal.py | SimonRosen173/ruck | 6eaee4a8e729e2b8b1c76b41da5f39e93c16b8be | [
"MIT"
] | 20 | 2021-09-28T12:29:47.000Z | 2022-02-21T21:57:24.000Z | examples/onemax_minimal.py | SimonRosen173/ruck | 6eaee4a8e729e2b8b1c76b41da5f39e93c16b8be | [
"MIT"
] | 3 | 2021-10-16T02:56:40.000Z | 2021-10-20T02:39:57.000Z | examples/onemax_minimal.py | SimonRosen173/ruck | 6eaee4a8e729e2b8b1c76b41da5f39e93c16b8be | [
"MIT"
] | null | null | null | #
# Copyright (c) 2021 Nathan Juraj Michlo
#
# 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, merge, p... | 42.828125 | 107 | 0.711054 |
1d3109b9380dd04f9f7fff39daa2676d50403b24 | 384 | py | Python | circlegame.py | hubenjm/projecteuler | 544596a6693a2e64a88e1d4606ce85480486dab5 | [
"MIT"
] | null | null | null | circlegame.py | hubenjm/projecteuler | 544596a6693a2e64a88e1d4606ce85480486dab5 | [
"MIT"
] | null | null | null | circlegame.py | hubenjm/projecteuler | 544596a6693a2e64a88e1d4606ce85480486dab5 | [
"MIT"
] | null | null | null | from itertools import tee, islice
def trianglenumbers(k=0):
total = 0
while True:
total += k
k += 1
yield total
def circlegame(n):
values = []
for j in islice(trianglenumbers(), n):
values.append(j%n)
if len(set(values)) == n: return True
else: return False
def main():
for j in range(1000):
if c... | 16 | 39 | 0.640625 |
1d311312627a88c1949f4689d306a5a8078da740 | 33,884 | py | Python | pcdsdevices/interface.py | slacAdpai/pcdsdevices | 7d79821f8b5652a7fd457b9a73d22ef37b2043d3 | [
"BSD-3-Clause-LBNL"
] | null | null | null | pcdsdevices/interface.py | slacAdpai/pcdsdevices | 7d79821f8b5652a7fd457b9a73d22ef37b2043d3 | [
"BSD-3-Clause-LBNL"
] | null | null | null | pcdsdevices/interface.py | slacAdpai/pcdsdevices | 7d79821f8b5652a7fd457b9a73d22ef37b2043d3 | [
"BSD-3-Clause-LBNL"
] | null | null | null | """
Module for defining bell-and-whistles movement features.
"""
import functools
import logging
import numbers
import re
import signal
import time
from contextlib import contextmanager
from pathlib import Path
from threading import Event, Thread
from types import MethodType, SimpleNamespace
from weakref import WeakSet... | 33.884 | 79 | 0.578267 |
1d313aa2f0e8c7f7764ed7888e3ea6daca1f516a | 3,299 | py | Python | instructors/projects/decoding_fun/examples/bottom_up_decode.py | mgadagin/PythonClass | 70b370362d75720b3fb0e1d6cc8158f9445e9708 | [
"MIT"
] | 46 | 2017-09-27T20:19:36.000Z | 2020-12-08T10:07:19.000Z | instructors/projects/decoding_fun/examples/bottom_up_decode.py | mgadagin/PythonClass | 70b370362d75720b3fb0e1d6cc8158f9445e9708 | [
"MIT"
] | 6 | 2018-01-09T08:07:37.000Z | 2020-09-07T12:25:13.000Z | instructors/projects/decoding_fun/examples/bottom_up_decode.py | mgadagin/PythonClass | 70b370362d75720b3fb0e1d6cc8158f9445e9708 | [
"MIT"
] | 18 | 2017-10-10T02:06:51.000Z | 2019-12-01T10:18:13.000Z | # -*- coding: utf-8 -*-
#correct two letter words from scrambled text into unscrambled words
#and cache the correct conversions
#found on http://www.textfixer.com/resources/common-english-words.txt
a = "a,able,about,across,after,all,almost,also,am,among,an,and,any,are,as,at,be,because,been,but,by,can,cannot,could,de... | 45.819444 | 918 | 0.628978 |
1d313ae71a27d837f70d567e4907416d305a0637 | 495 | py | Python | src/pacientes/migrations/0004_antecedente_actividad_fisica.py | mava-ar/sgk | cb8b3abf243b4614e6a45e4e2db5bb7cce94dee4 | [
"Apache-2.0"
] | null | null | null | src/pacientes/migrations/0004_antecedente_actividad_fisica.py | mava-ar/sgk | cb8b3abf243b4614e6a45e4e2db5bb7cce94dee4 | [
"Apache-2.0"
] | 32 | 2016-05-09T19:37:08.000Z | 2022-01-13T01:00:52.000Z | src/pacientes/migrations/0004_antecedente_actividad_fisica.py | mava-ar/sgk | cb8b3abf243b4614e6a45e4e2db5bb7cce94dee4 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-25 20:03
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pacientes', '0003_auto_20160519_2313'),
]
operations = [
migrations.AddField... | 23.571429 | 80 | 0.638384 |
1d313ef1558114df55984b2e6aa8498f4f1e5700 | 5,917 | py | Python | experiments/vitchyr/vaes/learn_swirl.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | 1 | 2020-10-23T14:40:09.000Z | 2020-10-23T14:40:09.000Z | experiments/vitchyr/vaes/learn_swirl.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/vitchyr/vaes/learn_swirl.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | 1 | 2021-05-27T20:38:45.000Z | 2021-05-27T20:38:45.000Z | """
Train a neural network to learn the swirl function.
Input: xy coordinate
Desired output: t that generated the xy-corrdinate
This is basically doing supervised learning for the encoder in a VAE.
"""
import matplotlib.pyplot as plt
import numpy as np
import torch
from torch import nn as nn
from torch.autograd impor... | 27.267281 | 77 | 0.595741 |
1d314f85862cd71ab542e77f2509d30c8d319bab | 1,420 | py | Python | sriracha/request.py | pcranaway/sriracha | cba5703e05cf8bee1b83d2ff163400f448e9e88a | [
"MIT"
] | null | null | null | sriracha/request.py | pcranaway/sriracha | cba5703e05cf8bee1b83d2ff163400f448e9e88a | [
"MIT"
] | null | null | null | sriracha/request.py | pcranaway/sriracha | cba5703e05cf8bee1b83d2ff163400f448e9e88a | [
"MIT"
] | null | null | null | class Request:
"""
A request is sadly a class (we might take a different approach to this
later, perhaps a dict) that represents a HTTP request.
"""
def __init__(self, environ):
self.method = environ['REQUEST_METHOD']
self.query_string = environ['QUERY_STRING']
# apparently... | 32.272727 | 121 | 0.589437 |
1d316c97fa2eeaeaf470b86a30038fc303a82219 | 13,679 | py | Python | biostar/forum/markdown.py | Abhijitpatil19/biostar-central | 69c5a1b8296d0d1f9c9b23ecef011595fcd3d485 | [
"MIT"
] | null | null | null | biostar/forum/markdown.py | Abhijitpatil19/biostar-central | 69c5a1b8296d0d1f9c9b23ecef011595fcd3d485 | [
"MIT"
] | null | null | null | biostar/forum/markdown.py | Abhijitpatil19/biostar-central | 69c5a1b8296d0d1f9c9b23ecef011595fcd3d485 | [
"MIT"
] | null | null | null | """
Markdown parser to render the Biostar style markdown.
"""
import re
import inspect
from functools import partial
import mistune
import requests
from xml.sax.saxutils import unescape
from django.shortcuts import reverse
from django.db.models import F
import bleach
from bleach.linkifier import Linker
from bleach.link... | 30.60179 | 124 | 0.630529 |
1d317551b8e0e0c8279cf6adc2ad636c1cc9bec1 | 19,028 | py | Python | thor/backend/findorb.py | KatKiker/thor | ffc8ab3fbaa8af046f531e8111907a891998d14b | [
"BSD-3-Clause"
] | null | null | null | thor/backend/findorb.py | KatKiker/thor | ffc8ab3fbaa8af046f531e8111907a891998d14b | [
"BSD-3-Clause"
] | null | null | null | thor/backend/findorb.py | KatKiker/thor | ffc8ab3fbaa8af046f531e8111907a891998d14b | [
"BSD-3-Clause"
] | 1 | 2021-07-29T15:20:34.000Z | 2021-07-29T15:20:34.000Z | import os
import time
import json
import shutil
import tempfile
import warnings
import subprocess
import numpy as np
import pandas as pd
from astropy.time import Time
from ..utils import writeToADES
from .backend import Backend
FINDORB_CONFIG = {
"config_file" : os.path.join(os.path.dirname(__file__), "data", "en... | 35.433892 | 153 | 0.466681 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.