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 |
|---|---|---|---|---|
emerge.py | kargaranamir/emerge | 142 | 12709362 | <filename>emerge.py<gh_stars>100-1000
"""
Simple wrapper to start emerge as a standalone tool.
"""
# Authors: <NAME> <<EMAIL>>
# License: MIT
from emerge.appear import Emerge
def run():
emerge = Emerge()
emerge.start()
if __name__ == "__main__":
run()
|
tests/transformers/convert_doc_test.py | elifesciences/sciencebeam | 272 | 12709385 | <reponame>elifesciences/sciencebeam<filename>tests/transformers/convert_doc_test.py
import logging
from configparser import ConfigParser
from pathlib import Path
from unittest.mock import patch, MagicMock
import pytest
from sciencebeam.utils.mime_type_constants import MimeTypes
from sciencebeam.transformers import c... |
guild/tests/samples/projects/autocomplete/echo.py | dwolfschlaeger/guildai | 694 | 12709393 | <reponame>dwolfschlaeger/guildai<filename>guild/tests/samples/projects/autocomplete/echo.py
msg = None
if msg:
print(msg)
|
dojo/unittests/tools/test_eslint_parser.py | axelpavageau/django-DefectDojo | 1,772 | 12709407 | <gh_stars>1000+
from django.test import TestCase
from dojo.tools.eslint.parser import ESLintParser
from dojo.models import Test
class TestESLintParser(TestCase):
def test_parse_file_has_two_findings(self):
testfile = open("dojo/unittests/scans/eslint/scan.json")
parser = ESLintParser()
fin... |
androguard/core/bytecodes/axml/types.py | amimo/androguard | 4,084 | 12709418 | # Type definiton for (type, data) tuples representing a value
# See http://androidxref.com/9.0.0_r3/xref/frameworks/base/libs/androidfw/include/androidfw/ResourceTypes.h#262
# The 'data' is either 0 or 1, specifying this resource is either
# undefined or empty, respectively.
TYPE_NULL = 0x00
# The 'data' holds a ResTa... |
simba/dpk_script/annotator.py | justinshenk/simba | 172 | 12709423 | <filename>simba/dpk_script/annotator.py<gh_stars>100-1000
import warnings
warnings.filterwarnings('ignore',category=FutureWarning)
from deepposekit import Annotator
import cv2
import numpy as np
import warnings
from configparser import ConfigParser
import os
warnings.filterwarnings('ignore')
def dpkAnnotat... |
examples/devices/xor-multidevice.py | ruyimarone/dynet | 3,307 | 12709469 | <gh_stars>1000+
# Usage:
# python xor-multidevice.py --dynet-devices CPU,GPU:0,GPU:1
# or python xor-multidevice.py --dynet-gpus 2
import sys
import dynet as dy
#xsent = True
xsent = False
HIDDEN_SIZE = 8
ITERATIONS = 2000
m = dy.Model()
trainer = dy.SimpleSGDTrainer(m)
pW1 = m.add_parameters((HIDDEN_SIZE, 2), ... |
databuilder/databuilder/models/query/base.py | defendercrypt/amundsen | 2,072 | 12709494 | # Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
from typing import Iterator
from databuilder.models.graph_serializable import GraphSerializable
class QueryBase(GraphSerializable):
@staticmethod
def _normalize(sql: str) -> str:
"""
Normalizes a SQL quer... |
recipes/Python/578359_Media_File_Renamer/recipe-578359.py | tdiprima/code | 2,023 | 12709500 | import os
import sys
# NOTE
# ====
# Renaming should happen in groups based on extention.
# All files should first be renamed with a unique ID.
################################################################################
ERR = False
ALL = ''.join(map(chr, xrange(256)))
NUM = '0123456789'
LET = ALL.translate(ALL,... |
torchaudio/models/deepspeech.py | popcornell/audio | 1,718 | 12709505 | <gh_stars>1000+
import torch
__all__ = ["DeepSpeech"]
class FullyConnected(torch.nn.Module):
"""
Args:
n_feature: Number of input features
n_hidden: Internal hidden unit size.
"""
def __init__(self, n_feature: int, n_hidden: int, dropout: float, relu_max_clip: int = 20) -> None:
... |
luna/gateware/platform/lambdaconcept.py | modwizcode/luna | 609 | 12709516 | #
# This file is part of LUNA.
#
# Copyright (c) 2020 <NAME> <<EMAIL>>
# SPDX-License-Identifier: BSD-3-Clause
""" LambdaConcept board platform definitions.
This is a non-core platform. To use it, you'll need to set your LUNA_PLATFORM variable:
> export LUNA_PLATFORM="luna.gateware.platform.lambdaconcept:USB2Sni... |
mx_mg/models/__init__.py | CheminfoPKU/molecule_generator | 127 | 12709525 | from .networks import *
from .functions import * |
python/phonenumbers/shortdata/region_NE.py | rodgar-nvkz/python-phonenumbers | 2,424 | 12709533 | <reponame>rodgar-nvkz/python-phonenumbers
"""Auto-generated file, do not edit by hand. NE metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_NE = PhoneMetadata(id='NE', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_patter... |
chapter15/cache_aside/cache_aside.py | JoeanAmiee/Mastering-Python-Design-Patterns-Second-Edition | 278 | 12709568 | <filename>chapter15/cache_aside/cache_aside.py
import sys
import sqlite3
import csv
cache_key_prefix = "quote"
class QuoteCache:
def __init__(self, filename=""):
self.filename = filename
def get(self, key):
with open(self.filename) as csv_file:
items = csv.reader(csv_file, delim... |
rethinkdb/datadog_checks/rethinkdb/config.py | vbarbaresi/integrations-core | 663 | 12709571 | # (C) Datadog, Inc. 2020-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from typing import List, Optional
from datadog_checks.base import ConfigurationError
from .types import Instance
class Config(object):
"""
Hold instance configuration for a RethinkDB check.
... |
tools/gemini/test-data/util/shrink_simple_tab.py | ic4f/tools-iuc | 142 | 12709596 | <reponame>ic4f/tools-iuc
from __future__ import print_function
import argparse
from functools import partial
def keep_line(line, pos_cols, region):
fields = line.rstrip().split(b'\t')
if fields[pos_cols[0]] == region[0]: # same chromosome
if (
region[1] < int(fields[pos_cols[1]]) < regio... |
jixianjiancha/models.py | zx273983653/vulscan | 582 | 12709628 | <reponame>zx273983653/vulscan
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
import sys
reload(sys)
sys.setdefaultencoding('utf8')
# Create your models here.
class BaseCheck(models.Model):
vid=models.IntegerField(primary_key=True) #主键
ip=models.CharField(max_lengt... |
disentanglement_lib/methods/shared/optimizers_test.py | travers-rhodes/disentanglement_lib | 1,280 | 12709642 | # coding=utf-8
# Copyright 2018 The DisentanglementLib 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
#
# Un... |
sanic_jwt/base.py | jekel/sanic-jwt | 226 | 12709662 | <reponame>jekel/sanic-jwt
class BaseDerivative:
def __init__(self, config, instance, *args, **kwargs):
self.config = config
self.instance = instance
|
robustnessgym/report/report.py | jessevig/robustness-gym | 399 | 12709670 | from __future__ import annotations
import itertools
from functools import partial
from typing import Dict, List
import dill
import numpy as np
import pandas as pd
import plotly.figure_factory as ff
import plotly.graph_objects as go
from plotly.graph_objs import Figure
from plotly.subplots import make_subplots
class... |
logparser/MoLFI/__init__.py | CUHK-CSE/logalizer | 859 | 12709672 | <reponame>CUHK-CSE/logalizer
from .MoLFI import * |
dataviva/apps/wizard/sessions.py | joelvisroman/dataviva-site | 126 | 12709719 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
class Question:
def __init__(self, title, selectors, redirect):
self.title = title
self.selectors = selectors
self.redirect = redirect
@property
def serialize(self):
return {
"title": self.title,
"selector... |
fooltrader/proxy/__init__.py | beaquant/fooltrader | 1,103 | 12709737 | <filename>fooltrader/proxy/__init__.py
# -*- coding: utf-8 -*-
import os
import pandas as pd
from fooltrader import settings
# 获取存档的代理列表
def get_proxy_dir():
return os.path.join(settings.FOOLTRADER_STORE_PATH, "proxy")
def get_proxy_path(protocol='http'):
return os.path.join(get_proxy_dir(), "{}_proxy.c... |
uber_problems/problem_1.py | loftwah/Daily-Coding-Problem | 129 | 12709745 | <gh_stars>100-1000
""" This problem was asked by Uber.
Given an array of integers, return a new array such that each element at index i
of the new array is the product of all the numbers in the original array except
the one at i.For example, if our input was [1, 2, 3, 4, 5], the expected output
would be [120, 60, 40, 3... |
lanefinder.py | Gautam-J/NFS_v1 | 139 | 12709773 | import cv2
import time
import numpy as np
from grabscreen import grab_screen
from directkeys import PressKey, ReleaseKey
from directkeys import W, A, D
from countdown import CountDown
'''
Most of the code in this script was taken from Sentdex's Python plays GTA-V
'''
def roi(img, vertices):
mask = np.zeros_like(... |
tests/integrations/test_reviewer_views.py | theSage21/junction | 192 | 12709795 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
import pytest
from django.core.urlresolvers import reverse
from .. import factories as f
from . import helpers
pytestmark = pytest.mark.django_db
class TestReviewerViews:
def test_reviewer_private_comment(
self, settings, login, conferences, create_proposal
... |
test/IECore/CompoundVectorParameterTest.py | bradleyhenke/cortex | 386 | 12709831 | ##########################################################################
#
# Copyright (c) 2008-2010, Image Engine Design 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:
#
# * Redis... |
experimental/distribution.py | keshav47/cnn-facial-landmark | 630 | 12709866 | <gh_stars>100-1000
"""Draw the histgram of the pose distributions
Run it like this:
`python3 -m experimental.distribution.py`
Do not forget to set the dataset file path.
"""
import cv2
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from dataset import get_parsed_dataset
from experimental.p... |
rlbench/tasks/turn_tap.py | vonHartz/RLBench | 619 | 12709885 | <reponame>vonHartz/RLBench
from typing import List
from pyrep.objects.dummy import Dummy
from pyrep.objects.joint import Joint
from rlbench.backend.task import Task
from rlbench.backend.conditions import JointCondition
OPTIONS = ['left', 'right']
class TurnTap(Task):
def init_task(self) -> None:
self.le... |
backends/c-rocm/schedule/standard/algo_format.py | guoshzhao/antares | 132 | 12709956 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from tvm import te
def schedule_branch(attrs, output, prefix):
cfg, s = attrs.auto_config, attrs.scheduler
th_vals = [attrs.get_extent(x) for x in output.op.axis]
# Normal Schedule Plan
blocks = [te.thread_axis('blockIdx.x'), te.thread_... |
Decision Tree/DT_Classify/AnFany_Show_Tree.py | Jojoxiao/Machine-Learning-for-Beginner-by-Python3 | 397 | 12709959 | # -*- coding:utf-8 -*-
# &Author AnFany
# 自适应优化绘制决策树程序
# 绘制决策图主要包括四部分
# 1,确定每一个节点展示的内容(内部节点展示,节点名称,类别比例,分类特征,本节点的结果, 叶子节点没有分类特征的内容)
# 2,确定每一个节点的位置(垂直方向平均分配,水平方向按照这一层的节点个数平均分配)
# 3,确定节点之间的连线
# 4,展示连线的内容(分类规则以及分分割值)
# 5,内部节点,子节点以不用的颜色展示,对给出图例
# 根据所有节点的数据集、所有节点的结果、所有节点的规则、剪枝后代表着树的节点关系绘制树
from pylab im... |
kentsay/0001/add_num2img.py | saurabh896/python-1 | 3,976 | 12709969 | <reponame>saurabh896/python-1
"""
Question:
第 0000 题:将你的 QQ 头像(或者微博头像)右上角加上红色的数字,类似于微信未读信息数量那种提示效果。
"""
import sys
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
def add_number2img(image, number):
font = ImageFont.truetype("/Library/Fonts/Chalkduster.ttf", 28)
draw = ImageDraw.Draw(image)... |
page_parser/beautifulsoup/test_403.py | 2581676612/python | 112 | 12709992 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 17-7-25 下午3:17
# @Author : Tom.Lee
# @CopyRight : 2016-2017 OpenBridge by yihecloud
# @File : test_403.py
# @Product : PyCharm
import bs4
t403 = """
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<h1>403 ... |
test/run/t73.py | timmartin/skulpt | 2,671 | 12709999 | <gh_stars>1000+
xyzy = [100,101,102,103,104,105,106,107]
del xyzy
print xyzy
|
CondTools/Ecal/python/EcalTrivialAlignment_cfi.py | ckamtsikis/cmssw | 852 | 12710000 | <gh_stars>100-1000
import FWCore.ParameterSet.Config as cms
EcalTrivialConditionRetriever = cms.ESSource("EcalTrivialConditionRetriever",
producedEcalClusterLocalContCorrParameters = cms.untracked.bool(True),
producedEcalClusterCrackCorrParameters = cms.untracked.bool(True),
producedEcalClusterEnergyUncertaintyP... |
examples/tutorials/django/blog/views.py | psy-repos-rust/vagga | 1,974 | 12710008 | <reponame>psy-repos-rust/vagga<filename>examples/tutorials/django/blog/views.py
from django.views import generic
from .models import Article
class ArticleList(generic.ListView):
model = Article
paginate_by = 10
class ArticleDetail(generic.DetailView):
model = Article
|
boto3_type_annotations_with_docs/boto3_type_annotations/resource_groups/client.py | cowboygneox/boto3_type_annotations | 119 | 12710009 | <filename>boto3_type_annotations_with_docs/boto3_type_annotations/resource_groups/client.py<gh_stars>100-1000
from typing import Optional
from botocore.client import BaseClient
from typing import Dict
from botocore.paginate import Paginator
from botocore.waiter import Waiter
from typing import Union
from typing import ... |
imgreco/ocr/cnocr.py | HTLXMC/ArknightsAutoHelper | 1,035 | 12710017 | <filename>imgreco/ocr/cnocr.py
from cnocr import CnOcr
from .common import *
import cv2
import numpy as np
from functools import lru_cache
import logging
is_online = False
# OCR 过程是否需要网络
info = "cnocr"
@lru_cache()
def get_ocr(model_name='densenet-lite-fc'):
return CnOcr(name=f'imgreco-{model_name}', model_na... |
Desktop Application/Basic/Python/Graph-Traversing-Visualizer/Graph Traversing Visualizer.py | shivam-s16/Project-Guidance | 219 | 12710018 | <reponame>shivam-s16/Project-Guidance<filename>Desktop Application/Basic/Python/Graph-Traversing-Visualizer/Graph Traversing Visualizer.py
# Graph Traversing #
from tkinter import *
import time
class GraphTraversal:
def __init__(self, root):
self.window = root
... |
python/introduction/interchange.py | Sudhanshu-Srivastava/hackerrank-1 | 194 | 12710047 | #https://www.hackerrank.com/challenges/interchange-two-numbers
import fileinput
#Input
a, b = fileinput.input()
#Solve
a, b = (b, a)
#Output
print(a)
print(b) |
tools/Polygraphy/polygraphy/mod/__init__.py | KaliberAI/TensorRT | 5,249 | 12710074 | <filename>tools/Polygraphy/polygraphy/mod/__init__.py
from polygraphy.mod.importer import *
from polygraphy.mod.exporter import *
from polygraphy.mod.util import version
|
hfnet/evaluation/cpp_localization.py | maxtomCMU/hfnet | 555 | 12710078 | import numpy as np
import cv2
import logging
from .utils.localization import LocResult
class CppLocalization:
def __init__(self, db_ids, local_db, global_descriptors, images, points):
import _hloc_cpp
self.hloc = _hloc_cpp.HLoc()
id_to_idx = {}
old_to_new_kpt = {}
for idx... |
supriya/ugens/gendyn.py | butayama/supriya | 191 | 12710087 | <reponame>butayama/supriya<gh_stars>100-1000
import collections
from supriya import CalculationRate
from supriya.synthdefs import UGen
class Gendy1(UGen):
"""
A dynamic stochastic synthesis generator.
::
>>> gendy_1 = supriya.ugens.Gendy1.ar(
... adparam=1,
... ampdist=1... |
scripts/submit.py | andrewmzhang/displayadv | 120 | 12710120 | <filename>scripts/submit.py
'''
@author: <NAME>
'''
import pandas as pd
import sys
import numpy as np
import gzip
df = pd.read_csv(sys.stdin)
p = 0.55 * df.p1 + 0.15 * df.p2 + 0.15 * df.p3 + 0.15 * df.p4
df['Predicted'] = prob = 1.0 / (1.0 + np.exp(-p))
submission = 'submission.cvs.gz'
print('saving to', submission,... |
tests/py/test_privacy_json.py | kant/gratipay.com | 517 | 12710127 | from __future__ import print_function, unicode_literals
from aspen import json
from gratipay.testing import Harness
class Tests(Harness):
def setUp(self):
Harness.setUp(self)
self.make_participant('alice', claimed_time='now')
def hit_privacy(self, method='GET', expected_code=200, **kw):
... |
DPGAnalysis/Skims/python/EGPDSkim_cfg.py | ckamtsikis/cmssw | 852 | 12710142 | import FWCore.ParameterSet.Config as cms
process = cms.Process("SKIM")
process.configurationMetadata = cms.untracked.PSet(
version = cms.untracked.string('$Revision: 1.4 $'),
name = cms.untracked.string('$Source: /cvs/CMSSW/CMSSW/DPGAnalysis/Skims/python/EGPDSkim_cfg.py,v $'),
annotation = cms.untracked.s... |
examples/modify_header_example.py | pbsds/sanic | 1,883 | 12710159 | """
Modify header or status in response
"""
from sanic import Sanic, response
app = Sanic("Example")
@app.route("/")
def handle_request(request):
return response.json(
{"message": "Hello world!"},
headers={"X-Served-By": "sanic"},
status=200,
)
@app.route("/unauthorized")
def hand... |
configs/det/common/mstrain_3x_coco_panoptic.py | yinchimaoliang/K-Net | 361 | 12710175 | _base_ = '../_base_/default_runtime.py'
# dataset settings
dataset_type = 'CocoPanopticDataset'
data_root = 'data/coco/'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
# file_client_args = dict(backend='disk',)
# file_client_args = dict(
# backend='petrel',
# ... |
loader/transforms.py | mmendiet/gate-decorator-pruning | 158 | 12710220 | """
pytorch (0.3.1) miss some transforms, will be removed after official support.
"""
import torch
import numpy as np
from PIL import Image
import torchvision.transforms.functional as F
import torch.nn.functional as Func
import random
imagenet_pca = {
'eigval': np.asarray([0.2175, 0.0188, 0.0045]),
'eigvec': ... |
app/controllers/dns/zones.py | grepleria/SnitchDNS | 152 | 12710227 | <reponame>grepleria/SnitchDNS
from . import bp
from flask_login import current_user, login_required
from flask import render_template, redirect, url_for, flash, request, send_file
from app.lib.base.provider import Provider
@bp.route('/', methods=['GET'])
@login_required
def index():
results_per_page = 20
pro... |
flownmt/modules/priors/prior.py | DeNeutoy/flowseq | 256 | 12710258 | <reponame>DeNeutoy/flowseq
import math
from typing import Dict, Tuple, Union
import torch
import torch.nn as nn
from flownmt.flows.nmt import NMTFlow
from flownmt.modules.priors.length_predictors import LengthPredictor
class Prior(nn.Module):
"""
class for Prior with a NMTFlow inside
"""
_registry = ... |
courses/machine_learning/deepdive2/production_ml/labs/samples/contrib/azure-samples/databricks-pipelines/databricks_secretscope_pipeline.py | memeyankm/training-data-analyst | 6,140 | 12710313 | <filename>courses/machine_learning/deepdive2/production_ml/labs/samples/contrib/azure-samples/databricks-pipelines/databricks_secretscope_pipeline.py
"""Create a new secret scope in Databricks."""
import kfp.dsl as dsl
import kfp.compiler as compiler
import databricks
def create_secretscope(
scope_name,
... |
rest-service/manager_rest/rest/requests_schema.py | TS-at-WS/cloudify-manager | 124 | 12710324 | <gh_stars>100-1000
#########
# Copyright (c) 2013 GigaSpaces Technologies Ltd. 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/LIC... |
hearthbreaker/cards/minions/mage.py | souserge/hearthbreaker | 429 | 12710328 | <reponame>souserge/hearthbreaker<filename>hearthbreaker/cards/minions/mage.py
import hearthbreaker.cards
from hearthbreaker.cards.base import MinionCard
from hearthbreaker.constants import CHARACTER_CLASS, CARD_RARITY, MINION_TYPE
from hearthbreaker.game_objects import Minion
from hearthbreaker.tags.action import AddCa... |
src/python/nimbusml/preprocessing/normalization/minmaxscaler.py | michaelgsharp/NimbusML | 134 | 12710355 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# --------------------------------------------------------------------------------------------
# - Generated by tools/entrypoint_co... |
controller_manager_tests/test/cm_msgs_utils_rostest.py | matthew-reynolds/ros_control | 375 | 12710361 | #!/usr/bin/env python
# Copyright (C) 2014, PAL Robotics S.L.
#
# 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 above copyright notice,
# this list of conditions and the... |
rules/vulnerabilities/rule_front-page.py | TomasTorresB/nerve | 365 | 12710372 | <filename>rules/vulnerabilities/rule_front-page.py
from core.redis import rds
from core.triage import Triage
from core.parser import ScanParser
class Rule:
def __init__(self):
self.rule = 'VLN_65C8'
self.rule_severity = 2
self.rule_description = 'This rule checks for FrontPage configuration information ... |
cea/utilities/date.py | architecture-building-systems/cea-toolbox | 121 | 12710392 | <reponame>architecture-building-systems/cea-toolbox
import pandas as pd
from calendar import isleap
def get_date_range_hours_from_year(year):
"""
creates date range in hours for the year excluding leap day
:param year: year of date range
:type year: int
:return: pd.date_range with 8760 values
... |
vectorhub/encoders/audio/pytorch/__init__.py | boba-and-beer/vectorhub | 385 | 12710403 | <reponame>boba-and-beer/vectorhub
from .wav2vec import *
|
ocpmodels/models/gemnet/layers/interaction_block.py | Irlirion/ocp | 242 | 12710427 | """
Copyright (c) Facebook, Inc. and its affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""
import math
import torch
from .atom_update_block import AtomUpdateBlock
from .base_layers import Dense, ResidualLayer
from .efficient impor... |
path_import.py | 5A59/Zvm | 485 | 12710439 | <filename>path_import.py
# coding=utf-8
import sys
import os
sys.path.append([os.getcwd()])
|
akika_venv/lib/python3.6/site-packages/django_seo_js/middleware/__init__.py | laetitia123/akikatest | 183 | 12710456 | from .escaped_fragment import EscapedFragmentMiddleware
from .hashbang import HashBangMiddleware
from .useragent import UserAgentMiddleware
|
bark/examples/paths.py | mansoorcheema/bark | 174 | 12710459 | <gh_stars>100-1000
# Copyright (c) 2020 fortiss GmbH
#
# Authors: <NAME>, <NAME>, <NAME>,
# <NAME> and <NAME>
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
import os
from pathlib import Path
class Data:
#xodr data
_xodr_data = {}
#track ... |
tests/comparison/statement_generator.py | suifengzhuliu/impala | 1,523 | 12710500 | <reponame>suifengzhuliu/impala<filename>tests/comparison/statement_generator.py<gh_stars>1000+
# 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 lic... |
ztag/errors.py | justinbastress/ztag | 107 | 12710501 | <reponame>justinbastress/ztag
class InvalidTag(Exception):
pass
class IgnoreObject(Exception):
def __init__(self, original_exception=None, trback=None, *args, **kwargs):
super(Exception, self).__init__(*args, **kwargs)
self.original_exception = original_exception
self.trback = trback
... |
doc/util/disguise.py | jhh67/chapel | 1,602 | 12710517 | from docutils import nodes
def disguise_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
"""
Role to obfuscate e-mail addresses using DISGUISE comments.
"""
obfuscated = '<!-- DISGUISE -->'.join(list(text))
obfuscated = '<b>' + obfuscated
obfuscated = obfuscated + '</b>'
... |
share/lib/python/neuron/rxd/geometry3d/GeneralizedVoxelization.py | niltonlk/nrn | 203 | 12710548 | from . import graphicsPrimitives as graphics
from .. import options
def find_voxel(x, y, z, g):
"""returns (i,j,k) of voxel containing point x,y,z if the point is within
the grid, otherwise return the corresponding grid boundary.
"""
# g is grid boundaries
i = max(0, int((x - g["xlo"]) //... |
Attack/IncDS.py | YingtongDou/Nash-Detect | 103 | 12710554 | <reponame>YingtongDou/Nash-Detect
import copy
import time
"""
The implementation of the IncDS attack.
"""
def compute_density(user_product_graph, product_user_graph, c, t):
"""
Compute the density of controlled accounts according to their local structural density
"""
density = {}
# intialize the auxiliary gr... |
PlatformerPathfinding/test_level.py | gerardrbentley/TheVGLC | 147 | 12710583 | '''
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of... |
models/smpl_official.py | hwfan/STRAPS-3DHumanShapePose | 118 | 12710619 | import torch
import numpy as np
from smplx import SMPL as _SMPL
from smplx.body_models import ModelOutput
from smplx.lbs import vertices2joints
import config
class SMPL(_SMPL):
"""
Extension of the official SMPL (from the smplx python package) implementation to
support more joints.
"""
def __init... |
fuzzers/ECP5/101-dtr/fuzzer.py | Keno/prjtrellis | 256 | 12710642 | from fuzzconfig import FuzzConfig
import nonrouting
import pytrellis
import fuzzloops
import interconnect
cfg = FuzzConfig(job="DTR", family="ECP5", device="LFE5U-45F", ncl="empty.ncl",
tiles=["CIB_R71C22:DTR"])
def get_substs(mode="DTR"):
if mode == "NONE":
comm... |
qa/rpc-tests/pingearly.py | MONIMAKER365/BitcoinUnlimited | 535 | 12710669 | #!/usr/bin/env python3
# Copyright (c) 2015-2018 The Bitcoin Unlimited developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import test_framework.loginit
import os
import os.path
import time
import sys
if sys.version_info[0] ... |
TradzQAI/tools/indicators/build_indicators.py | kkuette/AI_project | 164 | 12710674 | <reponame>kkuette/AI_project
import pandas as pd
from .exponential_moving_average import exponential_moving_average as ema
from .volatility import volatility as vol
from .stochastic import percent_k as K
from .stochastic import percent_d as D
from .relative_strength_index import relative_strength_index as RSI
from .mo... |
modules/dbnd-airflow/test_dbnd_airflow/airflow_home/dag_gcp_example/dag_with_remote_fs.py | ipattarapong/dbnd | 224 | 12710688 | <gh_stars>100-1000
from datetime import timedelta
from airflow import DAG
from airflow.utils.dates import days_ago
from dag_test_examples import t_A, t_B
default_args = {
"owner": "airflow",
"depends_on_past": False,
"start_date": days_ago(2),
"retries": 1,
"retry_delay": timedelta(minutes=5),
... |
spirit/user/forms.py | Ke-xueting/Spirit | 974 | 12710695 | <reponame>Ke-xueting/Spirit
# -*- coding: utf-8 -*-
import os
from django import forms
from django.utils.translation import gettext_lazy as _
from django.contrib.auth import get_user_model
from django.utils import timezone
from django.template import defaultfilters
from django.core.files.uploadedfile import UploadedF... |
bibliopixel/control/rest/flask_server.py | rec/leds | 253 | 12710714 | <reponame>rec/leds
import flask, werkzeug.serving
from werkzeug.datastructures import ImmutableOrderedMultiDict
from ... util import log
from ... util.threads import runnable
from ... animation.remote import opener
class OrderedFlask(flask.Flask):
# http://flask.pocoo.org/docs/1.0/patterns/subclassing/
clas... |
legacy/components/split_gen/utils.py | ParikhKadam/zenml | 1,275 | 12710722 | <filename>legacy/components/split_gen/utils.py
# Copyright (c) ZenML GmbH 2020. 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/licen... |
perma_web/perma/tests/test_views_user_management.py | rachelaus/perma | 317 | 12710727 | # -*- coding: utf-8 -*-
from django.urls import reverse
from django.core import mail
from django.conf import settings
from django.utils import timezone
from mock import patch, sentinel
from perma.models import LinkUser, Organization, Registrar, Sponsorship
from perma.exceptions import PermaPaymentsCommunicationExcept... |
src/lib/memory_efficient.py | shah0lin/data | 316 | 12710740 | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
scripts/predict.py | sreesxlnc/kaggle-right-whale | 200 | 12710751 | import argparse
import importlib
from time import strftime
import numpy as np
import pandas as pd
import cPickle as pickle
def load_data(fname):
n = 6925
size = int(fname.split('_')[0])
X_fname = 'cache/X_test_%s.npy' % fname
X_shape = (n, 3, size, size)
X = np.memmap(X_fname, dtype=np.float32, m... |
third_party/ibis/ibis_oracle/tests/conftest.py | ajw0100/professional-services-data-validator | 167 | 12710754 | # Copyright 2020 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... |
examples/05_vision/05_gesture.py | yukaryote/RoboMaster-SDK | 204 | 12710810 | <filename>examples/05_vision/05_gesture.py
# -*-coding:utf-8-*-
# Copyright (c) 2020 DJI.
#
# 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 in the file LICENSE.txt or at
#
# http://www.apache.... |
codegen/python/fixtures/sanic/server/congo/deliveries_if.py | mrpotes/go-raml | 142 | 12710839 | # DO NOT EDIT THIS FILE. This file will be overwritten when re-running go-raml.
from sanic import Blueprint
from sanic.views import HTTPMethodView
from sanic.response import text
from . import deliveries_api
deliveries_if = Blueprint('deliveries_if')
class deliveriesView(HTTPMethodView):
async def get(self, r... |
Packs/ApiModules/Scripts/IAMApiModule/IAMApiModule_test.py | diCagri/content | 799 | 12710851 | from IAMApiModule import *
APP_USER_OUTPUT = {
"user_id": "mock_id",
"user_name": "mock_user_name",
"first_name": "mock_first_name",
"last_name": "mock_last_name",
"active": "true",
"email": "<EMAIL>"
}
USER_APP_DATA = IAMUserAppData("mock_id", "mock_user_name", is_active=True, app_data=APP_US... |
embark/uploader/templatetags/filters.py | YulianaPoliakova/embark | 149 | 12710871 | from django import template
from django.forms.fields import CheckboxInput
register = template.Library()
@register.filter(name='is_checkbox')
def is_checkbox(value):
return isinstance(value, CheckboxInput)
|
templates.py | tommccoy1/hans | 109 | 12710898 | <reponame>tommccoy1/hans
import random
import numpy as np
def despace(string):
new_string = string.replace(" ", " ")
if new_string == string:
return string
else:
return despace(new_string)
def remove_terminals(tree):
words = tree.split()
new_words = []
for word in words:... |
bip_utils/bip/bip84/__init__.py | MIPPLTeam/bip_utils | 149 | 12710901 | <gh_stars>100-1000
from bip_utils.bip.bip84.bip84 import Bip84
|
pyrtl/rtllib/prngs.py | ryoon/PyRTL | 159 | 12710922 | """
``Example``::
``csprng_trivium``
load, req = pyrtl.Input(1, 'load'), pyrtl.Input(1, 'req')
ready, rand = pyrtl.Output(1, 'ready'), pyrtl.Output(128, 'rand')
ready_out, rand_out = prngs.csprng_trivium(128, load, req)
ready <<= ready_out
rand <<= rand_out
sim_trace = pyrtl.SimulationTrac... |
apps/batch/urls_api.py | crazypenguin/devops | 300 | 12710947 | <reponame>crazypenguin/devops
from django.urls import path
from . import views_api
app_name = "batch"
urlpatterns = [
path('get/hosts/', views_api.get_hosts, name='get_hosts'),
path('upload/', views_api.upload, name='upload'),
path('logs/', views_api.logs, name='logs'),
]
|
lib/symbioticpy/symbiotic/targets/ikos.py | paldebjit/symbiotic | 235 | 12710989 | # prepare for Python 3
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import subprocess
import sys
import os
import re
try:
import benchexec.util as util
import benchexec.result as result
from benchexec.tools.template import BaseTool
except ImportError:
... |
migrations/versions/5d5340d8c969_.py | frostming/Flog | 202 | 12711007 | """empty message
Revision ID: 5d5340d8c969
Revises:
Create Date: 2021-06-17 11:12:46.834659
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "5d5340d8c969"
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto gener... |
dm_alchemy/symbolic_alchemy_trackers.py | locross93/dm_alchemy | 182 | 12711010 | <gh_stars>100-1000
# Lint as: python3
# Copyright 2020 DeepMind Technologies Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/license... |
2019/glen.py | nyanthanya/Contoh-Program | 105 | 12711021 | def glen(generator):
"""
len implementation for generators.
"""
return sum(1 for _ in generator) |
bonobo/_version.py | winsmith/bonobo | 243 | 12711089 | __version__ = '0.5.2'
|
src/genie/libs/parser/iosxe/tests/ShowPlatformSoftwareMemorySwitchActiveAllocTypeBrief/cli/equal/golden_output_expected.py | balmasea/genieparser | 204 | 12711133 | expected_output = {
'type': {
'BYTE': {
'allocated': 7045122,
'allocations': 737743,
'frees': 734750,
'requested': 6877514,
},
'BYTE*': {
'allocated': 29128,
'allocations': 345,
'frees': 309,
'req... |
src/main/python/algorithms/sorting/RadixSort.py | pratikadarsh/Algorithms | 558 | 12711136 | '''
* @file RadixSort.py
* @author (original JAVA) EAlexa and <NAME>, <EMAIL>
* (conversion to Python) <NAME>, <EMAIL>
* @date 29 Jun 2020
* @version 0.1
* @brief Radix sort implementation
* See https://en.wikipedia.org/wiki/Radix_sort for details on runtime and complexity Radix sorts
* operates i... |
bindings/python/cntk/misc/converter.py | shyamalschandra/CNTK | 17,702 | 12711143 | <filename>bindings/python/cntk/misc/converter.py
# ==============================================================================
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE.md file in the project root
# for full license information.
# ==================================... |
tests/ml/test_utils.py | sethvargo/vaex | 337 | 12711151 | <gh_stars>100-1000
import os
import pytest
# Creating a custom mark decorator for units that test belong the incubator.
skip_incubator = pytest.mark.skipif('RUN_INCUBATOR_TESTS' not in os.environ,
reason="Add environment variable RUN_INCUBATOR_TESTS to run this test since \
... |
test/hlt/pytest/python/com/huawei/iotplatform/client/dto/QueryDeviceGroupsInDTO.py | yuanyi-thu/AIOT- | 128 | 12711171 | <filename>test/hlt/pytest/python/com/huawei/iotplatform/client/dto/QueryDeviceGroupsInDTO.py
class QueryDeviceGroupsInDTO(object):
def __init__(self):
self.accessAppId = None
self.pageNo = None
self.pageSize = None
self.name = None
def getAccessAppId(self):
return self.... |
sdk/python/pulumi_gcp/identityplatform/inbound_saml_config.py | sisisin/pulumi-gcp | 121 | 12711172 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.