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
Mythras/upload2roll20.py
ManuZzZ85/roll20-character-sheets
1,104
11153410
import json import requests from pathlib import Path home = str(Path.home()) with open("{}/.roll20/config.json".format(home)) as config_file: configs = json.load(config_file) login_data = {'email': configs['email'], 'password': configs['password']} roll20session = requests.Session() login_result = roll20session....
win/pywinauto/XMLHelpers.py
sk8darr/BrowserRefresh-Sublime
191
11153415
# GUI Application automation and testing library # Copyright (C) 2006 <NAME> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License # as published by the Free Software Foundation; either version 2.1 # of the License, or (at your optio...
qa/qa_network.py
modulus-sa/ganeti
396
11153417
# # # Copyright (C) 2013 Google 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: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and ...
tools/rs-sysmon/plugins/dstat_sendmail.py
y-sira/oltpbench
368
11153423
<filename>tools/rs-sysmon/plugins/dstat_sendmail.py<gh_stars>100-1000 ### Author: <NAME> <<EMAIL>> ### FIXME: Should read /var/log/mail/statistics or /etc/mail/statistics (format ?) class dstat_plugin(dstat): def __init__(self): self.name = 'sendmail' self.vars = ('queue',) self.type = 'd'...
tests/utilities/test_parameter_tying.py
Code-Cornelius/pytorch-lightning
15,666
11153430
<gh_stars>1000+ # Copyright The PyTorch Lightning team. # # 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 la...
volrender/volrender.py
s-kistler/PyPlay
505
11153473
<filename>volrender/volrender.py """ volrender.py Author: <NAME> A Ray Casting Volume Renderer for medical data visualization. """ import sys, argparse, os from slicerender import * from raycast import * import glfw class RenderWin: """GLFW Rendering window class""" def __init__(self, imageDir): ...
Contents/Libraries/Shared/pysrt/version.py
jippo015/Sub-Zero.bundle
1,553
11153480
<filename>Contents/Libraries/Shared/pysrt/version.py VERSION = (1, 0, 1) VERSION_STRING = '.'.join(str(i) for i in VERSION)
config.py
Google1234/Information_retrieva_Projectl-
139
11153505
<filename>config.py #-*- coding: UTF-8 -*- #针对查询 返回的记录数 query_return_numbers=20 #针对查询 返回的每条摘要长度 query_return_snipper_size=250 #针对某项查询 推荐的相似文档数目 recommand_numbers=3 #针对搜索词 推荐的相似主题数目 recommand_topic_numbers=10 #按块读取文件,块大小 :用于read_block() write_bloack(),针对只需读写一遍的大文件 buff_size=1024*1024*10 #将文件部分记录保存至内存,内存大小 ,内存中命中某项记录,直接...
test/statements/import4.py
kylebarron/MagicPython
1,482
11153548
<gh_stars>1000+ from....foo import a from...foo import b from..foo import c from.foo import d from : keyword.control.import.python, source.python .... : punctuation.separator.period.python, source.python foo : source.python : source.python import : keyword.control.imp...
proposals/generate_iter_proposals.py
LLLjun/learn-to-cluster
620
11153586
<filename>proposals/generate_iter_proposals.py #!/usr/bin/env python # -*- coding: utf-8 -*- import os import argparse import numpy as np from utils import (read_meta, write_meta, build_knns, labels2clusters, clusters2labels, BasicDataset, Timer) from proposals import super_vertex, filter_clusters,...
src/veGiantModel/distributed/__init__.py
sljlp/veGiantModel
101
11153596
<reponame>sljlp/veGiantModel from .. import patcher as dist from megatron import mpu def get_model_parallel_world_size(): return dist.get_model_parallel_world_size() def get_model_parallel_rank(): return dist.get_model_parallel_rank() def get_data_parallel_world_size(): return dist.get_data_parallel_worl...
tests/unit/module/test_cdk.py
blade2005/runway
134
11153619
"""Test runway.module.cdk.""" # pylint: disable=no-self-use,unused-argument # pyright: basic from __future__ import annotations import logging from subprocess import CalledProcessError from typing import TYPE_CHECKING, Any, Dict, List, Optional from unittest.mock import call import pytest from mock import Mock from ...
tests/test_spatial_crop.py
dyollb/MONAI
2,971
11153639
<filename>tests/test_spatial_crop.py # Copyright 2020 - 2021 MONAI Consortium # 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 ...
homeassistant/components/tellduslive/binary_sensor.py
MrDelik/core
30,023
11153680
"""Support for binary sensors using Tellstick Net.""" from homeassistant.components import binary_sensor, tellduslive from homeassistant.components.binary_sensor import BinarySensorEntity from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.helpers.dispatc...
data/datasets/joints_dataset.py
yihui-he2020/epipolar-transformers
360
11153685
<filename>data/datasets/joints_dataset.py # ------------------------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # Written by <NAME> (<EMAIL>), modified by <NAME> # ---------------------------------------------------...
proxypool/conf.py
Lemon2go/ProxyPool
359
11153701
# Redis Host HOST = 'localhost' # Redis PORT PORT = 6379 # Redis 中存放代理池的 Set 名 POOL_NAME = 'proxies' # Pool 的低阈值和高阈值 POOL_LOWER_THRESHOLD = 10 POOL_UPPER_THRESHOLD = 40 # 两个调度进程的周期 VALID_CHECK_CYCLE = 600 POOL_LEN_CHECK_CYCLE = 20 # headers HEADERS = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) Ap...
backUp/jd_spider_requests.py
lllrrr2/jd-3
354
11153703
<filename>backUp/jd_spider_requests.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' 环境变量 export wy_spike_cookie="" # 抢购账号的cookie export wy_spike_wy_eid="I2KGUFMH75SR5GXA65CVOTSKXJRPUIXVJREX23DWXYHUC7PSCXD5277TIQSFTHYRRB4VPW4CVBVMD5FRGT7HEE4W6U" # eid export wy_spike_fp="e7f3d2960def70d91633928c492950b...
etl/parsers/etw/Microsoft_Windows_Hyper_V_Hypervisor.py
IMULMUL/etl-parser
104
11153718
# -*- coding: utf-8 -*- """ Microsoft-Windows-Hyper-V-Hypervisor GUID : 52fc89f8-995e-434c-a91e-199986449890 """ from construct import Int8sl, Int8ul, Int16ul, Int16sl, Int32sl, Int32ul, Int64sl, Int64ul, Bytes, Double, Float32l, Struct from etl.utils import WString, CString, SystemTime, Guid from etl.dtyp import Sid f...
tests/opytimizer/optimizers/evolutionary/test_iwo.py
anukaal/opytimizer
528
11153775
import numpy as np from opytimizer.optimizers.evolutionary import iwo from opytimizer.spaces import search np.random.seed(0) def test_iwo_params(): params = { 'min_seeds': 0, 'max_seeds': 5, 'e': 2, 'final_sigma': 0.001, 'init_sigma': 3 } new_iwo = iwo.IWO(params...
tensorflow/contrib/bayesflow/python/ops/hmc_impl.py
ryorda/tensorflow-viennacl
522
11153780
# Copyright 2017 The TensorFlow 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 applica...
setup.py
phrfpeixoto/python-redis-rate-limit
105
11153785
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup, find_packages with open('README.rst') as f: readme = f.read() with open('requirements.txt') as f: requires = f.readlines() setup( name='python-redis-rate-limit', version='0.0.7', description=u'Python Rate Limiter based o...
homeassistant/components/forecast_solar/energy.py
MrDelik/core
30,023
11153796
<filename>homeassistant/components/forecast_solar/energy.py """Energy platform.""" from __future__ import annotations from homeassistant.core import HomeAssistant from .const import DOMAIN async def async_get_solar_forecast( hass: HomeAssistant, config_entry_id: str ) -> dict[str, dict[str, float | int]] | None...
src/pretalx/common/migrations/0003_activitylog_is_orga_action.py
hrchu/pretalx
418
11153845
<filename>src/pretalx/common/migrations/0003_activitylog_is_orga_action.py # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-05-05 13:16 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("common", "0002_au...
examples/web_cookies.py
loven-doo/aiohttp
10,338
11153849
#!/usr/bin/env python3 """Example for aiohttp.web basic server with cookies. """ from pprint import pformat from typing import NoReturn from aiohttp import web tmpl = """\ <html> <body> <a href="/login">Login</a><br/> <a href="/logout">Logout</a><br/> <pre>{}</pre> </body> </html>""" ...
Sources/Workflows/SearchKippt/kippt/clips.py
yagosys/AlfredWorkflow.com
2,177
11153866
import requests import json class Clips: """Clips class Handles the clips endpoint of the Kippt API. """ def __init__(self, kippt): """ Instantiates a Clips object. Parameters: kippt - KipptAPI object """ self.kippt = kippt def all(self, **args): ...
alipay/aop/api/domain/AlipayAccountInstfundAccountSyncModel.py
antopen/alipay-sdk-python-all
213
11153868
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * from alipay.aop.api.domain.InstAccountDTO import InstAccountDTO class AlipayAccountInstfundAccountSyncModel(object): def __init__(self): self._inst_account = None @property def inst_ac...
pytest-virtualenv/pytest_virtualenv.py
manahl/pytest-plugins
282
11153898
""" Python virtual environment fixtures """ import os import pathlib import re import shutil import subprocess import sys from enum import Enum import importlib_metadata as metadata import pkg_resources from pytest import yield_fixture from pytest_shutil.workspace import Workspace from pytest_shutil import run, cmdli...
BruteScan/migrations/0002_remove_bruteresult_result_flag_bruteresult_password_and_more.py
b0bac/ApolloScanner
289
11153902
<filename>BruteScan/migrations/0002_remove_bruteresult_result_flag_bruteresult_password_and_more.py # Generated by Django 4.0.1 on 2022-03-09 12:17 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('BruteScan', '0001_initial'), ] operations = [ ...
examples/tutorial/visuals/T02_measurements.py
3DAlgoLab/vispy
2,617
11153923
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. # ----------------------------------------------------------------------------- "...
kaolin/ops/spc/points.py
tovacinni/kaolin
3,747
11153924
<gh_stars>1000+ # Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. # 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...
JetMETAnalysis/Configuration/python/JetMETAnalysis_OutputModules_cff.py
ckamtsikis/cmssw
852
11153933
<reponame>ckamtsikis/cmssw # The following comments couldn't be translated into the new config version: #sumETOutputModuleAODSIM & import FWCore.ParameterSet.Config as cms from JetMETAnalysis.METSkims.metHigh_OutputModule_cfi import * from JetMETAnalysis.METSkims.metLow_OutputModule_cfi import * #include "JetMETAnal...
ex39_sql_create/test.py
techieguy007/learn-more-python-the-hard-way-solutions
466
11153940
<filename>ex39_sql_create/test.py<gh_stars>100-1000 class Person(object): def __init__(self, first_name, last_name, age, pets): self.first_name = first_name self.last_name = last_name self.age = age self.pets = pets class Pet(object): def __init__(self, name, ...
examples/streamlit/08_sentence_embedding_manifolds.py
milyiyo/nlu
480
11153946
import nlu text= """You can visualize any of the 100 + Sentence Embeddings with 10+ dimension reduction algorithms and view the results in 3D, 2D, and 1D which can be colored by various classifier labels! """ nlu.enable_streamlit_caching() # Optional caching the models, recommended nlu.load('embed_sentence.bert').viz...
tester/test_model/test_reply2user.py
bukun/TorCMS
243
11153949
<reponame>bukun/TorCMS # -*- coding:utf-8 -*- from torcms.model.reply2user_model import MReply2User from torcms.model.reply_model import MReply from torcms.model.user_model import MUser class TestMReply2User(): def setup(self): print('setup 方法执行于本类中每条用例之前') self.user = MUser() self.reply =...
v2/client_server/heartbeat.py
Dilepa/micropython-async
443
11153979
# flash.py Heartbeat code for simple uasyncio-based echo server # Released under the MIT licence # Copyright (c) <NAME> 2019 import uasyncio as asyncio from sys import platform async def heartbeat(tms): if platform == 'pyboard': # V1.x or D series from pyb import LED led = LED(1) elif platf...
torch2trt/converters/dummy_converters.py
PogChamper/torch2trt
3,363
11153985
from torch2trt.torch2trt import * def is_private(method): method = method.split('.')[-1] # remove prefix return method[0] == '_' and method[1] != '_' def is_function_type(method): fntype = eval(method + '.__class__.__name__') return fntype == 'function' or fntype == 'builtin_function_or_method' or ...
src/app/integrations/s3.py
denkasyanov/education-backend
151
11153989
import boto3 from botocore.client import Config from django.conf import settings from django.utils.functional import cached_property class AppS3: """App-specific methods for directly calling s3 API""" @cached_property def client(self): session = boto3.session.Session() return session.clie...
sagemaker_neo_compilation_jobs/mxnet_mnist/get_input.py
jerrypeng7773/amazon-sagemaker-examples
2,610
11153995
<filename>sagemaker_neo_compilation_jobs/mxnet_mnist/get_input.py<gh_stars>1000+ import math from tkinter import * from tkinter import messagebox import numpy as np # track welcome status so we only display the welcome message once welcome = False # saved array size width = 28.0 height = 28.0 # scale from array siz...
third_party/shaderc/src/utils/update_build_version.py
zipated/src
2,151
11154001
<reponame>zipated/src #!/usr/bin/env python # Copyright 2016 The Shaderc 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/...
tests/numpy/signal.py
RoboticExplorationLab/micropython-ulab
232
11154012
<reponame>RoboticExplorationLab/micropython-ulab import math try: from ulab import numpy as np from ulab import scipy as spy except ImportError: import numpy as np import scipy as spy x = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], dtype=np.float) sos = np.array([[1, 2, 3, 1, 5, 6], [1, 2, 3, 1, 5, 6]],dt...
apps/web/migrations/0004_change_team_model_field_type.py
kaustubh-s1/EvalAI
1,470
11154025
<gh_stars>1000+ # -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2017-03-19 21:58 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("web", "0003_added_description_and_background_image_to_team_model") ] ...
tests/pytests/unit/states/postgresql/test_user.py
babs/salt
9,425
11154050
import pytest import salt.modules.postgres as postgres import salt.states.postgres_user as postgres_user from tests.support.mock import create_autospec, patch class ScramHash: def __eq__(self, other): return other.startswith("SCRAM-SHA-256$4096:") @pytest.fixture(name="db_args") def fixture_db_args(): ...
csaps/_sspumv.py
espdev/csaps
111
11154086
<gh_stars>100-1000 # -*- coding: utf-8 -*- """ Univariate/multivariate cubic smoothing spline implementation """ import functools from typing import Optional, Union, Tuple, List import numpy as np import scipy.sparse as sp import scipy.sparse.linalg as la from scipy.interpolate import PPoly from ._base import ISp...
dp/cloud/python/magma/db_service/migrations/versions/6234f59dd8e4_.py
tenpercent/magma
539
11154092
<gh_stars>100-1000 """empty message Revision ID: 6234f59dd8e4 Revises: b0cad5321c88 Create Date: 2022-02-09 10:14:55.021034 """ from alembic import op # revision identifiers, used by Alembic. revision = '6234f59dd8e4' down_revision = 'b0cad5321c88' branch_labels = None depends_on = None def upgrade(): """ ...
contrib/python/parso/py2/tests/normalizer_issue_files/allowed_syntax_python3.5.py
jochenater/catboost
6,989
11154106
<gh_stars>1000+ """ Mostly allowed syntax in Python 3.5. """ async def foo(): await bar() #: E901 yield from [] return #: E901 return '' # With decorator it's a different statement. @bla async def foo(): await bar() #: E901 yield from [] return #: E901 return ''
demos/unreal_proxies/two_drones/unreal_proxy.py
TUBSAPISS2018/DroneSimLab
122
11154131
<reponame>TUBSAPISS2018/DroneSimLab<filename>demos/unreal_proxies/two_drones/unreal_proxy.py # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 import zmq,pickle,time import struct import config from Wrappers import phandlers as ph import numpy as np import cv2 #needed texture objects in the unreal project drone_te...
gen_largest_num_frm_list.py
deepak5998/Py
726
11154133
# Write a function that given a list of non # negative integers, arranges them such that # they form the largest possible number. For # example, given [50, 2, 1, 9], the largest # formed number is 95021 from itertools import permutations def generate_largest_number(arr): gen_nums = [] for i in permutations(ar...
nodes/1.x/python/RevitLinkType.AttachmentType.py
andydandy74/ClockworkForDynamo
147
11154138
import clr clr.AddReference('RevitAPI') from Autodesk.Revit.DB import * links = UnwrapElement(IN[0]) def GetAttachmentType(link): if hasattr(link, "AttachmentType"): return link.AttachmentType.ToString() else: return None if isinstance(IN[0], list): OUT = [GetAttachmentType(x) for x in links] else: OUT = GetAttach...
pyfr/integrators/dual/phys/steppers.py
pv101/PyFR
185
11154159
# -*- coding: utf-8 -*- import math from pyfr.integrators.dual.phys.base import BaseDualIntegrator class BaseDualStepper(BaseDualIntegrator): pass class BaseDIRKStepper(BaseDualStepper): stepper_nregs = 1 def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) if self....
samples/vsphere/vcenter/hcl/compatibility_data_update_sample.py
JKraftman/vsphere-automation-sdk-python
589
11154188
<filename>samples/vsphere/vcenter/hcl/compatibility_data_update_sample.py #!/usr/bin/env python """ * ******************************************************* * Copyright (c) VMware, Inc. 2019. All Rights Reserved. * SPDX-License-Identifier: MIT * ******************************************************* * * DISCLAIMER. T...
capstone/capapi/tests/test_resources.py
ChefAndy/capstone
134
11154218
from elasticsearch.exceptions import RequestError import pytest from capapi.documents import CaseDocument from capapi.resources import parallel_execute @pytest.mark.django_db(databases=['capdb']) def test_parallel_execute(three_cases, elasticsearch): # run search in parallel expected_ids = [str(three_cases[0...
doc/tutorials_src/model_selection.py
fatiando/verde
415
11154237
# Copyright (c) 2017 The Verde Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause # # This code is part of the Fatiando a Terra project (https://www.fatiando.org) # """ .. _model_selection: Model Selection =============== In :ref:`model_evaluation`, we saw h...
attic/win32/toga_win32/widgets/container.py
luizoti/toga
1,261
11154261
from toga_cassowary.widget import Container as CassowaryContainer class Win32Container(object): def add(self, widget): pass class Container(CassowaryContainer): def _create_container(self): # No impl is required for a container, but we need a placeholder # to keep the cross-platform ...
translator/utils.py
ttslr/gtos
172
11154288
<gh_stars>100-1000 import torch from torch import nn import math import numpy as np def move_to_device(maybe_tensor, device): if torch.is_tensor(maybe_tensor): return maybe_tensor.to(device) elif isinstance(maybe_tensor, np.ndarray): return torch.from_numpy(maybe_tensor).to(device).contiguous()...
hkust-gmission/gmission/models/crowdsourcing.py
gmission/gmission
251
11154296
__author__ = 'chenzhao' from base import * # type = text / image / selection class HIT(db.Model, BasicModelMixin): __tablename__ = 'hit' id = db.Column(db.Integer, primary_key=True) type = db.Column(db.String(20)) title = db.Column(db.String(500)) description = db.Column(db.TEXT) attachment_...
6-consumer/lessons/4-multiple-language-support/code/functions/smart-timer-trigger/text-to-speech/__init__.py
Iftu119/IoT-For-Beginners
9,718
11154317
import io import os import requests import librosa import soundfile as sf import azure.functions as func location = os.environ['SPEECH_LOCATION'] speech_key = os.environ['SPEECH_KEY'] def get_access_token(): headers = { 'Ocp-Apim-Subscription-Key': speech_key } token_endpoint = f...
osbrain/address.py
RezaBehzadpour/osbrain
176
11154329
""" Implementation of address-related features. """ from ipaddress import ip_address import zmq from .common import unique_identifier def address_to_host_port(addr): """ Try to convert an address to a (host, port) tuple. Parameters ---------- addr : str, SocketAddress Returns ------- ...
tests/files/crawl_settings.py
dimichxp/grab
2,266
11154345
GRAB_SPIDER_CONFIG = { 'global': { 'spider_modules': ['tests.script_crawl'], }, }
pmdarima/utils/tests/test_array.py
tuomijal/pmdarima
736
11154394
from pmdarima.utils.array import diff, diff_inv, c, is_iterable, as_series, \ check_exog from pmdarima.utils import get_callable from numpy.testing import assert_array_equal, assert_array_almost_equal import pytest import pandas as pd import numpy as np x = np.arange(5) m = np.array([10, 5, 12, 23, 18, 3, 2, 0, ...
qutip/tests/test_spmath.py
camponogaraviera/qutip
1,205
11154404
<gh_stars>1000+ import numpy as np from numpy.testing import (run_module_suite, assert_, assert_equal, assert_almost_equal) import scipy.sparse as sp from qutip.fastsparse import fast_csr_matrix, fast_identity from qutip.random_objects import (rand_dm, rand_herm, ...
momentumnet-main/examples/drop_in_replacement_advanced.py
ZhuFanCheng/Thesis
188
11154411
<reponame>ZhuFanCheng/Thesis """ ====================================================== From ResNets to Momentum ResNets 3) ====================================================== This illustrates on a more complex example how to replace an existing ResNet with a MomentumNet. <NAME>, <NAME>, <NAME>, <NAME>. Momentum ...
tests/test_model.py
MughilM/luke
467
11154415
<filename>tests/test_model.py<gh_stars>100-1000 import functools import operator import pytest import torch from transformers import AutoConfig, AutoModel from luke.model import EntityEmbeddings, LukeConfig, LukeModel BERT_MODEL_NAME = "bert-base-uncased" @pytest.fixture def bert_config(): bert_config = AutoCo...
terrascript/provider/hashicorp/google_beta.py
mjuenema/python-terrascript
507
11154431
# terrascript/provider/hashicorp/google_beta.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:17:17 UTC) import terrascript class google_beta(terrascript.Provider): """terraform-provider-google-beta""" __description__ = "terraform-provider-google-beta" __namespace__ = "hashicorp" __...
.modules/.recon-ng/modules/recon/domains-contacts/whois_pocs.py
termux-one/EasY_HaCk
1,103
11154439
from recon.core.module import BaseModule from urlparse import urlparse class Module(BaseModule): meta = { 'name': 'Whois POC Harvester', 'author': '<NAME> (@LaNMaSteR53)', 'description': 'Uses the ARIN Whois RWS to harvest POC data from whois queries for the given domain. Updates the \'con...
phrase2vec.py
bright1993ff66/emoji2vec
173
11154443
<filename>phrase2vec.py<gh_stars>100-1000 #!/usr/bin/env python """Wrapper for word2vec and emoji2vec models, so that we can query by entire phrase, rather than by individual words. """ # External dependencies import os.path import gensim.models as gs import numpy as np # Authorship __author__ = "<NAME>, <NAME>" __em...
Dark Souls/print__stats/common.py
DazEB2/SimplePyScripts
117
11154474
<reponame>DazEB2/SimplePyScripts #!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' import requests from bs4 import BeautifulSoup def get_parsed_two_column_table_stats(url: str) -> [(str, str)]: rs = requests.get(url) root = BeautifulSoup(rs.content, 'html.parser') table = root.se...
neural tensor network/ntn_model.py
kishormishra3/DeepLearn
1,756
11154483
# -*- coding: utf-8 -*- import glob import ntn_input from ntn import * import random import keras dimx,dimy = 100,100 corrupt_samples = 1 thres = 0.023 warnings.simplefilter("ignore") '''def word2vec_embedding_layer(embedding_matrix): #weights = np.load('Word2Vec_QA.syn0.npy') layer = Embedd...
clarifai/rest/grpc/proto/clarifai/api/cluster_pb2.py
Taik/clarifai-python
322
11154489
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: proto/clarifai/api/cluster.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import r...
examples/csj/visualization/decode_ctc.py
sundogrd/tensorflow_end2end_speech_recognition
351
11154518
<filename>examples/csj/visualization/decode_ctc.py #! /usr/bin/env python # -*- coding: utf-8 -*- """Decode the trained CTC outputs (CSJ corpus).""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from os.path import join, abspath import sys import tensorf...
segmappy/bin/plot_reconstructions.py
Oofs/segmap
771
11154520
<gh_stars>100-1000 from __future__ import print_function from builtins import input import numpy as np import os import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import random from sklearn import metrics import ensure_segmappy_is_installed from segmappy import Dataset from segmappy.tools.import_...
histoqc/_pipeline.py
kaczmarj/HistoQC
140
11154527
"""histoqc._pipeline helper utilities for running the HistoQC pipelines """ import glob import logging import multiprocessing import os import platform import shutil import threading import warnings from contextlib import ExitStack from contextlib import contextmanager from contextlib import nullcontext from importli...
parakeet/frontend/pinyin.py
zh794390558/DeepSpeech
501
11154565
<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/licenses/LICENSE-2.0 # # Unles...
diffadjust/blkdiff.py
kevaundray/research
1,351
11154576
<gh_stars>1000+ import math, random hashpower = [float(x) for x in open('hashpower.csv').readlines()] # Target block time TARGET = 12 # Should be 86400, but can reduce for a quicker sim SECONDS_IN_DAY = 86400 # Look at the 1/x day exponential moving average EMA_FACTOR = 0.01 # Damping factor for simple difficulty adj...
tests/integration/conftest.py
lvijnck/tavern
889
11154607
<gh_stars>100-1000 import pytest @pytest.fixture def str_fixture(): return "abc-fixture-value" @pytest.fixture(name="yield_str_fixture") def sdkofsok(str_fixture): yield str_fixture @pytest.fixture(name="yielder") def bluerhug(request): # This doesn't really do anything at the moment. In future it mig...
vilya/views/api/teams/__init__.py
mubashshirjamal/code
1,582
11154661
<reponame>mubashshirjamal/code # -*- coding: utf-8 -*- from vilya.views.api.team import TeamUI _q_exports = [] def _q_lookup(request, name): return TeamUI(name) def _q_access(request): request.response.set_content_type('application/json; charset=utf-8')
koku/masu/test/database/test_mini_transaction_delete.py
rubik-ai/koku
157
11154672
# # Copyright 2021 Red Hat Inc. # SPDX-License-Identifier: Apache-2.0 # """Test the mini_transaction_delete utility function.""" import os from unittest.mock import patch from api.provider.models import Sources from koku.env import ENVIRONMENT from masu.database.koku_database_access import mini_transaction_delete from...
Configuration/ProcessModifiers/python/premix_stage2_cff.py
ckamtsikis/cmssw
852
11154691
import FWCore.ParameterSet.Config as cms # This modifier is for the premixing stage2, i.e. mixing the premixed pileup library with the signal event premix_stage2 = cms.Modifier()
src/escpos/magicencode.py
cohorte/python-escpos
683
11154710
#!/usr/bin/python # -*- coding: utf-8 -*- """ Magic Encode This module tries to convert an UTF-8 string to an encoded string for the printer. It uses trial and error in order to guess the right codepage. The code is based on the encoding-code in py-xml-escpos by @fvdsn. :author: `<NAME> <<EMAIL>>`_ :organization: `p...
tests/test_crle.py
advmach/detools
119
11154731
<filename>tests/test_crle.py<gh_stars>100-1000 import unittest import detools from detools.create import CrleCompressor from detools.apply import CrleDecompressor class DetoolsCrleTest(unittest.TestCase): def test_compress(self): datas = [ ( [b''], b'\x00\x00'), ...
ensemble_submits/ensemble.py
tecufly/TextClassify
216
11154734
<filename>ensemble_submits/ensemble.py import pandas as pd import numpy as np #vote 文件 submits_path='./submits' #需要进行vote的文件 submits = ['0.82414645.csv','0.8172323.csv','0.81546885000.csv'] #vote时文件的权重 file_weight = [3,2,2] #vote时标签的权重 label_weight =[1,1,1] files = [] data = [] for f in submits: if 'csv' in f: ...
check/validate/client.py
siddhya/gstwebrtc-demos
451
11154784
<reponame>siddhya/gstwebrtc-demos # Copyright (c) 2020, <NAME> <<EMAIL>> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any lat...
physics_planning_games/board_games/_internal/pieces.py
mitchchristow/deepmind-research
10,110
11154834
# Copyright 2020 DeepMind Technologies Limited. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
zat/log_to_dataframe.py
SuperCowPowers/zat
146
11154869
"""LogToDataFrame: Converts a Zeek log to a Pandas DataFrame""" # Third Party import pandas as pd # Local from zat import zeek_log_reader class LogToDataFrame(object): """LogToDataFrame: Converts a Zeek log to a Pandas DataFrame Notes: This class has recently been overhauled from a simple l...
openbook_auth/migrations/0051_auto_20191209_1338.py
TamaraAbells/okuna-api
164
11154911
# Generated by Django 2.2.5 on 2019-12-09 12:38 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('openbook_auth', '0050_auto_20191209_1335'), ] operations = [ migrations.AlterField( model_name='usernotificationssubscription', ...
custom_components/samsungtv_custom/samsungctl_080b/remote_encrypted/rijndael/__init__.py
AdamOttvar/ha-samsungtv-custom
117
11154925
from .rijndael import Rijndael
fpn/demo.py
LZP4GitHub/RoITransformer_DOTA
200
11154964
<reponame>LZP4GitHub/RoITransformer_DOTA<gh_stars>100-1000 # -------------------------------------------------------- # Deformable Convolutional Networks # Copyright (c) 2017 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by <NAME>, <NAME> # ----------------------------------------------...
tools/ivwpy/regression/database.py
alexanderbock/inviwo
349
11154994
#********************************************************************************* # # Inviwo - Interactive Visualization Workshop # # Copyright (c) 2013-2021 Inviwo Foundation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the f...
ch05/5.1.1.py
AaronZhengkk/SpiderBook
990
11155010
<gh_stars>100-1000 #coding:utf-8 import json from bs4 import BeautifulSoup import requests user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' headers={'User-Agent':user_agent} r = requests.get('http://seputu.com/',headers=headers) soup = BeautifulSoup(r.text,'html.parser',from_encoding='utf-8')#html.parser c...
tests/star_wars_data.py
artofhuman/graphql-relay-py
124
11155015
"""This defines a basic set of data for our Star Wars Schema. This data is hard coded for the sake of the demo, but you could imagine fetching this data from a backend service rather than from hardcoded JSON objects in a more complex demo. """ from typing import List, NamedTuple, Optional class Ship(NamedTuple): ...
bin/colorchart.py
stefanholek/blessed
826
11155076
# -*- coding: utf-8 -*- """ Utility to show X11 colors in 24-bit and downconverted to 256, 16, and 8 colors. The time to generate the table is displayed to give an indication of how long each algorithm takes compared to the others. """ # std imports import sys import timeit import colorsys # local import blessed from...
Demo/scripts/script.py
cemeyer/tauthon
473
11155080
<reponame>cemeyer/tauthon #! /usr/bin/env python # script.py -- Make typescript of terminal session. # Usage: # -a Append to typescript. # -p Use Python as shell. # Author: <NAME>. import os, time, sys, getopt import pty def read(fd): data = os.read(fd, 1024) script.write(data) ret...
tests/openbb_terminal/cryptocurrency/overview/test_blockchaincenter_model.py
tehcoderer/GamestonkTerminal
255
11155103
<filename>tests/openbb_terminal/cryptocurrency/overview/test_blockchaincenter_model.py import pytest from openbb_terminal.cryptocurrency.overview import blockchaincenter_model @pytest.mark.skip @pytest.mark.vcr @pytest.mark.parametrize( "days,since,until", [ (365, 1_601_596_800, 1_641_573_787), ...
CV/SemSegPaddle/src/models/backbone/hrnet.py
pkulzb/Research
1,319
11155115
# coding: utf8 # copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
modules/google-earth-engine/docker/sepal-ee/sepal/ee/temporal_segmentation/harmonic_fit.py
BuddyVolly/sepal
153
11155116
import ee import math J_DAYS = 0 FRACTIONAL_YEARS = 1 UNIX_TIME_MILLIS = 2 def fitImage(coefs, t, dateFormat, harmonics): return ee.ImageCollection( fit(t, dateFormat, harmonics, lambda index: coefs.arrayGet([index])) ) \ .reduce(ee.Reducer.sum()) \ .regexpRename('(.*)_coefs_sum', '$1...
swampdragon/management/commands/runsd.py
aswinkp/swampdragon
366
11155120
<filename>swampdragon/management/commands/runsd.py from django.core.management.base import BaseCommand from swampdragon.swampdragon_server import run_server class Command(BaseCommand): args = '<host_port>' def handle(self, *args, **options): host_port = None if args: host_por...
examples/websockets_lib/app.py
mrmilu/graphql-ws
272
11155152
from graphql_ws.websockets_lib import WsLibSubscriptionServer from graphql.execution.executors.asyncio import AsyncioExecutor from sanic import Sanic, response from sanic_graphql import GraphQLView from schema import schema from template import render_graphiql app = Sanic(__name__) @app.listener("before_server_start...
tests/algorithms/test_job_normalizers_elasticsearch.py
bhagyaramgpo/skills-ml
147
11155154
import httpretty import json import re from skills_utils.es import basic_client from skills_ml.algorithms.job_normalizers.elasticsearch import NormalizeTopNIndexer def mock_job_posting_generator(postings): return lambda s3_conn, quarter: (json.dumps(post) for post in postings) @httpretty.activate def test_nor...
model_search/controller.py
dywsjtu/model_search
3,315
11155175
<filename>model_search/controller.py # 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 app...
tests/test_all_tables_e2e/test_porcelain_table.py
mgedmin/terminaltables
742
11155209
"""PorcelainTable end to end testing.""" from terminaltables import PorcelainTable def test_single_line(): """Test single-lined cells.""" table_data = [ ['Name', 'Color', 'Type'], ['Avocado', 'green', 'nut'], ['Tomato', 'red', 'fruit'], ['Lettuce', 'green', 'vegetable'], ...
tests/utils.py
pbulteel/python-hpilo
245
11155233
import unittest import ConfigParser import json import os import sys import time import re testroot = os.path.dirname(__file__) sys.path.insert(0, os.path.dirname(testroot)) import hpilo import warnings warnings.filterwarnings("ignore", category=hpilo.IloWarning) class FirmwareCache(object): def __init__(self): ...