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 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c0249ae490210019d3f363bbfc6fca20792a5f1 | 950 | py | Python | pyscf/hessian/__init__.py | highlight0112/pyscf | 4afbd42bad3e72db5bb94d8cacf1d5de76537bdd | [
"Apache-2.0"
] | null | null | null | pyscf/hessian/__init__.py | highlight0112/pyscf | 4afbd42bad3e72db5bb94d8cacf1d5de76537bdd | [
"Apache-2.0"
] | null | null | null | pyscf/hessian/__init__.py | highlight0112/pyscf | 4afbd42bad3e72db5bb94d8cacf1d5de76537bdd | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2014-2018 The PySCF Developers. 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
#
# U... | 31.666667 | 74 | 0.76 |
from pyscf.hessian import rhf
from pyscf.hessian import uhf
from pyscf.hessian.rhf import Hessian as RHF
from pyscf.hessian.uhf import Hessian as UHF
from pyscf.hessian.rhf import hess_nuc
try:
from . import rks
from . import uks
except ImportError:
pass
| true | true |
1c024a0930ebbaec89d03baa1840958c166b0634 | 1,013 | py | Python | src/polls/repositories.py | ryoutoku/django_rest_clean_architecture | 9834c0c71214699f0ba765c78023fc8575eb7c09 | [
"MIT"
] | 5 | 2020-06-28T07:04:11.000Z | 2022-02-09T03:28:42.000Z | src/polls/repositories.py | ryoutoku/django_rest_clean_architecture | 9834c0c71214699f0ba765c78023fc8575eb7c09 | [
"MIT"
] | 4 | 2021-04-08T21:22:11.000Z | 2021-09-22T19:20:19.000Z | src/polls/repositories.py | ryoutoku/django_rest_clean_architecture | 9834c0c71214699f0ba765c78023fc8575eb7c09 | [
"MIT"
] | null | null | null | from domains.repositories import IQuestionReader, IQuestionWriter
from domains.objects import Question as Aggregate
from .models import Question
from .serializers import QuestionSerializer
class QuestionReader(IQuestionReader):
"""
DBアクセスのreadの実体
"""
def read(self, id: str) -> Aggregate:
"""A... | 25.974359 | 78 | 0.649556 | from domains.repositories import IQuestionReader, IQuestionWriter
from domains.objects import Question as Aggregate
from .models import Question
from .serializers import QuestionSerializer
class QuestionReader(IQuestionReader):
def read(self, id: str) -> Aggregate:
aggregate_serializer = Question... | true | true |
1c024a10fbace1baac630e26d1e350607f7eaf60 | 1,912 | py | Python | aries_cloudagent/protocols/coordinate_mediation/v1_0/messages/mediate_request.py | danubetech/universal-registrar-didcomm | 15fdc7af65b4f9135a8f82ee6be3eca219d974b2 | [
"Apache-2.0"
] | null | null | null | aries_cloudagent/protocols/coordinate_mediation/v1_0/messages/mediate_request.py | danubetech/universal-registrar-didcomm | 15fdc7af65b4f9135a8f82ee6be3eca219d974b2 | [
"Apache-2.0"
] | 1 | 2021-04-21T00:28:28.000Z | 2021-04-21T00:28:28.000Z | aries_cloudagent/protocols/coordinate_mediation/v1_0/messages/mediate_request.py | danubetech/universal-registrar-didcomm | 15fdc7af65b4f9135a8f82ee6be3eca219d974b2 | [
"Apache-2.0"
] | 1 | 2021-04-20T03:44:33.000Z | 2021-04-20T03:44:33.000Z | """mediate-request message used to request mediation from a mediator."""
from typing import Sequence
from marshmallow import fields
from .....messaging.agent_message import AgentMessage, AgentMessageSchema
from ..message_types import MEDIATE_REQUEST, PROTOCOL_PACKAGE
HANDLER_CLASS = (
f"{PROTOCOL_PACKAGE}.hand... | 28.117647 | 82 | 0.661088 |
from typing import Sequence
from marshmallow import fields
from .....messaging.agent_message import AgentMessage, AgentMessageSchema
from ..message_types import MEDIATE_REQUEST, PROTOCOL_PACKAGE
HANDLER_CLASS = (
f"{PROTOCOL_PACKAGE}.handlers.mediate_request_handler.MediationRequestHandler"
)
class Mediation... | true | true |
1c024a5e1d74c161331022f529be08d4ee7b84ff | 9,773 | py | Python | Node3D/widgets/parameterTree/parameterBin.py | ArnoChenFx/Node3D | 30fe58cced3a8580eb129475925eb797e6065067 | [
"MIT"
] | 3 | 2020-09-09T15:42:46.000Z | 2021-07-24T13:58:56.000Z | Node3D/widgets/parameterTree/parameterBin.py | ArnoChenFx/Node3D | 30fe58cced3a8580eb129475925eb797e6065067 | [
"MIT"
] | null | null | null | Node3D/widgets/parameterTree/parameterBin.py | ArnoChenFx/Node3D | 30fe58cced3a8580eb129475925eb797e6065067 | [
"MIT"
] | 1 | 2021-10-17T12:21:39.000Z | 2021-10-17T12:21:39.000Z | from ...vendor.NodeGraphQt import PropertiesBinWidget
from ...vendor.NodeGraphQt.widgets.properties import defaultdict, PropLineEdit
from ...vendor.NodeGraphQt.constants import *
from Qt import QtCore, QtWidgets, QtGui
from .parameterTreeWidget import NodeParamTreeWidget
from ...vendor.pyqtgraph.parametertree import Pa... | 35.930147 | 98 | 0.591221 | from ...vendor.NodeGraphQt import PropertiesBinWidget
from ...vendor.NodeGraphQt.widgets.properties import defaultdict, PropLineEdit
from ...vendor.NodeGraphQt.constants import *
from Qt import QtCore, QtWidgets, QtGui
from .parameterTreeWidget import NodeParamTreeWidget
from ...vendor.pyqtgraph.parametertree import Pa... | true | true |
1c024a887afde747d47d4bd49597fb243857562a | 1,385 | py | Python | app/user/serializers.py | CompSci2013/recipe-app-api | b5546ad7b1d05492eacf2d086274e45a97a86f24 | [
"MIT"
] | null | null | null | app/user/serializers.py | CompSci2013/recipe-app-api | b5546ad7b1d05492eacf2d086274e45a97a86f24 | [
"MIT"
] | null | null | null | app/user/serializers.py | CompSci2013/recipe-app-api | b5546ad7b1d05492eacf2d086274e45a97a86f24 | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model, authenticate
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
class UserSerializer(serializers.ModelSerializer):
"""Serializer for the users object"""
class Meta:
model = get_user_model()
fields = ('... | 32.209302 | 74 | 0.654874 | from django.contrib.auth import get_user_model, authenticate
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = get_user_model()
fields = ('email', 'password', 'name')
extra_... | true | true |
1c024aef2cffb80910bb81d03584986913e1cbdb | 486 | py | Python | lib/config/database.py | arsystem/ardegra | 855ec9500729948a91d1cbb164a6591de64fe136 | [
"Apache-2.0"
] | null | null | null | lib/config/database.py | arsystem/ardegra | 855ec9500729948a91d1cbb164a6591de64fe136 | [
"Apache-2.0"
] | null | null | null | lib/config/database.py | arsystem/ardegra | 855ec9500729948a91d1cbb164a6591de64fe136 | [
"Apache-2.0"
] | null | null | null | from ..factory.validator import ValidatorFactory
from . import Config
import os
class DatabaseConfig(Config):
def __init__(self):
""" Exceptions:
- AssertionError (__init__, DatabaseConfigValidator)
- CannotFindField (DatabaseConfigValidator)
- ValidationError (DatabaseConfigValidator)
"""
Config... | 32.4 | 78 | 0.76749 | from ..factory.validator import ValidatorFactory
from . import Config
import os
class DatabaseConfig(Config):
def __init__(self):
Config.__init__(self, os.path.join(".","config","database.json"))
validator = ValidatorFactory.get_validator(ValidatorFactory.DATABASE_CONFIG)
validator.validate(self) | true | true |
1c024b780fcd3313ed985e20bcf2503debd6871d | 16,519 | py | Python | vision/tests/system.py | elisheva-qlogic/google-cloud-python | 79a43138a1dd733feff005e4207c29f8b269d8c2 | [
"Apache-2.0"
] | null | null | null | vision/tests/system.py | elisheva-qlogic/google-cloud-python | 79a43138a1dd733feff005e4207c29f8b269d8c2 | [
"Apache-2.0"
] | null | null | null | vision/tests/system.py | elisheva-qlogic/google-cloud-python | 79a43138a1dd733feff005e4207c29f8b269d8c2 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017, Google LLC 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 applicable law or a... | 41.401003 | 84 | 0.680126 |
import io
import os
import unittest
from google.cloud import exceptions
from google.cloud import storage
from google.cloud import vision
from test_utils.retry import RetryErrors
from test_utils.system import unique_resource_id
_SYS_TESTS_DIR = os.path.realpath(os.path.dirname(__file__))
LOGO_FILE = os.path.join(_... | true | true |
1c024be5508ab62c45b73054a03f03f8b6c72384 | 1,278 | py | Python | var/spack/repos/builtin/packages/r-robustbase/package.py | jonglezb/spack | ebc871abbf8f082000617e1798c75260652f0770 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2020-09-10T22:50:08.000Z | 2021-01-12T22:18:54.000Z | var/spack/repos/builtin/packages/r-robustbase/package.py | jonglezb/spack | ebc871abbf8f082000617e1798c75260652f0770 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 14 | 2021-07-20T01:04:53.000Z | 2022-03-02T01:08:36.000Z | var/spack/repos/builtin/packages/r-robustbase/package.py | jonglezb/spack | ebc871abbf8f082000617e1798c75260652f0770 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2021-05-06T00:17:46.000Z | 2021-05-06T00:17:46.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RRobustbase(RPackage):
""""Essential" Robust Statistics. Tools allowing to analyze data
... | 47.333333 | 96 | 0.725352 |
from spack import *
class RRobustbase(RPackage):
homepage = "https://robustbase.r-forge.r-project.org"
url = "https://cloud.r-project.org/src/contrib/robustbase_0.92-7.tar.gz"
list_url = "https://cloud.r-project.org/src/contrib/Archive/robustbase"
version('0.93-5', sha256='bde564dbd52f04ab32f9... | true | true |
1c024c817da03cbbc734ef38a7939c013290c4c7 | 641 | py | Python | Functions/python_exmple_fibonacci_en.py | cehceh/pythonCodes | eb5694363ebaaf1a2d9d2a0b812fd6c83f9d51b9 | [
"MIT"
] | 65 | 2018-06-29T16:37:54.000Z | 2021-06-11T07:56:33.000Z | Functions/python_exmple_fibonacci_en.py | cehceh/pythonCodes | eb5694363ebaaf1a2d9d2a0b812fd6c83f9d51b9 | [
"MIT"
] | 20 | 2018-06-29T18:01:56.000Z | 2018-09-08T15:41:10.000Z | Functions/python_exmple_fibonacci_en.py | cehceh/pythonCodes | eb5694363ebaaf1a2d9d2a0b812fd6c83f9d51b9 | [
"MIT"
] | 62 | 2018-06-29T17:21:26.000Z | 2021-05-30T17:37:12.000Z | #this file print out the fibonacci of the function input
#importing numpy for execute math with lists
import numpy as np
#define the function that takes one input
def fibonacci_cube(num):
#define a list that contains 0 and 1 , because the fibonacci always starts with 0 and 1
lis = [0,1]
#this for loop take... | 37.705882 | 91 | 0.722309 |
import numpy as np
def fibonacci_cube(num):
lis = [0,1]
for i in range(2,num):
lis.append(lis[i-2] + lis[i-1])
return np.array(lis)**3
print fibonacci_cube(8)
| false | true |
1c024c920e53955aa1ceadbe17656c4ad086e447 | 643 | py | Python | tests/idempotency_test.py | TylerYep/workshop | 69b19afc81c1b84b7f60723077670fb789b55744 | [
"MIT"
] | 1 | 2021-06-14T01:20:09.000Z | 2021-06-14T01:20:09.000Z | tests/idempotency_test.py | TylerYep/workshop | 69b19afc81c1b84b7f60723077670fb789b55744 | [
"MIT"
] | null | null | null | tests/idempotency_test.py | TylerYep/workshop | 69b19afc81c1b84b7f60723077670fb789b55744 | [
"MIT"
] | null | null | null | from __future__ import annotations
import pytest
from cs.util import idempotent
@idempotent
def func(x: list[int]) -> None:
if not x: # comment this line to verify the test
x += [9]
@pytest.mark.test_idempotency
def test_func() -> None:
x: list[int] = []
func(x)
assert x == [9]
def te... | 14.613636 | 53 | 0.578538 | from __future__ import annotations
import pytest
from cs.util import idempotent
@idempotent
def func(x: list[int]) -> None:
if not x: x += [9]
@pytest.mark.test_idempotency
def test_func() -> None:
x: list[int] = []
func(x)
assert x == [9]
def test_func_2() -> None:
x: list[int] =... | true | true |
1c024def38af04e7bbab79cab16c3dc9e61a34a3 | 22,479 | py | Python | test/test_ui.py | google-code-export/beets | 9fa7d6e6bfee1f4b79bdd37a889dbb69636f7454 | [
"MIT"
] | 1 | 2021-05-19T19:18:42.000Z | 2021-05-19T19:18:42.000Z | test/test_ui.py | rfdiazpr/beets | 38ecb357188ac26350cdbc1b98444a1fc47c79af | [
"MIT"
] | 56 | 2015-05-09T20:49:01.000Z | 2018-01-08T14:50:52.000Z | test/test_ui.py | rfdiazpr/beets | 38ecb357188ac26350cdbc1b98444a1fc47c79af | [
"MIT"
] | null | null | null | # This file is part of beets.
# Copyright 2013, Adrian Sampson.
#
# 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, ... | 33.351632 | 79 | 0.612972 |
"""Tests for the command-line interface.
"""
import os
import shutil
import textwrap
import re
import yaml
import _common
from _common import unittest
from beets import library
from beets import ui
from beets.ui import commands
from beets import autotag
from beets.autotag.match import distance
from beets import impor... | false | true |
1c024e12fb6406860ae7fe7e40f07efd70eb38ec | 83 | py | Python | include/scons/test/toolpath/nested/image/site_scons/site_tools/Toolpath_TestTool1.py | SWEN-712/screen-reader-brandonp728 | e30c25ad2d10ce632fac0548696a61a872328f59 | [
"bzip2-1.0.6"
] | null | null | null | include/scons/test/toolpath/nested/image/site_scons/site_tools/Toolpath_TestTool1.py | SWEN-712/screen-reader-brandonp728 | e30c25ad2d10ce632fac0548696a61a872328f59 | [
"bzip2-1.0.6"
] | null | null | null | include/scons/test/toolpath/nested/image/site_scons/site_tools/Toolpath_TestTool1.py | SWEN-712/screen-reader-brandonp728 | e30c25ad2d10ce632fac0548696a61a872328f59 | [
"bzip2-1.0.6"
] | null | null | null | def generate(env):
env['Toolpath_TestTool1'] = 1
def exists(env):
return 1
| 16.6 | 33 | 0.662651 | def generate(env):
env['Toolpath_TestTool1'] = 1
def exists(env):
return 1
| true | true |
1c024efd3978d7c244b3295c9def87b9cd3d8626 | 11,366 | py | Python | sdk/python/pulumi_aws_native/ec2/get_ipam_pool.py | pulumi/pulumi-aws-native | 1ae4a4d9c2256b2a79ca536f8d8497b28d10e4c3 | [
"Apache-2.0"
] | 29 | 2021-09-30T19:32:07.000Z | 2022-03-22T21:06:08.000Z | sdk/python/pulumi_aws_native/ec2/get_ipam_pool.py | pulumi/pulumi-aws-native | 1ae4a4d9c2256b2a79ca536f8d8497b28d10e4c3 | [
"Apache-2.0"
] | 232 | 2021-09-30T19:26:26.000Z | 2022-03-31T23:22:06.000Z | sdk/python/pulumi_aws_native/ec2/get_ipam_pool.py | pulumi/pulumi-aws-native | 1ae4a4d9c2256b2a79ca536f8d8497b28d10e4c3 | [
"Apache-2.0"
] | 4 | 2021-11-10T19:42:01.000Z | 2022-02-05T10:15:49.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! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from... | 42.569288 | 377 | 0.685729 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs
from ._enums import *
__all__ = [
'GetIPAMPoolResult',
'AwaitableGetIPAMPoolResult',
'get_ipam_pool',
'get_ipam_pool_output',
]
@pul... | true | true |
1c024f6233ee4bd7f2d8a19a47e82f656d178ed0 | 3,085 | py | Python | src/aws_lambda_typing/events/__init__.py | chuckwondo/aws-lambda-typing | 8417ab67f2492be1508fe38b2c34bc106619a56d | [
"MIT"
] | null | null | null | src/aws_lambda_typing/events/__init__.py | chuckwondo/aws-lambda-typing | 8417ab67f2492be1508fe38b2c34bc106619a56d | [
"MIT"
] | null | null | null | src/aws_lambda_typing/events/__init__.py | chuckwondo/aws-lambda-typing | 8417ab67f2492be1508fe38b2c34bc106619a56d | [
"MIT"
] | null | null | null | from .alb import ALBEvent as ALBEvent
from .api_gateway_authorizer import (
APIGatewayRequestAuthorizerEvent as APIGatewayRequestAuthorizerEvent,
)
from .api_gateway_authorizer import (
APIGatewayTokenAuthorizerEvent as APIGatewayTokenAuthorizerEvent,
)
from .api_gateway_proxy import APIGatewayProxyEventV1 as A... | 44.710145 | 97 | 0.871637 | from .alb import ALBEvent as ALBEvent
from .api_gateway_authorizer import (
APIGatewayRequestAuthorizerEvent as APIGatewayRequestAuthorizerEvent,
)
from .api_gateway_authorizer import (
APIGatewayTokenAuthorizerEvent as APIGatewayTokenAuthorizerEvent,
)
from .api_gateway_proxy import APIGatewayProxyEventV1 as A... | true | true |
1c024fba5ebe0a235575d7101b00978ad5373495 | 26,496 | py | Python | vision/google/cloud/vision_v1/proto/product_search_service_pb2_grpc.py | rsalmond/google-cloud-python | 120bf628220227bb4dd905c86feda93180e14970 | [
"Apache-2.0"
] | null | null | null | vision/google/cloud/vision_v1/proto/product_search_service_pb2_grpc.py | rsalmond/google-cloud-python | 120bf628220227bb4dd905c86feda93180e14970 | [
"Apache-2.0"
] | 1 | 2018-04-06T19:51:23.000Z | 2018-04-06T19:51:23.000Z | vision/google/cloud/vision_v1/proto/product_search_service_pb2_grpc.py | rsalmond/google-cloud-python | 120bf628220227bb4dd905c86feda93180e14970 | [
"Apache-2.0"
] | null | null | null | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from google.cloud.vision_v1.proto import (
product_search_service_pb2 as google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2,
)
from google.longrunning import (
operations_pb2 as google_dot_longrunning_dot... | 52.675944 | 160 | 0.768607 | import grpc
from google.cloud.vision_v1.proto import (
product_search_service_pb2 as google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2,
)
from google.longrunning import (
operations_pb2 as google_dot_longrunning_dot_operations__pb2,
)
from google.protobuf import empty_pb2 as google_do... | true | true |
1c024fdbaa30f7a476b6f7faaf6a2af396439dc8 | 6,048 | py | Python | airflow/providers/slack/hooks/slack_webhook.py | augusto-herrmann/airflow | 7ee4295dd3f7dba4fcd763286c7823bb1707fe99 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 4 | 2021-06-26T13:37:35.000Z | 2022-01-11T15:49:44.000Z | airflow/providers/slack/hooks/slack_webhook.py | augusto-herrmann/airflow | 7ee4295dd3f7dba4fcd763286c7823bb1707fe99 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 33 | 2021-07-25T10:29:30.000Z | 2022-03-30T04:39:06.000Z | airflow/providers/slack/hooks/slack_webhook.py | augusto-herrmann/airflow | 7ee4295dd3f7dba4fcd763286c7823bb1707fe99 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 35.162791 | 105 | 0.639716 | import json
import warnings
from typing import Optional
from airflow.exceptions import AirflowException
from airflow.providers.http.hooks.http import HttpHook
class SlackWebhookHook(HttpHook):
conn_name_attr = 'http_conn_id'
default_conn_name = 'slack_default'
conn_type = 'slackwebhook'
hook_name = ... | true | true |
1c025071d8166c1c5e89489681163a266576ca9e | 163 | py | Python | CodeForces/1418A_Buying_Torches/A_Buying_Torches.py | sungmen/Acmicpc_Solve | 0298a6aec84993a4d8767bd2c00490b7201e06a4 | [
"MIT"
] | 1 | 2020-07-08T23:16:19.000Z | 2020-07-08T23:16:19.000Z | CodeForces/1418A_Buying_Torches/A_Buying_Torches.py | sungmen/Acmicpc_Solve | 0298a6aec84993a4d8767bd2c00490b7201e06a4 | [
"MIT"
] | 1 | 2020-05-16T03:12:24.000Z | 2020-05-16T03:14:42.000Z | CodeForces/1418A_Buying_Torches/A_Buying_Torches.py | sungmen/Acmicpc_Solve | 0298a6aec84993a4d8767bd2c00490b7201e06a4 | [
"MIT"
] | 2 | 2020-05-16T03:25:16.000Z | 2021-02-10T16:51:25.000Z | import sys
t = int(input())
for i in range(t):
x, y, k = map(int, sys.stdin.readline().rstrip().split())
sys.stdout.write(str((k+k*y+x-3)//(x-1)+k) + '\n') | 32.6 | 61 | 0.564417 | import sys
t = int(input())
for i in range(t):
x, y, k = map(int, sys.stdin.readline().rstrip().split())
sys.stdout.write(str((k+k*y+x-3)//(x-1)+k) + '\n') | true | true |
1c0250f62c26de4db52f1bb6db58707494121b45 | 1,572 | py | Python | util/HexoMdUtil.py | StephenZSIR/csdn2hexo_python | a1a319b3e05022822a33b576ce7b80ba314fb2e6 | [
"MIT"
] | 2 | 2021-03-15T12:51:12.000Z | 2021-04-09T03:07:06.000Z | util/HexoMdUtil.py | StephenZSIR/csdn2hexo_python | a1a319b3e05022822a33b576ce7b80ba314fb2e6 | [
"MIT"
] | null | null | null | util/HexoMdUtil.py | StephenZSIR/csdn2hexo_python | a1a319b3e05022822a33b576ce7b80ba314fb2e6 | [
"MIT"
] | null | null | null | #-*- coding: utf-8 -*-
import platform
from properties import Properties
class HexoMdUtil:
# 读取文件
props = Properties.Properties()
def __init__(self):
print('HexoMdUtil初始化')
# 适配hexo头部
# ---
# title: hexo deploy时重复输入用户名密码的问题
# date: 2017-12-12 19:17:34
# tags: hexo
# ---
... | 31.44 | 195 | 0.56743 | import platform
from properties import Properties
class HexoMdUtil:
props = Properties.Properties()
def __init__(self):
print('HexoMdUtil初始化')
def getHeader(self, article):
separator = '\n'
if platform.system()=='Windows':
separator = '\r\n'
... | true | true |
1c0251e11c46106631614eddbc09d049193162f7 | 12,042 | py | Python | tests/integration/test_question.py | hmajid2301/banter-bus-management-api | d51a40c2d5254d4197cbe5bb84aa576df2c24893 | [
"Apache-2.0"
] | null | null | null | tests/integration/test_question.py | hmajid2301/banter-bus-management-api | d51a40c2d5254d4197cbe5bb84aa576df2c24893 | [
"Apache-2.0"
] | null | null | null | tests/integration/test_question.py | hmajid2301/banter-bus-management-api | d51a40c2d5254d4197cbe5bb84aa576df2c24893 | [
"Apache-2.0"
] | null | null | null | import pytest
from fastapi import status
from httpx import AsyncClient
from app.question.question_models import Question
from app.question.question_repository import QuestionRepository
from tests.integration.data.question_test_data import (
add_question_data,
add_question_translation_data,
disabled_questio... | 34.504298 | 118 | 0.697476 | import pytest
from fastapi import status
from httpx import AsyncClient
from app.question.question_models import Question
from app.question.question_repository import QuestionRepository
from tests.integration.data.question_test_data import (
add_question_data,
add_question_translation_data,
disabled_questio... | true | true |
1c025201788cda5037c46638467a8e0fead82583 | 3,138 | py | Python | venv/lib/python3.6/site-packages/tests/test_level4/test_scope.py | Guillaume-Fernandez/phishfinder | b459a30202fd5dfb1340b43c70363705de7cedd9 | [
"MIT"
] | 2 | 2019-09-26T17:46:18.000Z | 2022-02-26T03:07:59.000Z | venv/lib/python3.6/site-packages/tests/test_level4/test_scope.py | Guillaume-Fernandez/phishfinder | b459a30202fd5dfb1340b43c70363705de7cedd9 | [
"MIT"
] | 2 | 2018-08-19T17:12:26.000Z | 2020-09-18T03:51:33.000Z | venv/lib/python3.6/site-packages/tests/test_level4/test_scope.py | Guillaume-Fernandez/phishfinder | b459a30202fd5dfb1340b43c70363705de7cedd9 | [
"MIT"
] | 2 | 2020-09-14T06:19:39.000Z | 2020-12-29T10:54:43.000Z | """Test scope selectors."""
from __future__ import unicode_literals
from .. import util
import soupsieve as sv
class TestScope(util.TestCase):
"""Test scope selectors."""
MARKUP = """
<html id="root">
<head>
</head>
<body>
<div id="div">
<p id="0" class="somewordshere">Some text <span... | 31.38 | 102 | 0.545252 | from __future__ import unicode_literals
from .. import util
import soupsieve as sv
class TestScope(util.TestCase):
MARKUP = """
<html id="root">
<head>
</head>
<body>
<div id="div">
<p id="0" class="somewordshere">Some text <span id="1"> in a paragraph</span>.</p>
<a id="2" href="http... | true | true |
1c0253775c7bda5c7ac63e9d846d6bcc79cfb8e4 | 3,906 | py | Python | peanut/stress_test.py | Ezibenroc/peanut | 0a4c0abf31e49c837db9971a50c0f9843e8de47f | [
"MIT"
] | 4 | 2020-03-31T09:13:26.000Z | 2021-05-19T13:08:39.000Z | peanut/stress_test.py | Ezibenroc/peanut | 0a4c0abf31e49c837db9971a50c0f9843e8de47f | [
"MIT"
] | null | null | null | peanut/stress_test.py | Ezibenroc/peanut | 0a4c0abf31e49c837db9971a50c0f9843e8de47f | [
"MIT"
] | null | null | null | import os
from .peanut import Job, logger
class StressTest(Job):
expfile_types = {'mode': str, 'size': int, 'nb_calls': int, 'nb_runs': int, 'nb_sleeps': int, 'sleep_time': float,
'cores': str}
expfile_header_in_file = True
@classmethod
def check_exp(cls, exp):
for k, v i... | 41.115789 | 119 | 0.487455 | import os
from .peanut import Job, logger
class StressTest(Job):
expfile_types = {'mode': str, 'size': int, 'nb_calls': int, 'nb_runs': int, 'nb_sleeps': int, 'sleep_time': float,
'cores': str}
expfile_header_in_file = True
@classmethod
def check_exp(cls, exp):
for k, v i... | true | true |
1c0253ac6847f0d6e8055b16cde71fc7885b8dce | 5,734 | py | Python | object_detection/box_coders/keypoint_box_coder.py | travisyates81/object-detection | 931bebfa54798c08d2c401e9c1bad39015d8c832 | [
"MIT"
] | 1 | 2019-09-19T18:24:55.000Z | 2019-09-19T18:24:55.000Z | object_detection/box_coders/keypoint_box_coder.py | travisyates81/object-detection | 931bebfa54798c08d2c401e9c1bad39015d8c832 | [
"MIT"
] | null | null | null | object_detection/box_coders/keypoint_box_coder.py | travisyates81/object-detection | 931bebfa54798c08d2c401e9c1bad39015d8c832 | [
"MIT"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
# Travis Yates
"""Keypoint box coder.
The keypoint box coder follows the coding schema described below (this is
similar to the FasterRcnnBoxCoder, except that it encodes keypoints in addition
to box coordinates):
ty = (y - ya) / ha
tx = (x - xa) / wa
... | 35.8375 | 80 | 0.668992 |
import tensorflow as tf
from object_detection.core import box_coder
from object_detection.core import box_list
from object_detection.core import standard_fields as fields
EPSILON = 1e-8
class KeypointBoxCoder(box_coder.BoxCoder):
def __init__(self, num_keypoints, scale_factors=None):
self._num_keypoints = ... | true | true |
1c0253c0664fc1b5a03b43e6aa13b1d12a44169f | 1,222 | py | Python | contrib/namecoin/convertBechAddress.py | spaceexpanse/xaya | 49aee2d5abc0c36d6aee990e7acbc3aece2b7a82 | [
"MIT"
] | 96 | 2018-07-15T14:09:46.000Z | 2022-03-27T23:37:15.000Z | contrib/namecoin/convertBechAddress.py | spaceexpanse/xaya | 49aee2d5abc0c36d6aee990e7acbc3aece2b7a82 | [
"MIT"
] | 45 | 2018-07-13T13:53:19.000Z | 2022-01-12T09:09:26.000Z | contrib/namecoin/convertBechAddress.py | SpaceXpanse/rod-core-wallet | 4757a1c0ead25b9094ff06baabffbe5eb4a6bb67 | [
"MIT"
] | 47 | 2018-08-03T04:55:45.000Z | 2022-03-10T07:50:31.000Z | #!/usr/bin/env python3
# Convert Address - convert Bitcoin to Namecoin bech32 addresses
# Copyright (C) 2018-2021 Daniel Kraft <d@domob.eu>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Softwa... | 33.027027 | 79 | 0.716039 |
import sys
import segwit_addr
if len (sys.argv) not in [2, 3]:
print ("Usage: convertBechAddress.py ADDRESS [TO-HRP]")
sys.exit (-1);
addr = sys.argv[1]
if len (sys.argv) >= 3:
hrp = sys.argv[2]
else:
hrp = "chi"
enc, oldHrp, data = segwit_addr.bech32_decode (addr)
print ("Encoding %s, old HRP: %s" % (enc... | true | true |
1c0254fc464a8982fbae554e4adf6616ad6f84b5 | 1,869 | py | Python | integration/airflow/openlineage/airflow/facets.py | kedar-cz/OpenLineage | bd75b53c84fd9655f593c4f161e15c14785eb93e | [
"Apache-2.0"
] | null | null | null | integration/airflow/openlineage/airflow/facets.py | kedar-cz/OpenLineage | bd75b53c84fd9655f593c4f161e15c14785eb93e | [
"Apache-2.0"
] | null | null | null | integration/airflow/openlineage/airflow/facets.py | kedar-cz/OpenLineage | bd75b53c84fd9655f593c4f161e15c14785eb93e | [
"Apache-2.0"
] | null | null | null | import attr
from airflow.version import version as AIRFLOW_VERSION
from openlineage.airflow import __version__ as OPENLINEAGE_AIRFLOW_VERSION
from openlineage.client.facet import BaseFacet, DataQualityMetricsInputDatasetFacet
from typing import Optional, Dict
@attr.s
class AirflowVersionRunFacet(BaseFacet):
opera... | 32.789474 | 149 | 0.70947 | import attr
from airflow.version import version as AIRFLOW_VERSION
from openlineage.airflow import __version__ as OPENLINEAGE_AIRFLOW_VERSION
from openlineage.client.facet import BaseFacet, DataQualityMetricsInputDatasetFacet
from typing import Optional, Dict
@attr.s
class AirflowVersionRunFacet(BaseFacet):
opera... | true | true |
1c0255a92d07de21306921d6d48f4a32c77ea6f6 | 4,938 | py | Python | freesas/app/sas_argparser.py | maaeli/freesas | 418cdd1b72ab650198453a06defa3a57e5c4daea | [
"MIT"
] | null | null | null | freesas/app/sas_argparser.py | maaeli/freesas | 418cdd1b72ab650198453a06defa3a57e5c4daea | [
"MIT"
] | 5 | 2020-07-04T15:58:16.000Z | 2021-06-17T18:47:10.000Z | freesas/app/sas_argparser.py | maaeli/freesas | 418cdd1b72ab650198453a06defa3a57e5c4daea | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Generalized arg parser for freeSAS apps to ensure unified command line API.
"""
__author__ = "Martha Brennich"
__license__ = "MIT"
__copyright__ = "2020, ESRF"
__date__ = "09/08/2020"
import argparse
from pathlib import Path
from freesas import dated_version as freesas_version
def parse_u... | 37.12782 | 80 | 0.599838 |
__author__ = "Martha Brennich"
__license__ = "MIT"
__copyright__ = "2020, ESRF"
__date__ = "09/08/2020"
import argparse
from pathlib import Path
from freesas import dated_version as freesas_version
def parse_unit(unit_input: str) -> str:
if unit_input == "A": return "Å"
else:
return unit_inpu... | true | true |
1c0255c555da3b12049a95528cc6d2bb382cb04b | 538 | py | Python | comet/main.py | kearnsw/comet-commonsense | 8ba34b4d415432b171b19c7b253602103b01410a | [
"Apache-2.0"
] | null | null | null | comet/main.py | kearnsw/comet-commonsense | 8ba34b4d415432b171b19c7b253602103b01410a | [
"Apache-2.0"
] | null | null | null | comet/main.py | kearnsw/comet-commonsense | 8ba34b4d415432b171b19c7b253602103b01410a | [
"Apache-2.0"
] | null | null | null | import sys
import os
import argparse
sys.path.append(os.getcwd())
parser = argparse.ArgumentParser()
parser.add_argument("--experiment_type", type=str, default='atomic',
choices=["atomic", "conceptnet"])
parser.add_argument("--experiment_num", type=str, default="0")
args = parser.parse_args()
if... | 26.9 | 68 | 0.723048 | import sys
import os
import argparse
sys.path.append(os.getcwd())
parser = argparse.ArgumentParser()
parser.add_argument("--experiment_type", type=str, default='atomic',
choices=["atomic", "conceptnet"])
parser.add_argument("--experiment_num", type=str, default="0")
args = parser.parse_args()
if... | true | true |
1c0256251915c057e1b434d6f94c9d6be544c73c | 5,418 | py | Python | GeneralTools/run_args.py | frhrdr/MMD-GAN | 7522093498b658026344541ddd5c248095763fb6 | [
"Apache-2.0"
] | null | null | null | GeneralTools/run_args.py | frhrdr/MMD-GAN | 7522093498b658026344541ddd5c248095763fb6 | [
"Apache-2.0"
] | null | null | null | GeneralTools/run_args.py | frhrdr/MMD-GAN | 7522093498b658026344541ddd5c248095763fb6 | [
"Apache-2.0"
] | null | null | null | import argparse
from GeneralTools.architectures import get_mnist_architectures, cifar_default
def parse_run_args():
parser = argparse.ArgumentParser()
parser.add_argument('--filename', '-file', type=str, default=None)
parser.add_argument('--dataset', '-data', type=str, default='mnist')
parser.add_argument('... | 45.529412 | 116 | 0.70192 | import argparse
from GeneralTools.architectures import get_mnist_architectures, cifar_default
def parse_run_args():
parser = argparse.ArgumentParser()
parser.add_argument('--filename', '-file', type=str, default=None)
parser.add_argument('--dataset', '-data', type=str, default='mnist')
parser.add_argument('... | true | true |
1c0257e950da45366a9950cc7d942e7c933133b2 | 5,026 | py | Python | tracim/tracim/lib/base.py | lebouquetin/tracim | dc3485f92b07ced3230834a5852c9f9574477c1c | [
"MIT"
] | 1 | 2016-09-27T12:16:05.000Z | 2016-09-27T12:16:05.000Z | tracim/tracim/lib/base.py | lebouquetin/tracim | dc3485f92b07ced3230834a5852c9f9574477c1c | [
"MIT"
] | null | null | null | tracim/tracim/lib/base.py | lebouquetin/tracim | dc3485f92b07ced3230834a5852c9f9574477c1c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""The base Controller API."""
import logging
import tg
from tg import TGController, RestController, tmpl_context, flash
from tg.render import render
from tg import request, redirect
from tg.i18n import ugettext as _, ungettext
__all__ = ['BaseController']
class BaseController(TGController... | 36.686131 | 174 | 0.653999 |
import logging
import tg
from tg import TGController, RestController, tmpl_context, flash
from tg.render import render
from tg import request, redirect
from tg.i18n import ugettext as _, ungettext
__all__ = ['BaseController']
class BaseController(TGController):
def __call__(self, environ, context):
... | true | true |
1c025800ef6a96367e0894291763e7d8e0404e4d | 3,284 | py | Python | src/cli.py | gmoe/rere | aa49cc71d4d4da1550d62b44e1dd9023977d713b | [
"MIT"
] | 7 | 2019-11-30T14:57:39.000Z | 2021-07-14T21:06:15.000Z | src/cli.py | gmoe/rere | aa49cc71d4d4da1550d62b44e1dd9023977d713b | [
"MIT"
] | 2 | 2019-11-30T17:25:41.000Z | 2020-02-18T16:59:50.000Z | src/cli.py | gmoe/rere | aa49cc71d4d4da1550d62b44e1dd9023977d713b | [
"MIT"
] | 1 | 2019-11-30T15:15:39.000Z | 2019-11-30T15:15:39.000Z | """Utilities for user interaction"""
from argparse import ArgumentParser
from typing import Optional, Set
from .constants import ARGPARSE_DESCRIPTION, ARGPARSE_EPILOG
def make_arg_parser() -> ArgumentParser:
"""Set up CLI args and options."""
parser = ArgumentParser(description=ARGPARSE_DESCRIPTION, epilog=A... | 30.691589 | 99 | 0.591048 | from argparse import ArgumentParser
from typing import Optional, Set
from .constants import ARGPARSE_DESCRIPTION, ARGPARSE_EPILOG
def make_arg_parser() -> ArgumentParser:
parser = ArgumentParser(description=ARGPARSE_DESCRIPTION, epilog=ARGPARSE_EPILOG)
parser.add_argument(
"--init", "-i", help="Run ... | true | true |
1c025806f980b1a4bd929c8d7a5129aaab24e589 | 15,539 | py | Python | Lib/site-packages/markdown/core.py | srishti-yadav/poetrydj | 4f108fb79dce2bb4d1ef56b1977bad3d447fac62 | [
"bzip2-1.0.6"
] | 3 | 2020-10-12T15:47:01.000Z | 2022-01-14T19:51:26.000Z | Lib/site-packages/markdown/core.py | srishti-yadav/poetrydj | 4f108fb79dce2bb4d1ef56b1977bad3d447fac62 | [
"bzip2-1.0.6"
] | 13 | 2020-03-24T17:53:51.000Z | 2022-02-10T20:01:14.000Z | Lib/site-packages/markdown/core.py | srishti-yadav/poetrydj | 4f108fb79dce2bb4d1ef56b1977bad3d447fac62 | [
"bzip2-1.0.6"
] | 2 | 2020-01-02T08:57:18.000Z | 2020-11-04T06:57:49.000Z | # -*- coding: utf-8 -*-
"""
Python Markdown
A Python implementation of John Gruber's Markdown.
Documentation: https://python-markdown.github.io/
GitHub: https://github.com/Python-Markdown/markdown/
PyPI: https://pypi.org/project/Markdown/
Started by Manfred Stienstra (http://www.dwerg.net/).
Maintained for a few yea... | 37.716019 | 118 | 0.598494 |
from __future__ import absolute_import
from __future__ import unicode_literals
import codecs
import sys
import logging
import importlib
import pkg_resources
from . import util
from .preprocessors import build_preprocessors
from .blockprocessors import build_block_parser
from .treeprocessors import build_treeprocessors... | true | true |
1c0258639e1d9430f954083cd4f9cefc9ee966df | 167 | py | Python | tests/model_control/detailed/transf_Difference/model_control_one_enabled_Difference_MovingAverage_Seasonal_DayOfWeek_NoAR.py | shaido987/pyaf | b9afd089557bed6b90b246d3712c481ae26a1957 | [
"BSD-3-Clause"
] | 377 | 2016-10-13T20:52:44.000Z | 2022-03-29T18:04:14.000Z | tests/model_control/detailed/transf_Difference/model_control_one_enabled_Difference_MovingAverage_Seasonal_DayOfWeek_NoAR.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 160 | 2016-10-13T16:11:53.000Z | 2022-03-28T04:21:34.000Z | tests/model_control/detailed/transf_Difference/model_control_one_enabled_Difference_MovingAverage_Seasonal_DayOfWeek_NoAR.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 63 | 2017-03-09T14:51:18.000Z | 2022-03-27T20:52:57.000Z | import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Difference'] , ['MovingAverage'] , ['Seasonal_DayOfWeek'] , ['NoAR'] ); | 41.75 | 94 | 0.766467 | import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Difference'] , ['MovingAverage'] , ['Seasonal_DayOfWeek'] , ['NoAR'] ); | true | true |
1c0258cd0cc4e2104a8a6314c1b06394015b575b | 2,570 | py | Python | soc/board_specific_workflows/test_icebreaker.py | keadwen/CFU-Playground | 74c79158e85e1365170ececd1d91ea3fa48faba0 | [
"Apache-2.0"
] | 240 | 2021-03-09T23:32:09.000Z | 2022-03-28T14:54:08.000Z | soc/board_specific_workflows/test_icebreaker.py | keadwen/CFU-Playground | 74c79158e85e1365170ececd1d91ea3fa48faba0 | [
"Apache-2.0"
] | 283 | 2021-03-10T00:09:11.000Z | 2022-03-31T16:39:40.000Z | soc/board_specific_workflows/test_icebreaker.py | keadwen/CFU-Playground | 74c79158e85e1365170ececd1d91ea3fa48faba0 | [
"Apache-2.0"
] | 78 | 2021-03-10T06:13:39.000Z | 2022-03-30T14:09:00.000Z | #!/usr/bin/env python3
# Copyright 2021 The CFU-Playground 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | 38.358209 | 79 | 0.650973 |
import icebreaker
import unittest
from litex.build.lattice import programmer as lattice_programmer
from litex.soc.integration import soc as litex_soc
from litex.soc.integration import builder
from unittest import mock
class IcebreakerSoCWorkflowTest(unittest.TestCase):
def setUp(self):
self.soc = mock.cr... | true | true |
1c0259276506bfa2b788d5c02b85ac706653c6fc | 5,315 | py | Python | vumi/demos/tests/test_tictactoe.py | seidu626/vumi | 62eae205a07029bc7ab382086715694548001876 | [
"BSD-3-Clause"
] | 199 | 2015-01-05T09:04:24.000Z | 2018-08-15T17:02:49.000Z | vumi/demos/tests/test_tictactoe.py | seidu626/vumi | 62eae205a07029bc7ab382086715694548001876 | [
"BSD-3-Clause"
] | 187 | 2015-01-06T15:22:38.000Z | 2018-07-14T13:15:29.000Z | vumi/demos/tests/test_tictactoe.py | seidu626/vumi | 62eae205a07029bc7ab382086715694548001876 | [
"BSD-3-Clause"
] | 86 | 2015-01-31T02:47:08.000Z | 2018-12-01T11:59:47.000Z | from twisted.internet.defer import inlineCallbacks
from vumi.demos.tictactoe import TicTacToeGame, TicTacToeWorker
from vumi.message import TransportUserMessage
from vumi.application.tests.helpers import ApplicationHelper
from vumi.tests.helpers import VumiTestCase
class TestTicTacToeGame(VumiTestCase):
def get_... | 36.909722 | 78 | 0.577422 | from twisted.internet.defer import inlineCallbacks
from vumi.demos.tictactoe import TicTacToeGame, TicTacToeWorker
from vumi.message import TransportUserMessage
from vumi.application.tests.helpers import ApplicationHelper
from vumi.tests.helpers import VumiTestCase
class TestTicTacToeGame(VumiTestCase):
def get_... | true | true |
1c025b1535055b4a2f4aaa318822de2ee81c6149 | 13,238 | py | Python | tests/test_api.py | ServiceMax-Engineering/patroni | 48a6af6994f2bbb8a13e58db6179a514a3937429 | [
"MIT"
] | null | null | null | tests/test_api.py | ServiceMax-Engineering/patroni | 48a6af6994f2bbb8a13e58db6179a514a3937429 | [
"MIT"
] | null | null | null | tests/test_api.py | ServiceMax-Engineering/patroni | 48a6af6994f2bbb8a13e58db6179a514a3937429 | [
"MIT"
] | null | null | null | import datetime
import json
import psycopg2
import pytz
import unittest
from mock import Mock, patch
from patroni.api import RestApiHandler, RestApiServer
from patroni.dcs import ClusterConfig, Member
from six import BytesIO as IO
from six.moves import BaseHTTPServer
from test_postgresql import psycopg2_connect, MockC... | 41.111801 | 117 | 0.677595 | import datetime
import json
import psycopg2
import pytz
import unittest
from mock import Mock, patch
from patroni.api import RestApiHandler, RestApiServer
from patroni.dcs import ClusterConfig, Member
from six import BytesIO as IO
from six.moves import BaseHTTPServer
from test_postgresql import psycopg2_connect, MockC... | true | true |
1c025b9b5131f91359475ab30300b3fb5969a634 | 4,278 | py | Python | venv/Lib/site-packages/bigquery/core/Table.py | MuhammetALAPAN/Kaggle.com-Sql-BigQuery-Studies | b17568dd9cd074629a8789ca3c2fc351030f76a7 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/bigquery/core/Table.py | MuhammetALAPAN/Kaggle.com-Sql-BigQuery-Studies | b17568dd9cd074629a8789ca3c2fc351030f76a7 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/bigquery/core/Table.py | MuhammetALAPAN/Kaggle.com-Sql-BigQuery-Studies | b17568dd9cd074629a8789ca3c2fc351030f76a7 | [
"MIT"
] | null | null | null | import pandas as pd
from bigquery.core.Column import detect_type, find_sample_value
def get_table_info(_dbstream, table_and_schema_name):
split = table_and_schema_name.split(".")
if len(split) == 2:
table_name = split[1]
schema_name = split[0]
else:
raise Exception("Invalid table ... | 39.611111 | 117 | 0.604021 | import pandas as pd
from bigquery.core.Column import detect_type, find_sample_value
def get_table_info(_dbstream, table_and_schema_name):
split = table_and_schema_name.split(".")
if len(split) == 2:
table_name = split[1]
schema_name = split[0]
else:
raise Exception("Invalid table ... | true | true |
1c025b9d9590cd87cbf4d5736d2b8760f9dd18b1 | 1,075 | py | Python | core/processors/RUN_SSH_COMMANDProcessor.py | LoriSun/petp | f3bf52e5e26091d98907f97a6c95c9ddbf4999ae | [
"MIT"
] | 4 | 2021-06-06T11:57:14.000Z | 2021-07-18T00:34:09.000Z | core/processors/RUN_SSH_COMMANDProcessor.py | LoriSun/petp | f3bf52e5e26091d98907f97a6c95c9ddbf4999ae | [
"MIT"
] | null | null | null | core/processors/RUN_SSH_COMMANDProcessor.py | LoriSun/petp | f3bf52e5e26091d98907f97a6c95c9ddbf4999ae | [
"MIT"
] | 1 | 2021-06-16T16:05:55.000Z | 2021-06-16T16:05:55.000Z | import logging
from core.processor import Processor
from utils.ParamikoUtil import ParamikoUtil
from paramiko.client import SSHClient
class RUN_SSH_COMMANDProcessor(Processor):
TPL: str = '{"ssh_client_key":"sshclient", "cmd":"", "output_key":"", "close_after_run":"yes|no"}'
DESC: str = f'''
- run s... | 32.575758 | 103 | 0.662326 | import logging
from core.processor import Processor
from utils.ParamikoUtil import ParamikoUtil
from paramiko.client import SSHClient
class RUN_SSH_COMMANDProcessor(Processor):
TPL: str = '{"ssh_client_key":"sshclient", "cmd":"", "output_key":"", "close_after_run":"yes|no"}'
DESC: str = f'''
- run s... | true | true |
1c025bd1cae59f5b3c8ba8d6272991a51cbb0882 | 7,873 | py | Python | docs/conf.py | fooker/mido | 1077ffeb412cfe7673e9cbc091ec093d1252d7f8 | [
"MIT"
] | 658 | 2018-10-24T09:03:00.000Z | 2022-03-30T02:08:52.000Z | docs/conf.py | fooker/mido | 1077ffeb412cfe7673e9cbc091ec093d1252d7f8 | [
"MIT"
] | 161 | 2018-10-23T12:21:12.000Z | 2022-03-28T18:45:17.000Z | docs/conf.py | fooker/mido | 1077ffeb412cfe7673e9cbc091ec093d1252d7f8 | [
"MIT"
] | 105 | 2018-10-25T01:53:15.000Z | 2022-03-15T10:39:44.000Z | # -*- coding: utf-8 -*-
#
# Mido documentation build configuration file, created by
# sphinx-quickstart on Wed Jun 26 16:58:08 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All co... | 32.134694 | 122 | 0.715737 |
import sys, os
sys.path.insert(0, os.path.abspath('..'))
import mido
from mido import __version__
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.ifconfig']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'M... | true | true |
1c025c405d961d78e6bf3f69b59dbd14a6c8f142 | 1,183 | py | Python | test.py | sshkhr/prosthetics-rl | a19056aa90924b77e797e7d3a52eceeefc34e88c | [
"MIT"
] | 5 | 2019-09-24T21:30:26.000Z | 2020-11-07T05:30:02.000Z | test.py | sshkhr/prosthetics-rl | a19056aa90924b77e797e7d3a52eceeefc34e88c | [
"MIT"
] | null | null | null | test.py | sshkhr/prosthetics-rl | a19056aa90924b77e797e7d3a52eceeefc34e88c | [
"MIT"
] | null | null | null | import argparse
from osim.env import ProstheticsEnv
from osim.http.client import Client
from env.wrappers import Client_To_Env, Env_With_Dict_Observation, Env_With_JSONable_Actions
from env.dict_to_list import Dict_To_List
from utils.config import remote_base, crowdai_token
from agents.keras_ddpg_agent import KerasDD... | 28.166667 | 118 | 0.752325 | import argparse
from osim.env import ProstheticsEnv
from osim.http.client import Client
from env.wrappers import Client_To_Env, Env_With_Dict_Observation, Env_With_JSONable_Actions
from env.dict_to_list import Dict_To_List
from utils.config import remote_base, crowdai_token
from agents.keras_ddpg_agent import KerasDD... | true | true |
1c025f18a4ad2f7f2472fe68bac70871c5e294d0 | 6,529 | py | Python | python_tools/pipeline_kickoff/generate_copynumber_inputs.py | mskcc/ACCESS-Pipeline | b0f226a9ac5152f3afe0d38c8cd54aa25b8b01cf | [
"MIT"
] | 4 | 2018-08-23T04:37:43.000Z | 2021-07-03T12:49:51.000Z | python_tools/pipeline_kickoff/generate_copynumber_inputs.py | andurill/ACCESS-Pipeline | 3441040dfaecba58150c13a95a6a93657b00778a | [
"MIT"
] | 32 | 2018-06-08T12:44:55.000Z | 2022-01-13T01:29:35.000Z | python_tools/pipeline_kickoff/generate_copynumber_inputs.py | andurill/ACCESS-Pipeline | 3441040dfaecba58150c13a95a6a93657b00778a | [
"MIT"
] | 4 | 2018-05-25T21:43:48.000Z | 2022-01-07T18:51:43.000Z | import os
import csv
import glob
import logging
import argparse
import ruamel.yaml
from python_tools.util import include_yaml_resources, include_version_info
from python_tools.constants import CNV_INPUTS, VERSION_PARAM
##########
# Pipeline Inputs generation for the ACCESS Copy Number Variant Calling
#
# Usage:
#
# ... | 26.64898 | 107 | 0.603155 | import os
import csv
import glob
import logging
import argparse
import ruamel.yaml
from python_tools.util import include_yaml_resources, include_version_info
from python_tools.constants import CNV_INPUTS, VERSION_PARAM
logging.basicConfig(
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
date... | true | true |
1c025f7e57c16b110f2c47a54e797edc526ad5d9 | 106 | py | Python | src/yookassa_payout/__main__.py | yoomoney/yookassa-payout-sdk-python | f6953e97573bb4a4ee6f830f726a6fcfdf504e2a | [
"MIT"
] | 5 | 2021-03-11T14:38:25.000Z | 2021-08-13T10:41:50.000Z | src/yookassa_payout/__main__.py | yoomoney/yookassa-payout-sdk-python | f6953e97573bb4a4ee6f830f726a6fcfdf504e2a | [
"MIT"
] | 2 | 2021-02-15T18:18:34.000Z | 2021-08-13T13:49:46.000Z | src/yookassa_payout/__main__.py | yoomoney/yookassa-payout-sdk-python | f6953e97573bb4a4ee6f830f726a6fcfdf504e2a | [
"MIT"
] | 1 | 2022-01-29T08:47:02.000Z | 2022-01-29T08:47:02.000Z | import sys
from yookassa_payout.cli import main # noqa
if __name__ == "__main__":
sys.exit(main())
| 15.142857 | 44 | 0.698113 | import sys
from yookassa_payout.cli import main
if __name__ == "__main__":
sys.exit(main())
| true | true |
1c025fc03a67b520c10488d37779262cff96e028 | 702 | py | Python | flask_app.py | busyoucow/2smpb02e-with-isaax | b87d09d4d38caf53ada42638eb92fa7cdd68d40e | [
"MIT"
] | null | null | null | flask_app.py | busyoucow/2smpb02e-with-isaax | b87d09d4d38caf53ada42638eb92fa7cdd68d40e | [
"MIT"
] | null | null | null | flask_app.py | busyoucow/2smpb02e-with-isaax | b87d09d4d38caf53ada42638eb92fa7cdd68d40e | [
"MIT"
] | null | null | null | # coding: utf-8
# Sample that outputs the value acquired by 2SMPD-02E.
from __future__ import print_function
import time
import datetime
from flask import Flask
from flask import render_template
from flask import jsonify
import grove_2smpb_02e
sensor = grove_2smpb_02e.Grove2smpd02e()
app = Flask(__name__)
@app.ro... | 20.647059 | 70 | 0.729345 |
from __future__ import print_function
import time
import datetime
from flask import Flask
from flask import render_template
from flask import jsonify
import grove_2smpb_02e
sensor = grove_2smpb_02e.Grove2smpd02e()
app = Flask(__name__)
@app.route('/sensor')
def cpu():
press, temp = sensor.readData()
re... | true | true |
1c025ff8ff8e0c90b4195c3628b7852e8ee08858 | 272 | py | Python | 010407.py | anirudhkannanvp/UVA-OJ | e62029c2152f49c7e1229bd00be5309cce1352c8 | [
"MIT"
] | null | null | null | 010407.py | anirudhkannanvp/UVA-OJ | e62029c2152f49c7e1229bd00be5309cce1352c8 | [
"MIT"
] | null | null | null | 010407.py | anirudhkannanvp/UVA-OJ | e62029c2152f49c7e1229bd00be5309cce1352c8 | [
"MIT"
] | null | null | null | import sys
from fractions import gcd
for line in sys.stdin:
a=list(map(int,line.split()))
#print(a)
if(a==[0]):
break
a=a[0:len(a)-1]
#print(a)
ans=0
a.sort()
for i in range(1,len(a)):
ans=gcd(ans,a[i]-a[i-1])
print(ans) | 19.428571 | 33 | 0.529412 | import sys
from fractions import gcd
for line in sys.stdin:
a=list(map(int,line.split()))
if(a==[0]):
break
a=a[0:len(a)-1]
ans=0
a.sort()
for i in range(1,len(a)):
ans=gcd(ans,a[i]-a[i-1])
print(ans) | true | true |
1c0260e71b675c209c1c70f54c4c3ca4e6402cd6 | 18,946 | py | Python | sdk/python/pulumi_aws/ec2transitgateway/vpc_attachment_accepter.py | jen20/pulumi-aws | 172e00c642adc03238f89cc9c5a16b914a77c2b1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/ec2transitgateway/vpc_attachment_accepter.py | jen20/pulumi-aws | 172e00c642adc03238f89cc9c5a16b914a77c2b1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/ec2transitgateway/vpc_attachment_accepter.py | jen20/pulumi-aws | 172e00c642adc03238f89cc9c5a16b914a77c2b1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 50.930108 | 226 | 0.695134 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities, _tables
__all__ = ['VpcAttachmentAccepterArgs', 'VpcAttachmentAccepter']
@pulumi.input_type
class VpcAttachmentAccepterArgs:
def __init__(__self__, *,
... | true | true |
1c026244b568c30daec9fe9130578c664550a201 | 9,539 | py | Python | fairseq/optim/adafactor.py | ksboy/fairseq | 97154aa441769f7b335e8908392d7fb1b4b8de24 | [
"MIT"
] | 50 | 2021-11-15T02:34:43.000Z | 2021-11-18T07:24:46.000Z | codes_src/fairseq/optim/adafactor.py | yujun531/WeTS | bba33ad64e10efd7d3d95b5a0b6ad125216542cf | [
"Unlicense"
] | 8 | 2020-11-05T04:44:21.000Z | 2021-12-20T03:26:59.000Z | codes_src/fairseq/optim/adafactor.py | yujun531/WeTS | bba33ad64e10efd7d3d95b5a0b6ad125216542cf | [
"Unlicense"
] | 26 | 2021-11-15T02:35:14.000Z | 2021-11-15T08:25:42.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
import torch
import torch.optim
from . import FairseqOptimizer, register_optimizer
@register_optimizer('adafactor')
class Fairs... | 44.574766 | 110 | 0.586015 |
import math
import torch
import torch.optim
from . import FairseqOptimizer, register_optimizer
@register_optimizer('adafactor')
class FairseqAdafactor(FairseqOptimizer):
def __init__(self, args, params):
super().__init__(args, params)
self._optimizer = Adafactor(params, **self.optimizer_config)
... | true | true |
1c0262dcf0ccf9e4bd50113224d79bb53706ebbc | 10,175 | py | Python | conda_forge_tick/status_report.py | Prodyte/cf-scripts | 1800432178f158d824b17faef9ed70d557a06c8d | [
"MIT"
] | null | null | null | conda_forge_tick/status_report.py | Prodyte/cf-scripts | 1800432178f158d824b17faef9ed70d557a06c8d | [
"MIT"
] | null | null | null | conda_forge_tick/status_report.py | Prodyte/cf-scripts | 1800432178f158d824b17faef9ed70d557a06c8d | [
"MIT"
] | null | null | null | import csv
import os
import json
import subprocess
import copy
from collections import Counter
import networkx as nx
from graphviz import Source
import tempfile
from typing import Any, Dict, Set, Tuple
from conda_forge_tick.utils import frozen_to_json_friendly, load_graph
from conda_forge_tick.auto_tick import initi... | 32.507987 | 86 | 0.541327 | import csv
import os
import json
import subprocess
import copy
from collections import Counter
import networkx as nx
from graphviz import Source
import tempfile
from typing import Any, Dict, Set, Tuple
from conda_forge_tick.utils import frozen_to_json_friendly, load_graph
from conda_forge_tick.auto_tick import initi... | true | true |
1c026424c4df33c72f4b7f278f57d2e39357947b | 50 | py | Python | pyscripts/assets.py | lorvent/Bootstrap-Form-Builder-V3V4 | 7545203c7ae5b24c69d4dd4cafafbe6ecd1642b5 | [
"MIT"
] | 42 | 2017-08-23T02:54:07.000Z | 2021-09-16T08:15:15.000Z | pyscripts/assets.py | lorvent/Bootstrap-Form-Builder-V3V4 | 7545203c7ae5b24c69d4dd4cafafbe6ecd1642b5 | [
"MIT"
] | 21 | 2017-08-14T18:32:58.000Z | 2020-10-08T23:45:57.000Z | pyscripts/assets.py | lorvent/Bootstrap-Form-Builder-V3V4 | 7545203c7ae5b24c69d4dd4cafafbe6ecd1642b5 | [
"MIT"
] | 34 | 2017-10-29T05:02:28.000Z | 2021-09-16T08:15:20.000Z | """
Python script to generate webasset bundles
""" | 16.666667 | 42 | 0.74 | true | true | |
1c026485c7942d310a45b056a2fa11d35d789686 | 17,293 | py | Python | platform-tools/systrace/catapult/telemetry/telemetry/decorators_unittest.py | nbasingh5/dragons | 7926c79f95b46ca1ff44617b1d8cdc633343774b | [
"MIT"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | third_party/catapult/telemetry/telemetry/decorators_unittest.py | cangulcan/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | third_party/catapult/telemetry/telemetry/decorators_unittest.py | cangulcan/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
import mock
from telemetry.core import platform
from telemetry import decorators
from telemetry.internal.browser import possible_browser
... | 32.689981 | 80 | 0.700572 |
import unittest
import mock
from telemetry.core import platform
from telemetry import decorators
from telemetry.internal.browser import possible_browser
class FakeTest(object):
def SetEnabledStrings(self, enabled_strings):
enabled_attr_name = decorators.EnabledAttributeName(self)
setattr(self, enabled_a... | true | true |
1c0265289c11be5d4b7cc54fa7ff5f724c62418e | 31,039 | py | Python | python/oneflow/nn/modules/activation.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/nn/modules/activation.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/nn/modules/activation.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow 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 applicable law or agr... | 26.551754 | 123 | 0.55295 | import warnings
from typing import Optional
import oneflow as flow
import oneflow._oneflow_internal
from oneflow.framework.tensor import register_tensor_op
from oneflow.nn.module import Module
from oneflow.nn.modules.utils import _check_inplace_valid
def _softmax_need_transpose(x, axis):
assert type(axis) is int... | true | true |
1c0266231b894083b7715107efcb6a0b14ea4e6d | 757 | py | Python | codes/lambda/topic-function/src/handler.py | aJoohongKim/aws-serverless-using-aws-cdk | 7dd9af4d404318499fecd65ae544c565107739d0 | [
"MIT-0"
] | 24 | 2021-03-04T09:08:21.000Z | 2022-03-20T21:25:20.000Z | codes/lambda/topic-function/src/handler.py | bluegury/aws-serverless-using-aws-cdk | b464be4baaad220bda6e078b8e3be8badfc3d43f | [
"MIT-0"
] | 3 | 2021-06-02T11:29:15.000Z | 2022-03-07T06:47:26.000Z | codes/lambda/topic-function/src/handler.py | bluegury/aws-serverless-using-aws-cdk | b464be4baaad220bda6e078b8e3be8badfc3d43f | [
"MIT-0"
] | 10 | 2021-03-04T09:08:30.000Z | 2022-02-08T03:55:53.000Z | import os
import json
import boto3
from botocore.exceptions import ClientError
_table_name = os.environ.get('TABLE_NAME', 'ServerlessCdkDemo-ServerlessStack-ddb-table')
def get_client(service):
return boto3.client(service)
def get_resource(service):
return boto3.Session().resource(service)
def put_ddb(t... | 22.264706 | 89 | 0.676354 | import os
import json
import boto3
from botocore.exceptions import ClientError
_table_name = os.environ.get('TABLE_NAME', 'ServerlessCdkDemo-ServerlessStack-ddb-table')
def get_client(service):
return boto3.client(service)
def get_resource(service):
return boto3.Session().resource(service)
def put_ddb(t... | true | true |
1c02663829e089a6e973d9638110aa75a81d4ed3 | 10,724 | py | Python | src/lib/utils/io/.ipynb_checkpoints/files-checkpoint.py | charzharr/Hierarchical-Contrastive-Pretraining | 3c7ad022a90fe7137ed3a22655d48ae1ba27510c | [
"MIT"
] | null | null | null | src/lib/utils/io/.ipynb_checkpoints/files-checkpoint.py | charzharr/Hierarchical-Contrastive-Pretraining | 3c7ad022a90fe7137ed3a22655d48ae1ba27510c | [
"MIT"
] | null | null | null | src/lib/utils/io/.ipynb_checkpoints/files-checkpoint.py | charzharr/Hierarchical-Contrastive-Pretraining | 3c7ad022a90fe7137ed3a22655d48ae1ba27510c | [
"MIT"
] | null | null | null |
import sys, os
import pathlib
import ntpath
### Constants ###
IMAGE_EXTS = ['.bmp', '.png', '.jpg', '.jpeg', '.tiff', '.gif',
'.nii', '.dcm']
### ======================================================================== ###
### * ### * ### * ### * API Definitions * ### * ### * ### * ##... | 37.62807 | 104 | 0.577396 |
import sys, os
import pathlib
import ntpath
IMAGE_EXTS = ['.bmp', '.png', '.jpg', '.jpeg', '.tiff', '.gif',
'.nii', '.dcm']
def is_image(filepath, exts=None, checkfile=False):
if checkfile:
assert os.path.isfile(filepath), f"File ({filepath}) does not exist."
if exts:
if... | true | true |
1c026769951fd640f47213cf2e23d19909dba307 | 2,402 | py | Python | src/oci/cloud_guard/models/execute_responder_execution_details.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 249 | 2017-09-11T22:06:05.000Z | 2022-03-04T17:09:29.000Z | src/oci/cloud_guard/models/execute_responder_execution_details.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 228 | 2017-09-11T23:07:26.000Z | 2022-03-23T10:58:50.000Z | src/oci/cloud_guard/models/execute_responder_execution_details.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 224 | 2017-09-27T07:32:43.000Z | 2022-03-25T16:55:42.000Z | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 33.830986 | 245 | 0.702748 |
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class ExecuteResponderExecutionDetails(object):
def __init__(self, **kwargs):
self.swagger_types = {
'configura... | true | true |
1c0267bbc0febab953eb1a4752ce053e84db8e14 | 12,325 | py | Python | fairseq/data/audio/hubert_dataset.py | Shiguang-Guo/fairseq | c9d3df5679d0829cda8fc3c818b6cab52b78dc37 | [
"MIT"
] | 8 | 2022-03-19T15:20:10.000Z | 2022-03-30T20:29:25.000Z | fairseq/data/audio/hubert_dataset.py | Shiguang-Guo/fairseq | c9d3df5679d0829cda8fc3c818b6cab52b78dc37 | [
"MIT"
] | 1 | 2022-03-30T07:45:04.000Z | 2022-03-31T23:11:51.000Z | fairseq/data/audio/hubert_dataset.py | Shiguang-Guo/fairseq | c9d3df5679d0829cda8fc3c818b6cab52b78dc37 | [
"MIT"
] | 2 | 2022-03-18T14:42:41.000Z | 2022-03-19T15:23:20.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import itertools
import logging
import os
import sys
from typing import Any, List, Optional, Union
import numpy as np
import torch
import to... | 35.724638 | 86 | 0.591075 |
import itertools
import logging
import os
import sys
from typing import Any, List, Optional, Union
import numpy as np
import torch
import torch.nn.functional as F
from fairseq.data import data_utils
from fairseq.data.fairseq_dataset import FairseqDataset
logger = logging.getLogger(__name__)
def load_audio(manifes... | true | true |
1c026814fd5d7d86d38b67f4b13eb5eed4d8023d | 260 | py | Python | src/koji_builder_kube/session/__init__.py | odra/koji-scheduler | 121142376036629af4e40b3262774b6fedb82370 | [
"MIT"
] | 3 | 2021-09-14T18:39:38.000Z | 2022-03-18T01:33:51.000Z | src/koji_builder_kube/session/__init__.py | odra/koji-scheduler | 121142376036629af4e40b3262774b6fedb82370 | [
"MIT"
] | null | null | null | src/koji_builder_kube/session/__init__.py | odra/koji-scheduler | 121142376036629af4e40b3262774b6fedb82370 | [
"MIT"
] | null | null | null | from typing import Optional, Any
from .session_ssl import SessionSSL
from .base import BaseSession
def get(name: str, **kwargs: Any) -> Optional[BaseSession]:
for impl in [SessionSSL]:
if impl.name() == name:
return impl(**kwargs)
return None
| 21.666667 | 59 | 0.703846 | from typing import Optional, Any
from .session_ssl import SessionSSL
from .base import BaseSession
def get(name: str, **kwargs: Any) -> Optional[BaseSession]:
for impl in [SessionSSL]:
if impl.name() == name:
return impl(**kwargs)
return None
| true | true |
1c026848bf93b3561f377003f7c2a1ed289a7946 | 26 | py | Python | superfsmon/__init__.py | slippycheeze/superfsmon | 2c92de33aa75a4b4a8c4bee5ab2b594887faf137 | [
"MIT"
] | 17 | 2018-07-11T15:12:08.000Z | 2022-02-17T18:41:25.000Z | superfsmon/__init__.py | slippycheeze/superfsmon | 2c92de33aa75a4b4a8c4bee5ab2b594887faf137 | [
"MIT"
] | 2 | 2019-01-22T17:18:25.000Z | 2021-08-30T17:00:16.000Z | superfsmon/__init__.py | slippycheeze/superfsmon | 2c92de33aa75a4b4a8c4bee5ab2b594887faf137 | [
"MIT"
] | 7 | 2019-08-13T09:34:57.000Z | 2022-01-15T12:05:23.000Z | from .superfsmon import *
| 13 | 25 | 0.769231 | from .superfsmon import *
| true | true |
1c0269035ebc410897ea4d1f632c2373a5090ac2 | 284 | py | Python | icarus/models/strategy/__init__.py | Chrisys93/IcarusRepoSEND | f670b8e178c6e6e63cdabb71434eee8ac33c28e9 | [
"MIT"
] | 4 | 2021-04-29T10:16:04.000Z | 2022-03-02T08:14:53.000Z | icarus/models/strategy/__init__.py | Chrisys93/IcarusRepoSEND | f670b8e178c6e6e63cdabb71434eee8ac33c28e9 | [
"MIT"
] | 1 | 2021-12-13T07:40:46.000Z | 2021-12-20T16:59:08.000Z | icarus/models/strategy/__init__.py | Chrisys93/IcarusRepoSEND | f670b8e178c6e6e63cdabb71434eee8ac33c28e9 | [
"MIT"
] | 1 | 2021-11-25T05:42:20.000Z | 2021-11-25T05:42:20.000Z | # -*- coding: utf-8 -*-
"""Implementations of all caching and routing strategies"""
from .base import *
from .hashrouting import *
from .onpath import *
from .offpath import *
from .service import *
from .optimal import *
from .placement import *
from .repo_storage_mgmt_app import *
| 25.818182 | 59 | 0.735915 | from .base import *
from .hashrouting import *
from .onpath import *
from .offpath import *
from .service import *
from .optimal import *
from .placement import *
from .repo_storage_mgmt_app import *
| true | true |
1c02692b977bdf9c0182a391200fad13dc777482 | 187 | py | Python | fireant/tests/database/mock_database.py | vladaspasic/fireant | 2dbae6a97a927ef62fdcd5f37fcb51a7d6d55334 | [
"Apache-2.0"
] | 122 | 2016-08-05T13:34:52.000Z | 2022-03-15T13:21:13.000Z | fireant/tests/database/mock_database.py | RobinPapke/fireant | 822a5306b981549cb21a508a9b35729ecb8af6ec | [
"Apache-2.0"
] | 321 | 2016-08-10T08:48:15.000Z | 2021-07-28T13:08:18.000Z | fireant/tests/database/mock_database.py | RobinPapke/fireant | 822a5306b981549cb21a508a9b35729ecb8af6ec | [
"Apache-2.0"
] | 27 | 2016-08-10T08:11:08.000Z | 2021-08-23T08:14:37.000Z | from fireant.database.vertica import VerticaDatabase
class TestDatabase(VerticaDatabase):
# Vertica client that uses the vertica_python driver.
def connect(self):
pass
| 20.777778 | 57 | 0.754011 | from fireant.database.vertica import VerticaDatabase
class TestDatabase(VerticaDatabase):
def connect(self):
pass
| true | true |
1c0269abf37ce13144ca7e0bc07e652ec8ac41cb | 9,138 | py | Python | test/test_automl.py | sailfish009/FLAML | 492990655d09a144d99e91de4dedda761a70302e | [
"MIT"
] | 3 | 2021-08-30T05:59:25.000Z | 2021-09-23T01:06:48.000Z | test/test_automl.py | sailfish009/FLAML | 492990655d09a144d99e91de4dedda761a70302e | [
"MIT"
] | null | null | null | test/test_automl.py | sailfish009/FLAML | 492990655d09a144d99e91de4dedda761a70302e | [
"MIT"
] | null | null | null | import unittest
import numpy as np
import scipy.sparse
from sklearn.datasets import load_boston, load_iris
from flaml import AutoML, get_output_from_log
def custom_metric(X_test, y_test, estimator, labels, X_train, y_train):
from sklearn.metrics import log_loss
y_pred = estimator.predict_proba(X_test)
t... | 38.720339 | 81 | 0.630882 | import unittest
import numpy as np
import scipy.sparse
from sklearn.datasets import load_boston, load_iris
from flaml import AutoML, get_output_from_log
def custom_metric(X_test, y_test, estimator, labels, X_train, y_train):
from sklearn.metrics import log_loss
y_pred = estimator.predict_proba(X_test)
t... | true | true |
1c026a44c012e26ef3bb8230f3cda2ae092c8c9d | 1,180 | py | Python | tests/custom_columns_regress/models.py | fizista/django | 16f3a6a4c7bab11644d11c2be029374e5095cb56 | [
"BSD-3-Clause"
] | 2 | 2016-07-23T18:08:37.000Z | 2016-07-24T09:54:34.000Z | tests/custom_columns_regress/models.py | fizista/django | 16f3a6a4c7bab11644d11c2be029374e5095cb56 | [
"BSD-3-Clause"
] | null | null | null | tests/custom_columns_regress/models.py | fizista/django | 16f3a6a4c7bab11644d11c2be029374e5095cb56 | [
"BSD-3-Clause"
] | 1 | 2020-10-01T08:23:34.000Z | 2020-10-01T08:23:34.000Z | """
Regression for #9736.
Checks some pathological column naming to make sure it doesn't break
table creation or queries.
"""
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Article(models.Model):
... | 29.5 | 99 | 0.728814 | from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Article(models.Model):
Article_ID = models.AutoField(primary_key=True, db_column='Article ID')
headline = models.CharField(max_length=100)
... | true | true |
1c026a6812621b27ffaa118ab5ab45873064a72b | 4,438 | py | Python | parsers.py | yathomasi/Fantasy-Premier-League | 892eb610fb081f56af7fa93cd72446e9a17db7e5 | [
"MIT"
] | null | null | null | parsers.py | yathomasi/Fantasy-Premier-League | 892eb610fb081f56af7fa93cd72446e9a17db7e5 | [
"MIT"
] | null | null | null | parsers.py | yathomasi/Fantasy-Premier-League | 892eb610fb081f56af7fa93cd72446e9a17db7e5 | [
"MIT"
] | null | null | null | import csv
import os
# from utility import uprint
import pandas as pd
def extract_stat_names(dict_of_stats):
"""Extracts all the names of the statistics
Args:
dict_of_stats (dict): Dictionary containing key-alue pair of stats
"""
stat_names = []
for key, val in dict_of_stats.items():
... | 36.677686 | 85 | 0.671474 | import csv
import os
import pandas as pd
def extract_stat_names(dict_of_stats):
stat_names = []
for key, val in dict_of_stats.items():
stat_names += [key]
return stat_names
def parse_top_players(data, base_filename):
rows = []
for event in data["events"]:
gw = event["id"]
... | true | true |
1c026b070a46261243ee293276d912e293267f88 | 276 | py | Python | list_zero_or_not.py | bjoffficial/Python | 73e6fdc19a1bec18488405c4a60c30ba68581ce5 | [
"Apache-2.0"
] | null | null | null | list_zero_or_not.py | bjoffficial/Python | 73e6fdc19a1bec18488405c4a60c30ba68581ce5 | [
"Apache-2.0"
] | null | null | null | list_zero_or_not.py | bjoffficial/Python | 73e6fdc19a1bec18488405c4a60c30ba68581ce5 | [
"Apache-2.0"
] | null | null | null | n=int(input("Enter the number"))
ls=[]
for i in range(n):
ls.append(int(input("Enter the numbersss")))
le=len(ls)
for i in range(le-1):
for j in range(1,le):
if ls[i]+ls[j]==0:
print(ls[j],ls[i])
else:
continue
| 21.230769 | 49 | 0.496377 | n=int(input("Enter the number"))
ls=[]
for i in range(n):
ls.append(int(input("Enter the numbersss")))
le=len(ls)
for i in range(le-1):
for j in range(1,le):
if ls[i]+ls[j]==0:
print(ls[j],ls[i])
else:
continue
| true | true |
1c026b64b97c74d703685876317f774a7c8f7819 | 580 | py | Python | a010-csr1kv-nat-ha.py | yamekimsense/aws-csr1kv-nat-ha | f328a30d1721d892d4418547a1df2fcb452c0c07 | [
"BSD-3-Clause"
] | null | null | null | a010-csr1kv-nat-ha.py | yamekimsense/aws-csr1kv-nat-ha | f328a30d1721d892d4418547a1df2fcb452c0c07 | [
"BSD-3-Clause"
] | null | null | null | a010-csr1kv-nat-ha.py | yamekimsense/aws-csr1kv-nat-ha | f328a30d1721d892d4418547a1df2fcb452c0c07 | [
"BSD-3-Clause"
] | null | null | null | #run on python3
import boto3
print ("---- IP movement ---------------")
print (response)
ec2 = boto3.resource('ec2')
route = ec2.Route('rtb-id','0.0.0.0/0')
response = route.replace(NetworkInterfaceId='target-nic-id')
print ("---- route change ---------------")
print (response)
ec2 = boto3.resource('ec2')
ne... | 20 | 60 | 0.62931 |
import boto3
print ("---- IP movement ---------------")
print (response)
ec2 = boto3.resource('ec2')
route = ec2.Route('rtb-id','0.0.0.0/0')
response = route.replace(NetworkInterfaceId='target-nic-id')
print ("---- route change ---------------")
print (response)
ec2 = boto3.resource('ec2')
network_interface ... | true | true |
1c026b94e355659a39bf23af8982f8aecdff5267 | 1,058 | py | Python | authorization/middleware.py | R-Mielamud/TheKinozal | 62cb79faae58b23f0ef0175593ed9b5746229b5b | [
"MIT"
] | 1 | 2020-10-16T19:15:32.000Z | 2020-10-16T19:15:32.000Z | authorization/middleware.py | R-Mielamud/TheKinozal | 62cb79faae58b23f0ef0175593ed9b5746229b5b | [
"MIT"
] | null | null | null | authorization/middleware.py | R-Mielamud/TheKinozal | 62cb79faae58b23f0ef0175593ed9b5746229b5b | [
"MIT"
] | null | null | null | from django.utils.deprecation import MiddlewareMixin
from helpers import jwt
from TheKinozal import settings
from django.http import JsonResponse
from .models import User
def extract_jwt(get_response):
def middleware(request):
jwt_token = jwt.extract_user_token(request)
setattr(request, "jwt_token... | 27.128205 | 94 | 0.650284 | from django.utils.deprecation import MiddlewareMixin
from helpers import jwt
from TheKinozal import settings
from django.http import JsonResponse
from .models import User
def extract_jwt(get_response):
def middleware(request):
jwt_token = jwt.extract_user_token(request)
setattr(request, "jwt_token... | true | true |
1c026ba9c2753464f0bbe7be9ca7dff68c3a0adb | 2,355 | py | Python | models/Regressor.py | tijsmaas/SWaveNet | 4f34fc7b2c1b5139387bfec8d32266270e881b38 | [
"MIT"
] | 24 | 2018-06-25T00:48:31.000Z | 2020-03-17T03:35:04.000Z | models/Regressor.py | tijsmaas/SWaveNet | 4f34fc7b2c1b5139387bfec8d32266270e881b38 | [
"MIT"
] | null | null | null | models/Regressor.py | tijsmaas/SWaveNet | 4f34fc7b2c1b5139387bfec8d32266270e881b38 | [
"MIT"
] | 11 | 2018-09-03T14:38:03.000Z | 2020-05-29T11:13:31.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
class Regressor(nn.Module):
def __init__(self, Loss, hid, m):
super(Regressor, self).__init__()
self.loss_function = Loss;
self.m = m
if (self.loss_function == 'uni-Gaussian-novar'):
self.mean = nn.Linear... | 36.230769 | 76 | 0.49724 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Regressor(nn.Module):
def __init__(self, Loss, hid, m):
super(Regressor, self).__init__()
self.loss_function = Loss;
self.m = m
if (self.loss_function == 'uni-Gaussian-novar'):
self.mean = nn.Linear... | true | true |
1c026be6d29a74c0cdb3d4bcecb43f472843ea3f | 2,228 | py | Python | cps-tools/src/cps_tools/helloworld.py | bopopescu/conpaas-2 | 0141a11b67b14757f445b44613ea79819b9c2eaf | [
"BSD-3-Clause"
] | 5 | 2016-02-24T14:44:03.000Z | 2020-11-29T19:18:40.000Z | cps-tools/src/cps_tools/helloworld.py | bopopescu/conpaas-2 | 0141a11b67b14757f445b44613ea79819b9c2eaf | [
"BSD-3-Clause"
] | 25 | 2015-03-23T16:05:19.000Z | 2018-02-13T17:22:22.000Z | cps-tools/src/cps_tools/helloworld.py | bopopescu/conpaas-2 | 0141a11b67b14757f445b44613ea79819b9c2eaf | [
"BSD-3-Clause"
] | 2 | 2015-11-06T15:16:09.000Z | 2020-07-26T03:18:03.000Z |
import sys
import logging
import argcomplete
import traceback
from .base import BaseClient
from .config import config
from .service import ServiceCmd
class HelloWorldCmd(ServiceCmd):
def __init__(self, helloworld_parser, client):
ServiceCmd.__init__(self, helloworld_parser, client, "helloworld",
... | 31.380282 | 90 | 0.625673 |
import sys
import logging
import argcomplete
import traceback
from .base import BaseClient
from .config import config
from .service import ServiceCmd
class HelloWorldCmd(ServiceCmd):
def __init__(self, helloworld_parser, client):
ServiceCmd.__init__(self, helloworld_parser, client, "helloworld",
... | false | true |
1c026bf515ed2ee75cb046511de891145466adbe | 10,188 | py | Python | gym_flock/envs/old/mapping.py | katetolstaya/gym-flock | 3236d1dafcb1b9be0cf78b471672e8becb2d37af | [
"MIT"
] | 19 | 2019-07-29T22:19:58.000Z | 2022-01-27T04:38:38.000Z | gym_flock/envs/old/mapping.py | henghenghahei849/gym-flock | b09bdfbbe4a96fe052958d1f9e1e9dd314f58419 | [
"MIT"
] | null | null | null | gym_flock/envs/old/mapping.py | henghenghahei849/gym-flock | b09bdfbbe4a96fe052958d1f9e1e9dd314f58419 | [
"MIT"
] | 5 | 2019-10-03T14:44:49.000Z | 2021-12-09T20:39:39.000Z | import gym
from gym import spaces, error, utils
from gym.utils import seeding
import numpy as np
import configparser
from os import path
import matplotlib.pyplot as plt
from matplotlib.pyplot import gca
font = {'family': 'sans-serif',
'weight': 'bold',
'size': 14}
class MappingEnv(gym.Env):
def ... | 38.014925 | 120 | 0.565077 | import gym
from gym import spaces, error, utils
from gym.utils import seeding
import numpy as np
import configparser
from os import path
import matplotlib.pyplot as plt
from matplotlib.pyplot import gca
font = {'family': 'sans-serif',
'weight': 'bold',
'size': 14}
class MappingEnv(gym.Env):
def ... | true | true |
1c026bfbce15a13241a097d254dfa2494ac03a5c | 2,374 | py | Python | mmcv/parallel/data_container.py | serge-sans-paille/mmcv | 460b5cea2e1b339b44ff167b222de49073f0ad9b | [
"Apache-2.0"
] | null | null | null | mmcv/parallel/data_container.py | serge-sans-paille/mmcv | 460b5cea2e1b339b44ff167b222de49073f0ad9b | [
"Apache-2.0"
] | null | null | null | mmcv/parallel/data_container.py | serge-sans-paille/mmcv | 460b5cea2e1b339b44ff167b222de49073f0ad9b | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Open-MMLab. All rights reserved.
import functools
import torch
def assert_tensor_type(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
if not isinstance(args[0].data, torch.Tensor):
raise AttributeError(
f'{args[0].__class__.__name__} has no att... | 26.377778 | 79 | 0.622578 | import functools
import torch
def assert_tensor_type(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
if not isinstance(args[0].data, torch.Tensor):
raise AttributeError(
f'{args[0].__class__.__name__} has no attribute '
f'{func.__name__} for ty... | true | true |
1c026c191166d67945a557d2c00a738a00f84ebd | 1,212 | py | Python | code/dataset_creation.py | kspurlock/CS430-Demos | 81a1ee923aa3e9ea27d67a412aef1f49a7204932 | [
"MIT"
] | null | null | null | code/dataset_creation.py | kspurlock/CS430-Demos | 81a1ee923aa3e9ea27d67a412aef1f49a7204932 | [
"MIT"
] | null | null | null | code/dataset_creation.py | kspurlock/CS430-Demos | 81a1ee923aa3e9ea27d67a412aef1f49a7204932 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Jul 6 16:37:04 2021
@author: kylei
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.datasets import make_blobs
if __name__ == "__main__":
n_classes = 2
data, labels = make_blobs(
n_samples=1000,
centers=n_class... | 24.24 | 87 | 0.588284 |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.datasets import make_blobs
if __name__ == "__main__":
n_classes = 2
data, labels = make_blobs(
n_samples=1000,
centers=n_classes,
random_state=10,
center_box=(-10.0, 10.0), cluster_std=2... | true | true |
1c026c23f6849406e5a8bb17fba779e9e3df3e43 | 27,829 | py | Python | Orio/orio/main/tuner/ptest_codegen.py | HPCL/nametbd | 1b588cd6ce94ab39a8ba6f89d9eb64e1d3726af5 | [
"MIT"
] | null | null | null | Orio/orio/main/tuner/ptest_codegen.py | HPCL/nametbd | 1b588cd6ce94ab39a8ba6f89d9eb64e1d3726af5 | [
"MIT"
] | null | null | null | Orio/orio/main/tuner/ptest_codegen.py | HPCL/nametbd | 1b588cd6ce94ab39a8ba6f89d9eb64e1d3726af5 | [
"MIT"
] | null | null | null | #
# The basic code generator for performance-testing code
#
import random, re
import skeleton_code
from orio.main.util.globals import *
from orio.main.tuner.skeleton_code import SEQ_TIMER
#-----------------------------------------------------
class PerfTestCodeGen(object):
'''The code generator used to produce ... | 37.606757 | 130 | 0.533652 |
import random, re
import skeleton_code
from orio.main.util.globals import *
from orio.main.tuner.skeleton_code import SEQ_TIMER
class PerfTestCodeGen(object):
malloc_func_name = 'malloc_arrays'
dalloc_func_name = 'dalloc_arrays'
init_func_name = 'init_input_vars'
validation_func_name = 'isVal... | true | true |
1c026d64719d30146cc3c446a30ff2d2c61b36b8 | 35,313 | py | Python | tests/unit/modules/test_netscaler.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | 1 | 2020-03-31T22:51:16.000Z | 2020-03-31T22:51:16.000Z | tests/unit/modules/test_netscaler.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | null | null | null | tests/unit/modules/test_netscaler.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-09-30T07:00:01.000Z | 2021-09-30T07:00:01.000Z | # -*- coding: utf-8 -*-
'''
:codeauthor: Jayesh Kariya <jayeshk@saltstack.com>
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import TestCase
from tests.supp... | 31.473262 | 85 | 0.56053 |
from __future__ import absolute_import, print_function, unicode_literals
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import TestCase
from tests.support.mock import (
MagicMock,
patch,
)
import salt.modules.netscaler as netscaler
class MockJson(Exception):
@staticmetho... | true | true |
1c026db566b73fef6a82221f844c1351a59c5db0 | 1,391 | py | Python | django_prometheus/models.py | mikiec84/django-prometheus | c3a19ce46d812f76d9316e50a232878c27c9bdf5 | [
"Apache-2.0"
] | 5,079 | 2015-01-01T03:39:46.000Z | 2022-03-31T07:38:22.000Z | django_prometheus/models.py | mikiec84/django-prometheus | c3a19ce46d812f76d9316e50a232878c27c9bdf5 | [
"Apache-2.0"
] | 1,623 | 2015-01-01T08:06:24.000Z | 2022-03-30T19:48:52.000Z | django_prometheus/models.py | mikiec84/django-prometheus | c3a19ce46d812f76d9316e50a232878c27c9bdf5 | [
"Apache-2.0"
] | 2,033 | 2015-01-04T07:18:02.000Z | 2022-03-28T19:55:47.000Z | from prometheus_client import Counter
model_inserts = Counter(
'django_model_inserts_total',
'Number of insert operations by model.',
['model'])
model_updates = Counter(
'django_model_updates_total',
'Number of update operations by model.',
['model'])
model_deletes = Counter(
'django_mode... | 30.911111 | 78 | 0.667146 | from prometheus_client import Counter
model_inserts = Counter(
'django_model_inserts_total',
'Number of insert operations by model.',
['model'])
model_updates = Counter(
'django_model_updates_total',
'Number of update operations by model.',
['model'])
model_deletes = Counter(
'django_mode... | true | true |
1c02705da2f9a880e157d66a37198226a2ad5acb | 8,106 | py | Python | bio_rtd/peak_shapes.py | open-biotech/bio-rtd | c3e2cf4d7d646bda719e5fc6f694a1cae0e412c0 | [
"MIT"
] | 5 | 2020-03-30T13:26:12.000Z | 2021-04-02T07:10:49.000Z | bio_rtd/peak_shapes.py | open-biotech/bio-rtd | c3e2cf4d7d646bda719e5fc6f694a1cae0e412c0 | [
"MIT"
] | null | null | null | bio_rtd/peak_shapes.py | open-biotech/bio-rtd | c3e2cf4d7d646bda719e5fc6f694a1cae0e412c0 | [
"MIT"
] | 1 | 2020-06-03T07:50:56.000Z | 2020-06-03T07:50:56.000Z | """
Peak shapes based on mean residence time (`rt_mean`).
Notes
-----
Functions are evaluated for given time vectors. Peaks are considered
clipped if they do not fully fit on the time vector.
For un-clipped peak, the integral over the peak over time == 1.
For un-clipped peak, first momentum == `rt_mean`.
"""
__ver... | 31.540856 | 79 | 0.561559 |
__version__ = '0.7.1'
__author__ = 'Jure Sencar'
import typing as _typing
import numpy as _np
from scipy import special as _special
from bio_rtd.logger import RtdLogger as _RtdLogger
def gaussian(t: _np.ndarray, rt_mean: float, sigma: float,
logger: _typing.Union[_RtdLogger, None] = None) -> _np.ndar... | true | true |
1c02717a177cf4cb9793a1a5985b19fb3d23c274 | 576 | py | Python | cmds/ai.py | Toricane/Encourage-Bot | 65be63ee405b0e228738617c3ae12c395c3c6a08 | [
"MIT"
] | 4 | 2021-03-26T04:20:05.000Z | 2022-03-30T16:42:29.000Z | cmds/ai.py | Toricane/Perseverance-Bot | 65be63ee405b0e228738617c3ae12c395c3c6a08 | [
"MIT"
] | null | null | null | cmds/ai.py | Toricane/Perseverance-Bot | 65be63ee405b0e228738617c3ae12c395c3c6a08 | [
"MIT"
] | null | null | null | from prsaw import RandomStuff
import os
api_key = f"{os.getenv('api_key')}"
rs = RandomStuff(async_mode=True, api_key=api_key)
async def ai_response(ctx, msg):
response = await rs.get_ai_response(msg)
await ctx.send(response)
async def get_a_joke(ctx, joke):
response = await rs.get_joke(_type="any")
... | 27.428571 | 55 | 0.685764 | from prsaw import RandomStuff
import os
api_key = f"{os.getenv('api_key')}"
rs = RandomStuff(async_mode=True, api_key=api_key)
async def ai_response(ctx, msg):
response = await rs.get_ai_response(msg)
await ctx.send(response)
async def get_a_joke(ctx, joke):
response = await rs.get_joke(_type="any")
... | true | true |
1c0271d5763016cd9f464893b1a909a7ae50d490 | 1,168 | py | Python | tests/core/objects/test_requirements.py | geffy/ebonite | 2d85eeca44ac1799e743bafe333887712e325060 | [
"Apache-2.0"
] | 1 | 2019-11-27T14:33:45.000Z | 2019-11-27T14:33:45.000Z | tests/core/objects/test_requirements.py | geffy/ebonite | 2d85eeca44ac1799e743bafe333887712e325060 | [
"Apache-2.0"
] | null | null | null | tests/core/objects/test_requirements.py | geffy/ebonite | 2d85eeca44ac1799e743bafe333887712e325060 | [
"Apache-2.0"
] | null | null | null | from ebonite.core.objects.requirements import InstallableRequirement, Requirements, resolve_requirements
def test_resolve_requirements_arg():
requirements = Requirements([InstallableRequirement('dumb', '0.4.1'), InstallableRequirement('art', '4.0')])
actual_reqs = resolve_requirements(requirements)
assert... | 34.352941 | 112 | 0.733733 | from ebonite.core.objects.requirements import InstallableRequirement, Requirements, resolve_requirements
def test_resolve_requirements_arg():
requirements = Requirements([InstallableRequirement('dumb', '0.4.1'), InstallableRequirement('art', '4.0')])
actual_reqs = resolve_requirements(requirements)
assert... | true | true |
1c0272230f143409b2a767e367fb52d0a93567b3 | 5,132 | py | Python | tensorflow/core/user_ops/gpu_tests/unit_test_direct_conversion_gpu.py | TimoHackel/ILA-SCNN | 99ff4b3f68877d660dc56e086b6a12d6846b379a | [
"Apache-2.0"
] | 24 | 2018-02-01T15:49:22.000Z | 2021-01-11T16:31:18.000Z | tensorflow/core/user_ops/gpu_tests/unit_test_direct_conversion_gpu.py | TimoHackel/ILA-SCNN | 99ff4b3f68877d660dc56e086b6a12d6846b379a | [
"Apache-2.0"
] | null | null | null | tensorflow/core/user_ops/gpu_tests/unit_test_direct_conversion_gpu.py | TimoHackel/ILA-SCNN | 99ff4b3f68877d660dc56e086b6a12d6846b379a | [
"Apache-2.0"
] | 4 | 2018-10-29T18:43:22.000Z | 2020-09-28T07:19:52.000Z | #!/usr/bin/env python2
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import math
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.ops import gradient_checker
from... | 30.730539 | 151 | 0.698558 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import math
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.ops import gradient_checker
from tensorflow.python.ops ... | true | true |
1c02725b218bf666a71853d3d9b93f7483c34202 | 6,240 | py | Python | resources/mgltools_x86_64Linux2_1.5.6/MGLToolsPckgs/mglutil/math/crystal.py | J-E-J-S/aaRS-Pipeline | 43f59f28ab06e4b16328c3bc405cdddc6e69ac44 | [
"MIT"
] | 8 | 2021-12-14T21:30:01.000Z | 2022-02-14T11:30:03.000Z | resources/mgltools_x86_64Linux2_1.5.6/MGLToolsPckgs/mglutil/math/crystal.py | J-E-J-S/aaRS-Pipeline | 43f59f28ab06e4b16328c3bc405cdddc6e69ac44 | [
"MIT"
] | null | null | null | resources/mgltools_x86_64Linux2_1.5.6/MGLToolsPckgs/mglutil/math/crystal.py | J-E-J-S/aaRS-Pipeline | 43f59f28ab06e4b16328c3bc405cdddc6e69ac44 | [
"MIT"
] | null | null | null | ## Automatically adapted for numpy.oldnumeric Jul 23, 2007 by
import numpy.oldnumeric as Numeric, types
def EulerAnglesToMat( angles ):
"""Builds a rotation matrix from Euler angles given in degrees"""
from math import pi, cos, sin
t1 = angles[0]* (pi/180.0)
t2 = angles[1]* (pi/180.0)
t3 = ... | 35.254237 | 85 | 0.517788 |
import numpy.oldnumeric as Numeric, types
def EulerAnglesToMat( angles ):
from math import pi, cos, sin
t1 = angles[0]* (pi/180.0)
t2 = angles[1]* (pi/180.0)
t3 = angles[2]* (pi/180.0)
rot = Numeric.identity(3).astype('d')
rot[0][0]= -sin(t1)*cos(t2)*sin(t3) + cos(t1)*cos(t3)
rot... | true | true |
1c0273e0f508e66a4567c6cae875477395809631 | 3,189 | py | Python | lib-python/3/ctypes/test/test_python_api.py | Qointum/pypy | c0ed88efbc135a75a535f4534ca1f3baf0bf39d8 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | lib-python/3/ctypes/test/test_python_api.py | Qointum/pypy | c0ed88efbc135a75a535f4534ca1f3baf0bf39d8 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | lib-python/3/ctypes/test/test_python_api.py | Qointum/pypy | c0ed88efbc135a75a535f4534ca1f3baf0bf39d8 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | from ctypes import *
import unittest, sys
from ctypes.test import is_resource_enabled, xfail
################################################################
# This section should be moved into ctypes\__init__.py, when it's ready.
from _ctypes import PyObj_FromPtr
####################################################... | 32.212121 | 90 | 0.622452 | from ctypes import *
import unittest, sys
from ctypes.test import is_resource_enabled, xfail
from _ctypes import PyObj_FromPtr
################################################################
try:
from sys import getrefcount as grc
except ImportError:
grc = None # e.g. PyPy
if sys.version_info > (2, 4)... | true | true |
1c0273f08cb41eaac791b649d2fafb7d4401ebfb | 7,921 | py | Python | scvi/external/stereoscope/_module.py | gitter-badger/scvi-tools | 8948405f6b393baede73ccd6a0a5ac0824e16c0d | [
"BSD-3-Clause"
] | null | null | null | scvi/external/stereoscope/_module.py | gitter-badger/scvi-tools | 8948405f6b393baede73ccd6a0a5ac0824e16c0d | [
"BSD-3-Clause"
] | null | null | null | scvi/external/stereoscope/_module.py | gitter-badger/scvi-tools | 8948405f6b393baede73ccd6a0a5ac0824e16c0d | [
"BSD-3-Clause"
] | null | null | null | from typing import Tuple
import numpy as np
import torch
from torch.distributions import NegativeBinomial, Normal
from scvi import _CONSTANTS
from scvi._compat import Literal
from scvi.compose import BaseModuleClass, LossRecorder, auto_move_data
class RNADeconv(BaseModuleClass):
"""
Model of single-cell RNA... | 31.939516 | 124 | 0.62126 | from typing import Tuple
import numpy as np
import torch
from torch.distributions import NegativeBinomial, Normal
from scvi import _CONSTANTS
from scvi._compat import Literal
from scvi.compose import BaseModuleClass, LossRecorder, auto_move_data
class RNADeconv(BaseModuleClass):
def __init__(
self,
... | true | true |
1c0274103129f75de0c2b96e81d22d51a8a178b1 | 8,472 | py | Python | dashboard/dashboard/email_template.py | PLSV/catapult | 88e5b1f40c89c4b80d3dd56a722936d07f222a55 | [
"BSD-3-Clause"
] | null | null | null | dashboard/dashboard/email_template.py | PLSV/catapult | 88e5b1f40c89c4b80d3dd56a722936d07f222a55 | [
"BSD-3-Clause"
] | 6 | 2020-07-19T21:51:44.000Z | 2022-02-13T08:22:58.000Z | dashboard/dashboard/email_template.py | PLSV/catapult | 88e5b1f40c89c4b80d3dd56a722936d07f222a55 | [
"BSD-3-Clause"
] | 1 | 2020-06-02T01:31:18.000Z | 2020-06-02T01:31:18.000Z | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Defines common functionality used for generating e-mail to sheriffs."""
from __future__ import print_function
from __future__ import division
from __futur... | 32.212928 | 80 | 0.667375 |
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import logging
import re
import urllib
from google.appengine.api import urlfetch
from dashboard.common import utils
_SINGLE_EMAIL_SUBJECT = (
'%(percent_changed)s %(change_type)s in %(test_name)s '
... | true | true |
1c02749331f151b4c46110d75beabb4707892d78 | 13,214 | py | Python | Challenges/googletest/test/googletest-output-test.py | Alexander-Scott/LearnTDD | 6570ad6dd271595f1747763debfd3b78139ccbeb | [
"MIT"
] | 1 | 2019-06-23T16:54:16.000Z | 2019-06-23T16:54:16.000Z | Challenges/googletest/test/googletest-output-test.py | Alexander-Scott/HackerRank-Challenges | 6570ad6dd271595f1747763debfd3b78139ccbeb | [
"MIT"
] | 1 | 2019-06-23T08:56:21.000Z | 2019-06-23T11:30:29.000Z | Challenges/googletest/test/googletest-output-test.py | Alexander-Scott/HackerRank-Challenges | 6570ad6dd271595f1747763debfd3b78139ccbeb | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | 37.971264 | 85 | 0.663312 |
import difflib
import os
import re
import sys
import gtest_test_utils
GENGOLDEN_FLAG = '--gengolden'
CATCH_EXCEPTIONS_ENV_VAR_NAME = 'GTEST_CATCH_EXCEPTIONS'
NO_STACKTRACE_SUPPORT_FLAG = '--no_stacktrace_support'
IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux'
IS_WINDOWS = os.name == 'nt'
GOLDEN_NAME ... | true | true |
1c0274a4c3bee0d4e7fd40bb09721e37d82d0001 | 2,965 | py | Python | py/abd/abdt_tryloop.py | valhallasw/phabricator-tools | 397406485901ce3bd26e1aee122e652539f99f98 | [
"Apache-2.0"
] | null | null | null | py/abd/abdt_tryloop.py | valhallasw/phabricator-tools | 397406485901ce3bd26e1aee122e652539f99f98 | [
"Apache-2.0"
] | null | null | null | py/abd/abdt_tryloop.py | valhallasw/phabricator-tools | 397406485901ce3bd26e1aee122e652539f99f98 | [
"Apache-2.0"
] | null | null | null | """Retry operations that may intermittently fail, log each failure."""
# =============================================================================
# CONTENTS
# -----------------------------------------------------------------------------
# abdt_tryloop
#
# Public Functions:
# tryloop
# critical_tryloop
#
# ----... | 37.0625 | 79 | 0.620236 |
from __future__ import absolute_import
import phlsys_tryloop
import abdt_logging
def tryloop(f, identifier, detail):
def on_tryloop_exception(e, delay):
abdt_logging.on_retry_exception(identifier, detail, e, delay)
delays = phlsys_tryloop.make_default_short_retry()
return phlsys_tryloop.try_l... | true | true |
1c02754066b857230077366b81c19278457a812d | 2,270 | py | Python | Phrase_parse.py | Weiren1996/relation_extractor | b01ff44016ba3d1504b3079f9669c19b36a30fec | [
"MIT"
] | null | null | null | Phrase_parse.py | Weiren1996/relation_extractor | b01ff44016ba3d1504b3079f9669c19b36a30fec | [
"MIT"
] | null | null | null | Phrase_parse.py | Weiren1996/relation_extractor | b01ff44016ba3d1504b3079f9669c19b36a30fec | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon May 18 09:17:29 2020
@author: 35732
"""
import nltk
import re
from dictionary import Dictionary
class Phrase_parse:
def __init__(self,txt,prop_name,C_path):
self.C_path = C_path
self.dict_info = Dictionary(self.C_path)
self.txt = txt
... | 33.880597 | 95 | 0.546256 | import nltk
import re
from dictionary import Dictionary
class Phrase_parse:
def __init__(self,txt,prop_name,C_path):
self.C_path = C_path
self.dict_info = Dictionary(self.C_path)
self.txt = txt
self.prop_name = prop_name
def alloy_sub_search(self):
txt = self.t... | true | true |
1c0275b4853a56350f8a7c8207800a2b2cfed875 | 11,035 | py | Python | pipenv/vendor/pexpect/expect.py | Enzime/pipenv | d4f710be4a39e09a82a5133b7b3a277ee9bfb13a | [
"MIT"
] | 2,338 | 2018-06-19T17:34:51.000Z | 2022-03-31T11:00:37.000Z | pipenv/vendor/pexpect/expect.py | Enzime/pipenv | d4f710be4a39e09a82a5133b7b3a277ee9bfb13a | [
"MIT"
] | 3,740 | 2019-01-23T15:36:48.000Z | 2022-03-31T22:01:13.000Z | pipenv/vendor/pexpect/expect.py | Enzime/pipenv | d4f710be4a39e09a82a5133b7b3a277ee9bfb13a | [
"MIT"
] | 500 | 2019-01-23T07:49:22.000Z | 2022-03-30T02:59:37.000Z | import time
from .exceptions import EOF, TIMEOUT
class Expecter(object):
def __init__(self, spawn, searcher, searchwindowsize=-1):
self.spawn = spawn
self.searcher = searcher
if searchwindowsize == -1:
searchwindowsize = spawn.searchwindowsize
self.searchwindowsize = se... | 35.944625 | 86 | 0.569461 | import time
from .exceptions import EOF, TIMEOUT
class Expecter(object):
def __init__(self, spawn, searcher, searchwindowsize=-1):
self.spawn = spawn
self.searcher = searcher
if searchwindowsize == -1:
searchwindowsize = spawn.searchwindowsize
self.searchwindowsize = se... | true | true |
1c0276037a467a6a81808cdf4501f6b5f6d03f9a | 11,646 | py | Python | code/tacotron/models/attention.py | mwhitehill/Tacotron-2 | 62c7f32b6620ff427d396be56ff60d5fc0bc0bb2 | [
"MIT"
] | 1 | 2019-09-27T10:19:19.000Z | 2019-09-27T10:19:19.000Z | code/tacotron/models/attention.py | mwhitehill/Tacotron-2 | 62c7f32b6620ff427d396be56ff60d5fc0bc0bb2 | [
"MIT"
] | null | null | null | code/tacotron/models/attention.py | mwhitehill/Tacotron-2 | 62c7f32b6620ff427d396be56ff60d5fc0bc0bb2 | [
"MIT"
] | 1 | 2019-11-23T01:14:00.000Z | 2019-11-23T01:14:00.000Z | """Attention file for location based attention (compatible with tensorflow attention wrapper)"""
import tensorflow as tf
from tensorflow.contrib.seq2seq.python.ops.attention_wrapper import BahdanauAttention
from tensorflow.python.layers import core as layers_core
from tensorflow.python.ops import array_ops, math_ops, ... | 44.62069 | 127 | 0.728576 |
import tensorflow as tf
from tensorflow.contrib.seq2seq.python.ops.attention_wrapper import BahdanauAttention
from tensorflow.python.layers import core as layers_core
from tensorflow.python.ops import array_ops, math_ops, nn_ops, variable_scope
def _compute_attention(attention_mechanism, cell_output, attention_state... | true | true |
1c027617847d9d67b3ff96fac2ee66a4e4e3606d | 14,520 | bzl | Python | third_party/externals.bzl | streeter/sorbet | 893f8e5cf39d1de4fead40e5fa0c125e60944e78 | [
"Apache-2.0"
] | null | null | null | third_party/externals.bzl | streeter/sorbet | 893f8e5cf39d1de4fead40e5fa0c125e60944e78 | [
"Apache-2.0"
] | null | null | null | third_party/externals.bzl | streeter/sorbet | 893f8e5cf39d1de4fead40e5fa0c125e60944e78 | [
"Apache-2.0"
] | null | null | null | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
# We define our externals here instead of directly in WORKSPACE
def register_sorbet_dependencies():
http_archive(
name = "doctest",
urls = _github_public_urls("onqtam/doctest/archive/7d42bd0fab6c44010c8aed9338bd02bea5... | 44.95356 | 142 | 0.723416 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
def register_sorbet_dependencies():
http_archive(
name = "doctest",
urls = _github_public_urls("onqtam/doctest/archive/7d42bd0fab6c44010c8aed9338bd02bea5feba41.zip"),
sha256 = "b33c8e954d15a146bb744ca29f4ca204... | true | true |
1c0276e63faea48416dcfa7107af70ef85cfe89b | 183 | py | Python | AnalizeBonusViagem/Mundo3/exmundo3/ex114 site ecessivel.py | D-Wolter/Pycharm-Projects | aeb3a2464cf6c6578e5b47b13b54ff3ebd6e52dd | [
"MIT"
] | null | null | null | AnalizeBonusViagem/Mundo3/exmundo3/ex114 site ecessivel.py | D-Wolter/Pycharm-Projects | aeb3a2464cf6c6578e5b47b13b54ff3ebd6e52dd | [
"MIT"
] | null | null | null | AnalizeBonusViagem/Mundo3/exmundo3/ex114 site ecessivel.py | D-Wolter/Pycharm-Projects | aeb3a2464cf6c6578e5b47b13b54ff3ebd6e52dd | [
"MIT"
] | null | null | null | import urllib
import urllib.request
try:
site = urllib.request.urlopen('http://www.pudim.com.br')
except:
print('Deu Erro')
else:
print('Tudo ok')
print(site.read()) | 18.3 | 60 | 0.661202 | import urllib
import urllib.request
try:
site = urllib.request.urlopen('http://www.pudim.com.br')
except:
print('Deu Erro')
else:
print('Tudo ok')
print(site.read()) | true | true |
1c027716fa39ddc98a3eac87ca6fe4f82d697be4 | 165 | py | Python | app/utils/config.py | rbarbioni/python-flask-api | b245e167eae6482e80b8b69b33e418eea2b31aff | [
"Apache-2.0"
] | 3 | 2020-07-01T19:42:42.000Z | 2021-06-06T00:47:48.000Z | app/utils/config.py | rbarbioni/python-flask-api | b245e167eae6482e80b8b69b33e418eea2b31aff | [
"Apache-2.0"
] | 1 | 2021-04-04T23:45:29.000Z | 2021-04-04T23:45:29.000Z | app/utils/config.py | rbarbioni/python-flask-api | b245e167eae6482e80b8b69b33e418eea2b31aff | [
"Apache-2.0"
] | null | null | null | from dynaconf import settings
from os import getenv
def get_config(key=None, default=None, cast=None):
return getenv(key) or settings(key, default, cast=cast)
| 23.571429 | 59 | 0.763636 | from dynaconf import settings
from os import getenv
def get_config(key=None, default=None, cast=None):
return getenv(key) or settings(key, default, cast=cast)
| true | true |
1c02776879a33fbfc04ddb9f41cdaaadcfdfa022 | 123 | py | Python | gcalbridge/errors.py | ternus/gcal-bridge | 3fa5b43c58006efe9c0431e30ae2210e7700e2a8 | [
"MIT"
] | 3 | 2016-08-06T16:11:09.000Z | 2019-09-30T12:07:45.000Z | gcalbridge/errors.py | ternus/gcal-bridge | 3fa5b43c58006efe9c0431e30ae2210e7700e2a8 | [
"MIT"
] | null | null | null | gcalbridge/errors.py | ternus/gcal-bridge | 3fa5b43c58006efe9c0431e30ae2210e7700e2a8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
""" Defines specific gcalbridge-related errors.
"""
class BadConfigError(RuntimeError):
pass
| 13.666667 | 48 | 0.715447 |
class BadConfigError(RuntimeError):
pass
| true | true |
1c02779e76841d58286904d0b32ee920e0235826 | 15,565 | py | Python | Scripts/simulation/gsi_handlers/inventory_handlers.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | Scripts/simulation/gsi_handlers/inventory_handlers.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | Scripts/simulation/gsi_handlers/inventory_handlers.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | # uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\gsi_handlers\inventory_handlers.py
# Compiled at: 2020-03-03 03:56:51
# Size of source mod 2**32: 44... | 48.946541 | 116 | 0.485898 | import itertools, gsi_handlers, services
from gsi_handlers.gsi_utils import parse_filter_to_list
from sims4.gsi.dispatcher import GsiHandler
from sims4.gsi.schema import GsiGridSchema
inventory_schema = GsiGridSchema(label='Inventories')
inventory_schema.add_field('objId', label='Object Id', width=1, unique_field=True,... | false | true |
1c02782f16ffa18168e146194154b361c0153750 | 3,722 | py | Python | proj06.py | coderken1236/savy | 8cc15df71aee4f849c772fa754415161ffe71fa4 | [
"MIT"
] | null | null | null | proj06.py | coderken1236/savy | 8cc15df71aee4f849c772fa754415161ffe71fa4 | [
"MIT"
] | null | null | null | proj06.py | coderken1236/savy | 8cc15df71aee4f849c772fa754415161ffe71fa4 | [
"MIT"
] | null | null | null | # Name:
# Date:
# proj06: Hangman
# -----------------------------------
# Helper code
# (you don't need to understand this helper code)
import random
import string
WORDLIST_FILENAME = "words.txt"
def load_words():
"""
Returns a list of valid words. Words are strings of lowercase letters.
Depending... | 28.630769 | 74 | 0.531972 |
import random
import string
WORDLIST_FILENAME = "words.txt"
def load_words():
"""
Returns a list of valid words. Words are strings of lowercase letters.
Depending on the size of the word list, this function may
take a while to finish.
"""
print "Loading word list from file..."
# in... | false | true |
1c0278fd733ca9404a07ca9d0bd81265f6844589 | 127 | py | Python | Curso-em-video/Python/aulas-python/Testes/aula06b.py | AlbertoAlfredo/exercicios-cursos | 792096ad1f853188adec8fc3e5c629742c8dd7ab | [
"MIT"
] | 1 | 2017-08-27T00:57:20.000Z | 2017-08-27T00:57:20.000Z | Curso-em-video/Python/aulas-python/Testes/aula06b.py | AlbertoAlfredo/exercicios-cursos | 792096ad1f853188adec8fc3e5c629742c8dd7ab | [
"MIT"
] | 2 | 2020-09-09T04:22:06.000Z | 2020-12-24T16:25:36.000Z | Curso-em-video/Python/aulas-python/Testes/aula06b.py | AlbertoAlfredo/exercicios-cursos | 792096ad1f853188adec8fc3e5c629742c8dd7ab | [
"MIT"
] | null | null | null | n = input('Digite um valor: ')
print(n.isnumeric())
print(n.isalpha())
print(n.isalnum())
print(n.isupper())
print(n.isspace()) | 21.166667 | 30 | 0.677165 | n = input('Digite um valor: ')
print(n.isnumeric())
print(n.isalpha())
print(n.isalnum())
print(n.isupper())
print(n.isspace()) | true | true |
1c027938b88f0fa4235333e8195ab825edbb5014 | 1,065 | py | Python | Lib/site-packages/phonenumbers/data/region_EH.py | dawidhubicki97/bookstore | b505f7ab333eaa9aa7419d9512d92ae70d282a6a | [
"bzip2-1.0.6"
] | 1 | 2019-12-01T16:53:18.000Z | 2019-12-01T16:53:18.000Z | python/phonenumbers/data/region_EH.py | TheEyeOfHorus/python-phonenumbers | e439d797e44e42ebb1cbb7c355f0445db0e8d031 | [
"Apache-2.0"
] | 9 | 2020-08-11T15:19:55.000Z | 2022-03-12T00:11:12.000Z | python/phonenumbers/data/region_EH.py | TheEyeOfHorus/python-phonenumbers | e439d797e44e42ebb1cbb7c355f0445db0e8d031 | [
"Apache-2.0"
] | null | null | null | """Auto-generated file, do not edit by hand. EH metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_EH = PhoneMetadata(id='EH', country_code=212, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[5-8]\\d{8}', possible_length=(9,)),
... | 76.071429 | 169 | 0.738967 | from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_EH = PhoneMetadata(id='EH', country_code=212, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[5-8]\\d{8}', possible_length=(9,)),
fixed_line=PhoneNumberDesc(national_number_pattern='528[89]... | true | true |
1c02797310fe8d9b699dde347d2cc16e701c4aaa | 4,158 | py | Python | src/you_get/extractors/twitter.py | 0x110100/you-get | 74c306a0d085d80456208205b054e1d61017d43d | [
"MIT"
] | 3 | 2018-10-25T14:03:52.000Z | 2018-11-17T04:55:50.000Z | src/you_get/extractors/twitter.py | Jackwang8102/you-get | 2e461820f8dbb46bf7aa973e9df02986e758dd10 | [
"MIT"
] | null | null | null | src/you_get/extractors/twitter.py | Jackwang8102/you-get | 2e461820f8dbb46bf7aa973e9df02986e758dd10 | [
"MIT"
] | 1 | 2019-03-30T04:50:50.000Z | 2019-03-30T04:50:50.000Z | #!/usr/bin/env python
__all__ = ['twitter_download']
from ..common import *
from .vine import vine_download
def extract_m3u(source):
r1 = get_content(source)
s1 = re.findall(r'(/ext_tw_video/.*)', r1)
s1 += re.findall(r'(/amplify_video/.*)', r1)
r2 = get_content('https://video.twimg.com%s' % s1[-1])
... | 43.768421 | 137 | 0.563252 |
__all__ = ['twitter_download']
from ..common import *
from .vine import vine_download
def extract_m3u(source):
r1 = get_content(source)
s1 = re.findall(r'(/ext_tw_video/.*)', r1)
s1 += re.findall(r'(/amplify_video/.*)', r1)
r2 = get_content('https://video.twimg.com%s' % s1[-1])
s2 = re.findall(r'... | true | true |
1c02799a94bca2b78bee8d2e5cd1a5e3fb9a7578 | 1,918 | py | Python | test/test_authentication.py | Tsumanga-Studios/asyncmongo3 | e3e1eee31aabbbfb600cc9241311d5420eb0af99 | [
"Apache-2.0"
] | null | null | null | test/test_authentication.py | Tsumanga-Studios/asyncmongo3 | e3e1eee31aabbbfb600cc9241311d5420eb0af99 | [
"Apache-2.0"
] | null | null | null | test/test_authentication.py | Tsumanga-Studios/asyncmongo3 | e3e1eee31aabbbfb600cc9241311d5420eb0af99 | [
"Apache-2.0"
] | null | null | null | import tornado.ioloop
import time
import logging
import subprocess
from . import test_shunt
import asyncmongo
TEST_TIMESTAMP = int(time.time())
class AuthenticationTest(test_shunt.MongoTest):
def setUp(self):
super(AuthenticationTest, self).setUp()
logging.info('creating user')
pipe = sub... | 37.607843 | 155 | 0.599062 | import tornado.ioloop
import time
import logging
import subprocess
from . import test_shunt
import asyncmongo
TEST_TIMESTAMP = int(time.time())
class AuthenticationTest(test_shunt.MongoTest):
def setUp(self):
super(AuthenticationTest, self).setUp()
logging.info('creating user')
pipe = sub... | true | true |
1c027b8ec9f788d14a59f2fea9ec2a62f83d0e9a | 13,007 | py | Python | google/home/graph/v1/home-graph-v1-py/google/home/graph_v1/types/homegraph.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/home/graph/v1/home-graph-v1-py/google/home/graph_v1/types/homegraph.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/home/graph/v1/home-graph-v1-py/google/home/graph_v1/types/homegraph.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 26.653689 | 109 | 0.590759 | import proto
from google.home.graph_v1.types import device
from google.protobuf import struct_pb2
__protobuf__ = proto.module(
package='google.home.graph.v1',
manifest={
'RequestSyncDevicesRequest',
'RequestSyncDevicesResponse',
'ReportStateAndNotificationRequest',
'ReportSt... | true | true |
1c027e5ee6aa347b54603a80693b1f44eea4c1e3 | 2,418 | py | Python | Days/Day 10 - Balance Bots/Part 1.py | jamester234/Advent-of-Code-2016 | 104842164435f61d572ea6b6bea78990d2d8896f | [
"MIT"
] | null | null | null | Days/Day 10 - Balance Bots/Part 1.py | jamester234/Advent-of-Code-2016 | 104842164435f61d572ea6b6bea78990d2d8896f | [
"MIT"
] | null | null | null | Days/Day 10 - Balance Bots/Part 1.py | jamester234/Advent-of-Code-2016 | 104842164435f61d572ea6b6bea78990d2d8896f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Dec 26 15:02:12 2017
@author: James Jiang
"""
all_lines = [line.rstrip('\n') for line in open('Data.txt')]
all_instructions = []
for line in all_lines:
instruction = line.split(' ')
all_instructions.append(instruction)
bot_dict = {}
output_dict = {}
for instru... | 33.583333 | 82 | 0.536807 |
all_lines = [line.rstrip('\n') for line in open('Data.txt')]
all_instructions = []
for line in all_lines:
instruction = line.split(' ')
all_instructions.append(instruction)
bot_dict = {}
output_dict = {}
for instruction in all_instructions:
if instruction[0] == 'value':
if instruction[-1] no... | true | true |
1c02806eda885e158d600c552265313344d441e7 | 4,439 | py | Python | flexaeadv11/ref/python/test.py | edunasci/FlexAEAD | a9a3225f6edb4a42a1733a4a69e42e1f8ac42c99 | [
"MIT"
] | 1 | 2021-05-02T12:52:06.000Z | 2021-05-02T12:52:06.000Z | flexaeadv11/ref/python/test.py | edunasci/FlexAEAD | a9a3225f6edb4a42a1733a4a69e42e1f8ac42c99 | [
"MIT"
] | null | null | null | flexaeadv11/ref/python/test.py | edunasci/FlexAEAD | a9a3225f6edb4a42a1733a4a69e42e1f8ac42c99 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from FlexAEADv11SBox import FlexAEADv11SBox
from FlexAEADv11 import FlexAEADv11
import numpy as np
import matplotlib.pyplot as plt
import math
#"""
def dirShuffleLayer( a1 ):
half = int(len(a1)/2)
state = np.zeros(np.shape(a1),dtype=int)
for i in range(half):
state[(2*i)+0] ... | 35.230159 | 84 | 0.516558 |
from FlexAEADv11SBox import FlexAEADv11SBox
from FlexAEADv11 import FlexAEADv11
import numpy as np
import matplotlib.pyplot as plt
import math
def dirShuffleLayer( a1 ):
half = int(len(a1)/2)
state = np.zeros(np.shape(a1),dtype=int)
for i in range(half):
state[(2*i)+0] = a1[(half*0)+i]
st... | true | true |
1c0280990740a646fd13d8c00db917989bc38ab1 | 2,051 | py | Python | shape-detection.py | Sheriff-A/OpenCV | 3f1864d921b39a87f802a6b2d1ffef95fc45d813 | [
"MIT"
] | null | null | null | shape-detection.py | Sheriff-A/OpenCV | 3f1864d921b39a87f802a6b2d1ffef95fc45d813 | [
"MIT"
] | null | null | null | shape-detection.py | Sheriff-A/OpenCV | 3f1864d921b39a87f802a6b2d1ffef95fc45d813 | [
"MIT"
] | null | null | null | import cv2 as cv
import numpy as np
frameWidth = 640
frameHeight = 480
cap = cv.VideoCapture(0)
cap.set(3, frameWidth)
cap.set(3, frameHeight)
def empty(a):
pass
cv.namedWindow('Parameters')
cv.resizeWindow('Parameters', frameWidth, frameHeight // 2)
cv.createTrackbar('Threshold1', 'Parameters', 20, 255, empty... | 32.555556 | 88 | 0.61726 | import cv2 as cv
import numpy as np
frameWidth = 640
frameHeight = 480
cap = cv.VideoCapture(0)
cap.set(3, frameWidth)
cap.set(3, frameHeight)
def empty(a):
pass
cv.namedWindow('Parameters')
cv.resizeWindow('Parameters', frameWidth, frameHeight // 2)
cv.createTrackbar('Threshold1', 'Parameters', 20, 255, empty... | true | true |
1c0280c3ce6e60aeea9f1bd9542b3a69e75d70e4 | 10,478 | py | Python | tensorflow/python/kernel_tests/lu_op_test.py | PaulWang1905/tensorflow | ebf12d22b4801fb8dab5034cc94562bf7cc33fa0 | [
"Apache-2.0"
] | 36 | 2016-12-17T15:25:25.000Z | 2022-01-29T21:50:53.000Z | tensorflow/python/kernel_tests/lu_op_test.py | PaulWang1905/tensorflow | ebf12d22b4801fb8dab5034cc94562bf7cc33fa0 | [
"Apache-2.0"
] | 59 | 2019-06-17T09:37:49.000Z | 2022-01-19T01:21:34.000Z | tensorflow/python/kernel_tests/lu_op_test.py | PaulWang1905/tensorflow | ebf12d22b4801fb8dab5034cc94562bf7cc33fa0 | [
"Apache-2.0"
] | 36 | 2017-07-27T21:12:40.000Z | 2022-02-03T16:45:56.000Z | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 36.894366 | 80 | 0.644589 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.client import session
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import errors
from tensorflow.python.framework import ops
from t... | true | true |
1c0280e6e31b2f90d20ca55e319d32bd179c63c7 | 1,844 | py | Python | algorithms/arrays/vector.py | zhijunsheng/tictactoe-py | 648bed3bbf56d441805d472c73b7951b73469f20 | [
"MIT"
] | null | null | null | algorithms/arrays/vector.py | zhijunsheng/tictactoe-py | 648bed3bbf56d441805d472c73b7951b73469f20 | [
"MIT"
] | null | null | null | algorithms/arrays/vector.py | zhijunsheng/tictactoe-py | 648bed3bbf56d441805d472c73b7951b73469f20 | [
"MIT"
] | null | null | null | import unittest
class Vector:
"""Represent a vector in a multidimensional space."""
def __init__(self, d):
"""Create d-dimensional vector of zeros."""
self._coords = [0] * d
def __len__(self):
"""Return the dimension of the vector."""
return len(self._coords)
def __ge... | 29.269841 | 80 | 0.567245 | import unittest
class Vector:
def __init__(self, d):
self._coords = [0] * d
def __len__(self):
return len(self._coords)
def __getitem__(self, j):
return self._coords[j]
def __setitem__(self, j, val):
self._coords[j] = val
def __add__(self, other):
if len... | true | true |
1c0281f539f1c175e942efdc7b25887f85890fc1 | 10,762 | py | Python | turtlebot4_navigation/turtlebot4_navigation/turtlebot4_navigator.py | turtlebot/turtlebot4 | 69a8334343b53bc866e45fc28ed4bfe23dc68435 | [
"Apache-2.0"
] | 7 | 2022-02-28T22:14:58.000Z | 2022-03-30T07:32:02.000Z | turtlebot4_navigation/turtlebot4_navigation/turtlebot4_navigator.py | turtlebot/turtlebot4 | 69a8334343b53bc866e45fc28ed4bfe23dc68435 | [
"Apache-2.0"
] | 1 | 2022-02-28T23:58:54.000Z | 2022-03-03T22:27:40.000Z | turtlebot4_navigation/turtlebot4_navigation/turtlebot4_navigator.py | turtlebot/turtlebot4 | 69a8334343b53bc866e45fc28ed4bfe23dc68435 | [
"Apache-2.0"
] | 1 | 2022-03-01T21:55:18.000Z | 2022-03-01T21:55:18.000Z | #!/usr/bin/env python3
# Copyright 2022 Clearpath Robotics, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 32.612121 | 96 | 0.605371 |
from enum import IntEnum
import math
import time
from action_msgs.msg import GoalStatus
from geometry_msgs.msg import PoseStamped, PoseWithCovarianceStamped
from irobot_create_msgs.action import DockServo, Undock
from irobot_create_msgs.msg import Dock
from nav2_simple_commander.robot_navigator import BasicNavig... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.