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 |
|---|---|---|---|---|
myRL/algo/__init__.py | Shiduo-zh/pybulletSim | 562 | 12744723 | <reponame>Shiduo-zh/pybulletSim<gh_stars>100-1000
from .ppo import PPO
|
copy_memory/model.py | dnbaker/pytorch-dilated-rnn | 123 | 12744729 | from torch import nn
from drnn import DRNN
class DRNN_Copy(nn.Module):
def __init__(self, input_size, hidden_size, num_layers, dropout, output_size):
super(DRNN_Copy, self).__init__()
self.drnn = DRNN(cell_type='GRU', dropout=dropout, n_hidden=hidden_size,
n_input=input_s... |
platform/polycommon/tests/test_gzip_decorator.py | admariner/polyaxon | 3,200 | 12744749 | <filename>platform/polycommon/tests/test_gzip_decorator.py
#!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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.... |
paddleclas.py | Adgeros/PaddleClas | 3,763 | 12744764 | <gh_stars>1000+
# 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 r... |
EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/headline.py | michaelray/Iristyle-ChocolateyPackages | 123 | 12744792 | """Some utility functions for working with headline of Markdown.
Terminologies
- Headline :: The headline entity OR the text of the headline
- Content :: The content under the current headline. It stops after
encountering a headline with the same or higher level OR EOF.
"""
# Author: <NAME> <<EMAIL>>
import re
impo... |
tools/deployment/test_torchserver.py | JiYuanFeng/mmclassification | 1,190 | 12744806 | from argparse import ArgumentParser
import numpy as np
import requests
from mmcls.apis import inference_model, init_model, show_result_pyplot
def parse_args():
parser = ArgumentParser()
parser.add_argument('img', help='Image file')
parser.add_argument('config', help='Config file')
parser.add_argumen... |
tkinter/background-image/login/main-canvas.py | whitmans-max/python-examples | 140 | 12744807 |
#
# https://stackoverflow.com/a/47983927/1832058
#
import tkinter as tk
root = tk.Tk()
root.geometry('250x250')
root.title('Canvas')
canvas = tk.Canvas(root, width=250, height=250)
canvas.pack()
img = tk.PhotoImage(file='hal_9000.gif')
canvas.create_image((0, 0), image=img, anchor='nw')
canvas.create_text((10,... |
google/datalab/utils/facets/feature_statistics_generator.py | freyrsae/pydatalab | 198 | 12744809 | <filename>google/datalab/utils/facets/feature_statistics_generator.py<gh_stars>100-1000
# Copyright 2017 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
#
# ... |
tools/make_server_cert.py | galenzhao/nodemcu-firmware | 7,567 | 12744813 | import os
import argparse
import base64
import re
import sys
class Cert(object):
def __init__(self, name, buff):
self.name = name
self.len = len(buff)
self.buff = buff
pass
def __str__(self):
out_str = ['\0']*32
for i in range(len(self.name)):
out_s... |
src/media/audio/audio_core/schema/make_schema_header.py | allansrc/fuchsia | 210 | 12744822 | #!/usr/bin/env python3.8
# Copyright (c) 2018 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 l... |
packages/checker/haveibeenpwned.py | madstk1/leon | 9,211 | 12744837 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import utils
from time import sleep
from urllib import parse
from requests import codes, exceptions
# Developer token
apikey = utils.config('api_key')
def run(string, entities):
"""Verify if one or several email addresses have been pwned"""
emails = []
... |
eventlet/zipkin/greenthread.py | li-caspar/eventlet_0.30.2 | 5,079 | 12744843 | <reponame>li-caspar/eventlet_0.30.2
from eventlet import greenthread
from eventlet.zipkin import api
__original_init__ = greenthread.GreenThread.__init__
__original_main__ = greenthread.GreenThread.main
def _patched__init(self, parent):
# parent thread saves current TraceData from tls to self
if api.is_tra... |
src/python/example/gudhi_graphical_tools_example.py | gtauzin/gudhi-devel | 146 | 12744863 | <filename>src/python/example/gudhi_graphical_tools_example.py
#!/usr/bin/env python
import matplotlib.pyplot as plot
import gudhi
""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details... |
webrecorder/webrecorder/appcontroller.py | ssteo/webrecorder | 1,217 | 12744867 | <filename>webrecorder/webrecorder/appcontroller.py
from webrecorder.basecontroller import BaseController
from webrecorder.models.importer import ImportStatusChecker
# ============================================================================
class AppController(BaseController):
def __init__(self, *args, **kwarg... |
datashader/tests/benchmarks/test_draw_line.py | goncaloperes/datashader | 706 | 12744887 | from __future__ import division
import sys
import pytest
import numpy as np
from datashader.glyphs import Glyph
from datashader.glyphs.line import _build_draw_segment, \
_build_map_onto_pixel_for_line
from datashader.utils import ngjit
py2_skip = pytest.mark.skipif(sys.version_info.major < 3, reason="py2 not s... |
data/models/base.py | pombredanne/vulncode-db | 592 | 12744891 | # Copyright 2019 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, ... |
tests/test_chi_land_trust.py | MAYANK25402/city-scrapers | 255 | 12744914 | from datetime import datetime
from operator import itemgetter
from os.path import dirname, join
import pytest # noqa
from city_scrapers_core.constants import BOARD, PASSED
from city_scrapers_core.utils import file_response
from freezegun import freeze_time
from city_scrapers.spiders.chi_land_trust import ChiLandTrus... |
ops.py | Gengarrr/Relation-Network-Tensorflow | 267 | 12744940 | import tensorflow as tf
import tensorflow.contrib.slim as slim
def lrelu(x, leak=0.2, name="lrelu"):
with tf.variable_scope(name):
f1 = 0.5 * (1 + leak)
f2 = 0.5 * (1 - leak)
return f1 * x + f2 * abs(x)
def selu(x):
alpha = 1.6732632423543772848170429916717
scale = 1.050700987355... |
common/slow.py | spao234/wpt | 575 | 12744948 | <filename>common/slow.py
import time
def main(request, response):
time.sleep(2)
return 200, [], b''
|
VSR/DataLoader/YVDecoder.py | Kadantte/VideoSuperResolution | 1,447 | 12744959 | <reponame>Kadantte/VideoSuperResolution
# Copyright (c) 2017-2020 <NAME>.
# Author: <NAME>
# Email: <EMAIL>
# Update: 2020 - 2 - 7
# Image customized decoder for YV12([Y][U/4][V/4]), YV21([Y][V/4][U/4])
# NOTE: [Y][U][V] means Y/U/V channel is a planar channel, [U/4] means
# U channel is sub-sampled by a factor ... |
litex/soc/cores/dna.py | osterwood/litex | 1,501 | 12744988 | <filename>litex/soc/cores/dna.py
#
# This file is part of LiteX.
#
# Copyright (c) 2014-2015 <NAME> <<EMAIL>>
# SPDX-License-Identifier: BSD-2-Clause
from migen import *
from litex.soc.interconnect.csr import *
# Xilinx DNA (Device Identifier) -------------------------------------------------------------------
cla... |
train_oneside.py | SachinKumar105/Implicit-Competitive-Regularization | 107 | 12744991 | import os
import csv
import time
import math
import pandas as pd
import torch
import torch.nn as nn
import torchvision.utils as vutils
from torch.optim.sgd import SGD
from torch.utils.data import DataLoader
from optims import OCGD, BCGD2
from train_utils import get_data, weights_init_d, weights_init_g, \
get_diff... |
tests/integration_tests/util.py | trailofbits/mcsema | 1,301 | 12744996 | # Copyright (c) 2020 Trail of Bits, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is di... |
.modules/.metagoofil/extractors/metadataOpenOffice.py | termux-one/EasY_HaCk | 1,103 | 12744998 | import unzip
import zipfile
import sys
import re
import os
import random
class metaInfoOO:
def __init__(self):
self.version =""
self.generator=""
self.creationDate=""
self.date=""
self.language=""
self.editingCycles=""
self.editingDuration=""
self.tableCount=""
self.imageCount=""
self.objectCount=... |
recipes/m4/all/test_package/conanfile.py | rockandsalt/conan-center-index | 562 | 12745006 | <gh_stars>100-1000
from conans import ConanFile, tools
from conans.errors import ConanException
from io import StringIO
import os
import textwrap
class TestPackageConan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
@property
def _m4_input_path(self):
return os.path.join(self.build... |
tests/test_0220-contiguous-byte-ranges-in-http.py | eic/uproot4 | 133 | 12745007 | # BSD 3-Clause License; see https://github.com/scikit-hep/uproot4/blob/main/LICENSE
from __future__ import absolute_import
import numpy
import pytest
import uproot
@pytest.mark.network
def test():
with uproot.open(
"https://starterkit.web.cern.ch/starterkit/data/advanced-python-2019/RD_distribution.roo... |
testhub/testsuites/qip/test_datasets.py | banrieen/PerfBoard | 146 | 12745026 | <gh_stars>100-1000
""" 测试单(场景)
松山湖AI制造业推理平台性能测试SLI/SLO
1. 通过HTTP接口推送原始数据集和推理脚本(具体数量、频次待定)
2. 平台将数据写入nfs/ceph、数据库的读写性能测试(以及IOPS)
3. 100批量数据标注、图像预览响应测试
4. 数据集、模型的增删改查的接口响应(暂定32x6个模型、数据集)
5. 模型转换测试(暂定32x6个模型、数据集)
6. 数据集转换测试(暂定32x6个模型、数据集)
7. 10x32x6个分布式推理任务调度的稳定性
8. 64mpbs,128Mbps图片流量的负载... |
egg/core/continous_communication.py | vengalraoguttha/EGG | 254 | 12745030 | # 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.
from typing import Callable, Optional
import torch
import torch.nn as nn
import torch.nn.functional as F
from egg.core.interaction import Log... |
kivy/core/video/video_null.py | Galland/kivy | 13,889 | 12745062 |
'''
VideoNull: empty implementation of VideoBase for the no provider case
'''
from kivy.core.video import VideoBase
class VideoNull(VideoBase):
'''VideoBase implementation when there is no provider.
'''
pass
|
tests/test_iter_methods.py | mail6543210/jsl | 237 | 12745084 | <reponame>mail6543210/jsl<filename>tests/test_iter_methods.py<gh_stars>100-1000
# coding: utf-8
from jsl import (StringField, ArrayField, Var, DictField,
NotField, Document, DocumentField)
from jsl.fields.compound import BaseOfField
a = StringField()
b = StringField()
c = StringField()
d = StringFiel... |
examples/research/surgery/nds/filter_resnexta_group1.py | Harald-R/aw_nas | 195 | 12745085 | <gh_stars>100-1000
import os
import sys
import yaml
import pickle
from aw_nas import germ
from aw_nas.weights_manager.base import BaseWeightsManager
from aw_nas.common import rollout_from_genotype_str
ss = germ.GermSearchSpace()
wm = BaseWeightsManager.get_class_("germ")(
ss, "cuda", rollout_type="germ",
germ... |
tests/authentication/test_login_kubeconfig.py | tavaresrodrigo/kopf | 855 | 12745111 | <gh_stars>100-1000
import os
import pytest
import yaml
from kopf._cogs.structs.credentials import LoginError
from kopf._core.intents.piggybacking import has_kubeconfig, login_with_kubeconfig
MINICONFIG = '''
kind: Config
current-context: ctx
contexts:
- name: ctx
context:
cluster:... |
src/0264.ugly-number-ii/ugly-number-ii.py | lyphui/Just-Code | 782 | 12745125 | class Solution:
def nthUglyNumber(self, n):
ugly = [1]
i2 = i3 = i5 = 0
while len(ugly) < n:
while ugly[i2] * 2 <= ugly[-1]: i2 += 1
while ugly[i3] * 3 <= ugly[-1]: i3 += 1
while ugly[i5] * 5 <= ugly[-1]: i5 += 1
ugly.append(min(ugly[i2] * 2, u... |
tests/unit/test_returns.py | lust4life/uplink | 918 | 12745148 | <reponame>lust4life/uplink
# Local imports
from uplink import returns
def test_returns(request_builder):
custom = returns(str)
request_builder.get_converter.return_value = str
request_builder.return_type = returns.ReturnType.with_decorator(
None, custom
)
custom.modify_request(request_buil... |
descarteslabs/common/graft/client/__init__.py | descarteslabs/descarteslabs-python | 167 | 12745179 | from .client import (
is_delayed,
is_function_graft,
value_graft,
keyref_graft,
apply_graft,
function_graft,
merge_value_grafts,
guid,
isolate_keys,
parametrize,
consistent_guid,
)
__all__ = [
"is_delayed",
"is_function_graft",
"value_graft",
"keyref_graft",
... |
t5x/contrib/moe/partitioning_test.py | google-research/t5x | 278 | 12745188 | <gh_stars>100-1000
# Copyright 2022 The T5X Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
mpeg/sa3d.py | frade/spatialmedia | 1,469 | 12745199 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2016 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/LICENS... |
symposion/reviews/management/commands/promoteproposals.py | azkarmoulana/pycon | 154 | 12745200 | from django.core.management.base import BaseCommand
from django.db import connections
from symposion.reviews.models import ProposalResult, promote_proposal
class Command(BaseCommand):
def handle(self, *args, **options):
accepted_proposals = ProposalResult.objects.filter(status="accepted")
ac... |
envelopes/connstack.py | siyaoyao/envelopes | 202 | 12745239 | # -*- coding: utf-8 -*-
# Copyright 2012 <NAME>. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of... |
Interview Preparation Kit - Python/01. Warm-up Challenges/004. Repeated String.py | Snehakri022/HackerrankPractice | 831 | 12745270 | # Problem: https://www.hackerrank.com/challenges/repeated-string/problem
# Score: 20
def repeated_string(s, n):
return n // len(s) * s.count('a') + s[0: n % len(s)].count('a')
s = input()
n = int(input())
print(repeated_string(s, n))
|
src/StreamDeck/ImageHelpers/PILHelper.py | rolandio/python-elgato-streamdeck | 517 | 12745329 | <reponame>rolandio/python-elgato-streamdeck
# Python Stream Deck Library
# Released under the MIT license
#
# dean [at] fourwalledcubicle [dot] com
# www.fourwalledcubicle.com
#
import io
def create_image(deck, background='black'):
"""
Creates a new PIL Image with the correct image dim... |
docs/conf.py | modwizcode/luna | 609 | 12745332 |
# -- Project information -----------------------------------------------------
project = 'LUNA'
copyright = '2020 Great Scott Gadgets'
author = '<NAME>'
# -- General configuration ---------------------------------------------------
master_doc = 'index'
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napol... |
extra_views/dates.py | CleitonDeLima/django-extra-views | 974 | 12745359 | <filename>extra_views/dates.py
import datetime
import math
from calendar import Calendar
from collections import defaultdict
from django.core.exceptions import ImproperlyConfigured
from django.db.models import Q
from django.utils.translation import gettext_lazy as _
from django.views.generic.dates import (
DateMix... |
app/__init__.py | johnwheeler/flask-live-starter | 119 | 12745372 | <reponame>johnwheeler/flask-live-starter<gh_stars>100-1000
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config.from_pyfile('settings.cfg')
db = SQLAlchemy(app)
if not app.debug:
import logging
fmt = "%(levelname)s - %(asctime)s %(filename)s:%(lineno)d %(message)... |
test/plugins/echo.py | fenwar/limbo | 369 | 12745396 | def on_message_deleted(msg, server):
return "Deleted: {}".format(msg["previous_message"]["text"])
def on_message_changed(msg, server):
text = msg.get("message", {"text": ""}).get("text", "")
if text.startswith("!echo"):
return "Changed: {}".format(text)
def on_message(msg, server):
if msg["tex... |
imagepy/tools/Measure/coordinate_tol.py | dada1437903138/imagepy | 1,178 | 12745425 | from sciapp.action import CoordinateTool as Plugin |
ppgan/faceutils/image.py | pcwuyu/PaddleGAN | 6,852 | 12745431 | <reponame>pcwuyu/PaddleGAN
# Copyright (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
... |
examples/apidemos-preference-advanced_preferences.py | tqchagas/AndroidViewClient | 1,155 | 12745436 | <filename>examples/apidemos-preference-advanced_preferences.py
#! /usr/bin/env python
'''
Copyright (C) 2012 <NAME>
Created on Sep 18, 2012
@author: diego
'''
import re
import sys
import os
try:
sys.path.append(os.path.join(os.environ['ANDROID_VIEW_CLIENT_HOME'], 'src'))
except:
pass
import com.dtmilano.a... |
python/cogs/extra/lamp.py | dev-null-undefined/felix | 135 | 12745461 | """This is a cog for a discord.py bot.
It adds Lamp
"""
from discord.ext import commands
class Lamp(commands.Cog, command_attrs=dict(hidden=True)):
def __init__(self, client):
self.client = client
@commands.group(
name='lamp',
hidden=True,
invoke_without_command=True,
)
... |
skrf/media/tests/test_media.py | dxxx9/scikit-rf | 379 | 12745482 | <reponame>dxxx9/scikit-rf
# -*- coding: utf-8 -*-
import unittest
import os
import numpy as npy
from skrf.media import DefinedGammaZ0, Media
from skrf.network import Network
from skrf.frequency import Frequency
import skrf
class DefinedGammaZ0TestCase(unittest.TestCase):
def setUp(self):
self.files_dir ... |
docs/docs_env/Lib/site-packages/pip-1.0-py2.5.egg/pip/runner.py | gilsonbp/Django-facebook | 10,056 | 12745543 | import sys
import os
def run():
base = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
## FIXME: this is kind of crude; if we could create a fake pip
## module, then exec into it and update pip.__path__ properly, we
## wouldn't have to update sys.path:
sys.path.insert(0, base)
impo... |
datalad/downloaders/tests/utils.py | ypid/datalad | 298 | 12745552 | # emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
# ex: set sts=4 ts=4 sw=4 noet:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package for the
# copyright and license terms.
#
# ## ### ##... |
service/generated_flatbuffers/tflite/TensorMap.py | lcrh/falken | 213 | 12745604 | <gh_stars>100-1000
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
conftest.py | aperrin66/DAPPER | 225 | 12745621 | """Configures pytest (beyond the ini file)."""
import matplotlib as mpl
import numpy
import pytest
from matplotlib import pyplot as plt
from dapper.dpr_config import rc
@pytest.fixture(autouse=True)
def add_sci(doctest_namespace):
"""Add numpy as np for doctests."""
doctest_namespace["np"] = numpy
doctes... |
demo/memory_tree/xml_amazoncat_13K_script.py | Ark-kun/vowpal_wabbit | 4,332 | 12745624 | import os
import time
import numpy as np
# from IPython import embed
print("perform experiments on amazoncat 13K (multilabel)")
leaf_example_multiplier = 2
lr = 1
bits = 30
alpha = 0.1 # 0.3
passes = 4
learn_at_leaf = True
use_oas = True
# num_queries = 1 #does not really use
dream_at_update = 1
# hal_version = 1 #... |
Contrastive_Supervision_Synthesis/scripts/model.py | vishalbelsare/OpenMatch | 403 | 12745700 | import os
import math
import torch
from torch import nn, optim
import logging
import numpy as np
import torch.nn.functional as F
from torch.autograd import Variable
import utils
from contrastqg import (T5ForConditionalGeneration)
logger = logging.getLogger()
class QGenerator(object):
def __init__(self, args, toke... |
chaospy/distributions/collection/bradford.py | utsekaj42/chaospy | 333 | 12745714 | <reponame>utsekaj42/chaospy
"""Bradford distribution."""
import numpy
from ..baseclass import SimpleDistribution, LowerUpperDistribution
class bradford(SimpleDistribution):
"""Standard Bradford distribution."""
def __init__(self, c=1):
super(bradford, self).__init__(dict(c=c))
def _pdf(self, x,... |
axcell/models/structure/transfo_experiment.py | Kabongosalomon/axcell | 335 | 12745718 | <reponame>Kabongosalomon/axcell<filename>axcell/models/structure/transfo_experiment.py<gh_stars>100-1000
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import time
from .experiment import Experiment
from .nbsvm import preds_for_cell_content, preds_for_cell_content_max, preds_for_cell_content_... |
pilot/planning/mp_planning.py | yanbarurobotics/PythonPilot | 129 | 12745723 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import multiprocessing
import numpy as np
import time
from common.pilot_gloval_variable import MPVariable
from planning import pure_pursuit
class MPPlanning():
def __init__(self, cfg):
self.__m = multiprocessing.Process(target=self.__process, \
... |
dizoo/procgen/maze/entry/__init__.py | sailxjx/DI-engine | 464 | 12745731 | from .maze_ppo_config import main_config, create_config
from .maze_dqn_config import main_config, create_config |
pxr/usd/pcp/testenv/testPcpStreamingLayerReload.py | stephenp24/USD | 3,680 | 12745742 | #!/pxrpythonsubst
#
# Copyright 2021 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
... |
PyFunceble/cli/migrators/csv_file/base.py | Centaurioun/PyFunceble | 213 | 12745746 | """
The tool to check the availability or syntax of domain, IP or URL.
::
██████╗ ██╗ ██╗███████╗██╗ ██╗███╗ ██╗ ██████╗███████╗██████╗ ██╗ ███████╗
██╔══██╗╚██╗ ██╔╝██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝██╔══██╗██║ ██╔════╝
██████╔╝ ╚████╔╝ █████╗ ██║ ██║██╔██╗ ██║██║ █████╗ █... |
tools/pot/openvino/tools/pot/configs/utils.py | pazamelin/openvino | 2,406 | 12745752 | <filename>tools/pot/openvino/tools/pot/configs/utils.py<gh_stars>1000+
# Copyright (C) 2020-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import itertools
from ..utils.logger import get_logger
logger = get_logger(__name__)
def product_dict(d):
keys = d.keys()
vals = d.values()
for insta... |
hydrus/client/gui/ClientGUIDragDrop.py | thatfuckingbird/hydrus-websocket-server | 1,417 | 12745758 | import os
from qtpy import QtCore as QC
from qtpy import QtGui as QG
from qtpy import QtWidgets as QW
from hydrus.core import HydrusConstants as HC
from hydrus.core import HydrusGlobals as HG
from hydrus.core import HydrusPaths
from hydrus.core import HydrusText
from hydrus.client import ClientExporting
from hydrus.... |
malib/rpc/log/log_server.py | zbzhu99/malib | 258 | 12745770 | <reponame>zbzhu99/malib<filename>malib/rpc/log/log_server.py<gh_stars>100-1000
import time
import grpc
from threading import Event
from concurrent import futures
from collections import Iterable
from malib.rpc.proto import log_pb2_grpc, log_pb2
from malib.utils import io_wrapper
from malib.utils.convert import utc_to_... |
lite/tests/unittest_py/pass/common/test_elementwise_scale_fuse_pass_base.py | 714627034/Paddle-Lite | 808 | 12745807 | <reponame>714627034/Paddle-Lite<gh_stars>100-1000
# 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... |
Python3/1284.py | rakhi2001/ecom7 | 854 | 12745817 | <gh_stars>100-1000
__________________________________________________________________________________________________
sample 16 ms submission
class Solution:
def minFlips(self, mat: List[List[int]]) -> int:
M, N = len(mat), len(mat[0])
res = float('inf')
dire = [(0,0),(1,0),(-1,0),(0,1),(0,-... |
insights/parsers/tests/test_tuned.py | maxamillion/insights-core | 121 | 12745866 | import pytest
import doctest
from insights.parsers import SkipException, tuned
from insights.parsers.tuned import Tuned
from insights.tests import context_wrap
TUNED_OUTPUT = '''
Available profiles:
- balanced
- desktop
- latency-performance
- network-latency
- network-throughput
- powersave
- throughput-performance
... |
setup.py | CodeBrew-LTD/django-hordak | 187 | 12745891 | <gh_stars>100-1000
#!/usr/bin/env python
from os.path import exists
from setuptools import setup, find_packages
setup(
name="django-hordak",
version=open("VERSION").read().strip(),
author="<NAME>",
author_email="<EMAIL>",
packages=find_packages(),
scripts=[],
url="https://github.com/adamch... |
lldb/test/API/tools/lldb-server/TestGdbRemoteCompletion.py | Machiry/checkedc-clang | 250 | 12745898 | <filename>lldb/test/API/tools/lldb-server/TestGdbRemoteCompletion.py
import tempfile
import gdbremote_testcase
from lldbsuite.test.lldbtest import *
from lldbsuite.test.decorators import *
from lldbgdbserverutils import *
class GdbRemoteCompletionTestCase(gdbremote_testcase.GdbRemoteTestCaseBase):
mydir = TestBase... |
locations/spiders/bonefishgrill.py | davidchiles/alltheplaces | 297 | 12745911 | # -*- coding: utf-8 -*-
import json
import re
import scrapy
from locations.items import GeojsonPointItem
from locations.hours import OpeningHours
DAY_MAPPING = {
'Monday': 'Mo',
'Tuesday': 'Tu',
'Wednesday': 'We',
'Thursday': 'Th',
'Friday': 'Fr',
'Saturday': 'Sa',
'Sunday': 'Su'
}
clas... |
tests/package_extract/extract.py | AppliedIntuition/subpar | 546 | 12745956 | # Copyright 2018 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 applicable law or a... |
hack/mkdocs_macros/feature_stability_table.py | javipolo/kops | 14,563 | 12745976 | <reponame>javipolo/kops<filename>hack/mkdocs_macros/feature_stability_table.py
#!/usr/bin/env python
# Copyright 2020 The Kubernetes 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
... |
src/main/python/com/bluehonour/utils/get_stock_data_path.py | kingmoon3/stock-data-analysis-and-prediction | 162 | 12745978 | #!/usr/bin/python
import sys
import os
import shutil
from readConfig import *
def get_stock_data_path():
config = ReadConfig()
path = config.find_path("config.ini")
config.__read__(path)
stock_path = config.get_stock("path")
if not os.path.exists(stock_path):
os.makedirs(stock_path)
re... |
release/stubs.min/Autodesk/Revit/DB/__init___parts/CurveLoopIterator.py | htlcnn/ironpython-stubs | 182 | 12745990 | class CurveLoopIterator(object,IEnumerator[Curve],IDisposable,IEnumerator):
""" An iterator to a curve loop. """
def Dispose(self):
""" Dispose(self: CurveLoopIterator) """
pass
def MoveNext(self):
"""
MoveNext(self: CurveLoopIterator) -> bool
Increments the iterator to the next item.
... |
Tools/scripts/generate_stdlib_module_names.py | oleksandr-pavlyk/cpython | 52,316 | 12746022 | <filename>Tools/scripts/generate_stdlib_module_names.py
# This script lists the names of standard library modules
# to update Python/stdlib_mod_names.h
import _imp
import os.path
import re
import subprocess
import sys
import sysconfig
SRC_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
STDLIB_PATH =... |
ports/teensy/memzip_files/main.py | sebastien-riou/micropython | 13,648 | 12746040 | import pyb
print("Executing main.py")
led = pyb.LED(1)
led.on()
pyb.delay(100)
led.off()
pyb.delay(100)
led.on()
pyb.delay(100)
led.off()
|
examples/lists/tests.py | jpwatts/django-positions | 118 | 12746047 | import time
import doctest
import unittest
from examples.lists.models import List, Item
from django.test import TestCase
class GenericTestCase(TestCase):
def setUp(self):
pass
def tearDown(self):
pass
# @unittest.skip("Some reason. If you are reading this in a test run someone did not f... |
malaya_speech/config/hifigan.py | dtx525942103/malaya-speech | 111 | 12746123 | config = {
'sampling_rate': 22050,
'hop_size': 256,
'model_type': 'hifigan_generator',
'hifigan_generator_params': {
'out_channels': 1,
'kernel_size': 7,
'filters': 128,
'use_bias': True,
'upsample_scales': [8, 8, 2, 2],
'stacks': 3,
'stack_kernel_... |
paddlespeech/text/exps/ernie_linear/test.py | JiehangXie/PaddleSpeech | 1,540 | 12746129 | # 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... |
tests/unit/fixtures/fail_exporter.py | ClementPruvot/slo-generator | 243 | 12746139 | <filename>tests/unit/fixtures/fail_exporter.py
"""dummy_exporter.py
Dummy exporter implementation for testing.
"""
# pylint: disable=missing-class-docstring
from slo_generator.exporters.base import MetricsExporter
class FailExporter(MetricsExporter):
def export_metric(self, data):
raise ValueError("Oop... |
release/stubs.min/Autodesk/Revit/DB/__init___parts/GridNode.py | htlcnn/ironpython-stubs | 182 | 12746140 | class GridNode(object):
"""
A structure that represents a particular location in (U,V) from a grid.
GridNode(uIndex: int,vIndex: int)
"""
@staticmethod
def __new__(self,uIndex,vIndex):
"""
__new__[GridNode]() -> GridNode
__new__(cls: type,uIndex: int,vIndex: int)
"""
pass
UIn... |
tilecloud/tests/test_bounds.py | camptocamp/tilecloud | 134 | 12746147 | import unittest
from tilecloud import Bounds
class TestBounds(unittest.TestCase):
def test_empty(self) -> None:
bounds = Bounds()
assert len(bounds) == 0
assert 1 not in bounds
self.assertRaises(StopIteration, next, iter(bounds))
assert bounds == bounds
def test_init_... |
questions/range-addition-ii/Solution.py | marcus-aurelianus/leetcode-solutions | 141 | 12746148 | <gh_stars>100-1000
"""
You are given an m x n matrix M initialized with all 0's and an array of operations ops, where ops[i] = [ai, bi] means M[x][y] should be incremented by one for all 0 <= x < ai and 0 <= y < bi.
Count and return the number of maximum integers in the matrix after performing all the operations.
Ex... |
examples/plot_data_augmentation.py | braindecode/braindecode | 301 | 12746164 | <gh_stars>100-1000
"""
Data Augmentation on BCIC IV 2a Dataset
=======================================
This tutorial shows how to train EEG deep models with data augmentation. It
follows the trial-wise decoding example and also illustrates the effect of a
transform on the input signals.
.. contents:: This example cov... |
services/core/PlatformDriverAgent/platform_driver/interfaces/modbus_tk/tests/test_battery_meter.py | cloudcomputingabc/volttron | 406 | 12746196 | import pytest
import gevent
import logging
import time
from volttron.platform import get_services_core, jsonapi
from volttrontesting.utils.utils import get_rand_ip_and_port
from platform_driver.interfaces.modbus_tk.server import Server
from platform_driver.interfaces.modbus_tk.maps import Map, Catalog
from volttron.pl... |
src/masonite/foundation/response_handler.py | cercos/masonite | 1,816 | 12746222 | <reponame>cercos/masonite
def response_handler(environ, start_response):
"""The WSGI Application Server.
Arguments:
environ {dict} -- The WSGI environ dictionary
start_response {WSGI callable}
Returns:
WSGI Response
"""
from wsgi import application
application.bind("en... |
poshc2/client/command_handlers/SharpHandler.py | nettitude/PoshC2_Python | 237 | 12746223 | <gh_stars>100-1000
import base64, re, traceback, os, string, subprocess
from prompt_toolkit import PromptSession
from prompt_toolkit.history import FileHistory
from prompt_toolkit.auto_suggest import AutoSuggestFromHistory
from prompt_toolkit.styles import Style
from poshc2.client.Alias import cs_alias, cs_replace
fro... |
frameworks/tensorflow/code/train.py | jerrypeng7773/amazon-sagemaker-examples | 2,610 | 12746252 | from __future__ import print_function
import argparse
import gzip
import json
import logging
import os
import traceback
import numpy as np
import tensorflow as tf
from tensorflow.keras import Model
from tensorflow.keras.layers import Conv2D, Dense, Flatten
logging.basicConfig(level=logging.DEBUG)
# Define the model... |
qiskit/transpiler/coupling.py | Roshan-Thomas/qiskit-terra | 1,456 | 12746257 | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# 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 modifications or derivat... |
wrappers/python/tests/crypto/test_unpack_message.py | absltkaos/indy-sdk | 636 | 12746265 | <filename>wrappers/python/tests/crypto/test_unpack_message.py
import json
import pytest
from indy import crypto, error
@pytest.mark.asyncio
async def test_pack_message_and_unpack_message_authcrypt_works(wallet_handle, identity_my1, identity_steward1,
pac... |
orchestra/migrations/0037_add_fields_to_iteration.py | code-review-doctor/orchestra | 444 | 12746283 | <filename>orchestra/migrations/0037_add_fields_to_iteration.py<gh_stars>100-1000
# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-04-14 21:18
from __future__ import unicode_literals
import django.utils.timezone
from django.db import migrations
from django.db import models
class Migration(migrations.Migrat... |
securetea/lib/social_engineering/utils.py | pwned-17/SecureTea-Project | 257 | 12746287 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
u"""Utils module for SecureTea Social Engineering.
Project:
╔═╗┌─┐┌─┐┬ ┬┬─┐┌─┐╔╦╗┌─┐┌─┐
╚═╗├┤ │ │ │├┬┘├┤ ║ ├┤ ├─┤
╚═╝└─┘└─┘└─┘┴└─└─┘ ╩ └─┘┴ ┴
Author: <NAME> <<EMAIL>> , Aug 6 2020
Version: 2.1
Module: SecureTea
"""
import re
def check_valid_email(... |
api/tacticalrmm/autotasks/migrations/0009_automatedtask_run_time_bit_weekdays.py | infinite8co/tacticalrmm | 903 | 12746304 | # Generated by Django 3.1.3 on 2020-11-29 09:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("autotasks", "0008_auto_20201030_1515"),
]
operations = [
migrations.AddField(
model_name="automatedtask",
name="run_... |
tools/third_party/websockets/src/websockets/typing.py | meyerweb/wpt | 14,668 | 12746307 | <filename>tools/third_party/websockets/src/websockets/typing.py
from typing import List, NewType, Optional, Tuple, Union
__all__ = ["Data", "Origin", "ExtensionHeader", "ExtensionParameter", "Subprotocol"]
Data = Union[str, bytes]
Data__doc__ = """
Types supported in a WebSocket message:
- :class:`str` for text me... |
tests/test_interface.py | Yuxiang1990/rising | 276 | 12746309 | <filename>tests/test_interface.py
import unittest
from rising import AbstractMixin
class Abstract(object):
def __init__(self, **kwargs):
super().__init__()
self.abstract = True
class AbstractForward(object):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.abstr... |
tests/rankingscreentest_delete.py | ADoesGit/osr2mp4-core | 103 | 12746317 | import os
import unittest
from PIL import Image
from utils import getdrawer, abspath
from helper import assert_image_similar
class TestRankingScreen(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.tests = []
cls.update = False
cls.tests.append(getdrawer("", "syunn", (123123123, -1)))
cls.tests.a... |
setup.py | khaxis/plynx | 137 | 12746318 | #!/usr/bin/env python
import os
import plynx
from setuptools import setup, find_packages
def parse_requirements(filename):
""" load requirements from a pip requirements file """
lineiter = (line.strip() for line in open(filename))
return [line for line in lineiter if line and not line.startswith("#")]
D... |
doc/paper/cg17/example-1.py | baender/gimli | 224 | 12746340 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Minimal example of using pygimli to simulate the steady heat equation.
"""
import pygimli as pg
import pygimli.meshtools as mt
# Create geometry definition for the modelling domain
world = mt.createWorld(start=[-20, 0], end=[20, -16], layers=[-2, -8],
... |
PythonAPI/agents/navigation/test_global_route_planner.py | AbdulHoffmann/carla_carissma | 116 | 12746341 | <gh_stars>100-1000
import math
import unittest
import carla
from global_route_planner import GlobalRoutePlanner
from global_route_planner import NavEnum
from global_route_planner_dao import GlobalRoutePlannerDAO
class Test_GlobalRoutePlanner(unittest.TestCase):
"""
Test class for GlobalRoutePlanner class
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.