max_stars_repo_path
string
max_stars_repo_name
string
max_stars_count
int64
id
string
content
string
add_param_types
int64
add_return_types
int64
add_class_field_types
int64
add_instance_field_types
int64
add_total
int64
add_error
int64
discovery-provider/alembic/versions/92571f94989a_add_trending_views.py
Tenderize/audius-protocol
429
1717932
"""add trending views Revision ID: 92571f94989a Revises: 65ec7a3171c7 Create Date: 2021-09-22 16:27:23.281441 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = "92571f94989a" down_revision = "65ec7a3171c7" branch_labels = None depends_on = None def upgrade(): ...
0
0
0
0
0
0
python/ql/test/library-tests/ControlFlow/ssa/vars/test5.py
vadi2/codeql
4,036
1717939
<reponame>vadi2/codeql<filename>python/ql/test/library-tests/ControlFlow/ssa/vars/test5.py if x: def a(): pass else: def a(): pass
0
0
0
0
0
0
drafts/rec/rec/clean_all.py
kstepanmpmg/mldb
665
1717965
import sys from pymldb import Connection from rec.settings import HOST, PREFIX if __name__ == '__main__': if len(sys.argv) > 1: whats = sys.argv[1:] else: whats = ['datasets', 'procedures', 'functions'] mldb = Connection(HOST) prefix = PREFIX for what in whats: for x in ge...
0
0
0
0
0
0
examples/labFrame.py
tgolsson/appJar
666
1717983
<reponame>tgolsson/appJar import sys sys.path.append("..") from appJar import gui def press(btn): text = app.textBox("New title", "Enter a new title:") app.setLabelFrameTitle("Songs", text) def setAnchor(anchor): app.setLabelFrameAnchor("Songs", anchor.lower()) app = gui() app.addLabel("header", "The hea...
0
0
0
0
0
0
jet_django/views/message.py
lukejamison/jet-dasboard
193
1717987
<filename>jet_django/views/message.py from jet_django.deps.rest_framework import views from jet_django.deps.rest_framework.response import Response from jet_django.mixins.cors_api_view import CORSAPIViewMixin from jet_django.permissions import HasProjectPermissions from jet_django.serializers.message import MessageSeri...
0
0
0
0
0
0
src/numbers_parser/generated/TNCommandArchives_sos_pb2.py
jessie-murray/numbers-parser
110
1717989
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: TNCommandArchives_sos.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from ...
0
0
0
0
0
0
pykg2vec/utils/riemannian_optimizer.py
emilbaekdahl/pykg2vec
430
1717992
from __future__ import annotations import torch from torch.optim.optimizer import Optimizer class RiemannianOptimizer(Optimizer): """Riemannian stochastic gradient descent""" def __init__(self, params, lr, param_names): defaults = dict(lr=lr) super(RiemannianOptimizer, self).__init__(params, ...
1
6
0
0
7
0
web/server/tests/unit/test_ccldap.py
ryankurte/codechecker
1,601
1717993
<filename>web/server/tests/unit/test_ccldap.py # ------------------------------------------------------------------------- # # Part of the CodeChecker project, under the Apache License v2.0 with # LLVM Exceptions. See LICENSE for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # # ----...
0
0
0
0
0
0
python/test/nbla_test_utils.py
daniel-falk/nnabla
2,792
1718010
<gh_stars>1000+ # Copyright 2017,2018,2019,2020,2021 Sony Corporation. # Copyright 2021 Sony Group Corporation. # # 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/l...
0
0
0
0
0
0
thrift-logger-python/thrift_logger/thrift_libs/ttypes.py
leofuxiaohui/singer
151
1718027
# # Autogenerated by Thrift Compiler (0.8.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py:dynamic,dynbase=TBase,dynimport=from thrift.protocol.TBase import TBase; from thrift.protocol.TBase import TExceptionBase; from thrift.Thrift import TApplicationException,slots # fr...
7
0
4
0
11
0
tests/functional/services/api/accounts/users/test_delete.py
rbrady/anchore-engine
1,484
1718085
import pytest from tests.functional.services.api.accounts.users import create_ft_account_user from tests.functional.services.api.conftest import FT_ACCOUNT, USER_API_CONFS from tests.functional.services.utils.http_utils import APIResponse, http_del @pytest.mark.parametrize("api_conf", USER_API_CONFS) class TestAdmin...
0
0
0
0
0
0
package/awesome_panel/designer/views/__init__.py
Jhsmit/awesome-panel
179
1718090
"""Exports Views""" from .error_view import ErrorView
0
0
0
0
0
0
rlkit/rlkit/demos/source/path_loader.py
hbutsuak95/iv_rl
1,662
1718096
<reponame>hbutsuak95/iv_rl from collections import OrderedDict import numpy as np import torch import torch.optim as optim from torch import nn as nn import torch.nn.functional as F import rlkit.torch.pytorch_util as ptu from rlkit.core.eval_util import create_stats_ordered_dict from rlkit.torch.torch_rl_algorithm im...
0
0
0
0
0
0
saleor/order/migrations/0098_discounts_relation.py
fairhopeweb/saleor
15,337
1718115
<gh_stars>1000+ from django.db import migrations, models from django.db.models import F def calculate_undiscounted_total_values(apps, *_args, **_kwargs): Order = apps.get_model("order", "Order") Order.objects.update( undiscounted_total_gross_amount=F("total_gross_amount") + F("discount_amount") ) ...
0
0
0
0
0
0
tests/openbb_terminal/stocks/technical_analysis/test_tradingview_view.py
tehcoderer/GamestonkTerminal
255
1718116
# IMPORTATION STANDARD # IMPORTATION THIRDPARTY import pytest # IMPORTATION INTERNAL from openbb_terminal.stocks.technical_analysis import tradingview_view @pytest.fixture(scope="module") def vcr_config() -> dict[str,list[tuple[str, str]]]: return { "filter_query_parameters": [ ("apikey", "M...
0
1
0
0
1
0
alipay/aop/api/domain/ServiceBase.py
antopen/alipay-sdk-python-all
213
1718117
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import annotations import json from alipay.aop.api.constant.ParamConstants import * class ServiceBase(object): def __init__(self): self._service_carrier_url: None = None self._service_code: None = None self._service_logo: None...
0
8
0
6
14
0
odin/strategy/templates/buy_and_hold_strategy.py
gsamarakoon/Odin
103
1718130
<gh_stars>100-1000 import pandas as pd from ..abstract_strategy import AbstractStrategy from ...utilities.mixins.strategy_mixins import ( LongStrategyMixin, EqualBuyProportionMixin, DefaultPriorityMixin, DefaultFeaturesMixin, AlwaysBuyIndicatorMixin, NeverSellIndicatorMixin, NeverExitIndicat...
0
0
0
0
0
0
scripts/generate_playbook_descriptions.py
kandahk/robusta
273
1718161
from __future__ import annotations import argparse import importlib import inspect import os import glob from typing import Callable from pydantic import BaseModel class PlaybookDescription(BaseModel): function_name: str docs: str = None src: str src_file: str action_params: dict = None def get_...
1
2
5
0
8
0
custom_components/tahoma/switch.py
iMicknl/ha-tahoma
130
1718166
"""Support for Overkiz switches.""" from typing import Any, Optional from homeassistant.components.cover import DOMAIN as COVER from homeassistant.components.switch import ( DEVICE_CLASS_SWITCH, DOMAIN as SWITCH, SwitchEntity, ) from homeassistant.config_entries import ConfigEntry from homeassistant.const ...
7
6
1
2
16
0
data/preprocess_iharmony4.py
zhanghongyong123456/RainNet
102
1718199
import os import cv2 from tqdm import tqdm import argparse def parsePaths(path) -> tuple[object, object, object]: name_parts=path.split('_') mask_path = path.replace('composite_images','masks') mask_path = mask_path.replace(('_'+name_parts[-1]),'.png') target_path = path.replace('composite_ima...
0
1
0
0
1
0
fun/data/genBesselInteger.py
wtsia/gosl
1,811
1718202
import scipy.special as sp import numpy as np # Reference: # [1] <NAME>, Stegun IA (1972) Handbook of Mathematical Functions with Formulas, Graphs, # and Mathematical Tables. U.S. Department of Commerce, NIST # generate tables 9.* starting at page 390 of [1] def gentable(X): # header l = '%5s %18s %13s...
0
0
0
0
0
0
peeringdb/migrations/0011_contact.py
schiederme/peering-manager
173
1718211
# Generated by Django 2.2.7 on 2019-11-23 11:05 from django.db import migrations, models class Migration(migrations.Migration): dependencies: list[tuple[str, str]] = [("peeringdb", "0010_auto_20190417_1851")] operations: list[object] = [ migrations.CreateModel( name="Contact", ...
0
0
2
0
2
0
hw/ip/otbn/util/shared/bit_ranges.py
asb/opentitan
1,375
1718230
<filename>hw/ip/otbn/util/shared/bit_ranges.py # Copyright lowRISC contributors. # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 import re from typing import List, Tuple class BitRanges: '''Represents the bit ranges used for a field in an encoding ...
0
0
0
0
0
0
kibitzr/storage.py
paulmassen/kibitzr
478
1718243
from __future__ import annotations import os import itertools import io import shutil from kibitzr.compat import sh from .utils import normalize_filename def report_changes(conf, content) -> object: return PageHistory(conf).report_changes(content) class PageHistory(object): """ Single file changes his...
3
8
1
0
12
0
scripts/taiseilib/version.py
kasymovga/taisei
573
1718249
from __future__ import annotations from . import common import sys import subprocess import shlex import re class VerionFormatError(common.TaiseiError): pass class Version(object): regex = re.compile(r'^v?(\d+)(?:\.(\d+)(?:\.(\d+))?)?(?:[-+](\d+))?(?:[-+](.*))?$') def _make_string(self) -> object: ...
3
5
0
0
8
0
CommonLayerCode/datalake-library/python/datalake_library/octagon/__init__.py
davidwebstar34/codepipeline-lambda-docker-images
267
1718292
<gh_stars>100-1000 import logging from .__version__ import __version__, __title__ # noqa: F401; from .event import EventReasonEnum # noqa: F401; from .client import OctagonClient # noqa: F401; from .artifact import Artifact # noqa: F401; name = "octagon" # Suppress boto3 logging logging.getLogger("boto3").setLev...
0
0
0
0
0
0
se/commands/word_count.py
vr8hub/tools
985
1718327
<reponame>vr8hub/tools """ This module implements the `se word-count` command. """ import argparse import chardet import regex import se import se.formatting NOVELLA_MIN_WORD_COUNT = 17500 NOVEL_MIN_WORD_COUNT = 40000 def word_count(plain_output: bool) -> int: """ Entry point for `se word-count` """ parser =...
0
0
0
0
0
0
python/src/cm_api_tests/test_snapshot.py
zcjtom/cm_api
329
1718332
# Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file ex...
0
1
0
0
1
0
b3/composites/ornode.py
justjosias/IKBT
129
1718344
from __future__ import annotations import b3 # run all the children (regardless of status) # return success if any child succeeds # equvalent to logical OR # added by <NAME> 06/2017 # Copyright 2017 University of Washington # Developed by <NAME> <dianmuz at uw.edu> and # <NAME> <blake at uw.edu> # BioRobotics Lab, U...
1
1
0
1
3
0
python/tests/__init__.py
krossruiz/pb3
4,317
1718354
<filename>python/tests/__init__.py from unityagents import * from unitytrainers import *
0
0
0
0
0
0
examples/template/template/service.py
edustaff/spyne
786
1718380
# you can put your own Service class definitions here.
0
0
0
0
0
0
recipes/Python/502226_Download_file_viTrivial_File_Transfer_Protocol/recipe-502226.py
tdiprima/code
2,023
1718384
#!/usr/bin/env python import sys, logging, os from optparse import OptionParser import tftpy def main(): usage="" parser = OptionParser(usage=usage) parser.add_option('-H', '--host', action='store', dest='host', help='...
0
0
0
1
1
0
pymagnitude/third_party/allennlp/tests/models/bimpm_test.py
tpeng/magnitude
1,520
1718390
<filename>pymagnitude/third_party/allennlp/tests/models/bimpm_test.py # pylint: disable=no-self-use,invalid-name from __future__ import division from __future__ import absolute_import from allennlp.common.testing import ModelTestCase class TestBiMPM(ModelTestCase): def setUp(self): super(TestBiMPM, sel...
0
0
0
0
0
0
SimCalorimetry/EcalTrigPrimProducers/python/ecalTriggerPrimitiveDigis_CosmicsConfiguration_cff.py
ckamtsikis/cmssw
852
1718396
<gh_stars>100-1000 import FWCore.ParameterSet.Config as cms # TP Emulator Producer: from CalibCalorimetry.Configuration.Ecal_FakeConditions_cff import * # Ecal Trig Prim module simEcalTriggerPrimitiveDigis = cms.EDProducer("EcalTrigPrimProducer", BarrelOnly = cms.bool(True), TTFHighEnergyEB = cms.double(1.0)...
0
0
0
0
0
0
.github/misc_scripts/dg-test-tuner.py
aolin480/openpilot
121
1718410
import matplotlib.pyplot as plt import numpy as np from selfdrive.config import Conversions as CV x = [0.0, 1.4082, 2.8031, 4.2266, 5.3827, 6.1656, 7.2478, 8.2831, 10.2447, 12.964, 15.423, 18.119, 20.117, 24.4661, 29.0581, 32.7101, 35.7633] y = [0.218, 0.222, 0.233, 0.25, 0.273, 0.294, 0.337, 0.362, 0.38, 0.389, 0.398...
0
0
0
0
0
0
vlcp/event/lock.py
hubo1016/vlcp
252
1718413
from __future__ import annotations ''' Created on 2015/12/14 :author: hubo Lock is created by limiting queue length of LockEvent, so there is only one event in the queue. Other send request is blocked by the queue. ''' from vlcp.event.event import Event, withIndices from vlcp.event.pqueue import CBQueue from vlcp.eve...
5
7
1
3
16
0
tests/test_states_group.py
andrew-ld/aiogram
2,744
1718421
import pytest from aiogram.dispatcher.filters.state import State, StatesGroup, any_state, default_state class MyGroup(StatesGroup): state = State() state_1 = State() state_2 = State() class MySubGroup(StatesGroup): sub_state = State() sub_state_1 = State() sub_state_2 = State...
0
0
0
0
0
0
main_tf.py
Joffrey-Liu/Dilation-FCN
145
1718428
<reponame>Joffrey-Liu/Dilation-FCN<filename>main_tf.py import tensorflow as tf import pickle import cv2 import os import os.path as path from utils import predict from model import dilation_model_pretrained from datasets import CONFIG if __name__ == '__main__': # Choose between 'cityscapes' and 'camvid' data...
0
0
0
0
0
0
Topology_generator/topo_proc.py
bbhunter/AutoPentest-DRL
186
1718434
import os import sys import json import random from random import choice from jinja2 import Environment, select_autoescape, FileSystemLoader TOPOLOGY_PATH = "MulVAL_P/" GENERATION_TOPOLOGY_TEMPLATE = "topology_template.P" GENERATION_TOPO_GEN_TEMPLATE = "topo_gen_template.P" env = Environment(loader=FileSystemLoader('....
0
0
0
0
0
0
ote_sdk/ote_sdk/usecases/evaluation/performance_provider_interface.py
ntyukaev/training_extensions
775
1718454
<reponame>ntyukaev/training_extensions<gh_stars>100-1000 """ This module contains interface for performance providers. """ # Copyright (C) 2021-2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 # import abc from ote_sdk.entities.metrics import Performance class IPerformanceProvider(metaclass=abc.ABCMet...
0
0
0
0
0
0
python/115_Distinct_Subsequences.py
dvlpsh/leetcode-1
4,416
1718491
class Solution(object): def numDistinct(self, s, t) -> object: """ :type s: str :type t: str :rtype: int """ # https://discuss.leetcode.com/topic/51131/space-o-mn-and-o-n-python-solutions dp = [[0 for j in xrange(0, len(t) + 1)] for i in xrange(0, len(s) + 1)]...
0
1
0
0
1
0
gists/seamlessClone.py
18721017183/text_renderer-master
1,119
1718503
from PIL import ImageFont, Image, ImageDraw import numpy as np import cv2 # bg_path = '/home/cwq/code/ocr_end2end/text_gen/bg/000000088218.jpg' from gists.outline import draw_border_text bg_path = '/home/cwq/code/text_renderer/data/bg/paper1.png' font_path = '/home/cwq/code/ocr_end2end/text_gen/fonts/chn/msyh.ttc' C...
0
0
0
0
0
0
optimus_manager/hacks/manjaro.py
heinrichmalan/optimus-manager
1,694
1718528
import os from ..log_utils import get_logger MHWD_CONF_PATH = "/etc/X11/xorg.conf.d/90-mhwd.conf" def remove_mhwd_conf(): logger = get_logger() try: os.remove(MHWD_CONF_PATH) logger.info( "Found MHWD-generated Xorg config file at %s. Removing.", MHWD_CONF_PATH) except FileNo...
0
0
0
0
0
0
plugins/shell-proxy/ssh-proxy.py
upperbounds/oh-my-zsh
86,823
1718584
<gh_stars>1000+ #!/usr/bin/env python3 import os import subprocess import sys from urllib.parse import urlparse proxy = next(os.environ[_] for _ in ("HTTP_PROXY", "HTTPS_PROXY") if _ in os.environ) parsed = urlparse(proxy) proxy_protocols = { "http": "connect", "https": "connect", "socks": "5", "sock...
0
0
0
0
0
0
Practice/Coding Blocks/Competitive Warriors Challenge 3.0/Find Upper and Lower bound.py
cnm06/Competitive-Programming
994
1718590
n = int(raw_input()) data = [int(i) for i in raw_input().split()] q = int(raw_input()) for i in xrange(q): x = int(raw_input()) if x in data: print data.index(x), print len(data) - 1 - data[::-1].index(x) else: print -1, print -1
0
0
0
0
0
0
DjangoTutorial_v3.5/lesson1/task1/tests_subtask2.py
behzod/pycharm-courses
213
1718617
<gh_stars>100-1000 from test_helper import run_common_tests, failed, passed, get_answer_placeholders, test_is_initial_text, \ test_is_not_empty, test_answer_placeholders_text_deleted, do_not_run_on_check def test_answer_placeholders(): placeholders = get_answer_placeholders() placeholder = placeholders[0]...
0
0
0
0
0
0
modules/smtp/strong_password/files/smtpd_server/secure_smtpd/__init__.py
zdresearch/Python-Honeypot
186
1718627
import secure_smtpd.config from secure_smtpd.config import LOG_NAME from .smtp_server import SMTPServer
0
0
0
0
0
0
example/geopage/apps.py
eduardocp/wagtail-geo-widget
105
1718643
from __future__ import unicode_literals from django.apps import AppConfig class GeopageConfig(AppConfig): name: str = 'geopage'
0
0
1
0
1
0
examples/paramiko_expect-demo-helper.py
dgonzalez-cs/paramiko-expect
158
1718715
#!/usr/bin/env python # # Paramiko Expect Demo Helper # # Written by <NAME> # http://github.com/fgimian # # This interactive script is used to help demonstrate the paramiko_expect-demo.py # script from __future__ import print_function import sys if sys.version_info.major == 3: raw_input = input def main(): ...
0
0
0
0
0
0
theonionbox/tob/system/windows/__init__.py
ralphwetzel/theonionbox
120
1718737
<reponame>ralphwetzel/theonionbox from typing import Optional, Callable from datetime import datetime, timedelta import inspect import logging import os.path import re import subprocess import time from .. import BaseSystem class Windows(BaseSystem): def __init__(self): super(Windows, self).__init__() ...
0
0
0
0
0
0
worldengine/model/__init__.py
ctittel/worldengine
946
1718753
__author__ = 'federico'
0
0
0
0
0
0
tools/get_dataset_stats.py
Woffee/deformer
114
1718770
<filename>tools/get_dataset_stats.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- import argparse import os import re from collections import Counter, defaultdict import json_lines from tqdm import tqdm def word_tokenize(text): """Split on whitespace and punctuation.""" return re.findall(r'\w+|[^\w\s]', t...
0
0
0
0
0
0
matminer/featurizers/structure/tests/test_matrix.py
ncfrey/matminer
326
1718810
<gh_stars>100-1000 import os import unittest import numpy as np import pandas as pd from sklearn.exceptions import NotFittedError from pymatgen.core import Molecule from matminer.featurizers.structure.matrix import ( CoulombMatrix, SineCoulombMatrix, OrbitalFieldMatrix, ) from matminer.featurizers.struct...
0
0
0
0
0
0
src/models/__init__.py
ManuGar/Deep-Image-Analogy-PyTorch
123
1718812
<reponame>ManuGar/Deep-Image-Analogy-PyTorch<filename>src/models/__init__.py from .VGG19 import VGG19 as VGG19
0
0
0
0
0
0
django_libsass.py
mohammad-nabeel/django-libsass
249
1718825
<filename>django_libsass.py import base64 import json import re import os import django from django.conf import settings from django.contrib.staticfiles.finders import get_finders if django.VERSION >= (1,10): from django.templatetags.static import static as django_static else: from django.contrib.staticfiles.t...
0
0
0
0
0
0
tests/rna/test_graphs.py
avivko/graphein
342
1718833
import pytest from hypothesis import given from hypothesis.strategies import text from graphein.rna.edges import ( add_all_dotbracket_edges, add_base_pairing_interactions, add_phosphodiester_bonds, ) from graphein.rna.graphs import ( RNA_BASES, SUPPORTED_DOTBRACKET_NOTATION, construct_rna_graph...
0
0
0
0
0
0
projects/gym_baselines/experiments/gym_base.py
brandontrabucco/allenact
187
1718879
from abc import ABC from typing import Dict, Sequence, Optional, List, Any from allenact.base_abstractions.experiment_config import ExperimentConfig from allenact.base_abstractions.sensor import Sensor class GymBaseConfig(ExperimentConfig, ABC): SENSORS: Optional[Sequence[Sensor]] = None def _get_sampler_a...
18
4
1
0
23
0
tools/chrome_proxy/webdriver/data_use.py
zipated/src
2,151
1718906
# Copyright 2016 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 os import common from common import TestDriver from common import IntegrationTest from decorators import NotAndroid class DataUseAscription(Integra...
0
0
0
0
0
0
tests/importer/tflite_/basic/test_gather.py
xhuohai/nncase
510
1718960
<filename>tests/importer/tflite_/basic/test_gather.py # Copyright 2019-2021 Canaan 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 # # ...
0
0
0
0
0
0
furl/common.py
mattmurch/furl
1,614
1718969
<reponame>mattmurch/furl # -*- coding: utf-8 -*- # # furl - URL manipulation made simple. # # <NAME> # grunseid.com # <EMAIL> # # License: Build Amazing Things (Unlicense) # from .compat import string_types absent = object() def callable_attr(obj, attr): return hasattr(obj, attr) and callable(getattr(obj, att...
0
0
0
0
0
0
python-standard-library/daemon-thread/daemon_thread.py
caesarcc/python-code-tutorials
1,059
1718989
import threading import time def func_1(): while True: print(f"[{threading.current_thread().name}] Printing this message every 2 seconds") time.sleep(2) # initiate the thread with daemon set to True daemon_thread = threading.Thread(target=func_1, name="daemon-thread", daemon=True) # or # daemon_th...
0
0
0
0
0
0
pyqt4/show-hide-widgets/main-2.py
whitmans-max/python-examples
140
1719027
<gh_stars>100-1000 #!/usr/bin/env python import sys from PyQt4 import QtCore, QtGui class SimpleCalc(QtGui.QWidget): def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.widget1 = QtGui.QLabel('Widget1') layout = QtGui.QVBoxLayout() layout.addWidget(self.w...
0
0
0
0
0
0
examples/foo/main2.py
philippeitis/nimporter
656
1719099
<reponame>philippeitis/nimporter import main print(dir(main)) print(main.__loader__) print(main.__spec__)
0
0
0
0
0
0
src/build_vambtools.py
SilasK/vamb
111
1719116
<filename>src/build_vambtools.py # To build vambtools from .pyx source, run the following line: # python build_vambtools.py build_ext --inplace from distutils.core import setup from Cython.Build import cythonize setup(name='_vambtools', ext_modules=cythonize("_vambtools.pyx"))
0
0
0
0
0
0
src/confluent_kafka/schema_registry/error.py
hyunjinjeong/confluent-kafka-python
2,838
1719145
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2020 Confluent 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 requi...
0
2
0
0
2
0
tester/test_model/test_mpage.py
bukun/TorCMS
243
1719149
# -*- coding:utf-8 -*- import time import tornado.escape from torcms.core import tools from torcms.model.wiki_model import MWiki class TestMWiki(): def setup(self): print('setup 方法执行于本类中每条用例之前') self.uu = MWiki() self.title = 'tyyyitle' self.uid = '6985' def add_page(self, *...
0
0
0
0
0
0
stonesoup/types/__init__.py
Red-Portal/Stone-Soup-1
157
1719160
# -*- coding: utf-8 -*- from .base import Type __all__ = ['Type']
0
0
0
0
0
0
2020/quals/reversing-sprint/asm.py
BearerPipelineTest/google-ctf
2,757
1719188
<reponame>BearerPipelineTest/google-ctf<filename>2020/quals/reversing-sprint/asm.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/...
0
0
0
0
0
0
qanta/datasets/triviaqa.py
Mshivam2409/qb
122
1719194
from typing import Set import json from qanta.datasets.abstract import AbstractDataset, TrainingData class TriviaQADataset(AbstractDataset): def __init__(self, answers: Set[str]): super().__init__() self.answers = answers def training_data(self) -> tuple[object, object, None]: with op...
1
1
0
0
2
0
packages/syft/src/syft/core/node/common/action/smpc_action_seq_batch_message.py
vishalbelsare/PySyft
8,428
1719203
# future from __future__ import annotations # stdlib from typing import List from typing import Optional # third party from google.protobuf.reflection import GeneratedProtocolMessageType # syft absolute import syft as sy # relative from .....proto.core.node.common.action.smpc_action_seq_batch_message_pb2 import ( ...
4
5
0
0
9
0
redun/tests/test_args.py
cclauss/redun
303
1719280
from sqlalchemy.orm import Session from redun import Scheduler, task from redun.backends.db import Argument, CallNode, Execution def test_record_args() -> object: @task() def task1(a, b) -> object: return a + b @task() def task2(x) -> object: return x @task() def main() -> o...
4
16
0
0
20
0
example/imagenet/inception_v3_jpeg.py
KuanKuanQAQ/ares
206
1719305
from ares.defense.jpeg_compression import jpeg_compression from ares.utils import get_res_path import inception_v3 MODEL_PATH = get_res_path('./imagenet/inception_v3.ckpt') def load(session) -> object: model = InceptionV3Jpeg() model.load(session, MODEL_PATH) return model @jpeg_compression(quality=75...
0
1
0
0
1
0
downstream/speaker_linear_utter_libri/dataset.py
OlegJakushkin/s3prl
856
1719324
# -*- coding: utf-8 -*- # """*********************************************************************************************""" # FileName [ dataset.py ] # Synopsis [ the libri speaker dataset ] # Author [ S3PRL ] # Copyright [ Copyleft(c), Speech Lab, NTU, Taiwan ] """***************************...
2
8
0
1
11
0
examples/stocks_by_collection.py
LivingTrades83/fast_arrow
143
1719341
<reponame>LivingTrades83/fast_arrow import configparser import json from fast_arrow import ( Client, Collection ) print("----- running {}".format(__file__)) # # get auth_data (see https://github.com/westonplatter/fast_arrow_auth) # with open("fast_arrow_auth.json") as f: auth_data = json.loads(f.read())...
0
0
0
0
0
0
api/tests/app/test_camera_metrics.py
AlexRogalskiy/smart-social-distancing
113
1719390
import os import pytest from freezegun import freeze_time import numpy as np # The line below is absolutely necessary. Fixtures are passed as arguments to test functions. That is why IDE could # not recognized them. from api.tests.utils.fixtures_tests import config_rollback_cameras, heatmap_simulation, config_rollback ...
0
0
0
0
0
0
extrabacon-2.0/improved/grep-offsets.py
JS-Burns/CVE-2016-6366
171
1719423
#!/usr/bin/env python2 """ Crappy script that reads the offsets in the Metasploit module, turns it into json, and write Python files """ import json def parse_offsets(data): data = data.split("@offsets = {")[1] data = data.split("}")[0] str = "{" for line in data.split("\n"): line = line.str...
0
0
0
0
0
0
tests/series/test_describe_pytest.py
szabosteve/eland
335
1719440
# Licensed to Elasticsearch B.V. under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch B.V. licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use ...
0
0
0
0
0
0
tests/r/test_drivers.py
hajime9652/observations
199
1719459
from __future__ import absolute_import from __future__ import division from __future__ import print_function import shutil import sys import tempfile from observations.r.drivers import drivers def test_drivers(): """Test module drivers.py by downloading drivers.csv and testing shape of extracted data has 19...
0
0
0
0
0
0
PyFin/tests/api/__init__.py
rpatil524/Finance-Python
325
1719506
<filename>PyFin/tests/api/__init__.py # -*- coding: utf-8 -*- u""" Created on 2015-7-13 @author: cheng.li """ from PyFin.tests.api.testDateUtilities import TestDateUtilities __all__ = ["TesDateUtilities"]
0
0
0
0
0
0
tests/integration/hdf5/test_nwbfile.py
weiglszonja/pynwb
132
1719541
from datetime import datetime from dateutil.tz import tzlocal, tzutc import pandas as pd import numpy as np from hdmf.backends.hdf5 import HDF5IO from hdmf.common import DynamicTable from pynwb import NWBFile, TimeSeries, NWBHDF5IO, get_manager from pynwb.file import Subject from pynwb.epoch import TimeIntervals from...
1
22
0
0
23
0
tests/validation/test_unique_enum_value_names.py
KingDarBoja/graphql-core
590
1719574
from functools import partial from graphql.utilities import build_schema from graphql.validation.rules.unique_enum_value_names import UniqueEnumValueNamesRule from .harness import assert_sdl_validation_errors assert_errors = partial(assert_sdl_validation_errors, UniqueEnumValueNamesRule) assert_valid = partial(asse...
0
0
0
0
0
0
tests/test_metrics.py
twstewart42/ParlAI
9,228
1719607
<reponame>twstewart42/ParlAI #!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import unittest from typing import Dict import torch import random from parlai.core.metric...
0
0
0
0
0
0
voctocore/lib/sources/decklinkavsource.py
0xflotus/voctomix
521
1719653
<filename>voctocore/lib/sources/decklinkavsource.py #!/usr/bin/env python3 import logging import re from lib.config import Config from lib.sources.avsource import AVSource class DeckLinkAVSource(AVSource): timer_resolution = 0.5 def __init__(self, name, has_audio=True, has_video=True): super().__in...
0
0
0
0
0
0
eeauditor/check_register.py
kbhagi/ElectricEye
442
1719658
#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...
0
4
1
0
5
0
src/clusto/test/drivers/resourcetests.py
thekad/clusto
216
1719663
<reponame>thekad/clusto from clusto.test import testbase from clusto.drivers import * class ResourceManagerTests(testbase.ClustoTestBase): def testAllocate(self): rm = ResourceManager('test') d = Driver('d') rm.allocate(d, 'foo') self.assertEqual(rm.owners('foo'), [d]) ...
0
0
0
0
0
0
bin/gftools-fix-nameids.py
hyvyys/gftools
150
1719724
#!/usr/bin/env python3 # Copyright 2017 The Font Bakery Authors. # Copyright 2017 The Google Font Tools 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/l...
0
1
0
0
1
0
arcade/experimental/bloom_filter.py
yegarti/arcade
824
1719727
<reponame>yegarti/arcade<filename>arcade/experimental/bloom_filter.py """ See: https://www.shadertoy.com/view/lsBfRc """ from arcade.experimental import Shadertoy class BloomFilter: """ CRT Filter :param int width: :param int height: """ def __init__( self, width: int, height...
0
0
0
0
0
0
src/gamemodes/sleepy.py
iamgreaser/lykos
122
1719752
import random import threading import functools from collections import Counter from src.gamemodes import game_mode, GameMode from src.messages import messages from src.containers import UserList, UserDict from src.decorators import command, handle_error from src.functions import get_players, change_role from src.statu...
1
2
0
3
6
0
Stock_Analysis/ols_regression.py
vhn0912/Finance
441
1719761
<gh_stars>100-1000 import datetime import numpy as np import pandas as pd from pandas_datareader.data import DataReader import matplotlib.pyplot as plt import statsmodels.api as sm from scipy import stats # BETA, ALPHA, OLS REGRESSION stock = 'MSFT' start_date = datetime.datetime(2014,12,28) end_date = datetime.date.t...
0
0
0
0
0
0
tests/test_morphology.py
yelircaasi/cltk
757
1719764
<filename>tests/test_morphology.py """Test cltk.morphology.""" import unittest from cltk.core.exceptions import CLTKException from cltk.morphology.lat import CollatinusDecliner class TestMorphology(unittest.TestCase): def test_collatinus_decline(self): """ Ensure lemmatization works well """ ...
0
0
0
0
0
0
tutorials/W0D1_PythonWorkshop1/solutions/W0D1_Tutorial1_Solution_c0a3438b.py
eduardojdiniz/CompNeuro
2,294
1719783
# Set random number generator np.random.seed(2020) # Initialize step_end and n step_end = int(t_max / dt) n = 50 # Intiatialize the list v_n with 50 values of membrane leak potential el v_n = [el] * n with plt.xkcd(): # Initialize the figure plt.figure() plt.title('Multiple realizations of $V_m$') plt.xlabe...
0
0
0
0
0
0
entity/cards/LETLT_072/__init__.py
x014/lushi_script
102
1719785
# -*- coding: utf-8 -*- import entity.cards.LETLT_072.LETLT_072p2 import entity.cards.LETLT_072.LETLT_072p1
0
0
0
0
0
0
Supreme Config/colorCodes.py
zweed4u/new_supr3m31059
111
1719795
<filename>Supreme Config/colorCodes.py colorCodes = { 'red':'\033[31m', 'orange':'\033[33m', 'blue':'\033[34m', 'purple':'\033[35m', 'cyan':'\033[36m', 'lightgrey':'\033[37m', 'darkgrey':'\033[90m', 'lightred':'\033[91m', 'lightgreen':'\033[92m', 'yellow':'\033[93m', 'lightbl...
0
0
0
0
0
0
cupy_alias/__init__.py
fixstars/clpy
142
1719824
from clpy import * # NOQA
0
0
0
0
0
0
tests/test_cloudfront/test_server.py
symroe/moto
5,460
1719844
import sure # noqa # pylint: disable=unused-import import xmltodict import moto.server as server def test_cloudfront_list(): backend = server.create_backend_app("cloudfront") test_client = backend.test_client() res = test_client.get("/2020-05-31/distribution") data = xmltodict.parse(res.data, dict_...
0
0
0
0
0
0
ML/recommendations/surprise_tutorial.py
saneravi/ML_Stuff
209
1719877
import zipfile from surprise import SVD, Dataset, Reader, evaluate # Unzip ml-100k.zip zipfile = zipfile.ZipFile('ml-100k.zip', 'r') zipfile.extractall() zipfile.close() # Read data into an array of strings with open('./ml-100k/u.data') as f: all_lines = f.readlines() # Prepare the data to be used in Surprise r...
0
0
0
0
0
0
tools/assembly_download/assembly_download.py
AutodeskAILab/Fusion360GalleryDataset
193
1719878
<filename>tools/assembly_download/assembly_download.py """ Download and extract the Fusion 360 Gallery Assembly Dataset """ import argparse import sys import itertools import requests from requests.packages.urllib3.exceptions import InsecureRequestWarning import subprocess from pathlib import Path from multiprocessi...
0
0
0
0
0
0
esphome/components/socket/__init__.py
OttoWinter/esphomeyaml
249
1719895
<filename>esphome/components/socket/__init__.py import esphome.config_validation as cv import esphome.codegen as cg CODEOWNERS = ["@esphome/core"] CONF_IMPLEMENTATION = "implementation" IMPLEMENTATION_LWIP_TCP = "lwip_tcp" IMPLEMENTATION_BSD_SOCKETS = "bsd_sockets" CONFIG_SCHEMA = cv.Schema( { cv.SplitDe...
0
0
0
0
0
0
tests/resources/config_modifier.py
elijahbenizzy/hamilton
298
1719924
<filename>tests/resources/config_modifier.py from hamilton.function_modifiers import config def new_param() -> str: return 'dummy' @config.when(fn_1_version=0) def fn() -> str: pass @config.when(fn_1_version=1) def fn__v1() -> str: return 'version_1' @config.when(fn_1_version=2) def fn__v2(new_param...
0
0
0
0
0
0
third_party/android_build_tools/bundletool/3pp/fetch.py
zealoussnow/chromium
14,668
1719930
<gh_stars>1000+ #!/usr/bin/env python # Copyright 2021 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. from __future__ import print_function import argparse import json import os import urllib _RELEASES_URL = 'https://ap...
0
0
0
0
0
0