hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c2882201c3bfc0909f7476a21ae774c713e688e | 1,282 | py | Python | pirates/leveleditor/worldData/Vegas.py | Willy5s/Pirates-Online-Rewritten | 7434cf98d9b7c837d57c181e5dabd02ddf98acb7 | [
"BSD-3-Clause"
] | 81 | 2018-04-08T18:14:24.000Z | 2022-01-11T07:22:15.000Z | pirates/leveleditor/worldData/Vegas.py | Willy5s/Pirates-Online-Rewritten | 7434cf98d9b7c837d57c181e5dabd02ddf98acb7 | [
"BSD-3-Clause"
] | 4 | 2018-09-13T20:41:22.000Z | 2022-01-08T06:57:00.000Z | pirates/leveleditor/worldData/Vegas.py | Willy5s/Pirates-Online-Rewritten | 7434cf98d9b7c837d57c181e5dabd02ddf98acb7 | [
"BSD-3-Clause"
] | 26 | 2018-05-26T12:49:27.000Z | 2021-09-11T09:11:59.000Z | from pandac.PandaModules import Point3, VBase3
objectStruct = {'Objects': {'1149705528.16Shochet': {'Type': 'Region','Name': 'default','Objects': {'1149705583.09Shochet': {'Type': 'Island','Name': 'Vegas','File': 'VegasIsland','Hpr': Point3(0.0, 0.0, 0.0),'Pos': Point3(-410.0, 80.0, 0.0),'Scale': VBase3(1.0, 1.0, 1.0),... | 641 | 1,235 | 0.651326 | from pandac.PandaModules import Point3, VBase3
objectStruct = {'Objects': {'1149705528.16Shochet': {'Type': 'Region','Name': 'default','Objects': {'1149705583.09Shochet': {'Type': 'Island','Name': 'Vegas','File': 'VegasIsland','Hpr': Point3(0.0, 0.0, 0.0),'Pos': Point3(-410.0, 80.0, 0.0),'Scale': VBase3(1.0, 1.0, 1.0),... | true | true |
1c28841799f65605d802198c0120d9efb186d689 | 7,878 | py | Python | derivations/scripts/sympy_addons.py | arghdos/SPyJac-paper | 7f65253a3acd3a93141e673c2cdd5810ecc6a0ca | [
"CC-BY-4.0"
] | 1 | 2020-10-31T23:56:50.000Z | 2020-10-31T23:56:50.000Z | derivations/scripts/sympy_addons.py | arghdos/SPyJac-paper | 7f65253a3acd3a93141e673c2cdd5810ecc6a0ca | [
"CC-BY-4.0"
] | null | null | null | derivations/scripts/sympy_addons.py | arghdos/SPyJac-paper | 7f65253a3acd3a93141e673c2cdd5810ecc6a0ca | [
"CC-BY-4.0"
] | null | null | null | from sympy.core.symbol import Symbol
from sympy.tensor.indexed import Idx, IndexedBase, Indexed
from sympy.concrete import Product
from sympy.core.compatibility import is_sequence
from sympy.core.singleton import S
from sympy.core.add import Add
from sympy.core.function import Derivative
from sympy.functions.special.te... | 36.64186 | 96 | 0.524879 | from sympy.core.symbol import Symbol
from sympy.tensor.indexed import Idx, IndexedBase, Indexed
from sympy.concrete import Product
from sympy.core.compatibility import is_sequence
from sympy.core.singleton import S
from sympy.core.add import Add
from sympy.core.function import Derivative
from sympy.functions.special.te... | true | true |
1c28879b2be6611ffcbbc85ef658930de5c3c361 | 2,658 | py | Python | tests/generate_topo/vegetation/test_landfire_140.py | USDA-ARS-NWRC/basin_setup | 8a9f661ab7897d63dda6c470cfd24f498e6e6183 | [
"CC0-1.0"
] | 1 | 2020-10-15T00:53:46.000Z | 2020-10-15T00:53:46.000Z | tests/generate_topo/vegetation/test_landfire_140.py | USDA-ARS-NWRC/basin_setup | 8a9f661ab7897d63dda6c470cfd24f498e6e6183 | [
"CC0-1.0"
] | 58 | 2017-12-13T23:37:12.000Z | 2021-07-26T19:58:05.000Z | tests/generate_topo/vegetation/test_landfire_140.py | USDA-ARS-NWRC/basin_setup | 8a9f661ab7897d63dda6c470cfd24f498e6e6183 | [
"CC0-1.0"
] | null | null | null | import os
from unittest.mock import patch
import xarray as xr
from basin_setup.generate_topo.vegetation import Landfire140
from basin_setup.utils import domain_extent
from tests.Lakes.lakes_test_case import BasinSetupLakes
# patch the landfire datasets for testing. Comment out to test with the
# real thing
@patch.o... | 35.44 | 75 | 0.688488 | import os
from unittest.mock import patch
import xarray as xr
from basin_setup.generate_topo.vegetation import Landfire140
from basin_setup.utils import domain_extent
from tests.Lakes.lakes_test_case import BasinSetupLakes
@patch.object(Landfire140, 'veg_height_csv',
new='tests/Lakes/data/landfire_1... | true | true |
1c2887ad47e81c877b5ee12f1fd14f58410afb2c | 566 | py | Python | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/cuda/tests/cudadrv/test_profiler.py | jeikabu/lumberyard | 07228c605ce16cbf5aaa209a94a3cb9d6c1a4115 | [
"AML"
] | 1,738 | 2017-09-21T10:59:12.000Z | 2022-03-31T21:05:46.000Z | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/cuda/tests/cudadrv/test_profiler.py | jeikabu/lumberyard | 07228c605ce16cbf5aaa209a94a3cb9d6c1a4115 | [
"AML"
] | 427 | 2017-09-29T22:54:36.000Z | 2022-02-15T19:26:50.000Z | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/cuda/tests/cudadrv/test_profiler.py | jeikabu/lumberyard | 07228c605ce16cbf5aaa209a94a3cb9d6c1a4115 | [
"AML"
] | 671 | 2017-09-21T08:04:01.000Z | 2022-03-29T14:30:07.000Z | from __future__ import absolute_import, print_function
import numba.unittest_support as unittest
from numba.cuda.testing import CUDATestCase
from numba import cuda
from numba.cuda.testing import skip_on_cudasim
@skip_on_cudasim('CUDA Profiler unsupported in the simulator')
class TestProfiler(CUDATestCase):
def te... | 24.608696 | 62 | 0.701413 | from __future__ import absolute_import, print_function
import numba.unittest_support as unittest
from numba.cuda.testing import CUDATestCase
from numba import cuda
from numba.cuda.testing import skip_on_cudasim
@skip_on_cudasim('CUDA Profiler unsupported in the simulator')
class TestProfiler(CUDATestCase):
def te... | true | true |
1c28883d9a0ad49328e03b43a80900d026a47663 | 2,224 | py | Python | plaso/output/pstorage.py | cvandeplas/plaso | b625a2c267ed09505cfac84c9593d8c0922852b1 | [
"Apache-2.0"
] | 3 | 2016-03-11T02:47:08.000Z | 2016-12-24T03:19:27.000Z | plaso/output/pstorage.py | cvandeplas/plaso | b625a2c267ed09505cfac84c9593d8c0922852b1 | [
"Apache-2.0"
] | null | null | null | plaso/output/pstorage.py | cvandeplas/plaso | b625a2c267ed09505cfac84c9593d8c0922852b1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the L... | 34.75 | 78 | 0.717626 |
from plaso.lib import event
from plaso.lib import output
from plaso.lib import storage
from plaso.lib import timelib
class Pstorage(output.LogOutputFormatter):
def Start(self):
pre_obj = event.PreprocessObject()
pre_obj.collection_information = {}
pre_obj.collection_information['time_... | true | true |
1c28884fc21a1760ba336f8ad108afb2623aa54f | 8,139 | py | Python | sdk/lusid_asyncio/models/paged_resource_list_of_participation.py | finbourne/lusid-sdk-python-asyncio-preview | 290f93590ab5485661216c8622d3de9f7af0ed60 | [
"MIT"
] | null | null | null | sdk/lusid_asyncio/models/paged_resource_list_of_participation.py | finbourne/lusid-sdk-python-asyncio-preview | 290f93590ab5485661216c8622d3de9f7af0ed60 | [
"MIT"
] | null | null | null | sdk/lusid_asyncio/models/paged_resource_list_of_participation.py | finbourne/lusid-sdk-python-asyncio-preview | 290f93590ab5485661216c8622d3de9f7af0ed60 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
LUSID API
FINBOURNE Technology # noqa: E501
The version of the OpenAPI document: 0.11.3923
Contact: info@finbourne.com
Generated by: https://openapi-generator.tech
"""
try:
from inspect import getfullargspec
except ImportError:
from inspect import getargspec as getf... | 30.483146 | 140 | 0.606954 |
try:
from inspect import getfullargspec
except ImportError:
from inspect import getargspec as getfullargspec
import pprint
import re
import six
from lusid_asyncio.configuration import Configuration
class PagedResourceListOfParticipation(object):
openapi_types = {
'next_page': 'str',
... | true | true |
1c2888e47062ada268a37cbe0ace3f8c088078b6 | 12,284 | py | Python | lingvo/core/datasource_test.py | zh794390558/lingvo | ecdf678179018ca07f4f52d065b9bf3fe2dc7c5a | [
"Apache-2.0"
] | 1 | 2019-10-10T06:08:35.000Z | 2019-10-10T06:08:35.000Z | lingvo/core/datasource_test.py | VonRosenchild/lingvo | fb929def2f27cf73a6ee1b1eaa8bee982bd92987 | [
"Apache-2.0"
] | null | null | null | lingvo/core/datasource_test.py | VonRosenchild/lingvo | fb929def2f27cf73a6ee1b1eaa8bee982bd92987 | [
"Apache-2.0"
] | 1 | 2019-10-10T06:08:39.000Z | 2019-10-10T06:08:39.000Z | # Lint as: python2, python3
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... | 40.013029 | 80 | 0.718903 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import lingvo.compat as tf
from lingvo.core import datasource
from lingvo.core import py_utils
def _MockDataSourceFromFilePattern(file_pattern, input_source_weights=None):
del input_source_... | true | true |
1c2888f41906f218dd3e15a987380e5df48d26e2 | 6,471 | py | Python | tests/test_spectrometers.py | jonathanvanschenck/python-seabreeze | 2756e094b4277e54d454cef748bef2de1278b770 | [
"MIT"
] | null | null | null | tests/test_spectrometers.py | jonathanvanschenck/python-seabreeze | 2756e094b4277e54d454cef748bef2de1278b770 | [
"MIT"
] | null | null | null | tests/test_spectrometers.py | jonathanvanschenck/python-seabreeze | 2756e094b4277e54d454cef748bef2de1278b770 | [
"MIT"
] | null | null | null | import pytest
try:
import seabreeze.pyseabreeze as psb
except ImportError:
psb = None
try:
import seabreeze.cseabreeze as csb
except ImportError:
csb = None
# skip all tests in this module if no backends can be imported
if csb is not None or psb is not None:
import seabreeze
seabreeze.use("... | 29.413636 | 88 | 0.660794 | import pytest
try:
import seabreeze.pyseabreeze as psb
except ImportError:
psb = None
try:
import seabreeze.cseabreeze as csb
except ImportError:
csb = None
if csb is not None or psb is not None:
import seabreeze
seabreeze.use("cseabreeze", force=False)
from seabreeze.spectrometers imp... | true | true |
1c288931938fb6251fd0aa6c38507fc541c98966 | 453,617 | py | Python | modules/s3db/pr.py | sahana/eden-core | 6af086d0617e84483aa74317c897ecffbe232596 | [
"MIT"
] | null | null | null | modules/s3db/pr.py | sahana/eden-core | 6af086d0617e84483aa74317c897ecffbe232596 | [
"MIT"
] | null | null | null | modules/s3db/pr.py | sahana/eden-core | 6af086d0617e84483aa74317c897ecffbe232596 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
""" Sahana Eden Person Registry Model
@copyright: 2009-2021 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Softwa... | 40.767233 | 252 | 0.415868 |
__all__ = (
"PersonEntityModel",
"PersonModel",
"PersonGroupModel",
"ForumModel",
"PersonEntityRealmModel",
"PersonEntityAddressModel",
"PersonEntityContactModel",
"PersonEntityImageModel",
"PersonEntityNo... | true | true |
1c288b0723ba00d21e86ab031a34ef0f04a4dbe0 | 8,516 | py | Python | experiments/ashvin/rss/pusher1/original/td3bc1.py | Asap7772/rail-rl-franka-eval | 4bf99072376828193d05b53cf83c7e8f4efbd3ba | [
"MIT"
] | null | null | null | experiments/ashvin/rss/pusher1/original/td3bc1.py | Asap7772/rail-rl-franka-eval | 4bf99072376828193d05b53cf83c7e8f4efbd3ba | [
"MIT"
] | null | null | null | experiments/ashvin/rss/pusher1/original/td3bc1.py | Asap7772/rail-rl-franka-eval | 4bf99072376828193d05b53cf83c7e8f4efbd3ba | [
"MIT"
] | null | null | null | """Example behavior cloning script for pointmass.
If you are trying to run this code, ask Ashvin for the demonstration file:
demos/pointmass_demos_100.npy (which should go in your S3 storage)
"""
import railrl.misc.hyperparameter as hyp
from multiworld.envs.mujoco.cameras import sawyer_pusher_camera_upright_v2
from m... | 32.753846 | 87 | 0.629403 |
import railrl.misc.hyperparameter as hyp
from multiworld.envs.mujoco.cameras import sawyer_pusher_camera_upright_v2
from multiworld.envs.pygame.point2d import Point2DWallEnv
from multiworld.envs.mujoco.sawyer_xyz.sawyer_push_multiobj import SawyerMultiobjectEnv
from railrl.launchers.launcher_util import run_experime... | true | true |
1c288d6dc062f019fc3dd65464dffa74d6ee0489 | 4,409 | py | Python | hubblestack/files/hubblestack_nova/vulners_scanner.py | NerdsvilleCEO/hubble | 200dc8bc2075da5753b2424f1597d806a4139d41 | [
"Apache-2.0"
] | null | null | null | hubblestack/files/hubblestack_nova/vulners_scanner.py | NerdsvilleCEO/hubble | 200dc8bc2075da5753b2424f1597d806a4139d41 | [
"Apache-2.0"
] | null | null | null | hubblestack/files/hubblestack_nova/vulners_scanner.py | NerdsvilleCEO/hubble | 200dc8bc2075da5753b2424f1597d806a4139d41 | [
"Apache-2.0"
] | null | null | null | '''
HubbleStack Nova plugin for auditing installed packages.
The module gets the list of installed packages of the system and queries
the Vulners.com Linux Vulnerability Audit API.
The API is described at the link below:
https://blog.vulners.com/linux-vulnerability-audit-in-vulners/
This audit module requires a ... | 31.719424 | 107 | 0.650034 |
from __future__ import absolute_import
import logging
import sys
import requests
log = logging.getLogger(__name__)
def __virtual__():
return not sys.platform.startswith('win')
def audit(data_list, tags, labels, debug=False, **kwargs):
os_name = __grains__.get('os').lower()
os_version = __grains__.ge... | true | true |
1c288e4100d6f8bf44bb2b099e3c910997afe50b | 881 | py | Python | BACKEND/dbsbank/dbsbank/urls.py | cvsnpraveen/VirtualHiring | ded7f3a65e84fb185f19dee400c433fac23e077b | [
"MIT"
] | null | null | null | BACKEND/dbsbank/dbsbank/urls.py | cvsnpraveen/VirtualHiring | ded7f3a65e84fb185f19dee400c433fac23e077b | [
"MIT"
] | null | null | null | BACKEND/dbsbank/dbsbank/urls.py | cvsnpraveen/VirtualHiring | ded7f3a65e84fb185f19dee400c433fac23e077b | [
"MIT"
] | 2 | 2022-01-29T07:06:49.000Z | 2022-01-29T07:47:44.000Z | """dbs URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-b... | 33.884615 | 78 | 0.690125 | from django.contrib import admin
from django.urls import path,include
from order import urls
admin.site.site_header="DBS order Booking"
urlpatterns = [
path('admin/', admin.site.urls),
path("",include("order.urls")),
]
| true | true |
1c288f3285db06a192514543fd2e83081e4babdb | 4,003 | py | Python | qiskit_metal/renderers/renderer_base/rndr_analysis.py | TomVethaak/qiskit-metal | 0fd3049b16a2b28dc6890b696d67329a91da70b9 | [
"Apache-2.0"
] | 167 | 2021-03-17T20:35:17.000Z | 2022-03-31T13:25:04.000Z | qiskit_metal/renderers/renderer_base/rndr_analysis.py | TomVethaak/qiskit-metal | 0fd3049b16a2b28dc6890b696d67329a91da70b9 | [
"Apache-2.0"
] | 307 | 2021-03-17T14:07:43.000Z | 2022-03-23T14:22:20.000Z | qiskit_metal/renderers/renderer_base/rndr_analysis.py | TomVethaak/qiskit-metal | 0fd3049b16a2b28dc6890b696d67329a91da70b9 | [
"Apache-2.0"
] | 122 | 2021-03-17T14:21:24.000Z | 2022-03-18T10:09:38.000Z | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | 28.592857 | 95 | 0.616538 |
from . import QRenderer
from ... import Dict
from abc import abstractmethod, ABC
from ...designs import QDesign, is_design
__all__ = ['QRendererAnalysis']
class QRendererAnalysis(QRenderer):
def __init__(self, design: 'QDesign', initiate=False, options: Dict = None):
super().__init__(desi... | true | true |
1c288f60bb849774cf46d051d8aaed94c2ba7c9b | 6,813 | py | Python | neural_testbed/agents/enn_agent.py | deepmind/neural_testbed | 5b18d74473403fd5dc28c2570a1641b24e9d0a28 | [
"Apache-2.0"
] | 67 | 2021-10-04T09:29:12.000Z | 2022-03-25T11:10:15.000Z | neural_testbed/agents/enn_agent.py | deepmind/neural_testbed | 5b18d74473403fd5dc28c2570a1641b24e9d0a28 | [
"Apache-2.0"
] | 2 | 2021-11-03T10:48:02.000Z | 2021-11-05T11:04:58.000Z | neural_testbed/agents/enn_agent.py | deepmind/neural_testbed | 5b18d74473403fd5dc28c2570a1641b24e9d0a28 | [
"Apache-2.0"
] | 4 | 2021-10-12T23:57:39.000Z | 2022-03-23T04:02:25.000Z | # pylint: disable=g-bad-file-header
# Copyright 2021 DeepMind Technologies Limited. 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/... | 36.239362 | 79 | 0.722002 |
import dataclasses
from typing import Dict, Optional, Union, Callable
from acme.utils import loggers
import chex
from enn import base as enn_base
from enn import supervised
from enn import utils
import jax
from neural_testbed import base as testbed_base
from neural_testbed import likelihood
from neura... | true | true |
1c289099a759e76dc9f87ff5597225983e103848 | 2,161 | py | Python | deepxde/losses.py | HiddeLekanne/deepxde | dbe9188866bc8e4fc472e5d59a82a2202b033ab1 | [
"Apache-2.0"
] | null | null | null | deepxde/losses.py | HiddeLekanne/deepxde | dbe9188866bc8e4fc472e5d59a82a2202b033ab1 | [
"Apache-2.0"
] | null | null | null | deepxde/losses.py | HiddeLekanne/deepxde | dbe9188866bc8e4fc472e5d59a82a2202b033ab1 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from . import backend as bkd
from . import config
from .backend import tf
def mean_absolute_error(y_true, y_pred):
return tf.keras.losses.MeanAbsoluteError()(y_true, y_pred)
def mean_absolute_percentage... | 33.765625 | 102 | 0.713096 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from . import backend as bkd
from . import config
from .backend import tf
def mean_absolute_error(y_true, y_pred):
return tf.keras.losses.MeanAbsoluteError()(y_true, y_pred)
def mean_absolute_percentage... | true | true |
1c2891cb7085a890753ff442679c7ef8b55f97e0 | 1,627 | py | Python | lagpy/functools/Environment.py | lagagain/lagpy | c46ee0c72c11b801b6b03980296fe6c739479c46 | [
"BSD-3-Clause"
] | null | null | null | lagpy/functools/Environment.py | lagagain/lagpy | c46ee0c72c11b801b6b03980296fe6c739479c46 | [
"BSD-3-Clause"
] | null | null | null | lagpy/functools/Environment.py | lagagain/lagpy | c46ee0c72c11b801b6b03980296fe6c739479c46 | [
"BSD-3-Clause"
] | null | null | null | from .Callable import CallableWrapper
class Environment:
"""
>>> def puts(s:str, *args, **kwargs):
... print(s, *args, **kwargs)
... return s
>>>
>>> Env = Environment # alias
>>> env = Env()
>>> # env(puts,"Hello", end="") \
>>> # (puts, 'World.') # Output: Hello, World
... | 24.283582 | 79 | 0.519361 | from .Callable import CallableWrapper
class Environment:
def __getitem__(self, key:str):
return self.__getattr__(key)
def __setitem__(self, key:str, value):
setattr(self, key, value)
return CallableWrapper.new(value)
def __getattr__(self, key: str, default = None):
if key ... | true | true |
1c2892fa85cf68d3ffb2104d8116ba4d1540ff1c | 1,187 | py | Python | robot-server/robot_server/protocols/protocol_analyzer.py | Opentrons/labware | e21d8db51eac5818477264a45ef12c0a2d15fb72 | [
"Apache-2.0"
] | 2 | 2015-11-10T17:49:51.000Z | 2016-01-15T04:43:37.000Z | robot-server/robot_server/protocols/protocol_analyzer.py | Opentrons/labware | e21d8db51eac5818477264a45ef12c0a2d15fb72 | [
"Apache-2.0"
] | null | null | null | robot-server/robot_server/protocols/protocol_analyzer.py | Opentrons/labware | e21d8db51eac5818477264a45ef12c0a2d15fb72 | [
"Apache-2.0"
] | null | null | null | """Protocol analysis module."""
import logging
from opentrons.protocol_runner import ProtocolRunner
from .protocol_store import ProtocolResource
from .analysis_store import AnalysisStore
log = logging.getLogger(__name__)
class ProtocolAnalyzer:
"""A collaborator to perform an analysis of a protocol and store ... | 28.261905 | 83 | 0.672283 | import logging
from opentrons.protocol_runner import ProtocolRunner
from .protocol_store import ProtocolResource
from .analysis_store import AnalysisStore
log = logging.getLogger(__name__)
class ProtocolAnalyzer:
def __init__(
self,
protocol_runner: ProtocolRunner,
analysis_store: Ana... | true | true |
1c2893a14cba5023fe0cc349c0da3693597e8075 | 703 | py | Python | user/api/dev/serializers.py | dermrsimon/wopi-engine | 934a238b98f7e1f479a358776eb396f5d6bc0f24 | [
"BSD-Source-Code"
] | null | null | null | user/api/dev/serializers.py | dermrsimon/wopi-engine | 934a238b98f7e1f479a358776eb396f5d6bc0f24 | [
"BSD-Source-Code"
] | null | null | null | user/api/dev/serializers.py | dermrsimon/wopi-engine | 934a238b98f7e1f479a358776eb396f5d6bc0f24 | [
"BSD-Source-Code"
] | null | null | null | #
# Created on Mon Nov 02 2020
#
# Copyright (c) 2020 - Simon Prast
#
from rest_framework import serializers
from user.models import User
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = User
exclude = ['password', 'is_admin']
class RegisterUserSerializer(serializers.Mod... | 21.96875 | 58 | 0.648649 |
from rest_framework import serializers
from user.models import User
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = User
exclude = ['password', 'is_admin']
class RegisterUserSerializer(serializers.ModelSerializer):
class Meta:
model = User
... | true | true |
1c2894ee68717c322e27f9f0050efea9f6e5bfd5 | 1,346 | py | Python | adv_2017/day2_checksum.py | vschule/adventcode | 273698fd8bc88beec6b707a87d3b956594493792 | [
"MIT"
] | null | null | null | adv_2017/day2_checksum.py | vschule/adventcode | 273698fd8bc88beec6b707a87d3b956594493792 | [
"MIT"
] | null | null | null | adv_2017/day2_checksum.py | vschule/adventcode | 273698fd8bc88beec6b707a87d3b956594493792 | [
"MIT"
] | null | null | null | import pytest
def first(lines):
summed = 0
for line in lines.splitlines():
values = list(map(int, line.split()))
maximum = max(values)
minimum = min(values)
summed += maximum - minimum
return summed
def second(lines):
output_cs = 0
for line in lines.splitlines()... | 21.709677 | 53 | 0.502972 | import pytest
def first(lines):
summed = 0
for line in lines.splitlines():
values = list(map(int, line.split()))
maximum = max(values)
minimum = min(values)
summed += maximum - minimum
return summed
def second(lines):
output_cs = 0
for line in lines.splitlines()... | true | true |
1c289568b0b844064557a4acd8495b60c4ca009e | 8,660 | py | Python | tests/002_finder/101_compilable.py | Sam-prog-sudo/boussole | 5d6ec94356f9a91ff4d6d23c1700d3512b67006a | [
"MIT"
] | 13 | 2016-05-19T15:18:41.000Z | 2022-03-22T15:37:32.000Z | tests/002_finder/101_compilable.py | Sam-prog-sudo/boussole | 5d6ec94356f9a91ff4d6d23c1700d3512b67006a | [
"MIT"
] | 38 | 2016-04-07T00:30:58.000Z | 2022-02-28T13:29:33.000Z | tests/002_finder/101_compilable.py | Sam-prog-sudo/boussole | 5d6ec94356f9a91ff4d6d23c1700d3512b67006a | [
"MIT"
] | 3 | 2016-05-20T09:21:57.000Z | 2020-10-12T10:56:49.000Z | # -*- coding: utf-8 -*-
import os
def test_relative_nonrecursive_001(settings, finder):
"""
Find non recursively all compilable sources from sample project in relative
mode
"""
result = finder.compilable_sources(
settings.sample_path,
recursive=False
)
assert result == [
... | 34.501992 | 79 | 0.655312 |
import os
def test_relative_nonrecursive_001(settings, finder):
result = finder.compilable_sources(
settings.sample_path,
recursive=False
)
assert result == [
"main_basic.scss",
"main_circular_0.scss",
"main_circular_1.scss",
"main_circular_2.scss",
... | true | true |
1c2897a20bf18a17eb70e73495b2ded76270d61f | 16,201 | py | Python | venv/lib/python2.7/site-packages/ansible/modules/net_tools/haproxy.py | haind27/test01 | 7f86c0a33eb0874a6c3f5ff9a923fd0cfc8ef852 | [
"MIT"
] | 37 | 2017-08-15T15:02:43.000Z | 2021-07-23T03:44:31.000Z | venv/lib/python2.7/site-packages/ansible/modules/net_tools/haproxy.py | haind27/test01 | 7f86c0a33eb0874a6c3f5ff9a923fd0cfc8ef852 | [
"MIT"
] | 12 | 2018-01-10T05:25:25.000Z | 2021-11-28T06:55:48.000Z | venv/lib/python2.7/site-packages/ansible/modules/net_tools/haproxy.py | haind27/test01 | 7f86c0a33eb0874a6c3f5ff9a923fd0cfc8ef852 | [
"MIT"
] | 49 | 2017-08-15T09:52:13.000Z | 2022-03-21T17:11:54.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Ravi Bhure <ravibhure@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | 36.002222 | 139 | 0.644034 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: haproxy
version_added: "1.9"
short_description: Enabl... | true | true |
1c28998789ef432ebc696ee0ae0ec8145d931f04 | 20,477 | py | Python | nipyapi/nifi/apis/input_ports_api.py | Zyrix/nipyapi | d00221ba50bd83e21133d6e4d4b56741ead6822a | [
"Apache-2.0"
] | null | null | null | nipyapi/nifi/apis/input_ports_api.py | Zyrix/nipyapi | d00221ba50bd83e21133d6e4d4b56741ead6822a | [
"Apache-2.0"
] | null | null | null | nipyapi/nifi/apis/input_ports_api.py | Zyrix/nipyapi | d00221ba50bd83e21133d6e4d4b56741ead6822a | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
NiFi Rest Api
The Rest Api provides programmatic access to command and control a NiFi instance in real time. Start and stop processors, monitor queues, query provenance data, and more. Each endpoint below includes a description, ... | 41.619919 | 479 | 0.568882 |
from __future__ import absolute_import
import sys
import os
import re
from six import iteritems
from ..configuration import Configuration
from ..api_client import ApiClient
class InputPortsApi(object):
def __init__(self, api_client=None):
config = Configuration()
if api_client:
... | true | true |
1c289a4c95011eb37f9f21b88f1792732ffbacf0 | 3,167 | py | Python | filepath/constants.py | Cediner/Rise-of-Kingdoms-Bot | 784de31bfa1d505abe20f147bc32ed4638d2bc93 | [
"MIT"
] | 2 | 2022-02-03T14:50:57.000Z | 2022-02-03T19:46:23.000Z | filepath/constants.py | Cediner/Rise-of-Kingdoms-Bot | 784de31bfa1d505abe20f147bc32ed4638d2bc93 | [
"MIT"
] | 1 | 2022-02-03T17:12:18.000Z | 2022-02-04T03:51:30.000Z | filepath/constants.py | Cediner/Rise-of-Kingdoms-Bot | 784de31bfa1d505abe20f147bc32ed4638d2bc93 | [
"MIT"
] | 4 | 2022-02-03T14:51:00.000Z | 2022-02-23T09:44:46.000Z | RESOURCES = 'RESOURCES'
SPEEDUPS = 'SPEEDUPS'
BOOSTS = 'BOOSTS'
EQUIPMENT = 'EQUIPMENT'
OTHER = 'OTHER'
HOME = 'HOME'
MAP = 'MAP'
GREEN_HOME = 'GREEN_HOME'
WINDOW = 'WINDOW'
WINDOW_TITLE = 'WINDOW_TITLE'
BUILDING_TITLE = 'BUILDING_TITLE'
BUILDING_INFO = 'BUILDING_INFO'
MENU_OPENED_IMAGE = 'MENU_OPENED_IMAGE'
MENU_IMAGE... | 34.053763 | 67 | 0.825703 | RESOURCES = 'RESOURCES'
SPEEDUPS = 'SPEEDUPS'
BOOSTS = 'BOOSTS'
EQUIPMENT = 'EQUIPMENT'
OTHER = 'OTHER'
HOME = 'HOME'
MAP = 'MAP'
GREEN_HOME = 'GREEN_HOME'
WINDOW = 'WINDOW'
WINDOW_TITLE = 'WINDOW_TITLE'
BUILDING_TITLE = 'BUILDING_TITLE'
BUILDING_INFO = 'BUILDING_INFO'
MENU_OPENED_IMAGE = 'MENU_OPENED_IMAGE'
MENU_IMAGE... | true | true |
1c289af90daa61a2f2b7e9320d353df5c845d4ae | 464 | py | Python | My first python project.py | sanxy/hacktoberfest-1 | 913582b310688d496602e8b1bc9166cb64866e38 | [
"MIT"
] | null | null | null | My first python project.py | sanxy/hacktoberfest-1 | 913582b310688d496602e8b1bc9166cb64866e38 | [
"MIT"
] | null | null | null | My first python project.py | sanxy/hacktoberfest-1 | 913582b310688d496602e8b1bc9166cb64866e38 | [
"MIT"
] | 1 | 2020-09-30T18:53:05.000Z | 2020-09-30T18:53:05.000Z | print("hello freinds i am first python program of Tanmay")
print("so first i will find avg of a number you give me")
a = input("Enter first number : ")
b = input("Enter second number : ")
a = int(a)
b = int(b)
avg = (a + b)/2
print("the average of your number is",avg)
print("Now i will square the number you... | 24.421053 | 59 | 0.637931 | print("hello freinds i am first python program of Tanmay")
print("so first i will find avg of a number you give me")
a = input("Enter first number : ")
b = input("Enter second number : ")
a = int(a)
b = int(b)
avg = (a + b)/2
print("the average of your number is",avg)
print("Now i will square the number you... | true | true |
1c289bc56ab75b46d6187d02df0b140d7b9e52f2 | 1,635 | py | Python | src/apps/api/errors.py | Chise1/fast-tmp2 | 0dd34ac3ec7ea5452c1e4b8d922a40665264f42b | [
"Apache-2.0"
] | 1 | 2021-07-02T09:14:12.000Z | 2021-07-02T09:14:12.000Z | src/apps/api/errors.py | Chise1/fast-tmp2 | 0dd34ac3ec7ea5452c1e4b8d922a40665264f42b | [
"Apache-2.0"
] | null | null | null | src/apps/api/errors.py | Chise1/fast-tmp2 | 0dd34ac3ec7ea5452c1e4b8d922a40665264f42b | [
"Apache-2.0"
] | null | null | null | from pydantic import BaseModel
class BaseError(BaseModel):
error: int
msg: str
class EntityNotFound(BaseError):
error = 1
msg = "实体未找到"
class UserBaned(BaseError):
error = 2
msg = "你的账号已被冻结"
class EntityExists(BaseError):
error = 3
msg = "实体已存在"
class VerifyCodeError(BaseError)... | 13.401639 | 37 | 0.633639 | from pydantic import BaseModel
class BaseError(BaseModel):
error: int
msg: str
class EntityNotFound(BaseError):
error = 1
msg = "实体未找到"
class UserBaned(BaseError):
error = 2
msg = "你的账号已被冻结"
class EntityExists(BaseError):
error = 3
msg = "实体已存在"
class VerifyCodeError(BaseError)... | true | true |
1c289cb87d2aa6c9f4dd04e764e10063663c4994 | 1,654 | py | Python | main.py | zerv-bot/gitafe | 9637808d39b9eb828a839d1273155fdb26c0c6fa | [
"MIT"
] | null | null | null | main.py | zerv-bot/gitafe | 9637808d39b9eb828a839d1273155fdb26c0c6fa | [
"MIT"
] | null | null | null | main.py | zerv-bot/gitafe | 9637808d39b9eb828a839d1273155fdb26c0c6fa | [
"MIT"
] | null | null | null | # GITAFE - Time is money.
# Author : Harvey Wu
import os
import sys
import yaml
VERSION = '0.1'
CONFIG_VERSION = '0.0'
CONFIG_PATH = 'config.yaml'
GIT_BRANCH = 'main'
def main():
try:
with open(CONFIG_PATH, 'r') as f:
data = yaml.safe_load(f)
CONFIG_VERSION = str(data.get('version... | 33.755102 | 95 | 0.542322 |
import os
import sys
import yaml
VERSION = '0.1'
CONFIG_VERSION = '0.0'
CONFIG_PATH = 'config.yaml'
GIT_BRANCH = 'main'
def main():
try:
with open(CONFIG_PATH, 'r') as f:
data = yaml.safe_load(f)
CONFIG_VERSION = str(data.get('version'))
GIT_BRANCH = str(data.get('br... | true | true |
1c289d697b2ddba1cb7fb4186a099cf8a31f0198 | 670 | py | Python | manage.py | ttppren-github/MeetingSample-Backend | 7ed01498d1c825333c496b41450140e2438cd630 | [
"MIT"
] | 7 | 2021-11-11T09:29:20.000Z | 2021-11-15T03:45:22.000Z | manage.py | ttppren-github/MeetingSample-Backend | 7ed01498d1c825333c496b41450140e2438cd630 | [
"MIT"
] | null | null | null | manage.py | ttppren-github/MeetingSample-Backend | 7ed01498d1c825333c496b41450140e2438cd630 | [
"MIT"
] | 4 | 2021-11-12T03:32:02.000Z | 2021-11-15T03:45:24.000Z | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'meeting_sample.settings')
try:
from django.core.management import execute_from_command_line
exce... | 29.130435 | 78 | 0.68209 |
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'meeting_sample.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and ... | true | true |
1c289e711882426f4c3fbddefd2a9a728bdd18c0 | 4,342 | py | Python | src/etc/make-win-dist.py | wickerwaka/rust | 140e79385494da83f5a36f8fefa001b2180fa541 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2016-12-02T22:31:57.000Z | 2022-03-14T19:54:37.000Z | src/etc/make-win-dist.py | wickerwaka/rust | 140e79385494da83f5a36f8fefa001b2180fa541 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | src/etc/make-win-dist.py | wickerwaka/rust | 140e79385494da83f5a36f8fefa001b2180fa541 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2017-06-08T10:09:37.000Z | 2017-06-08T10:09:37.000Z | # Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or ht... | 34.736 | 89 | 0.538922 |
import sys
import os
import shutil
import subprocess
def find_files(files, path):
found = []
for fname in files:
for dir in path:
filepath = os.path.normpath(os.path.join(dir, fname))
if os.path.isfile(filepath):
found.append(filepath)
... | true | true |
1c289fbc39239579ee145ec6aed31fe56fa7f614 | 8,530 | py | Python | networks/networks.py | Ch4nYH/dataset-distillation | 61effcfe8aa7a1a3d9f66ece1fa29bcb393472c2 | [
"MIT"
] | null | null | null | networks/networks.py | Ch4nYH/dataset-distillation | 61effcfe8aa7a1a3d9f66ece1fa29bcb393472c2 | [
"MIT"
] | null | null | null | networks/networks.py | Ch4nYH/dataset-distillation | 61effcfe8aa7a1a3d9f66ece1fa29bcb393472c2 | [
"MIT"
] | null | null | null | import torch.nn as nn
import torch.nn.functional as F
from . import utils
class LeNet(utils.ReparamModule):
supported_dims = {28, 32}
def __init__(self, state):
if state.dropout:
raise ValueError("LeNet doesn't support dropout")
super(LeNet, self).__init__()
self.conv1 = ... | 38.251121 | 118 | 0.601172 | import torch.nn as nn
import torch.nn.functional as F
from . import utils
class LeNet(utils.ReparamModule):
supported_dims = {28, 32}
def __init__(self, state):
if state.dropout:
raise ValueError("LeNet doesn't support dropout")
super(LeNet, self).__init__()
self.conv1 = ... | true | true |
1c289fcebddf5fc23e3935526c0b81f2db1e1901 | 19,632 | py | Python | dee/dee_task.py | yanqiuxia/Doc2EDAG | db6256cff47e647f53cdaf3fb43b4adb8559b95b | [
"MIT"
] | 15 | 2020-08-27T11:31:04.000Z | 2022-03-07T03:14:21.000Z | dee/dee_task.py | yanqiuxia/Doc2EDAG | db6256cff47e647f53cdaf3fb43b4adb8559b95b | [
"MIT"
] | 1 | 2020-08-24T07:56:38.000Z | 2022-03-18T01:26:57.000Z | dee/dee_task.py | yanqiuxia/Doc2EDAG | db6256cff47e647f53cdaf3fb43b4adb8559b95b | [
"MIT"
] | 2 | 2020-12-03T09:09:54.000Z | 2021-05-20T06:15:29.000Z | # -*- coding: utf-8 -*-
# AUTHOR: Shun Zheng
# DATE: 19-9-19
import logging
import os
import torch.optim as optim
import torch.distributed as dist
from itertools import product
from .dee_helper import logger, DEEExample, DEEExampleLoader, DEEFeatureConverter, \
convert_dee_features_to_dataset, prepare_doc_batch_d... | 43.626667 | 120 | 0.639925 |
import logging
import os
import torch.optim as optim
import torch.distributed as dist
from itertools import product
from .dee_helper import logger, DEEExample, DEEExampleLoader, DEEFeatureConverter, \
convert_dee_features_to_dataset, prepare_doc_batch_dict, measure_dee_prediction, \
decode_dump_template, e... | true | true |
1c289ff869d5f785ab60187b647ccc2ca1e7de1e | 13,562 | py | Python | bot/cogs/misc.py | AvocadoManYT/Test | 06728cb852e675c86fbcf687780fc7bff88b8a43 | [
"MIT"
] | null | null | null | bot/cogs/misc.py | AvocadoManYT/Test | 06728cb852e675c86fbcf687780fc7bff88b8a43 | [
"MIT"
] | null | null | null | bot/cogs/misc.py | AvocadoManYT/Test | 06728cb852e675c86fbcf687780fc7bff88b8a43 | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
from main import restart_reason as rr, owners, note
import datetime
import json
import DiscordUtils
from datetime import datetime
from discord.ext.commands import Cog as c, command as cmd
class Miscellaneous(commands.Cog):
""" Cog for miscellaneous commands"""
a... | 45.972881 | 313 | 0.596077 | import discord
from discord.ext import commands
from main import restart_reason as rr, owners, note
import datetime
import json
import DiscordUtils
from datetime import datetime
from discord.ext.commands import Cog as c, command as cmd
class Miscellaneous(commands.Cog):
async def open_accoun(self, user):
... | true | true |
1c28a23818107a2fb8f037a4d3c22862993e338b | 2,062 | py | Python | letters/migrations/0001_initial.py | onhan/free-site | f01de27a3cafd09234cddacfd4ca9705b5b9d6e7 | [
"BSD-3-Clause"
] | 19 | 2018-01-28T14:35:40.000Z | 2020-12-04T03:04:02.000Z | letters/migrations/0001_initial.py | groundupnews/gu | c7179ee3d058c8749d250d681032a76dc8d599d5 | [
"BSD-3-Clause"
] | 8 | 2018-06-02T14:28:28.000Z | 2021-08-06T10:22:37.000Z | letters/migrations/0001_initial.py | onhan/free-site | f01de27a3cafd09234cddacfd4ca9705b5b9d6e7 | [
"BSD-3-Clause"
] | 21 | 2018-02-25T14:07:48.000Z | 2020-05-28T23:10:52.000Z | # Generated by Django 2.1.4 on 2018-12-10 16:17
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('newsroom', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='... | 45.822222 | 186 | 0.594083 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('newsroom', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Letter',
fields=[
(... | true | true |
1c28a25f869dd5efdf173983e056b9729aed8c78 | 1,455 | py | Python | muk_web_utils/models/ir_attachment.py | juazisco/gestion_rifa | bce6b75f17cb5ab2df7e2f7dd5141fc85a1a5bfb | [
"MIT"
] | null | null | null | muk_web_utils/models/ir_attachment.py | juazisco/gestion_rifa | bce6b75f17cb5ab2df7e2f7dd5141fc85a1a5bfb | [
"MIT"
] | null | null | null | muk_web_utils/models/ir_attachment.py | juazisco/gestion_rifa | bce6b75f17cb5ab2df7e2f7dd5141fc85a1a5bfb | [
"MIT"
] | null | null | null | ##########################################################################
#
# Copyright (C) 2018 MuK IT GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version ... | 33.068182 | 77 | 0.584192 | true | true | |
1c28a3afc5efbeb61e26a0e617a66628aaa6060c | 683 | py | Python | tests/ui/sidebar.py | uProxy/1-ufo-management-server | e5d3a9fc704f13d2d0c82fc7cd5ac596c553eca3 | [
"Apache-2.0"
] | 1 | 2018-12-30T11:35:11.000Z | 2018-12-30T11:35:11.000Z | tests/ui/sidebar.py | UWNetworksLab/ufo-management-server | e5d3a9fc704f13d2d0c82fc7cd5ac596c553eca3 | [
"Apache-2.0"
] | null | null | null | tests/ui/sidebar.py | UWNetworksLab/ufo-management-server | e5d3a9fc704f13d2d0c82fc7cd5ac596c553eca3 | [
"Apache-2.0"
] | null | null | null | """Sidebar module to get links for testing."""
from base_driver import BaseDriver
from selenium.webdriver.common.by import By
class Sidebar(BaseDriver):
"""Sidebar action methods and locators."""
# pylint: disable=too-few-public-methods
SIDEBAR = (By.TAG_NAME, 'ufo-sidebar')
HOME_LINK = (By.ID, 'Home')
... | 27.32 | 72 | 0.707174 | from base_driver import BaseDriver
from selenium.webdriver.common.by import By
class Sidebar(BaseDriver):
SIDEBAR = (By.TAG_NAME, 'ufo-sidebar')
HOME_LINK = (By.ID, 'Home')
USERS_LINK = (By.ID, 'Users')
PROXY_SERVERS_LINK = (By.ID, 'Proxy Servers')
SETUP_LINK = (By.ID, 'Setup')
SYNC_NOTIFICATIONS_L... | true | true |
1c28a79c95ade01bbeaebc1f5657c85703ba9895 | 7,521 | py | Python | hddm/tests/test_optimization.py | ccbrain/hddm_upt | 153abccf20633811503aff5467097ad2cc3fa0e7 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | hddm/tests/test_optimization.py | ccbrain/hddm_upt | 153abccf20633811503aff5467097ad2cc3fa0e7 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | hddm/tests/test_optimization.py | ccbrain/hddm_upt | 153abccf20633811503aff5467097ad2cc3fa0e7 | [
"BSD-2-Clause-FreeBSD"
] | 2 | 2017-05-19T10:04:11.000Z | 2020-11-13T09:21:43.000Z |
from copy import copy
import itertools
import glob
import os
import unittest
import pymc as pm
import numpy as np
import pandas as pd
import nose
pd.set_printoptions(precision=4)
from nose import SkipTest
import hddm
from hddm.diag import check_model
def add_outliers(data, p_outlier):
"""add outliers to data. ... | 39.171875 | 118 | 0.655897 |
from copy import copy
import itertools
import glob
import os
import unittest
import pymc as pm
import numpy as np
import pandas as pd
import nose
pd.set_printoptions(precision=4)
from nose import SkipTest
import hddm
from hddm.diag import check_model
def add_outliers(data, p_outlier):
data = pd.DataFrame(data)... | true | true |
1c28a7d524bd9352d7aea55121c00580602f1de5 | 2,501 | py | Python | openie/stuffie/utils_stuffie.py | hthuwal/ARC-Challenge | 6b1b2899a4d6e5ea58c7fce0f32d382dbdbfa748 | [
"Apache-2.0"
] | null | null | null | openie/stuffie/utils_stuffie.py | hthuwal/ARC-Challenge | 6b1b2899a4d6e5ea58c7fce0f32d382dbdbfa748 | [
"Apache-2.0"
] | null | null | null | openie/stuffie/utils_stuffie.py | hthuwal/ARC-Challenge | 6b1b2899a4d6e5ea58c7fce0f32d382dbdbfa748 | [
"Apache-2.0"
] | null | null | null | import json
import os
import time
def timeit(function):
def inner(*args, **kwargs):
st = time.time()
out = function(*args, **kwargs)
et = time.time()
time_taken = et - st
unit = "seconds" if time_taken <= 60 else "minutes"
time_taken = time_taken if time_taken <= 60 ... | 31.2625 | 82 | 0.457417 | import json
import os
import time
def timeit(function):
def inner(*args, **kwargs):
st = time.time()
out = function(*args, **kwargs)
et = time.time()
time_taken = et - st
unit = "seconds" if time_taken <= 60 else "minutes"
time_taken = time_taken if time_taken <= 60 ... | true | true |
1c28a81cadb7293d08d7c6b9c7afa408660074a3 | 497 | py | Python | tests/support/settings.py | thedrow/django-password-field | f3a1b641c670cac63e799f756b1eff378a0ad9ff | [
"BSD-3-Clause"
] | 2 | 2018-03-02T12:57:16.000Z | 2019-06-07T20:14:24.000Z | tests/support/settings.py | thedrow/django-password-field | f3a1b641c670cac63e799f756b1eff378a0ad9ff | [
"BSD-3-Clause"
] | null | null | null | tests/support/settings.py | thedrow/django-password-field | f3a1b641c670cac63e799f756b1eff378a0ad9ff | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
import django
USE_TZ = True
SECRET_KEY = 'secretkey'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'HOST': ':memory:'
}
}
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',... | 19.115385 | 71 | 0.661972 |
import django
USE_TZ = True
SECRET_KEY = 'secretkey'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'HOST': ':memory:'
}
}
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'tests.support'
)
PASSWORD_HAS... | true | true |
1c28aa4c47defa211ac4ed2d8d4366a82623a046 | 62 | py | Python | npyscreen/globals.py | tescalada/npyscreen-restructure | 0833bbbdec18439182f102d2147f3756fa98aadd | [
"BSD-2-Clause"
] | 2 | 2015-01-12T14:47:19.000Z | 2018-10-03T09:27:22.000Z | npyscreen/globals.py | tescalada/npyscreen-restructure | 0833bbbdec18439182f102d2147f3756fa98aadd | [
"BSD-2-Clause"
] | null | null | null | npyscreen/globals.py | tescalada/npyscreen-restructure | 0833bbbdec18439182f102d2147f3756fa98aadd | [
"BSD-2-Clause"
] | 1 | 2020-03-20T20:19:33.000Z | 2020-03-20T20:19:33.000Z | # encoding: utf-8
DEBUG = False
DISABLE_RESIZE_SYSTEM = False | 15.5 | 29 | 0.774194 |
DEBUG = False
DISABLE_RESIZE_SYSTEM = False | true | true |
1c28aa941d1d96291d3e7fde98b6f6dc6a8821b4 | 1,111 | py | Python | src/oic/oauth2/exception.py | layoaster/pyoidc | 6b03b8a285c3f4652dea474df4429d8ee6e5298b | [
"Apache-2.0"
] | null | null | null | src/oic/oauth2/exception.py | layoaster/pyoidc | 6b03b8a285c3f4652dea474df4429d8ee6e5298b | [
"Apache-2.0"
] | 1 | 2019-02-08T09:11:49.000Z | 2019-02-08T09:11:49.000Z | src/oic/oauth2/exception.py | layoaster/pyoidc | 6b03b8a285c3f4652dea474df4429d8ee6e5298b | [
"Apache-2.0"
] | 1 | 2019-02-25T10:08:48.000Z | 2019-02-25T10:08:48.000Z | from oic.exception import PyoidcError
__author__ = 'roland'
class HttpError(PyoidcError):
pass
class MissingRequiredAttribute(PyoidcError):
pass
class VerificationError(PyoidcError):
pass
class ResponseError(PyoidcError):
pass
class TimeFormatError(PyoidcError):
pass
class CapabilitiesM... | 14.428571 | 78 | 0.724572 | from oic.exception import PyoidcError
__author__ = 'roland'
class HttpError(PyoidcError):
pass
class MissingRequiredAttribute(PyoidcError):
pass
class VerificationError(PyoidcError):
pass
class ResponseError(PyoidcError):
pass
class TimeFormatError(PyoidcError):
pass
class CapabilitiesM... | true | true |
1c28abc96127a1480eaee7d163df617378a05b96 | 81 | py | Python | application/bridgesystem/hosteddocument.py | Ragora/PyBridge | 146bf8dea53d8af1ec7547cb18e4d373b2af6ec8 | [
"MIT"
] | null | null | null | application/bridgesystem/hosteddocument.py | Ragora/PyBridge | 146bf8dea53d8af1ec7547cb18e4d373b2af6ec8 | [
"MIT"
] | null | null | null | application/bridgesystem/hosteddocument.py | Ragora/PyBridge | 146bf8dea53d8af1ec7547cb18e4d373b2af6ec8 | [
"MIT"
] | null | null | null | """
Hosted document programming.
"""
class HostedDocument(object):
pass
| 11.571429 | 32 | 0.666667 |
class HostedDocument(object):
pass
| true | true |
1c28ada8c2e5c0298d97d1ba003cdb17146601c9 | 3,899 | py | Python | src/configurator.py | mnuyens/forseti2 | 3c6d76ffac2b64d51f03d3922e3b388a4e35f1a8 | [
"Apache-2.0"
] | 1 | 2015-03-07T04:48:53.000Z | 2015-03-07T04:48:53.000Z | src/configurator.py | mnuyens/forseti2 | 3c6d76ffac2b64d51f03d3922e3b388a4e35f1a8 | [
"Apache-2.0"
] | null | null | null | src/configurator.py | mnuyens/forseti2 | 3c6d76ffac2b64d51f03d3922e3b388a4e35f1a8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
"""
configurator.py
Created on Sat Apr 27 12:00:00 2013
@author: kyle
reads from various resource files stored on disk.
sends configs to PiEMOS controller, via channels PiEMOS{n}/Config
these configs contain RFID mappings and the PiEMOS layout configuration.
example ... | 30.700787 | 143 | 0.638882 |
from __future__ import print_function
import argparse
import csv
import lcm
import os
import os.path
import time
from forseti2 import *
import settings
config_dir = '../configs'
team_nums_to_names = {}
team_csv_filename = '../resources/teams.csv'
def init_team_nums():
team_reader = csv.reader(open(team_csv_... | true | true |
1c28ae977015fd2ce3a5a1078c830090f518ce70 | 11,145 | py | Python | tools/python/run_micro.py | zhangzhimin/mace | c28f093d719fd650a4308895cd045c26d0f198f6 | [
"Apache-2.0"
] | 1 | 2021-08-02T12:17:58.000Z | 2021-08-02T12:17:58.000Z | tools/python/run_micro.py | zhangzhimin/mace | c28f093d719fd650a4308895cd045c26d0f198f6 | [
"Apache-2.0"
] | null | null | null | tools/python/run_micro.py | zhangzhimin/mace | c28f093d719fd650a4308895cd045c26d0f198f6 | [
"Apache-2.0"
] | 1 | 2021-08-02T12:18:00.000Z | 2021-08-02T12:18:00.000Z | # Copyright 2020 The MACE Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 37.399329 | 77 | 0.624136 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import copy
import numpy as np
import shutil
import tempfile
from micro_converter import MicroConverter
from py_proto import mace_pb2
import run_target
from utils import util
from... | true | true |
1c28af0cd9da4129ee6dee095ff353c2d2eea731 | 2,436 | py | Python | simulations/Time-uniform/simulations.py | WannabeSmith/betting-paper-simulations | 00a6d870c5d619add22b9710b9b43bb84df5d0c6 | [
"BSD-3-Clause"
] | null | null | null | simulations/Time-uniform/simulations.py | WannabeSmith/betting-paper-simulations | 00a6d870c5d619add22b9710b9b43bb84df5d0c6 | [
"BSD-3-Clause"
] | null | null | null | simulations/Time-uniform/simulations.py | WannabeSmith/betting-paper-simulations | 00a6d870c5d619add22b9710b9b43bb84df5d0c6 | [
"BSD-3-Clause"
] | null | null | null | import sys
import os
sys.path.append(os.path.relpath("../../"))
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import binom
from scipy.stats import beta
from scipy.stats import multinomial
import matplotlib.cm as cm
from confseq.cs_plots import ConfseqToPlot, DataGeneratingProcess, plot_CSs
from ... | 28 | 75 | 0.574302 | import sys
import os
sys.path.append(os.path.relpath("../../"))
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import binom
from scipy.stats import beta
from scipy.stats import multinomial
import matplotlib.cm as cm
from confseq.cs_plots import ConfseqToPlot, DataGeneratingProcess, plot_CSs
from ... | true | true |
1c28af522eb21fdcb512483bf9a02b9da7a07c10 | 350 | py | Python | secondLargestAnotherTry.py | ucsb-cs8-m17/Lecture13_0906 | 9ac5541a933f5fcc120c86c661c7cad0a1d07106 | [
"MIT"
] | null | null | null | secondLargestAnotherTry.py | ucsb-cs8-m17/Lecture13_0906 | 9ac5541a933f5fcc120c86c661c7cad0a1d07106 | [
"MIT"
] | null | null | null | secondLargestAnotherTry.py | ucsb-cs8-m17/Lecture13_0906 | 9ac5541a933f5fcc120c86c661c7cad0a1d07106 | [
"MIT"
] | null | null | null |
def secondLargest(anIntList):
" return second largest int"
# localCopy is a local variable
# but does it affect anInList
localCopy = anIntList
localCopy.sort()
return localCopy[-2]
def test_secondLargest_1():
assert secondLargest([3,7,2,9,1])==7
def test_secondLargest_2():
assert... | 21.875 | 40 | 0.68 |
def secondLargest(anIntList):
localCopy = anIntList
localCopy.sort()
return localCopy[-2]
def test_secondLargest_1():
assert secondLargest([3,7,2,9,1])==7
def test_secondLargest_2():
assert secondLargest([4,10,2,6])==6
| true | true |
1c28b0219529375020614baf21ac85fd7d264ed9 | 64,611 | py | Python | mindspore/nn/layer/quant.py | huxian123/mindspore | ec5ba10c82bbd6eccafe32d3a1149add90105bc8 | [
"Apache-2.0"
] | null | null | null | mindspore/nn/layer/quant.py | huxian123/mindspore | ec5ba10c82bbd6eccafe32d3a1149add90105bc8 | [
"Apache-2.0"
] | null | null | null | mindspore/nn/layer/quant.py | huxian123/mindspore | ec5ba10c82bbd6eccafe32d3a1149add90105bc8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 46.282951 | 119 | 0.549473 |
from functools import partial
import numpy as np
from mindspore import nn
import mindspore.common.dtype as mstype
from mindspore.ops import operations as P
from mindspore.ops import functional as F
from mindspore.common.parameter import Parameter
from mindspore.common.initializer import initializer
from... | true | true |
1c28b0679058bff377db10517b2053f6a8fd4b99 | 11,157 | py | Python | openrouteservice/directions.py | ricardodani/openrouteservice-py | e8eb1e0ad4e13c810440c087512080b9ecf809b5 | [
"Apache-2.0"
] | 1 | 2020-04-09T21:06:15.000Z | 2020-04-09T21:06:15.000Z | openrouteservice/directions.py | ricardodani/openrouteservice-py | e8eb1e0ad4e13c810440c087512080b9ecf809b5 | [
"Apache-2.0"
] | null | null | null | openrouteservice/directions.py | ricardodani/openrouteservice-py | e8eb1e0ad4e13c810440c087512080b9ecf809b5 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2014 Google Inc. All rights reserved.
#
# Modifications Copyright (C) 2018 HeiGIT, University of Heidelberg.
#
#
# 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... | 37.820339 | 120 | 0.674106 |
from openrouteservice import deprecation
from openrouteservice.optimization import optimization, Job, Vehicle
import warnings
def directions(client,
coordinates,
profile='driving-car',
format_out=None,
format='json',
prefe... | true | true |
1c28b097cd29fd70bb690a579294c01561ea760d | 1,609 | py | Python | weatherapp/core/tests/unit/test_commandmanager.py | midasinc/weatherapp.core | 583f4687ba706d8159a506e844d7630645f39f07 | [
"MIT"
] | null | null | null | weatherapp/core/tests/unit/test_commandmanager.py | midasinc/weatherapp.core | 583f4687ba706d8159a506e844d7630645f39f07 | [
"MIT"
] | null | null | null | weatherapp/core/tests/unit/test_commandmanager.py | midasinc/weatherapp.core | 583f4687ba706d8159a506e844d7630645f39f07 | [
"MIT"
] | 1 | 2019-01-28T17:22:09.000Z | 2019-01-28T17:22:09.000Z | """ Unit tests for CommandManager class """
import unittest
from weatherapp.core.commandmanager import CommandManager
class AnyCommand:
"""Class for tests"""
pass
class CommandManagerTestCase(unittest.TestCase):
"""Unit test case for command manager"""
def setUp(self):
"""Contain set up i... | 28.732143 | 73 | 0.663766 |
import unittest
from weatherapp.core.commandmanager import CommandManager
class AnyCommand:
pass
class CommandManagerTestCase(unittest.TestCase):
def setUp(self):
self.command_manager = CommandManager()
self.command_manager.add('any', AnyCommand)
def test_add(self):
message ... | true | true |
1c28b10a17b09bf0a10d5b9d2f947fae098db4e4 | 40,103 | py | Python | lib/sqlalchemy/ext/associationproxy.py | seddonym/sqlalchemy | 7405392299492c83e6fa1546d3b36f52042e3c5e | [
"MIT"
] | null | null | null | lib/sqlalchemy/ext/associationproxy.py | seddonym/sqlalchemy | 7405392299492c83e6fa1546d3b36f52042e3c5e | [
"MIT"
] | null | null | null | lib/sqlalchemy/ext/associationproxy.py | seddonym/sqlalchemy | 7405392299492c83e6fa1546d3b36f52042e3c5e | [
"MIT"
] | null | null | null | # ext/associationproxy.py
# Copyright (C) 2005-2018 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Contain the ``AssociationProxy`` class.
The ``AssociationProxy`` is a Py... | 32.263073 | 86 | 0.60796 |
import operator
from .. import exc, orm, util
from ..orm import collections, interfaces
from ..sql import or_
from .. import inspect
def association_proxy(target_collection, attr, **kw):
return AssociationProxy(target_collection, attr, **kw)
ASSOCIATION_PROXY = util.symbol('ASSOCIATION_PROXY')
class As... | true | true |
1c28b207c2d97215d4951b9405fc5e3b709baf3b | 3,937 | py | Python | st2common/st2common/models/db/action.py | kkkanil/st2 | 07cd195d7a6e177a37dd019e5c9ab8329259d0fa | [
"Apache-2.0"
] | null | null | null | st2common/st2common/models/db/action.py | kkkanil/st2 | 07cd195d7a6e177a37dd019e5c9ab8329259d0fa | [
"Apache-2.0"
] | 15 | 2021-02-11T22:58:54.000Z | 2021-08-06T18:03:47.000Z | st2common/st2common/models/db/action.py | kkkanil/st2 | 07cd195d7a6e177a37dd019e5c9ab8329259d0fa | [
"Apache-2.0"
] | 1 | 2021-07-10T15:02:29.000Z | 2021-07-10T15:02:29.000Z | # Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme 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 ... | 34.840708 | 80 | 0.710439 |
from __future__ import absolute_import
import mongoengine as me
from st2common import log as logging
from st2common.models.db import MongoDBAccess
from st2common.models.db import stormbase
from st2common.models.db.actionalias import ActionAliasDB
from st2common.models.db.executionstate import ActionExec... | true | true |
1c28b3262c1166a5bd131d93dd3aaea274c13f6b | 322 | py | Python | tests/test.py | mitchute/ES2 | 7fbc818874da504d9e71a6649a2da5f20bb4325a | [
"MIT"
] | null | null | null | tests/test.py | mitchute/ES2 | 7fbc818874da504d9e71a6649a2da5f20bb4325a | [
"MIT"
] | null | null | null | tests/test.py | mitchute/ES2 | 7fbc818874da504d9e71a6649a2da5f20bb4325a | [
"MIT"
] | null | null | null | import unittest
from src.functions import add, get_cp, mult
class TestClass(unittest.TestCase):
def test_add(self):
self.assertEqual(add(1, 1), 2)
def test_mult(self):
self.assertEqual(mult(3, 4), 12)
def test_get_cp(self):
self.assertAlmostEqual(get_cp(20), 4183.99, delta=1E-2... | 20.125 | 63 | 0.667702 | import unittest
from src.functions import add, get_cp, mult
class TestClass(unittest.TestCase):
def test_add(self):
self.assertEqual(add(1, 1), 2)
def test_mult(self):
self.assertEqual(mult(3, 4), 12)
def test_get_cp(self):
self.assertAlmostEqual(get_cp(20), 4183.99, delta=1E-2... | true | true |
1c28b4d99ab3282fa27568ddb2ffff837426abe7 | 19,578 | py | Python | Cryptography/Rotation-Ciphers/pygenere.py | hacky1997/My-Gray-Hacker-Resources | e9b10ac7b0e557a9e624a5a6e761f9af4488d777 | [
"MIT"
] | 14 | 2017-06-14T06:10:07.000Z | 2019-02-22T03:21:15.000Z | Cryptography/Rotation-Ciphers/pygenere.py | rookie-12/My-Gray-Hacker-Resources | e9b10ac7b0e557a9e624a5a6e761f9af4488d777 | [
"MIT"
] | 1 | 2021-04-30T21:19:32.000Z | 2021-04-30T21:19:32.000Z | Cryptography/Rotation-Ciphers/pygenere.py | rookie-12/My-Gray-Hacker-Resources | e9b10ac7b0e557a9e624a5a6e761f9af4488d777 | [
"MIT"
] | 7 | 2015-10-01T09:47:05.000Z | 2022-01-21T14:25:37.000Z | # PyGenere v 0.3
#
# Release Date: 2007-02-16
# Author: Simon Liu <webmonkey at smurfoncrack dot com>
# URL: http://smurfoncrack.com/pygenere
# History and License at end of file
r"""
This library implements the Caesar and Vigenere ciphers, allowing a piece of
plaintext to be encoded using a numeric rotation or an al... | 41.044025 | 80 | 0.599091 |
class Caesar(str):
def encipher(self, shift):
ciphertext = []
for p in self:
if p.isalpha():
ciphertext.append(chr((ord(p) - ord('Aa'[int(p.islower())]) +
shift) % 26 + ord('Aa'[int(p.islower())])))
else:
ciphertext.... | true | true |
1c28b5709acd0bed7d725068f89856479a819ce7 | 7,967 | py | Python | scale/ingest/scan/configuration/json/configuration_v6.py | kaydoh/scale | 1b6a3b879ffe83e10d3b9d9074835a4c3bf476ee | [
"Apache-2.0"
] | 121 | 2015-11-18T18:15:33.000Z | 2022-03-10T01:55:00.000Z | scale/ingest/scan/configuration/json/configuration_v6.py | kaydoh/scale | 1b6a3b879ffe83e10d3b9d9074835a4c3bf476ee | [
"Apache-2.0"
] | 1,415 | 2015-12-23T23:36:04.000Z | 2022-01-07T14:10:09.000Z | scale/ingest/scan/configuration/json/configuration_v6.py | kaydoh/scale | 1b6a3b879ffe83e10d3b9d9074835a4c3bf476ee | [
"Apache-2.0"
] | 66 | 2015-12-03T20:38:56.000Z | 2020-07-27T15:28:11.000Z | """Manages the v6 batch configuration schema"""
from __future__ import unicode_literals
import logging
import os
import re
from jsonschema import validate
from jsonschema.exceptions import ValidationError
from ingest.handlers.file_handler import FileHandler
from ingest.handlers.file_rule import FileRule
from ingest.... | 36.049774 | 118 | 0.597339 | from __future__ import unicode_literals
import logging
import os
import re
from jsonschema import validate
from jsonschema.exceptions import ValidationError
from ingest.handlers.file_handler import FileHandler
from ingest.handlers.file_rule import FileRule
from ingest.scan.configuration.scan_configuration import Sca... | true | true |
1c28b724239c8b3605dad77a13b9811449090d0f | 3,584 | py | Python | exemples/exemple-lecteur-fnc-snc.py | aurmarsan/pyturbo | b4f1c6e535b816fbb51b142f7a694aac9ff9b088 | [
"MIT"
] | 1 | 2018-03-23T13:33:23.000Z | 2018-03-23T13:33:23.000Z | exemples/exemple-lecteur-fnc-snc.py | aurmarsan/pyturbo | b4f1c6e535b816fbb51b142f7a694aac9ff9b088 | [
"MIT"
] | null | null | null | exemples/exemple-lecteur-fnc-snc.py | aurmarsan/pyturbo | b4f1c6e535b816fbb51b142f7a694aac9ff9b088 | [
"MIT"
] | null | null | null | import numpy, scipy
import pyturbo as p
######################################
# pour lire un fichier surface SNC
path_snc = "indiquer.snc"
r = p.LecteurSNC(file_path = path_snc)
r.lire_parametres()
r.get_infos_temporelles() # ca affiche des trucs
r.get_infos_variables() # ca affiche d'autres trucs
# on peut lire le... | 44.8 | 139 | 0.729911 | import numpy, scipy
import pyturbo as p
1 le stator. On peut aussi laisse numbloc=None pour lire rotor et stator.
# ici on lit 'p' a la frame temporelle 10. On tourne le rotor pour le placer en position. On ajouter les faces_id qui peuvent
# etre bien pratique pour afficher seulement des morceaux de la surface (hub,... | true | true |
1c28b7270576c8598e3104501ba72b7520ba1642 | 2,148 | py | Python | mac/google-cloud-sdk/lib/surface/recommender/__init__.py | bopopescu/cndw | ee432efef88a4351b355f3d6d5350defc7f4246b | [
"Apache-2.0"
] | null | null | null | mac/google-cloud-sdk/lib/surface/recommender/__init__.py | bopopescu/cndw | ee432efef88a4351b355f3d6d5350defc7f4246b | [
"Apache-2.0"
] | null | null | null | mac/google-cloud-sdk/lib/surface/recommender/__init__.py | bopopescu/cndw | ee432efef88a4351b355f3d6d5350defc7f4246b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*- #
# Copyright 2019 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 39.777778 | 78 | 0.781192 |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.calliope import base
@base.ReleaseTracks(base.ReleaseTrack.ALPHA,
base.ReleaseTrack.BETA)
class Recommender(base.Group):
category = base.API_PLATFOR... | true | true |
1c28b76373ea126f62e0acce3def88a8a0e98544 | 224 | py | Python | day_saint_ksaver.py | webkadiz/olympiad-problems | 620912815904c0f95b91ccd193ca3db0ea20e507 | [
"MIT"
] | null | null | null | day_saint_ksaver.py | webkadiz/olympiad-problems | 620912815904c0f95b91ccd193ca3db0ea20e507 | [
"MIT"
] | null | null | null | day_saint_ksaver.py | webkadiz/olympiad-problems | 620912815904c0f95b91ccd193ca3db0ea20e507 | [
"MIT"
] | null | null | null | beg, end = map(int, input().split())
if end < 1605:
print(0)
elif beg < 1605:
rang = end - 1605
print(rang // 10 + 1)
else:
rang = end - beg
ans = rang // 10 + 1
if beg % 5 == 0:
ans -= 1
print(ans)
| 12.444444 | 36 | 0.508929 | beg, end = map(int, input().split())
if end < 1605:
print(0)
elif beg < 1605:
rang = end - 1605
print(rang // 10 + 1)
else:
rang = end - beg
ans = rang // 10 + 1
if beg % 5 == 0:
ans -= 1
print(ans)
| true | true |
1c28b7c1c900b457a4b55f062b61022e5ce3d743 | 6,594 | py | Python | packnet-sfm/packnet_sfm/utils/load.py | Fatmangh/VIDEO-ACTION-CLASSIFICATION-USING-PRETAINED-SELF-SUPERVISED-DEPTH-AWARE-DENSE-PREDICTIVE-CODING- | 13fac05601efed16ae8b29989aad487e04cd90a7 | [
"MIT"
] | null | null | null | packnet-sfm/packnet_sfm/utils/load.py | Fatmangh/VIDEO-ACTION-CLASSIFICATION-USING-PRETAINED-SELF-SUPERVISED-DEPTH-AWARE-DENSE-PREDICTIVE-CODING- | 13fac05601efed16ae8b29989aad487e04cd90a7 | [
"MIT"
] | null | null | null | packnet-sfm/packnet_sfm/utils/load.py | Fatmangh/VIDEO-ACTION-CLASSIFICATION-USING-PRETAINED-SELF-SUPERVISED-DEPTH-AWARE-DENSE-PREDICTIVE-CODING- | 13fac05601efed16ae8b29989aad487e04cd90a7 | [
"MIT"
] | null | null | null | # Copyright 2020 Toyota Research Institute. All rights reserved.
import importlib
import logging
import os
import warnings
import torch
from inspect import signature
from collections import OrderedDict
import sys
sys.path.append('../packnet-sfm/packnet_sfm/utils')
sys.path.append('../packnet-sfm/configs')
sys.path.... | 30.527778 | 96 | 0.634213 |
import importlib
import logging
import os
import warnings
import torch
from inspect import signature
from collections import OrderedDict
import sys
sys.path.append('../packnet-sfm/packnet_sfm/utils')
sys.path.append('../packnet-sfm/configs')
sys.path.append('../packnet-sfm/packnet_sfm/models')
sys.path.append('../p... | true | true |
1c28b886b71efddda412690d02a2991097e84394 | 2,245 | py | Python | openstack/tests/functional/network/v2/test_rbac_policy.py | teresa-ho/stx-openstacksdk | 7d723da3ffe9861e6e9abcaeadc1991689f782c5 | [
"Apache-2.0"
] | 43 | 2018-12-19T08:39:15.000Z | 2021-07-21T02:45:43.000Z | openstack/tests/functional/network/v2/test_rbac_policy.py | teresa-ho/stx-openstacksdk | 7d723da3ffe9861e6e9abcaeadc1991689f782c5 | [
"Apache-2.0"
] | 11 | 2019-03-17T13:28:56.000Z | 2020-09-23T23:57:50.000Z | openstack/tests/functional/network/v2/test_rbac_policy.py | teresa-ho/stx-openstacksdk | 7d723da3ffe9861e6e9abcaeadc1991689f782c5 | [
"Apache-2.0"
] | 47 | 2018-12-19T05:14:25.000Z | 2022-03-19T15:28:30.000Z | # 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, software
# distributed under t... | 34.538462 | 75 | 0.641871 |
import uuid
from openstack.network.v2 import network
from openstack.network.v2 import rbac_policy
from openstack.tests.functional import base
class TestRBACPolicy(base.BaseFunctionalTest):
NET_NAME = 'net-' + uuid.uuid4().hex
UPDATE_NAME = uuid.uuid4().hex
ACTION = 'access_as_shared'
OBJ... | true | true |
1c28b8ac26759210343759d4ce8e96e73a113e7b | 6,481 | py | Python | sympy/polys/domains/fractionfield.py | tesseralis/sympy | 0c2f7e06b1a43d25ba93bac65e93f8d5f323be7a | [
"BSD-3-Clause"
] | 1 | 2020-11-17T07:35:20.000Z | 2020-11-17T07:35:20.000Z | sympy/polys/domains/fractionfield.py | tesseralis/sympy | 0c2f7e06b1a43d25ba93bac65e93f8d5f323be7a | [
"BSD-3-Clause"
] | null | null | null | sympy/polys/domains/fractionfield.py | tesseralis/sympy | 0c2f7e06b1a43d25ba93bac65e93f8d5f323be7a | [
"BSD-3-Clause"
] | null | null | null | """Implementation of :class:`FractionField` class. """
from sympy.polys.domains.field import Field
from sympy.polys.domains.compositedomain import CompositeDomain
from sympy.polys.domains.characteristiczero import CharacteristicZero
from sympy.polys.polyclasses import DMF
from sympy.polys.polyerrors import Generators... | 33.235897 | 94 | 0.573985 |
from sympy.polys.domains.field import Field
from sympy.polys.domains.compositedomain import CompositeDomain
from sympy.polys.domains.characteristiczero import CharacteristicZero
from sympy.polys.polyclasses import DMF
from sympy.polys.polyerrors import GeneratorsNeeded
from sympy.polys.polyutils import dict_from_basi... | true | true |
1c28b9973a1faf5e55bce35a36a2f269038de169 | 2,431 | py | Python | grs/twseopen.py | toomore/goristock | e61f57f11a626cfbc4afbf66337fd9d1c51e3e71 | [
"MIT"
] | 30 | 2015-02-13T06:30:10.000Z | 2021-03-04T08:01:46.000Z | grs/twseopen.py | toomore/goristock | e61f57f11a626cfbc4afbf66337fd9d1c51e3e71 | [
"MIT"
] | 1 | 2018-08-03T15:08:26.000Z | 2018-08-03T15:08:26.000Z | grs/twseopen.py | toomore/goristock | e61f57f11a626cfbc4afbf66337fd9d1c51e3e71 | [
"MIT"
] | 11 | 2015-02-27T03:55:11.000Z | 2020-07-09T09:36:58.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2010,2011 Toomore Chiang, http://toomore.net/
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including wi... | 32.851351 | 79 | 0.648293 |
from cttwt import TWTime
import csv
from datetime import datetime
_CSVFILEPATH = __name__.split('.')[-2]
class twseopen(object):
def __init__(self, time):
if type(TWTime().now) == type(time):
self.twtime = TWTime().now
elif type(TWTime().date) == type(time):
self.twtime = TW... | true | true |
1c28bb3905df34f0cdc6430f6373b04f16d574d2 | 3,643 | py | Python | evaluate.py | Yanshang1991/FastSpeech2 | c289d86c8560ebca8aeca61a62b79b22b9e708e4 | [
"MIT"
] | null | null | null | evaluate.py | Yanshang1991/FastSpeech2 | c289d86c8560ebca8aeca61a62b79b22b9e708e4 | [
"MIT"
] | null | null | null | evaluate.py | Yanshang1991/FastSpeech2 | c289d86c8560ebca8aeca61a62b79b22b9e708e4 | [
"MIT"
] | 1 | 2021-12-08T08:36:24.000Z | 2021-12-08T08:36:24.000Z | import argparse
import os
import torch
import yaml
import torch.nn as nn
from torch.utils.data import DataLoader
from utils.model import get_model, get_vocoder
from utils.tools import to_device, log, synth_one_sample
from model import FastSpeech2Loss
from dataset import Dataset
device = torch.device("... | 30.358333 | 171 | 0.588251 | import argparse
import os
import torch
import yaml
import torch.nn as nn
from torch.utils.data import DataLoader
from utils.model import get_model, get_vocoder
from utils.tools import to_device, log, synth_one_sample
from model import FastSpeech2Loss
from dataset import Dataset
device = torch.device("... | true | true |
1c28bb7051716d6a152e37585ee8458d398d2f64 | 668 | py | Python | twitchwatcher/__init__.py | MOZGIII/twitch | 77a39e8e7b8104717553efeebc05489301eaaf96 | [
"MIT"
] | null | null | null | twitchwatcher/__init__.py | MOZGIII/twitch | 77a39e8e7b8104717553efeebc05489301eaaf96 | [
"MIT"
] | null | null | null | twitchwatcher/__init__.py | MOZGIII/twitch | 77a39e8e7b8104717553efeebc05489301eaaf96 | [
"MIT"
] | null | null | null | import sys
import os
def usage():
"""Print usage info and exit the app"""
print("Usage: %s [stream_name | http://stream_url]" % sys.argv[0])
sys.exit(2)
def normalize_stream_url(stream_url):
"""Makes a twitch stream url from a stream name (leaves urls as is)"""
if stream_url.startswith("http://") ... | 29.043478 | 77 | 0.640719 | import sys
import os
def usage():
print("Usage: %s [stream_name | http://stream_url]" % sys.argv[0])
sys.exit(2)
def normalize_stream_url(stream_url):
if stream_url.startswith("http://") or stream_url.startswith("https://"):
return stream_url
return "http://twitch.tv/%s" % stream_url
def main... | true | true |
1c28bb9c33d61ce9423c8d6144a7008d0f00255c | 1,523 | py | Python | yawast/external/total_size.py | Prodject/yawast | 044309709cf3782de75a35f77297f2d2850d8e1c | [
"BSD-3-Clause"
] | 200 | 2016-02-06T17:14:03.000Z | 2022-03-14T00:50:25.000Z | yawast/external/total_size.py | Prodject/yawast | 044309709cf3782de75a35f77297f2d2850d8e1c | [
"BSD-3-Clause"
] | 341 | 2016-02-06T21:53:47.000Z | 2021-09-27T22:40:25.000Z | yawast/external/total_size.py | Prodject/yawast | 044309709cf3782de75a35f77297f2d2850d8e1c | [
"BSD-3-Clause"
] | 68 | 2016-02-17T08:10:47.000Z | 2021-05-27T23:26:07.000Z | # From: https://github.com/ActiveState/recipe-577504-compute-mem-footprint
# License: MIT
# Copyright: Raymond Hettinger
from collections import deque
from itertools import chain
from sys import getsizeof
def total_size(o, handlers=None):
""" Returns the approximate memory footprint an object and all of its cont... | 32.404255 | 83 | 0.64872 |
from collections import deque
from itertools import chain
from sys import getsizeof
def total_size(o, handlers=None):
if handlers is None:
handlers = {}
dict_handler = lambda d: chain.from_iterable(d.items())
all_handlers = {
tuple: iter,
list: iter,
deque: iter,
... | true | true |
1c28bbd406c03d3e114acd7cb112486f704a73ec | 1,027 | py | Python | tests/conftest.py | armills/aioautomatic | 346666868f35308dd6edd8a1fffb4c4f0d0ba2da | [
"Apache-2.0"
] | 8 | 2017-04-16T01:16:31.000Z | 2019-06-07T07:16:26.000Z | tests/conftest.py | armills/aioautomatic | 346666868f35308dd6edd8a1fffb4c4f0d0ba2da | [
"Apache-2.0"
] | 5 | 2017-04-24T02:33:15.000Z | 2019-10-16T21:30:04.000Z | tests/conftest.py | armills/aioautomatic | 346666868f35308dd6edd8a1fffb4c4f0d0ba2da | [
"Apache-2.0"
] | 4 | 2017-04-24T02:06:27.000Z | 2018-12-11T19:16:26.000Z | """Common fixtures for tests."""
from aioautomatic.client import Client
from aioautomatic.session import Session
import pytest
from tests.common import AsyncMock, SessionMock
@pytest.fixture
def aiohttp_session(event_loop):
"""Create a mock aiohttp session object."""
session = SessionMock()
session.loop ... | 26.333333 | 76 | 0.685492 | from aioautomatic.client import Client
from aioautomatic.session import Session
import pytest
from tests.common import AsyncMock, SessionMock
@pytest.fixture
def aiohttp_session(event_loop):
session = SessionMock()
session.loop = event_loop
yield session
@pytest.fixture
def client(aiohttp_session):
... | true | true |
1c28bc4d3db995a30c9b6346d8cfc55165bb77b7 | 3,951 | py | Python | lib/services/server/ncloud_server/model/get_root_password_server_instance_list_request.py | NaverCloudPlatform/ncloud-sdk-python | 5976dfabd205c615fcf57ac2f0ab67313ee6953c | [
"MIT"
] | 12 | 2018-11-20T04:30:49.000Z | 2021-11-09T12:34:26.000Z | lib/services/server/ncloud_server/model/get_root_password_server_instance_list_request.py | NaverCloudPlatform/ncloud-sdk-python | 5976dfabd205c615fcf57ac2f0ab67313ee6953c | [
"MIT"
] | 1 | 2019-01-24T15:56:15.000Z | 2019-05-31T07:56:55.000Z | lib/services/server/ncloud_server/model/get_root_password_server_instance_list_request.py | NaverCloudPlatform/ncloud-sdk-python | 5976dfabd205c615fcf57ac2f0ab67313ee6953c | [
"MIT"
] | 6 | 2018-06-29T03:45:50.000Z | 2022-03-18T01:51:45.000Z | # coding: utf-8
"""
server
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from ncloud_server.model.root_password_server_instance_parameter import RootPasswordServerInstanceParameter # noqa: F401,E501
class GetRootPasswordServer... | 34.356522 | 153 | 0.656796 |
import pprint
import re
import six
from ncloud_server.model.root_password_server_instance_parameter import RootPasswordServerInstanceParameter
class GetRootPasswordServerInstanceListRequest(object):
swagger_types = {
'root_password_server_instance_list': 'list[RootPasswordServerInstanceParamete... | true | true |
1c28bc758e7a30f3302e0f1c676353a83588dcec | 4,886 | py | Python | src/geomagindices/io.py | space-physics/geomag-indices | c989f7df05ac1082f7347cd32cfee7a916e3b30d | [
"MIT"
] | 10 | 2019-07-24T02:15:29.000Z | 2022-03-17T11:40:57.000Z | src/geomagindices/io.py | space-physics/geomag-indices | c989f7df05ac1082f7347cd32cfee7a916e3b30d | [
"MIT"
] | 5 | 2019-10-31T14:10:39.000Z | 2022-03-28T19:10:40.000Z | src/geomagindices/io.py | scivision/geomag-indices | c989f7df05ac1082f7347cd32cfee7a916e3b30d | [
"MIT"
] | 3 | 2020-08-04T12:50:08.000Z | 2021-11-27T18:44:04.000Z | from __future__ import annotations
from pathlib import Path
import pandas
import numpy as np
from datetime import datetime, timedelta
from dateutil.parser import parse
from .web import URLmonthly, URL45dayfcast, URL20yearfcast
from .utils import yeardec2datetime
def load(flist: Path | list[Path]) -> pandas.DataFrame... | 31.522581 | 108 | 0.556897 | from __future__ import annotations
from pathlib import Path
import pandas
import numpy as np
from datetime import datetime, timedelta
from dateutil.parser import parse
from .web import URLmonthly, URL45dayfcast, URL20yearfcast
from .utils import yeardec2datetime
def load(flist: Path | list[Path]) -> pandas.DataFrame... | true | true |
1c28bd0706d84a0680df278adb2d2817dd017b9d | 4,035 | py | Python | datumaro/plugins/accuracy_checker_plugin/details/ac.py | shivam124081/datumaro | 3aa8842a3649ec8e05c0bfe042794823375b812b | [
"MIT"
] | null | null | null | datumaro/plugins/accuracy_checker_plugin/details/ac.py | shivam124081/datumaro | 3aa8842a3649ec8e05c0bfe042794823375b812b | [
"MIT"
] | null | null | null | datumaro/plugins/accuracy_checker_plugin/details/ac.py | shivam124081/datumaro | 3aa8842a3649ec8e05c0bfe042794823375b812b | [
"MIT"
] | null | null | null | # Copyright (C) 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
from datumaro.util.tf_util import import_tf
import_tf() # prevent TF loading and potential interpeter crash
from itertools import groupby
from accuracy_checker.adapters import create_adapter
from accuracy_checker.data_readers import DataRepres... | 32.02381 | 87 | 0.657497 |
from datumaro.util.tf_util import import_tf
import_tf()
from itertools import groupby
from accuracy_checker.adapters import create_adapter
from accuracy_checker.data_readers import DataRepresentation
from accuracy_checker.launcher import InputFeeder, create_launcher
from accuracy_checker.postprocessor import P... | true | true |
1c28bdeb67750462bea0906016337e015e5fd358 | 2,872 | py | Python | tests/test_hivemind.py | mccartnm/robx | ee1a2fc6239df170d487ab42c7c350a5272e66a8 | [
"MIT"
] | null | null | null | tests/test_hivemind.py | mccartnm/robx | ee1a2fc6239df170d487ab42c7c350a5272e66a8 | [
"MIT"
] | 2 | 2019-09-08T20:15:11.000Z | 2019-10-04T00:45:58.000Z | tests/test_hivemind.py | mccartnm/hivemind | ee1a2fc6239df170d487ab42c7c350a5272e66a8 | [
"MIT"
] | null | null | null | import os
import sys
import unittest
import argparse
import threading
# Make sure we can import hivemind proper
TEST_BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.dirname(TEST_BASE_DIR))
from hivemind import RootController, _Node
from hivemind.core import log
from hivemind.util import... | 29.010101 | 98 | 0.58461 | import os
import sys
import unittest
import argparse
import threading
TEST_BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.dirname(TEST_BASE_DIR))
from hivemind import RootController, _Node
from hivemind.core import log
from hivemind.util import global_settings
from hivemind.util.misc ... | true | true |
1c28be118ad72c74b9a5bc8dadafca75d996e2e2 | 147 | py | Python | Beecrowd/Tired/infinity_msg.py | nazmul629/OJ-Problem_Solution | cf5e01ab8cf062441bfe901e12d98cbaa1d727f9 | [
"MIT"
] | null | null | null | Beecrowd/Tired/infinity_msg.py | nazmul629/OJ-Problem_Solution | cf5e01ab8cf062441bfe901e12d98cbaa1d727f9 | [
"MIT"
] | null | null | null | Beecrowd/Tired/infinity_msg.py | nazmul629/OJ-Problem_Solution | cf5e01ab8cf062441bfe901e12d98cbaa1d727f9 | [
"MIT"
] | null | null | null | import pyautogui
import time
while True:
time.sleep(5)
pyautogui.typewrite("I Love You ❤️ ")
time.sleep(2)
pyautogui.press('enter') | 21 | 41 | 0.673469 | import pyautogui
import time
while True:
time.sleep(5)
pyautogui.typewrite("I Love You ❤️ ")
time.sleep(2)
pyautogui.press('enter') | true | true |
1c28beb12efb17d79428d82d9b9be5a926eb0de0 | 4,285 | py | Python | tools/spec-collector.py | Maratyszcza/WebRunner | e7cdb0cb9bb36ea033bcc0a4f629e18d8b3a28b2 | [
"BSD-2-Clause"
] | null | null | null | tools/spec-collector.py | Maratyszcza/WebRunner | e7cdb0cb9bb36ea033bcc0a4f629e18d8b3a28b2 | [
"BSD-2-Clause"
] | null | null | null | tools/spec-collector.py | Maratyszcza/WebRunner | e7cdb0cb9bb36ea033bcc0a4f629e18d8b3a28b2 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
from __future__ import print_function, absolute_import
import os
import sys
import argparse
from spec import read_kernel_specification, Kernel, Parameter, Argument
parser = argparse.ArgumentParser(description="WebRunner Kernel Specification Collector")
parser.add_argument(
"--code", dest="... | 34.007937 | 104 | 0.681214 |
from __future__ import print_function, absolute_import
import os
import sys
import argparse
from spec import read_kernel_specification, Kernel, Parameter, Argument
parser = argparse.ArgumentParser(description="WebRunner Kernel Specification Collector")
parser.add_argument(
"--code", dest="code", required=True,... | true | true |
1c28beb7b5ea9b7970ecef93289f4e7459b5d4ab | 2,766 | py | Python | tools/telemetry/telemetry/user_story/user_story_filter.py | kjthegod/chromium | cf940f7f418436b77e15b1ea23e6fa100ca1c91a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2019-11-28T10:46:52.000Z | 2019-11-28T10:46:52.000Z | tools/telemetry/telemetry/user_story/user_story_filter.py | kjthegod/chromium | cf940f7f418436b77e15b1ea23e6fa100ca1c91a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | tools/telemetry/telemetry/user_story/user_story_filter.py | kjthegod/chromium | cf940f7f418436b77e15b1ea23e6fa100ca1c91a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2015-03-27T11:15:39.000Z | 2016-08-17T14:19:56.000Z | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import optparse
import re
from telemetry.core import command_line
def HasLabelIn(user_story, labels):
return bool(user_story.labels.intersection(labels)... | 34.148148 | 80 | 0.723427 |
import optparse
import re
from telemetry.core import command_line
def HasLabelIn(user_story, labels):
return bool(user_story.labels.intersection(labels))
class UserStoryFilter(command_line.ArgumentHandlerMixIn):
@classmethod
def AddCommandLineArgs(cls, parser):
group = optparse.OptionGroup(parser, '... | true | true |
1c28bff71382acb0cd426e3761c0b52bb7e08335 | 8,109 | py | Python | sh/run_exp.py | DHunte/CodeT5 | dbdadad6f44566c262e9765e6bdad888b7d45293 | [
"BSD-3-Clause"
] | null | null | null | sh/run_exp.py | DHunte/CodeT5 | dbdadad6f44566c262e9765e6bdad888b7d45293 | [
"BSD-3-Clause"
] | null | null | null | sh/run_exp.py | DHunte/CodeT5 | dbdadad6f44566c262e9765e6bdad888b7d45293 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import os
import argparse
def get_cmd(task, sub_task, model_tag, gpu, data_num, bs, lr, source_length, target_length, patience, epoch, warmup,
model_dir, summary_dir, res_fn, max_steps=None, save_steps=None, log_steps=None):
if max_steps is None:
cmd_str = 'bash exp_with_... | 46.872832 | 123 | 0.582933 |
import os
import argparse
def get_cmd(task, sub_task, model_tag, gpu, data_num, bs, lr, source_length, target_length, patience, epoch, warmup,
model_dir, summary_dir, res_fn, max_steps=None, save_steps=None, log_steps=None):
if max_steps is None:
cmd_str = 'bash exp_with_args.sh %s %s %s %d %... | true | true |
1c28c0a4dd1182c44eacbb4a28d78cd77fdcc115 | 3,242 | py | Python | src/test/python/org/o3project/odenos/remoteobject/transport/test_base_message_transport.py | o3project/odenos | 837d0d3d3c37482e843c40c5eeeac10646e68c65 | [
"Apache-2.0"
] | 26 | 2015-02-18T10:22:50.000Z | 2020-06-18T05:07:54.000Z | src/test/python/org/o3project/odenos/remoteobject/transport/test_base_message_transport.py | o3project/odenos | 837d0d3d3c37482e843c40c5eeeac10646e68c65 | [
"Apache-2.0"
] | 45 | 2015-02-20T00:40:45.000Z | 2021-12-14T21:07:57.000Z | src/test/python/org/o3project/odenos/remoteobject/transport/test_base_message_transport.py | o3project/odenos | 837d0d3d3c37482e843c40c5eeeac10646e68c65 | [
"Apache-2.0"
] | 30 | 2015-02-19T02:00:35.000Z | 2017-02-18T15:28:09.000Z | # -*- coding:utf-8 -*-
# Copyright 2015 NEC Corporation. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in compliance with the License... | 32.747475 | 76 | 0.596237 |
from org.o3project.odenos.remoteobject.message.response import Response
from org.o3project.odenos.remoteobject.transport.base_message_transport\
import BaseMessageTransport
import unittest
class RemoteMessageTransportTest(unittest.TestCase):
def setUp(self):
self.target = BaseMessageTransport(
... | true | true |
1c28c0b250b5dcea8efc8fbba6a2501502f8af33 | 48,200 | py | Python | patches_tool/aws_patch/aws_deps/libcloud/test/compute/test_opennebula.py | Hybrid-Cloud/badam | 390ad3a6fc03948008f7c04ed2f9fcc8514cc1eb | [
"Apache-2.0"
] | 2 | 2015-06-15T02:16:33.000Z | 2022-02-23T07:10:38.000Z | patches_tool/aws_patch/aws_deps/libcloud/test/compute/test_opennebula.py | Hybrid-Cloud/badam | 390ad3a6fc03948008f7c04ed2f9fcc8514cc1eb | [
"Apache-2.0"
] | 7 | 2016-05-13T06:39:45.000Z | 2016-05-20T02:55:31.000Z | patches_tool/aws_patch/aws_deps/libcloud/test/compute/test_opennebula.py | Hybrid-Cloud/badam | 390ad3a6fc03948008f7c04ed2f9fcc8514cc1eb | [
"Apache-2.0"
] | 4 | 2015-11-02T04:02:50.000Z | 2021-05-13T17:06:00.000Z | # Copyright 2002-2009, Distributed Systems Architecture Group, Universidad
# Complutense de Madrid (dsa-research.org)
#
# 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 copyr... | 37.833595 | 79 | 0.575996 |
__docformat__ = 'epytext'
import unittest
import sys
from libcloud.utils.py3 import httplib
from libcloud.compute.base import Node, NodeImage, NodeSize, NodeState
from libcloud.compute.drivers.opennebula import OpenNebulaNodeDriver
from libcloud.compute.drivers.opennebula import OpenNeb... | true | true |
1c28c0b8479014624c60e102a556d83293b71b23 | 1,601 | py | Python | alipay/aop/api/domain/AlipayMarketingCardFormtemplateSetModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayMarketingCardFormtemplateSetModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayMarketingCardFormtemplateSetModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.OpenFormFieldDO import OpenFormFieldDO
class AlipayMarketingCardFormtemplateSetModel(object):
def __init__(self):
self._fields = None
self._temp... | 26.683333 | 73 | 0.607121 |
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.OpenFormFieldDO import OpenFormFieldDO
class AlipayMarketingCardFormtemplateSetModel(object):
def __init__(self):
self._fields = None
self._template_id = None
@property
def fields... | true | true |
1c28c1f05a17616c48c2c9512036ec3b1c90bee5 | 1,783 | py | Python | XNATSlicer/XnatSlicerLib/settings/Settings_View.py | QwaddleMan/XNATSlicer | 5aa06e4f2a578898d34cf0ea703963b9556f2da3 | [
"BSD-3-Clause"
] | 4 | 2016-03-03T08:56:52.000Z | 2021-12-10T21:14:58.000Z | XNATSlicer/XnatSlicerLib/settings/Settings_View.py | keithcallenberg/XNATSlicer | 4a8462b2e81984cc114d25fb2b1c981457a11878 | [
"BSD-3-Clause"
] | null | null | null | XNATSlicer/XnatSlicerLib/settings/Settings_View.py | keithcallenberg/XNATSlicer | 4a8462b2e81984cc114d25fb2b1c981457a11878 | [
"BSD-3-Clause"
] | 5 | 2015-04-22T01:53:40.000Z | 2021-03-29T12:14:32.000Z | __author__ = "Sunil Kumar (kumar.sunil.p@gmail.com)"
__copyright__ = "Copyright 2014, Washington University in St. Louis"
__credits__ = ["Sunil Kumar", "Steve Pieper", "Dan Marcus"]
__license__ = "XNAT Software License Agreement " + \
"(see: http://xnat.org/about/license.php)"
__version__ = "2.1.1"
__main... | 27.015152 | 72 | 0.60516 | __author__ = "Sunil Kumar (kumar.sunil.p@gmail.com)"
__copyright__ = "Copyright 2014, Washington University in St. Louis"
__credits__ = ["Sunil Kumar", "Steve Pieper", "Dan Marcus"]
__license__ = "XNAT Software License Agreement " + \
"(see: http://xnat.org/about/license.php)"
__version__ = "2.1.1"
__main... | true | true |
1c28c1f144372b74db75af034c1a5c109cdc8cea | 92,810 | py | Python | pennylane/ops/qubit/parametric_ops.py | MoritzWillmann/pennylane | 2b07d22cfcc6406ba28e5c647062340b240a4ee5 | [
"Apache-2.0"
] | null | null | null | pennylane/ops/qubit/parametric_ops.py | MoritzWillmann/pennylane | 2b07d22cfcc6406ba28e5c647062340b240a4ee5 | [
"Apache-2.0"
] | null | null | null | pennylane/ops/qubit/parametric_ops.py | MoritzWillmann/pennylane | 2b07d22cfcc6406ba28e5c647062340b240a4ee5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-2021 Xanadu Quantum Technologies 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... | 34.348631 | 182 | 0.588105 |
import functools
import math
from operator import matmul
import numpy as np
import pennylane as qml
from pennylane.operation import AnyWires, Operation
from pennylane.ops.qubit.non_parametric_ops import PauliX, PauliY, PauliZ, Hadamard
from pennylane.operation import expand_matrix
from pennylane.utils ... | true | true |
1c28c26dc1496f965dbfc961b7c9c2bb8d369ebd | 909 | py | Python | RPi/Python/Pi_Serial.py | UdayanSinha/Code_Blocks | 43c010dcfb587942b6e6f8ba72b93862042afa1d | [
"MIT"
] | 3 | 2016-10-30T05:54:44.000Z | 2021-05-17T20:24:42.000Z | RPi/Python/Pi_Serial.py | UdayanSinha/Code_Blocks | 43c010dcfb587942b6e6f8ba72b93862042afa1d | [
"MIT"
] | null | null | null | RPi/Python/Pi_Serial.py | UdayanSinha/Code_Blocks | 43c010dcfb587942b6e6f8ba72b93862042afa1d | [
"MIT"
] | 1 | 2018-10-04T08:20:25.000Z | 2018-10-04T08:20:25.000Z | import serial
from time import sleep
#setup serial comm
port="/dev/ttyACM0" #serial port
serial_arduino=serial.Serial(port, 9600) #start serial comm@9600bps
serial_arduino.flushInput() #clear i/p buffer
try:
while True:
if(serial_arduino.inWaiting()>0): #chec... | 45.45 | 128 | 0.645765 | import serial
from time import sleep
port="/dev/ttyACM0"
serial_arduino=serial.Serial(port, 9600)
serial_arduino.flushInput()
try:
while True:
if(serial_arduino.inWaiting()>0):
input=serial_arduino.readline()
print(input) ... | true | true |
1c28c27b1521d9b4a5433301d4dd213cf92c7796 | 2,923 | py | Python | duke-cs671-fall21-coupon-recommendation/outputs/rules/RF/10_features/numtrees_20/rule_15.py | apcarrik/kaggle | 6e2d4db58017323e7ba5510bcc2598e01a4ee7bf | [
"MIT"
] | null | null | null | duke-cs671-fall21-coupon-recommendation/outputs/rules/RF/10_features/numtrees_20/rule_15.py | apcarrik/kaggle | 6e2d4db58017323e7ba5510bcc2598e01a4ee7bf | [
"MIT"
] | null | null | null | duke-cs671-fall21-coupon-recommendation/outputs/rules/RF/10_features/numtrees_20/rule_15.py | apcarrik/kaggle | 6e2d4db58017323e7ba5510bcc2598e01a4ee7bf | [
"MIT"
] | null | null | null | def findDecision(obj): #obj[0]: Passanger, obj[1]: Time, obj[2]: Coupon, obj[3]: Education, obj[4]: Occupation, obj[5]: Bar, obj[6]: Coffeehouse, obj[7]: Restaurant20to50, obj[8]: Direction_same, obj[9]: Distance
# {"feature": "Passanger", "instances": 51, "metric_value": 0.8479, "depth": 1}
if obj[0]<=1:
# {"featu... | 35.216867 | 212 | 0.545672 | def findDecision(obj):
if obj[0]<=1:
if obj[4]<=7:
if obj[7]>0.0:
if obj[2]>0:
if obj[3]>0:
if obj[9]<=1:
if obj[1]<=0:
if obj[5]<=0.0:
return 'False'
elif obj[5]>0.0:
return 'True'
else: return 'True'
... | true | true |
1c28c37d8224373ff2f35c14791d856de1a07c96 | 1,237 | py | Python | python/advanced_sw/res_code/scrap2.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/advanced_sw/res_code/scrap2.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/advanced_sw/res_code/scrap2.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | '''
Note :: some songs donot have JSON, cannot be downloaded!
__author__ : Jimut Bahan Pal
__date__ : June 11 2018
'''
import urllib.request, urllib.parse, urllib.error
from bs4 import BeautifulSoup
import ssl
import re
# Ignore SSL certificate errors
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx... | 24.74 | 94 | 0.703314 | import urllib.request, urllib.parse, urllib.error
from bs4 import BeautifulSoup
import ssl
import re
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
id1 = input('Enter the song id :- ')
url = 'https://secure.hungama.com/newTwitter_Audio/audio/index-g.php?songid='+str... | true | true |
1c28c4180fcdda091a41e784b624754434663ffc | 3,848 | py | Python | deepcell/utils/export_utils.py | jackstellwagen/deepcell-tf | d9326b8aceb2f25637e0d3934646da8f6a9f9539 | [
"Apache-2.0"
] | null | null | null | deepcell/utils/export_utils.py | jackstellwagen/deepcell-tf | d9326b8aceb2f25637e0d3934646da8f6a9f9539 | [
"Apache-2.0"
] | null | null | null | deepcell/utils/export_utils.py | jackstellwagen/deepcell-tf | d9326b8aceb2f25637e0d3934646da8f6a9f9539 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016-2019 The Van Valen Lab at the California Institute of
# Technology (Caltech), with support from the Paul Allen Family Foundation,
# Google, & National Institutes of Health (NIH) under Grant U24CA224309-01.
# All rights reserved.
#
# Licensed under a modified Apache License, Version 2.0 (the "License");... | 38.48 | 91 | 0.723753 |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import os
import tensorflow as tf
from tensorflow.python.keras import backend as K
from tensorflow.python.saved_model import tag_constants
from tensorflow.python.saved_model import si... | true | true |
1c28c545acf2bc5590f57cb38c060c37f680a383 | 1,659 | py | Python | dojango/data/modelstore/treestore.py | ofirr/dojango | 9856ca4a0194f59a5fe41cc32739e36eaa1f4bc3 | [
"BSD-3-Clause"
] | 1 | 2016-12-27T09:46:02.000Z | 2016-12-27T09:46:02.000Z | dojango/data/modelstore/treestore.py | ofirr/dojango | 9856ca4a0194f59a5fe41cc32739e36eaa1f4bc3 | [
"BSD-3-Clause"
] | null | null | null | dojango/data/modelstore/treestore.py | ofirr/dojango | 9856ca4a0194f59a5fe41cc32739e36eaa1f4bc3 | [
"BSD-3-Clause"
] | null | null | null | from .stores import Store
from .fields import StoreField
from .methods import BaseMethod
class ChildrenMethod(BaseMethod):
""" A method proxy that will resolve the children
of a model that has a tree structure.
"django-treebeard" and "django-mptt" both attach a get_children method
to the mo... | 37.704545 | 89 | 0.644967 | from .stores import Store
from .fields import StoreField
from .methods import BaseMethod
class ChildrenMethod(BaseMethod):
def get_value(self):
store = self.field.proxied_args['StoreArg']
obj = self.field.proxied_args['ObjectArg']
ret = []
if hasattr(obj, "get_children"):
... | true | true |
1c28c6ae80ad89da2c7346fa0b5411d02705991b | 879 | py | Python | tests/test_settings.py | jjacob7734/incubator-sdap-ningesterpy | b26a22c75b288a524745787f1c8db02a377abc2e | [
"Apache-2.0"
] | 3 | 2018-08-29T04:55:12.000Z | 2021-11-10T19:37:17.000Z | tests/test_settings.py | jjacob7734/incubator-sdap-ningesterpy | b26a22c75b288a524745787f1c8db02a377abc2e | [
"Apache-2.0"
] | 2 | 2018-08-28T15:27:22.000Z | 2020-02-06T00:56:33.000Z | tests/test_settings.py | jjacob7734/incubator-sdap-ningesterpy | b26a22c75b288a524745787f1c8db02a377abc2e | [
"Apache-2.0"
] | 9 | 2018-01-23T01:14:49.000Z | 2021-11-10T19:37:05.000Z | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | 43.95 | 74 | 0.773606 |
SERVER_NAME = '127.0.0.1:0'
ENV = 'development'
PORT_FILE = 'current_port'
CREATE_PORT_FILE = True
| true | true |
1c28c884e51da67e55970095116b1d20bfeef6bf | 1,504 | py | Python | jesse/indicators/macdext.py | leaiannotti/jesse | 564c54845774891ff3b5a8d3c02cc7cea890ac54 | [
"MIT"
] | 5 | 2021-05-21T07:39:16.000Z | 2021-11-17T11:08:41.000Z | jesse/indicators/macdext.py | leaiannotti/jesse | 564c54845774891ff3b5a8d3c02cc7cea890ac54 | [
"MIT"
] | null | null | null | jesse/indicators/macdext.py | leaiannotti/jesse | 564c54845774891ff3b5a8d3c02cc7cea890ac54 | [
"MIT"
] | 2 | 2021-05-21T10:14:53.000Z | 2021-05-27T04:39:51.000Z | from collections import namedtuple
import numpy as np
from jesse.helpers import get_candle_source
from jesse.helpers import slice_candles
from jesse.indicators.ma import ma
MACDEXT = namedtuple('MACDEXT', ['macd', 'signal', 'hist'])
def macdext(candles: np.ndarray, fast_period: int = 12, fast_matype: int = 0, slow... | 35.809524 | 148 | 0.695479 | from collections import namedtuple
import numpy as np
from jesse.helpers import get_candle_source
from jesse.helpers import slice_candles
from jesse.indicators.ma import ma
MACDEXT = namedtuple('MACDEXT', ['macd', 'signal', 'hist'])
def macdext(candles: np.ndarray, fast_period: int = 12, fast_matype: int = 0, slow... | true | true |
1c28c8ea47b77c28ac4ee6b8f2d0058920a385d0 | 364 | py | Python | virtualfish/test/conftest.py | szaydel/virtualfish | ae5873eec445558dfb5fb690b42e2d3355a49453 | [
"MIT"
] | 550 | 2015-01-07T19:36:44.000Z | 2019-04-30T08:22:04.000Z | virtualfish/test/conftest.py | szaydel/virtualfish | ae5873eec445558dfb5fb690b42e2d3355a49453 | [
"MIT"
] | 102 | 2015-01-01T11:17:53.000Z | 2019-04-12T16:17:59.000Z | virtualfish/test/conftest.py | szaydel/virtualfish | ae5873eec445558dfb5fb690b42e2d3355a49453 | [
"MIT"
] | 69 | 2015-01-13T23:25:28.000Z | 2019-03-24T14:00:16.000Z | import pytest
from .repl import Fish
from ..loader import load
from os import mkdir, path
@pytest.fixture
def f():
return Fish()
@pytest.fixture
def vf(f):
mkdir(path.join(f.homedir, ".virtualenvs"))
f.run("\n".join(load()))
return f
@pytest.fixture
def vf_active(vf):
vf.run("vf new myenv")
... | 15.166667 | 47 | 0.656593 | import pytest
from .repl import Fish
from ..loader import load
from os import mkdir, path
@pytest.fixture
def f():
return Fish()
@pytest.fixture
def vf(f):
mkdir(path.join(f.homedir, ".virtualenvs"))
f.run("\n".join(load()))
return f
@pytest.fixture
def vf_active(vf):
vf.run("vf new myenv")
... | true | true |
1c28c8fa9b14c3397bae844111572061431ee6ad | 21,658 | py | Python | features/steps/steps.py | gregr/translator-testing-framework | 75f4259184d8aa5fbe5bc686ca7bbf051bea3560 | [
"BSD-3-Clause"
] | null | null | null | features/steps/steps.py | gregr/translator-testing-framework | 75f4259184d8aa5fbe5bc686ca7bbf051bea3560 | [
"BSD-3-Clause"
] | null | null | null | features/steps/steps.py | gregr/translator-testing-framework | 75f4259184d8aa5fbe5bc686ca7bbf051bea3560 | [
"BSD-3-Clause"
] | null | null | null | import jsonpath_rw
import logging
import requests
import json
import pandas as pd
from behave import given, when, then, use_step_matcher
from contextlib import closing
from reasoner_diff.test_robokop import answer as robokop_answer
from reasoner_diff.test_robokop import question as robokop_question
from reasoner_diff.... | 34.6528 | 120 | 0.649644 | import jsonpath_rw
import logging
import requests
import json
import pandas as pd
from behave import given, when, then, use_step_matcher
from contextlib import closing
from reasoner_diff.test_robokop import answer as robokop_answer
from reasoner_diff.test_robokop import question as robokop_question
from reasoner_diff.... | true | true |
1c28c95f3a2dc9b3bb3bec119d939564c59338d2 | 30,126 | py | Python | src/transformers/modelcard.py | djroxx2000/transformers | 77770ec79883343d32051cfb6a04f64523cd8df1 | [
"Apache-2.0"
] | 723 | 2020-07-16T13:02:25.000Z | 2022-03-31T21:03:55.000Z | src/transformers/modelcard.py | Hecim1984/transformers | 8e908c8c74f556a82534f4cf1e7a1b4f7b55d24c | [
"Apache-2.0"
] | 170 | 2020-07-16T14:39:11.000Z | 2022-03-31T13:02:11.000Z | src/transformers/modelcard.py | Hecim1984/transformers | 8e908c8c74f556a82534f4cf1e7a1b4f7b55d24c | [
"Apache-2.0"
] | 131 | 2020-07-16T14:38:16.000Z | 2022-03-29T19:43:18.000Z | # coding=utf-8
# Copyright 2018 The HuggingFace Inc. team.
#
# 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... | 39.796565 | 148 | 0.645788 |
import copy
import json
import os
import warnings
from dataclasses import dataclass
from pathlib import Path
from typing import Any, Dict, List, Optional, Union
import requests
import yaml
from huggingface_hub import HfApi
from . import __version__
from .file_utils import (
CONFIG_NAME,
MODEL_... | true | true |
1c28c9c14d886f417107614e37e640811c6acfd1 | 5,327 | py | Python | trustybrowser/Statistics.py | coco673/TrustyBrowser | e88f09c0e7899d53eac266f9c83d2f8949303e0f | [
"Beerware"
] | null | null | null | trustybrowser/Statistics.py | coco673/TrustyBrowser | e88f09c0e7899d53eac266f9c83d2f8949303e0f | [
"Beerware"
] | null | null | null | trustybrowser/Statistics.py | coco673/TrustyBrowser | e88f09c0e7899d53eac266f9c83d2f8949303e0f | [
"Beerware"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
import threading
import json
import logging
class Statistics(object):
""" Classe pour la génération de rapports statistiques sur les
implémentations auditées.
"""
def __init__(self, database, timer):
# Verrou sur le contenu du rapport
self.__l... | 34.367742 | 79 | 0.592078 |
import threading
import json
import logging
class Statistics(object):
def __init__(self, database, timer):
self.__lock = threading.Lock()
self.__writePending = False
self.__reports = {}
self.__charts = []
self.__ren... | true | true |
1c28cb62eb99272ce274d9732ba98bd5b24037d9 | 28,870 | py | Python | env/Lib/site-packages/plotly/graph_objs/layout/_coloraxis.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 7 | 2022-01-16T12:28:16.000Z | 2022-03-04T15:31:45.000Z | env/Lib/site-packages/plotly/graph_objs/layout/_coloraxis.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 14 | 2021-10-20T23:33:47.000Z | 2021-12-21T04:50:37.000Z | env/Lib/site-packages/plotly/graph_objs/layout/_coloraxis.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | null | null | null | from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Coloraxis(_BaseLayoutHierarchyType):
# class properties
# --------------------
_parent_path_str = "layout"
_path_str = "layout.coloraxis"
_valid_props = {
"autocolorscale",
... | 41.361032 | 87 | 0.527225 | from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Coloraxis(_BaseLayoutHierarchyType):
_parent_path_str = "layout"
_path_str = "layout.coloraxis"
_valid_props = {
"autocolorscale",
"cauto",
"cmax",
"cm... | true | true |
1c28cbf0fa20270abd17c96ab7d4678b2b34d1d1 | 163 | py | Python | src/parsing/admin.py | MichaelNest/JobParser | d60a5bdfa505a201b3a6d98d52abc19edaa91e9f | [
"Apache-2.0"
] | null | null | null | src/parsing/admin.py | MichaelNest/JobParser | d60a5bdfa505a201b3a6d98d52abc19edaa91e9f | [
"Apache-2.0"
] | null | null | null | src/parsing/admin.py | MichaelNest/JobParser | d60a5bdfa505a201b3a6d98d52abc19edaa91e9f | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from .models import City, Language, Vacancy
admin.site.register(City)
admin.site.register(Language)
admin.site.register(Vacancy)
| 23.285714 | 43 | 0.815951 | from django.contrib import admin
from .models import City, Language, Vacancy
admin.site.register(City)
admin.site.register(Language)
admin.site.register(Vacancy)
| true | true |
1c28ccb20a520afdc809120f0017882b681fd400 | 3,030 | py | Python | python3-virtualenv/Lib/python3.6/site-packages/alembic/testing/util.py | LindaNayeli104/mlh-orientation-hackathon-project | d86b58f76721a9d5f3374399bfc6d3b1445d16ca | [
"MIT"
] | null | null | null | python3-virtualenv/Lib/python3.6/site-packages/alembic/testing/util.py | LindaNayeli104/mlh-orientation-hackathon-project | d86b58f76721a9d5f3374399bfc6d3b1445d16ca | [
"MIT"
] | null | null | null | python3-virtualenv/Lib/python3.6/site-packages/alembic/testing/util.py | LindaNayeli104/mlh-orientation-hackathon-project | d86b58f76721a9d5f3374399bfc6d3b1445d16ca | [
"MIT"
] | 1 | 2021-06-20T19:28:37.000Z | 2021-06-20T19:28:37.000Z | # testing/util.py
# Copyright (C) 2005-2019 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import types
def flag_combinations(*combinations):
"""A facade arou... | 28.055556 | 74 | 0.592739 |
import types
def flag_combinations(*combinations):
from sqlalchemy.testing import config
keys = set()
for d in combinations:
keys.update(d)
keys = sorted(keys)
return config.combinations(
*[
("_".join(k for k in keys if d.get(k, False)),)
... | true | true |
1c28cdeb2ce9697c64de4444b01d79cd465bb3f1 | 2,777 | py | Python | multiagent/teoretoc_results.py | NaumO4/multiagent-particle-envs | 3abf895e97c9a1b003bf324fc4d36a4c8d89d8f6 | [
"MIT"
] | null | null | null | multiagent/teoretoc_results.py | NaumO4/multiagent-particle-envs | 3abf895e97c9a1b003bf324fc4d36a4c8d89d8f6 | [
"MIT"
] | null | null | null | multiagent/teoretoc_results.py | NaumO4/multiagent-particle-envs | 3abf895e97c9a1b003bf324fc4d36a4c8d89d8f6 | [
"MIT"
] | null | null | null | import argparse
import numpy as np
import os
import utilities
from multiagent.environment import MultiAgentEnv
from multiagent.scenarios.open_1_1_pursuit_know_vel import Scenario
from multiagent.simple_agents import StayAgent, ToPointAgent,StayForceAgent, VectorAgent
from multiagent.ddpg_agent import DDPGAgent
import ... | 42.075758 | 100 | 0.745049 | import argparse
import numpy as np
import os
import utilities
from multiagent.environment import MultiAgentEnv
from multiagent.scenarios.open_1_1_pursuit_know_vel import Scenario
from multiagent.simple_agents import StayAgent, ToPointAgent,StayForceAgent, VectorAgent
from multiagent.ddpg_agent import DDPGAgent
import ... | true | true |
1c28cdfb769263bb72d2d84d7ef1db5bd161cf1e | 13,792 | py | Python | celery/local.py | stratoukos/celery | da9c0bad1f52515a70ae28d48abddbf42571a39f | [
"BSD-3-Clause"
] | 1 | 2015-12-02T17:12:09.000Z | 2015-12-02T17:12:09.000Z | celery/local.py | stratoukos/celery | da9c0bad1f52515a70ae28d48abddbf42571a39f | [
"BSD-3-Clause"
] | null | null | null | celery/local.py | stratoukos/celery | da9c0bad1f52515a70ae28d48abddbf42571a39f | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
celery.local
~~~~~~~~~~~~
This module contains critical utilities that
needs to be loaded as soon as possible, and that
shall not load any third party modules.
Parts of this module is Copyright by Werkzeug Team.
:copyright: (c) 2009 - 2012 by Ask Solem.
:li... | 33.153846 | 78 | 0.632396 |
from __future__ import absolute_import
try:
from greenlet import getcurrent as get_ident
except ImportError:
try:
from thread import get_ident
except ImportError:
from dummy_thread import get_ident
def try_import(module, default=None):
from importlib import import_module
... | true | true |
1c28ce51801e439769f69e69db3050ed75fe8135 | 4,279 | py | Python | lite/tests/unittest_py/rpc_service/server.py | zhupengyang/Paddle-Lite | c8d77d38c5586a98a3ffaa0a87d4a3cd0aa42755 | [
"Apache-2.0"
] | null | null | null | lite/tests/unittest_py/rpc_service/server.py | zhupengyang/Paddle-Lite | c8d77d38c5586a98a3ffaa0a87d4a3cd0aa42755 | [
"Apache-2.0"
] | null | null | null | lite/tests/unittest_py/rpc_service/server.py | zhupengyang/Paddle-Lite | c8d77d38c5586a98a3ffaa0a87d4a3cd0aa42755 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 40.367925 | 136 | 0.641505 |
import rpyc
import os
import shutil
from rpyc.utils.server import ThreadedServer
from paddlelite.lite import *
rpyc.core.protocol.DEFAULT_CONFIG['allow_pickle'] = True
def ParsePlaceInfo(place_str):
infos = ''.join(place_str.split()).split(",")
if len(infos) == 1 :
if infos[0] in Targe... | true | true |
1c28ced8571cc55e9948c851611294c09bc86f73 | 525 | py | Python | sdk/python/pulumi_azure_native/alertsmanagement/v20200804preview/_enums.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_native/alertsmanagement/v20200804preview/_enums.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_native/alertsmanagement/v20200804preview/_enums.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
from enum import Enum
__all__ = [
'HealthAlertsNamespace',
'HealthStateName',
]
class HealthAlertsNamespace(str, Enum):
"""
specifie... | 20.192308 | 80 | 0.655238 |
from enum import Enum
__all__ = [
'HealthAlertsNamespace',
'HealthStateName',
]
class HealthAlertsNamespace(str, Enum):
GUEST_VM_HEALTH = "GuestVmHealth"
class HealthStateName(str, Enum):
WARNING = "Warning"
CRITICAL = "Critical"
| true | true |
1c28d04649748b222e465a41de328eb2d4a1e568 | 2,143 | py | Python | xhtools.py | nxihe/xhtools | 6cdebc576fe6d89f69a4ef8c5cfb23cd7036ab6c | [
"Apache-2.0"
] | null | null | null | xhtools.py | nxihe/xhtools | 6cdebc576fe6d89f69a4ef8c5cfb23cd7036ab6c | [
"Apache-2.0"
] | null | null | null | xhtools.py | nxihe/xhtools | 6cdebc576fe6d89f69a4ef8c5cfb23cd7036ab6c | [
"Apache-2.0"
] | null | null | null | import pandas as pd
import numpy as np
class Xhtools:
'''
npproduct:求两个一维数组的笛卡尔积
threesigmod:根据3Sigma法则求异常值
numericoutlier:箱线图法求异常值
cutbin:自定义分箱,woe、iv值计算
'''
def __init__(self):
return None
def npproduct(self,array1,array2):
if len(array1) == len(array2):
... | 40.433962 | 95 | 0.581428 | import pandas as pd
import numpy as np
class Xhtools:
def __init__(self):
return None
def npproduct(self,array1,array2):
if len(array1) == len(array2):
return np.transpose([np.repeat(array1, len(array1)), np.tile(array2, len(array2))])
else:
return 'array1、a... | true | true |
1c28d1db0f73fbca89d31707a52c23a5eaaecc4f | 1,129 | py | Python | memcache_server/users/tests/test_forms.py | hrabryi/django-vue-memcached-server | 8858a7f4a6ce9bc05dc7f3d2fe5b65ca3ceea098 | [
"MIT"
] | null | null | null | memcache_server/users/tests/test_forms.py | hrabryi/django-vue-memcached-server | 8858a7f4a6ce9bc05dc7f3d2fe5b65ca3ceea098 | [
"MIT"
] | null | null | null | memcache_server/users/tests/test_forms.py | hrabryi/django-vue-memcached-server | 8858a7f4a6ce9bc05dc7f3d2fe5b65ca3ceea098 | [
"MIT"
] | null | null | null | import pytest
from memcache_server.users.forms import UserCreationForm
from memcache_server.users.tests.factories import UserFactory
pytestmark = pytest.mark.django_db
class TestUserCreationForm:
def test_clean_username(self):
# A user with proto_user params does not exist yet.
proto_user = User... | 27.536585 | 61 | 0.59876 | import pytest
from memcache_server.users.forms import UserCreationForm
from memcache_server.users.tests.factories import UserFactory
pytestmark = pytest.mark.django_db
class TestUserCreationForm:
def test_clean_username(self):
proto_user = UserFactory.build()
form = UserCreationForm(
... | true | true |
1c28d209ca514cadcefb37cb8293dcc804bf5806 | 609 | py | Python | packages/pyright-internal/src/tests/samples/properties2.py | sasano8/pyright | e804f324ee5dbd25fd37a258791b3fd944addecd | [
"MIT"
] | 4,391 | 2019-05-07T01:18:57.000Z | 2022-03-31T20:45:44.000Z | packages/pyright-internal/src/tests/samples/properties2.py | sasano8/pyright | e804f324ee5dbd25fd37a258791b3fd944addecd | [
"MIT"
] | 2,740 | 2019-05-07T03:29:30.000Z | 2022-03-31T12:57:46.000Z | packages/pyright-internal/src/tests/samples/properties2.py | sasano8/pyright | e804f324ee5dbd25fd37a258791b3fd944addecd | [
"MIT"
] | 455 | 2019-05-07T12:55:14.000Z | 2022-03-31T17:09:15.000Z | # This sample tests handling of the @abc.abstractpropery decorator.
import abc
def requires_int(x: int):
pass
class Foo(abc.ABC):
@abc.abstractproperty
def x(self) -> int:
raise NotImplementedError
@x.setter
def x(self, value: int):
raise NotImplementedError
@abc.abstractp... | 17.4 | 67 | 0.681445 |
import abc
def requires_int(x: int):
pass
class Foo(abc.ABC):
@abc.abstractproperty
def x(self) -> int:
raise NotImplementedError
@x.setter
def x(self, value: int):
raise NotImplementedError
@abc.abstractproperty
def y(self) -> float:
raise NotImplementedError... | true | true |
1c28d25bc269b2d1581f561aa4b40e0f1b672d2e | 1,011 | py | Python | plotting/palette/_LondonUnderground_Colours.py | fhoefling/useful_stuff | 84a3d7afd52162ee5f70bcbd0657f4e2d1add904 | [
"BSD-2-Clause"
] | null | null | null | plotting/palette/_LondonUnderground_Colours.py | fhoefling/useful_stuff | 84a3d7afd52162ee5f70bcbd0657f4e2d1add904 | [
"BSD-2-Clause"
] | null | null | null | plotting/palette/_LondonUnderground_Colours.py | fhoefling/useful_stuff | 84a3d7afd52162ee5f70bcbd0657f4e2d1add904 | [
"BSD-2-Clause"
] | null | null | null | #__all__ = ['build_palette']
color_dict = {
'Bakerloo': '#894e24',
'Central': '#dc241f',
'Circle': '#ffce00',
'District': '#007229',
'Hammersmith': '#d799af',
'Jubilee': '#868f98',
'Metropolitan': '#751056',
'Northern': '#000000',
'Piccadilly': '#... | 22.977273 | 43 | 0.486647 |
color_dict = {
'Bakerloo': '#894e24',
'Central': '#dc241f',
'Circle': '#ffce00',
'District': '#007229',
'Hammersmith': '#d799af',
'Jubilee': '#868f98',
'Metropolitan': '#751056',
'Northern': '#000000',
'Piccadilly': '#0010a8',
'Victoria':... | true | true |
1c28d41ae25574d591eaff73672c1aae8b8cd7d5 | 17,675 | py | Python | solarwindpy/tests/test_quantities.py | blalterman/SolarWindPy | c906f1ea1b833fedc717d906d14d2531e6c03d66 | [
"BSD-3-Clause"
] | null | null | null | solarwindpy/tests/test_quantities.py | blalterman/SolarWindPy | c906f1ea1b833fedc717d906d14d2531e6c03d66 | [
"BSD-3-Clause"
] | 4 | 2020-03-24T16:53:54.000Z | 2022-03-12T00:58:31.000Z | solarwindpy/tests/test_quantities.py | blalterman/SolarWindPy | c906f1ea1b833fedc717d906d14d2531e6c03d66 | [
"BSD-3-Clause"
] | 1 | 2021-11-24T23:10:32.000Z | 2021-11-24T23:10:32.000Z | #!/usr/bin/env python
r"""Test :py:class:`~solarwindpy.core.vector.Vector` and :py:class:`~solarwindpy.core.tensor.Tensor`.
"""
import pdb
# import re as re
import numpy as np
import pandas as pd
import unittest
import sys
import pandas.testing as pdt
from unittest import TestCase
from abc import ABC, abstractpropert... | 33.099251 | 101 | 0.562942 |
import pdb
import numpy as np
import pandas as pd
import unittest
import sys
import pandas.testing as pdt
from unittest import TestCase
from abc import ABC, abstractproperty
from scipy import constants
from solarwindpy.tests import test_base as base
from solarwindpy import vector
from solarwindpy import tensor
... | true | true |
1c28d4c131632b055ebcfa0106ad2486db6adbd4 | 5,578 | py | Python | typic/types/email.py | wyfo/typical | 5fc5326b3509d0b9d35c15dae9590d6cf37a0354 | [
"MIT"
] | 157 | 2019-03-20T19:12:28.000Z | 2022-03-25T08:57:53.000Z | typic/types/email.py | wyfo/typical | 5fc5326b3509d0b9d35c15dae9590d6cf37a0354 | [
"MIT"
] | 147 | 2019-07-03T20:00:52.000Z | 2022-02-10T11:38:39.000Z | typic/types/email.py | wyfo/typical | 5fc5326b3509d0b9d35c15dae9590d6cf37a0354 | [
"MIT"
] | 15 | 2019-03-21T11:01:03.000Z | 2022-01-08T10:38:15.000Z | from __future__ import annotations
import dataclasses
import re
from typing import ClassVar, Pattern, Match, Optional
from urllib.parse import quote
from typic.util import cached_property, slotted
from .url import (
NetworkAddress,
PRIVATE_HOSTS,
INTERNAL_HOSTS,
INTERNAL_IP_PATTERN,
NetworkAddress... | 29.670213 | 102 | 0.59394 | from __future__ import annotations
import dataclasses
import re
from typing import ClassVar, Pattern, Match, Optional
from urllib.parse import quote
from typic.util import cached_property, slotted
from .url import (
NetworkAddress,
PRIVATE_HOSTS,
INTERNAL_HOSTS,
INTERNAL_IP_PATTERN,
NetworkAddress... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.