max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 7 115 | max_stars_count int64 101 368k | id stringlengths 2 8 | content stringlengths 6 1.03M |
|---|---|---|---|---|
SandboxAgent/logging_helpers.py | lhoste-bell/knix | 167 | 12632538 | # Copyright 2020 The KNIX 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 agree... |
tests/test_modeling_albert.py | legacyai/tf-transformers | 116 | 12632570 | # coding=utf-8
# Copyright 2021 TF-Transformers 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 r... |
test/test_utils/pytest_cache.py | haohanchen-yagao/deep-learning-containers | 383 | 12632573 | import json
import os
import logging
import sys
LOGGER = logging.getLogger(__name__)
LOGGER.setLevel(logging.DEBUG)
LOGGER.addHandler(logging.StreamHandler(sys.stdout))
class PytestCache:
"""
A handler for pytest cache
Contains methods for uploading/dowloading pytest cache file to/from ec2 instances and ... |
kipoi/__init__.py | bfclarke/kipoi | 213 | 12632578 | <gh_stars>100-1000
from __future__ import absolute_import
__author__ = '<NAME>'
__email__ = '<EMAIL>'
from ._version import __version__
# available modules
from . import config
from . import pipeline
from kipoi_utils import utils # backward compat
from kipoi_utils import data_utils # backward compat
from . import ... |
tests/issues/gh182.py | aureooms-contrib/ics-py | 312 | 12632579 | <filename>tests/issues/gh182.py
from datetime import datetime
import pytest
from dateutil.tz import gettz
from ics import Todo
from ics.contentline import ContentLine, lines_to_container
def test_issue_182_seconds_ignored():
todo = Todo.from_container(lines_to_container([
"BEGIN:VTODO",
"DTSTART... |
sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_generated/v7_3_preview/models/_key_vault_client_enums.py | rsdoherty/azure-sdk-for-python | 2,728 | 12632592 | <reponame>rsdoherty/azure-sdk-for-python
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R... |
torchdyn/models/energy.py | iisabeller/torchdyn | 825 | 12632600 | <filename>torchdyn/models/energy.py
# 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 wri... |
redun/handle.py | cclauss/redun | 303 | 12632616 | <reponame>cclauss/redun<filename>redun/handle.py
from typing import Any, Optional, Tuple, Type
from redun.hashing import hash_struct
from redun.value import Value, get_type_registry
def get_handle_class(handle_class_name: str) -> Type["Handle"]:
"""
Returns a Handle class from the TypeRegistry.
"""
k... |
src/torchphysics/problem/samplers/data_samplers.py | TomF98/torchphysics | 203 | 12632638 | <filename>src/torchphysics/problem/samplers/data_samplers.py
"""File with samplers that handle external created data.
E.g. measurements or validation data computed with other methods.
"""
from .sampler_base import PointSampler
from ..spaces import Points
class DataSampler(PointSampler):
"""A sampler that process... |
Scripts/sims4communitylib/utils/cas/common_cas_utils.py | ColonolNutty/Sims4CommunityLibrary | 118 | 12632649 | <reponame>ColonolNutty/Sims4CommunityLibrary
"""
The Sims 4 Community Library is licensed under the Creative Commons Attribution 4.0 International public license (CC BY 4.0).
https://creativecommons.org/licenses/by/4.0/
https://creativecommons.org/licenses/by/4.0/legalcode
Copyright (c) COLONOLNUTTY
"""
import os
from... |
pygtkweb/demos/062-uimanager.py | takipsizad/pyjs | 739 | 12632661 | <gh_stars>100-1000
#!/usr/bin/env python
import pygtk
pygtk.require('2.0')
import gtk
class UIManagerExample:
ui = '''<ui>
<menubar name="MenuBar">
<menu action="File">
<menuitem action="Quit"/>
</menu>
<menu action="Sound">
<menuitem action="Mute"/>
</menu>
<menu... |
torchtyping/pytest_plugin.py | olliethomas/torchtyping | 881 | 12632675 | <reponame>olliethomas/torchtyping
from .typechecker import patch_typeguard
def pytest_addoption(parser):
group = parser.getgroup("torchtyping")
group.addoption(
"--torchtyping-patch-typeguard",
action="store_true",
help="Run torchtyping's typeguard patch.",
)
def pytest_configure... |
docs/basic_usage/bu03.py | jviide/htm.py | 112 | 12632683 | from htm import htm
@htm
def html(tag, props, children):
return tag, props, children
# start
name = 'World'
result03 = html("""
<div title="Say Hi">Hello {name}</div>
""")
|
plugins/Status/plugin.py | mogad0n/Limnoria | 476 | 12632715 | ###
# Copyright (c) 2002-2005, <NAME>
# Copyright (c) 2009, <NAME>
# Copyright (c) 2010-2021, The Limnoria Contributors
# 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 s... |
serpent/machine_learning/reinforcement_learning/ppo/policy.py | JackEasons/SerpentAI | 6,762 | 12632734 | <reponame>JackEasons/SerpentAI<filename>serpent/machine_learning/reinforcement_learning/ppo/policy.py
import torch
from .cnn_base import CNNBase
from .distributions import Categorical
class Policy(torch.nn.Module):
def __init__(self, observation_shape, action_space, recurrent_policy):
super().__init__()
... |
wam/settings.py | laozhudetui/wam | 227 | 12632749 | <gh_stars>100-1000
#!/usr/bin/env python
# coding: utf8
"""
Django settings for wam project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside ... |
true_coders/migrations/0038_auto_20210703_0011.py | horacexd/clist | 166 | 12632758 | # Generated by Django 3.1.12 on 2021-07-03 00:11
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
dependencies = [
('true_coders', '0037_auto_20210702_2355'),
]
operations = [
migrations.AddField(
mo... |
models/vision/detection/awsdet/datasets/loader/build_loader.py | kevinyang8/deep-learning-models | 129 | 12632767 | <gh_stars>100-1000
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
# -*- coding: utf-8 -*-
import tensorflow as tf
from .. import data_generator
from awsdet.utils.runner.dist_utils import get_dist_info
def build_dataloader(dataset,
... |
tests/test_queue_size.py | purificant/tasktiger | 1,143 | 12632770 | """Test max queue size limits."""
from multiprocessing import Process
import datetime
import os
import signal
import time
import pytest
from tasktiger import Task, Worker
from tasktiger.exceptions import QueueFullException
from .config import DELAY
from .tasks import decorated_task_max_queue_size, simple_task, slee... |
regtests/requirejs/webworker_p2js.py | ahakingdom/Rusthon | 622 | 12632774 | '''import p2.js inside webworker'''
# sudo npm install -g p2
import threading
from time import sleep
def main():
shared = []
w = threading.start_webworker( worker, [shared] )
sleep(1.0)
TestError( len(shared)==2 )
TestError( shared[0]==10 )
TestError( shared[1]==20 )
with webworker:
import p2
def worker( a... |
9.用两个栈实现队列/9.用两个栈实现队列.py | shenweichen/coding_interviews | 483 | 12632775 | # -*- coding:utf-8 -*-
class Solution:
stack1 = []
stack2 = []
def push(self, node):
# write code here
self.stack1.append(node)
def pop(self):
# return xx
if len(self.stack2)==0:
while len(self.stack1)!=0:
self.stack2.append(self.stack1[-1])
... |
src/YoutubeDataset.py | JasonQSY/YouTube3D | 102 | 12632794 | import numpy as np
import random
from utils import save_obj, load_obj
import torch
from torch.utils import data
import cv2
import os
import h5py
import random
from ReDWebNet import resNet_data_preprocess
def draw(img, target, fname):
img_temp = img.copy()
color_close = (255, 0, 0) # close is blue
color_far = (0... |
corehq/ex-submodules/casexml/apps/case/dbaccessors/related.py | akashkj/commcare-hq | 471 | 12632800 | from casexml.apps.case.sharedmodels import CommCareCaseIndex
def get_reverse_indices_json(domain, case_id):
from casexml.apps.case.models import CommCareCase
return CommCareCase.get_db().view(
"case_indices/related",
startkey=[domain, case_id, "reverse_index"],
endkey=[domain, case_id,... |
datatypes.py | loyalgarlic/snakepit-game | 124 | 12632802 | from collections import namedtuple
Position = namedtuple("Position", "x y")
Vector = namedtuple("Vector", "xdir ydir")
Char = namedtuple("Char", "char color")
Draw = namedtuple("Draw", "x y char color")
|
chaospy/distributions/collection/chi.py | utsekaj42/chaospy | 333 | 12632822 | """Chi distribution."""
import numpy
from scipy import special
from ..baseclass import SimpleDistribution, ShiftScaleDistribution
class chi(SimpleDistribution):
"""Chi distribution."""
def __init__(self, df=1):
super(chi, self).__init__(dict(df=df))
def _pdf(self, x, df):
return x**(df-... |
src/riotwatcher/_apis/league_of_legends/urls/__init__.py | acgandhi/Riot-Watcher | 489 | 12632883 | from .ChampionApiUrls import ChampionApiV3Urls
from .ChampionMasteryApiUrls import ChampionMasteryApiV4Urls
from .ClashApiUrls import ClashApiV1Urls
from .DataDragonUrls import DataDragonUrls
from .LeagueApiUrls import LeagueApiV4Urls
from .LolStatusApiUrls import LolStatusApiV3Urls
from .LolStatusApiV4Urls import LolS... |
Lib/objc/_UsageTracking.py | snazari/Pyto | 701 | 12632894 | <filename>Lib/objc/_UsageTracking.py
"""
Classes from the 'UsageTracking' framework.
"""
try:
from rubicon.objc import ObjCClass
except ValueError:
def ObjCClass(name):
return None
def _Class(name):
try:
return ObjCClass(name)
except NameError:
return None
USXPCRemoteObject... |
forte/utils/utils_processor.py | jzpang/forte | 163 | 12632895 | <gh_stars>100-1000
# Copyright 2021 The Forte 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 requ... |
application/frontend/templatetags/versiontag.py | cqkenuo/w12scan | 864 | 12632900 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2019/3/29 5:35 PM
# @Author : w8ay
# @File : versiontag.py
from django import template
from config import W12SCAN_VERSION
register = template.Library()
@register.simple_tag
def w12_version():
return W12SCAN_VERSION
|
reconstruction/reconstruction_model.py | garyxcheng/federated | 330 | 12632931 | # Copyright 2020, Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
src/genie/libs/parser/iosxr/monitor.py | balmasea/genieparser | 204 | 12632933 | """monitor.py
Iosxr parsers for the following show commands:
* monitor interface {interface}
"""
# Python
import re
import time
# Metaparser
from genie.metaparser import MetaParser
from genie.metaparser.util.schemaengine import (Any,
Optional, Use, SchemaTypeError, Schema)
from genie.libs.parse... |
Packs/CircleCI/Integrations/CircleCI/CircleCI_test.py | diCagri/content | 799 | 12633006 | import io
import json
import pytest
from typing import Tuple, Dict
from CircleCI import Client, circleci_workflows_list_command, circleci_artifacts_list_command, \
circleci_workflow_jobs_list_command, circleci_workflow_last_runs_command, DEFAULT_LIMIT_VALUE
from CommonServerPython import CommandResults
fake_clien... |
xmanager/xm/id_predictor_test.py | jurgisp/xmanager | 392 | 12633009 | # Copyright 2021 DeepMind Technologies Limited
#
# 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 agr... |
tests/checker/reputation/reputation_test_base.py | Centaurioun/PyFunceble | 213 | 12633012 | """
The tool to check the availability or syntax of domain, IP or URL.
::
██████╗ ██╗ ██╗███████╗██╗ ██╗███╗ ██╗ ██████╗███████╗██████╗ ██╗ ███████╗
██╔══██╗╚██╗ ██╔╝██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝██╔══██╗██║ ██╔════╝
██████╔╝ ╚████╔╝ █████╗ ██║ ██║██╔██╗ ██║██║ █████╗ █... |
dbver/versions/00001_init.py | bopopescu/redis-ctl | 109 | 12633015 | <filename>dbver/versions/00001_init.py
from migrate import *
from sqlalchemy.sql.sqltypes import *
from sqlalchemy.sql.schema import *
from sqlalchemy.dialects.mysql.base import MEDIUMTEXT
from sqlalchemy.sql.functions import func
meta = MetaData()
cluster = Table(
'cluster', meta,
Column('id', Integer, nulla... |
rdkit/Chem/Scaffolds/UnitTestMurckoScaffold.py | kazuyaujihara/rdkit | 1,609 | 12633023 | # $Id: test_MurckoScaffold.py 3672 2010-06-14 17:10:00Z landrgr1 $
#
# Created by <NAME>, June 2008
#
from collections import namedtuple
import doctest
import unittest
from rdkit import Chem
from rdkit.Chem.Scaffolds import MurckoScaffold
from rdkit.Chem.Scaffolds.MurckoScaffold import (GetScaffoldForMol, _pyGetScaff... |
tools/binary_size/libsupersize/dwarfdump_test.py | zealoussnow/chromium | 14,668 | 12633051 | <filename>tools/binary_size/libsupersize/dwarfdump_test.py
#!/usr/bin/env python3
# Copyright 2021 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 unittest
import dwarfdump
class DwarfDumpTest(unittest.TestCase):... |
zippy/benchmarks/src/benchmarks/whoosh/benchmark/marc21.py | lucapele/pele-c | 319 | 12633087 | <reponame>lucapele/pele-c<filename>zippy/benchmarks/src/benchmarks/whoosh/benchmark/marc21.py<gh_stars>100-1000
from __future__ import with_statement, print_function
import fnmatch, logging, os.path, re
from whoosh import analysis, fields, index, qparser, query, scoring
from whoosh.util import now
log = logging.getL... |
livecode/sample_X.py | pragnesh-ai/driverlessai-recipes | 194 | 12633091 | """ Randomly sample rows from dataset"""
# Specification:
# Inputs:
# X: datatable - primary dataset
# Parameters:
# fraction: float - fraction of rows to sample from 'X' (must be between 0 and 1)
# random_seed: int - random seed to control for reproducibility
import random
fraction = 0.1
random_seed = 0.7030
... |
graphql_compiler/compiler/ir_lowering_match/__init__.py | kensho-technologies/graphql-compiler | 521 | 12633110 | # Copyright 2018-present Kensho Technologies, LLC.
import six
from ...schema.schema_info import CommonSchemaInfo
from ..blocks import Filter
from ..compiler_frontend import IrAndMetadata
from ..ir_lowering_common.common import (
extract_optional_location_root_info,
extract_simple_optional_location_info,
lo... |
ch21-轮廓Contours/凸包-凸性检测-边界矩形-最小外接圆-拟合.py | makelove/OpenCV-Python-Tutorial | 2,875 | 12633149 | <reponame>makelove/OpenCV-Python-Tutorial
# -*- coding: utf-8 -*-
# @Time : 2017/7/12 下午8:28
# @Author : play4fun
# @File : 凸包-凸性检测-边界矩形-最小外接圆-拟合.py
# @Software: PyCharm
"""
凸包-凸性检测-边界矩形-最小外接圆-拟合.py:
"""
import cv2
import numpy as np
img=cv2.imread('../data/lightning.png',0)
image, contours, hierarchy = cv2.f... |
dgmc/models/spline.py | rlckd159/deep-graph-matching-consensus | 194 | 12633160 | <reponame>rlckd159/deep-graph-matching-consensus<filename>dgmc/models/spline.py
import torch
from torch.nn import Linear as Lin
import torch.nn.functional as F
from torch_geometric.nn import SplineConv
class SplineCNN(torch.nn.Module):
def __init__(self, in_channels, out_channels, dim, num_layers, cat=True,
... |
fonts/vector/romanc.py | szczys/st7789_mpy | 153 | 12633161 | <filename>fonts/vector/romanc.py
WIDTH = 32
HEIGHT = 32
FIRST = 0x20
LAST = 0x7f
_font =\
b'\x00\x4a\x5a\x0e\x4d\x57\x52\x46\x51\x48\x52\x54\x53\x48\x52'\
b'\x46\x20\x52\x52\x48\x52\x4e\x20\x52\x52\x59\x51\x5a\x52\x5b'\
b'\x53\x5a\x52\x59\x15\x49\x5b\x4e\x46\x4d\x47\x4d\x4d\x20\x52'\
b'\x4e\x47\x4d\x4d\x20\x52\x4e\x46... |
conftest.py | utsekaj42/chaospy | 333 | 12633174 | <reponame>utsekaj42/chaospy
"""Global configuration."""
import os
import pytest
import numpy
import scipy
import sklearn.linear_model
@pytest.fixture(autouse=True)
def global_setup(doctest_namespace, monkeypatch):
"""Global configuration setup."""
# set debug mode during testing
environ = os.environ.cop... |
inference.py | amorgun/pose-with-style | 168 | 12633209 | import argparse
import os
import torch
from torchvision import utils
from tqdm import tqdm
from torch.utils import data
import numpy as np
import random
from PIL import Image
import torchvision.transforms as transforms
from dataset import DeepFashionDataset
from model import Generator
from util.dp2coor import getSymXYc... |
blender/arm/logicnode/object/LN_get_object_property.py | onelsonic/armory | 2,583 | 12633235 | <filename>blender/arm/logicnode/object/LN_get_object_property.py<gh_stars>1000+
from arm.logicnode.arm_nodes import *
class GetPropertyNode(ArmLogicTreeNode):
"""Returns the value of the given object property.
@seeNode Set Object Property"""
bl_idname = 'LNGetPropertyNode'
bl_label = 'Get Object Prope... |
tests/emukit/quadrature/ground_truth_integrals_qkernel.py | ndalchau/emukit | 152 | 12633248 | <gh_stars>100-1000
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
# Use this script for ground truth integrals of the quadrature kernels.
import numpy as np
import GPy
from typing import List, Tuple
from emukit.model_wrappers.gpy_quadrature_wrappers i... |
scalyr_agent/third_party_tls/tlslite/utils/x25519.py | zak905/scalyr-agent-2 | 121 | 12633261 | # Authors:
# <NAME> (2017)
#
# See the LICENSE file for legal information regarding use of this file.
"""Handling X25519 and X448 curve based key agreement protocol."""
from .cryptomath import bytesToNumber, numberToByteArray, divceil
# the names of the variables come directly from RFC 7748 so changing them
# would... |
RNS/Utilities/rnpath.py | krypt0x/Reticulum | 254 | 12633263 | #!/usr/bin/env python3
import RNS
import sys
import time
import argparse
from RNS._version import __version__
def program_setup(configdir, destination_hexhash, verbosity):
try:
dest_len = (RNS.Reticulum.TRUNCATED_HASHLENGTH//8)*2
if len(destination_hexhash) != dest_len:
raise ValueEr... |
mariner/exceptions.py | terabyte128/mariner | 167 | 12633279 | <reponame>terabyte128/mariner
from abc import ABC, abstractmethod
class MarinerException(Exception, ABC):
@abstractmethod
def get_title(self) -> str:
raise NotImplementedError
@abstractmethod
def get_description(self) -> str:
raise NotImplementedError
class UnexpectedPrinterResponse... |
aliyun-python-sdk-core/tests/auth/algorithm/test_sha_hmac256.py | yndu13/aliyun-openapi-python-sdk | 1,001 | 12633290 | <gh_stars>1000+
# coding=utf-8
from tests import unittest
from aliyunsdkcore.auth.algorithm import sha_hmac256 as hmac256
class TestShaHmac256(unittest.TestCase):
def test(self):
self.assertEqual(hmac256.get_signer_name(), "SHA256withRSA")
self.assertEqual(hmac256.get_signer_type(), "PRIVATEKEY"... |
sdk/python/pulumi_aws/codestarconnections/host.py | alexbowers/pulumi-aws | 260 | 12633295 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... |
dev/Gems/CloudGemFramework/v1/AWS/common-code/LambdaService/test/mock_handler.py | BadDevCode/lumberyard | 1,738 | 12633297 | #
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or th... |
benchmarks/benchmark.py | zeta1999/tensor_annotations | 117 | 12633301 | <filename>benchmarks/benchmark.py
# Copyright 2020 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/L... |
tests/test_soft_fail.py | ActivisionGameScience/assertpy | 246 | 12633326 | # Copyright (c) 2015-2019, Activision Publishing, 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:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of ... |
scipy/stats/tests/studentized_range_mpmath_ref.py | jcharlong/scipy | 9,095 | 12633333 | # To run this script, run
# `python studentized_range_mpmath_ref.py`
# in the "scipy/stats/tests/" directory
# This script generates a JSON file "./data/studentized_range_mpmath_ref.json"
# that is used to compare the accuracy of `studentized_range` functions against
# precise (20 DOP) results generated using `mpmath`... |
convnets-keras/build/lib.linux-x86_64-2.7/convnetskeras/customlayers.py | ksmizer/GrapevinePD | 123 | 12633401 | import numpy as np
from keras.layers.core import Lambda, Merge
from keras.layers.convolutional import Convolution2D
from keras import backend as K
from keras.engine import Layer
def crosschannelnormalization(alpha = 1e-4, k=2, beta=0.75, n=5,**kwargs):
"""
This is the function used for cross channel normaliz... |
utils/scripts/gsa/geneSetOverlap.py | lufuhao/snp2vcf | 139 | 12633465 | <reponame>lufuhao/snp2vcf
#!/usr/bin/env python
#------------------------------------------------------------------------------
#
# Overlap between gene sets
#
#------------------------------------------------------------------------------
import sys
# Debug mode?
debug = False
#------------------------------------... |
src/python/nimbusml/internal/entrypoints/trainers_fasttreetweedieregressor.py | michaelgsharp/NimbusML | 134 | 12633467 | # - Generated by tools/entrypoint_compiler.py: do not edit by hand
"""
Trainers.FastTreeTweedieRegressor
"""
import numbers
from ..utils.entrypoints import EntryPoint
from ..utils.utils import try_set, unlist
def trainers_fasttreetweedieregressor(
training_data,
predictor_model=None,
number_... |
tests/test.py | davidbistolas/py-simple-audio | 121 | 12633476 | import simpleaudio as sa
import unittest
class TestSimpleaudio(unittest.TestCase):
def test_num_channels(self):
self.assertRaises(ValueError, sa.play_buffer, b'\0' * 16, 0, 2, 44100)
self.assertRaises(ValueError, sa.play_buffer, b'\0' * 16, 3, 2, 44100)
def test_bytes_per_chan(self):
... |
util/crypto/diffieHellman.py | arinachison/abides | 196 | 12633533 | <reponame>arinachison/abides
import nacl.bindings as nb
import random
import pandas as pd
import numpy as np
import math
def dict_keygeneration(peer_list):
# CDB: turned these into dictionaries to relax assumptions around agent IDs.
pkeys = {}
skeys = {}
for peer_id in peer_list:
pkeys[peer_id], skeys[pe... |
rapidsms/backends/vumi/forms.py | catalpainternational/rapidsms | 330 | 12633546 | from django import forms
from rapidsms.backends.http.forms import BaseHttpForm
class VumiForm(BaseHttpForm):
message_id = forms.CharField()
to_addr = forms.CharField()
from_addr = forms.CharField()
in_reply_to = forms.CharField(required=False)
session_event = forms.CharField(required=False)
c... |
lettersmith/absolutize.py | ericmjl/lettersmith_py | 103 | 12633551 | <reponame>ericmjl/lettersmith_py<filename>lettersmith/absolutize.py
"""
Tools for making relative URLs absolute in doc content.
"""
import re
from lettersmith.docs import renderer
from lettersmith.func import composable
from lettersmith import path as pathtools
URL_ATTR = r"""(src|href)=["'](.*?)["']"""
def absolut... |
tests/__init__.py | gitter-badger/vcspull | 169 | 12633619 | from . import fixtures # noqa
|
margaritashotgun/auth.py | cyberdefensegrp/margaritashotgun | 198 | 12633668 | <filename>margaritashotgun/auth.py
from enum import Enum
import paramiko
from paramiko import PasswordRequiredException
from margaritashotgun.exceptions import AuthenticationMissingUsernameError
from margaritashotgun.exceptions import AuthenticationMethodMissingError
class AuthMethods(Enum):
key = 'key'
passw... |
txdav/common/datastore/podding/test/test_conduit.py | backwardn/ccs-calendarserver | 462 | 12633669 | ##
# Copyright (c) 2005-2017 Apple Inc. 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 l... |
2019/07/27/Django Example App - YouTube Search With YouTube Data API/django_youtube_search/youtube_search/search/views.py | kenjitagawa/youtube_video_code | 492 | 12633678 | import requests
from isodate import parse_duration
from django.conf import settings
from django.shortcuts import render, redirect
def index(request):
videos = []
if request.method == 'POST':
search_url = 'https://www.googleapis.com/youtube/v3/search'
video_url = 'https://www.googleapis.com/y... |
src/binwalk/__init__.py | chubbymaggie/binwalk | 5,504 | 12633687 | <gh_stars>1000+
__all__ = ['scan', 'execute', 'ModuleException']
from binwalk.core.module import Modules
from binwalk.core.version import __version__ # This file is auto-generated by setup.py and ignored by .gitignore
from binwalk.core.exceptions import ModuleException
# Convenience functions
def scan(*args, **kwargs... |
skfda/inference/anova/__init__.py | jiduque/scikit-fda | 147 | 12633737 | """Implementation of ANOVA for functional data."""
from ._anova_oneway import oneway_anova, v_asymptotic_stat, v_sample_stat
|
ptp/components/models/__init__.py | aasseman/pytorchpipe | 232 | 12633760 | <filename>ptp/components/models/__init__.py<gh_stars>100-1000
from .model import Model
# General usage
from .general_usage.feed_forward_network import FeedForwardNetwork
from .general_usage.recurrent_neural_network import RecurrentNeuralNetwork
from .general_usage.seq2seq import Seq2Seq
from .general_usage.attention_d... |
leet/array/toHex.py | monishshah18/python-cp-cheatsheet | 140 | 12633768 | class Solution:
def toHex(self, num: int) -> str:
rtn = []
index = "0123456789abcdef"
if num == 0: return '0'
if num < 0: num += 2 ** 32
while num > 0:
digit = num % 16
num = num // 16
rtn.append(index[digit])
return "".join(rtn[::-1]) |
InnerEye-DataQuality/InnerEyeDataQuality/deep_learning/transforms.py | faz1993/InnerEye-DeepLearning | 402 | 12633783 | <reponame>faz1993/InnerEye-DeepLearning<filename>InnerEye-DataQuality/InnerEyeDataQuality/deep_learning/transforms.py<gh_stars>100-1000
# ------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT Lic... |
modules/ts/misc/report.py | thisisgopalmandal/opencv | 163 | 12633792 | #!/usr/bin/env python
import testlog_parser, sys, os, xml, re, glob
from table_formatter import *
from optparse import OptionParser
if __name__ == "__main__":
parser = OptionParser()
parser.add_option("-o", "--output", dest="format", help="output results in text format (can be 'txt', 'html' or 'auto' - defaul... |
external/mmdetection/tests/ote_params_validation/test_ote_ote_utils_params_validation.py | opencv/openvino_training_extensions | 775 | 12633826 | # Copyright (C) 2021-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
import pytest
from detection_tasks.apis.detection.ote_utils import (
ColorPalette,
generate_label_schema,
get_task_class,
load_template,
)
from ote_sdk.test_suite.e2e_test_system import e2e_pytest_unit
from ote_sdk.tes... |
libraries/botbuilder-adapters-slack/botbuilder/adapters/slack/slack_message.py | Fl4v/botbuilder-python | 388 | 12633834 | <reponame>Fl4v/botbuilder-python<gh_stars>100-1000
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from slack.web.classes.attachments import Attachment
from slack.web.classes.blocks import Block
class SlackMessage:
def __init__(self, **kwargs):
self.... |
xcessiv/stacker.py | KhaledTo/xcessiv | 1,362 | 12633870 | import sklearn
if sklearn.__version__.startswith('0.18'):
from sklearn.pipeline import _BasePipeline as bp
else:
from sklearn.utils.metaestimators import _BaseComposition as bp
import numpy as np
class XcessivStackedEnsemble(bp):
"""Contains the class for the Xcessiv stacked ensemble"""
def __init__(s... |
sample_factory/runner/runs/paper_doom_all_basic_envs.py | eles13/sample-factory | 320 | 12633907 | <filename>sample_factory/runner/runs/paper_doom_all_basic_envs.py
from sample_factory.runner.run_description import RunDescription, Experiment, ParamGrid
_params = ParamGrid([
('seed', [0, 1111, 2222, 3333, 4444, 5555, 6666, 7777, 8888, 9999]),
('env', ['doom_my_way_home', 'doom_deadly_corridor', 'doom_defend_... |
self_supervision/patch_utils.py | kristinakupf/revisiting-self-supervised | 360 | 12633935 | #!/usr/bin/python
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
examples/classic/expand.py | ria02/InquirerPy | 120 | 12633939 | <gh_stars>100-1000
from InquirerPy import prompt
from InquirerPy.prompts.expand import ExpandChoice
from InquirerPy.separator import Separator
def question1_choice(_):
return [
ExpandChoice(key="a", name="Apple", value="Apple"),
ExpandChoice(key="c", name="Cherry", value="Cherry"),
ExpandC... |
alipay/aop/api/domain/AccTransDetail.py | snowxmas/alipay-sdk-python-all | 213 | 12633979 | <reponame>snowxmas/alipay-sdk-python-all
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.CertInfo import CertInfo
from alipay.aop.api.domain.OriTxnInfo import OriTxnInfo
from alipay.aop.api.domain.AccPayeeInfo import AccPayeeInfo... |
kc-py1.py | taoliu/kmer-cnt | 139 | 12633986 | <gh_stars>100-1000
#!/usr/bin/env python
import sys
base_for = "ACGT"
base_rev = "TGCA"
comp_tab = str.maketrans(base_for, base_rev)
def count_kmer(h, k, seq):
l = len(seq)
if l < k: return
for i in range(l - k + 1):
kmer_for = seq[i:(i+k)]
if 'N' in kmer_for: continue
kmer_rev = kmer_for.translate(comp_tab... |
seal/routing.py | topicgit/seal | 132 | 12633987 | from channels.auth import AuthMiddlewareStack
from channels.routing import URLRouter, ProtocolTypeRouter
from django.urls import path
from k8s.consumers import EchoConsumer
application = ProtocolTypeRouter({
"websocket": AuthMiddlewareStack(
URLRouter([
path(r"ws/<slug:name>/<slug:namespace>",... |
tests/plugins/fail_by_itself.py | Bladez1753/lightning | 2,288 | 12634010 | <filename>tests/plugins/fail_by_itself.py<gh_stars>1000+
#!/usr/bin/env python3
from pyln.client import Plugin
import os
import threading
import time
plugin = Plugin()
class FailThread(threading.Thread):
def __init__(self):
super().__init__()
self.start()
def run(self):
time.sleep(1)... |
python3/pracmln/utils/project.py | seba90/pracmln | 123 | 12634011 | <reponame>seba90/pracmln
#
#
# (C) 2011-2015 by <NAME> (<EMAIL>)
#
# 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, cop... |
sdk/python/pulumi_gcp/organizations/get_organization.py | sisisin/pulumi-gcp | 121 | 12634018 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... |
raiden/utils/capabilities.py | tirkarthi/raiden | 2,101 | 12634030 | <reponame>tirkarthi/raiden
from typing import Any, Dict, Union
import structlog
from raiden.constants import Capabilities
from raiden.settings import CapabilitiesConfig
log = structlog.get_logger(__name__)
def _bool_to_binary(value: Any) -> str:
if isinstance(value, bool):
return "1" if value is True e... |
pcbmode/config.py | Hylian/pcbmode | 370 | 12634039 | <filename>pcbmode/config.py
#!/usr/bin/python
# This file is used as a global config file while PCBmodE is running.
# DO NOT EDIT THIS FILE
cfg = {} # PCBmodE configuration
brd = {} # board data
stl = {} # style data
pth = {} # path database
msg = {} # message database
stk = {} # stackup data
|
deepsleep/trainer.py | HTJR/deepsleepnet | 266 | 12634067 | <reponame>HTJR/deepsleepnet
import itertools
import os
import re
import time
from datetime import datetime
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
from sklearn.metrics import confusion_matrix, f1_score
from deepsleep.data_loader... |
src/python/web/serialize/serialize_auto_queue.py | annihilatethee/seedsync | 255 | 12634093 | # Copyright 2017, <NAME>, All rights reserved.
import json
from typing import List
from controller import AutoQueuePattern
class SerializeAutoQueue:
__KEY_PATTERN = "pattern"
@staticmethod
def patterns(patterns: List[AutoQueuePattern]) -> str:
patterns_list = []
for pattern in patterns:... |
venv/lib/python3.9/site-packages/pendulum/lang/da.py | qarik-hanrattyjen/apache-airflow-backport-providers-google-2021.3.3 | 224 | 12634094 | # -*- coding: utf-8 -*-
translations = {
# Days
'days': {
0: 'søndag',
1: 'mandag',
2: 'tirsdag',
3: 'onsdag',
4: 'torsdag',
5: 'fredag',
6: 'lørdag'
},
'days_abbrev': {
0: 'søn',
1: 'man',
2: 'tir',
3: 'ons',
... |
setup.py | lantunes/cellpylib | 124 | 12634095 | from setuptools import setup
setup(name="cellpylib",
version="1.1.0",
description="CellPyLib, A library for working with Cellular Automata, for Python.",
long_description="CellPyLib is a library for working with Cellular Automata, for Python. "
"Currently, only 1- and 2-dimensi... |
platypush/message/response/__init__.py | RichardChiang/platypush | 228 | 12634123 | <reponame>RichardChiang/platypush
import json
import time
from platypush.message import Message
class Response(Message):
""" Response message class """
def __init__(self, target=None, origin=None, id=None, output=None, errors=None,
timestamp=None, disable_logging=False):
"""
... |
fbgemm_gpu/fbgemm_gpu/split_embedding_codegen_lookup_invokers.py | garroud/FBGEMM | 792 | 12634130 | <reponame>garroud/FBGEMM<gh_stars>100-1000
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import python.lookup_adagrad as lookup_adagrad ... |
solutions/reverse_image_search/object_detection/server/src/operations/load.py | kilianovski/bootcamp | 789 | 12634135 | import os
import sys
from diskcache import Cache
sys.path.append("..")
from config import DEFAULT_TABLE, CACHE_DIR
def get_imgs_path(path):
pics = os.listdir(path)
pics.sort()
paths = []
for f in pics:
if f.endswith('.jpg'):
paths.append(os.path.join(path, f))
return paths
de... |
chrome/common/extensions/docs/server2/link_converter.py | iplo/Chain | 231 | 12634174 | <reponame>iplo/Chain
#!/usr/bin/env python
# Copyright (c) 2012 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.
# This script converts old-style <a> links to API docs to the new $ref links.
# See reference_resolver.py for ... |
tests/test_unique_fields_mixin.py | radicalbiscuit/drf-writable-nested | 754 | 12634188 | <reponame>radicalbiscuit/drf-writable-nested
from django.test import TestCase
from rest_framework.exceptions import ValidationError, ErrorDetail
from . import (
models,
serializers,
)
class UniqueFieldsMixinTestCase(TestCase):
def test_create_update_success(self):
serializer = serializers.UFMPare... |
src/pymap3d/ned.py | ryanpavlick/pymap3d | 116 | 12634216 | """ Transforms involving NED North East Down """
from __future__ import annotations
import typing
from .enu import geodetic2enu, aer2enu, enu2aer
from .ecef import ecef2geodetic, ecef2enuv, ecef2enu, enu2ecef
from .ellipsoid import Ellipsoid
if typing.TYPE_CHECKING:
from numpy import ndarray
def aer2ned(
a... |
VMEncryption/setup.py | shridpant/azure-linux-extensions | 266 | 12634269 | #!/usr/bin/env python
#
# VM Backup extension
#
# Copyright 2015 Microsoft 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
#
# U... |
vimdoc/docline.py | torao-1892/vimdoc | 211 | 12634294 | """Vimfile documentation lines, the stuff of vimdoc blocks."""
import abc
import vimdoc
from vimdoc import error
from vimdoc import regex
from vimdoc.block import Block
class DocLine(object):
"""One line of vim documentation."""
__metaclass__ = abc.ABCMeta
def Each(self, blocks, selection):
"""Iterates t... |
src/DyldExtractor/dyld/dyld_context.py | arandomdev/DyldExtractor | 177 | 12634313 | <gh_stars>100-1000
from mmap import mmap
from DyldExtractor.file_context import FileContext
from DyldExtractor.dyld.dyld_structs import (
dyld_cache_header,
dyld_cache_mapping_info,
dyld_cache_image_info,
)
class DyldContext(FileContext):
header: dyld_cache_header
mappings: list[dyld_cache_mapping_info]
image... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.