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 |
|---|---|---|---|---|
anuga/utilities/parse.py | samcom12/anuga_core | 136 | 12672094 | from .data_audit import license_file_is_valid
import sys
def print_tree(n, indent=0):
while n:
print(" "*indent, n)
print_tree(n.firstChild, indent+4)
n = n.nextSibling
fid = open(sys.argv[1])
license_file_is_valid(fid, '.')
fid.close()
|
test/integration/expected_out_single_line/CantAffordActiveException.py | Inveracity/flynt | 487 | 12672099 | <gh_stars>100-1000
from exceptions import PydolonsError
class CantAffordActiveError(PydolonsError):
def __init__(self, active, missing):
assert missing in ["mana", "stamina", "health"]
self.active = active
self.missing = missing
def __repr__(self):
return f"Need more {self.mis... |
galileo/framework/tf/python/convolutions/sage_layer.py | YaoPu2021/galileo | 115 | 12672101 | # Copyright 2020 JD.com, Inc. Galileo 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 a... |
nflows/version.py | Tennessee-Wallaceh/nflows | 522 | 12672147 | __version__ = "0.14"
VERSION = __version__
|
src/embedding/conf.py | mykiscool/DeepCamera | 914 | 12672161 | # -*- coding: UTF-8 -*-
# run: $gunicorn -c conf.py upload_api:app
import sys
import os
import multiprocessing
sys.path.append(os.path.abspath('upload_api.py'))
sys.path.append('.')
sys.path.append('..')
from upload_api import crons_start
path_of_current_file = os.path.abspath(__file__)
path_of_current_dir = os.path.s... |
eeauditor/tests/test_Amazon_EFS_Auditor.py | kbhagi/ElectricEye | 442 | 12672176 | #This file is part of ElectricEye.
#SPDX-License-Identifier: Apache-2.0
#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 un... |
apps/yolo/pycocoEvalDemo.py | Saums/ml-suite | 334 | 12672194 | #!/usr/bin/env python
#
# // SPDX-License-Identifier: BSD-3-CLAUSE
#
# (C) Copyright 2018, Xilinx, Inc.
#
import os,sys
## THIS FILE CANNOT BE USED UNLESS THE USER CLONES the COCOAPI parallel to the MLSUITE
## AND THEY DONWLOAD THE VAL2014 annotations, and images
## Also, the PythonAPI directory needs to be built
# B... |
OrderedDict_tutorial.py | twtrubiks/python-notes | 106 | 12672303 | <reponame>twtrubiks/python-notes<gh_stars>100-1000
# Python 3.6 introduced a new implementation of dict.
# dict now keeps its items ordered as well.
# An OrderedDict is a dictionary subclass that remembers the order in which its contents are added.
from collections import OrderedDict
if __name__ == "__main__":
or... |
mutpy/test_runners/__init__.py | f-str/mutpy | 284 | 12672355 | <filename>mutpy/test_runners/__init__.py
from .unittest_runner import UnittestTestRunner
def pytest_installed():
import importlib
pytest_loader = importlib.find_loader('pytest')
return pytest_loader is not None
class TestRunnerNotInstalledException(Exception):
pass
def __pytest_not_installed(*args... |
tests/__init__.py | sjoerdk/sitdown | 101 | 12672371 | <reponame>sjoerdk/sitdown
from pathlib import Path
BASE_PATH = Path(__file__).parent.absolute()
RESOURCE_PATH = BASE_PATH / "resources"
|
peering/migrations/0019_router_netbox_device_id.py | schiederme/peering-manager | 173 | 12672426 | # Generated by Django 2.1.3 on 2018-11-08 15:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("peering", "0018_auto_20181014_1612")]
operations = [
migrations.AddField(
model_name="router",
name="netbox_device_id",
... |
reudom/testdata/aes.py | BarryYBL/reudom | 393 | 12672442 | import requests
aes_url = 'http://tool.chacuo.net/cryptaes'
header = {
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) '
'AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.67 Safari/537.36'
}
ECB = 'ecb'
PKC = 'pkcs5'
BLOCK = '128'
PWD = '<PASSWORD>'
IV = '123456'
O = '0'
... |
vendor/cloud.google.com/go/httpreplay/cmd/httpr/examples/python/httpr-demo.py | maxnordlund/transfer.sh | 3,723 | 12672460 | from __future__ import print_function
import sys
from google.auth.credentials import AnonymousCredentials
from google.cloud import storage
if len(sys.argv)-1 != 3:
print('args: PROJECT BUCKET record|replay')
sys.exit(1)
project = sys.argv[1]
bucket_name = sys.argv[2]
mode = sys.argv[3]
if mode == 'record':
... |
benchmarks/20_quantity.py | KOLANICH-libs/pint | 1,545 | 12672465 | import itertools as it
import operator
import pint
from . import util
units = ("meter", "kilometer", "second", "minute", "angstrom")
all_values = ("int", "float", "complex")
all_values_q = tuple(
"%s_%s" % (a, b) for a, b in it.product(all_values, ("meter", "kilometer"))
)
op1 = (operator.neg, operator.truth)
o... |
src/genie/libs/parser/iosxe/tests/ShowIPAlias/cli/equal/golden_output3_expected.py | balmasea/genieparser | 204 | 12672466 | expected_output = {
"vrf": {
"L3VPN-1538": {
"index": {1: {"address_type": "Interface", "ip_address": "192.168.10.254"}}
}
}
}
|
windows_build/generate_ver_info.py | hugmyndakassi/hvmi | 677 | 12672467 | <gh_stars>100-1000
#
# Copyright (c) 2020 Bitdefender
# SPDX-License-Identifier: Apache-2.0
#
import argparse
import pathlib
import subprocess
import sys
import platform
from build_info import write_build_info
def get_argparser():
parser = argparse.ArgumentParser()
parser.add_argument(
"--meta-file", ... |
lightbus/internal_apis.py | gcollard/lightbus | 178 | 12672600 | from lightbus.api import Api, Event
class LightbusStateApi(Api):
"""The API for the state plugin"""
worker_started = Event(
parameters=[
"service_name",
"process_name",
"metrics_enabled",
"api_names",
"listening_for",
"timestamp"... |
py2deb/cli.py | arrikto/py2deb | 309 | 12672607 | # Command line interface for the `py2deb' program.
#
# Author: <NAME> <<EMAIL>>
# Last Change: May 22, 2017
# URL: https://py2deb.readthedocs.io
"""
Usage: py2deb [OPTIONS] ...
Convert Python packages to Debian packages according to the given
command line options (see below). The command line arguments are the
same a... |
support/go-NN-master/engine/SelfPlay.py | sjkim04/AlphaGOZero-python-tensorflow | 325 | 12672651 |
# Self play games as used by DeepMind to train AlphaGo's value network. Play a
# policy against itself, but insert single random move somewhere in the game.
# Use the position immediately after the random move together with the final
# game result as a single training example for the value network.
def run_self_play... |
vimfiles/bundle/vim-python/submodules/pylint/tests/functional/a/arguments_differ_py3.py | ciskoinch8/vimrc | 463 | 12672669 | # pylint: disable=missing-docstring,too-few-public-methods
class AbstractFoo:
def kwonly_1(self, first, *, second, third):
"Normal positional with two positional only params."
def kwonly_2(self, *, first, second):
"Two positional only parameter."
def kwonly_3(self, *, first, second):
... |
coders/nyc_parks.py | susannahsoon/oldperth | 302 | 12672700 | <reponame>susannahsoon/oldperth<gh_stars>100-1000
#!/usr/bin/python
#
# Look for well-known NYC parks.
from collections import defaultdict
import fileinput
import re
import sys
import json
if __name__ == '__main__':
sys.path += (sys.path[0] + '/..')
import coders.registration
import record
parks = {
'Bronx Pa... |
task11_kaggle/create_submission.py | Rojanson/stepik-dl-nlp | 120 | 12672704 | import argparse
import pandas as pd
import numpy as np
import string
import pickle
from nltk.util import ngrams
def generate_csv(input_file='predicted_titles.csv', output_file='submission.csv', voc_file='vocs.pkl'):
'''
Generates file in format required for submitting result to Kaggle
Parameters:
... |
sdk/formrecognizer/azure-ai-formrecognizer/samples/v3.2-beta/sample_authentication.py | rsdoherty/azure-sdk-for-python | 2,728 | 12672714 | # coding: utf-8
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------... |
nntts/models/__init__.py | entn-at/efficient_tts | 111 | 12672730 | <filename>nntts/models/__init__.py
from .efficient_tts import EfficientTTSCNN
from .duration_model import DurationModel
|
vimfiles/bundle/vim-python/submodules/pylint/tests/functional/b/blacklisted_name.py | ciskoinch8/vimrc | 463 | 12672746 | <gh_stars>100-1000
# pylint: disable=missing-docstring
def baz(): # [disallowed-name]
pass
|
dirigible/sheet/tests/test_dirigible_datetime.py | EnoX1/dirigible-spreadsheet | 168 | 12672775 | <filename>dirigible/sheet/tests/test_dirigible_datetime.py
# Copyright (c) 2010 Resolver Systems Ltd, PythonAnywhere LLP
# See LICENSE.md
#
try:
import unittest2 as unittest
except ImportError:
import unittest
import datetime
from sheet.dirigible_datetime import DateTime
from dirigible.test_utils import Resol... |
tests/integrations/subprocess/conftest.py | chuckyQ/briefcase | 917 | 12672794 | from unittest.mock import MagicMock
import pytest
from briefcase.integrations.subprocess import Subprocess
@pytest.fixture
def mock_sub():
command = MagicMock()
command.verbosity = 0
sub = Subprocess(command)
sub._subprocess = MagicMock()
return sub
|
venv/Lib/site-packages/nipype/interfaces/cat12/tests/test_auto_ExtractROIBasedSurfaceMeasures.py | richung99/digitizePlots | 585 | 12672834 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ..surface import ExtractROIBasedSurfaceMeasures
def test_ExtractROIBasedSurfaceMeasures_inputs():
input_map = dict(
lh_roi_atlas=dict(
copyfile=False,
field="rdata",
mandatory=True,
),
lh_surface... |
adbui/adb_ext.py | hao1032/adbui | 136 | 12672903 | # coding=utf-8
import os
import re
import time
import base64
import logging
import tempfile
class AdbExt(object):
def __init__(self, util):
self.util = util
self.is_helper_ready = False
self.width, self.height = None, None
self.dir_path = os.path.dirname(os.path.abspath(__file__)) ... |
tests/typing/test_fixp_inst.py | bogdanvuk/pygears | 120 | 12672908 | <reponame>bogdanvuk/pygears<filename>tests/typing/test_fixp_inst.py
from math import ceil, floor
from pygears.typing import Fixp, Ufixp, Uint, Int
def test_abs():
uq2_3 = Ufixp[2, 3]
q2_3 = Fixp[2, 3]
q3_4 = Fixp[3, 4]
assert abs(uq2_3.max) == uq2_3.max
assert abs(q2_3.min) == q3_4(abs(float(q2_3... |
utils/visualize_mel.py | BaoLocPham/hum2song | 108 | 12672941 | import numpy as np
import yaml
import argparse
import os
import random
import matplotlib.pyplot as plt
def save_img(path, spec_song=None, spec_hum=None):
if spec_song is None or spec_hum is None:
if spec_song is not None:
plt.imshow(spec_song, origin="lower")
plt.title("song", fonts... |
examples/cloudml-churn-prediction/trainer/trainer/metadata.py | ruchirjain86/professional-services | 2,116 | 12672947 | <gh_stars>1000+
# Copyright 2019 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... |
src/tests/error_tests.py | sanders41/pydocstyle | 776 | 12672961 | """Tests for the violations.Error class."""
import pytest
import collections
import textwrap
from pydocstyle.violations import Error
MockDefinition = collections.namedtuple('MockDefinition', ['source', 'start'])
def test_message_without_context():
"""Test a simple error message without parameters."""
error... |
Validation/RecoParticleFlow/python/pfTauBenchmarkElecRejection_cfi.py | ckamtsikis/cmssw | 852 | 12672976 | import FWCore.ParameterSet.Config as cms
pfTauBenchmarkElecRejection = cms.EDAnalyzer("PFTauElecRejectionBenchmarkAnalyzer",
OutputFile = cms.untracked.string('tauBenchmarkElecRejection.root'),
InputTruthLabel = cms.InputTag('generatorSmeared'),
BenchmarkLabel = cms.string('PFTauElecRejection'),
minRe... |
Chapter_16/ch16_ex9.py | pauldevos/Mastering-Object-Oriented-Python-Second-Edition | 108 | 12673029 | <filename>Chapter_16/ch16_ex9.py<gh_stars>100-1000
#!/usr/bin/env python3.7
"""
Mastering Object-Oriented Python 2e
Code Examples for Mastering Object-Oriented Python 2nd Edition
Chapter 16. Example 9.
"""
import logging
import logging.config
import logging.handlers
import yaml
import time
# Producer/Consumer
# ===... |
configs/mmcls/classification_onnxruntime_dynamic.py | aegis-rider/mmdeploy | 746 | 12673048 | _base_ = ['./classification_dynamic.py', '../_base_/backends/onnxruntime.py']
|
pyjobs/profiler/management/commands/linkedin_user_stats.py | Mdslino/PyJobs | 132 | 12673050 | import os
from django.conf import settings
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from pyjobs.profiler.models import ProfilerData
from django.db import IntegrityError
from linkedin_scraper import Person, actions
from pprint import pprint
from selenium impor... |
examples/python.tornado/nats_client.py | ariasheets-wk/frugal | 144 | 12673062 | <reponame>ariasheets-wk/frugal
import logging
import sys
import uuid
from nats.io.client import Client as NATS
from tornado import ioloop, gen
from thrift.protocol import TBinaryProtocol
from thrift.transport.TTransport import TTransportException
from frugal.context import FContext
from frugal.protocol import FProtoco... |
magma/ref.py | leonardt/magma | 167 | 12673083 | <filename>magma/ref.py<gh_stars>100-1000
import abc
import typing
import weakref
from magma.compatibility import IntegerTypes
class Ref:
@abc.abstractmethod
def __str__(self):
raise NotImplementedError()
def __repr__(self):
return self.qualifiedname()
@abc.abstractmethod
def qual... |
rlbench/tasks/put_books_on_bookshelf.py | vonHartz/RLBench | 619 | 12673098 | from typing import List, Tuple
from pyrep.objects import Dummy
from pyrep.objects.shape import Shape
from pyrep.objects.proximity_sensor import ProximitySensor
from rlbench.backend.task import Task
from rlbench.backend.conditions import DetectedCondition, NothingGrasped
class PutBooksOnBookshelf(Task):
def init... |
vilya/models/ngit/patch.py | mubashshirjamal/code | 1,582 | 12673153 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from itertools import groupby
from vilya.libs.generated import Generated
from vilya.libs.text import is_image
from vilya.models.consts import LINECOMMENT_INDEX_EMPTY
from vilya.models.ngit.hunk import Hunk
MAX_PATCH_MOD_LINES = 2000
INVALID_OID = b'0' * ... |
libs/omninet/cnp/SubLayers.py | kyteinsky/OmniNet | 525 | 12673156 | <reponame>kyteinsky/OmniNet
#
# Copyright 2019 <NAME>, <NAME>, <NAME>
#
# 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... |
client/fcImgThread.py | shpoellet/telecine | 138 | 12673157 | <gh_stars>100-1000
import cv2 #needed for histogram plotting and preview window display
#need to build and install opencv version 3 to support frame blending
import threading
import struct
import logging
import config
import numpy as np
import io
from time import sleep
from fractions import F... |
tests/core/test_indexed_array.py | DataLab-CQU/stellargraph | 2,428 | 12673203 | # -*- coding: utf-8 -*-
#
# Copyright 2020 Data61, CSIRO
#
# 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 o... |
2017/async-socket-server/server-test.py | mikiec84/code-for-blog | 1,199 | 12673316 | # Tests a concurrent server, by connecting multiple clients sending pre-set
# messages, and comparing the echoes with expected values.
#
# Run with -h for full usage.
#
# <NAME> [http://eli.thegreenplace.net]
# This code is in the public domain.
import argparse
import itertools
import logging
import queue
import socket... |
tests/plugins/test_buffer.py | augusto-herrmann/frictionless-py | 247 | 12673321 | <gh_stars>100-1000
from frictionless import Resource
# Loader
def test_buffer_loader():
source = b"header1,header2\nvalue1,value2\nvalue3,value4"
with Resource(source, format="csv") as resource:
assert resource.header == ["header1", "header2"]
assert resource.read_rows() == [
{"h... |
emails/testsuite/smtp_servers.py | MrTango/python-emails | 348 | 12673327 | # encoding: utf-8
import os
import platform
import datetime
import random
import time
from emails.compat import to_unicode
DEFAULT_FROM = os.environ.get('SMTP_TEST_FROM_EMAIL') or '<EMAIL>'
SUBJECT_SUFFIX = os.environ.get('SMTP_TEST_SUBJECT_SUFFIX')
def as_bool(value, default=False):
if value is None:
re... |
t/unit/test_values.py | faheel/billiard | 5,079 | 12673328 | from __future__ import absolute_import
import pytest
from billiard import Value, RawValue, Lock, Process
class test_values:
codes_values = [
('i', 4343, 24234),
('d', 3.625, -4.25),
('h', -232, 234),
('c', 'x'.encode('latin'), 'y'.encode('latin'))
]
def test_issue_22... |
appengine/gallery_api/__init__.py | bharati-software/blockly-games-Kannada | 1,184 | 12673330 | <gh_stars>1000+
from common import *
|
ckanapi/version.py | muccg/ckanapi | 128 | 12673369 | <reponame>muccg/ckanapi
import pkg_resources
__version__ = pkg_resources.require("ckanapi")[0].version
|
nuitka/nodes/ImportHardNodes.py | byehack/Nuitka | 1,228 | 12673377 | <reponame>byehack/Nuitka<gh_stars>1000+
# Copyright 2021, <NAME>, mailto:<EMAIL>
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this... |
run.py | svenvs/awesome-video-chat-backgrounds | 113 | 12673382 | from os import listdir
from os.path import isfile, join, abspath
image_path = abspath('./images')
onlyfiles = [f for f in listdir(image_path) if isfile(join(image_path, f))]
readme = '''# awesome-video-chat-backgrounds
Just in case you're at home on a video call and you haven't had time to tidy up your REAL backgrou... |
discrete_systems_time_domain/animation.py | spatialaudio/signals-and-systems-lecture | 243 | 12673387 | <reponame>spatialaudio/signals-and-systems-lecture
"""Animations of common operations in signal processing."""
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
def animate_discrete_convolution(x, h, y, k, kappa, interval=100):
def update_stem(stem, x, y):
stem.markerline.set... |
octodns/processor/filter.py | CyberFlameGO/octodns | 1,865 | 12673395 | #
#
#
from __future__ import absolute_import, division, print_function, \
unicode_literals
from .base import BaseProcessor
class TypeAllowlistFilter(BaseProcessor):
def __init__(self, name, allowlist):
super(TypeAllowlistFilter, self).__init__(name)
self.allowlist = set(allowlist)
def ... |
control/keyboard/vtol_keyboard_multi_control.py | CNRoboComp2020/XTDrone | 457 | 12673397 | <reponame>CNRoboComp2020/XTDrone
import rospy
from geometry_msgs.msg import Pose, Twist
import sys, select, os
import tty, termios
from std_msgs.msg import String
MAX_LINEAR = 1000
MAX_ANG_VEL = 0.5
LINEAR_STEP_SIZE = 0.1
ANG_VEL_STEP_SIZE = 0.01
ctrl_leader = False
send_flag = False
transition_state = 'multirotor'... |
tests/bots/stocks/technical_analysis/test_aroon.py | tehcoderer/GamestonkTerminal | 255 | 12673399 | import pytest
try:
from bots.stocks.technical_analysis.aroon import aroon_command
except ImportError:
pytest.skip(allow_module_level=True)
@pytest.fixture(scope="module")
def vcr_config():
return {
"filter_headers": [("User-Agent", None)],
"filter_query_parameters": [
("period... |
hail/python/test/hail/matrixtable/test_matrix_table.py | tdeboer-ilmn/hail | 789 | 12673412 | <filename>hail/python/test/hail/matrixtable/test_matrix_table.py
import math
import operator
import random
import pytest
import hail as hl
import hail.expr.aggregators as agg
from hail.utils.java import Env
from hail.utils.misc import new_temp_file
from ..helpers import *
setUpModule = startTestHailContext
tearDownMo... |
Validation/SiTrackerPhase2V/python/Phase2TrackerValidateDigi_cfi.py | ckamtsikis/cmssw | 852 | 12673413 | import FWCore.ParameterSet.Config as cms
from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
digiValid = DQMEDAnalyzer('Phase2TrackerValidateDigi',
Verbosity = cms.bool(False),
TopFolderName = cms.string("Ph2TkPixelDigi"),
PixelPlotFillingFlag = cms.bool(False),
OuterTrackerDigiSource = cms.InputT... |
references/classification/utils.py | yoshitomo-matsubara/vision | 12,063 | 12673450 | import copy
import datetime
import errno
import hashlib
import os
import time
from collections import defaultdict, deque, OrderedDict
import torch
import torch.distributed as dist
class SmoothedValue:
"""Track a series of values and provide access to smoothed values over a
window or the global series average... |
hatsploit/core/utils/ui/tip.py | EntySec/HatSploit | 139 | 12673451 | #!/usr/bin/env python3
#
# MIT License
#
# Copyright (c) 2020-2022 EntySec
#
# 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... |
venv/Lib/site-packages/ipykernel/gui/gtkembed.py | ajayiagbebaku/NFL-Model | 652 | 12673458 | <filename>venv/Lib/site-packages/ipykernel/gui/gtkembed.py
"""GUI support for the IPython ZeroMQ kernel - GTK toolkit support.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2010-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. ... |
app/ivr/__init__.py | itworxs/suite | 890 | 12673477 | from flask import Blueprint
ivr = Blueprint('ivr', __name__)
from . import views
|
dataviz/flagssubdivisions.py | Udzu/pudzu | 119 | 12673536 | <reponame>Udzu/pudzu
from pudzu.charts import *
df = pd.read_csv("datasets/flagssubdivisions.csv")
FONT = sans
fg, bg="black", "#EEEEEE"
default_img = "https://upload.wikimedia.org/wikipedia/commons/thumb/b/b0/No_flag.svg/1024px-No_flag.svg.png"
def process(d):
if not d: return None
description = get_non(d, ... |
wetectron/engine/bbox_aug.py | akobiisr/wetectron | 332 | 12673537 | <gh_stars>100-1000
import torch
import torchvision.transforms as TT
from wetectron.config import cfg
from wetectron.data import transforms as T
from wetectron.structures.image_list import to_image_list
from wetectron.structures.bounding_box import BoxList
from wetectron.modeling.roi_heads.box_head.inference import mak... |
AET/imagenet/algorithms/__init__.py | pjwu1997/teil_project | 114 | 12673574 | <reponame>pjwu1997/teil_project
from .Algorithm import *
from .UnsupervisedModel import UnsupervisedModel
from .FeatureClassificationModel import FeatureClassificationModel
|
train.py | zaidhassanch/gector | 582 | 12673592 | import argparse
import os
from random import seed
import torch
from allennlp.data.iterators import BucketIterator
from allennlp.data.vocabulary import DEFAULT_OOV_TOKEN, DEFAULT_PADDING_TOKEN
from allennlp.data.vocabulary import Vocabulary
from allennlp.modules.text_field_embedders import BasicTextFieldEmbedder
from ... |
pygogo/main.py | reubano/pygogo | 301 | 12673599 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
""" A Python logging library with super powers """
import sys
import itertools as it
from os import getcwd, path as p
from argparse import RawTextHelpFormatter, ArgumentParser
import pygogo as gogo
HDLRS_FULL = tuple(h for h in dir(gogo.handl... |
test/nn/test_upsampling.py | steven-lang/e2cnn | 356 | 12673621 | import unittest
from unittest import TestCase
from e2cnn.nn import *
from e2cnn.gspaces import *
import numpy as np
class TestUpsampling(TestCase):
def test_cyclic_even_bilinear(self):
g = Rot2dOnR2(8)
self.check_upsampling(g, "bilinear")
def test_cyclic_odd_bilinear(self):
g =... |
third_party/blink/renderer/build/scripts/keyword_utils.py | zealoussnow/chromium | 14,668 | 12673629 | # Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json5_generator
def sort_keyword_properties_by_canonical_order(
css_properties, css_value_keywords_file, json5_file_parameters):
"""Sort... |
laspy/vlrs/__init__.py | CCInc/laspy | 240 | 12673642 | from . import geotiff
from .known import BaseKnownVLR
from .vlr import VLR
|
tests/notebooks/mirror/ipynb_to_script_vscode_folding_markers/jupyter_with_raw_cell_in_body.py | st--/jupytext | 5,378 | 12673644 | <reponame>st--/jupytext
# ---
# jupyter:
# jupytext:
# cell_markers: region,endregion
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
1+2+3
# region active=""
# This is a raw cell
# endregion
# This is a markdown cell
|
lale/lib/autogen/kernel_pca.py | mfeffer/lale | 265 | 12673647 | <reponame>mfeffer/lale<filename>lale/lib/autogen/kernel_pca.py
from numpy import inf, nan
from sklearn.decomposition import KernelPCA as Op
from lale.docstrings import set_docstrings
from lale.operators import make_operator
class _KernelPCAImpl:
def __init__(self, **hyperparams):
self._hyperparams = hype... |
seahub/api2/endpoints/public_repos_search.py | samuelduann/seahub | 420 | 12673659 | # -*- coding: utf-8 -*-
import logging
from rest_framework.views import APIView
from rest_framework.authentication import SessionAuthentication
from rest_framework.permissions import IsAuthenticatedOrReadOnly
from rest_framework.response import Response
from rest_framework import status
from seaserv import seafile_api... |
example/app_namespace.py | prabhpreet332/Flask-SocketIO | 4,639 | 12673683 | <filename>example/app_namespace.py<gh_stars>1000+
from threading import Lock
from flask import Flask, render_template, session, request
from flask_socketio import SocketIO, Namespace, emit, join_room, leave_room, \
close_room, rooms, disconnect
# Set this variable to "threading", "eventlet" or "gevent" to test the... |
Python_Discord_Bot_JE/venv/Lib/site-packages/pip/_vendor/chardet/universaldetector.py | JE-Chen/je_old_repo | 548 | 12673716 | <filename>Python_Discord_Bot_JE/venv/Lib/site-packages/pip/_vendor/chardet/universaldetector.py
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporatio... |
mindinsight/datavisual/data_transform/graph/node_tree.py | mindspore-ai/mindinsight | 216 | 12673730 | # Copyright 2020 Huawei Technologies Co., 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/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
Patterns/VritikaMalhotra_Pattern.py | sanchit781/HACKTOBERFEST2021_PATTERN | 229 | 12673737 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
def contnum(n):
# initializing starting number
num = 1
# outer loop to handle number of rows
for i in range(0, n):
# inner loop to handle number of columns
# values changing acc. to outer loop
for j in range(0, i+1):... |
migrations/versions/15bd4b7e6622_add_filecoverage_unique_constraint.py | vault-the/changes | 443 | 12673740 | <filename>migrations/versions/15bd4b7e6622_add_filecoverage_unique_constraint.py
"""Add FileCoverage unique constraint
Revision ID: 15bd4b7e6622
Revises: <PASSWORD>
Create Date: 2014-05-09 11:06:50.845168
"""
# revision identifiers, used by Alembic.
revision = '15bd4b7e6622'
down_revision = '3d8177ef<PASSWORD>'
fro... |
xcit.py | artsousa/xcit | 578 | 12673741 | <gh_stars>100-1000
# Copyright (c) 2015-present, Facebook, Inc.
# All rights reserved.
"""
Implementation of Cross-Covariance Image Transformer (XCiT)
Based on timm and DeiT code bases
https://github.com/rwightman/pytorch-image-models/tree/master/timm
https://github.com/facebookresearch/deit/
"""
import math
import to... |
python2/pracmln/mln/database.py | seba90/pracmln | 123 | 12673744 | #
# Markov Logic Networks -- Databases
#
# (C) 2006-2015 by <NAME>, (<EMAIL>)
# <NAME> (<EMAIL>)
#
# 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, includ... |
tests/test_galleries.py | kevinlai219/Mezzanine-Django | 3,053 | 12673761 | <reponame>kevinlai219/Mezzanine-Django
import os
from shutil import rmtree
from uuid import uuid4
from mezzanine.conf import settings
from mezzanine.core.templatetags.mezzanine_tags import thumbnail
from mezzanine.galleries.models import GALLERIES_UPLOAD_DIR, Gallery
from mezzanine.utils.tests import TestCase, copy_te... |
pcdet/models/roi_heads/target_assigner/proposal_target_layer.py | s-ryosky/ST3D | 184 | 12673766 | import numpy as np
import torch
import torch.nn as nn
from ....ops.iou3d_nms import iou3d_nms_utils
class ProposalTargetLayer(nn.Module):
def __init__(self, roi_sampler_cfg):
super().__init__()
self.roi_sampler_cfg = roi_sampler_cfg
def forward(self, batch_dict):
"""
Args:
... |
tkgui/player_info.py | hawson/rpg-text | 162 | 12673767 | <gh_stars>100-1000
class PlayerInfo:
def __init__(self, manager):
self.window = manager.window
self.game = manager.game
self.manager = manager
self._bottom_index = 0
self._top_index = 0
self.bottom_num_pages = 3
self.top_num_pages = 2
def __call__(self):
... |
src/sparseml/sparsification/info.py | clementpoiret/sparseml | 922 | 12673800 | <gh_stars>100-1000
# 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
#
... |
Chapter04/wavnet/wavenet_utils.py | sbi97/R-Deep-learning | 1,119 | 12673806 | <reponame>sbi97/R-Deep-learning
import keras.backend as K
from keras.layers import AtrousConvolution1D
from keras.utils.np_utils import conv_output_length
def categorical_mean_squared_error(y_true, y_pred):
"""MSE for categorical variables."""
return K.mean(K.square(K.argmax(y_true, axis=-1) -
... |
recipes/Python/578107_Tracking_Manipulating_PythImport/recipe-578107.py | tdiprima/code | 2,023 | 12673809 | <gh_stars>1000+
"""import_state.py
A rough implementation of PEP 405. This module centers on manipulating
the normal Python import machinery through its defined state. Any other
approach, such as replacing builtins.__import__ is certainly legal, but
not supported here.
"""
__all__ = ['ImportState', 'default_import... |
tests/test_at.py | CrackerCat/regexploit | 592 | 12673829 | <filename>tests/test_at.py
import pytest
from regexploit.ast.at import EndOfString
from regexploit.ast.sre import SreOpParser
def from_regex(pattern: str):
return SreOpParser().parse_sre(pattern)
@pytest.mark.parametrize(
"r",
[
r".*b*",
r".*\w*b*",
r".+b*",
],
)
def test_ca... |
doc/generate-doc.py | ponty/pyscreenshot | 416 | 12673830 | import glob
import logging
import os
from easyprocess import EasyProcess
from entrypoint2 import entrypoint
# (cmd,grab,background)
commands = [
"python3 -m pyscreenshot.check.versions",
"python3 -m pyscreenshot.examples.virtdisp",
"python3 -m pyscreenshot.check.speedtest",
"python3 -m pyscreenshot.ch... |
gazelle/bzl/testdata/defaultvisibility/nested/dir/bar.bzl | jkjk822/bazel-skylib | 223 | 12673834 | <gh_stars>100-1000
"""
Doc string
"""
def asdf():
pass
|
carla/recourse_methods/catalog/focus/distances.py | jayanthyetukuri/CARLA | 140 | 12673841 | import tensorflow as tf
from tensorflow.losses import Reduction
def distance_func(name, x1, x2, eps: float = 0.0):
if name == "l1":
ax = 1
return l1_dist(x1, x2, ax, eps)
if name == "l2":
ax = 1
return l2_dist(x1, x2, ax, eps)
if name == "cosine":
ax = -1
re... |
pytimeparse/__init__.py | Dushistov/pytimeparse | 216 | 12673848 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
__init__.py
(c) <NAME> <<EMAIL>> 1 February, 2014
`timeparse` module.
'''
from __future__ import absolute_import
from codecs import open
from os import path
# Version. For each new release, the version number should be updated
# in the file VERSION.
try:
# If ... |
vlcp/protocol/openflow/defs/openflow10.py | hubo1016/vlcp | 252 | 12673878 | '''
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, 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 ... |
projects/OneSeg/oneseg/config.py | simon108018/OneNet | 611 | 12673962 | # -*- coding: utf-8 -*-
#
# Modified by <NAME>
# Contact: <EMAIL>
#
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from detectron2.config import CfgNode as CN
def add_onenet_config(cfg):
"""
Add config for OneNet.
"""
cfg.MODEL.OneNet = CN()
cfg.MODEL.OneNet.NUM_CLASSES = 8... |
recipes/Python/266586_Simple_XOR_keyword_Encryption/recipe-266586.py | tdiprima/code | 2,023 | 12673989 | #PEcrypt - use a string key to encrypt/decrypt another string
# - <NAME> - January 2004
class PEcrypt:
"""
PEcrypt - very, very simple word key encryption system
uses cyclic XOR between the keyword character
bytes and the string to be encrypted/decrypted.
Theref... |
tests/unit/test_signature_verify.py | windies21/loopchain | 105 | 12674001 | import json
import logging
import os
from pathlib import Path
import plyvel
import pytest
from pkg_resources import parse_version
from plyvel._plyvel import Error
from loopchain.blockchain import TransactionVerifier
from loopchain.blockchain.blocks import BlockVersioner, BlockVerifier, BlockSerializer
from loopchain.... |
synthtiger/components/wrapper/__init__.py | KoryakovDmitry/synthtiger | 153 | 12674003 | <filename>synthtiger/components/wrapper/__init__.py
"""
SynthTIGER
Copyright (c) 2021-present NAVER Corp.
MIT license
"""
from synthtiger.components.wrapper.iterator import Iterator
from synthtiger.components.wrapper.selector import Selector
from synthtiger.components.wrapper.switch import Switch
__all__ = ["Iterator... |
Server/integrations/azuread/AzureADAuthenticationForGluu.py | rkondratenko/oxAuth | 380 | 12674014 | # Author: <NAME>
from org.gluu.service.cdi.util import CdiUtil
from org.gluu.oxauth.security import Identity
from org.gluu.model.custom.script.type.auth import PersonAuthenticationType
from org.gluu.oxauth.service import AuthenticationService, UserService
from org.gluu.oxauth.model.common import User
from org.gluu.uti... |
blueapps/account/sites/open/conf.py | qqqqqie/bk-sops | 881 | 12674019 | # -*- 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... |
sdks/python/apache_beam/io/gcp/dicomio_integration_test.py | hengfengli/beam | 5,279 | 12674028 | <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 licenses this file to You under the Apache License, Version 2.0
# (the "License")... |
dataset-construction/src/ndb_data/data_import/wikidata_index.py | j6mes/NeuralDB | 213 | 12674029 | #
# Copyright (c) 2021 Facebook, Inc. and its affiliates.
#
# This file is part of NeuralDB.
# See https://github.com/facebookresearch/NeuralDB for further info.
#
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.