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 |
|---|---|---|---|---|
third_party/google-endpoints/endpoints/test/test_util.py | tingshao/catapult | 2,151 | 12612410 | # Copyright 2016 Google 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 law or agree... |
spikeinterface/core/baserecording.py | JuliaSprenger/spikeinterface | 116 | 12612414 | from typing import List, Union
from pathlib import Path
import warnings
import numpy as np
from probeinterface import Probe, ProbeGroup, write_probeinterface, read_probeinterface
from .base import BaseExtractor, BaseSegment
from .core_tools import write_binary_recording, write_memory_recording
from warnings import ... |
tests/chainerx_tests/unit_tests/test_device.py | zaltoprofen/chainer | 3,705 | 12612427 | import copy
import pickle
import pytest
import chainerx
_devices_data = [
{'index': 0},
{'index': 1},
]
@pytest.fixture(params=_devices_data)
def device_data1(request):
return request.param
@pytest.fixture(params=_devices_data)
def device_data2(request):
return request.param
@pytest.fixture
de... |
terrascript/data/hcp.py | mjuenema/python-terrascript | 507 | 12612431 | <filename>terrascript/data/hcp.py
# terrascript/data/hcp.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:18:10 UTC)
#
# For imports without namespace, e.g.
#
# >>> import terrascript.data.hcp
#
# instead of
#
# >>> import terrascript.data.hashicorp.hcp
#
# This is only available for 'official' and... |
niapy/algorithms/algorithm.py | altaregos/NiaPy | 202 | 12612485 | # encoding=utf8
import logging
import multiprocessing
import threading
import numpy as np
from numpy.random import default_rng
from niapy.util.array import objects_to_array
logging.basicConfig()
logger = logging.getLogger('niapy.util.utility')
logger.setLevel('INFO')
__all__ = [
'Algorithm',
'Individual',
... |
dbaas/dbaas/features.py | didindinn/database-as-a-service | 303 | 12612502 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.conf import settings
LDAP_ENABLED = settings.LDAP_ENABLED
|
PythonNetwork/venv/Lib/site-packages/pip/_vendor/packaging/tags.py | Moldovandreii/RepetitionCount | 2,160 | 12612543 | <filename>PythonNetwork/venv/Lib/site-packages/pip/_vendor/packaging/tags.py
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import
import distutils.util
... |
keras_retinanet/utils/config.py | kukuruza/keras-retinanet | 124 | 12612554 | <filename>keras_retinanet/utils/config.py<gh_stars>100-1000
"""
Copyright 2017-2018 Fizyr (https://fizyr.com)
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/LICE... |
pykafka/partition.py | Instamojo/pykafka | 1,174 | 12612583 | """
Author: <NAME>, <NAME>
"""
__license__ = """
Copyright 2015 Parse.ly, 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 app... |
tests/test_encode.py | Narasimha1997/blurhash-python | 105 | 12612590 | from __future__ import absolute_import
import pytest
from blurhash import encode
def test_encode_file():
with open('tests/pic2.png', 'rb') as image_file:
result = encode(image_file, 4, 3)
assert result == 'LlMF%n00%#MwS|WCWEM{R*bbWBbH'
def test_encode_with_filename():
result = encode('tests/p... |
dask/hashing.py | aeisenbarth/dask | 9,684 | 12612598 | <reponame>aeisenbarth/dask<gh_stars>1000+
import binascii
import hashlib
hashers = [] # In decreasing performance order
# Timings on a largish array:
# - CityHash is 2x faster than MurmurHash
# - xxHash is slightly slower than CityHash
# - MurmurHash is 8x faster than SHA1
# - SHA1 is significantly faster than all ... |
rqd/rqd/rqmachine.py | winter3030/OpenCue | 329 | 12612611 | <gh_stars>100-1000
# Copyright Contributors to the OpenCue Project
#
# 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 b... |
sld-api-backend/api_v1/endpoints/activity_logs.py | terjekv/Stack-Lifecycle-Deployment | 115 | 12612612 | <gh_stars>100-1000
from sqlalchemy.orm import Session
from fastapi import APIRouter, Depends, HTTPException
from schemas import schemas
from security import deps
from crud import activityLogs as crud_activity
from crud import user as crud_users
#from fastapi_limiter import FastAPILimiter
#from fastapi_limiter.depends... |
metrics/parser.py | manipopopo/TC-ResNet | 185 | 12612619 | from abc import ABC, ABCMeta
from metrics.base import DataStructure
class MetricDataParserBase(ABC):
@classmethod
def parse_build_data(cls, data):
"""
Args:
data: dictionary which will be passed to InputBuildData
"""
data = cls._validate_build_data(data)
da... |
changes/api/patch_details.py | vault-the/changes | 443 | 12612645 | from __future__ import absolute_import
from flask import request, Response
from changes.api.base import APIView
from changes.models.patch import Patch
class PatchDetailsAPIView(APIView):
def get(self, patch_id):
patch = Patch.query.get(patch_id)
if patch is None:
return '', 404
... |
tests/cluecode/data/ics/markdown-markdown-extensions/codehilite.py | s4-2/scancode-toolkit | 1,511 | 12612646 | <filename>tests/cluecode/data/ics/markdown-markdown-extensions/codehilite.py<gh_stars>1000+
Adds code/syntax highlighting to standard Python-Markdown code blocks.
Copyright 2006-2008 [<NAME>](http://achinghead.com/).
Project website: <http://www.freewisdom.org/project/python-markdown/CodeHilite> |
src/3rdparty/keyvi/python/tests/index/index_test.py | pombredanne/keyvi-server | 199 | 12612649 | # -*- coding: utf-8 -*-
# Usage: py.test tests
from keyvi.index import Index, ReadOnlyIndex
import os
import random
import shutil
import tempfile
import gc
def test_open_index():
test_dir = os.path.join(tempfile.gettempdir(), "index_open_index")
try:
if not os.path.exists(test_dir):
os.mk... |
tests/contrib/test_strava.py | kerryhatcher/flask-dance | 836 | 12612651 | import pytest
import responses
from urlobject import URLObject
from flask import Flask
from flask_dance.contrib.strava import make_strava_blueprint, strava
from flask_dance.consumer import OAuth2ConsumerBlueprint
from flask_dance.consumer.storage import MemoryStorage
@pytest.fixture
def make_app():
"A callable to... |
tests/issues/test_issue_033.py | RodrigoDeRosa/related | 190 | 12612658 | import related
@related.immutable()
class Child(object):
name = related.StringField(default="!")
@related.immutable()
class Model(object):
# non-child fields
sequence_field = related.SequenceField(str, default=set())
set_field = related.SetField(str, default=[])
mapping_field = related.MappingFi... |
utils/smpl.py | SomaNonaka/HandMesh | 131 | 12612669 | <reponame>SomaNonaka/HandMesh
import numpy as np
import torch
import os.path as osp
import json
# from config import cfg
import sys
from smplpytorch.pytorch.smpl_layer import SMPL_Layer
class SMPL(object):
def __init__(self, root):
self.root = root
self.layer = {'neutral': self.get_layer(), 'mal... |
gabbi/tests/test_use_prior_test.py | scottwallacesh/gabbi | 145 | 12612722 | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under... |
vispy/visuals/tests/test_ellipse.py | hmaarrfk/vispy | 2,617 | 12612747 | <gh_stars>1000+
# -*- coding: utf-8 -*-
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Tests for EllipseVisual
All images are of size (100,100) to keep a small file size
"""
from vispy.scene import visuals, transforms
from vis... |
zentral/contrib/monolith/ppd.py | janheise/zentral | 634 | 12612748 | <filename>zentral/contrib/monolith/ppd.py
import zlib
KEYWORDS = {
"ModelName": ("model_name", False),
"ShortNickName": ("short_nick_name", False),
"Manufacturer": ("manufacturer", False),
"FileVersion": ("file_version", False),
"Product": ("product", True),
"PCFileName": ("pc_file_name", False... |
empire/server/modules/powershell/collection/SharpChromium.py | chenxiangfang/Empire | 2,541 | 12612818 | from __future__ import print_function
from builtins import object
from builtins import str
from typing import Dict
from empire.server.common import helpers
from empire.server.common.module_models import PydanticModule
from empire.server.utils import data_util
from empire.server.utils.module_util import handle_error_m... |
service/util/auto_task.py | mutouxia/kamiFaka | 717 | 12612825 | from sqlalchemy.orm import query
from service.database.models import TempOrder
from service.api.db import db
from datetime import datetime,timedelta
def clean_tmp_order():
orders = TempOrder.query.all()
c_now = datetime.utcnow()+timedelta(hours=8)
# del_list = []
if orders:
with db.auto_commit_... |
inference.py | gonglinyuan/StackingBERT | 104 | 12612839 | #!/usr/bin/env python3 -u
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
"""
Evalu... |
parsers/test/test_IN_AP.py | hybridcattt/electricitymap-contrib | 1,582 | 12612854 | <gh_stars>1000+
import unittest
from requests import Session
from requests_mock import Adapter, ANY
from pkg_resources import resource_string
from parsers import IN_AP
class Test_IN_AP(unittest.TestCase):
def setUp(self):
self.session = Session()
self.adapter = Adapter()
self.session.moun... |
Wallstreetbets.py | dave-knight/wallstreetbets-sentiment-analysis | 146 | 12612907 | '''*****************************************************************************
Purpose: To analyze the sentiments of r/wallstreetbets
This program uses Vader SentimentIntensityAnalyzer to calculate the ticker compound value.
You can change multiple parameters to suit your needs. See below under "set program paramete... |
Configuration/Generator/python/Hadronizer_TuneEE5C_13TeV_madgraph_differentPDF_MPIoff_herwigpp_cff.py | ckamtsikis/cmssw | 852 | 12612959 | import FWCore.ParameterSet.Config as cms
from Configuration.Generator.HerwigppDefaults_cfi import *
from Configuration.Generator.HerwigppUE_EE_5C_cfi import *
from Configuration.Generator.HerwigppPDF_CTEQ6_LO_cfi import * # Import CTEQ6L PDF as shower pdf
from Configuration.Generator.HerwigppPDF_NNPDF30_NLO_cf... |
tests/redirects_tests/tests.py | agarwalutkarsh554/django | 61,676 | 12612960 | from django.conf import settings
from django.contrib.redirects.middleware import RedirectFallbackMiddleware
from django.contrib.redirects.models import Redirect
from django.contrib.sites.models import Site
from django.core.exceptions import ImproperlyConfigured
from django.http import (
HttpResponse, HttpResponseFo... |
tests/importer/onnx_/basic/test_constantofshape.py | xhuohai/nncase | 510 | 12612979 | # Copyright 2019-2021 Canaan Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
h/exceptions.py | tgiardina/rpp-h | 2,103 | 12612992 | <filename>h/exceptions.py<gh_stars>1000+
class InvalidUserId(Exception):
"""The userid does not meet the expected pattern."""
def __init__(self, user_id):
super().__init__(f"User id '{user_id}' is not valid")
class RealtimeMessageQueueError(Exception):
"""A message could not be sent to the realti... |
apps/webssh/websocket.py | crazypenguin/devops | 300 | 12613035 | from channels.generic.websocket import WebsocketConsumer
from .ssh import SSH
from django.conf import settings
from django.http.request import QueryDict
from django.utils.six import StringIO
import django.utils.timezone as timezone
from devops.settings import TMP_DIR
from server.models import RemoteUserBindHost
from we... |
migrations/versions/6ea7dc05f496_fix_typo_in_history_detail.py | cwinfo/PowerDNS-Admin | 109 | 12613036 | """Fix typo in history detail
Revision ID: 6ea7dc05f496
Revises: <KEY>
Create Date: 2022-05-10 10:16:58.784497
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '6ea7dc05f496'
down_revision = '<KEY>'
branch_labels = None
depends_on = None
history_table = sa.sql.... |
Networking-Test-Kit/LSL/lslStreamTest_FFTplot.py | thiago-roque07/OpenBCI_GUI | 500 | 12613046 | <gh_stars>100-1000
### Run the OpenBCI GUI
### Set Networking mode to LSL, FFT data type, and # Chan to 125
### Thanks to @Sentdex - Nov 2019
from pylsl import StreamInlet, resolve_stream
import numpy as np
import time
import matplotlib.pyplot as plt
from matplotlib import style
from collections import deque
last_pri... |
app/queues.py | riQQ/mtgatracker | 240 | 12613053 | <gh_stars>100-1000
import multiprocessing
all_die_queue = multiprocessing.Queue()
block_read_queue = multiprocessing.Queue()
json_blob_queue = multiprocessing.Queue()
game_state_change_queue = multiprocessing.Queue()
decklist_change_queue = multiprocessing.Queue()
general_output_queue = multiprocessing.Queue()
collect... |
HAN/test_han.py | RandolphVI/Text-Pairs-Relation-Classification | 150 | 12613063 | <gh_stars>100-1000
# -*- coding:utf-8 -*-
__author__ = 'Randolph'
import os
import sys
import time
import logging
import numpy as np
sys.path.append('../')
logging.getLogger('tensorflow').disabled = True
import tensorflow as tf
from utils import checkmate as cm
from utils import data_helpers as dh
from utils import ... |
algorithms/strings/decode_string.py | zhengli0817/algorithms | 22,426 | 12613081 | # Given an encoded string, return it's decoded string.
# The encoding rule is: k[encoded_string], where the encoded_string
# inside the square brackets is being repeated exactly k times.
# Note that k is guaranteed to be a positive integer.
# You may assume that the input string is always valid; No extra white spaces... |
tests/opentracer/utils.py | p7g/dd-trace-py | 308 | 12613103 | <reponame>p7g/dd-trace-py
from ddtrace.opentracer import Tracer
def init_tracer(service_name, dd_tracer, scope_manager=None):
"""A method that emulates what a user of OpenTracing would call to
initialize a Datadog opentracer.
It accepts a Datadog tracer that should be the same one used for testing.
"... |
observations/r/acf1.py | hajime9652/observations | 199 | 12613136 | <reponame>hajime9652/observations
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import numpy as np
import os
import sys
from observations.util import maybe_download_and_extract
def acf1(path):
"""Aberrant Crypt Foci ... |
locations/spiders/federal_savings_bank.py | boomerwv1/alltheplaces | 297 | 12613154 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
import json
import re
import scrapy
from locations.items import GeojsonPointItem
from locations.hours import OpeningHours
class FederalSavingsBankSpider(scrapy.Spider):
name = "federal_savings_bank"
allowed_domains = ['thefederalsavingsbank.com']
start_urls = [... |
tests/prioritization/test_prioritization_rules.py | trumanw/ScaffoldGraph | 121 | 12613157 | <filename>tests/prioritization/test_prioritization_rules.py
"""
scaffoldgraph tests.prioritization.test_prioritization_rules
"""
import pytest
from scaffoldgraph.prioritization.prioritization_rules import *
class MockScaffoldFilterRule(BaseScaffoldFilterRule):
def filter(self, child, parents):
return pa... |
pysph/examples/gas_dynamics/noh.py | nauaneed/pysph | 293 | 12613163 | <reponame>nauaneed/pysph
"""Example for the Noh's cylindrical implosion test. (10 minutes)
"""
# NumPy and standard library imports
import numpy
# PySPH base and carray imports
from pysph.base.utils import get_particle_array as gpa
from pysph.solver.application import Application
from pysph.sph.scheme import GasDSche... |
utils/time_tools.py | jingmouren/QuantResearch | 623 | 12613172 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pandas as pd
from datetime import datetime, timedelta
def convert_date_input(input_str, default_date=None):
"""
convert date input
:param input_str: 3y, 2m, 0mm 1w, or yyyy-mm-dd
:param default_date: datetime.date
:return:datetime.date
"""
... |
homeassistant/components/insteon/climate.py | learn-home-automation/core | 22,481 | 12613177 | """Support for Insteon thermostat."""
from __future__ import annotations
from pyinsteon.constants import ThermostatMode
from pyinsteon.operating_flag import CELSIUS
from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.const import (
ATTR_TARGET_TEMP_HIGH,
ATTR_TARGE... |
navec/train/ctl/merge.py | FreedomSlow/navec | 115 | 12613201 | <reponame>FreedomSlow/navec
import sys
from itertools import groupby
from heapq import (
heappush,
heappop,
)
from ..glove import (
load_glove_vocab,
format_glove_vocab,
load_glove_cooc,
format_glove_cooc
)
def merge_vocabs(args):
iters = [load_glove_vocab(_) for _ in args.paths]
r... |
reports/site/site_address.py | FreeQster/reports | 104 | 12613202 | # site_address.py
# Make sure to add `geocoder` to your `local_requirements.txt` and make sure it is installed in your Python venv.
import geocoder
from extras.reports import Report
from dcim.models import Site
class checkSiteAddress(Report):
description = "Check if site has a physical address and/or geolocation... |
GreedyInfoMax/vision/models/Resnet_Encoder.py | Spijkervet/Greedy_InfoMax | 288 | 12613214 | <reponame>Spijkervet/Greedy_InfoMax
import torch.nn as nn
import torch.nn.functional as F
import torch
from GreedyInfoMax.vision.models import InfoNCE_Loss, Supervised_Loss
from GreedyInfoMax.utils import model_utils
class PreActBlockNoBN(nn.Module):
"""Pre-activation version of the BasicBlock."""
expansion... |
numba/np/ufunc/__init__.py | auderson/numba | 6,620 | 12613225 | <reponame>auderson/numba<filename>numba/np/ufunc/__init__.py
# -*- coding: utf-8 -*-
from numba.np.ufunc.decorators import Vectorize, GUVectorize, vectorize, guvectorize
from numba.np.ufunc._internal import PyUFunc_None, PyUFunc_Zero, PyUFunc_One
from numba.np.ufunc import _internal, array_exprs
from numba.np.ufunc.pa... |
frappe/website/doctype/personal_data_download_request/test_personal_data_download_request.py | naderelabed/frappe | 3,755 | 12613259 | # -*- coding: utf-8 -*-
# Copyright (c) 2019, Frappe Technologies and Contributors
# License: MIT. See LICENSE
import frappe
import unittest
import json
from frappe.website.doctype.personal_data_download_request.personal_data_download_request import get_user_data
from frappe.contacts.doctype.contact.contact import get_... |
alphamind/data/standardize.py | rongliang-tech/alpha-mind | 186 | 12613270 | # -*- coding: utf-8 -*-
"""
Created on 2017-4-25
@author: cheng.li
"""
import numpy as np
from alphamind.utilities import aggregate
from alphamind.utilities import array_index
from alphamind.utilities import group_mapping
from alphamind.utilities import simple_mean
from alphamind.utilities import simple_sqrsum
from ... |
solutions/problem_197.py | ksvr444/daily-coding-problem | 1,921 | 12613275 | <gh_stars>1000+
def rotate_index(arr, k, src_ind, src_num, count=0):
if count == len(arr):
return
des_ind = (src_ind + k) % len(arr)
des_num = arr[des_ind]
arr[des_ind] = src_num
rotate_index(arr, k, des_ind, des_num, count + 1)
def rotate_k(arr, k):
if k < 1:
return arr
... |
docs_src/handling_errors/tutorial006.py | Aryabhata-Rootspring/fastapi | 53,007 | 12613302 | <reponame>Aryabhata-Rootspring/fastapi
from fastapi import FastAPI, HTTPException
from fastapi.exception_handlers import (
http_exception_handler,
request_validation_exception_handler,
)
from fastapi.exceptions import RequestValidationError
from starlette.exceptions import HTTPException as StarletteHTTPExceptio... |
google/ads/googleads/v8/common/__init__.py | wxxlouisa/google-ads-python | 285 | 12613334 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
# 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 b... |
networkx/algorithms/operators/__init__.py | jebogaert/networkx | 10,024 | 12613353 | from networkx.algorithms.operators.all import *
from networkx.algorithms.operators.binary import *
from networkx.algorithms.operators.product import *
from networkx.algorithms.operators.unary import *
|
tests/meltano/core/job/test_stale_job_failer.py | siilats/meltano | 122 | 12613355 | from datetime import datetime, timedelta
import pytest
from meltano.core.job import Job
from meltano.core.job.stale_job_failer import StaleJobFailer
class TestStaleJobFailer:
@pytest.fixture
def live_job(self, session):
job = Job(job_id="test")
job.start()
job.save(session)
r... |
lib/python/treadmill/spawn/utils.py | vrautela/treadmill | 133 | 12613365 | <filename>lib/python/treadmill/spawn/utils.py
"""Treadmill spawn utilities.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import os
import zlib
from treadmill import utils
_LOGGER = logging.getL... |
tools/accuracy_checker/openvino/tools/accuracy_checker/adapters/mask_rcnn_with_text.py | TolyaTalamanov/open_model_zoo | 2,201 | 12613382 | """
Copyright (c) 2018-2022 Intel 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 to in wri... |
run-debug-webhooks.py | MiniCodeMonkey/machine | 101 | 12613391 | #!/usr/bin/env python
''' Run openaddr.ci.webhooks.app in Flask debug mode.
'''
from openaddr.ci.web import app
if __name__ == '__main__':
app.run(debug=True)
|
ocr/tess/split_wide_boxes.py | susannahsoon/oldperth | 302 | 12613395 | <filename>ocr/tess/split_wide_boxes.py
#!/usr/bin/env python
"""Split boxes that are suspicously wide.
This maps box file --> box file.
"""
import copy
import sys
from box import BoxLine, load_box_file
def split_box(box):
"""Returns a list of (possibly just one) boxes, with appropriate widths."""
w = box.ri... |
backend/setup.py | jtimberlake/cloud-inquisitor | 462 | 12613404 | import setuptools
setuptools.setup(
name='cloud_inquisitor',
version='3.0.0',
entry_points={
'console_scripts': [
'cloud-inquisitor = cloud_inquisitor.cli:cli'
],
'cloud_inquisitor.plugins.commands': [
'auth = cloud_inquisitor.plugins.commands.auth:Auth',
... |
WebMirror/management/rss_parser_funcs/feed_parse_extractMayonaizeshrimpWordpressCom.py | fake-name/ReadableWebProxy | 193 | 12613411 | <filename>WebMirror/management/rss_parser_funcs/feed_parse_extractMayonaizeshrimpWordpressCom.py
def extractMayonaizeshrimpWordpressCom(item):
'''
Parser for 'mayonaizeshrimp.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['titl... |
python-exercises/while_loop.py | nakonovalov/Python-for-beginners | 158 | 12613414 | <filename>python-exercises/while_loop.py
# A simple while loop example
user_input = input('Hey how are you ')
while user_input != 'stop copying me':
print(user_input)
user_input = input()
else:
print('UGHH Fine') |
src/plot.py | steveandpeggyb/walking-salesman | 1,760 | 12613427 | <reponame>steveandpeggyb/walking-salesman
import matplotlib.pyplot as plt
import matplotlib as mpl
def plot_network(cities, neurons, name='diagram.png', ax=None):
"""Plot a graphical representation of the problem"""
mpl.rcParams['agg.path.chunksize'] = 10000
if not ax:
fig = plt.figure(figsize=(5,... |
examples/adaptive_hgb/adaptive_hgb_client.py | cuiboyuan/plato | 135 | 12613437 | """
A federated learning client with support for Adaptive hierarchical gradient blending.
"""
import copy
import logging
import os
import time
from dataclasses import dataclass
from plato.clients import base, simple
from plato.config import Config
from plato.models.multimodal import blending
from plato.samplers impor... |
tests/Issue11/issue11.py | ryogrid/shellbags | 128 | 12613475 | #!/usr/bin/python
import os
import sys
# from http://stackoverflow.com/a/9806045/87207
import inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
parentparentdir = os.path.dirname(parentdir)
sys.path.append(parentparentdir)
from ShellI... |
sympy/printing/python.py | ethankward/sympy | 445 | 12613481 | <reponame>ethankward/sympy<gh_stars>100-1000
from __future__ import print_function, division
import keyword as kw
import sympy
from .repr import ReprPrinter
from .str import StrPrinter
# A list of classes that should be printed using StrPrinter
STRPRINT = ("Add", "Infinity", "Integer", "Mul", "NegativeInfinity",
... |
data_collection/gazette/spiders/sc_corupa.py | kaiocp/querido-diario | 454 | 12613521 | <gh_stars>100-1000
from gazette.spiders.base.fecam import FecamGazetteSpider
class ScCorupaSpider(FecamGazetteSpider):
name = "sc_corupa"
FECAM_QUERY = "cod_entidade:78"
TERRITORY_ID = "4204509"
|
backend/src/baserow/test_utils/fixtures/row.py | ashishdhngr/baserow | 839 | 12613552 | from baserow.contrib.database.rows.handler import RowHandler
class RowFixture:
def create_row_for_many_to_many_field(
self, table, field, values, user, model=None, **kwargs
):
"""
This is a helper function for creating a row with a many-to-many field that
preserves the order of... |
rpython/jit/backend/x86/test/test_calling_convention.py | nanjekyejoannah/pypy | 381 | 12613555 | <filename>rpython/jit/backend/x86/test/test_calling_convention.py
from rpython.jit.backend.test.calling_convention_test import CallingConvTests
from rpython.jit.backend.x86 import codebuf
from rpython.jit.backend.x86.arch import WORD
from rpython.jit.backend.x86.regloc import eax, esp
class TestCallingConv(CallingConv... |
homeassistant/components/alarmdecoder/sensor.py | learn-home-automation/core | 22,481 | 12613556 | <reponame>learn-home-automation/core
"""Support for AlarmDecoder sensors (Shows Panel Display)."""
from homeassistant.components.sensor import SensorEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from .const import SIGNAL_PANEL_MESSAGE
async def async_setup_e... |
route/recent_record_reset.py | k0000k/openNAMU | 126 | 12613558 | <filename>route/recent_record_reset.py
from .tool.func import *
def recent_record_reset_2(conn, name):
curs = conn.cursor()
if admin_check() != 1:
return re_error('/error/3')
if flask.request.method == 'POST':
admin_check(None, 'record reset ' + name)
curs.execute(db_change("dele... |
lektor/constants.py | yagebu/lektor | 4,104 | 12613561 | # Special value that identifies a target to the primary alt
PRIMARY_ALT = "_primary"
|
pdm/models/auth.py | houbie/pdm | 1,731 | 12613566 | from typing import List, Optional, Tuple
import click
from pdm._types import Source
from pdm.exceptions import PdmException
from pdm.models.pip_shims import MultiDomainBasicAuth
try:
import keyring
except ModuleNotFoundError:
keyring = None # type: ignore
class PdmBasicAuth(MultiDomainBasicAuth):
"""A... |
pygsheets/authorization.py | samamorgan/pygsheets | 1,346 | 12613567 | <filename>pygsheets/authorization.py
# -*- coding: utf-8 -*-.
import os
import json
import warnings
from google.oauth2 import service_account
from google.oauth2.credentials import Credentials
from google_auth_oauthlib.flow import Flow, InstalledAppFlow
from google.auth.transport.requests import Request
from pygsheets... |
bibliopixel/layout/cutter.py | rec/leds | 253 | 12613575 | """
Cut matrices by row or column and apply operations to them.
"""
class Cutter:
"""
Base class that pre-calculates cuts and can use them to
apply a function to the layout.
Each "cut" is a row or column, depending on the value of by_row.
The entries are iterated forward or backwards, depending ... |
h2o-py/h2o/estimators/anovaglm.py | MikolajBak/h2o-3 | 6,098 | 12613613 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# This file is auto-generated by h2o-3/h2o-bindings/bin/gen_python.py
# Copyright 2016 H2O.ai; Apache License Version 2.0 (see LICENSE for details)
#
from __future__ import absolute_import, division, print_function, unicode_literals
import h2o
from h2o.base import Key... |
tests/xontribs/test_jedi.py | meramsey/xonsh | 4,716 | 12613616 | """Tests for the Jedi completer xontrib"""
import sys
import pytest
import importlib
from unittest.mock import MagicMock, call
from tests.tools import skip_if_on_windows, skip_if_on_darwin
from xonsh.xontribs import find_xontrib
from xonsh.completers.tools import RichCompletion
from xonsh.parsers.completion_context i... |
chapter6_operation_management/condition_based_pattern/src/api_composition_proxy/routers/routers.py | sudabon/ml-system-in-actions | 133 | 12613617 | import asyncio
import base64
import io
import logging
import uuid
from typing import Any, Dict, List
import grpc
import httpx
from fastapi import APIRouter
from PIL import Image
from src.api_composition_proxy.backend import request_tfserving
from src.api_composition_proxy.backend.data import Data
from src.api_composit... |
tests/hwsim/wlantest.py | majacQ/fragattacks | 1,104 | 12613626 | # Python class for controlling wlantest
# Copyright (c) 2013-2019, <NAME> <<EMAIL>>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import re
import os
import posixpath
import time
import subprocess
import logging
import wpaspy
logger = logging.getLogger()
clas... |
lib/python2.7/site-packages/sklearn/gaussian_process/correlation_models.py | wfehrnstrom/harmonize | 6,989 | 12613636 | # -*- coding: utf-8 -*-
# Author: <NAME> <<EMAIL>>
# (mostly translation, see implementation details)
# License: BSD 3 clause
"""
The built-in correlation models submodule for the gaussian_process module.
"""
import numpy as np
def absolute_exponential(theta, d):
"""
Absolute exponential autocorre... |
xdfile/ccxml2xd.py | jmviz/xd | 179 | 12613663 | # -*- coding: utf-8 -*-
#!/usr/bin/env python3
import string
import re
from lxml import etree
import xdfile
from xdfile.utils import escape, consecutive, xml_escape_table, rev_xml_escape_table, error
HEADER_RENAMES = {
'Creator': 'Author'
}
# data is bytes()
def parse_ccxml(data, filename):
content = data.... |
scale/util/exceptions.py | kaydoh/scale | 121 | 12613672 | """Defines utility exceptions"""
from util.validation import ValidationError
class FileDoesNotExist(Exception):
"""Exception indicating an attempt was made to access a file that no longer exists
"""
pass
class InvalidBrokerUrl(Exception):
"""Exception indicating the broker URL does not meet the for... |
tests/filters/test_base_filter.py | mokeyish/thumbor | 6,837 | 12613684 | <reponame>mokeyish/thumbor
#!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com <EMAIL>
from preggy import expect
from tornado.testing import gen_... |
modelci/utils/docker_api_utils.py | FerdinandZhong/ML-Model-CI | 170 | 12613686 | <reponame>FerdinandZhong/ML-Model-CI
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Author: <NAME>
Email: <EMAIL>
Date: 10/3/2020
Docker Container API utilization.
"""
from docker.errors import ImageNotFound
def check_container_status(docker_client, name):
"""Check an existed container running status and heal... |
ddn/pytorch/node.py | pmorerio/ddn | 161 | 12613703 | <reponame>pmorerio/ddn
# DEEP DECLARATIVE NODES
# Defines the PyTorch interface for data processing nodes and declarative nodes
#
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
import torch
from torch.autograd import grad
import warnings
class AbstractNode:
"""Minimal interface for generic data processing node
that pr... |
mvpa2/cmdline/cmd_searchlight.py | nno/PyMVPA | 227 | 12613718 | <gh_stars>100-1000
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the PyMVPA package for the
# copyright and license terms.
#
... |
tests/test_validate.py | frictionlessdata/goodtables-py | 243 | 12613734 | # -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import sys
import six
import json
import pytest
from pprint import pprint
from copy import deepcopy
from importlib import import_module
from goodt... |
examples/pytorch/pointcloud/pointnet/pointnet_cls.py | ketyi/dgl | 9,516 | 12613736 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
class PointNetCls(nn.Module):
def __init__(self, output_classes, input_dims=3, conv1_dim=64,
dropout_prob=0.5, use_transform=True):
super(PointNetCls, self).__init__()
... |
analysis/iec_cases/batch_sim_test.py | leozz37/makani | 1,178 | 12613738 | <reponame>leozz37/makani
# Copyright 2020 Makani Technologies 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 ap... |
contrib/python/scipy/scipy/integrate/tests/test_quadrature.py | ibr11/catboost | 6,989 | 12613756 | <gh_stars>1000+
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from numpy import cos, sin, pi
from numpy.testing import TestCase, run_module_suite, assert_equal, \
assert_almost_equal, assert_allclose, assert_
from scipy.integrate import (quadrature, romberg, r... |
src/ray_tune.py | waddupitzme/graph-neural-pde | 125 | 12613768 | <reponame>waddupitzme/graph-neural-pde<gh_stars>100-1000
import argparse
import os
from functools import partial
import numpy as np
import torch
from data import get_dataset, set_train_val_test_split
from GNN_early import GNNEarly
from GNN import GNN
from ray import tune
from ray.tune import CLIReporter
from ray.tune.... |
tests/anomaly/forecast_based/test_lstm.py | mbignotti/Merlion | 2,215 | 12613775 | <gh_stars>1000+
#
# Copyright (c) 2022 salesforce.com, inc.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
#
import datetime
import logging
import math
from os.path import abspath, dirname, joi... |
electrum_axe/axe_peer.py | AXErunners/electrum-axe | 336 | 12613789 | <gh_stars>100-1000
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Axe-Electrum - lightweight Axe client
# Copyright (C) 2019 Axe Developers
#
# 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 Softwar... |
lib/python/parallels_send_string.py | ibizaman/veewee | 1,295 | 12613815 | import sys
import prlsdkapi
import string
if len(sys.argv) != 3:
print "Usage: parallels_send_string '<VM_NAME>' '<string>'"
exit()
# Parse arguments
vm_name=sys.argv[1]
# String to use
keynames = sys.argv[2].split(' ');
prlsdk = prlsdkapi.prlsdk
consts = prlsdkapi.prlsdk.consts
# Initialize the Parallels A... |
tests/pytests/unit/modules/test_rabbitmq.py | tomdoherty/salt | 9,425 | 12613849 | <reponame>tomdoherty/salt<filename>tests/pytests/unit/modules/test_rabbitmq.py
"""
:codeauthor: <NAME> <<EMAIL>>
"""
import logging
import pytest
import salt.modules.rabbitmq as rabbitmq
from salt.exceptions import CommandExecutionError
from tests.support.mock import MagicMock, patch
log = logging.getLogger(__n... |
PhysicsTools/PatAlgos/python/slimming/offlineSlimmedPrimaryVerticesWithBS_cfi.py | Purva-Chaudhari/cmssw | 852 | 12613850 | <gh_stars>100-1000
import FWCore.ParameterSet.Config as cms
offlineSlimmedPrimaryVerticesWithBS = cms.EDProducer("PATVertexSlimmer",
src = cms.InputTag("offlinePrimaryVerticesWithBS"),
score = cms.InputTag("primaryVertexWithBSAssociation","original"),
)
|
airbyte-integrations/connectors/source-hubspot/source_hubspot/__init__.py | rajatariya21/airbyte | 6,215 | 12613864 | from .source import SourceHubspot
__all__ = ["SourceHubspot"]
|
caliban/platform/gke/types.py | Anon-Artist/caliban | 425 | 12613901 | #!/usr/bin/python
#
# 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 ag... |
lib/smpl/vertex_joint_selector.py | xuchen-ethz/snarf | 150 | 12613910 | # -*- coding: utf-8 -*-
# Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG) is
# holder of all proprietary rights on this computer program.
# You can only use this computer program if you have closed
# a license agreement with MPG or you get the right to use the computer
# program from someone who is... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.