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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c2bdb0fe6942436fcb97e18761d122d3ee8e8b1 | 20,030 | py | Python | bot/client.py | potocnikluka/discord-utility-bot | 6ccd808043812579278244dcaac1a5ce473d77cc | [
"MIT"
] | null | null | null | bot/client.py | potocnikluka/discord-utility-bot | 6ccd808043812579278244dcaac1a5ce473d77cc | [
"MIT"
] | 1 | 2021-07-18T14:50:40.000Z | 2021-07-18T15:31:38.000Z | bot/client.py | potocnikluka/discord-utility-bot | 6ccd808043812579278244dcaac1a5ce473d77cc | [
"MIT"
] | 1 | 2021-10-10T10:06:49.000Z | 2021-10-10T10:06:49.000Z | import os
import inspect
import sys
import traceback
import nextcord
import logging
from functools import partial
import bot.commands as commands
import bot.games as games
import bot.decorators as decorators
import bot.utils as utils
class UtilityClient(nextcord.Client):
"""Client connection handling events reci... | 38.298279 | 79 | 0.570444 | import os
import inspect
import sys
import traceback
import nextcord
import logging
from functools import partial
import bot.commands as commands
import bot.games as games
import bot.decorators as decorators
import bot.utils as utils
class UtilityClient(nextcord.Client):
def __init__(self, *, version, database,... | true | true |
1c2bdce8b5cb4cf01ff364e7c93fcedef0b4ad64 | 35,025 | py | Python | fairseq/models/dlcl_transformer.py | libeineu/SDT-Training | d33a836c1b3258748ec11c4d64998e0dcc9792df | [
"BSD-3-Clause"
] | 9 | 2020-10-04T06:20:40.000Z | 2021-05-19T06:25:54.000Z | fairseq/models/dlcl_transformer.py | libeineu/SDT-Training | d33a836c1b3258748ec11c4d64998e0dcc9792df | [
"BSD-3-Clause"
] | 1 | 2021-01-21T04:20:52.000Z | 2021-01-21T04:20:52.000Z | fairseq/models/dlcl_transformer.py | libeineu/SDT-Training | d33a836c1b3258748ec11c4d64998e0dcc9792df | [
"BSD-3-Clause"
] | 1 | 2021-01-19T06:12:27.000Z | 2021-01-19T06:12:27.000Z | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
# author: Bei Li
# email: libei_ne... | 43.081181 | 119 | 0.643198 |
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from fairseq import options, utils
from fairseq.modules import (
AdaptiveInput, AdaptiveSoftmax, CharacterTokenEmbedder, LayerNorm,
LearnedPositionalEmbedding, MultiheadAttention, SinusoidalPositionalEmbedding,
RelativeMultih... | true | true |
1c2bdd7637a823f29230bc74aa73f348aae2e568 | 804 | py | Python | {{cookiecutter.project_slug}}/sources/app/config/settings/components/common/rest_framework.py | AsheKR/cookiecutter-django | d0402aefcc2eeaffa747faa7ef50ad97286bfcca | [
"BSD-3-Clause"
] | null | null | null | {{cookiecutter.project_slug}}/sources/app/config/settings/components/common/rest_framework.py | AsheKR/cookiecutter-django | d0402aefcc2eeaffa747faa7ef50ad97286bfcca | [
"BSD-3-Clause"
] | null | null | null | {{cookiecutter.project_slug}}/sources/app/config/settings/components/common/rest_framework.py | AsheKR/cookiecutter-django | d0402aefcc2eeaffa747faa7ef50ad97286bfcca | [
"BSD-3-Clause"
] | null | null | null | # flake8: noqa
{% if cookiecutter.use_drf == "y" %}
from .app import INSTALLED_APPS
from .middleware import MIDDLEWARE
from .authentication import AUTHENTICATION_BACKENDS
INSTALLED_APPS += [
"rest_framework",
"corsheaders",
]
MIDDLEWARE += [
"corsheaders.middleware.CorsMiddleware",
]
REST_FRAMEWORK = {
... | 25.125 | 75 | 0.742537 | {% if cookiecutter.use_drf == "y" %}
from .app import INSTALLED_APPS
from .middleware import MIDDLEWARE
from .authentication import AUTHENTICATION_BACKENDS
INSTALLED_APPS += [
"rest_framework",
"corsheaders",
]
MIDDLEWARE += [
"corsheaders.middleware.CorsMiddleware",
]
REST_FRAMEWORK = {
'DEFAULT_AUT... | false | true |
1c2bdd7bd7931d3e116412a7d8fdf90c2c822f40 | 4,663 | py | Python | u2socks5.py | thisforeda/unicorn | 16ea5e05912850926cc897ec2bc20db09b7b50cd | [
"Apache-2.0"
] | 5 | 2017-12-08T09:57:17.000Z | 2019-01-16T12:50:42.000Z | u2socks5.py | thisforeda/unicorn | 16ea5e05912850926cc897ec2bc20db09b7b50cd | [
"Apache-2.0"
] | 1 | 2019-04-06T08:35:00.000Z | 2019-04-06T08:35:00.000Z | u2socks5.py | thisforeda/unicorn | 16ea5e05912850926cc897ec2bc20db09b7b50cd | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#encoding=utf8
#
# Copyright 2017 thisforeda
#
# 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 req... | 29.700637 | 106 | 0.551147 | import struct
import socket
import asyncio
import functools
from unicorn import BaseProtocol
P = struct.pack
U = struct.unpack
UP = lambda b: U("!H", b)[0]
class SOCKS5(BaseProtocol):
STAGE_CONN_MADE = 0
STAGE_AUTH_DONE = 2
STAGE_TUNNEL_STREAMING = 3
ATYPE_DOMAIN = 3
ATYPE_IPV4 = 1
ATYPE_IP... | true | true |
1c2bdda1cd6e99640ba34b990716e88ead6bbeea | 13,262 | py | Python | pyWAPOR/ETLook/radiation.py | hectornieto/wapor-et-look | bc0b98be58d1680de2f82909809ac876f78f2d85 | [
"Apache-2.0"
] | 1 | 2021-05-24T08:12:03.000Z | 2021-05-24T08:12:03.000Z | pyWAPOR/ETLook/radiation.py | hectornieto/wapor-et-look | bc0b98be58d1680de2f82909809ac876f78f2d85 | [
"Apache-2.0"
] | 2 | 2020-06-25T08:27:55.000Z | 2020-08-28T07:38:17.000Z | pyWAPOR/ETLook/radiation.py | DHI-GRAS/wapor-et-look | e05b8f24616af8fc99ac1d646c878b353cb35aef | [
"Apache-2.0"
] | 4 | 2020-09-23T09:51:59.000Z | 2021-08-10T08:59:14.000Z | import numpy as np
from pyWAPOR.ETLook import constants as c
def interception_wm2(int_mm, lh_24):
r"""
Computes the energy equivalent for the interception in Wm-2 if it
is provide in mm/day
.. math ::
I = \frac{\lambda I^*}{86400}
Parameters
----------
int_mm : float
inter... | 22.826162 | 114 | 0.54856 | import numpy as np
from pyWAPOR.ETLook import constants as c
def interception_wm2(int_mm, lh_24):
return int_mm * (lh_24/c.day_sec)
def soil_fraction(lai):
return np.exp(-0.6*lai)
def longwave_radiation_fao_etref(t_air_k_24, vp_24, trans_24):
vp_slope=0.14
vp_offset=0.34
lw_slope=1.35
lw_o... | true | true |
1c2bdda97544d685b3b4c3ba20721a0f071f60d9 | 3,824 | py | Python | reinforcement_learning/rl_traveling_salesman_vehicle_routing_coach/src/evaluate-coach.py | jerrypeng7773/amazon-sagemaker-examples | c5ddecce1f739a345465b9a38b064983a129141d | [
"Apache-2.0"
] | 2,610 | 2020-10-01T14:14:53.000Z | 2022-03-31T18:02:31.000Z | reinforcement_learning/rl_traveling_salesman_vehicle_routing_coach/src/evaluate-coach.py | jerrypeng7773/amazon-sagemaker-examples | c5ddecce1f739a345465b9a38b064983a129141d | [
"Apache-2.0"
] | 1,959 | 2020-09-30T20:22:42.000Z | 2022-03-31T23:58:37.000Z | reinforcement_learning/rl_traveling_salesman_vehicle_routing_coach/src/evaluate-coach.py | jerrypeng7773/amazon-sagemaker-examples | c5ddecce1f739a345465b9a38b064983a129141d | [
"Apache-2.0"
] | 2,052 | 2020-09-30T22:11:46.000Z | 2022-03-31T23:02:51.000Z | import argparse
import os
import rl_coach
from rl_coach.base_parameters import Frameworks, TaskParameters
from rl_coach.core_types import EnvironmentSteps
from sagemaker_rl.coach_launcher import CoachConfigurationList, SageMakerCoachPresetLauncher
def inplace_replace_in_file(filepath, old, new):
with open(filepa... | 39.020408 | 103 | 0.664487 | import argparse
import os
import rl_coach
from rl_coach.base_parameters import Frameworks, TaskParameters
from rl_coach.core_types import EnvironmentSteps
from sagemaker_rl.coach_launcher import CoachConfigurationList, SageMakerCoachPresetLauncher
def inplace_replace_in_file(filepath, old, new):
with open(filepa... | true | true |
1c2bddb37a35a95625d7b40d40467e4b804ab7b0 | 15,925 | py | Python | mindspore/ops/operations/debug_ops.py | kungfu-team/mindspore-bert | 71501cf52ae01db9d6a73fb64bcfe68a6509dc32 | [
"Apache-2.0"
] | null | null | null | mindspore/ops/operations/debug_ops.py | kungfu-team/mindspore-bert | 71501cf52ae01db9d6a73fb64bcfe68a6509dc32 | [
"Apache-2.0"
] | null | null | null | mindspore/ops/operations/debug_ops.py | kungfu-team/mindspore-bert | 71501cf52ae01db9d6a73fb64bcfe68a6509dc32 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020-2021 Huawei Technologies Co., Ltd
#
# 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 agre... | 32.566462 | 114 | 0.565777 |
from types import FunctionType, MethodType
from mindspore import context
from ..._checkparam import Validator as validator
from ..._checkparam import Rel
from ...common import dtype as mstype
from ..primitive import prim_attr_register, PrimitiveWithInfer
def _check_mode(class_name):
mode = context.get_context('... | true | true |
1c2bde7e21b5791e6b0be6b7981c4980a2ceffae | 1,817 | py | Python | clonebuild.py | pombreda/pydee | 133609d4e378361d968e7a06baa11256e0e2f403 | [
"MIT"
] | null | null | null | clonebuild.py | pombreda/pydee | 133609d4e378361d968e7a06baa11256e0e2f403 | [
"MIT"
] | null | null | null | clonebuild.py | pombreda/pydee | 133609d4e378361d968e7a06baa11256e0e2f403 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright © 2009 Pierre Raybaut
# Licensed under the terms of the MIT License
# (see pydeelib/__init__.py for details)
"""
Cloning Pydee mercurial repository
Building:
.tar.gz source distribution package
.exe and .egg installers
"""
import os, shutil, tarfile
import o... | 31.327586 | 76 | 0.678041 |
import os, shutil, tarfile
import os.path as osp
import pydeelib as mod
name = 'pydee'
parentdir = osp.join(os.getcwd(), osp.pardir)
version = '%s-%s' % (name, mod.__version__)
os.chdir(parentdir)
if osp.isdir(version):
shutil.rmtree(version)
os.system('hg clone %s %s' % (name, version))
tar... | true | true |
1c2be15f633c8e26a248021a3d87732554d93dc9 | 958 | py | Python | modules/python-codes/modules/databases/mysql/modules/theory-practice/src/insert_into_function.py | drigols/Studies | 9c293156935b491ded24be6b511daac67fd43538 | [
"MIT"
] | null | null | null | modules/python-codes/modules/databases/mysql/modules/theory-practice/src/insert_into_function.py | drigols/Studies | 9c293156935b491ded24be6b511daac67fd43538 | [
"MIT"
] | null | null | null | modules/python-codes/modules/databases/mysql/modules/theory-practice/src/insert_into_function.py | drigols/Studies | 9c293156935b491ded24be6b511daac67fd43538 | [
"MIT"
] | null | null | null | import mysql.connector
def insert_varibles_into_table(id, name, price, purchase_date):
try:
connection = mysql.connector.connect(
host='localhost',
database='Electronics',
user='root',
password='toor'
)
except mysql.connector.Error as error:
print("Failed to insert into MySQL ta... | 29.9375 | 64 | 0.655532 | import mysql.connector
def insert_varibles_into_table(id, name, price, purchase_date):
try:
connection = mysql.connector.connect(
host='localhost',
database='Electronics',
user='root',
password='toor'
)
except mysql.connector.Error as error:
print("Failed to insert into MySQL ta... | true | true |
1c2be3fa240a7a8e67431b08479f6796c2934516 | 16,344 | py | Python | spark_auto_mapper_fhir/resources/evidence.py | imranq2/SparkAutoMapper.FHIR | dd23b218fb0097d1edc2f3e688e8d6d4d7278bd2 | [
"Apache-2.0"
] | 1 | 2020-10-31T23:25:07.000Z | 2020-10-31T23:25:07.000Z | spark_auto_mapper_fhir/resources/evidence.py | icanbwell/SparkAutoMapper.FHIR | 98f368e781b46523142c7cb513c670d659a93c9b | [
"Apache-2.0"
] | null | null | null | spark_auto_mapper_fhir/resources/evidence.py | icanbwell/SparkAutoMapper.FHIR | 98f368e781b46523142c7cb513c670d659a93c9b | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
from typing import Optional, TYPE_CHECKING, Union
# noinspection PyPackageRequirements
from pyspark.sql.types import StructType, DataType
from spark_auto_mapper_fhir.fhir_types.date import FhirDate
from spark_auto_mapper_fhir.fhir_types.date_time import FhirDateTime
from spark_auto_m... | 51.396226 | 117 | 0.711331 | from __future__ import annotations
from typing import Optional, TYPE_CHECKING, Union
from pyspark.sql.types import StructType, DataType
from spark_auto_mapper_fhir.fhir_types.date import FhirDate
from spark_auto_mapper_fhir.fhir_types.date_time import FhirDateTime
from spark_auto_mapper_fhir.fhir_types.list import Fhi... | true | true |
1c2be47f10631d5a8e7cf6eb4ce1ccb2182f99fc | 5,849 | py | Python | k8sclient/models/v1_endpoint_subset.py | Arvinhub/client-python | d67df30f635231d68dc4c20b9b7e234c616c1e6a | [
"Apache-2.0"
] | 1 | 2021-06-16T02:57:18.000Z | 2021-06-16T02:57:18.000Z | k8sclient/models/v1_endpoint_subset.py | Arvinhub/client-python | d67df30f635231d68dc4c20b9b7e234c616c1e6a | [
"Apache-2.0"
] | null | null | null | k8sclient/models/v1_endpoint_subset.py | Arvinhub/client-python | d67df30f635231d68dc4c20b9b7e234c616c1e6a | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: unversioned
Generated by: https://github.com/swagger-api/swagger-codegen.git
Licensed under the Apache License, Version 2.0 (the "Licens... | 32.675978 | 215 | 0.622158 |
from pprint import pformat
from six import iteritems
import re
class V1EndpointSubset(object):
def __init__(self, addresses=None, not_ready_addresses=None, ports=None):
self.swagger_types = {
'addresses': 'list[V1EndpointAddress]',
'not_ready_addresses': 'list[V1EndpointAddress]'... | true | true |
1c2be5f8b532542090580e19f142e26cb4f30576 | 304 | py | Python | src_cs/f2py/importTest.py | marcomangano/idwarp | 3e0d4837a9b926b1cd227654365ca4adfbc08cbe | [
"Apache-2.0"
] | null | null | null | src_cs/f2py/importTest.py | marcomangano/idwarp | 3e0d4837a9b926b1cd227654365ca4adfbc08cbe | [
"Apache-2.0"
] | null | null | null | src_cs/f2py/importTest.py | marcomangano/idwarp | 3e0d4837a9b926b1cd227654365ca4adfbc08cbe | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
import sys
name = 'idwarp_cs'
print("Testing if module %s can be imported..." % name)
import_cmd = "import %s" % name
try:
exec(import_cmd)
except Exception as err:
print("Error: %s." % err)
sys.exit(1)
# end try
print("Module %s was successfully imported." % name)
| 19 | 55 | 0.657895 |
import sys
name = 'idwarp_cs'
print("Testing if module %s can be imported..." % name)
import_cmd = "import %s" % name
try:
exec(import_cmd)
except Exception as err:
print("Error: %s." % err)
sys.exit(1)
print("Module %s was successfully imported." % name)
| true | true |
1c2be683bc08652843c9c39c1d44570e125e0e4a | 2,496 | py | Python | src/programy/parser/template/nodes/normalise.py | ItsPhant/program-y | c2b211fcaf8cedc7d6d95a8ea9470a913efa1622 | [
"MIT"
] | null | null | null | src/programy/parser/template/nodes/normalise.py | ItsPhant/program-y | c2b211fcaf8cedc7d6d95a8ea9470a913efa1622 | [
"MIT"
] | null | null | null | src/programy/parser/template/nodes/normalise.py | ItsPhant/program-y | c2b211fcaf8cedc7d6d95a8ea9470a913efa1622 | [
"MIT"
] | 1 | 2020-02-21T17:58:05.000Z | 2020-02-21T17:58:05.000Z | """
Copyright (c) 2016-17 Keith Sterling http://www.keithsterling.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, mod... | 40.918033 | 120 | 0.658253 |
import logging
from programy.parser.template.nodes.base import TemplateNode
class TemplateNormalizeNode(TemplateNode):
def __init__(self):
TemplateNode.__init__(self)
def resolve_to_string(self, bot, clientid):
string = self.resolve_children_to_string(bot, clientid)
resolved = bot.... | true | true |
1c2be7b6bf5c647793eaa54f0ac554ba1e28e82b | 11,671 | py | Python | autobahn/autobahn/wamp/test/test_protocol.py | luhn/AutobahnPython | 7d519052ab42dc029598ab9e2dbdd7af8e08341f | [
"Apache-2.0"
] | null | null | null | autobahn/autobahn/wamp/test/test_protocol.py | luhn/AutobahnPython | 7d519052ab42dc029598ab9e2dbdd7af8e08341f | [
"Apache-2.0"
] | null | null | null | autobahn/autobahn/wamp/test/test_protocol.py | luhn/AutobahnPython | 7d519052ab42dc029598ab9e2dbdd7af8e08341f | [
"Apache-2.0"
] | null | null | null | ###############################################################################
##
## Copyright (C) 2014 Tavendo GmbH
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http:/... | 36.021605 | 197 | 0.630966 |
from __future__ import absolute_import
import os
if os.environ.get('USE_TWISTED', False):
from twisted.trial import unittest
from twisted.internet.defer import Deferred, inlineCallbacks
from autobahn import wamp
from autobahn.wamp import message
from autobahn.wamp import serializer
from autob... | true | true |
1c2be827a79715beef77ec9b12b82a536c44c9a2 | 2,175 | py | Python | setup.py | sleepy-owl/hummingbird | d23d8f2eb6864f88461fe1e0044f2f981b7d5881 | [
"MIT"
] | 1 | 2021-02-25T19:55:49.000Z | 2021-02-25T19:55:49.000Z | setup.py | hsaputra/hummingbird | 0ebd6be58880615bc86eab3648056682b40de614 | [
"MIT"
] | null | null | null | setup.py | hsaputra/hummingbird | 0ebd6be58880615bc86eab3648056682b40de614 | [
"MIT"
] | null | null | null | from distutils.core import setup
from setuptools import find_packages
import os
import sys
this = os.path.dirname(__file__)
packages = find_packages()
assert packages
# read version from the package file.
with (open(os.path.join(this, "hummingbird/__init__.py"), "r")) as f:
line = [_ for _ in [_.strip("\r\n ") f... | 30.633803 | 96 | 0.645517 | from distutils.core import setup
from setuptools import find_packages
import os
import sys
this = os.path.dirname(__file__)
packages = find_packages()
assert packages
with (open(os.path.join(this, "hummingbird/__init__.py"), "r")) as f:
line = [_ for _ in [_.strip("\r\n ") for _ in f.readlines()] if _.startswith... | true | true |
1c2bea7f40256e88ea7c3a0fe6b7339cd1b14381 | 8,781 | py | Python | WISDEM/wisdem/commonse/akima.py | ebranlard/WEIS | 59851a0c3b2e801bd413ca4887ab4b78e58f928a | [
"Apache-2.0"
] | null | null | null | WISDEM/wisdem/commonse/akima.py | ebranlard/WEIS | 59851a0c3b2e801bd413ca4887ab4b78e58f928a | [
"Apache-2.0"
] | null | null | null | WISDEM/wisdem/commonse/akima.py | ebranlard/WEIS | 59851a0c3b2e801bd413ca4887ab4b78e58f928a | [
"Apache-2.0"
] | null | null | null | """
Simple interpolant based on Andrew Ning's implementation of Akima splines.
Includes derivatives wrt training points. Akima spline is regenerated during each compute.
https://github.com/andrewning/akima
"""
import numpy as np
def abs_smooth_dv(x, x_deriv, delta_x):
"""
Compute the absolute value in a smoo... | 33.135849 | 115 | 0.439016 | import numpy as np
def abs_smooth_dv(x, x_deriv, delta_x):
if x >= delta_x:
y_deriv = x_deriv
y = x
elif x <= -delta_x:
y_deriv = -x_deriv
y = -x
else:
y_deriv = 2.0 * x * x_deriv / (2.0 * delta_x)
y = x ** 2 / (2.0 * delta_x) + delta_x / 2.0
return y... | true | true |
1c2beb0e3e9708ace96894a559d9ac33ce15a4c7 | 2,998 | py | Python | stemmer/find_potential_stems.py | Esukhia/text_utils | 562065d4dedba127f8aaeee03ca3d9f071805f62 | [
"MIT"
] | 1 | 2017-01-26T22:37:57.000Z | 2017-01-26T22:37:57.000Z | stemmer/find_potential_stems.py | Esukhia/tibtext_utils | 562065d4dedba127f8aaeee03ca3d9f071805f62 | [
"MIT"
] | null | null | null | stemmer/find_potential_stems.py | Esukhia/tibtext_utils | 562065d4dedba127f8aaeee03ca3d9f071805f62 | [
"MIT"
] | null | null | null | from collections import defaultdict
from PyTib.common import open_file, write_csv, tib_sort
def format_families(families):
lemmas_sorted = tib_sort(list(families.keys()))
formatted = []
for lemma in lemmas_sorted:
members = families[lemma]
formatted.append('{}: {}'.format(lemma, ' '.... | 37.475 | 104 | 0.641761 | from collections import defaultdict
from PyTib.common import open_file, write_csv, tib_sort
def format_families(families):
lemmas_sorted = tib_sort(list(families.keys()))
formatted = []
for lemma in lemmas_sorted:
members = families[lemma]
formatted.append('{}: {}'.format(lemma, ' '.... | true | true |
1c2beb17305d8936ca8116de0afa4ec98fd39c51 | 127 | py | Python | language/_experimental/peace/_coherent.py | jedhsu/language | 3772a4a0ff287e1fc5ebefc716b8d91928d04c72 | [
"MIT"
] | null | null | null | language/_experimental/peace/_coherent.py | jedhsu/language | 3772a4a0ff287e1fc5ebefc716b8d91928d04c72 | [
"MIT"
] | null | null | null | language/_experimental/peace/_coherent.py | jedhsu/language | 3772a4a0ff287e1fc5ebefc716b8d91928d04c72 | [
"MIT"
] | null | null | null | """
*Coherent*
"""
from abc import ABCMeta
__all__ = [
"Coherent",
]
class Coherent:
__metaclass__ = ABCMeta
| 7.9375 | 27 | 0.598425 |
from abc import ABCMeta
__all__ = [
"Coherent",
]
class Coherent:
__metaclass__ = ABCMeta
| true | true |
1c2becd673e4d1caa9ff0dcb3a8856e5946e4172 | 1,185 | py | Python | zerver/migrations/0232_make_archive_transaction_field_not_nullable.py | kaustubh-nair/zulip | fb96407607c1f42b350980ad13af20b884750606 | [
"Apache-2.0"
] | 6 | 2019-05-09T20:43:20.000Z | 2022-03-29T05:53:50.000Z | zerver/migrations/0232_make_archive_transaction_field_not_nullable.py | kaustubh-nair/zulip | fb96407607c1f42b350980ad13af20b884750606 | [
"Apache-2.0"
] | 2 | 2016-10-18T04:01:56.000Z | 2016-10-20T18:19:09.000Z | zerver/migrations/0232_make_archive_transaction_field_not_nullable.py | kaustubh-nair/zulip | fb96407607c1f42b350980ad13af20b884750606 | [
"Apache-2.0"
] | 7 | 2016-08-10T02:24:32.000Z | 2022-03-28T15:14:18.000Z | import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
"""
Tables cannot have data deleted from them and be altered in a single transaction,
but we need the DELETEs to be atomic together. So we set atomic=False for the migration
in general, and... | 33.857143 | 113 | 0.683544 | import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
atomic = False
dependencies = [
('zerver', '0231_add_archive_transaction_model'),
]
operations = [
migrations.RunSQL("""
BEGIN;
DELETE FROM zerver_archived... | true | true |
1c2bed449e2331f0a0e96bda18a70f2e92511a9b | 36,224 | py | Python | pydantic/schema.py | xzycn/pydantic | 36c0af787fee01fe566a38c9a3d19940cb3e93c8 | [
"MIT"
] | 1 | 2020-03-03T22:12:12.000Z | 2020-03-03T22:12:12.000Z | pydantic/schema.py | xzycn/pydantic | 36c0af787fee01fe566a38c9a3d19940cb3e93c8 | [
"MIT"
] | 5 | 2021-06-02T03:55:08.000Z | 2022-03-12T00:54:02.000Z | pydantic/schema.py | xzycn/pydantic | 36c0af787fee01fe566a38c9a3d19940cb3e93c8 | [
"MIT"
] | 1 | 2021-10-05T16:57:32.000Z | 2021-10-05T16:57:32.000Z | import re
import warnings
from datetime import date, datetime, time, timedelta
from decimal import Decimal
from enum import Enum
from ipaddress import IPv4Address, IPv4Interface, IPv4Network, IPv6Address, IPv6Interface, IPv6Network
from pathlib import Path
from typing import (
TYPE_CHECKING,
Any,
Callable,
... | 40.838782 | 120 | 0.665443 | import re
import warnings
from datetime import date, datetime, time, timedelta
from decimal import Decimal
from enum import Enum
from ipaddress import IPv4Address, IPv4Interface, IPv4Network, IPv6Address, IPv6Interface, IPv6Network
from pathlib import Path
from typing import (
TYPE_CHECKING,
Any,
Callable,
... | true | true |
1c2bed8c36105c3c4609fb84bceed7998b51d8e0 | 2,945 | py | Python | cinder/tests/api/contrib/test_availability_zones.py | cloudbau/cinder | 3179f2f42ae940a08b910e326a809556689864d8 | [
"Apache-2.0"
] | 1 | 2015-11-25T10:18:28.000Z | 2015-11-25T10:18:28.000Z | cinder/tests/api/contrib/test_availability_zones.py | NeCTAR-RC/cinder | e01da23febc530de218ed8eed6737add150c1587 | [
"Apache-2.0"
] | null | null | null | cinder/tests/api/contrib/test_availability_zones.py | NeCTAR-RC/cinder | e01da23febc530de218ed8eed6737add150c1587 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2013 OpenStack Foundation
# 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 ... | 32.362637 | 78 | 0.639728 |
import datetime
from lxml import etree
import cinder.api.contrib.availability_zones
import cinder.context
from cinder.openstack.common import timeutils
import cinder.test
import cinder.volume.api
created_time = datetime.datetime(2012, 11, 14, 1, 20, 41, 95099)
current_time = timeutils.utcnow()
def list_availabil... | true | true |
1c2bed98a4878cd82b3abdfca2bc12690e5daeec | 910 | py | Python | modulo 2/d068/par_impar_v2.py | rafa-evangelista/PYTHON | 761ec7e01f1617263bc023a6b82b599a936275ee | [
"MIT"
] | null | null | null | modulo 2/d068/par_impar_v2.py | rafa-evangelista/PYTHON | 761ec7e01f1617263bc023a6b82b599a936275ee | [
"MIT"
] | null | null | null | modulo 2/d068/par_impar_v2.py | rafa-evangelista/PYTHON | 761ec7e01f1617263bc023a6b82b599a936275ee | [
"MIT"
] | null | null | null | from random import randint
print('.'*35)
print('PAR OU ÍMPAR')
print('.'*35)
soma = 0
while True:
minha_escolha = ''
while minha_escolha not in 'PI':
minha_escolha = str(
input('Você escolhe PAR ou ÍMPAR [P] ou [I]? ')).strip().upper()[0]
if minha_escolha == 'P':
escolha_computa... | 29.354839 | 98 | 0.562637 | from random import randint
print('.'*35)
print('PAR OU ÍMPAR')
print('.'*35)
soma = 0
while True:
minha_escolha = ''
while minha_escolha not in 'PI':
minha_escolha = str(
input('Você escolhe PAR ou ÍMPAR [P] ou [I]? ')).strip().upper()[0]
if minha_escolha == 'P':
escolha_computa... | true | true |
1c2bee4abdea0305d9da67ec0e87f6ee51bf00a1 | 19,713 | py | Python | src/vnsw/opencontrail-vrouter-netns/opencontrail_vrouter_netns/vrouter_netns.py | biswajit-mandal/contrail-controller | 80c4a7e8515f7296b18ba4c21a439bd3daefcc4a | [
"Apache-2.0"
] | null | null | null | src/vnsw/opencontrail-vrouter-netns/opencontrail_vrouter_netns/vrouter_netns.py | biswajit-mandal/contrail-controller | 80c4a7e8515f7296b18ba4c21a439bd3daefcc4a | [
"Apache-2.0"
] | null | null | null | src/vnsw/opencontrail-vrouter-netns/opencontrail_vrouter_netns/vrouter_netns.py | biswajit-mandal/contrail-controller | 80c4a7e8515f7296b18ba4c21a439bd3daefcc4a | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2014 Cloudwatt
# 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/l... | 38.805118 | 85 | 0.566022 |
from __future__ import print_function
__docformat__ = "restructuredtext en"
import argparse
import netaddr
import sys
import uuid
import subprocess
import requests
import json
import os
import shlex
from linux import ip_lib
import haproxy_process
def validate_uuid(val):
try:
if str(uuid.UUID(val)) ==... | true | true |
1c2bee4bac7fec0321a50314dc6ae2c0c1cf7725 | 428 | py | Python | Informatik1/Midterms Prep/midterms hs19/find_sum.py | Queentaker/uzh | 35cccaf910b95d15db21be80c8567eb427202591 | [
"MIT"
] | 8 | 2021-11-21T10:02:08.000Z | 2022-03-15T21:02:02.000Z | Informatik1/Midterms Prep/midterms hs19/find_sum.py | Queentaker/uzh | 35cccaf910b95d15db21be80c8567eb427202591 | [
"MIT"
] | null | null | null | Informatik1/Midterms Prep/midterms hs19/find_sum.py | Queentaker/uzh | 35cccaf910b95d15db21be80c8567eb427202591 | [
"MIT"
] | 3 | 2021-11-19T18:52:56.000Z | 2022-02-27T15:45:59.000Z | def find_sum(list, target):
for idx1, v1 in enumerate(list):
for idx2, v2 in enumerate(list):
if idx1 == idx2:
continue
if v1 + v2 == target:
return(idx1, idx2)
return None
print(find_sum([], 9)) #None
print(find_sum([1], 2)) #None
print(fin... | 26.75 | 41 | 0.511682 | def find_sum(list, target):
for idx1, v1 in enumerate(list):
for idx2, v2 in enumerate(list):
if idx1 == idx2:
continue
if v1 + v2 == target:
return(idx1, idx2)
return None
print(find_sum([], 9)) print(find_sum([1], 2)) print(find_sum([1, 1]... | true | true |
1c2beef66162473376677f0874951e423d99c133 | 5,824 | py | Python | tests/integration_tests/dashboards/filter_state/api_tests.py | mabossert/superset | d9e9c3a3de2ec5fe90c613ac06ad2a5606c43ece | [
"Apache-2.0"
] | 1 | 2021-12-02T03:47:56.000Z | 2021-12-02T03:47:56.000Z | tests/integration_tests/dashboards/filter_state/api_tests.py | mabossert/superset | d9e9c3a3de2ec5fe90c613ac06ad2a5606c43ece | [
"Apache-2.0"
] | 11 | 2021-12-04T14:16:33.000Z | 2022-02-21T16:07:30.000Z | tests/integration_tests/dashboards/filter_state/api_tests.py | bretton7700/alertsAndReports | d3feca6973baa9a265805a095464650e6af7b0d9 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 36.860759 | 85 | 0.684753 | import json
from typing import Any
from unittest.mock import patch
import pytest
from flask.testing import FlaskClient
from sqlalchemy.orm import Session
from superset import app
from superset.dashboards.commands.exceptions import DashboardAccessDeniedError
from superset.extensions import cache_manager
from superset.... | true | true |
1c2bef230bc14bd35ef8b0f84b1a984e28b66c66 | 4,900 | py | Python | sympy/plotting/textplot.py | msgoff/sympy | 1e7daef7514902f5e89718fa957b7b36c6669a10 | [
"BSD-3-Clause"
] | null | null | null | sympy/plotting/textplot.py | msgoff/sympy | 1e7daef7514902f5e89718fa957b7b36c6669a10 | [
"BSD-3-Clause"
] | null | null | null | sympy/plotting/textplot.py | msgoff/sympy | 1e7daef7514902f5e89718fa957b7b36c6669a10 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function, division
from sympy.core.numbers import Float
from sympy.core.symbol import Dummy
from sympy.utilities.lambdify import lambdify
import math
def is_valid(x):
"""Check if a floating point number is valid"""
if x is None:
return False
if isinstance(x, complex)... | 31.210191 | 87 | 0.380204 | from __future__ import print_function, division
from sympy.core.numbers import Float
from sympy.core.symbol import Dummy
from sympy.utilities.lambdify import lambdify
import math
def is_valid(x):
if x is None:
return False
if isinstance(x, complex):
return False
return not math.isinf(x) ... | true | true |
1c2bf09b1133e9b2ad9fd1508d657f6294cf8cfb | 2,758 | py | Python | catalog/bindings/gmd/arc_by_center_point_type.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | catalog/bindings/gmd/arc_by_center_point_type.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | catalog/bindings/gmd/arc_by_center_point_type.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass, field
from typing import Optional
from bindings.gmd.abstract_curve_segment_type import AbstractCurveSegmentType
from bindings.gmd.angle_type import AngleType
from bindings.gmd.coordinates import Coordinates
from bindings.gmd.curve_interpolation_type import CurveInterpolationType
from ... | 28.729167 | 77 | 0.568891 | from dataclasses import dataclass, field
from typing import Optional
from bindings.gmd.abstract_curve_segment_type import AbstractCurveSegmentType
from bindings.gmd.angle_type import AngleType
from bindings.gmd.coordinates import Coordinates
from bindings.gmd.curve_interpolation_type import CurveInterpolationType
from ... | true | true |
1c2bf125fa33e0f79dc94f4ba4b890f6c187bae6 | 2,260 | py | Python | tests/models/v2/average_analysed_drive_stats_test.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 5 | 2016-08-23T17:52:22.000Z | 2019-05-16T08:45:30.000Z | tests/models/v2/average_analysed_drive_stats_test.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 2 | 2016-11-10T05:30:21.000Z | 2019-04-05T15:03:37.000Z | tests/models/v2/average_analysed_drive_stats_test.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 7 | 2016-08-25T16:11:44.000Z | 2021-02-22T05:31:25.000Z | #!/usr/bin/env python
# coding: utf-8
"""
The Clear BSD License
Copyright (c) – 2016, NetApp, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions... | 59.473684 | 845 | 0.781416 |
import unittest
from netapp.santricity.models.v2.average_analysed_drive_stats import AverageAnalysedDriveStats
class AverageAnalysedDriveStatsTest(unittest.TestCase):
def test_average_analysed_drive_stats(self):
average_analysed_drive_stats_obj = AverageAnalysedDriveStats()
... | true | true |
1c2bf165335c159012d35da21c1793b566b09b91 | 578 | py | Python | nevow/test/test_tabbedpane.py | wthie/nevow | e630de8f640f27df85c38bc37ecdaf4e7b931afc | [
"MIT"
] | 49 | 2015-03-18T15:29:16.000Z | 2021-11-17T12:30:51.000Z | src/nevow/test/test_tabbedpane.py | winjer/squeal | 20401986e0d1698776f5b482b28e14c57b11833c | [
"Apache-2.0"
] | 62 | 2015-01-21T08:48:08.000Z | 2021-04-02T17:31:29.000Z | src/nevow/test/test_tabbedpane.py | winjer/squeal | 20401986e0d1698776f5b482b28e14c57b11833c | [
"Apache-2.0"
] | 30 | 2015-02-26T09:35:39.000Z | 2021-07-24T12:45:04.000Z | # Copyright (c) 2009 Divmod. See LICENSE for details.
"""
Tests for L{nevow.taglibrary.tabbedPane}.
"""
from twisted.trial.unittest import TestCase
class TabbedPaneTests(TestCase):
def test_import(self):
"""
L{nevow.taglibrary.tabbedPane} can be imported.
This is a very meager test, an... | 27.52381 | 72 | 0.681661 |
from twisted.trial.unittest import TestCase
class TabbedPaneTests(TestCase):
def test_import(self):
import nevow.taglibrary.tabbedPane
| true | true |
1c2bf40f9814a7452866b58655c468474e01efdb | 1,093 | py | Python | setup.py | 5long/forwardable | 30d0f1989265acf05b0302abbf307d887f40ab05 | [
"MIT"
] | 31 | 2015-01-20T15:08:22.000Z | 2020-11-24T20:52:58.000Z | setup.py | 5long/forwardable | 30d0f1989265acf05b0302abbf307d887f40ab05 | [
"MIT"
] | 2 | 2019-05-13T06:27:45.000Z | 2019-08-15T06:10:36.000Z | setup.py | 5long/forwardable | 30d0f1989265acf05b0302abbf307d887f40ab05 | [
"MIT"
] | 6 | 2019-05-09T09:35:06.000Z | 2021-08-16T09:01:56.000Z | #!/usr/bin/env python
from setuptools import setup
from forwardable import __version__
setup(
name='forwardable',
version=__version__,
description="Forwardable as in Ruby's stdlib",
url='https://github.com/5long/forwardable',
long_description=open("README.rst").read(),
author="Whyme Lyu",
... | 30.361111 | 66 | 0.619396 |
from setuptools import setup
from forwardable import __version__
setup(
name='forwardable',
version=__version__,
description="Forwardable as in Ruby's stdlib",
url='https://github.com/5long/forwardable',
long_description=open("README.rst").read(),
author="Whyme Lyu",
author_email="callme5... | true | true |
1c2bf5c725262d5b1f8d86c19cab70d1597efa3a | 563 | gyp | Python | binding.gyp | GaikwadPratik/node-linux-pam | 9249114b2efb3b1ff86b8ee2d7c12c8605faaa23 | [
"MIT"
] | null | null | null | binding.gyp | GaikwadPratik/node-linux-pam | 9249114b2efb3b1ff86b8ee2d7c12c8605faaa23 | [
"MIT"
] | null | null | null | binding.gyp | GaikwadPratik/node-linux-pam | 9249114b2efb3b1ff86b8ee2d7c12c8605faaa23 | [
"MIT"
] | null | null | null | {
"targets": [
{
"target_name": "node-linux-pam",
"cflags!": ["-fno-exceptions"],
"cflags_cc!": ["-fno-exceptions"],
"sources": [
"src/index.cc",
"src/pam_worker.cpp"
],
'conditions': [
['OS=="mac"', {
'xcode_settings': {
'GCC_ENABL... | 21.653846 | 60 | 0.445826 | {
"targets": [
{
"target_name": "node-linux-pam",
"cflags!": ["-fno-exceptions"],
"cflags_cc!": ["-fno-exceptions"],
"sources": [
"src/index.cc",
"src/pam_worker.cpp"
],
'conditions': [
['OS=="mac"', {
'xcode_settings': {
'GCC_ENABL... | true | true |
1c2bf6a63fa7b00998e842355efee74c370d0689 | 3,447 | py | Python | pymisp/tools/vehicleobject.py | kak-bo-che/PyMISP | 23d732e398471ade1d28c7ec1e61977329df07ea | [
"BSD-2-Clause"
] | null | null | null | pymisp/tools/vehicleobject.py | kak-bo-che/PyMISP | 23d732e398471ade1d28c7ec1e61977329df07ea | [
"BSD-2-Clause"
] | null | null | null | pymisp/tools/vehicleobject.py | kak-bo-che/PyMISP | 23d732e398471ade1d28c7ec1e61977329df07ea | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python3
import requests
import json
from .abstractgenerator import AbstractMISPObjectGenerator
# Original sourcecode: https://github.com/hayk57/MISP_registration_check
class VehicleObject(AbstractMISPObjectGenerator):
'''Vehicle object generator out of regcheck.org.uk'''
country_urls = {
... | 42.036585 | 112 | 0.653612 |
import requests
import json
from .abstractgenerator import AbstractMISPObjectGenerator
class VehicleObject(AbstractMISPObjectGenerator):
country_urls = {
'fr': "http://www.regcheck.org.uk/api/reg.asmx/CheckFrance",
'es': "http://www.regcheck.org.uk/api/reg.asmx/CheckSpain",
'uk': "http... | true | true |
1c2bf8647f720fdad3e12b5cbc2dd91af165d56a | 10,861 | py | Python | scripts/ws/DaemonStatusServiceImplService_client.py | rondinelisaad/lockss-daemon | 563a3bcd106908b0967f510ee4cf88525a48651a | [
"BSD-3-Clause"
] | null | null | null | scripts/ws/DaemonStatusServiceImplService_client.py | rondinelisaad/lockss-daemon | 563a3bcd106908b0967f510ee4cf88525a48651a | [
"BSD-3-Clause"
] | null | null | null | scripts/ws/DaemonStatusServiceImplService_client.py | rondinelisaad/lockss-daemon | 563a3bcd106908b0967f510ee4cf88525a48651a | [
"BSD-3-Clause"
] | null | null | null | ##################################################
# file: DaemonStatusServiceImplService_client.py
#
# client stubs generated by "ZSI.generate.wsdl2python.WriteServiceModule"
# /usr/bin/wsdl2py -b /tmp/DaemonStatusService.wsdl
#
##################################################
from DaemonStatusServiceImplServ... | 42.2607 | 148 | 0.685756 |
from DaemonStatusServiceImplService_types import *
import urlparse, types
from ZSI.TCcompound import ComplexType, Struct
from ZSI import client
from ZSI.schema import GED, GTD
import ZSI
from ZSI.generate.pyclass import pyclass_type
class DaemonStatusServiceImplServiceLocator:
DaemonStatusServiceImplPort_address ... | false | true |
1c2bf8b07e26a0bf34dc5b1b7d2d271c2ab8488a | 2,433 | py | Python | huaweicloud-sdk-vpcep/huaweicloudsdkvpcep/v1/model/delete_endpoint_response.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-vpcep/huaweicloudsdkvpcep/v1/model/delete_endpoint_response.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-vpcep/huaweicloudsdkvpcep/v1/model/delete_endpoint_response.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class DeleteEndpointResponse(SdkResponse):
"""
Attributes:
openapi_types (dict): The key is attribute name
... | 28.290698 | 79 | 0.55076 |
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class DeleteEndpointResponse(SdkResponse):
sensitive_list = []
openapi_types = {
}
attribute_map = {
}
def __init__(self):
... | true | true |
1c2bfa5ee6dc0bf2c9bb76e4aae9a6ebc633107a | 793 | py | Python | src/hg/ultras/ultraDb/plateTab/salama2.py | andypohl/kent | af7a004c8f3fa909cd8c2cfc2e5bea60e3421cd1 | [
"MIT"
] | 171 | 2015-04-22T15:16:02.000Z | 2022-03-18T20:21:53.000Z | src/hg/ultras/ultraDb/plateTab/salama2.py | andypohl/kent | af7a004c8f3fa909cd8c2cfc2e5bea60e3421cd1 | [
"MIT"
] | 60 | 2016-10-03T15:15:06.000Z | 2022-03-30T15:21:52.000Z | src/hg/ultras/ultraDb/plateTab/salama2.py | andypohl/kent | af7a004c8f3fa909cd8c2cfc2e5bea60e3421cd1 | [
"MIT"
] | 80 | 2015-04-16T10:39:48.000Z | 2022-03-29T16:36:30.000Z | #!/usr/bin/env python
import sys
def reformat(inName, outName):
"""Transform spreadsheet format into database format"""
print "Processing %s to %s" % (inName, outName)
inFile = open(inName)
outFile = open(outName, "w")
while 1:
line = inFile.readline()
if line == '':
break
(rowCol, ... | 26.433333 | 77 | 0.627995 |
import sys
def reformat(inName, outName):
"""Transform spreadsheet format into database format"""
print "Processing %s to %s" % (inName, outName)
inFile = open(inName)
outFile = open(outName, "w")
while 1:
line = inFile.readline()
if line == '':
break
(rowCol, row, col, name, seq, s... | false | true |
1c2bfc2d2277fd98cef9390d253e1790f4aebd3f | 153 | py | Python | src/fake-email/ruks.py | AboFatma512/fake-email | d9bf3c3001a36126d34671f78bf7ed77ded7701a | [
"MIT"
] | 14 | 2021-10-31T20:39:40.000Z | 2022-01-03T15:32:42.000Z | src/fake-email/ruks.py | AboFatma512/fake-email | d9bf3c3001a36126d34671f78bf7ed77ded7701a | [
"MIT"
] | null | null | null | src/fake-email/ruks.py | AboFatma512/fake-email | d9bf3c3001a36126d34671f78bf7ed77ded7701a | [
"MIT"
] | 4 | 2021-11-01T11:42:45.000Z | 2022-01-26T14:33:59.000Z | URL = "https://10minutemail.com"
EMAIL = URL + "/session/address"
MESSAGE_A = URL + "/messages/messagesAfter/"
MESSAGE_C = URL + "/messages/messageCount" | 38.25 | 44 | 0.718954 | URL = "https://10minutemail.com"
EMAIL = URL + "/session/address"
MESSAGE_A = URL + "/messages/messagesAfter/"
MESSAGE_C = URL + "/messages/messageCount" | true | true |
1c2bfd3d9326aa478d6c1164c854527ce75f53b5 | 5,148 | py | Python | standup_and_prosper_sdk/models/thread.py | Teaminator/standup-and-prosper-sdk.py | ccdba4a24f395dc0b45d9f9da9bdf5038e1b1617 | [
"Apache-2.0"
] | 1 | 2021-09-16T08:02:35.000Z | 2021-09-16T08:02:35.000Z | standup_and_prosper_sdk/models/thread.py | Teaminator/standup-and-prosper-sdk.py | ccdba4a24f395dc0b45d9f9da9bdf5038e1b1617 | [
"Apache-2.0"
] | 1 | 2021-06-14T16:45:56.000Z | 2021-06-14T16:56:05.000Z | standup_and_prosper_sdk/models/thread.py | Teaminator/standup-and-prosper-sdk.py | ccdba4a24f395dc0b45d9f9da9bdf5038e1b1617 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
import pprint
import re
import six
class Thread(object):
"""
Attributes:
swagger_types (dict): The key is attribute name and the value is attribute type.
attribute_map (dict): The key is attribute name and the value is json key in definition.
"""
swagger_types = {
... | 27.677419 | 94 | 0.582168 |
import pprint
import re
import six
class Thread(object):
swagger_types = {
'scheduled_date': 'str',
'last_updated': 'str',
'status': 'str',
'responses': 'list[Response]',
}
attribute_map = {
'scheduled_date': 'scheduledDate',
'last_updated': 'lastUpdate... | true | true |
1c2bff6e021e13c1039c359c5299324d5c99df91 | 225 | py | Python | mydays/01-03/01.py | josephrewald/100daysofcode-with-python-course | b51dfbf786c1a89694c4661805ef930516683439 | [
"MIT"
] | null | null | null | mydays/01-03/01.py | josephrewald/100daysofcode-with-python-course | b51dfbf786c1a89694c4661805ef930516683439 | [
"MIT"
] | null | null | null | mydays/01-03/01.py | josephrewald/100daysofcode-with-python-course | b51dfbf786c1a89694c4661805ef930516683439 | [
"MIT"
] | null | null | null | from datetime import datetime
from datetime import date
from datetime import timedelta
today = datetime.today()
print(today)
t = timedelta(days=4, hours=10)
second = timedelta(seconds=1)
seconds = t/second
print(seconds)
| 16.071429 | 31 | 0.773333 | from datetime import datetime
from datetime import date
from datetime import timedelta
today = datetime.today()
print(today)
t = timedelta(days=4, hours=10)
second = timedelta(seconds=1)
seconds = t/second
print(seconds)
| true | true |
1c2c000c1996218df929d4fbfc623e469922b650 | 677 | py | Python | myapp/models.py | Palash51/kd | 2f28adbff98756a84906a4170b428c3298e9273d | [
"MIT"
] | null | null | null | myapp/models.py | Palash51/kd | 2f28adbff98756a84906a4170b428c3298e9273d | [
"MIT"
] | null | null | null | myapp/models.py | Palash51/kd | 2f28adbff98756a84906a4170b428c3298e9273d | [
"MIT"
] | null | null | null | # from django.db import models
# # Create your models here.
# class RegistrationForm(models.Model):
# first_name = models.CharField(max_length=45)
# last_name = models.CharField(max_length=45)
# email = models.EmailField()
# password = models.CharField(max_length=100)#,widget=models.PasswordInput)
# confirm_pass... | 32.238095 | 84 | 0.781388 |
from __future__ import unicode_literals
from django.db import models
class Crop_details(models.Model):
Name = models.CharField(max_length=30)
Phone = models.IntegerField()
FieldLocation = models.CharField(max_length=30)
CropAcres = models.IntegerField() | true | true |
1c2c00a0ece3ea72ebeb3dcb891cf8b8a73360b4 | 11,136 | py | Python | euca2ools/commands/argtypes.py | sjones4/euca2ools | 03b0e421eeebd8f402422a0ad6994bd6ee4e4127 | [
"BSD-2-Clause"
] | null | null | null | euca2ools/commands/argtypes.py | sjones4/euca2ools | 03b0e421eeebd8f402422a0ad6994bd6ee4e4127 | [
"BSD-2-Clause"
] | null | null | null | euca2ools/commands/argtypes.py | sjones4/euca2ools | 03b0e421eeebd8f402422a0ad6994bd6ee4e4127 | [
"BSD-2-Clause"
] | null | null | null | # Copyright 2012-2014 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software 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 of conditions ... | 38.532872 | 79 | 0.599497 |
import argparse
import base64
import sys
from requestbuilder import EMPTY
def manifest_block_device_mappings(mappings_as_str):
mappings = {}
mapping_strs = mappings_as_str.split(',')
for mapping_str in mapping_strs:
if mapping_str.strip():
bits = mapping_str.strip().split('=')
... | true | true |
1c2c0160bc99a9415b825ead5aeb916195464fa4 | 1,773 | py | Python | RecursiveDescentAnalysis/TheoreticalParser.py | Miosolo/C-Lanaguage-Compiler | f38459e0a27b0e71eaad81fe3d3c25d72f3a0ca0 | [
"MIT"
] | null | null | null | RecursiveDescentAnalysis/TheoreticalParser.py | Miosolo/C-Lanaguage-Compiler | f38459e0a27b0e71eaad81fe3d3c25d72f3a0ca0 | [
"MIT"
] | null | null | null | RecursiveDescentAnalysis/TheoreticalParser.py | Miosolo/C-Lanaguage-Compiler | f38459e0a27b0e71eaad81fe3d3c25d72f3a0ca0 | [
"MIT"
] | null | null | null |
class Parser(object):
V_N = ['E', 'e', 'T', 't', 'F']
first = {
'E': ['(', 'i'],
'e': ['+', '-'],
'T': ['(', 'i'],
't': ['*', '/'],
'F': ['(', 'i']
}
follow = {
'E': [')', '#'],
'e': [')', '#'],
'T': ['+', '-', '#', ')'],
't': ['+', '-', '#', ')'],
'F': ['+', '-', '*',... | 23.025974 | 109 | 0.400451 |
class Parser(object):
V_N = ['E', 'e', 'T', 't', 'F']
first = {
'E': ['(', 'i'],
'e': ['+', '-'],
'T': ['(', 'i'],
't': ['*', '/'],
'F': ['(', 'i']
}
follow = {
'E': [')', '#'],
'e': [')', '#'],
'T': ['+', '-', '#', ')'],
't': ['+', '-', '#', ')'],
'F': ['+', '-', '*',... | true | true |
1c2c01ba70600600132778eea97a6611aed1f678 | 7,415 | py | Python | script.py | cgalaz01/acur_mri | 3be85e62a3362f9498169edb87c233e4da35ddd8 | [
"MIT"
] | null | null | null | script.py | cgalaz01/acur_mri | 3be85e62a3362f9498169edb87c233e4da35ddd8 | [
"MIT"
] | null | null | null | script.py | cgalaz01/acur_mri | 3be85e62a3362f9498169edb87c233e4da35ddd8 | [
"MIT"
] | null | null | null | import argparse
from pathlib import Path
from functions import anonymise_mri, catalogue, dicom_sort, sequence
def parse_arguments() -> argparse.Namespace:
"""
Defines all accepted arguments.
Returns
-------
args : argparse.Namespace
Values of the passed arguments.
"""
p... | 30.142276 | 94 | 0.599191 | import argparse
from pathlib import Path
from functions import anonymise_mri, catalogue, dicom_sort, sequence
def parse_arguments() -> argparse.Namespace:
parser = argparse.ArgumentParser(description='Script to prepare the data.' +
'One flag should be given at a time... | true | true |
1c2c01cdaa60e2de80735ae30dcb81a40e4f8ccd | 3,055 | py | Python | python/chapter10.py | Rokon-Uz-Zaman/thinkdiff_python_django | 5010c5f1dd8a028fb9e5235319bb6bb434831e6c | [
"MIT"
] | 92 | 2018-04-03T20:53:07.000Z | 2022-03-04T05:53:10.000Z | python-language/python-beginner/chapter10.py | mostafijur-rahman299/thinkdiff | b0e0c01fe38c406f4dfa8cc80b2f0c5654017079 | [
"MIT"
] | 11 | 2018-10-01T15:35:33.000Z | 2021-09-01T04:59:56.000Z | python-language/python-beginner/chapter10.py | mostafijur-rahman299/thinkdiff | b0e0c01fe38c406f4dfa8cc80b2f0c5654017079 | [
"MIT"
] | 98 | 2018-03-13T08:03:54.000Z | 2022-03-22T08:11:44.000Z | # author: Mahmud Ahsan
# code: https://github.com/mahmudahsan/thinkdiff
# blog: http://thinkdiff.net
# http://pythonbangla.com
# MIT License
# --------------------
# Exception
# --------------------
'''
Exception are object in Python that arise runtime to handle error
'''
## Hello Exception
def div(x, y):
re... | 20.782313 | 65 | 0.582651 |
def div(x, y):
return x / y
print ( div(4, 2) )
def div(x, y):
try:
result = x / y
except ZeroDivisionError:
print ("Can not divide by zero")
return None
return result
print ( div(4, 2) )
print ( div(2, 0) )
def div(x, y):
try:
result = x / y
... | true | true |
1c2c0229bf58ba5a5e012acacea611bd236757cd | 1,502 | py | Python | pyzoo/test/zoo/orca/data/conftest.py | thalvari/analytics-zoo | 4f4c5095c3db9363f5a23ca312a95bbdc6a3db91 | [
"Apache-2.0"
] | null | null | null | pyzoo/test/zoo/orca/data/conftest.py | thalvari/analytics-zoo | 4f4c5095c3db9363f5a23ca312a95bbdc6a3db91 | [
"Apache-2.0"
] | null | null | null | pyzoo/test/zoo/orca/data/conftest.py | thalvari/analytics-zoo | 4f4c5095c3db9363f5a23ca312a95bbdc6a3db91 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2018 Analytics Zoo Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 33.377778 | 77 | 0.684421 | import os
from zoo.orca import OrcaContext
import pytest
sc = None
ray_ctx = None
@pytest.fixture(autouse=True, scope='package')
def orca_data_fixture():
from zoo import init_spark_on_local
from zoo.ray import RayContext
OrcaContext._eager_mode = True
sc = init_spark_on_local(cores=4, spark_log_leve... | true | true |
1c2c02353792b04153b879efbe0813a32e4c9f76 | 672 | py | Python | 01. RPI - Python - Blink an LED/main.py | wyliodrinstudio/tutorials | bbb982fd2cae848d2b5d9e45a1d0408df9ced811 | [
"Apache-2.0"
] | null | null | null | 01. RPI - Python - Blink an LED/main.py | wyliodrinstudio/tutorials | bbb982fd2cae848d2b5d9e45a1d0408df9ced811 | [
"Apache-2.0"
] | null | null | null | 01. RPI - Python - Blink an LED/main.py | wyliodrinstudio/tutorials | bbb982fd2cae848d2b5d9e45a1d0408df9ced811 | [
"Apache-2.0"
] | null | null | null | import RPi.GPIO as GPIO #import Raspberry Pi GPIO library
from time import sleep #import the sleep method from time module
GPIO.setmode(GPIO.BOARD) #setup BOARD numbering
GPIO.setup(11, GPIO.OUT) #set pin 11 as output
try:
while True: #run... | 44.8 | 78 | 0.543155 | import RPi.GPIO as GPIO from time import sleep
GPIO.setmode(GPIO.BOARD) GPIO.setup(11, GPIO.OUT)
try:
while True: GPIO.output(11, 1) sleep(1) GPIO.output(11, 0) sleep(0.5) ... | true | true |
1c2c02fbc031c0a65d193085f3e43db29743163b | 1,449 | py | Python | WEEKS/CD_Sata-Structures/general/practice/PYTHON/09 - allLongestStrings.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | null | null | null | WEEKS/CD_Sata-Structures/general/practice/PYTHON/09 - allLongestStrings.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | null | null | null | WEEKS/CD_Sata-Structures/general/practice/PYTHON/09 - allLongestStrings.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | null | null | null | """Given an array of strings, return another array containing all of its longest strings.
Example:
For inputArray = ["aba", "aa", "ad", "vcd", "aba"], the output should be allLongestStrings(inputArray) = ["aba", "vcd", "aba"]."""
def allLongestStrings(inputArray):
# Step 1: We begin by defining an empty array ca... | 63 | 133 | 0.715666 |
def allLongestStrings(inputArray):
max_arr = []
# You are free to test it on a random input array containing various random strings, using a Python compiler online.
max_len = len(max(inputArray, key=len))
# Step 3: Now, we go over all strings inside the input array checking if thei... | true | true |
1c2c033ff22bbc05914c0d7d30afc0d5506fdeec | 19,440 | py | Python | salt/modules/boto_asg.py | robmessick/salt | 95b44af831eeca3df261b3d61b7519fbd65319c6 | [
"Apache-2.0"
] | null | null | null | salt/modules/boto_asg.py | robmessick/salt | 95b44af831eeca3df261b3d61b7519fbd65319c6 | [
"Apache-2.0"
] | null | null | null | salt/modules/boto_asg.py | robmessick/salt | 95b44af831eeca3df261b3d61b7519fbd65319c6 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Connection module for Amazon Autoscale Groups
.. versionadded:: 2014.7.0
:configuration: This module accepts explicit autoscale credentials but can also
utilize IAM roles assigned to the instance trough Instance Profiles.
Dynamic credentials are then automatically obtained from AWS... | 37.31286 | 190 | 0.639712 |
import logging
import json
import yaml
import email.mime.multipart
log = logging.getLogger(__name__)
try:
import boto
import boto.ec2
import boto.ec2.blockdevicemapping as blockdevicemapping
import boto.ec2.autoscale as autoscale
logging.getLogger('boto').setLevel(logging.CRITICAL)
HAS_BOTO =... | true | true |
1c2c03a70656d1a7b8ce7938f0d27478e07cf865 | 1,559 | py | Python | project/api/views.py | milkOSTpyt/Goods-accounting-system | ec223ed726cfa9f18d49c4233f9dc1520373c874 | [
"BSD-3-Clause"
] | null | null | null | project/api/views.py | milkOSTpyt/Goods-accounting-system | ec223ed726cfa9f18d49c4233f9dc1520373c874 | [
"BSD-3-Clause"
] | null | null | null | project/api/views.py | milkOSTpyt/Goods-accounting-system | ec223ed726cfa9f18d49c4233f9dc1520373c874 | [
"BSD-3-Clause"
] | null | null | null | from rest_framework.viewsets import ModelViewSet
from rest_framework import permissions
from rest_framework.generics import ListAPIView
from django_filters.rest_framework import DjangoFilterBackend
from app.models import Product, Category, Shop, Warehouse
from .serializers import (ProductSerializer,
... | 33.170213 | 64 | 0.736369 | from rest_framework.viewsets import ModelViewSet
from rest_framework import permissions
from rest_framework.generics import ListAPIView
from django_filters.rest_framework import DjangoFilterBackend
from app.models import Product, Category, Shop, Warehouse
from .serializers import (ProductSerializer,
... | true | true |
1c2c04346d29c864bf3b404ac8b16744e1a6c5f6 | 2,850 | py | Python | benchmark.py | padix-key/fastpdb | 016c0211743fcbf4366fdaf6fb5579ff073c6274 | [
"BSD-3-Clause"
] | 2 | 2021-11-12T18:54:09.000Z | 2022-03-29T10:20:28.000Z | benchmark.py | biotite-dev/fastpdb | 016c0211743fcbf4366fdaf6fb5579ff073c6274 | [
"BSD-3-Clause"
] | null | null | null | benchmark.py | biotite-dev/fastpdb | 016c0211743fcbf4366fdaf6fb5579ff073c6274 | [
"BSD-3-Clause"
] | null | null | null | import time
import tempfile
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import numpy as np
import biotite.database.rcsb as rcsb
import biotite.structure.info as info
import biotite.structure.io.pdb as pdb
import fastpdb
REPEATS = 1000
PDB_ID = "1AKI"
WIDTH = 0.25
# Call this... | 28.217822 | 77 | 0.723158 | import time
import tempfile
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import numpy as np
import biotite.database.rcsb as rcsb
import biotite.structure.info as info
import biotite.structure.io.pdb as pdb
import fastpdb
REPEATS = 1000
PDB_ID = "1AKI"
WIDTH = 0.25
info.bond_d... | true | true |
1c2c05041b07e62bc9988d892ca411996f34d53f | 2,665 | py | Python | basecase.py | sibson/dynoup | 6f43c92c82f41bf9c1e3efeeca05bf8f566a4cf5 | [
"MIT"
] | 1 | 2020-09-13T17:26:31.000Z | 2020-09-13T17:26:31.000Z | basecase.py | sibson/dynoup | 6f43c92c82f41bf9c1e3efeeca05bf8f566a4cf5 | [
"MIT"
] | 3 | 2015-09-23T17:01:02.000Z | 2015-11-21T03:58:13.000Z | basecase.py | sibson/dynoup | 6f43c92c82f41bf9c1e3efeeca05bf8f566a4cf5 | [
"MIT"
] | null | null | null | from contextlib import contextmanager
import json
import os
import logging
from unittest import TestCase
from flask import appcontext_pushed, g
import responses
from dynoup import app, db
from scaler import models
class HerokuBouncerTestDoubleMiddleWare(object):
def __init__(self, app):
self._app = app... | 28.052632 | 119 | 0.63152 | from contextlib import contextmanager
import json
import os
import logging
from unittest import TestCase
from flask import appcontext_pushed, g
import responses
from dynoup import app, db
from scaler import models
class HerokuBouncerTestDoubleMiddleWare(object):
def __init__(self, app):
self._app = app... | true | true |
1c2c05bf84b5f4c73f4eca061fdcd88f931bb816 | 4,677 | py | Python | examples/set_mnist_gan.py | bobelly/torchsupport | 5aa0a04f20c193ec99310f5d6a3375d2e95e740d | [
"MIT"
] | 18 | 2019-05-02T16:32:15.000Z | 2021-04-16T09:33:54.000Z | examples/set_mnist_gan.py | bobelly/torchsupport | 5aa0a04f20c193ec99310f5d6a3375d2e95e740d | [
"MIT"
] | 5 | 2019-10-14T13:46:49.000Z | 2021-06-08T11:48:34.000Z | examples/set_mnist_gan.py | bobelly/torchsupport | 5aa0a04f20c193ec99310f5d6a3375d2e95e740d | [
"MIT"
] | 12 | 2019-05-12T21:34:24.000Z | 2021-07-15T14:14:16.000Z | import random
import torch
import torch.nn as nn
import torch.nn.functional as func
from torch.nn.utils import spectral_norm
from torch.utils.data import Dataset
from torch.distributions import Normal
from torchvision.datasets import MNIST
from torchvision.transforms import ToTensor
from torchsupport.modules.basic i... | 31.816327 | 111 | 0.6904 | import random
import torch
import torch.nn as nn
import torch.nn.functional as func
from torch.nn.utils import spectral_norm
from torch.utils.data import Dataset
from torch.distributions import Normal
from torchvision.datasets import MNIST
from torchvision.transforms import ToTensor
from torchsupport.modules.basic i... | true | true |
1c2c060c1c9a431c35374a32fe73c945cf6450c9 | 8,437 | py | Python | src/compressed_sensing.py | horseriver/csgm | 7c8f039e6f28cb84909df05c55124f18067bb6df | [
"MIT"
] | 213 | 2017-03-22T03:39:08.000Z | 2022-03-07T17:59:52.000Z | src/compressed_sensing.py | wenxiang2333/csgm | 0f77d9c749dd31ce03b104dc2d355267e3ced038 | [
"MIT"
] | 13 | 2017-03-24T07:27:10.000Z | 2020-10-11T14:25:02.000Z | src/compressed_sensing.py | wenxiang2333/csgm | 0f77d9c749dd31ce03b104dc2d355267e3ced038 | [
"MIT"
] | 80 | 2017-03-23T15:34:14.000Z | 2022-03-04T13:13:33.000Z | """Compressed sensing main script"""
# pylint: disable=C0301,C0103,C0111
from __future__ import division
import os
from argparse import ArgumentParser
import numpy as np
import utils
def main(hparams):
# Set up some stuff accoring to hparams
hparams.n_input = np.prod(hparams.image_shape)
utils.set_num_m... | 47.398876 | 139 | 0.659832 | """Compressed sensing main script"""
from __future__ import division
import os
from argparse import ArgumentParser
import numpy as np
import utils
def main(hparams):
hparams.n_input = np.prod(hparams.image_shape)
utils.set_num_measurements(hparams)
utils.print_hparams(hparams)
xs_dict = mod... | false | true |
1c2c0732857dffb457209f64f936c6c97ee67f82 | 49 | py | Python | writer/__init__.py | thsis/timesheets | fa849e0e67aac30de777312adc5b232aa79ecb31 | [
"WTFPL"
] | 3 | 2020-07-26T18:04:37.000Z | 2022-02-08T13:27:47.000Z | writer/__init__.py | thsis/timesheets | fa849e0e67aac30de777312adc5b232aa79ecb31 | [
"WTFPL"
] | null | null | null | writer/__init__.py | thsis/timesheets | fa849e0e67aac30de777312adc5b232aa79ecb31 | [
"WTFPL"
] | null | null | null | from ._writer import Writer
__all__ = ["Writer"] | 16.333333 | 27 | 0.734694 | from ._writer import Writer
__all__ = ["Writer"] | true | true |
1c2c077f814bee6ca3254a928438dc8c529d69d6 | 12,450 | py | Python | guilded/user.py | ShashankKumarSaxena/enhanced-guilded.py | 285bf65f115362f69b36547ad77dc02598a70e28 | [
"MIT"
] | null | null | null | guilded/user.py | ShashankKumarSaxena/enhanced-guilded.py | 285bf65f115362f69b36547ad77dc02598a70e28 | [
"MIT"
] | null | null | null | guilded/user.py | ShashankKumarSaxena/enhanced-guilded.py | 285bf65f115362f69b36547ad77dc02598a70e28 | [
"MIT"
] | null | null | null | """
MIT License
Copyright (c) 2020-present shay (shayypy)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge,... | 33.2 | 90 | 0.621526 |
import guilded.abc
from .colour import Colour
from .utils import ISO8601, parse_hex_number
from .file import File, MediaType
class Device:
def __init__(self, data):
self.type = data.get('type')
self.id = data.get('id')
self.last_online = ISO8601(data.get('lastOnline'))
self.activ... | true | true |
1c2c087406338bf6b6a5c280270dabf1873aef85 | 6,991 | py | Python | plotting.py | KonstantinIvanchenko/selfdriving_env_sim | 2e524c9a7164020a0bc35af4f1b6556777a8289c | [
"MIT"
] | 1 | 2020-08-26T19:41:02.000Z | 2020-08-26T19:41:02.000Z | plotting.py | KonstantinIvanchenko/selfdriving_env_sim | 2e524c9a7164020a0bc35af4f1b6556777a8289c | [
"MIT"
] | null | null | null | plotting.py | KonstantinIvanchenko/selfdriving_env_sim | 2e524c9a7164020a0bc35af4f1b6556777a8289c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
#
# Modified work: Konstantin Ivanchenko
# Date: December 25, 2019
from external_source import live_plotter as lp
class MotionPlotter(object):
def __init__(self, waypoints,... | 46.919463 | 115 | 0.506508 |
from external_source import live_plotter as lp
class MotionPlotter(object):
def __init__(self, waypoints, num_local_path, trajectory = True, controls = True):
self.tr_plot = lp.LivePlotter(tk_title="Trajectory Visualization")
self.ct_plot = lp.LivePlotter(tk_title="Control Outputs")
sel... | true | true |
1c2c08fa5eda507ae606cd60e1248cb0e025213c | 1,650 | py | Python | store/store_de_ro_prices.py | rkneusel9/SwarmOptimization | 5445b6f90ab49339ca0fdb71e98d44e6827c95a8 | [
"MIT"
] | 2 | 2022-01-11T17:14:14.000Z | 2022-03-07T10:22:32.000Z | store/store_de_ro_prices.py | rkneusel9/SwarmOptimization | 5445b6f90ab49339ca0fdb71e98d44e6827c95a8 | [
"MIT"
] | null | null | null | store/store_de_ro_prices.py | rkneusel9/SwarmOptimization | 5445b6f90ab49339ca0fdb71e98d44e6827c95a8 | [
"MIT"
] | 1 | 2021-11-24T01:11:49.000Z | 2021-11-24T01:11:49.000Z | import numpy as np
import pickle
import matplotlib.pylab as plt
d = pickle.load(open("de_50_40_16000_results.pkl","rb"))
r = pickle.load(open("ro_50_40_16000_results.pkl","rb"))
#g = pickle.load(open("ga_50_40_16000_results.pkl","rb"))
p = np.array(pickle.load(open("products.pkl","rb"))[-1])
w = np.array(pickle.load(o... | 36.666667 | 70 | 0.661818 | import numpy as np
import pickle
import matplotlib.pylab as plt
d = pickle.load(open("de_50_40_16000_results.pkl","rb"))
r = pickle.load(open("ro_50_40_16000_results.pkl","rb"))
p = np.array(pickle.load(open("products.pkl","rb"))[-1])
w = np.array(pickle.load(open("products.pkl","rb"))[0])
w = w / w.sum()
de = p[np... | true | true |
1c2c09d0914ee6083d8ca37494180d973848f2ef | 10,083 | py | Python | pcp_utils/cameras.py | YunchuZhang/Visually-Grounded-Library-of-Behaviors-for-Generalizing-Manipulation-Across-Objects-Configurations- | 896afda942dfc04e4aaad2ee751c32df1eb17913 | [
"MIT"
] | 1 | 2022-03-14T22:25:17.000Z | 2022-03-14T22:25:17.000Z | pcp_utils/cameras.py | YunchuZhang/Visually-Grounded-Library-of-Behaviors | 896afda942dfc04e4aaad2ee751c32df1eb17913 | [
"MIT"
] | null | null | null | pcp_utils/cameras.py | YunchuZhang/Visually-Grounded-Library-of-Behaviors | 896afda942dfc04e4aaad2ee751c32df1eb17913 | [
"MIT"
] | null | null | null | import numpy as np
import math
from scipy.linalg import inv, sqrtm
import transformations
def sym(w):
return w.dot(inv(sqrtm(w.T.dot(w))))
def render_images(env, camera_img_height, camera_img_width, camera_fov, camera_positions, camera_quats, camera_name="ext_camera_0"):
"""
go through all the cameras ... | 33.277228 | 134 | 0.632748 | import numpy as np
import math
from scipy.linalg import inv, sqrtm
import transformations
def sym(w):
return w.dot(inv(sqrtm(w.T.dot(w))))
def render_images(env, camera_img_height, camera_img_width, camera_fov, camera_positions, camera_quats, camera_name="ext_camera_0"):
n_cams = len(camera_positions)
... | true | true |
1c2c0a04625db08cdc0b0f638973ec5905bc5218 | 1,924 | py | Python | tests/profiler_test.py | gully/jax | eb086f9b22154104b216b22ed006264989bcad41 | [
"ECL-2.0",
"Apache-2.0"
] | 4 | 2021-04-02T03:46:28.000Z | 2021-12-04T22:52:50.000Z | tests/profiler_test.py | gully/jax | eb086f9b22154104b216b22ed006264989bcad41 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-10-01T05:38:44.000Z | 2020-10-01T05:38:44.000Z | tests/profiler_test.py | gully/jax | eb086f9b22154104b216b22ed006264989bcad41 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-08-28T18:42:08.000Z | 2020-08-28T18:42:08.000Z | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 26.722222 | 77 | 0.723493 |
from functools import partial
import unittest
from absl.testing import absltest
import jax
import jax.numpy as jnp
import jax.profiler
from jax.config import config
import jax.test_util as jtu
try:
import portpicker
except ImportError:
portpicker = None
config.parse_flags_with_absl()
class ProfilerTest(unitt... | true | true |
1c2c0a3497a3a7dcde3159a8843df11d37a8f392 | 1,381 | py | Python | rplugin/python3/defx/column/size.py | sahwar/defx.nvim | bdd4896617f91800932ba2aaa4b2d019ae75ef1c | [
"MIT"
] | 1 | 2019-04-14T20:18:26.000Z | 2019-04-14T20:18:26.000Z | rplugin/python3/defx/column/size.py | sahwar/defx.nvim | bdd4896617f91800932ba2aaa4b2d019ae75ef1c | [
"MIT"
] | null | null | null | rplugin/python3/defx/column/size.py | sahwar/defx.nvim | bdd4896617f91800932ba2aaa4b2d019ae75ef1c | [
"MIT"
] | null | null | null | # ============================================================================
# FILE: size.py
# AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
# License: MIT license
# ============================================================================
from defx.base.column import Base
from defx.context import Context... | 30.021739 | 78 | 0.5105 |
from defx.base.column import Base
from defx.context import Context
from defx.util import Nvim, readable
import typing
class Column(Base):
def __init__(self, vim: Nvim) -> None:
super().__init__(vim)
self.name = 'size'
def get(self, context: Context,
candidate: typing.Dict[str,... | true | true |
1c2c0c1f0313760161119e12ed53273a0b730353 | 7,463 | py | Python | turtlefy/resources.py | nprutan/turtlefy | 45ff9b592047607d04142f34fe30d0987c5052c5 | [
"MIT"
] | 1 | 2022-03-27T03:44:10.000Z | 2022-03-27T03:44:10.000Z | turtlefy/resources.py | nprutan/turtlefy | 45ff9b592047607d04142f34fe30d0987c5052c5 | [
"MIT"
] | null | null | null | turtlefy/resources.py | nprutan/turtlefy | 45ff9b592047607d04142f34fe30d0987c5052c5 | [
"MIT"
] | null | null | null |
def extract_tags(tags):
return [tag.strip().lower() for tag in tags.split(',')]
def append_tags(tags, new_tag):
if tags:
split_tags = tags.split(',')
split_tags.append(f' {new_tag}')
return ','.join(split_tags)
return new_tag
def tag_resource(client, resource, new_tag, resource_... | 30.711934 | 107 | 0.627228 |
def extract_tags(tags):
return [tag.strip().lower() for tag in tags.split(',')]
def append_tags(tags, new_tag):
if tags:
split_tags = tags.split(',')
split_tags.append(f' {new_tag}')
return ','.join(split_tags)
return new_tag
def tag_resource(client, resource, new_tag, resource_... | true | true |
1c2c0c2698e23924b849d04cd00c551d44130204 | 31,748 | py | Python | Lib/test/test_warnings.py | akruis/stackless_historic | f8af5dd49558f0ef046cf99dc5d34db2b9a90ce2 | [
"PSF-2.0"
] | 1 | 2019-05-14T05:05:42.000Z | 2019-05-14T05:05:42.000Z | Lib/test/test_warnings.py | akruis/stackless_historic | f8af5dd49558f0ef046cf99dc5d34db2b9a90ce2 | [
"PSF-2.0"
] | null | null | null | Lib/test/test_warnings.py | akruis/stackless_historic | f8af5dd49558f0ef046cf99dc5d34db2b9a90ce2 | [
"PSF-2.0"
] | 2 | 2018-07-15T06:35:21.000Z | 2019-05-14T05:05:31.000Z | from contextlib import contextmanager
import linecache
import os
import StringIO
import sys
import unittest
import subprocess
from test import test_support
from test.script_helper import assert_python_ok
import warning_tests
import warnings as original_warnings
py_warnings = test_support.import_fresh_module('warning... | 42.330667 | 81 | 0.602085 | from contextlib import contextmanager
import linecache
import os
import StringIO
import sys
import unittest
import subprocess
from test import test_support
from test.script_helper import assert_python_ok
import warning_tests
import warnings as original_warnings
py_warnings = test_support.import_fresh_module('warning... | true | true |
1c2c0c82cb420667a554255138ca41a2122bf774 | 1,187 | py | Python | tests/conda_env/utils/test_uploader.py | richmoore1962/conda | ef36713bfeca5b9a8505ff8ae6d7899c2d7c6306 | [
"BSD-3-Clause"
] | 107 | 2015-01-31T18:25:22.000Z | 2021-06-12T16:33:26.000Z | tests/conda_env/utils/test_uploader.py | richmoore1962/conda | ef36713bfeca5b9a8505ff8ae6d7899c2d7c6306 | [
"BSD-3-Clause"
] | 213 | 2015-01-06T17:47:59.000Z | 2017-06-02T11:54:22.000Z | tests/conda_env/utils/test_uploader.py | richmoore1962/conda | ef36713bfeca5b9a8505ff8ae6d7899c2d7c6306 | [
"BSD-3-Clause"
] | 62 | 2015-01-06T15:47:56.000Z | 2021-08-23T05:42:17.000Z | import unittest
try:
from unittest import mock
except ImportError:
import mock
from binstar_client import errors
from conda_env.utils.uploader import Uploader
class UploaderTestCase(unittest.TestCase):
def test_unauthorized(self):
uploader = Uploader('package', 'filename')
with mock.patch.... | 39.566667 | 90 | 0.68829 | import unittest
try:
from unittest import mock
except ImportError:
import mock
from binstar_client import errors
from conda_env.utils.uploader import Uploader
class UploaderTestCase(unittest.TestCase):
def test_unauthorized(self):
uploader = Uploader('package', 'filename')
with mock.patch.... | true | true |
1c2c0ca790fb83c200c37f1ebec40b4841886f8a | 2,477 | py | Python | pyrosm/boundary.py | geoDavey/pyrosm | 9b28714680e93c1f12cf2dc457fbc7d0db1f2798 | [
"MIT"
] | null | null | null | pyrosm/boundary.py | geoDavey/pyrosm | 9b28714680e93c1f12cf2dc457fbc7d0db1f2798 | [
"MIT"
] | null | null | null | pyrosm/boundary.py | geoDavey/pyrosm | 9b28714680e93c1f12cf2dc457fbc7d0db1f2798 | [
"MIT"
] | null | null | null | from pyrosm.data_manager import get_osm_data
from pyrosm.frames import prepare_geodataframe
from pyrosm.utils import validate_custom_filter
import geopandas as gpd
import warnings
def get_boundary_data(node_coordinates, way_records, relations,
tags_as_columns, custom_filter,
... | 39.951613 | 89 | 0.557529 | from pyrosm.data_manager import get_osm_data
from pyrosm.frames import prepare_geodataframe
from pyrosm.utils import validate_custom_filter
import geopandas as gpd
import warnings
def get_boundary_data(node_coordinates, way_records, relations,
tags_as_columns, custom_filter,
... | true | true |
1c2c0d85d4fc5bb563185b72458addcfa70657d8 | 143 | py | Python | xv_leak_tools/test_components/vpn_application/mobile_vpn_application.py | UAEKondaya1/expressvpn_leak_testing | 9e4cee899ac04f7820ac351fa55efdc0c01370ba | [
"MIT"
] | 219 | 2017-12-12T09:42:46.000Z | 2022-03-13T08:25:13.000Z | xv_leak_tools/test_components/vpn_application/mobile_vpn_application.py | UAEKondaya1/expressvpn_leak_testing | 9e4cee899ac04f7820ac351fa55efdc0c01370ba | [
"MIT"
] | 11 | 2017-12-14T08:14:51.000Z | 2021-08-09T18:37:45.000Z | xv_leak_tools/test_components/vpn_application/mobile_vpn_application.py | UAEKondaya1/expressvpn_leak_testing | 9e4cee899ac04f7820ac351fa55efdc0c01370ba | [
"MIT"
] | 45 | 2017-12-14T07:26:36.000Z | 2022-03-11T09:36:56.000Z | from xv_leak_tools.test_components.vpn_application.vpn_application import VPNApplication
class MobileVPNApplication(VPNApplication):
pass
| 28.6 | 88 | 0.874126 | from xv_leak_tools.test_components.vpn_application.vpn_application import VPNApplication
class MobileVPNApplication(VPNApplication):
pass
| true | true |
1c2c0e2371d49e308a5a1275f651283e3e0a2f39 | 4,190 | py | Python | test/oauth_sig_check_test.py | rhargreaves/fastly-vcl-experiments | 1514ee06ed5848c4c3701b10a46035b5d2a89277 | [
"MIT"
] | 3 | 2016-03-08T09:21:09.000Z | 2016-04-13T21:20:00.000Z | test/oauth_sig_check_test.py | rhargreaves/fastly-vcl-experiments | 1514ee06ed5848c4c3701b10a46035b5d2a89277 | [
"MIT"
] | null | null | null | test/oauth_sig_check_test.py | rhargreaves/fastly-vcl-experiments | 1514ee06ed5848c4c3701b10a46035b5d2a89277 | [
"MIT"
] | null | null | null | import requests
import os
from requests_oauthlib import OAuth1
from oauthlib.oauth1 import SIGNATURE_TYPE_QUERY
from nose.tools import assert_equals, assert_regex
from freezegun import freeze_time
from datetime import datetime, timedelta
proxies = {
'http': 'http://nonssl.global.fastly.net:80'
}
service_host = os.... | 33.790323 | 70 | 0.670644 | import requests
import os
from requests_oauthlib import OAuth1
from oauthlib.oauth1 import SIGNATURE_TYPE_QUERY
from nose.tools import assert_equals, assert_regex
from freezegun import freeze_time
from datetime import datetime, timedelta
proxies = {
'http': 'http://nonssl.global.fastly.net:80'
}
service_host = os.... | true | true |
1c2c0f6de6cac6a96bebc2635b3a7d347d09f9f8 | 2,026 | py | Python | tests/interplanetary_test.py | tomaszmrugalski/astro | c4d270a8d7830fcf799c2cbafe7f7b2070072cc9 | [
"MIT"
] | null | null | null | tests/interplanetary_test.py | tomaszmrugalski/astro | c4d270a8d7830fcf799c2cbafe7f7b2070072cc9 | [
"MIT"
] | null | null | null | tests/interplanetary_test.py | tomaszmrugalski/astro | c4d270a8d7830fcf799c2cbafe7f7b2070072cc9 | [
"MIT"
] | null | null | null | from astropy import units as u
from perylune import interplanetary
from perylune.orbit_tools import *
from poliastro.twobody import Orbit
from poliastro.bodies import Earth, Sun
import numpy as np
from test_tools import *
def test_escape_velocity():
# TEST CASE 1:
# This is circular orbit, the escape veloci... | 34.931034 | 107 | 0.619941 | from astropy import units as u
from perylune import interplanetary
from perylune.orbit_tools import *
from poliastro.twobody import Orbit
from poliastro.bodies import Earth, Sun
import numpy as np
from test_tools import *
def test_escape_velocity():
o1 = Orbit.circular(Earth, 0*u.km)
v,vp,va = i... | true | true |
1c2c100c56a532209cbf6ee9cbafb965b65a8d85 | 9,978 | py | Python | rcnn/fio/rpn.py | truetqy/lesion_det_dual_att | 5a5a77dd7f3aa195a2f5b84169822eb32c396d65 | [
"Apache-2.0"
] | 1 | 2020-02-25T02:25:44.000Z | 2020-02-25T02:25:44.000Z | rcnn/fio/rpn.py | truetqy/lesion_det_dual_att | 5a5a77dd7f3aa195a2f5b84169822eb32c396d65 | [
"Apache-2.0"
] | null | null | null | rcnn/fio/rpn.py | truetqy/lesion_det_dual_att | 5a5a77dd7f3aa195a2f5b84169822eb32c396d65 | [
"Apache-2.0"
] | 1 | 2020-06-16T03:07:35.000Z | 2020-06-16T03:07:35.000Z | """
RPN:
data =
{'data': [num_images, c, h, w],
'im_info': [num_images, 4] (optional)}
label =
{'gt_boxes': [num_boxes, 5] (optional),
'label': [batch_size, 1] <- [batch_size, num_anchors, feat_height, feat_width],
'bbox_target': [batch_size, num_anchors, feat_height, feat_width],
'... | 43.008621 | 105 | 0.620265 |
import logging
import numpy as np
import numpy.random as npr
from ..logger import logger
from ..config import config
from .image import get_image, tensor_vstack
from ..processing.generate_anchor import generate_anchors
from ..processing.bbox_transform import bbox_overlaps, bbox_transform
def get_rpn_tes... | true | true |
1c2c102002b7e18f4787617786c66338410a3d69 | 329 | py | Python | video_behavior_tracking/__init__.py | droumis/video_behavior_tracking | 98b031a4a8dda1c0112f823b661ebad2feeaa43e | [
"MIT"
] | 1 | 2018-10-01T23:33:44.000Z | 2018-10-01T23:33:44.000Z | video_behavior_tracking/__init__.py | droumis/video_behavior_tracking | 98b031a4a8dda1c0112f823b661ebad2feeaa43e | [
"MIT"
] | 1 | 2020-01-07T01:55:30.000Z | 2020-01-07T01:55:30.000Z | video_behavior_tracking/__init__.py | droumis/video_behavior_tracking | 98b031a4a8dda1c0112f823b661ebad2feeaa43e | [
"MIT"
] | 2 | 2018-11-15T00:14:35.000Z | 2020-11-16T07:50:09.000Z | # flake8: noqa
from .kalman import extract_position_data
from .labeled_video import make_video
from .LED_detection import detect_LEDs
from .utils import (adjust_time, convert_to_loren_frank_data_format,
position_dataframe, save_loren_frank_data,
video_filename_to_epoch_key, write... | 41.125 | 68 | 0.765957 | from .kalman import extract_position_data
from .labeled_video import make_video
from .LED_detection import detect_LEDs
from .utils import (adjust_time, convert_to_loren_frank_data_format,
position_dataframe, save_loren_frank_data,
video_filename_to_epoch_key, write_config)
| true | true |
1c2c109217c571684466b1b495a7f7640861afc1 | 12,450 | py | Python | src/sage/combinat/integer_vector_weighted.py | UCD4IDS/sage | 43474c96d533fd396fe29fe0782d44dc7f5164f7 | [
"BSL-1.0"
] | 1,742 | 2015-01-04T07:06:13.000Z | 2022-03-30T11:32:52.000Z | src/sage/combinat/integer_vector_weighted.py | UCD4IDS/sage | 43474c96d533fd396fe29fe0782d44dc7f5164f7 | [
"BSL-1.0"
] | 66 | 2015-03-19T19:17:24.000Z | 2022-03-16T11:59:30.000Z | src/sage/combinat/integer_vector_weighted.py | UCD4IDS/sage | 43474c96d533fd396fe29fe0782d44dc7f5164f7 | [
"BSL-1.0"
] | 495 | 2015-01-10T10:23:18.000Z | 2022-03-24T22:06:11.000Z | """
Weighted Integer Vectors
AUTHORS:
- Mike Hansen (2007): initial version, ported from MuPAD-Combinat
- Nicolas M. Thiery (2010-10-30): WeightedIntegerVectors(weights) + cleanup
"""
# ****************************************************************************
# Copyright (C) 2007 Mike Hansen <mhansen@gmail.com>
#... | 30.970149 | 125 | 0.521446 |
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.parent import Parent
from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets
from sage.categories.infinite_enumerated_sets import InfiniteEnumeratedSets
from sage.categories.sets_with_grading import SetsWithGradin... | true | true |
1c2c10e98592060422a387974b993eddbea876b7 | 665 | py | Python | appSchool/migrations/0002_auto_20190510_1914.py | NandyAkash/Sma | 60b247d7b213516b94347626d09a8f329a70aa90 | [
"MIT"
] | null | null | null | appSchool/migrations/0002_auto_20190510_1914.py | NandyAkash/Sma | 60b247d7b213516b94347626d09a8f329a70aa90 | [
"MIT"
] | null | null | null | appSchool/migrations/0002_auto_20190510_1914.py | NandyAkash/Sma | 60b247d7b213516b94347626d09a8f329a70aa90 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.13 on 2019-05-10 13:14
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('appSchool', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='user',
name='groups',
),
... | 20.78125 | 48 | 0.512782 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('appSchool', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='user',
name='groups',
),
migrations.RemoveField(
model_name='u... | true | true |
1c2c12a5417aed49530556a1a522d4f26674df6b | 2,137 | py | Python | pyshadowsocks/protocol/socks5ssl/__init__.py | FTwOoO/pyShadowsocks | 452323e30c4b97d322cbb67e9bbc7c4549e67b5f | [
"MIT"
] | 21 | 2016-08-01T06:48:01.000Z | 2021-04-05T18:20:53.000Z | pyshadowsocks/protocol/socks5ssl/__init__.py | zen-of-proxy/pyShadowsocks | 452323e30c4b97d322cbb67e9bbc7c4549e67b5f | [
"MIT"
] | 2 | 2016-07-23T02:33:17.000Z | 2018-03-13T09:50:02.000Z | pyshadowsocks/protocol/socks5ssl/__init__.py | FTwOoO/pyShadowsocks | 452323e30c4b97d322cbb67e9bbc7c4549e67b5f | [
"MIT"
] | 7 | 2017-04-22T16:53:53.000Z | 2021-02-08T06:33:05.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: booopooob@gmail.com
#
import os.path
import ssl
import subprocess
import settings
def create_self_signed_certs():
settings.SSL_PUBLIC_FILE = os.path.abspath(settings.SSL_PUBLIC_FILE)
settings.SSL_RPIVATE_FILE = os.path.abspath(settings.SSL_RPIVATE_... | 38.160714 | 108 | 0.652316 |
import os.path
import ssl
import subprocess
import settings
def create_self_signed_certs():
settings.SSL_PUBLIC_FILE = os.path.abspath(settings.SSL_PUBLIC_FILE)
settings.SSL_RPIVATE_FILE = os.path.abspath(settings.SSL_RPIVATE_FILE)
if not os.path.exists(settings.SSL_PUBLIC_FILE):
os.makedirs(o... | true | true |
1c2c136b8fdad5a79ae05ac836de38ea9dbace3f | 3,773 | py | Python | gcloud/contrib/function/models.py | gangh/bk-sops | 29f4b4915be42650c2eeee637e0cf798e4066f09 | [
"Apache-2.0"
] | 1 | 2019-12-23T07:23:35.000Z | 2019-12-23T07:23:35.000Z | gcloud/contrib/function/models.py | bk-sops/bk-sops | 9f5950b13473bf7b5032528b20016b7a571bb3cd | [
"Apache-2.0"
] | 9 | 2020-02-12T03:15:49.000Z | 2021-06-10T22:04:51.000Z | gcloud/contrib/function/models.py | bk-sops/bk-sops | 9f5950b13473bf7b5032528b20016b7a571bb3cd | [
"Apache-2.0"
] | 1 | 2022-01-17T11:32:05.000Z | 2022-01-17T11:32:05.000Z | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2019 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 39.715789 | 115 | 0.675855 |
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from gcloud.core.utils import convert_readable_username
from gcloud.taskflow3.models import TaskFlowInstance
FUNCTION_TASK_STATUS = [
('submitted', _(u"未认领")),
('claimed', _(u"已认领")),
(... | true | true |
1c2c15280a79e91e39d4330bed21a7be832e710f | 1,175 | py | Python | migrations/versions/cb9983b1a2b6_init.py | fengyc/flasky | 49b822f7f8f1f8ec53007d4cc2467e4744fb213a | [
"MIT"
] | null | null | null | migrations/versions/cb9983b1a2b6_init.py | fengyc/flasky | 49b822f7f8f1f8ec53007d4cc2467e4744fb213a | [
"MIT"
] | null | null | null | migrations/versions/cb9983b1a2b6_init.py | fengyc/flasky | 49b822f7f8f1f8ec53007d4cc2467e4744fb213a | [
"MIT"
] | null | null | null | """'init'
Revision ID: cb9983b1a2b6
Revises: None
Create Date: 2016-01-28 21:20:28.690752
"""
# revision identifiers, used by Alembic.
revision = 'cb9983b1a2b6'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###
op... | 27.97619 | 82 | 0.666383 |
revision = 'cb9983b1a2b6'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table('roles',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('name', sa.String(length=64), nullable=True),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('nam... | true | true |
1c2c1604189928c066ede2845d4f2e385835cce4 | 848 | py | Python | utils/config.py | Steve-Tod/3D_generation | 75817f91f4a69da06375b4401d4182e932102cd1 | [
"Apache-2.0"
] | null | null | null | utils/config.py | Steve-Tod/3D_generation | 75817f91f4a69da06375b4401d4182e932102cd1 | [
"Apache-2.0"
] | null | null | null | utils/config.py | Steve-Tod/3D_generation | 75817f91f4a69da06375b4401d4182e932102cd1 | [
"Apache-2.0"
] | 1 | 2019-07-24T03:35:27.000Z | 2019-07-24T03:35:27.000Z | import json
from bunch import Bunch
import os
def get_config_from_json(json_file):
"""
Get the config from a json file
:param json_file:
:return: config(namespace) or config(dictionary)
"""
# parse the configurations from the config json file provided
with open(json_file, 'r') as config_fi... | 29.241379 | 75 | 0.646226 | import json
from bunch import Bunch
import os
def get_config_from_json(json_file):
with open(json_file, 'r') as config_file:
config_dict = json.load(config_file)
config = Bunch(config_dict)
return config, config_dict
def process_config(json_file):
config, _ = get_config_from_json(j... | true | true |
1c2c1614938ba23c6d186eff22a13e0ea526a734 | 495 | py | Python | plugins/whois/setup.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 46 | 2019-06-05T20:47:58.000Z | 2022-03-29T10:18:01.000Z | plugins/whois/setup.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 386 | 2019-06-07T20:20:39.000Z | 2022-03-30T17:35:01.000Z | plugins/whois/setup.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 43 | 2019-07-09T14:13:58.000Z | 2022-03-28T12:04:46.000Z | # GENERATED BY KOMAND SDK - DO NOT EDIT
from setuptools import setup, find_packages
setup(name="whois-rapid7-plugin",
version="3.0.3",
description="The WHOIS plugin enables address and domain lookups in the WHOIS databases",
author="rapid7",
author_email="",
url="",
packages=find_p... | 33 | 120 | 0.684848 | from setuptools import setup, find_packages
setup(name="whois-rapid7-plugin",
version="3.0.3",
description="The WHOIS plugin enables address and domain lookups in the WHOIS databases",
author="rapid7",
author_email="",
url="",
packages=find_packages(),
install_requires=['insi... | true | true |
1c2c1691915643a8ab197499b02cd41d77a3f200 | 29,880 | py | Python | tests/trainer/test_trainer.py | binshengliu/pytorch-lightning | 8f6b7a2b4fea9b7bd0b873f5973e6364b3981412 | [
"Apache-2.0"
] | null | null | null | tests/trainer/test_trainer.py | binshengliu/pytorch-lightning | 8f6b7a2b4fea9b7bd0b873f5973e6364b3981412 | [
"Apache-2.0"
] | null | null | null | tests/trainer/test_trainer.py | binshengliu/pytorch-lightning | 8f6b7a2b4fea9b7bd0b873f5973e6364b3981412 | [
"Apache-2.0"
] | 1 | 2021-03-05T20:59:47.000Z | 2021-03-05T20:59:47.000Z | import glob
import math
import os
import types
from argparse import Namespace
import pytest
import torch
import yaml
import tests.base.utils as tutils
from pytorch_lightning import Callback, LightningModule
from pytorch_lightning import Trainer
from pytorch_lightning.callbacks import EarlyStopping, ModelCheckpoint
fr... | 35.111633 | 118 | 0.683969 | import glob
import math
import os
import types
from argparse import Namespace
import pytest
import torch
import yaml
import tests.base.utils as tutils
from pytorch_lightning import Callback, LightningModule
from pytorch_lightning import Trainer
from pytorch_lightning.callbacks import EarlyStopping, ModelCheckpoint
fr... | true | true |
1c2c16caae55b75e2804f678b6f990b595ff904d | 8,503 | py | Python | awips/test/dafTests/testGfeEditArea.py | mjames-upc/python-awips | e2b05f5587b02761df3b6dd5c6ee1f196bd5f11c | [
"BSD-3-Clause"
] | null | null | null | awips/test/dafTests/testGfeEditArea.py | mjames-upc/python-awips | e2b05f5587b02761df3b6dd5c6ee1f196bd5f11c | [
"BSD-3-Clause"
] | null | null | null | awips/test/dafTests/testGfeEditArea.py | mjames-upc/python-awips | e2b05f5587b02761df3b6dd5c6ee1f196bd5f11c | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
from awips.dataaccess import DataAccessLayer as DAL
from awips.ThriftClient import ThriftRequestException
from awips.test.dafTests import baseDafTestCase
from awips.test.dafTests impor... | 42.303483 | 104 | 0.698342 | from __future__ import print_function
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
from awips.dataaccess import DataAccessLayer as DAL
from awips.ThriftClient import ThriftRequestException
from awips.test.dafTests import baseDafTestCase
from awips.test.dafTests impor... | true | true |
1c2c16d48b9a5ebedf2c92de374e40386c398822 | 6,268 | py | Python | core/ook_lib.py | zdx198811/lab604-automation | f73acdce38422d9c3a0845a553efa4eebc662086 | [
"MIT"
] | 1 | 2020-10-30T15:22:20.000Z | 2020-10-30T15:22:20.000Z | core/ook_lib.py | zdx198811/lab604-automation | f73acdce38422d9c3a0845a553efa4eebc662086 | [
"MIT"
] | null | null | null | core/ook_lib.py | zdx198811/lab604-automation | f73acdce38422d9c3a0845a553efa4eebc662086 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Jul 2 15:16:16 2018
@author: dongxucz
"""
import numpy as np
import csv as csvlib
from locale import atoi
from os.path import exists
# from torch.utils.data import Dataset
class OOK_signal:
"""Create (randomly generate|load from file) or save an OOK signal.
NOT... | 40.701299 | 130 | 0.57275 |
import numpy as np
import csv as csvlib
from locale import atoi
from os.path import exists
class OOK_signal:
def __init__(self, data_len = 0, data_ref=[], load_file = ''):
if (load_file!=''): if exists(load_file):
if (load_file[-3:]!='csv'):
raise ValueError... | true | true |
1c2c17960aa80e454059311a01f72e7d705ed67e | 279,211 | py | Python | tensorflow/contrib/metrics/python/ops/metric_ops_test.py | AudioStreamTV/tensorflow | 7277ed8ed2da84b227295216632dec52a81f63b3 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/metrics/python/ops/metric_ops_test.py | AudioStreamTV/tensorflow | 7277ed8ed2da84b227295216632dec52a81f63b3 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/metrics/python/ops/metric_ops_test.py | AudioStreamTV/tensorflow | 7277ed8ed2da84b227295216632dec52a81f63b3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38.709414 | 85 | 0.64169 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import numpy as np
from six.moves import xrange from tensorflow.contrib import metrics as metrics_lib
from tensorflow.contrib.metrics.python.ops import metric_ops
from tensorflow.python.framework... | true | true |
1c2c17ca3ae40240b1b72a93c6615a29cbb7031c | 2,982 | py | Python | faasmcli/faasmcli/tasks/codegen.py | BieVic/faasm | 90081b3c9596a0f5bfe576725199ad1ef0242f12 | [
"Apache-2.0"
] | 254 | 2018-10-12T10:09:43.000Z | 2020-06-02T17:42:04.000Z | faasmcli/faasmcli/tasks/codegen.py | BieVic/faasm | 90081b3c9596a0f5bfe576725199ad1ef0242f12 | [
"Apache-2.0"
] | 49 | 2019-11-18T17:33:01.000Z | 2020-05-23T13:15:23.000Z | faasmcli/faasmcli/tasks/codegen.py | BieVic/faasm | 90081b3c9596a0f5bfe576725199ad1ef0242f12 | [
"Apache-2.0"
] | 22 | 2019-11-05T15:01:54.000Z | 2020-06-02T17:42:05.000Z | from subprocess import run
from invoke import task
from copy import copy
from os import environ
from os.path import join
from faasmcli.util.codegen import find_codegen_func, find_codegen_shared_lib
from faasmcli.util.env import FAASM_RUNTIME_ROOT
LIB_FAKE_FILES = [
join(FAASM_RUNTIME_ROOT, "lib", "fake", "libfak... | 22.421053 | 76 | 0.595909 | from subprocess import run
from invoke import task
from copy import copy
from os import environ
from os.path import join
from faasmcli.util.codegen import find_codegen_func, find_codegen_shared_lib
from faasmcli.util.env import FAASM_RUNTIME_ROOT
LIB_FAKE_FILES = [
join(FAASM_RUNTIME_ROOT, "lib", "fake", "libfak... | true | true |
1c2c181ecf11238b04a9e12154632e2445d0eb4d | 3,448 | py | Python | testsuite/data/scores/score_api/score_api.py | ICONationDevTeam/goloop | 45241c021e7ba56408b8cc9a1440c965bef28411 | [
"Apache-2.0"
] | 47 | 2020-09-11T01:40:37.000Z | 2022-03-29T02:41:17.000Z | testsuite/data/scores/score_api/score_api.py | pranav925/goloop | 19f19e6ba6ccb25f464ae0cc31b76a9b30a13f0f | [
"Apache-2.0"
] | 41 | 2020-09-11T01:33:13.000Z | 2022-03-22T11:21:53.000Z | testsuite/data/scores/score_api/score_api.py | pranav925/goloop | 19f19e6ba6ccb25f464ae0cc31b76a9b30a13f0f | [
"Apache-2.0"
] | 24 | 2020-09-22T08:23:38.000Z | 2022-03-19T11:14:10.000Z | from iconservice import *
TAG = 'ScoreApi'
class Person(TypedDict):
name: str
age: int
class ScoreApi(IconScoreBase):
def __init__(self, db: IconScoreDatabase) -> None:
super().__init__(db)
def on_install(self) -> None:
super().on_install()
def on_update(self) -> None:
... | 27.806452 | 85 | 0.603538 | from iconservice import *
TAG = 'ScoreApi'
class Person(TypedDict):
name: str
age: int
class ScoreApi(IconScoreBase):
def __init__(self, db: IconScoreDatabase) -> None:
super().__init__(db)
def on_install(self) -> None:
super().on_install()
def on_update(self) -> None:
... | true | true |
1c2c18773aad320c335162241a9041be30c4ee83 | 9,337 | bzl | Python | rules/framework/vfs_overlay.bzl | cdoky/rules_ios | 35c3cbb69a86a0f607b21bd5c65cabcfa3e12666 | [
"Apache-2.0"
] | null | null | null | rules/framework/vfs_overlay.bzl | cdoky/rules_ios | 35c3cbb69a86a0f607b21bd5c65cabcfa3e12666 | [
"Apache-2.0"
] | null | null | null | rules/framework/vfs_overlay.bzl | cdoky/rules_ios | 35c3cbb69a86a0f607b21bd5c65cabcfa3e12666 | [
"Apache-2.0"
] | null | null | null | load("//rules:providers.bzl", "FrameworkInfo")
load("//rules:features.bzl", "feature_names")
FRAMEWORK_SEARCH_PATH = "/build_bazel_rules_ios/frameworks"
VFSOverlayInfo = provider(
doc = "Propagates vfs overlays",
fields = {
"files": "depset with overlays",
"vfs_info": "intneral obj",
},
)
... | 33.46595 | 147 | 0.633501 | load("//rules:providers.bzl", "FrameworkInfo")
load("//rules:features.bzl", "feature_names")
FRAMEWORK_SEARCH_PATH = "/build_bazel_rules_ios/frameworks"
VFSOverlayInfo = provider(
doc = "Propagates vfs overlays",
fields = {
"files": "depset with overlays",
"vfs_info": "intneral obj",
},
)
... | true | true |
1c2c19476fea3bdf4fb4b6553a526732eba38284 | 6,035 | py | Python | sdks/python/http_client/v1/polyaxon_sdk/models/v1_list_dashboards_response.py | admariner/polyaxon | ba355c38166047eb11e60de4cee4d7c3b48db323 | [
"Apache-2.0"
] | null | null | null | sdks/python/http_client/v1/polyaxon_sdk/models/v1_list_dashboards_response.py | admariner/polyaxon | ba355c38166047eb11e60de4cee4d7c3b48db323 | [
"Apache-2.0"
] | null | null | null | sdks/python/http_client/v1/polyaxon_sdk/models/v1_list_dashboards_response.py | admariner/polyaxon | ba355c38166047eb11e60de4cee4d7c3b48db323 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 27.939815 | 120 | 0.600663 |
import pprint
import re
import six
from polyaxon_sdk.configuration import Configuration
class V1ListDashboardsResponse(object):
openapi_types = {
'count': 'int',
'results': 'list[V1Dashboard]',
'previous': 'str',
'next': 'str'
}
attribute_map = {
'count': '... | true | true |
1c2c19a12b87b250f7609372d69771a1c72c1620 | 4,740 | py | Python | app/users/migrations/0001_initial.py | chriskmamo/greenvoice | 11306e939612907da21f89350b4446e47081e695 | [
"MIT"
] | null | null | null | app/users/migrations/0001_initial.py | chriskmamo/greenvoice | 11306e939612907da21f89350b4446e47081e695 | [
"MIT"
] | 2 | 2022-02-13T20:16:39.000Z | 2022-02-19T06:27:31.000Z | app/users/migrations/0001_initial.py | chriskmamo/greenvoice | 11306e939612907da21f89350b4446e47081e695 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.10 on 2020-10-10 11:16
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
... | 60 | 266 | 0.621941 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.Crea... | true | true |
1c2c1a6931ccebf375a10d9ed09224fe6b4d6c2d | 8,204 | py | Python | hyperion/model/image.py | astrofrog/hyperion | e90d7af1df4f064a960594d812c07ff27d87fcc7 | [
"BSD-2-Clause"
] | 2 | 2015-05-14T17:26:16.000Z | 2019-03-13T17:33:18.000Z | hyperion/model/image.py | astrofrog/hyperion | e90d7af1df4f064a960594d812c07ff27d87fcc7 | [
"BSD-2-Clause"
] | null | null | null | hyperion/model/image.py | astrofrog/hyperion | e90d7af1df4f064a960594d812c07ff27d87fcc7 | [
"BSD-2-Clause"
] | null | null | null | import numpy as np
from ..util.functions import FreezableClass, is_numpy_array
from ..util.constants import c
class Image(FreezableClass):
"""
Class to represent an image or set of images
Parameters
----------
nu : ndarray
The frequencies at which the image is defined, in Hz
flux : n... | 29.3 | 179 | 0.574963 | import numpy as np
from ..util.functions import FreezableClass, is_numpy_array
from ..util.constants import c
class Image(FreezableClass):
def __init__(self, nu, flux=None, unc=None, units=None):
self.nu = nu
self.flux = flux
self.unc = unc
self.units = units
self.x_min... | true | true |
1c2c1bf41a6b57bdda5539eb2df9272b3e718ab5 | 3,276 | py | Python | setup.py | VincentRPS/hikari-views | b641dd6f02baee144daaa1b41f6337effa870325 | [
"MIT"
] | 1 | 2022-01-31T16:59:55.000Z | 2022-01-31T16:59:55.000Z | setup.py | VincentRPS/hikari-views | b641dd6f02baee144daaa1b41f6337effa870325 | [
"MIT"
] | null | null | null | setup.py | VincentRPS/hikari-views | b641dd6f02baee144daaa1b41f6337effa870325 | [
"MIT"
] | null | null | null | """
MIT License
Copyright (c) 2022-present HyperGH
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publis... | 34.851064 | 120 | 0.690171 |
import os
import re
import types
from setuptools import find_namespace_packages
from setuptools import setup
name = "miru"
def parse_meta():
with open(os.path.join(name, "__init__.py")) as fp:
code = fp.read()
token_pattern = re.compile(r"^__(?P<key>\w+)?__\s*=\s*(?P<quote>(?:'{3}|\"{3}|'|\"))(?P<... | true | true |
1c2c1c7b3896f407d171c284c7c03dfea1455844 | 58,209 | py | Python | lte/gateway/python/integ_tests/s1aptests/s1ap_utils.py | ashish-acl/magma | d938f420b56b867a7c64101e6fac63f50be58a46 | [
"BSD-3-Clause"
] | null | null | null | lte/gateway/python/integ_tests/s1aptests/s1ap_utils.py | ashish-acl/magma | d938f420b56b867a7c64101e6fac63f50be58a46 | [
"BSD-3-Clause"
] | null | null | null | lte/gateway/python/integ_tests/s1aptests/s1ap_utils.py | ashish-acl/magma | d938f420b56b867a7c64101e6fac63f50be58a46 | [
"BSD-3-Clause"
] | null | null | null | """
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... | 36.335206 | 125 | 0.530588 |
import ctypes
import ipaddress
import logging
import os
import shlex
import threading
import time
from enum import Enum
from queue import Queue
from typing import Optional
import grpc
import subprocess
import json
import s1ap_types
from integ_tests.gateway.rpc import get_rpc_channel
from lte.protos.policydb_pb2 impo... | true | true |
1c2c1d7890efc23e0bdea96dce3259aa992eba31 | 99,719 | py | Python | ai4water/preprocessing/datahandler.py | csiro-hydroinformatics/AI4Water | cdb18bd4bf298f77b381f1829045a1e790146985 | [
"MIT"
] | 12 | 2020-10-13T08:23:17.000Z | 2021-01-22T04:36:21.000Z | ai4water/preprocessing/datahandler.py | csiro-hydroinformatics/AI4Water | cdb18bd4bf298f77b381f1829045a1e790146985 | [
"MIT"
] | 1 | 2020-10-15T02:42:52.000Z | 2020-10-15T02:51:07.000Z | ai4water/preprocessing/datahandler.py | csiro-hydroinformatics/AI4Water | cdb18bd4bf298f77b381f1829045a1e790146985 | [
"MIT"
] | 2 | 2020-11-23T04:45:38.000Z | 2020-11-26T10:12:34.000Z | import os
import copy
import json
import warnings
from typing import Union, Tuple
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.patches import Patch
from sklearn.model_selection import train_test_split
from sklearn.model_selection import KFold, LeaveOneOut, TimeSeriesSplit
from... | 38.74087 | 153 | 0.556444 | import os
import copy
import json
import warnings
from typing import Union, Tuple
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.patches import Patch
from sklearn.model_selection import train_test_split
from sklearn.model_selection import KFold, LeaveOneOut, TimeSeriesSplit
from... | true | true |
1c2c1ecd58a4917781ee5a0596ac3eb30799d735 | 485 | py | Python | Python/SimplifyPathTest.py | TonnyL/Windary | 39f85cdedaaf5b85f7ce842ecef975301fc974cf | [
"MIT"
] | 205 | 2017-11-16T08:38:46.000Z | 2022-03-06T05:50:03.000Z | Python/SimplifyPathTest.py | santosh241/Windary | 39f85cdedaaf5b85f7ce842ecef975301fc974cf | [
"MIT"
] | 3 | 2018-04-10T10:17:52.000Z | 2020-12-11T08:00:09.000Z | Python/SimplifyPathTest.py | santosh241/Windary | 39f85cdedaaf5b85f7ce842ecef975301fc974cf | [
"MIT"
] | 28 | 2018-04-10T06:42:42.000Z | 2021-09-14T14:15:39.000Z | from unittest import TestCase
from SimplifyPath import SimplifyPath
class TestSimplifyPath(TestCase):
def test_simplifyPath(self):
sp = SimplifyPath()
self.assertEqual(sp.simplifyPath("/home/"), "/home")
self.assertEqual(sp.simplifyPath("/a/./b/../../c/"), "/c")
self.assertEqua... | 25.526316 | 68 | 0.626804 | from unittest import TestCase
from SimplifyPath import SimplifyPath
class TestSimplifyPath(TestCase):
def test_simplifyPath(self):
sp = SimplifyPath()
self.assertEqual(sp.simplifyPath("/home/"), "/home")
self.assertEqual(sp.simplifyPath("/a/./b/../../c/"), "/c")
self.assertEqua... | true | true |
1c2c1ece5a26cb6d3ac60df6a5881da49d274ee9 | 17,173 | py | Python | pytype/errors.py | JelleZijlstra/pytype | 962a0ebc05bd24dea172381b2bedcc547ba53dd5 | [
"Apache-2.0"
] | null | null | null | pytype/errors.py | JelleZijlstra/pytype | 962a0ebc05bd24dea172381b2bedcc547ba53dd5 | [
"Apache-2.0"
] | null | null | null | pytype/errors.py | JelleZijlstra/pytype | 962a0ebc05bd24dea172381b2bedcc547ba53dd5 | [
"Apache-2.0"
] | null | null | null | """Code and data structures for storing and displaying errors."""
import csv
import os
import re
import StringIO
import sys
from pytype import abstract
from pytype import utils
from pytype.pytd import pytd
from pytype.pytd import utils as pytd_utils
# "Error level" enum for distinguishing between warnings and erro... | 34.55332 | 80 | 0.667443 | """Code and data structures for storing and displaying errors."""
import csv
import os
import re
import StringIO
import sys
from pytype import abstract
from pytype import utils
from pytype.pytd import pytd
from pytype.pytd import utils as pytd_utils
SEVERITY_WARNING = 1
SEVERITY_ERROR = 2
_ERROR_NAMES = set()
_C... | false | true |
1c2c1ecff02208f628aa2e65eae53abaf0c94bd6 | 1,527 | py | Python | docs/conf.py | alexweav/nisystemlink-clients-python | f19a30907a7fef536043ecbddc5a755e5fedf846 | [
"MIT"
] | null | null | null | docs/conf.py | alexweav/nisystemlink-clients-python | f19a30907a7fef536043ecbddc5a755e5fedf846 | [
"MIT"
] | null | null | null | docs/conf.py | alexweav/nisystemlink-clients-python | f19a30907a7fef536043ecbddc5a755e5fedf846 | [
"MIT"
] | null | null | null | import os
import sys
sys.path.insert(0, os.path.abspath(".."))
# --------------------------------------------------------------------------------------
project = "nisystemlink"
copyright = "2020, National Instruments"
author = "National Instruments"
# The short X.Y version
version = "0.1"
# The full version, includ... | 26.789474 | 88 | 0.587426 | import os
import sys
sys.path.insert(0, os.path.abspath(".."))
project = "nisystemlink"
copyright = "2020, National Instruments"
author = "National Instruments"
version = "0.1"
release = "0.1.3"
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
"sphinx_autodoc_type... | true | true |
1c2c1edc237faeeb210a95b60ce48beaa5f33843 | 3,010 | py | Python | tests/nlu/classifiers/test_embedding_intent_classifier.py | anil-slt/Rasa | 53685e85a3c9185f51e4f12cc055d2a65bb5314d | [
"Apache-2.0"
] | 4 | 2020-04-17T17:08:59.000Z | 2021-07-21T16:25:00.000Z | tests/nlu/classifiers/test_embedding_intent_classifier.py | anil-slt/Rasa | 53685e85a3c9185f51e4f12cc055d2a65bb5314d | [
"Apache-2.0"
] | 5 | 2020-04-10T09:08:46.000Z | 2021-08-25T14:40:03.000Z | tests/nlu/classifiers/test_embedding_intent_classifier.py | anil-slt/Rasa | 53685e85a3c9185f51e4f12cc055d2a65bb5314d | [
"Apache-2.0"
] | 2 | 2020-11-04T04:03:30.000Z | 2021-01-27T04:41:42.000Z | import numpy as np
import pytest
import scipy.sparse
from rasa.nlu.constants import (
TEXT_ATTRIBUTE,
SPARSE_FEATURE_NAMES,
DENSE_FEATURE_NAMES,
INTENT_ATTRIBUTE,
)
from rasa.nlu.classifiers.embedding_intent_classifier import EmbeddingIntentClassifier
from rasa.nlu.training_data import Message
def te... | 28.130841 | 86 | 0.498671 | import numpy as np
import pytest
import scipy.sparse
from rasa.nlu.constants import (
TEXT_ATTRIBUTE,
SPARSE_FEATURE_NAMES,
DENSE_FEATURE_NAMES,
INTENT_ATTRIBUTE,
)
from rasa.nlu.classifiers.embedding_intent_classifier import EmbeddingIntentClassifier
from rasa.nlu.training_data import Message
def te... | true | true |
1c2c1f26c46eb966c4b21455bbacceee4e343723 | 3,179 | py | Python | eth/beacon/_utils/random.py | Bhargavasomu/py-evm | ee8f72d5a70805575a967cde0a43942e1526264e | [
"MIT"
] | null | null | null | eth/beacon/_utils/random.py | Bhargavasomu/py-evm | ee8f72d5a70805575a967cde0a43942e1526264e | [
"MIT"
] | null | null | null | eth/beacon/_utils/random.py | Bhargavasomu/py-evm | ee8f72d5a70805575a967cde0a43942e1526264e | [
"MIT"
] | 2 | 2019-09-05T01:31:56.000Z | 2019-09-17T09:09:16.000Z |
from typing import (
Any,
Iterable,
Sequence,
Tuple,
TypeVar,
)
from eth_typing import (
Hash32,
)
from eth_utils import (
to_tuple,
)
from eth.beacon._utils.hash import (
hash_eth2,
)
from eth.beacon.constants import (
RAND_BYTES,
RAND_MAX,
)
TItem = TypeVar('TItem')
@to_... | 32.111111 | 156 | 0.612142 |
from typing import (
Any,
Iterable,
Sequence,
Tuple,
TypeVar,
)
from eth_typing import (
Hash32,
)
from eth_utils import (
to_tuple,
)
from eth.beacon._utils.hash import (
hash_eth2,
)
from eth.beacon.constants import (
RAND_BYTES,
RAND_MAX,
)
TItem = TypeVar('TItem')
@to_... | true | true |
1c2c1fae3f0888772ce80d4a08476f303b3afbcd | 1,697 | py | Python | app/notifications/notifications_email_callback.py | davidbgk/notification-api | 0ede6a61b48289236d1873124965d2bc22a9b27b | [
"MIT"
] | 1 | 2021-08-13T13:46:04.000Z | 2021-08-13T13:46:04.000Z | app/notifications/notifications_email_callback.py | davidbgk/notification-api | 0ede6a61b48289236d1873124965d2bc22a9b27b | [
"MIT"
] | null | null | null | app/notifications/notifications_email_callback.py | davidbgk/notification-api | 0ede6a61b48289236d1873124965d2bc22a9b27b | [
"MIT"
] | 1 | 2021-09-29T18:25:48.000Z | 2021-09-29T18:25:48.000Z | from datetime import datetime
from flask import Blueprint
from flask import current_app
from flask import json
from flask import request, jsonify
from app.errors import InvalidRequest, register_errors
from app.clients.email.sendgrid_client import get_sendgrid_responses
from app import statsd_client
from app.dao impor... | 36.891304 | 112 | 0.728344 | from datetime import datetime
from flask import Blueprint
from flask import current_app
from flask import json
from flask import request, jsonify
from app.errors import InvalidRequest, register_errors
from app.clients.email.sendgrid_client import get_sendgrid_responses
from app import statsd_client
from app.dao impor... | true | true |
1c2c1fba38356b075ac9c9a513394587f74d6627 | 952 | py | Python | var/spack/repos/builtin/packages/r-remotes/package.py | carlabguillen/spack | 7070bb892f9bdb5cf9e76e0eecd64f6cc5f4695c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 9 | 2018-04-18T07:51:40.000Z | 2021-09-10T03:56:57.000Z | var/spack/repos/builtin/packages/r-remotes/package.py | carlabguillen/spack | 7070bb892f9bdb5cf9e76e0eecd64f6cc5f4695c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 907 | 2018-04-18T11:17:57.000Z | 2022-03-31T13:20:25.000Z | var/spack/repos/builtin/packages/r-remotes/package.py | carlabguillen/spack | 7070bb892f9bdb5cf9e76e0eecd64f6cc5f4695c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 29 | 2018-11-05T16:14:23.000Z | 2022-02-03T16:07:09.000Z | # Copyright 2013-2020 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 RRemotes(RPackage):
"""Download and install R packages stored in 'GitHub', 'BitBucket', or... | 41.391304 | 95 | 0.730042 |
from spack import *
class RRemotes(RPackage):
homepage = "https://github.com/r-lib/remotes#readme"
url = "https://cloud.r-project.org/src/contrib/remotes_2.1.0.tar.gz"
list_url = "https://cloud.r-project.org/src/contrib/Archive/remotes"
version('2.1.1', sha256='4e590746fce618094089372b185e1ea2... | true | true |
1c2c205102b642af21d582fa7a41363dad38b9ff | 3,851 | py | Python | tests/test_linalg/test_solvers/test_belief_updates/test_matrix_based/test_symmetric_matrix_based_linear_belief_update.py | NDOWAH/probnum | 91a5cf920fe0793d01f3d7dae4b3909c4a74d201 | [
"MIT"
] | 1 | 2021-06-22T14:25:43.000Z | 2021-06-22T14:25:43.000Z | tests/test_linalg/test_solvers/test_belief_updates/test_matrix_based/test_symmetric_matrix_based_linear_belief_update.py | pitmonticone/probnum | 1fed705b2443a14d08419e16f98f6ef815ae9ffa | [
"MIT"
] | 42 | 2021-03-08T07:20:40.000Z | 2022-03-28T05:04:48.000Z | tests/test_linalg/test_solvers/test_belief_updates/test_matrix_based/test_symmetric_matrix_based_linear_belief_update.py | pitmonticone/probnum | 1fed705b2443a14d08419e16f98f6ef815ae9ffa | [
"MIT"
] | null | null | null | """Tests for the symmetric matrix-based belief update for linear information."""
import pathlib
import numpy as np
import pytest
from pytest_cases import parametrize_with_cases
from probnum import linops, randvars
from probnum.linalg.solvers import LinearSolverState, belief_updates, beliefs
case_modules = (pathlib.... | 33.198276 | 93 | 0.719294 |
import pathlib
import numpy as np
import pytest
from pytest_cases import parametrize_with_cases
from probnum import linops, randvars
from probnum.linalg.solvers import LinearSolverState, belief_updates, beliefs
case_modules = (pathlib.Path(__file__).parent.parent / "cases").stem
cases_belief_updates = case_modules ... | true | true |
1c2c20ac8a769d65250428a6409c0ab27e840ff7 | 706 | py | Python | specs/default/cluster-init/tests/test_uid.py | hmeiland/cyclecloud-slurm | 2b5efb3dda92a8f58e4bc57f0b040eb5f77de30f | [
"MIT"
] | 1 | 2021-05-12T15:37:07.000Z | 2021-05-12T15:37:07.000Z | specs/default/cluster-init/tests/test_uid.py | hmeiland/cyclecloud-slurm | 2b5efb3dda92a8f58e4bc57f0b040eb5f77de30f | [
"MIT"
] | null | null | null | specs/default/cluster-init/tests/test_uid.py | hmeiland/cyclecloud-slurm | 2b5efb3dda92a8f58e4bc57f0b040eb5f77de30f | [
"MIT"
] | null | null | null | #!/opt/cycle/jetpack/system/embedded/bin/python -m pytest
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import subprocess
import jetpack.config
def test_slurm_uid():
suid = jetpack.config.get('slurm.user.uid').strip()
suser = jetpack.config.get('slurm.user.name'... | 37.157895 | 67 | 0.70255 | import subprocess
import jetpack.config
def test_slurm_uid():
suid = jetpack.config.get('slurm.user.uid').strip()
suser = jetpack.config.get('slurm.user.name').strip()
muid = jetpack.config.get('munge.user.uid').strip()
muser = jetpack.config.get('munge.user.name').strip()
subprocess.check_ca... | true | true |
1c2c20b962b505f8179a00c3b2d9fa46fae9ef17 | 7,819 | py | Python | wrfpy/utils.py | rvanharen/wrfpy | caa1159326abcc59e5e25921f5de72a274962275 | [
"Apache-2.0"
] | 11 | 2018-01-06T22:20:04.000Z | 2022-03-10T15:26:21.000Z | wrfpy/utils.py | ERA-URBAN/wrfpy | caa1159326abcc59e5e25921f5de72a274962275 | [
"Apache-2.0"
] | 14 | 2017-04-11T13:11:38.000Z | 2021-03-19T22:49:42.000Z | wrfpy/utils.py | rvanharen/wrfpy | caa1159326abcc59e5e25921f5de72a274962275 | [
"Apache-2.0"
] | 5 | 2017-06-13T12:17:54.000Z | 2021-09-26T02:44:52.000Z | #!/usr/bin/env python3
'''
description: Utilities used in wrfpy
license: APACHE 2.0
author: Ronald van Haren, NLeSC (r.vanharen@esciencecenter.nl)
'''
import logging
import sys
import os
# define global LOG variables
DEFAULT_LOG_LEVEL = 'debug'
LOG_LEVELS = {'debug': logging.DEBUG,
'i... | 28.959259 | 79 | 0.62783 |
import logging
import sys
import os
DEFAULT_LOG_LEVEL = 'debug'
LOG_LEVELS = {'debug': logging.DEBUG,
'info': logging.INFO,
'warning': logging.WARNING,
'error': logging.ERROR,
'critical': logging.CRITICAL}
LOG_LEVELS_LIST = LOG_LEVELS.keys()
LOG_FORMAT = '%(asc... | true | true |
1c2c21bf1d1f3f2b5b0226a69d6c7dc8f0d87e0a | 15,249 | py | Python | src/python/twitter/pants/binary_util.py | wfarner/commons | 42988a7a49f012665174538cca53604c7846ee86 | [
"Apache-2.0"
] | 1 | 2019-12-20T14:13:27.000Z | 2019-12-20T14:13:27.000Z | src/python/twitter/pants/binary_util.py | wfarner/commons | 42988a7a49f012665174538cca53604c7846ee86 | [
"Apache-2.0"
] | null | null | null | src/python/twitter/pants/binary_util.py | wfarner/commons | 42988a7a49f012665174538cca53604c7846ee86 | [
"Apache-2.0"
] | 1 | 2019-12-20T14:13:29.000Z | 2019-12-20T14:13:29.000Z | # ==================================================================================================
# Copyright 2011 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | 37.651852 | 100 | 0.66365 |
from __future__ import division, print_function
import os
import errno
import itertools
import posixpath
import subprocess
from contextlib import closing, contextmanager
from twitter.common import log
from twitter.common.contextutil import environment_as, temporary_file, temporary_dir
from twitter.common.dirutil im... | true | true |
1c2c2271471e2c0763c1446eef497c2efa5dc733 | 1,885 | py | Python | discrete_fuzzy_operators/base/operators/binary_operators/suboperators/fuzzy_aggregation_suboperators/nullnorm.py | mmunar97/discrete-fuzzy-operators | e97646faa82a732b7d24c2e6621704b981b80b60 | [
"MIT"
] | null | null | null | discrete_fuzzy_operators/base/operators/binary_operators/suboperators/fuzzy_aggregation_suboperators/nullnorm.py | mmunar97/discrete-fuzzy-operators | e97646faa82a732b7d24c2e6621704b981b80b60 | [
"MIT"
] | null | null | null | discrete_fuzzy_operators/base/operators/binary_operators/suboperators/fuzzy_aggregation_suboperators/nullnorm.py | mmunar97/discrete-fuzzy-operators | e97646faa82a732b7d24c2e6621704b981b80b60 | [
"MIT"
] | null | null | null | import numpy
from discrete_fuzzy_operators.base.operators.binary_operators.suboperators.fuzzy_aggregation_operator import \
DiscreteFuzzyAggregationBinaryOperator
from typing import Callable
class Nullnorm(DiscreteFuzzyAggregationBinaryOperator):
def __init__(self, n: int,
k: int,
... | 50.945946 | 118 | 0.661538 | import numpy
from discrete_fuzzy_operators.base.operators.binary_operators.suboperators.fuzzy_aggregation_operator import \
DiscreteFuzzyAggregationBinaryOperator
from typing import Callable
class Nullnorm(DiscreteFuzzyAggregationBinaryOperator):
def __init__(self, n: int,
k: int,
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.