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 |
|---|---|---|---|---|
scripts/taiseilib/configure.py | kasymovga/taisei | 573 | 12620113 |
from . import common
import re
class ConfigureError(common.TaiseiError):
pass
class NameNotDefinedError(ConfigureError):
def __init__(self, type, name):
return super().__init__("{} '{}' is not defined".format(type, name))
class VariableNotDefinedError(NameNotDefinedError):
def __init__(self,... |
utils/utils.py | LisaAnne/LocalizingMoments | 157 | 12620120 | <reponame>LisaAnne/LocalizingMoments<filename>utils/utils.py
import json
def read_json(json_file):
with open(json_file) as data_file:
data = json.load(data_file)
return data
|
Huang2017AdaIN/model.py | czczup/URST | 119 | 12620125 | import torch.nn as nn
import torch
from function import coral
from function import adaptive_instance_normalization as adain
from function import calc_mean_std
import torch.nn.functional as F
decoder = nn.Sequential(
nn.ReflectionPad2d((1, 1, 1, 1)),
nn.Conv2d(512, 256, (3, 3)),
nn.ReLU(),
nn.Upsample(... |
tests/test_utilities.py | JNDanielson/mplstereonet | 120 | 12620132 | import pytest
import mplstereonet
import numpy as np
class TestParseStrikes:
def test_parse_strike(self):
data = [
[('N30E', '45NW'), (210, 45)],
[('210', '45'), (210, 45)],
[('E10N', '20NW'), (260, 20)],
[('350', '40W'), (170, 40)],
... |
composer/core/state.py | mosaicml/composer | 945 | 12620136 | <reponame>mosaicml/composer<filename>composer/core/state.py
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0
"""The state of the trainer."""
from __future__ import annotations
import collections.abc
import logging
import warnings
from typing import TYPE_CHECKING, Any, Callable, Dict, I... |
unittest/ops/electric_potential_unittest.py | xiefei1026/DREAMPlace | 323 | 12620157 | ##
# @file electric_potential_unitest.py
# @author <NAME>
# @date Mar 2019
#
import time
import numpy as np
import unittest
import logging
import torch
from torch.autograd import Function, Variable
import os
import sys
import gzip
sys.path.append(
os.path.dirname(os.path.dirname(os.path.dirname(
os.p... |
run_all_tests.py | spchal/pwntools-write-ups | 456 | 12620215 | <filename>run_all_tests.py
#!/usr/bin/env python2
from pwn import *
for path, dirs, files in os.walk('.'):
if '.git' in path:
continue
if 'wargames' in path:
continue
if not dirs:
for f in files:
if f.startswith('harness'):
h = log.waitfor('Running har... |
third_party/WebKit/Source/build/scripts/make_element_lookup_trie.py | wenfeifei/miniblink49 | 5,964 | 12620217 | <reponame>wenfeifei/miniblink49
#!/usr/bin/env python
# Copyright (C) 2013 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the abov... |
datasets/load/old/load.1000_genomes_phase3_chrMT.GRCh37.py | 3vivekb/hail | 789 | 12620220 |
import hail as hl
ht_samples = hl.import_table('gs://hail-datasets/raw-data/1000_genomes/samples_1kg.tsv',
key='sample')
mt = hl.import_vcf('gs://hail-datasets/raw-data/1000_genomes/ALL.chrMT.phase3_callmom-v0_4.20130502.genotypes.vcf.bgz')
mt = mt.key_rows_by('locus')
mt = mt.distinct_b... |
yapftests/unwrapped_line_test.py | TinkerBoard2-Android/external-yapf | 13,769 | 12620227 | <reponame>TinkerBoard2-Android/external-yapf
# Copyright 2015 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... |
tensorflow/contrib/labeled_tensor/python/ops/nn.py | tianyapiaozi/tensorflow | 848 | 12620236 | # Copyright 2016 The TensorFlow 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 applica... |
PhysicsTools/PythonAnalysis/test/testNumba.py | ckamtsikis/cmssw | 852 | 12620239 | <filename>PhysicsTools/PythonAnalysis/test/testNumba.py
#!/usr/bin/env python3
"""
A moving average function using @guvectorize.
"""
from __future__ import print_function
# from examples in numba documentaiton
# http://numba.pydata.org/numba-doc/dev/user/examples.html (0.33.0)
from builtins import range
import numpy ... |
lfs/shipping/__init__.py | michael-hahn/django-lfs | 345 | 12620240 | default_app_config = 'lfs.shipping.apps.LfsShippingAppConfig'
|
pkg/virtualenv_utils.py | bruce30262/idapkg | 125 | 12620243 | <reponame>bruce30262/idapkg
import os
import runpy
import subprocess
import sys
import tempfile
from hashlib import sha256
from .logger import getLogger
from .process import Popen, system
# extracted from https://pypi.org/simple/virtualenv/
VIRTUALENV_URL = 'https://files.pythonhosted.org/packages/b3/3a' \
... |
SQTemplate/SQBuilder Sample/UIBuilder/builder.py | sundayios/coderZsq.project.ios-master | 264 | 12620317 | import os, sys, json
def cur_file_dir():
path = sys.path[0]
if os.path.isdir(path):
return path
elif os.path.isfile(path):
return os.path.dirname(path)
file_json = open(cur_file_dir() + "/config.json", "r")
data_json = json.loads(file_json.read())
bean = str(data_json["bean"])
unit = str(dat... |
matrix-python-project/cover_generator/typesetting/model/three.py | hokaso/hocassian-media-matrix | 141 | 12620321 | <reponame>hokaso/hocassian-media-matrix
import sys, os, time, json, random
from PIL import Image, ImageDraw, ImageFont, ImageFilter
from cover_generator.typesetting.more import More
from cover_generator.typesetting.mark import Mark
from cover_generator.typesetting.build import Build
from utils.snow_id import SnowId
sy... |
evaluate/__init__.py | xiabinfeng/reid_baseline_with_syncbn | 155 | 12620344 | <reponame>xiabinfeng/reid_baseline_with_syncbn<filename>evaluate/__init__.py
from .eval_reid import eval_func
from .re_ranking import re_ranking
import torch
def euclidean_dist(x, y):
"""
Args:
x: pytorch Variable, with shape [m, d]
y: pytorch Variable, with shape [n, d]
Returns:
dist: p... |
examples/example_tf_data_validation/main.py | flylo/spotify-tensorflow | 123 | 12620360 | # -*- coding: utf-8 -*-
#
# Copyright 2017-2019 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 applicabl... |
ssd/layers/functions/__init__.py | maddie157/BiDet | 161 | 12620379 | <gh_stars>100-1000
from .detection import Detect, DetectPrior
from .prior_box import PriorBox
__all__ = ['Detect', 'DetectPrior', 'PriorBox']
|
torchlayers/_name.py | ghost2718/torchlayers | 573 | 12620383 | <reponame>ghost2718/torchlayers
_name = "torchlayers"
|
paper/rev2q3-count-highest-impact.py | zihhuafang/slivar_vep105 | 162 | 12620426 | from cyvcf2 import VCF
import collections
import sys
order = [line.strip() for line in open(sys.argv[1], 'rt') if line[0] != '#']
counts = collections.defaultdict(int)
for v in VCF(sys.argv[2]):
hi = v.INFO.get("highest_impact_order")
counts[order[hi]] += 1
for k, v in counts.items():
print(f"{k}\t{v}")... |
python/ql/src/Classes/ConflictingAttributesInBaseClasses.py | vadi2/codeql | 4,036 | 12620432 | <filename>python/ql/src/Classes/ConflictingAttributesInBaseClasses.py
class TCPServer(object):
def process_request(self, request, client_address):
self.do_work(request, client_address)
self.shutdown_request(request)
class ThreadingMixIn:
"""Mix-in class to handle each request in a ne... |
desktop/core/ext-py/docutils-0.14/test/test_transforms/test_messages.py | kokosing/hue | 5,079 | 12620452 | <filename>desktop/core/ext-py/docutils-0.14/test/test_transforms/test_messages.py
#! /usr/bin/env python
# $Id: test_messages.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: <NAME> <<EMAIL>>
# Copyright: This module has been placed in the public domain.
"""
Tests for docutils.transforms.universal.Messages.
"""
from... |
inquirer/__init__.py | SteinRobert/python-inquirer | 640 | 12620462 | <reponame>SteinRobert/python-inquirer<gh_stars>100-1000
from __future__ import print_function
try:
from .prompt import prompt
from .questions import (
Text,
Editor,
Password,
Confirm,
List,
Checkbox,
Path,
load_from_dict,
load_from_json,
... |
mmtbx/refinement/real_space/adp.py | dperl-sol/cctbx_project | 155 | 12620471 | <gh_stars>100-1000
from __future__ import absolute_import, division, print_function
import mmtbx.refinement.real_space.utils
import mmtbx.refinement.utils
from scitbx.array_family import flex
from cctbx import adptbx
from libtbx import easy_mp
from mmtbx import bulk_solvent
from libtbx.test_utils import approx_equal
fr... |
kapitan/inputs/remove.py | laserb/kapitan | 1,413 | 12620496 | #!/usr/bin/env python3
# Copyright 2019 The Kapitan Authors
# SPDX-FileCopyrightText: 2020 The Kapitan Authors <<EMAIL>>
#
# SPDX-License-Identifier: Apache-2.0
import logging
import os
import shutil
from distutils.dir_util import copy_tree
from kapitan.inputs.base import InputType
logger = logging.getLogger(__name... |
Validation/EcalDigis/python/ecalUnsuppressedMixingModuleValidation_cff.py | ckamtsikis/cmssw | 852 | 12620508 | <gh_stars>100-1000
import FWCore.ParameterSet.Config as cms
from Validation.EcalDigis.ecalMixingModuleValidation_cfi import *
ecalMixingModuleValidation.EBdigiCollection = 'simEcalUnsuppressedDigis'
ecalMixingModuleValidation.EEdigiCollection = 'simEcalUnsuppressedDigis'
ecalMixingModuleValidation.ESdigiCollection = '... |
phidl/__init__.py | giumc/phidl | 102 | 12620511 | <reponame>giumc/phidl<filename>phidl/__init__.py<gh_stars>100-1000
from phidl.device_layout import Device, Group, Path, CrossSection, Port, Layer, LayerSet
from phidl.device_layout import make_device
from phidl.quickplotter import quickplot, quickplot2, set_quickplot_options
from phidl.device_layout import __version__,... |
demo-project/src/demo_project/pipelines/modelling/nodes.py | deepyaman/kedro-viz | 125 | 12620513 | import importlib
import logging
from typing import Any, Dict, Tuple
import pandas as pd
from sklearn.base import BaseEstimator
from sklearn.metrics import r2_score
from sklearn.model_selection import train_test_split
def split_data(data: pd.DataFrame, split_options: Dict) -> Tuple:
"""Splits data into features a... |
OSLSM/code/ss_settings.py | vamsirk/OneShotSemanticSegmentation | 115 | 12620518 | <reponame>vamsirk/OneShotSemanticSegmentation
import numpy as np
import os.path as osp
from util import Map
from db_path import *
# Classes in pascal dataset
PASCAL_CATS = ['aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus', 'car' , 'cat', 'chair', 'cow',
'diningtable', 'dog', 'horse', 'motorbike'... |
scripts/backup/run_backup/backup_swift.py | chopeen/dataverse | 681 | 12620524 | import io
import re
import swiftclient
from config import (ConfigSectionMap)
def backup_file_swift (file_input, dataset_authority, dataset_identifier, storage_identifier):
auth_url = ConfigSectionMap("Backup")['swiftauthurl']
auth_version = ConfigSectionMap("Backup")['swiftauthversion']
user = ConfigSectio... |
aminator/plugins/blockdevice/null.py | vijay-khanna/Netflix-aminator | 721 | 12620527 | # -*- coding: utf-8 -*-
#
#
# Copyright 2014 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 ... |
quarkc/test/ffi/expected/py/org_example_foo/org_example_foo_md/__init__.py | datawire/quark | 112 | 12620552 | <gh_stars>100-1000
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from builtins import str as unicode
from quark_runtime import *
_lazyImport.plug("org_example_foo_md.org_example_foo_Foo_test_Method")
import quark.ref... |
src/hdusd/ui/panels.py | VascoPi/BlenderUSDHydraAddon | 212 | 12620555 | #**********************************************************************
# Copyright 2020 Advanced Micro Devices, 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.or... |
tests/integration/test_system_ddl_worker_queue/test.py | chalice19/ClickHouse | 8,629 | 12620559 | import pytest
from helpers.cluster import ClickHouseCluster
cluster = ClickHouseCluster(__file__)
node1 = cluster.add_instance(
"node1", main_configs=["configs/remote_servers.xml"], with_zookeeper=True
)
node2 = cluster.add_instance(
"node2", main_configs=["configs/remote_servers.xml"], with_zookeeper=True
)... |
src/schnetpack/md/parsers/__init__.py | giadefa/schnetpack | 450 | 12620588 | <gh_stars>100-1000
"""
This module contains several parsers. This includes utilities for reading and converting molecular
dynamics input files to instructions for the :obj:`schnetpack.md.simulator.Simulator`. In addition, there is
a full package for parsing ORCA output files.
"""
|
external/AR/ltr/models/AR_seg_mask/AR_seg_mask.py | tzhhhh123/Stark | 376 | 12620595 | <reponame>tzhhhh123/Stark
import torch.nn as nn
from ltr.models.neck import CorrNL
from ltr import model_constructor
import torch
import ltr.models.backbone.resnet_seg as resnet_seg
from ltr.models.head import seg_network
from easydict import EasyDict as edict
'''2020.4.14 replace mask head with frtm for higher-quali... |
test/nn/conv/test_supergat_conv.py | JinheonBaek/pytorch_geometric | 12,651 | 12620596 | import pytest
import torch
from torch_geometric.nn import SuperGATConv
@pytest.mark.parametrize('att_type', ['MX', 'SD'])
def test_supergat_conv(att_type):
x = torch.randn(4, 8)
edge_index = torch.tensor([[0, 1, 2, 3], [0, 0, 1, 1]])
conv = SuperGATConv(8, 32, heads=2, attention_type=att_type,
... |
src/sparsify/blueprints/system.py | dhuangnm/sparsify | 152 | 12620602 | <reponame>dhuangnm/sparsify
# Copyright (c) 2021 - present / Neuralmagic, 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/LICEN... |
eggs/Flask_Admin-1.1.0-py2.7.egg/flask_admin/contrib/mongoengine/typefmt.py | salayhin/talkofacta | 334 | 12620691 | <gh_stars>100-1000
from jinja2 import Markup, escape
from mongoengine.base import BaseList
from mongoengine.fields import GridFSProxy, ImageGridFsProxy
from flask.ext.admin.model.typefmt import BASE_FORMATTERS, list_formatter
from . import helpers
def grid_formatter(view, value):
if not value.grid_id:
... |
zeus/api/schemas/fields/__init__.py | conrad-kronos/zeus | 221 | 12620699 | from .enum import * # NOQA
from .file import * # NOQA
from .permission import * # NOQA
from .result import * # NOQA
from .revision import * # NOQA
from .severity import * # NOQA
from .status import * # NOQA
|
examples/serial_server.py | timgates42/PyBBIO | 102 | 12620722 | <reponame>timgates42/PyBBIO
# serial_server.py - <NAME> - 4/15/12
#
# Creates a simple web interface to the Serial2 port.
#
# Serial2 TX = pin 21 on P9 header
# Serial2 RX = pin 22 on P9 header
#
# Run this program and navigate to http://your_beaglebone_ip:8000
# in your web brower.
#
# See BBIOServer tutorial:
# htt... |
wagtail/admin/views/pages/utils.py | sonnybaker/wagtail | 8,851 | 12620730 | <filename>wagtail/admin/views/pages/utils.py
from django.utils.http import url_has_allowed_host_and_scheme
def get_valid_next_url_from_request(request):
next_url = request.POST.get('next') or request.GET.get('next')
if not next_url or not url_has_allowed_host_and_scheme(url=next_url, allowed_hosts={request.ge... |
scripts/check_utils/check_split_leak.py | gitter-badger/FlexNeuART | 101 | 12620752 | <filename>scripts/check_utils/check_split_leak.py
#!/usr/bin/env python
#
# Copyright 2014+ Carnegie Mellon University
#
# 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.apac... |
states/bacula.py | beornf/salt-contrib | 111 | 12620764 | <reponame>beornf/salt-contrib
# -*- coding: utf-8 -*-
'''
Management of bacula File Daemon Configuration
==============================================
Configure Bacula file daemon to allow connections from a
particular Bacula director, set password credentials, as well as
the file daemon name and port that it runs on... |
src/encoded/tests/test_audit_series.py | procha2/encoded | 102 | 12620772 | import pytest
def test_treatment_time_series_mixed_units(
testapp,
treatment_time_series,
experiment_chip_H3K4me3,
experiment_chip_H3K27me3,
replicate_1_chip,
replicate_2_chip,
library_1_chip,
library_2_chip,
biosample_human_1,
biosample_human_2,
treatment_5,
treatment_... |
atest/testdata/standard_libraries/builtin/UseBuiltIn.py | phil-davis/robotframework | 7,073 | 12620774 | from robot.libraries.BuiltIn import BuiltIn
def log_debug_message():
b = BuiltIn()
b.set_log_level('DEBUG')
b.log('Hello, debug world!', 'DEBUG')
def get_test_name():
return BuiltIn().get_variables()['${TEST NAME}']
def set_secret_variable():
BuiltIn().set_test_variable('${SECRET}', '*****')
... |
dsgn/utils/rotate_iou/utils.py | fangchengji/DSGN | 166 | 12620780 | <reponame>fangchengji/DSGN
import numpy as np
def boxes_center3d_to_corner3d_lidar(boxes_center):
# (N, 7) -> (N, 8, 3)
N = boxes_center.shape[0]
translation = boxes_center[:, :3]
size = boxes_center[:, 3:6]
rotation = boxes_center[:, 6]
h, w, l = boxes_center[:,3], boxes_center[:,4], boxes_ce... |
tests/test_case.py | ajhynes7/datatest | 277 | 12620782 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
import inspect
import re
import textwrap
import warnings
from sys import version_info as _version_info
from unittest import TestCase as _TestCase # Originial TestCase, not
# compatibility layer.
# Import compatiblity layers.
from .... |
paas-ce/paas/esb/esb/channel/confapis.py | renmcc/bk-PaaS | 767 | 12620783 | <filename>paas-ce/paas/esb/esb/channel/confapis.py<gh_stars>100-1000
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under th... |
st2api/tests/unit/controllers/v1/test_policies.py | momokuri-3/st2 | 4,920 | 12620786 | # Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... |
Python/PlusOneTest.py | TonnyL/Windary | 205 | 12620791 | <reponame>TonnyL/Windary
from unittest import TestCase
from PlusOne import PlusOne
class TestPlusOne(TestCase):
def test_plusOne(self):
po = PlusOne()
self.assertEqual(po.plusOne([1]), [2])
self.assertEqual(po.plusOne([9]), [1, 0])
self.assertEqual(po.plusOne([9, 9]), [1, 0, 0]... |
src/encoded/upgrade/analysis_step.py | procha2/encoded | 102 | 12620804 | from snovault import upgrade_step
from .upgrade_data.analysis_step_5_to_6 import (
label_mapping,
status_mapping,
title_mapping,
major_version_mapping,
aliases_mapping
)
@upgrade_step('analysis_step', '1', '2')
def analysis_step_1_2(value, system):
# http://redmine.encodedcc.org/issues/2770
... |
wandb/vendor/prompt_toolkit/contrib/regular_languages/__init__.py | dreamflasher/client | 6,989 | 12620831 | <reponame>dreamflasher/client
r"""
Tool for expressing the grammar of an input as a regular language.
==================================================================
The grammar for the input of many simple command line interfaces can be
expressed by a regular language. Examples are PDB (the Python debugger); a
sim... |
parsecom.py | hanleybrand/deserts | 493 | 12620841 | <filename>parsecom.py
import re
class ParseFailure(Exception):
pass
class Parser(object):
def __add__(self, other):
return ThenWS(self, other)
def __and__(self, other):
return Then(self, other)
def __or__(self, other):
return Or(self, other)
def __rshift__(self, other):
... |
fhir/resources/DSTU2/address.py | cstoltze/fhir.resources | 144 | 12620845 | # -*- coding: utf-8 -*-
"""
Profile: http://hl7.org/fhir/StructureDefinition/Address
Release: DSTU2
Version: 1.0.2
Revision: 7202
"""
from typing import List as ListType
from pydantic import Field
from . import fhirtypes
from .element import Element
class Address(Element):
"""A postal address.
There is a v... |
scons/site_tools/openocd_remote.py | roboterclubaachen/xpcc | 161 | 12620846 | #!/usr/bin/env python3
#
# Copyright (c) 2014, Roboterclub Aachen e.V.
# All Rights Reserved.
#
# The file is part of the xpcc library and is released under the 3-clause BSD
# license. See the file `LICENSE` for the full license governing this code.
import platform
from SCons.Script import *
# ----------------------... |
Chapter 7/tf2_cbow_model.py | shantam21/Deep-Learning-with-TensorFlow-2-and-Keras | 267 | 12620856 | import tensorflow as tf
class CBOWModel(tf.keras.Model):
def __init__(self, vocab_sz, emb_sz, window_sz, **kwargs):
super(CBOWModel, self).__init__(**kwargs)
self.embedding = tf.keras.layers.Embedding(
input_dim=vocab_sz,
output_dim=emb_sz,
embeddings_initializer... |
pythran/tests/rosetta/greatest_common_divisor.py | davidbrochart/pythran | 1,647 | 12620887 | <filename>pythran/tests/rosetta/greatest_common_divisor.py
#from http://rosettacode.org/wiki/Greatest_common_divisor#Python
#pythran export gcd_iter(int, int)
#pythran export gcd(int, int)
#pythran export gcd_bin(int, int)
#runas gcd_iter(40902, 24140)
#runas gcd(40902, 24140)
#runas gcd_bin(40902, 24140)
def gcd_iter... |
tests/qos/test_buffer_traditional.py | lolyu/sonic-mgmt | 132 | 12620906 | import logging
import pytest
from tests.common.utilities import wait_until
from tests.common.helpers.assertions import pytest_assert
pytestmark = [
pytest.mark.topology('any')
]
DEFAULT_LOSSLESS_PROFILES = None
RECLAIM_BUFFER_ON_ADMIN_DOWN = None
@pytest.fixture(scope="module", autouse=True)
def setup_module(d... |
tests/openwisp2/sample_x509/migrations/0002_common_name_max_length.py | MiHiR151203/django-x509 | 410 | 12620921 | # Generated by Django 3.1.1 on 2020-09-09 08:21
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sample_x509', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='ca',
name='common_name',
... |
cv-Tkinter-GUI/kivy-GUI/kivy_cv1.py | shliang0603/OpenCV-Python-Tutorial | 2,875 | 12620939 | # -*- coding: utf-8 -*-
# @Time : 2018/2/8 16:30
# @Author : play4fun
# @File : kivy_cv1.py
# @Software: PyCharm
"""
参考:https://github.com/kivy/kivy/blob/master/kivy/core/camera/camera_opencv.py
kivy_cv1.py:
https://gist.github.com/ExpandOcean/de261e66949009f44ad2
pip install kivy
问题:无显示
"""
# coding:utf-8
... |
Python/tigre/algorithms/statistical_algorithms.py | gfardell/TIGRE | 326 | 12620952 | <filename>Python/tigre/algorithms/statistical_algorithms.py
from __future__ import division
import time
import numpy as np
from tigre.algorithms.iterative_recon_alg import IterativeReconAlg
from tigre.algorithms.iterative_recon_alg import decorator
from tigre.utilities.Atb import Atb
from tigre.utilities.Ax i... |
notification/notifier/slack.py | gueux/openduty | 595 | 12620970 | from slacker import Slacker
class SlackNotifier:
def __init__(self, config):
self.__config = config
def notify(self, notification):
slack = Slacker(self.__config['apikey'])
response = slack.chat.post_message(notification.user_to_notify.profile.slack_room_name, notification.message... |
examples/entities/mtext_editor.py | Gmadges/ezdxf | 515 | 12620973 | <filename>examples/entities/mtext_editor.py
# Copyright (c) 2021 <NAME>
# License: MIT License
from pathlib import Path
import ezdxf
from ezdxf.tools.text import (
MTextEditor,
ParagraphProperties,
MTextParagraphAlignment,
)
from ezdxf.tools.text_layout import lorem_ipsum
OUTBOX = Path("~/Desktop/Outbox").... |
sleepypuppy/admin/assessment/views.py | soffensive/sleepy-puppy | 952 | 12620979 | <reponame>soffensive/sleepy-puppy
# Copyright 2015 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
#
# ... |
qa/rpc-tests/spv.py | coindroid42/chain2 | 515 | 12620989 | #!/usr/bin/env python3
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import binascii
from test_framework.mininode import *
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *... |
3rdParty/V8/v7.9.317/tools/dump-cpp.py | rajeev02101987/arangodb | 12,278 | 12621007 | <reponame>rajeev02101987/arangodb<gh_stars>1000+
#!/usr/bin/env python
# Copyright 2016 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.
# This script executes dumpcpp.js, collects all dumped C++ symbols,
# and merges the... |
deep-rl/lib/python2.7/site-packages/OpenGL/GL/ATI/pn_triangles.py | ShujaKhalid/deep-rl | 210 | 12621012 | '''OpenGL extension ATI.pn_triangles
This module customises the behaviour of the
OpenGL.raw.GL.ATI.pn_triangles to provide a more
Python-friendly API
Overview (from the spec)
ATI_pn_triangles provides a path for enabling the GL to internally
tessellate input geometry into curved patches. The extension allows ... |
KG/CoKE/bin/evaluation.py | pkulzb/Research | 1,319 | 12621014 | # Copyright (c) 2019 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 app... |
Chapter07/generators_iteration_2.py | TranQuangDuc/Clean-Code-in-Python | 402 | 12621018 | """Clean Code in Python - Chapter 7: Using Generators
> The Interface for Iteration: sequences
"""
import logging
logger = logging.getLogger(__name__)
class SequenceWrapper:
def __init__(self, original_sequence):
self.seq = original_sequence
def __getitem__(self, item):
value = self.seq[i... |
dml/tool/__init__.py | Edelweiss35/deep-machine-learning | 708 | 12621031 | <reponame>Edelweiss35/deep-machine-learning
"""
"""
import numpy as np
import scipy as sp
from .sigmoid import sigmoid
from .normalize import normalize,disnormalize,normalize_by_extant,featurenormal
from .sign import sign
from .pca import pca,projectData,recoverData
from .displayData import displayData,showimage
fro... |
leetcode/527.word-abbreviation.py | geemaple/algorithm | 177 | 12621056 | class Solution(object):
def wordsAbbreviation(self, dict):
"""
:type dict: List[str]
:rtype: List[str]
"""
res = []
countMap = {}
prefix = [1] * len(dict)
for word in dict:
abbr = self.abbreviateWord(word, 1)
res.append(abbr)
... |
homeassistant/components/zwave/workaround.py | tbarbette/core | 22,481 | 12621098 | """Z-Wave workarounds."""
from . import const
# Manufacturers
FIBARO = 0x010F
GE = 0x0063
PHILIO = 0x013C
SOMFY = 0x0047
WENZHOU = 0x0118
LEVITON = 0x001D
# Product IDs
GE_FAN_CONTROLLER_12730 = 0x3034
GE_FAN_CONTROLLER_14287 = 0x3131
JASCO_FAN_CONTROLLER_14314 = 0x3138
PHILIO_SLIM_SENSOR = 0x0002
PHILIO_3_IN_1_SENSO... |
venv/Lib/site-packages/two1/sell/composer.py | RafaelHMachado/Cioffis_Automation | 415 | 12621100 | # standard python imports
import re
import os
import time
from collections import OrderedDict
from collections import namedtuple
import json
import shutil
import subprocess
from enum import Enum
from abc import ABCMeta
from abc import abstractmethod
import tarfile
import yaml
# 3rd party imports
import requests
from ... |
cinder/tests/unit/policies/test_attachments.py | arunvinodqmco/cinder | 571 | 12621120 | # Copyright 2021 Red Hat, 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 a... |
files/commands/code.py | rockonedege/ezored | 129 | 12621146 | <reponame>rockonedege/ezored<filename>files/commands/code.py<gh_stars>100-1000
"""Code manager tool"""
import os
import subprocess
from files.core import const
from files.core import file
from files.core import log
from files.core import runner
from files.core import target
# ---------------------------------------... |
gradient_free_optimizers/optimizers/sequence_model/ensemble_optimizer.py | gtr8/Gradient-Free-Optimizers | 860 | 12621154 | <reponame>gtr8/Gradient-Free-Optimizers
# Author: <NAME>
# Email: <EMAIL>
# License: MIT License
from .exp_imp_based_opt import ExpectedImprovementBasedOptimization
from .surrogate_models import EnsembleRegressor
from sklearn.tree import DecisionTreeRegressor
from sklearn.ensemble import GradientBoostingRegressor
f... |
run/sipdump2john.py | zaza568/yo | 2,109 | 12621188 | <reponame>zaza568/yo
#!/usr/bin/env python
"""sipdump2john.py processes sipdump output files (dump files)
into a format suitable for use with JtR."""
import sys
def process_file(filename):
with open(filename, "r") as f:
for line in f.readlines():
line = line.rstrip().replace('"', '*').replac... |
tests/r/test_consump.py | hajime9652/observations | 199 | 12621226 | <gh_stars>100-1000
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import shutil
import sys
import tempfile
from observations.r.consump import consump
def test_consump():
"""Test module consump.py by downloading
consump.csv and testing shape of
ex... |
examples/emr_pyspark_crag/repo.py | dbatten5/dagster | 4,606 | 12621232 | # start-snippet
from pathlib import Path
from dagster import graph, make_python_type_usable_as_dagster_type, op, repository
from dagster.core.definitions.no_step_launcher import no_step_launcher
from dagster_aws.emr import emr_pyspark_step_launcher
from dagster_aws.s3 import s3_pickle_io_manager, s3_resource
from dags... |
components/iscesys/DataRetriever/__init__.py | vincentschut/isce2 | 1,133 | 12621236 | #!/usr/bin/env python3
def createDataRetriever(name=''):
from .DataRetriever import DataRetriever
return DataRetriever(name=name)
def getFactoriesInfo():
"""
Returns a dictionary with information on how to create an object Sensor from its factory
"""
return {'DataRetriever':
... |
oidc_example/op2/client_mgr.py | kschu91/pyoidc | 373 | 12621239 | <gh_stars>100-1000
#!/usr/bin/env python
import json
from oic.utils.client_management import CDB
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-l', dest='list', action='store_true')
parser.add_argument('-a', dest='add')
parser.add_argument('-d'... |
test/win/gyptest-quoting-commands.py | chlorm-forks/gyp | 2,151 | 12621255 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Make sure batch files run as actions. Regression test for previously missing
trailing quote on command line. cmd typically will implicit... |
Day_1_Scientific_Python/snippets/02-pandas_introduction65.py | Morisset/python-workshop | 183 | 12621269 | <filename>Day_1_Scientific_Python/snippets/02-pandas_introduction65.py
df.loc[df['Sex'] == 'male', 'Age'].mean() |
migrations/versions/ce624ab2c458_create_tables.py | martyole/TensorHive | 129 | 12621274 | <filename>migrations/versions/ce624ab2c458_create_tables.py
"""create_tables
Revision ID: ce624ab2c458
Revises:
Create Date: 2018-10-19 23:09:12.879429
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'ce624ab2c458'
down_revision = None
branch_labels = None
dep... |
Section 8 - Twitter Sentiment Analysis/TSA Part 5 - Preprocessing tweets.py | kungfumas/bahasa-alami | 169 | 12621281 | <gh_stars>100-1000
# Twitter Sentiment Analysis using NLP
# Install tweepy - pip install tweepy
# Importing the libraries
import tweepy
import re
import pickle
from tweepy import OAuthHandler
# Please change with your own consumer key, consumer secret, access token and access secret
# Initializing the keys
consumer... |
tests/SphereVoxelization_fft.py | SyedZiaul/freud | 172 | 12621285 | <filename>tests/SphereVoxelization_fft.py
import numpy as np
def compute_3d(box_size, width, points, r_max, periodic=True):
"""
Does voxelization by doing an aperiodic fft of the sphere over the
points on the grid in 3 dimensions
Args:
box_size (float):
Length of the (assuemd cubi... |
dist/ba_data/python/bastd/game/thelaststand.py | Bartixxx32/Bombsquad-Ballistica-Modded-Server | 317 | 12621286 | <filename>dist/ba_data/python/bastd/game/thelaststand.py<gh_stars>100-1000
# Released under the MIT License. See LICENSE for details.
#
"""Defines the last stand minigame."""
from __future__ import annotations
import random
from dataclasses import dataclass
from typing import TYPE_CHECKING
import ba
from bastd.actor... |
lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestFoundationDisassembly.py | dan-zheng/llvm-project | 456 | 12621293 | """
Test the lldb disassemble command on foundation framework.
"""
import unittest2
import os
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
@skipUnlessDarwin
class FoundationDisassembleTestCase(TestBase):
mydir = TestBase.compute_my... |
tests/func/conftest.py | ng-pe/ldap2pg | 151 | 12621311 | import logging
import os
import sys
from functools import partial
import pytest
import sh
class PSQL(object):
# A helper object to do SQL queries with real psql.
def __init__(self):
from sh import psql
self.psql = psql
def __call__(self, *a, **kw):
return self.psql(*a, **kw)
... |
neutron/agent/linux/ip_conntrack.py | congnt95/neutron | 1,080 | 12621320 | <filename>neutron/agent/linux/ip_conntrack.py
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
climlab/model/column.py | nfeldl/climlab | 160 | 12621326 | <filename>climlab/model/column.py
"""Object-oriented code for radiative-convective models with grey-gas radiation.
Code developed by <NAME>, University at Albany
<EMAIL>
Note that the column models by default represent global, time averages.
Thus the insolation is a prescribed constant.
Here is an example to impleme... |
nni/algorithms/nas/pytorch/cream/trainer.py | dutxubo/nni | 9,680 | 12621330 | <reponame>dutxubo/nni
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import logging
from copy import deepcopy
import torch
from nni.nas.pytorch.trainer import Trainer
from nni.nas.pytorch.utils import AverageMeterGroup
from .utils import accuracy, reduce_metrics
logger = logging.getLogger(... |
ServidorPython/python32_web/Lib/site-packages/sklearn/feature_extraction/__init__.py | mak213k/Servidor_automatizado_python | 6,989 | 12621339 | """
The :mod:`sklearn.feature_extraction` module deals with feature extraction
from raw data. It currently includes methods to extract features from text and
images.
"""
from .dict_vectorizer import DictVectorizer
from .hashing import FeatureHasher
from .image import img_to_graph, grid_to_graph
from . import text
__a... |
src/test-apps/happy/test-templates/WeaveKeyExport.py | robszewczyk/openweave-core | 249 | 12621373 | <gh_stars>100-1000
#!/usr/bin/env python3
#
# Copyright (c) 2017 <NAME>, 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.apac... |
WorldModels/env.py | zacwellmer/WorldModels | 240 | 12621387 | <gh_stars>100-1000
import numpy as np
import gym
import json
import os
import tensorflow as tf
import gc
from PIL import Image
from gym.spaces.box import Box
from gym.envs.box2d.car_racing import CarRacing
class CarRacingWrapper(CarRacing):
def __init__(self, full_episode=False):
super(CarRacingWrapper, self)._... |
tests/structures/test_rgbdimages.py | glebshevchukk/gradslam | 1,048 | 12621437 | import logging
import os
import unittest
import numpy as np
import torch
from tests.common import default_to_cpu_if_no_gpu, load_test_data
from tests.common_testing import TestCaseMixin
from gradslam.geometry.geometryutils import create_meshgrid
from gradslam.geometry.projutils import project_points
from gradslam.str... |
tools/SeeDot/seedot/compiler/codegen/arduino.py | Shenzhen-Cloudatawalk-Technology-Co-Ltd/EdgeML | 719 | 12621441 | <gh_stars>100-1000
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license.
'''
Arduino backend handles the automatic Arduino sketch generation.
It adds the appropriate header files to the sketch and makes it easy to 'compile and upload' the sketch to a device.
Most of the routines... |
irc3/plugins/quakenet.py | gtmanfred/irc3 | 178 | 12621449 | <reponame>gtmanfred/irc3
import hashlib
import hmac
import irc3
__doc__ = '''
====================================================
:mod:`irc3.plugins.quakenet` QuakeNet authorization
====================================================
Plugin supports both simple and
`challenge based <https://www.quakenet.org/develop... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.