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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f709ea70f6e909c44e5ef29389569b227510e864 | 175,344 | py | Python | tests/pydevtest/test_resource_types.py | PlantandFoodResearch/irods | 9dfe7ffe5aa0760b7493bd9392ea1270df9335d4 | [
"BSD-3-Clause"
] | null | null | null | tests/pydevtest/test_resource_types.py | PlantandFoodResearch/irods | 9dfe7ffe5aa0760b7493bd9392ea1270df9335d4 | [
"BSD-3-Clause"
] | null | null | null | tests/pydevtest/test_resource_types.py | PlantandFoodResearch/irods | 9dfe7ffe5aa0760b7493bd9392ea1270df9335d4 | [
"BSD-3-Clause"
] | null | null | null | import sys
if (sys.version_info >= (2,7)):
import unittest
else:
import unittest2 as unittest
from pydevtest_common import assertiCmd, assertiCmdFail, getiCmdOutput, create_local_testfile, get_hostname, RUN_IN_TOPOLOGY, get_irods_config_dir, get_irods_top_level_dir
import pydevtest_sessions as s
from resource_s... | 61.893399 | 174 | 0.633988 | import sys
if (sys.version_info >= (2,7)):
import unittest
else:
import unittest2 as unittest
from pydevtest_common import assertiCmd, assertiCmdFail, getiCmdOutput, create_local_testfile, get_hostname, RUN_IN_TOPOLOGY, get_irods_config_dir, get_irods_top_level_dir
import pydevtest_sessions as s
from resource_s... | false | true |
f709eb1b5af037f2a9c13eb283c75382944620af | 4,757 | py | Python | datamart/joiners/join_feature/feature_factory.py | juancroldan/datamart | 9ec3b99f36192f812edd74ad2262bebccc22bc66 | [
"MIT"
] | 7 | 2018-10-02T01:32:23.000Z | 2020-10-08T00:42:35.000Z | datamart/joiners/join_feature/feature_factory.py | juancroldan/datamart | 9ec3b99f36192f812edd74ad2262bebccc22bc66 | [
"MIT"
] | 47 | 2018-10-02T05:41:13.000Z | 2021-02-02T21:50:31.000Z | datamart/joiners/join_feature/feature_factory.py | juancroldan/datamart | 9ec3b99f36192f812edd74ad2262bebccc22bc66 | [
"MIT"
] | 19 | 2018-10-01T22:27:20.000Z | 2019-02-28T18:59:53.000Z |
from datamart.joiners.join_feature.feature_classes import *
from functools import reduce
import numpy as np
class FeatureFactory:
subclasses = {
(DistributeType.CATEGORICAL, DataType.NUMBER): CategoricalNumberFeature,
(DistributeType.CATEGORICAL, DataType.STRING): CategoricalStringFeature,
... | 42.473214 | 114 | 0.646206 |
from datamart.joiners.join_feature.feature_classes import *
from functools import reduce
import numpy as np
class FeatureFactory:
subclasses = {
(DistributeType.CATEGORICAL, DataType.NUMBER): CategoricalNumberFeature,
(DistributeType.CATEGORICAL, DataType.STRING): CategoricalStringFeature,
... | true | true |
f709ef1c8a4102a6552cd1ecd42a1eb6b329f1f3 | 2,517 | py | Python | nodeeditor/node_editor_widget.py | icnmtrx/econ_helper | 76a2a49a17f87acf9b9f4e0142f86e544a9cc52b | [
"MIT"
] | null | null | null | nodeeditor/node_editor_widget.py | icnmtrx/econ_helper | 76a2a49a17f87acf9b9f4e0142f86e544a9cc52b | [
"MIT"
] | null | null | null | nodeeditor/node_editor_widget.py | icnmtrx/econ_helper | 76a2a49a17f87acf9b9f4e0142f86e544a9cc52b | [
"MIT"
] | null | null | null | import logging
import os
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from nodeeditor.node_edge import Edge, EDGE_TYPE_BEZIER
from nodeeditor.node_graphics_view import QDMGraphicsView
from nodeeditor.node_node import Node
from nodeeditor.node_scene import Scene, InvalidFile
class NodeEditorWidget(QWidge... | 27.358696 | 94 | 0.657132 | import logging
import os
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from nodeeditor.node_edge import Edge, EDGE_TYPE_BEZIER
from nodeeditor.node_graphics_view import QDMGraphicsView
from nodeeditor.node_node import Node
from nodeeditor.node_scene import Scene, InvalidFile
class NodeEditorWidget(QWidge... | true | true |
f709f0b169aac9dac69ec255c444a85bce05cb86 | 1,001 | py | Python | test/test_v1alpha1_data_volume_source_pvc.py | gabriel-samfira/client-python | c2e184c3cad6797af35b0160a36ffcbba77284a7 | [
"Apache-2.0"
] | null | null | null | test/test_v1alpha1_data_volume_source_pvc.py | gabriel-samfira/client-python | c2e184c3cad6797af35b0160a36ffcbba77284a7 | [
"Apache-2.0"
] | null | null | null | test/test_v1alpha1_data_volume_source_pvc.py | gabriel-samfira/client-python | c2e184c3cad6797af35b0160a36ffcbba77284a7 | [
"Apache-2.0"
] | 1 | 2020-12-10T03:16:05.000Z | 2020-12-10T03:16:05.000Z | # coding: utf-8
"""
KubeVirt API
This is KubeVirt API an add-on for Kubernetes.
OpenAPI spec version: 1.0.0
Contact: kubevirt-dev@googlegroups.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
import unittest
i... | 22.244444 | 94 | 0.726274 |
from __future__ import absolute_import
import os
import sys
import unittest
import kubevirt
from kubevirt.rest import ApiException
from kubevirt.models.v1alpha1_data_volume_source_pvc import V1alpha1DataVolumeSourcePVC
class TestV1alpha1DataVolumeSourcePVC(unittest.TestCase):
def setUp(self):
pass
... | true | true |
f709f3a1db36a7690e2301e6bb78d5b399a49454 | 3,453 | py | Python | foundations/docker/localhost/kind/yugabyte-demo/cluster/build/yugabyte/_vendir/upstream/stable/yugabyte/generate_kubeconfig.py | aegershman/deployments | c2093ea6824fea6ef18198f9420ca36a1f3ec1af | [
"Apache-2.0"
] | 2 | 2020-02-20T05:56:41.000Z | 2020-04-26T17:29:51.000Z | foundations/docker/localhost/kind/yugabyte-demo/cluster/build/yugabyte/_vendir/upstream/stable/yugabyte/generate_kubeconfig.py | aegershman/deployments | c2093ea6824fea6ef18198f9420ca36a1f3ec1af | [
"Apache-2.0"
] | 39 | 2019-11-02T19:35:56.000Z | 2021-10-14T20:16:38.000Z | foundations/docker/localhost/kind/yugabyte-demo/cluster/build/yugabyte/_vendir/upstream/stable/yugabyte/generate_kubeconfig.py | aegershman/deployments | c2093ea6824fea6ef18198f9420ca36a1f3ec1af | [
"Apache-2.0"
] | 1 | 2020-06-22T23:00:32.000Z | 2020-06-22T23:00:32.000Z | #!/usr/bin/python
# Copyright (c) YugaByte, Inc.
# This script would generate a kubeconfig for the given servie account
# by fetching the cluster information and also add the service account
# token for the authentication purpose.
import argparse
from subprocess import check_output
import json
import base64
import te... | 41.60241 | 92 | 0.643498 |
import argparse
from subprocess import check_output
import json
import base64
import tempfile
def run_command(command_args, namespace=None, as_json=True):
command = ['kubectl']
if namespace:
command.extend(['--namespace', namespace])
command.extend(command_args)
if as_json:
command.e... | true | true |
f709f425c1c0e384091cdd8da6bfbdb7d780231c | 11,272 | py | Python | lib/exabgp/reactor/protocol.py | tehnerd/exabgp | 81b7d68351e678669db16ba873de41a9b60ca90a | [
"BSD-3-Clause"
] | null | null | null | lib/exabgp/reactor/protocol.py | tehnerd/exabgp | 81b7d68351e678669db16ba873de41a9b60ca90a | [
"BSD-3-Clause"
] | null | null | null | lib/exabgp/reactor/protocol.py | tehnerd/exabgp | 81b7d68351e678669db16ba873de41a9b60ca90a | [
"BSD-3-Clause"
] | null | null | null | # encoding: utf-8
"""
protocol.py
Created by Thomas Mangin on 2009-08-25.
Copyright (c) 2009-2015 Exa Networks. All rights reserved.
"""
import os
import traceback
# ================================================================ Registration
#
from exabgp.reactor.network.outgoing import Outgoing
# from exabgp.re... | 31.841808 | 126 | 0.710699 | """
protocol.py
Created by Thomas Mangin on 2009-08-25.
Copyright (c) 2009-2015 Exa Networks. All rights reserved.
"""
import os
import traceback
from exabgp.reactor.network.outgoing import Outgoing
from exabgp.protocol.family import AFI
from exabgp.protocol.family import SAFI
from exabgp.bgp.message import Messa... | false | true |
f709f44fde235e8c6f38256a50cbfb476ceee8e9 | 373 | py | Python | JDjangoDemo/docs/migrations/0003_auto_20201028_1758.py | JIYANG-PLUS/JDjango | 57cbb13b2b4c07f34d546c0c637c22f60c1e692a | [
"MIT"
] | 3 | 2020-12-28T05:09:02.000Z | 2021-06-23T10:02:03.000Z | JDjangoDemo/docs/migrations/0003_auto_20201028_1758.py | JIYANG-PLUS/JDjango | 57cbb13b2b4c07f34d546c0c637c22f60c1e692a | [
"MIT"
] | null | null | null | JDjangoDemo/docs/migrations/0003_auto_20201028_1758.py | JIYANG-PLUS/JDjango | 57cbb13b2b4c07f34d546c0c637c22f60c1e692a | [
"MIT"
] | null | null | null | # Generated by Django 3.0.8 on 2020-10-28 17:58
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('docs', '0002_article_version'),
]
operations = [
migrations.AlterModelOptions(
name='article',
options={'verbose_name': '插件内... | 20.722222 | 76 | 0.603217 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('docs', '0002_article_version'),
]
operations = [
migrations.AlterModelOptions(
name='article',
options={'verbose_name': '插件内容', 'verbose_name_plural': '插件内容'},
),
... | true | true |
f709f4a438cc8457611aa5475ad0795c5fb0526b | 1,333 | py | Python | src/adorn/exception/configuration_error.py | pyadorn/adorn | a34a9a20c1a80c7bdbee0fa641c2bd17e20e60e6 | [
"Apache-2.0"
] | 3 | 2021-12-11T03:52:57.000Z | 2022-03-22T20:42:56.000Z | src/adorn/exception/configuration_error.py | pyadorn/adorn | a34a9a20c1a80c7bdbee0fa641c2bd17e20e60e6 | [
"Apache-2.0"
] | 12 | 2021-12-31T19:22:09.000Z | 2022-03-21T03:49:13.000Z | src/adorn/exception/configuration_error.py | pyadorn/adorn | a34a9a20c1a80c7bdbee0fa641c2bd17e20e60e6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Jacob Baumbach
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 35.078947 | 74 | 0.711928 |
class ConfigurationError(Exception):
def __init__(self, message: str):
super().__init__()
self.message = message
def __str__(self):
return self.message
| true | true |
f709f56e4962f1057d045039872862b374050ce3 | 8,637 | py | Python | carla/PythonAPI/examples/tutorial4.py | kyuhoJeong11/GrewRL | a514698df8d38df34de0bd1667d99927f0aa3885 | [
"MIT"
] | null | null | null | carla/PythonAPI/examples/tutorial4.py | kyuhoJeong11/GrewRL | a514698df8d38df34de0bd1667d99927f0aa3885 | [
"MIT"
] | null | null | null | carla/PythonAPI/examples/tutorial4.py | kyuhoJeong11/GrewRL | a514698df8d38df34de0bd1667d99927f0aa3885 | [
"MIT"
] | null | null | null | import glob
import os
import sys
import random
import time
import numpy as np
import cv2
import math
from collections import deque
from keras.applications.xception import Xception
from keras.layers import Dense, GlobalAveragePooling2D
from keras.optimizers import Adam
from keras.models import Model
'''
Carla 패키지가 사용하는... | 30.956989 | 171 | 0.631817 | import glob
import os
import sys
import random
import time
import numpy as np
import cv2
import math
from collections import deque
from keras.applications.xception import Xception
from keras.layers import Dense, GlobalAveragePooling2D
from keras.optimizers import Adam
from keras.models import Model
try:
sys.path.a... | true | true |
f709f6674727313dfa9736c9f5cd0079095048e2 | 1,907 | py | Python | from_cpython/Lib/email/errors.py | aisk/pyston | ac69cfef0621dbc8901175e84fa2b5cb5781a646 | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | from_cpython/Lib/email/errors.py | aisk/pyston | ac69cfef0621dbc8901175e84fa2b5cb5781a646 | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | from_cpython/Lib/email/errors.py | aisk/pyston | ac69cfef0621dbc8901175e84fa2b5cb5781a646 | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""email package exception classes."""
class MessageError(Exception):
"""Base class for errors in the email package."""
class MessageParseError(MessageError):
"""Base class for message parsing erro... | 31.262295 | 94 | 0.745674 |
class MessageError(Exception):
class MessageParseError(MessageError):
class HeaderParseError(MessageParseError):
class BoundaryError(MessageParseError):
# We could make it so that it only inherits one of the base classes, but I'd rather that
class CharsetError(MessageError):
class MessageDefect:
... | true | true |
f709f698c123435954203e84f6c89a00b3fd75db | 804 | py | Python | setup.py | colincsl/RGBD-Dataset-Reader | bafa7c74770f6e91a41312e009fbb4176af23e77 | [
"BSD-2-Clause-FreeBSD"
] | 6 | 2019-06-06T03:56:18.000Z | 2020-11-28T07:32:37.000Z | setup.py | colincsl/RGBD-Dataset-Reader | bafa7c74770f6e91a41312e009fbb4176af23e77 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | setup.py | colincsl/RGBD-Dataset-Reader | bafa7c74770f6e91a41312e009fbb4176af23e77 | [
"BSD-2-Clause-FreeBSD"
] | 3 | 2019-07-04T08:51:02.000Z | 2020-12-10T16:13:59.000Z |
'''
Configure:
python setup.py install
pyVideoDatasets
Colin Lea
2013
'''
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
import numpy as np
ext_modules = []
for e in ext_modules:
e.pyrex_directives = {
"boundscheck": False,
"wraparound... | 18.697674 | 56 | 0.677861 |
'''
Configure:
python setup.py install
pyVideoDatasets
Colin Lea
2013
'''
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
import numpy as np
ext_modules = []
for e in ext_modules:
e.pyrex_directives = {
"boundscheck": False,
"wraparound... | false | true |
f709f773e6761ca5effc91050a215dab991ab27e | 588 | py | Python | graphql/utils/tests/test_quoted_or_list.py | ThanksBoomerang/graphql-core-legacy | 6e2fbccdec655ce9122b84d3808c14242c4e6b96 | [
"MIT"
] | 8 | 2020-03-23T21:34:02.000Z | 2021-11-12T11:27:45.000Z | graphql/utils/tests/test_quoted_or_list.py | ThanksBoomerang/graphql-core-legacy | 6e2fbccdec655ce9122b84d3808c14242c4e6b96 | [
"MIT"
] | 17 | 2020-03-14T22:22:29.000Z | 2022-03-16T19:26:37.000Z | graphql/utils/tests/test_quoted_or_list.py | ThanksBoomerang/graphql-core-legacy | 6e2fbccdec655ce9122b84d3808c14242c4e6b96 | [
"MIT"
] | 17 | 2020-03-23T12:06:23.000Z | 2022-02-13T05:33:32.000Z | from pytest import raises
from ..quoted_or_list import quoted_or_list
def test_does_not_accept_an_empty_list():
with raises(StopIteration):
quoted_or_list([])
def test_returns_single_quoted_item():
assert quoted_or_list(["A"]) == '"A"'
def test_returns_two_item_list():
assert quoted_or_list([... | 23.52 | 88 | 0.646259 | from pytest import raises
from ..quoted_or_list import quoted_or_list
def test_does_not_accept_an_empty_list():
with raises(StopIteration):
quoted_or_list([])
def test_returns_single_quoted_item():
assert quoted_or_list(["A"]) == '"A"'
def test_returns_two_item_list():
assert quoted_or_list([... | true | true |
f709f7c3584cc274e7b71885cfd3023498cacb9b | 4,418 | py | Python | profiles_api/views.py | MatheusAbdias/proj-rest-api | 5401d6c2bc96f9f30f646a7969cdc2a65cb0de3c | [
"MIT"
] | 1 | 2022-02-20T23:16:19.000Z | 2022-02-20T23:16:19.000Z | profiles_api/views.py | MatheusAbdias/proj-rest-api | 5401d6c2bc96f9f30f646a7969cdc2a65cb0de3c | [
"MIT"
] | null | null | null | profiles_api/views.py | MatheusAbdias/proj-rest-api | 5401d6c2bc96f9f30f646a7969cdc2a65cb0de3c | [
"MIT"
] | null | null | null | from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from rest_framework import viewsets
from rest_framework.authentication import TokenAuthentication
from rest_framework import filters
from rest_framework.authtoken.views import ObtainAuthToken
from r... | 35.918699 | 80 | 0.661838 | from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from rest_framework import viewsets
from rest_framework.authentication import TokenAuthentication
from rest_framework import filters
from rest_framework.authtoken.views import ObtainAuthToken
from r... | true | true |
f709f855c6208fa8f7d480a10f080584e7ee9b14 | 2,022 | py | Python | tests/gold_tests/shutdown/emergency.test.py | nozomi1773/trafficserver | 2ee141137545a84584d8047eee70b171b5254c40 | [
"Apache-2.0"
] | null | null | null | tests/gold_tests/shutdown/emergency.test.py | nozomi1773/trafficserver | 2ee141137545a84584d8047eee70b171b5254c40 | [
"Apache-2.0"
] | null | null | null | tests/gold_tests/shutdown/emergency.test.py | nozomi1773/trafficserver | 2ee141137545a84584d8047eee70b171b5254c40 | [
"Apache-2.0"
] | null | null | null | '''
'''
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License");... | 38.884615 | 131 | 0.755193 |
import os
Test.Summary = 'Test TSEmergency API'
Test.ContinueOnFail = True
ts = Test.MakeATSProcess('ts')
Test.testName = 'Emergency Shutdown Test'
ts.Disk.records_config.update({
'proxy.config.exec_thread.autoconfig': 0,
'proxy.config.exec_thread.autoconfig.scale': 1.5,
'proxy.config.exec_thread.limi... | true | true |
f709f87c4beb8fa85bcf5d596823ca75307a6393 | 29,244 | py | Python | test/test_fnetout.py | vanderhe/fortnet-python | 118237f0ce750852d973b213161fc04623fd7f82 | [
"BSD-2-Clause"
] | null | null | null | test/test_fnetout.py | vanderhe/fortnet-python | 118237f0ce750852d973b213161fc04623fd7f82 | [
"BSD-2-Clause"
] | 1 | 2022-03-11T15:21:56.000Z | 2022-03-11T15:33:46.000Z | test/test_fnetout.py | vanderhe/fortnet-python | 118237f0ce750852d973b213161fc04623fd7f82 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
#------------------------------------------------------------------------------#
# fortnet-python: Python Tools for the Fortnet Software Package #
# Copyright (C) 2021 - 2022 T. W. van der Heide #
# ... | 45.622465 | 80 | 0.610792 |
import os
import pytest
import numpy as np
from common import compare_fnetout_references
REFPATH = os.path.join(os.getcwd(), 'test', 'references', 'Fnetout')
def test_predict_atomic():
fname = 'predict_atomic.hdf5'
ref = {}
ref['mode'] = 'predict'
ref['ndatapoints'] = 5
ref['nglobaltarget... | true | true |
f709f98cce7a40c942eef0665a243189284ff7ed | 5,240 | py | Python | bumblebee/buzzes/api/serializers/buzz_serializers.py | sthasam2/bumblebee-backend | 22057399f34cdc1edb0ef04e622c97df46532de3 | [
"Linux-OpenIB"
] | null | null | null | bumblebee/buzzes/api/serializers/buzz_serializers.py | sthasam2/bumblebee-backend | 22057399f34cdc1edb0ef04e622c97df46532de3 | [
"Linux-OpenIB"
] | null | null | null | bumblebee/buzzes/api/serializers/buzz_serializers.py | sthasam2/bumblebee-backend | 22057399f34cdc1edb0ef04e622c97df46532de3 | [
"Linux-OpenIB"
] | null | null | null | from rest_framework import serializers
from bumblebee.buzzes.api.serializers.interaction_serializers import (
BuzzInteractionsSerializer,
)
from bumblebee.buzzes.models import Buzz, BuzzImage
from bumblebee.core.exceptions import UnknownModelFieldsError
from .user_serializers import BuzzUserSerializer
##########... | 29.111111 | 103 | 0.608206 | from rest_framework import serializers
from bumblebee.buzzes.api.serializers.interaction_serializers import (
BuzzInteractionsSerializer,
)
from bumblebee.buzzes.models import Buzz, BuzzImage
from bumblebee.core.exceptions import UnknownModelFieldsError
from .user_serializers import BuzzUserSerializer
class Bu... | true | true |
f709f9ddbd9a5f676f6351489bf105cf4c645a2a | 2,382 | py | Python | gazoo_device/tests/functional_tests/device_power_test_suite.py | isabella232/gazoo-device | 0e1e276d72333e713b47152815708b9c74c45409 | [
"Apache-2.0"
] | null | null | null | gazoo_device/tests/functional_tests/device_power_test_suite.py | isabella232/gazoo-device | 0e1e276d72333e713b47152815708b9c74c45409 | [
"Apache-2.0"
] | 1 | 2021-06-24T19:20:50.000Z | 2021-06-24T19:20:50.000Z | gazoo_device/tests/functional_tests/device_power_test_suite.py | isabella232/gazoo-device | 0e1e276d72333e713b47152815708b9c74c45409 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 36.090909 | 76 | 0.695634 |
from typing import Type
from gazoo_device.tests.functional_tests.utils import gdm_test_base
import retry
class DevicePowerTestSuite(gdm_test_base.GDMTestBase):
@classmethod
def is_applicable_to(cls, device_type: str,
device_class: Type[gdm_test_base.DeviceType],
dev... | true | true |
f709fa3e67ee8095268931a28d7f66ac738f26b7 | 1,023 | py | Python | books/PRML/PRML-master-Python/prml/nn/optimizer/ada_delta.py | iamfaith/DeepLearning | 80ce429d0e9e448cf84e7d51129ef4e0077048a2 | [
"Apache-2.0"
] | 7,581 | 2018-04-26T04:29:30.000Z | 2022-03-31T15:35:39.000Z | books/PRML/PRML-master-Python/prml/nn/optimizer/ada_delta.py | lizhenchen2019/DeepLearning | 467c73e2d0435f0a05255e5b5e00454260d01f27 | [
"Apache-2.0"
] | 8 | 2019-05-22T02:27:35.000Z | 2022-03-03T03:53:05.000Z | books/PRML/PRML-master-Python/prml/nn/optimizer/ada_delta.py | lizhenchen2019/DeepLearning | 467c73e2d0435f0a05255e5b5e00454260d01f27 | [
"Apache-2.0"
] | 2,340 | 2018-04-26T04:28:11.000Z | 2022-03-31T02:28:25.000Z | import numpy as np
from prml.nn.optimizer.optimizer import Optimizer
class AdaDelta(Optimizer):
"""
AdaDelta optimizer
"""
def __init__(self, parameter, rho=0.95, epsilon=1e-8):
super().__init__(parameter, None)
self.rho = rho
self.epsilon = epsilon
self.mean_squared_d... | 31.96875 | 98 | 0.57087 | import numpy as np
from prml.nn.optimizer.optimizer import Optimizer
class AdaDelta(Optimizer):
def __init__(self, parameter, rho=0.95, epsilon=1e-8):
super().__init__(parameter, None)
self.rho = rho
self.epsilon = epsilon
self.mean_squared_deriv = []
self.mean_squared_upd... | true | true |
f709fba769a5a08997b1bd7938d44d6037a9f1df | 8,111 | py | Python | cloudmersive_barcode_api_client/configuration.py | Cloudmersive/Cloudmersive.APIClient.Python.Barcode | e584de80304ebddbcce99ee6ff42196d46486421 | [
"Apache-2.0"
] | 1 | 2018-06-24T04:50:28.000Z | 2018-06-24T04:50:28.000Z | cloudmersive_barcode_api_client/configuration.py | Cloudmersive/Cloudmersive.APIClient.Python.Barcode | e584de80304ebddbcce99ee6ff42196d46486421 | [
"Apache-2.0"
] | 1 | 2019-02-25T18:23:23.000Z | 2019-02-25T18:23:23.000Z | cloudmersive_barcode_api_client/configuration.py | Cloudmersive/Cloudmersive.APIClient.Python.Barcode | e584de80304ebddbcce99ee6ff42196d46486421 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
barcodeapi
Barcode APIs let you generate barcode images, and recognize values from images of barcodes. # noqa: E501
OpenAPI spec version: v1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import copy
import logg... | 32.059289 | 109 | 0.604981 |
from __future__ import absolute_import
import copy
import logging
import multiprocessing
import sys
import urllib3
import six
from six.moves import http_client as httplib
class Configuration(object):
_default = None
def __init__(self):
if self._default:
for key in self._default.__di... | true | true |
f709fd08e353fb40d7b89a80816394ef307e0dcb | 2,633 | py | Python | bilby_pipe/job_creation/nodes/generation_node.py | Samanwaya1301/tidal-heating-bilby-pipe | b495d4f3ffe3ef61a46ce5b87c826e10b087e2e1 | [
"MIT"
] | 4 | 2019-02-28T00:54:28.000Z | 2021-08-24T14:52:16.000Z | bilby_pipe/job_creation/nodes/generation_node.py | Samanwaya1301/tidal-heating-bilby-pipe | b495d4f3ffe3ef61a46ce5b87c826e10b087e2e1 | [
"MIT"
] | 2 | 2020-10-05T02:11:03.000Z | 2021-02-19T06:31:42.000Z | bilby_pipe/job_creation/nodes/generation_node.py | Samanwaya1301/tidal-heating-bilby-pipe | b495d4f3ffe3ef61a46ce5b87c826e10b087e2e1 | [
"MIT"
] | 3 | 2020-08-26T09:45:54.000Z | 2021-07-07T09:24:52.000Z | from ...utils import DataDump, logger
from ..node import Node
class GenerationNode(Node):
def __init__(self, inputs, trigger_time, idx, dag, parent=None):
"""
Node for data generation jobs
Parameters:
-----------
inputs: bilby_pipe.main.MainInput
The user-defin... | 31.345238 | 86 | 0.616787 | from ...utils import DataDump, logger
from ..node import Node
class GenerationNode(Node):
def __init__(self, inputs, trigger_time, idx, dag, parent=None):
super().__init__(inputs)
self.inputs = inputs
self.trigger_time = trigger_time
self.idx = idx
self.dag = dag
s... | true | true |
f709fdad8e04c0a5e71d2d9204dc5fa6943d9a3d | 536 | py | Python | append_to_array_with_comp.py | tsuyukimakoto/chore_python_sequence_performance | d984675f7af4d47b256b341f123b07f8827d95ed | [
"MIT"
] | null | null | null | append_to_array_with_comp.py | tsuyukimakoto/chore_python_sequence_performance | d984675f7af4d47b256b341f123b07f8827d95ed | [
"MIT"
] | null | null | null | append_to_array_with_comp.py | tsuyukimakoto/chore_python_sequence_performance | d984675f7af4d47b256b341f123b07f8827d95ed | [
"MIT"
] | null | null | null | from array import array
from random import randint
import sys
@profile
def create_data():
return array('i', [randint(1, 10000000) for i in range(100000)])
def proc():
cnt = 0
data = create_data()
for i in range(100000):
if randint(1, 10000000) in data:
cnt += 1
if __name__ == '_... | 21.44 | 81 | 0.623134 | from array import array
from random import randint
import sys
@profile
def create_data():
return array('i', [randint(1, 10000000) for i in range(100000)])
def proc():
cnt = 0
data = create_data()
for i in range(100000):
if randint(1, 10000000) in data:
cnt += 1
if __name__ == '_... | true | true |
f709fe65c70fa2031de7bd284fbe943cd20a10e6 | 5,293 | py | Python | applied_python/applied_python/lib/python2.7/site-packages/pylint/test/unittest_pyreverse_inspector.py | mith1979/ansible_automation | 013dfa67c6d91720b787fadb21de574b6e023a26 | [
"Apache-2.0"
] | null | null | null | applied_python/applied_python/lib/python2.7/site-packages/pylint/test/unittest_pyreverse_inspector.py | mith1979/ansible_automation | 013dfa67c6d91720b787fadb21de574b6e023a26 | [
"Apache-2.0"
] | 1 | 2016-03-22T13:36:30.000Z | 2016-03-22T13:36:30.000Z | applied_python/applied_python/lib/python2.7/site-packages/pylint/test/unittest_pyreverse_inspector.py | mith1979/ansible_automation | 013dfa67c6d91720b787fadb21de574b6e023a26 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2003-2015 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free Software
# Foundation; either version 2 of the Lic... | 38.635036 | 87 | 0.643869 | import os
import unittest
import astroid
from astroid import nodes
from astroid import bases
from astroid import manager
from astroid import test_utils
from pylint.pyreverse import inspector
from unittest_pyreverse_writer import get_project
MANAGER = manager.AstroidManager()
def astroid_wrapper(func, modname):
... | true | true |
f709ff1bce098437679e5a803075ed18ece003f9 | 31,264 | py | Python | Source/Python/UPT/Library/String.py | Mokwang/basetools | c190b1ccb9f388bec7d19a7cc281aeabb94b8d75 | [
"BSD-2-Clause"
] | 8 | 2015-05-04T22:34:40.000Z | 2021-07-07T06:10:40.000Z | Source/Python/UPT/Library/String.py | Mokwang/basetools | c190b1ccb9f388bec7d19a7cc281aeabb94b8d75 | [
"BSD-2-Clause"
] | null | null | null | Source/Python/UPT/Library/String.py | Mokwang/basetools | c190b1ccb9f388bec7d19a7cc281aeabb94b8d75 | [
"BSD-2-Clause"
] | 8 | 2015-06-29T13:37:05.000Z | 2021-03-22T16:05:16.000Z | ## @file
# This file is used to define common string related functions used in parsing
# process
#
# Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License which a... | 32.364389 | 121 | 0.576766 | import re
import os.path
from string import strip
import Logger.Log as Logger
import Library.DataType as DataType
from Logger.ToolError import FORMAT_INVALID
from Logger.ToolError import PARSER_ERROR
from Logger import StringTable as ST
gMACRO_PATTERN = re.compile("\$\(([_A-Z][_A-Z0-9]*)\)", re.UNICODE)
de... | true | true |
f709ff30745f048a9069257f0e215166f25c956b | 1,509 | py | Python | msdsl/assignment.py | sgherbst/msdsl | e38d5ecdb88b3574bda62f22a4f91ce3e4173d12 | [
"MIT"
] | 15 | 2019-05-14T10:12:23.000Z | 2022-03-29T15:29:52.000Z | msdsl/assignment.py | sgherbst/msdsl | e38d5ecdb88b3574bda62f22a4f91ce3e4173d12 | [
"MIT"
] | 19 | 2020-01-22T21:44:33.000Z | 2021-06-05T02:10:41.000Z | msdsl/assignment.py | sgherbst/msdsl | e38d5ecdb88b3574bda62f22a4f91ce3e4173d12 | [
"MIT"
] | 5 | 2019-10-21T09:53:17.000Z | 2021-08-10T17:32:20.000Z | from msdsl.expr.expr import ModelExpr
from msdsl.expr.signals import Signal, DigitalSignal, AnalogSignal
from msdsl.expr.format import RealFormat
from msdsl.expr.table import Table
class Assignment:
def __init__(self, signal: Signal, expr: ModelExpr, check_format=True):
self.signal = signal
... | 33.533333 | 83 | 0.636183 | from msdsl.expr.expr import ModelExpr
from msdsl.expr.signals import Signal, DigitalSignal, AnalogSignal
from msdsl.expr.format import RealFormat
from msdsl.expr.table import Table
class Assignment:
def __init__(self, signal: Signal, expr: ModelExpr, check_format=True):
self.signal = signal
... | true | true |
f709ffc9a9096e68c6eafa3940ad5daafbe4f454 | 15,511 | py | Python | deerlab/utils/utils.py | laenan8466/DeerLab | 94f1942da1b506e0661a8e7e4901bb5ba6d69143 | [
"MIT"
] | null | null | null | deerlab/utils/utils.py | laenan8466/DeerLab | 94f1942da1b506e0661a8e7e4901bb5ba6d69143 | [
"MIT"
] | null | null | null | deerlab/utils/utils.py | laenan8466/DeerLab | 94f1942da1b506e0661a8e7e4901bb5ba6d69143 | [
"MIT"
] | null | null | null | import warnings
import numpy as np
import cmath as math
import scipy as scp
import scipy.optimize as opt
from types import FunctionType
def parse_multidatasets(V,K,weights,precondition=False):
#===============================================================================
# Identify if the sig... | 33.143162 | 197 | 0.479402 | import warnings
import numpy as np
import cmath as math
import scipy as scp
import scipy.optimize as opt
from types import FunctionType
def parse_multidatasets(V,K,weights,precondition=False):
if type(V) is not list:
if V.size == np.atleast_1d(weights).size:
... | true | true |
f709ffd40dd8a38cba8ea8ba1325e17e8c739d17 | 11,448 | py | Python | Lib/test/support/socket_helper.py | chexca/cpython | cfc6ce4d40f2f01314b7e283fb972a7bb3ed3faa | [
"CNRI-Python-GPL-Compatible"
] | 1,318 | 2019-07-11T10:34:39.000Z | 2022-03-29T15:05:19.000Z | Lib/test/support/socket_helper.py | chexca/cpython | cfc6ce4d40f2f01314b7e283fb972a7bb3ed3faa | [
"CNRI-Python-GPL-Compatible"
] | 387 | 2020-12-15T14:54:04.000Z | 2022-03-31T07:00:21.000Z | Lib/test/support/socket_helper.py | chexca/cpython | cfc6ce4d40f2f01314b7e283fb972a7bb3ed3faa | [
"CNRI-Python-GPL-Compatible"
] | 66 | 2019-11-11T15:33:12.000Z | 2022-03-01T07:55:55.000Z | import contextlib
import errno
import socket
import unittest
import sys
from .. import support
HOST = "localhost"
HOSTv4 = "127.0.0.1"
HOSTv6 = "::1"
def find_unused_port(family=socket.AF_INET, socktype=socket.SOCK_STREAM):
"""Returns an unused port that should be suitable for binding. This is
achieved by... | 42.4 | 89 | 0.65898 | import contextlib
import errno
import socket
import unittest
import sys
from .. import support
HOST = "localhost"
HOSTv4 = "127.0.0.1"
HOSTv6 = "::1"
def find_unused_port(family=socket.AF_INET, socktype=socket.SOCK_STREAM):
with socket.socket(family, socktype) as tempsock:
port = bind_port(tempsock)
... | true | true |
f70a000037d4adeeded177205c3e2f23a6c16f71 | 421 | py | Python | jassen/django/project/blog/migrations/0003_auto_20180507_0734.py | cabilangan112/intern-drf-blog | b2d6c7a4af1316b2c7ce38547bd9df99b4f3e8b9 | [
"MIT"
] | null | null | null | jassen/django/project/blog/migrations/0003_auto_20180507_0734.py | cabilangan112/intern-drf-blog | b2d6c7a4af1316b2c7ce38547bd9df99b4f3e8b9 | [
"MIT"
] | null | null | null | jassen/django/project/blog/migrations/0003_auto_20180507_0734.py | cabilangan112/intern-drf-blog | b2d6c7a4af1316b2c7ce38547bd9df99b4f3e8b9 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.4 on 2018-05-07 07:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0002_auto_20180507_0653'),
]
operations = [
migrations.AlterField(
model_name='post',
name='banner_photo',
... | 22.157895 | 84 | 0.612827 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0002_auto_20180507_0653'),
]
operations = [
migrations.AlterField(
model_name='post',
name='banner_photo',
field=models.ImageField(upload_to='st... | true | true |
f70a00bd04dc577a9c2437547c31ffdaa0260ef1 | 5,394 | py | Python | ibmsecurity/isam/aac/server_connections/ws.py | sandermey/ibmsecurity | 92ba7828260e96a6a323f4ac3830bfa43ee8dd7e | [
"Apache-2.0"
] | null | null | null | ibmsecurity/isam/aac/server_connections/ws.py | sandermey/ibmsecurity | 92ba7828260e96a6a323f4ac3830bfa43ee8dd7e | [
"Apache-2.0"
] | null | null | null | ibmsecurity/isam/aac/server_connections/ws.py | sandermey/ibmsecurity | 92ba7828260e96a6a323f4ac3830bfa43ee8dd7e | [
"Apache-2.0"
] | null | null | null | import logging
import ibmsecurity.utilities.tools
logger = logging.getLogger(__name__)
def get_all(isamAppliance, check_mode=False, force=False):
"""
Retrieving a list of all Web Service connections
"""
return isamAppliance.invoke_get("Retrieving a list of all Web Service connections",
... | 33.092025 | 143 | 0.643493 | import logging
import ibmsecurity.utilities.tools
logger = logging.getLogger(__name__)
def get_all(isamAppliance, check_mode=False, force=False):
return isamAppliance.invoke_get("Retrieving a list of all Web Service connections",
"/mga/server_connections/ws/v1")
def get(isam... | true | true |
f70a02f2e0f7ececb1a48f2b6248fe11c810141e | 3,714 | py | Python | imix/data/infocomp/ocrvqa_infocpler.py | linxi1158/iMIX | af87a17275f02c94932bb2e29f132a84db812002 | [
"Apache-2.0"
] | 23 | 2021-06-26T08:45:19.000Z | 2022-03-02T02:13:33.000Z | imix/data/infocomp/ocrvqa_infocpler.py | XChuanLee/iMIX | 99898de97ef8b45462ca1d6bf2542e423a73d769 | [
"Apache-2.0"
] | null | null | null | imix/data/infocomp/ocrvqa_infocpler.py | XChuanLee/iMIX | 99898de97ef8b45462ca1d6bf2542e423a73d769 | [
"Apache-2.0"
] | 9 | 2021-06-10T02:36:20.000Z | 2021-11-09T02:18:16.000Z | import torch
from ..utils.stream import ItemFeature
from .base_infocpler import BaseInfoCpler
class OCRVQAInfoCpler(BaseInfoCpler):
def __init__(self, cfg):
super().__init__(cfg)
def complete_info(self, item_feature: ItemFeature):
tokens = self.tokenizer.tokenize(item_feature.question.strip... | 53.826087 | 117 | 0.716478 | import torch
from ..utils.stream import ItemFeature
from .base_infocpler import BaseInfoCpler
class OCRVQAInfoCpler(BaseInfoCpler):
def __init__(self, cfg):
super().__init__(cfg)
def complete_info(self, item_feature: ItemFeature):
tokens = self.tokenizer.tokenize(item_feature.question.strip... | true | true |
f70a030b4c2a7491dbc7609927869cf77e179697 | 445 | py | Python | scripts/item/consume_2434762.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 54 | 2019-04-16T23:24:48.000Z | 2021-12-18T11:41:50.000Z | scripts/item/consume_2434762.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 3 | 2019-05-19T15:19:41.000Z | 2020-04-27T16:29:16.000Z | scripts/item/consume_2434762.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 49 | 2020-11-25T23:29:16.000Z | 2022-03-26T16:20:24.000Z | # Mini Black Heaven Mount Coupon | (2434762)
if sm.getSkillByItem() == 0:# Check whether item has an vehicleID stored, 0 if false.
sm.chat("An Error occurred whilst trying to find the mount.")
elif sm.hasSkill(sm.getSkillByItem()):
sm.chat("You already have the 'Mini Black Heaven' mount.")
else:
sm.consu... | 40.454545 | 86 | 0.707865 | if sm.getSkillByItem() == 0: sm.chat("An Error occurred whilst trying to find the mount.")
elif sm.hasSkill(sm.getSkillByItem()):
sm.chat("You already have the 'Mini Black Heaven' mount.")
else:
sm.consumeItem()
sm.giveSkill(sm.getSkillByItem())
sm.chat("Successfully added the 'Mini Black Heaven' mou... | true | true |
f70a03d30736dd708147341c7dadfe0b222da100 | 618 | py | Python | xgboost_ames_housing/test/conftest.py | qq2016/kubeflow_learning | 930706686108f997aab42ccf2fe455dcf09a4afc | [
"Apache-2.0"
] | 1,165 | 2018-03-01T01:47:14.000Z | 2022-03-31T08:35:00.000Z | xgboost_ames_housing/test/conftest.py | arki1/examples | c93b792d67c8c52bc91d4ccf5fbaead4e2324331 | [
"Apache-2.0"
] | 929 | 2018-02-04T18:20:16.000Z | 2022-03-31T18:20:43.000Z | xgboost_ames_housing/test/conftest.py | arki1/examples | c93b792d67c8c52bc91d4ccf5fbaead4e2324331 | [
"Apache-2.0"
] | 687 | 2018-02-01T21:35:30.000Z | 2022-03-29T07:47:47.000Z | import pytest
def pytest_addoption(parser):
parser.addoption(
"--master", action="store", default="", help="IP address of GKE master")
parser.addoption(
"--namespace", action="store", default="", help="namespace of server")
parser.addoption(
"--service", action="store", default="",
help... | 24.72 | 78 | 0.697411 | import pytest
def pytest_addoption(parser):
parser.addoption(
"--master", action="store", default="", help="IP address of GKE master")
parser.addoption(
"--namespace", action="store", default="", help="namespace of server")
parser.addoption(
"--service", action="store", default="",
help... | true | true |
f70a051a93048684b0e2b78eec14871d90d388e0 | 13,037 | py | Python | lte/gateway/python/integ_tests/s1aptests/test_attach_service_with_multi_pdns_and_bearers_mt_data.py | saurabhsoni88/magma | 4236c9d8edb7bd203707ff7e861b1f7c12fb84c7 | [
"BSD-3-Clause"
] | 1 | 2021-08-04T16:40:05.000Z | 2021-08-04T16:40:05.000Z | lte/gateway/python/integ_tests/s1aptests/test_attach_service_with_multi_pdns_and_bearers_mt_data.py | saurabhsoni88/magma | 4236c9d8edb7bd203707ff7e861b1f7c12fb84c7 | [
"BSD-3-Clause"
] | 112 | 2020-09-03T06:41:43.000Z | 2022-03-31T12:07:08.000Z | lte/gateway/python/integ_tests/s1aptests/test_attach_service_with_multi_pdns_and_bearers_mt_data.py | kkahrs/magma | 73e666627dc28e0c492feab7321bb7d6dd433b09 | [
"BSD-3-Clause"
] | 1 | 2021-05-26T03:41:46.000Z | 2021-05-26T03:41:46.000Z | """
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... | 34.217848 | 79 | 0.571527 |
import unittest
import time
import gpp_types
import s1ap_types
import s1ap_wrapper
from integ_tests.s1aptests.s1ap_utils import SessionManagerUtil
import ipaddress
from lte.protos.policydb_pb2 import FlowMatch
class TestAttachServiceWithMultiPdnsAndBearersMtData(unittest.TestCase):
def setUp(self):
self... | true | true |
f70a05c6a865eba6a06188b0d8d211a463686254 | 420 | py | Python | xonsh/parser.py | caputomarcos/xonsh | 9ca29d8f2aad9f026af23b83fb7263d0fb702b1a | [
"BSD-2-Clause-FreeBSD"
] | 7,986 | 2015-11-07T11:59:21.000Z | 2022-03-27T17:20:49.000Z | xonsh/parser.py | caputomarcos/xonsh | 9ca29d8f2aad9f026af23b83fb7263d0fb702b1a | [
"BSD-2-Clause-FreeBSD"
] | 161 | 2016-05-09T09:53:48.000Z | 2022-02-22T04:18:59.000Z | xonsh/parser.py | caputomarcos/xonsh | 9ca29d8f2aad9f026af23b83fb7263d0fb702b1a | [
"BSD-2-Clause-FreeBSD"
] | 539 | 2016-04-05T05:39:58.000Z | 2022-03-23T20:47:52.000Z | # -*- coding: utf-8 -*-
"""Implements the xonsh parser."""
from xonsh.lazyasd import lazyobject
from xonsh.platform import PYTHON_VERSION_INFO
@lazyobject
def Parser():
if PYTHON_VERSION_INFO > (3, 6):
from xonsh.parsers.v36 import Parser as p
elif PYTHON_VERSION_INFO > (3, 5):
from xonsh.pars... | 26.25 | 49 | 0.685714 | from xonsh.lazyasd import lazyobject
from xonsh.platform import PYTHON_VERSION_INFO
@lazyobject
def Parser():
if PYTHON_VERSION_INFO > (3, 6):
from xonsh.parsers.v36 import Parser as p
elif PYTHON_VERSION_INFO > (3, 5):
from xonsh.parsers.v35 import Parser as p
else:
from xonsh.par... | true | true |
f70a066635c0d20ddf6993ebb8b958bc79edcc42 | 619 | py | Python | 01-Lists_as_stacks_and_queues/balanced_parentheses.py | nmoskova/Python-advanced | 007f496e868aa151e39d79446b055e76ffb2db95 | [
"MIT"
] | null | null | null | 01-Lists_as_stacks_and_queues/balanced_parentheses.py | nmoskova/Python-advanced | 007f496e868aa151e39d79446b055e76ffb2db95 | [
"MIT"
] | null | null | null | 01-Lists_as_stacks_and_queues/balanced_parentheses.py | nmoskova/Python-advanced | 007f496e868aa151e39d79446b055e76ffb2db95 | [
"MIT"
] | null | null | null | parentheses = input()
stack_opening_brackets = []
pairs = {
'(': ')',
'{': '}',
'[': ']'
}
balanced = True
for el in parentheses:
if el in "({[":
stack_opening_brackets.append(el)
else:
if len(stack_opening_brackets) > 0:
opening_bracket = stack_opening_brackets.pop()
... | 19.34375 | 58 | 0.537964 | parentheses = input()
stack_opening_brackets = []
pairs = {
'(': ')',
'{': '}',
'[': ']'
}
balanced = True
for el in parentheses:
if el in "({[":
stack_opening_brackets.append(el)
else:
if len(stack_opening_brackets) > 0:
opening_bracket = stack_opening_brackets.pop()
... | true | true |
f70a06af43dd69ca9f41c3a3beebccea7e0d523c | 5,671 | py | Python | p4_hlir/main.py | hnamkung15/p4-hlir | b12a1bdc34fa0bf24041cbd747f04f908cefc2c0 | [
"Apache-2.0"
] | 2 | 2021-09-27T13:54:46.000Z | 2022-02-09T14:17:08.000Z | p4_hlir/main.py | hnamkung15/p4-hlir | b12a1bdc34fa0bf24041cbd747f04f908cefc2c0 | [
"Apache-2.0"
] | null | null | null | p4_hlir/main.py | hnamkung15/p4-hlir | b12a1bdc34fa0bf24041cbd747f04f908cefc2c0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013-present Barefoot Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 32.97093 | 106 | 0.639922 |
import os
from frontend.tokenizer import *
from frontend.parser import *
from frontend.preprocessor import Preprocessor, PreprocessorException
from frontend.semantic_check import P4SemanticChecker
from frontend.dumper import P4HlirDumper
from frontend.ast import P4Program
from collections import OrderedDict
import hli... | false | true |
f70a06c82a572505b28b82a34b5eb08e9de1b593 | 1,121 | py | Python | VOTA_Control/VOTAScopeHW/daq_do/daq_do_hw.py | fullerene12/VOTA | 3a5cfc1e210ac7ea274537a8d189b54660416599 | [
"MIT"
] | null | null | null | VOTA_Control/VOTAScopeHW/daq_do/daq_do_hw.py | fullerene12/VOTA | 3a5cfc1e210ac7ea274537a8d189b54660416599 | [
"MIT"
] | null | null | null | VOTA_Control/VOTAScopeHW/daq_do/daq_do_hw.py | fullerene12/VOTA | 3a5cfc1e210ac7ea274537a8d189b54660416599 | [
"MIT"
] | 1 | 2021-08-01T22:39:18.000Z | 2021-08-01T22:39:18.000Z | '''
Created on Aug 9, 2017
@author: Hao Wu
'''
from ScopeFoundry import HardwareComponent
from .daq_do_dev import DAQSimpleDOTask
from PyDAQmx import *
import numpy as np
import time
class DAQdoHW(HardwareComponent):
'''
Hardware Component Class for receiving AI input for breathing, licking etc
'''
... | 23.354167 | 78 | 0.613738 |
from ScopeFoundry import HardwareComponent
from .daq_do_dev import DAQSimpleDOTask
from PyDAQmx import *
import numpy as np
import time
class DAQdoHW(HardwareComponent):
name='daq_do'
def setup(self,channels='Dev2/port0/line2'):
self.settings.New(name='channels',initial=channels,dtype=str,ro=Fal... | true | true |
f70a06d2005dcef3d0954fa546eda9fa99fac2cb | 4,394 | py | Python | tests/test_malquery.py | kra-ts/falconpy | c7c4ed93cb3b56cdfd86757f573fde57e4ccf857 | [
"Unlicense"
] | null | null | null | tests/test_malquery.py | kra-ts/falconpy | c7c4ed93cb3b56cdfd86757f573fde57e4ccf857 | [
"Unlicense"
] | null | null | null | tests/test_malquery.py | kra-ts/falconpy | c7c4ed93cb3b56cdfd86757f573fde57e4ccf857 | [
"Unlicense"
] | null | null | null | # test_malquery.py
# This class tests the malquery service class
import os
import sys
import pytest
# Authentication via test_authorization.py
from tests import test_authorization as Authorization
# Import our sibling src folder into the path
sys.path.append(os.path.abspath('src'))
# Classes to test - manually imported... | 48.285714 | 94 | 0.382795 | import os
import sys
import pytest
from tests import test_authorization as Authorization
sys.path.append(os.path.abspath('src'))
from falconpy import MalQuery
auth = Authorization.TestAuthorization()
config = auth.getConfigObject()
falcon = MalQuery(auth_object=config)
AllowedResponses = [200, 400, 404, 429]
class ... | true | true |
f70a08c0ccb36b65a873e4524fb5358bf0678621 | 2,908 | py | Python | results/8112a5333cb1bb472ee14fa5342f6422/pyfile.py | CatrionaMarr/OnlineMCMCTest | 92899d082c1bdfc2d61128ced453ac59812ae03a | [
"MIT"
] | null | null | null | results/8112a5333cb1bb472ee14fa5342f6422/pyfile.py | CatrionaMarr/OnlineMCMCTest | 92899d082c1bdfc2d61128ced453ac59812ae03a | [
"MIT"
] | null | null | null | results/8112a5333cb1bb472ee14fa5342f6422/pyfile.py | CatrionaMarr/OnlineMCMCTest | 92899d082c1bdfc2d61128ced453ac59812ae03a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# import required packages
import emcee
import numpy as np
from numpy import exp, log
# import model function from separate file
from mymodel import mymodel
# import post-processing function from theonlinemcmc package
from theonlinemcmc import *
# initialise error code value
errval = 0
# defi... | 21.540741 | 128 | 0.670564 |
import emcee
import numpy as np
from numpy import exp, log
from mymodel import mymodel
from theonlinemcmc import *
errval = 0
def lnprob(theta, x, sigma_gauss, data):
lp = lnprior(theta)
if not np.isfinite(lp):
return -np.inf
return lp + lnlike(theta, x, sigma_gauss, data)
def lnprior(theta):
lp = 0... | true | true |
f70a0908b0719bf6610dc731089facdb963866e2 | 597 | py | Python | scoreboard.py | MdGhulamAzadAnsari/Turtle-Crossing-Game | 24c45e048c3ab994638a3b77f904c602070eda87 | [
"MIT"
] | 1 | 2021-12-17T15:29:59.000Z | 2021-12-17T15:29:59.000Z | scoreboard.py | MdGhulamAzadAnsari/Turtle-Crossing-Game | 24c45e048c3ab994638a3b77f904c602070eda87 | [
"MIT"
] | null | null | null | scoreboard.py | MdGhulamAzadAnsari/Turtle-Crossing-Game | 24c45e048c3ab994638a3b77f904c602070eda87 | [
"MIT"
] | null | null | null | from turtle import Turtle
FONT = ("Courier", 20, "normal")
class Scoreboard(Turtle):
def __init__(self):
super().__init__()
self.hideturtle()
self.penup()
self.level = 1
self.goto(x=-230, y=260)
self.update_scoreboard()
def update_scoreboard(self):
sel... | 22.961538 | 69 | 0.586265 | from turtle import Turtle
FONT = ("Courier", 20, "normal")
class Scoreboard(Turtle):
def __init__(self):
super().__init__()
self.hideturtle()
self.penup()
self.level = 1
self.goto(x=-230, y=260)
self.update_scoreboard()
def update_scoreboard(self):
sel... | true | true |
f70a09258b593b19b6aa36de6f5f883ef6e7bdbe | 529 | py | Python | zSPA/zSPA/spa/views.py | hawwestin/MSR.DjangoByExample | b1649ccb92e9d557c09f27c15fc779de64282fcb | [
"MIT"
] | 1 | 2021-02-08T20:29:06.000Z | 2021-02-08T20:29:06.000Z | zSPA/zSPA/spa/views.py | hawwestin/MSR.DjangoByExample | b1649ccb92e9d557c09f27c15fc779de64282fcb | [
"MIT"
] | 13 | 2021-06-09T17:28:23.000Z | 2022-03-12T00:54:20.000Z | zSPA/zSPA/spa/views.py | hawwestin/MSR.DjangoByExample | b1649ccb92e9d557c09f27c15fc779de64282fcb | [
"MIT"
] | null | null | null | from django.shortcuts import render
from decouple import config
from .models import Images
# Create your views here.
def index(request, **kwargs):
"""
Render single page application and provide context data.
:param request:
:param kwargs:
:return:
"""
context = {
'images': Images... | 23 | 60 | 0.654064 | from django.shortcuts import render
from decouple import config
from .models import Images
def index(request, **kwargs):
context = {
'images': Images.objects.filter(is_active=True),
'googleForm': config('googleForm', default=''),
'googleMaps': config('googleMaps', default=''),
}
... | true | true |
f70a097f52bce624bb2820b41fa155ec232643eb | 2,720 | py | Python | var/spack/repos/builtin/packages/sparskit/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2015-10-04T02:17:46.000Z | 2018-02-07T18:23:00.000Z | var/spack/repos/builtin/packages/sparskit/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 22 | 2017-08-01T22:45:10.000Z | 2022-03-10T07:46:31.000Z | var/spack/repos/builtin/packages/sparskit/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 4 | 2016-06-10T17:57:39.000Z | 2018-09-11T04:59:38.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
from spack import *
class Sparskit(MakefilePackage):
"""SPARSKIT: A basic tool-kit for sparse matrix comp... | 34.871795 | 103 | 0.609926 |
import os
from spack import *
class Sparskit(MakefilePackage):
homepage = "https://www-users.cse.umn.edu/~saad/software/SPARSKIT/"
version('develop', sha256='ecdd0a9968d6b45153a328710a42fe87600f0bba0e3c53896090b8ae1c113b7a',
url='http://www-users.cs.umn.edu/~saad/software/SPARSKIT/SPARSKIT2.ta... | true | true |
f70a0a2cf88801ad20816738947597123b97a106 | 3,932 | py | Python | pygments/lexers/verification.py | KMilhan/pygments | 5120e9943d137f7aa1d33499b79d5ebd5c9f775d | [
"BSD-2-Clause"
] | 1,198 | 2015-01-02T12:08:49.000Z | 2021-10-07T02:46:59.000Z | pygments/lexers/verification.py | KMilhan/pygments | 5120e9943d137f7aa1d33499b79d5ebd5c9f775d | [
"BSD-2-Clause"
] | 249 | 2015-01-22T13:31:12.000Z | 2021-05-01T08:01:22.000Z | pygments/lexers/verification.py | KMilhan/pygments | 5120e9943d137f7aa1d33499b79d5ebd5c9f775d | [
"BSD-2-Clause"
] | 118 | 2015-01-16T19:13:15.000Z | 2021-07-21T15:09:15.000Z | # -*- coding: utf-8 -*-
"""
pygments.lexers.verification
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lexer for Intermediate Verification Languages (IVLs).
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, include... | 34.191304 | 92 | 0.444049 |
from pygments.lexer import RegexLexer, include, words
from pygments.token import Comment, Operator, Keyword, Name, Number, \
Punctuation, Text, Generic
__all__ = ['BoogieLexer', 'SilverLexer']
class BoogieLexer(RegexLexer):
name = 'Boogie'
aliases = ['boogie']
filenames = ['*.bpl']
tokens = {
... | true | true |
f70a0b08e0b1f2114d4fef8c6ff7995adeceb92d | 1,319 | py | Python | DownloadSECFilingsExample.py | sdincer11/DownloadSECFilings | be7738bf9062d3e5c28aa3acb8209d868d846953 | [
"Apache-2.0"
] | null | null | null | DownloadSECFilingsExample.py | sdincer11/DownloadSECFilings | be7738bf9062d3e5c28aa3acb8209d868d846953 | [
"Apache-2.0"
] | null | null | null | DownloadSECFilingsExample.py | sdincer11/DownloadSECFilings | be7738bf9062d3e5c28aa3acb8209d868d846953 | [
"Apache-2.0"
] | null | null | null | from DownloadSECFilings import *
# SEC EDGAR system saves all the URL links for each filing under quarterly folders. These files storing
# the URL information are called "master" files.
# 1) You need to call for the "createMasterFile" function if you want to keep the master file updated.
# createMasterFile generates ... | 69.421053 | 115 | 0.738438 | from DownloadSECFilings import *
createMasterFile('C:/path to your folder where you want to download the filings to', 2000, 2001)
downloadSECFilings('C:/path to your folder where you want to download the filings to',
formTypesList=['10-K'],
dateStart=20000101,
da... | true | true |
f70a0bca3d6810cc9945ef26f760662ef36c5232 | 339 | py | Python | happy_kids.py | anudeep586/Codechef_hackerrank_codeforces1 | 39a536d6ad6d670e0bce2ba8657cf5715b0037e0 | [
"0BSD"
] | null | null | null | happy_kids.py | anudeep586/Codechef_hackerrank_codeforces1 | 39a536d6ad6d670e0bce2ba8657cf5715b0037e0 | [
"0BSD"
] | null | null | null | happy_kids.py | anudeep586/Codechef_hackerrank_codeforces1 | 39a536d6ad6d670e0bce2ba8657cf5715b0037e0 | [
"0BSD"
] | null | null | null | try:
tests=int(input())
z=[]
for _ in range(tests):
n,x=[int(xi) for xi in input().split(" ")]
arr=list(map(int,input().rstrip().split()))
m=max(arr)-min(arr)
if m>x:
z.append("NO")
else:
z.append("YES")
for x in z:
prin... | 22.6 | 52 | 0.439528 | try:
tests=int(input())
z=[]
for _ in range(tests):
n,x=[int(xi) for xi in input().split(" ")]
arr=list(map(int,input().rstrip().split()))
m=max(arr)-min(arr)
if m>x:
z.append("NO")
else:
z.append("YES")
for x in z:
prin... | true | true |
f70a0bd231c19af2ab9ae0085efc1a97b5a73b9f | 100 | py | Python | object_oriented_design/deck_of_cards/suite.py | bpatel28/practice_python | 358c3ce1ca59d80711df07e6509af14e9c784f60 | [
"MIT"
] | 1 | 2021-10-13T07:33:25.000Z | 2021-10-13T07:33:25.000Z | object_oriented_design/deck_of_cards/suite.py | bpatel28/practice_python | 358c3ce1ca59d80711df07e6509af14e9c784f60 | [
"MIT"
] | null | null | null | object_oriented_design/deck_of_cards/suite.py | bpatel28/practice_python | 358c3ce1ca59d80711df07e6509af14e9c784f60 | [
"MIT"
] | null | null | null | from enum import Enum
class Suite(Enum):
Diamond = 1
Heart = 2
Club = 3
Spade = 4
| 11.111111 | 21 | 0.57 | from enum import Enum
class Suite(Enum):
Diamond = 1
Heart = 2
Club = 3
Spade = 4
| true | true |
f70a0c6d4c741fe95e6abbe3c262e8e24fbf85c3 | 1,902 | py | Python | quapy/method/non_aggregative.py | valgur/QuaPy | 6b1ba4886a1d64b086829306cbba689cdcfd60e8 | [
"BSD-3-Clause"
] | null | null | null | quapy/method/non_aggregative.py | valgur/QuaPy | 6b1ba4886a1d64b086829306cbba689cdcfd60e8 | [
"BSD-3-Clause"
] | null | null | null | quapy/method/non_aggregative.py | valgur/QuaPy | 6b1ba4886a1d64b086829306cbba689cdcfd60e8 | [
"BSD-3-Clause"
] | null | null | null | from quapy.data import LabelledCollection
from .base import BaseQuantifier
class MaximumLikelihoodPrevalenceEstimation(BaseQuantifier):
"""
The `Maximum Likelihood Prevalence Estimation` (MLPE) method is a lazy method that assumes there is no prior
probability shift between training and test instances (pu... | 30.190476 | 116 | 0.655626 | from quapy.data import LabelledCollection
from .base import BaseQuantifier
class MaximumLikelihoodPrevalenceEstimation(BaseQuantifier):
def __init__(self):
self._classes_ = None
def fit(self, data: LabelledCollection):
self._classes_ = data.classes_
self.estimated_prevalence = data.p... | true | true |
f70a0cb3b2ed71901741e067150e72927820d222 | 31,386 | py | Python | testslide/strict_mock.py | deathowl/TestSlide | 22958af9d487caa9bbc309405106591a48716ad5 | [
"MIT"
] | 48 | 2021-01-06T15:11:09.000Z | 2022-03-09T22:52:25.000Z | testslide/strict_mock.py | deathowl/TestSlide | 22958af9d487caa9bbc309405106591a48716ad5 | [
"MIT"
] | 63 | 2021-01-06T15:04:49.000Z | 2022-03-30T22:12:24.000Z | testslide/strict_mock.py | deathowl/TestSlide | 22958af9d487caa9bbc309405106591a48716ad5 | [
"MIT"
] | 33 | 2021-03-03T19:55:14.000Z | 2022-03-29T21:49:30.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import dis
import inspect
import os.path
from types import FrameType
from typing import (
TYPE_CHECKING,
Any,
Callable,... | 37.05549 | 104 | 0.567419 | import copy
import dis
import inspect
import os.path
from types import FrameType
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
List,
Optional,
Type,
Union,
get_type_hints,
)
import testslide.lib
import testslide.mock_callable
if TYPE_CHECKING:
from testslide.mock... | true | true |
f70a0ce72f008baa85734794ad2293305ba995a2 | 3,653 | py | Python | mmhid/datasets/builder.py | zjutcv/mmhid | faeaf4fb5c634037c6e482f63ef73e7f2144c7b5 | [
"Apache-2.0"
] | 1 | 2021-11-26T07:41:39.000Z | 2021-11-26T07:41:39.000Z | mmhid/datasets/builder.py | zjutcv/mmhid | faeaf4fb5c634037c6e482f63ef73e7f2144c7b5 | [
"Apache-2.0"
] | null | null | null | mmhid/datasets/builder.py | zjutcv/mmhid | faeaf4fb5c634037c6e482f63ef73e7f2144c7b5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
import copy
import platform
import random
from functools import partial
import numpy as np
from mmcv.parallel import collate
from mmcv.runner import get_dist_info
from mmcv.utils import Registry, build_from_cfg
from torch.utils.data import DataLoader
from .samplers impo... | 31.491379 | 79 | 0.662743 | import copy
import platform
import random
from functools import partial
import numpy as np
from mmcv.parallel import collate
from mmcv.runner import get_dist_info
from mmcv.utils import Registry, build_from_cfg
from torch.utils.data import DataLoader
from .samplers import DistributedGroupSampler, DistributedSampler, ... | true | true |
f70a0d2a2029fd539f60c8d2b5e2c5f1548616f4 | 9,653 | py | Python | bases_2021_1S/Grupo 01/Parser/ui/PantallaPrincipal.py | dadu0699/tytus | e1920f6932c840859e3e79eb8756a1d3da88bd77 | [
"MIT"
] | 35 | 2020-12-07T03:11:43.000Z | 2021-04-15T17:38:16.000Z | bases_2021_1S/Grupo 01/Parser/ui/PantallaPrincipal.py | dadu0699/tytus | e1920f6932c840859e3e79eb8756a1d3da88bd77 | [
"MIT"
] | 47 | 2020-12-09T01:29:09.000Z | 2021-01-13T05:37:50.000Z | bases_2021_1S/Grupo 01/Parser/ui/PantallaPrincipal.py | dadu0699/tytus | e1920f6932c840859e3e79eb8756a1d3da88bd77 | [
"MIT"
] | 556 | 2020-12-07T03:13:31.000Z | 2021-06-17T17:41:10.000Z | from sys import path
from os.path import dirname as dir
import webbrowser
import os
path.append(dir(path[0]))
from tkinter import ttk
import tkinter as tk
from tkinter import *
from ui.Pantalla_TS import *
from ui.Pantalla_AST import *
from ui.Pantalla_Error import *
import tkinter.messagebox
from analizer import inter... | 36.984674 | 87 | 0.530716 | from sys import path
from os.path import dirname as dir
import webbrowser
import os
path.append(dir(path[0]))
from tkinter import ttk
import tkinter as tk
from tkinter import *
from ui.Pantalla_TS import *
from ui.Pantalla_AST import *
from ui.Pantalla_Error import *
import tkinter.messagebox
from analizer import inter... | true | true |
f70a0dbd0faf4dc6a673ed3d6bd04f9fe282784e | 12,251 | py | Python | jupyterhub_config.py | victor-moreno/jupyterhub-deploy-docker-VM | 002af508122d0f1919c704f719acd3d837174d4b | [
"BSD-3-Clause"
] | 3 | 2021-11-15T12:54:24.000Z | 2022-02-07T07:45:24.000Z | jupyterhub_config.py | victor-moreno/jupyterhub-deploy-docker-VM | 002af508122d0f1919c704f719acd3d837174d4b | [
"BSD-3-Clause"
] | 1 | 2022-01-10T21:01:31.000Z | 2022-03-15T03:48:13.000Z | jupyterhub_config.py | victor-moreno/jupyterhub-deploy-docker-VM | 002af508122d0f1919c704f719acd3d837174d4b | [
"BSD-3-Clause"
] | 1 | 2022-02-08T20:05:45.000Z | 2022-02-08T20:05:45.000Z | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
# Configuration file for JupyterHub
import os
# pre-spawn settings
NB_UID = 65534
NB_GID = 65534
CUDA = 'cuda' in os.environ['HOSTNODE']
c = get_config()
# read users/teams & images
import os, yaml
with open('... | 31.656331 | 125 | 0.671455 |
import os
NB_UID = 65534
NB_GID = 65534
CUDA = 'cuda' in os.environ['HOSTNODE']
c = get_config()
import os, yaml
with open('/srv/jupyterhub/config.yaml', 'r') as cfgfile:
cfg = yaml.load(cfgfile, Loader=yaml.FullLoader)
team_map = cfg['users']
c.Authenticator.allowed_users = list(team_map.keys())
c.Auth... | true | true |
f70a0e8a1e36c7d6b49ffd219b5fb6ca1c543c6b | 14,575 | py | Python | Packs/DeprecatedContent/Integrations/Cymon/Cymon.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/DeprecatedContent/Integrations/Cymon/Cymon.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/DeprecatedContent/Integrations/Cymon/Cymon.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
''' IMPORTS '''
import requests
import os
# disable insecure warnings
requests.packages.urllib3.disable_warnings()
if not demisto.params().get('useProxy', False):
del os.environ['HTTP_PROXY']
del os.environ['H... | 31.344086 | 124 | 0.535232 | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
import requests
import os
requests.packages.urllib3.disable_warnings()
if not demisto.params().get('useProxy', False):
del os.environ['HTTP_PROXY']
del os.environ['HTTPS_PROXY']
del os.environ['http_proxy'... | true | true |
f70a0f884ad3dff842c3597cedd90838041493d7 | 1,991 | py | Python | src/compas_blender/artists/robotmodelartist.py | XingxinHE/compas | d2901dbbacdaf4694e5adae78ba8f093f10532bf | [
"MIT"
] | null | null | null | src/compas_blender/artists/robotmodelartist.py | XingxinHE/compas | d2901dbbacdaf4694e5adae78ba8f093f10532bf | [
"MIT"
] | null | null | null | src/compas_blender/artists/robotmodelartist.py | XingxinHE/compas | d2901dbbacdaf4694e5adae78ba8f093f10532bf | [
"MIT"
] | null | null | null | import bpy
import mathutils
import compas_blender
from compas.robots.base_artist import BaseRobotModelArtist
__all__ = [
'RobotModelArtist',
]
class RobotModelArtist(BaseRobotModelArtist):
"""Visualizer for robot models inside a Blender environment.
Parameters
----------
model : :class:`compas.... | 33.183333 | 135 | 0.675038 | import bpy
import mathutils
import compas_blender
from compas.robots.base_artist import BaseRobotModelArtist
__all__ = [
'RobotModelArtist',
]
class RobotModelArtist(BaseRobotModelArtist):
def __init__(self, model, collection=None):
self.collection = collection
super(RobotModelArtist, self)... | true | true |
f70a10aff0b277358ad768846f92507929b5b0b0 | 18,696 | py | Python | venv/Lib/site-packages/skimage/transform/tests/test_radon_transform.py | amelliaaas/tugastkc4 | f442382c72379e911f3780543b95345a3b1c9407 | [
"Apache-2.0"
] | 4 | 2021-10-20T12:39:09.000Z | 2022-02-26T15:02:08.000Z | venv/Lib/site-packages/skimage/transform/tests/test_radon_transform.py | amelliaaas/tugastkc4 | f442382c72379e911f3780543b95345a3b1c9407 | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/skimage/transform/tests/test_radon_transform.py | amelliaaas/tugastkc4 | f442382c72379e911f3780543b95345a3b1c9407 | [
"Apache-2.0"
] | 20 | 2021-11-07T13:55:56.000Z | 2021-12-02T10:54:01.000Z | import itertools
import pytest
import numpy as np
from skimage.data import shepp_logan_phantom
from skimage.transform import radon, iradon, iradon_sart, rescale
from skimage._shared.utils import convert_to_float
from skimage._shared import testing
from skimage._shared.testing import test_parallel
from skimage._shared... | 37.846154 | 80 | 0.65153 | import itertools
import pytest
import numpy as np
from skimage.data import shepp_logan_phantom
from skimage.transform import radon, iradon, iradon_sart, rescale
from skimage._shared.utils import convert_to_float
from skimage._shared import testing
from skimage._shared.testing import test_parallel
from skimage._shared... | true | true |
f70a10d191655957dfeebe15ba978c3fba9a7a51 | 9,739 | py | Python | qiskit/basicplotter.py | NickyBar/QIP | 11747b40beb38d41faa297fb2b53f28c6519c753 | [
"Apache-2.0"
] | 1 | 2017-07-12T02:04:53.000Z | 2017-07-12T02:04:53.000Z | qiskit/basicplotter.py | NickyBar/QIP | 11747b40beb38d41faa297fb2b53f28c6519c753 | [
"Apache-2.0"
] | null | null | null | qiskit/basicplotter.py | NickyBar/QIP | 11747b40beb38d41faa297fb2b53f28c6519c753 | [
"Apache-2.0"
] | 6 | 2018-05-27T10:52:02.000Z | 2021-04-02T19:20:11.000Z | # -*- coding: utf-8 -*-
# Copyright 2017 IBM RESEARCH. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 35.286232 | 79 | 0.591745 |
from mpl_toolkits.mplot3d import proj3d
import matplotlib.pyplot as plt
from matplotlib.patches import FancyArrowPatch
import numpy as np
from collections import Counter
from functools import reduce
def plot_histogram(data, number_to_keep=None):
if number_to_keep is not None:
data_temp = dict(Counter(da... | true | true |
f70a111ad3d409ffefa00c4d03e4c96bc4459064 | 2,136 | py | Python | qa/rpc-tests/getchaintips.py | mirzaei-ce/core-moselbit | 7e8e723109f22b0fddfa227692b9492f48d12d7c | [
"MIT"
] | null | null | null | qa/rpc-tests/getchaintips.py | mirzaei-ce/core-moselbit | 7e8e723109f22b0fddfa227692b9492f48d12d7c | [
"MIT"
] | null | null | null | qa/rpc-tests/getchaintips.py | mirzaei-ce/core-moselbit | 7e8e723109f22b0fddfa227692b9492f48d12d7c | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Exercise the getchaintips API. We introduce a network split, work
# on chains of different lengths, an... | 35.6 | 70 | 0.643727 |
from test_framework.test_framework import MoselbitTestFramework
from test_framework.util import assert_equal
class GetChainTipsTest (MoselbitTestFramework):
def run_test (self):
MoselbitTestFramework.run_test (self)
tips = self.nodes[0].getchaintips ()
assert_equal (len (tips), 1)
... | true | true |
f70a125670f78eacba803b405bf1888af7478244 | 853 | py | Python | aitlas/transforms/classification.py | tiendzung-le/aitlas | 4725693a5c073cc80a617fb9bab5a1557c3c3270 | [
"MIT"
] | 32 | 2020-12-04T19:48:19.000Z | 2022-03-16T18:18:05.000Z | aitlas/transforms/classification.py | likyoo/aitlas | 1c365e055c18e349e41670a4137c4d2b88671af9 | [
"MIT"
] | 2 | 2021-04-11T17:09:14.000Z | 2021-05-14T13:22:41.000Z | aitlas/transforms/classification.py | likyoo/aitlas | 1c365e055c18e349e41670a4137c4d2b88671af9 | [
"MIT"
] | 8 | 2021-04-06T22:06:27.000Z | 2022-01-30T06:01:39.000Z | from torchvision import transforms
from ..base import BaseTransforms
class ResizeCenterCropFlipHVToTensor(BaseTransforms):
def __call__(self, sample):
data_transforms = transforms.Compose([
transforms.ToPILImage(),
transforms.Resize(256),
transforms.CenterCro... | 28.433333 | 54 | 0.620164 | from torchvision import transforms
from ..base import BaseTransforms
class ResizeCenterCropFlipHVToTensor(BaseTransforms):
def __call__(self, sample):
data_transforms = transforms.Compose([
transforms.ToPILImage(),
transforms.Resize(256),
transforms.CenterCro... | true | true |
f70a13330f3cce522d7d897373b4d306174ba6ee | 1,393 | py | Python | treefrog/setup.py | oberhamsi/FrameworkBenchmarks | 660a66d51a9aad10b43c0660208fb13c098121af | [
"BSD-3-Clause"
] | 4 | 2015-01-22T02:13:03.000Z | 2018-06-13T12:02:46.000Z | frameworks/C++/treefrog/setup.py | ratpack/FrameworkBenchmarks | 81604309e46e382fe2ffb7970a87d728f20c8be6 | [
"BSD-3-Clause"
] | null | null | null | frameworks/C++/treefrog/setup.py | ratpack/FrameworkBenchmarks | 81604309e46e382fe2ffb7970a87d728f20c8be6 | [
"BSD-3-Clause"
] | null | null | null |
import subprocess
import sys
import setup_util
from os.path import expanduser
home = expanduser("~")
##############
# start(args)
##############
def start(args, logfile, errfile):
setup_util.replace_text("treefrog/config/database.ini", "HostName=.*", "HostName=" + args.database_host)
setup_util.replace_text("tre... | 35.717949 | 126 | 0.703518 |
import subprocess
import sys
import setup_util
from os.path import expanduser
home = expanduser("~")
def start(args, logfile, errfile):
setup_util.replace_text("treefrog/config/database.ini", "HostName=.*", "HostName=" + args.database_host)
setup_util.replace_text("treefrog/config/application.ini", "MultiProcess... | true | true |
f70a13567965eaf01adcb5afda46bb9ab109f32e | 1,339 | py | Python | tests/int_pro_surveys.py | wfarah/frbpoppy | e575c49e6b4a69015a66d3f38a3459e0ffe4eb05 | [
"MIT"
] | null | null | null | tests/int_pro_surveys.py | wfarah/frbpoppy | e575c49e6b4a69015a66d3f38a3459e0ffe4eb05 | [
"MIT"
] | null | null | null | tests/int_pro_surveys.py | wfarah/frbpoppy | e575c49e6b4a69015a66d3f38a3459e0ffe4eb05 | [
"MIT"
] | null | null | null | """Plot intensity profile of theoretical beam patterns."""
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import binned_statistic as bstat
from frbpoppy.survey import Survey
OBSERVATORIES = [('parkes', 'htru'),
('apertif', 'apertif')]
n = int(1e6)
for obs in OBSERVATORIES:
... | 26.254902 | 71 | 0.612397 | import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import binned_statistic as bstat
from frbpoppy.survey import Survey
OBSERVATORIES = [('parkes', 'htru'),
('apertif', 'apertif')]
n = int(1e6)
for obs in OBSERVATORIES:
survey = obs[1]
pattern = obs[0]
s = Survey(surve... | true | true |
f70a13ae6569d81bdfa4c8e185bdd5411b6c5afb | 273 | py | Python | sciwing/modules/__init__.py | sean-dingxu/sciwing | 75eca1ea43be165eab20cf8bd81bbc19cecda74c | [
"MIT"
] | 50 | 2019-09-13T10:32:29.000Z | 2022-02-14T16:52:53.000Z | sciwing/modules/__init__.py | sean-dingxu/sciwing | 75eca1ea43be165eab20cf8bd81bbc19cecda74c | [
"MIT"
] | 31 | 2019-09-03T11:06:03.000Z | 2021-08-20T14:57:09.000Z | sciwing/modules/__init__.py | sean-dingxu/sciwing | 75eca1ea43be165eab20cf8bd81bbc19cecda74c | [
"MIT"
] | 9 | 2019-09-16T03:25:15.000Z | 2021-05-11T10:28:25.000Z | from sciwing.modules.embedders import *
from sciwing.modules.bow_encoder import BOW_Encoder
from sciwing.modules.lstm2vecencoder import LSTM2VecEncoder
from sciwing.modules.lstm2seqencoder import Lstm2SeqEncoder
from sciwing.modules.charlstm_encoder import CharLSTMEncoder
| 45.5 | 60 | 0.886447 | from sciwing.modules.embedders import *
from sciwing.modules.bow_encoder import BOW_Encoder
from sciwing.modules.lstm2vecencoder import LSTM2VecEncoder
from sciwing.modules.lstm2seqencoder import Lstm2SeqEncoder
from sciwing.modules.charlstm_encoder import CharLSTMEncoder
| true | true |
f70a14c8089f951f793cbbb534fcff9da041bd68 | 5,154 | py | Python | automation/services/watchdog/metrics.py | adong-corp/mina | 4d2678444f3c2457f203bdf9b8ae0d6a9202ccfc | [
"Apache-2.0"
] | 1 | 2021-03-29T18:24:14.000Z | 2021-03-29T18:24:14.000Z | automation/services/watchdog/metrics.py | adong-corp/mina | 4d2678444f3c2457f203bdf9b8ae0d6a9202ccfc | [
"Apache-2.0"
] | null | null | null | automation/services/watchdog/metrics.py | adong-corp/mina | 4d2678444f3c2457f203bdf9b8ae0d6a9202ccfc | [
"Apache-2.0"
] | 1 | 2021-12-18T20:29:13.000Z | 2021-12-18T20:29:13.000Z |
import itertools
import datetime
import util
import asyncio
import random
import os
import sys
import traceback
import subprocess
import time
import json
import urllib.request
import ast
from google.cloud import storage
# ========================================================================
def collect_cluster_c... | 34.13245 | 140 | 0.658324 |
import itertools
import datetime
import util
import asyncio
import random
import os
import sys
import traceback
import subprocess
import time
import json
import urllib.request
import ast
from google.cloud import storage
def collect_cluster_crashes(v1, namespace, cluster_crashes):
print('collecting cluster crashes... | true | true |
f70a14e8b52c68a0c9a1982722017841cbfaa1df | 4,343 | py | Python | tests/test_tags.py | nomadixinc/django-money | 2c04749110c78978d4f12fe42d8f28a7bc9014dd | [
"BSD-3-Clause"
] | null | null | null | tests/test_tags.py | nomadixinc/django-money | 2c04749110c78978d4f12fe42d8f28a7bc9014dd | [
"BSD-3-Clause"
] | null | null | null | tests/test_tags.py | nomadixinc/django-money | 2c04749110c78978d4f12fe42d8f28a7bc9014dd | [
"BSD-3-Clause"
] | 2 | 2019-08-29T04:51:29.000Z | 2019-09-25T08:46:27.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.template import Context, Template, TemplateSyntaxError
from django.utils.translation import override
import pytest
from djmoney.models.fields import MoneyPatched
from djmoney.templatetags.djmoney import MoneyLocalizeNode
from moneyed import ... | 28.953333 | 96 | 0.521529 | from __future__ import unicode_literals
from django.template import Context, Template, TemplateSyntaxError
from django.utils.translation import override
import pytest
from djmoney.models.fields import MoneyPatched
from djmoney.templatetags.djmoney import MoneyLocalizeNode
from moneyed import Money
def render(templ... | true | true |
f70a153b88783e9a6e3e8721963f8b862849cdcb | 70 | py | Python | rlutils/pytorch/__init__.py | vermouth1992/rlutils | a326373b9e39dbf147c6c4261b82a688d4dc3e78 | [
"Apache-2.0"
] | null | null | null | rlutils/pytorch/__init__.py | vermouth1992/rlutils | a326373b9e39dbf147c6c4261b82a688d4dc3e78 | [
"Apache-2.0"
] | null | null | null | rlutils/pytorch/__init__.py | vermouth1992/rlutils | a326373b9e39dbf147c6c4261b82a688d4dc3e78 | [
"Apache-2.0"
] | null | null | null | from . import distributions
from . import functional
from . import nn
| 17.5 | 27 | 0.785714 | from . import distributions
from . import functional
from . import nn
| true | true |
f70a16364238c5a4f7f1a12687bc6b9e07edc599 | 970 | py | Python | Searching and Sorting/Merge sort/Python/merge_sort.py | Subrato-oid/cs-algorithms | 4a04fe49f513c439b641a8e4e783a98cd99dc909 | [
"MIT"
] | 239 | 2019-10-07T11:01:56.000Z | 2022-01-27T19:08:55.000Z | Searching and Sorting/Merge sort/Python/merge_sort.py | ashfreakingoyal/cs-algorithms | 08f5aba5c3379e17d03b899fc36efcdccebd181c | [
"MIT"
] | 176 | 2019-10-07T06:59:49.000Z | 2020-09-30T08:16:22.000Z | Searching and Sorting/Merge sort/Python/merge_sort.py | ashfreakingoyal/cs-algorithms | 08f5aba5c3379e17d03b899fc36efcdccebd181c | [
"MIT"
] | 441 | 2019-10-07T07:34:08.000Z | 2022-03-15T07:19:58.000Z | def mergesort(items):
if len(items) <= 1:
return items
mid = len(items) // 2
left = items[:mid]
right = items[mid:]
left = mergesort(left)
right = mergesort(right)
return merge(left, right)
def merge(left, right):
merged = []
left_index = 0
right_index... | 25.526316 | 62 | 0.587629 | def mergesort(items):
if len(items) <= 1:
return items
mid = len(items) // 2
left = items[:mid]
right = items[mid:]
left = mergesort(left)
right = mergesort(right)
return merge(left, right)
def merge(left, right):
merged = []
left_index = 0
right_index... | true | true |
f70a168c3c1ea13d7bafe7bef9dcf39a28e655b8 | 151 | py | Python | dependencies/bluebird-master/examples/followers.py | munyolec/Impact-of-Covid-19-on-Food-and-Air-Quality-in-Africa | fb5762b8a759aa5bc368edd6ea3ac714af853b1e | [
"MIT"
] | 2 | 2020-10-22T16:19:34.000Z | 2020-12-19T15:51:00.000Z | dependencies/bluebird-master/examples/followers.py | munyolec/Impact-of-Covid-19-on-Food-and-Air-Quality-in-Africa | fb5762b8a759aa5bc368edd6ea3ac714af853b1e | [
"MIT"
] | null | null | null | dependencies/bluebird-master/examples/followers.py | munyolec/Impact-of-Covid-19-on-Food-and-Air-Quality-in-Africa | fb5762b8a759aa5bc368edd6ea3ac714af853b1e | [
"MIT"
] | 6 | 2020-09-28T07:31:29.000Z | 2020-09-29T10:51:50.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from bluebird import BlueBird
for username in BlueBird().get_followers('brunn3is'):
print(username) | 21.571429 | 53 | 0.701987 |
from bluebird import BlueBird
for username in BlueBird().get_followers('brunn3is'):
print(username) | true | true |
f70a176b0b06930bded82cfc3477e7bf3ca21f6b | 18,419 | py | Python | rancher.py | xl82602/xl | 79c48d121f669ae0d95861f24e5efd58dd16de0c | [
"MIT"
] | null | null | null | rancher.py | xl82602/xl | 79c48d121f669ae0d95861f24e5efd58dd16de0c | [
"MIT"
] | null | null | null | rancher.py | xl82602/xl | 79c48d121f669ae0d95861f24e5efd58dd16de0c | [
"MIT"
] | null | null | null | # !/usr/bin/env python
import re
import requests
import collections
import hashlib
import os
import json
import time
def _prefix(cmd):
prefix = os.path.basename(cmd.replace('-', '_'))
for i in ['.pyc', '.py', '-cli', '-tool', '-util']:
prefix = prefix.replace(i, '')
return prefix.upper()
PREFI... | 29.998371 | 79 | 0.525761 |
import re
import requests
import collections
import hashlib
import os
import json
import time
def _prefix(cmd):
prefix = os.path.basename(cmd.replace('-', '_'))
for i in ['.pyc', '.py', '-cli', '-tool', '-util']:
prefix = prefix.replace(i, '')
return prefix.upper()
PREFIX = _prefix(__file__)
C... | true | true |
f70a179b3eddf190eaaa58dc66330aea22ba5acb | 2,292 | py | Python | MaxiNet/Frontend/distriopt_.py | Giuseppe1992/MaxiNet | fffb5ca383afb7f7f22de0646cced7f0182b86b5 | [
"MIT"
] | null | null | null | MaxiNet/Frontend/distriopt_.py | Giuseppe1992/MaxiNet | fffb5ca383afb7f7f22de0646cced7f0182b86b5 | [
"MIT"
] | null | null | null | MaxiNet/Frontend/distriopt_.py | Giuseppe1992/MaxiNet | fffb5ca383afb7f7f22de0646cced7f0182b86b5 | [
"MIT"
] | null | null | null | import json
import os
from mininet.topo import Topo
import subprocess
class Mapper(object):
def __init__(self, topo, physical_network_file, mapper):
self.topo = topo
self.physical_network_file = physical_network_file
self.mapper = mapper
self.topo_file = self.create_topo_file(topo... | 36.380952 | 152 | 0.609511 | import json
import os
from mininet.topo import Topo
import subprocess
class Mapper(object):
def __init__(self, topo, physical_network_file, mapper):
self.topo = topo
self.physical_network_file = physical_network_file
self.mapper = mapper
self.topo_file = self.create_topo_file(topo... | true | true |
f70a17dff3a5f42dca4df45b96d57c4d84470ded | 11,913 | py | Python | code/python/TimeSeriesAPIforDigitalPortals/v3/fds/sdk/TimeSeriesAPIforDigitalPortals/model/inline_response2001.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 6 | 2022-02-07T16:34:18.000Z | 2022-03-30T08:04:57.000Z | code/python/TimeSeriesAPIforDigitalPortals/v3/fds/sdk/TimeSeriesAPIforDigitalPortals/model/inline_response2001.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 2 | 2022-02-07T05:25:57.000Z | 2022-03-07T14:18:04.000Z | code/python/TimeSeriesAPIforDigitalPortals/v3/fds/sdk/TimeSeriesAPIforDigitalPortals/model/inline_response2001.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | null | null | null | """
Time Series API For Digital Portals
Time series data, end-of-day or intraday, tick-by-tick or subsampled. Additional vendor-specific endpoints provide a modified interface for seamless integration with the ChartIQ chart library. # noqa: E501
The version of the OpenAPI document: 2
Generated by: ht... | 44.451493 | 210 | 0.583816 |
import re import sys
from fds.sdk.TimeSeriesAPIforDigitalPortals.model_utils import ( ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get... | true | true |
f70a182da31175046edd04dfca877dac25580027 | 323 | py | Python | testes_basicos.py | renzon/pypraticot2 | 530c422ac0fd482e491db46cdf250145e0c22f60 | [
"MIT"
] | 1 | 2017-07-16T00:16:31.000Z | 2017-07-16T00:16:31.000Z | testes_basicos.py | renzon/pypraticot2 | 530c422ac0fd482e491db46cdf250145e0c22f60 | [
"MIT"
] | null | null | null | testes_basicos.py | renzon/pypraticot2 | 530c422ac0fd482e491db46cdf250145e0c22f60 | [
"MIT"
] | null | null | null | import unittest
def soma(param, param1):
return param + param1
class BasicoTests(unittest.TestCase):
def test_soma(self):
resultado = soma(1, 2)
self.assertEqual(3, resultado)
resultado = soma(3, 2)
self.assertEqual(5, resultado)
if __name__ == '__main__':
unittest.main... | 17.944444 | 38 | 0.640867 | import unittest
def soma(param, param1):
return param + param1
class BasicoTests(unittest.TestCase):
def test_soma(self):
resultado = soma(1, 2)
self.assertEqual(3, resultado)
resultado = soma(3, 2)
self.assertEqual(5, resultado)
if __name__ == '__main__':
unittest.main... | true | true |
f70a187b86345725dacfb36b83a3c8c5937c9f30 | 8,106 | py | Python | tests/test_colour_specification_box.py | feature-engineer/glymur | 660b593ab7bfbb3036de5d15c3ecb43bef3bf919 | [
"MIT"
] | 41 | 2015-04-06T21:36:55.000Z | 2022-02-03T09:41:42.000Z | tests/test_colour_specification_box.py | feature-engineer/glymur | 660b593ab7bfbb3036de5d15c3ecb43bef3bf919 | [
"MIT"
] | 244 | 2015-01-01T03:41:54.000Z | 2022-03-24T14:07:33.000Z | tests/test_colour_specification_box.py | feature-engineer/glymur | 660b593ab7bfbb3036de5d15c3ecb43bef3bf919 | [
"MIT"
] | 21 | 2015-03-06T12:57:27.000Z | 2022-03-02T16:00:54.000Z | # -*- coding: utf-8 -*-
"""
Test suite specifically targeting ICC profiles
"""
# Standard library imports ...
from datetime import datetime
try:
import importlib.resources as ir
except ImportError: # pragma: no cover
# before 3.7
import importlib_resources as ir
import struct
import tempfile
import unit... | 37.878505 | 79 | 0.632618 |
from datetime import datetime
try:
import importlib.resources as ir
except ImportError: import importlib_resources as ir
import struct
import tempfile
import unittest
import warnings
import numpy as np
import glymur
from glymur import Jp2k
from glymur._iccprofile import _ICCProfile
from glymur.jp2box im... | true | true |
f70a18b901a7364101fce9a3ef3981bb6655bbe2 | 11,412 | py | Python | bls_py/keys.py | zebra-lucky/python-bls | f1adb3d57997bf67820dd62eb355a9cd1a82eb4d | [
"Apache-2.0"
] | 3 | 2020-07-25T00:37:31.000Z | 2020-08-24T11:42:17.000Z | bls_py/keys.py | zebra-lucky/python-bls | f1adb3d57997bf67820dd62eb355a9cd1a82eb4d | [
"Apache-2.0"
] | null | null | null | bls_py/keys.py | zebra-lucky/python-bls | f1adb3d57997bf67820dd62eb355a9cd1a82eb4d | [
"Apache-2.0"
] | 1 | 2019-12-09T09:02:05.000Z | 2019-12-09T09:02:05.000Z | import sys
from copy import deepcopy
from random import SystemRandom
from .aggregation_info import AggregationInfo
from .ec import (AffinePoint, JacobianPoint, default_ec, generator_Fq,
hash_to_point_Fq2, hash_to_point_prehashed_Fq2, y_for_x)
from .fields import Fq
from .signature import Signature
fro... | 34.167665 | 88 | 0.616106 | import sys
from copy import deepcopy
from random import SystemRandom
from .aggregation_info import AggregationInfo
from .ec import (AffinePoint, JacobianPoint, default_ec, generator_Fq,
hash_to_point_Fq2, hash_to_point_prehashed_Fq2, y_for_x)
from .fields import Fq
from .signature import Signature
fro... | true | true |
f70a195622f84b2586afb783102fe8933f5e550b | 3,683 | py | Python | scripts/module/preparation/phastcons_score_list.py | Naoto-Imamachi/MIRAGE | 448d7f2b62f0830c0abd3eb1435d16baffc5d3f9 | [
"MIT"
] | 3 | 2017-01-16T03:31:38.000Z | 2021-01-04T16:00:59.000Z | scripts/module/preparation/phastcons_score_list.py | Imamachi-n/MIRAGE | 448d7f2b62f0830c0abd3eb1435d16baffc5d3f9 | [
"MIT"
] | null | null | null | scripts/module/preparation/phastcons_score_list.py | Imamachi-n/MIRAGE | 448d7f2b62f0830c0abd3eb1435d16baffc5d3f9 | [
"MIT"
] | null | null | null | #!usr/bin/env python
import sys
import re
import shelve
from parameter.common_parameters import common_parameters
import utils.setting_utils as utils
utils.now_time("phastcons_score_list script starting...")
p = utils.Bunch(common_parameters)
def main():
utils.now_time("Input_file: " + p.phastcons_sc... | 42.825581 | 204 | 0.55987 |
import sys
import re
import shelve
from parameter.common_parameters import common_parameters
import utils.setting_utils as utils
utils.now_time("phastcons_score_list script starting...")
p = utils.Bunch(common_parameters)
def main():
utils.now_time("Input_file: " + p.phastcons_score_list_db_input)
... | true | true |
f70a19951b85ac6ffcb76c0f7122a6358303f1e6 | 4,620 | py | Python | docs/conf.py | UltronAI/habitat-sim | f8fd41a56b9ad2cbc4781d2a16291ca83ce91964 | [
"MIT"
] | 1,457 | 2019-02-21T21:42:41.000Z | 2022-03-29T13:34:28.000Z | docs/conf.py | UltronAI/habitat-sim | f8fd41a56b9ad2cbc4781d2a16291ca83ce91964 | [
"MIT"
] | 1,131 | 2019-02-27T16:14:06.000Z | 2022-03-31T15:41:24.000Z | docs/conf.py | UltronAI/habitat-sim | f8fd41a56b9ad2cbc4781d2a16291ca83ce91964 | [
"MIT"
] | 316 | 2019-02-26T22:45:38.000Z | 2022-03-26T04:55:32.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import re
import sys
# TODO make this less brittle
sys.path = [
os.path.join(os.path.dirname(__file__), "../"),
# os.path.jo... | 29.615385 | 140 | 0.640043 |
import os
import re
import sys
sys.path = [
os.path.join(os.path.dirname(__file__), "../"),
] + sys.path
import habitat_sim
habitat_sim.logging.HabitatSimFormatter.formatStack.__doc__ = ""
habitat_sim.registry = type(habitat_sim.registry)
habitat_sim.utils.__all__.remove("quat_from_angle_axis")
habitat_si... | true | true |
f70a19f51fc1e4929dfce84168119a5e0a81eef7 | 15,349 | py | Python | tests/components/monoprice/test_media_player.py | pdbogen/home-assistant | e602de55ac09be9ab8cbb354519a1b1b57fbe362 | [
"Apache-2.0"
] | 2 | 2022-01-24T18:59:56.000Z | 2022-02-04T22:12:48.000Z | tests/components/monoprice/test_media_player.py | pdbogen/home-assistant | e602de55ac09be9ab8cbb354519a1b1b57fbe362 | [
"Apache-2.0"
] | 5 | 2021-02-08T20:55:25.000Z | 2022-03-12T00:51:18.000Z | tests/components/monoprice/test_media_player.py | pdbogen/home-assistant | e602de55ac09be9ab8cbb354519a1b1b57fbe362 | [
"Apache-2.0"
] | 1 | 2020-05-18T09:13:52.000Z | 2020-05-18T09:13:52.000Z | """The tests for Monoprice Media player platform."""
from collections import defaultdict
from serial import SerialException
from homeassistant.components.media_player.const import (
ATTR_INPUT_SOURCE,
ATTR_INPUT_SOURCE_LIST,
ATTR_MEDIA_VOLUME_LEVEL,
DOMAIN as MEDIA_PLAYER_DOMAIN,
SERVICE_SELECT_SO... | 31.844398 | 88 | 0.704671 | from collections import defaultdict
from serial import SerialException
from homeassistant.components.media_player.const import (
ATTR_INPUT_SOURCE,
ATTR_INPUT_SOURCE_LIST,
ATTR_MEDIA_VOLUME_LEVEL,
DOMAIN as MEDIA_PLAYER_DOMAIN,
SERVICE_SELECT_SOURCE,
SUPPORT_SELECT_SOURCE,
SUPPORT_TURN_OFF... | true | true |
f70a1a3d6be3176f87e56f1573e0f4b1076b23a5 | 496 | py | Python | pythontutorials/books/AutomateTheBoringStuff/Ch05/P2_characterCount.py | JoseALermaIII/python-tutorials | 9d6cb78beec0bb55e27c49da1217317ba4d5f4fc | [
"MIT"
] | 2 | 2017-04-20T02:57:19.000Z | 2018-10-12T20:15:47.000Z | pythontutorials/books/AutomateTheBoringStuff/Ch05/P2_characterCount.py | JoseALermaIII/python-tutorials | 9d6cb78beec0bb55e27c49da1217317ba4d5f4fc | [
"MIT"
] | 8 | 2021-03-18T21:50:16.000Z | 2022-03-11T23:38:01.000Z | pythontutorials/books/AutomateTheBoringStuff/Ch05/P2_characterCount.py | JoseALermaIII/python-tutorials | 9d6cb78beec0bb55e27c49da1217317ba4d5f4fc | [
"MIT"
] | 3 | 2018-08-30T20:30:50.000Z | 2022-01-18T13:40:51.000Z | """Character count
This program counts how often each character appears in a string.
"""
def main():
message = 'It was a bright cold day in April, and the clocks were striking thirteen.'
"""str: Message to count characters."""
count = {}
"""dict: Characters as keys and counts as values."""
... | 20.666667 | 89 | 0.637097 |
def main():
message = 'It was a bright cold day in April, and the clocks were striking thirteen.'
count = {}
for character in message:
count.setdefault(character, 0)
count[character] = count[character] + 1
print(count)
if __name__ == '__main__':
main()
| true | true |
f70a1cb6f5e5200cbb6e0cabbea4fdcec0c9ec6c | 1,914 | py | Python | roberta/scripts/convert_bert_text_classification_from_huggingface_to_uer.py | LiRunyi2001/cnSoftBei | 72b90033ade1e926d3fb23621f5c67fa8eec9bb4 | [
"MIT"
] | 1 | 2021-11-29T08:33:00.000Z | 2021-11-29T08:33:00.000Z | roberta/scripts/convert_bert_text_classification_from_huggingface_to_uer.py | LiRunyi2001/cnSoftBei | 72b90033ade1e926d3fb23621f5c67fa8eec9bb4 | [
"MIT"
] | null | null | null | roberta/scripts/convert_bert_text_classification_from_huggingface_to_uer.py | LiRunyi2001/cnSoftBei | 72b90033ade1e926d3fb23621f5c67fa8eec9bb4 | [
"MIT"
] | null | null | null | import sys
import os
import torch
import argparse
import collections
uer_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
sys.path.insert(0, uer_dir)
from scripts.convert_bert_from_huggingface_to_uer import convert_bert_transformer_encoder_from_huggingface_to_uer
parser = argparse.ArgumentParser(... | 47.85 | 223 | 0.795716 | import sys
import os
import torch
import argparse
import collections
uer_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
sys.path.insert(0, uer_dir)
from scripts.convert_bert_from_huggingface_to_uer import convert_bert_transformer_encoder_from_huggingface_to_uer
parser = argparse.ArgumentParser(... | true | true |
f70a1cef52c255401bc34e7dbbce792978be7289 | 69,597 | py | Python | sdk/lusid/api/data_types_api.py | finbourne/lusid-sdk-python-generated-preview | 9c36c953e8149443a4390ed7f0c04d01211401b6 | [
"MIT"
] | null | null | null | sdk/lusid/api/data_types_api.py | finbourne/lusid-sdk-python-generated-preview | 9c36c953e8149443a4390ed7f0c04d01211401b6 | [
"MIT"
] | null | null | null | sdk/lusid/api/data_types_api.py | finbourne/lusid-sdk-python-generated-preview | 9c36c953e8149443a4390ed7f0c04d01211401b6 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
LUSID API
FINBOURNE Technology # noqa: E501
The version of the OpenAPI document: 0.11.4425
Contact: info@finbourne.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility lib... | 54.930545 | 409 | 0.61415 |
from __future__ import absolute_import
import re
import six
from lusid.api_client import ApiClient
from lusid.exceptions import ( ApiTypeError,
ApiValueError
)
class DataTypesApi(object):
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
... | true | true |
f70a1da1cd39a3e99fe038d88d3e890621cfe100 | 4,950 | py | Python | napari/utils/progress.py | kolibril13/napari | b39647d94e587f0255b0d4cc3087855e160a8929 | [
"BSD-3-Clause"
] | null | null | null | napari/utils/progress.py | kolibril13/napari | b39647d94e587f0255b0d4cc3087855e160a8929 | [
"BSD-3-Clause"
] | null | null | null | napari/utils/progress.py | kolibril13/napari | b39647d94e587f0255b0d4cc3087855e160a8929 | [
"BSD-3-Clause"
] | null | null | null | import inspect
from typing import Iterable, Optional
from tqdm import tqdm
from ..utils.translations import trans
_tqdm_kwargs = {
p.name
for p in inspect.signature(tqdm.__init__).parameters.values()
if p.kind is not inspect.Parameter.VAR_KEYWORD and p.name != "self"
}
class progress(tqdm):
"""This... | 28.612717 | 76 | 0.571111 | import inspect
from typing import Iterable, Optional
from tqdm import tqdm
from ..utils.translations import trans
_tqdm_kwargs = {
p.name
for p in inspect.signature(tqdm.__init__).parameters.values()
if p.kind is not inspect.Parameter.VAR_KEYWORD and p.name != "self"
}
class progress(tqdm):
monito... | true | true |
f70a1dbc606d62d87076fc535271675c9725e00f | 579 | py | Python | macronizer_cores/errors/routes.py | triethuynh2301/macronizer-project | b4cd234de603abc8f588c143ac1fdf56063390c5 | [
"MIT"
] | null | null | null | macronizer_cores/errors/routes.py | triethuynh2301/macronizer-project | b4cd234de603abc8f588c143ac1fdf56063390c5 | [
"MIT"
] | null | null | null | macronizer_cores/errors/routes.py | triethuynh2301/macronizer-project | b4cd234de603abc8f588c143ac1fdf56063390c5 | [
"MIT"
] | null | null | null | from flask import Blueprint, render_template
from macronizer_cores import db
# create error blueprint
errors = Blueprint('errors', __name__)
# SECTION - routes
# NOTE - app_errorhandler() is a method inherited from Blueprint that is equivalent to errorhandler() inherited from flask
@errors.app_errorhandler(404)
def... | 25.173913 | 122 | 0.759931 | from flask import Blueprint, render_template
from macronizer_cores import db
errors = Blueprint('errors', __name__)
@errors.app_errorhandler(404)
def page_not_found(e):
return render_template('errors/404.html'), 404
@errors.app_errorhandler(500)
def internal_server_error(e):
db.session.rollback()
return... | true | true |
f70a1df778a417b37e29bcfcd5700440004d378c | 3,448 | py | Python | src/api/bkuser_core/categories/migrations/0010_auto_20210803_1026.py | trueware/bk-user | 8c633e0a3821beb839ed120c4514c5733e675862 | [
"MIT"
] | null | null | null | src/api/bkuser_core/categories/migrations/0010_auto_20210803_1026.py | trueware/bk-user | 8c633e0a3821beb839ed120c4514c5733e675862 | [
"MIT"
] | null | null | null | src/api/bkuser_core/categories/migrations/0010_auto_20210803_1026.py | trueware/bk-user | 8c633e0a3821beb839ed120c4514c5733e675862 | [
"MIT"
] | 1 | 2021-12-31T06:48:41.000Z | 2021-12-31T06:48:41.000Z | # -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-用户管理(Bk-User) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the Lic... | 52.242424 | 220 | 0.632251 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('categories', '0009_auto_20210413_1702'),
]
operations = [
migrations.CreateModel(
name='SyncProgress',
fields=[
('i... | true | true |
f70a1e8de15b92057b4e7a95a2e6ed9b32905846 | 38,568 | py | Python | dev/Tools/build/waf-1.7.13/waflib/Task.py | raghnarx/lumberyard | 1c52b941dcb7d94341fcf21275fe71ff67173ada | [
"AML"
] | 8 | 2019-10-07T16:33:47.000Z | 2020-12-07T03:59:58.000Z | dev/Tools/build/waf-1.7.13/waflib/Task.py | 29e7e280-0d1c-4bba-98fe-f7cd3ca7500a/lumberyard | 1c52b941dcb7d94341fcf21275fe71ff67173ada | [
"AML"
] | null | null | null | dev/Tools/build/waf-1.7.13/waflib/Task.py | 29e7e280-0d1c-4bba-98fe-f7cd3ca7500a/lumberyard | 1c52b941dcb7d94341fcf21275fe71ff67173ada | [
"AML"
] | 4 | 2019-08-05T07:25:46.000Z | 2020-12-07T05:12:55.000Z | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2005-2010 (ita)
"""
Tasks represent atomic operations such as processes.
"""
import os, shutil, re, tempfile, time, pprint
from waflib import Context, Utils, Logs, Errors
from binascii import hexlify
# task states
NOT_RUN = 0
"""The task was not executed yet"""
... | 28.675093 | 153 | 0.673538 |
import os, shutil, re, tempfile, time, pprint
from waflib import Context, Utils, Logs, Errors
from binascii import hexlify
NOT_RUN = 0
MISSING = 1
CRASHED = 2
EXCEPTION = 3
SKIPPED = 8
SUCCESS = 9
ASK_LATER = -1
SKIP_ME = -2
RUN_ME = -3
COMPILE_TEMPLATE_SHELL = '''
def f(tsk):
env = tsk.env
gen = tsk.gene... | true | true |
f70a1f7c570d346ca9264fc6af83f1d197354756 | 2,526 | py | Python | foampy/tests/test_dictionaries.py | petebachant/foamPy | ff74ab13f982b31e8ef0d1f379425db08f03924c | [
"MIT"
] | 8 | 2017-11-22T03:37:32.000Z | 2021-11-23T08:57:15.000Z | foampy/tests/test_dictionaries.py | Carlopasquinucci/foamPy | ff74ab13f982b31e8ef0d1f379425db08f03924c | [
"MIT"
] | 45 | 2015-02-11T23:09:59.000Z | 2017-07-24T22:24:31.000Z | foampy/tests/test_dictionaries.py | Carlopasquinucci/foamPy | ff74ab13f982b31e8ef0d1f379425db08f03924c | [
"MIT"
] | 7 | 2015-05-05T21:41:54.000Z | 2020-09-30T14:29:54.000Z | """Tests for the `dictionaries` module."""
from __future__ import division, print_function, absolute_import
import foampy
from foampy.dictionaries import *
def test_replace_value():
"""Test the `replace_value` function."""
print("\nTesting dictionaries.replace_value")
orig = read_single_line_value(dictna... | 48.576923 | 99 | 0.407759 |
from __future__ import division, print_function, absolute_import
import foampy
from foampy.dictionaries import *
def test_replace_value():
print("\nTesting dictionaries.replace_value")
orig = read_single_line_value(dictname="blockMeshDict",
keyword="convertToMeters",
... | true | true |
f70a1f932d120296d5c3e1b50f097d31b797cbbf | 1,957 | py | Python | Python/Templates/Web/ProjectTemplates/Python/Web/WorkerRoleProject/worker.py | awesome-archive/PTVS | c0cd34196ddf53b4ca755d72da5351f4e2ffdfb9 | [
"Apache-2.0"
] | 1 | 2019-06-05T19:16:49.000Z | 2019-06-05T19:16:49.000Z | Python/Templates/Web/ProjectTemplates/Python/Web/WorkerRoleProject/worker.py | willv84/PTVS | 42b834efec9dd1510dc83cdec28c93ee3110b5f2 | [
"Apache-2.0"
] | 2 | 2019-06-05T18:13:41.000Z | 2019-06-05T20:13:16.000Z | Python/Templates/Web/ProjectTemplates/Python/Web/WorkerRoleProject/worker.py | RaymonGulati1/PTVS | ee1d09f2a94be4e21016f7579205bb65ec82c616 | [
"Apache-2.0"
] | 2 | 2018-03-02T19:55:14.000Z | 2019-02-14T22:37:28.000Z | import os
from time import sleep
#
# The azure library provides access to services made available by the
# Microsoft Azure platform, such as storage and messaging.
#
# See https://go.microsoft.com/fwlink/?linkid=254360 for documentation and
# example code.
#
from azure.servicebus import ServiceBusService
from azure.s... | 34.946429 | 87 | 0.771589 | import os
from time import sleep
from azure.servicebus import ServiceBusService
from azure.storage import CloudStorageAccount
STORAGE_ACCOUNT_NAME = '__paste_your_storage_account_name_here__'
STORAGE_ACCOUNT_KEY = '__paste_your_storage_key_here__'
if os.environ.get('EMULATED', '').lower() == 'true':
storage_... | true | true |
f70a2161483120e67364fec4846701e21f94c6f8 | 1,509 | py | Python | mmdet/models/bbox_heads/mgan_head.py | zjplab/Pedestron | 07e1a2cee82b57e1584b0c744f5b44f1ae92be73 | [
"Apache-2.0"
] | null | null | null | mmdet/models/bbox_heads/mgan_head.py | zjplab/Pedestron | 07e1a2cee82b57e1584b0c744f5b44f1ae92be73 | [
"Apache-2.0"
] | null | null | null | mmdet/models/bbox_heads/mgan_head.py | zjplab/Pedestron | 07e1a2cee82b57e1584b0c744f5b44f1ae92be73 | [
"Apache-2.0"
] | null | null | null | import torch.nn as nn
from ..registry import HEADS
from ..utils import ConvModule
from mmdetection.core import auto_fp16
@HEADS.register_module
class MGANHead(nn.Module):
def __init__(self,
num_convs=2,
roi_feat_size=7,
in_channels=512,
conv_ou... | 28.471698 | 71 | 0.55666 | import torch.nn as nn
from ..registry import HEADS
from ..utils import ConvModule
from mmdetection.core import auto_fp16
@HEADS.register_module
class MGANHead(nn.Module):
def __init__(self,
num_convs=2,
roi_feat_size=7,
in_channels=512,
conv_ou... | true | true |
f70a218a22117f560b2fb24add1cdcdeacc100ed | 273 | py | Python | weread/redisTool.py | songjiang951130/JD-Coin | 03e2183435e6e8e4cf109fa7286d15cf5f6933da | [
"Apache-2.0"
] | 5 | 2019-08-01T10:35:48.000Z | 2019-12-15T02:58:01.000Z | weread/redisTool.py | songjiang951130/JD-Coin | 03e2183435e6e8e4cf109fa7286d15cf5f6933da | [
"Apache-2.0"
] | 1 | 2020-01-21T08:38:24.000Z | 2020-01-21T08:38:24.000Z | weread/redisTool.py | songjiang951130/JD-Coin | 03e2183435e6e8e4cf109fa7286d15cf5f6933da | [
"Apache-2.0"
] | 7 | 2019-08-28T11:36:15.000Z | 2022-01-16T14:55:41.000Z | import redis
host = '127.0.0.1'
port = 6379
client = redis.Redis(host=host, port=port)
client.set("redis", "value111", None, 1000)
print(str(client.get("redis")))
if client.get("redis1") != None and len(client.get("redis1")) > 0:
print("sss")
else:
print("no")
| 18.2 | 66 | 0.641026 | import redis
host = '127.0.0.1'
port = 6379
client = redis.Redis(host=host, port=port)
client.set("redis", "value111", None, 1000)
print(str(client.get("redis")))
if client.get("redis1") != None and len(client.get("redis1")) > 0:
print("sss")
else:
print("no")
| true | true |
f70a21ed38d44e8d3f866d610001a211b803b1ce | 7,189 | py | Python | src/onegov/election_day/path.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/path.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/path.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.ballot import Ballot
from onegov.ballot import BallotCollection
from onegov.ballot import Candidate
from onegov.ballot import CandidateCollection
from onegov.ballot import Election
from onegov.ballot import ElectionCollection
from onegov.ballot import ElectionCompound
from onegov.ballot import ElectionCompo... | 23.340909 | 78 | 0.717346 | from onegov.ballot import Ballot
from onegov.ballot import BallotCollection
from onegov.ballot import Candidate
from onegov.ballot import CandidateCollection
from onegov.ballot import Election
from onegov.ballot import ElectionCollection
from onegov.ballot import ElectionCompound
from onegov.ballot import ElectionCompo... | true | true |
f70a220499257b977fc553bef7627d7bfd552431 | 31,854 | py | Python | selfdrive/controls/controlsd.py | jauderho/openpilot | 9720dbe9b94a409d1540ec624b1deb29a5f37c8b | [
"MIT"
] | null | null | null | selfdrive/controls/controlsd.py | jauderho/openpilot | 9720dbe9b94a409d1540ec624b1deb29a5f37c8b | [
"MIT"
] | 65 | 2021-06-28T21:29:20.000Z | 2021-09-16T21:19:17.000Z | selfdrive/controls/controlsd.py | jauderho/openpilot | 9720dbe9b94a409d1540ec624b1deb29a5f37c8b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import math
from numbers import Number
from cereal import car, log
from common.numpy_fast import clip
from common.realtime import sec_since_boot, config_realtime_process, Priority, Ratekeeper, DT_CTRL
from common.profiler import Profiler
from common.params import Params, put_nonblockin... | 42.134921 | 154 | 0.706567 | import os
import math
from numbers import Number
from cereal import car, log
from common.numpy_fast import clip
from common.realtime import sec_since_boot, config_realtime_process, Priority, Ratekeeper, DT_CTRL
from common.profiler import Profiler
from common.params import Params, put_nonblocking
import cereal.messagi... | true | true |
f70a23e92e05e9cf9eeb8ad1955f0041146b7b6f | 169 | py | Python | 78_pr9_06.py | AmreshTripathy/Python | e86420fef7f52da393be5b50ac2f13bddfeb3306 | [
"Apache-2.0"
] | 4 | 2021-05-27T05:06:09.000Z | 2021-06-12T17:12:47.000Z | 78_pr9_06.py | AmreshTripathy/Python | e86420fef7f52da393be5b50ac2f13bddfeb3306 | [
"Apache-2.0"
] | null | null | null | 78_pr9_06.py | AmreshTripathy/Python | e86420fef7f52da393be5b50ac2f13bddfeb3306 | [
"Apache-2.0"
] | null | null | null | with open('log.txt') as f:
text = f.read().lower()
if ('python' in text):
print ('Yes, Python is present')
else:
print ('No, Python is not present')
| 21.125 | 40 | 0.573964 | with open('log.txt') as f:
text = f.read().lower()
if ('python' in text):
print ('Yes, Python is present')
else:
print ('No, Python is not present')
| true | true |
f70a243e4446ed30e1ab6f3bb466a27d6919e8aa | 9,213 | py | Python | game_demos/trials.py | LocoBunny04/Vroom-Vroom-BTS-Edition | 6432ad6dc2578bb060543dbe91a6dafbd3a8bd52 | [
"MIT"
] | null | null | null | game_demos/trials.py | LocoBunny04/Vroom-Vroom-BTS-Edition | 6432ad6dc2578bb060543dbe91a6dafbd3a8bd52 | [
"MIT"
] | null | null | null | game_demos/trials.py | LocoBunny04/Vroom-Vroom-BTS-Edition | 6432ad6dc2578bb060543dbe91a6dafbd3a8bd52 | [
"MIT"
] | null | null | null | from PIL import Image, ImageTk
import random as rand
import turtle as trtl
# import required module
from playsound import playsound
import tkinter.messagebox
from pynput.keyboard import Key, Listener
import glob
#import prgm_image
# prgm_image_list = []
# for filename in glob.glob('/Users/khaase/Desktop/VroomFold/prgm_... | 24.437666 | 177 | 0.629762 | from PIL import Image, ImageTk
import random as rand
import turtle as trtl
from playsound import playsound
import tkinter.messagebox
from pynput.keyboard import Key, Listener
import glob
wn = trtl.Screen()
si = trtl.Turtle()
caller = trtl.Turtle()
st = trtl.Turtle()
rSt = trtl.Turtle()
user = trtl.Turtle()
point = trtl... | true | true |
f70a25425109eb80765b11c658857ded6d821f1e | 7,576 | py | Python | weather_sp/splitter_pipeline/file_splitters.py | shriekdj/weather-tools | 882b832a3ae7fdaff432cfec5915e94919bd4262 | [
"Apache-2.0"
] | null | null | null | weather_sp/splitter_pipeline/file_splitters.py | shriekdj/weather-tools | 882b832a3ae7fdaff432cfec5915e94919bd4262 | [
"Apache-2.0"
] | null | null | null | weather_sp/splitter_pipeline/file_splitters.py | shriekdj/weather-tools | 882b832a3ae7fdaff432cfec5915e94919bd4262 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 38.653061 | 117 | 0.619192 |
import abc
import logging
import shutil
import tempfile
import typing as t
from contextlib import contextmanager
import apache_beam.metrics as metrics
import netCDF4 as nc
import pygrib
from apache_beam.io.filesystems import FileSystems
from .file_name_utils import OutFileInfo
logger = logging.getLogger(__name__)
... | true | true |
f70a259508b1b45d8cb1c78e697950e6b5a3fd78 | 11,877 | py | Python | bionic/datatypes.py | square/bionic | 357da8e2806996427e0aa6efd08f7ea8c5198f9b | [
"Apache-2.0"
] | 98 | 2019-08-29T21:38:44.000Z | 2022-01-26T04:59:57.000Z | bionic/datatypes.py | square/bionic | 357da8e2806996427e0aa6efd08f7ea8c5198f9b | [
"Apache-2.0"
] | 143 | 2019-09-11T15:32:17.000Z | 2021-06-08T21:48:30.000Z | bionic/datatypes.py | square/bionic | 357da8e2806996427e0aa6efd08f7ea8c5198f9b | [
"Apache-2.0"
] | 20 | 2019-09-13T18:13:03.000Z | 2021-12-03T19:51:01.000Z | """
Contains various data structures used by Bionic's infrastructure.
"""
import attr
from .utils.misc import ImmutableSequence, ImmutableMapping
@attr.s(frozen=True)
class EntityDefinition:
"""
Describes the immutable properties of an entity. These properties generally have
to do with the entity's "con... | 31.337731 | 93 | 0.66473 |
import attr
from .utils.misc import ImmutableSequence, ImmutableMapping
@attr.s(frozen=True)
class EntityDefinition:
name = attr.ib()
protocol = attr.ib()
doc = attr.ib()
optional_should_memoize = attr.ib()
optional_should_persist = attr.ib()
needs_caching = attr.ib(default=False)
@attr.s... | true | true |
f70a25b71d5f45ade2f220d3d461d927e22f6bd6 | 677 | py | Python | rqt_ocare/scripts/capture_image.py | SiChiTong/ros_ocare_nav | 5df256ae9f398cb05f3d0d8c9be124fed5fc2c26 | [
"Apache-2.0"
] | null | null | null | rqt_ocare/scripts/capture_image.py | SiChiTong/ros_ocare_nav | 5df256ae9f398cb05f3d0d8c9be124fed5fc2c26 | [
"Apache-2.0"
] | null | null | null | rqt_ocare/scripts/capture_image.py | SiChiTong/ros_ocare_nav | 5df256ae9f398cb05f3d0d8c9be124fed5fc2c26 | [
"Apache-2.0"
] | 1 | 2018-08-17T03:31:44.000Z | 2018-08-17T03:31:44.000Z | import paramiko
from time import localtime, strftime
# Create a ssh client
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect('ocare', username='taiwanet', password='qwe7891')
file_name = strftime("/home/taiwanet/capture_image/%Y%m%d_%H%M%S.jpg", localtime())
st... | 28.208333 | 211 | 0.731167 | import paramiko
from time import localtime, strftime
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect('ocare', username='taiwanet', password='qwe7891')
file_name = strftime("/home/taiwanet/capture_image/%Y%m%d_%H%M%S.jpg", localtime())
stdin, stdout, stderr = ... | true | true |
f70a26b73ab91ee81563001d95d271815374a2a3 | 29,966 | py | Python | HotSpotMap.py | bucaps/HotSpotMap | 655d83d98316acbf9328519850268f548ae44af4 | [
"MIT"
] | null | null | null | HotSpotMap.py | bucaps/HotSpotMap | 655d83d98316acbf9328519850268f548ae44af4 | [
"MIT"
] | null | null | null | HotSpotMap.py | bucaps/HotSpotMap | 655d83d98316acbf9328519850268f548ae44af4 | [
"MIT"
] | null | null | null | # HotSpotMap: A python based temperature (thermal) map generation
# tool for HotSpot-6.0 (http://lava.cs.virginia.edu/HotSpot/)
# This tool uses python's turtle library
#
# Author: Gaurav Kothari (gkothar1@binghamton.edu) Copyright 2021
#
# This tool generates:
# 1) Floor-plan image (using floor-plan file)
# 2) Thermal... | 31.743644 | 194 | 0.553961 | #
# Author: Gaurav Kothari (gkothar1@binghamton.edu) Copyright 2021
#
# This tool generates:
# 1) Floor-plan image (using floor-plan file)
# 2) Thermal map (using floor-plan file and steady temperature file)
# 3) Fine grained thermal map (using floor-plan file and grid steady temperature file)
#
# Supports 2D and 3D st... | true | true |
f70a26e07705cfcdd4b9700935899358780391f1 | 2,001 | py | Python | setup.py | felixfire/LiteWQL | 8b47d1617041f1e9505bdbee713536a13a3ef88e | [
"Apache-2.0"
] | null | null | null | setup.py | felixfire/LiteWQL | 8b47d1617041f1e9505bdbee713536a13a3ef88e | [
"Apache-2.0"
] | null | null | null | setup.py | felixfire/LiteWQL | 8b47d1617041f1e9505bdbee713536a13a3ef88e | [
"Apache-2.0"
] | null | null | null | import os
from setuptools import setup, find_packages
def read(fn):
path = os.path.join(os.path.dirname(__file__), fn)
try:
file = open(path, encoding='utf-8')
except TypeError:
file = open(path)
return file.read()
setup(
name='litewql',
version=__import__('litewql').VERSION,... | 35.732143 | 72 | 0.575212 | import os
from setuptools import setup, find_packages
def read(fn):
path = os.path.join(os.path.dirname(__file__), fn)
try:
file = open(path, encoding='utf-8')
except TypeError:
file = open(path)
return file.read()
setup(
name='litewql',
version=__import__('litewql').VERSION,... | true | true |
f70a27ec88c165e9fe3b4e47800e5ac9b23f1af0 | 18,393 | py | Python | pythonProject1/venv/Lib/site-packages/jsonlint/validators.py | mjtomlinson/CNE330_Python_1_Final_Project | 05020806860937ef37b9a0ad2e27de4897a606de | [
"CC0-1.0"
] | null | null | null | pythonProject1/venv/Lib/site-packages/jsonlint/validators.py | mjtomlinson/CNE330_Python_1_Final_Project | 05020806860937ef37b9a0ad2e27de4897a606de | [
"CC0-1.0"
] | null | null | null | pythonProject1/venv/Lib/site-packages/jsonlint/validators.py | mjtomlinson/CNE330_Python_1_Final_Project | 05020806860937ef37b9a0ad2e27de4897a606de | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
import uuid
from jsonlint.compat import string_types, text_type
__all__ = (
'DataRequired', 'data_required', 'Email', 'email', 'EqualTo', 'equal_to',
'IPAddress', 'ip_address', 'InputRequired', 'input_required', 'Length',
'length',... | 33.810662 | 122 | 0.610558 | from __future__ import unicode_literals
import re
import uuid
from jsonlint.compat import string_types, text_type
__all__ = (
'DataRequired', 'data_required', 'Email', 'email', 'EqualTo', 'equal_to',
'IPAddress', 'ip_address', 'InputRequired', 'input_required', 'Length',
'length', 'NumberRange', 'number_... | true | true |
f70a284e5edac34ac2e87eccb11a9a4ed65666e9 | 7,722 | py | Python | sdk/keyvault/azure-keyvault-keys/tests/test_samples_keys.py | anuchandy/azure-sdk-for-python | 589b9890554ebf261aa2184e8f1c6507f01a207c | [
"MIT"
] | null | null | null | sdk/keyvault/azure-keyvault-keys/tests/test_samples_keys.py | anuchandy/azure-sdk-for-python | 589b9890554ebf261aa2184e8f1c6507f01a207c | [
"MIT"
] | null | null | null | sdk/keyvault/azure-keyvault-keys/tests/test_samples_keys.py | anuchandy/azure-sdk-for-python | 589b9890554ebf261aa2184e8f1c6507f01a207c | [
"MIT"
] | null | null | null | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
from __future__ import print_function
import functools
import hashlib
import os
from azure.core.exceptions import ResourceNotFoundError
from devtools_testutils import R... | 31.909091 | 115 | 0.662264 | from __future__ import print_function
import functools
import hashlib
import os
from azure.core.exceptions import ResourceNotFoundError
from devtools_testutils import ResourceGroupPreparer, KeyVaultPreparer
from keys_preparer import VaultClientPreparer
from keys_test_case import KeyVaultTestCase
def print(*args):
... | true | true |
f70a286e808fcd8fa7820662a35bec224fa63036 | 6,751 | py | Python | selection/truncated/chi.py | Xiaoying-Tian/selective-inference | a20c5ad3f527beb709d5b8d7301016640738b092 | [
"BSD-3-Clause"
] | null | null | null | selection/truncated/chi.py | Xiaoying-Tian/selective-inference | a20c5ad3f527beb709d5b8d7301016640738b092 | [
"BSD-3-Clause"
] | null | null | null | selection/truncated/chi.py | Xiaoying-Tian/selective-inference | a20c5ad3f527beb709d5b8d7301016640738b092 | [
"BSD-3-Clause"
] | 1 | 2019-07-13T04:14:12.000Z | 2019-07-13T04:14:12.000Z | """
This module implements the class `truncated_chi2` which
performs (conditional) UMPU tests for Gaussians
restricted to a set of intervals.
"""
import numpy as np
import mpmath as mp
from scipy.stats import chi, chi2
from .base import truncated, find_root
class truncated_chi(truncated):
"""
>>> from inte... | 23.359862 | 63 | 0.483484 | import numpy as np
import mpmath as mp
from scipy.stats import chi, chi2
from .base import truncated, find_root
class truncated_chi(truncated):
def __init__(self, I, k, scale = 1.):
self._k = k
self._scale = scale
truncated.__init__(self, I)
def _cdf_notTruncated(self, a, b, dps):
... | true | true |
f70a2a25224545676e5b981a65f639ab405c76b0 | 595 | py | Python | pwny/commands/generic/upload.py | EntySec/Pwny | d6a8a5edee171dcd3bf3ea1ec49b0ffb03d38531 | [
"MIT"
] | 7 | 2021-11-12T23:14:19.000Z | 2022-01-16T21:27:42.000Z | pwny/commands/generic/upload.py | YurinDoctrine/Pwny | 1c89a1a2a574c28cf92b5817b3d5dfb3dd4032be | [
"MIT"
] | null | null | null | pwny/commands/generic/upload.py | YurinDoctrine/Pwny | 1c89a1a2a574c28cf92b5817b3d5dfb3dd4032be | [
"MIT"
] | 7 | 2021-11-10T16:52:57.000Z | 2022-02-09T17:11:57.000Z | #!/usr/bin/env python3
#
# This command requires HatSploit: https://hatsploit.netlify.app
# Current source: https://github.com/EntySec/HatSploit
#
from hatsploit.lib.command import Command
class HatSploitCommand(Command):
details = {
'Category': "transfer",
'Name': "upload",
'Authors': [... | 23.8 | 64 | 0.608403 |
from hatsploit.lib.command import Command
class HatSploitCommand(Command):
details = {
'Category': "transfer",
'Name': "upload",
'Authors': [
'Ivan Nikolsky (enty8080) - command developer'
],
'Description': "Upload local file.",
'Usage': "upload <local... | true | true |
f70a2b0e9261046b6a2a3a6a7ffdf762b0fb67a7 | 1,618 | py | Python | mlp_uk_learning.py | lujiammy/coronavirus-machine-learning | 4af16b1c51a89a81206262b50a9bcf4d9b679853 | [
"BSD-3-Clause"
] | null | null | null | mlp_uk_learning.py | lujiammy/coronavirus-machine-learning | 4af16b1c51a89a81206262b50a9bcf4d9b679853 | [
"BSD-3-Clause"
] | null | null | null | mlp_uk_learning.py | lujiammy/coronavirus-machine-learning | 4af16b1c51a89a81206262b50a9bcf4d9b679853 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
np.random.seed(1337)
from keras.models import Sequential
from keras.layers import Dense
import matplotlib.pyplot as plt
model = Sequential()
model.add(Dense(units=50, input_dim=1, activation='relu'))
model.add(Dense(units=50, activation='relu'))
model.add(Dense(units=1, activation='sigmoid'))
model... | 27.423729 | 72 | 0.776885 | import numpy as np
np.random.seed(1337)
from keras.models import Sequential
from keras.layers import Dense
import matplotlib.pyplot as plt
model = Sequential()
model.add(Dense(units=50, input_dim=1, activation='relu'))
model.add(Dense(units=50, activation='relu'))
model.add(Dense(units=1, activation='sigmoid'))
model... | true | true |
f70a2b37f6f06bf07a52a01197f2deb18fbace0e | 6,051 | py | Python | diplom_test/main.py | CrackedSTone/algorithm-detects-liver-pathology | d52d08e4e6931b3502f083f20d6332f7b6839a3b | [
"Apache-2.0"
] | 8 | 2019-04-09T07:11:26.000Z | 2020-02-27T16:51:26.000Z | diplom_test/main.py | il-yanko/algorithm-detects-liver-pathology | d52d08e4e6931b3502f083f20d6332f7b6839a3b | [
"Apache-2.0"
] | null | null | null | diplom_test/main.py | il-yanko/algorithm-detects-liver-pathology | d52d08e4e6931b3502f083f20d6332f7b6839a3b | [
"Apache-2.0"
] | 2 | 2019-04-04T07:13:02.000Z | 2020-02-06T04:58:34.000Z | #!/usr/bin/python3
# -*- coding: utf-8 -*-
from PyQt5.uic import loadUi
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
#from matplotlib.backends.backend_qt5agg import (NavigationToolbar2QT as NavigationToolbar)
import matplotlib.image as mpimg
import sys
import radiomics_single a... | 44.492647 | 135 | 0.653611 |
from PyQt5.uic import loadUi
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
import matplotlib.image as mpimg
import sys
import radiomics_single as rs
qtCreatorFile = "design/diplom.ui"
class MatplotlibWidget(QMainWindow):
def __init__(self):
QMainWindow.__init__(s... | true | true |
f70a2b644457fe1530f88e063abd293d2c32dfdb | 10,084 | py | Python | tests/asp/cautious/hamiltonian.test.04.asp.gringo.cautious.asp.test.py | bernardocuteri/wasp | 05c8f961776dbdbf7afbf905ee00fc262eba51ad | [
"Apache-2.0"
] | 19 | 2015-12-03T08:53:45.000Z | 2022-03-31T02:09:43.000Z | tests/asp/cautious/hamiltonian.test.04.asp.gringo.cautious.asp.test.py | bernardocuteri/wasp | 05c8f961776dbdbf7afbf905ee00fc262eba51ad | [
"Apache-2.0"
] | 80 | 2017-11-25T07:57:32.000Z | 2018-06-10T19:03:30.000Z | tests/asp/cautious/hamiltonian.test.04.asp.gringo.cautious.asp.test.py | bernardocuteri/wasp | 05c8f961776dbdbf7afbf905ee00fc262eba51ad | [
"Apache-2.0"
] | 6 | 2015-01-15T07:51:48.000Z | 2020-06-18T14:47:48.000Z | input = """
1 2 0 0
1 3 0 0
1 4 0 0
1 5 0 0
1 6 0 0
1 7 0 0
1 8 0 0
1 9 0 0
1 10 0 0
1 11 0 0
1 12 0 0
1 13 0 0
1 14 0 0
1 15 0 0
1 16 0 0
1 17 0 0
1 18 0 0
1 19 0 0
1 20 0 0
1 21 0 0
1 22 0 0
1 23 0 0
1 24 0 0
1 25 0 0
1 26 0 0
1 27 0 0
1 28 0 0
1 29 0 0
1 30 0 0
1 31 0 0
1 32 0 0
1 33 0 0
1 34 0 0
1 35 0 0
1 36 0 0
1... | 15.050746 | 666 | 0.615728 | input = """
1 2 0 0
1 3 0 0
1 4 0 0
1 5 0 0
1 6 0 0
1 7 0 0
1 8 0 0
1 9 0 0
1 10 0 0
1 11 0 0
1 12 0 0
1 13 0 0
1 14 0 0
1 15 0 0
1 16 0 0
1 17 0 0
1 18 0 0
1 19 0 0
1 20 0 0
1 21 0 0
1 22 0 0
1 23 0 0
1 24 0 0
1 25 0 0
1 26 0 0
1 27 0 0
1 28 0 0
1 29 0 0
1 30 0 0
1 31 0 0
1 32 0 0
1 33 0 0
1 34 0 0
1 35 0 0
1 36 0 0
1... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.