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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7989903c057492211a616959481ea6973bcc505c | 5,840 | py | Python | ext/DataMining/8_ParametersTuning/BayesianOptimization/TuningCV.py | Jie-Yuan/1_DataMining | f5338388b4f883233f350d4fb9c5903180883430 | [
"Apache-2.0"
] | 14 | 2019-06-25T13:46:32.000Z | 2020-10-27T02:04:59.000Z | ext/DataMining/8_ParametersTuning/BayesianOptimization/TuningCV.py | Jie-Yuan/2_DataMining | f5338388b4f883233f350d4fb9c5903180883430 | [
"Apache-2.0"
] | null | null | null | ext/DataMining/8_ParametersTuning/BayesianOptimization/TuningCV.py | Jie-Yuan/2_DataMining | f5338388b4f883233f350d4fb9c5903180883430 | [
"Apache-2.0"
] | 7 | 2019-06-25T13:26:16.000Z | 2020-10-27T02:05:03.000Z | # coding: utf-8
__title__ = 'byes'
__author__ = 'JieYuan'
__mtime__ = '2017/12/10'
import warnings
warnings.filterwarnings('ignore')
from udfs import *
import lightgbm as lgb
import xgboost as xgb
from bayes_opt import BayesianOptimization
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_select... | 32.808989 | 117 | 0.527226 |
7989a228892cdacb059bd6c96853045f41e8e37a | 3,432 | py | Python | src/buildstream/_protos/google/rpc/status_pb2.py | doraskayo/buildstream | 1c72d4342ae7df360808de22c5e49f55dbb6bec6 | [
"Apache-2.0"
] | 2 | 2021-12-13T20:29:00.000Z | 2022-01-28T13:02:54.000Z | src/buildstream/_protos/google/rpc/status_pb2.py | doraskayo/buildstream | 1c72d4342ae7df360808de22c5e49f55dbb6bec6 | [
"Apache-2.0"
] | 1 | 2021-07-26T00:36:18.000Z | 2021-07-26T13:52:59.000Z | src/buildstream/_protos/google/rpc/status_pb2.py | doraskayo/buildstream | 1c72d4342ae7df360808de22c5e49f55dbb6bec6 | [
"Apache-2.0"
] | 2 | 2022-02-08T12:39:26.000Z | 2022-03-12T19:08:18.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/rpc/status.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from goog... | 38.561798 | 387 | 0.765443 |
7989e0540743f8108f49108d41c3014a01f25210 | 105 | py | Python | sleeplearning/lib/models/__init__.py | hlinus/SleepLearning | f2f2113e73e86b7dbb67b63d2be1b90b221b4fd5 | [
"MIT"
] | 2 | 2018-11-16T19:39:32.000Z | 2018-11-20T03:38:58.000Z | sleeplearning/lib/models/__init__.py | isempi/MT18_LH_human-sleep-classification | f2f2113e73e86b7dbb67b63d2be1b90b221b4fd5 | [
"MIT"
] | 1 | 2019-04-03T07:39:48.000Z | 2019-04-03T07:39:48.000Z | sleeplearning/lib/models/__init__.py | hlinus/SleepLearning | f2f2113e73e86b7dbb67b63d2be1b90b221b4fd5 | [
"MIT"
] | 1 | 2019-03-04T15:46:24.000Z | 2019-03-04T15:46:24.000Z | __all__ = ["single_chan_expert",
"late_fusion",
"amoe",
"attention_net"] | 26.25 | 32 | 0.504762 |
7989e28e3212983f5797463bcfd57edba741bcdd | 9,992 | py | Python | src/mockldap/ldapobject.py | mixman/mockldap | fdf6a20d0c5d15213f99cdadfbcc0677128ab49e | [
"BSD-2-Clause"
] | null | null | null | src/mockldap/ldapobject.py | mixman/mockldap | fdf6a20d0c5d15213f99cdadfbcc0677128ab49e | [
"BSD-2-Clause"
] | null | null | null | src/mockldap/ldapobject.py | mixman/mockldap | fdf6a20d0c5d15213f99cdadfbcc0677128ab49e | [
"BSD-2-Clause"
] | null | null | null | from __future__ import absolute_import
from copy import deepcopy
import re
import ldap
try:
from passlib.hash import ldap_md5_crypt
except ImportError:
pass
from .recording import SeedRequired, RecordableMethods, recorded
class LDAPObject(RecordableMethods):
"""
:param directory: The initial conten... | 31.520505 | 93 | 0.539832 |
7989f162845aecf43242344d8cb58babc99d5b63 | 827 | py | Python | terrascript/resource/taiidani/jenkins.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 507 | 2017-07-26T02:58:38.000Z | 2022-01-21T12:35:13.000Z | terrascript/resource/taiidani/jenkins.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 135 | 2017-07-20T12:01:59.000Z | 2021-10-04T22:25:40.000Z | terrascript/resource/taiidani/jenkins.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 81 | 2018-02-20T17:55:28.000Z | 2022-01-31T07:08:40.000Z | # terrascript/resource/taiidani/jenkins.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:19:30 UTC)
import terrascript
class jenkins_credential_secret_file(terrascript.Resource):
pass
class jenkins_credential_secret_text(terrascript.Resource):
pass
class jenkins_credential_ssh(terrascript... | 19.232558 | 73 | 0.779927 |
798a5aa29cb4bcb98022cd9b7b415f3709b451a2 | 2,851 | py | Python | backend/database/models/user.py | AlexanderBerardino/police-data-trust | 587fe2bc1e7f048e2308d89803abb20f4e619aab | [
"MIT"
] | 16 | 2021-03-02T21:32:52.000Z | 2022-03-15T23:13:06.000Z | backend/database/models/user.py | AlexanderBerardino/police-data-trust | 587fe2bc1e7f048e2308d89803abb20f4e619aab | [
"MIT"
] | 173 | 2021-03-03T01:35:36.000Z | 2022-03-30T03:17:58.000Z | backend/database/models/user.py | AlexanderBerardino/police-data-trust | 587fe2bc1e7f048e2308d89803abb20f4e619aab | [
"MIT"
] | 36 | 2021-03-03T00:27:20.000Z | 2022-03-29T23:07:57.000Z | """Define the SQL classes for Users."""
import bcrypt
from backend.database.core import db
from flask_login import LoginManager
from flask_serialize.flask_serialize import FlaskSerialize
from flask_user import UserMixin
from sqlalchemy.ext.compiler import compiles
from sqlalchemy.types import String, TypeDecorator
fro... | 30.010526 | 78 | 0.670993 |
798a6926c4a03a381590a4a3baf32edd47f4be50 | 1,170 | py | Python | func_tests/pages/activateaccountpage/activate_account_page.py | ICT4H/dcs-web | fb0f53fad4401cfac1c1789ff28b9d5bda40c975 | [
"Apache-2.0"
] | 1 | 2015-11-02T09:11:12.000Z | 2015-11-02T09:11:12.000Z | func_tests/pages/activateaccountpage/activate_account_page.py | ICT4H/dcs-web | fb0f53fad4401cfac1c1789ff28b9d5bda40c975 | [
"Apache-2.0"
] | null | null | null | func_tests/pages/activateaccountpage/activate_account_page.py | ICT4H/dcs-web | fb0f53fad4401cfac1c1789ff28b9d5bda40c975 | [
"Apache-2.0"
] | null | null | null | # vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
from pages.loginpage.login_page import LoginPage
from pages.page import Page
from pages.activateaccountpage.activate_account_locator import *
from testdata.test_data import DATA_WINNER_ACTIVATE_ACCOUNT
class ActivateAccountPage(Page):
def __init__(self, driver):
... | 27.857143 | 82 | 0.664957 |
798aa9ae7ce6013f02d070e5ee218cd7b3e5b1cc | 964 | py | Python | conditions/if_with_lists.py | nv-krishna/python-crash-course | d481faeb2196712cd52ca1d34dc1fe967d13712f | [
"Apache-2.0"
] | 2 | 2020-11-02T05:52:33.000Z | 2021-06-09T01:28:22.000Z | conditions/if_with_lists.py | nv-krishna/python-crash-course | d481faeb2196712cd52ca1d34dc1fe967d13712f | [
"Apache-2.0"
] | null | null | null | conditions/if_with_lists.py | nv-krishna/python-crash-course | d481faeb2196712cd52ca1d34dc1fe967d13712f | [
"Apache-2.0"
] | 2 | 2021-04-08T05:26:04.000Z | 2021-06-09T01:28:23.000Z | requested_toppings = ['green chillie', 'mushroom','extra cheese' ]
for topping in requested_toppings:
if topping == 'green chillie':
print("Sorry, we are out of green chillie")
else:
print(f"Adding topping {topping}")
print("Pizze is prepared!")
# checking list if it is empty or not before loop... | 35.703704 | 98 | 0.697095 |
798acd6d8df0d8c5501900fd8d9f868ec8ce8d3c | 2,058 | py | Python | HandwrittenDigitsClassifier/CNN_MLP.py | ckauth/ML_HandwrittenDigitsClassifier | f2f51619a0c2abd033181317a86e136e5b9a3e8b | [
"MIT"
] | null | null | null | HandwrittenDigitsClassifier/CNN_MLP.py | ckauth/ML_HandwrittenDigitsClassifier | f2f51619a0c2abd033181317a86e136e5b9a3e8b | [
"MIT"
] | null | null | null | HandwrittenDigitsClassifier/CNN_MLP.py | ckauth/ML_HandwrittenDigitsClassifier | f2f51619a0c2abd033181317a86e136e5b9a3e8b | [
"MIT"
] | null | null | null | from convPoolLayer import ConvPoolLayer
from hiddenLayer import HiddenLayer
from logisticRegressionLayer import LogisticRegressionLayer
class CNN_MLP(object):
"""
+ First a couple of convolutional and pooling layers react to local changes and globalize these.
+ Second a hidden layer transforms the data spa... | 32.666667 | 100 | 0.609815 |
798ae44304f755515c4bce1e390400876bdb7585 | 529 | py | Python | incomepropertyevaluator/shared_authentication/tasks.py | MikaSoftware/django-incomepropertyevaluator | d30dc9ba38dc2c2cb8ad858e9e7cfec17a45e73b | [
"BSD-2-Clause"
] | 2 | 2019-02-22T23:34:59.000Z | 2022-03-22T06:10:21.000Z | incomepropertyevaluator/shared_authentication/tasks.py | MikaSoftware/django-incomepropertyevaluator | d30dc9ba38dc2c2cb8ad858e9e7cfec17a45e73b | [
"BSD-2-Clause"
] | 6 | 2020-02-11T23:57:35.000Z | 2022-03-11T23:17:44.000Z | incomepropertyevaluator/shared_authentication/tasks.py | MikaSoftware/django-incomepropertyevaluator | d30dc9ba38dc2c2cb8ad858e9e7cfec17a45e73b | [
"BSD-2-Clause"
] | null | null | null | from rq import get_current_job
from django_rq import job
from django.core.management import call_command
@job
def send_user_activation_email_func(email):
call_command('send_user_activation_email', email, verbosity=0, interactive=False)
@job
def create_tenant_organization_func(data_dict):
call_command(
... | 25.190476 | 85 | 0.725898 |
798aed4d664e9318b0c5360ae41a4bca2441500b | 2,150 | py | Python | exps/exp_async_synch_math_func.py | rubinxin/asynchronous-BO | fcfe8938e83fc7d925268ff21e1cfb52903ee752 | [
"MIT"
] | 6 | 2019-08-11T21:31:01.000Z | 2020-11-18T10:16:46.000Z | exps/exp_async_synch_math_func.py | rubinxin/asynchronous-BO | fcfe8938e83fc7d925268ff21e1cfb52903ee752 | [
"MIT"
] | 1 | 2021-09-12T16:25:25.000Z | 2021-12-03T22:25:35.000Z | exps/exp_async_synch_math_func.py | rubinxin/asynchronous-BO | fcfe8938e83fc7d925268ff21e1cfb52903ee752 | [
"MIT"
] | 4 | 2019-08-11T21:31:09.000Z | 2021-11-27T14:15:33.000Z | # -*- coding: utf-8 -*-
"""
Main entry point for running BayesOpt experiments.
Defines high-level parameters that will be fed into bo_exp.
"""
from exps.defs import exp_async_synch
from exps.exp_utils import get_math_exp_task, \
get_commit_hash, create_default_parser, \
get_interface, get_iters, \
generat... | 30.714286 | 75 | 0.619535 |
798af6bc67a73cec27c76b7918b57d86073e5e61 | 4,766 | py | Python | care/users/tests/test_facility_user_create.py | agzuniverse/care | 952babf5b394921fcdb4fd4b1405cb571261f322 | [
"MIT"
] | 1 | 2020-04-23T10:33:56.000Z | 2020-04-23T10:33:56.000Z | care/users/tests/test_facility_user_create.py | agzuniverse/care | 952babf5b394921fcdb4fd4b1405cb571261f322 | [
"MIT"
] | null | null | null | care/users/tests/test_facility_user_create.py | agzuniverse/care | 952babf5b394921fcdb4fd4b1405cb571261f322 | [
"MIT"
] | null | null | null | from rest_framework import status
from care.facility.models import FacilityUser
from care.users.models import User
from care.utils.tests.test_base import TestBase
from config.tests.helper import mock_equal
class TestFacilityUserApi(TestBase):
def get_base_url(self):
return "/api/v1/users/add_user"
d... | 40.389831 | 108 | 0.638691 |
798b0234ebcce7df108a0da65d1305502ce0253a | 14,919 | py | Python | tensorflow/contrib/coder/python/layers/entropybottleneck_test.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 71 | 2017-05-25T16:02:15.000Z | 2021-06-09T16:08:08.000Z | tensorflow/contrib/coder/python/layers/entropybottleneck_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 133 | 2017-04-26T16:49:49.000Z | 2019-10-15T11:39:26.000Z | tensorflow/contrib/coder/python/layers/entropybottleneck_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 31 | 2018-09-11T02:17:17.000Z | 2021-12-15T10:33:35.000Z | # -*- coding: utf-8 -*-
# Copyright 2018 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
#
# Un... | 47.212025 | 80 | 0.691065 |
798b1f43306bcaf31275c839cd7ea700560ca65b | 4,943 | py | Python | dashboard/Validity.py | StevenZZJ/dataQualityDashboard | c2604904d50346d73d4353bb007122ad7b547555 | [
"MIT"
] | null | null | null | dashboard/Validity.py | StevenZZJ/dataQualityDashboard | c2604904d50346d73d4353bb007122ad7b547555 | [
"MIT"
] | null | null | null | dashboard/Validity.py | StevenZZJ/dataQualityDashboard | c2604904d50346d73d4353bb007122ad7b547555 | [
"MIT"
] | null | null | null | import re
from dashboard import models
class Validity:
def __init__(self):
self.dictV = {'email': '(\w|\.|\_|\-)+[@](\w|\_|\-|\.)+[.]\w{2,3}$',
'portable': '[\+\d]?(\d{2,3}[-\.\s]??\d{2,3}[-\.\s]??\d{4}|\(\d{3}\)\s*\d{3}[-\.\s]??\d{4}|\d{3}[-\.\s]??\d{4})',
'Te... | 28.085227 | 135 | 0.445074 |
798b309fcc562b55bcaceecc1a895fef25dc82fb | 1,081 | py | Python | onmt/ape/bin/translate.py | aeceou/OpenNAPE-py | 9ee9126f85be40b3e83c58ebd58ea56aeaa06a4d | [
"MIT"
] | 1 | 2021-09-17T05:33:37.000Z | 2021-09-17T05:33:37.000Z | onmt/ape/bin/translate.py | aeceou/OpenNAPE-py | 9ee9126f85be40b3e83c58ebd58ea56aeaa06a4d | [
"MIT"
] | null | null | null | onmt/ape/bin/translate.py | aeceou/OpenNAPE-py | 9ee9126f85be40b3e83c58ebd58ea56aeaa06a4d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from onmt.utils.logging import init_logger
from onmt.utils.misc import split_corpus
from onmt.ape.translate.translator import build_post_editor
from onmt.ape.utils.parse import ArgumentParserForAPE
def post_edit(opt):
Argumen... | 31.794118 | 69 | 0.698427 |
798b3bad10859c6b2fe57c97b3f798a6aecf21fa | 12,608 | py | Python | foox/species/third.py | butayama/foox | 7c73c54f125a95250624ba53767b758232033427 | [
"MIT"
] | 94 | 2015-01-27T18:42:09.000Z | 2022-02-11T13:42:38.000Z | foox/species/third.py | butayama/foox | 7c73c54f125a95250624ba53767b758232033427 | [
"MIT"
] | 1 | 2016-04-12T18:10:29.000Z | 2016-04-13T17:10:21.000Z | foox/species/third.py | butayama/foox | 7c73c54f125a95250624ba53767b758232033427 | [
"MIT"
] | 37 | 2015-01-23T21:31:21.000Z | 2021-07-18T22:45:35.000Z | """
This module encapsulates the behaviour of third species counterpoint.
"""
import random
import foox.ga as ga
from .utils import is_parallel, make_generate_function, is_stepwise_motion
# Some sane defaults.
DEFAULT_POPULATION_SIZE = 4000
DEFAULT_MAX_GENERATION = 200
DEFAULT_MUTATION_RANGE = 3
DEFAULT_MUTATION_RAT... | 38.090634 | 78 | 0.624921 |
798b41771468ed708c2a3ef5e686f0b7520c7d60 | 3,242 | py | Python | todo/views/external_add.py | fross123/Theater-Admin-Portal | 68f8b33d2d25ad287efb6038255425a6d64a0b67 | [
"MIT"
] | null | null | null | todo/views/external_add.py | fross123/Theater-Admin-Portal | 68f8b33d2d25ad287efb6038255425a6d64a0b67 | [
"MIT"
] | 26 | 2021-02-08T07:57:42.000Z | 2022-03-01T02:07:58.000Z | todo/views/external_add.py | fross123/Theater-Admin-Portal | 68f8b33d2d25ad287efb6038255425a6d64a0b67 | [
"MIT"
] | null | null | null | from django.conf import settings
from django.contrib import messages
from django.contrib.auth.decorators import login_required, user_passes_test
from django.contrib.auth import get_user_model
from django.contrib.sites.models import Site
from django.core.mail import send_mail
from django.http import HttpResponse
from dj... | 39.536585 | 110 | 0.644047 |
798b5b61f50722ca22263acb27b256c24378dd47 | 4,010 | py | Python | sans-index.py | eidorb/sans-index | dabb4bb5e85b8c51c1569ffbba3f1e0a43a4c8fd | [
"MIT"
] | null | null | null | sans-index.py | eidorb/sans-index | dabb4bb5e85b8c51c1569ffbba3f1e0a43a4c8fd | [
"MIT"
] | null | null | null | sans-index.py | eidorb/sans-index | dabb4bb5e85b8c51c1569ffbba3f1e0a43a4c8fd | [
"MIT"
] | null | null | null | import itertools
from collections import namedtuple
from pathlib import Path
import typer
import xlsxwriter
import yaml
# Some of the colours are a bit hard to distinguish.
colours = [
"#FF1493", # deeppink
# '#FF69B4', # hotpink
"#FFE4E1", # mistyrose
"#E6E6FA", # lavender
# '#B0E0E6', # pow... | 32.868852 | 84 | 0.638155 |
798b736f2c67537c46754dd14c363a85327a7ab2 | 16,128 | py | Python | packages/python-packages/api-stub-generator/apistub/nodes/_function_node.py | LarryOsterman/azure-sdk-tools | 0146e05f4aee767ed7593218109546663be95ec4 | [
"MIT"
] | null | null | null | packages/python-packages/api-stub-generator/apistub/nodes/_function_node.py | LarryOsterman/azure-sdk-tools | 0146e05f4aee767ed7593218109546663be95ec4 | [
"MIT"
] | null | null | null | packages/python-packages/api-stub-generator/apistub/nodes/_function_node.py | LarryOsterman/azure-sdk-tools | 0146e05f4aee767ed7593218109546663be95ec4 | [
"MIT"
] | null | null | null | import logging
import inspect
from collections import OrderedDict
import astroid
import re
from ._docstring_parser import DocstringParser
from ._typehint_parser import TypeHintParser
from ._base_node import NodeEntityBase, get_qualified_name
from ._argtype import ArgType
VALIDATION_REQUIRED_DUNDER = ["__init__",]
KW... | 42.109661 | 181 | 0.631572 |
798b7c82a72002de54b073bcc00540c407082a57 | 10,744 | py | Python | holoviews/core/data/dask.py | jsignell/holoviews | 4f9fd27367f23c3d067d176f638ec82e4b9ec8f0 | [
"BSD-3-Clause"
] | null | null | null | holoviews/core/data/dask.py | jsignell/holoviews | 4f9fd27367f23c3d067d176f638ec82e4b9ec8f0 | [
"BSD-3-Clause"
] | null | null | null | holoviews/core/data/dask.py | jsignell/holoviews | 4f9fd27367f23c3d067d176f638ec82e4b9ec8f0 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
try:
import itertools.izip as zip
except ImportError:
pass
import numpy as np
import pandas as pd
import dask.dataframe as dd
from dask.dataframe import DataFrame, Series
from .. import util
from ..dimension import Dimension
from ..element import Element
from ..ndmappin... | 36.544218 | 87 | 0.579859 |
798bafbc9eb3af04ee38115d82639adbefdaa411 | 700 | py | Python | oscar/lib/python2.7/site-packages/phonenumbers/data/alt_format_7.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/phonenumbers/data/alt_format_7.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/phonenumbers/data/alt_format_7.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | """Auto-generated file, do not edit by hand. 7 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_7 = [NumberFormat(pattern='(\\d{4})(\\d{3})(\\d{3})', format='\\1 \\2-\\3', leading_digits_pattern=['[346-9]']), NumberFormat(pattern='(\\d{5})(\\d{5})', format='\\1 \\2', leading_digits_pattern=['[3... | 140 | 595 | 0.574286 |
798bb91b64ef8233afd8c48aadc61e8291d58c3f | 12,662 | py | Python | autokeras/graph.py | micheleFraccaroli/autokeras | 4c0e36dc0a5418355952dd74f74b2b6e7e87ebf1 | [
"Apache-2.0"
] | 3,979 | 2019-04-02T02:01:52.000Z | 2022-03-31T16:53:14.000Z | autokeras/graph.py | micheleFraccaroli/autokeras | 4c0e36dc0a5418355952dd74f74b2b6e7e87ebf1 | [
"Apache-2.0"
] | 939 | 2019-04-02T18:13:53.000Z | 2022-03-31T16:25:08.000Z | autokeras/graph.py | micheleFraccaroli/autokeras | 4c0e36dc0a5418355952dd74f74b2b6e7e87ebf1 | [
"Apache-2.0"
] | 826 | 2019-04-02T00:53:31.000Z | 2022-03-31T10:11:02.000Z | # Copyright 2020 The AutoKeras 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 applicable law or agreed to i... | 36.177143 | 85 | 0.595246 |
798bc91d2273110a26f81a1757b3a47d5efe32a6 | 339 | py | Python | software/transformers/src/transformers/data/__init__.py | mcgoohanch/Elbria | fa984bef5de17a00b44c86f3b6f5a359c57b7ca5 | [
"MIT"
] | 5 | 2020-12-05T12:10:34.000Z | 2021-03-04T19:01:25.000Z | software/transformers/src/transformers/data/__init__.py | mcgoohanch/Elbria | fa984bef5de17a00b44c86f3b6f5a359c57b7ca5 | [
"MIT"
] | null | null | null | software/transformers/src/transformers/data/__init__.py | mcgoohanch/Elbria | fa984bef5de17a00b44c86f3b6f5a359c57b7ca5 | [
"MIT"
] | 3 | 2020-10-10T10:56:18.000Z | 2020-12-04T20:54:39.000Z | from .processors import InputExample, InputFeatures, DataProcessor
from .processors import glue_output_modes, glue_processors, glue_tasks_num_labels, glue_convert_examples_to_features, \
semdiv_convert_examples_to_features
from .metrics import is_sklearn_available
if is_sklearn_available():
from .metrics import gl... | 42.375 | 119 | 0.870206 |
798c0604f9afae132d0517d5dd4427e6f33af22b | 15,925 | py | Python | src/sx_item.py | tonypdmtr/sxtool | 225468d70c5fe1bf7414f19ce13dcdd43e872433 | [
"BSD-2-Clause"
] | 3 | 2018-10-11T15:34:24.000Z | 2022-02-20T23:24:01.000Z | src/sx_item.py | tonypdmtr/sxtool | 225468d70c5fe1bf7414f19ce13dcdd43e872433 | [
"BSD-2-Clause"
] | 1 | 2018-10-16T06:58:22.000Z | 2018-10-22T20:19:55.000Z | src/sx_item.py | tonypdmtr/sxtool | 225468d70c5fe1bf7414f19ce13dcdd43e872433 | [
"BSD-2-Clause"
] | 1 | 2022-02-20T23:26:50.000Z | 2022-02-20T23:26:50.000Z | # Copyright 2018 Philippe Fremy
# This software is provided under the BSD 2 clause license; see LICENSE.txt file for more information
from typing import Optional, List, Dict, Union, TextIO
def str2hex( s:Optional[str] ) -> List[int]:
'''Convert a string containing hexadecimal values, with possible space and newli... | 36.863426 | 149 | 0.557174 |
798c58cdf437272a632576fae63c14f5f24f02b6 | 1,628 | py | Python | recOrder/postproc/post_processing.py | mehta-lab/recOrder | 67f2edb9ab13114dfe41d57e465ae24f961b0004 | [
"Unlicense"
] | 2 | 2022-01-19T21:13:32.000Z | 2022-02-24T19:40:24.000Z | recOrder/postproc/post_processing.py | mehta-lab/recOrder | 67f2edb9ab13114dfe41d57e465ae24f961b0004 | [
"Unlicense"
] | 55 | 2021-06-24T18:53:18.000Z | 2022-03-30T21:05:14.000Z | recOrder/postproc/post_processing.py | mehta-lab/recOrder | 67f2edb9ab13114dfe41d57e465ae24f961b0004 | [
"Unlicense"
] | null | null | null | from scipy.ndimage import affine_transform
import numpy as np
from waveorder.util import wavelet_softThreshold
def post_proc_denoise(data_volume, params):
data_volume_denoised = np.copy(data_volume)
if len(data_volume) == 1:
data_volume_denoised = wavelet_softThreshold(data_volume[0], 'db8', params[... | 31.307692 | 110 | 0.589066 |
798c74438a3148a53e88be92bdd78e33a41936cf | 3,558 | py | Python | intersight/models/memory_array_ref.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | intersight/models/memory_array_ref.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | intersight/models/memory_array_ref.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Intersight REST API
This is Intersight REST API
OpenAPI spec version: 1.0.9-255
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class MemoryArrayRef(object):
"""
NOTE: This class ... | 23.72 | 77 | 0.534851 |
798c976548df918e9f86a6a5f41879e545f56fa4 | 11,941 | py | Python | numba/extending.py | sighingnow/numba | ae88a6ff4a41f76e50672a1af9d9aa66c205b51b | [
"BSD-2-Clause"
] | 1 | 2019-02-13T09:22:51.000Z | 2019-02-13T09:22:51.000Z | numba/extending.py | sighingnow/numba | ae88a6ff4a41f76e50672a1af9d9aa66c205b51b | [
"BSD-2-Clause"
] | null | null | null | numba/extending.py | sighingnow/numba | ae88a6ff4a41f76e50672a1af9d9aa66c205b51b | [
"BSD-2-Clause"
] | null | null | null |
import inspect
import uuid
import weakref
import collections
from numba import types, config
# Exported symbols
from .typing.typeof import typeof_impl
from .typing.templates import infer, infer_getattr
from .targets.imputils import (
lower_builtin, lower_getattr, lower_getattr_generic,
lower_setattr, lower_s... | 32.44837 | 80 | 0.648271 |
798cc05bbf20d0c6e220f7ebfca7a7dbf7d054b7 | 33,468 | py | Python | geosoft/gxapi/GXVA.py | fearaschiarrai/gxpy | 4c5e7594b24e530a8cd94df1eef562c5c6ce3e92 | [
"BSD-2-Clause"
] | 25 | 2017-07-14T06:39:37.000Z | 2022-03-09T21:39:51.000Z | geosoft/gxapi/GXVA.py | fearaschiarrai/gxpy | 4c5e7594b24e530a8cd94df1eef562c5c6ce3e92 | [
"BSD-2-Clause"
] | 100 | 2016-12-13T17:30:41.000Z | 2021-08-01T20:21:13.000Z | geosoft/gxapi/GXVA.py | fearaschiarrai/gxpy | 4c5e7594b24e530a8cd94df1eef562c5c6ce3e92 | [
"BSD-2-Clause"
] | 28 | 2016-12-12T17:34:40.000Z | 2022-03-16T15:39:39.000Z | ### extends 'class_empty.py'
### block ClassImports
# NOTICE: Do not edit anything here, it is generated code
from . import gxapi_cy
from geosoft.gxapi import GXContext, float_ref, int_ref, str_ref
from .GXVV import GXVV
### endblock ClassImports
### block Header
# NOTICE: The code generator will not replace the cod... | 33.737903 | 218 | 0.6015 |
798cc134d744ddfbd721c9365ab1fa57546d4f7c | 11,755 | py | Python | bonneville/utils/jinja.py | lowsodium/bonneville | 02a016380b56345594f20ee007c62e7e92821a8b | [
"Apache-2.0"
] | null | null | null | bonneville/utils/jinja.py | lowsodium/bonneville | 02a016380b56345594f20ee007c62e7e92821a8b | [
"Apache-2.0"
] | null | null | null | bonneville/utils/jinja.py | lowsodium/bonneville | 02a016380b56345594f20ee007c62e7e92821a8b | [
"Apache-2.0"
] | 3 | 2020-05-10T02:08:44.000Z | 2020-11-06T11:01:57.000Z | # -*- coding: utf-8 -*-
'''
Jinja loading utils to enable a more powerful backend for jinja templates
'''
# Import python libs
from os import path
import logging
import json
from functools import wraps
# Import third party libs
from jinja2 import BaseLoader, Markup, TemplateNotFound, nodes
from jinja2.environment imp... | 29.910941 | 92 | 0.536963 |
798cc3684469cd9956ffa5c6adbb138fc1045476 | 1,692 | py | Python | category_encoders/utils.py | deil87/categorical-encoding | c867aa09343b55cbcb600958542d6e8b0c405d86 | [
"BSD-3-Clause"
] | null | null | null | category_encoders/utils.py | deil87/categorical-encoding | c867aa09343b55cbcb600958542d6e8b0c405d86 | [
"BSD-3-Clause"
] | null | null | null | category_encoders/utils.py | deil87/categorical-encoding | c867aa09343b55cbcb600958542d6e8b0c405d86 | [
"BSD-3-Clause"
] | null | null | null | """A collection of shared utilities for all encoders, not intended for external use."""
import pandas as pd
import numpy as np
from scipy.sparse.csr import csr_matrix
__author__ = 'willmcginnis'
def get_obj_cols(df):
"""
Returns names of 'object' columns in the DataFrame.
"""
obj_cols = []
for i... | 28.2 | 103 | 0.637116 |
798ceb11216b3ff9a46e67a5374eff590f27abf4 | 2,856 | py | Python | tests/laser_test.py | lubiluk/qibullet | 46b7f3a6f1672185233bbe5be545a8b176bc9127 | [
"Apache-2.0"
] | null | null | null | tests/laser_test.py | lubiluk/qibullet | 46b7f3a6f1672185233bbe5be545a8b176bc9127 | [
"Apache-2.0"
] | null | null | null | tests/laser_test.py | lubiluk/qibullet | 46b7f3a6f1672185233bbe5be545a8b176bc9127 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
import time
import unittest
from qibullet import PepperVirtual
from qibullet import SimulationManager
class PepperLaserTest(unittest.TestCase):
"""
Unittests for Pepper's lasers
"""
@classmethod
def setUpClass(cls):
"""
Launches a simulation a... | 28.56 | 77 | 0.637605 |
798d0ba399242e61f907f79c1d3e62a3910c19f9 | 663 | py | Python | frontend/extensions.py | acasi-ctf/ctf | 1136185c359252d80f5dd4ebd4ce4cc404cd4ea3 | [
"Apache-2.0"
] | 4 | 2021-03-13T04:45:23.000Z | 2022-03-22T06:45:04.000Z | frontend/extensions.py | acasi-ctf/ctf | 1136185c359252d80f5dd4ebd4ce4cc404cd4ea3 | [
"Apache-2.0"
] | 207 | 2021-03-09T22:36:46.000Z | 2022-03-28T13:49:50.000Z | frontend/extensions.py | acasi-ctf/ctf | 1136185c359252d80f5dd4ebd4ce4cc404cd4ea3 | [
"Apache-2.0"
] | 2 | 2021-03-13T01:07:37.000Z | 2021-12-23T00:01:40.000Z | """
This file contains all Flask extensions.
"""
import os
import grpc
from flask_migrate import Migrate
from flask_sqlalchemy import SQLAlchemy
from frontend.pb import EnvironmentLookupServiceStub, EnvironmentProvisioningServiceStub
operator_channel_target = "localhost:1234"
if os.getenv("CTF_OPERATOR_SERVICE_HOST"... | 30.136364 | 88 | 0.834087 |
798d23334c7d1ed4af4f810925c7855ca5aeeb34 | 606 | py | Python | Task1E.py | jgm48/ia-flood-risk-project | b0e61bae8ff4c00bf767e95f7e271760c0bff543 | [
"MIT"
] | null | null | null | Task1E.py | jgm48/ia-flood-risk-project | b0e61bae8ff4c00bf767e95f7e271760c0bff543 | [
"MIT"
] | null | null | null | Task1E.py | jgm48/ia-flood-risk-project | b0e61bae8ff4c00bf767e95f7e271760c0bff543 | [
"MIT"
] | null | null | null | '''TASK 1E'''
from distutils.command.build import *
from floodsystem.geo import *
from floodsystem.station import *
from floodsystem.datafetcher import *
from floodsystem.stationdata import build_station_list
def run():
# Obtain list of stations
stations = build_station_list()
# Run the demonstr... | 27.545455 | 105 | 0.70462 |
798d55741618b5710ef5808c371c472392f6f8e4 | 26,329 | py | Python | monitors/views.py | armyninja/cyber | e20db027f44deb3ec1ca7e55e1cb58b5e7348ba5 | [
"MIT"
] | 1 | 2019-03-13T09:21:56.000Z | 2019-03-13T09:21:56.000Z | monitors/views.py | armyninja/cyber | e20db027f44deb3ec1ca7e55e1cb58b5e7348ba5 | [
"MIT"
] | null | null | null | monitors/views.py | armyninja/cyber | e20db027f44deb3ec1ca7e55e1cb58b5e7348ba5 | [
"MIT"
] | null | null | null | import csv
import datetime
import django.template
import logging
from django.views.generic import TemplateView, ListView, FormView, View
from django.shortcuts import render
from django.http import HttpResponse
from django.shortcuts import redirect
from django.core.urlresolvers import reverse
from django.contrib import... | 39.771903 | 120 | 0.654943 |
798d56e66eb15582e859a13953a0641e7004d28a | 5,600 | py | Python | src/callbacks/visualizer.py | smivv/kaggle-bengali | ab6a2153b657b4f4210551f7f4a674920d66a272 | [
"Apache-2.0"
] | null | null | null | src/callbacks/visualizer.py | smivv/kaggle-bengali | ab6a2153b657b4f4210551f7f4a674920d66a272 | [
"Apache-2.0"
] | null | null | null | src/callbacks/visualizer.py | smivv/kaggle-bengali | ab6a2153b657b4f4210551f7f4a674920d66a272 | [
"Apache-2.0"
] | null | null | null | # flake8: noqa
# isort: skip_file
import cv2
import numpy as np
import torch
import torchvision.utils
from catalyst.dl import Callback, CallbackOrder, State
from catalyst.contrib.tools.tensorboard import SummaryWriter
class VisualizationCallback2(Callback):
TENSORBOARD_LOGGER_KEY = "_tensorboard"
def __in... | 34.355828 | 95 | 0.612143 |
798dcc35d94a2659c56c48a750d6629e61ce608e | 3,727 | py | Python | base/utils/constants.py | korenlev/calipso-cvim | 39278a5cf09c40b26a8a143ccc0c8d437961abc2 | [
"Apache-2.0"
] | null | null | null | base/utils/constants.py | korenlev/calipso-cvim | 39278a5cf09c40b26a8a143ccc0c8d437961abc2 | [
"Apache-2.0"
] | null | null | null | base/utils/constants.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 #
# #
... | 30.300813 | 116 | 0.637778 |
798de2f9e5e47d93946a9a6f91daf49d88c5006a | 2,924 | py | Python | wsh/connection.py | pinntech/wsh | 6243046eb90b193c2d203525c2712a7d7bc29e1f | [
"MIT"
] | null | null | null | wsh/connection.py | pinntech/wsh | 6243046eb90b193c2d203525c2712a7d7bc29e1f | [
"MIT"
] | null | null | null | wsh/connection.py | pinntech/wsh | 6243046eb90b193c2d203525c2712a7d7bc29e1f | [
"MIT"
] | null | null | null | """
:copyright: (c) 2018 Pinn Technologies, Inc.
:license: All rights reserved
"""
import json
import click
import websocket
from blinker import signal
from prompt_toolkit.document import Document
class Connection:
def __init__(self, ws_url, app, receiver=None):
signal('wsh-send').connect(self.send)
... | 34.4 | 83 | 0.569425 |
798def3b91ffed5e212854fb8a7972eda5f5909e | 3,782 | py | Python | chapter_1_fundamentals/speak_google.py | fancyerii/voicebook | def82da8577086d0361643a05fec2463006533a9 | [
"Apache-2.0"
] | 1 | 2020-03-05T01:19:17.000Z | 2020-03-05T01:19:17.000Z | chapter_1_fundamentals/speak_google.py | fancyerii/voicebook | def82da8577086d0361643a05fec2463006533a9 | [
"Apache-2.0"
] | null | null | null | chapter_1_fundamentals/speak_google.py | fancyerii/voicebook | def82da8577086d0361643a05fec2463006533a9 | [
"Apache-2.0"
] | null | null | null | '''
================================================
## VOICEBOOK REPOSITORY ##
================================================
repository name: voicebook
repository version: 1.0
repository link: https://github.com/jim-schwoebel/voicebook
author: Jim Schwoebel
author contact: js@neur... | 37.078431 | 121 | 0.642782 |
798df302b2e612a1a327cb867a853dfe5e58b444 | 3,931 | py | Python | bp_acceptance_tests/level_2/acceptance_test_trmv.py | nicholas-moreles/blaspy | c4af6258e17dd996c4b6d90bbaae15b31b8702b4 | [
"BSD-3-Clause"
] | 4 | 2015-01-25T12:44:44.000Z | 2022-03-19T08:36:19.000Z | bp_acceptance_tests/level_2/acceptance_test_trmv.py | nicholas-moreles/blaspy | c4af6258e17dd996c4b6d90bbaae15b31b8702b4 | [
"BSD-3-Clause"
] | 7 | 2015-01-20T13:35:39.000Z | 2015-05-31T17:11:50.000Z | bp_acceptance_tests/level_2/acceptance_test_trmv.py | nicholas-moreles/blaspy | c4af6258e17dd996c4b6d90bbaae15b31b8702b4 | [
"BSD-3-Clause"
] | null | null | null | """
Copyright (c) 2014-2015-2015, The University of Texas at Austin.
All rights reserved.
This file is part of BLASpy and is available under the 3-Clause
BSD License, which can be found in the LICENSE file at the top-level
directory or at http://opensource.org/licenses/BSD-3-Clause
"""
from ..he... | 35.736364 | 95 | 0.62147 |
798e3f17ca6ca0a8379301e950f6d75ba24b2f8e | 2,018 | py | Python | venv/Lib/site-packages/pyrogram/raw/types/input_privacy_key_phone_number.py | D1ne2021/jjhhhjj | a090da30983b3ef276dfe4cef2ded4526f36002a | [
"MIT"
] | 2 | 2021-12-13T07:09:55.000Z | 2022-01-12T12:15:20.000Z | venv/Lib/site-packages/pyrogram/raw/types/input_privacy_key_phone_number.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pyrogram/raw/types/input_privacy_key_phone_number.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 31.53125 | 103 | 0.63776 |
798e4100b2b6f9a042b7c36a98d957f66b1c5402 | 1,766 | py | Python | p3_collab-compet/hyperparameters.py | fdasilva59/deep-reinforcement-learning | a95e71730e54dae26ca24fcb31d5f4a7bb0eb025 | [
"MIT"
] | null | null | null | p3_collab-compet/hyperparameters.py | fdasilva59/deep-reinforcement-learning | a95e71730e54dae26ca24fcb31d5f4a7bb0eb025 | [
"MIT"
] | null | null | null | p3_collab-compet/hyperparameters.py | fdasilva59/deep-reinforcement-learning | a95e71730e54dae26ca24fcb31d5f4a7bb0eb025 | [
"MIT"
] | null | null | null | import torch.nn.functional as F
# Default hyperparameters
SEED = 10 # Random seed
NB_EPISODES = 10000 # Max nb of episodes
NB_STEPS = 1000 # Max nb of steps per episodes
UPDATE_EVERY_NB_EPISODE = 4 # Nb of episodes between ... | 51.941176 | 88 | 0.60872 |
798e448ef8ca9738a7d14186233bb75227951656 | 678 | py | Python | src/command_modules/azure-cli-dls/azure/cli/command_modules/dls/__init__.py | v-Ajnava/azure-cli | febec631d79bfca151e84267b5b409594bad598e | [
"MIT"
] | null | null | null | src/command_modules/azure-cli-dls/azure/cli/command_modules/dls/__init__.py | v-Ajnava/azure-cli | febec631d79bfca151e84267b5b409594bad598e | [
"MIT"
] | 3 | 2021-03-26T00:48:20.000Z | 2022-03-29T22:05:39.000Z | src/command_modules/azure-cli-dls/azure/cli/command_modules/dls/__init__.py | v-Ajnava/azure-cli | febec631d79bfca151e84267b5b409594bad598e | [
"MIT"
] | 1 | 2017-12-28T04:51:44.000Z | 2017-12-28T04:51:44.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 45.2 | 106 | 0.567847 |
798e44c97d49866dcdbfa210774ee9c3278c31a3 | 5,621 | py | Python | tests/test_tagpack_schema.py | graphsense/graphsense-tagpack-tool | 81260c9c22f8630a164e1aefa06fc89baab9b345 | [
"MIT"
] | 4 | 2020-05-14T07:37:24.000Z | 2020-12-20T11:47:14.000Z | tests/test_tagpack_schema.py | graphsense/graphsense-tagpack-tool | 81260c9c22f8630a164e1aefa06fc89baab9b345 | [
"MIT"
] | 17 | 2021-03-29T15:24:55.000Z | 2022-03-31T14:46:39.000Z | tests/test_tagpack_schema.py | graphsense/graphsense-tagpack-tool | 81260c9c22f8630a164e1aefa06fc89baab9b345 | [
"MIT"
] | 3 | 2020-08-13T22:35:03.000Z | 2022-02-16T10:11:58.000Z | from datetime import date
import pytest
from tagpack.tagpack_schema import TagPackSchema, ValidationError
from tagpack.taxonomy import Taxonomy
@pytest.fixture
def schema(monkeypatch):
def mock_load_schema(*args, **kwargs):
pass
tagpack_schema = TagPackSchema()
return tagpack_schema
@pytest.... | 34.484663 | 73 | 0.745597 |
798e507da635160ece704f312cf1167005022ac3 | 1,681 | py | Python | sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_update_parameters_py3.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_update_parameters_py3.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_update_parameters_py3.py | xiafu-msft/azure-sdk-for-python | 4d9560cfd519ee60667f3cc2f5295a58c18625db | [
"MIT"
] | null | null | null | # 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 ... | 40.02381 | 82 | 0.627008 |
798ea67e74e375cbfa815d45ab9263b649d18bcb | 634 | py | Python | src/pyramid_slide_down.py | AshotVantsyan/longest_slide_down | 33d2ea22901bfde495887968c5674f590776d119 | [
"MIT"
] | null | null | null | src/pyramid_slide_down.py | AshotVantsyan/longest_slide_down | 33d2ea22901bfde495887968c5674f590776d119 | [
"MIT"
] | null | null | null | src/pyramid_slide_down.py | AshotVantsyan/longest_slide_down | 33d2ea22901bfde495887968c5674f590776d119 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3.8
"""
The core of the project.
Contains function which calculates the longest slide down path of the given pyramid.
"""
from typing import List
def longest_slide_down(pyramid: List[List[int]]) -> int:
"""
The function returns the maximum path sum for the given pyramid.
Dynamic prog... | 33.368421 | 86 | 0.660883 |
798ecd8abc488308e71038264ca885dad7cf802b | 2,848 | py | Python | examples/python/08-save-stream.py | lkucalaba/tiscamera | e1fa7b21bb4dd777ae8039dfa072cfa2daa88244 | [
"Apache-2.0"
] | 241 | 2015-02-20T09:10:41.000Z | 2022-03-18T08:53:26.000Z | examples/python/08-save-stream.py | lkucalaba/tiscamera | e1fa7b21bb4dd777ae8039dfa072cfa2daa88244 | [
"Apache-2.0"
] | 435 | 2015-01-19T10:18:01.000Z | 2022-03-28T08:03:08.000Z | examples/python/08-save-stream.py | lkucalaba/tiscamera | e1fa7b21bb4dd777ae8039dfa072cfa2daa88244 | [
"Apache-2.0"
] | 141 | 2015-01-03T17:54:08.000Z | 2022-02-09T09:55:15.000Z | #!/usr/bin/env python3
# Copyright 2019 The Imaging Source Europe GmbH
#
# 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 a... | 31.644444 | 98 | 0.592346 |
798ef33a7b4405a93b959e800d2cac6bc1eb6506 | 1,382 | py | Python | mojacoder/001/gen.py | KATO-Hiro/atcoder-1 | c2cbfcfd5c3d46ac9810ba330a37d437aa2839c2 | [
"MIT"
] | null | null | null | mojacoder/001/gen.py | KATO-Hiro/atcoder-1 | c2cbfcfd5c3d46ac9810ba330a37d437aa2839c2 | [
"MIT"
] | null | null | null | mojacoder/001/gen.py | KATO-Hiro/atcoder-1 | c2cbfcfd5c3d46ac9810ba330a37d437aa2839c2 | [
"MIT"
] | null | null | null | import glob
import os
import random
import shutil
import sys
from math import gcd
input = sys.stdin.readline
random.seed(777)
testdir = "./gcd-and-lcm/testcases"
def lcm(a, b):
return (a * b) // gcd(a, b)
def write_testcase(name, A, B, G, L):
with open(f"{testdir}/in/{name}.txt", "w", encoding="utf-8") as... | 22.655738 | 71 | 0.532562 |
798efaf594e81f4d90ec2ae204f32e2e317251e8 | 8,921 | py | Python | tfchain/errors.py | xmonader/pytfchain | ef28238eeaedda1dd5ea8055ea6dc2ca6baa263c | [
"Apache-2.0"
] | null | null | null | tfchain/errors.py | xmonader/pytfchain | ef28238eeaedda1dd5ea8055ea6dc2ca6baa263c | [
"Apache-2.0"
] | null | null | null | tfchain/errors.py | xmonader/pytfchain | ef28238eeaedda1dd5ea8055ea6dc2ca6baa263c | [
"Apache-2.0"
] | null | null | null | class InvalidPublicKeySpecifier(Exception):
"""
InvalidPublicKeySpecifier error
"""
class UnknownTransansactionVersion(Exception):
"""
UnknownTransansactionVersion error
"""
class InsufficientFunds(Exception):
"""
InsufficientFunds error
"""
class CurrencyPrecisionOverflow(Exce... | 25.857971 | 133 | 0.637036 |
798f514f42401c41643cd90f4974b196a1247927 | 2,838 | py | Python | common/common/utils/grpc_server.py | ravirahman/sancus | 6563852b98edeb1068574e2d99e1fc18b815bee3 | [
"MIT"
] | 2 | 2022-03-17T04:50:20.000Z | 2022-03-17T04:51:31.000Z | common/common/utils/grpc_server.py | ravirahman/sancus | 6563852b98edeb1068574e2d99e1fc18b815bee3 | [
"MIT"
] | null | null | null | common/common/utils/grpc_server.py | ravirahman/sancus | 6563852b98edeb1068574e2d99e1fc18b815bee3 | [
"MIT"
] | null | null | null | import logging
from concurrent.futures import ThreadPoolExecutor
from types import TracebackType
from typing import Optional, Type
import grpc
from grpc_health.v1.health import HealthServicer
from grpc_health.v1.health_pb2 import HealthCheckResponse
from grpc_health.v1.health_pb2_grpc import add_HealthServicer_to_serv... | 40.542857 | 120 | 0.68957 |
798f6cbaa41bb3910fe54177e21c0ac9c6ec3b4e | 1,094 | py | Python | story.py | sagol/umorilibot | 89e4bdc9771c21326768171099ee9872dc40b194 | [
"MIT"
] | 1 | 2021-02-19T11:13:24.000Z | 2021-02-19T11:13:24.000Z | story.py | sagol/umorilibot | 89e4bdc9771c21326768171099ee9872dc40b194 | [
"MIT"
] | null | null | null | story.py | sagol/umorilibot | 89e4bdc9771c21326768171099ee9872dc40b194 | [
"MIT"
] | null | null | null | import hashlib
class Story:
def __init__(self):
self.site = ''
self.site_name = ''
self.site_desc = ''
self.story_url = ''
self.story = ''
self.story_html = ''
def set(self, story_dict):
self.site = story_dict.get('site')
self.site_name = story_... | 26.682927 | 54 | 0.561243 |
798f95fd196003ef3ecb7d6c5e21ebb39b281bb0 | 2,906 | py | Python | lib/python/qmk/cli/kle2json.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | null | null | null | lib/python/qmk/cli/kle2json.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | null | null | null | lib/python/qmk/cli/kle2json.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | null | null | null | """Convert raw KLE to JSON
"""
import json
import os
from pathlib import Path
from decimal import Decimal
from collections import OrderedDict
from milc import cli
from kle2xy import KLE2xy
from qmk.converter import kle2qmk
class CustomJSONEncoder(json.JSONEncoder):
def default(self, obj):
try:
... | 38.236842 | 126 | 0.655196 |
798fc071791b7b342b1e31a6eaaa6c02e8bbd4e2 | 435 | py | Python | smartva/rules/road_traffic_adult.py | rileyhazard/SmartVA-Analyze-1 | 0573eeff27d03f54e7506db4f1631c0cd9f54bbb | [
"MIT"
] | 4 | 2019-01-23T12:57:47.000Z | 2020-04-18T17:13:08.000Z | smartva/rules/road_traffic_adult.py | rileyhazard/SmartVA-Analyze-1 | 0573eeff27d03f54e7506db4f1631c0cd9f54bbb | [
"MIT"
] | 4 | 2019-01-09T22:10:07.000Z | 2022-02-16T04:57:06.000Z | smartva/rules/road_traffic_adult.py | rileyhazard/SmartVA-Analyze-1 | 0573eeff27d03f54e7506db4f1631c0cd9f54bbb | [
"MIT"
] | 11 | 2018-12-11T22:01:13.000Z | 2022-01-07T11:38:02.000Z | # https://stash.ihme.washington.edu/projects/VA/repos/business_rules/browse/doc/md/rti.md
from smartva.data.constants import *
from smartva.utils.utils import value_from_row, int_or_float
CAUSE_ID = 41
def logic_rule(row):
value_of = value_from_row(row, int_or_float)
road_traffic = value_of(Adult.ROAD_TRAFF... | 27.1875 | 89 | 0.777011 |
798fc53d00611bcc8cc209246b8d0a64197f5c0d | 8,351 | py | Python | ggshield/dev_scan.py | rgajason/gg-shield | 45c3534bdd174880710b97aedac068f6ddd52eaf | [
"MIT"
] | null | null | null | ggshield/dev_scan.py | rgajason/gg-shield | 45c3534bdd174880710b97aedac068f6ddd52eaf | [
"MIT"
] | 1 | 2021-06-02T04:28:09.000Z | 2021-06-02T04:28:09.000Z | ggshield/dev_scan.py | rgajason/gg-shield | 45c3534bdd174880710b97aedac068f6ddd52eaf | [
"MIT"
] | null | null | null | import concurrent.futures
import os
import tempfile
import traceback
from contextlib import contextmanager
from pathlib import Path
from typing import Iterable, Iterator, List, Set
import click
from pygitguardian import GGClient
from ggshield.output import OutputHandler
from ggshield.scan import Commit, ScanCollectio... | 30.702206 | 85 | 0.622081 |
798fd78ed8ec3e53bd8446989798ba105246ebd6 | 1,193 | py | Python | main.py | vt-sailbot/sailbot-19 | a9252e9415d3fef62e4baf813306bdc07fb69781 | [
"MIT"
] | 1 | 2019-05-29T19:32:48.000Z | 2019-05-29T19:32:48.000Z | main.py | vt-sailbot/sailbot-19 | a9252e9415d3fef62e4baf813306bdc07fb69781 | [
"MIT"
] | 3 | 2019-02-23T13:33:47.000Z | 2019-08-18T12:54:56.000Z | main.py | vt-sailbot/sailbot-19 | a9252e9415d3fef62e4baf813306bdc07fb69781 | [
"MIT"
] | null | null | null | import src.airmar.airmar_input_thread as airmar
import src.rc_input.rc_input_thread as rc
import src.rudder.rudder_listener as rudder
import src.sail.sail_listener as sail
import src.nav.captain as captain
from src.boat.boat import Boat
from src.world.world import World
from src.logging.logger import Logger
def main... | 25.934783 | 124 | 0.654652 |
7990481169401a134a2347907921e40038ccb485 | 10,516 | py | Python | sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_private_link_resources_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_private_link_resources_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/operations/_private_link_resources_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # 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 ... | 41.896414 | 208 | 0.677824 |
79905b0cb8d6ac3c77c41e08a68440e33383cdd6 | 954 | py | Python | userbot/helpers/tools.py | ansiltech/Wolf-UserBot | 4ae67752d00febe2671d0eaeb713dc3569c5d6df | [
"MIT"
] | 2 | 2021-09-15T06:07:55.000Z | 2021-09-15T08:42:02.000Z | userbot/helpers/tools.py | ansiltech/Wolf-UserBot | 4ae67752d00febe2671d0eaeb713dc3569c5d6df | [
"MIT"
] | null | null | null | userbot/helpers/tools.py | ansiltech/Wolf-UserBot | 4ae67752d00febe2671d0eaeb713dc3569c5d6df | [
"MIT"
] | null | null | null | from html_telegraph_poster import TelegraphPoster
def media_type(message):
if message and message.photo:
return "Photo"
if message and message.audio:
return "Audio"
if message and message.voice:
return "Voice"
if message and message.video_note:
return "Round Video"
... | 27.257143 | 61 | 0.675052 |
799098f52f1c9c2be1be9be63950c17009619df2 | 2,577 | py | Python | SLU/fairseq/fairseq/modules/__init__.py | Natalia-T/NeurIPS2021 | 1b368c6461a9a56a4337f9ee86888e286a55f2f9 | [
"MIT"
] | 5 | 2021-10-11T13:44:05.000Z | 2022-02-22T12:55:25.000Z | SLU/fairseq/fairseq/modules/__init__.py | Natalia-T/NeurIPS2021 | 1b368c6461a9a56a4337f9ee86888e286a55f2f9 | [
"MIT"
] | null | null | null | SLU/fairseq/fairseq/modules/__init__.py | Natalia-T/NeurIPS2021 | 1b368c6461a9a56a4337f9ee86888e286a55f2f9 | [
"MIT"
] | 8 | 2021-09-09T14:49:14.000Z | 2022-03-03T15:53:09.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from .adaptive_input import AdaptiveInput
from .adaptive_softmax import AdaptiveSoftmax
from .beamable_mm import BeamableMM
from .character_to... | 36.295775 | 79 | 0.815289 |
7990ac549a49b80e5df91a874bc2a8bc751b2e37 | 471 | py | Python | source/memex/wsgi.py | 0x0mar/memex-explorer | e6b0f2da034e746193ee104c7c10f58c0698774f | [
"BSD-2-Clause"
] | 31 | 2018-02-26T11:28:14.000Z | 2021-04-19T02:51:53.000Z | source/memex/wsgi.py | danielguerra69/memex-explorer | d4c2e63fb982bb23f6cb9d7b0a93b21740a68f10 | [
"BSD-2-Clause"
] | 185 | 2015-01-01T16:54:08.000Z | 2015-03-04T23:31:15.000Z | source/memex/wsgi.py | danielguerra69/memex-explorer | d4c2e63fb982bb23f6cb9d7b0a93b21740a68f10 | [
"BSD-2-Clause"
] | 15 | 2018-03-23T14:01:35.000Z | 2020-10-28T00:46:28.000Z | """
WSGI config for memex project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
import sys
sys.path.insert(1, '/'.join(os.path.abspath(__file__).split('/')[:-2]))
os.e... | 23.55 | 78 | 0.757962 |
79912d52f84992567bf568be9d1b85bf3f7906da | 23,458 | py | Python | lib/datasets/food_meta_data.py | denglixi/faster-rcnn.pytorch | 12158fa2ec998ba3733a4696b7a4e08a35c157e3 | [
"MIT"
] | null | null | null | lib/datasets/food_meta_data.py | denglixi/faster-rcnn.pytorch | 12158fa2ec998ba3733a4696b7a4e08a35c157e3 | [
"MIT"
] | null | null | null | lib/datasets/food_meta_data.py | denglixi/faster-rcnn.pytorch | 12158fa2ec998ba3733a4696b7a4e08a35c157e3 | [
"MIT"
] | null | null | null | from __future__ import print_function
from __future__ import absolute_import
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# ----------------------------------------------------... | 38.081169 | 138 | 0.557976 |
79912edc362bf803d5363183c71e8d607117500b | 3,664 | py | Python | dvc/remote/oss.py | drorata/dvc | b6bc65fcbf269b94b7c1ce2d9dff641dedb039b0 | [
"Apache-2.0"
] | 2 | 2019-06-23T14:24:48.000Z | 2019-07-08T12:22:53.000Z | dvc/remote/oss.py | drorata/dvc | b6bc65fcbf269b94b7c1ce2d9dff641dedb039b0 | [
"Apache-2.0"
] | null | null | null | dvc/remote/oss.py | drorata/dvc | b6bc65fcbf269b94b7c1ce2d9dff641dedb039b0 | [
"Apache-2.0"
] | 1 | 2019-09-02T00:29:40.000Z | 2019-09-02T00:29:40.000Z | from __future__ import absolute_import
from __future__ import unicode_literals
import os
import logging
from dvc.scheme import Schemes
try:
import oss2
except ImportError:
oss2 = None
from dvc.config import Config
from dvc.remote.base import RemoteBASE
from dvc.remote.azure import Callback
from dvc.path_inf... | 30.032787 | 77 | 0.638373 |
7991466668f952a5c4284dfe36e6917282d70f2f | 44,709 | py | Python | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_storage_accounts_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_storage_accounts_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_storage_accounts_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 ... | 47.211193 | 448 | 0.684985 |
799170a26a5648140476c915fa6c5fee8cac43e5 | 9,923 | py | Python | obsolete/pipeline_rnaseq/trackers/Reference.py | kevinrue/cgat-flow | 02b5a1867253c2f6fd6b4f3763e0299115378913 | [
"MIT"
] | 11 | 2018-09-07T11:33:23.000Z | 2022-01-07T12:16:11.000Z | obsolete/pipeline_rnaseq/trackers/Reference.py | kevinrue/cgat-flow | 02b5a1867253c2f6fd6b4f3763e0299115378913 | [
"MIT"
] | 102 | 2018-03-22T15:35:26.000Z | 2022-03-23T17:46:16.000Z | obsolete/pipeline_rnaseq/trackers/Reference.py | kevinrue/cgat-flow | 02b5a1867253c2f6fd6b4f3763e0299115378913 | [
"MIT"
] | 7 | 2018-06-11T15:01:41.000Z | 2020-03-31T09:29:33.000Z | import os
import sys
import re
import types
import itertools
import math
from RnaseqReport import *
from cgatReport.ResultBlock import ResultBlock, ResultBlocks
import Stats
##########################################################################
####################################################################... | 35.063604 | 125 | 0.495415 |
7991851ff47db5c2a21368e28fe2c9520e8bc808 | 1,228 | py | Python | util/compile_plot_stats.py | mcba1n/nanopore_dna_storage | fd91f4c88f7d602aadcdcb5c3f14e2d41902aef2 | [
"MIT"
] | 10 | 2020-07-26T22:06:25.000Z | 2022-03-27T13:20:57.000Z | util/compile_plot_stats.py | mcba1n/nanopore_dna_storage | fd91f4c88f7d602aadcdcb5c3f14e2d41902aef2 | [
"MIT"
] | null | null | null | util/compile_plot_stats.py | mcba1n/nanopore_dna_storage | fd91f4c88f7d602aadcdcb5c3f14e2d41902aef2 | [
"MIT"
] | 6 | 2020-08-10T09:14:14.000Z | 2021-07-25T09:08:16.000Z | import sys
import matplotlib.pyplot as plt
if len(sys.argv) != 3:
print('Incorrect number of arguments')
sys.exit(1)
prefix = str(sys.argv[1])
num_mapped = int(sys.argv[2])
f_csv = open(prefix+'.error_stats.csv','w')
subs_pos = []
subs_rate = []
ins_pos = []
ins_rate = []
del_pos = []
del_rate = []
f_csv.w... | 25.583333 | 66 | 0.599349 |
7991b8fbfd78f2b820f62e47dcd995ea4c92f737 | 1,558 | py | Python | tests/unit/modules/nginx_test.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | 2 | 2017-09-17T21:10:35.000Z | 2019-08-26T03:00:12.000Z | tests/unit/modules/nginx_test.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | null | null | null | tests/unit/modules/nginx_test.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | 3 | 2021-02-23T08:12:48.000Z | 2021-02-23T08:13:13.000Z | # -*- coding: utf-8 -*-
import urllib2
# Import Salt Testing libs
from salttesting import skipIf, TestCase
from salttesting.helpers import ensure_in_syspath
from salttesting.mock import NO_MOCK, NO_MOCK_REASON, Mock, patch
from salt.modules import nginx
ensure_in_syspath('../../')
MOCK_STATUS_OUTPUT = """Active con... | 27.821429 | 74 | 0.674583 |
7991c2ad502e56b50291a344468519dbefc8dd11 | 388 | py | Python | phaseportrait/__init__.py | Loracio/phase-portrait | 3b830a7ec3c011757414a149c8d1af9fcdbfb033 | [
"MIT"
] | 3 | 2021-09-23T08:48:35.000Z | 2021-12-26T15:47:55.000Z | phaseportrait/__init__.py | Loracio/phase-portrait | 3b830a7ec3c011757414a149c8d1af9fcdbfb033 | [
"MIT"
] | null | null | null | phaseportrait/__init__.py | Loracio/phase-portrait | 3b830a7ec3c011757414a149c8d1af9fcdbfb033 | [
"MIT"
] | 1 | 2021-12-25T14:52:01.000Z | 2021-12-25T14:52:01.000Z | try:
__PHASEPORTRAIT_MODULE_IMPORTED__
except NameError:
__PHASEPORTRAIT_MODULE_IMPORTED__= False
if not __PHASEPORTRAIT_MODULE_IMPORTED__:
from .PhasePortrait2D import PhasePortrait2D
from .Trajectories3D import Trajectory3D
from .Trajectories2D import Trajectory2D
from .Map1D import Map1D
... | 32.333333 | 48 | 0.819588 |
7991e74a9ef3a5fbd7ccb7533e5e983c1eeac7dd | 6,697 | py | Python | venv/lib/python3.6/site-packages/kubernetes/client/models/v1beta1_controller_revision_list.py | DiptoChakrabarty/Kube-Automate | 2072d1aadd58eb405c7308ff5cfecbf50300ead3 | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/kubernetes/client/models/v1beta1_controller_revision_list.py | DiptoChakrabarty/Kube-Automate | 2072d1aadd58eb405c7308ff5cfecbf50300ead3 | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/kubernetes/client/models/v1beta1_controller_revision_list.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 V1bet... | 33.823232 | 295 | 0.630133 |
79920a59e8a42bda4f5db99bbc820df60fbdb84b | 2,112 | py | Python | experiments/2014-11-11-gefcom-revisited-hint.py | jaesikchoi/gpss-research | 2a64958a018f1668f7b8eedf33c4076a63af7868 | [
"MIT"
] | 151 | 2015-01-09T19:25:05.000Z | 2022-01-05T02:05:52.000Z | experiments/2014-11-11-gefcom-revisited-hint.py | jaesikchoi/gpss-research | 2a64958a018f1668f7b8eedf33c4076a63af7868 | [
"MIT"
] | 1 | 2016-08-04T13:12:51.000Z | 2016-08-04T13:12:51.000Z | experiments/2014-11-11-gefcom-revisited-hint.py | jaesikchoi/gpss-research | 2a64958a018f1668f7b8eedf33c4076a63af7868 | [
"MIT"
] | 59 | 2015-02-04T19:13:58.000Z | 2021-07-28T23:36:09.000Z | Experiment(description='Re-analysis of GEFCOM data for purposes of thesis',
data_dir='../data/gefcom_temp',
max_depth=10,
random_order=True,
k=1,
debug=False,
local_computation=False,
n_rand=9,
sd=2,
jitter_sd=0.1,
... | 55.578947 | 626 | 0.557765 |
79920df78480e4bc24f515df75b6497caa98042e | 23,958 | py | Python | lib/hyper/hyper_pseudo_gt_layer.py | leochangzliao/OPBM | 9688e03cbf3f8efea2feb8813fa80c702b3e3ed6 | [
"BSD-2-Clause"
] | null | null | null | lib/hyper/hyper_pseudo_gt_layer.py | leochangzliao/OPBM | 9688e03cbf3f8efea2feb8813fa80c702b3e3ed6 | [
"BSD-2-Clause"
] | null | null | null | lib/hyper/hyper_pseudo_gt_layer.py | leochangzliao/OPBM | 9688e03cbf3f8efea2feb8813fa80c702b3e3ed6 | [
"BSD-2-Clause"
] | null | null | null | # --------------------------------------------------------
# Faster R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick and Sean Bell
# --------------------------------------------------------
import caffe
import numpy as np
import yaml
from fast_r... | 49.808732 | 120 | 0.56549 |
799227a1ef906989efb6a989271fe7e80b4ffdfe | 15,376 | py | Python | lingua_nostra/lang/format_en.py | GigundoAI/lingua-franca | dc1ed76b063a1aad54e457cf193de9c18145011f | [
"Apache-2.0"
] | null | null | null | lingua_nostra/lang/format_en.py | GigundoAI/lingua-franca | dc1ed76b063a1aad54e457cf193de9c18145011f | [
"Apache-2.0"
] | 1 | 2021-06-17T00:56:25.000Z | 2021-06-17T00:56:25.000Z | lingua_nostra/lang/format_en.py | HelloChatterbox/lingua-nostra | 83f0690977a1d8cc7f04e11bfded9ee3df7abd4b | [
"Apache-2.0"
] | 1 | 2019-10-25T18:05:32.000Z | 2019-10-25T18:05:32.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2017 Mycroft AI Inc.
#
# 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 ... | 36.349882 | 95 | 0.498439 |
79922aee018cdfe5b8d4ab21ea2534957587065e | 2,244 | py | Python | exos/examen_20161207.py | afafe78/python-im | c831eb92c163084bb3c9098e40d28e7ba8600319 | [
"MIT"
] | 7 | 2016-09-29T07:20:25.000Z | 2021-03-15T15:00:06.000Z | exos/examen_20161207.py | afafe78/python-im | c831eb92c163084bb3c9098e40d28e7ba8600319 | [
"MIT"
] | 1 | 2018-10-08T10:52:48.000Z | 2018-10-08T10:52:48.000Z | exos/examen_20161207.py | afafe78/python-im | c831eb92c163084bb3c9098e40d28e7ba8600319 | [
"MIT"
] | 11 | 2017-01-12T18:50:49.000Z | 2021-02-28T22:44:29.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# examen python M2 - 07/12/2016
import re
def nb_emprunts(data):
"""
calcule le nombre d'emprunts dans le jeu de données argument
arg: data (list of lists)
return: int
"""
res = 0
for item in data:
res += int(item[-1])
return res
... | 26.4 | 82 | 0.564617 |
799230e3b2f02ca5e0cab1189df04e0410d7ab89 | 1,684 | py | Python | tests/test_ray.py | dnilosek/evtech | 0cd7cc7f29a3f61bd7c09d92d795a2ef042250b2 | [
"MIT"
] | 1 | 2020-01-22T03:21:44.000Z | 2020-01-22T03:21:44.000Z | tests/test_ray.py | dnilosek/evtech | 0cd7cc7f29a3f61bd7c09d92d795a2ef042250b2 | [
"MIT"
] | 199 | 2020-01-22T15:18:34.000Z | 2022-03-31T17:24:21.000Z | tests/test_ray.py | dnilosek/evtech | 0cd7cc7f29a3f61bd7c09d92d795a2ef042250b2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""Tests for ray class."""
import sys
import unittest
import numpy as np
import math
from pyproj import CRS
from evtech import Ray
from evtech import Camera
class TestRay(unittest.TestCase):
"""Tests for `evtech.ray` package."""
def setUp(self):
self.proj = np.array([[-234.48... | 35.083333 | 114 | 0.658551 |
79923c611cb8318467478487d5c22d446d6f2bd2 | 3,381 | py | Python | ros/src/bag_validator/light_classification/tl_classifier.py | pascalnagel/CarND-Capstone | 4dfe8998a0d85e6e8277410660e0777af08d9031 | [
"MIT"
] | null | null | null | ros/src/bag_validator/light_classification/tl_classifier.py | pascalnagel/CarND-Capstone | 4dfe8998a0d85e6e8277410660e0777af08d9031 | [
"MIT"
] | 7 | 2020-09-26T01:03:33.000Z | 2022-02-10T01:30:14.000Z | ros/src/bag_validator/light_classification/tl_classifier.py | pascalnagel/CarND-Capstone | 4dfe8998a0d85e6e8277410660e0777af08d9031 | [
"MIT"
] | null | null | null | from styx_msgs.msg import TrafficLight
from PIL import Image
from PIL.ImageDraw import Draw
from PIL import ImageFont
import numpy as np
import tensorflow as tf
from collections import Counter
class TLClassifier(object):
def __init__(self):
self.frozen_graph_filename = "/capstone/ros/src/tl_detector/light_... | 43.909091 | 134 | 0.581189 |
799241c14941d34bbc6d161b52e36c97a2052648 | 699 | py | Python | app/core/migrations/0004_tag.py | siddharthmudgal/idres-gait | b9500d4eab34a72e8f877ca4f0593a335e5b3fd7 | [
"MIT"
] | null | null | null | app/core/migrations/0004_tag.py | siddharthmudgal/idres-gait | b9500d4eab34a72e8f877ca4f0593a335e5b3fd7 | [
"MIT"
] | null | null | null | app/core/migrations/0004_tag.py | siddharthmudgal/idres-gait | b9500d4eab34a72e8f877ca4f0593a335e5b3fd7 | [
"MIT"
] | null | null | null | # Generated by Django 3.2 on 2021-04-30 09:31
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0003_remove_user_coordinates'),
]
operations = [
migrations.CreateMo... | 29.125 | 118 | 0.626609 |
79924c473d920bb4349e587c62031668d5f06288 | 9,870 | py | Python | nn_analysis/acts/core.py | hchau630/nn-analysis | 0fbe7ad7b2b4566b9f88d8f21413a6d405f96bdc | [
"MIT"
] | null | null | null | nn_analysis/acts/core.py | hchau630/nn-analysis | 0fbe7ad7b2b4566b9f88d8f21413a6d405f96bdc | [
"MIT"
] | null | null | null | nn_analysis/acts/core.py | hchau630/nn-analysis | 0fbe7ad7b2b4566b9f88d8f21413a6d405f96bdc | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
import random
import hashlib
import os
import traceback
import pathlib
import h5py
import torch
import numpy as np
from nn_analysis import utils
def attach_hooks(model, layer_names, get_hook):
handles = []
for layer_name, module in model.named_modules():
if layer_n... | 38.858268 | 173 | 0.598582 |
79924fa2ca4e84464829bff31fd313afbff367b0 | 23,110 | py | Python | TrainingExtensions/tensorflow/src/python/aimet_tensorflow/plotting_utils.py | lipovsek/aimet | 236fb02cc6c45e65c067030416c49a09ace82045 | [
"BSD-3-Clause"
] | 945 | 2020-04-30T02:23:55.000Z | 2022-03-31T08:44:32.000Z | TrainingExtensions/tensorflow/src/python/aimet_tensorflow/plotting_utils.py | lipovsek/aimet | 236fb02cc6c45e65c067030416c49a09ace82045 | [
"BSD-3-Clause"
] | 563 | 2020-05-01T03:07:22.000Z | 2022-03-30T05:35:58.000Z | TrainingExtensions/tensorflow/src/python/aimet_tensorflow/plotting_utils.py | lipovsek/aimet | 236fb02cc6c45e65c067030416c49a09ace82045 | [
"BSD-3-Clause"
] | 186 | 2020-04-30T00:55:26.000Z | 2022-03-30T09:54:51.000Z | # /usr/bin/env python3.5
# -*- mode: python -*-
# =============================================================================
# @@-COPYRIGHT-START-@@
#
# Copyright (c) 2019-2021, Qualcomm Innovation Center, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modifica... | 45.313725 | 136 | 0.666075 |
79924fad485c8cf25c24e864ca32445c5c9d15ed | 1,063 | py | Python | management/pycom_functions/communicate_with_server/close_network/MQTT_Regatta.py | AaltoIIC/OSEMA | 38740e3dcfeb72a6d87e25190e6a73f6c60b199b | [
"MIT"
] | 2 | 2021-04-03T13:19:32.000Z | 2022-01-03T00:38:55.000Z | management/pycom_functions/communicate_with_server/close_network/MQTT_Regatta.py | AaltoIIC/OSEMA | 38740e3dcfeb72a6d87e25190e6a73f6c60b199b | [
"MIT"
] | null | null | null | management/pycom_functions/communicate_with_server/close_network/MQTT_Regatta.py | AaltoIIC/OSEMA | 38740e3dcfeb72a6d87e25190e6a73f6c60b199b | [
"MIT"
] | null | null | null | """This function takes care that correct messages are sent to server"""
def communicate_with_server(data_with_ts, header_ts):
try:
network = connect_network() #Connect to network
sync_rtc(machine.RTC())
client = MQTTClient(str(SENSOR_ID), BROKER_URL, user=USER, password=KEY, port=BROKER_PORT... | 37.964286 | 98 | 0.607714 |
799251d253dcfc773487838f124ebefe5373592a | 2,167 | py | Python | starttf/cluster/client.py | penguinmenac3/starttf | f4086489d169757c0504e822165db2fea534b944 | [
"MIT"
] | 14 | 2018-05-10T17:46:40.000Z | 2019-03-09T21:26:49.000Z | starttf/cluster/client.py | penguinmenac3/tensorflow-starterpack | f4086489d169757c0504e822165db2fea534b944 | [
"MIT"
] | 8 | 2018-05-05T15:36:57.000Z | 2019-05-04T15:13:58.000Z | starttf/cluster/client.py | penguinmenac3/deeplearning-starterpack | f4086489d169757c0504e822165db2fea534b944 | [
"MIT"
] | 4 | 2018-05-11T20:59:44.000Z | 2019-03-09T21:27:23.000Z | # MIT License
#
# Copyright (c) 2018 Michael Fuerst
#
# 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, me... | 38.017544 | 80 | 0.680665 |
79927c8a53237dacbc03c65e3cd2f5381407b427 | 2,372 | py | Python | pandaserver/test/killUser.py | virthead/panda-server | d2b65f788c4539dc103641ca2a8052cb18729d44 | [
"Apache-2.0"
] | 7 | 2015-03-30T14:15:35.000Z | 2021-12-22T06:48:22.000Z | pandaserver/test/killUser.py | virthead/panda-server | d2b65f788c4539dc103641ca2a8052cb18729d44 | [
"Apache-2.0"
] | 16 | 2015-06-01T13:48:01.000Z | 2022-02-08T15:03:32.000Z | pandaserver/test/killUser.py | virthead/panda-server | d2b65f788c4539dc103641ca2a8052cb18729d44 | [
"Apache-2.0"
] | 15 | 2015-03-02T08:57:35.000Z | 2022-03-01T09:48:45.000Z | import sys
import optparse
from pandaserver.taskbuffer.OraDBProxy import DBProxy
# password
from pandaserver.config import panda_config
import pandaserver.userinterface.Client as Client
optP = optparse.OptionParser(conflict_handler="resolve")
optP.add_option('--user', action='store',dest='user', default=None,help='... | 33.408451 | 121 | 0.695194 |
799297ad429d041fd9928ff49e49dc31dfc259dc | 24,116 | py | Python | src/encoded/upgrade/file.py | aperritano/encoded | c03f6799a2155377321877bf12c079c50b0e08ce | [
"MIT"
] | null | null | null | src/encoded/upgrade/file.py | aperritano/encoded | c03f6799a2155377321877bf12c079c50b0e08ce | [
"MIT"
] | null | null | null | src/encoded/upgrade/file.py | aperritano/encoded | c03f6799a2155377321877bf12c079c50b0e08ce | [
"MIT"
] | null | null | null | from snovault import upgrade_step
from pyramid.traversal import find_root
from datetime import datetime, time
@upgrade_step('file', '', '2')
def file_0_2(value, system):
# http://redmine.encodedcc.org/issues/1295
# http://redmine.encodedcc.org/issues/1307
if 'status' in value:
value['status'] = va... | 39.340946 | 109 | 0.571529 |
7992a3061efecb8775efe8fb62dfb6e6b4af8136 | 4,007 | py | Python | src/ggrc/settings/default.py | Killswitchz/ggrc-core | 2460df94daf66727af248ad821462692917c97a9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/ggrc/settings/default.py | Killswitchz/ggrc-core | 2460df94daf66727af248ad821462692917c97a9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/ggrc/settings/default.py | Killswitchz/ggrc-core | 2460df94daf66727af248ad821462692917c97a9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
import os
import jinja2
DEBUG = False
TESTING = False
PRODUCTION = False
GOOGLE_INTERNAL = False
# Flask-SQLAlchemy fix to be less than `wait_time` in /etc/mysql/my.cnf
SQLALCHEMY_POOL_RECYCLE = 120
# Set... | 27.826389 | 82 | 0.730222 |
7992a90686cc2c21ed67a33e6d7e6e276548c927 | 891 | py | Python | webhook_telegram_bot/config.py | toolen/webhook-telegram-bot | c2ef4e7a6cf0f78c0341d3d645e516440596569f | [
"MIT"
] | null | null | null | webhook_telegram_bot/config.py | toolen/webhook-telegram-bot | c2ef4e7a6cf0f78c0341d3d645e516440596569f | [
"MIT"
] | 1 | 2022-02-01T18:18:28.000Z | 2022-02-01T18:18:28.000Z | webhook_telegram_bot/config.py | toolen/webhook-telegram-bot | c2ef4e7a6cf0f78c0341d3d645e516440596569f | [
"MIT"
] | null | null | null | """This file contains config methods."""
import os
from typing import Any, Dict
env = os.environ
def get_config() -> Dict[str, Any]:
"""
Return application config.
:return: application configuration
"""
return {
'DEBUG': True,
'TELEGRAM_API_ENDPOINT': env.get(
'TELEGR... | 30.724138 | 80 | 0.621773 |
7992af839d73950194a2150e74de37627a649eb9 | 6,841 | py | Python | alipay/aop/api/domain/AlipayEbppInvoiceExpenserulesSceneruleModifyModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayEbppInvoiceExpenserulesSceneruleModifyModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayEbppInvoiceExpenserulesSceneruleModifyModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.ExpenseCtrRuleInfo import ExpenseCtrRuleInfo
class AlipayEbppInvoiceExpenserulesSceneruleModifyModel(object):
def __init__(self):
self._account_id = None
self... | 36.388298 | 105 | 0.632802 |
7992f103e8b16b251f09a3cf00073740b56feefe | 10,478 | py | Python | src/gafaelfawr/handlers/oidc.py | lsst-sqre/gafaelfawr | 5d965e9d7901987ef041fd341637d75407b55227 | [
"MIT"
] | null | null | null | src/gafaelfawr/handlers/oidc.py | lsst-sqre/gafaelfawr | 5d965e9d7901987ef041fd341637d75407b55227 | [
"MIT"
] | 155 | 2020-05-29T17:21:13.000Z | 2022-03-28T19:55:52.000Z | src/gafaelfawr/handlers/oidc.py | lsst-sqre/gafaelfawr | 5d965e9d7901987ef041fd341637d75407b55227 | [
"MIT"
] | 3 | 2021-04-26T18:02:58.000Z | 2022-02-03T01:29:13.000Z | """Handler for minimalist OpenID Connect (``/auth/openid``)."""
from __future__ import annotations
import time
from typing import Any, Mapping, Optional, Union
from urllib.parse import ParseResult, parse_qsl, urlencode
from fastapi import (
APIRouter,
Depends,
Form,
HTTPException,
Query,
Resp... | 33.158228 | 79 | 0.642584 |
7992f828714c4ebeb52f73120fa87e549821c435 | 24,220 | py | Python | posthog/queries/test/test_paths.py | thinhnguyenuit/posthog | 4758e66790485587d29a617174158d07341342f8 | [
"MIT"
] | null | null | null | posthog/queries/test/test_paths.py | thinhnguyenuit/posthog | 4758e66790485587d29a617174158d07341342f8 | [
"MIT"
] | null | null | null | posthog/queries/test/test_paths.py | thinhnguyenuit/posthog | 4758e66790485587d29a617174158d07341342f8 | [
"MIT"
] | 1 | 2021-09-08T19:45:03.000Z | 2021-09-08T19:45:03.000Z | from dateutil.relativedelta import relativedelta
from django.utils.timezone import now
from freezegun import freeze_time
from posthog.constants import FILTER_TEST_ACCOUNTS
from posthog.models import Element, Event, Person
from posthog.models.filters.path_filter import PathFilter
from posthog.queries.paths import Paths... | 49.227642 | 120 | 0.557556 |
79931efa777b74a04f6183a4b70f2b2f0d6e67a0 | 84 | py | Python | ote_sdk/ote_sdk/utils/__init__.py | ntyukaev/training_extensions | c897d42e50828fea853ceda0795e1f0e7d6e9909 | [
"Apache-2.0"
] | 775 | 2019-03-01T02:13:33.000Z | 2020-09-07T22:49:15.000Z | ote_sdk/ote_sdk/utils/__init__.py | ntyukaev/training_extensions | c897d42e50828fea853ceda0795e1f0e7d6e9909 | [
"Apache-2.0"
] | 229 | 2019-02-28T21:37:08.000Z | 2020-09-07T15:11:49.000Z | ote_sdk/ote_sdk/utils/__init__.py | ntyukaev/training_extensions | c897d42e50828fea853ceda0795e1f0e7d6e9909 | [
"Apache-2.0"
] | 290 | 2019-02-28T20:32:11.000Z | 2020-09-07T05:51:41.000Z | # Copyright (C) 2021-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
| 21 | 43 | 0.75 |
799322df221bb85eb624e7c43f5fd810a387e64a | 310 | py | Python | Datasets/Water/glcf_global_inland_water.py | monocilindro/qgis-earthengine-examples | 82aea8926d34ed3f4ad4a4a345ddbd225819d28f | [
"MIT"
] | 646 | 2019-12-03T06:09:03.000Z | 2022-03-28T03:37:08.000Z | Datasets/Water/glcf_global_inland_water.py | csaybar/qgis-earthengine-examples | ba8942683834d2847ff3246bdd1859b36e50fe44 | [
"MIT"
] | 10 | 2019-12-30T03:42:44.000Z | 2021-05-22T07:34:07.000Z | Datasets/Water/glcf_global_inland_water.py | csaybar/qgis-earthengine-examples | ba8942683834d2847ff3246bdd1859b36e50fe44 | [
"MIT"
] | 219 | 2019-12-06T02:20:53.000Z | 2022-03-30T15:14:27.000Z | import ee
from ee_plugin import Map
dataset = ee.ImageCollection('GLCF/GLS_WATER')
water = dataset.select('water').mosaic()
waterVis = {
'min': 1.0,
'max': 4.0,
'palette': ['FAFAFA', '00C5FF', 'DF73FF', '828282', 'CCCCCC'],
}
Map.setCenter(-79.3094, 44.5693, 8)
Map.addLayer(water, waterVis, 'Water')
| 23.846154 | 64 | 0.66129 |
79932321102090f4923c4ce950bc23ad29154619 | 5,318 | py | Python | tests/mmm/topology/topology-single-tenant-nat.py | duarten/midonet | c7a5aa352a8038bdc6a463c68abc47bb411a1e7c | [
"Apache-2.0"
] | 1 | 2015-05-19T08:36:55.000Z | 2015-05-19T08:36:55.000Z | tests/mmm/topology/topology-single-tenant-nat.py | duarten/midonet | c7a5aa352a8038bdc6a463c68abc47bb411a1e7c | [
"Apache-2.0"
] | null | null | null | tests/mmm/topology/topology-single-tenant-nat.py | duarten/midonet | c7a5aa352a8038bdc6a463c68abc47bb411a1e7c | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Midokura SARL
#
# 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... | 42.887097 | 81 | 0.505453 |
79932c9ed8bfab4b6f49bbe11fcfd7e2ddeb4c46 | 3,331 | py | Python | prepro_vocab.py | tgc1997/video-caption.pytorch | 66430862696678f7233a1fc67af22f0525b22e52 | [
"MIT"
] | 39 | 2018-05-14T02:30:32.000Z | 2021-07-17T11:39:28.000Z | prepro_vocab.py | AmmieQi/video-caption.pytorch-1 | 66430862696678f7233a1fc67af22f0525b22e52 | [
"MIT"
] | 8 | 2018-09-20T09:08:46.000Z | 2019-12-12T08:24:54.000Z | prepro_vocab.py | AmmieQi/video-caption.pytorch-1 | 66430862696678f7233a1fc67af22f0525b22e52 | [
"MIT"
] | 19 | 2018-05-14T13:12:01.000Z | 2021-06-25T07:48:07.000Z | import re
import json
import argparse
import numpy as np
def build_vocab(vids, params):
count_thr = params['word_count_threshold']
# count up the number of words
counts = {}
for vid, caps in vids.items():
for cap in caps['captions']:
ws = re.sub(r'[.!,;?]', ' ', cap).split()
... | 38.732558 | 105 | 0.58571 |
79933bf365a551c169f81b2a4b3565dc5c11cbf9 | 904 | py | Python | src/ggrc_basic_permissions/migrations/versions/20140429235556_344a6dfd28ad_add_some_indexes.py | Killswitchz/ggrc-core | 2460df94daf66727af248ad821462692917c97a9 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2018-03-30T11:28:48.000Z | 2018-03-30T11:28:48.000Z | src/ggrc_basic_permissions/migrations/versions/20140429235556_344a6dfd28ad_add_some_indexes.py | trevordonnelly/ggrc-core | 499cf0d3cce70737b080991b12c203ec22015cea | [
"ECL-2.0",
"Apache-2.0"
] | 10 | 2018-07-06T00:04:23.000Z | 2021-02-26T21:13:20.000Z | src/ggrc_basic_permissions/migrations/versions/20140429235556_344a6dfd28ad_add_some_indexes.py | zidarsk8/ggrc-core | 2509c989eddf434249d3bef50c21e08dbf56c1a4 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2017-11-11T22:16:56.000Z | 2017-11-11T22:16:56.000Z | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Add some indexes
Revision ID: 344a6dfd28ad
Revises: e1e9986270
Create Date: 2014-04-29 23:55:56.938368
"""
# revision identifiers, used by Alembic.
revision = '344a6dfd28ad'
down_revision = 'e1e998627... | 29.16129 | 109 | 0.757743 |
79938d3a984f1605384167a4e7ce669c96c70707 | 10,343 | py | Python | syft/frameworks/torch/tensors/interpreters/autograd.py | Ankit-Dhankhar/PySyft | 750bd2c3987a570ef1dc8554b933696d416724c7 | [
"Apache-2.0"
] | null | null | null | syft/frameworks/torch/tensors/interpreters/autograd.py | Ankit-Dhankhar/PySyft | 750bd2c3987a570ef1dc8554b933696d416724c7 | [
"Apache-2.0"
] | null | null | null | syft/frameworks/torch/tensors/interpreters/autograd.py | Ankit-Dhankhar/PySyft | 750bd2c3987a570ef1dc8554b933696d416724c7 | [
"Apache-2.0"
] | 1 | 2021-04-18T15:27:15.000Z | 2021-04-18T15:27:15.000Z | from functools import wraps
import torch
import syft
from syft.generic.tensor import AbstractTensor
from syft.generic.frameworks.overload import overloaded
from . import gradients
def backwards_grad(grad_fn, in_grad=None):
if grad_fn is None:
raise ValueError(
"The gradient for one of the com... | 31.06006 | 113 | 0.603983 |
799398056e90675907edd41d7a6995b38ca71ec5 | 2,762 | py | Python | jenkinsapi_tests/unittests/test_views.py | ifwe/jenkinsapi | 31a7fbb07efcd48e226f7dcf643fd2a2625416c0 | [
"MIT"
] | 1 | 2015-01-12T14:15:59.000Z | 2015-01-12T14:15:59.000Z | jenkinsapi_tests/unittests/test_views.py | moustuk/jenkinsapi-1 | d18c1e669965c209093763f3295f79c9d3ccdeea | [
"MIT"
] | null | null | null | jenkinsapi_tests/unittests/test_views.py | moustuk/jenkinsapi-1 | d18c1e669965c209093763f3295f79c9d3ccdeea | [
"MIT"
] | null | null | null | import mock
import unittest
from jenkinsapi import config
from jenkinsapi.view import View
from jenkinsapi.jenkins import Jenkins
from jenkinsapi.jenkinsbase import JenkinsBase
from jenkinsapi.utils.requester import Requester
class TestDataMissing(Exception):
pass
class TestViews(unittest.TestCase):
@mock.p... | 36.342105 | 92 | 0.608979 |
7993d32d8ff416580b9094c58d11cba7702453d0 | 19,025 | py | Python | test/api/test_zone.py | choonho/inventory | cc89757490d28fecb7ffccdfd6f89d4c0aa40da5 | [
"Apache-2.0"
] | null | null | null | test/api/test_zone.py | choonho/inventory | cc89757490d28fecb7ffccdfd6f89d4c0aa40da5 | [
"Apache-2.0"
] | null | null | null | test/api/test_zone.py | choonho/inventory | cc89757490d28fecb7ffccdfd6f89d4c0aa40da5 | [
"Apache-2.0"
] | null | null | null | import os
import uuid
import random
import unittest
from langcodes import Language
from spaceone.core import config
from spaceone.core import pygrpc
from spaceone.core import utils
from spaceone.core.unittest.runner import RichTestRunner
from google.protobuf.json_format import MessageToDict
def random_string():
r... | 30.537721 | 113 | 0.538449 |
7993dc612436afa1c2e0773466db6d665520b371 | 3,544 | py | Python | aea/runner.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | 28 | 2021-10-31T18:54:14.000Z | 2022-03-17T13:10:43.000Z | aea/runner.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | 66 | 2021-10-31T11:55:48.000Z | 2022-03-31T06:26:23.000Z | aea/runner.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2022 Valory AG
# Copyright 2018-2021 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... | 31.642857 | 86 | 0.630643 |
7993e2c1b35141933f679c69b9c96002c0d5bb21 | 468 | py | Python | source/week2a/xy.py | ArturPrzybysz/finite-element-method | f6edc466c3020f3c7d7563458cc9fc60ba378d43 | [
"MIT"
] | null | null | null | source/week2a/xy.py | ArturPrzybysz/finite-element-method | f6edc466c3020f3c7d7563458cc9fc60ba378d43 | [
"MIT"
] | null | null | null | source/week2a/xy.py | ArturPrzybysz/finite-element-method | f6edc466c3020f3c7d7563458cc9fc60ba378d43 | [
"MIT"
] | 1 | 2022-01-04T17:16:50.000Z | 2022-01-04T17:16:50.000Z | import numpy as np
def xy(x0, y0, L1, L2, noelms1, noelms2):
all_nodes = (1 + noelms1) * (1 + noelms2)
X = np.zeros(all_nodes)
for i, x in enumerate(np.linspace(start=x0, stop=x0 + L1, num=noelms1 + 1)):
start_idx = i * (noelms2 + 1)
stop_idx = start_idx + (noelms2 + 1)
X[start_id... | 29.25 | 80 | 0.589744 |
79941c5d34aacb9289e6a65c5fa9497e22f8e03c | 904 | py | Python | workspace/Pipeline/gameApp/etl/batch/transform.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | 18 | 2019-08-01T07:45:02.000Z | 2022-03-31T18:05:44.000Z | workspace/Pipeline/gameApp/etl/batch/transform.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | workspace/Pipeline/gameApp/etl/batch/transform.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | 15 | 2019-12-29T08:46:20.000Z | 2022-03-08T14:14:05.000Z | """
class for transform/clean raw data
"""
class Transform:
def __init__(self, cfg)
self.cfg = cfg
def get_schema(self):
fields = [
'timestamp',
'user_id',
'event_type',
'transaction_id',
'platform',
'os',
'version'
]
return ... | 21.52381 | 62 | 0.549779 |
799427ad5a0bdc11aed21998305d0f4c22079550 | 389 | py | Python | lottery/migrations/0002_auto_20180125_1612.py | eethan1/IMnight2018_Backend | 39780f737e57763fdfb171c4687a375d3c5a4bb0 | [
"Apache-2.0"
] | null | null | null | lottery/migrations/0002_auto_20180125_1612.py | eethan1/IMnight2018_Backend | 39780f737e57763fdfb171c4687a375d3c5a4bb0 | [
"Apache-2.0"
] | null | null | null | lottery/migrations/0002_auto_20180125_1612.py | eethan1/IMnight2018_Backend | 39780f737e57763fdfb171c4687a375d3c5a4bb0 | [
"Apache-2.0"
] | 4 | 2018-01-27T06:01:41.000Z | 2018-02-21T12:18:35.000Z | # Generated by Django 2.0 on 2018-01-25 16:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lottery', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='task',
name='description',
... | 20.473684 | 63 | 0.596401 |
7994280fc34257ed2b1458d94aa4b89c58aed9d3 | 11,457 | py | Python | syft/exceptions.py | yeggasd/PySyft | cb71c978d1fb545f64daf71ac31ad12583fc0bc2 | [
"Apache-2.0"
] | 2 | 2019-05-29T13:09:02.000Z | 2019-06-14T17:40:51.000Z | syft/exceptions.py | yeggasd/PySyft | cb71c978d1fb545f64daf71ac31ad12583fc0bc2 | [
"Apache-2.0"
] | 3 | 2019-05-24T01:16:56.000Z | 2019-09-18T13:02:30.000Z | syft/exceptions.py | yeggasd/PySyft | cb71c978d1fb545f64daf71ac31ad12583fc0bc2 | [
"Apache-2.0"
] | 1 | 2022-03-12T08:04:34.000Z | 2022-03-12T08:04:34.000Z | """Specific Pysyft exceptions."""
from tblib import Traceback
import traceback
from six import reraise
from typing import Tuple
import syft as sy
from syft.generic.frameworks.types import FrameworkTensor
class PureFrameworkTensorFoundError(BaseException):
"""Exception raised for errors in the input.
This err... | 38.317726 | 157 | 0.617701 |
79943aa48b32d1c7ce0c46eebe4060c70de281f9 | 1,416 | py | Python | src/python/pants/engine/parser.py | mpopenko-exos/pants | 47d27037c8b13291fc9023e56ddd1b1defdf1b8e | [
"Apache-2.0"
] | null | null | null | src/python/pants/engine/parser.py | mpopenko-exos/pants | 47d27037c8b13291fc9023e56ddd1b1defdf1b8e | [
"Apache-2.0"
] | 1 | 2018-09-04T17:37:34.000Z | 2018-09-04T19:42:58.000Z | src/python/pants/engine/parser.py | mpopenko-exos/pants | 47d27037c8b13291fc9023e56ddd1b1defdf1b8e | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from abc import ABC, abstractmethod
from dataclasses import dataclass
from typing import Dict, Type
from pants.engine.struct import Struct
class ParseError(Exception):
"""Indicates an... | 32.930233 | 111 | 0.741525 |
79945f3d8ea70c5691a35fbae99f5805c9d5148f | 41,750 | py | Python | tests/batching_test.py | akihironitta/jax | c67454d0f85dd786b09ba2944bb629f3c88302f2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | tests/batching_test.py | akihironitta/jax | c67454d0f85dd786b09ba2944bb629f3c88302f2 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-10-01T05:38:44.000Z | 2020-10-01T05:38:44.000Z | tests/batching_test.py | rahul-deepsource/jax | 24c02148f27345b35555b0898bfc1d694a68c19a | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-09-16T11:34:14.000Z | 2020-09-16T11:34:14.000Z | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 39.275635 | 99 | 0.586228 |
799466e1662aac284570e2bae3f8100eaf129102 | 28,586 | py | Python | sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_scripts_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_scripts_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_scripts_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # 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.446741 | 235 | 0.668964 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.