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 |
|---|---|---|---|---|
river/tree/splitter/base.py | fox-ds/river | 2,184 | 11082282 | import abc
import typing
from river import base
from ..split_criterion.base import SplitCriterion
from ..utils import BranchFactory, GradHess, GradHessStats
class Splitter(base.Estimator, abc.ABC):
"""Base class for the tree splitters.
Each Attribute Observer (AO) or Splitter monitors one input feature and... |
tests/test_preprocess_tokenfuncs.py | samir-joshi/tmtoolkit | 167 | 11082298 | """
Preprocessing: Tests for ._tokenfuncs submodule.
"""
import string
from hypothesis import given, strategies as st
import pytest
import numpy as np
from tmtoolkit.preprocess._tokenfuncs import (
str_multisplit, str_shape, str_shapesplit, expand_compound_token, make_index_window_around_matches,
token_match... |
hubspot/cms/site_search/__init__.py | Ronfer/hubspot-api-python | 117 | 11082303 | <gh_stars>100-1000
# coding: utf-8
# flake8: noqa
"""
CMS Site Search
Use these endpoints for searching content on your HubSpot hosted CMS website(s). # noqa: E501
The version of the OpenAPI document: v3
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
__ve... |
setup.py | alvistack/tabatkins-railroad-diagrams | 1,277 | 11082322 | from setuptools import setup, find_packages
with open("README-py.md", "r") as fh:
long_description = fh.read()
with open("semver.txt", "r") as fh:
semver = fh.read().strip()
setup(
name='railroad-diagrams',
py_modules=['railroad'],
version=semver,
description='Generate SVG railroad syntax diag... |
androguard/gui/TextDecorators.py | amimo/androguard | 4,084 | 11082333 | <filename>androguard/gui/TextDecorators.py<gh_stars>1000+
import re
import string
from PyQt5 import QtGui, QtCore
class CTextDecorator:
redPen = QtGui.QPen(QtGui.QColor(255, 0, 0))
greenPen = QtGui.QPen(QtGui.QColor(255, 255, 0))
whitePen = QtGui.QPen(QtGui.QColor(255, 255, 255))
normalPen = QtGui.... |
client/verta/tests/test_permissions/test_visibility_api.py | fool-sec-review/modeldb | 624 | 11082336 | <reponame>fool-sec-review/modeldb
"""
Basic tests to make sure the client passes `visibility` without errors.
"""
import pytest
import requests
from verta._protos.public.common import CommonService_pb2 as _CommonCommonService
from verta._protos.public.modeldb import DatasetService_pb2 as _DatasetService
from verta._... |
src/utils/csv_to_pkl.py | scaomath/BCAI_kaggle_CHAMPS | 108 | 11082354 | <filename>src/utils/csv_to_pkl.py
## Copyright (c) 2017 <NAME> GmbH
## All rights reserved.
##
## This source code is licensed under the MIT license found in the
## LICENSE file in the root directory of this source tree.
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import itertools
import pic... |
model_hub/examples/huggingface/question-answering/qa_utils.py | gh-determined-ai/determined | 1,729 | 11082392 | <filename>model_hub/examples/huggingface/question-answering/qa_utils.py
import numpy as np
import model_hub.huggingface as hf
import model_hub.utils as utils
def compute_metrics(
data_config,
column_names,
post_processing_function,
raw_datasets,
tokenized_datasets,
model,
metric,
pred... |
checkov/cloudformation/checks/resource/aws/S3IgnorePublicACLs.py | kylelaker/checkov | 4,013 | 11082403 | <gh_stars>1000+
from checkov.cloudformation.checks.resource.base_resource_value_check import BaseResourceValueCheck
from checkov.common.models.enums import CheckCategories
class S3IgnorePublicACLs(BaseResourceValueCheck):
def __init__(self):
name = "Ensure S3 bucket has ignore public ACLs enabled"
... |
examples/scrollbar.py | nano-labs/bullet | 2,962 | 11082429 | from bullet import ScrollBar
from bullet import emojis
from bullet import colors
cli = ScrollBar(
"How are you feeling today? ",
emojis.feelings[0],
height = 5,
align = 5,
margin = 0,
pointer = "👉",
background_on_switch = colors.background['default'],
word_on_switch = colors.foregroun... |
report/csv_to_html.py | ysh329/mobile-ai-bench | 313 | 11082478 | import os
import pandas as pd
csvs = ['run_report', 'prepare_report', 'precision_report']
for csv in csvs:
csv_file = 'output/' + csv + '.csv'
if os.path.exists(csv_file):
df = pd.read_csv('output/' + csv + '.csv')
df.to_html('report/' + csv + '.html')
dir_path = os.path.dirname(os.path.realp... |
external/rocksdb/tools/block_cache_analyzer/block_cache_pysim.py | cashbitecrypto/cashbite | 12,278 | 11082523 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import gc
import heapq
import random
import sys
import time
from collections import OrderedDict
from os import path
import numpy as np
kSampleSize = 64 # The sample size used when performing eviction.
kMicrosInSecond = 1... |
owl/owl/conv.py | jjzhang166/minerva | 561 | 11082537 | <filename>owl/owl/conv.py
#!/usr/bin/env python
""" This module contains operations for convolution, pooling and softmax
"""
import libowl as _owl
soft_op = _owl.softmax_algo
""" Same enum type as cudnn's ``cudnnSoftmaxMode_t``. Either ``soft_op.instance`` or ``soft_op.channel``.
"""
pool_op = _owl.pooling_algo
""" Sa... |
cdlib/test/test_static_benchmark.py | xing-lab-pitt/cdlib | 248 | 11082561 | import unittest
import cdlib
from cdlib import algorithms
from cdlib import benchmark
import networkx as nx
class STBenchTest(unittest.TestCase):
def test_LFR(self):
n = 250
tau1 = 3
tau2 = 1.5
mu = 0.1
G, coms = benchmark.LFR(n, tau1, tau2, mu, average_degree=5, min_commu... |
OmniDB/OmniDB_app/tests.old/test_postgresql96.py | lejmr/OmniDB | 2,982 | 11082577 | <filename>OmniDB/OmniDB_app/tests.old/test_postgresql96.py
from django.test import TestCase, Client
from django.http import JsonResponse
import json
from datetime import datetime, timedelta
import OmniDB_app.include.Spartacus as Spartacus
import OmniDB_app.include.Spartacus.Database as Database
import OmniDB_app.incl... |
tools/CleanJournalFiles.py | talrasha/Dynamo | 1,202 | 11082582 | <filename>tools/CleanJournalFiles.py<gh_stars>1000+
import os
import fnmatch
import string
def main():
testsPath = os.path.join(os.path.dirname(__file__), "..\\test\\revit")
# find all files to be cleaned
journals = [os.path.join(dirpath, f)
for dirpath, dirnames, files in os.walk(testsPath)
for f in ... |
pinax/blog/tests/tests.py | shadytradesman/pinax-blog | 315 | 11082598 | from __future__ import absolute_import
import random
from django.core.exceptions import ValidationError
from django.http.request import HttpRequest
from django.urls import reverse
from django.utils.text import slugify
from test_plus import TestCase
from ..context_processors import scoped
from ..models import Blog, ... |
PythonMiddleware/instance.py | chandlerette/Python-Middleware | 101 | 11082627 | <filename>PythonMiddleware/instance.py
import PythonMiddleware as gph
_shared_graphene_instance = None
def shared_graphene_instance():
""" This method will initialize ``_shared_graphene_instance`` and return it.
The purpose of this method is to have offer single default
graphene instance that can ... |
tests/test_config.py | deisenroth/prysm | 110 | 11082656 | """Tests verifying the functionality of the global prysm config."""
import pytest
import numpy as np
from prysm.conf import config
PRECISIONS = {
32: np.float32,
64: np.float64,
}
PRECISIONS_COMPLEX = {
32: np.complex64,
64: np.complex128
}
@pytest.mark.parametrize('precision', [32, 64])
def test_s... |
aiosocks/__init__.py | nibrag/aiosocks | 126 | 11082683 | import asyncio
from .errors import (
SocksError, NoAcceptableAuthMethods, LoginAuthenticationFailed,
SocksConnectionError, InvalidServerReply, InvalidServerVersion
)
from .helpers import (
SocksAddr, Socks4Addr, Socks5Addr, Socks4Auth, Socks5Auth
)
from .protocols import Socks4Protocol, Socks5Protocol, DEFA... |
bsuite/bsuite/logging/csv_load.py | hbutsuak95/iv_rl | 1,337 | 11082684 | # python3
# pylint: disable=g-bad-file-header
# Copyright 2019 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... |
sceptre/stack_status.py | dennisconrad/sceptre | 493 | 11082692 | # -*- coding: utf-8 -*-
"""
sceptre.stack_status
This module implemets structs for simplified Stack status and simplified
ChangeSet status values.
"""
class StackStatus(object):
"""
StackStatus stores simplified Stack statuses.
"""
COMPLETE = "complete"
FAILED = "failed"
IN_PROGRESS = "in pr... |
strategies/gekko-japonicus-master/promoterz/sequence/__init__.py | tobby2002/tradyai-api | 229 | 11082695 | #!/bin/python
from .locale import standard_loop
from .world import parallel_world
|
sdk/python/pulumi_gcp/monitoring/get_uptime_check_i_ps.py | sisisin/pulumi-gcp | 121 | 11082706 | # 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... |
src/utils/casino/table/holdem/numberlizeCards.py | lin483/Funny-Nations | 126 | 11082715 | <gh_stars>100-1000
from typing import List
import copy
from src.utils.poker.Card import Card
import src.utils.casino.table.holdem.checkHandValue as checkHandValue
from src.utils.casino.table.holdem.sortCards import sortCards
"""
For numberlization of cards
There are 11 digit
10101010101
^
First digit represent han... |
tests/r/test_kakadu.py | hajime9652/observations | 199 | 11082728 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import shutil
import sys
import tempfile
from observations.r.kakadu import kakadu
def test_kakadu():
"""Test module kakadu.py by downloading
kakadu.csv and testing shape of
extracted data has 1827 ro... |
examples/listener.py | BradleyKirton/circus | 820 | 11082729 | from circus.consumer import CircusConsumer
import json
ZMQ_ENDPOINT = 'tcp://127.0.0.1:5556'
topic = 'show:'
for message, message_topic in CircusConsumer(topic, endpoint=ZMQ_ENDPOINT):
response = json.dumps(dict(message=message, topic=message_topic))
print(response)
|
setup.py | SimlaBurcu/QPyTorch | 172 | 11082738 | <gh_stars>100-1000
from setuptools import setup, find_packages
try:
import torch
has_dev_pytorch = "dev" in torch.__version__
except ImportError:
has_dev_pytorch = False
# Base equirements
install_requires = [
"torch>=1.5.0",
]
if has_dev_pytorch: # Remove the PyTorch requirement
install_require... |
software/glasgow/arch/mips/core.py | electroniceel/Glasgow | 1,014 | 11082771 | # Ref: MIPS® Architecture For Programmers Vol. III: MIPS32® / microMIPS32™ Privileged Resource Architecture
# Document Number: MD00090 Revision 6.02
# Accession: G00020
from collections import defaultdict
from ...support.bitstruct import *
__all__ = [
# Address space
"KUSEG_addr", "KSEG0_addr", "KSEG1_addr"... |
tests/nnapi/specs/V1_1/space_to_batch_float_1_nnfw.mod.py | bogus-sudo/ONE-1 | 255 | 11082799 | batch = 2
rows = 3
cols = 4
depth = 5
block_size_height = 2
block_size_width = 3
padding_size_height_top = 1
padding_size_height_bottom = 2
padding_size_width_left = 3
padding_size_width_right = 2
out_batch = batch * block_size_height * block_size_width
out_rows = (int)((rows + padding_size_height_top + padding_size_he... |
jactorch/functional/__init__.py | dapatil211/Jacinle | 114 | 11082806 | <reponame>dapatil211/Jacinle<gh_stars>100-1000
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# File : __init__.py
# Author : <NAME>
# Email : <EMAIL>
# Date : 01/24/2018
#
# This file is part of Jacinle.
# Distributed under terms of the MIT license.
from .arith import *
from .grad import *
from .indexing import... |
profiles/api/views/user_api_views.py | LaudateCorpus1/squest | 112 | 11082812 | from django.contrib.auth.models import User
from rest_framework.generics import ListCreateAPIView, RetrieveUpdateDestroyAPIView
from rest_framework.permissions import IsAdminUser
from profiles.api.serializers.user_serializers import UserSerializer
class UserDetails(RetrieveUpdateDestroyAPIView):
serializer_class... |
src/gtk/toga_gtk/widgets/box.py | luizoti/toga | 1,261 | 11082858 | from ..libs import Gdk, Gtk
from .base import Widget
class TogaBox(Gtk.Fixed):
def __init__(self, impl):
super().__init__()
self._impl = impl
self.interface = self._impl.interface
def do_get_preferred_width(self):
# Calculate the minimum and natural width of the container.
... |
tools/gitallsecrets/thog/setup.py | ismailbozkurt/kubebot | 171 | 11082899 | from setuptools import setup
setup(
name='truffleHog',
version='1.0.2',
description='Searches through git repositories for high entropy strings, digging deep into commit history.',
url='https://github.com/dxa4481/truffleHog',
author='<NAME>',
author_email='<EMAIL>',
license='GNU',
packa... |
dl_lib/network/head/centernet_head.py | harrylin-hyl/CenterNet-better | 543 | 11082916 | <filename>dl_lib/network/head/centernet_head.py
#!/usr/bin/python3
# -*- coding:utf-8 -*-
import torch
import torch.nn as nn
class SingleHead(nn.Module):
def __init__(self, in_channel, out_channel, bias_fill=False, bias_value=0):
super(SingleHead, self).__init__()
self.feat_conv = nn.Conv2d(in_ch... |
boto3_type_annotations/boto3_type_annotations/cloud9/paginator.py | cowboygneox/boto3_type_annotations | 119 | 11082943 | from typing import Dict
from typing import List
from botocore.paginate import Paginator
class DescribeEnvironmentMemberships(Paginator):
def paginate(self, userArn: str = None, environmentId: str = None, permissions: List = None, PaginationConfig: Dict = None) -> Dict:
pass
class ListEnvironments(Pagina... |
monk/tf_keras_1/schedulers/common.py | take2rohit/monk_v1 | 542 | 11082955 | <gh_stars>100-1000
from monk.tf_keras_1.schedulers.imports import *
from monk.system.imports import *
# Code inspired from: https://www.pyimagesearch.com/2019/07/22/keras-learning-rate-schedules-and-decay/
#Level - 1 - Helper classes - Keras
class LearningRateDecay:
def plot(self, epochs, title="Learning Rate S... |
third_party/blink/tools/blinkpy/web_tests/controllers/web_test_finder_unittest.py | zealoussnow/chromium | 14,668 | 11082967 | <reponame>zealoussnow/chromium
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import optparse
import os
import sys
import unittest
from blinkpy.common import path_finder
from blinkpy.common.host_mock imp... |
tools/render_videos.py | ford442/oglplu2 | 103 | 11082973 | #!/usr/bin/python3
# coding=utf-8
# Copyright <NAME>.
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt
#
import os
import re
import sys
import shutil
import subprocess
# ----------------------------------------------... |
imagenet/lip_resnet.py | sebgao/LIP | 209 | 11082985 | <gh_stars>100-1000
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.model_zoo as model_zoo
from collections import OrderedDict
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152']
model_urls = {
'resnet50': './lip_resnet-50.pth',
'... |
pyocd/target/builtin/target_M251.py | majorlin/pyOCD | 276 | 11082994 | # pyOCD debugger
# Copyright (c) 2019 Nuvoton
# Copyright (c) 2021 <NAME>
# SPDX-License-Identifier: Apache-2.0
#
# 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/l... |
examples/cp/basic/golomb_ruler_all_solutions.py | yukarinoki/docplex-examples | 302 | 11083005 | # --------------------------------------------------------------------------
# Source file provided under Apache License, Version 2.0, January 2004,
# http://www.apache.org/licenses/
# (c) Copyright IBM Corp. 2015, 2016
# --------------------------------------------------------------------------
"""
In mathematics, a ... |
Tests/image_tests/helpers.py | gonsolo/Falcor | 1,615 | 11083025 | def render_frames(m, name, frames=[1], framerate=60, resolution=[1280,720]):
m.resizeSwapChain(*resolution)
m.ui = False
m.clock.framerate = framerate
m.clock.time = 0
m.clock.pause()
m.frameCapture.baseFilename = name
frame = 0
for capture_frame in frames:
while frame < capture... |
src/encoded/tests/test_upgrade_platform.py | procha2/encoded | 102 | 11083040 | <gh_stars>100-1000
import pytest
def test_platform_upgrade(upgrader, platform_1):
value = upgrader.upgrade('platform', platform_1, target_version='2')
assert value['schema_version'] == '2'
assert 'encode2_dbxrefs' not in value
assert 'geo_dbxrefs' not in value
assert value['dbxrefs'] == ['UCSC-ENC... |
tests/import/pkg_m/pkg2/__init__.py | Euromance/pycopy | 663 | 11083058 | print("pkg_m.pkg2:", __name__)
|
jira_agile_metrics/utils.py | arulvelkumar/jira-agile-metrics | 206 | 11083070 | <filename>jira_agile_metrics/utils.py
import datetime
import os.path
import numpy as np
import pandas as pd
import seaborn as sns
class StatusTypes:
backlog = "backlog"
accepted = "accepted"
complete = "complete"
def extend_dict(d, e):
r = d.copy()
r.update(e)
return r
def to_json_string(... |
fpn_dcr/symbols/__init__.py | weiyc/Decoupled-Classification-Refinement | 148 | 11083080 | <reponame>weiyc/Decoupled-Classification-Refinement
import resnet_v1_101_fpn_rcnn_dcr_res2
import resnet_v1_101_fpn_dcn_rcnn_dcr_res2
|
libs/sqlobject/tests/test_SQLMultipleJoin.py | scambra/HTPC-Manager | 422 | 11083088 | from sqlobject import *
from sqlobject.tests.dbtest import *
class Race(SQLObject):
name = StringCol()
fightersAsList = MultipleJoin('RFighter', joinColumn="rf_id")
fightersAsSResult = SQLMultipleJoin('RFighter', joinColumn="rf_id")
class RFighter(SQLObject):
name = StringCol()
race = ForeignKey('... |
src/ppl/nn/engines/cuda/impls/src/nn/conv/int8_idxn/gen_idxn_int8_kernel.py | tangyanf/ppl.nn | 764 | 11083096 | <reponame>tangyanf/ppl.nn
#!/usr/bin/env python3
"""generate idxn conv kernels dynamically
"""
import os
import sys
import hashlib
class KernelInfo:
def __init__(self, path, s_size, k_num, cta_y_num, cta_x_num, warp_y, warp_x):
self.path = path
self.s_size = s_size
self.k_num = k_num
... |
cantoolz/module.py | The-Cracker-Technology/CANToolz | 194 | 11083119 | <reponame>The-Cracker-Technology/CANToolz<gh_stars>100-1000
import codecs
import threading
import traceback
import collections
class Command(object):
"""Command class helper to easily identify command attributes."""
def __init__(self, description, num_params, desc_params, callback, is_enabled, index=None):
... |
py_pdf_parser/visualise/info_figure.py | d-hoke/py-pdf-parser | 186 | 11083136 | <gh_stars>100-1000
from typing import Dict, List, Optional, TYPE_CHECKING
from matplotlib.backend_bases import MouseButton
if TYPE_CHECKING:
from py_pdf_parser.components import PDFElement
def get_clicked_element_info(clicked_elements: Dict[MouseButton, "PDFElement"]) -> str:
left_element = clicked_elements... |
tests/changes/api/test_build_tag.py | vault-the/changes | 443 | 11083140 | <gh_stars>100-1000
import json
from changes.testutils import APITestCase
NONE = None
NO_TAGS = []
ONE_TAG = ['one_tag']
MULTI_TAGS = ['one_tag', 'two_tags']
TAG_LISTS = [MULTI_TAGS, ONE_TAG, NO_TAGS, NONE]
PATH = '/api/0/builds/{0}/tags'
class BuildTagTest(APITestCase):
def test_get_tags(self):
projec... |
social_core/backends/eventbrite.py | shnaqawi/social-core | 745 | 11083141 | from .oauth import BaseOAuth2
class EventbriteOAuth2(BaseOAuth2):
"""Eventbrite OAuth2 authentication backend"""
name = 'eventbrite'
AUTHORIZATION_URL = 'https://www.eventbrite.com/oauth/authorize'
ACCESS_TOKEN_URL = 'https://www.eventbrite.com/oauth/token'
METADATA_URL = 'https://www.eventbriteap... |
conan/tools/__init__.py | Wonders11/conan | 6,205 | 11083206 | <reponame>Wonders11/conan
CONAN_TOOLCHAIN_ARGS_FILE = "conanbuild.conf"
CONAN_TOOLCHAIN_ARGS_SECTION = "toolchain"
|
tools/gsuite-grant-analyzer/gsuite_grant_analyzer/bigquery_helpers.py | ruchirjain86/professional-services | 2,116 | 11083216 | """Helper functions for BigQuery."""
# 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 r... |
tests/orm/test_computers.py | aiidateam/aiida_core | 153 | 11083240 | <filename>tests/orm/test_computers.py
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
scripts/utils.py | PavelBlend/fluid-engine-dev | 1,355 | 11083251 | """
Copyright (c) 2018 <NAME>
I am making my contributions/submissions to this project solely in my personal
capacity and am not conveying any rights to any intellectual property of any
third parties.
"""
"""
Jet uses portions of Chromium V8.
Copyright 2008 the V8 project authors. All rights reserved.
Redistribution... |
apps/incidents/views.py | seanlefevre/openduty | 145 | 11083253 | import uuid
from django.urls import reverse
from django.views.generic import DetailView, ListView
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.auth.models import User
from django.utils import timezone
from django.http import HttpResponseRedirect
from django.contrib.auth.decorators impor... |
graphql_compiler/query_formatting/__init__.py | manesioz/graphql-compiler | 521 | 11083287 | <gh_stars>100-1000
# Copyright 2017-present <NAME>, LLC.
"""Safely insert runtime arguments into compiled GraphQL queries."""
from .common import insert_arguments_into_query, validate_argument_type # noqa
|
bilibili.py | squ33ker/Dlink_Parse | 142 | 11083327 | import requests
import re
class Bili:
def __init__(self, url):
self.url = url
self.headers = {
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36¬"
}
def start(self):
res = requests... |
src/test/python/apache/aurora/executor/common/fixtures.py | jeremyvdw/aurora | 479 | 11083361 | <filename>src/test/python/apache/aurora/executor/common/fixtures.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 a... |
Alignment/OfflineValidation/test/DiMuonVertexValidation_cfg.py | Purva-Chaudhari/cmssw | 852 | 11083374 | from __future__ import print_function
from fnmatch import fnmatch
import FWCore.ParameterSet.Config as cms
import FWCore.Utilities.FileUtils as FileUtils
import FWCore.ParameterSet.VarParsing as VarParsing
import sys
from Configuration.StandardSequences.Eras import eras
###############################################... |
contrib/performance/jobqueue/workrate.py | backwardn/ccs-calendarserver | 462 | 11083378 | #!/usr/bin/env python
##
# Copyright (c) 2012-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 re... |
fastfold/model/hub/__init__.py | hpcaitech/FastFold | 303 | 11083434 | from .alphafold import AlphaFold
__all__ = ["AlphaFold"] |
tock/employees/signals.py | mikiec84/tock | 134 | 11083442 | <reponame>mikiec84/tock
import logging
from django.db.models.signals import pre_save
logger = logging.getLogger('tock-employees')
def employee_grade_creation(sender, instance=None, **kwargs):
if instance is not None and instance.pk is None:
logger.info(
f'Creating EmployeeGrade for {instance... |
Tools/uorb_graph/create.py | imchangchang/PX4-Autopilot | 1,537 | 11083444 | <reponame>imchangchang/PX4-Autopilot
#! /usr/bin/env python3
from __future__ import print_function
import argparse
import codecs
import colorsys
import json
import logging
import os
import re
import sys
from typing import Optional, Set, Tuple
parser = argparse.ArgumentParser(
description='Generate uORB pub/sub ... |
qa/L0_stability_metrics/test_config_generator.py | triton-inference-server/model_analyzer | 115 | 11083455 | <filename>qa/L0_stability_metrics/test_config_generator.py
# Copyright (c) 2021 NVIDIA CORPORATION & 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.
# You may obtain a copy of the License at
#
# h... |
devil/devil/android/cpu_temperature.py | tingshao/catapult | 138 | 11083469 | # Copyright 2019 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.
"""Provides device interactions for CPU temperature monitoring."""
# pylint: disable=unused-argument
import logging
from devil.android import device_utils
f... |
neutron/api/converters.py | congnt95/neutron | 1,080 | 11083515 | # Copyright (c) 2021 Ericsson Software Technology
#
# 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 app... |
python/153_Find_Minimum_in_Rotated_Sorted_Array.py | dvlpsh/leetcode-1 | 4,416 | 11083571 | class Solution(object):
# def findMin(self, nums):
# """
# :type nums: List[int]
# :rtype: int
# """
# return self.get_min(nums, 0, len(nums) - 1)
#
# def get_min(self, nums, start, end):
# mid = (start + end) / 2
# if start == end:
# # one... |
corehq/ex-submodules/pillowtop/management/commands/merge_pillow_checkpoints.py | dimagilg/commcare-hq | 471 | 11083608 | import logging
import sys
from django.core.management.base import BaseCommand
from django.db.models import Count, Max, Min
from pillowtop import get_pillow_by_name
from pillowtop.models import KafkaCheckpoint
logger = logging.getLogger('__name__')
def confirm(msg):
return input(msg) == 'y'
class Command(Base... |
desktop/core/ext-py/docutils-0.14/test/test_parsers/test_rst/test_TableParser.py | kokosing/hue | 5,079 | 11083633 | #! /usr/bin/env python
# coding: utf-8
# $Id: test_TableParser.py 7668 2013-06-04 12:46:30Z milde $
# Author: <NAME> <<EMAIL>>
# Copyright: This module has been placed in the public domain.
"""
Tests for states.py.
"""
from __init__ import DocutilsTestSupport
def suite():
s = DocutilsTestSupport.GridTableParser... |
music21/test/testRunner.py | cuthbertLab/music21 | 1,449 | 11083643 | <gh_stars>1000+
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Name: testRunner.py
# Purpose: Music21 testing suite
#
# Authors: <NAME>
# <NAME>
#
# Copyright: Copyright © 2006-2016 <NAME> and the music21
# Proje... |
homeassistant/components/launch_library/sensor.py | learn-home-automation/core | 22,481 | 11083646 | <filename>homeassistant/components/launch_library/sensor.py<gh_stars>1000+
"""A sensor platform that give you information about the next space launch."""
from __future__ import annotations
from datetime import timedelta
import logging
from pylaunches import PyLaunches, PyLaunchesException
import voluptuous as vol
fr... |
demo/io_util.py | hoverinc/OANet | 209 | 11083688 | import numpy as np
def write_keypoints(path, keypoints):
# path: path to save
# keypoints: single-precision real matrix, N*4, x,y,scale, orientation
assert keypoints.shape[1]==4
write_matrix(path, keypoints, np.float32)
def write_descriptors(path, descriptors):
write_matrix(path, descriptors, np.float32)
def wr... |
tools/module_generator/c_source_templates.py | acrop/iotjs | 2,081 | 11083706 | <filename>tools/module_generator/c_source_templates.py
#!/usr/bin/env python
# Copyright 2019-present Samsung Electronics Co., Ltd. and other contributors
#
# 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 th... |
dbaas/tsuru/migrations/0002_auto__del_bind.py | didindinn/database-as-a-service | 303 | 11083709 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting model 'Bind'
db.delete_table(u'tsuru_bind')
def backward... |
img2dataset/__init__.py | kanttouchthis/img2dataset | 482 | 11083714 | <gh_stars>100-1000
"""Img2dataset"""
from img2dataset.main import main
from img2dataset.main import download
|
torchtext/experimental/__init__.py | parmeet/text | 3,172 | 11083722 | <filename>torchtext/experimental/__init__.py
from . import datasets
from . import transforms
from . import models
__all__ = ['datasets', 'transforms', 'models']
|
rlschool/quadrupedal/envs/__init__.py | HaojieSHI98/RLSchool | 169 | 11083727 | <filename>rlschool/quadrupedal/envs/__init__.py
from rlschool.quadrupedal.envs.gym_envs import * |
leet/dynamic/maxProfit4.py | monishshah18/python-cp-cheatsheet | 140 | 11083742 | <filename>leet/dynamic/maxProfit4.py
"""
time: k * p
space: p
"""
class Solution:
def maxProfit(self, k: int, prices: List[int]) -> int:
if len(prices) <= 1:
return 0
dp = [0] * len(prices)
if k > len(prices):
profit = 0
for i i... |
wagtail/core/management/commands/create_log_entries_from_revisions.py | brownaa/wagtail | 8,851 | 11083745 | <reponame>brownaa/wagtail<filename>wagtail/core/management/commands/create_log_entries_from_revisions.py
from django.core.management.base import BaseCommand
from wagtail.core.models import PageLogEntry, PageRevision
def get_comparison(page, revision_a, revision_b):
comparison = page.get_edit_handler().get_compar... |
ding/worker/collector/tests/speed_test/utils.py | sailxjx/DI-engine | 464 | 11083792 | <reponame>sailxjx/DI-engine
import numpy as np
def random_change(number):
return number * (1 + (np.random.random() - 0.5) * 0.6)
|
algorithms/maths/next_bigger.py | zhengli0817/algorithms | 22,426 | 11083812 | """
I just bombed an interview and made pretty much zero
progress on my interview question.
Given a number, find the next higher number which has the
exact same set of digits as the original number.
For example: given 38276 return 38627.
given 99999 return -1. (no such number exists)
Condensed mathem... |
third_party/blink/tools/blinkpy/common/config/PRESUBMIT.py | chromium/chromium | 14,668 | 11083816 | <gh_stars>1000+
# Copyright (c) 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.
"""config/ presubmit script for Blink.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details abou... |
flask_appbuilder/validators.py | tianhe1986/Flask-AppBuilder | 3,862 | 11083849 | import re
from typing import Optional
from flask import current_app
from flask_appbuilder.exceptions import PasswordComplexityValidationError
from flask_appbuilder.models.base import BaseInterface
from flask_babel import gettext
from wtforms import Field, Form, ValidationError
password_complexity_regex = re.compile(
... |
corehq/util/itertools.py | dimagilg/commcare-hq | 471 | 11083850 | <reponame>dimagilg/commcare-hq<gh_stars>100-1000
def zip_with_gaps(all_items, some_items, all_items_key=None, some_items_key=None):
"""
Yields pairs of items from `all_items` and `some_items` where item
keys match.
Keys do not need to be unique. Keys in `all_items` must be a
superset of keys in `... |
dev/Gems/CloudGemAWSScriptBehaviors/AWS/test/test_settings.py | brianherrera/lumberyard | 1,738 | 11083856 | <filename>dev/Gems/CloudGemAWSScriptBehaviors/AWS/test/test_settings.py
#
# 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 i... |
iPERCore/services/run_imitator.py | JSssssss/iPERCore | 2,223 | 11083873 | <gh_stars>1000+
# Copyright (c) 2020-2021 impersonator.org authors (<NAME> and <NAME>). All rights reserved.
from iPERCore.models import ModelsFactory
from iPERCore.tools.utils.signals.smooth import temporal_smooth_smpls
from iPERCore.tools.utils.filesio.persistence import clear_dir
from iPERCore.tools.utils.multimedi... |
locations/spiders/tgifridays.py | jleedev/alltheplaces | 297 | 11083878 | # -*- coding: utf-8 -*-
import datetime
import re
import json
import scrapy
from locations.items import GeojsonPointItem
from locations.hours import OpeningHours
DAY_MAPPING = {
'Monday': 'Mo',
'Tuesday': 'Tu',
'Wednesday': 'We',
'Thursday': 'Th',
'Friday': 'Fr',
'Saturday': 'Sa',
'Sunday... |
hdfs3/tests/test_conf.py | HirniMeshram1/hdfs3 | 143 | 11083908 |
import os
import pytest
import shutil
import tempfile
from hdfs3.conf import conf, guess_config, conf_defaults, hdfs_conf
from hdfs3 import HDFileSystem
@pytest.yield_fixture()
def no_conf():
# clear environment
hcd = os.environ.pop('HADOOP_CONF_DIR', None)
hi = os.environ.pop('HADOOP_INSTALL', None)
... |
routes/admin.py | Junhua9981/WebProjectFinal | 120 | 11083912 | <filename>routes/admin.py
from fastapi import Body, APIRouter
from fastapi.encoders import jsonable_encoder
from fastapi.security import HTTPBasicCredentials
from passlib.context import CryptContext
from database.database import admin_collection
from auth.jwt_handler import signJWT
from database.database import add_ad... |
python/alibiexplainer/alibiexplainer/explainer.py | ittus/kserve | 1,146 | 11083922 | <reponame>ittus/kserve
# Copyright 2021 The KServe 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... |
understat/__init__.py | arkjinli/understat | 114 | 11083940 | from .understat import Understat
|
deepsvg/svglib/util_fns.py | naoto0804/deepsvg | 573 | 11083946 | import math
def get_roots(a, b, c):
if a == 0:
if b == 0:
return []
return [-c / b]
r = b * b - 4 * a * c
if r < 0:
return []
elif r == 0:
x0 = -b / (2 * a)
return [x0]
x1, x2 = (-b - math.sqrt(r)) / (2 * a), (-b + math.sqrt(r)) / (2 * a)
re... |
tests/integration_tests/flows/test_mysql_api.py | mindsdb/main | 261 | 11083956 | <gh_stars>100-1000
import time
import tempfile
import unittest
import json
from pathlib import Path
import docker
import netifaces
import pandas as pd
import requests
from common import (
run_environment,
EXTERNAL_DB_CREDENTIALS,
CONFIG_PATH)
def get_docker0_inet_ip():
if "docker0" not in netifaces... |
Combo_Dial_Safe/code.py | gamblor21/Adafruit_Learning_System_Guides | 665 | 11083975 | # Combo Dial Safe
# for Adafruit Circuit Playground express
# with CircuitPython
import time
import board
import pwmio
from adafruit_motor import servo
from adafruit_circuitplayground.express import cpx
pwm = pwmio.PWMOut(board.A3, duty_cycle=2 ** 15, frequency=50)
# plug red servo wire to VOUT, brown to GND, yell... |
lintcode/629.minimum-spanning-tree.py | geemaple/algorithm | 177 | 11084002 | '''
Definition for a Connection
class Connection:
def __init__(self, city1, city2, cost):
self.city1, self.city2, self.cost = city1, city2, cost
'''
class UnionFind(object):
def __init__(self, n):
self.size = n
self.graph = {}
for i in range(n):
self.graph[i] = i
... |
src/proxy.py | LIVEauctioneers/aws-lambda-go-shim | 864 | 11084009 | <gh_stars>100-1000
#
# Copyright 2017 Alsanium, SAS. 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.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0... |
petl/test/io/test_db_server.py | vishalbelsare/petl | 495 | 11084043 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
import sys
import logging
import petl as etl
from petl.test.helpers import ieq
logger = logging.getLogger(__name__)
debug = logger.debug
def _test_dbo(write_dbo, read_dbo=None):
if read_dbo is None:
read_dbo = wri... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.