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_util_path.py | JFlynnXYZ/pymel | 287 | 12713366 | from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import os
import unittest
import pymel.util.path
from pymel.util.path import path
class TestPath(unittest.TestCase):
def test_misc(self):
thisFile = path(__file__)
self.assert... |
bin/query.py | cvangysel/SERT | 107 | 12713369 | #!/usr/bin/env python
import sys
from cvangysel import argparse_utils, logging_utils, sklearn_utils, trec_utils
from sert import inference, math_utils, models
import argparse
import collections
import io
import logging
import numpy as np
import os
import operator
import pickle
import scipy
import scipy.spatial
impor... |
data_structures/trees/tests/test_trie.py | vinta/fuck-coding-interviews | 590 | 12713446 | # coding: utf-8
import unittest
from data_structures.trees.trie import Trie
class TrieNodeTest(unittest.TestCase):
def setUp(self):
self.trie = Trie()
def test__len__(self):
self.assertEqual(len(self.trie), 0)
def test_insert(self):
with self.assertRaises(ValueError):
... |
examples/create_images.py | hengwei-chan/nn_vis_network_visualization | 631 | 12713456 | import sys
import os.path
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(sys.modules[__name__].__file__), "..")))
import matplotlib.pyplot as plt
import numpy as np
from sklearn.neighbors import KernelDensity
from tensorflow.python.keras.datasets import mnist
from data.data_handler import ProcessedNNHan... |
tools/scrape/scrape.py | therealplato/vim-awesome | 1,379 | 12713487 | <gh_stars>1000+
import argparse
import logging
from raven import Client
from tools.scrape import vimorg, github
try:
import secrets
_SENTRY_DSN = getattr(secrets, 'SENTRY_DSN', None)
except ImportError:
_SENTRY_DSN = None
client = Client(_SENTRY_DSN)
def scrape_github_plugins(num):
print "\nScrapi... |
gffutils/test/parser_test.py | aswarren/gffutils | 171 | 12713497 | <reponame>aswarren/gffutils
import tempfile
from nose.tools import assert_raises
from gffutils import (parser, create, feature, iterators, constants, helpers,
exceptions)
from gffutils import example_filename, create_db
from . import attr_test_cases
from textwrap import dedent
TEST_FILENAMES = [e... |
src/commands/flow/__init__.py | PranjalPansuriya/JavaScriptEnhancements | 690 | 12713509 | <reponame>PranjalPansuriya/JavaScriptEnhancements<filename>src/commands/flow/__init__.py
from .build_flow import JavascriptEnhancementsBuildFlowCommand
from .add_flow_definition import JavascriptEnhancementsAddFlowDefinitionCommand
__all__ = [
"JavascriptEnhancementsBuildFlowCommand",
"JavascriptEnhancementsAddFlo... |
utils/update_pyarrow.py | ssayyah/notebooks-contrib | 155 | 12713555 | import re
import sys
import os
print('***********************************************************************')
print('Let us check on that pyarrow version...')
print('***********************************************************************')
print()
pyarrow_version = sys.modules["pyarrow"].__version__
f = re.search("... |
python/ql/src/Numerics/Pythagorean.py | vadi2/codeql | 4,036 | 12713559 | <reponame>vadi2/codeql
# We know that a^2 + b^2 = c^2, and wish to use this to compute c
from math import sqrt, hypot
a = 3e154 # a^2 > 1e308
b = 4e154 # b^2 > 1e308
# with these, c = 5e154 which is less that 1e308
def longSideDirect():
return sqrt(a**2 + b**2) # this will overflow
def longSideBuiltin():
ret... |
pypy/tool/pytest/fake_pytest/moduledef.py | nanjekyejoannah/pypy | 333 | 12713563 | from pypy.interpreter.mixedmodule import MixedModule
class Module(MixedModule):
applevel_name = 'pytest'
interpleveldefs = {
'raises': 'interp_pytest.pypyraises',
'skip': 'interp_pytest.pypyskip',
'fixture': 'interp_pytest.fake_fixture',
}
appleveldefs = {
'importorskip'... |
assets/jupyter-gmaps-example.py | mpacer/jupyter.github.io | 143 | 12713571 | <filename>assets/jupyter-gmaps-example.py
import gmaps
import gmaps.datasets
gmaps.configure(api_key="AI...") # Your Google API key
locations = gmaps.datasets.load_dataset("taxi_rides")
fig = gmaps.figure()
# locations could be an array, a dataframe or just a Python iterable
fig.add_layer(gmaps.heatmap_layer(locati... |
test/test_functorch_lagging_op_db.py | mathandy/functorch | 279 | 12713574 | # Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
from torch.testing._internal.common_methods_invocations import op_db
from torch.testing._internal.common_device_ty... |
examples/pybullet/gym/pybullet_envs/minitaur/vision/imagery_client.py | felipeek/bullet3 | 9,136 | 12713583 | <reponame>felipeek/bullet3
"""The imagery client to connect to the camera job."""
from typing import Any, Dict, Sequence, Text
import gin
from pybullet_envs.minitaur.fw_bridge import worker_builder
from pybullet_envs.minitaur.vision import imagery_pb2
from pybullet_envs.minitaur.vision import imagery_utils
from googl... |
tools/nntool/quantization/multiplicative/quantizers/rescale_constant_mixin.py | 00-01/gap_sdk | 118 | 12713654 | # Copyright (C) 2020 GreenWaves Technologies, SAS
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# This progr... |
python/ffi_navigator/workspace.py | csullivan/ffi-navigator | 148 | 12713657 | <gh_stars>100-1000
import glob
import os
import logging
from . import pattern
from .import_resolver import PyImportResolver
from .dialect import autodetect_dialects
from .util import join_path
def _append_dict(sdict, key, value):
if key in sdict:
sdict[key].append(value)
else:
sdict[key] = [va... |
knitpy/tests/__init__.py | srinivas32/knitpy | 213 | 12713694 | <gh_stars>100-1000
# encoding: utf-8
# Copyright (c) <NAME> <<EMAIL>>
# Distributed under the terms of the Modified BSD License.
from __future__ import absolute_import, print_function, unicode_literals
import codecs
import glob
import os
import tempfile
import inspect
import unittest
import re
from knitpy.knitpy im... |
release/scripts/presets/camera/Sony_A55.py | rbabari/blender | 365 | 12713702 | import bpy
bpy.context.camera.sensor_width = 23.4
bpy.context.camera.sensor_height = 15.6
bpy.context.camera.sensor_fit = 'HORIZONTAL'
|
classifier.py | pankaj5395/clickbait-classifier | 122 | 12713707 | #!/usr/bin/env python
# coding: utf-8
# Sources for machine learning information / examples:
# http://nbviewer.ipython.org/gist/rjweiss/7158866
# http://scikit-learn.org/stable/modules/feature_extraction.html
# http://www.datarobot.com/blog/classification-with-scikit-learn/
# http://scikit-learn.org/stable/aut... |
Connected Component Analysis-Labeling.py/DrawVideo.py | yinedeng/Kryon | 229 | 12713708 | #This code comes from: https://github.com/becomequantum/kryon
from PIL import Image,ImageDraw,ImageFont
import numpy as np
#This code is only about animation. 本代码只是和做演示动画相关.
VideoSize = (1280, 720)
DemoImageSize = (48, 36)
标题位置 = (60, 16)
注释1位置 = (1000, 76)
网格位置 = (32, 76)
比例 = 17
网格颜色 = (230, 230, 230)
网三位置... |
tools/telemetry/telemetry/unittest/decorators_unittest.py | iplo/Chain | 231 | 12713735 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from telemetry import decorators
class Foo(object):
pass
def CreateFooUncached(_):
return Foo()
@decorators.Cache
def CreateFooCac... |
security_monkey/auditors/rds/rds_snapshot.py | boladmin/security_monkey | 4,258 | 12713747 | # Copyright 2017 Netflix, 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... |
examples/retrieve_audit_events.py | Manny27nyc/oci-python-sdk | 249 | 12713765 | <gh_stars>100-1000
# coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LIC... |
test-framework/test-suites/integration/tests/set/test_set_bootaction_args.py | knutsonchris/stacki | 123 | 12713771 | import json
from textwrap import dedent
class TestSetBootactionArgs:
def test_no_args(self, host):
result = host.run('stack set bootaction args')
assert result.rc == 255
assert result.stderr == dedent('''\
error - "action" argument is required
{action} {args=string} [os=string] [type=string]
''')
def... |
observations/r/softbacks.py | hajime9652/observations | 199 | 12713791 | # -*- 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 softbacks(path):
"""Measurements on a Selection of Paperback Books
... |
python_modules/dagster/dagster/core/storage/sqlite.py | dbatten5/dagster | 4,606 | 12713814 | <filename>python_modules/dagster/dagster/core/storage/sqlite.py
import os
import sqlite3
from functools import update_wrapper
from dagster import check
from .sql import run_migrations_offline as run_migrations_offline_
from .sql import run_migrations_online as run_migrations_online_
def run_migrations_offline(*args... |
tests/bugs/issue_19/issue_19_no_interpolation.py | jmabry/pyaf | 377 | 12713822 | <reponame>jmabry/pyaf<filename>tests/bugs/issue_19/issue_19_no_interpolation.py<gh_stars>100-1000
import numpy as np
import pandas as pd
df = pd.read_csv('tests/bugs/issue_19/issue_19_data_1.csv')
import datetime
def convert_date(x):
y = np.nan
try:
y = datetime.datetime.strptime(str(x), "%Y")
ex... |
homeassistant/components/tankerkoenig/const.py | domwillcode/home-assistant | 22,481 | 12713826 | <reponame>domwillcode/home-assistant
"""Constants for the tankerkoenig integration."""
DOMAIN = "tankerkoenig"
NAME = "tankerkoenig"
CONF_FUEL_TYPES = "fuel_types"
CONF_STATIONS = "stations"
FUEL_TYPES = ["e5", "e10", "diesel"]
|
d2go/data/transforms/affine.py | wenliangzhao2018/d2go | 687 | 12713858 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import json
import random
from typing import List, Optional, Tuple
import cv2
import numpy as np
import torchvision.transforms as T
from detectron2.config import CfgNode
from detectron2.data.transforms import Transform, Tra... |
TrackingTools/MaterialEffects/python/MaterialPropagatorParabolicMf_cff.py | ckamtsikis/cmssw | 852 | 12713862 | import FWCore.ParameterSet.Config as cms
from TrackingTools.MaterialEffects.MaterialPropagator_cfi import MaterialPropagator
MaterialPropagatorParabolicMF = MaterialPropagator.clone(
SimpleMagneticField = 'ParabolicMf',
ComponentName = 'PropagatorWithMaterialParabolicMf'
)
from TrackingTools.MaterialEff... |
koku/reporting/migrations/0194_awscostentrylineitemdailysummary_savingsplan_effective_cost.py | cgoodfred/koku | 157 | 12713866 | # Generated by Django 3.1.12 on 2021-09-09 14:23
import pkgutil
from django.db import connection
from django.db import migrations
from django.db import models
def add_aws_views(apps, schema_editor):
"""Create the AWS Materialized views from files."""
version = "_20210910"
views = {
f"sql/views/{v... |
ch3/greedy/loowater_UVa11292.py | lyskevin/cpbook-code | 1,441 | 12713881 | def main():
while True:
n,m = map(int, input().split())
if n==0 and m==0:
break
D = [9] * n
H = [0] * m
for d in range(n):
D[d] = int(input())
for k in range(m):
H[k] = int(input())
D.sort() #... |
heudiconv/queue.py | fhopp/heudiconv | 167 | 12713920 | <filename>heudiconv/queue.py
import subprocess
import sys
import os
import logging
from .utils import which
lgr = logging.getLogger(__name__)
def queue_conversion(queue, iterarg, iterables, queue_args=None):
"""
Write out conversion arguments to file and submit to a job scheduler.
Parses `sys.argv` for h... |
tests/conftest.py | teaglebuilt/bocadillo | 434 | 12713933 | <gh_stars>100-1000
import typing
import pytest
from bocadillo import App, configure, create_client, Templates, settings
@pytest.fixture(name="raw_app")
def fixture_raw_app(request) -> App:
settings._clear()
return App()
@pytest.fixture(name="app")
def fixture_app(raw_app: App) -> App:
configure(raw_ap... |
tools/pot/tools/frame_extractor/run.py | pazamelin/openvino | 2,406 | 12713976 | # Copyright (C) 2020-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import sys
from argparse import ArgumentParser
import extractor
def parse_args(argv):
"""
Parse and process arguments for frames-extractor tool
"""
parser = ArgumentParser(description='Frames-extractor toolkit', allow_... |
tests/test_provider_ellisdon_oss_azuredevops.py | mjuenema/python-terrascript | 507 | 12713988 | # tests/test_provider_ellisdon-oss_azuredevops.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:13:00 UTC)
def test_provider_import():
import terrascript.provider.ellisdon_oss.azuredevops
def test_resource_import():
from terrascript.resource.ellisdon_oss.azuredevops import (
azurede... |
attacks/rsa/wiener_attack_lattice.py | jvdsn/crypto-attacks | 139 | 12713998 | <gh_stars>100-1000
import os
import sys
from math import isqrt
from sage.all import ZZ
from sage.all import matrix
path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(os.path.abspath(__file__)))))
if sys.path[1] != path:
sys.path.insert(1, path)
from attacks.factorization import known_phi
fro... |
lib/airtable/__init__.py | goztrk/django-htk | 206 | 12714040 | <gh_stars>100-1000
# HTK Imports
from htk.lib.airtable.api import AirtableAPI
|
cacreader/swig-4.0.2/Examples/test-suite/python/typedef_class_runme.py | kyletanyag/LL-Smartcard | 1,031 | 12714050 | <reponame>kyletanyag/LL-Smartcard
import typedef_class
a = typedef_class.RealA()
a.a = 3
b = typedef_class.B()
b.testA(a)
|
Python/FiniteStateParser/struct_fs_parser.py | Gjacquenot/training-material | 115 | 12714061 | #!/usr/bin/env python
"""Module containing a parser for a simple block enocded data format"""
import re
class ParseError(Exception):
"""Exception thrown when a parse error occurs"""
def __init__(self, msg):
Exception.__init__(self)
self.msg = msg
def __str__(self):
return repr(se... |
securityheaders/models/csp/cspdirective.py | th3cyb3rc0p/securityheaders | 151 | 12714062 | from securityheaders.models import Directive
from securityheaders.models.annotations import requireddirectives, requireddirectivevalues
@requireddirectivevalues('form-action','frame-ancestors','report-uri','report-to','require-sri-for','plugin-types','worker-src','style-src','object-src','manifest-src','frame-src','de... |
tests/python/view_layer/test_scene_delete.py | rbabari/blender | 365 | 12714167 | # ############################################################
# Importing - Same For All Render Layer Tests
# ############################################################
import unittest
import os
import sys
from view_layer_common import *
# ############################################################
# Testing
# ... |
locations/spiders/tropical_smoothie_cafe.py | nbeecher/alltheplaces | 297 | 12714176 | <gh_stars>100-1000
import json
import re
import scrapy
from scrapy.selector import Selector
from locations.hours import OpeningHours
from locations.items import GeojsonPointItem
class TropicalSmoothieCafe(scrapy.Spider):
name = "tropical_smoothie_cafe"
item_attributes = {"brand": "Tropical Smoothie Cafe", "... |
hordak/migrations/0002_check_leg_trigger_20160903_1149.py | PetrDlouhy/django-hordak | 187 | 12714178 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-03 11:49
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("hordak", "0001_initial")]
operations = [
migrations.RunSQL(
"""
CREA... |
L1TriggerConfig/L1GtConfigProducers/test/L1GtVhdlWriter_cfg.py | ckamtsikis/cmssw | 852 | 12714189 | <filename>L1TriggerConfig/L1GtConfigProducers/test/L1GtVhdlWriter_cfg.py
# cfg file to write the VHDL templates
import FWCore.ParameterSet.Config as cms
# process
process = cms.Process("L1GtVhdlWriterTest")
# number of events and source
process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(1)
)
pr... |
docs_src/behind_a_proxy/tutorial001.py | Aryabhata-Rootspring/fastapi | 53,007 | 12714197 | <gh_stars>1000+
from fastapi import FastAPI, Request
app = FastAPI()
@app.get("/app")
def read_main(request: Request):
return {"message": "Hello World", "root_path": request.scope.get("root_path")}
|
dnsdb_common/library/exception.py | baiyongjie/open_dnsdb | 378 | 12714214 | <filename>dnsdb_common/library/exception.py
# -*- coding: utf-8 -*-
BADREQUEST = 400
UNAUTHORIZED = 401
FORBIDDEN = 403
GONE = 410
TOOMANYREQUESTS = 412
class DnsdbException(Exception):
def __init__(self, message, errcode=500, detail=None, msg_ch=u''):
self.message = message
self.errcode = errcod... |
graphlearn/python/nn/tf/config.py | amznero/graph-learn | 1,088 | 12714216 | <gh_stars>1000+
# Copyright 2021 Alibaba Group Holding Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... |
moviepy/video/io/ffmpeg_tools.py | odidev/moviepy | 8,558 | 12714233 | """Miscellaneous bindings to ffmpeg."""
import os
from moviepy.config import FFMPEG_BINARY
from moviepy.decorators import convert_parameter_to_seconds, convert_path_to_string
from moviepy.tools import subprocess_call
@convert_path_to_string(("inputfile", "outputfile"))
@convert_parameter_to_seconds(("start_time", "... |
missions/middleware.py | ANSUUVIOUS/dart | 234 | 12714267 | <reponame>ANSUUVIOUS/dart
# -*- coding: utf-8 -*-
# Copyright 2017 Lockheed Martin 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-... |
samples/alpc/advanced_alpc.py | IMULMUL/PythonForWindows | 479 | 12714269 | import sys
import multiprocessing
import windows.alpc
from windows.generated_def import LPC_CONNECTION_REQUEST, LPC_REQUEST
import windows.generated_def as gdef
import ctypes
import tempfile
PORT_NAME = r"\RPC Control\PythonForWindowsPORT_2"
PORT_CONTEXT = 0x11223344
def full_alpc_server():
print("server pid =... |
tests/worker/test_initializers.py | adir-intsights/sergeant | 152 | 12714274 | import unittest
import unittest.mock
import sergeant.worker
class WorkerInitializersTestCase(
unittest.TestCase,
):
def test_init_logger(
self,
):
worker = sergeant.worker.Worker()
worker.config = sergeant.config.WorkerConfig(
name='some_worker',
connector=... |
tests/unit/merchant_account/test_business_details.py | futureironman/braintree_python | 182 | 12714302 | <reponame>futureironman/braintree_python
from tests.test_helper import *
from braintree.merchant_account.business_details import BusinessDetails
class TestBusinessDetails(unittest.TestCase):
def test_repr_has_all_fields(self):
details = BusinessDetails({
"dba_name": "<NAME>",
"legal... |
backprop/models/hf_seq2seq_tg_model/__init__.py | lucky7323/backprop | 200 | 12714330 | <filename>backprop/models/hf_seq2seq_tg_model/__init__.py
from .model import HFSeq2SeqTGModel |
tests/test__types.py | lemon24/reader | 205 | 12714335 | from types import SimpleNamespace
import pytest
from reader._types import entry_data_from_obj
from reader._types import EntryData
from reader._types import FeedData
from reader._types import fix_datetime_tzinfo
from reader._types import tag_filter_argument
TAG_DATA = [
([], [None, [], (), [[]], ((),), [[], []]]... |
examples/mcscf/32-beh2_scan/BeH2-scan.py | robert-anderson/pyscf | 501 | 12714338 | <gh_stars>100-1000
import numpy
from pyscf import gto, scf, mcscf
'''
Scan BeH2 molecule symmetric dissociation curve
Note the CI wave function might change symmetry in the scanning. Adjust
fcisolver parameters to maintain the right symmetry.
'''
def run(i, dm0, mo0, ci0):
x = i
y = (2.54 - 0.46 * x)
x ... |
api/users/tests/test_signals.py | mevinbabuc/flagsmith | 1,259 | 12714340 | import pytest
from users.signals import warn_insecure
@pytest.mark.django_db
def test_warn_insecure_emits_a_warning_when_no_user_exists(recwarn):
# When
warn_insecure(None)
# Then
assert len(recwarn) == 1
w = recwarn.pop()
assert issubclass(w.category, RuntimeWarning)
@pytest.mark.django_d... |
src/operation/fetchlines.py | fekblom/critic | 216 | 12714347 | <filename>src/operation/fetchlines.py
# -*- mode: python; encoding: utf-8 -*-
#
# Copyright 2012 <NAME>, Opera Software ASA
#
# 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.a... |
litex_boards/platforms/trenz_te0725.py | smunaut/litex-boards | 177 | 12714416 | #
# This file is part of LiteX-Boards.
# FPGA Board Info : https://shop.trenz-electronic.de/en/TE0725-03-35-2C-FPGA-Module-with-Xilinx-Artix-7-XC7A35T-2CSG324C-2-x-50-Pin-with-2.54-mm-pitch
#
# Copyright (c) 2021 <NAME> <<EMAIL>>
# SPDX-License-Identifier: BSD-2-Clause
from litex.build.generic_platform import *
from l... |
main.py | rederxz/wide_resnets_keras | 156 | 12714427 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from six.moves import range
import os
import logging
logging.basicConfig(level=logging.DEBUG)
import sys
#sys.stdout = sys.stderr
# Prevent reaching to maximum recursion depth in `theano.tensor.grad`
#sys.set... |
tests/testapp/__init__.py | cursive-works/wagtailmedia | 176 | 12714437 | default_app_config = "tests.testapp.apps.WagtailmediaTestsAppConfig"
|
modules/lsegmentation_module_zs.py | isl-org/lang-seg | 202 | 12714439 | <gh_stars>100-1000
import types
import time
import random
import clip
import torch
import torch.nn as nn
import torchvision.transforms as transforms
from argparse import ArgumentParser
import pytorch_lightning as pl
from encoding.models import get_segmentation_model
from encoding.nn import SegmentationLosses
from e... |
exps/stage3_root2/config.py | zju3dv/SMAP | 209 | 12714451 | <gh_stars>100-1000
# encoding: utf-8
import os, getpass
import os.path as osp
import argparse
from easydict import EasyDict as edict
from dataset.data_settings import load_dataset
from cvpack.utils.pyt_utils import ensure_dir
class Config:
# -------- Directoy Config -------- #
ROOT_DIR = os.environ['PROJECT_... |
nri/nri/models/decoders/__init__.py | take-cheeze/models | 112 | 12714470 | <reponame>take-cheeze/models<gh_stars>100-1000
from nri.models.decoders.mlp_decoder import MLPDecoder
from nri.models.decoders.rnn_decoder import RNNDecoder |
lib/test/test_automata.py | SkittlePox/ConwayGOLGym | 138 | 12714474 | from conway import conway
import unittest
import numpy as np
class TestConway(unittest.TestCase):
def test_still(self):
"""2x2 block"""
A = np.zeros((10,10))
A[1:3,1:3] = 1
B = conway(A)
assert (A == B).all()
def test_scillator(self):
"""blinker"""
A =... |
tests/test_end_to_end.py | lammda/mercari-solution | 249 | 12714486 | import numpy as np
import pandas as pd
import pytest
from sklearn.model_selection import train_test_split
from mercari.datasets_mx import prepare_vectorizer_1, prepare_vectorizer_2, prepare_vectorizer_3
from mercari.datasets_tf import prepare_vectorizer_1_tf, prepare_vectorizer_2_tf, prepare_vectorizer_3_tf
from merca... |
main.py | AlexTaehwan/kgpolicy | 111 | 12714494 | import os
import random
import torch
import numpy as np
from time import time
from tqdm import tqdm
from copy import deepcopy
from pathlib import Path
from prettytable import PrettyTable
from common.test import test_v2
from common.utils import early_stopping, print_dict
from common.config import parse_args
from comm... |
terraform_compliance/steps/then/it_must_contain_something.py | Miouge1/cli | 866 | 12714499 | # -*- coding: utf-8 -*-
from terraform_compliance.common.helper import (
seek_key_in_dict, # importing this purely because the unit tests require it to exist in global scope
Null
)
from terraform_compliance.common.error_handling import Error
def it_must_contain_something(_step_obj, something, inherited_valu... |
pydocx/openxml/packaging/footnotes_part.py | botzill/pydocx | 127 | 12714500 | # coding: utf-8
from __future__ import (
absolute_import,
print_function,
unicode_literals,
)
from pydocx.openxml.packaging.open_xml_part import OpenXmlPart
from pydocx.openxml.wordprocessing import Footnotes
class FootnotesPart(OpenXmlPart):
'''
Represents a Footnotes part within a Word document... |
src/python/gem5/components/memory/dram_interfaces/wideio.py | hyu-iot/gem5 | 765 | 12714505 | <gh_stars>100-1000
# Copyright (c) 2012-2021 Arm Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementati... |
lldb/test/API/tools/lldb-vscode/console/TestVSCode_redirection_to_console.py | mkinsner/llvm | 2,338 | 12714510 | import unittest2
import vscode
import json
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
import lldbvscode_testcase
class TestVSCode_redirection_to_console(lldbvscode_testcase.VSCodeTestCaseBase):
mydir = TestBase.compute_mydir(__file__)
@s... |
src/DyldExtractor/macho/macho_context.py | arandomdev/DyldExtractor | 177 | 12714528 | import struct
from mmap import mmap
from typing import Union
from DyldExtractor.file_context import FileContext
from DyldExtractor.macho.segment_context import SegmentContext
from DyldExtractor.macho.macho_structs import (
LoadCommandMap,
LoadCommands,
load_command,
UnknownLoadCommand,
mach_header_64,
segment_... |
src/enamlnative/widgets/image_view.py | codelv/enaml-native | 237 | 12714530 | <gh_stars>100-1000
"""
Copyright (c) 2017, <NAME>.
Distributed under the terms of the MIT License.
The full license is in the file LICENSE, distributed with this software.
Created on May 20, 2017
@author: jrm
"""
from atom.api import (
Typed, ForwardTyped, Int, Unicode, Bool, Event, observe, set_default
)
from... |
scripts/eval_badja.py | isabella232/lasr | 128 | 12714550 | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... |
lib/core/loss.py | ahmedelmahy/HRNet-Bottom-Up-Pose-Estimation | 129 | 12714560 | # ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# The code is based on HigherHRNet-Human-Pose-Estimation.
# (https://github.com/HRNet/HigherHRNet-Human-Pose-Estimation)
# Modified by <NAME> (<EMAIL>).
# ------------------------... |
test/Image_by_text.py | cigar666/my_manim_projects | 159 | 12714562 | from manimlib.imports import *
import matplotlib.pyplot as plt
import csv
import codecs
# import pandas as pd
# import ctypes
# # from https://www.cnpython.com/qa/81434
# def GetTextLength(text, points=10, font='思源黑体 Bold'):
# class SIZE(ctypes.Structure):
# _fields_ = [("cx", ctypes.c_long), ("cy", ctypes... |
time_series_detector/algorithm/ewma.py | alexanderqiu/Metis | 1,367 | 12714569 | <gh_stars>1000+
#!/usr/bin/env python
# -*- coding=utf-8 -*-
"""
Tencent is pleased to support the open source community by making Metis available.
Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in com... |
scrapyd_client/commands.py | zanachka/scrapyd-client | 681 | 12714641 | <reponame>zanachka/scrapyd-client<filename>scrapyd_client/commands.py<gh_stars>100-1000
import sys
from scrapyd_client import lib
from scrapyd_client.utils import indent
INDENT_PREFIX = ' '
def deploy(args):
""" Deploys a Scrapy project to a Scrapyd instance.
For help on this command, invoke `scrapyd... |
dialogue-engine/src/programy/utils/logging/ylogger.py | cotobadesign/cotoba-agent-oss | 104 | 12714660 | """
Copyright (c) 2020 COTOBA DESIGN, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distri... |
ztag/annotations/FtpBelkin.py | justinbastress/ztag | 107 | 12714744 | import re
from ztag.annotation import Annotation
from ztag.annotation import OperatingSystem
from ztag.annotation import Type
from ztag.annotation import Manufacturer
from ztag import protocols
import ztag.test
class FtpBelkin(Annotation):
protocol = protocols.FTP
subprotocol = protocols.FTP.BANNER
port =... |
gluoncv/utils/version.py | Kh4L/gluon-cv | 5,447 | 12714750 | <gh_stars>1000+
"""Utility functions for version checking."""
import warnings
__all__ = ['check_version']
def check_version(min_version, warning_only=False):
"""Check the version of gluoncv satisfies the provided minimum version.
An exception is thrown if the check does not pass.
Parameters
---------... |
pyspark/find_model_collaborative.py | chelseawmk/recommendation-engine | 254 | 12714768 | <reponame>chelseawmk/recommendation-engine<filename>pyspark/find_model_collaborative.py
#!/usr/bin/env python
"""
Copyright Google Inc. 2016
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://ww... |
tests/distance/test_init.py | rhasspy/rapidfuzz | 554 | 12714785 | <reponame>rhasspy/rapidfuzz<filename>tests/distance/test_init.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import pytest
from rapidfuzz.distance import Levenshtein, Editops, Opcodes
def test_editops_comparision():
"""
test comparision with Editops
"""
ops = Levenshtein.editops("aa... |
generate/build_tools/forge/defaults.py | flamencist/browser-extensions | 102 | 12714797 | <filename>generate/build_tools/forge/defaults.py
'Project-wide default values'
import sys
from os import path
FORGE_ROOT = path.dirname(path.dirname(__file__))
CONFIG_FILE = path.join(FORGE_ROOT, 'forge_build.json')
PASSWORD = "<PASSWORD>"
SRC_DIR = 'src'
APP_CONFIG_FILE = path.join(SRC_DIR, 'config.json')
IDENTITY_F... |
src/utils/clean_links.py | LaudateCorpus1/hermes-5 | 135 | 12714799 | #!/usr/bin/env python
def clean_links(text):
"""Remove brackets around a wikilink, keeping the label instead of the page
if it exists.
"[[foobar]]" will become "foobar", but "[[foobar|code words]]" will return
"code words".
Args:
text (str): Full text of a Wikipedia article as a single st... |
py_utils/emu_utils.py | tamarindmonkey/.oh-my-comma | 102 | 12714806 | <filename>py_utils/emu_utils.py<gh_stars>100-1000
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import psutil
import difflib
import argparse
import subprocess
import time
if __package__ is None:
from os import path
sys.path.append(path.abspath(path.join(path.dirname(__file__), '../py_utils')))
from py_ut... |
backend/www/test/list_client_logs_test.py | xuantan/viewfinder | 645 | 12714818 | # Copyright 2012 Viewfinder Inc. All Rights Reserved.
# -*- coding: utf-8 -*-
__author__ = '<EMAIL> (<NAME>)'
import datetime
import logging
import mock
import time
from functools import partial
from tornado import options
from viewfinder.backend.base import otp, util
from viewfinder.backend.base.testing import asyn... |
recipes/Python/425345_Generic_commandline/recipe-425345.py | tdiprima/code | 2,023 | 12714833 | <filename>recipes/Python/425345_Generic_commandline/recipe-425345.py
# -- coding: iso8859-1
"""Generic option parser class. This class can be used
to write code that will parse command line options for
an application by invoking one of the standard Python
library command argument parser modules optparse or
getopt.
The... |
instances/__init__.py | NGXTDN/webvirtcloud | 1,246 | 12714925 | <reponame>NGXTDN/webvirtcloud<filename>instances/__init__.py
default_app_config = 'instances.apps.InstancesConfig'
|
dataset/dota_coco/dota_generate_test_result.py | leakyH/PaddleDetection | 7,782 | 12715023 | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
src/super_gradients/common/factories/optimizers_type_factory.py | Deci-AI/super-gradients | 308 | 12715040 | import importlib
from typing import Union
from torch import optim
from super_gradients.common.factories.base_factory import AbstractFactory
from super_gradients.training.utils.optimizers.rmsprop_tf import RMSpropTF
from super_gradients.training.utils.optimizers.lamb import Lamb
class OptimizersTypeFactory(AbstractF... |
lib/interact.py | alegrey91/legion | 430 | 12715085 | <reponame>alegrey91/legion
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import os, sys, signal
from threading import Thread
from termcolor import colored
from cmd import Cmd
from time import sleep
from lib.main import main_run
from lib.main import valid_protos
from lib.main import print_error
from warriors.general imp... |
samples/device_manager/device_manager.py | IMULMUL/PythonForWindows | 479 | 12715106 | <reponame>IMULMUL/PythonForWindows
import sys
import os.path
sys.path.append(os.path.abspath(__file__ + "\..\.."))
import windows
import windows.generated_def as gdef
devmgr = windows.system.device_manager
print("Device manager is {0}".format(devmgr))
print("Enumerating the first 3 device classes")
for cls in devmgr... |
nuplan/planning/metrics/evaluation_metrics/common/distance_to_baseline.py | motional/nuplan-devkit | 128 | 12715117 | <filename>nuplan/planning/metrics/evaluation_metrics/common/distance_to_baseline.py<gh_stars>100-1000
from typing import List
import numpy as np
from shapely.geometry import Point
from nuplan.common.actor_state.state_representation import Point2D
from nuplan.common.maps.abstract_map import AbstractMap
from nuplan.pla... |
v7.0/act_timing.py | jsstwright/osumapper | 296 | 12715119 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
#
# Timing
#
import numpy as np
import re, os
import include.id3reader_p3 as id3
from shutil import copy
from timing import *
from metadata import *
def get_timed_osu_file(music_path, input_filename = "assets/template.osu", output_filename = "timing.osu", game_mode = 0, ma... |
communicate/dbus_notify.py | lukaszbinden/process-watcher | 113 | 12715138 |
import sys
import notify2
from notify2 import Notification
notify2.init(sys.argv[0])
def send(process=None, subject_format='{executable} process {pid} ended',
timeout=notify2.EXPIRES_NEVER):
"""Display a Desktop Notification via DBUS (notify2)
:param process: information about process. (.info() i... |
pyairctrl/__init__.py | GSzabados/py-air-control | 203 | 12715210 | """py-air-control."""
|
tests/util/test_store.py | spxtr/bumblebee-status | 1,089 | 12715215 | <reponame>spxtr/bumblebee-status<gh_stars>1000+
import pytest
import util.store
@pytest.fixture
def emptyStore():
return util.store.Store()
@pytest.fixture
def store():
return util.store.Store()
def test_get_of_unset_key(emptyStore):
assert emptyStore.get("any-key") == None
assert emptyStore.get(... |
self-paced-labs/vertex-ai/vertex-ai-qwikstart/utils/data_download.py | memeyankm/training-data-analyst | 6,140 | 12715262 | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
cLoops/cDBSCAN.py | rikrdo89/cLoops | 105 | 12715283 | <gh_stars>100-1000
#--coding:utf-8 --
"""
"""
class cDBSCAN:
"""
The major class of the cDBSCAN algorithm, belong to <NAME>, <NAME>.
"""
def __init__(self, mat, eps, minPts):
"""
@param mat: the raw or normalized [pointId,X,Y] data matrix
@type mat : np.array
@param ... |
lightbus/__init__.py | C0DK/lightbus | 178 | 12715284 | from lightbus.utilities.logging import configure_logging
from lightbus.transports import *
from lightbus.client import BusClient
from lightbus.path import *
from lightbus.message import *
from lightbus.api import *
from lightbus.schema import *
from lightbus.creation import *
from lightbus.client.utilities import OnErr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.