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 |
|---|---|---|---|---|
sdss/dr8.py | juandesant/astrometry.net | 460 | 12764195 | # This file is part of the Astrometry.net suite.
# Licensed under a 3-clause BSD style license - see LICENSE
from __future__ import print_function
from __future__ import absolute_import
import os
from astrometry.util.fits import fits_table
import numpy as np
import logging
import tempfile
import sys
py3 = (sys.version... |
migrations/alembic/versions/2a8981379eba_add_locales_table.py | bonomali/parrot | 143 | 12764211 | <filename>migrations/alembic/versions/2a8981379eba_add_locales_table.py
"""add locales table
Revision ID: 2a8981379eba
Revises: 438b950c4c9a
Create Date: 2018-01-10 16:21:39.595957
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '2a8981379eba'
down_revision = '... |
058-bmp-stegano/taski_zrodla/mapofbits/level0/testlevel0.py | gynvael/stream | 152 | 12764232 | <gh_stars>100-1000
#!/usr/bin/python
import os, sys
from struct import pack, unpack
PATH = os.path.dirname(os.path.realpath(__file__))
sys.path.append(PATH)
import settings
def rb(d, off):
return d[off]
def rw(d, off):
return unpack("<H", str(d[off:off+2]))[0]
def rd(d, off):
return unpack("<I"... |
spikeextractors/extractors/mdaextractors/__init__.py | zekearneodo/spikeextractors | 145 | 12764286 | from .mdaextractors import MdaRecordingExtractor, MdaSortingExtractor
|
release/stubs.min/Rhino/DocObjects/__init___parts/PointCloudObject.py | htlcnn/ironpython-stubs | 182 | 12764287 | <reponame>htlcnn/ironpython-stubs<filename>release/stubs.min/Rhino/DocObjects/__init___parts/PointCloudObject.py
class PointCloudObject(RhinoObject):
# no doc
def DuplicatePointCloudGeometry(self):
""" DuplicatePointCloudGeometry(self: PointCloudObject) -> PointCloud """
pass
PointCloudGeometry=property(lam... |
Filters/Modeling/Testing/Python/TestImprintFilter.py | cclauss/VTK | 1,755 | 12764301 | <reponame>cclauss/VTK<gh_stars>1000+
#!/usr/bin/env python
import vtk
# A simpler imprint test. One plane
# imprints a second plane.
# Control the resolution of the test
res = 2
# Create the RenderWindow, Renderer
#
ren = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer( ren )
iren = vtk.vtkRende... |
delft/textClassification/preprocess.py | tantikristanti/delft | 333 | 12764312 | import itertools
import regex as re
import numpy as np
# seed is fixed for reproducibility
np.random.seed(7)
from tensorflow import set_random_seed
set_random_seed(7)
from unidecode import unidecode
from delft.utilities.Tokenizer import tokenizeAndFilterSimple
from delft.utilities.bert.run_classifier_delft import Data... |
docs/snippets/bus0_sync.py | husqvarnagroup/pynng | 174 | 12764334 | <reponame>husqvarnagroup/pynng
import time
from pynng import Bus0, Timeout
address = 'tcp://127.0.0.1:13131'
with Bus0(listen=address, recv_timeout=100) as s0, \
Bus0(dial=address, recv_timeout=100) as s1, \
Bus0(dial=address, recv_timeout=100) as s2:
# let all connections be established
time.... |
applications/pytorch/cnns/tests/test_train.py | payoto/graphcore_examples | 260 | 12764337 | <gh_stars>100-1000
# Copyright (c) 2020 Graphcore Ltd. All rights reserved.
import os
import gc
import pytest
import shutil
import torch
import poptorch
import popart
from poptorch.optim import SGD
import import_helper
from train import TrainingModelWithLoss
import datasets
import models
from utils import get_train_acc... |
doc/sphinxext/numpydoc/__init__.py | vimalromeo/pandas | 303 | 12764344 | from __future__ import division, absolute_import, print_function
from .numpydoc import setup
|
python/047 Permutations II.py | allandproust/leetcode-share | 156 | 12764349 | <filename>python/047 Permutations II.py
'''
Given a collection of numbers that might contain duplicates, return all possible unique permutations.
For example,
[1,1,2] have the following unique permutations:
[1,1,2], [1,2,1], and [2,1,1].
'''
class Solution(object):
def permuteUnique(self, nums):
... |
tests/test_basis_evaluation.py | jiduque/scikit-fda | 147 | 12764386 |
from skfda.representation.basis import (
FDataBasis, Monomial, BSpline, Fourier, Constant, VectorValued, Tensor)
import unittest
import numpy as np
class TestBasisEvaluationFourier(unittest.TestCase):
def test_evaluation_simple_fourier(self):
"""Test the evaluation of FDataBasis"""
fourier ... |
python/iceberg/api/expressions/expression_parser.py | moulimukherjee/incubator-iceberg | 2,161 | 12764392 | <reponame>moulimukherjee/incubator-iceberg
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Vers... |
rnnmorph/test_predictor.py | AliceCyber/rnnmorph | 124 | 12764404 | <reponame>AliceCyber/rnnmorph<filename>rnnmorph/test_predictor.py
import unittest
import logging
import sys
import numpy as np
import nltk
# import os
# os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
# os.environ["CUDA_VISIBLE_DEVICES"] = ""
from rnnmorph.predictor import RNNMorphPredictor
from rnnmorph.tag_genres im... |
lib/test/vot20/stark_st50_lt.py | tzhhhh123/Stark | 376 | 12764407 | <filename>lib/test/vot20/stark_st50_lt.py
from lib.test.vot20.stark_vot20lt import run_vot_exp
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '6'
run_vot_exp('stark_st', 'baseline', vis=False)
|
jax_cfd/base/subgrid_models_test.py | ngam/jax-cfd | 244 | 12764413 | <gh_stars>100-1000
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
two_sigma_problems/problem_7.py | loftwah/Daily-Coding-Problem | 129 | 12764431 | <reponame>loftwah/Daily-Coding-Problem
"""This problem was asked by Two Sigma.
You’re tracking stock price at a given instance of time.
Implement an API with the following functions: add(), update(), remove(),
which adds/updates/removes a datapoint for the stock price you are tracking.
The data is given as (timesta... |
common/data_refinery_common/models/keywords.py | AlexsLemonade/refinebio | 106 | 12764488 | from django.db import models
class SampleKeyword(models.Model):
"""An ontology term associated with a sample in our database"""
name = models.ForeignKey("OntologyTerm", on_delete=models.CASCADE, related_name="+")
sample = models.ForeignKey("Sample", on_delete=models.CASCADE, related_name="keywords")
... |
Contents/Libraries/Shared/guessit/rules/properties/title.py | jippo015/Sub-Zero.bundle | 1,553 | 12764507 | <gh_stars>1000+
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
title property
"""
from rebulk import Rebulk, Rule, AppendMatch, RemoveMatch, AppendTags
from rebulk.formatters import formatters
from .film import FilmTitleRule
from .language import SubtitlePrefixLanguageRule, SubtitleSuffixLanguageRule, SubtitleExte... |
maistra/vendor/com_googlesource_chromium_v8/wee8/build/fuchsia/boot_data.py | knm3000/proxy | 643 | 12764564 | # Copyright 2018 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.
"""Functions used to provision Fuchsia boot images."""
import common
import logging
import os
import subprocess
import tempfile
import time
import uuid
_SS... |
pypy/interpreter/pyparser/parser.py | nanjekyejoannah/pypy | 333 | 12764661 | """
A CPython inspired RPython parser.
"""
from rpython.rlib.objectmodel import not_rpython
class Grammar(object):
"""
Base Grammar object.
Pass this to ParserGenerator.build_grammar to fill it with useful values for
the Parser.
"""
def __init__(self):
self.symbol_ids = {}
se... |
torchrecipes/vision/core/optim/lr_scheduler.py | colin2328/recipes | 161 | 12764664 | <reponame>colin2328/recipes
#!/usr/bin/env python3
from typing import Union
import torch
from torch.optim.lr_scheduler import CosineAnnealingLR, LinearLR, SequentialLR
class CosineWithWarmup(SequentialLR):
r"""Cosine Decay Learning Rate Scheduler with Linear Warmup.
Args:
optimizer (Optimizer): Wrap... |
crabageprediction/venv/Lib/site-packages/mpl_toolkits/axes_grid/angle_helper.py | 13rianlucero/CrabAgePrediction | 603 | 12764680 | <reponame>13rianlucero/CrabAgePrediction
from mpl_toolkits.axisartist.angle_helper import *
|
tests/load/test_load_case.py | mhkc/scout | 111 | 12764683 | def test_load_case(case_obj, adapter):
## GIVEN a database with no cases
assert adapter.case_collection.find_one() is None
## WHEN loading a case
adapter._add_case(case_obj)
## THEN assert that the case have been loaded with correct info
assert adapter.case_collection.find_one()
def test_lo... |
migrator/wix-bazel-migrator/src/main/resources/import_external.bzl | or-shachar/exodus | 186 | 12764692 | load("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_maven_import_external")
_default_server_urls = ["https://repo.maven.apache.org/maven2/",
"https://mvnrepository.com/artifact",
"https://maven-central.storage.googleapis.com",
"http://gitblit... |
redis-monitor/plugins/stats_monitor.py | j3k00/scrapy-cluster | 1,108 | 12764725 | from __future__ import absolute_import
from .kafka_base_monitor import KafkaBaseMonitor
class StatsMonitor(KafkaBaseMonitor):
regex = "statsrequest:*:*"
def setup(self, settings):
'''
Setup kafka
'''
KafkaBaseMonitor.setup(self, settings)
def handle(self, key, value):
... |
TopQuarkAnalysis/TopEventProducers/python/sequences/ttSemiLepEvtHypotheses_cff.py | ckamtsikis/cmssw | 852 | 12764749 | import FWCore.ParameterSet.Config as cms
#
# produce ttSemiLep event hypotheses
#
## geom hypothesis
from TopQuarkAnalysis.TopJetCombination.TtSemiLepHypGeom_cff import *
## wMassDeltaTopMass hypothesis
from TopQuarkAnalysis.TopJetCombination.TtSemiLepHypWMassDeltaTopMass_cff import *
## wMassMaxSumPt hypothesis
fr... |
ott/core/gromov_wasserstein.py | google-research/ott | 232 | 12764750 | # coding=utf-8
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... |
wonk/policy.py | aminohealth/wonk | 103 | 12764761 | <filename>wonk/policy.py
"""Manage AWS policies."""
import json
import pathlib
import re
from typing import Dict, List, Tuple
from xdg import xdg_cache_home
from wonk import aws, exceptions, optimizer
from wonk.constants import MAX_MANAGED_POLICY_SIZE
from wonk.models import Policy, Statement, canonicalize_resources... |
script/cal_overlap.py | zeta1999/SpinNet | 166 | 12764777 | <reponame>zeta1999/SpinNet
import os
from os.path import exists, join
import pickle
import numpy as np
import open3d
import cv2
import time
class ThreeDMatch(object):
"""
Given point cloud fragments and corresponding pose in '{root}'.
1. Save the aligned point cloud pts in '{savepath}/3DMatch_{downsam... |
pytorch_lit/shared_params.py | lipovsek/PyTorch-LIT | 151 | 12764828 | <filename>pytorch_lit/shared_params.py
from torch.nn import Parameter
from .memory import Memory
class SharedParameterUtil:
_isHijacked = False
_memory = None
_mainNew = None
@staticmethod
def _shared_new(cls, data=None, requires_grad=True):
if data is None:
return SharedPara... |
backend/projects/tests/test_models.py | LucasSantosGuedes/App-Gestao | 142 | 12764849 | import pytest
from mixer.backend.django import mixer
from projects.models import Project, ProjectMembership
from users.models import User
@pytest.mark.django_db
class TestProject:
def test_project_create(self):
user = mixer.blend(User, username='test')
proj = mixer.blend(Project, owner = user)
... |
pymtl3/passes/rtlir/util/test_utility.py | kevinyuan/pymtl3 | 152 | 12764865 | <gh_stars>100-1000
#=========================================================================
# test_utility.py
#=========================================================================
# Author : <NAME>
# Date : Feb 21, 2019
"""Test utilities used by RTLIR tests."""
from contextlib import contextmanager
import py... |
promoterz/evaluationPool.py | mczero80/japonicus | 229 | 12764874 | <filename>promoterz/evaluationPool.py
#!/bin/python
import time
import random
import itertools
from multiprocessing import Pool, TimeoutError
from multiprocessing.pool import ThreadPool
class EvaluationPool():
def __init__(self,
World,
Urls, poolsize, individual_info):
... |
tests/unit/test_non_empty_configs_provider.py | barryib/gitlabform | 299 | 12764886 | import pytest
from gitlabform import EXIT_INVALID_INPUT
from gitlabform.configuration.projects_and_groups import ConfigurationProjectsAndGroups
from gitlabform.filter import NonEmptyConfigsProvider
def test_error_on_missing_key():
config_yaml = """
---
# no key at all
"""
with pytest.raises(Syst... |
GeneratorInterface/GenFilters/python/ZgammaFilter_cfi.py | ckamtsikis/cmssw | 852 | 12764901 | <reponame>ckamtsikis/cmssw
import FWCore.ParameterSet.Config as cms
# values tuned also according to slide 3 of :
# https://indico.cern.ch/getFile.py/access?contribId=23&sessionId=2&resId=0&materialId=slides&confId=271548
# selection efficiency of approx 6% for ZMM_8TeV
myZgammaFilter = cms.EDFilter('ZgammaMassFilter... |
xautodl/spaces/__init__.py | Joey61Liuyi/AutoDL-Projects | 817 | 12764915 | #####################################################
# Copyright (c) <NAME> [GitHub D-X-Y], 2021.01 #
#####################################################
# Define complex searc space for AutoDL #
#####################################################
from .basic_space import Categorical
from .basic_space... |
pygmy/rest/wsgi.py | ParikhKadam/pygmy | 571 | 12764932 | #!/usr/bin/env python3
from pygmy.core.initialize import initialize
initialize()
from pygmy.rest.manage import app
if __name__ == '__main__':
app.run()
|
infoxlm/src-infoxlm/infoxlm/models/__init__.py | Sanster/unilm | 5,129 | 12764957 | import argparse
import importlib
import os
from fairseq.models import MODEL_REGISTRY, ARCH_MODEL_INV_REGISTRY
# automatically import any Python files in the models/ directory
models_dir = os.path.dirname(__file__)
for file in os.listdir(models_dir):
path = os.path.join(models_dir, file)
if not file.startswith('_... |
bench/bench_long_empty_string.py | janaknat/markupsafe | 415 | 12764978 | <filename>bench/bench_long_empty_string.py
from markupsafe import escape
def run():
string = "Hello World!" * 1000
escape(string)
|
torchcam/cams/__init__.py | alexandrosstergiou/torch-cam | 749 | 12764981 | <reponame>alexandrosstergiou/torch-cam
from .cam import *
from .gradcam import *
from .utils import *
|
dfirtrack_config/migrations/0014_main_overview.py | thomas-kropeit/dfirtrack | 273 | 12764983 | <gh_stars>100-1000
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dfirtrack_config', '0013_csvimporterconfigmodel'),
]
operations = [
migrations.AddField(
model_name='mainconfigmodel',
name='main_overview',
... |
CommonTools/PileupAlgos/python/PUPuppi_cff.py | ckamtsikis/cmssw | 852 | 12764987 | import FWCore.ParameterSet.Config as cms
from CommonTools.PileupAlgos.Puppi_cff import *
pupuppi = puppi.clone(
invertPuppi = True
)
|
src/openprocurement/api/interfaces.py | EBRD-ProzorroSale/openprocurement.api | 102 | 12765008 | # -*- coding: utf-8 -*-
from zope.interface import Interface
class IOPContent(Interface):
""" Openprocurement Content """
class IContentConfigurator(Interface):
""" Content configurator """
|
insights/parsers/tests/test_neutron_server_log.py | lhuett/insights-core | 121 | 12765027 | <gh_stars>100-1000
from insights.parsers.neutron_server_log import NeutronServerLog
from insights.tests import context_wrap
NEUTRON_LOG = """
2016-09-13 05:56:45.155 30586 WARNING keystonemiddleware.auth_token [-] Identity response: {"error": {"message": "Could not find token: b45405915eb44e608885f894028d37b9", "code"... |
benchmarks/src/garage_benchmarks/experiments/q_functions/__init__.py | blacksph3re/garage | 1,500 | 12765054 | <reponame>blacksph3re/garage
"""Benchmarking experiments for Q-functions."""
from garage_benchmarks.experiments.q_functions.continuous_mlp_q_function import ( # isort:skip # noqa: E501
continuous_mlp_q_function)
__all__ = ['continuous_mlp_q_function']
|
pytools/lib/common.py | virtualparadox/bbmap | 134 | 12765078 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Function definitions common to all programs.
"""
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## libraries to use
#import re
import os
import time
import sys
#import getpass
import ... |
src/deepsparse/utils/data.py | SkalskiP/deepsparse | 460 | 12765091 | # 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/LICENSE-2.0
#
# Unless required b... |
.sim-test.py | niw/linux-on-litex-vexriscv | 329 | 12765100 | #!/usr/bin/env python3
#
# This file is part of Linux-on-LiteX-VexRiscv
#
# Copyright (c) 2019-2021, Linux-on-LiteX-VexRiscv Developers
# SPDX-License-Identifier: BSD-2-Clause
import os
import sys
import pexpect
import time
from argparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument("--sdram-m... |
wagtail/core/signals.py | smartfactory-gmbh/wagtail | 8,851 | 12765103 | <reponame>smartfactory-gmbh/wagtail
from django.dispatch import Signal
# Page signals
# provides args: instance, revision
page_published = Signal()
# provides args: instance
page_unpublished = Signal()
# provides args: instance, parent_page_before, parent_page_after, url_path_before, url_path_after
pre_page_move =... |
src/detection_efffdet/utils.py | yellowdolphin/SIIM-COVID19-Detection | 153 | 12765127 | <filename>src/detection_efffdet/utils.py
import random
import os
import numpy as np
import torch
import pandas as pd
from mean_average_precision import MetricBuilder
import pickle
classes = [
'Negative for Pneumonia',
'Typical Appearance',
'Indeterminate Appearance',
'Atypical Appearance'
]
def seed_... |
mlcomp/contrib/catalyst/optim/cosineanneal.py | sUeharaE4/mlcomp | 166 | 12765135 | from torch.optim.lr_scheduler import CosineAnnealingLR
class OneCycleCosineAnnealLR(CosineAnnealingLR):
def __init__(self, *args, **kwargs):
self.start_epoch = None
self.last_epoch = None
super().__init__(*args, **kwargs)
def step(self, epoch=None):
if self.last_epoch is not N... |
tests/runtime-trace-tests/cases/assign_stmt.py | jaydeetay/pxt | 977 | 12765144 | # regular assignment
foo = 7
print(foo)
# annotated assignmnet
bar: number = 9
print(bar)
|
tests/test_tools.py | frenners/python-amazon-paapi | 121 | 12765148 | <filename>tests/test_tools.py
from amazon_paapi.exceptions import AsinNotFoundException
from amazon_paapi.tools import get_asin
import pytest
def test_get_asin():
assert get_asin('B01N5IB20Q') == 'B01N5IB20Q'
assert get_asin('https://www.amazon.es/gp/product/B07PHPXHQS') == 'B07PHPXHQS'
assert get_asin('h... |
kotti/views/util.py | IonicaBizauKitchen/Kotti | 191 | 12765151 | import hashlib
from collections import defaultdict
from datetime import datetime
from urllib.parse import urlencode
from babel.dates import format_date
from babel.dates import format_datetime
from babel.dates import format_time
from babel.numbers import format_currency
from pyramid.decorator import reify
from pyramid.... |
examples/txt2unicode/demo_utf8_2_tscii.py | nv-d/open-tamil | 218 | 12765168 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# (C) 2014 Arulalan.T <<EMAIL>>
# (C) 2015 <NAME>
# This file is part of 'open-tamil/txt2unicode' package examples
#
import sys
sys.path.append("../..")
from tamil.txt2unicode import tscii2unicode, unicode2tscii
tscii = """¾¢ÕÅûÙÅ÷ «ÕǢ ¾¢ÕìÌÈû """
uni_1 = tscii2unico... |
deeptools/plotPCA.py | gartician/deepTools | 351 | 12765210 | <gh_stars>100-1000
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import argparse
import matplotlib
matplotlib.use('Agg')
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['svg.fonttype'] = 'none'
from deeptools import cm # noqa: F401
from deeptools.correlation import Correlation
from deeptools.... |
conans/test/conan_v2/conanfile/test_environment.py | matthiasng/conan | 6,205 | 12765219 | <gh_stars>1000+
import textwrap
from conans.client.tools.env import _environment_add
from conans.test.utils.conan_v2_tests import ConanV2ModeTestCase
class CollectLibsTestCase(ConanV2ModeTestCase):
def test_conan_username(self):
t = self.get_client()
conanfile = textwrap.dedent("""
f... |
openbook_invitations/migrations/0002_auto_20190101_1413.py | TamaraAbells/okuna-api | 164 | 12765235 | <gh_stars>100-1000
# Generated by Django 2.1.4 on 2019-01-01 13:13
from django.conf import settings
import django.contrib.auth.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(sett... |
evcouplings/utils/tracker/sql.py | mrunalimanj/EVcouplings | 117 | 12765242 | <reponame>mrunalimanj/EVcouplings
"""
SQL-based result tracker (cannot store actual results, only status).
Using this tracker requires installation of the sqlalchemy package.
Regarding using models from different sources in Flask-SQLAlchemy:
https://stackoverflow.com/questions/28789063/associate-external-class-model-w... |
NLP/Text2SQL-BASELINE/text2sql/dataproc/sql_preproc_v2.py | zhangyimi/Research | 1,319 | 12765311 | <gh_stars>1000+
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# 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://... |
CV/SemSegPaddle/train.py | zhangyimi/Research | 1,319 | 12765335 | <filename>CV/SemSegPaddle/train.py
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
# GPU memory garbage collection optimization flags
os.environ['FLAGS_eager_delete_tensor_gb'] = "0.0"
import sys
import timeit
import argparse
import pprint
import ... |
docs/basic_usage/bu01.py | jviide/htm.py | 112 | 12765351 | from htm import htm
@htm
def html(tag, props, children):
return tag, props, children
result01 = html("""
<div>Hello World</div>
""")
|
testing/util.py | bbhunter/fuzz-lightyear | 169 | 12765382 | <gh_stars>100-1000
import re
# Source: https://stackoverflow.com/a/14693789
_ansi_escape = re.compile(r'\x1b\[[0-?]*[ -/]*[@-~]')
def uncolor(text):
return _ansi_escape.sub('', text)
|
TeacherTree/venv/Lib/site-packages/flask_boost/templates/model.py | intuile/teacher-tree-website | 543 | 12765386 | # coding: utf-8
from datetime import datetime
from ._base import db
class #{model|title}(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(50), unique=True)
created_at = db.Column(db.DateTime, default=datetime.now)
def __repr__(self):
return '<#{model|title} %... |
tensornetwork/linalg/krylov.py | khanhgithead/TensorNetwork | 1,681 | 12765392 | # Copyright 2019 The TensorNetwork Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... |
workalendar/tests/test_mozambique.py | taiyeoguns/workalendar | 405 | 12765411 | from datetime import date
from . import GenericCalendarTest
from ..africa.mozambique import Mozambique
class MozambiqueTest(GenericCalendarTest):
cal_class = Mozambique
def test_year_new_year_shift(self):
holidays = self.cal.holidays_set(2019)
self.assertIn(date(2019, 1, 1), holidays)
... |
grr/server/grr_response_server/bin/__init__.py | nkrios/grr | 4,238 | 12765429 | #!/usr/bin/env python
"""GRR server entry points."""
|
Chapter 04/4.01/model.py | ACsBlack/Tkinter-GUI-Application-Development-Blueprints-Second-Edition | 120 | 12765488 | <filename>Chapter 04/4.01/model.py<gh_stars>100-1000
"""
Code illustration: 4.01
@ Tkinter GUI Application Development Blueprints
"""
from configurations import *
class Model():
def __init__(self):
pass
|
amrlib/alignments/faa_aligner/faa_aligner.py | plandes/amrlib | 103 | 12765493 | <filename>amrlib/alignments/faa_aligner/faa_aligner.py
import os
import sys
import json
import subprocess
import logging
import tarfile
from .preprocess import preprocess_infer
from .postprocess import postprocess
from .get_alignments import GetAlignments
from ..penman_utils import to_graph_line
from ...defau... |
examples/rkhs.py | gautam1858/autograd | 6,119 | 12765495 | <filename>examples/rkhs.py
"""
Inferring a function from a reproducing kernel Hilbert space (RKHS) by taking
gradients of eval with respect to the function-valued argument
"""
from __future__ import print_function
import autograd.numpy as np
import autograd.numpy.random as npr
from autograd.extend import primitive, def... |
test/nmea_queue_test.py | quiet-oceans/libais | 161 | 12765509 | <filename>test/nmea_queue_test.py<gh_stars>100-1000
"""Tests for ais.nmea_queue."""
import contextlib
import unittest
import pytest
import six
from six.moves import StringIO
import ais
from ais import nmea
from ais import nmea_queue
BARE_NMEA = """
# pylint: disable=line-too-long
$GPZDA,203003.00,12,07,2009,00,00,*... |
neo/test/iotest/test_elphyio.py | Mario-Kart-Felix/python-neo | 199 | 12765528 | """
Tests of neo.io.elphyo
"""
import unittest
from neo.io import ElphyIO
from neo.test.iotest.common_io_test import BaseTestIO
class TestElphyIO(BaseTestIO, unittest.TestCase):
ioclass = ElphyIO
entities_to_download = [
'elphy'
]
entities_to_test = ['elphy/DATA1.DAT',
... |
tests/apps/packages/test_xmlrpc.py | tranarthur/localshop | 162 | 12765574 | import xmlrpc.client as xmlrpclib
import pytest
from tests.factories import ReleaseFactory
@pytest.fixture(params=['/RPC2', '/pypi'])
def rpc_endpoint(request):
return request.param
@pytest.mark.django_db
def test_search_package_name(client, admin_user, live_server, repository,
rp... |
dmbrl/config/reacher.py | nikkik11/handful-of-trials | 358 | 12765583 | <reponame>nikkik11/handful-of-trials<gh_stars>100-1000
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import numpy as np
import tensorflow as tf
from dotmap import DotMap
import gym
from dmbrl.misc.DotmapUtils import get_required_argument
from dmbrl.modeli... |
src/captcha/tests/urls.py | daniel-werner/stelagifts | 108 | 12765673 | <reponame>daniel-werner/stelagifts
from django.conf.urls.defaults import *
urlpatterns = patterns('',
url(r'test/$','captcha.tests.views.test',name='captcha-test'),
url(r'test2/$','captcha.tests.views.test_custom_error_message',name='captcha-test-custom-error-message'),
url(r'test3/$','captcha.tests.views.t... |
dataset/lfw.py | Vicent-xd/Residual_autoencoding | 432 | 12765685 | <filename>dataset/lfw.py
import os
import numpy as np
import joblib
from skimage import transform
import deeppy as dp
from .augment import (img_augment, sample_img_augment_params, AugmentedFeed,
SupervisedAugmentedFeed)
from .util import img_transform
cachedir = os.getenv('CACHE_HOME', './cache... |
2017/quals/2017-re-food/generate_flag.py | tonghuaroot/google-ctf | 2,757 | 12765703 | #!/usr/bin/python
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
resource_emulation.py | sogeti-esec-lab/LKD | 102 | 12765707 | import ctypes
import itertools
import windows
import windows.hooks
from windows.generated_def.winstructs import *
class Ressource(object):
def __init__(self, filename, lpName, lpType):
self.filename = filename
self.lpName = lpName
self.lpType = lpType
self.driver_data = None
... |
tests/api/serializers.py | TralahM/drf-generators | 340 | 12765723 | <reponame>TralahM/drf-generators
from rest_framework.serializers import ModelSerializer
from api.models import Category, Post
class CategorySerializer(ModelSerializer):
class Meta:
model = Category
fields = '__all__'
class PostSerializer(ModelSerializer):
class Meta:
model = Post
... |
bibliopixel/layout/matrix.py | rec/leds | 253 | 12765730 | import math, threading, time
from .. import colors
from .. util import deprecated, log
from . import matrix_drawing as md
from . import font
from . layout import MultiLayout
from . geometry import make_matrix_coord_map_multi
from . geometry.matrix import (
make_matrix_coord_map, make_matrix_coord_map_positions)
... |
RecoHI/HiTracking/python/HIPixelVertices_cff.py | ckamtsikis/cmssw | 852 | 12765746 | <reponame>ckamtsikis/cmssw
import FWCore.ParameterSet.Config as cms
# pixel cluster vertex finder
from RecoHI.HiTracking.HIPixelClusterVertex_cfi import *
# pixel track producer
from RecoHI.HiTracking.HIPixel3ProtoTracks_cfi import *
# fast vertex finding
from RecoHI.HiTracking.HIPixelMedianVertex_cfi import *
# s... |
zentral/contrib/inventory/migrations/0023_puppetdb.py | arubdesu/zentral | 634 | 12765749 | <reponame>arubdesu/zentral<filename>zentral/contrib/inventory/migrations/0023_puppetdb.py<gh_stars>100-1000
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-05-15 13:16
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrat... |
tests/fixtures/config_teamocil/test1.py | rfoliva/tmuxp | 1,607 | 12765753 | <reponame>rfoliva/tmuxp<filename>tests/fixtures/config_teamocil/test1.py
from .._util import loadfixture
teamocil_yaml = loadfixture('config_teamocil/test1.yaml')
teamocil_conf = {
'windows': [
{
'name': 'sample-two-panes',
'root': '~/Code/sample/www',
'layout': 'even-ho... |
pyrep/objects/vision_sensor.py | WeiWeic6222848/PyRep | 505 | 12765797 | import math
from typing import List, Union, Sequence
from pyrep.backend import sim
from pyrep.objects.object import Object, object_type_to_class
import numpy as np
from pyrep.const import ObjectType, PerspectiveMode, RenderMode
class VisionSensor(Object):
"""A camera-type sensor, reacting to light, colors and ima... |
utils/mahalanobis.py | gautard/pystatsml | 123 | 12765803 | <reponame>gautard/pystatsml<filename>utils/mahalanobis.py
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 4 16:09:56 2016
@author: <EMAIL>
"""
import numpy as np
import scipy
import matplotlib.pyplot as plt
import seaborn as sns
#%matplotlib inline
'''
Mahalanobis distance
====================
'''
from matplotlib.pa... |
src/python/twitter/checkstyle/plugins/trailing_whitespace.py | zhouyijiaren/commons | 1,143 | 12765807 | # ==================================================================================================
# Copyright 2014 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... |
see_rnn/utils.py | MichaelHopwood/MLMassSpectrom | 149 | 12765820 | <filename>see_rnn/utils.py
import numpy as np
from copy import deepcopy
from pathlib import Path
from ._backend import WARN, NOTE, TF_KERAS, Layer
try:
import tensorflow as tf
except:
pass # handled in __init__ via _backend.py
TF24plus = bool(float(tf.__version__[:3]) > 2.3)
def _kw_from_configs(configs, d... |
packages/python/setup.py | ufora/ufora | 571 | 12765846 | <filename>packages/python/setup.py<gh_stars>100-1000
# Copyright 2015 Ufora 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
#... |
generate_result.py | SeitaroShinagawa/chainer-partial_convolution_image_inpainting | 116 | 12765852 | <gh_stars>100-1000
#!/usr/bin/env python
import argparse
import os
import chainer
from chainer import training
from chainer import cuda, serializers
from chainer.training import extension
from chainer.training import extensions
import sys
import common.net as net
import datasets
from updater import *
from evaluation im... |
examples/issues/issue529_obj.py | tgolsson/appJar | 666 | 12765855 | <reponame>tgolsson/appJar
import sys
sys.path.append("../../")
from numpy import sin, pi, arange
from appJar import gui
from matplotlib.backends.backend_tkagg import NavigationToolbar2TkAgg as addToolbar
import random
from mpl_toolkits.mplot3d import Axes3D
with gui() as app:
fig = app.addPlotFig("p1", showNav=... |
alipay/aop/api/domain/StageGroupInfoVO.py | antopen/alipay-sdk-python-all | 213 | 12765950 | <filename>alipay/aop/api/domain/StageGroupInfoVO.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.StageCateInfoVO import StageCateInfoVO
class StageGroupInfoVO(object):
def __init__(self):
self._group_name = None... |
L1Trigger/L1THGCal/python/customTriggerCellSelect.py | Purva-Chaudhari/cmssw | 852 | 12765969 | <gh_stars>100-1000
import FWCore.ParameterSet.Config as cms
import SimCalorimetry.HGCalSimProducers.hgcalDigitizer_cfi as digiparam
from L1Trigger.L1THGCal.hgcalConcentratorProducer_cfi import threshold_conc_proc, best_conc_proc, supertc_conc_proc, coarsetc_onebitfraction_proc, coarsetc_equalshare_proc, bestchoice_ndat... |
deepchem/feat/molecule_featurizers/maccs_keys_fingerprint.py | deloragaskins/deepchem | 3,782 | 12765970 | <gh_stars>1000+
import numpy as np
from deepchem.utils.typing import RDKitMol
from deepchem.feat.base_classes import MolecularFeaturizer
class MACCSKeysFingerprint(MolecularFeaturizer):
"""MACCS Keys Fingerprint.
The MACCS (Molecular ACCess System) keys are one of the most commonly used structural keys.
Pleas... |
wg-manager-backend/script/wireguard_startup.py | SH-Daemon/wg-manager | 417 | 12765990 | import os
import typing
from sqlalchemy.orm import Session
import const
from database import models
from database.database import SessionLocal
from db.api_key import add_initial_api_key_for_admin
from db.wireguard import server_add_on_init
from script.wireguard import is_installed, start_interface, is_running, load_e... |
ChasingTrainFramework_GeneralOneClassDetection/data_provider_base/base_provider.py | dvt0101/A-Light-and-Fast-Face-Detector-for-Edge-Devices | 1,172 | 12765998 | """
This module takes an adapter as data supplier, pack data and provide data for data iterators
"""
class ProviderBaseclass(object):
"""
This is the baseclass of packer. Any other detailed packer must inherit this class.
"""
def __init__(self):
pass
def __str__(self):
return se... |
patch_rt_container_registry_repos/python/list_docker_repos.py | jfrog/log4j_tools | 170 | 12766004 | import sys
import requests
from urllib.parse import urljoin
JFROG_API_KEY_HEADER_NAME = 'X-JFrog-Art-Api'
class DockerRegistryPagination:
def __init__(self, concatenating_key):
self.concatenating_key = concatenating_key
def __call__(self, url, *args, **kwargs):
response = requests.get(url, *... |
tests/test_noncoap_tcp_client.py | mguc/aiocoap | 229 | 12766101 | # This file is part of the Python aiocoap library project.
#
# Copyright (c) 2012-2014 <NAME> <http://sixpinetrees.blogspot.com/>,
# 2013-2014 <NAME> <<EMAIL>>
#
# aiocoap is free software, this file is published under the MIT license as
# described in the accompanying LICENSE file.
"""Confront a CoAP ov... |
fexm/helpers/exceptions.py | fgsect/fexm | 105 | 12766124 | <filename>fexm/helpers/exceptions.py<gh_stars>100-1000
class CouldNotConfigureException(BaseException):
def __str__(self):
return "Could not configure the repository."
class NotABinaryExecutableException(BaseException):
def __str__(self):
return "The file given is not a binary executable"
cl... |
text_summarize/text_summarize.py | anshul2807/Automation-scripts | 496 | 12766160 | <filename>text_summarize/text_summarize.py
import argparse
from summarizer import Summarizer
def text_summarize(text, **kwargs):
"""
Summarize the given text. Returns the summarize
"""
model = Summarizer()
return model(text, **kwargs)
if __name__ == '__main__':
parser = argparse.ArgumentPars... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.