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 |
|---|---|---|---|---|---|---|---|---|---|---|
filer/migrations/0013_image_width_height_to_float.py | messi19950304/django-file | 889 | 1784868 | # Generated by Django 3.0.8 on 2020-10-28 16:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies: list[tuple[str, str]] = [
('filer', '0012_file_mime_type'),
]
operations: list[object] = [
migrations.AlterField(
model_name='image',... | 0 | 0 | 2 | 0 | 2 | 0 |
skfem/mesh/mesh_hex_1.py | bhaveshshrimali/scikit-fem | 238 | 1784875 | from __future__ import annotations
from dataclasses import dataclass, replace
from typing import Type
import numpy as np
from numpy import ndarray
from ..element import Element, ElementHex1
from .mesh_3d import Mesh3D
from .mesh_tet_1 import MeshTet1
@dataclass(repr=False)
class MeshHex1(Mesh3D):
"""A standard ... | 5 | 5 | 3 | 0 | 13 | 0 |
Validation/RecoMET/python/METPostProcessor_cfi.py | ckamtsikis/cmssw | 852 | 1784882 | import FWCore.ParameterSet.Config as cms
from DQMServices.Core.DQMEDHarvester import DQMEDHarvester
################# Postprocessing #########################
METPostprocessing = DQMEDHarvester('METTesterPostProcessor')
################ Postprocessing Harvesting #########################
METPostprocessingHarvesting... | 0 | 0 | 0 | 0 | 0 | 0 |
cellrank/tl/estimators/__init__.py | WeilerP/cellrank | 172 | 1784886 | from cellrank.tl.estimators._base_estimator import BaseEstimator
from cellrank.tl.estimators.terminal_states import GPCCA, CFLARE, TermStatesEstimator
| 0 | 0 | 0 | 0 | 0 | 0 |
sts-b-dir/tasks.py | mzl9039/imbalanced-regression | 370 | 1784888 | <reponame>mzl9039/imbalanced-regression
import os
import nltk
import codecs
import logging
import numpy as np
from scipy.ndimage import convolve1d
from util import get_lds_kernel_window, STSShotAverage
def process_sentence(sent, max_seq_len):
'''process a sentence using NLTK toolkit'''
return nltk.word_tokeniz... | 0 | 0 | 0 | 0 | 0 | 0 |
EAC-code/TestCommitment.py | kvakil/BulletProofLib | 162 | 1784899 | import pytest
import petlib
@pytest.mark.task1
def test_petlib_present():
"""
Try to import Petlib and pytest to ensure they are
present on the system, and accessible to the python
environment
"""
import petlib
import pytest
assert True
@pytest.mark.task1
def test_code_present():
... | 0 | 0 | 0 | 0 | 0 | 0 |
distrax/_src/bijectors/block_test.py | kuperov/distrax | 278 | 1784906 | # 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/LICENSE-2.0
#
# Unless required by ... | 0 | 2 | 0 | 0 | 2 | 0 |
res/TensorFlowPythonExamples/examples/sum/__init__.py | periannath/ONE | 255 | 1784932 | <gh_stars>100-1000
import tensorflow as tf
in_ = tf.compat.v1.placeholder(dtype=tf.float32, shape=(1, 8, 8, 4), name="Hole")
op_ = tf.compat.v1.reduce_sum(in_, -1, True)
| 0 | 0 | 0 | 0 | 0 | 0 |
nmtpytorch/layers/decoders/xu.py | toshohirasawa/mmt-with-monolingual-data | 420 | 1784959 | # -*- coding: utf-8 -*-
from __future__ import annotations
from collections import defaultdict
import torch
from torch import nn
import torch.nn.functional as F
from ...utils.nn import get_rnn_hidden_state
from .. import FF
from ..attention import get_attention
class XuDecoder(nn.Module):
"""A decoder which impl... | 14 | 7 | 0 | 0 | 21 | 0 |
qtrader/agents/uniform.py | aaron8tang/qtrader | 381 | 1785019 | import numpy as np
from qtrader.agents.base import Agent
class UniformAgent(Agent):
"""Uniform agent."""
_id: str = 'uniform'
def __init__(self, action_space):
self.N = action_space.shape[0]
def act(self, observation) -> object:
return np.ones(self.N) / self.N
| 0 | 1 | 1 | 0 | 2 | 0 |
api_tests/actions/views/test_action_detail.py | gaybro8777/osf.io | 628 | 1785033 | import pytest
from api.base.settings.defaults import API_BASE
from api_tests.requests.mixins import NodeRequestTestMixin, PreprintRequestTestMixin
@pytest.mark.django_db
class TestActionDetailNodeRequests(NodeRequestTestMixin):
@pytest.fixture()
def url(self, node_request) -> object:
action = node_re... | 0 | 2 | 0 | 0 | 2 | 0 |
backend/rental/migrations/0008_support_price_range.py | g0v/tw-rental-house-data | 125 | 1785038 | <filename>backend/rental/migrations/0008_support_price_range.py
# Generated by Django 2.1.15 on 2021-10-26 04:49
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rental', '0007_more_property_type'),
]
operations = [
migrations.AddField(
... | 0 | 0 | 0 | 0 | 0 | 0 |
mmdeploy/codebase/mmrotate/models/rotated_anchor_head.py | grimoire/mmdeploy | 746 | 1785062 | <filename>mmdeploy/codebase/mmrotate/models/rotated_anchor_head.py<gh_stars>100-1000
# Copyright (c) OpenMMLab. All rights reserved.
import torch
from mmdeploy.codebase.mmdet import (get_post_processing_params,
pad_with_value_if_necessary)
from mmdeploy.codebase.mmrotate.core.post_... | 0 | 0 | 0 | 0 | 0 | 0 |
json_to_models/models/__init__.py | bogdandm/attrs-api-client | 111 | 1785064 | <reponame>bogdandm/attrs-api-client
from enum import Enum
from typing import Dict, List, Tuple
from ..dynamic_typing import ModelMeta
Index = str
ModelsStructureType = Tuple[List[dict], Dict[ModelMeta, ModelMeta]]
INDENT = " " * 4
OBJECTS_DELIMITER = "\n" * 3 # 2 blank lines
class ClassType(Enum):
Dataclass =... | 0 | 0 | 0 | 0 | 0 | 0 |
nnvm/tests/python/compiler/test_top_level3.py | mingwayzhang/tvm | 286 | 1785079 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 3 | 0 | 0 | 0 | 3 | 0 |
reviewboard/accounts/tests/test_review_request_visit.py | amalik2/reviewboard | 921 | 1785101 | <filename>reviewboard/accounts/tests/test_review_request_visit.py
"""Unit tests for reviewboard.accounts.models.ReviewRequestVisit."""
from __future__ import unicode_literals
from reviewboard.accounts.models import ReviewRequestVisit
from reviewboard.testing import TestCase
class ReviewRequestVisitTests(TestCase):
... | 0 | 0 | 0 | 0 | 0 | 0 |
Python/Average_for_3test.py | PushpneetSingh/Hello-world | 1,428 | 1785149 | <reponame>PushpneetSingh/Hello-world<gh_stars>1000+
# Get three test score
r1, r2, r3 = map(int, (input("enter the scores ").split()))
# Print out the test score
print ("the average score is: ", (r1 + r2 + r3) / 3)
| 0 | 0 | 0 | 0 | 0 | 0 |
calamari_ocr/ocr/dataset/imageprocessors/data_preprocessor.py | jacektl/calamari | 922 | 1785163 | <filename>calamari_ocr/ocr/dataset/imageprocessors/data_preprocessor.py
from abc import ABC, abstractmethod
from tfaip.data.pipeline.definitions import Sample
from tfaip.data.pipeline.processor.dataprocessor import MappingDataProcessor, T
import logging
logger = logging.getLogger(__name__)
class ImageProcessor(Mapp... | 0 | 0 | 0 | 0 | 0 | 0 |
mmselfsup/datasets/single_view.py | mitming/mmselfsup | 355 | 1785177 | # Copyright (c) OpenMMLab. All rights reserved.
from __future__ import annotations
import torch
from mmcv.utils import print_log
from .base import BaseDataset
from .builder import DATASETS
from .utils import to_numpy
@DATASETS.register_module()
class SingleViewDataset(BaseDataset):
"""The dataset outputs one vie... | 3 | 2 | 0 | 0 | 5 | 0 |
chapter07/detect_people_hog.py | ankona/Learning-OpenCV-4-Computer-Vision-with-Python-Third-Edition | 286 | 1785180 | <gh_stars>100-1000
import cv2
def is_inside(i, o):
ix, iy, iw, ih = i
ox, oy, ow, oh = o
return ix > ox and ix + iw < ox + ow and \
iy > oy and iy + ih < oy + oh
hog = cv2.HOGDescriptor()
hog.setSVMDetector(cv2.HOGDescriptor_getDefaultPeopleDetector())
img = cv2.imread('../images/haying.jpg')
fo... | 0 | 0 | 0 | 0 | 0 | 0 |
data_convert/task_format/task_format.py | wlof-2/Text2Relation | 107 | 1785183 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
class TaskFormat:
def generate_sentence(self): pass
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/unit/test_speech.py | oleguldberg/nvda | 1,592 | 1785186 | # A part of NonVisual Desktop Access (NVDA)
# This file is covered by the GNU General Public License.
# See the file COPYING for more details.
# Copyright (C) 2021 NV Access Limited, <NAME>
"""Unit tests for the speech module.
"""
import unittest
import gettext
import typing
import config
from speech import... | 2 | 2 | 3 | 1 | 8 | 0 |
sympy/interactive/__init__.py | iamabhishek0/sympy | 445 | 1785199 | <reponame>iamabhishek0/sympy
"""Helper module for setting up interactive SymPy sessions. """
from .printing import init_printing
from .session import init_session
| 0 | 0 | 0 | 0 | 0 | 0 |
setup.py | symphorien/pyls-mypy | 119 | 1785207 | <reponame>symphorien/pyls-mypy
#!/usr/bin/env python
from setuptools import setup
import versioneer
if __name__ == "__main__":
setup(version=versioneer.get_version(), cmdclass=versioneer.get_cmdclass())
| 0 | 0 | 0 | 0 | 0 | 0 |
kopf/_core/intents/stoppers.py | tavaresrodrigo/kopf | 855 | 1785220 | import enum
from kopf._cogs.aiokits import aioenums
class DaemonStoppingReason(enum.Flag):
"""
A reason or reasons of daemon being terminated.
Daemons are signalled to exit usually for two reasons: the operator itself
is exiting or restarting, so all daemons of all resources must stop;
or the in... | 0 | 0 | 0 | 0 | 0 | 0 |
fabfile.py | thoppe/NLPre | 186 | 1785232 | from fabric.api import local
exclude_command = "--exclude nlpre/spacy_models/"
def test():
local("nosetests --with-coverage --cover-package nlpre --cover-html")
def lint():
local(f"black -l 80 nlpre tests *.py {exclude_command}")
local(f"flake8 nlpre --ignore=E501,E203,W503 {exclude_command}")
def vi... | 0 | 0 | 0 | 0 | 0 | 0 |
lib/adb/DockerEmulator.py | Berlin-231/Android-Malware-Sandbox | 218 | 1785242 | from .Emulator import Emulator, Device
from external.containers.emu import docker_device, emu_docker, emu_downloads_menu
import subprocess
import logging
import time
import sys
class DockerEmulator(Emulator):
def __init__(self, path_config, configuration, ):
Device.__init__(self, path_config, configurat... | 0 | 0 | 0 | 0 | 0 | 0 |
casper4/simple_casper.v.py | kevaundray/research | 1,351 | 1785261 | <filename>casper4/simple_casper.v.py
# Information about validators
validators: public({
# Amount of wei the validator holds
deposit: wei_value,
# The dynasty the validator is joining
dynasty_start: num,
# The dynasty the validator joined for the first time
original_dynasty_start: num,
# The... | 0 | 0 | 0 | 0 | 0 | 0 |
rltime/env_wrappers/vec_env/simple.py | frederikschubert/rltime | 147 | 1785264 | <filename>rltime/env_wrappers/vec_env/simple.py
from .common import VecEnv, stack_vec_obs
import numpy as np
class SimpleVecEnv(VecEnv):
"""A simple vec-env not using sub-processes.
Can be faster then the 'SubProc' version for simple envs like cartpole
"""
def __init__(self, envs):
VecEnv.__i... | 0 | 0 | 0 | 0 | 0 | 0 |
L1TriggerOffline/L1Analyzer/python/bscTrigger_cfi.py | ckamtsikis/cmssw | 852 | 1785325 | <reponame>ckamtsikis/cmssw<filename>L1TriggerOffline/L1Analyzer/python/bscTrigger_cfi.py
import FWCore.ParameterSet.Config as cms
bscTrigger=cms.EDProducer("BSCTrigger",
bitNumbers=cms.vuint32(32,33,34,35,36,37,38,39,40,41,42,43),
bitNames=cms.vstring( 'L1Tech_BSC_min... | 0 | 0 | 0 | 0 | 0 | 0 |
sleekxmpp/plugins/xep_0033/__init__.py | E-Tahta/sleekxmpp | 499 | 1785341 | """
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2012 <NAME>, <NAME>
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
"""
from sleekxmpp.plugins.base import register_plugin
from sleekxmpp.plugins.xep_0033 import stanza
from sleekxmpp.plugins.xep_0033.stanza import Addre... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/fixtures/foo_sub_namespaced1_command.py | Ivoz/cleo | 859 | 1785383 | from cleo.commands.command import Command
from cleo.io.io import IO
class FooSubNamespaced1Command(Command):
name: str = "foo bar baz"
description: str = "The foo bar baz command"
aliases: list[str] = ["foobarbaz"]
def handle(self) -> int:
return 0
| 0 | 1 | 3 | 0 | 4 | 0 |
third_party/gsutil/third_party/httplib2/python2/ssl_protocol_test.py | tingshao/catapult | 2,151 | 1785399 | """Tests for SSL handling in httplib2."""
import httplib2
import os
import ssl
import sys
import unittest
class TestSslProtocol(unittest.TestCase):
def testSslCertValidationWithInvalidCaCert(self):
if sys.version_info >= (2, 6):
http = httplib2.Http(ca_certs='/nosuchfile')
if sys.version_info >= (... | 0 | 0 | 0 | 0 | 0 | 0 |
Code/Chenglong/run_stacking_ridge.py | ChenglongChen/Kaggle_Homedepot | 465 | 1785424 | <filename>Code/Chenglong/run_stacking_ridge.py
# -*- coding: utf-8 -*-
"""
@author: <NAME> <<EMAIL>>
@brief: script for testing 2nd & 3rd level model with reg_skl_ridge
"""
import os
from optparse import OptionParser
from utils import time_utils
def parse_args(parser):
parser.add_option("-l", "--level", defaul... | 0 | 0 | 0 | 0 | 0 | 0 |
adapt/entity_tagger.py | DodoHan/mycroft-core-zh | 796 | 1785435 | <gh_stars>100-1000
# Copyright 2018 Mycroft AI 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 ... | 0 | 0 | 0 | 0 | 0 | 0 |
skl2onnx/operator_converters/cross_decomposition.py | twosense/sklearn-onnx | 323 | 1785437 | <filename>skl2onnx/operator_converters/cross_decomposition.py
# SPDX-License-Identifier: Apache-2.0
import numpy as np
from ..proto import onnx_proto
from ..common._registration import register_converter
from ..common._topology import Scope, Operator
from ..common._container import ModelComponentContainer
from ..commo... | 0 | 0 | 0 | 0 | 0 | 0 |
detection/pixel_link/util/dtype.py | HLIG/HUAWEI_OCR2019 | 211 | 1785439 | #coding=utf-8
'''
Created on 2016年9月27日
@author: dengdan
'''
import numpy as np
float32 = 'float32'
floatX = float32
int32 = 'int32'
uint8 = 'uint8'
string = 'str'
def cast(obj, dtype) -> object:
if isinstance(obj, list):
return np.asarray(obj, dtype = floatX)
return np.cast[dtype](obj)
def int(obj) ... | 0 | 7 | 0 | 0 | 7 | 0 |
Natural Language Processing Fundamentals in Python/Chapter 4 - Building a fake news classifier.py | nabeelsana/DataCamp-courses | 464 | 1785527 | #---------------------------------------------------------------------------------------------------------------#
#Chapter 4 Building a "fake news" classifier
#---------------------------------------------------------------------------------------------------------------#
#CountVectorizer for text classification
#... | 0 | 1 | 0 | 0 | 1 | 0 |
src/pytorch_metric_learning/losses/subcenter_arcface_loss.py | cwkeam/pytorch-metric-learning | 143 | 1785534 | <filename>src/pytorch_metric_learning/losses/subcenter_arcface_loss.py
import math
import numpy as np
import torch
from ..utils import common_functions as c_f
from .arcface_loss import ArcFaceLoss
class SubCenterArcFaceLoss(ArcFaceLoss):
"""
Implementation of https://www.ecva.net/papers/eccv_2020/papers_ECC... | 0 | 0 | 0 | 0 | 0 | 0 |
script.mrknow.urlresolver/lib/urlresolver9/plugins/promptfile.py | mrknow/filmkodi | 105 | 1785563 | <filename>script.mrknow.urlresolver/lib/urlresolver9/plugins/promptfile.py
'''
urlresolver XBMC Addon
Copyright (C) 2013 Bstrdsmkr
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of ... | 0 | 0 | 0 | 0 | 0 | 0 |
usaspending_api/references/migrations/0042_popcounty.py | g4brielvs/usaspending-api | 217 | 1785582 | <filename>usaspending_api/references/migrations/0042_popcounty.py<gh_stars>100-1000
# Generated by Django 2.2.10 on 2020-03-27 21:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('references', '0042_cgac_is_shared'),
]
operations = [
m... | 0 | 0 | 0 | 0 | 0 | 0 |
UEM-Samples/Utilities and Tools/Generic/App Upload/Mobile CICD Script/api_client/application_api.py | dholliman/euc-samples | 127 | 1785595 | from __future__ import annotations
import requests
import json
from config import config
from api_client.url_helpers.internal_app_url import get_create_internal_app_from_blob_url, get_edit_assignment_url
from api_client.url_helpers.internal_app_url import get_retire_app_url, get_internal_app_assignment_url
from Logs.l... | 0 | 4 | 0 | 0 | 4 | 0 |
utils/get_codes_from_unicode_emoji_data_files.py | brutus/emoji | 1,471 | 1785609 | <reponame>brutus/emoji
# -*- coding: utf-8 -*-
"""
Extract the full list of emoji and names from the Unicode emoji data files
https://unicode.org/Public/emoji/{v}/emoji-test.txt and
https://www.unicode.org/Public/{v}/ucd/emoji/emoji-variation-sequences.txt
and apply as much formatting as possible so the codes can be d... | 0 | 0 | 0 | 0 | 0 | 0 |
airbyte-cdk/python/airbyte_cdk/__init__.py | darian-heede/airbyte | 6,215 | 1785611 | from .connector import AirbyteSpec, Connector
from .entrypoint import AirbyteEntrypoint
from .logger import AirbyteLogger
__all__ = ["AirbyteEntrypoint", "AirbyteLogger", "AirbyteSpec", "Connector"]
| 0 | 0 | 0 | 0 | 0 | 0 |
examples/dynamic-client/accept_header.py | venukarnati92/python-1 | 4,417 | 1785622 | # Copyright 2021 The Kubernetes 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 ... | 0 | 0 | 0 | 0 | 0 | 0 |
_solved/solutions/04-spatial-joins13.py | lleondia/geopandas-tutorial | 341 | 1785666 | # Make a plot of the land use with 'class' as the color
land_use.plot(column='class', legend=True, figsize=(15, 10)) | 0 | 0 | 0 | 0 | 0 | 0 |
lightnlp/tc/re/utils/preprocess.py | CNLPT/lightNLP | 889 | 1785667 | import jieba
def handle_line(entity1, entity2, sentence, begin_e1_token: str='<e1>', end_e1_token: str='</e1>', begin_e2_token: str='<e2>',
end_e2_token: str='</e2>') -> object:
assert entity1 in sentence
assert entity2 in sentence
sentence = sentence.replace(entity1, begin_e1_token + enti... | 4 | 1 | 0 | 0 | 5 | 0 |
python/test/solver/test_solver.py | daniel-falk/nnabla | 2,792 | 1785686 | # Copyright 2019,2020,2021 Sony Corporation.
#
# 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... | 0 | 0 | 0 | 0 | 0 | 0 |
darts/dataprocessing/transformers/__init__.py | micronoz/darts | 3,756 | 1785698 | <reponame>micronoz/darts
"""
Data Transformers
-----------------
"""
from .base_data_transformer import BaseDataTransformer
from .fittable_data_transformer import FittableDataTransformer
from .invertible_data_transformer import InvertibleDataTransformer
from .scaler import Scaler
from .missing_values_filler import Mis... | 0 | 0 | 0 | 0 | 0 | 0 |
pwncat/target.py | Mitul16/pwncat | 1,454 | 1785707 | """
A target is the data structure stored in the ZODB. It contains all enumerated
facts, installed implants, unique ID, last remote address identified and other
information needed across pwncat sessions to identify or interact with a target.
No information in this object is specific to a connection protocol or session.... | 0 | 2 | 0 | 13 | 15 | 0 |
gmusicapi/clients/__init__.py | maxjoehnk/gmusicapi | 1,621 | 1785715 | <gh_stars>1000+
from gmusicapi.clients.webclient import Webclient
from gmusicapi.clients.musicmanager import Musicmanager
from gmusicapi.clients.mobileclient import Mobileclient
(Webclient, Musicmanager, Mobileclient) # noqa
| 0 | 0 | 0 | 0 | 0 | 0 |
src/encoded/reports/batch_download.py | procha2/encoded | 102 | 1785725 | from encoded.reports.constants import BATCH_DOWNLOAD_COLUMN_TO_FIELDS_MAPPING
from encoded.reports.constants import SERIES_BATCH_DOWNLOAD_COLUMN_TO_FIELDS_MAPPING
from encoded.reports.constants import METADATA_LINK
from encoded.reports.constants import AT_IDS_AS_JSON_DATA_LINK
from encoded.reports.metadata import Metad... | 0 | 11 | 6 | 0 | 17 | 0 |
utils/log.py | yu-iskw/elementary | 282 | 1785726 | import logging
import sys
from utils.env_vars import is_debug_mode_on
FORMATTER = logging.Formatter("%(asctime)s — %(name)s — %(levelname)s — %(message)s")
LOG_FILE = "edr.log"
def get_console_handler() -> object:
console_handler = logging.StreamHandler(sys.stdout)
console_handler.setFormatter(FORMATTER)
... | 0 | 3 | 0 | 0 | 3 | 0 |
causallib/contrib/hemm/gen_synthetic_data.py | liranszlak/causallib | 350 | 1785758 | <gh_stars>100-1000
# (C) Copyright 2019 IBM Corp.
#
# 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 ag... | 0 | 0 | 0 | 0 | 0 | 0 |
netbox/extras/graphql/schema.py | TheFlyingCorpse/netbox | 4,994 | 1785794 | import graphene
from netbox.graphql.fields import ObjectField, ObjectListField
from .types import *
class ExtrasQuery(graphene.ObjectType):
config_context = ObjectField(ConfigContextType)
config_context_list = ObjectListField(ConfigContextType)
custom_field = ObjectField(CustomFieldType)
custom_fiel... | 0 | 0 | 0 | 0 | 0 | 0 |
lambeq/training/dataset.py | CQCL/lambeq | 131 | 1785803 | <filename>lambeq/training/dataset.py<gh_stars>100-1000
# Copyright 2021, 2022 Cambridge Quantum Computing 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/li... | 0 | 0 | 0 | 0 | 0 | 0 |
check_model.py | alinlab/L2T-ww | 260 | 1785815 | from models import resnet_ilsvrc
from models import resnet_cifar as cresnet, vgg_cifar as cvgg
def check_model(opt) -> object:
if opt.model.startswith('resnet'):
if opt.dataset in ['cub200', 'indoor', 'stanford40', 'flowers102', 'dog', 'tinyimagenet']:
ResNet = resnet_ilsvrc.__dict__[opt.model... | 0 | 1 | 0 | 0 | 1 | 0 |
objectModel/Python/tests/persistence/cdmfolder/entity_attribute/test_cdm_entity_attribute.py | rt112000/CDM | 884 | 1785816 | <filename>objectModel/Python/tests/persistence/cdmfolder/entity_attribute/test_cdm_entity_attribute.py
import unittest
from cdm.objectmodel import CdmCorpusDefinition
from cdm.persistence.cdmfolder.entity_attribute_persistence import EntityAttributePersistence
from cdm.utilities import JObject
class CdmEntityAttribut... | 0 | 0 | 0 | 0 | 0 | 0 |
vuecli/provider/flask.py | adamlwgriffiths/vue.py | 274 | 1785817 | <reponame>adamlwgriffiths/vue.py
import os
from pathlib import Path
from flask import Flask as FlaskApp, send_file, abort
from .provider import Provider
class Flask(Provider):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.app = FlaskApp(__name__)
def content(se... | 0 | 0 | 0 | 0 | 0 | 0 |
Demo_detect_video.py | argusswift/SSD-pytorch | 379 | 1785836 | # -*- coding: utf-8 -*-
# @Author : LG
from Model import SSD
from Configs import _C as cfg
# 实例化模型
net = SSD(cfg)
# 使用cpu或gpu
net.to('cuda')
# 模型从权重文件中加载权重
net.load_pretrained_weight('Weights/pretrained/vgg_ssd300_voc0712.pkl')
video_path = 'aaa.mp4'
# 进行检测,
# if save_video_path不为None,则不保存视频,如需保存视频save_video_path=a... | 0 | 0 | 0 | 0 | 0 | 0 |
spotfinder/math_support/sphere_formulae.py | dperl-sol/cctbx_project | 155 | 1785850 | <gh_stars>100-1000
from __future__ import absolute_import, division, print_function
from six.moves import range
import math
"""radius is taken to be d_star, or 1/resolution limit in units of distance"""
def sphere_volume(radius):
return (4./3.)*math.pi*math.pow(radius,3)
def vol_of_Ewald_sphere_solid_of_revolution... | 0 | 0 | 0 | 0 | 0 | 0 |
alembic/versions/ae347beeb622_celebrities_table_add_is_detail_column.py | billvsme/videoSpider | 216 | 1785870 | """celebrities table add is_detail column
Revision ID: ae347beeb622
Revises: <KEY>
Create Date: 2016-02-21 23:38:46.913557
"""
# revision identifiers, used by Alembic.
revision = 'ae347beeb622'
down_revision = '<KEY>'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrad... | 0 | 0 | 0 | 0 | 0 | 0 |
solutions/problem_149.py | ksvr444/daily-coding-problem | 1,921 | 1785890 | from __future__ import annotations
class SubarraySumOptimizer:
def __init__(self, arr):
self.arr = arr
total = 0
self.larr: list[object] = [total]
for num in self.arr:
total += num
self.larr.append(total)
def sum(self, start, end) -> int | object:
... | 0 | 1 | 0 | 1 | 2 | 0 |
floppy/runner.py | x75/Floppy | 147 | 1785898 | from __future__ import annotations
"""
Module implementing a program for executing a Floppy graph.
The program can be called from the Floppy editor but will run independently from the calling process.
Communication between the editor and the runner is realized via Sockets.
The runner will report its status to the edito... | 2 | 9 | 0 | 21 | 32 | 0 |
tools/test_users/open_prs.py | edwardcwang/coreir | 104 | 1785900 | <reponame>edwardcwang/coreir
#!/usr/bin/env python
import github3
from netrc import netrc
netrc = netrc('github.netrc')
login, _, password = netrc.authenticators('api.github.com')
g = github3.login(login, password)
coreir = g.repository("rdaly525", "coreir")
coreir_pr = [_ for _ in coreir.pull_requests(state="open",... | 0 | 0 | 0 | 0 | 0 | 0 |
anytree/node/util.py | odidev/anytree | 700 | 1785955 | from __future__ import annotations
def _repr(node, args: object | None=None, nameblacklist: object | None=None) -> object:
classname = node.__class__.__name__
args = args or []
nameblacklist = nameblacklist or []
for key, value in filter(lambda item: not item[0].startswith("_") and item[0] not in namebl... | 2 | 1 | 0 | 0 | 3 | 0 |
benchmarks/api_hour/benchmarks/benchmarks/endpoints/benchmarks.py | Ovvovy/API-Hour | 571 | 1785963 | <gh_stars>100-1000
import asyncio
from api_hour.plugins.aiohttp import JSON
from .. import services
async def agents(request):
return JSON(await services.agents.list(request.app['ah_container'])) | 0 | 0 | 0 | 0 | 0 | 0 |
modules/chempy/cc1.py | dualword/pymol-open-source | 636 | 1785972 | <gh_stars>100-1000
#A* -------------------------------------------------------------------
#B* This file contains source code for the PyMOL computer program
#C* copyright 1998-2000 by <NAME> of DeLano Scientific.
#D* -------------------------------------------------------------------
#E* It is unlawful to modify or rem... | 0 | 0 | 0 | 0 | 0 | 0 |
twitter_problems/problem_7.py | loftwah/Daily-Coding-Problem | 129 | 1785975 | """
Good morning! Here's your coding interview problem for today.
This problem was asked by Twitter.
A network consists of nodes labeled 0 to N. You are given a list of edges (a, b, t),
describing the time t it takes for a message to be sent from node a to node b.
Whenever a node receives a message, it immediately ... | 0 | 0 | 0 | 0 | 0 | 0 |
jcvi/assembly/__main__.py | paradoxcell/jcvi | 517 | 1785985 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Assemblage of genome-assembly related scripts: ALLMAPS algorithm, scaffolding, k-mer analysis, QC, tool wrappers, etc.
"""
from jcvi.apps.base import dmain
if __name__ == "__main__":
dmain(__file__)
| 0 | 0 | 0 | 0 | 0 | 0 |
cape_privacy/pandas/transformations/__init__.py | vismaya-Kalaiselvan/cape-python | 144 | 1785988 | <gh_stars>100-1000
from cape_privacy.pandas.transformations.column_redact import ColumnRedact
from cape_privacy.pandas.transformations.perturbation import DatePerturbation
from cape_privacy.pandas.transformations.perturbation import NumericPerturbation
from cape_privacy.pandas.transformations.rounding import DateTrunca... | 0 | 0 | 0 | 0 | 0 | 0 |
posenet_engine_test.py | petcupaula/project-posenet | 451 | 1785993 | # Lint as: python3
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 0 | 0 | 0 | 0 | 0 | 0 |
hvad/test_utils/project/manage.py | Kunpors/dr.pors- | 341 | 1786002 | #!/usr/bin/env python
from django.core.management import execute_from_command_line
import sys
import os
BASEDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.insert(0, BASEDIR)
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hvad.test_utils.project.settings"... | 0 | 0 | 0 | 0 | 0 | 0 |
.github/extract-snippets/extract-snippets.py | iconara/aws-doc-sdk-examples | 5,166 | 1786009 | # extract-snippets.py v1.2.0 6/24/2021
# <NAME>, Amazon Web Services
# extracts tagged regions from source files and writes them to a snippets directory.
# reads list of paths from stdin and extracts snippets from these files. Takes the
# directory to which snippets should be extracted as a command line argument. Th... | 1 | 7 | 0 | 3 | 11 | 0 |
fuxi/core/databases/orm/exploit/http_log_orm.py | cocobear/fuxi | 731 | 1786030 | <gh_stars>100-1000
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author : jeffzhang
# @Time : 2019/9/5
# @File : http_log_orm.py
# @Desc : ""
import time
from fuxi.core.databases.db_error import DatabaseError
from fuxi.core.databases.orm.database_base import DatabaseBase
from fuxi.core.databases.db_mongo ... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/controls/test_multiclasssubmitter.py | vishalbelsare/superintendent | 157 | 1786091 | import pytest
import ipywidgets
from hypothesis import strategies as st
from hypothesis import given, settings
from superintendent import controls
from superintendent.controls import togglebuttongroup
from superintendent.controls import hintedmultiselect
DUMMY_KEYUP_DICT_ENTER = {
"altKey": False,
"ctrlKey... | 0 | 0 | 0 | 0 | 0 | 0 |
Skype4Py/lang/pl.py | low456high/Skype4Py | 199 | 1786096 | apiAttachAvailable = u'API jest dost\u0119pne'
apiAttachNotAvailable = u'Niedost\u0119pny'
apiAttachPendingAuthorization = u'Autoryzacja w toku'
apiAttachRefused = u'Odmowa'
apiAttachSuccess = u'Sukces'
apiAttachUnknown = u'Nieznany'
budDeletedFriend = u'Usuni\u0119ty z listy znajomych'
budFriend = u'Znajomy'
budNeverB... | 0 | 0 | 0 | 0 | 0 | 0 |
pywick/models/segmentation/testnets/lg_kernel_exfuse/__init__.py | achaiah/pywick | 408 | 1786099 | <gh_stars>100-1000
from .large_kernel_exfuse import * | 0 | 0 | 0 | 0 | 0 | 0 |
gdc_client/parcel/portability.py | jrouly/gdc-client | 139 | 1786110 | <gh_stars>100-1000
# ***************************************************************************************
# Title: LabAdvComp/parcel
# Author: <NAME>
# Date: May 26, 2016
# Code version: 0.1.13
# Availability: https://github.com/LabAdvComp/parcel
# ********************************************************************... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/openioc_to_misp.py | chrisinmtown/PyMISP | 307 | 1786126 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
from pymisp import PyMISP
from keys import misp_url, misp_key, misp_verifycert
from pymisp.tools import load_openioc_file
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Convert an OpenIOC file to a MISPEvent. Optionnaly send... | 0 | 0 | 0 | 0 | 0 | 0 |
nndet/io/patching.py | joeranbosma/nnDetection | 242 | 1786136 | """
Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
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/L... | 25 | 9 | 0 | 0 | 34 | 0 |
lexos/helpers/constants.py | WheatonCS/Lexos | 107 | 1786167 | import getpass
import os
# Configurations
IS_SERVER = False
DUMPING = True
# File directories
FILE_CONTENTS_FOLDER = "filecontents/"
RESULTS_FOLDER = "analysis_results/"
WORKSPACE_DIR = "workspace/"
TMP_FOLDER = os.path.expanduser(
"~\\AppData\\Local\\Temp") if os.name == "nt" else "/tmp/"
UPLOAD_FOLDER = os.pa... | 0 | 0 | 0 | 0 | 0 | 0 |
jug/tests/test_hooks.py | rdenham/jug | 309 | 1786189 | <filename>jug/tests/test_hooks.py
import pytest
from jug.hooks import register_hook, register_hook_once, reset_all_hooks, jug_hook
A = []
def inc_A():
A.append(0)
@pytest.fixture(scope='function')
def reset_hooks_at_exit():
yield
reset_all_hooks()
del A[:] # A.clear() is not available in Python 2.x
... | 0 | 0 | 0 | 0 | 0 | 0 |
api/python/quilt3/backends/s3.py | rekon/quilt | 1,115 | 1786203 | <reponame>rekon/quilt
from quilt3.data_transfer import S3Api, S3ClientProvider, get_bytes, list_url
from quilt3.util import PhysicalKey
from .base import PackageRegistryV1, PackageRegistryV2
def s3_list_objects(**kwargs):
s3_client = S3ClientProvider().find_correct_client(S3Api.LIST_OBJECTS_V2, kwargs['Bucket'],... | 0 | 0 | 0 | 0 | 0 | 0 |
rkqc/tools/gui/items/PatternInputItem.py | clairechingching/ScaffCC | 158 | 1786233 | # RevKit: A Toolkit for Reversible Circuit Design (www.revkit.org)
# Copyright (C) 2009-2011 The RevKit Developers <<EMAIL>>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 o... | 1 | 4 | 0 | 0 | 5 | 0 |
pyjobs/core/templatetags/core_tags.py | Mdslino/PyJobs | 132 | 1786268 | <filename>pyjobs/core/templatetags/core_tags.py
from django import template
register = template.Library()
@register.simple_tag(takes_context=True)
def merge_query_params(context, **kwargs):
query_params = context["request"].GET.copy()
for k, v in kwargs.items():
query_params[k] = v
return query... | 0 | 0 | 0 | 0 | 0 | 0 |
marley/gamey/model_free.py | cool-RR/grid_royale | 255 | 1786287 | <reponame>cool-RR/grid_royale
# Copyright 2020 <NAME> and collaborators.
# This program is distributed under the MIT license.
from __future__ import annotations
import random
import weakref
import concurrent.futures
import numbers
import functools
import collections.abc
from typing import (Iterable, Union, Optional, ... | 0 | 0 | 0 | 0 | 0 | 0 |
test/tcp-server.py | lupyuen/evm | 485 | 1786293 | <gh_stars>100-1000
# coding:utf-8
import signal
import socket
import time
import threading
class GracefulKiller:
kill_now = False
def __init__(self):
signal.signal(signal.SIGINT, self.exit_gracefully)
signal.signal(signal.SIGTERM, self.exit_gracefully)
def exit_gracefully... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/bazeldefs/pkg.bzl | xyzst/gvisor | 12,536 | 1786308 | """Packaging rules."""
# N.B. We refer to pkg_deb_impl to avoid the macro, which cannot use select.
load("@rules_pkg//:pkg.bzl", _pkg_deb = "pkg_deb_impl", _pkg_tar = "pkg_tar")
pkg_deb = _pkg_deb
pkg_tar = _pkg_tar
| 0 | 0 | 0 | 0 | 0 | 0 |
salesforce/defaults.py | agilentia/django-salesforce | 251 | 1786326 | <reponame>agilentia/django-salesforce
import datetime
import decimal
from typing import Any, Callable, Dict, Optional, overload, Tuple, Type, TYPE_CHECKING
from pytz import utc
# from django.utils.deconstruct import deconstructible
import salesforce # pylint:disable=unused-import
if TYPE_CHECKING:
import salesforc... | 0 | 0 | 0 | 0 | 0 | 0 |
cn_sort/__init__.py | bmxbmx3/cn_sort | 361 | 1786332 | from .decorator import *
from .process_cn_word import *
name="cn_sort" | 0 | 0 | 0 | 0 | 0 | 0 |
src/tools/factory-prov-tool/WeaveFactoryProvisioningTool.py | aiw-google/openweave-core | 249 | 1786339 | #!/usr/bin/env python3
#
# Copyright (c) 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.... | 22 | 25 | 10 | 4 | 61 | 0 |
plugins/talkbot.py | messense/wechat-bot | 115 | 1786364 | <reponame>messense/wechat-bot
#coding=utf-8
import os
import sys
sys.path.append('..')
import aiml
from tornado.options import options
__name__ = 'talkbot'
class TalkBot(aiml.Kernel):
def __init__(self):
super(TalkBot, self).__init__()
self.verbose(options.debug)
if os.path.exists(opti... | 0 | 0 | 0 | 0 | 0 | 0 |
ui/video-playback/video-playback.py | titanomachy/flight | 1,040 | 1786376 | <gh_stars>1000+
import dbus
from ctypes import c_longlong
bus = dbus.SessionBus()
parole = bus.get_object('org.Parole.Media.Player', '/org/Parole/Media/Player')
iface = dbus.Interface(parole, 'org.mpris.MediaPlayer2')
print parole.Introspect()
print iface.Introspect()
parole.SetPosition(dbus.ObjectPath("/org/mpri... | 0 | 0 | 0 | 0 | 0 | 0 |
code-preprocessing/archive-update/test_archives.py | cavalcantigor/coco | 181 | 1786380 | <gh_stars>100-1000
# A series of tests to check whether the python scripts of archive-update perform correctly.
# Start the tests by writing
# py.test
# or
# python -m pytest
# in a terminal window on this folder
from os.path import dirname, abspath, join, exists
from os import walk, remove, rmdir, chdir, chmod
def ... | 0 | 0 | 0 | 0 | 0 | 0 |
mudpi/extensions/bme680/__init__.py | icyspace/mudpi-core | 163 | 1786418 | <reponame>icyspace/mudpi-core
"""
BME680 Extension
Includes sensor interface for BME680.
Works on i2c over linux boards.
"""
from mudpi.extensions import BaseExtension
class Extension(BaseExtension):
namespace = 'bme680'
update_interval = 30
| 0 | 0 | 0 | 0 | 0 | 0 |
desktop/core/ext-py/mozilla-django-oidc-1.0.0/mozilla_django_oidc/auth.py | kokosing/hue | 5,079 | 1786420 | from __future__ import annotations
import base64
import hashlib
import json
import logging
import requests
from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend
from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured
try:
from django.urls import r... | 0 | 13 | 0 | 0 | 13 | 0 |
examples/src/dbnd_examples/features/custom_logging.py | ipattarapong/dbnd | 224 | 1786432 | <filename>examples/src/dbnd_examples/features/custom_logging.py
import logging
from dbnd import get_databand_context, new_dbnd_context, task
logger = logging.getLogger(__name__)
def custom_logging_mod():
base_config = get_databand_context().settings.log.get_dbnd_logging_config_base()
base_config["handlers... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_config/test_config_scope_chain.py | ahallermed/sacred | 3,895 | 1786453 | <reponame>ahallermed/sacred
#!/usr/bin/env python
# coding=utf-8
import pytest
from sacred.config import ConfigScope, ConfigDict, chain_evaluate_config_scopes
def test_chained_config_scopes_contain_combined_keys():
@ConfigScope
def cfg1():
a = 10
@ConfigScope
def cfg2():
b = 20
... | 0 | 0 | 0 | 0 | 0 | 0 |
src/ezdxf/sections/__init__.py | jkjt/ezdxf | 515 | 1786480 | <filename>src/ezdxf/sections/__init__.py
# Purpose: DXF section classes
# Created: 16.07.2015
# Copyright (c) 2015-2018, <NAME>
# License: MIT License
| 0 | 0 | 0 | 0 | 0 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.