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 |
|---|---|---|---|---|---|---|---|---|---|---|
src/robomaster/robotic_arm.py | yukaryote/RoboMaster-SDK | 204 | 153937 | <filename>src/robomaster/robotic_arm.py<gh_stars>100-1000
# -*-coding:utf-8-*-
# Copyright (c) 2020 DJI.
#
# 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 in the file LICENSE.txt or at
#
# htt... | 0 | 0 | 0 | 0 | 0 | 0 |
pxr/usdQt/testenv/testUsdQtOpinionProxy.py | goodbyekansas/usd-qt | 124 | 153985 | #!/pxrpythonsubst
#
# Copyright 2016 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
... | 0 | 0 | 0 | 0 | 0 | 0 |
Harry-Potter-Cloak/HarryPotterCloak.py | Affanmir/Awesome-Python-Scripts | 1,026 | 153990 | <filename>Harry-Potter-Cloak/HarryPotterCloak.py
import cv2
import numpy
def hello(x):
print("")
if __name__=='__main__':
cap = cv2.VideoCapture(0)
bars = cv2.namedWindow("bars")
cv2.createTrackbar("upper_hue","bars",110,180,hello)
cv2.createTrackbar("upper_saturation","bars",255, 255, hello)
cv2.createTrackba... | 0 | 0 | 0 | 0 | 0 | 0 |
Examples/Legacy/BoseHubbard1d/bosehubbard1d.py | pesvut/netket | 352 | 154015 | <gh_stars>100-1000
# Copyright 2018-2020 The Simons Foundation, 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
#... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_bn128_and_bls12_381.py | kclowes/py_ecc | 122 | 154026 | import time
import pytest
from py_ecc import (
bn128,
optimized_bn128,
bls12_381,
optimized_bls12_381,
)
from py_ecc.fields import (
bls12_381_FQ,
bls12_381_FQ2,
bls12_381_FQ12,
bn128_FQ,
bn128_FQ2,
bn128_FQ12,
optimized_bls12_381_FQ,
optimized_bls12_381_FQ2,
optim... | 0 | 23 | 0 | 0 | 23 | 0 |
test/ux/components/model/onnx/test_model.py | intel/neural-compressor | 172 | 154056 | <reponame>intel/neural-compressor<gh_stars>100-1000
# -*- coding: utf-8 -*-
# Copyright (c) 2021 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 at
#
# http://www.apache.org/... | 0 | 0 | 0 | 0 | 0 | 0 |
plato/datasources/multimodal/kinetics_mm.py | cuiboyuan/plato | 135 | 154085 | """
The backup interface for the kinetics dataset for a easier way to prepare the dataset
The data structure is:
├── data
│ ├── ${DATASET}
│ │ ├── ${DATASET}_train_list_videos.txt
│ │ ├── ${DATASET}_val_list_videos.txt
│ │ ├── annotations
│ │ ├── videos_train
│ │ ├── videos_val
│ │ │ ├── ab... | 0 | 0 | 0 | 1 | 1 | 0 |
corehq/form_processor/tests/test_doc_types.py | akashkj/commcare-hq | 471 | 154090 | from django.test import SimpleTestCase
from corehq.form_processor.models import XFormInstanceSQL
class FormDocTypesTest(SimpleTestCase):
def test_doc_types(self):
for doc_type in XFormInstanceSQL.DOC_TYPE_TO_STATE:
self.assertIn(doc_type, XFormInstanceSQL.ALL_DOC_TYPES)
def test_deleted(... | 0 | 0 | 0 | 0 | 0 | 0 |
fabric_bolt/projects/model_managers.py | jooni22/fabric-bolt | 219 | 154095 | <filename>fabric_bolt/projects/model_managers.py
from django.db import models
class ActiveManager(models.Manager):
def get_queryset(self):
return super(ActiveManager, self).get_queryset().filter(date_deleted__isnull=True)
class ActiveDeploymentManager(models.Manager):
def get_queryset(self):
... | 0 | 0 | 0 | 0 | 0 | 0 |
tractseg/experiments/dm_reg_lowres.py | inaccel/TractSeg | 148 | 154102 | <gh_stars>100-1000
from tractseg.experiments.base_legacy.dm_reg_legacy import Config as DmRegConfig
class Config(DmRegConfig):
DATASET = "HCP_32g"
RESOLUTION = "2.5mm"
FEATURES_FILENAME = "32g_25mm_peaks"
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/spot/bswap/test_bswap_pool_configure.py | Banging12/binance-connector-python | 512 | 154113 | <filename>tests/spot/bswap/test_bswap_pool_configure.py<gh_stars>100-1000
import responses
from binance.spot import Spot as Client
from tests.util import mock_http_response
from tests.util import random_str
mock_item = {"key_1": "value_1", "key_2": "value_2"}
key = random_str()
secret = random_str()
@mock_http_respo... | 0 | 0 | 0 | 0 | 0 | 0 |
aries_cloudagent/transport/outbound/tests/test_http_transport.py | SNU-Blockchain-2021-Fall-Group-H/aries-cloudagent-python | 247 | 154123 | import asyncio
import pytest
from aiohttp.test_utils import AioHTTPTestCase, unittest_run_loop
from aiohttp import web
from asynctest import mock as async_mock
from ....core.in_memory import InMemoryProfile
from ....utils.stats import Collector
from ...wire_format import JsonWireFormat
from ..base import OutboundTr... | 0 | 1 | 0 | 0 | 1 | 0 |
utime/dataset/sleep_study_dataset/subject_dir_sleep_study_dataset_base.py | learning310/U-Time | 138 | 154145 | <reponame>learning310/U-Time
import os
import numpy as np
from utime.dataset.sleep_study_dataset.abc_sleep_study_dataset \
import AbstractBaseSleepStudyDataset
from utime.errors import CouldNotLoadError
from utime.dataset.utils import find_subject_folders
class SubjectDirSleepStudyDatasetBase(AbstractBaseSleepSt... | 0 | 0 | 0 | 0 | 0 | 0 |
akshare/stock/stock_zh_kcb_report.py | lisong996/akshare | 4,202 | 154183 | <filename>akshare/stock/stock_zh_kcb_report.py
# -*- coding:utf-8 -*-
#!/usr/bin/env python
"""
Date: 2021/8/20 19:00
Desc: 科创板报告
http://data.eastmoney.com/notices/kcb.html
"""
import pandas as pd
import requests
from tqdm import tqdm
def _stock_zh_kcb_report_em_page() -> int:
"""
科创板报告的页数
http://data.eas... | 0 | 0 | 0 | 0 | 0 | 0 |
indra/preassembler/custom_preassembly.py | kkaris/indra | 136 | 154216 | <filename>indra/preassembler/custom_preassembly.py
"""This module contains a library of functions that are
useful for building custom preassembly logic for some applications.
They are typically used as matches_fun or refinement_fun arguments
to the Preassembler and other modules."""
import logging
from indra.statements... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/rp2/pio_pinchange.py | ProofDx/micropython | 13,648 | 154220 | # Example using PIO to wait for a pin change and raise an IRQ.
#
# Demonstrates:
# - PIO wrapping
# - PIO wait instruction, waiting on an input pin
# - PIO irq instruction, in blocking mode with relative IRQ number
# - setting the in_base pin for a StateMachine
# - setting an irq handler for a StateMachine
# ... | 0 | 0 | 0 | 0 | 0 | 0 |
sw/device/silicon_creator/lib/crypto/tests/rsa_3072_verify_set_testvectors.py | asb/opentitan | 1,375 | 154245 | <filename>sw/device/silicon_creator/lib/crypto/tests/rsa_3072_verify_set_testvectors.py<gh_stars>1000+
#!/usr/bin/env python3
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
import argparse
import os
import sys
import h... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/datasets/test_squad.py | yasufumy/textflow | 138 | 154246 | import shutil
import tempfile
from unittest import TestCase, mock
import pytest
from lineflow import download
from lineflow.datasets.squad import Squad, get_squad
class SquadTestCase(TestCase):
@classmethod
def setUpClass(cls):
cls.default_cache_root = download.get_cache_root()
cls.temp_dir... | 0 | 0 | 0 | 0 | 0 | 0 |
lib/roi_data_layer/minibatch.py | psaboia/RGB-N | 117 | 154255 | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME> and <NAME>
# --------------------------------------------------------
"""Compute minibatch blobs for training a Fast R-CNN network."""
fr... | 0 | 2 | 0 | 0 | 2 | 0 |
crawler/daily_prices.py | ytzeng1/Sentiment-Analysis-in-Event-Driven-Stock-Price-Movement-Prediction | 643 | 154274 | #!/usr/bin/env python3
import os
import sys
import json
from datetime import datetime
from datetime import timedelta
from yahoo_finance import repeat_download
# collect the tickers to crawl their corresponding price information
def get_tickers(date, tickers) -> object:
try:
f = open('./input/news/' + ... | 0 | 1 | 0 | 0 | 1 | 0 |
281 Zigzag Iterator.py | ChiFire/legend_LeetCode | 872 | 154306 | <filename>281 Zigzag Iterator.py
"""
Premium Question
"""
__author__ = 'Daniel'
class ZigzagIterator(object):
def __init__(self, v1, v2):
"""
Initialize your data structure here.
:type v1: List[int]
:type v2: List[int]
"""
self.mat = [v1, v2]
self.maxa = max... | 0 | 0 | 0 | 0 | 0 | 0 |
pyjs/builtin/mkbuiltin.py | takipsizad/pyjs | 739 | 154308 | #!/usr/bin/env python
import re
func_type = {
'jsmethod': 0,
'function': 1,
'staticmethod': 2,
'classmethod': 3,
'wrappermethod': 4,
}
short_names = {
'module': 'm$',
'globals': 'g$',
'locals': 'l$',
'funcbase': 'f$',
'builtin': 'B$',
'constants': 'C$',
'None': 'N$',
... | 0 | 0 | 0 | 0 | 0 | 0 |
src/python/qfy.py | nh13/hap.py | 315 | 154327 | <reponame>nh13/hap.py
#!/usr/bin/env python
# coding=utf-8
#
# Copyright (c) 2010-2015 Illumina, Inc.
# All rights reserved.
#
# This file is distributed under the simplified BSD license.
# The full text can be found here (and in LICENSE.txt in the root folder of
# this distribution):
#
# https://github.com/Illumina/li... | 0 | 0 | 0 | 0 | 0 | 0 |
deep-rl/lib/python2.7/site-packages/OpenGL/GL/EXT/framebuffer_blit.py | ShujaKhalid/deep-rl | 210 | 154335 | '''OpenGL extension EXT.framebuffer_blit
This module customises the behaviour of the
OpenGL.raw.GL.EXT.framebuffer_blit to provide a more
Python-friendly API
Overview (from the spec)
This extension modifies EXT_framebuffer_object by splitting the
framebuffer object binding point into separate DRAW and READ
bin... | 0 | 1 | 0 | 0 | 1 | 0 |
mkdocs_awesome_pages_plugin/tests/e2e/test_nav.py | Owen-Liuyuxuan/mkdocs-awesome-pages-plugin | 226 | 154336 | <filename>mkdocs_awesome_pages_plugin/tests/e2e/test_nav.py
from .base import E2ETestCase
from ...meta import DuplicateRestItemError
from ...navigation import NavEntryNotFound
class TestNav(E2ETestCase):
def test_all_listed(self):
navigation = self.mkdocs(self.config, [
'1.md',
'2... | 0 | 0 | 0 | 0 | 0 | 0 |
pyzoo/zoo/models/image/imageclassification/image_classification.py | limn2o4/analytics-zoo | 2,970 | 154361 | <reponame>limn2o4/analytics-zoo<gh_stars>1000+
#
# Copyright 2018 Analytics Zoo 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 |
research/astronet/third_party/robust_mean/test_data/random_normal.py | xychu/models | 286 | 154362 | <reponame>xychu/models
"""This file contains 1,000 points of a random normal distribution.
The mean of the distribution is 2, and the standard deviation is 1.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
RANDOM_NORMAL = [
0.692741320869,
1.9... | 0 | 0 | 0 | 0 | 0 | 0 |
core/providers/torrent_modules/__init__.py | 0x20Man/Watcher3 | 320 | 154365 | <reponame>0x20Man/Watcher3
import os
for module in os.listdir(os.path.dirname(os.path.realpath(__file__))):
if module[-3:] == '.py' and module[0] not in ('.', '_'):
__import__('core.providers.torrent_modules.{}'.format(module[:-3]))
| 0 | 0 | 0 | 0 | 0 | 0 |
anaconda_project/requirements_registry/requirements/test/test_redis_requirement.py | kathatherine/anaconda-project | 188 | 154367 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2016, Anaconda, Inc. All rights reserved.
#
# Licensed under the terms of the BSD 3-Clause License.
# The full license is in the file LICENSE.txt, distributed with this software.
# -------------------... | 1 | 2 | 0 | 0 | 3 | 0 |
test/profile_test.py | tamirzb/logcat-color | 373 | 154393 | from common import *
from logcatcolor.column import *
from logcatcolor.config import *
from logcatcolor.layout import *
from logcatcolor.profile import *
from logcatcolor.reader import *
import unittest
class ProfileTest(unittest.TestCase):
def setUp(self):
pass
def test_package_name_filter(self):
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_tasks.py | jgillis/piwheels | 120 | 154406 | <filename>tests/test_tasks.py
# The piwheels project
# Copyright (c) 2017 <NAME> <https://github.com/bennuttall>
# Copyright (c) 2017 <NAME> <<EMAIL>>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redist... | 0 | 0 | 0 | 0 | 0 | 0 |
bibliopixel/drivers/serial/devices.py | rec/leds | 253 | 154413 | <reponame>rec/leds
import serial, serial.tools.list_ports
from distutils.version import LooseVersion
from . codes import CMDTYPE, LEDTYPE, SPIChipsets, BufferChipsets
from . import io
from ... drivers.return_codes import raise_error
from ... util import log, util
from ... project.importer import import_module
_DEVICES... | 0 | 0 | 0 | 0 | 0 | 0 |
check/check_ceil_rouge_badcase.py | SunnyMarkLiu/lic2019-dureader2.0-rank2 | 137 | 154417 | <filename>check/check_ceil_rouge_badcase.py
#!/usr/bin/python
# _*_ coding: utf-8 _*_
"""
验证生成的 MRC 数据集的有效性
@author: <NAME>, <EMAIL>
@github: https://github.com/sunnymarkLiu
@time : 2019/4/12 17:08
"""
import sys
import os
import json
from tqdm import tqdm
# python check_ceil_rouge_badcase.py 50 50 ../input/dureade... | 0 | 0 | 0 | 0 | 0 | 0 |
proselint/checks/spelling/in_un.py | ankita240796/proselint | 4,163 | 154423 | <gh_stars>1000+
"""in- vs. un-."""
from proselint.tools import memoize, preferred_forms_check
@memoize
def check(text):
"""in- vs un-."""
err = "spelling.in_un"
msg = "in- vs. un-. '{}' is the preferred spelling."
preferences = [
["inadvisable", ["unadvisable"]],
["inalienab... | 0 | 0 | 0 | 0 | 0 | 0 |
wren/core/podcast.py | tzano/wren | 245 | 154432 | # -*- coding: utf-8 -*-
from __future__ import annotations
from resources.constants import EMPTY_STR, EMPTY_LIST, EMPTY_DICT
from dateutil import parser
class Podcast():
"""
Podcast class
"""
def __init__(self, title, podcast_url, **kwargs):
"""
Initialize the class with you title and... | 1 | 2 | 0 | 1 | 4 | 0 |
src/utils.py | AlbertoMoretto/mondrianforest | 214 | 154438 | <gh_stars>100-1000
#!/usr/bin/env python
import numpy as np
import math
def compute_kl(mean_1, log_prec_1, mean_2, log_prec_2):
"""
compute KL between two Gaussian distributions
"""
mean_1 = np.asarray(mean_1)
log_prec_1 = np.asarray(log_prec_1)
mean_2 = np.asarray(mean_2)
log_prec_2 = np... | 0 | 0 | 0 | 0 | 0 | 0 |
selfdrive/debug/can_print_changes.py | shoes22/openpilot | 37,508 | 154439 | <gh_stars>1000+
#!/usr/bin/env python3
import binascii
import sys
from collections import defaultdict
import cereal.messaging as messaging
from common.realtime import sec_since_boot
def can_printer(bus=0):
"""Collects messages and prints when a new bit transition is observed.
This is very useful to find signals ... | 0 | 0 | 0 | 0 | 0 | 0 |
awx/main/tests/functional/models/test_job_launch_config.py | bhyunki/awx | 11,396 | 154447 | <reponame>bhyunki/awx
import pytest
# AWX
from awx.main.models import JobTemplate, JobLaunchConfig
@pytest.fixture
def full_jt(inventory, project, machine_credential):
jt = JobTemplate.objects.create(name='my-jt', inventory=inventory, project=project, playbook='helloworld.yml')
jt.credentials.add(machine_cre... | 0 | 0 | 0 | 0 | 0 | 0 |
finviz/helper_functions/error_handling.py | yplsydnr/finviz | 746 | 154449 | from finviz.config import connection_settings
class NoResults(Exception):
""" Raise when there are no results found. """
def __init__(self, query):
super(NoResults, self).__init__(f"No results found for query: {query}")
class InvalidTableType(Exception):
""" Raise when the given table type is i... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/compute_metrics.py | yarny/gbdt | 335 | 154456 | <filename>scripts/compute_metrics.py<gh_stars>100-1000
#!/usr/bin/python
import collections
import math
import re
import sys
import operator
from optparse import make_option
from optparse import OptionParser
option_list = [
make_option('--group_file', action='store', type='string', dest='group_file',
... | 0 | 0 | 0 | 0 | 0 | 0 |
models/cnn_policy.py | amitport/A2C | 181 | 154465 | <filename>models/cnn_policy.py
import numpy as np
import tensorflow as tf
from models.base_policy import BasePolicy
from layers import conv2d, flatten, dense
from layers import orthogonal_initializer, noise_and_argmax
class CNNPolicy(BasePolicy):
def __init__(self, sess, input_shape, num_actions, reuse=False, is_... | 0 | 0 | 0 | 0 | 0 | 0 |
custom/api/utils.py | dimagilg/commcare-hq | 471 | 154487 | from requests.auth import HTTPBasicAuth
def apply_updates(doc, update_dict) -> object:
# updates the doc with items from the dict
# returns whether or not any updates were made
should_save = False
for key, value in update_dict.items():
if getattr(doc, key, None) != value:
setattr(d... | 0 | 4 | 0 | 0 | 4 | 0 |
sdks/python/apache_beam/examples/kafkataxi/kafka_taxi.py | harrydrippin/beam | 5,279 | 154504 | #
# 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 under the Apache License, Version 2.0
# (the "License"); you may not us... | 0 | 2 | 0 | 0 | 2 | 0 |
torchsampler/__init__.py | LeeTaeHoon97/imbalanced-dataset-sampler | 1,753 | 154511 | from torchsampler.__about__ import * # noqa: F401 F403
from torchsampler.imbalanced import ImbalancedDatasetSampler
__all__ = [
'ImbalancedDatasetSampler',
]
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/type/test_extensions.py | fugal-dy/graphql-core | 249 | 154517 | <gh_stars>100-1000
from typing import Any, Dict, cast
from pytest import mark, param, raises
from graphql.type import (
GraphQLArgument,
GraphQLDirective,
GraphQLEnumType,
GraphQLEnumValue,
GraphQLField,
GraphQLInputField,
GraphQLInputObjectType,
GraphQLInterfaceType,
GraphQLObject... | 0 | 0 | 0 | 0 | 0 | 0 |
_solved/solutions/04-spatial-joins24.py | lleondia/geopandas-tutorial | 341 | 154551 | # Take a subset for the Muette district
land_use_muette = combined[combined['district_name'] == 'Muette'] | 0 | 0 | 0 | 0 | 0 | 0 |
2020/day_20.py | nyanthanya/Contoh-Program | 105 | 154562 | <reponame>nyanthanya/Contoh-Program
from collections import defaultdict
from itertools import product
from math import prod
import aoc_helper
import networkx as nx
import numpy as np
from scipy.ndimage import convolve
def parse_raw():
tiles = {}
for tile in raw.split("\n\n"):
it = iter(tile.splitlines... | 0 | 0 | 0 | 0 | 0 | 0 |
docs/examples/compute/ec2/temporary_credentials.py | dupontz/libcloud | 1,435 | 154569 | from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
cls = get_driver(Provider.EC2)
driver = cls('temporary access key', 'temporary secret key',
token='<PASSWORD>', region="us-west-1")
| 0 | 0 | 0 | 0 | 0 | 0 |
profiler/translation/seq2seq/data/sampler.py | NestLakerJasonLIN/pipedream | 273 | 154616 | <filename>profiler/translation/seq2seq/data/sampler.py
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import logging
import torch
from torch.utils.data.sampler import Sampler
from mlperf_compliance import mlperf_log
from seq2seq.utils import gnmt_print
from seq2seq.utils import get_world_si... | 0 | 0 | 0 | 0 | 0 | 0 |
utils/tf_visualizer.py | NVlabs/UMR | 184 | 154631 | # -----------------------------------------------------------
# Copyright (C) 2020 NVIDIA Corporation. All rights reserved.
# Nvidia Source Code License-NC
# Code written by <NAME>.
# -----------------------------------------------------------
import numpy as np
import os
import ntpath
import time
import termcolor
# c... | 0 | 6 | 0 | 0 | 6 | 0 |
tests/core/sinkhorn_lr_test.py | ersisimou/ott | 110 | 154645 | <filename>tests/core/sinkhorn_lr_test.py
# coding=utf-8
# Copyright 2022 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
#
# Unl... | 0 | 0 | 0 | 0 | 0 | 0 |
src/role/worker.py | grischard/OSMDeepOD | 156 | 154648 | import rq
from rq import Queue
from rq import Connection
from redis import Redis
class Worker(object):
def __init__(self, job_queue_name_list):
self.queues = job_queue_name_list
def run(self, redis):
redis_connection = Redis(redis[0], redis[1], password=redis[2])
with Connection(redis... | 0 | 1 | 0 | 0 | 1 | 0 |
kivy/uix/camera.py | sirpercival/kivy | 317 | 154688 | <filename>kivy/uix/camera.py
'''
Camera
======
The :class:`Camera` widget is used to capture and display video from a camera.
Once the widget is created, the texture inside the widget will be automatically
updated. Our :class:`~kivy.core.camera.CameraBase` implementation is used under
the hood::
cam = Camera()
B... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/modules/contrib/test_amixer.py | spxtr/bumblebee-status | 1,089 | 154692 | import pytest
import util.cli
import core.config
import modules.contrib.amixer
@pytest.fixture
def module_mock(request) -> object:
def _module_mock(config: list[object] = []) -> object:
return modules.contrib.amixer.Module(
config=core.config.Config(config),
theme=None
)
... | 4 | 4 | 0 | 0 | 8 | 0 |
sparse/tests/test_dask_interop.py | simonthor/sparse | 391 | 154698 | <gh_stars>100-1000
from dask.base import tokenize
import sparse
def test_deterministic_token():
a = sparse.COO(data=[1, 2, 3], coords=[10, 20, 30], shape=(40,))
b = sparse.COO(data=[1, 2, 3], coords=[10, 20, 30], shape=(40,))
assert tokenize(a) == tokenize(b)
# One of these things is not like the othe... | 0 | 0 | 0 | 0 | 0 | 0 |
petl/test/io/test_text.py | OptionMetrics/petl | 495 | 154708 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
from tempfile import NamedTemporaryFile
import gzip
import os
import io
from petl.test.helpers import ieq, eq_
from petl.io.text import fromtext, totext
def test_fromtext():
# initial data
f = NamedTemporaryFile(dele... | 0 | 0 | 0 | 0 | 0 | 0 |
alipay/aop/api/response/AlipayInsDataAuthorizationQueryResponse.py | antopen/alipay-sdk-python-all | 213 | 154754 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayInsDataAuthorizationQueryResponse(AlipayResponse):
def __init__(self):
super(AlipayInsDataAuthorizationQueryResponse, self).__init__()
self._auth_agreement_url:... | 0 | 2 | 0 | 2 | 4 | 0 |
dl_shape_estimate.py | tanyinghui/Minimal-Hand-pytorch | 158 | 154757 | import os
import torch
import create_data
from model import shape_net
import numpy as np
def align_bone_len(opt_, pre_) -> object:
opt = opt_.copy()
pre = pre_.copy()
opt_align = opt.copy()
for i in range(opt.shape[0]):
ratio = pre[i][6] / opt[i][6]
opt_align[i] = ratio * opt_alig... | 0 | 2 | 0 | 0 | 2 | 0 |
src/configs.py | CaoHaoyuan/SReC | 951 | 154779 | <filename>src/configs.py
best_bpsp = float("inf")
n_feats = 64
scale = 3
resblocks = 3
K = 10
plot = ""
log_likelihood = True
collect_probs = False
| 0 | 0 | 0 | 0 | 0 | 0 |
test/run/t28.py | timmartin/skulpt | 2,671 | 154789 | <reponame>timmartin/skulpt
z = 0
for x in [1,2,3]:
z += x
print z
| 0 | 0 | 0 | 0 | 0 | 0 |
editing/interfacegan/helpers/pose_estimator.py | cedro3/stylegan3-editing | 347 | 154805 | <filename>editing/interfacegan/helpers/pose_estimator.py
import math
import torch
import torch.nn as nn
import torchvision
from torchvision import transforms
from configs.paths_config import model_paths
"""
HopeNet is adopted from https://github.com/natanielruiz/deep-head-pose/blob/master/code/hopenet.py
"""
def s... | 0 | 0 | 0 | 0 | 0 | 0 |
frontera/strategy/depth.py | buildfail/frontera | 1,267 | 154806 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from frontera.core.components import States
from frontera.strategy import BaseCrawlingStrategy
class BreadthFirstCrawlingStrategy(BaseCrawlingStrategy):
def read_seeds(self, fh):
for url in fh:
url = url.strip()
req = s... | 0 | 3 | 0 | 0 | 3 | 0 |
test/test_baseline_training.py | jturner65/habitat-api | 489 | 154809 | #!/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 glob
import os
import random
import numpy as np
import pytest
try:
import torch
import torch.distribute... | 0 | 0 | 0 | 0 | 0 | 0 |
Contents/Libraries/Shared/json_tricks/__init__.py | jippo015/Sub-Zero.bundle | 1,553 | 154813 |
from .utils import hashodict, NoNumpyException, NoPandasException, get_scalar_repr, encode_scalars_inplace
from .comment import strip_comment_line_with_symbol, strip_comments
from .encoders import TricksEncoder, json_date_time_encode, class_instance_encode, json_complex_encode, \
numeric_types_encode, ClassInstanceEn... | 0 | 0 | 0 | 0 | 0 | 0 |
test/torchaudio_unittest/transforms/autograd_cuda_test.py | popcornell/audio | 1,718 | 154822 | <gh_stars>1000+
from torchaudio_unittest.common_utils import (
PytorchTestCase,
skipIfNoCuda,
)
from .autograd_test_impl import AutogradTestMixin, AutogradTestFloat32
@skipIfNoCuda
class AutogradCUDATest(AutogradTestMixin, PytorchTestCase):
device = "cuda"
@skipIfNoCuda
class AutogradRNNTCUDATest(Autog... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/plot_2d_linear_regression.py | sumau/tick | 411 | 154824 | <filename>examples/plot_2d_linear_regression.py
"""
===================================
Linear regression in two dimensions
===================================
In this example, we try to predict the median price of houses in Boston's
neighbors by looking at two features: the average of the number of rooms per
dwelling... | 0 | 0 | 0 | 0 | 0 | 0 |
py/examples/client_send_request.py | NorthIsUp/loqui | 147 | 154841 | from __future__ import absolute_import
from __future__ import print_function
from loqui.client import LoquiClient
client = LoquiClient(('localhost', 4001))
print(len(client.send_request('hello world'))) | 0 | 0 | 0 | 0 | 0 | 0 |
dev/Tools/lmbr_aws/cleanup_utils/cleanup_utils.py | BadDevCode/lumberyard | 1,738 | 154843 | #
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or th... | 3 | 6 | 0 | 0 | 9 | 0 |
main.py | wadahana/pcap2har | 126 | 154849 | #!/usr/bin/env python
'''
Main program that converts pcaps to HAR's.
'''
import os
import optparse
import logging
import sys
import json
from pcap2har import pcap
from pcap2har import http
from pcap2har import httpsession
from pcap2har import har
from pcap2har import tcp
from pcap2har import settings
from pcap2har.p... | 0 | 0 | 0 | 0 | 0 | 0 |
src/wavegrad/model.py | CookiePPP/wavegrad | 182 | 154857 | <reponame>CookiePPP/wavegrad
# Copyright 2020 LMNT, 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 req... | 0 | 0 | 0 | 0 | 0 | 0 |
ultimatelabeling/main.py | MauroPfister/UltimateLabeling | 244 | 154864 | from PyQt5.QtWidgets import *
from PyQt5.QtCore import Qt
from PyQt5 import QtCore, QtGui
from .views import *
from .models import State, StateListener, KeyboardNotifier
from .styles import Theme
class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle("UltimateLa... | 0 | 0 | 0 | 0 | 0 | 0 |
test/python/transpiler/test_count_ops_longest_path_pass.py | TheGupta2012/qiskit-terra | 1,599 | 154866 | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_data.py | DevFifteen/chatterbot-corpus | 1,197 | 154883 | import os
import sys
import inspect
from unittest import TestCase
from chatterbot import corpus
from chatterbot import languages
from chatterbot.constants import STATEMENT_TEXT_MAX_LENGTH
from chatterbot_corpus.corpus import DATA_DIRECTORY
class CorpusUtilsTestCase(TestCase):
"""
This test case is designed t... | 0 | 0 | 0 | 0 | 0 | 0 |
third_party/rust_crates/vendor/unicode-normalization/scripts/unicode.py | wwjiang007/fuchsia-1 | 210 | 154898 | #!/usr/bin/env python
#
# Copyright 2011-2018 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT lice... | 0 | 0 | 0 | 0 | 0 | 0 |
athena/transform/feats/ops/py_x_ops.py | wgfi110/athena | 791 | 154917 | <reponame>wgfi110/athena<filename>athena/transform/feats/ops/py_x_ops.py
# Copyright (C) ATHENA 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://w... | 0 | 0 | 0 | 0 | 0 | 0 |
dassl/utils/registry.py | Fyy10/Dassl.pytorch | 563 | 154966 | from __future__ import annotations
"""
Modified from https://github.com/facebookresearch/fvcore
"""
__all__ = ["Registry"]
class Registry:
"""A registry providing name -> object mapping, to support
custom modules.
To create a registry (e.g. a backbone registry):
.. code-block:: python
BACKB... | 3 | 4 | 0 | 1 | 8 | 0 |
src/cryptoadvance/specter/devices/hwi/jadepy/__init__.py | aphex3k/specter-desktop | 683 | 154968 | <gh_stars>100-1000
from .jade import JadeAPI
from .jade_error import JadeError
__version__ = "0.0.1"
| 0 | 0 | 0 | 0 | 0 | 0 |
inflate/inflate.py | 00ff0000red/raw-wasm | 314 | 154982 | <filename>inflate/inflate.py
#!/usr/bin/env python
import argparse
import sys
MAXBITS = 15
MAXCLCODES = 19
MAXLCODES = 286
MAXDCODES = 32
FIXLCODES = 288
FIXED_LIT_LENS = [8] * 144 + [9] * 112 + [7] * 24 + [8] * 8
FIXED_DIST_LENS = [5] * 32
CODELEN_LITS = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1... | 0 | 0 | 0 | 0 | 0 | 0 |
zhihu/image_download.py | lzjun567/crawler_html2pdf | 710 | 155012 | {"query": {"function_score": {"query": {
"bool": {"should": [{"multi_match": {"query": "python", "fields": ["nickname^2", "username^4"]}}],
"filter": {"range": {"follower_count": {"gte": "50000", "lte": "100000"}}}}},
"field_value_factor": {"field": "follower_count", "modifier": "log1p", "missing":... | 0 | 0 | 0 | 0 | 0 | 0 |
heat/core/factories.py | Mystic-Slice/heat | 105 | 155022 | """Provides high-level DNDarray initialization functions"""
import numpy as np
import torch
import warnings
from typing import Callable, Iterable, Optional, Sequence, Tuple, Type, Union, List
from .communication import MPI, sanitize_comm, Communication
from .devices import Device
from .dndarray import DNDarray
from ... | 109 | 18 | 0 | 0 | 127 | 0 |
webkit/support/setup_third_party.py | Scopetta197/chromium | 212 | 155056 | <filename>webkit/support/setup_third_party.py<gh_stars>100-1000
#!/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.
"""A helper script for setting up forwarding headers."""
import er... | 0 | 0 | 0 | 0 | 0 | 0 |
benchmark/setup.py | gxdai/solt | 263 | 155060 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import find_packages, setup
with open("requirements.txt") as f:
reqs = f.read().splitlines()
description = """Benchmark of the data augmentation libraries"""
setup(
author="<NAME>",
author_email="<EMAIL>",
classif... | 0 | 0 | 0 | 0 | 0 | 0 |
academicstoday_project/student/views/credit.py | LeeDoona/EasyGrading | 146 | 155068 | from django.shortcuts import render
from django.core import serializers
from django.http import HttpResponse
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
from django.conf import settings
import json
import datetime
from registrar.models import Course
from registr... | 0 | 3 | 0 | 0 | 3 | 0 |
packer/placer.py | Commodoreprime/Command-Block-Assembly | 223 | 155070 |
from __future__ import annotations
def escape(text) -> object:
return text.replace('\\', '\\\\').replace('"', '\\"')
opposites = {
'north': 'south',
'east': 'west',
'south': 'north',
'west': 'east'
}
class Rel:
def __init__(self, offset: int=0):
self.offset = offset
def __add__(s... | 2 | 7 | 0 | 2 | 11 | 0 |
app/cifar10/build_basenet.py | nrupatunga/pynetbuilder | 381 | 155074 | <reponame>nrupatunga/pynetbuilder<filename>app/cifar10/build_basenet.py
"""
Copyright 2016 Yahoo Inc.
Licensed under the terms of the 2 clause BSD license.
Please see LICENSE file in the project root for terms.
"""
from caffe.proto import caffe_pb2
import google.protobuf as pb
from caffe import layers as L
from caffe... | 0 | 0 | 0 | 0 | 0 | 0 |
gluoncv/utils/metrics/coco_keypoints.py | Kh4L/gluon-cv | 5,447 | 155081 | from __future__ import annotations
"""MS COCO Key Points Evaluate Metrics."""
from __future__ import absolute_import
import os
from os import path as osp
from collections import OrderedDict
import warnings
try:
from mxnet.metric import EvalMetric
except ImportError:
from mxnet.gluon.metric import EvalMetric
c... | 4 | 2 | 0 | 2 | 8 | 0 |
tests/unit/test_neural_network_random_freeze_repurposer.py | apaleyes/xfer | 244 | 155088 | # Copyright 2018 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://www.apache.org/licenses/LICENSE-2.0
#
# or in th... | 0 | 1 | 0 | 0 | 1 | 0 |
Windows/etc/serverx/config/config_server.py | Dave360-crypto/Oblivion | 339 | 155093 | # /General
# api: Allows return the results in json.
# db_name_f: Name of data base file.
api_return = True
db_name_f = 'data.db'
# /APIs
# Enables or disables the API.
situacaoIntelx = False
situacaoHaveIPwned = False
situacaoScylla = True
# /Notification E-mail account
# id_f3: E-mail.
# id_f4: Password.
id_f3 = 'E... | 0 | 0 | 0 | 0 | 0 | 0 |
argoverse/utils/polyline_density.py | gargrohin/argoverse-api | 560 | 155095 | <reponame>gargrohin/argoverse-api<gh_stars>100-1000
# <Copyright 2019, Argo AI, LLC. Released under the MIT license.>
from typing import Tuple
import numpy as np
from argoverse.utils.interpolate import interp_arc
NUM_PTS_PER_TRAJ = 50
def get_polyline_length(polyline: np.ndarray) -> float:
"""Calculate the le... | 0 | 0 | 0 | 0 | 0 | 0 |
sdk/python/lib/test/test_resource.py | pcen/pulumi | 12,004 | 155099 | # Copyright 2016-2021, Pulumi 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 required by applicable law or agreed t... | 11 | 13 | 3 | 1 | 28 | 0 |
data/external/repositories/262496/diagnose-heart-master/SETTINGS.py | Keesiu/meta-kaggle | 140 | 155141 | import socket
if socket.gethostname() == 'Faramir': #for CNN_B
data_root = '/home/tencia/Documents/data/heart/'
data_kaggle = data_root + 'kaggle'
data_sunnybrook = data_root + 'sunnybrook'
local_root = '/home/tencia/Dropbox/heart/diagnose-heart/'
data_manual = local_root + 'manual_data'
data_in... | 0 | 0 | 0 | 0 | 0 | 0 |
pptx/enum/shapes.py | iroin/python-pptx | 1,429 | 155169 | <reponame>iroin/python-pptx<filename>pptx/enum/shapes.py
# encoding: utf-8
"""Enumerations used by shapes and related objects."""
from pptx.enum.base import (
alias,
Enumeration,
EnumMember,
ReturnValueOnlyEnumMember,
XmlEnumeration,
XmlMappedEnumMember,
)
from pptx.util import lazyproperty
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/trac/test-trac-0075.py | eLBati/pyxb | 123 | 155226 | <filename>tests/trac/test-trac-0075.py
# -*- coding: utf-8 -*-
import logging
if __name__ == '__main__':
logging.basicConfig()
_log = logging.getLogger(__name__)
import pyxb.binding.generate
import pyxb.binding.datatypes as xs
import pyxb.binding.basis
import pyxb.binding.content
import pyxb.utils.domutils
import x... | 0 | 0 | 0 | 0 | 0 | 0 |
External-Tools/keras-cam/cam.py | IcedDoggie/Micro-Expression-with-Deep-Learning | 249 | 155248 | from keras.models import *
from keras.callbacks import *
import keras.backend as K
from model import *
from data import *
import cv2
import argparse
import pydot, graphviz
from keras.utils import np_utils, plot_model
def visualize_class_activation_map(model_path, img_path, output_path, run_count, write_to_file, post_... | 0 | 2 | 0 | 0 | 2 | 0 |
rqalpha/mod/rqalpha_mod_sys_simulation/testing.py | ForrestLin0805/rqalpha | 5,263 | 155267 | <filename>rqalpha/mod/rqalpha_mod_sys_simulation/testing.py
# -*- coding: utf-8 -*-
# 版权所有 2019 深圳米筐科技有限公司(下称“米筐科技”)
#
# 除非遵守当前许可,否则不得使用本软件。
#
# * 非商业用途(非商业用途指个人出于非商业目的使用本软件,或者高校、研究所等非营利机构出于教育、科研等目的使用本软件):
# 遵守 Apache License 2.0(下称“Apache 2.0 许可”),您可以在以下位置获得 Apache 2.0 许可的副本:http://www.apache.org/licenses/... | 0 | 0 | 0 | 0 | 0 | 0 |
eatiht/eatiht_trees.py | jackastner/eatiht | 346 | 155288 | """eatiht v2 - <NAME> - Copyright 2014"""
from lxml.html import builder as E
from lxml.html import tostring as htmltostring
class TextNodeSubTree(object):
""" This class can be described in a few different ways. A proper
explanation requires a brief definition of terms.
There's two W3C-spec'd ... | 0 | 10 | 0 | 2 | 12 | 0 |
api/urlvoid.py | larrycameron80/Threat-Intelligence-Hunter | 138 | 155310 | <filename>api/urlvoid.py
__author__ = '@abhinavbom a.k.a darkl0rd'
import sys
import os
import urllib2
from xml.dom import minidom
from urllib import quote
from lib.parse import *
# Base API URL
base_url = 'http://api.urlvoid.com/'
# API Key . Key can be obtained from api.urlvoid.com
api_key = '<Add API key Here>'+... | 0 | 0 | 0 | 0 | 0 | 0 |
learning_python/classes/collateral/video_classes_p2/simple_class.py | fallenfuzz/pynet | 528 | 155322 | <reponame>fallenfuzz/pynet
import ipdb # noqa
class NetworkDevice:
def __init__(self, platform, ip_addr):
self.platform = platform
self.ip_addr = ip_addr
# ipdb.set_trace()
rtr1 = NetworkDevice("cisco_ios", "1.1.1.1")
| 0 | 0 | 0 | 0 | 0 | 0 |
Chapter08/c8_02_get_date_varible_using_pandasDataFrame.py | John-ye666/Python-for-Finance-Second-Edition | 236 | 155327 | <reponame>John-ye666/Python-for-Finance-Second-Edition
"""
Name : c8_02_get_date_variable.py
Book : Python for Finance (2nd ed.)
Publisher: Packt Publishing Ltd.
Author : <NAME>
Date : 6/6/2017
email : <EMAIL>
<EMAIL>
"""
import pandas as pd
import scipy as sp
sp.random.see... | 0 | 0 | 0 | 0 | 0 | 0 |
test/test_utils/test_case.py | karldoenitz/karlooper | 161 | 155340 | # -*-encoding:utf-8-*-
from karlooper.utils.encrypt import StrEncryption
from karlooper.utils.base64encrypt import Encryption
from karlooper.utils.des_encrypt import DES
def test_encrypt():
str_encryption = StrEncryption()
str_encryption.input_key("test")
_str = "make a test"
encode_str = str_encrypt... | 0 | 0 | 0 | 0 | 0 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.