hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 239 | max_forks_repo_name stringlengths 5 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4a128c1e2a68b5dfe0ab2f2626be144908e50751 | 4,524 | py | Python | nuremberg/settings/generic.py | emmalemma/nuremberg | 10a5f789f5668aa4e7902e1765737c2c764ff2b2 | [
"MIT"
] | null | null | null | nuremberg/settings/generic.py | emmalemma/nuremberg | 10a5f789f5668aa4e7902e1765737c2c764ff2b2 | [
"MIT"
] | null | null | null | nuremberg/settings/generic.py | emmalemma/nuremberg | 10a5f789f5668aa4e7902e1765737c2c764ff2b2 | [
"MIT"
] | null | null | null | """
Django settings for nuremberg project.
Generated by 'django-admin startproject' using Django 1.9.6.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
... | 27.585366 | 91 | 0.720601 |
4a128c8a771cd7638cb92fb7692d58d8df985846 | 195,853 | py | Python | BaseTools/Source/Python/Workspace/DscBuildData.py | cgjertsen/edk2 | 1b461403ee723dab01d5828714cca0b9396a6b3c | [
"Python-2.0",
"Zlib",
"BSD-2-Clause",
"MIT",
"BSD-2-Clause-Patent",
"BSD-3-Clause"
] | 2 | 2021-04-11T10:53:37.000Z | 2021-05-20T03:42:31.000Z | BaseTools/Source/Python/Workspace/DscBuildData.py | cgjertsen/edk2 | 1b461403ee723dab01d5828714cca0b9396a6b3c | [
"Python-2.0",
"Zlib",
"BSD-2-Clause",
"MIT",
"BSD-2-Clause-Patent",
"BSD-3-Clause"
] | 1 | 2021-06-04T20:24:43.000Z | 2021-06-04T20:24:43.000Z | BaseTools/Source/Python/Workspace/DscBuildData.py | cgjertsen/edk2 | 1b461403ee723dab01d5828714cca0b9396a6b3c | [
"Python-2.0",
"Zlib",
"BSD-2-Clause",
"MIT",
"BSD-2-Clause-Patent",
"BSD-3-Clause"
] | 3 | 2020-10-26T00:20:14.000Z | 2021-06-04T09:41:16.000Z | ## @file
# This file is used to create a database used by build tool
#
# Copyright (c) 2008 - 2020, Intel Corporation. All rights reserved.<BR>
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
## Platform build information from DSC file
#
# ... | 57.961823 | 486 | 0.565092 |
4a128c9a113bf369e5b3cb1239283af4b0f0afc5 | 5,589 | py | Python | sites/altdev/settings_mkt.py | clouserw/zamboni | c4a568b69c1613f27da41d46328b2975cbdc1c07 | [
"BSD-3-Clause"
] | null | null | null | sites/altdev/settings_mkt.py | clouserw/zamboni | c4a568b69c1613f27da41d46328b2975cbdc1c07 | [
"BSD-3-Clause"
] | null | null | null | sites/altdev/settings_mkt.py | clouserw/zamboni | c4a568b69c1613f27da41d46328b2975cbdc1c07 | [
"BSD-3-Clause"
] | null | null | null | """private_mkt will be populated from puppet and placed in this directory"""
from mkt.settings import * # noqa
from settings_base import * # noqa
import private_mkt
DOMAIN = "marketplace-altdev.allizom.org"
SERVER_EMAIL = 'zmarketplacedev@addons.mozilla.org'
SITE_URL = 'https://marketplace-altdev.allizom.org'
BRO... | 32.12069 | 97 | 0.778493 |
4a128ca8f02997c74f90e9770d811ef58667286f | 1,189 | py | Python | api/test/test_serializers/cashback.py | ghalonso94/wswallet | 8f1f13a0d646166adad45b3872c2db6558d48f38 | [
"MIT"
] | null | null | null | api/test/test_serializers/cashback.py | ghalonso94/wswallet | 8f1f13a0d646166adad45b3872c2db6558d48f38 | [
"MIT"
] | null | null | null | api/test/test_serializers/cashback.py | ghalonso94/wswallet | 8f1f13a0d646166adad45b3872c2db6558d48f38 | [
"MIT"
] | null | null | null |
from datetime import datetime
from django.contrib.auth.models import User
from django.test import TestCase
from api.serializer import CashbackSerializer
from core.models import Cashback, Sale, Customer
class CashbackSerializerTestCase(TestCase):
user = User(username='test')
customer = Customer(name='Test... | 34.970588 | 119 | 0.702271 |
4a128ce4312ecbf47fbae3e91dd375c3042ddb30 | 2,454 | py | Python | bripinfo/registro_br.py | rogeriopaulos/BRIpinfo | 739579a626892b32474588752073a2041af6acb8 | [
"MIT"
] | null | null | null | bripinfo/registro_br.py | rogeriopaulos/BRIpinfo | 739579a626892b32474588752073a2041af6acb8 | [
"MIT"
] | 2 | 2021-08-31T02:18:20.000Z | 2021-09-07T03:57:12.000Z | bripinfo/registro_br.py | rogeriopaulos/BRIpinfo | 739579a626892b32474588752073a2041af6acb8 | [
"MIT"
] | null | null | null | import datetime as dt
import json
from bripinfo import settings
from bripinfo.core import BaseData
class RegistroBrMetadata(BaseData):
"""
self.data -> {
'source': <str>,
'timestamp': <str>,
'sha256': <str>,
}
"""
url = settings.CONFIG['registro_br']['sha256_mainfile']
... | 24.54 | 84 | 0.560717 |
4a128d11e246347c080ff9b6c9ba2e8081b28068 | 4,678 | py | Python | crossdock/server/endtoend.py | ctripops/jaeger-client-python | 2b2ff0249b756285aadab4175d8c8332912dd1b4 | [
"Apache-2.0"
] | 372 | 2017-10-31T21:51:26.000Z | 2022-03-23T10:36:19.000Z | crossdock/server/endtoend.py | ctripops/jaeger-client-python | 2b2ff0249b756285aadab4175d8c8332912dd1b4 | [
"Apache-2.0"
] | 276 | 2017-10-10T11:33:50.000Z | 2022-03-24T16:36:16.000Z | crossdock/server/endtoend.py | ctripops/jaeger-client-python | 2b2ff0249b756285aadab4175d8c8332912dd1b4 | [
"Apache-2.0"
] | 157 | 2017-10-09T07:16:41.000Z | 2021-12-29T14:49:26.000Z | # Copyright (c) 2016-2018 Uber Technologies, 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 law or agree... | 30.575163 | 96 | 0.645147 |
4a128d259ebc23e7113ad4d79941b4929966b071 | 832 | py | Python | data/import/import_gdp.py | soyrochus/worlddata-python-example | 8c35600e107d7fc00886bb4d3429615243e4b3be | [
"MIT"
] | 1 | 2019-12-03T11:38:50.000Z | 2019-12-03T11:38:50.000Z | data/import/import_gdp.py | soyrochus/worlddata-python-example | 8c35600e107d7fc00886bb4d3429615243e4b3be | [
"MIT"
] | null | null | null | data/import/import_gdp.py | soyrochus/worlddata-python-example | 8c35600e107d7fc00886bb4d3429615243e4b3be | [
"MIT"
] | 1 | 2019-12-03T11:39:02.000Z | 2019-12-03T11:39:02.000Z | import csv
import sqlite3
conn = sqlite3.connect('/home/iwk/src/data-pack/world-gdp.db')
c = conn.cursor()
csv_growth = open("/home/iwk/src/data-pack/data.gdp.1.csv")
csv_gdp = open("/home/iwk/src/data-pack/data.gdp.2.csv")
growth_reader = csv.DictReader(csv_growth)
gdp_reader = csv.DictReader(csv_gdp)
growth = {... | 26 | 100 | 0.66226 |
4a128e5224ca89f794cb7acedbee3557dde09aeb | 2,744 | py | Python | citizenshell/telnetshell.py | meuter/citizenshell | 43964b6ec57b15e1dcd6f7a0723eb1533abe7aaa | [
"MIT"
] | 14 | 2018-03-22T19:54:14.000Z | 2021-03-28T15:07:23.000Z | citizenshell/telnetshell.py | meuter/citizenshell | 43964b6ec57b15e1dcd6f7a0723eb1533abe7aaa | [
"MIT"
] | 15 | 2018-02-07T21:31:37.000Z | 2022-02-28T14:08:21.000Z | citizenshell/telnetshell.py | meuter/citizenshell | 43964b6ec57b15e1dcd6f7a0723eb1533abe7aaa | [
"MIT"
] | 7 | 2018-05-13T11:50:53.000Z | 2021-04-14T13:05:21.000Z | from telnetlib import Telnet
from uuid import uuid4
from time import sleep
from hashlib import md5
from os import chmod
from re import compile as compile_regex
from sys import version_info
from .abstractremoteshell import AbstractRemoteShell
from .shellresult import ShellResult
from .streamreader import PrefixedStream... | 33.463415 | 92 | 0.636297 |
4a128ec12f63b71571d41077ef5eb7d39c3cc156 | 3,097 | py | Python | trader/broker/base.py | tianhm/pyfx | 515dc8eaa9862d2bb28656a8c5c5c21d2a054f69 | [
"MIT"
] | 19 | 2016-12-13T12:55:09.000Z | 2021-11-19T00:21:54.000Z | trader/broker/base.py | tianhm/pyfx | 515dc8eaa9862d2bb28656a8c5c5c21d2a054f69 | [
"MIT"
] | null | null | null | trader/broker/base.py | tianhm/pyfx | 515dc8eaa9862d2bb28656a8c5c5c21d2a054f69 | [
"MIT"
] | 16 | 2017-03-10T18:52:28.000Z | 2021-10-04T05:18:42.000Z | import logging
from dateutil import parser as date_parse
from time import sleep
from OpenSSL.SSL import SysCallError
import pandas as pd
from requests.packages.urllib3.exceptions import ProtocolError
from ..lib.oandapy import OandaError
log = logging.getLogger('pyFx')
class OandaBrokerBase(object):
'''
Bas... | 32.946809 | 86 | 0.560542 |
4a128f7baab2b37dc20a6686b68ac3818b2a59ac | 2,009 | py | Python | src/python/pants/backend/python/tasks/wrapped_pex.py | ghthor/pants | 450de702414f87f563081ddefaefd8a554de07a3 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/python/tasks/wrapped_pex.py | ghthor/pants | 450de702414f87f563081ddefaefd8a554de07a3 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/python/tasks/wrapped_pex.py | ghthor/pants | 450de702414f87f563081ddefaefd8a554de07a3 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2017 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
from builtins import object
from copy import copy
class WrappedPEX(object):
"""Wrappe... | 31.390625 | 99 | 0.658537 |
4a1291ffe84665e7d351d66c2470a3a127abf3ce | 4,933 | py | Python | RecoTauTag/HLTProducers/python/applyL2TauTag.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 2 | 2020-10-26T18:40:32.000Z | 2021-04-10T16:33:25.000Z | RecoTauTag/HLTProducers/python/applyL2TauTag.py | gartung/cmssw | 3072dde3ce94dcd1791d778988198a44cde02162 | [
"Apache-2.0"
] | 30 | 2015-11-04T11:42:27.000Z | 2021-12-01T07:56:34.000Z | RecoTauTag/HLTProducers/python/applyL2TauTag.py | gartung/cmssw | 3072dde3ce94dcd1791d778988198a44cde02162 | [
"Apache-2.0"
] | 8 | 2016-03-25T07:17:43.000Z | 2021-07-08T17:11:21.000Z | import FWCore.ParameterSet.Config as cms
from HLTrigger.Configuration.customizeHLTforPatatrack import customizeHLTforPatatrackTriplets
from RecoTauTag.HLTProducers.l2TauNNProducer_cfi import *
from RecoTauTag.HLTProducers.l2TauTagFilter_cfi import *
def insertL2TauSequence(process, path, ref_module):
ref_idx = pat... | 55.426966 | 915 | 0.797081 |
4a1292228fedf92fbb6a17a84d70d5740551e4bc | 178 | py | Python | PyStacks/PyStacks/recordsets.py | 0xack13/PyStacks | 13136c43089c241680beb216a233d1846119dd7c | [
"MIT"
] | 11 | 2018-02-15T04:27:05.000Z | 2020-10-02T11:20:08.000Z | PyStacks/PyStacks/recordsets.py | 0xack13/PyStacks | 13136c43089c241680beb216a233d1846119dd7c | [
"MIT"
] | 3 | 2018-02-15T05:46:54.000Z | 2018-03-05T04:46:51.000Z | PyStacks/PyStacks/recordsets.py | 0xack13/PyStacks | 13136c43089c241680beb216a233d1846119dd7c | [
"MIT"
] | 8 | 2018-03-05T04:40:41.000Z | 2021-02-22T08:07:58.000Z | class recordsets():
def __init__(self, name, rectype, value, ttl):
self.name = name
self.rectype = rectype
self.value = value
self.ttl = ttl
| 22.25 | 50 | 0.578652 |
4a12947a5675b01b4410bedf4a39ad3e872dbdfe | 11,147 | py | Python | powerline/bindings/config.py | PH111P/powerline | f8dfe7e7e3d021cd66bc0e19b19ea4a51949cb9a | [
"MIT"
] | 23 | 2016-12-16T09:03:18.000Z | 2022-02-25T19:19:23.000Z | powerline/bindings/config.py | PH111P/powerline | f8dfe7e7e3d021cd66bc0e19b19ea4a51949cb9a | [
"MIT"
] | 30 | 2016-12-20T11:11:42.000Z | 2019-11-19T15:23:59.000Z | powerline/bindings/config.py | PH111P/powerline | f8dfe7e7e3d021cd66bc0e19b19ea4a51949cb9a | [
"MIT"
] | 4 | 2016-12-11T18:29:11.000Z | 2018-04-22T07:51:28.000Z | import os
import re
import sys
import subprocess
import shlex
from powerline.config import POWERLINE_ROOT, TMUX_CONFIG_DIRECTORY
from powerline.lib.config import ConfigLoader
from powerline import generate_config_finder, load_config, create_logger, finish_common_config
from powerline.shell import ShellPowerline
from p... | 39.25 | 129 | 0.65318 |
4a1294e515da1ab84eea0d4eb5e8a44c73c118a5 | 14,037 | py | Python | lib/densityx/__init__.py | kaylai/GlassDensityCalc | fd524fb97728c166cb0756a4a130d57fac1be43c | [
"MIT"
] | null | null | null | lib/densityx/__init__.py | kaylai/GlassDensityCalc | fd524fb97728c166cb0756a4a130d57fac1be43c | [
"MIT"
] | null | null | null | lib/densityx/__init__.py | kaylai/GlassDensityCalc | fd524fb97728c166cb0756a4a130d57fac1be43c | [
"MIT"
] | null | null | null | from math import *
import pandas
#Molecular Weights
MW_SiO2 = 60.0855
MW_TiO2 = 79.88
MW_Al2O3 = 101.96
MW_Fe2O3 = 159.69
MW_FeO = 71.85
MW_MgO = 40.3
MW_CaO = 56.08
MW_Na2O = 61.98
MW_K2O = 94.2
MW_H2O = 18.02
#Partial Molar Volumes
#Volumes for SiO2, Al2O3, MgO, CaO, Na2O, K2O at Tref=1773 K (Lange,... | 39.319328 | 168 | 0.616798 |
4a1295698dc5c88a1716604b0f94c66298de5ad8 | 9,548 | py | Python | jupyterlab/handlers/extension_manager_handler.py | nmichaud/jupyterlab | ebbe90df0826baf81e4067bf1c15157812abe978 | [
"BSD-3-Clause"
] | 3 | 2017-11-30T13:02:36.000Z | 2020-09-11T01:26:35.000Z | jupyterlab/handlers/extension_manager_handler.py | nmichaud/jupyterlab | ebbe90df0826baf81e4067bf1c15157812abe978 | [
"BSD-3-Clause"
] | 2 | 2017-05-03T21:24:52.000Z | 2019-01-15T23:15:11.000Z | jupyterlab/handlers/extension_manager_handler.py | ianhi/jupyterlab | 13c1964250d2772739fe3688360e4ef3f25564c0 | [
"BSD-3-Clause"
] | 1 | 2016-07-16T15:45:53.000Z | 2016-07-16T15:45:53.000Z | """Tornado handlers for extension management."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import json
import os
import re
from concurrent.futures import ThreadPoolExecutor
from jupyter_server.base.handlers import APIHandler
from jupyter_server.extension.ha... | 35.894737 | 88 | 0.615941 |
4a1296b426485c1a1a19f05b0b2645331a54f48a | 22,988 | bzl | Python | tensorflow/core/platform/default/build_refactor.bzl | LuBingtan/tensorflow | 064a4a0dabe0689fc3d3e90ee4ad39c7161e49ac | [
"Apache-2.0"
] | 1 | 2019-09-02T08:18:46.000Z | 2019-09-02T08:18:46.000Z | tensorflow/core/platform/default/build_refactor.bzl | LuBingtan/tensorflow | 064a4a0dabe0689fc3d3e90ee4ad39c7161e49ac | [
"Apache-2.0"
] | 1 | 2018-04-02T23:42:30.000Z | 2018-05-03T23:12:23.000Z | tensorflow/core/platform/default/build_refactor.bzl | LuBingtan/tensorflow | 064a4a0dabe0689fc3d3e90ee4ad39c7161e49ac | [
"Apache-2.0"
] | null | null | null | """
Build targets for default implementations of tf/core/platform libraries.
"""
# This is a temporary hack to mimic the presence of a BUILD file under
# tensorflow/core/platform/default. This is part of a large refactoring
# of BUILD rules under tensorflow/core/platform. We will remove this file
# and add real BUILD f... | 36.488889 | 93 | 0.517226 |
4a1296f1b0f149c809b91bdee1f0a24e69941706 | 1,009 | py | Python | sdk/python/pulumi_azure_nextgen/authorization/v20171001preview/__init__.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/authorization/v20171001preview/__init__.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/authorization/v20171001preview/__init__.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
# Export this package's modules as members:
from .get_role_assignment import *
from .role_assignment import *
def _register_module():
import pulum... | 32.548387 | 112 | 0.688801 |
4a129711c93e1ea7504dd04955b3c52a81dabe68 | 4,490 | py | Python | all_repos/clone.py | charlievieth/all-repos | 279d2910c56567d9518ab41bd8894216b9f649e5 | [
"MIT"
] | 1 | 2020-12-23T18:26:54.000Z | 2020-12-23T18:26:54.000Z | all_repos/clone.py | charlievieth/all-repos | 279d2910c56567d9518ab41bd8894216b9f649e5 | [
"MIT"
] | null | null | null | all_repos/clone.py | charlievieth/all-repos | 279d2910c56567d9518ab41bd8894216b9f649e5 | [
"MIT"
] | 2 | 2020-09-03T12:50:13.000Z | 2020-10-30T07:45:29.000Z | import argparse
import functools
import json
import os.path
import shutil
import subprocess
from typing import Dict
from typing import Generator
from typing import Optional
from typing import Sequence
from typing import Tuple
from all_repos import cli
from all_repos import git
from all_repos import mapper
from all_rep... | 30.544218 | 79 | 0.641203 |
4a129764ca3f6b4da14be65bc0e096cb7f5027d4 | 1,684 | py | Python | RESTApi/flaskapp/routes.py | Peacecake/HoloMu | 98b422b226c2274e6d7e96df31724b0d2abd8ebb | [
"MIT"
] | null | null | null | RESTApi/flaskapp/routes.py | Peacecake/HoloMu | 98b422b226c2274e6d7e96df31724b0d2abd8ebb | [
"MIT"
] | 32 | 2018-06-19T15:27:04.000Z | 2018-09-30T20:17:23.000Z | RESTApi/flaskapp/routes.py | Peacecake/HoloMu | 98b422b226c2274e6d7e96df31724b0d2abd8ebb | [
"MIT"
] | null | null | null | from flask import Blueprint, request, Response
from db import get_db
from db import init_db
from uploader import Uploader
from jsonParser import JsonParser
import json
from . import trainAndTest
from . import label_image
import os
from collections import Counter
import recommend
bp = Blueprint("routes", __... | 30.618182 | 88 | 0.7019 |
4a1297e5bd53afa74794b320745a1f3460daaca8 | 681 | py | Python | utils/utils.py | Irvinfaith/numpy_neural_network | 46c86884611d0174e6ab96eb70d1f4ebec8caafb | [
"MIT"
] | 26 | 2021-01-12T03:00:21.000Z | 2022-01-22T10:36:40.000Z | utils/utils.py | Irvinfaith/numpy_neural_network | 46c86884611d0174e6ab96eb70d1f4ebec8caafb | [
"MIT"
] | null | null | null | utils/utils.py | Irvinfaith/numpy_neural_network | 46c86884611d0174e6ab96eb70d1f4ebec8caafb | [
"MIT"
] | 1 | 2021-01-13T06:47:58.000Z | 2021-01-13T06:47:58.000Z | # -*- coding: utf-8 -*-
"""
Created on 2021/1/12 18:22
@author: Irvinfaith
@email: Irvinfaith@hotmail.com
"""
import pandas as pd
import numpy as np
def series_to_array(x):
if isinstance(x, pd.DataFrame) or isinstance(x, pd.Series):
return np.array(x)
elif isinstance(x, np.ndarray):
return x... | 23.482759 | 112 | 0.640235 |
4a1298162da43ec54b2bcd1f8de73764ffe8eb48 | 7,393 | py | Python | tests/integration/test_recovery_replica/test.py | chalice19/ClickHouse | 2f38e7bc5c2113935ab86260439bb543a1737291 | [
"Apache-2.0"
] | 8,629 | 2016-06-14T21:03:01.000Z | 2019-09-23T07:46:38.000Z | tests/integration/test_recovery_replica/test.py | chalice19/ClickHouse | 2f38e7bc5c2113935ab86260439bb543a1737291 | [
"Apache-2.0"
] | 4,335 | 2016-06-15T12:58:31.000Z | 2019-09-23T11:18:43.000Z | tests/integration/test_recovery_replica/test.py | chalice19/ClickHouse | 2f38e7bc5c2113935ab86260439bb543a1737291 | [
"Apache-2.0"
] | 1,700 | 2016-06-15T09:25:11.000Z | 2019-09-23T11:16:38.000Z | import time
import pytest
from helpers.cluster import ClickHouseCluster
from helpers.test_tools import assert_eq_with_retry
SETTINGS = "SETTINGS min_replicated_logs_to_keep=3, max_replicated_logs_to_keep=5, cleanup_delay_period=0, cleanup_delay_period_random_add=0"
def fill_nodes(nodes):
for node in nodes:
... | 33.452489 | 141 | 0.649533 |
4a1298555fd42c0959b7b1b9fd05bb39ebe27c31 | 769 | py | Python | device/management/commands/add_device.py | sharmapacific/homeAutomation | 77f7f415ff9813ad86e1f93d9a405bd221f2abba | [
"MIT"
] | null | null | null | device/management/commands/add_device.py | sharmapacific/homeAutomation | 77f7f415ff9813ad86e1f93d9a405bd221f2abba | [
"MIT"
] | null | null | null | device/management/commands/add_device.py | sharmapacific/homeAutomation | 77f7f415ff9813ad86e1f93d9a405bd221f2abba | [
"MIT"
] | null | null | null | from device.models import DeviceInfo
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'Add New Device'
def add_arguments(self, parser):
parser.add_argument('device',
type=str,
help='Indicates the device to b... | 28.481481 | 65 | 0.56827 |
4a12987bda4533e7a2a2d3f1958a74cb01e121d7 | 1,432 | py | Python | simsurvey_tools.py | sPaMFouR/simsurvey-examples | ef034f729a5dd74e4bdd9ae5052c69780d917cbe | [
"BSD-3-Clause"
] | null | null | null | simsurvey_tools.py | sPaMFouR/simsurvey-examples | ef034f729a5dd74e4bdd9ae5052c69780d917cbe | [
"BSD-3-Clause"
] | null | null | null | simsurvey_tools.py | sPaMFouR/simsurvey-examples | ef034f729a5dd74e4bdd9ae5052c69780d917cbe | [
"BSD-3-Clause"
] | 1 | 2021-04-29T07:31:43.000Z | 2021-04-29T07:31:43.000Z | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import sncosmo
def load_ztf_fields(filename='data/ZTF_Fields.txt', mwebv=False, galactic=False):
"""Load the ZTF fields propose by Eran from the included file.
Parameters
----------
filename: [str]
File name of the ASCII file c... | 25.122807 | 81 | 0.585196 |
4a1298c58e5a70d12ce9008e24aea3eec1065e0a | 4,365 | py | Python | code/ARAX/ARAXQuery/Overlay/GraphSage_train/py_scripts/generate_random_walk.py | andrewsu/RTX | dd1de262d0817f7e6d2f64e5bec7d5009a3a2740 | [
"MIT"
] | 31 | 2018-03-05T20:01:10.000Z | 2022-02-01T03:31:22.000Z | code/ARAX/ARAXQuery/Overlay/GraphSage_train/py_scripts/generate_random_walk.py | andrewsu/RTX | dd1de262d0817f7e6d2f64e5bec7d5009a3a2740 | [
"MIT"
] | 1,774 | 2018-03-06T01:55:03.000Z | 2022-03-31T03:09:04.000Z | code/ARAX/ARAXQuery/Overlay/GraphSage_train/py_scripts/generate_random_walk.py | andrewsu/RTX | dd1de262d0817f7e6d2f64e5bec7d5009a3a2740 | [
"MIT"
] | 19 | 2018-05-10T00:43:19.000Z | 2022-03-08T19:26:16.000Z | ## This script is used to generate random walk file (eg. walks.txt, please see https://github.com/williamleif/GraphSAGE
# for more details) via batch by batch for running Graphsage
from __future__ import print_function
import json
import numpy as np
import pandas as pd
import random
import os
import sys
import argpar... | 38.289474 | 119 | 0.636426 |
4a12995cb97f792733494fb9006a3ed902d5453b | 5,228 | py | Python | temboo/core/Library/SendGrid/WebAPI/Statistics/GetAllTimeCategoryTotals.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 7 | 2016-03-07T02:07:21.000Z | 2022-01-21T02:22:41.000Z | temboo/core/Library/SendGrid/WebAPI/Statistics/GetAllTimeCategoryTotals.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | null | null | null | temboo/core/Library/SendGrid/WebAPI/Statistics/GetAllTimeCategoryTotals.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 8 | 2016-06-14T06:01:11.000Z | 2020-04-22T09:21:44.000Z | # -*- coding: utf-8 -*-
###############################################################################
#
# GetAllTimeCategoryTotals
# Obtain statistics by specified categories.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you m... | 45.859649 | 269 | 0.702946 |
4a1299e11ba4be2b7b316d5e954b0ae566c229c9 | 39,577 | py | Python | cvxpy/problems/problem.py | dberkens/cvxpy | b639e4a691d4986b9952de268282c9ece570411b | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cvxpy/problems/problem.py | dberkens/cvxpy | b639e4a691d4986b9952de268282c9ece570411b | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cvxpy/problems/problem.py | dberkens/cvxpy | b639e4a691d4986b9952de268282c9ece570411b | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-04-12T05:17:18.000Z | 2020-04-12T05:17:18.000Z | """
Copyright 2013 Steven Diamond, 2017 Akshay Agrawal
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to... | 38.091434 | 98 | 0.599666 |
4a129ab1c25d92d01467194fe09cdc3f55be5d7e | 1,295 | py | Python | benchmarks/test_benchmark.py | ludovicchabant/Wikked | 02ec3c0361ac90b0366e7a90f8928a54d40616b5 | [
"Apache-2.0"
] | 17 | 2015-10-10T11:37:33.000Z | 2021-11-21T02:10:38.000Z | benchmarks/test_benchmark.py | ludovicchabant/Wikked | 02ec3c0361ac90b0366e7a90f8928a54d40616b5 | [
"Apache-2.0"
] | 1 | 2018-11-10T19:40:58.000Z | 2019-03-09T07:47:53.000Z | benchmarks/test_benchmark.py | ludovicchabant/Wikked | 02ec3c0361ac90b0366e7a90f8928a54d40616b5 | [
"Apache-2.0"
] | null | null | null | import re
import urllib.parse
import random
import unittest
from funkload.FunkLoadTestCase import FunkLoadTestCase
class Benchmark(FunkLoadTestCase):
"""This test uses a configuration file Benchmark.conf."""
def setUp(self):
self.server_url = self.conf_get('main', 'url')
def test_simple(self):
... | 35 | 78 | 0.616216 |
4a129bbcd3eb80dceaac4efbd2224f4dd7154e7d | 4,406 | py | Python | lldb/packages/Python/lldbsuite/test/functionalities/abbreviation/TestAbbreviations.py | medismailben/llvm-project | e334a839032fe500c3bba22bf976ab7af13ce1c1 | [
"Apache-2.0"
] | 2,338 | 2018-06-19T17:34:51.000Z | 2022-03-31T11:00:37.000Z | lldb/packages/Python/lldbsuite/test/functionalities/abbreviation/TestAbbreviations.py | medismailben/llvm-project | e334a839032fe500c3bba22bf976ab7af13ce1c1 | [
"Apache-2.0"
] | 3,740 | 2019-01-23T15:36:48.000Z | 2022-03-31T22:01:13.000Z | lldb/packages/Python/lldbsuite/test/functionalities/abbreviation/TestAbbreviations.py | medismailben/llvm-project | e334a839032fe500c3bba22bf976ab7af13ce1c1 | [
"Apache-2.0"
] | 500 | 2019-01-23T07:49:22.000Z | 2022-03-30T02:59:37.000Z | """
Test some lldb command abbreviations and aliases for proper resolution.
"""
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class AbbreviationsTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@no_debug_info_test
... | 40.796296 | 86 | 0.642079 |
4a129c39da06b58d9ad8d6411a6799636a8af6c5 | 14,090 | py | Python | tests/run_unit_tests.py | CyberPoint/libpgm | be32202d28f53cf3761a2e31ea8ffcdc3e383789 | [
"BSD-3-Clause"
] | 83 | 2015-02-04T02:05:50.000Z | 2020-12-21T03:22:39.000Z | tests/run_unit_tests.py | CyberPoint/libpgm | be32202d28f53cf3761a2e31ea8ffcdc3e383789 | [
"BSD-3-Clause"
] | 26 | 2015-03-10T11:22:39.000Z | 2020-05-27T23:48:21.000Z | tests/run_unit_tests.py | CyberPoint/libpgm | be32202d28f53cf3761a2e31ea8ffcdc3e383789 | [
"BSD-3-Clause"
] | 50 | 2015-03-02T12:49:31.000Z | 2020-05-26T07:36:48.000Z | '''
A module that conducts unit tests on all top-level methods within each class.
Created on Jun 20, 2012
@author: ccabot
'''
import unittest
import sys
# add to PYTHONPATH
sys.path.append("../")
from libpgm.dictionary import Dictionary
from libpgm.graphskeleton import GraphSkeleton
from libpgm.orderedskeleton impo... | 37.275132 | 244 | 0.637615 |
4a129c721e40365989e38ee52dff8c8c46f18593 | 351 | py | Python | tlnmf/__init__.py | sixin-zh/tlnmf-gcm | 4ff1d61acfa65eb51e90f56d02d227cb77847558 | [
"MIT"
] | null | null | null | tlnmf/__init__.py | sixin-zh/tlnmf-gcm | 4ff1d61acfa65eb51e90f56d02d227cb77847558 | [
"MIT"
] | null | null | null | tlnmf/__init__.py | sixin-zh/tlnmf-gcm | 4ff1d61acfa65eb51e90f56d02d227cb77847558 | [
"MIT"
] | null | null | null | """Transform Learning - NMF"""
__version__ = '0.1' # noqa
from .tl_nmf_batch import tl_nmf_batch # gcm model, mle loss, batch samples
from .tl_nmf_gcm_newton import tl_nmf_gcm_newton # gcm model, mle loss in expectation
from .utils import signal_to_frames, unitary_projection, synthesis_windowing # noqa
import numpy... | 31.909091 | 85 | 0.777778 |
4a129d20aa5d1ee2b8ba6cbcd4eaf9af4ec7e3f6 | 40,988 | py | Python | examples/my_agent/my_agent_1/macro_action_mask.py | Hotpotfish/python-sc2 | 31675d62d3241dc84e538df9b77d15132939be85 | [
"MIT"
] | null | null | null | examples/my_agent/my_agent_1/macro_action_mask.py | Hotpotfish/python-sc2 | 31675d62d3241dc84e538df9b77d15132939be85 | [
"MIT"
] | null | null | null | examples/my_agent/my_agent_1/macro_action_mask.py | Hotpotfish/python-sc2 | 31675d62d3241dc84e538df9b77d15132939be85 | [
"MIT"
] | null | null | null | import random
from examples.my_agent.my_agent_1.action_list import *
from sc2.ids.unit_typeid import UnitTypeId
from sc2.position import Point2
from sc2.units import Units
from sc2.unit import Unit
ATTACK_FREQUENCY = 32
BUILD_FREQUENCY = 32
DETECTION_FREQUENCY = 64
DISTRIBUTE_FREQUENCY = 32
# 动作若无法执行直接输出no-op
# 修建... | 45.847875 | 198 | 0.617937 |
4a129e2ad433ea94283c1a44d95eb1df80aabe60 | 14,309 | py | Python | python/GafferOSLTest/OSLImageTest.py | mattigruener/gaffer | 8216ba1a884712575a0acae747c51b02f7a99a5d | [
"BSD-3-Clause"
] | 1 | 2019-08-02T16:49:59.000Z | 2019-08-02T16:49:59.000Z | python/GafferOSLTest/OSLImageTest.py | rkoschmitzky/gaffer | ec6262ae1292767bdeb9520d1447d65a4a511884 | [
"BSD-3-Clause"
] | 2 | 2017-08-23T21:35:45.000Z | 2018-01-29T08:59:33.000Z | python/GafferOSLTest/OSLImageTest.py | rkoschmitzky/gaffer | ec6262ae1292767bdeb9520d1447d65a4a511884 | [
"BSD-3-Clause"
] | null | null | null | ##########################################################################
#
# Copyright (c) 2013-2015, John Haddon. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions ... | 38.883152 | 115 | 0.675938 |
4a129f458bf807577a03c99d4ad79526435062c0 | 31,883 | py | Python | src/cogent3/format/table.py | jamesmartini/cogent3 | 5d0aab1871561aa3d4cd6b629be6cc7a23f15c49 | [
"BSD-3-Clause"
] | null | null | null | src/cogent3/format/table.py | jamesmartini/cogent3 | 5d0aab1871561aa3d4cd6b629be6cc7a23f15c49 | [
"BSD-3-Clause"
] | null | null | null | src/cogent3/format/table.py | jamesmartini/cogent3 | 5d0aab1871561aa3d4cd6b629be6cc7a23f15c49 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""
Tool for creating tables and representing them as text, or writing to file for
import into other packages. These classes still under development.
Current formats include restructured text (keyed by 'rest'), latex, html,
columns separated by a provided string, and a simple text format.
"""
imp... | 29.769374 | 100 | 0.586112 |
4a12a01307f9cf776bf5f73db0a011b86cf1e1fc | 2,333 | py | Python | 4/learn.py | Terfno/learn_DL | 0e1f3049c2c342915e1b7237506029a42539029e | [
"MIT"
] | null | null | null | 4/learn.py | Terfno/learn_DL | 0e1f3049c2c342915e1b7237506029a42539029e | [
"MIT"
] | null | null | null | 4/learn.py | Terfno/learn_DL | 0e1f3049c2c342915e1b7237506029a42539029e | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pylab as plt
import os, sys
sys.path.append(os.pardir)
from two_layer_net import TwoLayerNet
from dataset.mnist import load_mnist
def graph_loss(train_loss_list: list):
print("now creating graph of loss")
x = np.arange(len(train_loss_list))
plt.plot(x, train_loss_list, label=... | 25.922222 | 87 | 0.691384 |
4a12a1403eb11c795b3522a85042c56bded57c81 | 2,915 | py | Python | starlette_login/login_manager.py | jockerz/Starlette-Login | 8e517d33b2100417ff71db72404b3a3cde6cdd7d | [
"MIT"
] | null | null | null | starlette_login/login_manager.py | jockerz/Starlette-Login | 8e517d33b2100417ff71db72404b3a3cde6cdd7d | [
"MIT"
] | null | null | null | starlette_login/login_manager.py | jockerz/Starlette-Login | 8e517d33b2100417ff71db72404b3a3cde6cdd7d | [
"MIT"
] | null | null | null | import typing as t
from dataclasses import dataclass
from datetime import timedelta
from enum import Enum
from starlette.requests import HTTPConnection
from starlette.responses import Response
from .mixins import AnonymousUser
from .utils import decode_cookie, encode_cookie
class ProtectionLevel(Enum):
Basic = ... | 30.051546 | 73 | 0.67307 |
4a12a1d76af3137dbf2acd1a4d68a301ce707330 | 13,333 | py | Python | ironic/common/release_mappings.py | arnewiebalck/ironic | 41a10cffce8bd85048d939f79fd64371b7382997 | [
"Apache-2.0"
] | 1 | 2021-07-19T16:42:19.000Z | 2021-07-19T16:42:19.000Z | ironic/common/release_mappings.py | arnewiebalck/ironic | 41a10cffce8bd85048d939f79fd64371b7382997 | [
"Apache-2.0"
] | null | null | null | ironic/common/release_mappings.py | arnewiebalck/ironic | 41a10cffce8bd85048d939f79fd64371b7382997 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Intel Corp.
#
# 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 agr... | 31.520095 | 79 | 0.441536 |
4a12a23298858a1885877381eb495e7dbe4614a9 | 844 | py | Python | thinkpython_allen_downey/exercise_11_1.py | alirkaya/programming-textbook-solutions | 7362dce474b8a881d654f95604e09d1d0e76aec2 | [
"MIT"
] | null | null | null | thinkpython_allen_downey/exercise_11_1.py | alirkaya/programming-textbook-solutions | 7362dce474b8a881d654f95604e09d1d0e76aec2 | [
"MIT"
] | null | null | null | thinkpython_allen_downey/exercise_11_1.py | alirkaya/programming-textbook-solutions | 7362dce474b8a881d654f95604e09d1d0e76aec2 | [
"MIT"
] | null | null | null | with open('words.txt', 'r') as fin:
lines = fin.readlines()
words_dict = {}
for line in lines:
word = line.strip()
words_dict[word] = 0
words = []
for line in lines:
words.append(line.strip())
def bisect(words, target):
if len(words) == 0:
return False
mid_value = len(words)//2
if... | 22.210526 | 50 | 0.648104 |
4a12a242d164fc41065480b30be6c3e80e1ac03b | 44,912 | py | Python | silx/math/fit/fitmanager.py | PiRK/silx | db6c1d2bdccfc6ec0811f2068dfbe9edefc38f20 | [
"CC0-1.0"
] | null | null | null | silx/math/fit/fitmanager.py | PiRK/silx | db6c1d2bdccfc6ec0811f2068dfbe9edefc38f20 | [
"CC0-1.0"
] | 1 | 2019-05-16T14:18:23.000Z | 2019-05-16T14:18:23.000Z | silx/math/fit/fitmanager.py | PiRK/silx | db6c1d2bdccfc6ec0811f2068dfbe9edefc38f20 | [
"CC0-1.0"
] | 1 | 2022-01-24T16:19:27.000Z | 2022-01-24T16:19:27.000Z | # coding: utf-8
# /*#########################################################################
#
# Copyright (c) 2004-2017 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to de... | 41.895522 | 99 | 0.588172 |
4a12a2543be6cc7a792c8310596012da841a9b7c | 5,232 | py | Python | training/src/tests/tests/python/cnnBiasTrain1d.py | steelONIONknight/bolt | 9bd3d08f2abb14435ca3ad0179889e48fa7e9b47 | [
"MIT"
] | null | null | null | training/src/tests/tests/python/cnnBiasTrain1d.py | steelONIONknight/bolt | 9bd3d08f2abb14435ca3ad0179889e48fa7e9b47 | [
"MIT"
] | null | null | null | training/src/tests/tests/python/cnnBiasTrain1d.py | steelONIONknight/bolt | 9bd3d08f2abb14435ca3ad0179889e48fa7e9b47 | [
"MIT"
] | null | null | null | # Copyright (C) 2022. Huawei Technologies Co., Ltd. All rights reserved.
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation the rights to use, co... | 31.902439 | 148 | 0.629205 |
4a12a37d9c7ca5a9291d1edda817cee83a2fea67 | 9,186 | py | Python | references/detection/train.py | soldierofhell/vision | 9197596f86c62b3de7965e80d644189cabb78f2b | [
"BSD-3-Clause"
] | null | null | null | references/detection/train.py | soldierofhell/vision | 9197596f86c62b3de7965e80d644189cabb78f2b | [
"BSD-3-Clause"
] | null | null | null | references/detection/train.py | soldierofhell/vision | 9197596f86c62b3de7965e80d644189cabb78f2b | [
"BSD-3-Clause"
] | null | null | null | r"""PyTorch Detection Training.
To run in a multi-gpu environment, use the distributed launcher::
python -m torch.distributed.launch --nproc_per_node=$NGPU --use_env \
train.py ... --world-size $NGPU
The default hyperparameters are tuned for training on 8 gpus and 2 images per gpu.
--lr 0.02 --batch-... | 41.945205 | 119 | 0.681907 |
4a12a426bc1ac4b6234ee3ca1a94ab9ea54340fa | 60 | py | Python | pokerl/envs/__init__.py | sneppy/pokerl | 2ea8cd6c3dad7531ac5cad79aa0dc8879f771e2c | [
"MIT"
] | 6 | 2020-05-26T23:04:39.000Z | 2022-03-01T18:11:08.000Z | pokerl/envs/__init__.py | sneppy/pokerl | 2ea8cd6c3dad7531ac5cad79aa0dc8879f771e2c | [
"MIT"
] | 14 | 2020-05-26T23:30:13.000Z | 2020-05-28T20:50:32.000Z | pokerl/envs/__init__.py | sneppy/pokerl | 2ea8cd6c3dad7531ac5cad79aa0dc8879f771e2c | [
"MIT"
] | null | null | null | from .env import PokerEnv
from .game_env import PokerGameEnv | 30 | 34 | 0.85 |
4a12a435c88684eea97cea41736116f92b9bfa14 | 337 | py | Python | Country cleaning/Argentina.py | Demonliquid/cars-python-cleaning | 91c516a33c4522114dc024cfaf04f1c1d594f973 | [
"MIT"
] | null | null | null | Country cleaning/Argentina.py | Demonliquid/cars-python-cleaning | 91c516a33c4522114dc024cfaf04f1c1d594f973 | [
"MIT"
] | null | null | null | Country cleaning/Argentina.py | Demonliquid/cars-python-cleaning | 91c516a33c4522114dc024cfaf04f1c1d594f973 | [
"MIT"
] | null | null | null | # %%
import os
import pandas as pd
import numpy as np
import datetime
import codecs
# %% CARGA DE DATOS
# MODELO
#base = pd.read_csv(r'D:\Basededatos\esquema.csv')
# PAIS
argentina2 = pd.read_csv(r'D:\Documentos\historico_afac\historico_afac.txt', encoding='latin1', engine="python" ,error_bad_lines=False, sep="\... | 14.041667 | 145 | 0.703264 |
4a12a452cbbc2e1029d0082a7f67e5f3f5379f54 | 9,764 | py | Python | lib/opentypesvg/fonts2svg.py | davidgodzsak/opentype-svg | 038bb25bcf9ccf0408bde708c4758674d7db5247 | [
"MIT"
] | null | null | null | lib/opentypesvg/fonts2svg.py | davidgodzsak/opentype-svg | 038bb25bcf9ccf0408bde708c4758674d7db5247 | [
"MIT"
] | null | null | null | lib/opentypesvg/fonts2svg.py | davidgodzsak/opentype-svg | 038bb25bcf9ccf0408bde708c4758674d7db5247 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright 2016 Adobe. All rights reserved.
"""
Generates a set of SVG glyph files from one or more fonts and hex colors
for each of them. The fonts' format can be either OpenType, TrueType, WOFF,
or WOFF2.
"""
import argparse
import os
import re
import sys
from fontTools import ttLib
from fo... | 31.80456 | 79 | 0.604261 |
4a12a4a0de3777d26c77bf1b970f96687f762383 | 420 | py | Python | src/gobjcreator3/model/genum.py | ThomasBollmeier/GObjectCreator3 | 20f2ad66efbae5e270f08612e5115be75399c55c | [
"Apache-2.0"
] | 1 | 2015-03-31T12:21:14.000Z | 2015-03-31T12:21:14.000Z | src/gobjcreator3/model/genum.py | ThomasBollmeier/GObjectCreator3 | 20f2ad66efbae5e270f08612e5115be75399c55c | [
"Apache-2.0"
] | null | null | null | src/gobjcreator3/model/genum.py | ThomasBollmeier/GObjectCreator3 | 20f2ad66efbae5e270f08612e5115be75399c55c | [
"Apache-2.0"
] | null | null | null | from gobjcreator3.model.type import Type
class GEnum(Type):
def __init__(self, name, code_names_values):
Type.__init__(self, name, Type.ENUMERATION)
self.code_names_values = code_names_values
def has_code(self, code_name):
for item in self.code_n... | 23.333333 | 51 | 0.592857 |
4a12a4d91b5d46ada8ffb2e92a74686e5d458627 | 2,910 | py | Python | src/tempo/unit.py | techdragon/python-tempo | c146959a5bd3a6f510a784d89ad3ee0537342677 | [
"BSD-3-Clause"
] | null | null | null | src/tempo/unit.py | techdragon/python-tempo | c146959a5bd3a6f510a784d89ad3ee0537342677 | [
"BSD-3-Clause"
] | null | null | null | src/tempo/unit.py | techdragon/python-tempo | c146959a5bd3a6f510a784d89ad3ee0537342677 | [
"BSD-3-Clause"
] | null | null | null | # coding=utf-8
"""Date/time related constants."""
import datetime as dt
from tempo.utils import Enum
# Minimum and maximum points of time within which
# the library is able to operate
MIN = dt.datetime(year=1, month=1, day=1)
MAX = dt.datetime(year=9999, month=12, day=31,
hour=23, minute=59, second=... | 28.811881 | 83 | 0.640893 |
4a12a570c5c6bf7684b9c0676d03fa0b35c3775e | 6,820 | py | Python | trakt/objects/show.py | jannon/trakt.py | 096496e453cadf6718f0f6de6f82a6b4bd6cb56c | [
"MIT"
] | null | null | null | trakt/objects/show.py | jannon/trakt.py | 096496e453cadf6718f0f6de6f82a6b4bd6cb56c | [
"MIT"
] | null | null | null | trakt/objects/show.py | jannon/trakt.py | 096496e453cadf6718f0f6de6f82a6b4bd6cb56c | [
"MIT"
] | null | null | null | from __future__ import absolute_import, division, print_function
from trakt.core.helpers import from_iso8601_datetime, to_iso8601_datetime, deprecated
from trakt.objects.core.helpers import update_attributes
from trakt.objects.media import Media
from six import iteritems
class Show(Media):
def __init__(self, cl... | 24.444444 | 102 | 0.537977 |
4a12a5a4a2d41fc5325ac7474664e59b649a19ea | 10,690 | py | Python | argo/workflows/client/models/v1_scale_io_volume_source.py | fvdnabee/argo-client-python | 0caa743442d37f2f2e3b30867398ed2708c1bf4d | [
"Apache-2.0"
] | 35 | 2019-10-25T09:19:36.000Z | 2022-03-04T11:22:27.000Z | argo/workflows/client/models/v1_scale_io_volume_source.py | fvdnabee/argo-client-python | 0caa743442d37f2f2e3b30867398ed2708c1bf4d | [
"Apache-2.0"
] | 17 | 2019-10-30T03:49:20.000Z | 2020-07-02T15:54:50.000Z | argo/workflows/client/models/v1_scale_io_volume_source.py | fvdnabee/argo-client-python | 0caa743442d37f2f2e3b30867398ed2708c1bf4d | [
"Apache-2.0"
] | 9 | 2019-11-06T13:30:08.000Z | 2021-06-12T03:00:05.000Z | # coding: utf-8
"""
Argo
Python client for Argo Workflows # noqa: E501
OpenAPI spec version: master
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class V1ScaleIOVolumeSource(object):
"""NOTE: This class is auto gen... | 29.860335 | 209 | 0.614874 |
4a12a5fe4d773eb0b5cbe03f70ddcf354c28002c | 14,023 | py | Python | onmt/utils/parse.py | comydream/OpenNMT-py | 2f3c810069ca03b752d9886782648e576b39a06d | [
"MIT"
] | 1 | 2021-10-01T15:03:35.000Z | 2021-10-01T15:03:35.000Z | onmt/utils/parse.py | urialon/OpenNMT-py | bdca05a3fac8f864b21c86a8ad03c09895212e70 | [
"MIT"
] | null | null | null | onmt/utils/parse.py | urialon/OpenNMT-py | bdca05a3fac8f864b21c86a8ad03c09895212e70 | [
"MIT"
] | null | null | null | import configargparse as cfargparse
import os
import torch
import onmt.opts as opts
from onmt.utils.logging import logger
from onmt.constants import CorpusName, ModelTask
from onmt.transforms import AVAILABLE_TRANSFORMS
class DataOptsCheckerMixin(object):
"""Checker with methods for validate data related options... | 43.280864 | 105 | 0.598231 |
4a12a721f3e1ce77ccf0c2e74af80490c161f01b | 2,417 | py | Python | lab_exercises/le_03-2019Fall/lab_exercise_03_solution.py | jadeharr/SI506-practice | 57001199c70e9b332b3dbad2ae6ce1be0e96946c | [
"BSD-3-Clause"
] | 12 | 2020-11-12T17:42:54.000Z | 2022-02-03T15:51:45.000Z | lab_exercises/le_03-2019Fall/lab_exercise_03_solution.py | jadeharr/SI506-practice | 57001199c70e9b332b3dbad2ae6ce1be0e96946c | [
"BSD-3-Clause"
] | 14 | 2020-10-07T13:44:33.000Z | 2020-10-23T16:03:13.000Z | lab_exercises/le_03-2019Fall/lab_exercise_03_solution.py | jadeharr/SI506-practice | 57001199c70e9b332b3dbad2ae6ce1be0e96946c | [
"BSD-3-Clause"
] | 15 | 2020-08-10T17:29:37.000Z | 2022-01-18T02:15:52.000Z | # START LAB EXERCISE 03
print('Lab Exercise 03 \n')
# SETUP - We provide you with a select list of UMSI faculty. In the future, such data
# will be provided in a file which you will read into Python with some useful functions. However,
# for today, the teaching team has provided this list for you to use.
#
# Data desc... | 32.226667 | 109 | 0.735623 |
4a12a7d59993f4c6f584aca04da3b0daf99ced06 | 7,550 | py | Python | awx/api/views/organization.py | DamoR25/awxnew | 03ed6e97558ae090ea52703caf6ed1b196557981 | [
"Apache-2.0"
] | 11,396 | 2017-09-07T04:56:02.000Z | 2022-03-31T13:56:17.000Z | awx/api/views/organization.py | DamoR25/awxnew | 03ed6e97558ae090ea52703caf6ed1b196557981 | [
"Apache-2.0"
] | 11,046 | 2017-09-07T09:30:46.000Z | 2022-03-31T20:28:01.000Z | awx/api/views/organization.py | DamoR25/awxnew | 03ed6e97558ae090ea52703caf6ed1b196557981 | [
"Apache-2.0"
] | 3,592 | 2017-09-07T04:14:31.000Z | 2022-03-31T23:53:09.000Z | # Copyright (c) 2018 Red Hat, Inc.
# All Rights Reserved.
# Python
import logging
# Django
from django.db.models import Count
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import ugettext_lazy as _
# AWX
from awx.main.models import (
ActivityStream,
Inventory,
H... | 29.150579 | 125 | 0.758411 |
4a12a90fd6a3ed94bf580d8bd4d332c76596faac | 3,753 | py | Python | src/sentry/plugins/sentry_webhooks/plugin.py | gecka/sentry | 9bfcde5f244dc4a8d5cf81222f14d3f8de1d9877 | [
"BSD-3-Clause"
] | 1 | 2018-12-04T12:57:00.000Z | 2018-12-04T12:57:00.000Z | src/sentry/plugins/sentry_webhooks/plugin.py | gecka/sentry | 9bfcde5f244dc4a8d5cf81222f14d3f8de1d9877 | [
"BSD-3-Clause"
] | 1 | 2021-05-09T11:43:43.000Z | 2021-05-09T11:43:43.000Z | src/sentry/plugins/sentry_webhooks/plugin.py | gecka/sentry | 9bfcde5f244dc4a8d5cf81222f14d3f8de1d9877 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
import logging
import six
import sentry
from django import forms
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from sentry.exceptions import PluginError
from sentry.plugins.bases import notify
from sentry.http import is_valid_url, safe... | 33.810811 | 93 | 0.622968 |
4a12aa1968fa0bd003821a037d2116be555083e7 | 1,493 | py | Python | joulescope/usb/impl_tools.py | rnestler/pyjoulescope | b9eff73d2236e05d5c3631dbd112c1ef54854005 | [
"Apache-2.0"
] | 29 | 2018-12-19T22:42:09.000Z | 2022-01-31T12:26:52.000Z | joulescope/usb/impl_tools.py | rnestler/pyjoulescope | b9eff73d2236e05d5c3631dbd112c1ef54854005 | [
"Apache-2.0"
] | 23 | 2019-07-21T23:44:46.000Z | 2022-03-11T13:29:11.000Z | joulescope/usb/impl_tools.py | rnestler/pyjoulescope | b9eff73d2236e05d5c3631dbd112c1ef54854005 | [
"Apache-2.0"
] | 9 | 2019-07-22T00:07:53.000Z | 2021-11-26T11:46:19.000Z | # Copyright 2018 Jetperch 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 writing,... | 29.86 | 108 | 0.671132 |
4a12aa430bf65095e06d564ef615c6c7db316999 | 3,632 | py | Python | python/archive/calculate_dist_mat_casia1.py | adi-nawal/Iris-Recognition | 1cec1471776e0b023e6629ea2e9fedf8ae659354 | [
"MIT"
] | 87 | 2019-09-20T07:04:38.000Z | 2022-03-26T17:23:34.000Z | python/archive/calculate_dist_mat_casia1.py | adi-nawal/Iris-Recognition | 1cec1471776e0b023e6629ea2e9fedf8ae659354 | [
"MIT"
] | 14 | 2019-10-07T00:27:14.000Z | 2022-03-11T23:33:40.000Z | python/archive/calculate_dist_mat_casia1.py | adi-nawal/Iris-Recognition | 1cec1471776e0b023e6629ea2e9fedf8ae659354 | [
"MIT"
] | 64 | 2019-09-04T16:08:25.000Z | 2022-03-31T16:10:32.000Z | #------------------------------------------------------------------------------
# Libraries
#------------------------------------------------------------------------------
import os
import numpy as np
from glob import glob
from tqdm import tqdm
from time import time
from random import shuffle
from matplotlib import pyp... | 31.310345 | 79 | 0.55837 |
4a12ab1590b558f2e86b82c7dee579e895eb60eb | 11,047 | py | Python | google/cloud/aiplatform_v1beta1/types/machine_resources.py | lclc19/python-aiplatform | d8da2e365277441abadb04328943f23345d72b0e | [
"Apache-2.0"
] | 180 | 2020-09-23T17:21:15.000Z | 2022-03-30T17:25:47.000Z | google/cloud/aiplatform_v1beta1/types/machine_resources.py | lclc19/python-aiplatform | d8da2e365277441abadb04328943f23345d72b0e | [
"Apache-2.0"
] | 601 | 2020-09-23T16:23:44.000Z | 2022-03-31T19:08:23.000Z | google/cloud/aiplatform_v1beta1/types/machine_resources.py | lclc19/python-aiplatform | d8da2e365277441abadb04328943f23345d72b0e | [
"Apache-2.0"
] | 109 | 2020-09-23T16:22:04.000Z | 2022-03-28T21:18:29.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 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... | 42.164122 | 117 | 0.673214 |
4a12ab7988633ca171a82f4d01b00d40a3d40824 | 83,356 | py | Python | gnocchi/tests/test_rest.py | lamby/gnocchi | 87928a7c92d46b31bf0e8333064a4d0b83e6131b | [
"Apache-2.0"
] | null | null | null | gnocchi/tests/test_rest.py | lamby/gnocchi | 87928a7c92d46b31bf0e8333064a4d0b83e6131b | [
"Apache-2.0"
] | null | null | null | gnocchi/tests/test_rest.py | lamby/gnocchi | 87928a7c92d46b31bf0e8333064a4d0b83e6131b | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
#
# Copyright © 2016 Red Hat, Inc.
# Copyright © 2014-2015 eNovance
#
# 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... | 42.441955 | 79 | 0.506514 |
4a12ab8f0277315afbd8851957438ff030e943d2 | 2,156 | py | Python | get_image.py | SecurityQQ/QR_Bot | 231aa2194ddd66ca50c1442acab61dcbde2a7924 | [
"MIT"
] | 6 | 2017-10-16T20:39:33.000Z | 2020-12-05T07:58:19.000Z | get_image.py | SecurityQQ/QR_Bot | 231aa2194ddd66ca50c1442acab61dcbde2a7924 | [
"MIT"
] | null | null | null | get_image.py | SecurityQQ/QR_Bot | 231aa2194ddd66ca50c1442acab61dcbde2a7924 | [
"MIT"
] | 1 | 2021-09-11T19:37:29.000Z | 2021-09-11T19:37:29.000Z | import requests as r
import re
import json
import os
from random import choice
AVAILABLE_FORMATS = ['png', 'jpg', 'jpeg', 'bmp']
BING_TOKEN = os.environ.get('BING_TOKEN', '63b3ee16a46847e0be92920dd1409024')
def get_images_urls(name):
s = r.get("https://api.cognitive.microsoft.com/bing/v7.0/images/search/?q={}".f... | 27.291139 | 95 | 0.628942 |
4a12abb634dbfb740f595bd1b1481ea292b86722 | 945 | py | Python | bsl_inst/bsl_lib/_bsl_inst_info_class.py | BioSensorsLab-Illinois/bsl_inst_control | cf41d6a7d41bf6fc05b9d4195e809771cb25354c | [
"MIT"
] | null | null | null | bsl_inst/bsl_lib/_bsl_inst_info_class.py | BioSensorsLab-Illinois/bsl_inst_control | cf41d6a7d41bf6fc05b9d4195e809771cb25354c | [
"MIT"
] | null | null | null | bsl_inst/bsl_lib/_bsl_inst_info_class.py | BioSensorsLab-Illinois/bsl_inst_control | cf41d6a7d41bf6fc05b9d4195e809771cb25354c | [
"MIT"
] | null | null | null | class bsl_inst_info_class:
def __init__(self, *, MANUFACTURE:str="N/A", MODEL:str="N/A", TYPE:str="N/A", INTERFACE:str="Serial", BAUDRATE:int=0, SERIAL_NAME:str="N/A", USB_PID:str="0x9999", USB_VID:str="0x9999", QUERY_CMD:str="N/A", QUERY_E_RESP:str="N/A", SN_REG=".*", QUERY_SN_CMD=""):
self.MANUFACTURE ... | 63 | 264 | 0.477249 |
4a12ac0f59722163b5324d67eb7452d0fe18953b | 3,159 | py | Python | utils/test_policy.py | YunjaeChoi/Gain-Risk_Framework_for_Stabilization_of_Deep_Policy_Gradient_Optimization | 68d3f8fca6c6e6b356261f568f0d8562242fa649 | [
"MIT"
] | null | null | null | utils/test_policy.py | YunjaeChoi/Gain-Risk_Framework_for_Stabilization_of_Deep_Policy_Gradient_Optimization | 68d3f8fca6c6e6b356261f568f0d8562242fa649 | [
"MIT"
] | null | null | null | utils/test_policy.py | YunjaeChoi/Gain-Risk_Framework_for_Stabilization_of_Deep_Policy_Gradient_Optimization | 68d3f8fca6c6e6b356261f568f0d8562242fa649 | [
"MIT"
] | null | null | null | import time
import joblib
import os
import os.path as osp
import tensorflow as tf
from .logx import restore_tf_graph, EpochLogger
def load_policy(fpath, itr='last', deterministic=False):
# handle which epoch to load from
if itr=='last':
saves = [int(x[11:]) for x in os.listdir(fpath) if 'simple_save' ... | 35.1 | 92 | 0.616334 |
4a12ac6abc9667f1d68c053c40cc1a3f01a84393 | 5,607 | py | Python | training/transformer/model/attention_layer.py | DCGM/pero-enhance | 3a322e16946408e541bad9f75bc498d66e93dbd8 | [
"BSD-3-Clause"
] | 5 | 2020-06-07T18:34:55.000Z | 2022-01-17T03:14:26.000Z | training/transformer/model/attention_layer.py | DCGM/pero-enhance | 3a322e16946408e541bad9f75bc498d66e93dbd8 | [
"BSD-3-Clause"
] | 16 | 2020-01-28T22:22:10.000Z | 2022-03-12T00:10:37.000Z | training/transformer/model/attention_layer.py | DCGM/pero-enhance | 3a322e16946408e541bad9f75bc498d66e93dbd8 | [
"BSD-3-Clause"
] | null | null | null | # 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
#
# Unless required by applica... | 37.38 | 82 | 0.675406 |
4a12ad83e36702f2c54e9ce6c71b3b070d74d7b0 | 4,092 | py | Python | tests2/testutils.py | PMR2/pyodbc | aa52358a1330e74b97a5684d772739cc14620c6d | [
"MIT-0"
] | 1 | 2020-11-06T02:23:35.000Z | 2020-11-06T02:23:35.000Z | tests2/testutils.py | mx-psi/pyodbc | 90cf98cc945738113f3cc572c06304c79bc134a8 | [
"MIT-0"
] | 1 | 2021-09-01T15:05:42.000Z | 2021-09-01T15:05:42.000Z | tests2/testutils.py | mx-psi/pyodbc | 90cf98cc945738113f3cc572c06304c79bc134a8 | [
"MIT-0"
] | 2 | 2020-11-21T08:23:46.000Z | 2020-11-21T08:32:41.000Z | from __future__ import print_function
import os, sys, platform
from os.path import join, dirname, abspath, basename
import unittest
def add_to_path():
"""
Prepends the build directory to the path so that newly built pyodbc libraries are used, allowing it to be tested
without installing it.
"... | 34.677966 | 117 | 0.606549 |
4a12ae1ec1ddcfe7049198513df564ffbbdb8089 | 8,811 | py | Python | agp/split.py | esrice/agptools | f91dbad20db539f4cc9731606978cb4369ea650f | [
"MIT"
] | 1 | 2021-12-28T01:44:20.000Z | 2021-12-28T01:44:20.000Z | agp/split.py | esrice/agptools | f91dbad20db539f4cc9731606978cb4369ea650f | [
"MIT"
] | 2 | 2021-12-16T16:35:21.000Z | 2022-03-17T07:45:16.000Z | agp/split.py | esrice/agptools | f91dbad20db539f4cc9731606978cb4369ea650f | [
"MIT"
] | null | null | null | """
Functions for splitting a scaffold into subscaffolds at gaps.
"""
from copy import deepcopy
from typing import Dict, Iterator, List, TextIO, Union
from . import AgpRow
class ParsingError(Exception):
"""Raised when breakpoints file is misformatted."""
pass
def breakpoints_type(filename: str) -> Dict[s... | 37.021008 | 85 | 0.625468 |
4a12ae5bc3b7bcf03cc3d8eed46e0b5f5dc31280 | 3,863 | py | Python | pyle38/commands/search.py | iwpnd/pyle38 | d2d6fa4e11b7444ed97df9152ee8e0a9dd0952d7 | [
"MIT"
] | 44 | 2021-04-08T07:06:19.000Z | 2022-02-16T15:06:05.000Z | pyle38/commands/search.py | iwpnd/pyle38 | d2d6fa4e11b7444ed97df9152ee8e0a9dd0952d7 | [
"MIT"
] | 50 | 2021-04-19T10:03:12.000Z | 2022-03-03T16:13:50.000Z | pyle38/commands/search.py | iwpnd/pyle38 | d2d6fa4e11b7444ed97df9152ee8e0a9dd0952d7 | [
"MIT"
] | 4 | 2021-04-29T08:20:21.000Z | 2022-03-12T07:28:19.000Z | from __future__ import annotations
from typing import List, Literal, Optional, Sequence, Union
from ..client import Client, Command, CommandArgs, SubCommand
from ..models import Options
from ..responses import CountResponse, IdsResponse, ObjectsResponse
from .executable import Compiled, Executable
Format = Literal["... | 25.926174 | 78 | 0.552679 |
4a12aeb6bf856ef1d92fc49bd95f1a4b2fbe6b14 | 952 | py | Python | build/lib.linux-x86_64-2.7_ucs4/mx/Tools/mxTools/bench1.py | mkubux/egenix-mx-base | 3e6f9186334d9d73743b0219ae857564c7208247 | [
"eGenix"
] | null | null | null | build/lib.linux-x86_64-2.7_ucs4/mx/Tools/mxTools/bench1.py | mkubux/egenix-mx-base | 3e6f9186334d9d73743b0219ae857564c7208247 | [
"eGenix"
] | null | null | null | build/lib.linux-x86_64-2.7_ucs4/mx/Tools/mxTools/bench1.py | mkubux/egenix-mx-base | 3e6f9186334d9d73743b0219ae857564c7208247 | [
"eGenix"
] | null | null | null | import hack
import mx.Tools.NewBuiltins
k = range(10000)
l = range(1,10001)
loops = trange(100)
def f(k=k,l=l,tuples=tuples,loops=loops):
for i in loops:
for a,b in tuples(k,l):
pass
def f1(k=k,l=l,lists=lists,loops=loops):
for i in loops:
for a,b in lists(k,l):
pass
... | 21.155556 | 54 | 0.566176 |
4a12afbec3c77803cdcccd4f26416a8f959fb9d8 | 2,193 | py | Python | Python 3/Olimpiada_2020/Preparacion/recuento_votos.py | DarkShadow4/python | 4cd94e0cf53ee06c9c31e9272572ca9656697c30 | [
"MIT"
] | null | null | null | Python 3/Olimpiada_2020/Preparacion/recuento_votos.py | DarkShadow4/python | 4cd94e0cf53ee06c9c31e9272572ca9656697c30 | [
"MIT"
] | null | null | null | Python 3/Olimpiada_2020/Preparacion/recuento_votos.py | DarkShadow4/python | 4cd94e0cf53ee06c9c31e9272572ca9656697c30 | [
"MIT"
] | 1 | 2020-08-19T17:25:22.000Z | 2020-08-19T17:25:22.000Z | import sys
def get_points(papeleta, candidates, p, n):
papeleta = papeleta.split()
papeleta = [int(points) for points in papeleta]
if sorted(papeleta) == [i for i in range(1,n+1)]:
candidate_names = [name for name in candidates.keys()]
for c in range(n):
candidates[candidate_na... | 43.86 | 147 | 0.582763 |
4a12b01053336a8bf960cc6b48ef7c42524e984b | 8,623 | py | Python | tests/backends/fock/pure/test_gates.py | antalszava/piquasso | 7ebff83145cfab44929114437c250852dff5f9a5 | [
"Apache-2.0"
] | 12 | 2021-09-12T15:51:45.000Z | 2022-03-05T22:25:47.000Z | tests/backends/fock/pure/test_gates.py | antalszava/piquasso | 7ebff83145cfab44929114437c250852dff5f9a5 | [
"Apache-2.0"
] | 36 | 2021-09-13T08:01:27.000Z | 2022-03-21T11:53:30.000Z | tests/backends/fock/pure/test_gates.py | antalszava/piquasso | 7ebff83145cfab44929114437c250852dff5f9a5 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2021 Budapest Quantum Computing Group
#
# 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... | 28.839465 | 86 | 0.608025 |
4a12b0ca3239125b1220611c1251081023693218 | 1,940 | py | Python | eventsourcing/application/django.py | bartboy011/eventsourcing | f7ffebb86120f12d04d21d6dcb1dd24a8e233ea9 | [
"BSD-3-Clause"
] | 1 | 2020-07-31T10:15:33.000Z | 2020-07-31T10:15:33.000Z | eventsourcing/application/django.py | bartboy011/eventsourcing | f7ffebb86120f12d04d21d6dcb1dd24a8e233ea9 | [
"BSD-3-Clause"
] | null | null | null | eventsourcing/application/django.py | bartboy011/eventsourcing | f7ffebb86120f12d04d21d6dcb1dd24a8e233ea9 | [
"BSD-3-Clause"
] | null | null | null | from typing import Any
from eventsourcing.application.simple import ApplicationWithConcreteInfrastructure
from eventsourcing.infrastructure.django.factory import DjangoInfrastructureFactory
from eventsourcing.infrastructure.django.utils import (
close_django_connection,
setup_django,
)
class DjangoApplicatio... | 35.272727 | 85 | 0.72732 |
4a12b0d10ef38e140e8c1bee2c3beacd4e365ecf | 10,054 | py | Python | torch/nn/modules/upsampling.py | wenhaopeter/read_pytorch_code | 491f989cd918cf08874dd4f671fb7f0142a0bc4f | [
"Intel",
"X11"
] | 40 | 2021-06-01T07:37:59.000Z | 2022-03-25T01:42:09.000Z | torch/nn/modules/upsampling.py | wenhaopeter/read_pytorch_code | 491f989cd918cf08874dd4f671fb7f0142a0bc4f | [
"Intel",
"X11"
] | 14 | 2021-06-01T11:52:46.000Z | 2022-03-25T02:13:08.000Z | torch/nn/modules/upsampling.py | wenhaopeter/read_pytorch_code | 491f989cd918cf08874dd4f671fb7f0142a0bc4f | [
"Intel",
"X11"
] | 7 | 2021-07-20T19:34:26.000Z | 2022-03-13T21:07:36.000Z | from .module import Module
from .. import functional as F
from torch import Tensor
from typing import Optional
from ..common_types import _size_2_t, _ratio_2_t, _size_any_t, _ratio_any_t
class Upsample(Module):
r"""Upsamples a given multi-channel 1D (temporal), 2D (spatial) or 3D (volumetric) data.
The inpu... | 41.717842 | 113 | 0.553809 |
4a12b25cd928dc7468781de16536208cef97cf3c | 6,415 | py | Python | selfdrive/car/hyundai/hyundaican.py | agegold/OPKR080Hoya | 17434ef0c2a2dd8463afbc2ac38bc7b4b66dcfe6 | [
"MIT"
] | null | null | null | selfdrive/car/hyundai/hyundaican.py | agegold/OPKR080Hoya | 17434ef0c2a2dd8463afbc2ac38bc7b4b66dcfe6 | [
"MIT"
] | null | null | null | selfdrive/car/hyundai/hyundaican.py | agegold/OPKR080Hoya | 17434ef0c2a2dd8463afbc2ac38bc7b4b66dcfe6 | [
"MIT"
] | null | null | null | import copy
import crcmod
from common.params import Params
from selfdrive.car.hyundai.values import CAR, CHECKSUM
hyundai_checksum = crcmod.mkCrcFun(0x11D, initCrc=0xFD, rev=False, xorOut=0xdf)
def create_lkas11(packer, frame, car_fingerprint, apply_steer, steer_req,
lkas11, sys_warning, sys_state... | 34.304813 | 179 | 0.696493 |
4a12b268d88cad9c95eebd209a861781f409b24e | 7,572 | py | Python | sdk/python/pulumi_aws/licensemanager/license_configuration.py | dixler/pulumi-aws | 88838ed6d412c092717a916b0b5b154f68226c3a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/licensemanager/license_configuration.py | dixler/pulumi-aws | 88838ed6d412c092717a916b0b5b154f68226c3a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/licensemanager/license_configuration.py | dixler/pulumi-aws | 88838ed6d412c092717a916b0b5b154f68226c3a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class Licens... | 54.47482 | 238 | 0.698494 |
4a12b296a6a308d56645ed9f9ef4d92f9cfd7a86 | 1,226 | py | Python | Windows/data/saves/GetInfo.py | Platingamer42/DigitRecognition | b42b0e79db90d198e72fc5f15c4bd730b6386671 | [
"Apache-2.0"
] | null | null | null | Windows/data/saves/GetInfo.py | Platingamer42/DigitRecognition | b42b0e79db90d198e72fc5f15c4bd730b6386671 | [
"Apache-2.0"
] | null | null | null | Windows/data/saves/GetInfo.py | Platingamer42/DigitRecognition | b42b0e79db90d198e72fc5f15c4bd730b6386671 | [
"Apache-2.0"
] | null | null | null | from keras import models
import os, gzip, pickle
if __name__ == "__main__":
model_arr = []
model_cnn = []
f = gzip.open("../datasets/mnist.pkl.gz", "rb")
train_images, train_labels, test_images, test_labels = pickle.load(f, encoding="latin1")
for file in os.listdir():
if "... | 29.190476 | 92 | 0.539152 |
4a12b2998f5de37ec15d92322af0357f6ee3bf0c | 1,567 | py | Python | ryu/lib/of_config/__init__.py | w180112/ryu | aadb6609f585c287b4928db9462baf72c6410718 | [
"Apache-2.0"
] | 975 | 2015-01-03T02:30:13.000Z | 2020-05-07T14:01:48.000Z | ryu/lib/of_config/__init__.py | DiegoRossiMafioletti/ryu | 6f906e72c92e10bd0264c9b91a2f7bb85b97780c | [
"Apache-2.0"
] | 66 | 2020-05-22T21:55:42.000Z | 2022-03-31T12:35:04.000Z | ryu/lib/of_config/__init__.py | DiegoRossiMafioletti/ryu | 6f906e72c92e10bd0264c9b91a2f7bb85b97780c | [
"Apache-2.0"
] | 763 | 2015-01-01T03:38:43.000Z | 2020-05-06T15:46:09.000Z | # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013 Isaku Yamahata <yamahata at private email ne jp>
#
# 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
#
# h... | 29.566038 | 73 | 0.734525 |
4a12b3228de8289832c6fb5012e3fca79f7f482d | 6,405 | py | Python | jobs/domain/system/etl_job_base.py | helpthx/pyspark_example_project_template | 2865bdb2712f480bd468b6c0a0f6b1ea094f42c5 | [
"CNRI-Python"
] | 1 | 2021-10-20T16:41:24.000Z | 2021-10-20T16:41:24.000Z | jobs/domain/system/etl_job_base.py | helpthx/pyspark_example_project_template | 2865bdb2712f480bd468b6c0a0f6b1ea094f42c5 | [
"CNRI-Python"
] | null | null | null | jobs/domain/system/etl_job_base.py | helpthx/pyspark_example_project_template | 2865bdb2712f480bd468b6c0a0f6b1ea094f42c5 | [
"CNRI-Python"
] | null | null | null | """
etl_job_base.py
~~~~~~~~~~
This Python module contains an example Apache Spark ETL job definition
that implements best practices for production ETL jobs. It can be
submitted to a Spark cluster (or locally) using the 'spark-submit'
command found in the '/bin' directory of all Spark distributions
(necessary for runn... | 30.942029 | 111 | 0.676659 |
4a12b389eaa7f3b4974a8c8f6039356f2bfaba55 | 606 | py | Python | converter/video/migrations/0002_alter_videoraw_req_format.py | HosseinMirjalali/converter-task | c9b7a9682d7f3acea5903c4b5edcba56a41a618b | [
"MIT"
] | null | null | null | converter/video/migrations/0002_alter_videoraw_req_format.py | HosseinMirjalali/converter-task | c9b7a9682d7f3acea5903c4b5edcba56a41a618b | [
"MIT"
] | 10 | 2021-12-30T04:33:52.000Z | 2022-03-31T04:28:36.000Z | converter/video/migrations/0002_alter_videoraw_req_format.py | HosseinMirjalali/converter-task | c9b7a9682d7f3acea5903c4b5edcba56a41a618b | [
"MIT"
] | null | null | null | # Generated by Django 3.2.10 on 2021-12-28 21:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('video', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='videoraw',
name='req_format',
... | 31.894737 | 276 | 0.617162 |
4a12b39b8c83832d8260bcb13530a71b014a6d79 | 1,391 | py | Python | Dictionary/dictionary.py | edwarddevp/python-learning | 6f849c5a7c296ba3cf3ea79cd21d0429ca91ad59 | [
"MIT"
] | null | null | null | Dictionary/dictionary.py | edwarddevp/python-learning | 6f849c5a7c296ba3cf3ea79cd21d0429ca91ad59 | [
"MIT"
] | null | null | null | Dictionary/dictionary.py | edwarddevp/python-learning | 6f849c5a7c296ba3cf3ea79cd21d0429ca91ad59 | [
"MIT"
] | null | null | null | import json
from difflib import get_close_matches
data = json.load(open("data.json"))
print()
def find_definition(word):
if word.lower() in data:
print_definitions(word, data[word.lower()])
elif word.upper() in data:
print_definitions(word, data[word.upper()])
elif word.title() in data:
... | 30.911111 | 89 | 0.60532 |
4a12b3e16599cb2dc972cf958a1d04f9852a88f6 | 5,460 | py | Python | library/panos_zone.py | rvichery/ansible-pan | d07839cd5a544a6398646c01e1edac0f0f82cc38 | [
"Apache-2.0"
] | null | null | null | library/panos_zone.py | rvichery/ansible-pan | d07839cd5a544a6398646c01e1edac0f0f82cc38 | [
"Apache-2.0"
] | null | null | null | library/panos_zone.py | rvichery/ansible-pan | d07839cd5a544a6398646c01e1edac0f0f82cc38 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function
__metaclass__ = type
# Copyright 2018 Palo Alto Networks, 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... | 28.14433 | 105 | 0.643956 |
4a12b3ffd0cfdf79a96bedcb9f6960f563a44e55 | 5,072 | py | Python | src/textual/events.py | ramiro/textual | a6a912ab2713b0e1cb668224f7a38f31b1c9939c | [
"MIT"
] | null | null | null | src/textual/events.py | ramiro/textual | a6a912ab2713b0e1cb668224f7a38f31b1c9939c | [
"MIT"
] | null | null | null | src/textual/events.py | ramiro/textual | a6a912ab2713b0e1cb668224f7a38f31b1c9939c | [
"MIT"
] | null | null | null | from __future__ import annotations
from typing import TYPE_CHECKING
from rich.repr import rich_repr, RichReprResult
from .message import Message
from ._types import MessageTarget
from .keys import Keys
if TYPE_CHECKING:
from ._timer import Timer as TimerClass
from ._timer import TimerCallback
@rich_repr
... | 20.047431 | 79 | 0.608833 |
4a12b4e199d4840f4fe12c1f185d9d647f42963b | 3,923 | py | Python | src/rotest/core/result/handlers/stream/stream_handler.py | gregoil/rotest | c443bc1b99e02f047adfcab9943966f0023f652c | [
"MIT"
] | 26 | 2017-06-11T18:21:17.000Z | 2021-02-21T20:36:30.000Z | src/rotest/core/result/handlers/stream/stream_handler.py | gregoil/rotest | c443bc1b99e02f047adfcab9943966f0023f652c | [
"MIT"
] | 143 | 2017-06-29T11:18:35.000Z | 2021-06-10T17:23:46.000Z | src/rotest/core/result/handlers/stream/stream_handler.py | gregoil/rotest | c443bc1b99e02f047adfcab9943966f0023f652c | [
"MIT"
] | 11 | 2017-06-12T09:16:14.000Z | 2021-07-11T23:20:59.000Z | """Stream output handler."""
# pylint: disable=invalid-name,too-few-public-methods,arguments-differ
# pylint: disable=too-many-arguments,super-init-not-called
from __future__ import absolute_import
from rotest.common.constants import GREEN, YELLOW, RED, BOLD, CYAN, BLUE
from rotest.core.result.handlers.stream.base_hand... | 32.155738 | 78 | 0.615345 |
4a12b4ee7e2becdd1e6f602c6d562b39517c04e3 | 3,984 | py | Python | python/assume_role_oidc_client_credentials.py | sequoiacapital/assume-role-oidc-client-credentials | cae5f3c85f4242cab30b4d7acfc77e30e8f34f7b | [
"MIT"
] | null | null | null | python/assume_role_oidc_client_credentials.py | sequoiacapital/assume-role-oidc-client-credentials | cae5f3c85f4242cab30b4d7acfc77e30e8f34f7b | [
"MIT"
] | null | null | null | python/assume_role_oidc_client_credentials.py | sequoiacapital/assume-role-oidc-client-credentials | cae5f3c85f4242cab30b4d7acfc77e30e8f34f7b | [
"MIT"
] | null | null | null | import requests
import base64
#from requests_toolbelt.utils import dump
import logging
from copy import deepcopy
from botocore.credentials import BaseAssumeRoleCredentialFetcher, CredentialProvider, AssumeRoleWithWebIdentityCredentialFetcher, DeferredRefreshableCredentials, Config, CredentialRetrievalError
from boto... | 36.218182 | 194 | 0.65261 |
4a12b606a042af8992100ed22efe9413e578f0ff | 1,727 | py | Python | jiraannouncer/views/travis.py | theunkn0wn1/JIRAAnnouncer | 75fa858f956f3b0d6b2f3dbe9feea979ad3d14c4 | [
"BSD-3-Clause"
] | null | null | null | jiraannouncer/views/travis.py | theunkn0wn1/JIRAAnnouncer | 75fa858f956f3b0d6b2f3dbe9feea979ad3d14c4 | [
"BSD-3-Clause"
] | null | null | null | jiraannouncer/views/travis.py | theunkn0wn1/JIRAAnnouncer | 75fa858f956f3b0d6b2f3dbe9feea979ad3d14c4 | [
"BSD-3-Clause"
] | null | null | null | import time
import simplejson
import urllib
from pyramid.view import view_config
from ..utils import logprint, send, getlast
OFFSET = 5
@view_config(route_name='travis', renderer="json")
def travis(request):
"""Handle TravisCI events"""
lastmessage = getlast()
data = request.body.decode('utf-8')
re... | 34.54 | 93 | 0.601621 |
4a12b6876675b95af350a2d03494abba987a59aa | 2,373 | py | Python | modoboa/admin/tests/test_repair.py | HarshCasper/modoboa | a00baa0593107992f545ee3e89cd4346b9615a96 | [
"0BSD"
] | 1,602 | 2016-12-15T14:25:34.000Z | 2022-03-31T16:49:25.000Z | modoboa/admin/tests/test_repair.py | sebageek/modoboa | 57f5d57ea60a57e8dcac970085dfc07082481fc6 | [
"0BSD"
] | 1,290 | 2016-12-14T15:39:05.000Z | 2022-03-31T13:49:09.000Z | modoboa/admin/tests/test_repair.py | sebageek/modoboa | 57f5d57ea60a57e8dcac970085dfc07082481fc6 | [
"0BSD"
] | 272 | 2016-12-22T11:58:18.000Z | 2022-03-17T15:57:24.000Z | """Repair command tests"""
from django.core import management
from modoboa.lib.permissions import ObjectAccess, get_object_owner
from modoboa.lib.tests import ModoTestCase
from .. import factories, models
class RepairTestCase(ModoTestCase):
"""TestCase for repair command."""
@classmethod
def setUpTestD... | 38.901639 | 79 | 0.655289 |
4a12b69464feba319f620289dd06e848d8555bc4 | 9,276 | py | Python | lib/galaxy/jobs/metrics/instrumenters/collectl.py | mmiladi/galaxy | 7857b152cd10d9490ac2433ff2905ca1a47ee32c | [
"CC-BY-3.0"
] | 4 | 2018-10-29T18:34:38.000Z | 2021-09-29T23:30:42.000Z | lib/galaxy/jobs/metrics/instrumenters/collectl.py | mmiladi/galaxy | 7857b152cd10d9490ac2433ff2905ca1a47ee32c | [
"CC-BY-3.0"
] | 1 | 2019-02-04T16:21:27.000Z | 2019-02-04T16:45:17.000Z | lib/galaxy/jobs/metrics/instrumenters/collectl.py | mmiladi/galaxy | 7857b152cd10d9490ac2433ff2905ca1a47ee32c | [
"CC-BY-3.0"
] | 3 | 2020-02-12T15:22:24.000Z | 2021-08-19T10:27:39.000Z | """The module describes the ``collectl`` job metrics plugin."""
import logging
import os
import shutil
from galaxy import util
from ..collectl import (
cli,
processes,
subsystems
)
from ..instrumenters import InstrumentPlugin
from ...metrics import formatting
log = logging.getLogger(__name__)
# By defau... | 42.163636 | 143 | 0.674105 |
4a12b7e77c47148c082ae9e8ce25f2f06223827a | 616 | py | Python | Final_Project/top_ten_tags/reducer_top_ten_tags.py | saturator22/hadoop-mapreduce-udacity | 28bcf82985d96ce967137df9b2da7a3c1ff4d69e | [
"MIT"
] | null | null | null | Final_Project/top_ten_tags/reducer_top_ten_tags.py | saturator22/hadoop-mapreduce-udacity | 28bcf82985d96ce967137df9b2da7a3c1ff4d69e | [
"MIT"
] | null | null | null | Final_Project/top_ten_tags/reducer_top_ten_tags.py | saturator22/hadoop-mapreduce-udacity | 28bcf82985d96ce967137df9b2da7a3c1ff4d69e | [
"MIT"
] | null | null | null | #!/usr/bin/python
import sys
import csv
def reducer():
reader = csv.reader(sys.stdin, delimiter='\t')
writer = csv.writer(sys.stdout, delimiter='\t')
tagFrequency = {}
for line in reader:
tag = line[0]
tagOccurance = int(line[1])
if tag not in tagFrequency:
tagFre... | 20.533333 | 71 | 0.592532 |
4a12b7ffb7ad0ec8a47b41a4dacac3095081f72a | 2,570 | py | Python | pyaam/texture.py | zangkaiqiang/pyaam | 3c59026df17fb0b4588797026d5a2fe64d05fca9 | [
"MIT"
] | 2 | 2020-07-06T18:18:25.000Z | 2021-01-20T08:05:21.000Z | pyaam/texture.py | zangkaiqiang/pyaam | 3c59026df17fb0b4588797026d5a2fe64d05fca9 | [
"MIT"
] | null | null | null | pyaam/texture.py | zangkaiqiang/pyaam | 3c59026df17fb0b4588797026d5a2fe64d05fca9 | [
"MIT"
] | 3 | 2021-01-11T07:16:42.000Z | 2021-07-28T11:37:01.000Z | # coding: utf-8
from __future__ import division
import cv2
import numpy as np
from pyaam.texturemapper import TextureMapper
from pyaam.utils import get_mask, get_aabb, get_vertices, normalize, pca
class TextureModel(object):
def __init__(self, model, mean, variance):
self.model = model
self.mea... | 30.235294 | 84 | 0.581323 |
4a12b872bdc3cb279509b56d3ffc109da53660cd | 7,858 | py | Python | homeassistant/components/mysensors/climate.py | aschor/core | eb2238a9e1c67ee926a40ab85fe13ba37f2c538d | [
"Apache-2.0"
] | 22,481 | 2020-03-02T13:09:59.000Z | 2022-03-31T23:34:28.000Z | homeassistant/components/mysensors/climate.py | aschor/core | eb2238a9e1c67ee926a40ab85fe13ba37f2c538d | [
"Apache-2.0"
] | 31,101 | 2020-03-02T13:00:16.000Z | 2022-03-31T23:57:36.000Z | homeassistant/components/mysensors/climate.py | aschor/core | eb2238a9e1c67ee926a40ab85fe13ba37f2c538d | [
"Apache-2.0"
] | 11,411 | 2020-03-02T14:19:20.000Z | 2022-03-31T22:46:07.000Z | """MySensors platform that offers a Climate (MySensors-HVAC) component."""
from __future__ import annotations
from typing import Any
from homeassistant.components import mysensors
from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.const import (
ATTR_TARGET_TEMP_HIGH,... | 35.080357 | 85 | 0.651184 |
4a12b8952bda57afc824c275be7abbfc12c4ab8f | 719 | py | Python | benchmarking/regression_detectors/regression_detector_base.py | virtan/FAI-PEP | 8641a54b2328c343ab0470f195a42da1021d1392 | [
"Apache-2.0"
] | 1 | 2022-03-21T06:39:38.000Z | 2022-03-21T06:39:38.000Z | benchmarking/regression_detectors/regression_detector_base.py | virtan/FAI-PEP | 8641a54b2328c343ab0470f195a42da1021d1392 | [
"Apache-2.0"
] | 1 | 2021-04-19T09:50:14.000Z | 2021-04-19T09:50:14.000Z | benchmarking/regression_detectors/regression_detector_base.py | isabella232/FAI-PEP | a4089c79ab765e7f05080348c2978a07c3487d4c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
##############################################################################
# Copyright 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
################################... | 29.958333 | 78 | 0.582754 |
4a12b8ba3b9eab9ea2d7e58f84a6dbee574f309a | 448 | py | Python | bou/constants.py | Feastybeast/bou | 6ea7d95cbc400fc1a0ebbad40fddad8c66717215 | [
"MIT"
] | null | null | null | bou/constants.py | Feastybeast/bou | 6ea7d95cbc400fc1a0ebbad40fddad8c66717215 | [
"MIT"
] | 2 | 2021-03-14T01:07:02.000Z | 2021-03-16T08:12:08.000Z | bou/constants.py | Feastybeast/bou | 6ea7d95cbc400fc1a0ebbad40fddad8c66717215 | [
"MIT"
] | null | null | null | """ bou.constants """
ASTERISK = '*'
BACK_SLASH = '\\'
BLANK = ''
DOUBLE_QUOTE = '"'
DOT_PY = '.py'
DOWNGRADE = 'downgrade'
FORWARD_SLASH = '/'
GT = '>'
INPUT = 'input'
LOCALTIME = 'localtime'
LT = '<'
MIGRATIONS_DEFAULT = 'migrations/'
NAME = 'name'
OUTPUT = 'output'
PIPE = '|'
QUESTION_MARK = '?'
Q... | 17.230769 | 35 | 0.580357 |
4a12b8e5302990f03d4138fe9762e59cddf33ce0 | 4,558 | py | Python | pinion/ui.py | dzarda/Pinion | fc5cc3bd6df0e7b434b41f0754a6861c52f87ae8 | [
"MIT"
] | null | null | null | pinion/ui.py | dzarda/Pinion | fc5cc3bd6df0e7b434b41f0754a6861c52f87ae8 | [
"MIT"
] | null | null | null | pinion/ui.py | dzarda/Pinion | fc5cc3bd6df0e7b434b41f0754a6861c52f87ae8 | [
"MIT"
] | null | null | null | import click
import csv
import io
from pinion import __version__
def splitStr(delimiter, escapeChar, s):
"""
Splits s based on delimiter that can be escaped via escapeChar
"""
# Let's use csv reader to implement this
reader = csv.reader(io.StringIO(s), delimiter=delimiter, escapechar=escapeChar)
... | 33.514706 | 85 | 0.664985 |
4a12b9b9a41c8b4a0ae1c82c1a33e3381a1339ac | 235 | py | Python | enshop/enshop/doctype/enshop_settings_banner/test_enshop_settings_banner.py | corioste/enshop | 9159ef7389873d9ec9c5188dbdbe2a03f8c3baad | [
"MIT"
] | null | null | null | enshop/enshop/doctype/enshop_settings_banner/test_enshop_settings_banner.py | corioste/enshop | 9159ef7389873d9ec9c5188dbdbe2a03f8c3baad | [
"MIT"
] | null | null | null | enshop/enshop/doctype/enshop_settings_banner/test_enshop_settings_banner.py | corioste/enshop | 9159ef7389873d9ec9c5188dbdbe2a03f8c3baad | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2021, Bai Web and Mobile Lab and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
import unittest
class TestEnshopSettingsBanner(unittest.TestCase):
pass
| 21.363636 | 61 | 0.770213 |
4a12ba1632867dd55eb2bf267cb97ec874c7157a | 1,002 | py | Python | projects/migrations/0001_initial.py | KamenSentai/Portfolio-Django | 93b73d14b469a948ac010cf9767e747c38d32f55 | [
"MIT"
] | null | null | null | projects/migrations/0001_initial.py | KamenSentai/Portfolio-Django | 93b73d14b469a948ac010cf9767e747c38d32f55 | [
"MIT"
] | 14 | 2020-02-12T00:23:46.000Z | 2022-03-11T23:48:23.000Z | projects/migrations/0001_initial.py | KamenSentai/Portfolio-Django | 93b73d14b469a948ac010cf9767e747c38d32f55 | [
"MIT"
] | null | null | null | # Generated by Django 2.2 on 2019-05-27 19:04
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Image',
fields=[
('id', models.AutoField(auto... | 30.363636 | 114 | 0.547904 |
4a12bbdef5ca7dd25e9e87ce2b49c448b2a0d2b9 | 1,975 | py | Python | autoPyTorch/pipeline/components/setup/augmentation/image/RandomCutout.py | LMZimmer/Auto-PyTorch_refactor | ac7a9ce35e87a428caca2ac108b362a54d3b8f3a | [
"Apache-2.0"
] | null | null | null | autoPyTorch/pipeline/components/setup/augmentation/image/RandomCutout.py | LMZimmer/Auto-PyTorch_refactor | ac7a9ce35e87a428caca2ac108b362a54d3b8f3a | [
"Apache-2.0"
] | 34 | 2020-10-06T08:06:46.000Z | 2021-01-21T13:23:34.000Z | autoPyTorch/pipeline/components/setup/augmentation/image/RandomCutout.py | LMZimmer/Auto-PyTorch_refactor | ac7a9ce35e87a428caca2ac108b362a54d3b8f3a | [
"Apache-2.0"
] | 1 | 2020-10-14T12:25:47.000Z | 2020-10-14T12:25:47.000Z | from typing import Any, Dict, Optional, Union
import ConfigSpace as CS
from ConfigSpace.configuration_space import ConfigurationSpace
from ConfigSpace.hyperparameters import (
CategoricalHyperparameter,
UniformFloatHyperparameter,
)
import imgaug.augmenters as iaa
from imgaug.augmenters.meta import Augmenter
... | 39.5 | 112 | 0.663797 |
4a12bdc416c6247fced9ee416e8da785df3bcf39 | 2,945 | py | Python | maskrcnn_benchmark/modeling/roi_heads/maskiou_head/roi_maskiou_feature_extractors.py | mrlooi/maskrcnn-benchmark | 135168ddda9436eead21fc945c192cffd8421e6a | [
"MIT"
] | 344 | 2019-08-29T09:08:11.000Z | 2022-03-16T08:37:42.000Z | maskrcnn_benchmark/modeling/roi_heads/maskiou_head/roi_maskiou_feature_extractors.py | mrlooi/maskrcnn-benchmark | 135168ddda9436eead21fc945c192cffd8421e6a | [
"MIT"
] | 46 | 2019-09-20T12:35:59.000Z | 2022-03-07T20:02:21.000Z | maskrcnn_benchmark/modeling/roi_heads/maskiou_head/roi_maskiou_feature_extractors.py | mrlooi/maskrcnn-benchmark | 135168ddda9436eead21fc945c192cffd8421e6a | [
"MIT"
] | 67 | 2019-08-29T09:56:31.000Z | 2022-03-12T13:47:02.000Z | # Mask Scoring R-CNN
# Wriiten by zhaojin.huang, 2018-12.
import torch
from torch import nn
from torch.nn import functional as F
from maskrcnn_benchmark.layers import Conv2d
from maskrcnn_benchmark.modeling.make_layers import make_conv3x3
from maskrcnn_benchmark.modeling.make_layers import make_fc
class MaskIoUFeat... | 35.914634 | 105 | 0.664856 |
4a12be9bbc9ae39da5714134e87e4ea367e84169 | 3,000 | py | Python | client/main.py | scz10/centerbot | 7805c7fd70f24148a54135ee86bca5c3a28c5332 | [
"MIT"
] | null | null | null | client/main.py | scz10/centerbot | 7805c7fd70f24148a54135ee86bca5c3a28c5332 | [
"MIT"
] | null | null | null | client/main.py | scz10/centerbot | 7805c7fd70f24148a54135ee86bca5c3a28c5332 | [
"MIT"
] | null | null | null | import cv2
import time
import random
import json
from paho.mqtt import client as mqtt_client
broker = 'broker.emqx.io'
port = 1883
topic = "XXXXXXXXX" # fill this with channel name you input on arduino code
client_id = f'python-mqtt-{random.randint(0, 1000)}'
def connect_mqtt():
def on_connect(client, userdata, ... | 27.777778 | 83 | 0.597667 |
4a12bf4615be3c68e6c039488724e03e0de1613c | 18,860 | py | Python | mesatee_services/acs/python/acs_engine.py | hshshjzsami/incubator-teaclave | 1a671e6e9fdb1f1bc2e1b4804ac2e516409bae63 | [
"Apache-2.0"
] | 1 | 2020-03-19T17:20:58.000Z | 2020-03-19T17:20:58.000Z | mesatee_services/acs/python/acs_engine.py | hshshjzsami/incubator-teaclave | 1a671e6e9fdb1f1bc2e1b4804ac2e516409bae63 | [
"Apache-2.0"
] | 1 | 2020-03-06T02:26:20.000Z | 2020-03-24T02:41:38.000Z | mesatee_services/acs/python/acs_engine.py | hshshjzsami/incubator-teaclave | 1a671e6e9fdb1f1bc2e1b4804ac2e516409bae63 | [
"Apache-2.0"
] | 1 | 2020-03-05T02:29:50.000Z | 2020-03-05T02:29:50.000Z | ###############################################################################
# Parser Combinators
###############################################################################
class Pair(tuple):
def __new__(cls, a, b):
return super(Pair, cls).__new__(cls, [a, b])
class Either(object):
def __init__... | 29.841772 | 97 | 0.585843 |
4a12bff149e147422347a63c544dfbbd4c5bc641 | 12,061 | py | Python | superset/config.py | eric-erki/Incubator-superset | 0ed66c9e02a8150b9f866332b4f43f6b058ca289 | [
"Apache-2.0"
] | null | null | null | superset/config.py | eric-erki/Incubator-superset | 0ed66c9e02a8150b9f866332b4f43f6b058ca289 | [
"Apache-2.0"
] | null | null | null | superset/config.py | eric-erki/Incubator-superset | 0ed66c9e02a8150b9f866332b4f43f6b058ca289 | [
"Apache-2.0"
] | null | null | null | """The main config file for Superset
All configuration in this file can be overridden by providing a superset_config
in your PYTHONPATH as there is a ``from superset_config import *``
at the end of this file.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_functi... | 33.31768 | 91 | 0.680623 |
4a12c0a1dea5aed04861b3b739a01406851c6b03 | 394 | py | Python | manage.py | mikenthiwa/dream_team | 81c85e2acac59ff91e3814b093b785ac311a04e4 | [
"MIT"
] | null | null | null | manage.py | mikenthiwa/dream_team | 81c85e2acac59ff91e3814b093b785ac311a04e4 | [
"MIT"
] | null | null | null | manage.py | mikenthiwa/dream_team | 81c85e2acac59ff91e3814b093b785ac311a04e4 | [
"MIT"
] | null | null | null | # manage.py
import os
from flask_script import Manager # class for handling a set of commands
from flask_migrate import Migrate, MigrateCommand
from app import db, create_app
from app import models
app = create_app(config_name=os.getenv('FLASK_CONFIG'))
migrate = Migrate(app, db)
manager = Manager(app)
manager.add_c... | 24.625 | 71 | 0.774112 |
4a12c0d4fc28b52f0d7e97523cb5a221bd31a1d2 | 5,886 | py | Python | server/tests/fixtures/database_fixtures.py | louisditzel/prefect | b1a02fee623b965e756a38aa09059db780ab67eb | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-05-10T14:32:32.000Z | 2020-05-10T14:32:32.000Z | server/tests/fixtures/database_fixtures.py | louisditzel/prefect | b1a02fee623b965e756a38aa09059db780ab67eb | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | server/tests/fixtures/database_fixtures.py | louisditzel/prefect | b1a02fee623b965e756a38aa09059db780ab67eb | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Licensed under the Prefect Community License, available at
# https://www.prefect.io/legal/prefect-community-license
import datetime
import inspect
import uuid
import warnings
from box import Box
import pendulum
import pytest
from asynctest import CoroutineMock
from click.testing import CliRunner
import prefect
im... | 28.028571 | 88 | 0.702345 |
4a12c15aee1d25fb04b2815550b5ffb7791bdd65 | 7,148 | py | Python | tests/tests.py | ehennenfent/tbas_python | 9d352e12cb4b1febed8304770b0fcaa058afcf55 | [
"Apache-2.0"
] | null | null | null | tests/tests.py | ehennenfent/tbas_python | 9d352e12cb4b1febed8304770b0fcaa058afcf55 | [
"Apache-2.0"
] | null | null | null | tests/tests.py | ehennenfent/tbas_python | 9d352e12cb4b1febed8304770b0fcaa058afcf55 | [
"Apache-2.0"
] | null | null | null | import unittest
from tbas.machine import Machine
class TestLanguage(unittest.TestCase):
def test_mptr_inc_dec(self):
m = Machine(program='+++>+++>+++>++++')
m.run()
self.assertEqual(3, m.mem_at(0))
self.assertEqual(3, m.mem_at(1))
self.assertEqual(3, m.mem_at(2))
s... | 30.160338 | 94 | 0.526861 |
4a12c1e640f5e84bee182093bfb1b6556ce5cfa7 | 51 | py | Python | CO_layers/__init__.py | cpinte/CO_layers | 1e1ea2ed3bd97e1a394e0345e9604905643fec95 | [
"MIT"
] | null | null | null | CO_layers/__init__.py | cpinte/CO_layers | 1e1ea2ed3bd97e1a394e0345e9604905643fec95 | [
"MIT"
] | null | null | null | CO_layers/__init__.py | cpinte/CO_layers | 1e1ea2ed3bd97e1a394e0345e9604905643fec95 | [
"MIT"
] | null | null | null | __version__ = "0.1"
from .measure_height import *
| 12.75 | 29 | 0.72549 |
4a12c3f05e13562c786fa87fefb7fb4a1734b92a | 1,695 | py | Python | contrastqg/dataloaders/.ipynb_checkpoints/__init__-checkpoint.py | thunlp/MetaAdaptRank | 5e80520b003b0a3a5fad817edf65cf76222438dd | [
"MIT"
] | 4 | 2021-05-30T09:34:45.000Z | 2021-09-07T02:46:01.000Z | contrastqg/dataloaders/.ipynb_checkpoints/__init__-checkpoint.py | thunlp/MetaAdaptRank | 5e80520b003b0a3a5fad817edf65cf76222438dd | [
"MIT"
] | null | null | null | contrastqg/dataloaders/.ipynb_checkpoints/__init__-checkpoint.py | thunlp/MetaAdaptRank | 5e80520b003b0a3a5fad817edf65cf76222438dd | [
"MIT"
] | 1 | 2021-07-26T01:51:11.000Z | 2021-07-26T01:51:11.000Z | def select_tokenizer(args):
if "t5" in args.pretrain_generator_type:
return T5_Tokenizer(args)
raise ValueError('Invalid generator class: %s' % args.pretrain_generator_type)
def select_data_loader(args):
if "train" in args.run_mode:
dataloder_dict = {"train_dataset":train_generate... | 39.418605 | 116 | 0.721534 |
4a12c40fca0c1cb3172dde6e8aa3b8f761b5467d | 314 | py | Python | hackerrank/algorithms/strings/easy/making_anagrams/py/solution.py | lilsweetcaligula/Online-Judges | 48454a8e6b5b86f80e89eca1b396480df8960cfd | [
"MIT"
] | null | null | null | hackerrank/algorithms/strings/easy/making_anagrams/py/solution.py | lilsweetcaligula/Online-Judges | 48454a8e6b5b86f80e89eca1b396480df8960cfd | [
"MIT"
] | null | null | null | hackerrank/algorithms/strings/easy/making_anagrams/py/solution.py | lilsweetcaligula/Online-Judges | 48454a8e6b5b86f80e89eca1b396480df8960cfd | [
"MIT"
] | null | null | null | def solution(s, t):
import collections
import itertools
cs = collections.Counter(s)
ct = collections.Counter(t)
count = 0
for c in set(itertools.chain(s, t)):
count += abs(cs[c] - ct[c])
return count
s = input().strip()
t = input().strip()
c = solution(s, t)
print(c)
| 15.7 | 40 | 0.579618 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.