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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
08f86d4e6f1e27f5147800623d808a7db1a6bf05 | 445 | py | Python | Docs/Examples/talks/session1_09.py | Vectro-Type-Foundry/robofab | cd65d78292d24358c98dce53d283314cdc85878e | [
"BSD-3-Clause"
] | 61 | 2015-01-17T10:15:45.000Z | 2018-12-02T13:53:02.000Z | Docs/Examples/talks/session1_09.py | Vectro-Type-Foundry/robofab | cd65d78292d24358c98dce53d283314cdc85878e | [
"BSD-3-Clause"
] | 37 | 2015-01-05T23:44:56.000Z | 2018-03-16T19:05:28.000Z | Docs/Examples/talks/session1_09.py | Vectro-Type-Foundry/robofab | cd65d78292d24358c98dce53d283314cdc85878e | [
"BSD-3-Clause"
] | 25 | 2015-01-08T19:49:36.000Z | 2018-10-29T00:36:46.000Z | # iteration through alphabetically sorted glyphnames
from robofab.world import CurrentFont
font = CurrentFont()
print "font has %d glyphs" % len(font)
# names is now a list of strings, the names of the glyphs
# not the glyphs themselves!
names = font.keys()
# the list of names is sorted
names.sort()
# now we itera... | 23.421053 | 57 | 0.74382 |
from robofab.world import CurrentFont
font = CurrentFont()
print "font has %d glyphs" % len(font)
names = font.keys()
names.sort()
for glyphName in names:
print font[glyphName]
| false | true |
08f86e5323637070dcbd2bf140313c64c1aee448 | 1,597 | py | Python | rlutil/dictarray.py | alexlioralexli/diagnosing_qlearning | 20a4338a324c1bab79e6ca65937830529d941302 | [
"MIT"
] | 16 | 2019-05-10T18:10:27.000Z | 2022-02-01T09:50:01.000Z | rlutil/dictarray.py | alexlioralexli/diagnosing_qlearning | 20a4338a324c1bab79e6ca65937830529d941302 | [
"MIT"
] | null | null | null | rlutil/dictarray.py | alexlioralexli/diagnosing_qlearning | 20a4338a324c1bab79e6ca65937830529d941302 | [
"MIT"
] | 4 | 2019-08-11T23:20:35.000Z | 2021-04-07T07:13:40.000Z | import numpy as np
def DictArray(shapes_dict, axis=0, dtype=np.float32):
keys = sorted(list(shapes_dict.keys()))
shapes = np.array([shapes_dict[k] for k in keys])
sizes = [np.prod(shape) for shape in shapes]
total_size = np.sum(sizes)
key_to_slice = {}
key_to_shape = {}
key_to_size = {}
... | 27.534483 | 67 | 0.573575 | import numpy as np
def DictArray(shapes_dict, axis=0, dtype=np.float32):
keys = sorted(list(shapes_dict.keys()))
shapes = np.array([shapes_dict[k] for k in keys])
sizes = [np.prod(shape) for shape in shapes]
total_size = np.sum(sizes)
key_to_slice = {}
key_to_shape = {}
key_to_size = {}
... | true | true |
08f86e6816b00800ba32f4d8a6090a8501a28447 | 622 | py | Python | tests/test_app.py | holotape/pch2csd | 9fab9dcc8d9fe9c4ff272461685d4dfc586d38a9 | [
"MIT"
] | null | null | null | tests/test_app.py | holotape/pch2csd | 9fab9dcc8d9fe9c4ff272461685d4dfc586d38a9 | [
"MIT"
] | null | null | null | tests/test_app.py | holotape/pch2csd | 9fab9dcc8d9fe9c4ff272461685d4dfc586d38a9 | [
"MIT"
] | null | null | null | from glob import glob
from unittest import TestCase
from pch2csd.app import print_pch2, convert_pch2, validate_udo
from tests.util import get_test_resource
class TestApp(TestCase):
def test_check_udo__not_raises(self):
validate_udo(81)
def test_print_pch2__not_raises(self):
for f in glob(get... | 28.272727 | 78 | 0.696141 | from glob import glob
from unittest import TestCase
from pch2csd.app import print_pch2, convert_pch2, validate_udo
from tests.util import get_test_resource
class TestApp(TestCase):
def test_check_udo__not_raises(self):
validate_udo(81)
def test_print_pch2__not_raises(self):
for f in glob(get... | true | true |
08f86faaa28613254e7572e79fda29de24a99d61 | 2,667 | py | Python | cmake_conf.py | jj4jj/pbdcex | 5b0d2bbdaebf94cceee47350819dae93a88a4cc8 | [
"MIT"
] | 5 | 2015-12-24T19:03:41.000Z | 2016-09-01T02:32:58.000Z | examples/pbdcex.py | jj4jj/cmaketools | ad027891280eb67af52157fb152b6a270138cdf4 | [
"MIT"
] | null | null | null | examples/pbdcex.py | jj4jj/cmaketools | ad027891280eb67af52157fb152b6a270138cdf4 | [
"MIT"
] | 2 | 2019-08-21T19:58:00.000Z | 2021-12-22T23:05:16.000Z | project='pbdcex'
version='0.1.1'
debug = 1 #0/1
defs = []
verbose = 'on' #on/off
extra_c_flags = '-wno-unused-parameter'
extra_cxx_flags = '--std=c++11 -lpthread -lrt -ldl'
env = {
'protoi':'/usr/local/include',
'protoc':'protoc',
'protoi':'/usr/local/include',
}
units = [
{
'name':'pbdcexer',... | 41.030769 | 177 | 0.431196 | project='pbdcex'
version='0.1.1'
debug = 1 defs = []
verbose = 'on' extra_c_flags = '-wno-unused-parameter'
extra_cxx_flags = '--std=c++11 -lpthread -lrt -ldl'
env = {
'protoi':'/usr/local/include',
'protoc':'protoc',
'protoi':'/usr/local/include',
}
units = [
{
'name':'pbdcexer',
... | true | true |
08f8701b8869adedae335e296ebdb01e308e695c | 1,493 | py | Python | systolic_runner/rcnn_runner/ort_native.py | kimjungwow/onnxruntime-riscv | 3c21abef03190648fe68a6633ac026725e6dfc58 | [
"MIT"
] | 18 | 2020-05-19T12:48:07.000Z | 2021-04-28T06:41:57.000Z | systolic_runner/rcnn_runner/ort_native.py | kimjungwow/onnxruntime-riscv | 3c21abef03190648fe68a6633ac026725e6dfc58 | [
"MIT"
] | 37 | 2020-03-26T22:08:26.000Z | 2021-05-06T07:27:11.000Z | systolic_runner/rcnn_runner/ort_native.py | kimjungwow/onnxruntime-riscv | 3c21abef03190648fe68a6633ac026725e6dfc58 | [
"MIT"
] | 9 | 2021-05-14T20:17:26.000Z | 2022-03-20T11:44:29.000Z | import onnxruntime as rt
import numpy
import argparse
import numpy as np
import cv2
parser = argparse.ArgumentParser(description='ImageNet native ORT')
parser.add_argument('--model', type=str, required=True)
parser.add_argument('--image', type=str, required=True)
args, args_other = parser.parse_known_args()
# sess_op... | 30.469388 | 87 | 0.725385 | import onnxruntime as rt
import numpy
import argparse
import numpy as np
import cv2
parser = argparse.ArgumentParser(description='ImageNet native ORT')
parser.add_argument('--model', type=str, required=True)
parser.add_argument('--image', type=str, required=True)
args, args_other = parser.parse_known_args()
sess = ... | true | true |
08f870a1c02941997d77fadba3588611140207d6 | 7,698 | py | Python | contrib/tools/cython/Cython/TestUtils.py | SitdikovRustam/CatBoost | 39fb9dfddb24e977ed87efc71063b03cd4bc8f16 | [
"Apache-2.0"
] | 652 | 2015-07-26T00:00:17.000Z | 2022-02-24T18:30:04.000Z | contrib/tools/cython/Cython/TestUtils.py | dsferz/machinelearning_yandex | 8fde8314c5c70299ece8b8f00075ddfcd5e07ddf | [
"Apache-2.0"
] | 8 | 2015-09-07T03:38:19.000Z | 2021-05-23T03:18:51.000Z | contrib/tools/cython/Cython/TestUtils.py | dsferz/machinelearning_yandex | 8fde8314c5c70299ece8b8f00075ddfcd5e07ddf | [
"Apache-2.0"
] | 40 | 2015-07-24T19:45:08.000Z | 2021-11-01T14:54:56.000Z | import Cython.Compiler.Errors as Errors
from Cython.CodeWriter import CodeWriter
from Cython.Compiler.TreeFragment import TreeFragment, strip_common_indent
from Cython.Compiler.Visitor import TreeVisitor, VisitorTransform
from Cython.Compiler import TreePath
import unittest
import os, sys
import tempfile
class NodeT... | 37.55122 | 122 | 0.617043 | import Cython.Compiler.Errors as Errors
from Cython.CodeWriter import CodeWriter
from Cython.Compiler.TreeFragment import TreeFragment, strip_common_indent
from Cython.Compiler.Visitor import TreeVisitor, VisitorTransform
from Cython.Compiler import TreePath
import unittest
import os, sys
import tempfile
class NodeT... | true | true |
08f87179217fe8aaec11f8e61707ac40787f8120 | 9,395 | py | Python | craftassist/agent/dialogue_objects/schematic_helper.py | kandluis/droidlet | 3851f0bdac7bc63100cfbcf1c206a94658790352 | [
"MIT"
] | null | null | null | craftassist/agent/dialogue_objects/schematic_helper.py | kandluis/droidlet | 3851f0bdac7bc63100cfbcf1c206a94658790352 | [
"MIT"
] | null | null | null | craftassist/agent/dialogue_objects/schematic_helper.py | kandluis/droidlet | 3851f0bdac7bc63100cfbcf1c206a94658790352 | [
"MIT"
] | null | null | null | """
Copyright (c) Facebook, Inc. and its affiliates.
"""
import random
import re
import numpy as np
from typing import cast, List, Tuple, Union, Optional
# TODO with subinterpret
from base_agent.dialogue_objects import get_repeat_num
import block_data
import size_words
from .block_helpers import get_block_type
from b... | 38.504098 | 94 | 0.651517 |
import random
import re
import numpy as np
from typing import cast, List, Tuple, Union, Optional
from base_agent.dialogue_objects import get_repeat_num
import block_data
import size_words
from .block_helpers import get_block_type
from base_agent.base_util import ErrorWithResponse
from mc_util import Block, most_commo... | true | true |
08f871ea760b7b98785562e2cbad05a5955d6749 | 30,329 | py | Python | zerver/webhooks/github/view.py | NerdyLucifer/zulip | 6bd7aac152b8f57f5597ac53df7eaf6affe491d4 | [
"Apache-2.0"
] | null | null | null | zerver/webhooks/github/view.py | NerdyLucifer/zulip | 6bd7aac152b8f57f5597ac53df7eaf6affe491d4 | [
"Apache-2.0"
] | null | null | null | zerver/webhooks/github/view.py | NerdyLucifer/zulip | 6bd7aac152b8f57f5597ac53df7eaf6affe491d4 | [
"Apache-2.0"
] | null | null | null | import re
from functools import partial
from typing import Callable, Dict, Optional
from django.http import HttpRequest, HttpResponse
from zerver.decorator import log_unsupported_webhook_event, webhook_view
from zerver.lib.exceptions import UnsupportedWebhookEventType
from zerver.lib.request import REQ, has_request_v... | 36.235364 | 142 | 0.667381 | import re
from functools import partial
from typing import Callable, Dict, Optional
from django.http import HttpRequest, HttpResponse
from zerver.decorator import log_unsupported_webhook_event, webhook_view
from zerver.lib.exceptions import UnsupportedWebhookEventType
from zerver.lib.request import REQ, has_request_v... | true | true |
08f8721ca4248ab1e9ae30ce5d0b5d81587182a6 | 3,825 | py | Python | api_tests/subscriptions/views/test_subscriptions_detail.py | gaybro8777/osf.io | 30408511510a40bc393565817b343ef5fd76ab14 | [
"Apache-2.0"
] | 628 | 2015-01-15T04:33:22.000Z | 2022-03-30T06:40:10.000Z | api_tests/subscriptions/views/test_subscriptions_detail.py | gaybro8777/osf.io | 30408511510a40bc393565817b343ef5fd76ab14 | [
"Apache-2.0"
] | 4,712 | 2015-01-02T01:41:53.000Z | 2022-03-30T14:18:40.000Z | api_tests/subscriptions/views/test_subscriptions_detail.py | Johnetordoff/osf.io | de10bf249c46cede04c78f7e6f7e352c69e6e6b5 | [
"Apache-2.0"
] | 371 | 2015-01-12T16:14:08.000Z | 2022-03-31T18:58:29.000Z | import pytest
from api.base.settings.defaults import API_BASE
from osf_tests.factories import AuthUserFactory, NotificationSubscriptionFactory
@pytest.mark.django_db
class TestSubscriptionDetail:
@pytest.fixture()
def user(self):
return AuthUserFactory()
@pytest.fixture()
def user_no_auth(s... | 35.747664 | 134 | 0.626928 | import pytest
from api.base.settings.defaults import API_BASE
from osf_tests.factories import AuthUserFactory, NotificationSubscriptionFactory
@pytest.mark.django_db
class TestSubscriptionDetail:
@pytest.fixture()
def user(self):
return AuthUserFactory()
@pytest.fixture()
def user_no_auth(s... | true | true |
08f87258afe51f8561ee3d06a44f60a3c96e3dbc | 1,144 | py | Python | kubernetes/test/test_extensions_v1beta1_pod_security_policy_spec.py | TomasTomecek/kubernetes-python | c37c074303a13c72662b9201ccc023fb0ca45755 | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_extensions_v1beta1_pod_security_policy_spec.py | TomasTomecek/kubernetes-python | c37c074303a13c72662b9201ccc023fb0ca45755 | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_extensions_v1beta1_pod_security_policy_spec.py | TomasTomecek/kubernetes-python | c37c074303a13c72662b9201ccc023fb0ca45755 | [
"Apache-2.0"
] | 1 | 2020-05-09T07:16:55.000Z | 2020-05-09T07:16:55.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.12.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
i... | 25.422222 | 126 | 0.755245 |
from __future__ import absolute_import
import os
import sys
import unittest
import kubernetes.client
from kubernetes.client.rest import ApiException
from kubernetes.client.models.extensions_v1beta1_pod_security_policy_spec import ExtensionsV1beta1PodSecurityPolicySpec
class TestExtensionsV1beta1PodSecurityPolicy... | true | true |
08f873123a54170318906e2fd09ab601dc1111f9 | 102,405 | py | Python | tests/examples/minlplib/squfl025-025.py | ouyang-w-19/decogo | 52546480e49776251d4d27856e18a46f40c824a1 | [
"MIT"
] | 2 | 2021-07-03T13:19:10.000Z | 2022-02-06T10:48:13.000Z | tests/examples/minlplib/squfl025-025.py | ouyang-w-19/decogo | 52546480e49776251d4d27856e18a46f40c824a1 | [
"MIT"
] | 1 | 2021-07-04T14:52:14.000Z | 2021-07-15T10:17:11.000Z | tests/examples/minlplib/squfl025-025.py | ouyang-w-19/decogo | 52546480e49776251d4d27856e18a46f40c824a1 | [
"MIT"
] | null | null | null | # MINLP written by GAMS Convert at 04/21/18 13:54:19
#
# Equation counts
# Total E G L N X C B
# 651 26 0 625 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc ... | 45.472913 | 120 | 0.628739 |
from pyomo.environ import *
model = m = ConcreteModel()
m.x1 = Var(within=Reals,bounds=(0,None),initialize=0)
m.x2 = Var(within=Reals,bounds=(0,None),initialize=0)
m.x3 = Var(within=Reals,bounds=(0,None),initialize=0)
m.x4 = Var(within=Reals,bounds=(0,None),initialize=0)
m.x5 = Var(within=Reals,bounds=(0,None),ini... | true | true |
08f8731f820ad750ad71acbc62bc76f546420187 | 4,654 | py | Python | mars/operands/fft.py | lmatz/mars | 45f9166b54eb91b21e66cef8b590a41aa8ac9569 | [
"Apache-2.0"
] | 1 | 2018-12-26T08:37:04.000Z | 2018-12-26T08:37:04.000Z | mars/operands/fft.py | lmatz/mars | 45f9166b54eb91b21e66cef8b590a41aa8ac9569 | [
"Apache-2.0"
] | null | null | null | mars/operands/fft.py | lmatz/mars | 45f9166b54eb91b21e66cef8b590a41aa8ac9569 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2018 Alibaba Group Holding 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-... | 19.472803 | 105 | 0.665449 |
from .core import Operand
from .base import HasInput
from .. import opcodes as OperandDef
from ..serialize import ValueType, KeyField, Int32Field, Int64Field, Float64Field, StringField, ListField
class DiscreteFourierTransform(HasInput):
__slots__ = ()
class StandardFFT(DiscreteFourierTransform):
_input = ... | true | true |
08f87381122efe2d7a188e40cd910fc7b621a0da | 12,496 | py | Python | mypy/plugins/dataclasses.py | chubbymaggie/mypy | 50c3dfcdca94726130e8cfdb6bde02b3eeca4e09 | [
"PSF-2.0"
] | null | null | null | mypy/plugins/dataclasses.py | chubbymaggie/mypy | 50c3dfcdca94726130e8cfdb6bde02b3eeca4e09 | [
"PSF-2.0"
] | null | null | null | mypy/plugins/dataclasses.py | chubbymaggie/mypy | 50c3dfcdca94726130e8cfdb6bde02b3eeca4e09 | [
"PSF-2.0"
] | null | null | null | from collections import OrderedDict
from typing import Dict, List, Set, Tuple
from mypy.nodes import (
ARG_OPT, ARG_POS, MDEF, Argument, AssignmentStmt, CallExpr,
Context, Decorator, Expression, FuncDef, JsonDict, NameExpr,
OverloadedFuncDef, SymbolTableNode, TempNode, TypeInfo, Var,
)
from mypy.plugin imp... | 38.567901 | 97 | 0.573864 | from collections import OrderedDict
from typing import Dict, List, Set, Tuple
from mypy.nodes import (
ARG_OPT, ARG_POS, MDEF, Argument, AssignmentStmt, CallExpr,
Context, Decorator, Expression, FuncDef, JsonDict, NameExpr,
OverloadedFuncDef, SymbolTableNode, TempNode, TypeInfo, Var,
)
from mypy.plugin imp... | true | true |
08f87488be169f74bfc5978867f09385732b3041 | 7,509 | py | Python | ml-agents/mlagents/trainers/trainer_util.py | jimrogerz/ml-agents | 8b0eb0eb997e3a0eaca947ed0dd58920d6736307 | [
"Apache-2.0"
] | 2 | 2020-12-26T20:40:09.000Z | 2021-01-27T15:25:56.000Z | ml-agents/mlagents/trainers/trainer_util.py | zachary2940/ml-agents-assignment | 917828a9bbe4a90b2e8004e5d22e485a7bad5802 | [
"Apache-2.0"
] | null | null | null | ml-agents/mlagents/trainers/trainer_util.py | zachary2940/ml-agents-assignment | 917828a9bbe4a90b2e8004e5d22e485a7bad5802 | [
"Apache-2.0"
] | null | null | null | import os
from typing import Dict
from mlagents_envs.logging_util import get_logger
from mlagents.trainers.environment_parameter_manager import EnvironmentParameterManager
from mlagents.trainers.exception import TrainerConfigError
from mlagents.trainers.trainer import Trainer
from mlagents.trainers.exception import Un... | 37.924242 | 110 | 0.665601 | import os
from typing import Dict
from mlagents_envs.logging_util import get_logger
from mlagents.trainers.environment_parameter_manager import EnvironmentParameterManager
from mlagents.trainers.exception import TrainerConfigError
from mlagents.trainers.trainer import Trainer
from mlagents.trainers.exception import Un... | true | true |
08f8749b86d25cd40b152bb48503be0bdecd17b2 | 1,025 | py | Python | src/bph_co2/ventilation.py | DerMaxxiKing/bph_co2 | 8a017c6f7f7708e6f840fd8ecb63d83c2db263d9 | [
"MIT"
] | null | null | null | src/bph_co2/ventilation.py | DerMaxxiKing/bph_co2 | 8a017c6f7f7708e6f840fd8ecb63d83c2db263d9 | [
"MIT"
] | null | null | null | src/bph_co2/ventilation.py | DerMaxxiKing/bph_co2 | 8a017c6f7f7708e6f840fd8ecb63d83c2db263d9 | [
"MIT"
] | null | null | null |
class Ventilation(object):
def __init__(self, *args, **kwargs):
self.name = kwargs.get('name', f'Ventilation') # ventilation
self.t_ex = kwargs.get('t_ex', None) # exhaust air temperature [°C]
self.t_in = kwargs.get('t_in', None) ... | 27.702703 | 104 | 0.498537 |
class Ventilation(object):
def __init__(self, *args, **kwargs):
self.name = kwargs.get('name', f'Ventilation')
self.t_ex = kwargs.get('t_ex', None) self.t_in = kwargs.get('t_in', None)
if self.t_ex is No... | true | true |
08f874a7a3f0f669cdaa77a60a9178fb2fda4986 | 6,525 | py | Python | nova/tests/functional/regressions/test_bug_1671648.py | hashsos/hashcloudos-nova | 8350f20167f256f740c5bb94f9222c95fa3e32ad | [
"Apache-2.0"
] | null | null | null | nova/tests/functional/regressions/test_bug_1671648.py | hashsos/hashcloudos-nova | 8350f20167f256f740c5bb94f9222c95fa3e32ad | [
"Apache-2.0"
] | null | null | null | nova/tests/functional/regressions/test_bug_1671648.py | hashsos/hashcloudos-nova | 8350f20167f256f740c5bb94f9222c95fa3e32ad | [
"Apache-2.0"
] | 1 | 2020-07-22T21:17:41.000Z | 2020-07-22T21:17:41.000Z | # Copyright 2017 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... | 43.211921 | 78 | 0.676935 |
import time
import nova.compute.resource_tracker
from nova import exception
from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.unit import cast_as_call
from nova.tests.unit import fake_network
import nova.tests.unit.image.fake
from nova.tests.unit import policy_fixture
from nova.vi... | true | true |
08f876341c163d16be6c8e385611467f13fb3c08 | 1,711 | py | Python | config/wsgi.py | janwinsemius/bureaumiddelkoop | 5dc19b92e30ce93db1fb03d7eb4502c18c4c3f4b | [
"MIT"
] | null | null | null | config/wsgi.py | janwinsemius/bureaumiddelkoop | 5dc19b92e30ce93db1fb03d7eb4502c18c4c3f4b | [
"MIT"
] | null | null | null | config/wsgi.py | janwinsemius/bureaumiddelkoop | 5dc19b92e30ce93db1fb03d7eb4502c18c4c3f4b | [
"MIT"
] | null | null | null | """
WSGI config for bureaumiddelkoop project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLI... | 42.775 | 79 | 0.800117 | import os
import sys
from django.core.wsgi import get_wsgi_application
app_path = os.path.abspath(
os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir)
)
sys.path.append(os.path.join(app_path, "bureaumiddelkoop"))
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.production")
# sett... | true | true |
08f876513673e9c7f93652cad78ca491ef0716ad | 1,044 | py | Python | alipay/aop/api/response/AlipayPointOrderAddResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/response/AlipayPointOrderAddResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/response/AlipayPointOrderAddResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayPointOrderAddResponse(AlipayResponse):
def __init__(self):
super(AlipayPointOrderAddResponse, self).__init__()
self._alipay_order_no = None
self._result... | 29 | 100 | 0.702107 | import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayPointOrderAddResponse(AlipayResponse):
def __init__(self):
super(AlipayPointOrderAddResponse, self).__init__()
self._alipay_order_no = None
self._result_code = None
@property
def alipay_ord... | true | true |
08f8770bd147da71136c6fdd49e702b72ac7df48 | 5,277 | py | Python | dataproject/dataproject.py | AskerNC/projects-2021-concatenaters | f495737c38cf86bbe459f2de6caf1d364419bb8d | [
"MIT"
] | null | null | null | dataproject/dataproject.py | AskerNC/projects-2021-concatenaters | f495737c38cf86bbe459f2de6caf1d364419bb8d | [
"MIT"
] | null | null | null | dataproject/dataproject.py | AskerNC/projects-2021-concatenaters | f495737c38cf86bbe459f2de6caf1d364419bb8d | [
"MIT"
] | null | null | null | from IPython.display import display
import ipywidgets as widgets
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
def eurostat_to_df(dataset_id, params, client):
""" imports a dataset from eurostat as a dataframe using the eurostatapiclient
prints dataset title and displays dataframe ... | 29.316667 | 131 | 0.613038 | from IPython.display import display
import ipywidgets as widgets
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
def eurostat_to_df(dataset_id, params, client):
""" imports a dataset from eurostat as a dataframe using the eurostatapiclient
prints dataset title and displays dataframe ... | false | true |
08f877256c86a0ad25db8bf86522a437d2e29a97 | 5,073 | py | Python | heat/engine/resources/openstack/neutron/l2_gateway.py | HyunJin-Jeong/heat | 8353fddf9ebfb0eca67d6f2b2feb529031acff89 | [
"Apache-2.0"
] | 1 | 2020-06-18T01:05:29.000Z | 2020-06-18T01:05:29.000Z | heat/engine/resources/openstack/neutron/l2_gateway.py | HyunJin-Jeong/heat | 8353fddf9ebfb0eca67d6f2b2feb529031acff89 | [
"Apache-2.0"
] | null | null | null | heat/engine/resources/openstack/neutron/l2_gateway.py | HyunJin-Jeong/heat | 8353fddf9ebfb0eca67d6f2b2feb529031acff89 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Ericsson
#
# 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... | 32.107595 | 78 | 0.625862 |
import collections
from heat.common.i18n import _
from heat.engine import properties
from heat.engine.resources.openstack.neutron import neutron
from heat.engine import support
class L2Gateway(neutron.NeutronResource):
required_service_extension = 'l2-gateway'
entity = 'l2_gateway'
support_status = s... | true | true |
08f877fb3cc1fb81a0b5a24d5147140dd00b7325 | 385 | py | Python | app_data.py | AIESECMX/App-Notification- | 63d1749193f6ae448df9c40ea22c5dec625abe9d | [
"MIT"
] | null | null | null | app_data.py | AIESECMX/App-Notification- | 63d1749193f6ae448df9c40ea22c5dec625abe9d | [
"MIT"
] | null | null | null | app_data.py | AIESECMX/App-Notification- | 63d1749193f6ae448df9c40ea22c5dec625abe9d | [
"MIT"
] | null | null | null | class App:
def __init__(self,ep_link,ep_mail,ep_name,op_name,op_link,cv_link,ep_managers,op_managers,app_link,country):
self.ep_link = ep_link
self.country = country
self.ep_mail = ep_mail
self.ep_name =ep_name
self.op_name =op_name
self.op_link =op_link
self.cv_link =cv_link
self.ep_managers =ep_mana... | 27.5 | 109 | 0.779221 | class App:
def __init__(self,ep_link,ep_mail,ep_name,op_name,op_link,cv_link,ep_managers,op_managers,app_link,country):
self.ep_link = ep_link
self.country = country
self.ep_mail = ep_mail
self.ep_name =ep_name
self.op_name =op_name
self.op_link =op_link
self.cv_link =cv_link
self.ep_managers =ep_mana... | true | true |
08f87a1833d359f2b1517c7b22d7f3b451e9bf66 | 1,185 | py | Python | datasets/dataset_invivo_sinograms.py | juestellab/msot-sinogram-denoising | 4114e7253c55edeae961dfa096418f14b609e846 | [
"BSD-2-Clause"
] | 2 | 2022-01-04T10:03:50.000Z | 2022-03-27T12:10:23.000Z | datasets/dataset_invivo_sinograms.py | juestellab/msot-sinogram-denoising | 4114e7253c55edeae961dfa096418f14b609e846 | [
"BSD-2-Clause"
] | null | null | null | datasets/dataset_invivo_sinograms.py | juestellab/msot-sinogram-denoising | 4114e7253c55edeae961dfa096418f14b609e846 | [
"BSD-2-Clause"
] | null | null | null | import natsort
import numpy as np
import torch
import os
from torchvision.transforms import transforms
import re
from PIL import Image
from medpy.io import load
class DatasetInvivoSinograms(torch.utils.data.Dataset):
def __init__(self, path_test_samples, divisor_for_data_normalization, regex_fullmatch_for_filena... | 34.852941 | 138 | 0.713924 | import natsort
import numpy as np
import torch
import os
from torchvision.transforms import transforms
import re
from PIL import Image
from medpy.io import load
class DatasetInvivoSinograms(torch.utils.data.Dataset):
def __init__(self, path_test_samples, divisor_for_data_normalization, regex_fullmatch_for_filena... | true | true |
08f87a44c29e1014cf5dba172fae2997c70e6cec | 15,015 | py | Python | tests/api.py | igoumiri/MuyGPyS | f60e67108a94d556ab330645bc792acbb84a8a3a | [
"MIT-0",
"MIT"
] | 4 | 2021-08-02T22:10:00.000Z | 2022-03-31T02:44:47.000Z | tests/api.py | igoumiri/MuyGPyS | f60e67108a94d556ab330645bc792acbb84a8a3a | [
"MIT-0",
"MIT"
] | 3 | 2021-12-07T02:00:36.000Z | 2022-01-18T22:20:07.000Z | tests/api.py | igoumiri/MuyGPyS | f60e67108a94d556ab330645bc792acbb84a8a3a | [
"MIT-0",
"MIT"
] | 4 | 2021-08-02T23:50:55.000Z | 2022-01-18T07:05:15.000Z | # Copyright 2021 Lawrence Livermore National Security, LLC and other MuyGPyS
# Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: MIT
import os
import sys
import pickle as pkl
from absl.testing import absltest
from absl.testing import parameterized
from MuyGPyS.examples.t... | 31.878981 | 79 | 0.448618 |
import os
import sys
import pickle as pkl
from absl.testing import absltest
from absl.testing import parameterized
from MuyGPyS.examples.two_class_classify_uq import example_lambdas
from MuyGPyS.testing.api_tests import ClassifyAPITest, RegressionAPITest
from MuyGPyS.testing.test_utils import (
_balanced_subsam... | true | true |
08f87b0e894193b1908d8e42f6d965c5857a5a33 | 1,696 | py | Python | correios_frete/service.py | adonescunha/correios-frete | 8958f25f1f3fbaad93a6c200b5de7e25827db743 | [
"MIT",
"Unlicense"
] | 13 | 2015-07-15T14:13:26.000Z | 2020-06-11T22:52:40.000Z | correios_frete/service.py | adonescunha/correios-frete | 8958f25f1f3fbaad93a6c200b5de7e25827db743 | [
"MIT",
"Unlicense"
] | null | null | null | correios_frete/service.py | adonescunha/correios-frete | 8958f25f1f3fbaad93a6c200b5de7e25827db743 | [
"MIT",
"Unlicense"
] | 7 | 2016-09-30T05:05:36.000Z | 2021-04-30T11:52:57.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# correios-frete
# https://github.com/adonescunha/correios-frete
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2013 Adones Cunha adonescunha@gmail.com
from .utils import comma_separated_to_float, s_n_to_bool
class Se... | 33.92 | 74 | 0.626179 |
from .utils import comma_separated_to_float, s_n_to_bool
class Service(object):
codigo = None
valor = None
prazo_entrega = None
valor_mao_propria = None
valor_aviso_recebimento = None
valor_valor_declarado = None
entrega_domiciliar ... | true | true |
08f87d00f44bd0ab0f09b44f112eb8e8036e2f76 | 7,541 | py | Python | net/pycopia/ssl/CA.py | kdart/pycopia | 1446fabaedf8c6bdd4ab1fc3f0ea731e0ef8da9d | [
"Apache-2.0"
] | 89 | 2015-03-26T11:25:20.000Z | 2022-01-12T06:25:14.000Z | net/pycopia/ssl/CA.py | kdart/pycopia | 1446fabaedf8c6bdd4ab1fc3f0ea731e0ef8da9d | [
"Apache-2.0"
] | 1 | 2015-07-05T03:27:43.000Z | 2015-07-11T06:21:20.000Z | net/pycopia/ssl/CA.py | kdart/pycopia | 1446fabaedf8c6bdd4ab1fc3f0ea731e0ef8da9d | [
"Apache-2.0"
] | 30 | 2015-04-30T01:35:54.000Z | 2022-01-12T06:19:49.000Z | #!/usr/bin/python2.7
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
# 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
... | 30.407258 | 88 | 0.57857 |
"""
Certificate Authority functionality.
Implemented as a wrapper for openSSL and openssl binary tool. Basically a port
to Python of the CA.pl script. Therefore, it's pretty ugly, and limited in what
your certs can contain.
It tries to automate the CA and other cert operations by using a custom openssl
configura... | false | true |
08f87d897c04dccefb6cdcddcb82013624c22730 | 10,075 | py | Python | abed_conf.py | SimonEismann/TCPDBench | e2e9158e40f38ca92472ead291f0b11fa5c8d1fd | [
"MIT"
] | 1 | 2021-12-17T19:50:30.000Z | 2021-12-17T19:50:30.000Z | abed_conf.py | SimonEismann/TCPDBench | e2e9158e40f38ca92472ead291f0b11fa5c8d1fd | [
"MIT"
] | null | null | null | abed_conf.py | SimonEismann/TCPDBench | e2e9158e40f38ca92472ead291f0b11fa5c8d1fd | [
"MIT"
] | null | null | null | import copy
##############################################################################
# General Settings #
##############################################################################
PROJECT_NAME = "cpdbench"
TASK_FILE = "abed_tasks.txt"
AUTO_FILE = "ab... | 43.055556 | 195 | 0.543027 | import copy
PROJECT_NAME = "cpdbench"
TASK_FILE = "abed_tasks.txt"
AUTO_FILE = "abed_auto.txt"
RESULT_DIR = "./abed_results"
STAGE_DIR = "./stagedir"
PRUNE_DIR = "./pruned"
MAX_FILES = 1000
ZIP_DIR = "./zips"
LOG_DIR = "./logs"
OUTPUT_DIR = "./output"
AUTO_SLEEP = 120
HTML_PORT = 8000
COMPRESSION = "bzip2"
RESULT_EXTE... | true | true |
08f87d9b9c2421fa15329cf4597f3de3ce8ec416 | 755 | py | Python | logger/logger.py | VovaTch/AttentionChess | 021fea4a02661b8af9de376ebc473fa5f58b3551 | [
"MIT"
] | null | null | null | logger/logger.py | VovaTch/AttentionChess | 021fea4a02661b8af9de376ebc473fa5f58b3551 | [
"MIT"
] | null | null | null | logger/logger.py | VovaTch/AttentionChess | 021fea4a02661b8af9de376ebc473fa5f58b3551 | [
"MIT"
] | null | null | null | import logging
import logging.config
from pathlib import Path
from utils.util import read_json
def setup_logging(save_dir, log_config='logger/logger_config.json', default_level=logging.INFO):
"""
Setup logging configuration
"""
log_config = Path(log_config)
if log_config.is_file():
config ... | 32.826087 | 96 | 0.680795 | import logging
import logging.config
from pathlib import Path
from utils.util import read_json
def setup_logging(save_dir, log_config='logger/logger_config.json', default_level=logging.INFO):
log_config = Path(log_config)
if log_config.is_file():
config = read_json(log_config)
for _, h... | true | true |
08f87ef273c3d82124d82c003a97d492168fb75c | 1,231 | py | Python | webcam_face_and_eye.py | sharkhack/webcam-face-detection | 917ec7b8b179f93d4406b434694891b89494ca2d | [
"MIT"
] | null | null | null | webcam_face_and_eye.py | sharkhack/webcam-face-detection | 917ec7b8b179f93d4406b434694891b89494ca2d | [
"MIT"
] | null | null | null | webcam_face_and_eye.py | sharkhack/webcam-face-detection | 917ec7b8b179f93d4406b434694891b89494ca2d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import cv2
import numpy as np
# Import Classifier for Face and Eye Detection
face_classifier = cv2.CascadeClassifier('./data/haarcascades/haarcascade_frontalface_default.xml')
eye_classifier = cv2.CascadeClassifier ('./data/haarcascades/haarcascade_eye.xml')
def face_detector (img, size=0.5):
... | 30.02439 | 98 | 0.694557 |
import cv2
import numpy as np
face_classifier = cv2.CascadeClassifier('./data/haarcascades/haarcascade_frontalface_default.xml')
eye_classifier = cv2.CascadeClassifier ('./data/haarcascades/haarcascade_eye.xml')
def face_detector (img, size=0.5):
gray = cv2.cvtColor (img, cv2.COLOR_BGR2GRAY)
faces = face_classifi... | true | true |
08f87f776171394d101faccda1aa407763fe9740 | 44 | py | Python | src/amuse/community/ph4/__init__.py | sibonyves/amuse | 5557bf88d14df1aa02133a199b6d60c0c57dcab7 | [
"Apache-2.0"
] | null | null | null | src/amuse/community/ph4/__init__.py | sibonyves/amuse | 5557bf88d14df1aa02133a199b6d60c0c57dcab7 | [
"Apache-2.0"
] | 12 | 2021-11-15T09:13:03.000Z | 2022-02-02T14:53:04.000Z | src/amuse/community/ph4/__init__.py | sibonyves/amuse | 5557bf88d14df1aa02133a199b6d60c0c57dcab7 | [
"Apache-2.0"
] | null | null | null | # generated file
from .interface import Ph4
| 14.666667 | 26 | 0.795455 | from .interface import Ph4
| true | true |
08f88030aabc13576c9a1d4dde59d622ad050bf2 | 652 | py | Python | examples/sample.py | RadostW/stochastic | 1d437900e0314f18678353fd4794ecefb197761d | [
"MIT"
] | 2 | 2022-03-01T11:48:21.000Z | 2022-03-01T11:48:22.000Z | examples/sample.py | RadostW/stochastic | 1d437900e0314f18678353fd4794ecefb197761d | [
"MIT"
] | null | null | null | examples/sample.py | RadostW/stochastic | 1d437900e0314f18678353fd4794ecefb197761d | [
"MIT"
] | 2 | 2021-11-16T15:44:39.000Z | 2021-12-15T22:59:49.000Z | from pychastic.problems.kp_4_27 import KloedenPlaten4_27
from pychastic.sde_solver import SDESolver
problem = KloedenPlaten4_27
solver = SDESolver()
solver.dt = 0.01
solution = solver.solve(problem)
exact = problem.exact_solution(problem.x0, solution['time_values'], solution['wiener_values'])
import matplotlib.pyplo... | 29.636364 | 94 | 0.771472 | from pychastic.problems.kp_4_27 import KloedenPlaten4_27
from pychastic.sde_solver import SDESolver
problem = KloedenPlaten4_27
solver = SDESolver()
solver.dt = 0.01
solution = solver.solve(problem)
exact = problem.exact_solution(problem.x0, solution['time_values'], solution['wiener_values'])
import matplotlib.pyplo... | true | true |
08f880635d874a142b9b0031f211f86f94e94753 | 8,559 | py | Python | ibis/pandas/execution/tests/test_functions.py | proxodilka/ibis | cad629e942859238f30ddb1e9bbf36c259c87ac4 | [
"Apache-2.0"
] | 1 | 2021-06-15T07:28:59.000Z | 2021-06-15T07:28:59.000Z | ibis/pandas/execution/tests/test_functions.py | dollylipare/ibis | 9d1086d7d29c2d3760c8150d8641ab51799720cd | [
"Apache-2.0"
] | 1 | 2020-10-02T23:51:48.000Z | 2020-10-03T00:54:29.000Z | ibis/pandas/execution/tests/test_functions.py | intel-go/ibis | 1943b6065d2ba89c35856b2d9b8399f15af11c01 | [
"Apache-2.0"
] | 1 | 2020-10-01T18:48:01.000Z | 2020-10-01T18:48:01.000Z | import decimal
import functools
import math
import operator
from operator import methodcaller
import numpy as np
import pandas as pd
import pandas.util.testing as tm # noqa: E402
import pytest
import ibis
import ibis.expr.datatypes as dt # noqa: E402
from ibis.pandas.udf import udf
pytestmark = pytest.mark.pandas
... | 30.677419 | 78 | 0.598084 | import decimal
import functools
import math
import operator
from operator import methodcaller
import numpy as np
import pandas as pd
import pandas.util.testing as tm import pytest
import ibis
import ibis.expr.datatypes as dt from ibis.pandas.udf import udf
pytestmark = pytest.mark.pandas
@pytest.mark.parametrize... | true | true |
08f88259d6b6d27db0b219e1756c1b4e4a721488 | 7,966 | py | Python | python/examples/frieze/merge_all.py | mcmigliore/vtkbool | a51f2dbcd094710f8967f33d54e8ca4849b90617 | [
"Apache-2.0"
] | null | null | null | python/examples/frieze/merge_all.py | mcmigliore/vtkbool | a51f2dbcd094710f8967f33d54e8ca4849b90617 | [
"Apache-2.0"
] | null | null | null | python/examples/frieze/merge_all.py | mcmigliore/vtkbool | a51f2dbcd094710f8967f33d54e8ca4849b90617 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# *-* coding: UTF-8 *-*
# Copyright 2012-2020 Ronald Römer
#
# 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 ... | 24.286585 | 76 | 0.66583 |
import sys
sys.path.extend(['/home/zippy/VTK8/lib/python3.6/site-packages'])
import vtk
import os
from frieze import extrude
def Merge1 ():
reader = vtk.vtkPolyDataReader()
reader.SetFileName('test4.vtk')
reader2 = vtk.vtkPolyDataReader()
reader2.SetFileName('test14.vtk')
app = vtk.vtkAppend... | true | true |
08f8838a9832af6d57a14d2f34473b39bdc55f27 | 14,770 | py | Python | pyhealth/models/ecg/rcrnet.py | rkalahasty/PyHealth | 1ee0859d8d39a7fc6f8df48ef8d2bf6c17dcf4a5 | [
"BSD-2-Clause"
] | 485 | 2020-08-03T20:04:21.000Z | 2022-02-25T13:35:43.000Z | pyhealth/models/ecg/rcrnet.py | rkalahasty/PyHealth | 1ee0859d8d39a7fc6f8df48ef8d2bf6c17dcf4a5 | [
"BSD-2-Clause"
] | 6 | 2020-08-06T01:07:45.000Z | 2021-10-15T21:49:42.000Z | pyhealth/models/ecg/rcrnet.py | rkalahasty/PyHealth | 1ee0859d8d39a7fc6f8df48ef8d2bf6c17dcf4a5 | [
"BSD-2-Clause"
] | 98 | 2020-08-04T01:04:38.000Z | 2022-02-09T10:36:03.000Z | # -*- coding: utf-8 -*-
# License: BSD 2 clause
import os
import torch
import torch.nn as nn
import pickle
import warnings
import torchvision.models as models
from ._loss import callLoss
from ._dlbase import BaseControler
from pyhealth.data.data_reader.ecg import rcrnet_reader
from collections import OrderedDict
from... | 34.269142 | 140 | 0.557211 |
import os
import torch
import torch.nn as nn
import pickle
import warnings
import torchvision.models as models
from ._loss import callLoss
from ._dlbase import BaseControler
from pyhealth.data.data_reader.ecg import rcrnet_reader
from collections import OrderedDict
from torch import Tensor
import torch.nn.functional ... | true | true |
08f883b53533476da6972814305c5e2f60f3078c | 4,696 | py | Python | react/components/Layout.py | rafi16jan/rapyd-framework | 436c60a8d2b9739c1b9177f5af985035aa21c8de | [
"BSD-3-Clause"
] | 16 | 2017-10-05T03:52:16.000Z | 2020-01-25T12:01:36.000Z | react/components/Layout.py | soIu/framework | 436c60a8d2b9739c1b9177f5af985035aa21c8de | [
"BSD-3-Clause"
] | 2 | 2018-01-06T00:21:09.000Z | 2018-01-09T08:22:19.000Z | react/components/Layout.py | rafi16jan/rapyd-framework | 436c60a8d2b9739c1b9177f5af985035aa21c8de | [
"BSD-3-Clause"
] | 7 | 2017-12-14T13:39:20.000Z | 2020-03-09T07:16:54.000Z | from react import Component, Text
from react.components import Typography, IconButton, MoreVertical, Menu, MenuItem
from javascript import JSON, Object, function, types
from orm import configuration
@Component(path='Module.Admin.AppBar')
class AppBar:
elevation = types.int
@Component
class span:
className = t... | 39.462185 | 242 | 0.627981 | from react import Component, Text
from react.components import Typography, IconButton, MoreVertical, Menu, MenuItem
from javascript import JSON, Object, function, types
from orm import configuration
@Component(path='Module.Admin.AppBar')
class AppBar:
elevation = types.int
@Component
class span:
className = t... | true | true |
08f884d6b87d23043795d26d50a1546cb653988b | 14,746 | bzl | Python | rules/opentitan.bzl | asb/opentitan | af68ff5041b10c81e97adc075a4d042f8ac7ab20 | [
"Apache-2.0"
] | 2 | 2019-11-21T14:05:14.000Z | 2020-07-10T12:40:54.000Z | rules/opentitan.bzl | asb/opentitan | af68ff5041b10c81e97adc075a4d042f8ac7ab20 | [
"Apache-2.0"
] | 9 | 2019-11-08T00:20:21.000Z | 2021-09-25T03:56:33.000Z | rules/opentitan.bzl | asb/opentitan | af68ff5041b10c81e97adc075a4d042f8ac7ab20 | [
"Apache-2.0"
] | 1 | 2019-11-19T05:28:23.000Z | 2019-11-19T05:28:23.000Z | # Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
# TODO(drewmacrae) this should be in rules_cc
# pending resolution of https://github.com/bazelbuild/rules_cc/issues/75
load("//rules:bugfix.bzl", "find_cc_toolchain")
"""R... | 36.142157 | 117 | 0.590126 |
load("//rules:bugfix.bzl", "find_cc_toolchain")
OPENTITAN_CPU = "@bazel_embedded//constraints/cpu:riscv32"
OPENTITAN_PLATFORM = "@bazel_embedded//platforms:opentitan_rv32imc"
_targets_compatible_with = {
OPENTITAN_PLATFORM: [OPENTITAN_CPU],
}
def _platforms_transition_impl(settings, attr):
return {"//comma... | true | true |
08f885470ab5be56bda310ba226b44c6071d10ee | 21,067 | py | Python | shijing_img/source/admcms.py | swenker/studio | 298336a6327dbd3d496de6a9290d29ac8fe00514 | [
"Apache-2.0"
] | 1 | 2015-02-05T09:05:01.000Z | 2015-02-05T09:05:01.000Z | shijing_img/source/admcms.py | swenker/studio | 298336a6327dbd3d496de6a9290d29ac8fe00514 | [
"Apache-2.0"
] | null | null | null | shijing_img/source/admcms.py | swenker/studio | 298336a6327dbd3d496de6a9290d29ac8fe00514 | [
"Apache-2.0"
] | null | null | null |
__author__ = 'sunwj'
from zipfile import ZipFile
import cgi
import web
from cms import cms_model
from cms import cms_service
from cms import service_config
from cms import batch_image_handler
from cms import cms_utils
from wshelper import ServiceHelper
from wshelper import ListWrapper
#TODO move this to a confi... | 28.239946 | 155 | 0.599753 |
__author__ = 'sunwj'
from zipfile import ZipFile
import cgi
import web
from cms import cms_model
from cms import cms_service
from cms import service_config
from cms import batch_image_handler
from cms import cms_utils
from wshelper import ServiceHelper
from wshelper import ListWrapper
urls = ("/adminsvc", "Admi... | false | true |
08f886dc2fc55d9656f0da319d3f23577e0fdee5 | 228 | py | Python | src/chapter7/exercise1.py | group6BCS1/BCS-2021 | 272b1117922163cde03901cfdd82f8e0cfab9a67 | [
"MIT"
] | null | null | null | src/chapter7/exercise1.py | group6BCS1/BCS-2021 | 272b1117922163cde03901cfdd82f8e0cfab9a67 | [
"MIT"
] | null | null | null | src/chapter7/exercise1.py | group6BCS1/BCS-2021 | 272b1117922163cde03901cfdd82f8e0cfab9a67 | [
"MIT"
] | null | null | null | # A program to read through a file and print the contents of the file
# (line by line) all in upper case
fname = input('Enter a file name')
fhand = open(fname)
for line in fhand:
line = line.rstrip()
print(line.upper())
| 28.5 | 69 | 0.692982 | fname = input('Enter a file name')
fhand = open(fname)
for line in fhand:
line = line.rstrip()
print(line.upper())
| true | true |
08f8870179c770a0aab7607b24768e7f1a13afba | 790 | py | Python | workflow/jobs/StartJob.py | MarcoFavorito/knowledge-based-telegram-bot | a6369856f9d40e288cccf99ac8ee62ff382a8fd3 | [
"MIT"
] | null | null | null | workflow/jobs/StartJob.py | MarcoFavorito/knowledge-based-telegram-bot | a6369856f9d40e288cccf99ac8ee62ff382a8fd3 | [
"MIT"
] | null | null | null | workflow/jobs/StartJob.py | MarcoFavorito/knowledge-based-telegram-bot | a6369856f9d40e288cccf99ac8ee62ff382a8fd3 | [
"MIT"
] | null | null | null | from workflow.State import State
from workflow.Job import Job
from messages.Messages import Messages
class StartJob(Job):
"""
The first job to be executed
it simply send a welcome message to the user
and dispatch the next job: the one who asks the domain
"""
def validate_input(self, input_tex... | 27.241379 | 73 | 0.683544 | from workflow.State import State
from workflow.Job import Job
from messages.Messages import Messages
class StartJob(Job):
def validate_input(self, input_text) -> bool:
return input_text in [
Messages.START.value
]
def the_job(self, input_text):
self.workflow_manag... | true | true |
08f8871de6862f9c9a801886e30aed586889cf5a | 1,039 | py | Python | Python/Ex105.py | EspagueteTV/Meus-Estudos-CursoEmVideo | 1bf3cc367bc754625a3fd59114ab63470e8d934b | [
"MIT"
] | null | null | null | Python/Ex105.py | EspagueteTV/Meus-Estudos-CursoEmVideo | 1bf3cc367bc754625a3fd59114ab63470e8d934b | [
"MIT"
] | null | null | null | Python/Ex105.py | EspagueteTV/Meus-Estudos-CursoEmVideo | 1bf3cc367bc754625a3fd59114ab63470e8d934b | [
"MIT"
] | null | null | null | def notas(*num, sit=False):
"""
-> Função para analizar as notas e situação dos alunos
:param num: Recebe as notas dos alunos
:param sit: (opcional) mostrar a situação dos alunos
:return: Um dicionário com as informações dos alunos
"""
aluno = dict()
aluno['total'] = len(num)
# Verifica... | 25.975 | 58 | 0.530318 | def notas(*num, sit=False):
aluno = dict()
aluno['total'] = len(num)
mai = men = 0
for c in range(0, len(num)):
if c == 0:
mai = men = num[0]
if num[c] > mai:
mai = num[c]
if num[c] < men:
men = num[c]
aluno['maior'] = mai
aluno['menor... | true | true |
08f8876e75c4f6713a06eedc0b69361ce1de85be | 19,076 | py | Python | paper_plots/presentation/null_test_presentation.py | amanchokshi/mwa-satellites | f9e8de353e7eddf28ed715c01d7d3fb5336f0f18 | [
"MIT"
] | 1 | 2020-08-10T11:42:55.000Z | 2020-08-10T11:42:55.000Z | paper_plots/presentation/null_test_presentation.py | amanchokshi/mwa-satellites | f9e8de353e7eddf28ed715c01d7d3fb5336f0f18 | [
"MIT"
] | 9 | 2020-11-16T03:05:16.000Z | 2020-11-20T23:49:09.000Z | paper_plots/presentation/null_test_presentation.py | amanchokshi/mwa-satellites | f9e8de353e7eddf28ed715c01d7d3fb5336f0f18 | [
"MIT"
] | 1 | 2021-12-27T02:34:30.000Z | 2021-12-27T02:34:30.000Z | import numpy as np
import healpy as hp
import scipy.optimize as opt
import numpy.polynomial.polynomial as poly
def hp_slices_horizon(nside=None):
"""Healpix pix indices of NS, EW slices and above horizon"""
# theta phi values of each pixel
hp_indices = np.arange(hp.nside2npix(nside))
θ, ɸ = hp.pix2ang... | 29.302611 | 110 | 0.62728 | import numpy as np
import healpy as hp
import scipy.optimize as opt
import numpy.polynomial.polynomial as poly
def hp_slices_horizon(nside=None):
hp_indices = np.arange(hp.nside2npix(nside))
θ, ɸ = hp.pix2ang(nside, hp_indices)
above_horizon_indices = np.where(θ <= np.radians(80))[0]
ɸ_a... | true | true |
08f88793dc5eb91d27717afd0edd6f4630b03b91 | 1,802 | py | Python | readings27.py | fledge-iot/fledge-filter-python27 | 7adbbdf9804d95230f2abe281a805311d151df21 | [
"Apache-2.0"
] | null | null | null | readings27.py | fledge-iot/fledge-filter-python27 | 7adbbdf9804d95230f2abe281a805311d151df21 | [
"Apache-2.0"
] | null | null | null | readings27.py | fledge-iot/fledge-filter-python27 | 7adbbdf9804d95230f2abe281a805311d151df21 | [
"Apache-2.0"
] | null | null | null | """
Fledge filtering fro readings data
"""
__author__ = "Massimiliano Pinto"
__copyright__ = "Copyright (c) 2018 Dianomic Systems"
__license__ = "Apache 2.0"
__version__ = "${VERSION}"
import sys
import json
"""
Filter configuration set by set_filter_config(config)
"""
"""
filter_config, global variable
"""
filter_... | 24.026667 | 71 | 0.645949 | """
Fledge filtering fro readings data
"""
__author__ = "Massimiliano Pinto"
__copyright__ = "Copyright (c) 2018 Dianomic Systems"
__license__ = "Apache 2.0"
__version__ = "${VERSION}"
import sys
import json
"""
Filter configuration set by set_filter_config(config)
"""
"""
filter_config, global variable
"""
filter_... | false | true |
08f88851430c53b0d9dcb20551db3449827c9508 | 194 | py | Python | train/admin.py | amateur-dev/django_trainbooking_tutorial | 3160827a6817c772e7fe2c34c981c017942fcc4f | [
"BSD-3-Clause"
] | 1 | 2019-09-16T06:29:25.000Z | 2019-09-16T06:29:25.000Z | train/admin.py | amateur-dev/django_trainbooking_tutorial | 3160827a6817c772e7fe2c34c981c017942fcc4f | [
"BSD-3-Clause"
] | null | null | null | train/admin.py | amateur-dev/django_trainbooking_tutorial | 3160827a6817c772e7fe2c34c981c017942fcc4f | [
"BSD-3-Clause"
] | null | null | null | from django.contrib import admin
from . import models
# Register your models here.
admin.site.register(models.Train)
admin.site.register(models.Station)
admin.site.register(models.Passenger)
| 19.4 | 37 | 0.804124 | from django.contrib import admin
from . import models
admin.site.register(models.Train)
admin.site.register(models.Station)
admin.site.register(models.Passenger)
| true | true |
08f8887fe748fec7db136c9f94b91daaecec4244 | 2,654 | py | Python | sdk/python/pulumi_azure_native/logic/list_integration_account_callback_url.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/logic/list_integration_account_callback_url.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/logic/list_integration_account_callback_url.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
from ... | 35.864865 | 163 | 0.6737 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
from ._enums import *
__all__ = [
'ListIntegrationAccountCallbackUrlResult',
'AwaitableListIntegrationAccountCallbackUrlResult',
'list_integration_account_callb... | true | true |
08f889982cad3d1ea8e5294f8cde3e34ef9a13d5 | 8,542 | py | Python | lib/make_cask.py | SAP/SapMachine-infrastructure | 3cf6e10b1bb2beec3e3da9080eb5c33700464663 | [
"Apache-2.0"
] | 21 | 2018-04-02T08:02:04.000Z | 2022-01-04T19:50:34.000Z | lib/make_cask.py | SAP/SapMachine-infrastructure | 3cf6e10b1bb2beec3e3da9080eb5c33700464663 | [
"Apache-2.0"
] | 5 | 2021-01-05T09:31:30.000Z | 2021-11-20T22:00:23.000Z | lib/make_cask.py | SAP/SapMachine-infrastructure | 3cf6e10b1bb2beec3e3da9080eb5c33700464663 | [
"Apache-2.0"
] | 11 | 2018-08-31T02:37:55.000Z | 2022-02-27T09:00:14.000Z | '''
Copyright (c) 2001-2019 by SAP SE, Walldorf, Germany.
All rights reserved. Confidential and proprietary.
'''
import argparse
import os
import re
import sys
import utils
import versions
from os.path import join
from string import Template
from versions import SapMachineTag
release_cask_template = '''
cask 'sapmac... | 43.805128 | 223 | 0.691407 |
import argparse
import os
import re
import sys
import utils
import versions
from os.path import join
from string import Template
from versions import SapMachineTag
release_cask_template = '''
cask 'sapmachine${MAJOR}-${IMAGE_TYPE}' do
version '${VERSION}'
sha256 '${SHA256}'
url "https://github.com/SAP/SapMach... | true | true |
08f889e2856ec9c7ce9837a526894260c05f5ea8 | 255 | py | Python | WS.py | KaiGeffen/Celestial | 01c0f428f0a1d981c712ceaeddbe7eac1caaea16 | [
"CC-BY-3.0"
] | null | null | null | WS.py | KaiGeffen/Celestial | 01c0f428f0a1d981c712ceaeddbe7eac1caaea16 | [
"CC-BY-3.0"
] | null | null | null | WS.py | KaiGeffen/Celestial | 01c0f428f0a1d981c712ceaeddbe7eac1caaea16 | [
"CC-BY-3.0"
] | null | null | null | import internet.WebSocketServer as ws
# Runs the authentication server
# import threading
# import internet.Authenticate as auth
# print('Starting the authentication server...')
# import Authenticate
print('Starting the websocket server...')
ws.main()
| 21.25 | 48 | 0.776471 | import internet.WebSocketServer as ws
print('Starting the websocket server...')
ws.main()
| true | true |
08f88b4f4cc642616abf708ec66ed9aead22e5bb | 54,610 | py | Python | qcodes/instrument_drivers/AlazarTech/ATS.py | nulinspiratie/Qcodes | d050d38ac83f532523a39549c3247dfa6096a36e | [
"MIT"
] | 2 | 2017-02-27T06:02:39.000Z | 2019-06-03T04:56:59.000Z | qcodes/instrument_drivers/AlazarTech/ATS.py | nulinspiratie/Qcodes | d050d38ac83f532523a39549c3247dfa6096a36e | [
"MIT"
] | 50 | 2017-04-12T04:03:15.000Z | 2022-03-09T00:41:43.000Z | qcodes/instrument_drivers/AlazarTech/ATS.py | nulinspiratie/Qcodes | d050d38ac83f532523a39549c3247dfa6096a36e | [
"MIT"
] | null | null | null | import socket
import ctypes
from ctypes import wintypes as wt
import logging
import numpy as np
import os
from qcodes.instrument.base import Instrument
from qcodes.utils import validators
from qcodes.instrument.parameter import Parameter, MultiParameter
# TODO(damazter) (C) logging
# these items are important for ge... | 38.675637 | 119 | 0.601685 | import socket
import ctypes
from ctypes import wintypes as wt
import logging
import numpy as np
import os
from qcodes.instrument.base import Instrument
from qcodes.utils import validators
from qcodes.instrument.parameter import Parameter, MultiParameter
logger = logging.getLogger(__name__)
class AlazarTech_ATS(In... | true | true |
08f88b7c6a9df01d43f31b2cfa97090d92545190 | 1,945 | py | Python | util/createramdisk.py | Dennisbonke/toaruos | 487293913d47347cf8f2021b36a226e674d7faa7 | [
"NCSA"
] | 1 | 2020-11-03T16:18:03.000Z | 2020-11-03T16:18:03.000Z | util/createramdisk.py | Dennisbonke/toaruos | 487293913d47347cf8f2021b36a226e674d7faa7 | [
"NCSA"
] | null | null | null | util/createramdisk.py | Dennisbonke/toaruos | 487293913d47347cf8f2021b36a226e674d7faa7 | [
"NCSA"
] | null | null | null | #!/usr/bin/python3
"""
Generates, from this source repository, a "tarramdisk" - a ustar archive
suitable for booting ToaruOS.
"""
import os
import tarfile
users = {
'root': 0,
'local': 1000,
}
restricted_files = {
'etc/master.passwd': 0o600,
'etc/sudoers': 0o600,
'tmp': 0o777,
'var': 0o755,
... | 30.873016 | 99 | 0.65964 |
import os
import tarfile
users = {
'root': 0,
'local': 1000,
}
restricted_files = {
'etc/master.passwd': 0o600,
'etc/sudoers': 0o600,
'tmp': 0o777,
'var': 0o755,
'bin/sudo': 0o4555,
'bin/gsudo': 0o4555,
}
def file_filter(tarinfo):
tarinfo.uid = 0
tarinfo.gid = 0
if t... | true | true |
08f88b98b289844aaf115b3bc9ae7f0da81cc611 | 1,108 | py | Python | cifar/models/oneshot.py | youngleox/gmu | 0ab963976098ce7861c462ddae136ac92edd9916 | [
"MIT"
] | null | null | null | cifar/models/oneshot.py | youngleox/gmu | 0ab963976098ce7861c462ddae136ac92edd9916 | [
"MIT"
] | null | null | null | cifar/models/oneshot.py | youngleox/gmu | 0ab963976098ce7861c462ddae136ac92edd9916 | [
"MIT"
] | null | null | null | import sys
import math
import numpy as np
import torch
from torch import Tensor
from torch.nn.init import constant_
from torch.nn.modules import Module
from torch.nn import functional as F
def stats(x):
with torch.no_grad():
if x.dim() == 4:
#print(x.shape)
#print( x.mean(dim=(0,2,3... | 27.02439 | 73 | 0.525271 | import sys
import math
import numpy as np
import torch
from torch import Tensor
from torch.nn.init import constant_
from torch.nn.modules import Module
from torch.nn import functional as F
def stats(x):
with torch.no_grad():
if x.dim() == 4:
if x.shape[0] > 2:
... | true | true |
08f88c62ca8cc18686a196f1378afc4c78b0f0d4 | 1,632 | py | Python | serving_utils/protos/list_models_pb2_grpc.py | PEAT-AI/serving-utils | 5d69d110cb92f0bae3a158582fc49d20a5e9a944 | [
"Apache-2.0"
] | 7 | 2019-06-03T02:17:27.000Z | 2021-06-07T14:16:39.000Z | serving_utils/protos/list_models_pb2_grpc.py | PEAT-AI/serving-utils | 5d69d110cb92f0bae3a158582fc49d20a5e9a944 | [
"Apache-2.0"
] | 28 | 2018-07-16T11:22:46.000Z | 2020-05-10T13:24:56.000Z | serving_utils/protos/list_models_pb2_grpc.py | PEAT-AI/serving-utils | 5d69d110cb92f0bae3a158582fc49d20a5e9a944 | [
"Apache-2.0"
] | 3 | 2019-06-03T02:17:28.000Z | 2021-01-21T09:18:30.000Z | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from serving_utils.protos import list_models_pb2 as serving__utils_dot_protos_dot_list__models__pb2
class ListModelsStub(object):
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
""... | 34.723404 | 115 | 0.78125 | import grpc
from serving_utils.protos import list_models_pb2 as serving__utils_dot_protos_dot_list__models__pb2
class ListModelsStub(object):
pass
def __init__(self, channel):
self.ListModels = channel.unary_unary(
'/ListModels/ListModels',
request_serializer=serving__utils_dot_protos_dot_... | true | true |
08f88cca45c2279add255acfe141a29f7dccd70d | 4,043 | py | Python | public_ip_monitor.py | brooklet/PublicIpMonitor | d21cd0248344f5da828064086872951d61d9a75b | [
"Apache-2.0"
] | null | null | null | public_ip_monitor.py | brooklet/PublicIpMonitor | d21cd0248344f5da828064086872951d61d9a75b | [
"Apache-2.0"
] | null | null | null | public_ip_monitor.py | brooklet/PublicIpMonitor | d21cd0248344f5da828064086872951d61d9a75b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: UTF-8 -*-
# pip install requests
import re
import os
import os.path
import requests
import smtplib
from email.mime.text import MIMEText
from email.header import Header
import urllib3.connection
# resolve ip from they servers, try one by one
resolve_ip_servers = ['http:/... | 30.398496 | 111 | 0.516201 |
import re
import os
import os.path
import requests
import smtplib
from email.mime.text import MIMEText
from email.header import Header
import urllib3.connection
resolve_ip_servers = ['http://icanhazip.com/',
'http://www.trackip.net/ip', 'http://ifconfig.me/ip']
last_ip_file_name ... | true | true |
08f88cd25dc433eba9abd0fc8cf91829dbd69946 | 3,043 | py | Python | barpyrus/conky.py | AckslD/barpyrus | a89ef3b1453b27998940137b1ccee47d23a19612 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | barpyrus/conky.py | AckslD/barpyrus | a89ef3b1453b27998940137b1ccee47d23a19612 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | barpyrus/conky.py | AckslD/barpyrus | a89ef3b1453b27998940137b1ccee47d23a19612 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | #!/usr/bin/env python3
import contextlib
import subprocess
import time
import sys
import select
import os
from barpyrus.widgets import RawLabel
from barpyrus.core import EventInput
from barpyrus.core import TextPainter
class Conky(EventInput):
def __init__(self, text='Conky $conky_version', config = { }, lua = ""... | 30.43 | 76 | 0.582649 |
import contextlib
import subprocess
import time
import sys
import select
import os
from barpyrus.widgets import RawLabel
from barpyrus.core import EventInput
from barpyrus.core import TextPainter
class Conky(EventInput):
def __init__(self, text='Conky $conky_version', config = { }, lua = ""):
command = [ ... | true | true |
08f88ce3ee599ce007383a4a8e3ed2f483e8dbe0 | 14,882 | py | Python | util/reggen/gen_cheader.py | Yetizone/opentitan | 7c66e95964adc22a32810d818994900ec6f38e00 | [
"Apache-2.0"
] | null | null | null | util/reggen/gen_cheader.py | Yetizone/opentitan | 7c66e95964adc22a32810d818994900ec6f38e00 | [
"Apache-2.0"
] | null | null | null | util/reggen/gen_cheader.py | Yetizone/opentitan | 7c66e95964adc22a32810d818994900ec6f38e00 | [
"Apache-2.0"
] | null | null | null | # Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
"""
Generate C header from validated register JSON tree
"""
import io
import logging as log
import sys
import textwrap
import warnings
def genout(outfile, msg):
outfi... | 35.099057 | 100 | 0.589974 |
import io
import logging as log
import sys
import textwrap
import warnings
def genout(outfile, msg):
outfile.write(msg)
def as_define(s):
s = s.upper()
r = ''
for i in range(0, len(s)):
r += s[i] if s[i].isalnum() else '_'
return r
def first_line(s):
return s.splitlines()[0]
def... | true | true |
08f88da933d4ca49e8f518859b3edb2494d7bc07 | 1,430 | py | Python | profiles_api/serializers.py | eferroni/profiles-rest-api | 5766b5ff9960cd407e6ad5f3646e6e9e1a493a3a | [
"MIT"
] | null | null | null | profiles_api/serializers.py | eferroni/profiles-rest-api | 5766b5ff9960cd407e6ad5f3646e6e9e1a493a3a | [
"MIT"
] | null | null | null | profiles_api/serializers.py | eferroni/profiles-rest-api | 5766b5ff9960cd407e6ad5f3646e6e9e1a493a3a | [
"MIT"
] | null | null | null | from rest_framework import serializers
from profiles_api import models
class HelloSerializer(serializers.Serializer):
"""Serializes a name fields for testing our API View"""
name = serializers.CharField(max_length=10)
class UserProfileSerializer(serializers.ModelSerializer):
"""Serializes a user profil... | 31.777778 | 81 | 0.64965 | from rest_framework import serializers
from profiles_api import models
class HelloSerializer(serializers.Serializer):
name = serializers.CharField(max_length=10)
class UserProfileSerializer(serializers.ModelSerializer):
class Meta:
model = models.UserProfile
fields = ("id", "email", "name"... | true | true |
08f88e1133c75fd5a7e178252e0e2cfc8dc3d036 | 453 | py | Python | rest_framework/tests/tests.py | mammique/django-rest-framework | afe12f8b1e50b065bb0b70e4d5e90cb66a2e30e5 | [
"Unlicense"
] | 3 | 2018-01-29T17:27:36.000Z | 2021-08-02T08:04:13.000Z | rest_framework/tests/tests.py | nschlemm/django-rest-framework | b950b025bc66e3018d5f74e1494ff17f7742be75 | [
"Unlicense"
] | 7 | 2019-10-06T14:48:03.000Z | 2021-09-08T01:20:06.000Z | rest_framework/tests/tests.py | nschlemm/django-rest-framework | b950b025bc66e3018d5f74e1494ff17f7742be75 | [
"Unlicense"
] | 1 | 2021-12-28T06:50:52.000Z | 2021-12-28T06:50:52.000Z | """
Force import of all modules in this package in order to get the standard test
runner to pick up the tests. Yowzers.
"""
from __future__ import unicode_literals
import os
modules = [filename.rsplit('.', 1)[0]
for filename in os.listdir(os.path.dirname(__file__))
if filename.endswith('.py') an... | 30.2 | 77 | 0.699779 | from __future__ import unicode_literals
import os
modules = [filename.rsplit('.', 1)[0]
for filename in os.listdir(os.path.dirname(__file__))
if filename.endswith('.py') and not filename.startswith('_')]
__test__ = dict()
for module in modules:
exec("from rest_framework.tests.%s import *" % ... | true | true |
08f88e6adf40c64f053be27abbd2db0d15c12429 | 962 | py | Python | ax/storage/sqa_store/timestamp.py | viotemp1/Ax | 87e2f33a02c745b40b2ea1332e649f298347f35d | [
"MIT"
] | 1,803 | 2019-05-01T16:04:15.000Z | 2022-03-31T16:01:29.000Z | ax/storage/sqa_store/timestamp.py | viotemp1/Ax | 87e2f33a02c745b40b2ea1332e649f298347f35d | [
"MIT"
] | 810 | 2019-05-01T07:17:47.000Z | 2022-03-31T23:58:46.000Z | ax/storage/sqa_store/timestamp.py | viotemp1/Ax | 87e2f33a02c745b40b2ea1332e649f298347f35d | [
"MIT"
] | 220 | 2019-05-01T05:37:22.000Z | 2022-03-29T04:30:45.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import datetime
from typing import Optional
from sqlalchemy.engine.interfaces import Dialect
from sqlalchemy.types imp... | 31.032258 | 80 | 0.7079 |
import datetime
from typing import Optional
from sqlalchemy.engine.interfaces import Dialect
from sqlalchemy.types import Integer, TypeDecorator
class IntTimestamp(TypeDecorator):
impl = Integer
def process_bind_param(
self, value: Optional[datetime.datetime], dialect: Dialect
) -> Opti... | true | true |
08f891922e468584a0efce96d6f8dce7ba6bb7b8 | 7,072 | py | Python | nanodet/model/backbone/shufflenetv2.py | 1713mz/nanodet | b446207c63f81dd4a2451728d141860544fbda99 | [
"Apache-2.0"
] | null | null | null | nanodet/model/backbone/shufflenetv2.py | 1713mz/nanodet | b446207c63f81dd4a2451728d141860544fbda99 | [
"Apache-2.0"
] | null | null | null | nanodet/model/backbone/shufflenetv2.py | 1713mz/nanodet | b446207c63f81dd4a2451728d141860544fbda99 | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
import torch.utils.model_zoo as model_zoo
from ..module.activation import act_layers
model_urls = {
"shufflenetv2_0.5x": "https://download.pytorch.org/models/shufflenetv2_x0.5-f707e7126e.pth", # noqa: E501
"shufflenetv2_1.0x": "https://download.pytorch.org/models/shufflenet... | 34 | 110 | 0.544966 | import torch
import torch.nn as nn
import torch.utils.model_zoo as model_zoo
from ..module.activation import act_layers
model_urls = {
"shufflenetv2_0.5x": "https://download.pytorch.org/models/shufflenetv2_x0.5-f707e7126e.pth", "shufflenetv2_1.0x": "https://download.pytorch.org/models/shufflenetv2_x1-5666bf0... | true | true |
08f8933e8fab5ba1e506e3075b873f5144f3ac56 | 2,453 | py | Python | stdnet/apps/columnts/__init__.py | stuaxo/python-stdnet | 78db5320bdedc3f28c5e4f38cda13a4469e35db7 | [
"BSD-3-Clause"
] | 61 | 2015-01-13T23:41:10.000Z | 2021-09-14T03:23:59.000Z | stdnet/apps/columnts/__init__.py | drscream/python-stdnet | 78db5320bdedc3f28c5e4f38cda13a4469e35db7 | [
"BSD-3-Clause"
] | 4 | 2015-02-28T08:57:14.000Z | 2020-12-29T17:14:43.000Z | stdnet/apps/columnts/__init__.py | drscream/python-stdnet | 78db5320bdedc3f28c5e4f38cda13a4469e35db7 | [
"BSD-3-Clause"
] | 12 | 2015-01-01T09:23:06.000Z | 2021-09-16T08:09:13.000Z | '''\
**backends**: :ref:`Redis <redis-server>`.
An application which implements a specialised remote
:class:`stdnet.odm.Structure` for managing numeric multivariate
timeseries_ and perform remote analysis on them. The main classes
for this application are :class:`ColumnTS`, the stand alone data structure,
and the corr... | 25.030612 | 78 | 0.695475 | from . import redis
from .models import *
| true | true |
08f8935f133f37a0f8be891853591c92bc626347 | 5,096 | py | Python | docs/conf.py | psydox/pyproj | af695bf44ad1c6d09290005a0979eae28a3c0d37 | [
"MIT"
] | 467 | 2019-03-19T14:56:31.000Z | 2022-03-31T17:28:52.000Z | docs/conf.py | psydox/pyproj | af695bf44ad1c6d09290005a0979eae28a3c0d37 | [
"MIT"
] | 661 | 2019-03-14T01:05:56.000Z | 2022-03-31T19:53:56.000Z | docs/conf.py | psydox/pyproj | af695bf44ad1c6d09290005a0979eae28a3c0d37 | [
"MIT"
] | 113 | 2019-03-14T02:56:26.000Z | 2022-03-31T17:57:35.000Z | #!/usr/bin/env python3
#
# pyproj documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 9 13:47:02 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... | 29.976471 | 79 | 0.679945 |
import os
import sys
import pyproj
sys.path.insert(0, os.path.abspath(".."))
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.viewcode",
"sphinx.ext.napoleon",
"sphinx.ext.intersphinx",
"sphinxarg.ext",
]
intersphinx_mapping = {
"proj": ("https://proj.org/", None),
}
templates_path = ["... | true | true |
08f893c21394fcf8e7dbee702f2f8b13d0dee2ca | 12,291 | py | Python | experiments/eval_images_simDisc.py | davesean/modular_semantic_segmentation | 5f9e34243915b862e8fef5e6195f1e29f4cebf50 | [
"BSD-3-Clause"
] | 2 | 2018-12-18T16:15:14.000Z | 2020-04-16T07:38:04.000Z | experiments/eval_images_simDisc.py | davesean/modular_semantic_segmentation | 5f9e34243915b862e8fef5e6195f1e29f4cebf50 | [
"BSD-3-Clause"
] | null | null | null | experiments/eval_images_simDisc.py | davesean/modular_semantic_segmentation | 5f9e34243915b862e8fef5e6195f1e29f4cebf50 | [
"BSD-3-Clause"
] | null | null | null | from os import path, environ
import os
import glob
import sacred as sc
import cv2
import scipy.misc
import numpy as np
import tensorflow as tf
import zipfile
from sacred.utils import apply_backspaces_and_linefeeds
from experiments.utils import get_observer, load_data
from xview.datasets import Cityscapes
from experimen... | 43.126316 | 177 | 0.607111 | from os import path, environ
import os
import glob
import sacred as sc
import cv2
import scipy.misc
import numpy as np
import tensorflow as tf
import zipfile
from sacred.utils import apply_backspaces_and_linefeeds
from experiments.utils import get_observer, load_data
from xview.datasets import Cityscapes
from experimen... | true | true |
08f893de62edb6f34259a003c7da2869c4b33701 | 1,654 | py | Python | website/notifications/constants.py | yuanyuan-deng/RDM-osf.io | e1c54e97c898d26406d71129db7e4baf82802224 | [
"Apache-2.0"
] | 11 | 2018-12-11T16:39:40.000Z | 2022-02-26T09:51:32.000Z | website/notifications/constants.py | yuanyuan-deng/RDM-osf.io | e1c54e97c898d26406d71129db7e4baf82802224 | [
"Apache-2.0"
] | 52 | 2018-04-13T05:03:21.000Z | 2022-03-22T02:56:19.000Z | website/notifications/constants.py | yuanyuan-deng/RDM-osf.io | e1c54e97c898d26406d71129db7e4baf82802224 | [
"Apache-2.0"
] | 16 | 2018-07-09T01:44:51.000Z | 2021-06-30T01:57:16.000Z | NODE_SUBSCRIPTIONS_AVAILABLE = {
'comments': 'Comments added',
'file_updated': 'Files updated'
}
# Note: if the subscription starts with 'global_', it will be treated like a default
# subscription. If no notification type has been assigned, the user subscription
# will default to 'email_transactional'.
USER_SU... | 32.431373 | 84 | 0.696493 | NODE_SUBSCRIPTIONS_AVAILABLE = {
'comments': 'Comments added',
'file_updated': 'Files updated'
}
USER_SUBSCRIPTIONS_AVAILABLE = {
'global_comment_replies': 'Replies to your comments',
'global_comments': 'Comments added',
'global_file_updated': 'Files updated',
'global_mentions': 'Mentions added... | true | true |
08f893fbb81989fd3a9ed76705afb37ae46aca14 | 965 | py | Python | src/03_generate_pseudo_labels/03_02_pseudo_label_dataset_a_dib/get_config.py | sergeykochetkov/kidney-1st | d4d543744a83a8b450af89f932a95a39b55fe893 | [
"MIT"
] | null | null | null | src/03_generate_pseudo_labels/03_02_pseudo_label_dataset_a_dib/get_config.py | sergeykochetkov/kidney-1st | d4d543744a83a8b450af89f932a95a39b55fe893 | [
"MIT"
] | null | null | null | src/03_generate_pseudo_labels/03_02_pseudo_label_dataset_a_dib/get_config.py | sergeykochetkov/kidney-1st | d4d543744a83a8b450af89f932a95a39b55fe893 | [
"MIT"
] | null | null | null | import torch
VERSION = '03_02'
def get_config():
config = {
'VERSION':VERSION,
'INPUT_PATH':'/mnt/750G/GIT/Kidney/data',
'OUTPUT_PATH':f'./result/{VERSION}/',
'external_data_path': '/mnt/750G/GIT/kidny_unlabeled_dib/DATASET_A_DIB',
'split_seed_list':[0],
'FOLD_LIST'... | 28.382353 | 80 | 0.569948 | import torch
VERSION = '03_02'
def get_config():
config = {
'VERSION':VERSION,
'INPUT_PATH':'/mnt/750G/GIT/Kidney/data',
'OUTPUT_PATH':f'./result/{VERSION}/',
'external_data_path': '/mnt/750G/GIT/kidny_unlabeled_dib/DATASET_A_DIB',
'split_seed_list':[0],
'FOLD_LIST'... | true | true |
08f894033ed08add1989d0222afba1bc96016115 | 981 | py | Python | mask_detector/routes.py | Guest-01/mask-detector | 524d215d396dfeee60ae03f61835ca05854a56dc | [
"MIT"
] | null | null | null | mask_detector/routes.py | Guest-01/mask-detector | 524d215d396dfeee60ae03f61835ca05854a56dc | [
"MIT"
] | null | null | null | mask_detector/routes.py | Guest-01/mask-detector | 524d215d396dfeee60ae03f61835ca05854a56dc | [
"MIT"
] | null | null | null | import os
from flask import Blueprint, flash, render_template, request
from werkzeug.utils import secure_filename
from mask_detector import BASE_DIR
from .detector import load_detect_save
bp = Blueprint("main", __name__)
imgpath = os.path.join(BASE_DIR, "static/userimg")
@bp.route("/")
def home():
print(imgp... | 26.513514 | 60 | 0.66055 | import os
from flask import Blueprint, flash, render_template, request
from werkzeug.utils import secure_filename
from mask_detector import BASE_DIR
from .detector import load_detect_save
bp = Blueprint("main", __name__)
imgpath = os.path.join(BASE_DIR, "static/userimg")
@bp.route("/")
def home():
print(imgp... | true | true |
08f894af1ef6d4f5c336a3e107ccc926aee359a1 | 153 | py | Python | tools/finest_resolution/builder.py | Mouse-Imaging-Centre/neuronix | a1ecc545044a71b773001b725b84f25518cabcb3 | [
"MIT"
] | null | null | null | tools/finest_resolution/builder.py | Mouse-Imaging-Centre/neuronix | a1ecc545044a71b773001b725b84f25518cabcb3 | [
"MIT"
] | null | null | null | tools/finest_resolution/builder.py | Mouse-Imaging-Centre/neuronix | a1ecc545044a71b773001b725b84f25518cabcb3 | [
"MIT"
] | null | null | null | import os
import nibabel as nib
img = nib.load(os.getenv("infile"))
with open(os.getenv("out"), 'w') as f:
f.write(str(min(img.header.get_zooms())))
| 19.125 | 43 | 0.673203 | import os
import nibabel as nib
img = nib.load(os.getenv("infile"))
with open(os.getenv("out"), 'w') as f:
f.write(str(min(img.header.get_zooms())))
| true | true |
08f895341a9b3e3c652d805da4702185cb377809 | 14,365 | py | Python | elevenclock/lang/lang_fr.py | Lacoi/ElevenClock | 77e05136c74340266f93650bd1c14cdda07c64d2 | [
"Apache-2.0"
] | null | null | null | elevenclock/lang/lang_fr.py | Lacoi/ElevenClock | 77e05136c74340266f93650bd1c14cdda07c64d2 | [
"Apache-2.0"
] | null | null | null | elevenclock/lang/lang_fr.py | Lacoi/ElevenClock | 77e05136c74340266f93650bd1c14cdda07c64d2 | [
"Apache-2.0"
] | null | null | null | # INSTRUCTIONS
# Translate the text and write it between the "
# EXAMPLE: original -> "This text is in english: value {0}"
# translation -> "Aquest text està en anglès: valor {0}"
# If you see sth like {0}, {1}, maintain it on the translated sentence
# Meke special attention to elements like "... | 71.113861 | 302 | 0.651096 |
# EXAMPLE: original -> "This text is in english: value {0}"
# translation -> "Aquest text està en anglès: valor {0}"
# If you see sth like {0}, {1}, maintain it on the translated sentence
# Meke special attention to elements like ":", etc.
lang_3_2 = {
"Use system accent color as backgro... | true | true |
08f8977fd8ab4365921b1cb5de476e06e7345d70 | 7,006 | py | Python | or_suite/agents/rl/utils/tree.py | JasmineSamadi/ORSuite | e2b2b0a5b497ea6566e794dcef1f176081fca4ce | [
"MIT"
] | 4 | 2021-12-01T10:56:17.000Z | 2022-02-06T17:07:43.000Z | or_suite/agents/rl/utils/tree.py | JasmineSamadi/ORSuite | e2b2b0a5b497ea6566e794dcef1f176081fca4ce | [
"MIT"
] | 2 | 2021-08-11T13:25:01.000Z | 2022-03-20T19:23:23.000Z | or_suite/agents/rl/utils/tree.py | JasmineSamadi/ORSuite | e2b2b0a5b497ea6566e794dcef1f176081fca4ce | [
"MIT"
] | 2 | 2021-07-27T02:39:37.000Z | 2022-02-14T21:03:15.000Z | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import matplotlib as mpl
from or_suite.agents.rl.utils.bounds_utils import bounds_contains, split_bounds
class Node():
"""
Node representing an l-infinity ball in R^d, that points
to sub-balls (defined via node ch... | 30.72807 | 124 | 0.572081 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import matplotlib as mpl
from or_suite.agents.rl.utils.bounds_utils import bounds_contains, split_bounds
class Node():
def __init__(self, bounds, depth, qVal, num_visits):
self.dim = len(bounds)
self... | true | true |
08f8981c8febe110fecddeb1cd410b888fb35a8f | 951 | py | Python | tests/test_videoanalyzer.py | gratuxri/play-chess-with-a-webcam | 9ef7ec306a2a612871fba83130ebee1f044ef0c1 | [
"Apache-2.0"
] | 17 | 2019-10-25T01:33:43.000Z | 2022-03-21T03:31:56.000Z | tests/test_videoanalyzer.py | gratuxri/play-chess-with-a-webcam | 9ef7ec306a2a612871fba83130ebee1f044ef0c1 | [
"Apache-2.0"
] | 34 | 2019-10-17T06:52:30.000Z | 2022-01-19T12:45:43.000Z | tests/test_videoanalyzer.py | gratuxri/play-chess-with-a-webcam | 9ef7ec306a2a612871fba83130ebee1f044ef0c1 | [
"Apache-2.0"
] | 4 | 2019-11-29T09:19:38.000Z | 2021-10-13T03:12:25.000Z | '''
Created on 2019-12-29
@author: wf
'''
# part of https://github.com/WolfgangFahl/play-chess-with-a-webcam
from pcwawc.videoanalyze import VideoAnalyzer
import getpass
from pcwawc.environment4test import Environment4Test
testEnv=Environment4Test()
from unittest import TestCase
class VideoAnalyzerTest(TestCase):
... | 32.793103 | 154 | 0.652997 | from pcwawc.videoanalyze import VideoAnalyzer
import getpass
from pcwawc.environment4test import Environment4Test
testEnv=Environment4Test()
from unittest import TestCase
class VideoAnalyzerTest(TestCase):
def test_videoanalyzer(self):
if getpass.getuser()=="wf2":
argv=["--input","/Users/wf/D... | true | true |
08f8982d136b723d70a0348af1e719dfb3e659b1 | 347 | py | Python | Models/migrations/0002_auto_20191117_0319.py | EmmanuelMuriungi/facepass | c16f5af4e8db59638666d708cba2042364be1f54 | [
"MIT"
] | 3 | 2020-09-24T22:57:13.000Z | 2022-02-01T17:17:26.000Z | Models/migrations/0002_auto_20191117_0319.py | EmmanuelMuriungi/facepass | c16f5af4e8db59638666d708cba2042364be1f54 | [
"MIT"
] | null | null | null | Models/migrations/0002_auto_20191117_0319.py | EmmanuelMuriungi/facepass | c16f5af4e8db59638666d708cba2042364be1f54 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.7 on 2019-11-17 00:19
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('records', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='records',
options={'verbose_name_plural': 'R... | 19.277778 | 55 | 0.596542 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('records', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='records',
options={'verbose_name_plural': 'Records'},
),
]
| true | true |
08f8994694888da95c740ab6acd80fa08740c97c | 1,026 | py | Python | 2019/day-2/advent-2019-day-2-puzzle-2.py | emddudley/advent-of-code-solutions | b507fffbed63fec577585a4c241a983413b1304c | [
"Unlicense"
] | null | null | null | 2019/day-2/advent-2019-day-2-puzzle-2.py | emddudley/advent-of-code-solutions | b507fffbed63fec577585a4c241a983413b1304c | [
"Unlicense"
] | null | null | null | 2019/day-2/advent-2019-day-2-puzzle-2.py | emddudley/advent-of-code-solutions | b507fffbed63fec577585a4c241a983413b1304c | [
"Unlicense"
] | null | null | null | # Advent of Code 2019 Solutions: Day 2, Puzzle 2
# https://github.com/emddudley/advent-of-code-solutions
with open('input', 'r') as f:
memory = [int(x) for x in f.read().strip().split(',')]
done = False
for noun in range(0, 100):
for verb in range(0, 100):
program = memory.copy()
program[1] ... | 25.65 | 65 | 0.520468 |
with open('input', 'r') as f:
memory = [int(x) for x in f.read().strip().split(',')]
done = False
for noun in range(0, 100):
for verb in range(0, 100):
program = memory.copy()
program[1] = noun
program[2] = verb
for opcode_index in range(0, len(program), 4):
opco... | true | true |
08f899c061dcc03f742d4f4ff8397ed192be4ae0 | 6,116 | py | Python | riam_api_client/models/inline_response20038.py | RiskAmerica/api-client-python | 468c554a0440bef5086828631e25d99d41e28571 | [
"MIT"
] | null | null | null | riam_api_client/models/inline_response20038.py | RiskAmerica/api-client-python | 468c554a0440bef5086828631e25d99d41e28571 | [
"MIT"
] | null | null | null | riam_api_client/models/inline_response20038.py | RiskAmerica/api-client-python | 468c554a0440bef5086828631e25d99d41e28571 | [
"MIT"
] | 1 | 2021-04-14T15:52:03.000Z | 2021-04-14T15:52:03.000Z | # coding: utf-8
"""
APIs RISKAMERICA
A continuación les presentamos la documentación las **APIs** **de** **RiskAmerica**, el cual es un servicio pagado ofrecido por RiskAmerica que se contrata por separado a nuestras otras ofertas de software. Algunas consideraciones que debe tener al momento de usar las API... | 37.066667 | 1,703 | 0.623447 |
import pprint
import re
import six
from .inline_response20038_message import InlineResponse20038Message
class InlineResponse20038(object):
swagger_types = {
'code': 'int',
'error': 'str',
'message': 'InlineResponse20038Message'
}
attribute_map = {
'code': 'code',
... | true | true |
08f89af2f09322a82a3682d95d2e38d343cabd14 | 5,954 | py | Python | medallion/backends/taxii/base.py | davidonzo/cti-taxii-server | e4e59cccf82264897dc274540aefbbfc4d39b22a | [
"BSD-3-Clause"
] | null | null | null | medallion/backends/taxii/base.py | davidonzo/cti-taxii-server | e4e59cccf82264897dc274540aefbbfc4d39b22a | [
"BSD-3-Clause"
] | null | null | null | medallion/backends/taxii/base.py | davidonzo/cti-taxii-server | e4e59cccf82264897dc274540aefbbfc4d39b22a | [
"BSD-3-Clause"
] | 1 | 2019-12-13T14:45:37.000Z | 2019-12-13T14:45:37.000Z |
class Backend(object):
def server_discovery(self):
"""
Fill:
Returns the discovery information (api_roots, etc) for this server
Args:
-none-
Returns:
discovery information
"""
raise NotImplementedError()
def get_collection... | 36.084848 | 113 | 0.629829 |
class Backend(object):
def server_discovery(self):
raise NotImplementedError()
def get_collections(self, api_root, start_index, end_index):
raise NotImplementedError()
def get_collection(self, api_root, collection_id):
raise NotImplementedError()
def get_object_manifest(self... | true | true |
08f89b6f05319982a82c25207fcc2cf4dc789ad2 | 833 | py | Python | tests/reasoning/logic/propositional/test_api_syntax.py | mikulatomas/LNN | dfcef594a241778946a3b78b0b8390eb202821de | [
"Apache-2.0"
] | 41 | 2021-12-07T11:48:20.000Z | 2022-03-29T04:16:16.000Z | tests/reasoning/logic/propositional/test_api_syntax.py | mikulatomas/LNN | dfcef594a241778946a3b78b0b8390eb202821de | [
"Apache-2.0"
] | 8 | 2022-02-16T08:50:00.000Z | 2022-03-31T08:37:28.000Z | tests/reasoning/logic/propositional/test_api_syntax.py | mikulatomas/LNN | dfcef594a241778946a3b78b0b8390eb202821de | [
"Apache-2.0"
] | 7 | 2021-12-03T16:51:45.000Z | 2022-03-10T07:51:29.000Z | ##
# Copyright 2021 IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
##
from lnn import Model, TRUE, AXIOM
def test():
model = Model()
smokes, friends = model.add_propositions("Smokes", "Friends")
# check that more propositions can be added
colleagues, gender = model.add_propos... | 23.138889 | 76 | 0.668667 |
from lnn import Model, TRUE, AXIOM
def test():
model = Model()
smokes, friends = model.add_propositions("Smokes", "Friends")
colleagues, gender = model.add_propositions("Colleagues", "GenderAlike")
assert colleagues.name == "Colleagues"
assert gender.name == "GenderAlike"
formula = smok... | true | true |
08f89e3b04611ee6e65eb811c1f6fcd2e4a9148c | 5,066 | py | Python | netbox/dcim/models/power.py | cybarox/netbox | ea197eff5f4fe925bb354d1375912decd81752bd | [
"Apache-2.0"
] | null | null | null | netbox/dcim/models/power.py | cybarox/netbox | ea197eff5f4fe925bb354d1375912decd81752bd | [
"Apache-2.0"
] | null | null | null | netbox/dcim/models/power.py | cybarox/netbox | ea197eff5f4fe925bb354d1375912decd81752bd | [
"Apache-2.0"
] | null | null | null | from django.contrib.contenttypes.fields import GenericRelation
from django.core.exceptions import ValidationError
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from django.urls import reverse
from dcim.choices import *
from dcim.constants import *
from netbox.mode... | 28.460674 | 108 | 0.644493 | from django.contrib.contenttypes.fields import GenericRelation
from django.core.exceptions import ValidationError
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from django.urls import reverse
from dcim.choices import *
from dcim.constants import *
from netbox.mode... | true | true |
08f89ea343a89ce04b6c6151b77eee3d229a94b5 | 322 | py | Python | ipybokeh/nbextension/__init__.py | pyviz/ipybokeh | 096b9c2db072bd9c283b16630db3d2fdd49a872a | [
"BSD-3-Clause"
] | 8 | 2019-06-11T13:32:12.000Z | 2019-08-10T01:03:58.000Z | ipybokeh/nbextension/__init__.py | pyviz/ipybokeh | 096b9c2db072bd9c283b16630db3d2fdd49a872a | [
"BSD-3-Clause"
] | 1 | 2019-11-04T15:04:20.000Z | 2019-11-04T15:04:20.000Z | ipybokeh/nbextension/__init__.py | philippjfr/ipybokeh | 096b9c2db072bd9c283b16630db3d2fdd49a872a | [
"BSD-3-Clause"
] | 1 | 2019-08-01T03:40:03.000Z | 2019-08-01T03:40:03.000Z | #!/usr/bin/env python
# coding: utf-8
# Copyright (c) Philipp Rudiger
# Distributed under the terms of the Modified BSD License.
def _jupyter_nbextension_paths():
return [{
'section': 'notebook',
'src': 'nbextension/static',
'dest': 'ipybokeh',
'require': 'ipybokeh/extension'
}... | 23 | 58 | 0.627329 |
def _jupyter_nbextension_paths():
return [{
'section': 'notebook',
'src': 'nbextension/static',
'dest': 'ipybokeh',
'require': 'ipybokeh/extension'
}]
| true | true |
08f89eb6ee6d5f02aa2f70c9483726cd8722a50e | 9,738 | py | Python | test/integration/ggrc/access_control/acl_propagation/test_auditors.py | pbedn/ggrc-core | 12ae4720a430730835f1d02def62c0f6ef453521 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2020-08-26T06:56:01.000Z | 2021-07-08T13:56:20.000Z | test/integration/ggrc/access_control/acl_propagation/test_auditors.py | pbedn/ggrc-core | 12ae4720a430730835f1d02def62c0f6ef453521 | [
"ECL-2.0",
"Apache-2.0"
] | 4 | 2021-02-02T23:04:30.000Z | 2022-03-02T09:54:47.000Z | test/integration/ggrc/access_control/acl_propagation/test_auditors.py | pbedn/ggrc-core | 12ae4720a430730835f1d02def62c0f6ef453521 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2016-08-23T10:51:19.000Z | 2016-08-23T10:51:19.000Z | # Copyright (C) 2019 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Test Access Control roles Auditors propagation."""
import ddt
from ggrc.models import all_models
from integration.ggrc.access_control import rbac_factories
from integration.ggrc.access_control.acl_propa... | 31.111821 | 78 | 0.440029 |
import ddt
from ggrc.models import all_models
from integration.ggrc.access_control import rbac_factories
from integration.ggrc.access_control.acl_propagation import base
from integration.ggrc.utils import helpers
@ddt.ddt
class TestAuditorsPropagation(base.TestACLPropagation):
PERMISSIONS = {
"Creator": {... | true | true |
08f89f17806761ab14746f746ab41773ed51e2ab | 525 | py | Python | commands/medicos.py | macoin-finance/telegram-bot | ea4a76356b0a80eb1ef0994c6be2048a0fc3c486 | [
"BSD-3-Clause"
] | 9 | 2021-07-10T04:43:30.000Z | 2022-02-23T04:57:15.000Z | commands/medicos.py | macoin-finance/telegram-bot | ea4a76356b0a80eb1ef0994c6be2048a0fc3c486 | [
"BSD-3-Clause"
] | 2 | 2021-07-12T01:56:18.000Z | 2021-07-12T02:05:42.000Z | commands/medicos.py | macoin-finance/telegram-bot | ea4a76356b0a80eb1ef0994c6be2048a0fc3c486 | [
"BSD-3-Clause"
] | 6 | 2021-07-10T04:44:32.000Z | 2021-07-28T16:34:51.000Z | MESSAGE_TEXT='**Carteira de MACOIN do Dr. Geovane Massa:**\t0x50f69C1683713AADeD613022a0f38Dbc1Cecc2Dd\n\nSite:\thttps://espacosativa.com.br/equipe-profissional/dr-geovane-massa/\n\nInstagram:\thttps://www.instagram.com/drgeovanemassa/\n\nMédico | Professor | Pesquisador | CRM: 26.153 BA\n\nContato: +55 71 99695-6256\n... | 105 | 354 | 0.748571 | MESSAGE_TEXT='**Carteira de MACOIN do Dr. Geovane Massa:**\t0x50f69C1683713AADeD613022a0f38Dbc1Cecc2Dd\n\nSite:\thttps://espacosativa.com.br/equipe-profissional/dr-geovane-massa/\n\nInstagram:\thttps://www.instagram.com/drgeovanemassa/\n\nMédico | Professor | Pesquisador | CRM: 26.153 BA\n\nContato: +55 71 99695-6256\n... | true | true |
08f89f6ad3ecb23d303e6a07a552a4624b6d6dd5 | 2,129 | py | Python | src/waldur_pid/tests/test_datacite.py | geant-multicloud/MCMS-mastermind | 81333180f5e56a0bc88d7dad448505448e01f24e | [
"MIT"
] | 26 | 2017-10-18T13:49:58.000Z | 2021-09-19T04:44:09.000Z | src/waldur_pid/tests/test_datacite.py | geant-multicloud/MCMS-mastermind | 81333180f5e56a0bc88d7dad448505448e01f24e | [
"MIT"
] | 14 | 2018-12-10T14:14:51.000Z | 2021-06-07T10:33:39.000Z | src/waldur_pid/tests/test_datacite.py | geant-multicloud/MCMS-mastermind | 81333180f5e56a0bc88d7dad448505448e01f24e | [
"MIT"
] | 32 | 2017-09-24T03:10:45.000Z | 2021-10-16T16:41:09.000Z | import mock
import requests
from rest_framework import test
from waldur_pid import backend
from waldur_pid.tests import factories
class DataciteTest(test.APITransactionTestCase):
def setUp(self):
super(DataciteTest, self).setUp()
self.offering = factories.OfferingFactory()
self.backend = ... | 34.901639 | 73 | 0.692344 | import mock
import requests
from rest_framework import test
from waldur_pid import backend
from waldur_pid.tests import factories
class DataciteTest(test.APITransactionTestCase):
def setUp(self):
super(DataciteTest, self).setUp()
self.offering = factories.OfferingFactory()
self.backend = ... | true | true |
08f8a130017167a53852746039883dbec11c2997 | 15,400 | py | Python | pfswift/pfswift.py | FNNDSC/pfswift | fa1c06295dd8e719f632e78a8bb6d4d5611015ef | [
"MIT"
] | null | null | null | pfswift/pfswift.py | FNNDSC/pfswift | fa1c06295dd8e719f632e78a8bb6d4d5611015ef | [
"MIT"
] | 1 | 2018-06-12T20:17:42.000Z | 2018-06-12T20:17:42.000Z | pfswift/pfswift.py | FNNDSC/pfswift | fa1c06295dd8e719f632e78a8bb6d4d5611015ef | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import abc
import time
import os
import json
import ast
import datetime
import socket
import uuid
import pfmisc
# pman local dependencies
try:
from .crunner import *
except:
from crunner import *
from pfmisc.C_snode impor... | 34.920635 | 97 | 0.498052 |
import abc
import time
import os
import json
import ast
import datetime
import socket
import uuid
import pfmisc
try:
from .crunner import *
except:
from crunner import *
from pfmisc.C_snode import *
from pfmisc._colors import Colors
import docker
import p... | true | true |
08f8a222e88d7b0db737031783beae20764d1b4d | 12,307 | py | Python | tests/unit/test_uta_database.py | cancervariants/uta-tools | 9d102ea96e5f7b07a862113ee07eca2ce3412ad4 | [
"MIT"
] | 1 | 2022-01-19T18:17:56.000Z | 2022-01-19T18:17:56.000Z | tests/unit/test_uta_database.py | cancervariants/uta-tools | 9d102ea96e5f7b07a862113ee07eca2ce3412ad4 | [
"MIT"
] | 25 | 2021-10-13T19:57:39.000Z | 2022-03-29T17:56:32.000Z | tests/unit/test_uta_database.py | cancervariants/uta-tools | 9d102ea96e5f7b07a862113ee07eca2ce3412ad4 | [
"MIT"
] | null | null | null | """Test UTA data source."""
import copy
import pytest
from uta_tools.data_sources import UTADatabase
@pytest.fixture(scope="module")
async def test_db():
"""Create uta db test fixture."""
test_uta_db = UTADatabase()
await test_uta_db._create_genomic_table()
return test_uta_db
@pytest.fixture(scope... | 33.717808 | 79 | 0.670513 | import copy
import pytest
from uta_tools.data_sources import UTADatabase
@pytest.fixture(scope="module")
async def test_db():
test_uta_db = UTADatabase()
await test_uta_db._create_genomic_table()
return test_uta_db
@pytest.fixture(scope="module")
def nm_152263_exons():
return ["117,234", "234,360"... | true | true |
08f8a2562ada52b792fc74428f4d34a8418a2f33 | 831 | py | Python | isi_sdk_9_0_0/test/test_s3_keys.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_9_0_0/test/test_s3_keys.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_9_0_0/test/test_s3_keys.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 10
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_9_0_0
from ... | 20.268293 | 79 | 0.679904 |
from __future__ import absolute_import
import unittest
import isi_sdk_9_0_0
from isi_sdk_9_0_0.models.s3_keys import S3Keys from isi_sdk_9_0_0.rest import ApiException
class TestS3Keys(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def testS3Keys(self):
... | true | true |
08f8a3ba6738d6a91456b25108e6c356727e8906 | 4,952 | py | Python | ionoscloud_dbaas_postgres/models/db_user.py | ionos-cloud/sdk-python-dbaas-postgres | b261553041f99143acec39740bae0b3f08d15799 | [
"Apache-2.0"
] | null | null | null | ionoscloud_dbaas_postgres/models/db_user.py | ionos-cloud/sdk-python-dbaas-postgres | b261553041f99143acec39740bae0b3f08d15799 | [
"Apache-2.0"
] | null | null | null | ionoscloud_dbaas_postgres/models/db_user.py | ionos-cloud/sdk-python-dbaas-postgres | b261553041f99143acec39740bae0b3f08d15799 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
IONOS DBaaS REST API
An enterprise-grade Database is provided as a Service (DBaaS) solution that can be managed through a browser-based \"Data Center Designer\" (DCD) tool or via an easy to use API. The API allows you to create additional database clusters or modify existing ones. It is d... | 31.948387 | 494 | 0.603796 |
import pprint
import re
import six
from ionoscloud_dbaas_postgres.configuration import Configuration
class DBUser(object):
openapi_types = {
'username': 'str',
'password': 'str',
}
attribute_map = {
'username': 'username',
'password': 'password',
}
def ... | true | true |
08f8a42fbc0288c7ccf9a50e204db573782b597e | 51,556 | py | Python | pylidc/Annotation.py | nguyenhoa93/pylidc | 8f3ef349b9573a894fac301ce8ccd9acbb9b8991 | [
"MIT"
] | 1 | 2021-02-24T17:11:24.000Z | 2021-02-24T17:11:24.000Z | pylidc/Annotation.py | nguyenhoa93/pylidc | 8f3ef349b9573a894fac301ce8ccd9acbb9b8991 | [
"MIT"
] | null | null | null | pylidc/Annotation.py | nguyenhoa93/pylidc | 8f3ef349b9573a894fac301ce8ccd9acbb9b8991 | [
"MIT"
] | null | null | null | import os, warnings
import sqlalchemy as sq
from sqlalchemy.orm import relationship
from ._Base import Base
from .Scan import Scan
import numpy as np
import matplotlib.pyplot as plt
# For contour to boolean mask function.
import matplotlib.path as mplpath
# For CT volume visualizer.
from matplotlib.patches import Re... | 37.224549 | 84 | 0.5495 | import os, warnings
import sqlalchemy as sq
from sqlalchemy.orm import relationship
from ._Base import Base
from .Scan import Scan
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.path as mplpath
from matplotlib.patches import Rectangle
from matplotlib.widgets import Slider, Button, CheckButtons
... | true | true |
08f8a5191c9fcf88d1b9a4e3e21471bcaf5c09e7 | 2,243 | py | Python | homeassistant/components/quantum_gateway/device_tracker.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 6 | 2020-07-18T16:33:25.000Z | 2021-09-26T09:52:04.000Z | homeassistant/components/quantum_gateway/device_tracker.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 78 | 2020-07-23T07:13:08.000Z | 2022-03-31T06:02:04.000Z | homeassistant/components/quantum_gateway/device_tracker.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 14 | 2018-08-19T16:28:26.000Z | 2021-09-02T18:26:53.000Z | """Support for Verizon FiOS Quantum Gateways."""
import logging
from quantum_gateway import QuantumGatewayScanner
from requests.exceptions import RequestException
import voluptuous as vol
from homeassistant.components.device_tracker import (
DOMAIN,
PLATFORM_SCHEMA,
DeviceScanner,
)
from homeassistant.con... | 31.591549 | 80 | 0.691485 | import logging
from quantum_gateway import QuantumGatewayScanner
from requests.exceptions import RequestException
import voluptuous as vol
from homeassistant.components.device_tracker import (
DOMAIN,
PLATFORM_SCHEMA,
DeviceScanner,
)
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_SSL
impo... | true | true |
08f8a51b27de4fb82d51660a6180362a63391147 | 785 | py | Python | meta_data/gcs_gcs.py | hilsdsg3/Google_Cloud_Platform_Demos | 891314269d078c133fa82f69d23f051c88879ad5 | [
"MIT"
] | null | null | null | meta_data/gcs_gcs.py | hilsdsg3/Google_Cloud_Platform_Demos | 891314269d078c133fa82f69d23f051c88879ad5 | [
"MIT"
] | null | null | null | meta_data/gcs_gcs.py | hilsdsg3/Google_Cloud_Platform_Demos | 891314269d078c133fa82f69d23f051c88879ad5 | [
"MIT"
] | null | null | null | import datetime
from airflow import models
from airflow.operators import bash_operator
default_dag_args = {
'start_date': datetime.datetime(2018, 12, 17, 0, 0),
'retries': 1,
'retry_delay': datetime.timedelta(minutes=2),
'project_id': models.Variable.get('gcp_project')
}
source_bucket = models.Variab... | 30.192308 | 59 | 0.732484 | import datetime
from airflow import models
from airflow.operators import bash_operator
default_dag_args = {
'start_date': datetime.datetime(2018, 12, 17, 0, 0),
'retries': 1,
'retry_delay': datetime.timedelta(minutes=2),
'project_id': models.Variable.get('gcp_project')
}
source_bucket = models.Variab... | true | true |
08f8a51cab3f2fa6fa9184b7f89c30925c370887 | 395 | py | Python | python/1074.py | clebsonc/UriOnlineJudge | 763cef77cf3d5088be34c54b0cf457c6ef90a88f | [
"MIT"
] | null | null | null | python/1074.py | clebsonc/UriOnlineJudge | 763cef77cf3d5088be34c54b0cf457c6ef90a88f | [
"MIT"
] | null | null | null | python/1074.py | clebsonc/UriOnlineJudge | 763cef77cf3d5088be34c54b0cf457c6ef90a88f | [
"MIT"
] | null | null | null | a = int(raw_input())
v = list()
for i in range(a):
v.append(int(raw_input()))
for value in v:
if value % 2 == 0:
if value > 0:
print 'EVEN POSITIVE'
elif value < 0:
print 'EVEN NEGATIVE'
else:
print 'NULL'
else:
if value > 0:
pr... | 20.789474 | 33 | 0.460759 | a = int(raw_input())
v = list()
for i in range(a):
v.append(int(raw_input()))
for value in v:
if value % 2 == 0:
if value > 0:
print 'EVEN POSITIVE'
elif value < 0:
print 'EVEN NEGATIVE'
else:
print 'NULL'
else:
if value > 0:
pr... | false | true |
08f8a576c392063c887229617641b0c1561929b4 | 1,200 | py | Python | pyannote/audio/models/embedding/__init__.py | hadware/pyannote-audio | dff09d364a019dff78cafb5d52c8490ab3d937df | [
"MIT"
] | 1 | 2022-02-23T08:46:10.000Z | 2022-02-23T08:46:10.000Z | pyannote/audio/models/embedding/__init__.py | hadware/pyannote-audio | dff09d364a019dff78cafb5d52c8490ab3d937df | [
"MIT"
] | 2 | 2022-02-16T14:19:17.000Z | 2022-02-23T14:12:28.000Z | pyannote/audio/models/embedding/__init__.py | FrenchKrab/pyannote-audio | 14e3b999e3b3fa6063d6401c375a9f7a2534cb74 | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (c) 2020-2021 CNRS
#
# 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, pu... | 44.444444 | 80 | 0.776667 |
from .xvector import XVectorMFCC, XVectorSincNet
__all__ = ["XVectorSincNet", "XVectorMFCC"]
| true | true |
08f8a5be2acfb48e73d27049e397ba883c2cd25f | 22,492 | py | Python | docs/source/conf.py | ismaelJimenez/quantopy | 955969ecd34f7619050ad38f612b1bafc05d159c | [
"MIT"
] | 2 | 2021-06-14T02:36:17.000Z | 2021-06-14T02:36:24.000Z | docs/source/conf.py | ismaelJimenez/quantopy | 955969ecd34f7619050ad38f612b1bafc05d159c | [
"MIT"
] | 4 | 2021-06-03T07:07:41.000Z | 2021-06-04T20:14:10.000Z | docs/source/conf.py | ismaelJimenez/quantopy | 955969ecd34f7619050ad38f612b1bafc05d159c | [
"MIT"
] | 2 | 2021-06-08T10:47:26.000Z | 2021-06-12T08:20:00.000Z | #
# quantopy documentation build configuration file, created by
#
# This file is execfile()d with the current directory set to its containing
# dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# ... | 31.858357 | 94 | 0.670016 |
from datetime import datetime
import importlib
import inspect
import logging
import os
import sys
import jinja2
from numpydoc.docscrape import NumpyDocString
from sphinx.ext.autosummary import _import_by_name
logger = logging.getLogger(__name__)
sys.setrecursionlimit(5000)
# If extensions (or modules to document w... | true | true |
08f8a5c613b831e3f9f1559d7af8882ad5fd56a6 | 505 | py | Python | venv/Lib/site-packages/stevedore/example/base.py | dhina016/OnCV | 2429ba7bc8589e92b2c273af6e8763487e1e05a8 | [
"Unlicense",
"MIT"
] | null | null | null | venv/Lib/site-packages/stevedore/example/base.py | dhina016/OnCV | 2429ba7bc8589e92b2c273af6e8763487e1e05a8 | [
"Unlicense",
"MIT"
] | 4 | 2021-03-31T20:05:34.000Z | 2022-01-13T03:08:13.000Z | virtual/lib/python3.6/site-packages/stevedore/example/base.py | Mercy-Njoroge/blog | 404336fb0fc8d172ddde8b744042cb3f37d89c65 | [
"MIT"
] | null | null | null | import abc
class FormatterBase(metaclass=abc.ABCMeta):
"""Base class for example plugin used in the tutorial.
"""
def __init__(self, max_width=60):
self.max_width = max_width
@abc.abstractmethod
def format(self, data):
"""Format the data and return unicode text.
:param d... | 25.25 | 70 | 0.621782 | import abc
class FormatterBase(metaclass=abc.ABCMeta):
def __init__(self, max_width=60):
self.max_width = max_width
@abc.abstractmethod
def format(self, data):
| true | true |
08f8a7135bdd322efc9d3130c6fe4f15ea3f9375 | 30,328 | py | Python | tests.py | akursar/async-kinesis | dcaf7f736195954545a5fb755af08c3b47874d81 | [
"Apache-2.0"
] | null | null | null | tests.py | akursar/async-kinesis | dcaf7f736195954545a5fb755af08c3b47874d81 | [
"Apache-2.0"
] | null | null | null | tests.py | akursar/async-kinesis | dcaf7f736195954545a5fb755af08c3b47874d81 | [
"Apache-2.0"
] | null | null | null | import os
import uuid
import asyncio
import logging, coloredlogs
from dotenv import load_dotenv
from asynctest import TestCase as AsynTestCase, fail_on
from unittest import skipUnless, TestCase
from kinesis import Consumer, Producer, MemoryCheckPointer, RedisCheckPointer
from kinesis.processors import (
StringProce... | 31.169579 | 112 | 0.597962 | import os
import uuid
import asyncio
import logging, coloredlogs
from dotenv import load_dotenv
from asynctest import TestCase as AsynTestCase, fail_on
from unittest import skipUnless, TestCase
from kinesis import Consumer, Producer, MemoryCheckPointer, RedisCheckPointer
from kinesis.processors import (
StringProce... | true | true |
08f8a7ae14ec6898a5eff1114c0ab082a79a2863 | 7,363 | py | Python | huaweicloud-sdk-iec/huaweicloudsdkiec/v1/model/list_flavors_request.py | githubmilesma/huaweicloud-sdk-python-v3 | 9d9449ed68a609ca65f0aa50b5b2a1c28445bf03 | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-iec/huaweicloudsdkiec/v1/model/list_flavors_request.py | githubmilesma/huaweicloud-sdk-python-v3 | 9d9449ed68a609ca65f0aa50b5b2a1c28445bf03 | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-iec/huaweicloudsdkiec/v1/model/list_flavors_request.py | githubmilesma/huaweicloud-sdk-python-v3 | 9d9449ed68a609ca65f0aa50b5b2a1c28445bf03 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
import pprint
import re
import six
class ListFlavorsRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value... | 23.828479 | 135 | 0.544208 |
import pprint
import re
import six
class ListFlavorsRequest:
sensitive_list = []
openapi_types = {
'offset': 'int',
'limit': 'int',
'name': 'str',
'area': 'str',
'province': 'str',
'city': 'str',
'operator': 'str',
'id': 'str',
'... | true | true |
08f8a7f64a150838378c7d4ca59dc82306236207 | 14,341 | py | Python | multiview/bundle_adjustment.py | greatwallet/cosypose | e72ce7d521ef61870daef267cbbe65aaebe9d24d | [
"MIT"
] | null | null | null | multiview/bundle_adjustment.py | greatwallet/cosypose | e72ce7d521ef61870daef267cbbe65aaebe9d24d | [
"MIT"
] | null | null | null | multiview/bundle_adjustment.py | greatwallet/cosypose | e72ce7d521ef61870daef267cbbe65aaebe9d24d | [
"MIT"
] | null | null | null | import numpy as np
from collections import defaultdict
import torch
import pandas as pd
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import connected_components
import cosypose.utils.tensor_collection as tc
from cosypose.lib3d.transform_ops import invert_T, compute_transform_from_pose9d
fro... | 40.741477 | 121 | 0.581759 | import numpy as np
from collections import defaultdict
import torch
import pandas as pd
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import connected_components
import cosypose.utils.tensor_collection as tc
from cosypose.lib3d.transform_ops import invert_T, compute_transform_from_pose9d
fro... | true | true |
08f8a801dbe69a5c4e8efcc27e18965a143bc3cb | 58,640 | py | Python | msgraph-cli-extensions/v1_0/notes_v1_0/azext_notes_v1_0/vendored_sdks/notes/aio/operations/_sites_onenote_pages_parent_section_parent_notebook_section_groups_operations.py | thewahome/msgraph-cli | 33127d9efa23a0e5f5303c93242fbdbb73348671 | [
"MIT"
] | null | null | null | msgraph-cli-extensions/v1_0/notes_v1_0/azext_notes_v1_0/vendored_sdks/notes/aio/operations/_sites_onenote_pages_parent_section_parent_notebook_section_groups_operations.py | thewahome/msgraph-cli | 33127d9efa23a0e5f5303c93242fbdbb73348671 | [
"MIT"
] | 22 | 2022-03-29T22:54:37.000Z | 2022-03-29T22:55:27.000Z | msgraph-cli-extensions/v1_0/notes_v1_0/azext_notes_v1_0/vendored_sdks/notes/aio/operations/_sites_onenote_pages_parent_section_parent_notebook_section_groups_operations.py | thewahome/msgraph-cli | 33127d9efa23a0e5f5303c93242fbdbb73348671 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 47.869388 | 205 | 0.654332 | from typing import Any, AsyncIterable, Callable, Dict, Generic, List, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.c... | true | true |
08f8a8647a332ef3d45183e906c86bf91e735614 | 1,123 | py | Python | setup.py | swagatobag2000/sb_utility_library | c85ece314e33bca21ff02fe288584450119de59f | [
"MIT"
] | 1 | 2021-10-03T11:46:52.000Z | 2021-10-03T11:46:52.000Z | setup.py | swagatobag2000/sb_utility_library | c85ece314e33bca21ff02fe288584450119de59f | [
"MIT"
] | null | null | null | setup.py | swagatobag2000/sb_utility_library | c85ece314e33bca21ff02fe288584450119de59f | [
"MIT"
] | null | null | null | import os
import codecs
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
VERSION = '0.0.2'
DESCRIPTION = 'Convert your file as you wish'
long_description = ''
with codecs.open(os.path.join(here, "README.md"), encoding="utf-8") as fh:
long_description = "\n" + fh.read()... | 32.085714 | 122 | 0.652716 | import os
import codecs
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
VERSION = '0.0.2'
DESCRIPTION = 'Convert your file as you wish'
long_description = ''
with codecs.open(os.path.join(here, "README.md"), encoding="utf-8") as fh:
long_description = "\n" + fh.read()... | true | true |
08f8a87aeba3462c9126fb6e93ae293b5badb493 | 8,265 | py | Python | modules/stixhelpers.py | optrudra/attack-website | d6df72fa56dde100444dd76985eb4b9b382c20b0 | [
"Apache-2.0"
] | null | null | null | modules/stixhelpers.py | optrudra/attack-website | d6df72fa56dde100444dd76985eb4b9b382c20b0 | [
"Apache-2.0"
] | null | null | null | modules/stixhelpers.py | optrudra/attack-website | d6df72fa56dde100444dd76985eb4b9b382c20b0 | [
"Apache-2.0"
] | null | null | null | import json
import stix2
import stix2.utils
from . import config
from . import util
def get_mitigation_list(src):
"""Reads the STIX and returns a list of all mitigations in the STIX"""
mitigations = src.query([
stix2.Filter('type', '=', 'course-of-action'),
stix2.Filter('revoked', '=', False)
... | 33.192771 | 115 | 0.584029 | import json
import stix2
import stix2.utils
from . import config
from . import util
def get_mitigation_list(src):
mitigations = src.query([
stix2.Filter('type', '=', 'course-of-action'),
stix2.Filter('revoked', '=', False)
])
mitigations = [x for x in mitigations if not hasattr(x, 'x_... | true | true |
08f8a97aa59f8dfeed7943458a44b0af1646bb99 | 2,869 | py | Python | algorithms/DNEH_SMR.py | TatianaPorras/MNIG_to_FMMSP | 1a62884237a4133f1417982d88f8a1421a972a08 | [
"MIT"
] | null | null | null | algorithms/DNEH_SMR.py | TatianaPorras/MNIG_to_FMMSP | 1a62884237a4133f1417982d88f8a1421a972a08 | [
"MIT"
] | null | null | null | algorithms/DNEH_SMR.py | TatianaPorras/MNIG_to_FMMSP | 1a62884237a4133f1417982d88f8a1421a972a08 | [
"MIT"
] | 2 | 2021-05-24T03:25:26.000Z | 2022-01-27T23:59:03.000Z | from API.functions import c_range, makespan, PT, ct
def DNEH_SMR(Tn, U_s, Pn):
"""
Tn es la lista de números triangulares difusos del tiempo de producción del trabajo i en la unidad o máquina u, en secuencia de números naturales, 1, 2, 3, ... El prefijo 't' es por triangular difuso.
U_s es el conjunto de ... | 27.32381 | 204 | 0.594632 | from API.functions import c_range, makespan, PT, ct
def DNEH_SMR(Tn, U_s, Pn):
import math
import numpy as np
L = len(U_s)
I = range(len(Tn))
sec = range(1, len(Tn) + 1)
S = range(L)
n_s = [len(U_s[s]) for s in S]
k = math.floor(L/2)
Ta = ... | true | true |
08f8aab7a9f888da3f6e1185ae1f8ad47ce8d27f | 3,012 | py | Python | isi_sdk_8_2_0/isi_sdk_8_2_0/models/mapping_dump.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_2_0/isi_sdk_8_2_0/models/mapping_dump.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_2_0/isi_sdk_8_2_0/models/mapping_dump.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 7
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class MappingDump(object):
"... | 26.654867 | 80 | 0.561089 |
import pprint
import re
import six
class MappingDump(object):
swagger_types = {
'identities': 'list[list[str]]'
}
attribute_map = {
'identities': 'identities'
}
def __init__(self, identities=None):
self._identities = None
self.discriminator = None
... | true | true |
08f8abcb834dcda499a838e9bc2d0d7367c1e748 | 1,338 | py | Python | fastapi_admin/models.py | cat-x/fastapi-admin | d9496b7e487134e5df1691df6652dca1c405919a | [
"Apache-2.0"
] | 1 | 2021-02-14T12:08:32.000Z | 2021-02-14T12:08:32.000Z | fastapi_admin/models.py | KonstantinKlepikov/fastapi-admin | a1baa185a77252f10afe1bd76e5ff3791158be98 | [
"Apache-2.0"
] | null | null | null | fastapi_admin/models.py | KonstantinKlepikov/fastapi-admin | a1baa185a77252f10afe1bd76e5ff3791158be98 | [
"Apache-2.0"
] | 2 | 2020-10-23T03:47:22.000Z | 2020-10-26T10:24:56.000Z | from tortoise import Model, fields
from fastapi_admin import enums
class AbstractUser(Model):
username = fields.CharField(max_length=20, unique=True)
password = fields.CharField(
max_length=200, description="Will auto hash with raw password when change"
)
is_active = fields.BooleanField(defau... | 24.777778 | 82 | 0.701794 | from tortoise import Model, fields
from fastapi_admin import enums
class AbstractUser(Model):
username = fields.CharField(max_length=20, unique=True)
password = fields.CharField(
max_length=200, description="Will auto hash with raw password when change"
)
is_active = fields.BooleanField(defau... | true | true |
08f8ac754d09a4f932ca160d6882499e2b6ce99a | 2,170 | py | Python | lib/node_modules/@stdlib/math/base/special/gamma/benchmark/python/benchmark.py | ghalimi/stdlib | 88f50b88aa945875ef053e2f89d26f9150a18c12 | [
"BSL-1.0"
] | 3,428 | 2016-07-14T13:48:46.000Z | 2022-03-31T22:32:13.000Z | lib/node_modules/@stdlib/math/base/special/gamma/benchmark/python/benchmark.py | ghalimi/stdlib | 88f50b88aa945875ef053e2f89d26f9150a18c12 | [
"BSL-1.0"
] | 435 | 2016-04-07T18:12:45.000Z | 2022-03-22T15:43:17.000Z | lib/node_modules/@stdlib/math/base/special/gamma/benchmark/python/benchmark.py | sthagen/stdlib | 042b6215818db0e2a784e72c7e054167dcefcd2a | [
"BSL-1.0"
] | 188 | 2016-11-29T22:58:11.000Z | 2022-03-17T06:46:43.000Z | #!/usr/bin/env python
#
# @license Apache-2.0
#
# Copyright (c) 2018 The Stdlib 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
#
# ... | 22.142857 | 74 | 0.635945 |
from __future__ import print_function
import timeit
NAME = "gamma"
REPEATS = 3
ITERATIONS = 1000000
def print_version():
print("TAP version 13")
def print_summary(total, passing):
print("#")
print("1.." + str(total)) print("# total " + str(total))
print("# pass " + str(passing))
print("... | true | true |
08f8ad1419ed6545ddb56b2ead73de272a003e24 | 4,174 | py | Python | docs/source/ext/autointerface.py | merchise/xotl.ql | 077881f97b9c0d00515d0e547563d125f6608007 | [
"BSD-3-Clause"
] | 1 | 2018-02-08T20:34:33.000Z | 2018-02-08T20:34:33.000Z | docs/source/ext/autointerface.py | merchise/xotl.ql | 077881f97b9c0d00515d0e547563d125f6608007 | [
"BSD-3-Clause"
] | null | null | null | docs/source/ext/autointerface.py | merchise/xotl.ql | 077881f97b9c0d00515d0e547563d125f6608007 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This is taken from repoze.sphinx.autointerface and modified to suite our
# needs
from __future__ import (division as _py3_division,
print_function as _py3_print,
absolute_import as _py3_abs_import)
from sphinx.util.docst... | 37.267857 | 82 | 0.601821 |
from __future__ import (division as _py3_division,
print_function as _py3_print,
absolute_import as _py3_abs_import)
from sphinx.util.docstrings import prepare_docstring
from sphinx.util import force_decode
try:
from sphinx.directives.desc import ClasslikeDesc ... | true | true |
08f8ad8946eb323ea058f283a687d90b4a360bad | 6,694 | py | Python | Flight-Schools.py | SunDevilThor/Flight-Schools | b7ae51b1a15894824bc9dc888ceccc1d78c74e5d | [
"MIT"
] | null | null | null | Flight-Schools.py | SunDevilThor/Flight-Schools | b7ae51b1a15894824bc9dc888ceccc1d78c74e5d | [
"MIT"
] | null | null | null | Flight-Schools.py | SunDevilThor/Flight-Schools | b7ae51b1a15894824bc9dc888ceccc1d78c74e5d | [
"MIT"
] | null | null | null | # Flight Schools - Webscraping Project from Upwork
# Objective: Gather data on all of the Airplane Flight Schools in the USA from:
# https://www.flightschoollist.com/airplane-flight-schools/
# And to create a spreadsheet with the following data:
# 1. Business Name
# 2. Owner/Director/CEO First and Last Name
# 3. Own... | 33.638191 | 140 | 0.617568 |
import requests
from bs4 import BeautifulSoup
import pandas as pd
MASTER_LIST = []
states = ['Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia',
'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Main... | true | true |
08f8aeec116f916c5476318c3cb47ee0981539b8 | 881 | py | Python | mockintosh/j2/meta.py | wenyuansong/mockintosh | 2ad4c180a1b5f01e986f3384cff6e6189689c6f2 | [
"MIT"
] | 95 | 2021-01-06T17:44:25.000Z | 2022-03-30T16:53:03.000Z | mockintosh/j2/meta.py | wenyuansong/mockintosh | 2ad4c180a1b5f01e986f3384cff6e6189689c6f2 | [
"MIT"
] | 129 | 2020-12-26T06:53:34.000Z | 2022-03-28T19:46:03.000Z | mockintosh/j2/meta.py | wenyuansong/mockintosh | 2ad4c180a1b5f01e986f3384cff6e6189689c6f2 | [
"MIT"
] | 8 | 2021-04-17T06:49:06.000Z | 2022-03-31T18:58:02.000Z | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
.. module:: __init__
:synopsis: Source: https://github.com/jappeace/offertex/blob/master/jinmeta.py
"""
from jinja2 import nodes, meta
def find_undeclared_variables_in_order(ast):
"""
Returns a list of undeclared variables **IN ORDER**,
unlike t... | 23.810811 | 82 | 0.631101 |
from jinja2 import nodes, meta
def find_undeclared_variables_in_order(ast):
undeclared_set = meta.find_undeclared_variables(ast) ordered_nodes = [
node
for node in ast.find_all(nodes.Name) if node.name in undeclared_set ]
result = []
seen = set()
for node in... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.