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 |
|---|---|---|---|---|
tests/test_edgeql_enums.py | sfermigier/edgedb | 7,302 | 12791331 | <gh_stars>1000+
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2019-present MagicStack Inc. and the EdgeDB 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... |
tests/integration/test_configinventory.py | vincentbernat/lldpd | 312 | 12791347 | <filename>tests/integration/test_configinventory.py
import os
import pytest
import platform
import time
import shlex
@pytest.mark.skipif("'LLDP-MED' not in config.lldpd.features",
reason="LLDP-MED not supported")
class TestConfigInventory(object):
def test_configinventory(self, lldpd1, lldpd, ... |
webservice/server/server/summ_eval/server/cli/__init__.py | mymusise/emnlp19-moverscore | 141 | 12791390 | def main():
from summ_eval.server import EvalServer
from summ_eval.server.helper import get_run_args
args = get_run_args()
server = EvalServer(args)
server.start()
server.join() |
stats/constants.py | mpope9/nba-sql | 113 | 12791395 | <gh_stars>100-1000
"""
Constants used in the application.
"""
"""
List of seasons.
"""
season_list = [
'1996-97',
'1997-98',
'1998-99',
'1999-00',
'2000-01',
'2001-02',
'2002-03',
'2003-04',
'2004-05',
'2005-06',
'2006-07',
'2007-08',
'2008-09',
'2009-10',
'2... |
descarteslabs/common/graft/interpreter/__init__.py | descarteslabs/descarteslabs-python | 167 | 12791407 | <gh_stars>100-1000
from .interpreter import interpret
from . import exceptions
from .scopedchainmap import ScopedChainMap
__all__ = ["interpret", "exceptions", "ScopedChainMap"]
|
skyline/functions/database/queries/related_to_metric_groups.py | datastreaming/skyline-1 | 396 | 12791408 | <reponame>datastreaming/skyline-1
"""
Get anomalies for a metric id
"""
import logging
import traceback
from ast import literal_eval
from sqlalchemy.sql import select
from database import get_engine, engine_disposal, metric_group_table_meta
from functions.metrics.get_base_name_from_metric_id import get_base_name_from_... |
html_parsing/get_game_genres/parsers/squarefaction_ru.py | DazEB2/SimplePyScripts | 117 | 12791421 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
from typing import List
from bs4 import BeautifulSoup
from base_parser import BaseParser
class SquarefactionRu_Parser(BaseParser):
def _parse(self) -> List[str]:
url = f'http://squarefaction.ru/main/search/games?q={self.game_name}'
... |
test/test_algos/test_opt_algorithm/test_racos/test_racos.py | IcarusWizard/ZOOpt | 403 | 12791427 | <filename>test/test_algos/test_opt_algorithm/test_racos/test_racos.py
from zoopt.algos.opt_algorithms.racos.racos_common import RacosCommon
from zoopt.algos.opt_algorithms.racos.sracos import SRacos
from zoopt import Solution, Objective, Dimension, Parameter, Opt, ExpOpt, ValueType, Dimension2
import numpy as np
def ... |
Testing/test_2D_frames.py | geosharma/PyNite | 199 | 12791433 | <filename>Testing/test_2D_frames.py
# -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2020 <NAME>, SE; tamalone1
"""
import unittest
from PyNite import FEModel3D
import math
import sys
from io import StringIO
class Test_2D_Frame(unittest.TestCase):
''' Tests of analyzing 2D frames. '''
def setUp(self):
... |
test/test_fakeservertest.py | yimuniao/collectd-cloudwatch | 220 | 12791454 | import unittest
import requests
from helpers.fake_http_server import FakeServer
class FakeServerTest(unittest.TestCase):
SERVER = None
@classmethod
def setUpClass(cls):
cls.SERVER = FakeServer()
cls.SERVER.start_server()
cls.SERVER.serve_forever()
def setUp(self):
se... |
src/ralph/supports/migrations/0006_auto_20160615_0805.py | DoNnMyTh/ralph | 1,668 | 12791475 | <filename>src/ralph/supports/migrations/0006_auto_20160615_0805.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import ralph.lib.mixins.fields
class Migration(migrations.Migration):
dependencies = [
('supports', '0005_auto_20160105_1222'),
... |
tools/gen_doc_files.py | joshddunn/crsfml | 248 | 12791476 | <filename>tools/gen_doc_files.py
import os
import textwrap
import mkdocs_gen_files
root = mkdocs_gen_files.config["plugins"]["mkdocstrings"].get_handler("crystal").collector.root
nav = mkdocs_gen_files.open(f"api/index.md", "w")
for module in ["System", "Window", "Graphics", "Audio", "Network", ""]:
if module:
... |
startup_scripts/240_virtualization_interfaces.py | systempal/netbox-docker | 691 | 12791478 | import sys
from startup_script_utils import load_yaml, pop_custom_fields, set_custom_fields_values
from virtualization.models import VirtualMachine, VMInterface
interfaces = load_yaml("/opt/netbox/initializers/virtualization_interfaces.yml")
if interfaces is None:
sys.exit()
required_assocs = {"virtual_machine"... |
tests/util_test.py | nickgaya/bravado-core | 122 | 12791481 | <reponame>nickgaya/bravado-core
# -*- coding: utf-8 -*-
from inspect import getcallargs
import mock
import pytest
from bravado_core.util import AliasKeyDict
from bravado_core.util import cached_property
from bravado_core.util import determine_object_type
from bravado_core.util import lazy_class_attribute
from bravado... |
pytest_use_postgresql.py | admariner/django-sql-dashboard | 293 | 12791491 | import os
import pytest
from dj_database_url import parse
from django.conf import settings
from testing.postgresql import Postgresql
postgres = os.environ.get("POSTGRESQL_PATH")
initdb = os.environ.get("INITDB_PATH")
_POSTGRESQL = Postgresql(postgres=postgres, initdb=initdb)
@pytest.hookimpl(tryfirst=True)
def pyte... |
tableauserverclient/models/target.py | zuarbase/server-client-python | 470 | 12791513 | <filename>tableauserverclient/models/target.py
"""Target class meant to abstract mappings to other objects"""
class Target:
def __init__(self, id_, target_type):
self.id = id_
self.type = target_type
def __repr__(self):
return "<Target#{id}, {type}>".format(**self.__dict__)
|
tools/builder.py | dp92987/nginx-amplify-agent | 308 | 12791532 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import sys
from builders import deb, rpm, amazon
from builders.util import shell_call
__author__ = "<NAME>"
__copyright__ = "Copyright (C) Nginx, Inc. All rights reserved."
__license__ = ""
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
if __name__ == '__main__':... |
ros/dataset_to_rosbag.py | sn0wflake/gta | 4,498 | 12791549 | #!/usr/bin/env python
from itertools import izip
import numpy as np
import h5py
from progress.bar import Bar
import sys
import rospy
import rosbag
from sensor_msgs.msg import Imu, Image
def main():
if len(sys.argv) < 2:
print("Usage: {} dataset_name".format(sys.argv[0]))
exit(1)
file_name = sys.argv[1]
... |
tests/test_py33_exceptions.py | haypo/trollius | 175 | 12791553 | # -*- coding: utf-8 -*-
"""
Tests for py33_exceptions.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import unittest
from trollius import py33_exceptions
class TestWrapErrors(unittest.TestCase):
def test_ebadf_wrapped_to_OSError(self):
... |
tests/RunTests/PythonTests/test2011_011.py | maurizioabba/rose | 488 | 12791565 | <gh_stars>100-1000
# tests for dictionary displays
a = {}
b = {1: 2}
c = {3: 4, 5: 6}
d = {7: "seven", 8: "eight", 9: "nine", 10: "one" + "zero"}
print a
print b
print c
print d
|
speech_mixer.py | ZhihaoDU/speech_feature_extractor | 111 | 12791645 | <reponame>ZhihaoDU/speech_feature_extractor
# coding = utf-8
import numpy as np
from read_sphere_wav import read_sphere_wav
from scipy.io import wavfile
from feature_extractor import *
from matplotlib import pyplot as plt
def SNR(x1, x2):
from numpy.linalg import norm
return 20 * np.log10(norm(x1) / norm(x2)... |
miniboss/__init__.py | afroisalreadyinu/miniboss | 633 | 12791659 | from .main import cli
from .services import Service
from .context import Context
from .types import set_group_name as group_name
|
homeassistant/components/hardkernel/const.py | liangleslie/core | 30,023 | 12791666 | <filename>homeassistant/components/hardkernel/const.py
"""Constants for the Hardkernel integration."""
DOMAIN = "hardkernel"
|
tests/UnitTests/Morphology/Disambiguator/disambiguator_prefix_rule1_test.py | ZenaNugraha/PySastrawi | 282 | 12791668 | import unittest
from Sastrawi.Morphology.Disambiguator.DisambiguatorPrefixRule1 import DisambiguatorPrefixRule1a, DisambiguatorPrefixRule1b
class Test_DisambiguatorPrefixRule1Test(unittest.TestCase):
def setUp(self):
self.subject1a = DisambiguatorPrefixRule1a()
self.subject1b = DisambiguatorPrefixR... |
app/admin/__init__.py | sunshineinwater/flask-Purchase_and_sale | 122 | 12791690 | <filename>app/admin/__init__.py
#-*- coding:utf-8 -*-
# author:Agam
# datetime:2018-11-05
from flask import Blueprint
admin=Blueprint('admin',__name__)
import app.admin.views
|
janitor/functions/groupby_agg.py | thatlittleboy/pyjanitor | 225 | 12791693 | from typing import Callable, List, Union
import pandas_flavor as pf
import pandas as pd
from janitor.utils import deprecated_alias
@pf.register_dataframe_method
@deprecated_alias(new_column="new_column_name", agg_column="agg_column_name")
def groupby_agg(
df: pd.DataFrame,
by: Union[List, Callable, str],
... |
PyFlow/Packages/PyFlowBase/Nodes/forLoopBegin.py | luzpaz/PyFlow | 1,463 | 12791725 | ## Copyright 2015-2019 <NAME>, <NAME>
## 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 i... |
src/vimpdb/proxy.py | dtrckd/vimpdb | 110 | 12791748 | import os
import socket
import subprocess
from vimpdb import config
from vimpdb import errors
def get_eggs_paths():
import vim_bridge
vimpdb_path = config.get_package_path(errors.ReturnCodeError())
vim_bridge_path = config.get_package_path(vim_bridge.bridged)
return (
os.path.dirname(vimpdb_p... |
recognition/predict.py | w-garcia/insightface | 108 | 12791780 | <reponame>w-garcia/insightface
from __future__ import absolute_import, division, print_function, unicode_literals
import argparse
import os
import sys
import tensorflow as tf
import yaml
from recognition.backbones.resnet_v1 import ResNet_v1_50
from recognition.models.models import MyModel
tf.enable_eager_execution(... |
Lib/test/test_compiler/testcorpus/04_assign.py | diogommartins/cinder | 1,886 | 12791781 | a = 1
b = "foo"
c = (d, e)
di = {f: 1, g: 2}
|
setup.py | Mumbleskates/jsane | 131 | 12791792 | <filename>setup.py
#!/usr/bin/env python
import sys
from jsane import __version__
assert sys.version >= '2.7', ("Requires Python v2.7 or above, get with the "
"times, grandpa.")
from setuptools import setup
classifiers = [
"License :: OSI Approved :: MIT License",
"Programming La... |
packages/testcases/input/nameprep/extract-tests.py | taarushv/ethers.js | 4,494 | 12791847 | import json
import re
output = ""
for line in file("test-vectors-00.txt"):
line = line.strip()
if line == "" or line[0:1] == "#":
continue
if line.startswith("Josefsson") or line.startswith("Internet-Draft"):
continue
output += line.replace("\n", "")
Tests = [ ]
def get_byte(v):
i... |
lightreid/models/architectures/build.py | nataliamiccini/light-reid | 296 | 12791903 | <gh_stars>100-1000
from lightreid.utils import Registry
ARCHs_REGISTRY = Registry('arch')
|
gh_build.py | sonvt1710/manga-py | 337 | 12791914 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
from helpers.gh_pages import main
main()
|
tests/unit/test_lists.py | scherroman/mugen | 119 | 12791918 | import pytest
from mugen import lists
from mugen.lists import MugenList
class Dummy(object):
foo = 1
@pytest.fixture
def mugen_list() -> MugenList:
return MugenList([Dummy(), Dummy(), Dummy(), Dummy(), Dummy(), Dummy()])
@pytest.mark.parametrize("l, expected_foo", [
(mugen_list(), [1, 1, 1, 1, 1, 1])... |
crabageprediction/venv/Lib/site-packages/fontTools/ttLib/tables/_c_i_d_g.py | 13rianlucero/CrabAgePrediction | 2,705 | 12791927 | # coding: utf-8
from .otBase import BaseTTXConverter
class table__c_i_d_g(BaseTTXConverter):
"""The AAT ``cidg`` table has almost the same structure as ``gidc``,
just mapping CIDs to GlyphIDs instead of the reverse direction.
It is useful for fonts that may be used by a PDF renderer in lieu of
a font reference w... |
services/workers/settings/base.py | paulowe/aws-boilerplate | 711 | 12791949 | import json
import boto3
from environs import Env
env = Env()
AWS_ENDPOINT_URL = env('AWS_ENDPOINT_URL', None)
SMTP_HOST = env('SMTP_HOST', None)
EMAIL_ENABLED = env.bool('EMAIL_ENABLED', default=True)
secrets_manager_client = boto3.client('secretsmanager', endpoint_url=AWS_ENDPOINT_URL)
def fetch_db_secret(db_se... |
WebMirror/management/rss_parser_funcs/feed_parse_extractKendalblackBlogspotCom.py | fake-name/ReadableWebProxy | 193 | 12791996 | def extractKendalblackBlogspotCom(item):
'''
DISABLED
Parser for 'kendalblack.blogspot.com'
'''
return None |
dephell/__main__.py | OliverHofkens/dephell | 1,880 | 12792035 | # app
from .cli import entrypoint
entrypoint()
|
docs/examples/use_cases/tensorflow/efficientdet/dataset/create_tfrecord_indexes.py | cyyever/DALI | 3,967 | 12792087 | <gh_stars>1000+
# Copyright 2021 <NAME>. 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 applica... |
Hackerrank/World Cup 2016/World Cup/Problem F/gen.py | VastoLorde95/Competitive-Programming | 170 | 12792121 | from math import *
from fractions import *
from random import *
n = 1000000000
q = 200000
print n, q
for _ in xrange(q):
t = randrange(1,4)
l,r,c = randrange(1,n+1), randrange(1,n+1), 1000000000
if t < 3:
print t,l,r,c
else:
print t,l,r
#print 3, 1, 1000000000
|
core/views.py | HortenciaArliane/speakerfight | 369 | 12792124 |
from django.contrib.auth.models import User
from django.utils.translation import ugettext as _
from django.http import Http404, HttpResponseRedirect
from django.contrib import messages
from django.shortcuts import get_object_or_404
from django.utils import translation
from vanilla import TemplateView, DetailView, Upd... |
OpenAttack/data/test.py | e-tornike/OpenAttack | 444 | 12792136 | NAME = "test"
DOWNLOAD = "/TAADToolbox/test.pkl"
|
tests/test_context_manager.py | timgates42/tasktiger | 1,143 | 12792144 | <reponame>timgates42/tasktiger
"""Child context manager tests."""
import redis
from tasktiger import Worker
from .tasks import exception_task, simple_task
from .test_base import BaseTestCase
from .config import TEST_DB, REDIS_HOST
class ContextManagerTester(object):
"""
Dummy context manager class.
Use... |
docs/examples/save_geotiff.py | carderne/descarteslabs-python | 167 | 12792145 | """
==================================================
Save image to GeoTIFF
==================================================
This example demonstrates how to save an image
to your local machine in GeoTiff format.
"""
import descarteslabs as dl
# Create an aoi feature to clip imagery to
box = {
"type": "Polygo... |
core/migrations/remove_provider_dns_server_ip_model.py | simpsonw/atmosphere | 197 | 12792165 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2018-09-07 21:53
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', 'remove_atmosphereuser_selected_identity'),
]
operations = [
migrations.Alte... |
custom/inddex/food.py | dimagilg/commcare-hq | 471 | 12792192 | """
This file contains the logic to generate the master dataset for the INDDEX reports
Overview
--------
Beneficiaries are asked about their diet in a "recall" session. This results in
a "foodrecall" case. Every food they mention results in the creation of a "food"
case that's a child of this foodrecall.
This dataset... |
testbook/reference.py | loichuder/testbook | 291 | 12792220 | <reponame>loichuder/testbook
from .exceptions import (
TestbookExecuteResultNotFoundError,
TestbookAttributeError,
TestbookSerializeError,
TestbookRuntimeError
)
from .utils import random_varname
from .translators import PythonTranslator
class TestbookObjectReference:
def __init__(self, tb, name):... |
k8s_snapshots/logconf.py | gmarkey/k8s-snapshots | 326 | 12792239 | <filename>k8s_snapshots/logconf.py<gh_stars>100-1000
import logging
import logging.config
from collections import OrderedDict
from typing import Optional, List, Any, Dict
import structlog
import sys
from k8s_snapshots import serialize
class ProcessStructuredErrors:
def __init__(self):
pass
def __ca... |
setup.py | samir-joshi/tmtoolkit | 167 | 12792250 | <filename>setup.py<gh_stars>100-1000
"""
tmtoolkit setuptools based setup module
"""
import os
from codecs import open
from setuptools import setup, find_packages
__title__ = 'tmtoolkit'
__version__ = '0.10.0'
__author__ = '<NAME>'
__license__ = 'Apache License 2.0'
GITHUB_URL = 'https://github.com/WZBSocialScienc... |
src/genie/libs/parser/junos/tests/ShowServicesAccountingErrors/cli/equal/golden_output_1_expected.py | balmasea/genieparser | 204 | 12792251 | expected_output = {
"services-accounting-information": {
"v9-error-information": [
{
"interface-name": "ms-9/0/0",
"service-set-dropped": "0",
"active-timeout-failures": "0",
"export-packet-failures": "0",
"flow-crea... |
open/core/betterself/views/activity_log_views.py | lawrendran/open | 105 | 12792291 | from open.core.betterself.models.activity_log import ActivityLog
from open.core.betterself.serializers.activity_log_serializers import (
ActivityLogReadSerializer,
ActivityLogCreateUpdateSerializer,
)
from open.core.betterself.views.mixins import (
BaseGetUpdateDeleteView,
BaseCreateListView,
)
class ... |
src/scripts/apply_json_metadata.py | charlottestanton/covid-19-open-data | 430 | 12792361 | <filename>src/scripts/apply_json_metadata.py
# 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 require... |
attributes/continuous_integration/__init__.py | Lufedi/reaper | 106 | 12792425 | <reponame>Lufedi/reaper
class CiService(object):
@staticmethod
def is_enabled(path):
raise NotImplementedError()
|
nemo/collections/nlp/models/glue_benchmark/metrics_for_glue.py | vinayphadnis/NeMo | 4,145 | 12792435 | # Copyright 2018 The Google AI Language Team Authors and
# The HuggingFace Inc. team.
# Copyright (c) 2020, <NAME>. 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
#
# ... |
opentapioca/tagger.py | heathersherry/opentapioca | 191 | 12792438 | <reponame>heathersherry/opentapioca<filename>opentapioca/tagger.py
import json
import requests
import logging
import re
from math import log
from .languagemodel import BOWLanguageModel
from .wikidatagraph import WikidataGraph
from .tag import Tag
from .mention import Mention
# solr_collection = 'wd_multilingual'
logg... |
tests/x-custom_tests.py | ivoupton/sheet2dict | 208 | 12792463 | import sys
from pathlib import Path
sys.path.append(str(Path(".").absolute().parent))
from sheet2dict import Worksheet
from io import BytesIO
ws = Worksheet()
ws.xlsx_to_dict(path="inventory.xlsx")
print(">>", ws.header)
print("ALL:", ws.sheet_items)
print("SANITIZED:", ws.sanitize_sheet_items)
path = "inventory.... |
new_venv/Lib/site-packages/cardio/core/utils.py | Shlyankin/cardio | 250 | 12792478 | """Miscellaneous ECG Batch utils."""
import functools
import pint
import numpy as np
from sklearn.preprocessing import LabelBinarizer as LB
UNIT_REGISTRY = pint.UnitRegistry()
def get_units_conversion_factor(old_units, new_units):
"""Return a multiplicative factor to convert a measured quantity from old
t... |
flake8_pytest_style/visitors/fail.py | kianmeng/flake8-pytest-style | 125 | 12792504 | <reponame>kianmeng/flake8-pytest-style<gh_stars>100-1000
import ast
from flake8_plugin_utils import Visitor
from flake8_pytest_style.config import Config
from flake8_pytest_style.errors import AssertAlwaysFalse, FailWithoutMessage
from flake8_pytest_style.utils import (
get_simple_call_args,
is_empty_string,
... |
RecoHI/HiEgammaAlgos/python/HiIsolationCommonParameters_cff.py | ckamtsikis/cmssw | 852 | 12792509 | import FWCore.ParameterSet.Config as cms
isolationInputParameters = cms.PSet(
barrelBasicCluster = cms.InputTag("islandBasicClusters","islandBarrelBasicClusters"),
endcapBasicCluster = cms.InputTag("islandBasicClusters","islandEndcapBasicClusters"),
horeco = cms.InputTag("horeco"),
hfreco = cms.InputTag("h... |
examples/scheduling.py | arnimarj/crochet | 152 | 12792569 | <filename>examples/scheduling.py
#!/usr/bin/python
"""
An example of scheduling time-based events in the background.
Download the latest EUR/USD exchange rate from Yahoo every 30 seconds in the
background; the rendered Flask web page can use the latest value without
having to do the request itself.
Note this is examp... |
update-attempt-ids.py | inducer/courseflow | 284 | 12792584 | <filename>update-attempt-ids.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django
django.setup()
from course.models import GradeChange
for gchange in GradeChange.objects.all():
if gchange.flow_session is not None:
gchange.attempt_id = "flow-session-%d" % gchange.flow_session.... |
backend/auth/security.py | restato/bunnybook | 131 | 12792593 | from typing import Optional, Dict
import jwt
import sentry_sdk
from fastapi import HTTPException
from starlette import status
from starlette.requests import Request
from auth.models import Role
from auth.models import User
from config import cfg
def get_user(request: Request) -> User:
"""
Protect route from... |
src/commands/get_ast.py | PranjalPansuriya/JavaScriptEnhancements | 690 | 12792595 | import sublime, sublime_plugin
import os
from ..libs import util
from ..libs import NodeJS
from ..libs import javaScriptEnhancements
from ..libs.global_vars import *
class JavascriptEnhancementsGetAstCommand(sublime_plugin.TextCommand):
def run(self, edit, **args):
view = self.view
flow_cli = "flow"
is_... |
tests/test-cases/basic/ssa_case-5.py | SMAT-Lab/Scalpel | 102 | 12792624 | # Imports
import os
import random
from collections import Counter, defaultdict
import random
from nltk.tag import StanfordNERTagger
from nltk.tokenize import word_tokenize
from nltk import pos_tag
from nltk.chunk import conlltags2tree
from nltk.tree import Tree
import pandas as pd
from htrc_features import FeatureReade... |
implementation-contributed/v8/wasm-js/testcfg.py | katemihalikova/test262 | 1,849 | 12792628 | <reponame>katemihalikova/test262<gh_stars>1000+
# Copyright 2018 the V8 project 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 os
import re
from testrunner.local import testsuite
from testrunner.objects import testcase
ANY_JS... |
tests/st/ops/gpu/test_relu_op.py | GuoSuiming/mindspore | 3,200 | 12792700 | <reponame>GuoSuiming/mindspore<filename>tests/st/ops/gpu/test_relu_op.py
# Copyright 2019 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.or... |
wagtailmenus/migrations/0010_auto_20160201_1558.py | pierremanceaux/wagtailmenus | 329 | 12792720 | <reponame>pierremanceaux/wagtailmenus
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wagtailmenus', '0009_auto_20160201_0859'),
]
operations = [
migrations.RenameField(
... |
src/zapv2/users.py | tnir/zap-api-python | 146 | 12792723 | # Zed Attack Proxy (ZAP) and its related class files.
#
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
#
# Copyright 2017 the ZAP development team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain... |
test/inserted_test.py | screamingskulls/sofi | 402 | 12792727 | from sofi.ui import Inserted
def test_basic():
assert(str(Inserted()) == "<ins></ins>")
def test_text():
assert(str(Inserted("text")) == "<ins>text</ins>")
def test_custom_class_ident_style_and_attrs():
assert(str(Inserted("text", cl='abclass', ident='123', style="font-size:0.9em;", attrs={"data-test": '... |
insights/components/openstack.py | lhuett/insights-core | 121 | 12792736 | """
IsOpenStackCompute
==================
The ``IsOpenStackCompute`` component uses ``PsAuxcww`` parser to determine
OpenStack Compute node. It checks if 'nova-compute' process exist, if not raises
``SkipComponent`` so that the dependent component will not fire. Can be added as
a dependency of a parser so that the par... |
codigo/Live29/exemplo_6.py | cassiasamp/live-de-python | 572 | 12792753 | <reponame>cassiasamp/live-de-python
class Pessoa:
def __init__(self, n, s):
self.n = n
self.s = s
def __hash__(self):
return hash((self.n,self.s))
ll = Pessoa('Lugão','Ricardo')
lulu = Pessoa('Lugão','Ricardinho')
print(hash(ll)) # True
print(hash(lulu)) # True
|
cd4ml/feature_set.py | camila-contreras/CD4ML-Scenarios | 113 | 12792775 | <reponame>camila-contreras/CD4ML-Scenarios<gh_stars>100-1000
import logging
def _exclude(fields, excluded):
return [field for field in fields if field not in excluded]
def _combine_dicts(*args):
results = {}
for arg in args:
results.update(arg)
return results
class FeatureSetBase:
"""... |
src/aiofiles/__init__.py | q0w/aiofiles | 1,947 | 12792812 | <gh_stars>1000+
"""Utilities for asyncio-friendly file handling."""
from .threadpool import open
from . import tempfile
__all__ = ["open", "tempfile"]
|
tests/test_wificontrol.py | TopperBG/pywificontrol | 115 | 12792862 | <filename>tests/test_wificontrol.py
# Written by <NAME> and <NAME> <<EMAIL>>
#
# Copyright (c) 2016, Emlid Limited
# 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 sourc... |
vision/visualization.py | yihui-he2020/epipolar-transformers | 360 | 12792888 | import os.path, sys, re, cv2, glob, numpy as np
import os.path as osp
from tqdm import tqdm
from IPython import embed
import scipy
import matplotlib.pyplot as plt
from skimage.transform import resize
from mpl_toolkits.mplot3d import Axes3D
from sklearn.metrics import auc
from matplotlib.patches import Circle
import to... |
examples/poll_card.py | smaeda-ks/twitter-python-ads-sdk | 162 | 12792897 | from twitter_ads.campaign import Tweet
from twitter_ads.client import Client
from twitter_ads.creative import MediaLibrary, PollCard
from twitter_ads.enum import MEDIA_TYPE
CONSUMER_KEY = ''
CONSUMER_SECRET = ''
ACCESS_TOKEN = ''
ACCESS_TOKEN_SECRET = ''
ACCOUNT_ID = ''
# initialize the client
client = Client(CONSUM... |
kibitzr/cli.py | paulmassen/kibitzr | 478 | 12792900 | import sys
import logging
import click
import entrypoints
LOG_LEVEL_CODES = {
"debug": logging.DEBUG,
"info": logging.INFO,
"warning": logging.WARNING,
"error": logging.ERROR,
}
def merge_extensions(click_group):
"""
Each extension is called with click group for
ultimate agility while p... |
examples/pybullet/gym/pybullet_envs/minitaur/agents/trajectory_generator/tg_inplace.py | felipeek/bullet3 | 9,136 | 12792908 | """Trajectory Generator for in-place stepping motion for quadruped robot."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import numpy as np
TWO_PI = 2 * math.pi
def _get_actions_asymmetric_sine(phase, tg_params):
"""Returns the leg exte... |
src/semver/__init__.py | b0uh/python-semver | 159 | 12792929 | <gh_stars>100-1000
"""
semver package major release 3.
A Python module for semantic versioning. Simplifies comparing versions.
"""
from ._deprecated import (
bump_build,
bump_major,
bump_minor,
bump_patch,
bump_prerelease,
compare,
finalize_version,
format_version,
match,
max_v... |
mergify_engine/tests/functional/actions/test_update.py | truthiswill/mergify-engine | 266 | 12792971 | # -*- encoding: utf-8 -*-
#
# Copyright © 2018–2021 Mergify SAS
#
# 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 appl... |
exchangelib/services/get_attachment.py | RossK1/exchangelib | 1,006 | 12793002 | from itertools import chain
from .common import EWSAccountService, create_attachment_ids_element
from ..util import create_element, add_xml_child, set_xml_value, DummyResponse, StreamingBase64Parser,\
StreamingContentHandler, ElementNotFound, MNS
# https://docs.microsoft.com/en-us/exchange/client-developer/web-se... |
src/0059.spiral-matrix-ii/spiral-matrix-ii.py | lyphui/Just-Code | 782 | 12793047 | <reponame>lyphui/Just-Code
class Solution:
def generateMatrix(self, n: int) -> List[List[int]]:
if not n: return []
A, lo = [[n*n]], n*n
while lo > 1:
lo, hi = lo - len(A), lo
A = [[ i for i in range(lo, hi)]] + [list(j) for j in zip(*A[::-1])]
return A |
python/pyarmnn/test/test_deserializer.py | Project-Xtended/external_armnn | 856 | 12793056 | <gh_stars>100-1000
# Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
# SPDX-License-Identifier: MIT
import os
import pytest
import pyarmnn as ann
import numpy as np
@pytest.fixture()
def parser(shared_data_folder):
"""
Parse and setup the test network to be used for the tests below
"""
... |
cloudbio/deploy/plugins/galaxy.py | glebkuznetsov/cloudbiolinux | 122 | 12793068 | from cloudbio.galaxy.tools import _install_application
def install_tool(options):
version = options.get("galaxy_tool_version")
name = options.get("galaxy_tool_name")
install_dir = options.get("galaxy_tool_dir", None)
_install_application(name, version, tool_install_dir=install_dir)
configure_actions... |
fnss/adapters/__init__.py | brucespang/fnss | 114 | 12793093 | """Tools for exporting and importing FNSS data structures (topologies,
event schedules and traffic matrices) to/from other simulators or emulators
"""
from fnss.adapters.autonetkit import *
from fnss.adapters.mn import *
from fnss.adapters.ns2 import *
from fnss.adapters.omnetpp import *
from fnss.adapters.jfed import ... |
news/api.py | nicbou/markdown-notes | 121 | 12793118 | <reponame>nicbou/markdown-notes
from django.conf.urls import url
from django.http import HttpResponse
from tastypie.authentication import ApiKeyAuthentication
from tastypie.authorization import Authorization
from tastypie.http import HttpForbidden
from tastypie.resources import ModelResource
from news.models import Ne... |
tests/r/test_sparrows.py | hajime9652/observations | 199 | 12793120 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import shutil
import sys
import tempfile
from observations.r.sparrows import sparrows
def test_sparrows():
"""Test module sparrows.py by downloading
sparrows.csv and testing shape of
extracted data h... |
CodeIA/venv/Lib/site-packages/coremltools/converters/mil/mil/ops/defs/random.py | Finasty-lab/IA-Python | 11,356 | 12793137 | # Copyright (c) 2020, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
from coremltools.converters.mil.mil.types.symbolic import any_symbolic
from coremltools.converters.mi... |
ch08/myproject_virtualenv/src/django-myproject/myproject/apps/ideas1/forms.py | PacktPublishing/Django-3-Web-Development-Cookbook | 159 | 12793150 | <reponame>PacktPublishing/Django-3-Web-Development-Cookbook
from django import forms
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth import get_user_model
from crispy_forms import bootstrap, helper, layout
from mptt.forms import TreeNodeCho... |
pypykatz/kerberos/functiondefs/asn1structs.py | wisdark/pypykatz | 1,861 | 12793152 |
from asn1crypto import core
from minikerberos.protocol.asn1_structs import krb5int32, APOptions, Ticket, EncryptedData, AP_REQ
UNIVERSAL = 0
APPLICATION = 1
CONTEXT = 2
TAG = 'explicit'
class MechType(core.ObjectIdentifier):
_map = {
#'': 'SNMPv2-SMI::enterprises.311.2.2.30',
'1.3.6.1.4.1.311.2.2.10': 'NTLMSSP... |
cli/src/klio_cli/commands/job/stop.py | gaybro8777/klio | 705 | 12793186 | # Copyright 2019-2020 Spotify AB
#
# 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 writin... |
cv2/select-pixels-by-RGB/main.py | whitmans-max/python-examples | 140 | 12793190 | <gh_stars>100-1000
#!/usr/bin/env python3
# date: 2019.09.24
# https://stackoverflow.com/questions/58085439/opencv-extract-pixels-with-rbg/
# replaca pixel when `R > G > B`
import cv2
import numpy as np
img = cv2.imread('/home/furas/Obrazy/images/image.png')
# img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
img[ (img[... |
transistor/persistence/__init__.py | awesome-archive/transistor | 232 | 12793224 | # -*- coding: utf-8 -*-
"""
transistor.persistence
~~~~~~~~~~~~
This module implements classes and methods to aid persistence, including
database, spreadsheet export, write to file.
:copyright: Copyright (C) 2018 by BOM Quote Limited
:license: The MIT License, see LICENSE for more details.
~~~~~~~~~~~~
"""
from .expo... |
plugins/nmap.py | hack654a/w12scan-client | 159 | 12793246 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2019/1/21 10:05 PM
# @Author : w8ay
# @File : nmap.py
import nmap
from lib.data import logger
def nmapscan(host, ports):
# 接受从masscan上扫描出来的结果
# 为了可以多线程使用,此函数支持多线程调用
nm = nmap.PortScanner()
argument = "-sV -sS -Pn --host-timeout 1m -p{}".f... |
src/poliastro/frames/enums.py | sundeshgupta/poliastro | 634 | 12793288 | """Coordinate frames definitions.
"""
from enum import Enum
class Planes(Enum):
EARTH_EQUATOR = "Earth mean Equator and Equinox of epoch (J2000.0)"
EARTH_ECLIPTIC = "Earth mean Ecliptic and Equinox of epoch (J2000.0)"
BODY_FIXED = "Rotating body mean Equator and node of date"
|
distributed_dp/dme_run.py | garyxcheng/federated | 330 | 12793318 | <filename>distributed_dp/dme_run.py
# Copyright 2021, Google LLC. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# ... |
LeetCode/1365_How_Many_Numbers_Are_Smaller_Than_the_Current_Number.py | Achyut-sudo/PythonAlgorithms | 144 | 12793355 | <filename>LeetCode/1365_How_Many_Numbers_Are_Smaller_Than_the_Current_Number.py<gh_stars>100-1000
class Solution:
def smallerNumbersThanCurrent(self, nums: List[int]) -> List[int]:
ans = []
for i in range(0, len(nums)):
soln = 0
for j in range(0, len(nums)):
i... |
xs/utils/data/dataset.py | eLeVeNnN/xshinnosuke | 290 | 12793408 | <filename>xs/utils/data/dataset.py
class DataSet:
def __init__(self, *datas):
self.datas = list(datas)
def __len__(self):
return len(self.datas[0])
def __getitem__(self, item):
ret_list = []
for data in self.datas:
ret_list.append(data[item])
return ret_... |
mmdet/core/utils/__init__.py | JustWeZero/mmdetection | 314 | 12793418 | # Copyright (c) OpenMMLab. All rights reserved.
from .dist_utils import (DistOptimizerHook, all_reduce_dict, allreduce_grads,
reduce_mean)
from .misc import (center_of_mass, flip_tensor, generate_coordinate,
mask2ndarray, multi_apply, unmap)
__all__ = [
'allreduce_grads'... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.