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 |
|---|---|---|---|---|
experiments/specialization/main.py | mit-han-lab/inter-operator-scheduler | 140 | 58633 | <filename>experiments/specialization/main.py
import json
import argparse
import numpy as np
import os
from ios.ir import Graph
from ios.visualizer import draw, draw_block
from ios.cost_model import IOSCostModel
argparser = argparse.ArgumentParser()
argparser.add_argument('--edir', type=str, required=True)
argparser.ad... |
data_managers/data_manager_diamond_database_builder/data_manager/data_manager_diamond_database_builder.py | supernord/tools-iuc | 142 | 58670 | #!/usr/bin/env python
import bz2
import gzip
import json
import optparse
import os
import shutil
import subprocess
import sys
import tarfile
import tempfile
import urllib.error
import urllib.parse
import urllib.request
import zipfile
from ftplib import FTP
CHUNK_SIZE = 2**20 # 1mb
def cleanup_before_exit(tmp_dir):
... |
deep-rl/lib/python2.7/site-packages/OpenGL/raw/GL/VERSION/GL_4_4.py | ShujaKhalid/deep-rl | 210 | 58707 | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_... |
tools/benchmark/asaga_spase_url.py | sumau/tick | 411 | 58715 | <filename>tools/benchmark/asaga_spase_url.py
import os
from tick.array.serialize import tick_double_sparse2d_from_file, \
tick_double_array_from_file
from tick.linear_model.model_logreg import ModelLogReg
from tick.prox.prox_elasticnet import ProxElasticNet
from tick.solver.saga import SAGA
# Create this dataset... |
Python/HelloWorld_Spanish.py | saurabhcommand/Hello-world | 1,428 | 58718 | print("Hola, el mundo!")
|
exercises/de/test_04_11_01.py | Jette16/spacy-course | 2,085 | 58760 | <gh_stars>1000+
def test():
assert (
len(TRAINING_DATA) == 3
), "Irgendetwas scheint mit deinen Daten nicht zu stimmen. Erwartet werden 3 Beispiele."
assert all(
len(entry) == 2 and isinstance(entry[1], dict) for entry in TRAINING_DATA
), "Die Trainingsdaten haben nicht das richtige Form... |
PWGJE/EMCALJetTasks/Tracks/analysis/plots/TriggerEfficiencyPlotMC.py | maroozm/AliPhysics | 114 | 58801 | <filename>PWGJE/EMCALJetTasks/Tracks/analysis/plots/TriggerEfficiencyPlotMC.py
#**************************************************************************
#* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
#* *
#* Author: Th... |
tests/physicalvalidation/physical_validation/data/gromacs_parser.py | hejamu/gromacs | 384 | 58812 | <reponame>hejamu/gromacs
###########################################################################
# #
# physical_validation, #
# a python package to test the physical validity of MD results ... |
wardroom/aws.py | jpweber/wardroom | 171 | 58893 | <reponame>jpweber/wardroom
import logging
import sys
import time
import boto3
import click
logger = logging.getLogger(name=__name__)
logger.setLevel(logging.INFO)
handler = logging.StreamHandler(sys.stderr)
logger.addHandler(handler)
yaml_template ='''
{}:
'64': {}
'''.strip('\r\n')
def copy_to_region(im... |
zeus/models/repository_api_token.py | conrad-kronos/zeus | 221 | 58930 | from zeus.config import db
from zeus.db.mixins import ApiTokenMixin, RepositoryMixin, StandardAttributes
from zeus.db.utils import model_repr
class RepositoryApiToken(StandardAttributes, RepositoryMixin, ApiTokenMixin, db.Model):
"""
An API token associated to a repository.
"""
__tablename__ = "repos... |
Installation/auxiliary/gdb/test-gdb.py | ffteja/cgal | 3,227 | 58935 | #!/usr/bin/python
# Copyright (c) 2011 GeometryFactory Sarl (France)
#
# $URL$
# $Id$
# SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
#
# Author(s) : <NAME>
import sys
import os
import gdb
sys.path.insert(0, os.getcwd() + '/python')
import CGAL.printers
|
bin/command/generate_dockerfile_command.py | oobeya-space/Dockerfile | 1,405 | 58936 | <reponame>oobeya-space/Dockerfile
#!/usr/bin/env/python
# -*- coding: utf-8 -*-
#
# (c) 2016 WebDevOps.io
#
# This file is part of Dockerfile Repository.
#
# 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 th... |
tests/python_ann_assign/ann_assign.py | hixio-mh/plugin-python | 362 | 58972 | <reponame>hixio-mh/plugin-python<gh_stars>100-1000
a: str
a: bool = True
my_long_var_aaaaaaaaaaaaaaaaaaaaaaaaaa: MyLongTypeAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
my_long_var_aaaaaaaaaaaaaaaaaaaaaaaaaa: MyLongTypeAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA = 1
|
simplesqlite/core.py | thombashi/SimpleSQLite | 126 | 59083 | <reponame>thombashi/SimpleSQLite
"""
.. codeauthor:: <NAME> <<EMAIL>>
"""
import logging
import os
import re
import sqlite3
from collections import OrderedDict, defaultdict
from sqlite3 import Connection, Cursor
from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union, cast
import pathvalidate
i... |
cloudtunes-server/cloudtunes/services/dropbox/models.py | skymemoryGit/cloudtunes | 529 | 59085 | <reponame>skymemoryGit/cloudtunes<gh_stars>100-1000
from mongoengine import StringField
from cloudtunes.base.models import EmbeddedDocument
from cloudtunes.services.models import ServiceAccount
class DropboxAccount(ServiceAccount):
country = StringField(max_length=2)
display_name = StringField()
oauth_to... |
fhir/resources/tests/test_bodystructure.py | cstoltze/fhir.resources | 144 | 59104 | # -*- coding: utf-8 -*-
"""
Profile: http://hl7.org/fhir/StructureDefinition/BodyStructure
Release: R4
Version: 4.0.1
Build ID: 9346c8cc45
Last updated: 2019-11-01T09:29:23.356+11:00
"""
from pydantic.validators import bytes_validator # noqa: F401
from .. import fhirtypes # noqa: F401
from .. import bodystructure
... |
spec/fixtures/semgrep/trivial.py | hstocks/salus | 625 | 59130 | <filename>spec/fixtures/semgrep/trivial.py
# https://semgrep.live/DdG
if 3 == 3:
print('3!') |
l10n_br_sale/models/delivery_carrier.py | kaoecoito/odoo-brasil | 181 | 59148 | <reponame>kaoecoito/odoo-brasil<filename>l10n_br_sale/models/delivery_carrier.py
from odoo import fields, models
class DeliveryCarrier(models.Model):
_inherit = 'delivery.carrier'
partner_id = fields.Many2one('res.partner', string='Transportadora')
|
crosshair/libimpl/randomlib_test.py | samuelchassot/CrossHair | 785 | 59155 | <reponame>samuelchassot/CrossHair<gh_stars>100-1000
import copy
import random
from crosshair.core_and_libs import proxy_for_type, standalone_statespace
from crosshair.libimpl.randomlib import ExplicitRandom
def test_ExplicitRandom():
rng = ExplicitRandom([1, 2])
assert rng.randrange(0, 10) == 1
assert rn... |
openbook_posts/migrations/0031_postcomment_parent_comment.py | TamaraAbells/okuna-api | 164 | 59160 | <gh_stars>100-1000
# Generated by Django 2.2 on 2019-05-02 17:34
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('openbook_posts', '0030_post_is_closed'),
]
operations = [
migrations.AddField(
... |
tests/test_verilog/test_2d_array.py | leonardt/magma | 167 | 59180 | import magma as m
import magma.testing
def test_2d_array_from_verilog():
main = m.define_from_verilog(f"""
module transpose_buffer (
input logic clk,
output logic [2:0] index_inner,
output logic [2:0] index_outer,
input logic [3:0] input_data [63:0],
input logic [2:0] range_inner,
input logic [2:0] ra... |
14Django/day01/BookManager/instruction01.py | HaoZhang95/PythonAndMachineLearning | 937 | 59187 | # MVT设计模式,model-view-template
# model负责和数据库交互来获取model数据
# view相当于MVC中的Controller负责处理网络请求http response
# template相当于MVC中的View负责封装html,css,js等内置模板引擎
# 具体流程:客户端发出网页请求 --> View接受网络请求 --> 找mdel去数据库找数据 -->找回的model数据返回给view
# --> view可以直接返回无修饰的model原始数据给客户端 --> 或者找template去美化数据,添加css,html等,动态生成一个html文件返回给View
# --> View将动态生成... |
unittest/scripts/py_devapi/validation/mysqlx_constants.py | mueller/mysql-shell | 119 | 59191 | <reponame>mueller/mysql-shell
#@ mysqlx type constants
|Type.BIT: <Type.BIT>|
|Type.TINYINT: <Type.TINYINT>|
|Type.SMALLINT: <Type.SMALLINT>|
|Type.MEDIUMINT: <Type.MEDIUMINT>|
|Type.INT: <Type.INT>|
|Type.BIGINT: <Type.BIGINT>|
|Type.FLOAT: <Type.FLOAT>|
|Type.DECIMAL: <Type.DECIMAL>|
|Type.DOUBLE: <Type.DOUBLE>|
|Typ... |
ch26-Hough圆环变换/HoughCircles_camera.py | makelove/OpenCV-Python-Tutorial | 2,875 | 59240 | # -*- coding: utf-8 -*-
# @Time : 2017/7/27 13:47
# @Author : play4fun
# @File : HoughCircles_camera.py
# @Software: PyCharm
"""
HoughCircles_camera.py:
用围棋-棋子来测试
"""
import cv2
import numpy as np
from skimage.measure import compare_mse as mse
import string, random
def id_generator(size=6, chars=string.asci... |
piqa/lpips.py | charltongroves/piqa | 205 | 59256 | <filename>piqa/lpips.py
r"""Learned Perceptual Image Patch Similarity (LPIPS)
This module implements the LPIPS in PyTorch.
Credits:
Inspired by [lpips-pytorch](https://github.com/S-aiueo32/lpips-pytorch)
References:
[1] The Unreasonable Effectiveness of Deep Features as a Perceptual Metric
(Zhang et al.,... |
crabageprediction/venv/Lib/site-packages/numpy/typing/tests/data/pass/arrayterator.py | 13rianlucero/CrabAgePrediction | 20,453 | 59317 |
from __future__ import annotations
from typing import Any
import numpy as np
AR_i8: np.ndarray[Any, np.dtype[np.int_]] = np.arange(10)
ar_iter = np.lib.Arrayterator(AR_i8)
ar_iter.var
ar_iter.buf_size
ar_iter.start
ar_iter.stop
ar_iter.step
ar_iter.shape
ar_iter.flat
ar_iter.__array__()
for i in ar_iter:
pass... |
tests/test_compatibility.py | AnandJyrm/allure-pytest | 112 | 59318 | <filename>tests/test_compatibility.py
"""
This module holds tests for compatibility with other py.test plugins.
Created on Apr 15, 2014
@author: pupssman
"""
from hamcrest import assert_that, contains, has_property
def test_maxfail(report_for):
"""
Check that maxfail generates proper report
"""
rep... |
qiskit/algorithms/optimizers/tnc.py | Roshan-Thomas/qiskit-terra | 1,599 | 59339 | <gh_stars>1000+
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifica... |
scripts/serial-stress-test.py | twopoint718/Amethyst | 260 | 59397 | #!/usr/bin/env python
import serial
import time
BAUD = 57600
with serial.Serial('/dev/cu.usbserial-DN05KLWU', BAUD) as port:
time.sleep(5.0)
n = 0
while True:
port.write(bytearray([n & 0xFF]))
n += 1
|
cflearn/models/cv/ssl/dino.py | carefree0910/carefree-learn | 400 | 59493 | import torch
import numpy as np
import torch.nn as nn
import torch.distributed as dist
import torch.nn.functional as F
from torch import Tensor
from typing import Any
from typing import Dict
from typing import Tuple
from typing import Optional
from cftool.misc import update_dict
from cftool.misc import shallow_copy_d... |
anuga/file_conversion/dem2array.py | samcom12/anuga_core | 136 | 59494 | from __future__ import absolute_import
# external modules
from past.builtins import basestring
import numpy as num
# ANUGA modules
import anuga.utilities.log as log
from anuga.config import netcdf_mode_r, netcdf_mode_w, netcdf_mode_a, \
netcdf_float
from .asc2dem import asc2dem
... |
browser_fingerprinting/bro_log_reader.py | dodoandbling/data_hacking | 475 | 59509 | <reponame>dodoandbling/data_hacking<filename>browser_fingerprinting/bro_log_reader.py
''' This module handles the mechanics around easily pulling in Bro Log data
The read_log method is a generator (in the python sense) for rows in a Bro log,
because of this, it's memory efficient and does not read the entire f... |
chapter-12/fees/app.py | wallacei/microservices-in-action-copy | 115 | 59550 | import datetime
import json
from nameko.events import EventDispatcher, event_handler
from simplebank.chassis import init_logger, init_statsd
class FeesService:
name = "fees_service"
statsd = init_statsd('simplebank-demo.fees', 'statsd')
logger = init_logger()
@event_handler("market_service", "order... |
python/iceberg/api/transforms/identity.py | moulimukherjee/incubator-iceberg | 2,161 | 59602 | # 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, Version 2.0 (the
# "License"); you may not u... |
plugins/comment_mem_access.py | bennofs/execution-trace-viewer | 186 | 59640 | """This plugin finds every memory access and comments the row with address and value"""
from yapsy.IPlugin import IPlugin
from core.api import Api
class PluginCommentMemAccesses(IPlugin):
def execute(self, api: Api):
want_to_continue = api.ask_user(
"Warning", "This plugin may replace some o... |
datasets/coco_eval_proposals.py | StephenStorm/DETReg | 212 | 59734 | # pip install pycocotools opencv-python opencv-contrib-python
# wget https://github.com/opencv/opencv_extra/raw/master/testdata/cv/ximgproc/model.yml.gz
import os
import copy
import time
import argparse
import contextlib
import multiprocessing
import numpy as np
import cv2
import cv2.ximgproc
import matplotlib.patc... |
names_dataset/__init__.py | nischal-sanil/name-dataset | 478 | 59750 | <filename>names_dataset/__init__.py
from names_dataset.nd_v1 import NameDatasetV1 # noqa
from names_dataset.nd_v2 import NameDataset # noqa
|
apps/interface/business/interfacemodule.py | rainydaygit/testtcloudserver | 349 | 59776 | from flask import g, current_app, jsonify
from sqlalchemy import asc, desc, func
from apps.interface.models.interfaceapimsg import InterfaceApiMsg
from apps.interface.models.interfacecase import InterfaceCase
from apps.interface.models.interfacemodule import InterfaceModule
from apps.interface.models.interfaceproject ... |
data_readers/kitti.py | xingruiy/RAFT-3D | 133 | 59784 |
import numpy as np
import torch
import torch.utils.data as data
import torch.nn.functional as F
import os
import cv2
import math
import random
import json
import csv
import pickle
import os.path as osp
from glob import glob
import raft3d.projective_ops as pops
from . import frame_utils
from .augmentation import RGB... |
tests/test_content_api.py | tzengwei/fastapi-sqlmodel-typer | 123 | 59810 | <reponame>tzengwei/fastapi-sqlmodel-typer
def test_content_create(api_client_authenticated):
response = api_client_authenticated.post(
"/content/",
json={
"title": "hello test",
"text": "this is just a test",
"published": True,
"tags": ["test", "hello"... |
nautobot/extras/migrations/0011_fileattachment_fileproxy.py | psmware-ltd/nautobot | 384 | 59828 | # Generated by Django 3.1.13 on 2021-07-16 21:44
from django.db import migrations, models
import nautobot.extras.models.models
import uuid
class Migration(migrations.Migration):
dependencies = [
("extras", "0010_change_cf_validation_max_min_field_to_bigint"),
]
operations = [
migrations... |
koku/masu/database/provider_auth_db_accessor.py | rubik-ai/koku | 157 | 59831 | <gh_stars>100-1000
#
# Copyright 2021 Red Hat Inc.
# SPDX-License-Identifier: Apache-2.0
#
"""Accessor for Provider Authentication from koku database."""
from api.provider.models import ProviderAuthentication
from masu.database.koku_database_access import KokuDBAccess
class ProviderAuthDBAccessor(KokuDBAccess):
"... |
lite/tests/unittest_py/pass/test_elementwise_scale_fuse_pass.py | 714627034/Paddle-Lite | 808 | 59840 | # 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... |
Data_Structures/Tree/Binary_Search_Tree/Binary_Search_Tree.py | pranjalkumar153/algo_ds_101 | 182 | 59886 | <reponame>pranjalkumar153/algo_ds_101
# Binary Search Tree (BST) Implementation
class BSTNode:
def __init__(selfNode, nodeData): # Node Structure
selfNode.nodeData = nodeData
selfNode.left = None
selfNode.right = None
selfNode.parent = None
# Insertion Operation
def insert(se... |
factory-ai-vision/EdgeSolution/modules/WebModule/backend/vision_on_edge/azure_training_status/signals.py | kaka-lin/azure-intelligent-edge-patterns | 176 | 59899 | """App signals.
"""
import logging
from django.db.models.signals import post_save
from django.dispatch import receiver
from ..azure_projects.models import Project
from .models import TrainingStatus
logger = logging.getLogger(__name__)
@receiver(
signal=post_save,
sender=Project,
dispatch_uid="training... |
backend/breach/urls.py | Cancelll/rupture | 184 | 59960 | <gh_stars>100-1000
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^get_work/(?P<victim_id>\d+)$', views.get_work, name='get_work'),
url(r'^get_work$', views.get_work, name='get_work'),
url(r'^work_completed/(?P<victim_id>\d+)$', views.work_completed, name='work_completed'),
... |
invoice/tests.py | Chris7/django-invoice | 139 | 60020 | <reponame>Chris7/django-invoice<filename>invoice/tests.py
import datetime
from django.test import TestCase
from django.contrib.auth.models import User
from addressbook.models import Address, Country
from .models import Invoice
class InvoiceTestCase(TestCase):
def setUp(self):
usr = User.objects.create(u... |
Dynamic Programming/Egg Dropping Puzzle/eggDrop.py | muthusk07/cs-algorithms | 239 | 60035 | #A Dynamic Programming based Python Program for the Egg Dropping Puzzle
import sys
# Function to get minimum number of trials
# needed in worst case with n eggs and k floors
def eggDrop(n, k):
# If there are no floors, then no trials needed. If there is one floor, one trial needed.
if (k == 0 or ... |
testData/regex/otherFunc.py | alek-sun/pydantic-pycharm-plugin | 238 | 60058 | from pydantic import BaseModel, constr
def other_func(regex):
pass
class Model(BaseModel):
abc: str = other_func(regex='<caret>[^a-zA-Z]+')
|
testing/tests/001-main/005-unittests/002-api/008-branch.py | fekblom/critic | 216 | 60073 | <gh_stars>100-1000
# @dependency 001-main/002-createrepository.py
SHA1 = "66f25ae79dcc5e200b136388771b5924a1b5ae56"
with repository.workcopy() as work:
REMOTE_URL = instance.repository_url("alice")
work.run(["checkout", "-b", "008-branch", SHA1])
work.run(["rebase", "--force-rebase", "HEAD~5"])
work.... |
Scatter/scatter_multi_dimension.py | pyecharts/pyecharts_gallery | 759 | 60098 | from pyecharts import options as opts
from pyecharts.charts import Scatter
from pyecharts.commons.utils import JsCode
from pyecharts.faker import Faker
c = (
Scatter()
.add_xaxis(Faker.choose())
.add_yaxis(
"商家A",
[list(z) for z in zip(Faker.values(), Faker.choose())],
label_opts=op... |
src/test/tests/databases/h5part.py | visit-dav/vis | 226 | 60109 | # ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: h5part.py
#
# Programmer: <NAME>
# Date: January, 2009
#
# Modifications:
# <NAME>, Wed Jan 21 09:36:13 PST 2009
# Took Gunther's original code and integrated it with test suite.
#
# ----... |
models/spach/spach.py | ritwikraha/SPACH | 104 | 60160 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from functools import partial
import torch
from torch import nn
from timm.models.layers import DropPath
from einops.layers.torch import Reduce
from .layers import DWConv, SPATIAL_FUNC, ChannelMLP, STEM_LAYER
from .misc import reshape2n... |
tests/nn/data_parallel/test_fsdp_grad_scaler.py | zhaojuanmao/fairscale | 1,662 | 60197 | <reponame>zhaojuanmao/fairscale
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
#
# This source code is licensed under the BSD license found in the
# LICENSE file in the root directory of this source tree.
# pylint: disable=missing-module-docstring
# pylint: disable=missing-class-docstring
# py... |
veles/external/freetype/ft_enums/ft_encodings.py | AkshayJainG/veles | 1,007 | 60208 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
#
# FreeType high-level python API - Copyright 2011-2012 <NAME>
# Distributed under the terms of the new BSD license.
#
# ----------------------------------------------------------------------... |
benchmarks/perf_tabletunnel.py | Emersonxuelinux/aliyun-odps-python-sdk | 412 | 60229 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2017 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENS... |
WebMirror/OutputFilters/util/feedNameLut.py | awesome-archive/ReadableWebProxy | 193 | 60257 |
import urllib.parse
import cachetools
from common import database as db
from sqlalchemy.orm import joinedload
FEED_LOOKUP_CACHE = cachetools.LRUCache(maxsize=200)
def patch_blogspot(innetloc):
assert isinstance(innetloc, str), "Expected str, recieved %s" % type(innetloc)
# Blogspot domains are coerced to ".co... |
fluent.docs/fluent/docs/__init__.py | shlomyb-di/python-fluent | 155 | 60262 | from pathlib import Path
from .build import DocBuilder
def finalize_builddir(repo_name):
'Bookkeeping on the docs build directory'
root = Path('_build') / repo_name
with open(root / '.nojekyll', 'w') as fh:
fh.write('')
def build_root(repo_name):
'''Build the top-level documentation.
Se... |
SimCalorimetry/EcalSimProducers/python/esEcalLiteDTUPedestalsProducer_cfi.py | ckamtsikis/cmssw | 852 | 60265 | <filename>SimCalorimetry/EcalSimProducers/python/esEcalLiteDTUPedestalsProducer_cfi.py
import FWCore.ParameterSet.Config as cms
EcalLiteDTUPedestalsRcd = cms.ESSource("EmptyESSource",
recordName = cms.string("EcalLiteDTUPedestalsRcd"),
firstValid = cms.v... |
examples/torch-starter/extract-coco-features.py | dapatil211/Jacinle | 114 | 60338 | <reponame>dapatil211/Jacinle
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# File : extract-coco-features.py
# Author : <NAME>
# Email : <EMAIL>
# Date : 11/27/2018
#
# This file is part of Jacinle.
# Distributed under terms of the MIT license.
"""
Extracing features from the MS-COCO dataset.
Examples:
jac-cru... |
test/tomography/test_gateset_tomography.py | paulineollitrault/qiskit-ignis | 182 | 60366 | # -*- coding: utf-8 -*-
#
# This code is part of Qiskit.
#
# (C) Copyright IBM 2019, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# An... |
tests/unit/lookups/handlers/test_env.py | avosper-intellaegis/runway | 134 | 60377 | """Tests for lookup handler for env."""
# pylint: disable=no-self-use
# pyright: basic
from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from runway.lookups.handlers.env import EnvLookup
if TYPE_CHECKING:
from ...factories import MockRunwayContext
ENV_VARS = {"str_val": "test"}
... |
websploit/modules/wifi_fap_spam.py | albiahbi/websploit | 803 | 60399 | <reponame>albiahbi/websploit
from scapy.all import *
from websploit.core import base
from threading import Thread
from websploit.core.utils import get_fake_mac, get_fake_name
conf.verb = 0
class Main(base.Module):
"""Spamming Fake access points """
parameters = {
"iface": "wlan0mon",
"count":... |
latest version/web/login.py | AzusaYukina/Arcaea-server | 162 | 60405 | #import sqlite3
from flask import (Blueprint, flash, g, redirect,
render_template, request, session, url_for)
import functools
from setting import Config
import hashlib
bp = Blueprint('login', __name__, url_prefix='/web')
@bp.route('/login', methods=('GET', 'POST'))
def login():
# 登录
if re... |
simple_rl/tasks/trench/TrenchOOMDPState.py | david-abel/mdps | 230 | 60412 | from simple_rl.mdp.oomdp.OOMDPStateClass import OOMDPState
class TrenchOOMDPState(OOMDPState):
''' Class for Trench World States '''
def __init__(self, objects):
OOMDPState.__init__(self, objects=objects)
def get_agent_x(self):
return self.objects["agent"][0]["x"]
def get_agent_y(sel... |
tests/schema/test_plot.py | vishalbelsare/FinMind | 1,106 | 60447 | <gh_stars>1000+
import os
import pytest
from FinMind.data import DataLoader
from FinMind.schema.plot import Labels, Series, convert_labels_series_schema
@pytest.fixture(scope="module")
def df():
user_id = os.environ.get("FINMIND_USER", "")
password = os.environ.get("FINMIND_PASSWORD", "")
data_loader = ... |
quokka/utils/custom_vars.py | songshansitulv/quokka | 1,141 | 60451 | <filename>quokka/utils/custom_vars.py
# coding: utf-8
from dynaconf.utils.parse_conf import parse_conf_data
def parse_data(data):
"""Return converted data from @int, @float, @bool, @json markers"""
return parse_conf_data(data)
def custom_var_dict(cvarlist):
cvarlist = cvarlist or []
return {
... |
test/nodes/test_accumulate.py | HerySon/timeflux | 123 | 60461 | <reponame>HerySon/timeflux
"""Tests for accumulate.py"""
import pandas as pd
import xarray as xr
from timeflux.helpers.testing import DummyData, DummyXArray
from timeflux.nodes.accumulate import AppendDataFrame, AppendDataArray
xarray_data = DummyXArray()
pandas_data = DummyData()
def test_append_dataframe():
""... |
__init__.py | nickm324/sensor.rpi_power | 297 | 60519 | """Raspberry Pi Power Supply Checker""" |
Misc/jython_checker.py | jeff5/jython-whinchat | 577 | 60530 | <gh_stars>100-1000
import sys
def usage():
print 'Usage: jython jython_checker.py <module name created by make_checker>'
sys.exit(1)
if not len(sys.argv) == 2:
usage()
checker_name = sys.argv[1].split('.')[0]#pop off the .py if needed
try:
checker = __import__(checker_name)
except:
print 'No module... |
bcs-ui/backend/templatesets/legacy_apps/configuration/migrations/0015_auto_20171227_1502.py | laodiu/bk-bcs | 599 | 60650 | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... |
tests/test_element.py | cgarjun/Pyno | 163 | 60658 | """Tests for pyno.element"""
pass
|
Chapter07/python/com/sparksamples/linearregression/LinearRegressionCrossValidationIterations.py | quguiliang/Machine-Learning-with-Spark-Second-Edition | 112 | 60670 | <reponame>quguiliang/Machine-Learning-with-Spark-Second-Edition
import os
import sys
import pylab as P
import matplotlib
import matplotlib.pyplot as plt
from com.sparksamples.util import evaluate
from com.sparksamples.linearregression.LinearRegressionUtil import get_train_test_data
try:
from pyspark import Spar... |
nlpcda/tools/Equivalent_char.py | blmoistawinde/nlpcda | 959 | 60713 | <reponame>blmoistawinde/nlpcda<filename>nlpcda/tools/Equivalent_char.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
from nlpcda.tools.Basetool import Basetool
from nlpcda.config import Equivalent_char_path
class EquivalentChar(Basetool):
'''
等价字,用于随机替换等价字,【字级别的】,增强数据
'''
def __init__(self, base_file=... |
forms.py | deeplook/slackipy | 103 | 60746 | <filename>forms.py<gh_stars>100-1000
from flask_wtf import Form
from wtforms import validators
from wtforms.fields.html5 import EmailField
class InviteForm(Form):
email = EmailField('Email Address',
[validators.DataRequired(), validators.Email()])
|
mongodb/mongodb_consistent_backup/official/mongodb_consistent_backup/Upload/Rsync/Rsync.py | smthkissinger/docker-images | 282 | 60777 | import os
import logging
import re
from copy_reg import pickle
from multiprocessing import Pool
from subprocess import check_output
from types import MethodType
from RsyncUploadThread import RsyncUploadThread
from mongodb_consistent_backup.Common import config_to_string
from mongodb_consistent_backup.Errors import O... |
src/pyinfraboxutils/db.py | agu3rra/InfraBox | 265 | 60782 | import time
import os
import psycopg2
import psycopg2.extras
from pyinfraboxutils import get_logger
logger = get_logger('infrabox')
def connect_db():
while True:
try:
conn = psycopg2.connect(dbname=os.environ['INFRABOX_DATABASE_DB'],
user=os.environ['INFRABO... |
pclib/rtl/onehot_test.py | belang/pymtl | 206 | 60787 | #==============================================================================
# ConfigManger_test.py
#==============================================================================
from pymtl import *
from pclib.test import TestVectorSimulator
from onehot import Mux, Demux
#--------------------------------... |
static/paddlex_restful/restful/project/visualize.py | cheneyveron/PaddleX | 3,655 | 60788 | # copytrue (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# 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... |
parsifal/apps/invites/migrations/0002_alter_invite_invitee_email.py | ShivamPytho/parsifal | 342 | 60826 | # Generated by Django 3.2.7 on 2021-09-08 00:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('invites', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='invite',
name='invitee_email',
... |
test/test_parameters.py | DLPerf/tensorforce | 1,132 | 60829 | <filename>test/test_parameters.py<gh_stars>1000+
# Copyright 2020 Tensorforce Team. 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... |
pydlm/predict/_dlmPredict.py | onnheimm/pydlm | 423 | 60840 | """
===============================================================================
The code for all predicting methods
===============================================================================
"""
from pydlm.core._dlm import _dlm
class _dlmPredict(_dlm):
""" The main class containing all prediction met... |
blinkpy/helpers/__init__.py | magicalyak/blinkpy | 272 | 60875 | """Init file for blinkpy helper functions."""
|
preprocess/__init__.py | federicozaiter/LogClass | 159 | 60896 | <reponame>federicozaiter/LogClass<gh_stars>100-1000
__all__ = [
"bgl_preprocessor",
"open_source_logs",
]
|
setup.py | jpic/django-nested-admin | 580 | 60899 | <gh_stars>100-1000
#!/usr/bin/env python
import re
import os.path
try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
# Find the package version in __init__.py without importing it
# (whi... |
sfaira/unit_tests/data_for_tests/loaders/consts.py | theislab/sfaira | 110 | 60922 | <filename>sfaira/unit_tests/data_for_tests/loaders/consts.py<gh_stars>100-1000
ASSEMBLY_HUMAN = "Homo_sapiens.GRCh38.104"
ASSEMBLY_MOUSE = "Mus_musculus.GRCm39.104"
CELLTYPES = ["adventitial cell", "endothelial cell", "acinar cell", "pancreatic PP cell", "type B pancreatic cell"]
CL_VERSION = "v2021-08-10"
|
en_transformer/__init__.py | dumpmemory/En-transformer | 108 | 60935 | from en_transformer.en_transformer import EquivariantAttention, EnTransformer
|
tests/test_perf_counters.py | gglin001/poptorch | 128 | 60959 | <reponame>gglin001/poptorch
# Copyright (c) 2021 Graphcore Ltd. All rights reserved.
import torch
import pytest
import poptorch
import helpers
class Model(torch.nn.Module):
def forward(self, x, y):
return torch.matmul(x, y)
def assert_perf_counter_size(perf, inputs, outputs, steps, outsteps=None):
d... |
scripts/rct_to_text.py | tomhoper/scibert | 1,143 | 60962 | <reponame>tomhoper/scibert
"""
Script to convert Pubmed RCT dataset to textual format for sent classification
"""
import jsonlines
import click
import pathlib
@click.command()
@click.argument('inpath')
@click.argument('outpath')
def convert(inpath, outpath):
pathlib.Path(outpath).parent.mkdir(parents=True, exist... |
testcase/test_case_4_QuickdrawDataset4dict_random_attention_mask.py | Team-Squad-Up/multigraph_transformer | 268 | 60992 | <reponame>Team-Squad-Up/multigraph_transformer<filename>testcase/test_case_4_QuickdrawDataset4dict_random_attention_mask.py
import numpy as np
def produce_adjacent_matrix_random(stroke_length, conn=0.15):
attention_mask = np.random.choice(a=[0, 1], size=[7, 7], p=[conn, 1-conn])
attention_mask[stroke_len... |
bin/measure_interface.py | fchapoton/CrisisMappingToolkit | 178 | 61011 | # -----------------------------------------------------------------------------
# Copyright * 2014, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration. All
# rights reserved.
#
# The Crisis Mapping Toolkit (CMT) v1 platform is licensed under the Apache
#... |
run_proto_exp.py | renmengye/inc-few-shot-attractor-public | 122 | 61025 | <reponame>renmengye/inc-few-shot-attractor-public
"""Runs a baseline for prototype networks for incremental few-shot learning.
Author: <NAME> (<EMAIL>)
See run_exp.py for usage.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import numpy as np
import... |
plot_parametric_plot.py | vinnamkim/large-batch-training | 122 | 61046 | <filename>plot_parametric_plot.py<gh_stars>100-1000
'''
Train CNNs on the CIFAR10/CIFAR100
Plots a parametric plot between SB and LB
minimizers demonstrating the relative sharpness
of the two minima.
Requirements:
- Keras (with Theano)
- Matplotlib
- Numpy
GPU run command:
KERAS_BACKEND=theano python plot_paramet... |
tensorflow_graphics/math/tests/feature_representation_test.py | Liang813/graphics | 2,759 | 61049 | <reponame>Liang813/graphics
# Copyright 2020 The TensorFlow 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... |
applications/DEMApplication/tests/test_DEM_search_tolerance.py | lkusch/Kratos | 778 | 61073 | import os
import KratosMultiphysics
from KratosMultiphysics import Logger
Logger.GetDefaultOutput().SetSeverity(Logger.Severity.WARNING)
import KratosMultiphysics.KratosUnittest as KratosUnittest
import KratosMultiphysics.DEMApplication.DEM_analysis_stage
import numpy as np
import auxiliary_functions_for_tests
this_w... |
mmdet/core/bbox/assigners/__init__.py | yanglinGEM/ReDet | 270 | 61107 | from .base_assigner import BaseAssigner
from .max_iou_assigner import MaxIoUAssigner
from .approx_max_iou_assigner import ApproxMaxIoUAssigner
from .assign_result import AssignResult
from .max_iou_assigner_hbb_cy import MaxIoUAssignerCy
from .max_iou_assigner_rbbox import MaxIoUAssignerRbbox
from .approx_max_iou_assign... |
soccer3d/instancesegm/utils.py | ngerstle/soccerontable | 465 | 61114 | import numpy as np
import scipy
import cv2
def get_pixel_neighbors(height, width):
"""
Estimate the 4 neighbors of every pixel in an image
:param height: image height
:param width: image width
:return: pixel index - neighbor index lists
"""
pix_id = []
neighbor_id = []
for i in ra... |
src/einsteinpy/geodesic/geodesic.py | epsilonethan/einsteinpy | 485 | 61138 | import warnings
import numpy as np
from einsteinpy.integrators import GeodesicIntegrator
from .utils import _P, _kerr, _kerrnewman, _sch
class Geodesic:
"""
Base Class for defining Geodesics
Working in Geometrized Units (M-Units),
with :math:`c = G = M = k_e = 1`
"""
def __init__(
... |
components/isceobj/Orbit/PRC.py | vincentschut/isce2 | 1,133 | 61155 | <reponame>vincentschut/isce2
import os
import logging
import datetime
from isceobj.Orbit.Orbit import Orbit
from isceobj.Orbit.Orbit import StateVector
from isceobj.Util.decorators import type_check, logged, pickled
class PRC(object):
"""A class to parse orbit data from D-PAF"""
logging_name = "isce.orbit.PRC... |
authx/middleware/__init__.py | theoohoho/authx | 141 | 61179 | <gh_stars>100-1000
from authx.middleware.Oauth2 import MiddlewareOauth2
__all__ = ["MiddlewareOauth2"]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.