hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f70154ae8605b52640bf200ccaaa8bf6ad001bf5 | 1,106 | py | Python | Module3/assignment2.py | dipdeb/DAT210x | 9103844fa7f76052bdcc5a4ec60e8afbc91a9f6b | [
"MIT"
] | null | null | null | Module3/assignment2.py | dipdeb/DAT210x | 9103844fa7f76052bdcc5a4ec60e8afbc91a9f6b | [
"MIT"
] | null | null | null | Module3/assignment2.py | dipdeb/DAT210x | 9103844fa7f76052bdcc5a4ec60e8afbc91a9f6b | [
"MIT"
] | null | null | null | import pandas as pd
import matplotlib.pyplot as plt
import matplotlib
# Look pretty...
# matplotlib.style.use('ggplot')
plt.style.use('ggplot')
#
# TODO: Load up the Seeds Dataset into a Dataframe
# It's located at 'Datasets/wheat.data'
#
wheat_df = pd.read_csv('/home/dipanjan/DAT210x/Module3/Datasets/wheat.data', ... | 22.571429 | 90 | 0.712477 | import pandas as pd
import matplotlib.pyplot as plt
import matplotlib
plt.style.use('ggplot')
#
wheat_df = pd.read_csv('/home/dipanjan/DAT210x/Module3/Datasets/wheat.data', index_col=0);
#
# TODO: Create a 2d scatter plot that graphs the
# area and perimeter features
#
# .. your code here ..
wheat_df.plot.s... | true | true |
f70155c72d7ad130cb57d825accdfa6901578200 | 4,547 | py | Python | scf/scf_utils.py | hongzhouye/sigma-SCF | 62e2dce538d1e68c4dc3c72fdf27beb1911e544f | [
"BSD-3-Clause"
] | 4 | 2016-07-30T22:02:50.000Z | 2018-08-02T23:46:15.000Z | scf/scf_utils.py | hongzhouye/sigma-SCF | 62e2dce538d1e68c4dc3c72fdf27beb1911e544f | [
"BSD-3-Clause"
] | 11 | 2017-08-04T20:34:04.000Z | 2017-08-08T23:07:42.000Z | scf/scf_utils.py | hongzhouye/sigma-SCF | 62e2dce538d1e68c4dc3c72fdf27beb1911e544f | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import os, sys
sys.path.append(os.path.dirname(__file__))
from diis_solver import diis_solver, diis_solver_uhf
sys.path.pop()
import jk
import xform
def homo_lumo_mix(C, nocc, beta):
"""
Mix a portion of LUMO to HOMO.
Used when generating spin-unrestricted guess.
"""
if beta < 0... | 25.982857 | 83 | 0.533978 | import numpy as np
import os, sys
sys.path.append(os.path.dirname(__file__))
from diis_solver import diis_solver, diis_solver_uhf
sys.path.pop()
import jk
import xform
def homo_lumo_mix(C, nocc, beta):
if beta < 0. or beta > 1.:
raise Exception("Mixing beta must be in [0, 1]")
Cb = C.copy()
homo =... | true | true |
f701560ac0a3a86c789a437ba0a2eed06d2ca194 | 1,250 | py | Python | tests/schema/test_schema.py | simonsobs/acondbs | 6ca11c2889d827ecdb2b54d0cf3b94b8cdd281e6 | [
"MIT"
] | null | null | null | tests/schema/test_schema.py | simonsobs/acondbs | 6ca11c2889d827ecdb2b54d0cf3b94b8cdd281e6 | [
"MIT"
] | 24 | 2020-04-02T19:29:07.000Z | 2022-03-08T03:05:43.000Z | tests/schema/test_schema.py | simonsobs/acondbs | 6ca11c2889d827ecdb2b54d0cf3b94b8cdd281e6 | [
"MIT"
] | 1 | 2020-04-08T15:48:28.000Z | 2020-04-08T15:48:28.000Z | import pytest
from .funcs import assert_query
QUERY = '''
{
__schema {
types {
kind
name
fields {
name
}
}
queryType {
fields {
name
}
}
mutationType {
fields {
name
}
}
subscriptionType {
fields {
name... | 18.656716 | 77 | 0.5896 | import pytest
from .funcs import assert_query
QUERY = '''
{
__schema {
types {
kind
name
fields {
name
}
}
queryType {
fields {
name
}
}
mutationType {
fields {
name
}
}
subscriptionType {
fields {
name... | true | true |
f70156a3a2fcf8fcc48c436b8d608cbe337dddd0 | 2,062 | py | Python | setup.py | hannes-holey/hans | 9604eedd70d54f3d4e2058fbc5b911e92e005e4f | [
"MIT"
] | 1 | 2022-02-03T09:31:24.000Z | 2022-02-03T09:31:24.000Z | setup.py | hannes-holey/hans | 9604eedd70d54f3d4e2058fbc5b911e92e005e4f | [
"MIT"
] | 6 | 2022-02-03T09:24:24.000Z | 2022-02-07T09:25:16.000Z | setup.py | hannes-holey/hans | 9604eedd70d54f3d4e2058fbc5b911e92e005e4f | [
"MIT"
] | null | null | null | """
MIT License
Copyright 2021 Hannes Holey
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, dist... | 38.185185 | 92 | 0.70805 |
from setuptools import setup, find_packages
with open("requirements.txt", "r") as fh:
requirements = [line.strip() for line in fh]
setup(name='hans',
description='Height-Averaged Navier-Stokes (HANS) solver for 2D lubrication problems',
author='Hannes Holey',
author_email='hannes.holey@kit.edu... | true | true |
f701581069cfd8be095c0662247dab35763588a4 | 4,161 | py | Python | tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_multilabel_recognition.py | APrigarina/open_model_zoo | b1ff98b64a6222cf6b5f3838dc0271422250de95 | [
"Apache-2.0"
] | 1,031 | 2020-07-16T08:30:57.000Z | 2022-03-30T19:42:52.000Z | tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_multilabel_recognition.py | APrigarina/open_model_zoo | b1ff98b64a6222cf6b5f3838dc0271422250de95 | [
"Apache-2.0"
] | 966 | 2020-07-16T08:13:00.000Z | 2022-03-31T18:09:18.000Z | tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_multilabel_recognition.py | APrigarina/open_model_zoo | b1ff98b64a6222cf6b5f3838dc0271422250de95 | [
"Apache-2.0"
] | 440 | 2020-07-16T12:52:50.000Z | 2022-03-31T14:21:41.000Z | """
Copyright (c) 2018-2021 Intel Corporation
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 wri... | 46.233333 | 113 | 0.670031 |
import numpy as np
from .format_converter import FileBasedAnnotationConverter, ConverterReturn
from ..representation import MultiLabelRecognitionAnnotation
from ..utils import read_xml, check_file_existence
from ..config import StringField, PathField, ConfigError
class CVATMultilabelAttributesRecognitionConverter(Fi... | true | true |
f701593506fcf4f739f92e926ff4b2ac42373413 | 15,435 | py | Python | bin/awscli/customizations/history/show.py | iilness2/bash-lambda-layer-custom | 0b054d4ccb0623460354ba1f58059258c095a494 | [
"MIT"
] | 399 | 2018-12-09T14:38:30.000Z | 2022-03-31T19:34:05.000Z | bin/awscli/customizations/history/show.py | iilness2/bash-lambda-layer-custom | 0b054d4ccb0623460354ba1f58059258c095a494 | [
"MIT"
] | 64 | 2018-12-10T01:34:46.000Z | 2022-01-13T14:04:34.000Z | bin/awscli/customizations/history/show.py | iilness2/bash-lambda-layer-custom | 0b054d4ccb0623460354ba1f58059258c095a494 | [
"MIT"
] | 80 | 2018-12-10T10:36:53.000Z | 2022-03-22T13:40:32.000Z | # Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acc... | 37.554745 | 79 | 0.586718 |
import datetime
import json
import sys
import xml.parsers.expat
import xml.dom.minidom
import colorama
from awscli.compat import six
from awscli.customizations.history.commands import HistorySubcommand
from awscli.customizations.history.filters import RegexFilter
class Formatter(object):
def __init_... | true | true |
f70159d65a5bfff918de93d5a0e04e7f23f300b0 | 1,711 | py | Python | Python/venv/lib/python3.7/site-packages/prometheus_client/platform_collector.py | HenriqueBuzin/TCC | 5fb9db42e97e28131bff97da3252a9ee33b3684e | [
"Unlicense"
] | 69 | 2019-02-18T12:07:35.000Z | 2022-03-12T10:38:32.000Z | Python/venv/lib/python3.7/site-packages/prometheus_client/platform_collector.py | HenriqueBuzin/TCC | 5fb9db42e97e28131bff97da3252a9ee33b3684e | [
"Unlicense"
] | 12 | 2018-12-06T22:06:49.000Z | 2022-02-25T17:40:44.000Z | Python/venv/lib/python3.7/site-packages/prometheus_client/platform_collector.py | HenriqueBuzin/TCC | 5fb9db42e97e28131bff97da3252a9ee33b3684e | [
"Unlicense"
] | 28 | 2019-03-22T01:07:13.000Z | 2022-02-21T16:38:27.000Z | #!/usr/bin/env python
# -*- coding: utf-8
from __future__ import unicode_literals
import platform as pf
from . import core
class PlatformCollector(object):
"""Collector for python platform information"""
def __init__(self, registry=core.REGISTRY, platform=None):
self._platform = pf if platform is N... | 29 | 80 | 0.613676 |
from __future__ import unicode_literals
import platform as pf
from . import core
class PlatformCollector(object):
def __init__(self, registry=core.REGISTRY, platform=None):
self._platform = pf if platform is None else platform
info = self._info()
system = self._platform.system()
... | true | true |
f70159fa731ebd5131cfc64b025fdad8ba885564 | 222 | py | Python | client codes/client v2/node_free.py | nathaniel-security/Localhost-distributed-computing-engine | 4643c22f563a969ccaf1062da17696819e00ab9a | [
"MIT"
] | null | null | null | client codes/client v2/node_free.py | nathaniel-security/Localhost-distributed-computing-engine | 4643c22f563a969ccaf1062da17696819e00ab9a | [
"MIT"
] | null | null | null | client codes/client v2/node_free.py | nathaniel-security/Localhost-distributed-computing-engine | 4643c22f563a969ccaf1062da17696819e00ab9a | [
"MIT"
] | null | null | null | from client_database_connection import mycursor
import os
sql = "INSERT INTO free_node (node_id) VALUES (%s)"
val = (node_id)
mycursor.execute(sql, val)
command = 'python get_code_when_free.py'
os.system(command) | 24.666667 | 52 | 0.752252 | from client_database_connection import mycursor
import os
sql = "INSERT INTO free_node (node_id) VALUES (%s)"
val = (node_id)
mycursor.execute(sql, val)
command = 'python get_code_when_free.py'
os.system(command) | true | true |
f7015a05765804fec4cfa4d48e357987ad3578a0 | 114,236 | py | Python | research/object_detection/meta_architectures/faster_rcnn_meta_arch_override_RPN.py | AXATechLab/models | c39ac760cfa6ce2339f5781f2a78d70db3ea5bb2 | [
"Apache-2.0"
] | null | null | null | research/object_detection/meta_architectures/faster_rcnn_meta_arch_override_RPN.py | AXATechLab/models | c39ac760cfa6ce2339f5781f2a78d70db3ea5bb2 | [
"Apache-2.0"
] | null | null | null | research/object_detection/meta_architectures/faster_rcnn_meta_arch_override_RPN.py | AXATechLab/models | c39ac760cfa6ce2339f5781f2a78d70db3ea5bb2 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 48.860565 | 181 | 0.713033 |
from abc import abstractmethod
from functools import partial
import tensorflow as tf
import json
import numpy as np
from object_detection.anchor_generators import grid_anchor_generator
from object_detection.builders import box_predictor_builder
from object_detection.core import box_list
from object_detec... | true | true |
f7015aaa826888850cd8fe4abef03d3587111370 | 643 | py | Python | manage.py | lievertom/2020.2-Projeto-Kokama-Traducao | c9c164ec69a3eba58fcbe0a74a43601346e57755 | [
"MIT"
] | 1 | 2021-03-13T02:44:27.000Z | 2021-03-13T02:44:27.000Z | manage.py | luisgaboardi/2020.2-Projeto-Kokama-Traducao | c14edf0611f6dcc7dc6de3249018de9c5cf71604 | [
"MIT"
] | 21 | 2021-03-14T01:51:11.000Z | 2021-05-25T02:04:23.000Z | manage.py | lievertom/2020.2-Projeto-Kokama-Traducao | c9c164ec69a3eba58fcbe0a74a43601346e57755 | [
"MIT"
] | 3 | 2021-04-02T11:06:33.000Z | 2021-05-12T21:30:34.000Z | """Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'translate.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
... | 29.227273 | 73 | 0.679627 | import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'translate.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
f7015abd02d2e91af592e552a6b9c0a139f233d9 | 9,314 | py | Python | monero_glue_test/test_crypto.py | ph4r05/monero-agent | 0bac0e6f33142b2bb885565bfd1ef8ac04559280 | [
"MIT"
] | 20 | 2018-04-05T22:06:10.000Z | 2021-09-18T10:43:44.000Z | monero_glue_test/test_crypto.py | ph4r05/monero-agent | 0bac0e6f33142b2bb885565bfd1ef8ac04559280 | [
"MIT"
] | null | null | null | monero_glue_test/test_crypto.py | ph4r05/monero-agent | 0bac0e6f33142b2bb885565bfd1ef8ac04559280 | [
"MIT"
] | 5 | 2018-08-06T15:06:04.000Z | 2021-07-16T01:58:43.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Dusan Klinec, ph4r05, 2018
import binascii
from binascii import unhexlify
import unittest
import aiounittest
from monero_glue.xmr import common, crypto
from monero_glue.xmr.core import ec_py
class CryptoTest(aiounittest.AsyncTestCase):
"""Simple tests"""
... | 35.280303 | 88 | 0.613915 |
import binascii
from binascii import unhexlify
import unittest
import aiounittest
from monero_glue.xmr import common, crypto
from monero_glue.xmr.core import ec_py
class CryptoTest(aiounittest.AsyncTestCase):
def __init__(self, *args, **kwargs):
super(CryptoTest, self).__init__(*args, **kwargs)
... | true | true |
f7015b1b5a99de73f33b4f3d76ad8353923e1995 | 175,051 | py | Python | python/ccxt/async_support/gateio.py | ttodua/ccxt-2 | d23db0c44288b3fc0313e798912a1c52c5b42f97 | [
"MIT"
] | null | null | null | python/ccxt/async_support/gateio.py | ttodua/ccxt-2 | d23db0c44288b3fc0313e798912a1c52c5b42f97 | [
"MIT"
] | null | null | null | python/ccxt/async_support/gateio.py | ttodua/ccxt-2 | d23db0c44288b3fc0313e798912a1c52c5b42f97 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
import hashlib
from ccxt.base.errors import ExchangeError
from ccxt.base.errors impor... | 43.971615 | 283 | 0.472485 |
rt.base.exchange import Exchange
import hashlib
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import PermissionDenied
from ccxt.base.errors import AccountNotEnabled
from ccxt.base.errors import AccountSuspended
from ccxt.base.errors import Arguments... | true | true |
f7015b2afba0129d69363926d5d8ce7086ff8751 | 715 | py | Python | asyncworker/metrics/registry.py | async-worker/async-worker | 9025d8f14d3fe6e1a2b1373c84abf41de575b359 | [
"MIT"
] | 7 | 2021-05-02T19:26:14.000Z | 2022-02-08T15:12:10.000Z | asyncworker/metrics/registry.py | async-worker/async-worker | 9025d8f14d3fe6e1a2b1373c84abf41de575b359 | [
"MIT"
] | 10 | 2021-05-02T15:37:55.000Z | 2021-09-11T10:58:32.000Z | asyncworker/metrics/registry.py | async-worker/async-worker | 9025d8f14d3fe6e1a2b1373c84abf41de575b359 | [
"MIT"
] | null | null | null | from prometheus_client import CollectorRegistry
from asyncworker.conf import settings
from asyncworker.metrics.collectors.gc import GCCollector
from asyncworker.metrics.collectors.platform import PlatformCollector
from asyncworker.metrics.collectors.process import ProcessCollector
NAMESPACE = (
f"{settings.METRIC... | 35.75 | 78 | 0.846154 | from prometheus_client import CollectorRegistry
from asyncworker.conf import settings
from asyncworker.metrics.collectors.gc import GCCollector
from asyncworker.metrics.collectors.platform import PlatformCollector
from asyncworker.metrics.collectors.process import ProcessCollector
NAMESPACE = (
f"{settings.METRIC... | true | true |
f7015b5c72fd870e0de08b32abce1f336bb097ab | 2,324 | py | Python | src/graphql/validation/rules/unique_operation_types.py | hspedro/graphql-core | 2b27e641d51789f532f989d3e125e04b33d24564 | [
"MIT"
] | null | null | null | src/graphql/validation/rules/unique_operation_types.py | hspedro/graphql-core | 2b27e641d51789f532f989d3e125e04b33d24564 | [
"MIT"
] | null | null | null | src/graphql/validation/rules/unique_operation_types.py | hspedro/graphql-core | 2b27e641d51789f532f989d3e125e04b33d24564 | [
"MIT"
] | null | null | null | from typing import Dict, Optional, Union
from ...error import GraphQLError
from ...language import (
OperationTypeDefinitionNode,
OperationType,
SchemaDefinitionNode,
SchemaExtensionNode,
)
from ...type import GraphQLObjectType
from . import SDLValidationContext, SDLValidationRule
__all__ = ["UniqueOp... | 34.176471 | 88 | 0.609725 | from typing import Dict, Optional, Union
from ...error import GraphQLError
from ...language import (
OperationTypeDefinitionNode,
OperationType,
SchemaDefinitionNode,
SchemaExtensionNode,
)
from ...type import GraphQLObjectType
from . import SDLValidationContext, SDLValidationRule
__all__ = ["UniqueOp... | true | true |
f7015b8ac1c781333bd97a91af3d7a190b0a0877 | 754 | py | Python | sdk/python/pulumi_azure_native/costmanagement/v20200301preview/_enums.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_native/costmanagement/v20200301preview/_enums.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_native/costmanagement/v20200301preview/_enums.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"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! ***
from enum import Enum
__all__ = [
'CostAllocationPolicyType',
'CostAllocationResourceType',
'RuleStatus',
]
class CostAllocationPolicyTy... | 20.944444 | 80 | 0.659151 |
from enum import Enum
__all__ = [
'CostAllocationPolicyType',
'CostAllocationResourceType',
'RuleStatus',
]
class CostAllocationPolicyType(str, Enum):
FIXED_PROPORTION = "FixedProportion"
class CostAllocationResourceType(str, Enum):
DIMENSION = "Dimension"
TAG = "Tag"
class RuleStatus... | true | true |
f7015bc8d1aae686fe1efb7e3d9e149f9f981a3e | 12,289 | py | Python | tools/train_eval.py | Sakura176/PointRCNN | a7fbb25e931609a39c32cb821a7c98a326e8b0c0 | [
"MIT"
] | null | null | null | tools/train_eval.py | Sakura176/PointRCNN | a7fbb25e931609a39c32cb821a7c98a326e8b0c0 | [
"MIT"
] | null | null | null | tools/train_eval.py | Sakura176/PointRCNN | a7fbb25e931609a39c32cb821a7c98a326e8b0c0 | [
"MIT"
] | null | null | null | import os
import numpy as np
import torch
import torch.nn.functional as F
from lib.utils.bbox_transform import decode_bbox_target
from tools.kitti_object_eval_python.evaluate import evaluate as kitti_evaluate
from lib.config import cfg
import lib.utils.kitti_utils as kitti_utils
import lib.utils.iou3d.iou3d_utils as i... | 43.733096 | 115 | 0.582391 | import os
import numpy as np
import torch
import torch.nn.functional as F
from lib.utils.bbox_transform import decode_bbox_target
from tools.kitti_object_eval_python.evaluate import evaluate as kitti_evaluate
from lib.config import cfg
import lib.utils.kitti_utils as kitti_utils
import lib.utils.iou3d.iou3d_utils as i... | true | true |
f7015cc43d31242d7bc3480085b9a95866ebf963 | 7,532 | py | Python | parallel_esn/bo.py | zblanks/parallel_esn | 25a979d0863ce54a4a588f4216dc473d4e9c5e8a | [
"BSD-2-Clause"
] | 7 | 2019-05-06T00:32:24.000Z | 2021-06-03T14:49:23.000Z | parallel_esn/bo.py | zblanks/parallel_esn | 25a979d0863ce54a4a588f4216dc473d4e9c5e8a | [
"BSD-2-Clause"
] | 8 | 2019-04-20T04:51:38.000Z | 2020-02-25T22:25:34.000Z | parallel_esn/bo.py | zblanks/parallel_esn | 25a979d0863ce54a4a588f4216dc473d4e9c5e8a | [
"BSD-2-Clause"
] | 2 | 2019-04-19T11:05:51.000Z | 2020-10-15T20:40:26.000Z | from math import log10
from sklearn.gaussian_process import GaussianProcessRegressor
from sklearn.gaussian_process.kernels import Matern
import numpy as np
from .utils import create_rng
class BO:
"""
Bayesian Optimization framework
"""
def __init__(self, k, hidden_dim=(100, 10000),
s... | 35.196262 | 79 | 0.556957 | from math import log10
from sklearn.gaussian_process import GaussianProcessRegressor
from sklearn.gaussian_process.kernels import Matern
import numpy as np
from .utils import create_rng
class BO:
def __init__(self, k, hidden_dim=(100, 10000),
spectral_radius=(.9, 1.3), p=(0, 1),
... | true | true |
f7015d2b3830806be972d5bfd60bcbe4ef3a2efc | 1,924 | py | Python | model/encoder/model_export_test.py | hjonnala/deeplab2 | 1868757c4333ec5287cc0bf0a6bbf38fbbe34c2e | [
"Apache-2.0"
] | null | null | null | model/encoder/model_export_test.py | hjonnala/deeplab2 | 1868757c4333ec5287cc0bf0a6bbf38fbbe34c2e | [
"Apache-2.0"
] | null | null | null | model/encoder/model_export_test.py | hjonnala/deeplab2 | 1868757c4333ec5287cc0bf0a6bbf38fbbe34c2e | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2022 The Deeplab2 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 ... | 31.032258 | 74 | 0.701663 |
import os
from absl import flags
from absl.testing import parameterized
import tensorflow as tf
from deeplab2.model.encoder import axial_resnet_instances
FLAGS = flags.FLAGS
class ModelExportTest(tf.test.TestCase, parameterized.TestCase):
@parameterized.parameters(
('resnet50',),
('r... | true | true |
f7015e1fbd223d4d58916cb28639860f971d3ab0 | 519 | py | Python | 114_sdoc7/run.py | sunlightlabs/senate_disbursements | 3e5989d075a91271c581e32c69f7ee9beb7eebad | [
"BSD-2-Clause"
] | 2 | 2017-06-12T18:09:10.000Z | 2021-04-18T17:11:06.000Z | 114_sdoc7/run.py | dwillis/senate_disbursements | 3e5989d075a91271c581e32c69f7ee9beb7eebad | [
"BSD-2-Clause"
] | 1 | 2017-10-03T14:18:00.000Z | 2017-10-03T14:50:35.000Z | 114_sdoc7/run.py | dwillis/senate_disbursements | 3e5989d075a91271c581e32c69f7ee9beb7eebad | [
"BSD-2-Clause"
] | 5 | 2016-09-20T23:42:34.000Z | 2017-10-05T19:23:13.000Z | from rip_pages import rip_pages
from read_pages import read_pages
from format_csv import format_csv
# STEP 1: CONFIG VARIABLES
SOURCE_DOC = '114sdoc7'
FILE_NAME = "GPO-CDOC-" + SOURCE_DOC + ".pdf"
OUT_FILE = 'senate_data.csv'
MISSING_FILE = 'missing_data.json'
START_PAGE = 17
END_PAGE = 2259
# STEP 2: Rip text, read ... | 23.590909 | 56 | 0.782274 | from rip_pages import rip_pages
from read_pages import read_pages
from format_csv import format_csv
SOURCE_DOC = '114sdoc7'
FILE_NAME = "GPO-CDOC-" + SOURCE_DOC + ".pdf"
OUT_FILE = 'senate_data.csv'
MISSING_FILE = 'missing_data.json'
START_PAGE = 17
END_PAGE = 2259
rip_pages(FILE_NAME, START_PAGE, END_PAGE)
read_pa... | true | true |
f7015e22936fea6cb9c989e8330ff91377b8db69 | 557 | py | Python | Fundamentals/Dictionaries/Lect_Demo..py | LuGeorgiev/PythonSelfLearning | db8fcff2c2df8946d6acf2a2e5677eccf2bbe5dc | [
"MIT"
] | null | null | null | Fundamentals/Dictionaries/Lect_Demo..py | LuGeorgiev/PythonSelfLearning | db8fcff2c2df8946d6acf2a2e5677eccf2bbe5dc | [
"MIT"
] | null | null | null | Fundamentals/Dictionaries/Lect_Demo..py | LuGeorgiev/PythonSelfLearning | db8fcff2c2df8946d6acf2a2e5677eccf2bbe5dc | [
"MIT"
] | null | null | null | my_list = [1, 2, 2, 4, 6]
#print reverse
print(my_list[::-1])
student = {'user': 'Lubo',
'pass': 'admin',
'course': ['C# Fundamentals', 'C# ASP', 'Algorithms']}
for key in student:
print(key)
for kvp in student.items():
print(f'the key is: {kvp[0]}, and values are: {kvp[1]} ')
print(s... | 19.206897 | 65 | 0.603232 | my_list = [1, 2, 2, 4, 6]
print(my_list[::-1])
student = {'user': 'Lubo',
'pass': 'admin',
'course': ['C# Fundamentals', 'C# ASP', 'Algorithms']}
for key in student:
print(key)
for kvp in student.items():
print(f'the key is: {kvp[0]}, and values are: {kvp[1]} ')
print(student['pass']... | true | true |
f7015eff97146dcc90e0d346cf7013c167c3b070 | 748 | py | Python | datas/exameUltrassom.py | mdietterle/aulas | b289a7252c2c8f7dfb4ee5482326a94e7d87ee45 | [
"Apache-2.0"
] | null | null | null | datas/exameUltrassom.py | mdietterle/aulas | b289a7252c2c8f7dfb4ee5482326a94e7d87ee45 | [
"Apache-2.0"
] | null | null | null | datas/exameUltrassom.py | mdietterle/aulas | b289a7252c2c8f7dfb4ee5482326a94e7d87ee45 | [
"Apache-2.0"
] | null | null | null | import datetime
from dateutil.relativedelta import relativedelta
print("Programa para calcular o prazo de exame de ultrassom...\nO mesmo deve ser feito entre 22 e 24 semanas de gestação")
print("você deverá informar com quantas semanasa de gestação a paciente se encontra, no formato aaaa/mm/dd")
semanas = int(input("C... | 53.428571 | 122 | 0.778075 | import datetime
from dateutil.relativedelta import relativedelta
print("Programa para calcular o prazo de exame de ultrassom...\nO mesmo deve ser feito entre 22 e 24 semanas de gestação")
print("você deverá informar com quantas semanasa de gestação a paciente se encontra, no formato aaaa/mm/dd")
semanas = int(input("C... | true | true |
f701614adbe0c289b89493a7ae3140602778980b | 2,333 | py | Python | jp.atcoder/abc012/abc012_4/21865313.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-09T03:06:25.000Z | 2022-02-09T03:06:25.000Z | jp.atcoder/abc012/abc012_4/21865313.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-05T22:53:18.000Z | 2022-02-09T01:29:30.000Z | jp.atcoder/abc012/abc012_4/21865313.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | null | null | null | from __future__ import annotations
from typing import Generator, NoReturn
class StdReader:
def __init__(
self,
) -> NoReturn:
import sys
self.buf = sys.stdin.buffer
self.lines = self.async_readlines()
self.chunks: Generator
def async_readlines(
self,
... | 17.80916 | 48 | 0.479211 | from __future__ import annotations
from typing import Generator, NoReturn
class StdReader:
def __init__(
self,
) -> NoReturn:
import sys
self.buf = sys.stdin.buffer
self.lines = self.async_readlines()
self.chunks: Generator
def async_readlines(
self,
... | true | true |
f70162a1e21c7e1848d4431d52ef94aa63177e6a | 3,991 | py | Python | tests/test_reducers_utils.py | jonathansick/astropy-librarian | f6a7cbd42ce0323b6d62f842a67eeeb7c31160b2 | [
"BSD-3-Clause"
] | null | null | null | tests/test_reducers_utils.py | jonathansick/astropy-librarian | f6a7cbd42ce0323b6d62f842a67eeeb7c31160b2 | [
"BSD-3-Clause"
] | 14 | 2020-03-30T17:25:17.000Z | 2022-02-10T15:15:55.000Z | tests/test_reducers_utils.py | jonathansick/astropy-librarian | f6a7cbd42ce0323b6d62f842a67eeeb7c31160b2 | [
"BSD-3-Clause"
] | 1 | 2021-05-01T21:32:09.000Z | 2021-05-01T21:32:09.000Z | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Tests for the astropylibrarian.reducers.utils module.
"""
from __future__ import annotations
from typing import TYPE_CHECKING
from astropylibrarian.reducers.utils import iter_sphinx_sections
if TYPE_CHECKING:
from .conftest import HtmlTestData
... | 32.713115 | 78 | 0.656477 |
from __future__ import annotations
from typing import TYPE_CHECKING
from astropylibrarian.reducers.utils import iter_sphinx_sections
if TYPE_CHECKING:
from .conftest import HtmlTestData
def test_iter_sphinx_sections(color_excess_tutorial: HtmlTestData) -> None:
doc = color_excess_tutorial.parse()
roo... | true | true |
f70163d595617592249268b64bea9e62fee7ad0e | 48,246 | py | Python | jd_beauty_plant.py | 21945764/Absinthe | 9bc101d49fcd4e53d64dd6065fad8315543c4f17 | [
"MIT"
] | 320 | 2022-02-07T11:50:19.000Z | 2022-03-31T10:07:55.000Z | jd_beauty_plant.py | 21945764/Absinthe | 9bc101d49fcd4e53d64dd6065fad8315543c4f17 | [
"MIT"
] | 25 | 2022-02-08T00:40:00.000Z | 2022-03-31T06:18:08.000Z | jd_beauty_plant.py | 21945764/Absinthe | 9bc101d49fcd4e53d64dd6065fad8315543c4f17 | [
"MIT"
] | 274 | 2022-02-07T11:35:01.000Z | 2022-03-31T15:07:18.000Z | #!/bin/env python3
# -*- coding: utf-8 -*
'''
感谢Curtin提供的其他脚本供我参考
感谢aburd ch大佬的指导
项目名称:xF_jd_beauty_plant.py
Author: 一风一扬
功能:健康社区-种植园自动任务
Date: 2022-1-4
cron: 10 9,11,15,21 * * * jd_beauty_plant.py
new Env('化妆馆-种植园自动任务');
活动入口:25:/¥2EaeU74Gz07gJ%
教程:该活动与京东的ck通用,所以只需要填写第几个号运行改脚本就行了。
青龙变量填写export plant_cookie="1",代表京... | 48.197802 | 1,343 | 0.613046 |
5k9kW4ArJEU3lfLhxBqw%3D%22%2C%22version%22%3A%221.0.3%22%2C%22appname%22%3A%22com.360buy.jdmobile%22%2C%22ridx%22%3A-1%7D&ext=%7B%22prstate%22%3A%220%22%2C%22pvcStu%22%3A%221%22%7D&isBackground=N&joycious=88&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&partner=apple&rfs=0000&scope=01&sign=946db60626658... | true | true |
f701647c2b297015f025eb53bd191a1a8c54ec62 | 18,209 | py | Python | tensorflow/contrib/layers/python/kernel_tests/sparse_feature_cross_op_test.py | AlexChrisF/udacity | b7f85a74058fc63ccb7601c418450ab934ef5953 | [
"Apache-2.0"
] | 522 | 2016-06-08T02:15:50.000Z | 2022-03-02T05:30:36.000Z | tensorflow/contrib/layers/python/kernel_tests/sparse_feature_cross_op_test.py | AlexChrisF/udacity | b7f85a74058fc63ccb7601c418450ab934ef5953 | [
"Apache-2.0"
] | 48 | 2016-07-26T00:11:55.000Z | 2022-02-23T13:36:33.000Z | tensorflow/contrib/layers/python/kernel_tests/sparse_feature_cross_op_test.py | AlexChrisF/udacity | b7f85a74058fc63ccb7601c418450ab934ef5953 | [
"Apache-2.0"
] | 108 | 2016-06-16T15:34:05.000Z | 2022-03-12T13:23:11.000Z | # Copyright 2016 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... | 41.573059 | 80 | 0.649953 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy
from tensorflow.contrib import layers
from tensorflow.contrib.layers.python.ops import sparse_feature_cross_op
from tensorflow.python.client import session
from tensorflow.python.fr... | true | true |
f70164867ee92c37dd1f5df7f9995e1f24766eff | 4,105 | py | Python | pyunity/scenes/runner.py | rayzchen/PyUnity | 8ed436eca7a84f05190c1fa275c58da5c6059926 | [
"MIT"
] | null | null | null | pyunity/scenes/runner.py | rayzchen/PyUnity | 8ed436eca7a84f05190c1fa275c58da5c6059926 | [
"MIT"
] | null | null | null | pyunity/scenes/runner.py | rayzchen/PyUnity | 8ed436eca7a84f05190c1fa275c58da5c6059926 | [
"MIT"
] | null | null | null | __all__ = ["ChangeScene", "Runner", "WindowRunner", "NonInteractiveRunner", "newRunner"]
from .. import config, render, Logger
from ..events import EventLoopManager, WaitForUpdate, WaitForFixedUpdate, WaitForRender
from ..errors import PyUnityException
import copy
import os
class ChangeScene(Exception):
pass
cla... | 31.098485 | 98 | 0.625335 | __all__ = ["ChangeScene", "Runner", "WindowRunner", "NonInteractiveRunner", "newRunner"]
from .. import config, render, Logger
from ..events import EventLoopManager, WaitForUpdate, WaitForFixedUpdate, WaitForRender
from ..errors import PyUnityException
import copy
import os
class ChangeScene(Exception):
pass
cla... | true | true |
f7016532b37838aa17bbc7b1b1e0324a6363051f | 2,571 | py | Python | docs/_ext/rapidsmsdocs.py | datamade/rapidsms | 052766eca9d5a79ccc4d1d3b5956c1c34c0d99cb | [
"BSD-3-Clause"
] | null | null | null | docs/_ext/rapidsmsdocs.py | datamade/rapidsms | 052766eca9d5a79ccc4d1d3b5956c1c34c0d99cb | [
"BSD-3-Clause"
] | 2 | 2018-08-03T18:48:09.000Z | 2019-01-02T19:33:23.000Z | docs/_ext/rapidsmsdocs.py | datamade/rapidsms | 052766eca9d5a79ccc4d1d3b5956c1c34c0d99cb | [
"BSD-3-Clause"
] | null | null | null | """
Sphinx plugins for RapidSMS documentation.
"""
try:
import json
except ImportError:
try:
import simplejson as json
except ImportError:
try:
from django.utils import simplejson as json
except ImportError:
json = None
from sphinx import addnodes, roles
fro... | 31.740741 | 82 | 0.56515 |
try:
import json
except ImportError:
try:
import simplejson as json
except ImportError:
try:
from django.utils import simplejson as json
except ImportError:
json = None
from sphinx import addnodes, roles
from docutils.parsers.rst import Directive
def setup... | true | true |
f70165831b1a0ae798b12f7c6cfd6eaade682b3b | 1,528 | py | Python | src/11.py | vulpicastor/advent-of-code-2021 | 12aaf84091604caf88acf3b4f7a118d866c33f5f | [
"MIT"
] | null | null | null | src/11.py | vulpicastor/advent-of-code-2021 | 12aaf84091604caf88acf3b4f7a118d866c33f5f | [
"MIT"
] | null | null | null | src/11.py | vulpicastor/advent-of-code-2021 | 12aaf84091604caf88acf3b4f7a118d866c33f5f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# pylint: disable=unused-import
import collections
import functools
import io
import itertools
import operator as op
import re
import timeit
import numpy as np
import aocd
YEAR = 2021
DAY = 11
def step(grid):
grid += 1
flash = np.zeros_like(grid, dtype=bool)
while np.any(grid[~fl... | 20.931507 | 68 | 0.578534 |
import collections
import functools
import io
import itertools
import operator as op
import re
import timeit
import numpy as np
import aocd
YEAR = 2021
DAY = 11
def step(grid):
grid += 1
flash = np.zeros_like(grid, dtype=bool)
while np.any(grid[~flash] > 9):
new_flash = (grid > 9) ^ flash
... | true | true |
f70165a3a17fd920644947b39c3f7192a33d8c30 | 5,864 | py | Python | tests/rest/test_connection.py | lforesta/openeo-python-client | d6cfc17f9693f6f6bf4a2ce60eac180ee9576543 | [
"Apache-2.0"
] | null | null | null | tests/rest/test_connection.py | lforesta/openeo-python-client | d6cfc17f9693f6f6bf4a2ce60eac180ee9576543 | [
"Apache-2.0"
] | null | null | null | tests/rest/test_connection.py | lforesta/openeo-python-client | d6cfc17f9693f6f6bf4a2ce60eac180ee9576543 | [
"Apache-2.0"
] | null | null | null | import unittest.mock as mock
import pytest
import requests_mock
from openeo.rest.auth.auth import NullAuth, BearerAuth
from openeo.rest.connection import Connection, RestApiConnection, connect, OpenEoApiError
API_URL = "https://oeo.net/"
@pytest.mark.parametrize(
["base", "paths", "expected_path"],
[
... | 38.834437 | 105 | 0.657913 | import unittest.mock as mock
import pytest
import requests_mock
from openeo.rest.auth.auth import NullAuth, BearerAuth
from openeo.rest.connection import Connection, RestApiConnection, connect, OpenEoApiError
API_URL = "https://oeo.net/"
@pytest.mark.parametrize(
["base", "paths", "expected_path"],
[
... | true | true |
f701678d9565d7ea82674dde93f7d7ccdabe6c52 | 10,194 | py | Python | yufuquantsdk/clients.py | We-Hack-Studio/nuts-sdk | 54ea379156b9f3c36a3ec05ba3d161b16ef43fc4 | [
"MIT"
] | 1 | 2021-04-11T03:48:17.000Z | 2021-04-11T03:48:17.000Z | yufuquantsdk/clients.py | We-Hack-Studio/nuts-sdk | 54ea379156b9f3c36a3ec05ba3d161b16ef43fc4 | [
"MIT"
] | null | null | null | yufuquantsdk/clients.py | We-Hack-Studio/nuts-sdk | 54ea379156b9f3c36a3ec05ba3d161b16ef43fc4 | [
"MIT"
] | 3 | 2021-04-17T22:52:05.000Z | 2022-01-05T01:30:57.000Z | import asyncio
import json
import logging
from datetime import datetime
from typing import Any, Dict, Iterable, List, Optional, Set, Union
import httpx
import websockets
from websockets import exceptions
logger = logging.getLogger("yufuquantsdk")
class WebsocketAPIClient:
def __init__(self, uri: str, ws: websoc... | 35.151724 | 88 | 0.572101 | import asyncio
import json
import logging
from datetime import datetime
from typing import Any, Dict, Iterable, List, Optional, Set, Union
import httpx
import websockets
from websockets import exceptions
logger = logging.getLogger("yufuquantsdk")
class WebsocketAPIClient:
def __init__(self, uri: str, ws: websoc... | true | true |
f7016aa5a1922d65f259e33893ab7489e6d9026d | 436 | py | Python | main.py | flaviopangracio/ort_music | 604e4d918d3057ee7ea3716bd3dfb77072e81ba3 | [
"MIT"
] | null | null | null | main.py | flaviopangracio/ort_music | 604e4d918d3057ee7ea3716bd3dfb77072e81ba3 | [
"MIT"
] | null | null | null | main.py | flaviopangracio/ort_music | 604e4d918d3057ee7ea3716bd3dfb77072e81ba3 | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
import os
intents = discord.Intents.default()
intents.members = True
testing = False
client = commands.Bot(command_prefix = "-", case_insensitive = True, intents=intents)
client.remove_command('help')
for filename in os.listdir('./cogs'):
if filenam... | 24.222222 | 86 | 0.697248 | import discord
from discord.ext import commands
import os
intents = discord.Intents.default()
intents.members = True
testing = False
client = commands.Bot(command_prefix = "-", case_insensitive = True, intents=intents)
client.remove_command('help')
for filename in os.listdir('./cogs'):
if filenam... | true | true |
f7016acf98feae99af9da1775ed115b17df2200d | 8,965 | py | Python | jack/train_reader.py | elyase/jack | a4f43a4012a540d55d2e05d8a904e6f8cc3002f1 | [
"MIT"
] | 192 | 2017-10-19T18:04:56.000Z | 2019-09-21T23:29:03.000Z | jack/train_reader.py | elyase/jack | a4f43a4012a540d55d2e05d8a904e6f8cc3002f1 | [
"MIT"
] | 120 | 2017-10-16T09:46:07.000Z | 2019-06-20T18:34:24.000Z | jack/train_reader.py | elyase/jack | a4f43a4012a540d55d2e05d8a904e6f8cc3002f1 | [
"MIT"
] | 50 | 2017-10-19T09:57:45.000Z | 2019-07-24T13:46:26.000Z | # -*- coding: utf-8 -*-
import logging
import math
import os
import random
import shutil
import tensorflow as tf
from jack import readers
from jack.core.tensorflow import TFReader
from jack.eval import evaluate_reader, pretty_print_results
from jack.util.hooks import LossHook, ExamplesPerSecHook, ETAHook
logger = l... | 40.201794 | 114 | 0.695482 |
import logging
import math
import os
import random
import shutil
import tensorflow as tf
from jack import readers
from jack.core.tensorflow import TFReader
from jack.eval import evaluate_reader, pretty_print_results
from jack.util.hooks import LossHook, ExamplesPerSecHook, ETAHook
logger = logging.getLogger(__name... | true | true |
f7016b5152ebd061fcd29b371db0ceded5c080ba | 23,671 | py | Python | utils/batchnorm_layer.py | limberc/hypercl | ad098a3b18cf2a2ae6e3ecd28a2b7af698f7b807 | [
"Apache-2.0"
] | null | null | null | utils/batchnorm_layer.py | limberc/hypercl | ad098a3b18cf2a2ae6e3ecd28a2b7af698f7b807 | [
"Apache-2.0"
] | null | null | null | utils/batchnorm_layer.py | limberc/hypercl | ad098a3b18cf2a2ae6e3ecd28a2b7af698f7b807 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2019 Christian Henning
#
# 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 l... | 44.080074 | 138 | 0.567023 |
from warnings import warn
import torch
import torch.nn as nn
import torch.nn.functional as F
class BatchNormLayer(nn.Module):
def __init__(self, num_features, momentum=0.1, affine=True,
track_running_stats=True, frozen_stats=False,
learnable_stats=False):
... | true | true |
f7016c5c21cf950aa7d4520f766ef05b3aa9a22c | 14,028 | py | Python | tensorflow/contrib/learn/python/learn/estimators/linear.py | calebchoo/modulabs | 10fbaf0581700641fc9b38b1bd722044bfb7c638 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/learn/python/learn/estimators/linear.py | calebchoo/modulabs | 10fbaf0581700641fc9b38b1bd722044bfb7c638 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/learn/python/learn/estimators/linear.py | calebchoo/modulabs | 10fbaf0581700641fc9b38b1bd722044bfb7c638 | [
"Apache-2.0"
] | 1 | 2020-03-26T00:09:00.000Z | 2020-03-26T00:09:00.000Z | # Copyright 2016 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... | 39.294118 | 82 | 0.71008 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib import layers
from tensorflow.contrib.framework.python.ops import variables as contrib_variables
from tensorflow.contrib.learn.python.learn.estimators import _sklearn
fro... | true | true |
f7016c7c0c3a67ee7989e59320e22bece5f09791 | 9,486 | py | Python | py/trtorch/_compile_spec.py | peri044/TRTorch | 62c9830b24552651abbff611515114cbcaca8b7b | [
"BSD-3-Clause"
] | 1 | 2021-06-18T17:26:58.000Z | 2021-06-18T17:26:58.000Z | py/trtorch/_compile_spec.py | peri044/TRTorch | 62c9830b24552651abbff611515114cbcaca8b7b | [
"BSD-3-Clause"
] | null | null | null | py/trtorch/_compile_spec.py | peri044/TRTorch | 62c9830b24552651abbff611515114cbcaca8b7b | [
"BSD-3-Clause"
] | null | null | null | from typing import List, Dict, Any
import torch
import trtorch._C
from trtorch import _types
def _supported_input_size_type(input_size: Any) -> bool:
if isinstance(input_size, torch.Size):
return True
elif isinstance(input_size, tuple):
return True
elif isinstance(input_size, list):
... | 42.16 | 145 | 0.630824 | from typing import List, Dict, Any
import torch
import trtorch._C
from trtorch import _types
def _supported_input_size_type(input_size: Any) -> bool:
if isinstance(input_size, torch.Size):
return True
elif isinstance(input_size, tuple):
return True
elif isinstance(input_size, list):
... | true | true |
f7016cf80f2cf98c95ee5e74713188d48fa48077 | 295 | py | Python | appointment_booking_drchrono/appointments/urls.py | TimothyBest/Appointment_Booking_drchrono | 279faf13724e768a6712d2f9911fe32399e4544c | [
"MIT"
] | null | null | null | appointment_booking_drchrono/appointments/urls.py | TimothyBest/Appointment_Booking_drchrono | 279faf13724e768a6712d2f9911fe32399e4544c | [
"MIT"
] | null | null | null | appointment_booking_drchrono/appointments/urls.py | TimothyBest/Appointment_Booking_drchrono | 279faf13724e768a6712d2f9911fe32399e4544c | [
"MIT"
] | null | null | null | from django.conf.urls import patterns, url
urlpatterns = patterns('appointments.views',
url(r'^appointment/(?P<practice_id>\d+)/$', 'appointment_form', name='appointment_form'),
url(r'^appointment/created/(?P<practice_id>\d+)/$', 'appointment_created', name='appointment_created'),
)
| 32.777778 | 107 | 0.718644 | from django.conf.urls import patterns, url
urlpatterns = patterns('appointments.views',
url(r'^appointment/(?P<practice_id>\d+)/$', 'appointment_form', name='appointment_form'),
url(r'^appointment/created/(?P<practice_id>\d+)/$', 'appointment_created', name='appointment_created'),
)
| true | true |
f7016d30d5f6e38ed75c2e93258d83dff26db920 | 2,848 | py | Python | menu.py | applefreak/europi | 6ad531c72e148fd1c5f75ee82e588b886ef330a4 | [
"MIT"
] | 1 | 2021-01-11T01:36:07.000Z | 2021-01-11T01:36:07.000Z | menu.py | applefreak/europi | 6ad531c72e148fd1c5f75ee82e588b886ef330a4 | [
"MIT"
] | null | null | null | menu.py | applefreak/europi | 6ad531c72e148fd1c5f75ee82e588b886ef330a4 | [
"MIT"
] | null | null | null | from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
from rotary_class import RotaryEncoder
class Display():
def __init__(self, disp):
self.disp = disp
self.dimensions = (disp.width, disp.height)
self.image = Image.new('1', self.dimensions)
self.draw = ImageDraw... | 32 | 129 | 0.542837 | from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
from rotary_class import RotaryEncoder
class Display():
def __init__(self, disp):
self.disp = disp
self.dimensions = (disp.width, disp.height)
self.image = Image.new('1', self.dimensions)
self.draw = ImageDraw... | true | true |
f7016dd197dc84aeab737877e938c7ecfc8970b5 | 5,276 | py | Python | tests/analyzer/test_as_import.py | CAM-Gerlach/unimport | acaebf547274a95a33816e47ec22bb73d8456b17 | [
"MIT"
] | 147 | 2019-09-19T15:43:06.000Z | 2022-03-25T16:42:08.000Z | tests/analyzer/test_as_import.py | CAM-Gerlach/unimport | acaebf547274a95a33816e47ec22bb73d8456b17 | [
"MIT"
] | 154 | 2019-10-31T19:50:18.000Z | 2022-03-29T12:43:00.000Z | tests/analyzer/test_as_import.py | CAM-Gerlach/unimport | acaebf547274a95a33816e47ec22bb73d8456b17 | [
"MIT"
] | 28 | 2019-10-31T18:11:13.000Z | 2021-09-06T08:24:14.000Z | from tests.analyzer.utils import UnusedTestCase
from unimport.statement import Import, ImportFrom
class AsImportTestCase(UnusedTestCase):
def test_as_import_all_unused_all_cases(self):
self.assertSourceAfterScanningEqualToExpected(
"""\
from x import y as z
import x
... | 29.311111 | 60 | 0.288855 | from tests.analyzer.utils import UnusedTestCase
from unimport.statement import Import, ImportFrom
class AsImportTestCase(UnusedTestCase):
def test_as_import_all_unused_all_cases(self):
self.assertSourceAfterScanningEqualToExpected(
"""\
from x import y as z
import x
... | true | true |
f7016f34f904942762b689e2683eb61c1e3e3a29 | 2,470 | py | Python | modules/Google_Takeout/modules/utils/takeout_case.py | dfrc-korea/carpe | 9afa8b624948fd462bb19c90cbc811228fd52c21 | [
"Apache-2.0"
] | 56 | 2019-02-07T06:21:45.000Z | 2022-03-21T08:19:24.000Z | modules/Google_Takeout/modules/utils/takeout_case.py | dfrc-korea/carpe | 9afa8b624948fd462bb19c90cbc811228fd52c21 | [
"Apache-2.0"
] | 5 | 2020-05-25T17:29:00.000Z | 2021-12-13T20:49:08.000Z | modules/Google_Takeout/modules/utils/takeout_case.py | dfrc-korea/carpe | 9afa8b624948fd462bb19c90cbc811228fd52c21 | [
"Apache-2.0"
] | 31 | 2019-03-13T10:23:49.000Z | 2021-11-04T12:14:58.000Z | import os
from .takeout_sqlite3 import SQLite3
import multiprocessing
CONTACTS = 'Contacts' + os.sep + 'All Contacts' + os.sep + 'All Contacts.vcf'
DRIVE = 'Drive'
MY_ACTIVITY_ASSISTANT_PATH = 'My Activity' + os.sep + 'Assistant' + os.sep + 'MyActivity.html'
MY_ACTIVITY_GMAIL_PATH = 'My Activity' + os.sep + 'Gmail' +... | 53.695652 | 113 | 0.773684 | import os
from .takeout_sqlite3 import SQLite3
import multiprocessing
CONTACTS = 'Contacts' + os.sep + 'All Contacts' + os.sep + 'All Contacts.vcf'
DRIVE = 'Drive'
MY_ACTIVITY_ASSISTANT_PATH = 'My Activity' + os.sep + 'Assistant' + os.sep + 'MyActivity.html'
MY_ACTIVITY_GMAIL_PATH = 'My Activity' + os.sep + 'Gmail' +... | true | true |
f7016f7ed1a12ccf8abe398fe979b5e78fb5499f | 2,938 | py | Python | gym_puyopuyo/test-feedforward-smallenv.py | brnor/dipl | db516610aecffb10825e899fb5aa9f2902093b6e | [
"MIT"
] | null | null | null | gym_puyopuyo/test-feedforward-smallenv.py | brnor/dipl | db516610aecffb10825e899fb5aa9f2902093b6e | [
"MIT"
] | null | null | null | gym_puyopuyo/test-feedforward-smallenv.py | brnor/dipl | db516610aecffb10825e899fb5aa9f2902093b6e | [
"MIT"
] | null | null | null | from __future__ import print_function
import os
import pickle
import time
from gym_puyopuyo import register
import gym
import numpy as np
import neat
import visualize
piece_shape = (3, 2)
DRAW_NETS = False
NUM_COLORS = 3.0 # 3 colors in the small env mode
# TODO: could probably read color number from observation da... | 28.803922 | 77 | 0.591559 | from __future__ import print_function
import os
import pickle
import time
from gym_puyopuyo import register
import gym
import numpy as np
import neat
import visualize
piece_shape = (3, 2)
DRAW_NETS = False
NUM_COLORS = 3.0
fn_results = "feedforward-small"
def multiplyMatrices(pieces, field, norm = True):
pie... | true | true |
f7016fdcb57fb610e943f783ffeb624675e41126 | 2,021 | py | Python | app/dao/broadcast_message_dao.py | tlwr/notifications-api | 88a6b7729edb9be41ce3e7c027f1452b7b6d00d2 | [
"MIT"
] | null | null | null | app/dao/broadcast_message_dao.py | tlwr/notifications-api | 88a6b7729edb9be41ce3e7c027f1452b7b6d00d2 | [
"MIT"
] | null | null | null | app/dao/broadcast_message_dao.py | tlwr/notifications-api | 88a6b7729edb9be41ce3e7c027f1452b7b6d00d2 | [
"MIT"
] | null | null | null | import uuid
from app import db
from app.dao.dao_utils import transactional
from app.models import (
BroadcastMessage,
BroadcastEvent,
BroadcastProvider,
BroadcastProviderMessage,
BroadcastProviderMessageNumber,
BroadcastProviderMessageStatus
)
def dao_get_broadcast_message_by_id_and_service_i... | 31.578125 | 85 | 0.764473 | import uuid
from app import db
from app.dao.dao_utils import transactional
from app.models import (
BroadcastMessage,
BroadcastEvent,
BroadcastProvider,
BroadcastProviderMessage,
BroadcastProviderMessageNumber,
BroadcastProviderMessageStatus
)
def dao_get_broadcast_message_by_id_and_service_i... | true | true |
f7016fe4e649e0defe4ee246bb7a91d3d39ef94e | 1,706 | py | Python | python/open3d/ml/torch/pipelines.py | xkaraman/Open3D | a1d65eca537a2b099fc3b6d08edb26e45b717e40 | [
"MIT"
] | 2 | 2020-12-08T15:38:34.000Z | 2021-04-10T02:58:15.000Z | python/open3d/ml/torch/pipelines.py | moonwonlee/Open3D | dda9b3a0129fa6c60f913672a70ff02483dcd0f3 | [
"MIT"
] | null | null | null | python/open3d/ml/torch/pipelines.py | moonwonlee/Open3D | dda9b3a0129fa6c60f913672a70ff02483dcd0f3 | [
"MIT"
] | 1 | 2021-11-05T01:16:13.000Z | 2021-11-05T01:16:13.000Z | # ----------------------------------------------------------------------------
# - Open3D: www.open3d.org -
# ----------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2020 www.open3d.org
#
# Permission is her... | 44.894737 | 79 | 0.631301 |
import os as _os
from open3d import _build_config
if _build_config['BUNDLE_OPEN3D_ML']:
if 'OPEN3D_ML_ROOT' in _os.environ:
from ml3d.torch.pipelines import *
else:
from open3d._ml3d.torch.pipelines import *
| true | true |
f7016fee3d19733d380e1f4199f8769b9529e54f | 722 | py | Python | {{cookiecutter.project_name}}/core/deployment/gunicorn_conf.py | ProjectTemplates/django-webpack-app | 50081d009162503042840a904e25c4b32d606cf5 | [
"MIT"
] | 2 | 2020-11-10T10:16:48.000Z | 2021-02-05T13:21:11.000Z | {{cookiecutter.project_name}}/core/deployment/gunicorn_conf.py | ProjectTemplates/django-webpack-app | 50081d009162503042840a904e25c4b32d606cf5 | [
"MIT"
] | null | null | null | {{cookiecutter.project_name}}/core/deployment/gunicorn_conf.py | ProjectTemplates/django-webpack-app | 50081d009162503042840a904e25c4b32d606cf5 | [
"MIT"
] | 1 | 2021-02-05T11:37:18.000Z | 2021-02-05T11:37:18.000Z | import os
def to_bool(value):
return (
value is True or
(isinstance(value, str) and value.lower() in ['true', 'yes']) or
(isinstance(value, (int, float)) and value > 0)
)
bind = '0.0.0.0:{}'.format(os.getenv('GUNICORN_PORT', '8000'))
max_requests = int(os.getenv('GUNICORN_MAX_REQUEST... | 27.769231 | 75 | 0.671745 | import os
def to_bool(value):
return (
value is True or
(isinstance(value, str) and value.lower() in ['true', 'yes']) or
(isinstance(value, (int, float)) and value > 0)
)
bind = '0.0.0.0:{}'.format(os.getenv('GUNICORN_PORT', '8000'))
max_requests = int(os.getenv('GUNICORN_MAX_REQUEST... | true | true |
f701701a180004073de4f335fee9153105be7e42 | 584 | py | Python | tests/test_pin_num_name.py | arjenroodselaar/skidl | 0bf801bd3b74e6ef94bd9aa1b68eef756b568276 | [
"MIT"
] | 2 | 2022-02-27T14:31:52.000Z | 2022-02-27T14:31:56.000Z | tests/test_pin_num_name.py | arjenroodselaar/skidl | 0bf801bd3b74e6ef94bd9aa1b68eef756b568276 | [
"MIT"
] | null | null | null | tests/test_pin_num_name.py | arjenroodselaar/skidl | 0bf801bd3b74e6ef94bd9aa1b68eef756b568276 | [
"MIT"
] | 1 | 2020-09-21T23:31:41.000Z | 2020-09-21T23:31:41.000Z | import pytest
from skidl import *
from .setup_teardown import *
def test_pin_names_1():
codec = Part("xess.lib", "ak4520a")
assert codec["ain"] == codec.n["ain"]
assert codec[1:4] == codec.p[1:4]
def test_pin_names_2():
codec = Part("xess.lib", "ak4520a")
codec[4].name = "A1"
codec[8].name... | 23.36 | 41 | 0.599315 | import pytest
from skidl import *
from .setup_teardown import *
def test_pin_names_1():
codec = Part("xess.lib", "ak4520a")
assert codec["ain"] == codec.n["ain"]
assert codec[1:4] == codec.p[1:4]
def test_pin_names_2():
codec = Part("xess.lib", "ak4520a")
codec[4].name = "A1"
codec[8].name... | true | true |
f701701fc0217b14ad2a52b62b79d747b1021bdd | 5,395 | py | Python | asynction/types.py | pedrohbtp/asynction | 939f9b3fdf09f8bf89da9a8c5222234c07594d22 | [
"MIT"
] | null | null | null | asynction/types.py | pedrohbtp/asynction | 939f9b3fdf09f8bf89da9a8c5222234c07594d22 | [
"MIT"
] | null | null | null | asynction/types.py | pedrohbtp/asynction | 939f9b3fdf09f8bf89da9a8c5222234c07594d22 | [
"MIT"
] | null | null | null | from dataclasses import dataclass
from dataclasses import field
from typing import Any
from typing import Callable
from typing import Mapping
from typing import Optional
from typing import Sequence
from typing import Type
from svarog import forge
from svarog import register_forge
from svarog.types import Forge
JSONMa... | 29.005376 | 88 | 0.67785 | from dataclasses import dataclass
from dataclasses import field
from typing import Any
from typing import Callable
from typing import Mapping
from typing import Optional
from typing import Sequence
from typing import Type
from svarog import forge
from svarog import register_forge
from svarog.types import Forge
JSONMa... | true | true |
f701720dc66511da8b41f4c16f88ff2e260dada6 | 408 | py | Python | ia870/iaframe.py | rdenadai/ia870p3 | c4823efc4b8e5f187a64f8a4e9962e328bf86967 | [
"BSD-2-Clause"
] | 5 | 2018-10-15T12:02:03.000Z | 2022-02-11T12:47:12.000Z | ia870/iaframe.py | rdenadai/ia870p3 | c4823efc4b8e5f187a64f8a4e9962e328bf86967 | [
"BSD-2-Clause"
] | 1 | 2018-10-15T12:04:36.000Z | 2019-01-25T12:04:35.000Z | ia870/iaframe.py | rdenadai/ia870p3 | c4823efc4b8e5f187a64f8a4e9962e328bf86967 | [
"BSD-2-Clause"
] | 4 | 2019-01-25T11:13:48.000Z | 2020-12-20T01:42:33.000Z | # -*- encoding: utf-8 -*-
# Module iaframe
from numpy import *
def iaframe(f, WT=1, HT=1, DT=0, k1=None, k2=None):
from ia870 import iaunion, iaintersec,ialimits
if k1 is None: k1 = ialimits(f)[1]
if k2 is None: k2 = ialimits(f)[0]
assert len(f.shape)==2,'Supports 2D only'
y = iaintersec(f,k2)
... | 21.473684 | 51 | 0.561275 |
from numpy import *
def iaframe(f, WT=1, HT=1, DT=0, k1=None, k2=None):
from ia870 import iaunion, iaintersec,ialimits
if k1 is None: k1 = ialimits(f)[1]
if k2 is None: k2 = ialimits(f)[0]
assert len(f.shape)==2,'Supports 2D only'
y = iaintersec(f,k2)
y[:,0:WT] = k1
y[:,-WT:] = k1
y... | true | true |
f7017311d918b6323937deb442372097cda94beb | 3,713 | py | Python | tests/common.py | lucmichalski/saraki | 74c11f70b4e7bdedfd33984cb96944c27a4eebbf | [
"MIT"
] | 3 | 2020-07-01T17:34:39.000Z | 2021-05-04T17:53:01.000Z | tests/common.py | lucmichalski/saraki | 74c11f70b4e7bdedfd33984cb96944c27a4eebbf | [
"MIT"
] | 25 | 2018-01-25T00:56:18.000Z | 2021-06-12T04:29:00.000Z | tests/common.py | lucmichalski/saraki | 74c11f70b4e7bdedfd33984cb96944c27a4eebbf | [
"MIT"
] | 4 | 2020-04-19T21:24:34.000Z | 2021-01-23T19:04:27.000Z | import jwt
from contextlib import contextmanager
from datetime import datetime, timedelta
from sqlalchemy import Column, Integer, String, DateTime, Boolean
from sqlalchemy import ForeignKey, func
from sqlalchemy.orm import relationship
from saraki.auth import _request_ctx_stack, User, Org
from saraki.model import Bas... | 24.267974 | 88 | 0.693509 | import jwt
from contextlib import contextmanager
from datetime import datetime, timedelta
from sqlalchemy import Column, Integer, String, DateTime, Boolean
from sqlalchemy import ForeignKey, func
from sqlalchemy.orm import relationship
from saraki.auth import _request_ctx_stack, User, Org
from saraki.model import Bas... | true | true |
f70173db91482b779289e981d3527cf4fdf8b6bc | 1,990 | py | Python | do_trim.py | eric-haibin-lin/text-proc | f84e2d6f802302fef5f20a2cb4b7583a57dd15c3 | [
"Apache-2.0"
] | 9 | 2019-07-16T21:30:01.000Z | 2022-01-26T02:32:26.000Z | do_trim.py | eric-haibin-lin/text-proc | f84e2d6f802302fef5f20a2cb4b7583a57dd15c3 | [
"Apache-2.0"
] | null | null | null | do_trim.py | eric-haibin-lin/text-proc | f84e2d6f802302fef5f20a2cb4b7583a57dd15c3 | [
"Apache-2.0"
] | 2 | 2020-02-29T13:21:26.000Z | 2020-08-19T09:27:29.000Z | from multiprocessing import Pool
import argparse
import glob
import os
import io
import time
import logging
import gluonnlp as nlp
import tokenizer as tokenization
parser = argparse.ArgumentParser(description='BERT tokenizer')
parser.add_argument('--input_files', type=str, default='wiki_*.doc',
hel... | 32.622951 | 91 | 0.59799 | from multiprocessing import Pool
import argparse
import glob
import os
import io
import time
import logging
import gluonnlp as nlp
import tokenizer as tokenization
parser = argparse.ArgumentParser(description='BERT tokenizer')
parser.add_argument('--input_files', type=str, default='wiki_*.doc',
hel... | true | true |
f7017509f204ca09eefcaa0814db20be4363c56d | 445 | py | Python | d9b.py | jogloran/advent-of-code-2020 | 9804f1eb8d94c991d9aa3348f01f4bf65c195849 | [
"MIT"
] | null | null | null | d9b.py | jogloran/advent-of-code-2020 | 9804f1eb8d94c991d9aa3348f01f4bf65c195849 | [
"MIT"
] | null | null | null | d9b.py | jogloran/advent-of-code-2020 | 9804f1eb8d94c991d9aa3348f01f4bf65c195849 | [
"MIT"
] | null | null | null | import sys; from more_itertools import windowed, first_true
orig_data = list(map(int, open('d9.txt')))
data = orig_data[:]
target = 32321523
for i, e in enumerate(data):
if i == 0: continue
data[i] = data[i - 1] + data[i]
for i in range(len(data)):
for j in range(i):
if data[i] - data[j] == target:... | 31.785714 | 64 | 0.58427 | import sys; from more_itertools import windowed, first_true
orig_data = list(map(int, open('d9.txt')))
data = orig_data[:]
target = 32321523
for i, e in enumerate(data):
if i == 0: continue
data[i] = data[i - 1] + data[i]
for i in range(len(data)):
for j in range(i):
if data[i] - data[j] == target:... | true | true |
f70175903618b46cbc2465f247c1e2539656a5a4 | 6,355 | py | Python | zhaquirks/xiaomi/aqara/remote_b186acn01.py | sylvaing/zha-device-handlers | 61dedab318a8986b2b0a7bffe5116bbc40bed214 | [
"Apache-2.0"
] | null | null | null | zhaquirks/xiaomi/aqara/remote_b186acn01.py | sylvaing/zha-device-handlers | 61dedab318a8986b2b0a7bffe5116bbc40bed214 | [
"Apache-2.0"
] | null | null | null | zhaquirks/xiaomi/aqara/remote_b186acn01.py | sylvaing/zha-device-handlers | 61dedab318a8986b2b0a7bffe5116bbc40bed214 | [
"Apache-2.0"
] | null | null | null | """Xiaomi aqara single key switch device."""
import logging
from zigpy.profiles import zha
from zigpy.zcl.clusters.general import (
AnalogInput,
Basic,
Groups,
Identify,
MultistateInput,
OnOff,
Ota,
Scenes,
)
from .. import (
LUMI,
XIAOMI_NODE_DESC,
BasicCluster,
Xiaomi... | 31.305419 | 84 | 0.51786 | import logging
from zigpy.profiles import zha
from zigpy.zcl.clusters.general import (
AnalogInput,
Basic,
Groups,
Identify,
MultistateInput,
OnOff,
Ota,
Scenes,
)
from .. import (
LUMI,
XIAOMI_NODE_DESC,
BasicCluster,
XiaomiPowerConfiguration,
XiaomiQuickInitDevice... | true | true |
f701763c784e49214fd9a7e52a90d440b81882b8 | 28,284 | py | Python | vscode/extensions/ms-python.python-2022.4.1/pythonFiles/lib/python/debugpy/adapter/clients.py | despresj/dotfiles | 1c76fc4efcc125f74aa5ebdc4aa521277a360379 | [
"MIT"
] | null | null | null | vscode/extensions/ms-python.python-2022.4.1/pythonFiles/lib/python/debugpy/adapter/clients.py | despresj/dotfiles | 1c76fc4efcc125f74aa5ebdc4aa521277a360379 | [
"MIT"
] | null | null | null | vscode/extensions/ms-python.python-2022.4.1/pythonFiles/lib/python/debugpy/adapter/clients.py | despresj/dotfiles | 1c76fc4efcc125f74aa5ebdc4aa521277a360379 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE in the project root
# for license information.
from __future__ import absolute_import, division, print_function, unicode_literals
import atexit
import os
import sys
import debugpy
from debugpy import ... | 41.110465 | 96 | 0.554306 |
from __future__ import absolute_import, division, print_function, unicode_literals
import atexit
import os
import sys
import debugpy
from debugpy import adapter, common, launcher
from debugpy.common import compat, fmt, json, log, messaging, sockets
from debugpy.common.compat import unicode
from debugpy... | true | true |
f701767e7eb4bd50bad3cd14a4cce3b563d834a2 | 510 | py | Python | p03.2/double_letters.py | LukeBriggsDev/GCSE-Code-Tasks | ed696873f6f9980e32b85ab7850cef8e75d52604 | [
"MIT"
] | null | null | null | p03.2/double_letters.py | LukeBriggsDev/GCSE-Code-Tasks | ed696873f6f9980e32b85ab7850cef8e75d52604 | [
"MIT"
] | null | null | null | p03.2/double_letters.py | LukeBriggsDev/GCSE-Code-Tasks | ed696873f6f9980e32b85ab7850cef8e75d52604 | [
"MIT"
] | null | null | null | """
Problem:
The function 'doubler' takes a word as input.
It should create and print
a string, where each character in the string is doubled, for example:
"test" -> "tteesstt"
Tests:
>>> doubler("test")
tteesstt
>>> doubler("original")
oorriiggiinnaall
>>> doubler("hihihi")
hhiihhi... | 15 | 69 | 0.65098 | import doctest
def run_tests():
doctest.testmod(verbose=True)
def doubler(word):
print(''.join([char + char for char in word]))
if __name__ == "__main__":
run_tests() | true | true |
f70176d180413d27094964996f759d35f158b8ae | 1,328 | py | Python | idread.py | sdwhturbosun/pn532_spi4student | 72af24e3e7a72811589fbc225f231330d470acad | [
"MIT"
] | null | null | null | idread.py | sdwhturbosun/pn532_spi4student | 72af24e3e7a72811589fbc225f231330d470acad | [
"MIT"
] | null | null | null | idread.py | sdwhturbosun/pn532_spi4student | 72af24e3e7a72811589fbc225f231330d470acad | [
"MIT"
] | null | null | null |
import binascii
import sys
import Adafruit_PN532 as PN532
# Setup how the PN532 is connected to the Raspbery Pi/BeagleBone Black.
# It is recommended to use a software SPI connection with 4 digital GPIO pins.
# Configuration for a Raspberry Pi:
CS = 8 #pn532_nss----->rpi_ce0:8
MOSI = 9 #pn532_mosi---->rpi__m... | 26.039216 | 78 | 0.700301 |
import binascii
import sys
import Adafruit_PN532 as PN532
CS = 8
MOSI = 9
MISO = 10
SCLK = 11
pn532 = PN532.PN532(cs=CS, sclk=SCLK, mosi=MOSI, miso=MISO)
pn532.begin()
ic, ver, rev, support = pn532.get_firmware_version()
print('Found PN532 with firmware version: {0}.{1}'.format(ver, rev... | true | true |
f70177f8792e21fd19853261c7c4d9f5f44b972b | 79 | py | Python | tests/test_cli.py | pbujold/macaqueModules | 3f55ec45f691972e40cc8bd98071b7934ae24349 | [
"MIT"
] | 1 | 2021-08-25T08:45:52.000Z | 2021-08-25T08:45:52.000Z | tests/test_cli.py | pbujold/macaqueModules | 3f55ec45f691972e40cc8bd98071b7934ae24349 | [
"MIT"
] | null | null | null | tests/test_cli.py | pbujold/macaqueModules | 3f55ec45f691972e40cc8bd98071b7934ae24349 | [
"MIT"
] | null | null | null | from macaque import cli
def test_cli_template():
assert cli.cli() is None
| 15.8 | 28 | 0.734177 | from macaque import cli
def test_cli_template():
assert cli.cli() is None
| true | true |
f7017816f2ca3a9c790e346ca4d93eb29edd1df0 | 262 | py | Python | 17.05.2022/POO/parte3/webBonus/meu_site.py | N0N4T0/python-codes | ac2b884f86749a8b179ff972cdb316ec4e005b32 | [
"MIT"
] | null | null | null | 17.05.2022/POO/parte3/webBonus/meu_site.py | N0N4T0/python-codes | ac2b884f86749a8b179ff972cdb316ec4e005b32 | [
"MIT"
] | null | null | null | 17.05.2022/POO/parte3/webBonus/meu_site.py | N0N4T0/python-codes | ac2b884f86749a8b179ff972cdb316ec4e005b32 | [
"MIT"
] | null | null | null | # Antes de mais nada install o flask = pip install flask
from flask import Flask
app = Flask(__name__)
@app.route('/')
def homepage():
return 'Essa é minha HomePage'
@app.route('/contatos')
def contatos():
return 'Essa são os meus contatos'
app.run() | 18.714286 | 56 | 0.694656 |
from flask import Flask
app = Flask(__name__)
@app.route('/')
def homepage():
return 'Essa é minha HomePage'
@app.route('/contatos')
def contatos():
return 'Essa são os meus contatos'
app.run() | true | true |
f70178817daa3868f8cf3f8e570980b45d7a7bd8 | 1,183 | py | Python | unjabberlib/formatters.py | adsr303/unjabber | 159f5fc8468e51c885a97c215196241c63b42a1e | [
"MIT"
] | null | null | null | unjabberlib/formatters.py | adsr303/unjabber | 159f5fc8468e51c885a97c215196241c63b42a1e | [
"MIT"
] | null | null | null | unjabberlib/formatters.py | adsr303/unjabber | 159f5fc8468e51c885a97c215196241c63b42a1e | [
"MIT"
] | null | null | null | from itertools import zip_longest
DAY = 'day'
HOUR = 'hour'
NAME = 'name'
class Formatter:
def __init__(self, indent=5 * ' '):
self.indent = indent
def append(self, text, tag=None):
raise NotImplementedError('Must override append() in derived class')
def println(self, *args):
se... | 26.288889 | 80 | 0.50634 | from itertools import zip_longest
DAY = 'day'
HOUR = 'hour'
NAME = 'name'
class Formatter:
def __init__(self, indent=5 * ' '):
self.indent = indent
def append(self, text, tag=None):
raise NotImplementedError('Must override append() in derived class')
def println(self, *args):
se... | true | true |
f70178a47dec7e27f047d239baba69c6694baf37 | 1,910 | py | Python | src/prototypes/prototypes.py | kprzybyla/prototypes | e4a8eb05071a1df62ed59fd5d4e69510a9db8e8a | [
"MIT"
] | null | null | null | src/prototypes/prototypes.py | kprzybyla/prototypes | e4a8eb05071a1df62ed59fd5d4e69510a9db8e8a | [
"MIT"
] | null | null | null | src/prototypes/prototypes.py | kprzybyla/prototypes | e4a8eb05071a1df62ed59fd5d4e69510a9db8e8a | [
"MIT"
] | null | null | null | __all__ = [
"prototype",
]
import sys
from inspect import (
signature,
)
from typing import (
TypeVar,
Callable,
)
from .exceptions import (
PrototypeError,
)
if sys.version_info >= (3, 10):
from typing import ParamSpec
else:
from typing_extensions import ParamSpec # pragma: no cover
... | 27.681159 | 97 | 0.704712 | __all__ = [
"prototype",
]
import sys
from inspect import (
signature,
)
from typing import (
TypeVar,
Callable,
)
from .exceptions import (
PrototypeError,
)
if sys.version_info >= (3, 10):
from typing import ParamSpec
else:
from typing_extensions import ParamSpec
Parameters = Param... | true | true |
f70178cbf4ef5105a30edcd3a5daa6e7f179211c | 571 | py | Python | chapter9_Computer-Vision/Deep-Dream/util.py | kumi123/pytorch-learning | 29f5b4d53f4e72b95b3fab979b1bc496ef23674c | [
"MIT"
] | null | null | null | chapter9_Computer-Vision/Deep-Dream/util.py | kumi123/pytorch-learning | 29f5b4d53f4e72b95b3fab979b1bc496ef23674c | [
"MIT"
] | null | null | null | chapter9_Computer-Vision/Deep-Dream/util.py | kumi123/pytorch-learning | 29f5b4d53f4e72b95b3fab979b1bc496ef23674c | [
"MIT"
] | null | null | null | import PIL.Image
from io import BytesIO
from IPython.display import clear_output, Image, display
import numpy as np
def showarray(a, fmt='jpeg'):
a = np.uint8(np.clip(a, 0, 255))
f = BytesIO()
PIL.Image.fromarray(a).save(f, fmt)
display(Image(data=f.getvalue()))
def showtensor(a):
mean = np.arra... | 24.826087 | 61 | 0.607706 | import PIL.Image
from io import BytesIO
from IPython.display import clear_output, Image, display
import numpy as np
def showarray(a, fmt='jpeg'):
a = np.uint8(np.clip(a, 0, 255))
f = BytesIO()
PIL.Image.fromarray(a).save(f, fmt)
display(Image(data=f.getvalue()))
def showtensor(a):
mean = np.arra... | true | true |
f70179383f15ccce81946c10265dbb68c2fdd06a | 2,084 | py | Python | novelsave/settings.py | damare01/novelsave | 7896e8393c944e169e3cb52a33ab81ae396dff9f | [
"Apache-2.0"
] | 12 | 2021-08-25T04:37:53.000Z | 2022-01-28T03:06:17.000Z | novelsave/settings.py | damare01/novelsave | 7896e8393c944e169e3cb52a33ab81ae396dff9f | [
"Apache-2.0"
] | 18 | 2021-08-24T20:02:16.000Z | 2022-03-29T06:55:53.000Z | novelsave/settings.py | damare01/novelsave | 7896e8393c944e169e3cb52a33ab81ae396dff9f | [
"Apache-2.0"
] | 6 | 2021-10-03T11:31:08.000Z | 2022-03-29T07:28:49.000Z | import mimetypes
from pathlib import Path
from appdirs import user_config_dir
from tqdm import tqdm
NAME = "novelsave"
AUTHOR = "Mensch272"
# base project directory
BASE_DIR = Path(__file__).resolve().parent.parent
STATIC_DIR = BASE_DIR / "novelsave/resources"
# operating system specific configuration file
# confi... | 23.41573 | 77 | 0.580134 | import mimetypes
from pathlib import Path
from appdirs import user_config_dir
from tqdm import tqdm
NAME = "novelsave"
AUTHOR = "Mensch272"
BASE_DIR = Path(__file__).resolve().parent.parent
STATIC_DIR = BASE_DIR / "novelsave/resources"
CONFIG_DIR = Path(user_config_dir(NAME, AUTHOR))
CONFIG_FILE = CONFIG_DIR / ... | true | true |
f70179c22847bf238ffe9a36a60ad35690b1309c | 1,775 | py | Python | newschimp/core.py | sputnikus/newschimp | 8de77e4eb8054ea599b73f9c99fb494818736445 | [
"MIT"
] | 2 | 2016-03-11T01:14:27.000Z | 2016-09-13T16:49:15.000Z | newschimp/core.py | sputnikus/newschimp | 8de77e4eb8054ea599b73f9c99fb494818736445 | [
"MIT"
] | 3 | 2021-03-22T17:12:24.000Z | 2021-12-13T19:39:41.000Z | newschimp/core.py | sputnikus/newschimp | 8de77e4eb8054ea599b73f9c99fb494818736445 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import os
import sys
import click
from newschimp import renderer, sender
from newschimp.social import fb, gg, lanyrd
from newschimp.cli import cli_group
from newschimp.utils import ComplexCLI, load_settings
LOGGER = logging.getLogger(__name__)
def create... | 31.696429 | 77 | 0.71662 |
import logging
import os
import sys
import click
from newschimp import renderer, sender
from newschimp.social import fb, gg, lanyrd
from newschimp.cli import cli_group
from newschimp.utils import ComplexCLI, load_settings
LOGGER = logging.getLogger(__name__)
def create_newsletter(settings):
context = {}
... | true | true |
f70179f8b9a5ed39f8e3e2daa4c9d420a7b278e5 | 1,044 | py | Python | setup.py | vladiscripts/flightaware | bc3d25667475c8efbf6603cd93151e7e03b6d1b4 | [
"MIT"
] | 1 | 2016-09-28T12:56:06.000Z | 2016-09-28T12:56:06.000Z | setup.py | vladiscripts/flightaware | bc3d25667475c8efbf6603cd93151e7e03b6d1b4 | [
"MIT"
] | null | null | null | setup.py | vladiscripts/flightaware | bc3d25667475c8efbf6603cd93151e7e03b6d1b4 | [
"MIT"
] | 1 | 2020-06-23T06:15:52.000Z | 2020-06-23T06:15:52.000Z | try:
from setuptools import setup
except ImportError:
from distutils.core import setup
PACKAGE = "flightaware"
NAME = "flightaware"
DESCRIPTION = "A python REST interface for flightaware data"
AUTHOR = "Fred Palmer"
AUTHOR_EMAIL = "fred.palmer@gmail.com"
URL = "https://github.com/fredpalmer/flightaware"
confi... | 26.1 | 80 | 0.62069 | try:
from setuptools import setup
except ImportError:
from distutils.core import setup
PACKAGE = "flightaware"
NAME = "flightaware"
DESCRIPTION = "A python REST interface for flightaware data"
AUTHOR = "Fred Palmer"
AUTHOR_EMAIL = "fred.palmer@gmail.com"
URL = "https://github.com/fredpalmer/flightaware"
confi... | true | true |
f7017a0b4139dd7ff8f485a857901a8d0d68104d | 268 | py | Python | tests/artificial/transf_Quantization/trend_Lag1Trend/cycle_30/ar_12/test_artificial_32_Quantization_Lag1Trend_30_12_20.py | shaido987/pyaf | b9afd089557bed6b90b246d3712c481ae26a1957 | [
"BSD-3-Clause"
] | 377 | 2016-10-13T20:52:44.000Z | 2022-03-29T18:04:14.000Z | tests/artificial/transf_Quantization/trend_Lag1Trend/cycle_30/ar_12/test_artificial_32_Quantization_Lag1Trend_30_12_20.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 160 | 2016-10-13T16:11:53.000Z | 2022-03-28T04:21:34.000Z | tests/artificial/transf_Quantization/trend_Lag1Trend/cycle_30/ar_12/test_artificial_32_Quantization_Lag1Trend_30_12_20.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 63 | 2017-03-09T14:51:18.000Z | 2022-03-27T20:52:57.000Z | import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "Lag1Trend", cycle_length = 30, transform = "Quantization", sigma = 0.0, exog_count = 20, ar_order = 12); | 38.285714 | 168 | 0.735075 | import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "Lag1Trend", cycle_length = 30, transform = "Quantization", sigma = 0.0, exog_count = 20, ar_order = 12); | true | true |
f7017af6c3cdf3b84c5e4f104a6d25cb9b08d77a | 9,779 | py | Python | lithops/storage/backends/swift/swift.py | Damian-MG/lithops | d2d2a83527671d64a445411bc47843b308095b87 | [
"Apache-2.0"
] | 55 | 2018-04-23T09:58:56.000Z | 2020-09-09T11:47:16.000Z | lithops/storage/backends/swift/swift.py | Damian-MG/lithops | d2d2a83527671d64a445411bc47843b308095b87 | [
"Apache-2.0"
] | 256 | 2018-05-20T13:01:51.000Z | 2020-09-16T09:09:54.000Z | lithops/storage/backends/swift/swift.py | Damian-MG/lithops | d2d2a83527671d64a445411bc47843b308095b87 | [
"Apache-2.0"
] | 35 | 2018-04-23T09:07:57.000Z | 2020-08-12T13:43:06.000Z | #
# (C) Copyright IBM Corp. 2020
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 36.901887 | 109 | 0.583495 |
import os
import json
import shutil
import logging
import requests
from lithops.storage.utils import StorageNoSuchKeyError
from lithops.utils import sizeof_fmt
from lithops.constants import STORAGE_CLI_MSG
logger = logging.getLogger(__name__)
class StorageBackend:
def __init__(self, swift_config... | true | true |
f7017b8db9e3fad17b386ca08b520a4ce52d409f | 7,307 | py | Python | rpcore/render_stage.py | serkkz/RenderPipeline | cecd14632150f607c0a89401287f74c68d77b15d | [
"MIT"
] | null | null | null | rpcore/render_stage.py | serkkz/RenderPipeline | cecd14632150f607c0a89401287f74c68d77b15d | [
"MIT"
] | null | null | null | rpcore/render_stage.py | serkkz/RenderPipeline | cecd14632150f607c0a89401287f74c68d77b15d | [
"MIT"
] | null | null | null | """
RenderPipeline
Copyright (c) 2014-2016 tobspr <tobias.springer1@gmail.com>
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... | 41.517045 | 84 | 0.66799 |
from rpcore.render_target import RenderTarget
from rpcore.loader import RPLoader
class RenderStage():
required_inputs = []
required_pipes = []
produced_inputs = {}
produced_pipes = {}
produced_defines = {}
disabled = False
def __init__(self, pipeline):
self.stage_id = self.__... | true | true |
f7017bfdb0cd9b92d160e04e3ef909806fba71cd | 5,304 | py | Python | tests/integration/actions/inventory/base.py | LaudateCorpus1/ansible-navigator | 28cdea13dba3e9039382eb993989db4b3e61b237 | [
"Apache-2.0"
] | null | null | null | tests/integration/actions/inventory/base.py | LaudateCorpus1/ansible-navigator | 28cdea13dba3e9039382eb993989db4b3e61b237 | [
"Apache-2.0"
] | null | null | null | tests/integration/actions/inventory/base.py | LaudateCorpus1/ansible-navigator | 28cdea13dba3e9039382eb993989db4b3e61b237 | [
"Apache-2.0"
] | null | null | null | """Base class for inventory interactive/stdout tests.
"""
import difflib
import json
import os
import pytest
from ....defaults import FIXTURES_DIR
from ..._common import fixture_path_from_request
from ..._common import update_fixtures
from ..._interactions import SearchFor
from ..._interactions import Step
from ..._t... | 41.76378 | 100 | 0.651584 | import difflib
import json
import os
import pytest
from ....defaults import FIXTURES_DIR
from ..._common import fixture_path_from_request
from ..._common import update_fixtures
from ..._interactions import SearchFor
from ..._interactions import Step
from ..._tmux_session import TmuxSession
TEST_FIXTURE_DIR = os.pat... | true | true |
f7017f4f4ad299560711cdd1fb4c0b007148e3da | 5,747 | py | Python | salt/states/libcloud_loadbalancer.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | 5 | 2017-02-07T05:39:29.000Z | 2020-06-13T02:07:33.000Z | salt/states/libcloud_loadbalancer.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | 86 | 2017-01-27T11:54:46.000Z | 2020-05-20T06:25:26.000Z | salt/states/libcloud_loadbalancer.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | 11 | 2017-01-26T19:36:29.000Z | 2021-12-11T07:54:16.000Z | # -*- coding: utf-8 -*-
'''
Apache Libcloud Load Balancer State
===================================
Manage load balancers using libcloud
:codeauthor: ``Anthony Shaw <anthonyshaw@apache.org>``
Apache Libcloud load balancer management for a full list
of supported clouds, see http://libcloud.readthedocs.io/en/lates... | 31.576923 | 132 | 0.65669 |
from __future__ import absolute_import, unicode_literals, print_function
import logging
import salt.utils.compat
log = logging.getLogger(__name__)
def __virtual__():
return True
def __init__(opts):
salt.utils.compat.pack_dunder(__name__)
def state_result(result, message, name, changes=None):
if ... | true | true |
f7017fa3cd00892a2d9a04db6d620ac61486f985 | 7,245 | py | Python | silex_client/utils/parameter_types.py | ArtFXDev/silex_client | 657d594dcfec79e7c8f4053df9d4a5dbc0c9ac50 | [
"MIT"
] | 10 | 2021-09-21T03:26:45.000Z | 2022-03-19T00:30:03.000Z | silex_client/utils/parameter_types.py | ArtFXDev/silex_dcc | 657d594dcfec79e7c8f4053df9d4a5dbc0c9ac50 | [
"MIT"
] | 66 | 2021-09-17T09:54:23.000Z | 2022-03-29T23:31:17.000Z | silex_client/utils/parameter_types.py | ArtFXDev/silex_dcc | 657d594dcfec79e7c8f4053df9d4a5dbc0c9ac50 | [
"MIT"
] | null | null | null | import pathlib
from silex_client.utils.log import logger
class AnyParameter(object):
def __new__(cls, value):
return value
class CommandParameterMeta(type):
def __new__(cls, name: str, bases: tuple, dct: dict):
def serialize():
return {
"name": "parameter",
... | 26.25 | 113 | 0.557902 | import pathlib
from silex_client.utils.log import logger
class AnyParameter(object):
def __new__(cls, value):
return value
class CommandParameterMeta(type):
def __new__(cls, name: str, bases: tuple, dct: dict):
def serialize():
return {
"name": "parameter",
... | true | true |
f701801fce4e0791e2126e82c19b415fb5f428d4 | 761 | py | Python | atcoder/abc/abc154_e.py | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | 1 | 2018-11-12T15:18:55.000Z | 2018-11-12T15:18:55.000Z | atcoder/abc/abc154_e.py | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | null | null | null | atcoder/abc/abc154_e.py | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | null | null | null | N = input()
L = len(N)
K = int(input())
dp = [[[0] * 2 for _ in range(K + 1)] for _ in range(L + 1)]
dp[0][0][1] = 1
for i, x in zip(range(L), map(int, N)):
for k in range(K):
dp[i+1][k][0] += dp[i][k][0] # d == 0
if x == 0:
dp[i+1][k][1] += dp[i][k][1]
elif x > 0:
d... | 29.269231 | 60 | 0.341656 | N = input()
L = len(N)
K = int(input())
dp = [[[0] * 2 for _ in range(K + 1)] for _ in range(L + 1)]
dp[0][0][1] = 1
for i, x in zip(range(L), map(int, N)):
for k in range(K):
dp[i+1][k][0] += dp[i][k][0]
if x == 0:
dp[i+1][k][1] += dp[i][k][1]
elif x > 0:
dp[i+1][k... | true | true |
f70180b809d83d1f2352aa742abe4ed55f91163a | 58 | py | Python | config.py | marcelom/slask | 5125d7e74932d5d0151323e935d9586cbc037f8f | [
"MIT"
] | 1 | 2015-01-28T06:05:56.000Z | 2015-01-28T06:05:56.000Z | config.py | marcelom/slask | 5125d7e74932d5d0151323e935d9586cbc037f8f | [
"MIT"
] | null | null | null | config.py | marcelom/slask | 5125d7e74932d5d0151323e935d9586cbc037f8f | [
"MIT"
] | null | null | null | config = {
"username": 'slask',
"icon": ":poop:",
}
| 11.6 | 23 | 0.465517 | config = {
"username": 'slask',
"icon": ":poop:",
}
| true | true |
f7018100d9e5b0dbbe8bcdafc3c55ae95bd3df34 | 5,553 | py | Python | datasets/vqa_v2.py | TopCoder2K/mdetr | aedfd63f550ae36d1477484c489a2aa438d10aa3 | [
"Apache-2.0"
] | 2 | 2022-02-22T05:11:00.000Z | 2022-03-30T18:59:50.000Z | datasets/vqa_v2.py | TopCoder2K/mdetr | aedfd63f550ae36d1477484c489a2aa438d10aa3 | [
"Apache-2.0"
] | null | null | null | datasets/vqa_v2.py | TopCoder2K/mdetr | aedfd63f550ae36d1477484c489a2aa438d10aa3 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Aishwarya Kamath & Nicolas Carion. Licensed under the Apache License 2.0. All Rights Reserved
"""
COCO dataset which returns image_id for evaluation.
Mostly copy-paste from https://github.com/ashkamath/mdetr/blob/main/datasets/gqa.py
"""
import json
from pathlib import Path
import torch
import torchvi... | 39.664286 | 109 | 0.60886 |
import json
from pathlib import Path
import torch
import torchvision
from transformers import RobertaTokenizerFast
from .coco import ConvertCocoPolysToMask, ModulatedDetection, make_coco_transforms
class VQAv2Detection(ModulatedDetection):
pass
class VQAv2QuestionAnswering(torchvision.datasets.CocoDetection):
... | true | true |
f701820b9d872f8eac52d86e40473c2034a80a09 | 2,240 | py | Python | tests/commands/test_admin.py | TheGoodlike13/sahyun-bot | 8ebc3d4e58a0acf9bde3c9ea8339145abcc53fcb | [
"MIT"
] | 1 | 2022-02-21T18:55:34.000Z | 2022-02-21T18:55:34.000Z | tests/commands/test_admin.py | TheGoodlike13/sahyun-bot | 8ebc3d4e58a0acf9bde3c9ea8339145abcc53fcb | [
"MIT"
] | null | null | null | tests/commands/test_admin.py | TheGoodlike13/sahyun-bot | 8ebc3d4e58a0acf9bde3c9ea8339145abcc53fcb | [
"MIT"
] | null | null | null | from assertpy import assert_that
from httmock import HTTMock
from sahyun_bot.commands.admin import Index, Rank
from sahyun_bot.users_settings import UserRank
from tests.mock_customsforge import customsforge
def test_require_admin(commander, hook):
for command in ['!lock', '!index', '!rank']:
with command... | 34.461538 | 96 | 0.710714 | from assertpy import assert_that
from httmock import HTTMock
from sahyun_bot.commands.admin import Index, Rank
from sahyun_bot.users_settings import UserRank
from tests.mock_customsforge import customsforge
def test_require_admin(commander, hook):
for command in ['!lock', '!index', '!rank']:
with command... | true | true |
f701836e504ea4264dcd26c30d57e1b8dca9025b | 3,075 | py | Python | gogamechen3/api/rpc/taskflow/__init__.py | lolizeppelin/gogamechen3 | 4ff06f9042f1bb0cc22e1cc0b342967a829ae0f8 | [
"MIT"
] | null | null | null | gogamechen3/api/rpc/taskflow/__init__.py | lolizeppelin/gogamechen3 | 4ff06f9042f1bb0cc22e1cc0b342967a829ae0f8 | [
"MIT"
] | null | null | null | gogamechen3/api/rpc/taskflow/__init__.py | lolizeppelin/gogamechen3 | 4ff06f9042f1bb0cc22e1cc0b342967a829ae0f8 | [
"MIT"
] | null | null | null | import os
import base64
from simpleutil.utils import digestutils
from goperation.filemanager import LocalFile
from goperation.manager.rpc.agent.application.taskflow.middleware import EntityMiddleware
from goperation.manager.rpc.agent.application.taskflow.database import Database
from goperation.manager.rpc.agent.appl... | 35.344828 | 100 | 0.626992 | import os
import base64
from simpleutil.utils import digestutils
from goperation.filemanager import LocalFile
from goperation.manager.rpc.agent.application.taskflow.middleware import EntityMiddleware
from goperation.manager.rpc.agent.application.taskflow.database import Database
from goperation.manager.rpc.agent.appl... | true | true |
f7018457af97cde20bee525c029ee91da68c58d8 | 2,647 | py | Python | Libraries/XML.py | CoolCat467/MineOS-Python3-Port | 39a6b4c1fcca7165501c8c2c77c5e10b208830d8 | [
"MIT"
] | null | null | null | Libraries/XML.py | CoolCat467/MineOS-Python3-Port | 39a6b4c1fcca7165501c8c2c77c5e10b208830d8 | [
"MIT"
] | null | null | null | Libraries/XML.py | CoolCat467/MineOS-Python3-Port | 39a6b4c1fcca7165501c8c2c77c5e10b208830d8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# XML API, for dealing with XML strings
# -*- coding: utf-8 -*-
__all__ = ['parseargs', 'collect']
'<users>\n\t<user>\n\t\t<id>1</id>\n\t\t<name>Fred</name>\n\t\t<salary>500000</salary>\n\t</user>\n\t<user>\n\t\t<id>1</id>\n\t\t<name>ScienceCat</name>\n\t\t<salary>500000</salary>\n\t</user>\n\t... | 28.771739 | 291 | 0.491878 |
__all__ = ['parseargs', 'collect']
xmlex = '<users>\n<user>\n<id>1</id>\n<name>Fred</name>\n<salary>500000</salary>\n</user>\n<user>\n<id>1</id>\n<name>ScienceCat</name>\n<salary>500000</salary>\n</user>\n<user>\n<id>1</id>\n<name>Bob</name>\n<salary>500000</salary>\n</user>\n</users>'
argex = 'cats="True and Sand... | true | true |
f70184ed31796ae9bea068a1768eac058c99e2d0 | 3,165 | py | Python | scripts/local_test_http_function.py | sanserg/fun-anomaly | 8b07f3f393cd60dbcff3f3fa0bebe11ced5f6a5d | [
"Apache-2.0"
] | null | null | null | scripts/local_test_http_function.py | sanserg/fun-anomaly | 8b07f3f393cd60dbcff3f3fa0bebe11ced5f6a5d | [
"Apache-2.0"
] | null | null | null | scripts/local_test_http_function.py | sanserg/fun-anomaly | 8b07f3f393cd60dbcff3f3fa0bebe11ced5f6a5d | [
"Apache-2.0"
] | null | null | null | import json
import logging
from sqlalchemy import Column, Integer, String, Float, DateTime, Boolean, func
from iotfunctions import bif
from ai.functions import SimpleAnomaly
from iotfunctions.metadata import EntityType
from iotfunctions.db import Database
from iotfunctions.enginelog import EngineLogging
from custom imp... | 36.37931 | 110 | 0.68752 | import json
import logging
from sqlalchemy import Column, Integer, String, Float, DateTime, Boolean, func
from iotfunctions import bif
from ai.functions import SimpleAnomaly
from iotfunctions.metadata import EntityType
from iotfunctions.db import Database
from iotfunctions.enginelog import EngineLogging
from custom imp... | true | true |
f70184f57fcc71d87ff6ce78f33efc207b7ef96b | 4,810 | py | Python | modoboa_amavis/factories.py | modoboa/modoboa-amavis | 18e5a210ac2eb007ce28d70675f4188d93e1b822 | [
"MIT"
] | 22 | 2015-05-01T09:09:11.000Z | 2021-03-20T03:11:49.000Z | modoboa_amavis/factories.py | modoboa/modoboa-amavis | 18e5a210ac2eb007ce28d70675f4188d93e1b822 | [
"MIT"
] | 138 | 2015-04-30T16:59:47.000Z | 2022-03-13T13:46:28.000Z | modoboa_amavis/factories.py | modoboa/modoboa-amavis | 18e5a210ac2eb007ce28d70675f4188d93e1b822 | [
"MIT"
] | 18 | 2015-05-05T10:27:23.000Z | 2021-09-19T23:58:59.000Z | # -*- coding: utf-8 -*-
"""Amavis factories."""
from __future__ import unicode_literals
import datetime
import time
import factory
from . import models
from .utils import smart_bytes
SPAM_BODY = """X-Envelope-To: <{rcpt}>
X-Envelope-To-Blocked: <{rcpt}>
X-Quarantine-ID: <nq6ekd4wtXZg>
X-Spam-Flag: YES
X-Spam-Scor... | 28.802395 | 78 | 0.685863 |
from __future__ import unicode_literals
import datetime
import time
import factory
from . import models
from .utils import smart_bytes
SPAM_BODY = """X-Envelope-To: <{rcpt}>
X-Envelope-To-Blocked: <{rcpt}>
X-Quarantine-ID: <nq6ekd4wtXZg>
X-Spam-Flag: YES
X-Spam-Score: 1000.985
X-Spam-Level: *********************... | true | true |
f701858d90987f1f596d9d74d126ce475a127ae0 | 2,414 | py | Python | scripts/mkgti.py | ZaynabGhazi/NICERsoft | c1e467b807226f091e82cd0e3ab0ce6b7a476610 | [
"MIT"
] | null | null | null | scripts/mkgti.py | ZaynabGhazi/NICERsoft | c1e467b807226f091e82cd0e3ab0ce6b7a476610 | [
"MIT"
] | null | null | null | scripts/mkgti.py | ZaynabGhazi/NICERsoft | c1e467b807226f091e82cd0e3ab0ce6b7a476610 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from __future__ import print_function, division
import os, sys
import matplotlib.pyplot as plt
import numpy as np
import argparse
from astropy import log
from os import path
from glob import glob
from subprocess import check_call
import shutil
from astropy.table import Table
from astropy.io import... | 35.5 | 131 | 0.677713 |
from __future__ import print_function, division
import os, sys
import matplotlib.pyplot as plt
import numpy as np
import argparse
from astropy import log
from os import path
from glob import glob
from subprocess import check_call
import shutil
from astropy.table import Table
from astropy.io import fits
from nicer.val... | true | true |
f70185a7b8ced19854c2172d3abd8153b1d14a41 | 4,268 | py | Python | deplatformr/views/filecoin_views.py | deplatformer/prototype | d755624ef2828a9c4b99cad53cc6013e4572e4d2 | [
"MIT"
] | null | null | null | deplatformr/views/filecoin_views.py | deplatformer/prototype | d755624ef2828a9c4b99cad53cc6013e4572e4d2 | [
"MIT"
] | 1 | 2021-02-10T02:26:02.000Z | 2021-02-10T02:26:02.000Z | deplatformr/views/filecoin_views.py | deplatformer/prototype | d755624ef2828a9c4b99cad53cc6013e4572e4d2 | [
"MIT"
] | 1 | 2021-06-28T14:42:56.000Z | 2021-06-28T14:42:56.000Z | import os
from datetime import datetime
from flask import Flask, render_template, flash, safe_join, send_file
from flask_user import login_required, current_user
from werkzeug.utils import secure_filename
from pygate_grpc.client import PowerGateClient
from deplatformr.models.filecoin_models import Ffs, Files, Logs
from... | 33.873016 | 111 | 0.646204 | import os
from datetime import datetime
from flask import Flask, render_template, flash, safe_join, send_file
from flask_user import login_required, current_user
from werkzeug.utils import secure_filename
from pygate_grpc.client import PowerGateClient
from deplatformr.models.filecoin_models import Ffs, Files, Logs
from... | true | true |
f70185ea6fa1e1036a31fb85275e059609151a59 | 787 | py | Python | setup.py | charles-marceau/msnexport | 9a130f83652824c27fde48cc28d7d0dc8da831d7 | [
"MIT"
] | null | null | null | setup.py | charles-marceau/msnexport | 9a130f83652824c27fde48cc28d7d0dc8da831d7 | [
"MIT"
] | null | null | null | setup.py | charles-marceau/msnexport | 9a130f83652824c27fde48cc28d7d0dc8da831d7 | [
"MIT"
] | null | null | null | from setuptools import find_packages, setup
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='msnexport',
version='0.1',
license="MIT",
classifiers=["Programming Language :: Python :: 3.7"],
author='Charles Marceau',
author_email='charlesmarceau3@gmail.com',
... | 26.233333 | 58 | 0.651842 | from setuptools import find_packages, setup
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='msnexport',
version='0.1',
license="MIT",
classifiers=["Programming Language :: Python :: 3.7"],
author='Charles Marceau',
author_email='charlesmarceau3@gmail.com',
... | true | true |
f7018712ee7626943f710f00b08771e4841e72e4 | 3,983 | py | Python | Payload_Type/apollo/mythic/agent_functions/inject.py | n0pe-sled/Apollo | cfc5804d163e1b47f6614321434a717b2bd2066f | [
"BSD-3-Clause"
] | null | null | null | Payload_Type/apollo/mythic/agent_functions/inject.py | n0pe-sled/Apollo | cfc5804d163e1b47f6614321434a717b2bd2066f | [
"BSD-3-Clause"
] | null | null | null | Payload_Type/apollo/mythic/agent_functions/inject.py | n0pe-sled/Apollo | cfc5804d163e1b47f6614321434a717b2bd2066f | [
"BSD-3-Clause"
] | null | null | null | from mythic_payloadtype_container.MythicCommandBase import *
import json
from mythic_payloadtype_container.MythicRPC import *
import base64
class InjectArguments(TaskArguments):
def __init__(self, command_line):
super().__init__(command_line)
self.args = {
"template": CommandParameter(... | 49.17284 | 198 | 0.581471 | from mythic_payloadtype_container.MythicCommandBase import *
import json
from mythic_payloadtype_container.MythicRPC import *
import base64
class InjectArguments(TaskArguments):
def __init__(self, command_line):
super().__init__(command_line)
self.args = {
"template": CommandParameter(... | true | true |
f7018880849f101375cb5c61af38b6fbdabcf866 | 1,045 | py | Python | src/data/gbm.py | imanolperez/optimal-double-execution | b380087765925043b01fe2f1066e5e2d1d850cf9 | [
"MIT"
] | 4 | 2020-05-20T13:56:36.000Z | 2021-01-05T12:41:47.000Z | src/data/gbm.py | imanolperez/optimal-double-execution | b380087765925043b01fe2f1066e5e2d1d850cf9 | [
"MIT"
] | null | null | null | src/data/gbm.py | imanolperez/optimal-double-execution | b380087765925043b01fe2f1066e5e2d1d850cf9 | [
"MIT"
] | 3 | 2020-07-02T17:52:05.000Z | 2022-03-15T14:07:08.000Z | import numpy as np
from .base import Price
class GBM(Price):
"""Brownian motion."""
def __init__(self, T=1., sigma1=0.02, sigma2=0.01, s1=1., s2=1.,
drift1=0., drift2=0., n=100):
self.sigma1 = sigma1
self.sigma2 = sigma2
self.drift1 = drift1
self.drift2 = drift... | 30.735294 | 106 | 0.507177 | import numpy as np
from .base import Price
class GBM(Price):
def __init__(self, T=1., sigma1=0.02, sigma2=0.01, s1=1., s2=1.,
drift1=0., drift2=0., n=100):
self.sigma1 = sigma1
self.sigma2 = sigma2
self.drift1 = drift1
self.drift2 = drift2
self.n = n
... | true | true |
f7018a9b751e10e71b44550771f8a399e9aa4f9a | 22,519 | py | Python | experiments/validation_wrapper.py | aquemy/HCBR | bc61cf0ca0629119c8d29b146890873f92a46835 | [
"MIT"
] | 5 | 2018-03-20T09:59:13.000Z | 2020-09-17T05:45:05.000Z | experiments/validation_wrapper.py | aquemy/HCBR | bc61cf0ca0629119c8d29b146890873f92a46835 | [
"MIT"
] | null | null | null | experiments/validation_wrapper.py | aquemy/HCBR | bc61cf0ca0629119c8d29b146890873f92a46835 | [
"MIT"
] | 3 | 2020-05-03T23:33:24.000Z | 2020-11-10T18:54:14.000Z | import json
import os, errno
import sys
import time
import shutil
import subprocess
from subprocess import Popen, PIPE
EXECUTABLE = 'hcbr_learning'
BUILD_FOLDER = '../build'
DATA_FOLDER = '../data'
KFOLD_SCRIPT = 'kfold_validation.py'
ACCURACY_ROW = 4
#METAOPTIMIZATION = '../tuning/hyperopt_wrapper.py'
#METAOPTIMIZAT... | 52.369767 | 185 | 0.607931 | import json
import os, errno
import sys
import time
import shutil
import subprocess
from subprocess import Popen, PIPE
EXECUTABLE = 'hcbr_learning'
BUILD_FOLDER = '../build'
DATA_FOLDER = '../data'
KFOLD_SCRIPT = 'kfold_validation.py'
ACCURACY_ROW = 4
METAOPTIMIZATION = '../script/genetic_algorithm.py'
def conver... | true | true |
f7018ac86c15a5146e9c8fcde8a6f279fdfb8f77 | 4,302 | py | Python | bpycv/scene_setting.py | Avinash2468/bpycv | 3638e58dfba7ce6397a6422cfb96173cee74db50 | [
"MIT"
] | 1 | 2021-05-04T15:13:38.000Z | 2021-05-04T15:13:38.000Z | bpycv/scene_setting.py | ethnhe/bpycv | f91373855c1fb6534fd240461af76ab0076f8330 | [
"MIT"
] | null | null | null | bpycv/scene_setting.py | ethnhe/bpycv | f91373855c1fb6534fd240461af76ab0076f8330 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: DIYer22@github
@mail: ylxx@live.com
Created on Thu Jan 16 18:17:20 2020
"""
from boxx import *
from boxx import deg2rad, np, pi
import bpy
import random
def set_cam_pose(cam_radius=1, cam_deg=45, cam_x_deg=None, cam=None):
cam_rad = deg2rad(cam_deg)
... | 29.265306 | 83 | 0.615993 |
from boxx import *
from boxx import deg2rad, np, pi
import bpy
import random
def set_cam_pose(cam_radius=1, cam_deg=45, cam_x_deg=None, cam=None):
cam_rad = deg2rad(cam_deg)
if cam_x_deg is None:
cam_x_deg = random.uniform(0, 360)
cam_x_rad = deg2rad(cam_x_deg)
z = cam_radius * np.sin(cam_... | true | true |
f7018bb7234e923366e80dfdf0fde1be51c3f094 | 25,751 | py | Python | generator/txmultigeneratormultisite.py | zarppy/MUREIL_2014 | 25ba16554ce8f614b9337e0fffce75da3fa259a4 | [
"MIT"
] | null | null | null | generator/txmultigeneratormultisite.py | zarppy/MUREIL_2014 | 25ba16554ce8f614b9337e0fffce75da3fa259a4 | [
"MIT"
] | null | null | null | generator/txmultigeneratormultisite.py | zarppy/MUREIL_2014 | 25ba16554ce8f614b9337e0fffce75da3fa259a4 | [
"MIT"
] | null | null | null | #
#
# Copyright (C) University of Melbourne 2013
#
#
#
#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... | 41.533871 | 127 | 0.604015 |
from tools import mureilexception, mureilbuilder
import copy
import numpy
from generator import txmultigeneratorbase
import logging
logger = logging.getLogger(__name__)
class TxMultiGeneratorMultiSite(txmultigeneratorbase.TxMultiGeneratorBase):
def __init__(self):
... | true | true |
f7018c4dff48a441d964a2ebd1a3bec5932d5d50 | 6,704 | py | Python | cartoframes/data/observatory/catalog/variable.py | CartoDB/cartoframes | 7c7392be5d15d0472ff428546c4791ed1a3842b0 | [
"BSD-3-Clause"
] | 236 | 2017-02-28T15:17:09.000Z | 2021-12-28T23:29:38.000Z | cartoframes/data/observatory/catalog/variable.py | CartoDB/cartoframes | 7c7392be5d15d0472ff428546c4791ed1a3842b0 | [
"BSD-3-Clause"
] | 1,332 | 2017-02-27T15:34:52.000Z | 2022-03-07T01:31:10.000Z | cartoframes/data/observatory/catalog/variable.py | CartoDB/cartoframes | 7c7392be5d15d0472ff428546c4791ed1a3842b0 | [
"BSD-3-Clause"
] | 63 | 2017-03-14T19:02:37.000Z | 2021-08-03T03:36:05.000Z | import pandas as pd
from .entity import CatalogEntity
from .repository.dataset_repo import get_dataset_repo
from .repository.variable_repo import get_variable_repo
from .repository.constants import VARIABLE_FILTER
from .summary import variable_describe, head, tail, counts, quantiles, top_values, histogram
_DESCRIPTI... | 33.353234 | 117 | 0.602924 | import pandas as pd
from .entity import CatalogEntity
from .repository.dataset_repo import get_dataset_repo
from .repository.variable_repo import get_variable_repo
from .repository.constants import VARIABLE_FILTER
from .summary import variable_describe, head, tail, counts, quantiles, top_values, histogram
_DESCRIPTI... | true | true |
f7018c8e09cd0883cd4c4b032d2a2a08d23843ea | 1,961 | py | Python | Set1/challenge6.py | BKreisel/Matasano-Crypto | 6906d352fda4665cc60fdcfe7b95a3296d313cb6 | [
"MIT"
] | null | null | null | Set1/challenge6.py | BKreisel/Matasano-Crypto | 6906d352fda4665cc60fdcfe7b95a3296d313cb6 | [
"MIT"
] | null | null | null | Set1/challenge6.py | BKreisel/Matasano-Crypto | 6906d352fda4665cc60fdcfe7b95a3296d313cb6 | [
"MIT"
] | null | null | null | from libcrypto import hamming_distance
from libcrypto import split_blocks
from libcrypto import xor
from libcrypto import freq_score
from base64 import b64decode
from operator import itemgetter
def main():
file64 = ""
for line in open("../assets/inputS1C6.txt","r"):
file64 += line.rstrip()
file... | 28.014286 | 75 | 0.559918 | from libcrypto import hamming_distance
from libcrypto import split_blocks
from libcrypto import xor
from libcrypto import freq_score
from base64 import b64decode
from operator import itemgetter
def main():
file64 = ""
for line in open("../assets/inputS1C6.txt","r"):
file64 += line.rstrip()
file... | true | true |
f7018d7d290f789306ee6408d401f7694b5d77f5 | 9,853 | py | Python | ML/tf-cifar-10/cifar10_input.py | PepSalehi/algorithms | 1c20f57185e6324aa840ccff98e69764b4213131 | [
"MIT"
] | null | null | null | ML/tf-cifar-10/cifar10_input.py | PepSalehi/algorithms | 1c20f57185e6324aa840ccff98e69764b4213131 | [
"MIT"
] | null | null | null | ML/tf-cifar-10/cifar10_input.py | PepSalehi/algorithms | 1c20f57185e6324aa840ccff98e69764b4213131 | [
"MIT"
] | 1 | 2019-12-09T21:40:46.000Z | 2019-12-09T21:40:46.000Z | # Copyright 2015 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... | 38.488281 | 80 | 0.703745 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from six.moves import xrange
import tensorflow as tf
IMAGE_SIZE = 24
NUM_CLASSES = 10
NUM_EXAMPLES_PER_EPOCH_FOR_TRAIN = 50000
NUM_EXAMPLES_PER_EPOCH_FOR_EVAL = 10000
def re... | true | true |
f7018e781d7c288b0bd46b3550d3a7ddf6a5d2d6 | 4,842 | py | Python | pulsar/managers/util/cli/job/lsf.py | usegalaxy-eu/pulsar | 4dcaf61cceded8f0a83801cf1e9847e62656809f | [
"Apache-2.0"
] | null | null | null | pulsar/managers/util/cli/job/lsf.py | usegalaxy-eu/pulsar | 4dcaf61cceded8f0a83801cf1e9847e62656809f | [
"Apache-2.0"
] | null | null | null | pulsar/managers/util/cli/job/lsf.py | usegalaxy-eu/pulsar | 4dcaf61cceded8f0a83801cf1e9847e62656809f | [
"Apache-2.0"
] | null | null | null | # A simple CLI runner for slurm that can be used when running Galaxy from a
# non-submit host and using a Slurm cluster.
from logging import getLogger
try:
from galaxy.model import Job
job_states = Job.states
except ImportError:
# Not in Galaxy, map Galaxy job states to Pulsar ones.
from pulsar.util im... | 37.246154 | 98 | 0.581991 |
from logging import getLogger
try:
from galaxy.model import Job
job_states = Job.states
except ImportError:
from pulsar.util import enum
job_states = enum(RUNNING='running', OK='complete', QUEUED='queued', ERROR="failed")
from ..job import BaseJobExec
log = getLogger(__name__)
argmap = {
'... | true | true |
f7018e954099790a05cbbdee6167be18b7c2ecc6 | 10,867 | py | Python | keras_frcnn/densenet.py | Heyjuke58/frcnn-wind-turbine-detection | 29311020188d3a26c8935cae710bd2c5013653ab | [
"Apache-2.0"
] | null | null | null | keras_frcnn/densenet.py | Heyjuke58/frcnn-wind-turbine-detection | 29311020188d3a26c8935cae710bd2c5013653ab | [
"Apache-2.0"
] | null | null | null | keras_frcnn/densenet.py | Heyjuke58/frcnn-wind-turbine-detection | 29311020188d3a26c8935cae710bd2c5013653ab | [
"Apache-2.0"
] | null | null | null | """DenseNet models for Keras.
# Reference paper
- [Densely Connected Convolutional Networks]
(https://arxiv.org/abs/1608.06993) (CVPR 2017 Best Paper Award)
# Reference implementation
- [Torch DenseNets]
(https://github.com/liuzhuang13/DenseNet/blob/master/models/densenet.lua)
- [TensorNets]
(https://gith... | 41.477099 | 155 | 0.625104 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from keras import backend as K
from keras.layers import Input, Add, Dense, Activation, Flatten, Convolution2D, MaxPooling2D, ZeroPadding2D, \
AveragePooling2D, TimeDistributed, BatchNormali... | true | true |
f7019023ce6c6a82f163a45aaf9b53f99160d360 | 3,618 | py | Python | oneartplease.py | schlarpc/oneartplease | 042ced4a57cbd8fd8ca36130ddd8650b0af282e9 | [
"MIT"
] | null | null | null | oneartplease.py | schlarpc/oneartplease | 042ced4a57cbd8fd8ca36130ddd8650b0af282e9 | [
"MIT"
] | null | null | null | oneartplease.py | schlarpc/oneartplease | 042ced4a57cbd8fd8ca36130ddd8650b0af282e9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import gevent.monkey
gevent.monkey.patch_all()
import argparse
import json
import re
import string
import socket
import urllib.parse
import webbrowser
import flask
import gevent.pool
import gevent.pywsgi
import requests
app = flask.Flask(__name__, template_folder='.')
con... | 35.470588 | 108 | 0.647872 |
import gevent.monkey
gevent.monkey.patch_all()
import argparse
import json
import re
import string
import socket
import urllib.parse
import webbrowser
import flask
import gevent.pool
import gevent.pywsgi
import requests
app = flask.Flask(__name__, template_folder='.')
config = {
'host': '1... | true | true |
f701902720c7854f5876c62a4f31115e0d9748bc | 1,100 | py | Python | Coursera/Week.3/Task.13.py | v1nnyb0y/Coursera.BasePython | bbfb3184dc27a4cdb16b087123890991afbc5506 | [
"MIT"
] | null | null | null | Coursera/Week.3/Task.13.py | v1nnyb0y/Coursera.BasePython | bbfb3184dc27a4cdb16b087123890991afbc5506 | [
"MIT"
] | null | null | null | Coursera/Week.3/Task.13.py | v1nnyb0y/Coursera.BasePython | bbfb3184dc27a4cdb16b087123890991afbc5506 | [
"MIT"
] | null | null | null | '''
Система линейных уравнений - 2
'''
a = float(input())
b = float(input())
c = float(input())
d = float(input())
e = float(input())
f = float(input())
if a == 0 and b == 0 and c == 0 and d == 0 and e == 0 and f == 0:
print(5)
elif a * d == b * c and a * f != c * e:
print(0)
elif a == 0 and b == 0 and e != 0:
... | 24.444444 | 65 | 0.377273 | a = float(input())
b = float(input())
c = float(input())
d = float(input())
e = float(input())
f = float(input())
if a == 0 and b == 0 and c == 0 and d == 0 and e == 0 and f == 0:
print(5)
elif a * d == b * c and a * f != c * e:
print(0)
elif a == 0 and b == 0 and e != 0:
print(0)
elif c == 0 and d == 0 and... | true | true |
f701930267eb677de0ff92fb8288386877a8c15a | 4,824 | py | Python | bopy/spec/lamost.py | hypergravity/bopy | 90cf5bf695c4ae4f53d9a9bec7cdc9ba16994267 | [
"BSD-3-Clause"
] | 1 | 2016-03-11T02:16:34.000Z | 2016-03-11T02:16:34.000Z | bopy/spec/lamost.py | hypergravity/bopy | 90cf5bf695c4ae4f53d9a9bec7cdc9ba16994267 | [
"BSD-3-Clause"
] | 4 | 2016-01-22T14:44:47.000Z | 2016-12-16T11:07:31.000Z | bopy/spec/lamost.py | hypergravity/bopy | 90cf5bf695c4ae4f53d9a9bec7cdc9ba16994267 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Author
------
Bo Zhang
Email
-----
bozhang@nao.cas.cn
Created on
----------
- Fri Jul 3 13:13:06 2015 read_spectrum
Modifications
-------------
- Fri Nov 20 10:16:59 2015 reformatting code
- Sun Feb 28 14:39:16 2016 migrated to bopy.spec.lamost
- Fri Jul 15 16:08:00 2016 mig... | 27.409091 | 78 | 0.541459 |
import os
import numpy as np
def lamost_filepath(planid, mjd, spid, fiberid, dirpath="", extname=".fits"):
if np.isscalar(planid):
planid = planid.strip()
else:
planid = [_.strip() for _ in planid]
if dirpath == "" or dirpath is None:
if np.isscalar(mjd):
... | true | true |
f70193699f0c4868dccc5ae5430f654b94ba4982 | 1,760 | py | Python | moonstone/normalization/reads/base.py | motleystate/moonstone | 37c38fabf361722f7002626ef13c68c443ace4ac | [
"MIT"
] | null | null | null | moonstone/normalization/reads/base.py | motleystate/moonstone | 37c38fabf361722f7002626ef13c68c443ace4ac | [
"MIT"
] | 84 | 2020-07-27T13:01:12.000Z | 2022-03-16T17:10:23.000Z | moonstone/normalization/reads/base.py | motleystate/moonstone | 37c38fabf361722f7002626ef13c68c443ace4ac | [
"MIT"
] | null | null | null | class BaseDownsizing:
def __init__(self, raw_file_f, raw_file_r=None):
self.raw_file_f = raw_file_f
self.raw_file_f = raw_file_f
self._downsized_f = None
if raw_file_r:
self.raw_file_r = raw_file_r
self.raw_file_r = raw_file_r
self._downsized_r = ... | 38.26087 | 110 | 0.673864 | class BaseDownsizing:
def __init__(self, raw_file_f, raw_file_r=None):
self.raw_file_f = raw_file_f
self.raw_file_f = raw_file_f
self._downsized_f = None
if raw_file_r:
self.raw_file_r = raw_file_r
self.raw_file_r = raw_file_r
self._downsized_r = ... | true | true |
f701939035f7fb6a21d19379da73cb9e2f9f3826 | 23,293 | py | Python | netbox/dcim/api/views.py | aslafy-z/netbox | a5512dd4c46c005df8752fc330c1382ac22b31ea | [
"Apache-2.0"
] | null | null | null | netbox/dcim/api/views.py | aslafy-z/netbox | a5512dd4c46c005df8752fc330c1382ac22b31ea | [
"Apache-2.0"
] | null | null | null | netbox/dcim/api/views.py | aslafy-z/netbox | a5512dd4c46c005df8752fc330c1382ac22b31ea | [
"Apache-2.0"
] | null | null | null | from collections import OrderedDict
from django.conf import settings
from django.db.models import Count, F
from django.http import HttpResponseForbidden, HttpResponse
from django.shortcuts import get_object_or_404
from drf_yasg import openapi
from drf_yasg.openapi import Parameter
from drf_yasg.utils import swagger_au... | 35.027068 | 117 | 0.710814 | from collections import OrderedDict
from django.conf import settings
from django.db.models import Count, F
from django.http import HttpResponseForbidden, HttpResponse
from django.shortcuts import get_object_or_404
from drf_yasg import openapi
from drf_yasg.openapi import Parameter
from drf_yasg.utils import swagger_au... | true | true |
f70193fe6ae26eba52826e7bbf17c7d0494676aa | 1,305 | py | Python | sa/profiles/Angtel/Topaz/get_interface_status.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 84 | 2017-10-22T11:01:39.000Z | 2022-02-27T03:43:48.000Z | sa/profiles/Angtel/Topaz/get_interface_status.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 22 | 2017-12-11T07:21:56.000Z | 2021-09-23T02:53:50.000Z | sa/profiles/Angtel/Topaz/get_interface_status.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 23 | 2017-12-06T06:59:52.000Z | 2022-02-24T00:02:25.000Z | # ---------------------------------------------------------------------
# Angtel.Topaz.get_interface_status
# ---------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
... | 35.27027 | 100 | 0.508812 |
import re
from noc.core.script.base import BaseScript
from noc.sa.interfaces.igetinterfacestatus import IGetInterfaceStatus
class Script(BaseScript):
name = "Angtel.Topaz.get_interface_status"
interface = IGetInterfaceStatus
cache = True
rx_port = re.compile(
r"^(?P<port>(?:Fa|Gi|Te... | true | true |
f7019440290b694e69787f2fa909cb9fd6add0b0 | 4,873 | py | Python | wandb/vendor/pygments/lexers/diff.py | dreamflasher/client | c8267f1c6b8b6970172d622bb8fbf7cc773d78b2 | [
"MIT"
] | 3,968 | 2017-08-23T21:27:19.000Z | 2022-03-31T22:00:19.000Z | wandb/vendor/pygments/lexers/diff.py | dreamflasher/client | c8267f1c6b8b6970172d622bb8fbf7cc773d78b2 | [
"MIT"
] | 2,725 | 2017-04-17T00:29:15.000Z | 2022-03-31T21:01:53.000Z | wandb/vendor/pygments/lexers/diff.py | dreamflasher/client | c8267f1c6b8b6970172d622bb8fbf7cc773d78b2 | [
"MIT"
] | 351 | 2018-04-08T19:39:34.000Z | 2022-03-30T19:38:08.000Z | # -*- coding: utf-8 -*-
"""
pygments.lexers.diff
~~~~~~~~~~~~~~~~~~~~
Lexers for diff/patch formats.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, bygroups
from pygments.tok... | 29.355422 | 86 | 0.477324 |
import re
from pygments.lexer import RegexLexer, include, bygroups
from pygments.token import Text, Comment, Operator, Keyword, Name, Generic, \
Literal
__all__ = ['DiffLexer', 'DarcsPatchLexer', 'WDiffLexer']
class DiffLexer(RegexLexer):
name = 'Diff'
aliases = ['diff', 'udiff']
filenames = ['*.... | true | true |
f70194a792e7d2b8b7d98d4ca7fae67585114899 | 735 | py | Python | config.py | vabarboza/Torre-de-Hanoi | 089d3daa5aa78b9d2197d09e86ff27136aef22bf | [
"MIT"
] | null | null | null | config.py | vabarboza/Torre-de-Hanoi | 089d3daa5aa78b9d2197d09e86ff27136aef22bf | [
"MIT"
] | null | null | null | config.py | vabarboza/Torre-de-Hanoi | 089d3daa5aa78b9d2197d09e86ff27136aef22bf | [
"MIT"
] | null | null | null | from disco import Disco
class Config:
def __init__(self):
self._numero_discos = int(input("\nInforme a quantidade de discos: "))
def adiciona_discos(self, torre_inicial):
discos = self.add_disco()
for ix in range(self._numero_discos):
torre_inicial.empilha(discos[ix])
... | 23.709677 | 78 | 0.609524 | from disco import Disco
class Config:
def __init__(self):
self._numero_discos = int(input("\nInforme a quantidade de discos: "))
def adiciona_discos(self, torre_inicial):
discos = self.add_disco()
for ix in range(self._numero_discos):
torre_inicial.empilha(discos[ix])
... | true | true |
f70194cedfde30f4c6fd6c44b9d3193b0d9a8861 | 51,979 | py | Python | flopy/export/netcdf.py | aleaf/flopy | a5777a4d4a745e473110a167c69603ac4ad3106c | [
"CC0-1.0",
"BSD-3-Clause"
] | null | null | null | flopy/export/netcdf.py | aleaf/flopy | a5777a4d4a745e473110a167c69603ac4ad3106c | [
"CC0-1.0",
"BSD-3-Clause"
] | null | null | null | flopy/export/netcdf.py | aleaf/flopy | a5777a4d4a745e473110a167c69603ac4ad3106c | [
"CC0-1.0",
"BSD-3-Clause"
] | null | null | null | import os
import platform
import socket
import copy
import json
import numpy as np
from datetime import datetime
import time
from .metadata import acdd
import flopy
# globals
FILLVALUE = -99999.9
ITMUNI = {
0: "undefined",
1: "seconds",
2: "minutes",
3: "hours",
4: "days",
5: "years",
}
PRECISI... | 34.468833 | 97 | 0.520133 | import os
import platform
import socket
import copy
import json
import numpy as np
from datetime import datetime
import time
from .metadata import acdd
import flopy
FILLVALUE = -99999.9
ITMUNI = {
0: "undefined",
1: "seconds",
2: "minutes",
3: "hours",
4: "days",
5: "years",
}
PRECISION_STRS =... | true | true |
f701952e324b29325e0950a0fc07100cde7c3a5b | 244 | py | Python | enviopack/__init__.py | adrianpaesani/enviopack | 7387cc78c76e589e95ac65345a9196738689cc0b | [
"MIT"
] | null | null | null | enviopack/__init__.py | adrianpaesani/enviopack | 7387cc78c76e589e95ac65345a9196738689cc0b | [
"MIT"
] | null | null | null | enviopack/__init__.py | adrianpaesani/enviopack | 7387cc78c76e589e95ac65345a9196738689cc0b | [
"MIT"
] | 1 | 2021-07-12T00:05:55.000Z | 2021-07-12T00:05:55.000Z | # -*- coding: utf-8 -*-
from .Enviopack import Enviopack
from .Auth.Auth import Auth
from .Quote.Quote import Quote
from .Pickings.Pickings import Pickings
from .Orders.Orders import Orders
__version__ = "0.4.6"
__author__ = "Federico Gobea"
| 22.181818 | 39 | 0.754098 |
from .Enviopack import Enviopack
from .Auth.Auth import Auth
from .Quote.Quote import Quote
from .Pickings.Pickings import Pickings
from .Orders.Orders import Orders
__version__ = "0.4.6"
__author__ = "Federico Gobea"
| true | true |
f70195a36662791fd3e1eb4b6744c001727d1c5d | 411 | py | Python | backend/billsengine_31836/wsgi.py | crowdbotics-apps/billsengine-31836 | f67d69303f16f3612b32f66f139e93d3a382effb | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/billsengine_31836/wsgi.py | crowdbotics-apps/billsengine-31836 | f67d69303f16f3612b32f66f139e93d3a382effb | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/billsengine_31836/wsgi.py | crowdbotics-apps/billsengine-31836 | f67d69303f16f3612b32f66f139e93d3a382effb | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """
WSGI config for billsengine_31836 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/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJ... | 24.176471 | 78 | 0.79562 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'billsengine_31836.settings')
application = get_wsgi_application()
| true | true |
f701962016b67a8ff9257acba3cbef163454f9e8 | 765 | py | Python | gettoken.py | kim3-sudo/moodletesting | 93adb08e84bf4e2299cb9a989d66de68dfe4cb67 | [
"MIT"
] | null | null | null | gettoken.py | kim3-sudo/moodletesting | 93adb08e84bf4e2299cb9a989d66de68dfe4cb67 | [
"MIT"
] | 1 | 2022-01-31T22:29:56.000Z | 2022-02-16T18:49:51.000Z | gettoken.py | kim3-sudo/moodletesting | 93adb08e84bf4e2299cb9a989d66de68dfe4cb67 | [
"MIT"
] | null | null | null | import requests
import threading
import random
import json
usernames = json.loads(open("usernames.json", "r").read())
password = '%4B%65%6E%79%6F%6E%35%25' # A hex encoded password
siteurl = '192.168.122.61'
def run():
username = random.choice(usernames)
token = requests.get('http://' + siteurl + '/login/toke... | 27.321429 | 160 | 0.618301 | import requests
import threading
import random
import json
usernames = json.loads(open("usernames.json", "r").read())
password = '%4B%65%6E%79%6F%6E%35%25'
siteurl = '192.168.122.61'
def run():
username = random.choice(usernames)
token = requests.get('http://' + siteurl + '/login/token.php?username=' + usern... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.