max_stars_repo_path
string
max_stars_repo_name
string
max_stars_count
int64
id
string
content
string
add_param_types
int64
add_return_types
int64
add_class_field_types
int64
add_instance_field_types
int64
add_total
int64
add_error
int64
tests/timetables/test_interval_timetable.py
holly-evans/airflow
8,092
135175
# # 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...
7
5
0
0
12
0
rllib/examples/export/cartpole_dqn_export.py
77loopin/ray
21,382
135177
<gh_stars>1000+ #!/usr/bin/env python import os import ray from ray.rllib.agents.registry import get_trainer_class from ray.rllib.utils.framework import try_import_tf tf1, tf, tfv = try_import_tf() ray.init(num_cpus=10) def train_and_export(algo_name, num_steps, model_dir, ckpt_dir, prefix): cls = get_trainer...
0
0
0
0
0
0
src/tests/ftest/util/write_host_file.py
fedepad/daos
429
135199
<gh_stars>100-1000 #!/usr/bin/python """ (C) Copyright 2018-2021 Intel Corporation. SPDX-License-Identifier: BSD-2-Clause-Patent """ from logging import getLogger import os import random from collections import Counter def write_host_file(hostlist, path='/tmp', slots=1): """Write out a hostfile suitable for...
0
0
0
0
0
0
tests/core/data/test_batch.py
Actis92/lightning-flash
1,457
135209
<reponame>Actis92/lightning-flash # Copyright The PyTorch Lightning 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 require...
0
0
0
0
0
0
examples/get-started/hello_world/example_test.py
iPlon-org/esp-idf
8,747
135210
<filename>examples/get-started/hello_world/example_test.py #!/usr/bin/env python from __future__ import division, print_function, unicode_literals import ttfw_idf @ttfw_idf.idf_example_test(env_tag='Example_GENERIC', target=['esp32', 'esp32s2', 'esp32c3'], ci_target=['esp32']) def test_examples_hello_world(env, ext...
0
0
0
0
0
0
qa/L0_libtorch_io_names/io_names_client.py
nskool/server
358
135229
#!/usr/bin/python # Copyright 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # * Redistributions of source code must retain the above copyright # notice...
1
0
0
0
1
0
src/molecule/test/unit/verifier/test_ansible.py
Shaps/molecule
1,599
135275
from __future__ import annotations import os import pytest from molecule import config from molecule.verifier import ansible @pytest.fixture def _patched_ansible_verify(mocker) -> object: m = mocker.patch("molecule.provisioner.ansible.Ansible.verify") m.return_value = "patched-ansible-verify-stdout" re...
0
3
0
0
3
0
tgen/eval.py
AnneBeyer/tgen
222
135280
#!/usr/bin/env python # coding=utf-8 from __future__ import annotations """ Evaluation (t-tree comparison functions). """ from __future__ import unicode_literals from __future__ import division from builtins import zip from builtins import range from builtins import object from past.utils import old_div from collecti...
3
21
0
0
24
0
linear_dynamical_systems/process_mit_bih.py
deepneuralmachine/google-research
23,901
135293
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
0
0
0
0
0
0
test/test_misc.py
nodamu/dl_coursera
111
135327
import unittest class TestMisc(unittest.TestCase): def test_pypi_api(self): from dl_coursera.lib.misc import get_latest_app_version ver = get_latest_app_version() self.assertRegex(ver, r'\d+\.\d+\.\d+')
0
0
0
0
0
0
flows/statestore/tests/utils.py
sergioisidoro/django-flows
104
135329
<reponame>sergioisidoro/django-flows from flows.statestore.tests.models import TestModel def store_state_works(case, store): test_model = TestModel.objects.create(fruit='apple', count=34) task_id = '10293847565647382910abdcef1029384756' state = {'a': 1, 'b': 'cake', ...
0
0
0
0
0
0
rpython/jit/backend/zarch/test/test_calling_convention.py
nanjekyejoannah/pypy
381
135344
<filename>rpython/jit/backend/zarch/test/test_calling_convention.py from rpython.jit.backend.test.calling_convention_test import CallingConvTests from rpython.jit.backend.zarch.codebuilder import InstrBuilder from rpython.rtyper.lltypesystem import lltype, rffi import rpython.jit.backend.zarch.registers as r import rpy...
0
0
0
0
0
0
vega/algorithms/nas/sgas/__init__.py
jie311/vega
724
135369
<filename>vega/algorithms/nas/sgas/__init__.py from .sgas_trainer_callback import *
0
0
0
0
0
0
models/sgm_model/gen_labelmap.py
techstack-studios/AnimeInterp
245
135378
from __future__ import annotations import os, sys import argparse import numpy as np import cv2 from skimage import filters from linefiller.thinning import thinning from linefiller.trappedball_fill import trapped_ball_fill_multi, flood_fill_multi, mark_fill, build_fill_map, merge_fill, \ show_fill_map, my_merge_...
5
3
0
0
8
0
pyxtal/interface/vasp.py
ubikpt/PyXtal
127
135381
<reponame>ubikpt/PyXtal from pyxtal import pyxtal from ase import Atoms from pyxtal.util import good_lattice from ase.calculators.vasp import Vasp import os, time import numpy as np """ A script to perform multistages vasp calculation """ class VASP(): """ This is a calculator to perform structure optimization...
0
0
0
0
0
0
dotviewer/graphserver.py
nanjekyejoannah/pypy
333
135382
#! /usr/bin/env python from __future__ import annotations """Graph server. From the command-line it's easier to use sshgraphserver.py instead of this. """ from __future__ import print_function, absolute_import import os, sys PARENTDIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # make dotviewer i...
2
0
1
1
4
0
desktop/core/ext-py/monotonic-1.5/monotonic.py
kokosing/hue
5,079
135422
<reponame>kokosing/hue # -*- coding: utf-8 -*- """ monotonic ~~~~~~~~~ This module provides a ``monotonic()`` function which returns the value (in fractional seconds) of a clock which never goes backwards. On Python 3.3 or newer, ``monotonic`` will be an alias of ``time.monotonic`` from the standard libra...
0
0
0
0
0
0
src/platform/axis2/fingerprints/AX12.py
0x27/clusterd
539
135423
<filename>src/platform/axis2/fingerprints/AX12.py from src.platform.axis2.interfaces import DefaultServer class FPrint(DefaultServer): def __init__(self): super(FPrint, self).__init__() self.version = '1.2'
0
0
0
0
0
0
dace/version.py
jnice-81/dace
144
135428
<gh_stars>100-1000 __version__ = '0.11.3'
0
0
0
0
0
0
custom_components/ovapi/sensor.py
klaasnicolaas/Smarthome-homeassistant-config
167
135435
<filename>custom_components/ovapi/sensor.py from datetime import datetime, timedelta import logging import operator import json import itertools import http.client import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import (CONF_NAME, STATE_UNKNOWN) from homea...
0
0
0
0
0
0
setup.py
cclauss/removestar
102
135455
import setuptools with open("README.md", "r") as fh: long_description = fh.read() import versioneer setuptools.setup( name="removestar", version=versioneer.get_version(), cmdclass=versioneer.get_cmdclass(), author="<NAME>", author_email="<EMAIL>", description="A tool to automatically repl...
0
0
0
0
0
0
venv/Lib/site-packages/nipype/algorithms/tests/test_ErrorMap.py
richung99/digitizePlots
585
135459
<filename>venv/Lib/site-packages/nipype/algorithms/tests/test_ErrorMap.py #!/usr/bin/env python # -*- coding: utf-8 -*- import pytest from nipype.testing import example_data from nipype.algorithms.metrics import ErrorMap import nibabel as nb import numpy as np import os def test_errormap(tmpdir): # Single-Spect...
0
0
0
0
0
0
tests/test_codecs.py
jaegertracing/jaeger-client-python
372
135460
# Copyright (c) 2016 Uber 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 agreed to ...
0
2
0
0
2
0
teuthology/orchestra/test/util.py
varshar16/teuthology
117
135471
def assert_raises(excClass, callableObj, *args, **kwargs) -> object: """ Like unittest.TestCase.assertRaises, but returns the exception. """ try: callableObj(*args, **kwargs) except excClass as e: return e else: if hasattr(excClass,'__name__'): excName = excClass.__name__...
0
1
0
0
1
0
PythonAPI/carissma_project/lib/python3.5/site-packages/pandas/util/_doctools.py
AbdulHoffmann/carla_carissma
6,989
135472
from __future__ import annotations import numpy as np import pandas.compat as compat import pandas as pd class TablePlotter(object): """ Layout some DataFrames in vertical/horizontal layout for explanation. Used in merging.rst """ def __init__(self, cell_width: float=0.37, cell_height: float=0....
6
6
0
0
12
0
corehq/apps/translations/app_translations/upload_app.py
dimagilg/commcare-hq
471
135492
from __future__ import annotations import io from django.contrib import messages from django.template.defaultfilters import linebreaksbr from django.utils.translation import ugettext as _ import ghdiff from CommcareTranslationChecker import validate_workbook from CommcareTranslationChecker.exceptions import FatalErro...
5
15
0
0
20
0
torchsso/autograd/samplegrad.py
jjxu217/pytorch-sso
121
135495
<gh_stars>100-1000 from contextlib import contextmanager import torch import torch.nn as nn import torch.nn.functional as F @contextmanager def save_sample_grads(model: nn.Module): handles = [] for module in model.children(): params = list(module.parameters()) params = [p for p in params if ...
0
0
0
0
0
0
conans/test/conan_v2/tools/test_tools_win.py
matthiasng/conan
6,205
135499
<reponame>matthiasng/conan import six from conans import tools from conans.errors import ConanV2Exception from conans.test.utils.conan_v2_tests import ConanV2ModeTestCase class ToolsWinTestCase(ConanV2ModeTestCase): def test_msvc_build_command(self): with six.assertRaisesRegex(self, ConanV2Exception, "Co...
0
0
0
0
0
0
vlcp/service/sdn/l3router.py
hubo1016/vlcp
252
135510
<filename>vlcp/service/sdn/l3router.py import itertools import time import vlcp.service.sdn.ioprocessing as iop from vlcp.config import defaultconfig from vlcp.event import Event from vlcp.event import RoutineContainer from vlcp.event import withIndices from vlcp.protocol.openflow import OpenflowAsyncMessageEvent fr...
0
0
0
0
0
0
nuplan/planning/training/data_loader/test/skeleton_test_dataloader.py
motional/nuplan-devkit
128
135511
<gh_stars>100-1000 import unittest import numpy as np import pytorch_lightning as pl import ray from nuplan.planning.scenario_builder.nuplan_db.test.nuplan_scenario_test_utils import get_test_nuplan_scenario_builder from nuplan.planning.scenario_builder.scenario_filter import ScenarioFilter from nuplan.planning.simul...
0
0
0
0
0
0
cmasher/colormaps/waterlily/waterlily.py
cclauss/CMasher
257
135516
# %% IMPORTS # Package imports from matplotlib.cm import register_cmap from matplotlib.colors import ListedColormap # All declaration __all__ = ['cmap'] # Author declaration __author__ = "<NAME> (@1313e)" # Package declaration __package__ = 'cmasher' # %% GLOBALS AND DEFINITIONS # Type of this colormap cm_type = '...
0
0
0
0
0
0
openprompt/utils/reproduciblity.py
puraminy/OpenPrompt
979
135526
import random import numpy as np import torch from openprompt.utils.logging import logger from typing import * def set_seed(seed:Optional[int] = None): """set seed for reproducibility Args: seed (:obj:`int`): the seed to seed everything for reproducibility. if None, do nothing. """ if seed: ...
1
0
0
0
1
0
solutions/problem_101.py
ksvr444/daily-coding-problem
1,921
135529
def is_prime(num, primes) -> bool: for prime in primes: if prime == num: return True if not num % prime: return False return True def get_primes(num) -> object: limit = (num // 2) + 1 candidates = list() primes = list() for i in range(2, limit): ...
0
2
0
0
2
0
ax/modelbridge/random.py
trsvchn/Ax
1,803
135540
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from typing import Dict, List, Optional, Tuple from ax.core.data import Data from ax.core.experiment import Experiment...
17
5
2
0
24
0
tests/system/fashion/test_fashion.py
vishalbelsare/jina
15,179
135556
<gh_stars>1000+ import os import pytest import jina from jina import Document from jina.helloworld.fashion.app import hello_world from jina.helloworld.fashion.my_executors import * from jina.parsers.helloworld import set_hw_parser def check_hello_world_results(html_path: str): from bs4 import BeautifulSoup ...
0
0
0
0
0
0
vyapp/areavi.py
iogf/vy
927
135575
from __future__ import annotations """ """ from vyapp.mixins import DataEvent, IdleEvent from vyapp.stderr import printd from tkinter import Text, IntVar import os class AreaVi(Text, DataEvent, IdleEvent): INPUT: None = None # Plugins should commonly use self.project # if it fails then use HOME. HOME...
103
26
2
8
139
0
server/auvsi_suas/models/mission_config.py
UnmannedAerialSystems/interop
175
135583
"""Mission configuration model.""" import logging from auvsi_suas.models.fly_zone import FlyZone from auvsi_suas.models.gps_position import GpsPosition from auvsi_suas.models.odlc import Odlc from auvsi_suas.models.stationary_obstacle import StationaryObstacle from auvsi_suas.models.waypoint import Waypoint from djang...
0
1
3
0
4
0
neptune/internal/abort.py
Raalsky/neptune-client
254
135659
<reponame>Raalsky/neptune-client<filename>neptune/internal/abort.py # # Copyright (c) 2019, Neptune Labs Sp. z o.o. # # 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.o...
0
0
0
0
0
0
mayan/apps/mime_types/apps.py
bonitobonita24/Mayan-EDMS
343
135665
<filename>mayan/apps/mime_types/apps.py from django.utils.translation import ugettext_lazy as _ from mayan.apps.common.apps import MayanAppConfig class MIMETypesApp(MayanAppConfig): name = 'mayan.apps.mime_types' has_tests = True verbose_name = _('MIME types') def ready(self, *args, **kwargs): ...
0
0
0
0
0
0
docs/tools/nav.py
pdv-ru/ClickHouse
15,577
135680
<reponame>pdv-ru/ClickHouse import collections import datetime import hashlib import logging import os import mkdocs.structure.nav import util def find_first_header(content): for line in content.split('\n'): if line.startswith('#'): no_hash = line.lstrip('#') return no_hash.split...
0
0
0
0
0
0
fastrunner/utils/ding_message.py
FuxiongYang/faster
227
135683
<gh_stars>100-1000 # !/usr/bin/python3 # -*- coding: utf-8 -*- # @Author:梨花菜 # @File: ding_message.py # @Time : 2018/12/21 15:11 # @Email: <EMAIL> # @Software: PyCharm from dingtalkchatbot.chatbot import DingtalkChatbot from fastrunner.utils.parser import format_summary_to_ding class DingMessage: """ 调用钉钉机...
0
0
0
0
0
0
python/paddle_fl/mpc/tests/unittests/privc/test_sigmoid_op.py
barrierye/PaddleFL
379
135688
# Copyright (c) 2020 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...
0
0
0
0
0
0
data/atis_Intent_Detection_and_Slot_Filling/train/check_train_raw_data.py
SmallStom/slot_learning
418
135706
label_data = open("label", encoding='utf-8').readlines() label_data = [x.strip() for x in label_data] print(len(label_data)) label_kinds = set(label_data) print(label_kinds)
0
0
0
0
0
0
tests/integration/cli/test_test.py
gamechanger/dusty
421
135721
<filename>tests/integration/cli/test_test.py import subprocess import sys from ...testcases import DustyIntegrationTestCase from ...fixtures import busybox_single_app_bundle_fixture class TestTestCLI(DustyIntegrationTestCase): def setUp(self): super(TestTestCLI, self).setUp() busybox_single_app_bu...
0
0
0
0
0
0
lib/pymedphys/_experimental/vendor/pylinac_vendored/winstonlutz.py
ethanio12345/pymedphys
207
135756
# Copyright (c) 2019-2020 <NAME> # Copyright (c) 2014-2020 <NAME> # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated # documentation files (the "Software"), to deal in the Software without restriction, including without limitation # the rights to use, copy, m...
7
18
0
3
28
0
merf/merf_test.py
ritviksahajpal/merf
189
135765
<filename>merf/merf_test.py """ MERF Unit Tests Run with this command for verbose output: > python tests.py -v :copyright: 2017 Manifold, Inc. :author: <NAME> <<EMAIL>> """ import pickle import unittest import numpy as np import pandas as pd from lightgbm import LGBMRegressor from numpy.testing import assert_almost_...
0
0
0
0
0
0
tracardi/domain/pii.py
bytepl/tracardi
153
135802
<gh_stars>100-1000 from typing import Optional, Any from pydantic import BaseModel class PII(BaseModel): """ Personally identifiable information, or PII, is any data that could potentially be used to identify a particular person. Examples include a full name, Social Security number, driver's license ...
0
0
0
0
0
0
sample_factory/envs/create_env.py
eles13/sample-factory
320
135833
from __future__ import annotations from sample_factory.envs.env_registry import global_env_registry def create_env(full_env_name, cfg: object | None=None, env_config: object | None=None) -> object: """ Factory function that creates environment instances. Matches full_env_name with env family prefixes regi...
2
1
0
0
3
0
src/sagemaker_training/__init__.py
unoebauer/sagemaker-training-toolkit
248
135858
<gh_stars>100-1000 # Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the...
0
0
0
0
0
0
mmf/trainers/core/device.py
tirkarthi/mmf
3,252
135956
# Copyright (c) Facebook, Inc. and its affiliates. import logging import warnings from abc import ABC import torch from mmf.common.registry import registry from mmf.utils.distributed import ( broadcast_xla_master_model_param, get_world_size, is_xla, ) from omegaconf import open_dict logger = logging.get...
0
3
0
0
3
0
keystone/identity/backends/resource_options.py
10088/keystone
615
136009
<filename>keystone/identity/backends/resource_options.py<gh_stars>100-1000 # 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 require...
0
0
0
0
0
0
virtual/lib/python3.6/site-packages/setuptools/wheel.py
najma-amin/News-Highlights
445
136040
<filename>virtual/lib/python3.6/site-packages/setuptools/wheel.py '''Wheels support.''' from distutils.util import get_platform import email import itertools import os import re import zipfile from pkg_resources import Distribution, PathMetadata, parse_version from setuptools.extern.six import PY3 from setuptools imp...
0
0
0
0
0
0
Documents/Router/CVE-2017-7494/impacket/testcases/SMB_RPC/test_wkst.py
edinjapan/NSABlocklist
201
136056
############################################################################### # Tested so far: # # NetrWkstaGetInfo # NetrWkstaUserEnum # NetrWkstaTransportEnum # NetrWkstaTransportAdd # NetrUseAdd # NetrUseGetInfo # NetrUseDel # NetrUseEnum # NetrWorkstationStatisticsGet # NetrGetJoinInformation # NetrJoinDomain2 ...
0
0
0
0
0
0
part2-steps-challenge/load-testing/plot-locust-data.py
viartemev/vertx-in-action
201
136093
<reponame>viartemev/vertx-in-action #!/usr/bin/env python import matplotlib.pyplot as plt import numpy as np import pandas as pd import argparse parser = argparse.ArgumentParser(description="Plot some data from Hey csv output") parser.add_argument("title", help="Plot title") parser.add_argument("input", help="Data fi...
0
0
0
0
0
0
sdk-extension/opentelemetry-sdk-extension-aws/tests/resource/test_ec2.py
epsagon/opentelemetry-python-contrib
208
136111
# Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
0
0
0
0
0
0
custom_components/tahoma/water_heater.py
iMicknl/ha-tahoma
130
136114
"""Support for Overkiz water heater devices.""" from homeassistant.components.water_heater import DOMAIN as WATER_HEATER from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback from .const import DOMAIN from...
3
0
0
0
3
0
strawberryfields/program_utils.py
corvust/strawberryfields
646
136124
# Copyright 2019 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 agre...
0
17
0
2
19
0
scripts/capnp_test_pycapnp.py
BartWeyder/pycapnp
188
136129
#!/usr/bin/env python import os import sys import capnp capnp.add_import_hook( [os.getcwd(), "/usr/local/include/"] ) # change this to be auto-detected? import test_capnp # noqa: E402 def decode(name): class_name = name[0].upper() + name[1:] print(getattr(test_capnp, class_name).from_bytes(sys.stdin....
0
0
0
0
0
0
seqlike/alphabets.py
ericmjl/seqlike
186
136130
from __future__ import annotations """SeqLike catalog of alphabets.""" import string from Bio.Data.IUPACData import ambiguous_dna_values, ambiguous_rna_values from Bio.Data.IUPACData import protein_letters, extended_protein_letters gap_letter = "-" stop_letter = "*" generic_protein_letter = "X" generic_nt_letter = "N...
2
7
0
0
9
0
lib/append_text.py
millengustavo/arauto
106
136135
<gh_stars>100-1000 def append_text(new_text): ''' Write the code instruction to be exported later on Args. new_text (str): the text that will be appended to the base string ''' global code_base_text code_base_text = code_base_text + new_text
0
0
0
0
0
0
examples/nnrt/nnrt_datasource_yolo.py
cuiboyuan/plato
135
136163
""" The COCO dataset or other datasets for the YOLOv5 model with using NNRT. """ import logging import os import math from plato.config import Config from plato.datasources import base from nnrt_datasource_yolo_utils import LoadImagesAndLabels def make_divisible(x, divisor) -> object: # Returns x evenly divisibl...
1
7
0
2
10
0
tests/pyccel/scripts/classes/classes.py
dina-fouad/pyccel
206
136192
# pylint: disable=missing-class-docstring, disable=missing-function-docstring, missing-module-docstring/ #$ header class Point(public) #$ header method __init__(Point, double, double) #$ header method __del__(Point) #$ header method translate(Point, double, double) class Point(object): def __init__(self, x, y): ...
0
0
0
0
0
0
python/pmercury/protocols/ssh.py
raj-apoorv/mercury
299
136198
from __future__ import annotations """ Copyright (c) 2019 Cisco Systems, Inc. All rights reserved. License at https://github.com/cisco/mercury/blob/master/LICENSE """ import os import sys import socket # SSH helper classes sys.path.append(os.path.dirname(os.path.abspath(__file__))) sys.path.append(os.path.dirname(o...
2
6
0
1
9
0
mmselfsup/models/algorithms/base.py
mitming/mmselfsup
355
136254
<gh_stars>100-1000 # Copyright (c) OpenMMLab. All rights reserved. from abc import ABCMeta, abstractmethod from collections import OrderedDict import torch import torch.distributed as dist from mmcv.runner import BaseModule, auto_fp16 class BaseModel(BaseModule, metaclass=ABCMeta): """Base model class for self-s...
0
0
0
0
0
0
cirq-google/cirq_google/ops/sycamore_gate.py
LLcat1217/Cirq
3,326
136277
# Copyright 2019 The Cirq Developers # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
1
4
0
0
5
0
kansha/card_addons/vote/models.py
AnomalistDesignLLC/kansha
161
136299
<filename>kansha/card_addons/vote/models.py # -*- coding:utf-8 -*- #-- # Copyright (c) 2012-2014 Net-ng. # All rights reserved. # # This software is licensed under the BSD License, as described in # the file LICENSE.txt, which you should have received as part of # this distribution. #-- from sqlalchemy import func fro...
0
0
0
0
0
0
library/rpi_ws281x/__init__.py
paulhayes/rpi-ws281x-python
219
136305
# New canonical package, to support `import rpi_ws281x` from .rpi_ws281x import PixelStrip, Adafruit_NeoPixel, Color, ws from _rpi_ws281x import * __version__ = '4.3.0'
0
0
0
0
0
0
python/ql/test/3/query-tests/Expressions/Arguments/wrong_arguments.py
vadi2/codeql
4,036
136315
<filename>python/ql/test/3/query-tests/Expressions/Arguments/wrong_arguments.py<gh_stars>1000+ #Make sure that we handle keyword-only arguments correctly def f(a, *varargs, kw1, kw2="has-default"): pass #OK f(1, 2, 3, kw1=1) f(1, 2, kw1=1, kw2=2) #Not OK f(1, 2, 3, kw1=1, kw3=3) f(1, 2, 3, kw3=3) #ODASA-5897 ...
0
0
0
0
0
0
insights/parsr/examples/multipath_conf.py
lhuett/insights-core
121
136322
""" multipath_conf parses multipath.conf configuration files into nested dictionaries. """ import string from insights.parsr import (EOF, Forward, LeftCurly, Lift, Literal, LineEnd, RightCurly, Many, Number, OneLineComment, PosMarker, skip_none, String, QuotedString, WS, WSChar) from insights.parsr.quer...
0
3
0
0
3
0
Tests/modules/misc/test_system_namespaces.py
aisk/ironpython3
1,872
136332
<filename>Tests/modules/misc/test_system_namespaces.py # Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information. ''' Ensures we can import from .NET 2.0 namespaces and ty...
0
0
0
0
0
0
src/app/beer_garden/api/http/authentication/login_handlers/__init__.py
ExpressHermes/beer-garden
230
136347
from .basic import BasicLoginHandler from .certificate import CertificateLoginHandler LOGIN_HANDLERS = [BasicLoginHandler, CertificateLoginHandler]
0
0
0
0
0
0
src/deepqmc/extra/memory.py
zenoone/deepqmc
224
136353
<reponame>zenoone/deepqmc import collections import torch __all__ = () EMPTY_TYPES = (str, type(None), type({}.keys())) UNKNWON_CLASSES = set() def get_children(obj): if type(obj) in (dict, collections.defaultdict): return obj.items() if type(obj) is list or isinstance(obj, tuple): return (...
0
0
0
0
0
0
fetch_cord/run_rpc.py
TabulateJarl8/FetchCord
286
136365
#from __future__ import annotations from typing import Callable, Dict from pypresence import Presence, exceptions import time, sys # import info about system from .args import parse_args from .config import ConfigError, load_config from .computer.Computer import Computer args = parse_args() class Run_rpc: rpc...
8
0
6
1
15
0
tests/syntax/indentation_error_4.py
matan-h/friendly
287
136373
<reponame>matan-h/friendly<filename>tests/syntax/indentation_error_4.py '''Should raise IndentationError''' def f(): s = "a"\ "b" "c" f()
0
0
0
0
0
0
lenstronomy/GalKin/galkin_model.py
DarthLazar/lenstronomy
107
136379
from __future__ import annotations from lenstronomy.GalKin.numeric_kinematics import NumericKinematics from lenstronomy.GalKin.analytic_kinematics import AnalyticKinematics __all__ = ['GalkinModel'] class GalkinModel(object): """ this class handles all the kinematic modeling aspects of Galkin Excluded ar...
2
1
0
0
3
0
test/test_jit_disabled.py
xiaohanhuang/pytorch
183
136402
# Owner(s): ["oncall: jit"] import sys import os import contextlib import subprocess from torch.testing._internal.common_utils import TestCase, run_tests, TemporaryFileName @contextlib.contextmanager def _jit_disabled(): cur_env = os.environ.get("PYTORCH_JIT", "1") os.environ["PYTORCH_JIT"] = "0" try: ...
0
0
0
0
0
0
panel/depends.py
sthagen/holoviz-panel
601
136426
<gh_stars>100-1000 import param from param.parameterized import iscoroutinefunction from .widgets import Widget ipywidget_classes = {} def param_value_if_widget(arg): if isinstance(arg, Widget): return arg.param.value from .pane.ipywidget import IPyWidget if IPyWidget.applies(arg) and hasattr(...
0
0
0
0
0
0
mordred/PBF.py
ademidun/mordred
199
136429
from rdkit.Chem.rdMolDescriptors import CalcPBF from ._base import Descriptor __all__ = ("PBF",) class PBF(Descriptor): r"""PBF descriptor.""" __slots__ = () since = "1.1.2" require_3D = True @classmethod def preset(cls, version): yield cls() def description(self): ret...
0
0
0
0
0
1
fastreid/data/datasets/AirportALERT.py
NTU-ROSE/fast-reid
2,194
136433
<reponame>NTU-ROSE/fast-reid # encoding: utf-8 """ @author: <NAME> @contact: <EMAIL> """ import os from fastreid.data.datasets import DATASET_REGISTRY from fastreid.data.datasets.bases import ImageDataset __all__ = ['AirportALERT', ] @DATASET_REGISTRY.register() class AirportALERT(ImageDataset): """Airport ...
0
0
0
0
0
0
tests/test_uy.py
smithdc1/django-localflavor
619
136448
<filename>tests/test_uy.py from django.test import SimpleTestCase from localflavor.uy.forms import UYCIField, UYDepartmentSelect from localflavor.uy.util import get_validation_digit class UYLocalFlavorTests(SimpleTestCase): def test_UYDepartmentSelect(self): f = UYDepartmentSelect() out = '''<sel...
0
0
0
0
0
0
tests/test_guardduty/test_guardduty.py
gtourkas/moto
5,460
136455
import boto3 import sure # noqa # pylint: disable=unused-import from moto import mock_guardduty @mock_guardduty def test_create_detector(): client = boto3.client("guardduty", region_name="us-east-1") response = client.create_detector( Enable=True, ClientToken="745645734574758463758", ...
0
0
0
0
0
0
geoq/training/models.py
kaydoh/geoq
471
136477
<gh_stars>100-1000 # This technical data was produced for the U. S. Government under Contract No. W15P7T-13-C-F600, and # is subject to the Rights in Technical Data-Noncommercial Items clause at DFARS 252.227-7013 (FEB 2012) from django.db import models from django.contrib.auth.models import User from jsonfield import...
0
0
0
0
0
0
recipe_scrapers/farmhousedelivery.py
mathiazom/recipe-scrapers
811
136479
from __future__ import annotations import re from bs4 import Tag from ._abstract import AbstractScraper from ._utils import normalize_string """ NOTE: This website has at least 2 prominent layouts styles, so there are two logic blocks and 2 test cases to support in ingredients and instructions processing sec...
1
6
0
0
7
0
tests/test_data_tokenizers.py
leezu/gluon-nlp
2,461
136484
from __future__ import annotations import pytest import random import collections import pickle from uuid import uuid4 import os import unicodedata import tempfile from pkg_resources import parse_version import gluonnlp from gluonnlp.data.tokenizers import WhitespaceTokenizer, MosesTokenizer, JiebaTokenizer,\ Spacy...
1
1
0
0
2
0
netbox_onboarding/tests/test_netbox_keeper.py
fallenfuzz/ntc-netbox-plugin-onboarding
180
136511
"""Unit tests for netbox_onboarding.onboard module and its classes. (c) 2020 Network To Code 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 requi...
0
0
0
0
0
0
aries_cloudagent/vc/vc_ld/issue.py
kuraakhilesh8230/aries-cloudagent-python
247
136520
"""Verifiable Credential issuance methods.""" from ..ld_proofs import ( LinkedDataProof, ProofPurpose, sign, CredentialIssuancePurpose, DocumentLoaderMethod, LinkedDataProofException, ) from .models.credential import CredentialSchema async def issue( *, credential: dict, suite: Li...
4
1
0
0
5
0
third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py
wenfeifei/miniblink49
5,964
136526
<reponame>wenfeifei/miniblink49 # Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, ...
0
0
0
0
0
0
notebook/list_transpose.py
vhn0912/python-snippets
174
136545
import numpy as np import pandas as pd l_2d = [[0, 1, 2], [3, 4, 5]] arr_t = np.array(l_2d).T print(arr_t) print(type(arr_t)) # [[0 3] # [1 4] # [2 5]] # <class 'numpy.ndarray'> l_2d_t = np.array(l_2d).T.tolist() print(l_2d_t) print(type(l_2d_t)) # [[0, 3], [1, 4], [2, 5]] # <class 'list'> df_t = pd.DataFrame(l...
0
0
0
0
0
0
mindinsight/wizard/create_project.py
fapbatista/mindinsight
216
136553
# 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...
0
3
2
0
5
0
src/dispatch/plugins/dispatch_slack/modals/feedback/views.py
axellaurelut/dispatch
3,417
136555
import json from dispatch.enums import DispatchEnum from dispatch.incident.models import Incident from dispatch.feedback.enums import FeedbackRating class RatingFeedbackBlockId(DispatchEnum): anonymous: str = "anonymous_field" feedback: str = "feedback_field" rating: str = "rating_field" class RatingFe...
2
1
4
0
7
0
build/sage_bootstrap/levenshtein.py
bopopescu/sage
1,742
136557
# -*- coding: utf-8 -*- u""" Levenshtein Distance The Levenshtein distance between two words is the minimal number of edits that turn one word into the other. Here, "edit" means a single-letter addition, single-letter deletion, or exchange of a letter with another letter. http://en.wikipedia.org/wiki/Levenshtein_dist...
0
1
0
0
1
0
Algo and DSA/LeetCode-Solutions-master/Python/fixed-point.py
Sourav692/FAANG-Interview-Preparation
3,269
136562
<filename>Algo and DSA/LeetCode-Solutions-master/Python/fixed-point.py # Time: O(logn) # Space: O(1) class Solution(object): def fixedPoint(self, A): """ :type A: List[int] :rtype: int """ left, right = 0, len(A)-1 while left <= right: mid = left + (righ...
0
0
0
0
0
0
rj_gameplay/rj_gameplay/tactic/nmark_tactic.py
RoboJackets/robocup-software
200
136587
<reponame>RoboJackets/robocup-software<filename>rj_gameplay/rj_gameplay/tactic/nmark_tactic.py from dataclasses import dataclass from typing import List, Optional import stp.rc as rc import stp.tactic as tactic import stp.role as role import rj_gameplay.eval import rj_gameplay.skill as skills from rj_gameplay.skill i...
0
0
0
0
0
0
plato/processors/inbound_feature_tensors.py
cuiboyuan/plato
135
136617
<filename>plato/processors/inbound_feature_tensors.py """ Implements a Processor for converting MistNet features from numpy ndarrays to PyTorch tensors. """ import logging from typing import Any import torch from plato.processors import base class Processor(base.Processor): """ Implements a Processor for con...
0
0
0
0
0
0
scipy/stats/_variation.py
jake-is-ESD-protected/scipy
9,095
136647
<filename>scipy/stats/_variation.py import numpy as np from numpy.core.multiarray import normalize_axis_index from scipy._lib._util import _nan_allsame from ._stats_py import _chk_asarray, _contains_nan def _nanvariation(a, *, axis=0, ddof=0, keepdims=False): """ Private version of `variation` that ignores n...
0
0
0
0
0
0
python/tests/test_data.py
gbull25/ouster_example
344
136649
<filename>python/tests/test_data.py """Tests for lidar data parsing. Checks that the output of parsing hasn't changed unexpectedly. """ from os import path import numpy as np import pytest from ouster import client from ouster.client import _client pytest.register_assert_rewrite('ouster.client._digest') import oust...
0
0
0
0
0
0
tests/github/test_issue_0011.py
next-franciscoalgaba/python-benedict
365
136670
<gh_stars>100-1000 # -*- coding: utf-8 -*- from benedict import benedict import unittest class github_issue_0011_test_case(unittest.TestCase): def test_github_issue_0011(self): """ https://github.com/fabiocaccamo/python-benedict/issues/11 """ d = { 'lorem': [ ...
0
0
0
0
0
0
examples/synthetic/multiobjective_hartmann/in_code_demo.py
hase1128/dragonfly
675
136675
""" In code demo for multiobjective_hartmann -- <EMAIL> """ from dragonfly import load_config_file, multiobjective_maximise_functions # From current directory # from multiobjective_hartmann import compute_objectives, num_objectives from multiobjective_hartmann import hartmann3_by_2_1, hartmann6, hartmann3_by_2_2 ...
0
0
0
0
0
0
pydis_site/apps/content/tests/test_utils.py
Robin5605/site
700
136686
<reponame>Robin5605/site<filename>pydis_site/apps/content/tests/test_utils.py<gh_stars>100-1000 from pathlib import Path from django.http import Http404 from pydis_site.apps.content import utils from pydis_site.apps.content.tests.helpers import ( BASE_PATH, MockPagesTestCase, PARSED_CATEGORY_INFO, PARSED_HTML, PA...
0
0
0
0
0
0
django_migration_linter/cache.py
christianbundy/django-migration-linter
357
136712
<reponame>christianbundy/django-migration-linter<filename>django_migration_linter/cache.py<gh_stars>100-1000 import os import pickle class Cache(dict): def __init__(self, django_folder, database, cache_path): self.filename = os.path.join( cache_path, "{0}_{1}.pickle".format(django_...
0
0
0
0
0
0