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
test/unit/v0/deps.py
KernelErr/b2-sdk-python
128
198922
###################################################################### # # File: test/unit/v0/deps.py # # Copyright 2019 Backblaze Inc. All Rights Reserved. # # License https://www.backblaze.com/using_b2_code.html # ###################################################################### # TODO: This module is used in o...
0
0
0
0
0
0
usaspending_api/references/tests/integration/filter_tree/psc/test_psc_irregular_cases.py
g4brielvs/usaspending-api
217
198933
<reponame>g4brielvs/usaspending-api<gh_stars>100-1000 from rest_framework import status base_query = "/api/v2/references/filter_tree/psc/" def test_wrong_path_at_tier_one(client, basic_service): resp = _call_and_expect_200(client, base_query + "Product/B/") assert resp.json() == {"results": []} def test_wr...
0
0
0
0
0
0
dataset/preparation/preparedata_test.py
WestCityInstitute/DeepSFM
235
198947
import os import sys import subprocess from joblib import Parallel, delayed import numpy as np import imageio imageio.plugins.freeimage.download() from imageio.plugins import freeimage import h5py from lz4.block import decompress import scipy.misc import cv2 from path import Path path = os.path.join(os.path.dirname(...
0
0
0
0
0
0
dulwich/tests/test_graph.py
dish59742/dulwich
624
198961
# -*- coding: utf-8 -*- # test_index.py -- Tests for merge # encoding: utf-8 # Copyright (c) 2020 <NAME>, Stratford Ontario Canada # # Dulwich is dual-licensed under the Apache License, Version 2.0 and the GNU # General Public License as public by the Free Software Foundation; version 2.0 # or (at your option) any late...
0
4
0
0
4
0
dexy/commands/fcmds.py
dexy/dexy
136
198970
<gh_stars>100-1000 import dexy.filter import inspect def fcmds_command( alias=False # Only print commands defined by this alias. ): """ Prints a list of available filter commands. """ if alias: filter_instances = [dexy.filter.Filter.create_instance(alias)] else: filt...
0
0
0
0
0
0
workflows/pipe-common/pipeline/log/logger.py
AlfiyaRF/cloud-pipeline
126
198971
# Copyright 2017-2019 EPAM Systems, Inc. (https://www.epam.com/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
52
2
12
0
66
0
split_text_by_fragments.py
DazEB2/SimplePyScripts
117
198981
<filename>split_text_by_fragments.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' def split_text_by_fragments(text: str, fragment_length=50) -> list: """ Функция для разбития текста (<text>) на куски указанной длины (<fragment_length>). """ # Если длина фрагмента больше ил...
0
0
0
0
0
0
demos/register-login/controllers/handlers.py
karldoenitz/karlooper
161
198988
<filename>demos/register-login/controllers/handlers.py # -*-encoding:utf-8-*- from base import is_login from karlooper.web.request import Request class Login(Request): def get(self): return self.render("/register-login.html", button="Login", title="LOGIN") class Register(Request): def get(self): ...
0
0
0
0
0
0
crits/core/management/commands/generate_notifications.py
dutrow/crits
738
198997
<filename>crits/core/management/commands/generate_notifications.py from django.core.mail import send_mail from django.core.management.base import BaseCommand try: from django.urls import reverse except ImportError: from django.core.urlresolvers import reverse from crits.config.config import CRITsConfig from cri...
0
0
0
0
0
0
lldb/test/API/types/AbstractBase.py
acidburn0zzz/llvm-project
250
199004
<gh_stars>100-1000 """ Abstract base class of basic types provides a generic type tester method. """ from __future__ import print_function import os import re import lldb from lldbsuite.test.lldbtest import * import lldbsuite.test.lldbutil as lldbutil def Msg(var, val, using_frame_variable): return "'%s %s' mat...
0
0
0
0
0
0
torchgan/utils.py
winnerineast/torchgan
1,300
199005
<filename>torchgan/utils.py from pkgutil import iter_modules import torch def reduce(x, reduction=None): r"""Applies reduction on a torch.Tensor. Args: x (torch.Tensor): The tensor on which reduction is to be applied. reduction (str, optional): The reduction to be applied. If ``mean`` the m...
0
0
0
0
0
0
b3/actions/randomnodeBH.py
mdecourse/IKBT
129
199013
<filename>b3/actions/randomnodeBH.py<gh_stars>100-1000 import b3 import random __all__ = ['RandomNodeBH'] class RandomNode(b3.Action): def tick(self, tick): x = random.random() if(x > 0.5): return b3.SUCCESS elif (0.5 < x < 0.75): return b3.RUNNING else: ...
0
0
0
0
0
0
NeoPixel_GoPro_Lens_Light/code.py
gamblor21/Adafruit_Learning_System_Guides
665
199022
<reponame>gamblor21/Adafruit_Learning_System_Guides import time import board import neopixel from analogio import AnalogIn pot = AnalogIn(board.A1) # what pin the pot is on pixpin = board.D0 # what pin the LEDs are on numpix = 16 # number of LEDs in ring! BPP = 4 # required for RGBW ring ring = neopixel.NeoPixel...
0
0
0
0
0
0
cnn_util.py
carpeanon/sequence_captions
285
199031
<reponame>carpeanon/sequence_captions<gh_stars>100-1000 import caffe import ipdb import cv2 import numpy as np import skimage deploy = '/home/taeksoo/Package/caffe/models/bvlc_reference_caffenet/deploy.prototxt' model = '/home/taeksoo/Package/caffe/models/bvlc_reference_caffenet/bvlc_reference_caffenet.caffemodel' mea...
0
0
0
0
0
0
components/policy/tools/template_writers/writers/template_writer_unittest.py
zipated/src
2,151
199080
<filename>components/policy/tools/template_writers/writers/template_writer_unittest.py #!/usr/bin/env python # Copyright (c) 2012 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. '''Unit tests for writers.template_writer'''...
0
0
0
0
0
0
samcli/cli/context.py
zhuhaow/aws-sam-cli
859
199088
from __future__ import annotations """ Context information passed to each CLI command """ import logging import uuid from typing import Optional, cast, List import boto3 import botocore import botocore.session from botocore import credentials import click from samcli.commands.exceptions import CredentialsError from ...
0
9
1
4
14
0
test/correctness/smoke/test_update.py
kolesa-team/fdb-document-layer
176
199102
#!/usr/bin/python # # test_update.py # # This source file is part of the FoundationDB open source project # # Copyright 2013-2019 Apple Inc. and the FoundationDB project authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You m...
0
0
0
0
0
0
nahamconctf2021/some-really-ordinary-program/exploit.py
nhtri2003gmail/ctf-write-ups
101
199118
<reponame>nhtri2003gmail/ctf-write-ups #!/usr/bin/env python3 from pwn import * binary = context.binary = ELF('./some-really-ordinary-program') binary.symbols['main'] = 0x401022 binary.symbols['midread'] = 0x401006 if args.REMOTE: p = remote('challenge.nahamcon.com', 31225) else: p = process(binary.path) syscall ...
0
0
0
0
0
0
passfun.py
juju2013/MPFA
101
199124
#! /usr/bin/env python3 # Copyright (c) 2021, <EMAIL>u<EMAIL> # All rights reserved # This file is under BSD 2-Clause License, see LICENSE file from __future__ import annotations import os,sys, random, io import argparse from pyzbar import pyzbar from PIL import Image, ImageDraw from datetime import datetime from ur...
8
1
0
5
14
0
tests/integ/test_inference_pipeline.py
LastRemote/sagemaker-python-sdk
1,690
199128
# Copyright Amazon.com, Inc. or its 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompan...
0
0
0
0
0
0
xhr/resources/echo-content-type.py
meyerweb/wpt
14,668
199138
<filename>xhr/resources/echo-content-type.py def main(request, response): response.headers.set(b"Content-Type", b"text/plain") response.status = 200 response.content = request.headers.get(b"Content-Type") response.close_connection = True
0
0
0
0
0
0
bin/assets/scripts/grabcut/grabcut.py
nci/drish
118
199141
<filename>bin/assets/scripts/grabcut/grabcut.py ''' =============================================================================== Interactive Image Segmentation using GrabCut algorithm. This sample shows interactive image segmentation using grabcut algorithm. USAGE: python grabcut.py <filename> README FIRST: ...
0
0
0
0
0
0
entity/cards/SWL_26H/LETL_236.py
x014/lushi_script
102
199144
<reponame>x014/lushi_script # -*- coding: utf-8 -*- from hearthstone.entities import Entity from entity.spell_entity import SpellEntity class LETL_236(SpellEntity): """ 火焰践踏5 对所有敌人造成$6点伤害。每有一个尚未行动的敌人,重复一次。 """ def __init__(self, entity: Entity): super().__init__(entity) s...
0
0
0
0
0
0
pkg/unix/Python27/Lib/site-packages/klei/textureconverter.py
hexgear-studio/ds_mod_tools
112
199156
from __future__ import annotations import sys, os, tempfile, shutil from PIL import Image import util import subprocess ''' TOOL_PATH = os.path.join( os.path.dirname( __file__ ), "../../../../../../tools/bin" ) TEXTURE_CONVERTER = os.path.abspath( os.path.join( TOOL_PATH, "TextureConverter.exe" ) ) def Conv...
14
2
0
0
16
0
examples/old/task_library/google/storage.py
concreted/prefect
8,633
199165
<filename>examples/old/task_library/google/storage.py """ This example illustrates the use of Prefect's Google Cloud Storage tasks. Each task is instantiated as a template in order to demonstrate how arguments can be passed either at initialization or when building the flow. """ import json from prefect import Flow f...
0
0
0
0
0
0
examples/transactions/__init__.py
adamzhang1987/py-etherscan-api
458
199171
__author__ = '<NAME>'
0
0
0
0
0
0
tests/async/test_listeners.py
tumregels/playwright-python
6,243
199175
<filename>tests/async/test_listeners.py # Copyright (c) Microsoft 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/licenses/LICENSE-2.0 # # Unless requir...
0
0
0
0
0
0
alpa/collective/__init__.py
alpa-projects/alpa
114
199176
from alpa.collective.collective import ( nccl_available, gloo_available, is_group_initialized, init_collective_group, destroy_collective_group, create_collective_group, get_rank, get_collective_group_size, allreduce, allreduce_multigpu, barrier, reduce, reduce_multigpu, broadcast, broadcast_partialgpu, ...
0
0
0
0
0
0
tests/util/test_dotted_path.py
lgfunderburk/ploomber
2,141
199180
import inspect from pathlib import Path from unittest.mock import Mock import parso from test_pkg import functions import pytest from ploomber.util import dotted_path from ploomber.exceptions import SpecValidationError from ploomber.sources.inspect import getfile @pytest.mark.parametrize('spec', [ 'test_pkg.fun...
0
0
0
0
0
0
qinhaifang/src/evalTools/script/spaceNet/evalTools.py
SpaceNetChallenge/BuildingFootprintDetectors
161
199198
<reponame>SpaceNetChallenge/BuildingFootprintDetectors import numpy as np import geoTools as gT from osgeo import ogr def iou(test_poly, truth_polys, truth_index=[]): fidlistArray = [] iou_list = [] if truth_index: fidlist = gT.search_rtree(test_poly, truth_index) for fid in fidlist: ...
0
0
0
0
0
0
tests/test_pool_layer.py
rsketine/neon
4,415
199222
<reponame>rsketine/neon # ****************************************************************************** # Copyright 2014-2018 Intel 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 a...
0
0
0
0
0
0
predict_label.py
IMAGR-LTD/noisystudent
683
199228
# coding=utf-8 # Copyright 2019 The Google NoisyStudent Team Authors. # # Licensed under the Apache License, Version 2.0 (the 'License'); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
1
5
0
0
6
0
ufora/cumulus/distributed/PythonIoTaskService.py
ufora/ufora
571
199240
<reponame>ufora/ufora # Copyright 2015 Ufora Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
0
0
0
0
0
0
catalogue/c11popl15/genmodel.py
patrick-rivos/herdtools7
103
199255
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import annotations from __future__ import print_function import argparse import re import sys import subprocess CHOICES_RF=["ConsRFna","Naive","Arf","Arfna"] CHOICES_SC=["SCorig","SCnew"] CHOICES_RS=["RSorig","RSnew"] CHOICES_ST=["STorig","STnew"] def mai...
1
1
0
0
2
0
config/train/cifar100/mixnet_l.py
HwangJohn/model_compression
216
199278
# -*- coding: utf-8 -*- """Configurations for training as mixnet_l (cifar100). - Author: Curt-Park - Email: <EMAIL> """ import os config = { "SEED": 777, "AUG_TRAIN": "randaugment_train_cifar100", "AUG_TRAIN_PARAMS": dict(n_select=2, level=None), "AUG_TEST": "simple_augment_test_cifar100", "CUTMI...
0
0
0
0
0
0
src/orders/tests/pay_signals/conftest.py
denkasyanov/education-backend
151
199282
<filename>src/orders/tests/pay_signals/conftest.py import pytest pytestmark = [pytest.mark.django_db] @pytest.fixture def order(factory): return factory.order()
0
0
0
0
0
0
test/jit/test_custom_operators.py
Hacky-DH/pytorch
60,067
199306
<filename>test/jit/test_custom_operators.py import os import sys import unittest import torch # Make the helper files in test/ importable pytorch_test_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) sys.path.append(pytorch_test_dir) from torch.testing._internal.jit_utils import JitTestCase if __na...
0
0
0
0
0
0
adminsortable/templatetags/django_template_additions.py
michael-k/django-admin-sortable
249
199313
from itertools import groupby import django from django import template register = template.Library() class DynamicRegroupNode(template.Node): """ Extends Django's regroup tag to accept a variable instead of a string literal for the property you want to regroup on """ def __init__...
0
3
0
0
3
0
crits/events/event.py
dutrow/crits
738
199317
import uuid try: from django_mongoengine import Document except ImportError: from mongoengine import Document from mongoengine import StringField, UUIDField, BooleanField from mongoengine import EmbeddedDocument from django.conf import settings from crits.core.crits_mongoengine import CritsBaseAttributes from crit...
0
1
1
0
2
0
mindsdb/api/mongo/responders/buildinfo.py
yarenty/mindsdb
261
199326
<filename>mindsdb/api/mongo/responders/buildinfo.py from mindsdb.__about__ import __version__ as mindsdb_version from mindsdb.api.mongo.classes import Responder class Responce(Responder): def when(self, query): return ( 'buildinfo' in query or 'buildInfo' in query ) result = { ...
0
0
0
0
0
0
kornia/contrib/lambda_module.py
Ishticode/kornia
4,894
199338
<filename>kornia/contrib/lambda_module.py<gh_stars>1000+ from typing import Callable import torch import torch.nn as nn class Lambda(nn.Module): """Applies user-defined lambda as a transform. Args: func: Callable function. Returns: The output of the user-defined lambda. Example: ...
0
0
0
0
0
0
Lib/parallel/http/server.py
pyparallel/pyparallel
652
199381
<filename>Lib/parallel/http/server.py from async.http.server import *
0
0
0
0
0
0
10_pipeline/sagemaker_mlops/sagemaker-project-modelbuild/pipelines/dsoaws/pipeline.py
dpai/workshop
2,327
199396
""" Example workflow pipeline script for BERT pipeline. . -RegisterModel . Process-> Train -> (Evaluate -> Condition) . . ...
0
1
0
0
1
0
tutorials/speech2srt/speech2srt.py
Mement-Mori/community
1,723
199404
# -*- coding: utf-8 -*- # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
0
4
0
0
4
0
InvenTree/stock/migrations/0043_auto_20200525_0420.py
ArakniD/InvenTree
656
199406
# Generated by Django 3.0.5 on 2020-05-25 04:20 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies: list[tuple[str, str]] = [ ('part', '0042_auto_20200518_0900'), ('stock', '0042_auto_20200523_0121'), ] operation...
0
0
2
0
2
0
tools/img2tfrecord.py
sarvex/TFace
764
199425
<reponame>sarvex/TFace<filename>tools/img2tfrecord.py import os import cv2 import argparse import numpy as np import tensorflow as tf from skimage import transform as trans from datetime import datetime as dt def parse_args(): parser = argparse.ArgumentParser( formatter_class=argparse.ArgumentDefaultsHelp...
0
0
0
0
0
0
networking-calico/networking_calico/plugins/ml2/drivers/calico/syncer.py
mikestephen/calico
3,973
199440
# -*- coding: utf-8 -*- # Copyright (c) 2018 Tigera, Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
0
1
0
0
1
0
packages/pegasus-python/src/Pegasus/service/monitoring/views.py
ahnitz/pegasus
127
199449
<gh_stars>100-1000 import hashlib import logging from flask import g, make_response, request from Pegasus.service import cache from Pegasus.service._serialize import jsonify from Pegasus.service.base import OrderedDict from Pegasus.service.monitoring import monitoring as blueprint from Pegasus.service.monitoring.quer...
0
0
0
0
0
0
api/tests/test_profiles_api.py
Ecotrust/formhub
123
199451
<reponame>Ecotrust/formhub<filename>api/tests/test_profiles_api.py import json from main.models import UserProfile from api.tests.test_api import TestAPICase from api.views import UserProfileViewSet class TestProfilesAPI(TestAPICase): def setUp(self): super(TestProfilesAPI, self).setUp() self.vi...
0
0
0
0
0
0
Lib/test/test_xml_etree_jy.py
jeff5/jython-whinchat
577
199459
# encoding: utf-8 import sys JYTHON = sys.platform.startswith("java") import doctest from test import test_support import xml.parsers.expat as expat from xml.etree.ElementTree import * def jython(function): if JYTHON: return function else: return None class sortdict(dict): def __repr__(...
0
0
0
0
0
0
preprocess/pretrain/split.py
motefly/MC-BERT
225
199460
import sys def main(): cnt = 0 f_cnt = 0 input_file = sys.argv[1] output_prefix = sys.argv[2] chunk_size = int(sys.argv[3]) f_ov = open(f'{output_prefix}.valid.txt', 'w', encoding='utf-8') f_ot = None with open(input_file, 'r', encoding='utf-8') as f_in: for line in f_in: ...
0
0
0
0
0
0
extract_code.py
sajjad2014/vq-vae-2-pytorch
1,007
199465
<filename>extract_code.py import argparse import pickle import torch from torch.utils.data import DataLoader from torchvision import transforms import lmdb from tqdm import tqdm from dataset import ImageFileDataset, CodeRow from vqvae import VQVAE def extract(lmdb_env, loader, model, device): inde...
0
0
0
0
0
0
Packs/BitDam/Integrations/BitDam/BitDam.py
diCagri/content
799
199470
<reponame>diCagri/content import demistomock as demisto from CommonServerPython import * '''IMPORTS''' import requests import base64 # disable insecure warnings requests.packages.urllib3.disable_warnings() '''INTEGRATION PARAMS''' API_TOKEN = demisto.params().get('apitoken') URL_BASE = demisto.params().get('url') USE...
0
0
0
0
0
0
wagtail/tests/testapp/migrations/0057_customdocumentwithauthor.py
brownaa/wagtail
8,851
199508
<gh_stars>1000+ # Generated by Django 3.0.10 on 2020-12-20 14:52 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import taggit.managers import wagtail.core.models import wagtail.search.index class Migration(migrations.Migration): dependencies = [ ...
0
0
0
0
0
0
tests/transforms/test_GaussianBlur.py
Tekrific/lightly
1,515
199537
<reponame>Tekrific/lightly from PIL import Image import unittest from lightly.transforms import GaussianBlur class TestGaussianBlur(unittest.TestCase): def test_on_pil_image(self): for w in range(1, 100): for h in range(1, 100): gaussian_blur = GaussianBlur(w * 0.1) ...
0
0
0
0
0
0
env/Lib/site-packages/OpenGL/raw/GL/EXT/memory_object.py
5gconnectedbike/Navio2
210
199554
'''Autogenerated by xml_generate script, do not edit!''' from OpenGL import platform as _p, arrays # Code generation uses this from OpenGL.raw.GL import _types as _cs # End users want this... from OpenGL.raw.GL._types import * from OpenGL.raw.GL import _errors from OpenGL.constant import Constant as _C import ctypes _...
0
1
0
0
1
0
dojo/note_type/views.py
mtcolman/django-DefectDojo
1,772
199566
<filename>dojo/note_type/views.py<gh_stars>1000+ import logging from django.contrib.auth.decorators import user_passes_test from django.shortcuts import render, get_object_or_404 from django.contrib import messages from django.urls import reverse from django.http import HttpResponseRedirect from dojo.forms import Not...
0
0
0
0
0
0
application/controllers/site.py
yongli82/FlaskBookRead
543
199589
# coding: utf-8 from flask import render_template, Blueprint bp = Blueprint('site', __name__) @bp.route('/') def index() -> object: """Index page.""" return render_template('site/index/index.html') @bp.route('/about') def about() -> object: """About page.""" return render_template('site/about/about...
0
2
0
0
2
0
salt/states/neutron_secgroup_rule.py
waynegemmell/salt
9,425
199621
<filename>salt/states/neutron_secgroup_rule.py """ Management of OpenStack Neutron Security Group Rules ==================================================== .. versionadded:: 2018.3.0 :depends: shade :configuration: see :py:mod:`salt.modules.neutronng` for setup instructions Example States .. code-block:: yaml ...
0
0
0
0
0
0
awacs/snow_device_management.py
michael-k/awacs
358
199636
<gh_stars>100-1000 # Copyright (c) 2012-2021, <NAME> <<EMAIL>> # All rights reserved. # # See LICENSE file for full license. from .aws import Action as BaseAction from .aws import BaseARN service_name = "AWS Snow Device Management" prefix = "snow-device-management" class Action(BaseAction): def __init__(self, a...
0
0
0
0
0
0
dashboard/lib/flanker/mime/bounce.py
robertsimmons514/isthislegit
282
199682
import re from collections import deque from contextlib import closing from cStringIO import StringIO from flanker.mime.message.headers.parsing import parse_stream from flanker.mime.message.headers import MimeHeaders def detect(message) -> object: headers = collect(message) return Result( score=len(he...
0
6
0
0
6
0
ldaptor/_scripts/ldap2pdns.py
twisted/ldaptor
133
199716
<gh_stars>100-1000 import sys from twisted.internet.defer import succeed, fail from twisted.internet import defer, reactor from twisted.internet.stdio import StandardIO from twisted.protocols.basic import LineReceiver from twisted.python.failure import Failure from twisted.python import log from ldaptor.protocols.ldap ...
0
0
0
0
0
0
appengine/standard/analytics/main_test.py
yshalabi/python-docs-samples
5,938
199727
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
0
1
0
0
1
0
bench/test_attrs_primitives.py
bibajz/cattrs
364
199740
from enum import IntEnum import attr import pytest from cattr import Converter, GenConverter, UnstructureStrategy class E(IntEnum): ONE: int = 1 TWO: int = 2 @attr.define class C: a: int b: float c: str d: bytes e: E f: int g: float h: str i: bytes j: E k: int ...
0
0
32
0
32
0
node/deps/brotli/brotli.gyp
schmitzn/node-packer
1,666
199744
<reponame>schmitzn/node-packer<filename>node/deps/brotli/brotli.gyp { 'targets': [ { 'target_name': 'brotli', 'type': 'static_library', 'include_dirs': ['c/include'], 'conditions': [ ['OS=="linux"', { 'defines': [ 'OS_LINUX' ] }], ['O...
0
0
0
0
0
0
tools/pythonpkg/tests/fast/test_transaction.py
AldoMyrtaj/duckdb
2,816
199755
<reponame>AldoMyrtaj/duckdb<gh_stars>1000+ import duckdb import pandas as pd class TestConnectionTransaction(object): def test_transaction(self, duckdb_cursor): con = duckdb.connect() con.execute('create table t (i integer)') con.execute ('insert into t values (1)') con.begin() ...
0
0
0
0
0
0
utils/LiftedStructure.py
xijiali/BDBNet
152
199768
<filename>utils/LiftedStructure.py from __future__ import absolute_import import torch from torch import nn from torch.autograd import Variable import torch.nn.functional as F import numpy as np def similarity(inputs_): # Compute similarity mat of deep feature # n = inputs_.size(0) sim = torch.matmul(inp...
0
0
0
0
0
0
mayan/apps/autoadmin/management/commands/createautoadmin.py
nattangwiwat/Mayan-EDMS-recitation
343
199782
<filename>mayan/apps/autoadmin/management/commands/createautoadmin.py from django.core.management.base import BaseCommand from ...models import AutoAdminSingleton class Command(BaseCommand): help = 'Used to create a superuser with a secure and automatic password.' def handle(self, *args, **options): ...
0
0
0
0
0
0
forte/processors/nlp/subword_tokenizer.py
zhanyuanucb/forte
163
199784
<reponame>zhanyuanucb/forte # Copyright 2021 The Forte 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 # # Un...
0
0
0
0
0
0
examples/extending_tensorflow/summaries.py
kjanik70/tflearn
10,882
199795
<reponame>kjanik70/tflearn<filename>examples/extending_tensorflow/summaries.py """ This example introduces the use of TFLearn functions to easily summarize variables into tensorboard. TFLearn can summarize: - Loss / Accuracy: The model loss and accuracy over training steps. - Activations: Histogram of operation output...
0
0
0
0
0
0
gmusicapi/__init__.py
maxjoehnk/gmusicapi
1,621
199818
from gmusicapi._version import __version__ from gmusicapi.clients import Webclient, Musicmanager, Mobileclient from gmusicapi.exceptions import CallFailure __copyright__ = 'Copyright 2018 <NAME>' __license__ = 'BSD 3-Clause' __title__ = 'gmusicapi' # appease flake8: the imports are purposeful (__version__, Webclient,...
0
0
0
0
0
0
GFW_Check/qiang.py
czahoi/crawler-py
127
199881
<filename>GFW_Check/qiang.py #-*- coding=utf-8 -*- """ Author: Abbey Create Date: 2019-05-27 Script Description: 检测域名是否被墙 """ import requests import json import time class Qiang(object): """docstring for Qiang""" def __init__(self, domain): self.domain = domain self.session=requests.Session() ...
0
0
0
0
0
0
var/spack/repos/builtin/packages/r-pkgload/package.py
kkauder/spack
2,360
199910
<filename>var/spack/repos/builtin/packages/r-pkgload/package.py # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class RPkgload(RPackage): """Sim...
0
0
0
0
0
0
objectModel/Python/cdm/resolvedmodel/expression_parser/predefined_type.py
rt112000/CDM
884
199920
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. from enum import IntEnum class PredefinedType(IntEnum): NOT_OPERATOR: int = 1 OPERATOR: int = 2 TOKEN: int = 3 CONSTANT: int = 4 OPEN_PARENTHE...
0
0
7
0
7
0
recipes/Python/577441_Run_command_in_Win32_Registry/recipe-577441.py
tdiprima/code
2,023
199924
<reponame>tdiprima/code # ---------------------------------------------- # Name: Do # Description: Expand and execute command ## D20H-23 Do command from Windows registry # # Author: <NAME> # Date: 10/12/2010 # Copyright 2010 by St. Thomas Software # ---------------------------------------------- # This program is freew...
0
0
0
0
0
0
demos/aspect_polarity_classification/run_fast_lsa_deberta.py
froth-synthesio/PyABSA
199
199940
<filename>demos/aspect_polarity_classification/run_fast_lsa_deberta.py # -*- coding: utf-8 -*- # file: run_fast_lsa_deberta.py # time: 2021/5/26 0026 # author: yangheng <<EMAIL>> # github: https://github.com/yangheng95 # Copyright (C) 2021. All Rights Reserved. #########################################################...
0
0
0
0
0
0
orbit/template/ktr.py
uber/orb
1,332
199956
from __future__ import annotations from orbit.models.ktrlite import KTRLite import pandas as pd import numpy as np import math from scipy.stats import nct from enum import Enum import torch import matplotlib.pyplot as plt from copy import deepcopy from ..constants.constants import ( KTRTimePointPriorKeys, Pred...
53
14
37
38
142
0
src/oci/database/models/external_non_container_database.py
Manny27nyc/oci-python-sdk
249
199969
<reponame>Manny27nyc/oci-python-sdk<filename>src/oci/database/models/external_non_container_database.py # coding: utf-8 # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle....
0
0
0
0
0
0
monitor/core/log.py
laozhudetui/wam
227
1600003
<filename>monitor/core/log.py #!/usr/bin/env python # coding: utf-8 # __buildin__ modules import logging from logging.handlers import RotatingFileHandler # monitor modules from monitor.core.settings import LOG_PATH class LogFormatter(logging.Formatter): FORMATS = { logging.DEBUG: '%(asctime)s [DEBUG] %...
0
0
0
0
0
0
dyu_tm_workshop/lib/python3.8/site-packages/jiagu/topic/lda.py
TLYu0419/DYU_TextMining
2,664
1600040
# -*- coding: utf-8 -*- import glob import jiagu import numpy as np from random import random def normalize(vec): total = sum(vec) assert(abs(total) > 1e-6) for i in range(len(vec)): assert(vec[i] >= 0) vec[i] = float(vec[i]) / total def get_prob(vec, prob) -> object: assert (len(ve...
4
2
0
1
7
0
tutorials/eboutique/microservices/cart/src/queries/services.py
bhardwajRahul/minos-python
247
1600051
import logging from logging import ( Logger, ) from dependency_injector.wiring import ( Provide, ) from src.queries.models import ( Cart, ) from src.queries.repository import ( CartQueryRepository, ) from minos.aggregate import ( Event, ) from minos.cqrs import ( QueryService, ) from minos.net...
4
4
4
0
12
0
guppy/etc/Code.py
odidev/guppy3
251
1600057
def co_code_findloadednames(co) -> object: """Find in the code of a code object, all loaded names. (by LOAD_NAME, LOAD_GLOBAL or LOAD_FAST) """ import dis from opcode import HAVE_ARGUMENT, opmap hasloadname = (opmap['LOAD_NAME'], opmap['LOAD_GLOBAL'], opmap['LOAD_FAST']) insn...
0
2
0
0
2
0
metrics/pearsonr/pearsonr.py
leondz/datasets
3,395
1600095
# Copyright 2021 The HuggingFace Datasets Authors and the current dataset script contributor. # # 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....
1
2
0
0
3
0
artemis/general/report_collector.py
peteroconnor-bc/artemis
235
1600113
<filename>artemis/general/report_collector.py __author__ = 'peter' class ReportCollector(object): def __init__(self, display = True): self.display = display self._report = [] def append(self, update): self._report.append(update) if self.display: print(update) ...
0
0
0
0
0
0
scaffold/angular_custom_fields.py
armohamm/Flask-Scaffold
973
1600176
# String for add/edit.component.html user_add_edit_string = """ <div class="form-group"> <input type="{type}" class="form-control input-underline input-lg" id="{field}" required formControlName = "{field}" placeholder=" {field}"> ...
0
0
0
0
0
0
stats/models/ShotChartDetailTemp.py
twist3dimages/nba-sql
113
1600180
from peewee import ( IntegerField, BooleanField, FloatField, CharField, Model ) # This table exists because we fetch _all_ shot_chart_detail records, # even if the game doesn't exist in the game table. So, we stage all # records in this temporary table, then insert into the main table # filtering b...
0
0
2
0
2
0
extractor/qingshipin.py
pwh19920920/spiders
390
1600233
<reponame>pwh19920920/spiders<filename>extractor/qingshipin.py import requests def get(url: str): """ author、title、imgs、videos """ data = {} headers = { "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like\ Gecko) Chrome/80.0.3987.149 Safar...
0
0
0
0
0
0
modules/labelfusion/cameraposes.py
hz-ants/LabelFusion-docker2-
313
1600244
# class to help manage loading stored camera poses from __future__ import annotations import numpy as np from director import transformUtils class CameraPoses(object): def __init__(self, posegraphFile: object | None=None): self.posegraphFile = posegraphFile if self.posegraphFile is not None: ...
1
1
0
0
2
0
h2o-docs/src/booklets/v2_2015/source/Python_Vignette_code_examples/python_injest_time_natively.py
ahmedengu/h2o-3
6,098
1600249
df14 = h2o.H2OFrame.from_python( {'D': ['18OCT2015:11:00:00', '19OCT2015:12:00:00', '20OCT2015:13:00:00']}, column_types=['time']) df14.types # {u'D': u'time'}
0
0
0
0
0
0
example2/getweather.py
leehuoche/PyAIML_copy
316
1600299
#!/usr/bin/env python # -*- coding: utf-8 -*- # http://toy.weather.com.cn/SearchBox/searchBox?_=1362892474803&language=zh&keyword=%E5%8C%97%E4%BA%AC import urllib import sys import json ENCODING = 'utf-8' def queryLocation(term): term = term.encode(ENCODING) if type(term) == unicode else term url = "http:...
0
0
0
0
0
0
observations/r/pntsprd.py
hajime9652/observations
199
1600302
<reponame>hajime9652/observations<gh_stars>100-1000 # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import csv import numpy as np import os import sys from observations.util import maybe_download_and_extract def pntsprd(path): ""...
0
0
0
0
0
0
misc/gce-federation/filter_plugins/gce_federation_filters.py
nixpanic/openshift-ansible-contrib
324
1600340
#!/usr/bin/python # -*- coding: utf-8 -*- # vim: expandtab:tabstop=4:shiftwidth=4 ''' Custom filters for use in gce-federation scripts ''' def add_cloudconfig_master(master_config) -> object: for service in ('apiServerArguments', 'controllerArguments'): for key, val in {'cloud-provider': 'gce', 'cloud-con...
0
3
0
0
3
0
models/inplace_abn/bn.py
lonestar686/pytorch-saltnet
289
1600341
<gh_stars>100-1000 import torch from queue import Queue from .functions import * from .abn import ABN class InPlaceABN(ABN): """InPlace Activated Batch Normalization""" def forward(self, x): exponential_average_factor = 0.0 if self.training and self.track_running_stats: self.nu...
0
0
0
0
0
0
doc/content/demos/bootstrap-5-confirmation-popup/bootstrap-5-confirmation-popup.py
korantu/lona
230
1600348
<reponame>korantu/lona from lona.html import Strong, THead, TBody, Table, HTML, Tr, Th, Td, H1 from lona import LonaView, LonaApp from lona_bootstrap_5 import ( SecondaryButton, PrimaryButton, DangerButton, Progress, Modal, ) app = LonaApp(__file__) NAMES = [ 'Alice', 'Bob', 'Mallory'...
0
0
0
0
0
0
Sliding window/1839. Longest Substring Of All Vowels in Order.py
beckswu/Leetcode
138
1600358
class Solution: def longestBeautifulSubstring(self, word: str) -> int: cnt = 1 start = res = 0 for i, (prev, cur) in enumerate(zip(word, word[1:]), 1): if cur < prev: cnt = 1 start = i elif cur > prev: cnt += 1 ...
2
2
0
0
4
0
shared/src/ecom/setup.py
Al-bambino/aws-serverless-ecommerce-platform
758
1600385
<reponame>Al-bambino/aws-serverless-ecommerce-platform #!/usr/bin/env python3 from setuptools import find_packages, setup setup( author="Amazon Web Services", install_requires=["boto3"], license="MIT-0", name="ecom", packages=find_packages(), setup_requires=["pytest-runner"], test_suite=...
0
0
0
0
0
0
example/playback.py
animuku/pyk4a
186
1600404
<gh_stars>100-1000 from argparse import ArgumentParser import cv2 from helpers import colorize, convert_to_bgra_if_required from pyk4a import PyK4APlayback def info(playback: PyK4APlayback): print(f"Record length: {playback.length / 1000000: 0.2f} sec") def play(playback: PyK4APlayback): while True: ...
0
0
0
0
0
0
apps/dash-pileup-demo/app.py
JeroenvdSande/dash-sample-apps
2,332
1600436
import os import dash_html_components as html import dash_core_components as dcc from dash.dependencies import Input, Output import dash_bio import pandas as pd import numpy as np import math import plotly.graph_objects as go from layout_helper import run_standalone_app text_style = {"color": "#506784", "font-family"...
0
8
0
0
8
0
spirit/topic/notification/urls.py
Ke-xueting/Spirit
974
1600457
# -*- coding: utf-8 -*- from django.conf.urls import re_path from . import views app_name = 'notification' urlpatterns = [ re_path(r'^$', views.index, name='index'), re_path(r'^unread/$', views.index_unread, name='index-unread'), re_path(r'^ajax/$', views.index_ajax, name='index-ajax'), re_path(r'^(...
0
0
0
0
0
0
www/tests/packed_arguments.py
raspberrypieman/brython
5,926
1600462
<filename>www/tests/packed_arguments.py # unpacking function parameters args = [3,16,2] log(range(*args)) log(range(3,16,2)) def parrot(voltage, state='a stiff', action='voom'): log("-- This parrot wouldn't", action, end=' ') log("if you put", voltage, "volts through it.", end=' ') log("E's", state, "!") d...
0
0
0
0
0
0