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/run/t304.py | timmartin/skulpt | 2,671 | 1793731 | # Test that min & max work on sets
s = set([1,2,3])
print s
print min(s)
print max(s)
| 0 | 0 | 0 | 0 | 0 | 0 |
conan/tools/gnu/get_gnu_triplet.py | Wonders11/conan | 6,205 | 1793740 | from __future__ import annotations
from conans.errors import ConanException
def _get_gnu_triplet(os_, arch, compiler: object | None=None) -> object:
"""
Returns string with <machine>-<vendor>-<op_system> triplet (<vendor> can be omitted in practice)
:param os_: os to be used to create the triplet
:pa... | 1 | 1 | 0 | 0 | 2 | 0 |
bindings/python/cntk/contrib/crosstalkcaffe/utils/format.py | shyamalschandra/CNTK | 17,702 | 1793750 | # Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE.md file in the project root
# for full license information.
# ==============================================================================
'''
The script contains some basic format ops
'''
import re
import json
import platf... | 0 | 3 | 0 | 0 | 3 | 0 |
tools/memory_inspector/memory_inspector/core/stacktrace_unittest.py | kjthegod/chromium | 2,151 | 1793752 | <filename>tools/memory_inspector/memory_inspector/core/stacktrace_unittest.py<gh_stars>1000+
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from memory_inspector.core import stacktrace
... | 0 | 0 | 0 | 0 | 0 | 0 |
CTFS/Nebula/level17.py | Deteriorator/pentest-wiki | 2,908 | 1793795 | #!/usr/bin/python
import os
import pickle
import time
import socket
import signal
signal.signal(signal.SIGCHLD, signal.SIG_IGN)
def server(skt):
line = skt.recv(1024)
obj = pickle.loads(line)
for i in obj:
clnt.send("why did you send me " + i + "?\n")
skt = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0... | 0 | 0 | 0 | 0 | 0 | 0 |
SCRAPE/Lib/site-packages/twisted/test/process_getenv.py | Chinmoy-Prasad-Dutta/scrapy_scraper | 4,612 | 1793819 | <reponame>Chinmoy-Prasad-Dutta/scrapy_scraper
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Used by L{twisted.test.test_process}.
"""
from os import environ
from sys import stdout
items = environ.items()
stdout.write(chr(0).join([k + chr(0) + v for k, v in items]))
stdout.flush()
| 0 | 0 | 0 | 0 | 0 | 0 |
lib/transform/bbox_transform.py | giladsharir/MNC-1 | 544 | 1793836 | <filename>lib/transform/bbox_transform.py
# --------------------------------------------------------
# Multitask Network Cascade
# Modified from py-faster-rcnn (https://github.com/rbgirshick/py-faster-rcnn)
# Copyright (c) 2016, <NAME>
# Licensed under The MIT License [see LICENSE for details]
# -----------------------... | 0 | 0 | 0 | 0 | 0 | 0 |
fuxi/web/api/auth/user_api.py | cocobear/fuxi | 731 | 1793845 | <reponame>cocobear/fuxi
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author : jeffzhang
# @Time : 2019/7/6
# @File : user_api.py
# @Desc : ""
from flask import request
from flask_restful import Resource
from fuxi.common.utils.logger import logger
from fuxi.core.databases.orm.auth.user_orm import DBFuxiAd... | 0 | 0 | 0 | 0 | 0 | 0 |
jaxopt/_src/mirror_descent.py | GeoffNN/jaxopt | 434 | 1793870 | # Copyright 2021 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 or agreed to in writing, ... | 9 | 10 | 14 | 0 | 33 | 0 |
scripts/test_sampler_enumeration.py | vishalbelsare/crosscat | 207 | 1793879 | #
# Copyright (c) 2010-2016, MIT Probabilistic Computing Project
#
# Lead Developers: <NAME> and <NAME>
# Authors: <NAME>, <NAME>, <NAME>, <NAME>
# Research Leads: <NAME>, <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lic... | 0 | 1 | 0 | 0 | 1 | 0 |
test_python_toolbox/test_zip_tools/test_zipping_in_memory.py | hboshnak/python_toolbox | 119 | 1793885 | # Copyright 2009-2017 <NAME>.
# This program is distributed under the MIT license.
from python_toolbox import cute_testing
from python_toolbox import zip_tools
def test():
''' '''
files = (
('meow.txt', b"I'm a cat."),
('dog.txt', b"I'm a dog."),
('folder/binary.bin', bytes(bytearray... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/input/joystick.py | AnantTiwari-Naman/pyglet | 1,160 | 1793904 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 <NAME>
# Copyright (c) 2008-2020 pyglet contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following c... | 0 | 0 | 0 | 0 | 0 | 0 |
recipes/Python/578956_AmazSNS_handler_logging/recipe-578956.py | tdiprima/code | 2,023 | 1793930 | import logging
import boto.sns
class SNSHandler(logging.Handler):
def __init__(self, topic_arn, *args, **kwargs):
super(SnsHandler, self).__init__(*args, **kwargs)
region_name = topic_arn.split(':')[3]
self.sns_connection = boto.sns.connect_to_region(region_name)
self.topic_arn =... | 0 | 0 | 0 | 0 | 0 | 0 |
buildroot/support/testing/tests/package/test_perl_gdgraph.py | rbrenton/hassos | 349 | 1793947 | <filename>buildroot/support/testing/tests/package/test_perl_gdgraph.py
from tests.package.test_perl import TestPerlBase
class TestPerlGDGraph(TestPerlBase):
"""
package:
GDGraph
direct dependencies:
GD XS
GDTextUtil
"""
config = TestPerlBase.config + \
"""
... | 0 | 0 | 0 | 0 | 0 | 0 |
RecoLocalCalo/EcalRecProducers/python/ecalPulseShapeParameters_cff.py | ckamtsikis/cmssw | 852 | 1793977 | <filename>RecoLocalCalo/EcalRecProducers/python/ecalPulseShapeParameters_cff.py<gh_stars>100-1000
import FWCore.ParameterSet.Config as cms
ecal_pulse_shape_templates = cms.PSet(
EBPulseShapeTemplate = cms.vdouble (
1.13979e-02, 7.58151e-01, 1.00000e+00, 8.87744e-01, 6.73548e-01, 4.74332e-01, 3.19561e-01, 2.1... | 0 | 0 | 0 | 0 | 0 | 0 |
chrome/installer/mac/notarize_thing.py | zealoussnow/chromium | 14,668 | 1794011 | <gh_stars>1000+
#!/usr/bin/env python
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import os.path
import sys
sys.path.append(os.path.dirname(__file__))
from signing import notarize
fro... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/pyccel/scripts/import_syntax/collisions4.py | dina-fouad/pyccel | 206 | 1794022 | # pylint: disable=missing-function-docstring, missing-module-docstring/
import user_mod
import user_mod2
if __name__ == '__main__':
test = user_mod.user_func(1.,2.,3.) + user_mod2.user_func(4.,5.)
print(test)
| 0 | 0 | 0 | 0 | 0 | 0 |
data_creation_scripts/create_phonemes.py | uw-thalesians/expresso | 222 | 1794075 | <reponame>uw-thalesians/expresso
import os
import nltk
import time
import cPickle as pickle
print 'starting...'
start = time.time()
dict_cmu = nltk.corpus.cmudict.dict()
print 'loaded CMU data.'
print time.time()-start
print 'converting CMU data to optimize and use without nltk...'
cmu = {word: dict_cmu[word][0] for ... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/optimizers/evolutionary/create_nghs.py | anukaal/opytimizer | 528 | 1794077 | <gh_stars>100-1000
from opytimizer.optimizers.evolutionary import NGHS
# One should declare a hyperparameters object based
# on the desired algorithm that will be used
params = {
'pm': 0.1
}
# Creates a NGHS optimizer
o = NGHS(params=params)
| 0 | 0 | 0 | 0 | 0 | 0 |
src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_user_unhandled2.py | r3m0t/debugpy | 695 | 1794093 | <filename>src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_user_unhandled2.py<gh_stars>100-1000
if __name__ == '__main__':
try:
raise RuntimeError()
except:
print('TEST SUCEEDED!')
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/base.py | FrostByte266/neupy | 801 | 1794102 | from __future__ import annotations
import pickle
import inspect
import logging
import unittest
import numpy as np
import tensorflow as tf
from neupy import utils, layers, init
from neupy.utils import tensorflow_eval, tensorflow_session, shape_to_tuple
from neupy.layers.base import format_name_if_specified_as_pattern
... | 7 | 1 | 3 | 0 | 11 | 0 |
valentyusb/usbcore/cpu/unififo_test.py | rjeschmi/valentyusb | 105 | 1794124 | <filename>valentyusb/usbcore/cpu/unififo_test.py<gh_stars>100-1000
#!/usr/bin/env python3
import unittest
from migen import *
from ..endpoint import *
from ..io import FakeIoBuf
from ..test.common import BaseUsbTestCase, CommonUsbTestCase
from ..utils.packet import *
from .unififo import UsbUniFifo
from ..test.cloc... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/distributions/system_repo.bzl | jobechoi/bazel | 16,989 | 1794129 | # Copyright 2020 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 0 | 0 | 0 | 0 | 0 | 0 |
ichnaea/scripts/datamap.py | szjozsef/ichnaea | 348 | 1794130 | <filename>ichnaea/scripts/datamap.py
#!/usr/bin/env python3
"""
Generate datamap image tiles and upload them to Amazon S3.
The process is:
1. Export data from datamap tables to CSV.
The data is exported as pairs of latitude and longitude,
converted into 0 to 6 pairs randomly around that point.
2. Convert the da... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/run-symbolic-executor.py | bergen/NSCL-PyTorch-Release | 343 | 1794137 | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# File : run-symbolic-executor.py
# Author : <NAME>
# Email : <EMAIL>
# Date : 10/02/2018
#
# This file is part of NSCL-PyTorch.
# Distributed under terms of the MIT license.
"""
A script tests the symbolic executor based on the ground-truth scene annotation and pro... | 0 | 0 | 0 | 0 | 0 | 0 |
common/numpy_helpers.py | wolterhv/openpilot | 37,508 | 1794141 | from __future__ import annotations
import numpy as np
def deep_interp_np(x, xp, fp, axis: object | None=None) -> object:
if axis is not None:
fp = fp.swapaxes(0,axis)
x = np.atleast_1d(x)
xp = np.array(xp)
if len(xp) < 2:
return np.repeat(fp, len(x), axis=0)
if min(np.diff(xp)) < 0:
raise Runtim... | 1 | 1 | 0 | 0 | 2 | 0 |
verkle/fk20.py | kevaundray/research | 1,351 | 1794166 | # Implement technique from https://github.com/khovratovich/Kate/blob/master/Kate_amortized.pdf
from py_ecc import optimized_bls12_381 as b
from fft import fft
from poly_utils import PrimeField
from multicombs import lincomb
from verkle import WIDTH, DEPTH, MODULUS, root_of_unity_candidates, ROOT_OF_UNITY
import time
... | 0 | 3 | 0 | 0 | 3 | 0 |
artman/tasks/emit_success.py | Katee/artman | 147 | 1794228 | # Copyright 2017 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 agree... | 1 | 0 | 0 | 0 | 1 | 0 |
pwncat/commands/lpwd.py | Mitul16/pwncat | 1,454 | 1794231 | <reponame>Mitul16/pwncat
#!/usr/bin/env python3
from pathlib import Path
import pwncat
from pwncat.util import console
from pwncat.commands import CommandDefinition
class Command(CommandDefinition):
"""Print the local current working directory"""
PROG = "lpwd"
ARGS = {}
def run(self, manager: "pwnc... | 0 | 0 | 0 | 0 | 0 | 0 |
benchmarks/100_million_downloads/client-task-pool.py | quarckster/pypeln | 1,281 | 1794238 | # client-task-pool.py
from aiohttp import ClientSession, TCPConnector
import asyncio
import sys
from pypeln.task import TaskPool
limit = 1000
async def fetch(url, session) -> object:
async with session.get(url) as response:
return await response.read()
async def _main(url, total_requests):
connect... | 0 | 1 | 0 | 0 | 1 | 0 |
test/test_attr.py | complexdb/zincbase | 174 | 1794241 | import context
from zincbase import KB
kb = KB()
kb.seed(555)
kb.store('person(tom)')
kb.store('person(shamala)')
kb.store('knows(tom, shamala)')
assert kb.neighbors('tom') == [('shamala', [{'pred': 'knows'}])]
kb.node('tom')['grains'] = 0
tom = kb.node('tom')
assert tom.grains == 0
assert tom.i_dont_exist is None... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/st/func/lineagemgr/conftest.py | fapbatista/mindinsight | 216 | 1794266 | # Copyright 2019 Huawei Technologies Co., Ltd
#
# 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... | 0 | 1 | 0 | 0 | 1 | 0 |
src/amuse/test/suite/ext_tests/test_composition_methods.py | rknop/amuse | 131 | 1794312 | <reponame>rknop/amuse
from amuse.test import amusetest
import numpy
class harmonic_oscillator(object):
def __init__(self,x,v,method=None):
self.x=x
self.v=v
self.model_time=0
self.method=method
def kick(self,dt):
self.v+=-self.x*dt
def drift(self,dt):
self.x+=self.v*dt
def total_energy... | 0 | 0 | 0 | 0 | 0 | 0 |
compiler_gym/spaces/__init__.py | sahirgomez1/CompilerGym | 562 | 1794342 | # 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.
from compiler_gym.spaces.box import Box
from compiler_gym.spaces.commandline import Commandline, CommandlineFlag
from compiler_gym.spaces.dict ... | 0 | 0 | 0 | 0 | 0 | 0 |
fabtools/tests/test_vagrant_base_boxes.py | timgates42/fabtools | 308 | 1794347 | <gh_stars>100-1000
import textwrap
import unittest
from mock import patch
class TestParseVagrantMachineReadableBoxList(unittest.TestCase):
def test_machine_readable_box_list(self):
with patch('fabtools.vagrant.local') as mock_local:
mock_local.return_value = textwrap.dedent(r"""
... | 0 | 0 | 0 | 0 | 0 | 0 |
Lib/test/test_compiler/testcorpus/03_tuple.py | diogommartins/cinder | 1,886 | 1794350 | (a,)
(b, c)
| 0 | 0 | 0 | 0 | 0 | 0 |
test/python/quantum_info/operators/symplectic/test_pauli_utils.py | Roshan-Thomas/qiskit-terra | 1,599 | 1794358 | <reponame>Roshan-Thomas/qiskit-terra<filename>test/python/quantum_info/operators/symplectic/test_pauli_utils.py
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2020.
#
# 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 di... | 0 | 0 | 0 | 0 | 0 | 0 |
angr/analyses/cfg_slice_to_sink/transitions.py | Kyle-Kyle/angr | 6,132 | 1794392 | <filename>angr/analyses/cfg_slice_to_sink/transitions.py
"""
Some utilitary functions to manage our representation of transitions:
A dictionary, indexed by int (source addresses), which values are list of ints (target addresses).
"""
def merge_transitions(transitions, existing_transitions):
"""
Merge two d... | 0 | 0 | 0 | 0 | 0 | 0 |
dump/typingissues/no-overload-matches.py | conductiveIT/pymunk-1 | 670 | 1794397 | import collections.abc
from typing import Any, Optional, Sequence, Tuple, Union, overload
class Vec(Sequence[float]):
@overload
def __init__(self, x_or_pair: Sequence[float], y: None) -> None:
...
@overload
def __init__(self, x_or_pair: float, y: float) -> None:
...
def __init__(... | 9 | 7 | 0 | 0 | 16 | 0 |
scripts/git-role-management/internal/model/permission_model.py | msleprosy/cloud-pipeline | 126 | 1794407 | <gh_stars>100-1000
# 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
#
# Unles... | 0 | 0 | 0 | 0 | 0 | 0 |
utils/utils_bbox.py | dvornikita/context_aug | 118 | 1794416 | <gh_stars>100-1000
import os
import logging
import numpy as np
from math import ceil, floor
from PIL import Image, ImageDraw, ImageFont
from configs.paths import EVAL_DIR
log = logging.getLogger()
colors = np.load(os.path.join(EVAL_DIR, 'Extra/colors.npy')).tolist()
palette = np.load(os.path.join(EVAL_DIR, 'Extra/pa... | 0 | 0 | 0 | 0 | 0 | 0 |
gimp-plugins/syncWeights.py | sunlin7/GIMP-ML | 1,077 | 1794434 | <filename>gimp-plugins/syncWeights.py
import requests
import os
from gimpfu import *
def download_file_from_google_drive(id, destination,fileSize):
URL = "https://docs.google.com/uc?export=download"
session = requests.Session()
response = session.get(URL, params = { 'id' : id }, stream = True)
token = get_confirm_... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_additional_properties.py | shirbi-cye/marshmallow-jsonschema | 195 | 1794439 | import pytest
from marshmallow import Schema, fields, RAISE, INCLUDE, EXCLUDE
from marshmallow_jsonschema import UnsupportedValueError, JSONSchema
from . import validate_and_dump
def test_additional_properties_default():
class TestSchema(Schema):
foo = fields.Integer()
schema = TestSchema()
dum... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/20.motion_vectors.py | blaine141/NVISII | 149 | 1794452 | <reponame>blaine141/NVISII
import nvisii
import os
import numpy as np
from math import acos
from math import sqrt
from math import pi
import colorsys
import cv2
opt = lambda: None
opt.spp = 100
opt.width = 1280
opt.height = 720
opt.noise = False
opt.path_obj = 'content/dragon/dragon.obj'
opt.outf = '20_motion_ve... | 0 | 0 | 0 | 0 | 0 | 0 |
Data Structure/Array Or Vector/Equilibrium Point in an Array/SolutionByVaishnavi.py | rajethanm4/Programmers-Community | 261 | 1794475 | #equilibrium index
def equilibriumIndex(arr) -> object:
n = len(arr)
rightSum= 0
leftSum = 0
#sum of all elements
for i in range(n):
rightSum += arr[i]
for i in range(n):
rightSum -= arr[i]
if leftSum == rightSum:
return i
leftSu... | 0 | 1 | 0 | 0 | 1 | 0 |
examples/barnacle_dv360_example.py | Ressmann/starthinker | 138 | 1794479 | ###########################################################################
#
# Copyright 2021 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/l... | 0 | 0 | 0 | 0 | 0 | 0 |
froide/georegion/migrations/0010_georegion_data.py | xenein/froide | 198 | 1794526 | # Generated by Django 3.2.4 on 2021-08-12 07:20
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies: list[tuple[str, str]] = [
("georegion", "0009_auto_20190325_2040"),
]
operations: list[object] = [
migrations.AddField(
model_name="g... | 0 | 0 | 2 | 0 | 2 | 0 |
lang/talon_editor.py | zachbarrow/talon_community | 125 | 1794575 | from __future__ import annotations
import string
from talon.voice import Context, Key, Str, press
from talon import clip
from ..apps import atom
from ..misc import basic_keys
from ..misc import switcher
from ..utils import parse_words, text, is_filetype, paste_text, insert
FILETYPES = (".py",)
ctx = Context("talon_... | 1 | 4 | 0 | 0 | 5 | 0 |
tests/nutter/test_testresult.py | cganta/dbtest | 130 | 1794611 | """
Copyright (c) Microsoft Corporation.
Licensed under the MIT license.
"""
import pytest
import json
from common.testresult import TestResults, TestResult
import pickle
import base64
def test__testresults_append__type_not_testresult__throws_error():
# Arrange
test_results = TestResults()
... | 0 | 0 | 0 | 0 | 0 | 0 |
gnocchi/indexer/sqlalchemy_types.py | Dmitry-Eremeev/gnocchi | 299 | 1794707 | # -*- encoding: utf-8 -*-
#
# Copyright © 2016 Red Hat, Inc.
# Copyright © 2014-2015 eNovance
#
# 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 | 9 | 0 | 0 | 9 | 0 |
macarico/tasks/seq2seq.py | bgalbraith/macarico | 121 | 1794749 | from __future__ import division, generators, print_function
import sys
import random
import macarico
from collections import deque
from macarico.data.vocabulary import EOS
class Seq2Seq(macarico.Env):
LENGTH_FACTOR: int = 4
def __init__(self, example):
macarico.Env.__init__(self, example.n_labels, ex... | 3 | 10 | 1 | 7 | 21 | 0 |
datasets/__init__.py | AlexanderParkin/ChaLearn_liveness_challenge | 379 | 1794758 | <reponame>AlexanderParkin/ChaLearn_liveness_challenge
from .init_dataloader import generate_loader | 0 | 0 | 0 | 0 | 0 | 0 |
feeds/tests/__init__.py | RamezIssac/djangopackages | 383 | 1794797 | from feeds.tests.test_latest import *
| 0 | 0 | 0 | 0 | 0 | 0 |
test_plotting.py | commoncdp2021/Gun-Gaja-Gun | 171 | 1794830 | <reponame>commoncdp2021/Gun-Gaja-Gun
from Plotting import list_comp
def test_list_comp():
data = list_comp.main()
print(data)
assert(data.strip("\n") == 'With Numpy: a = [ 5 10 15 20 25] b = [1. 2. 3. 4. 5.] ')
| 0 | 0 | 0 | 0 | 0 | 0 |
Chapter 09/9.06_weather_ reporter.py | ACsBlack/Tkinter-GUI-Application-Development-Blueprints-Second-Edition | 120 | 1794839 | """
Code illustration: 9.06
Weather reporter
Tkinter GUI Application Development Blueprints
"""
import sys
import json
import datetime
from tkinter import Tk, Canvas, Entry, Button, Frame, Label, StringVar, ALL
from tkinter import ttk
from tkinter import messagebox
import urllib.request
import urllib.parse
class ... | 0 | 9 | 2 | 0 | 11 | 0 |
data/transcoder_evaluation_gfg/python/SUM_MATRIX_ELEMENT_ELEMENT_INTEGER_DIVISION_ROW_COLUMN.py | mxl1n/CodeGen | 241 | 1794840 | # 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 ( N ) -> object :
ans = 0
for i in range ( 1 , N + 1 ) :
for j in range ( 1 , N + 1 ) :
a... | 0 | 1 | 0 | 0 | 1 | 0 |
data_process/read_txt.py | gakkifan2020/YoloV3_From_calmisential_workspace | 115 | 1794850 | from configuration import MAX_TRUE_BOX_NUM_PER_IMG
class ReadTxt(object):
def __init__(self, line_bytes):
super(ReadTxt, self).__init__()
# bytes -> string
self.line_str = bytes.decode(line_bytes, encoding="utf-8")
def parse_line(self) -> tuple[object, object]:
line_info = sel... | 0 | 1 | 0 | 0 | 1 | 0 |
bcs-ui/backend/helm/helm/models/repo.py | laodiu/bk-bcs | 599 | 1794853 | <filename>bcs-ui/backend/helm/helm/models/repo.py
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the ... | 0 | 0 | 0 | 0 | 0 | 0 |
tikz/pi/create.py | RalfGuder/LaTeX-examples | 1,231 | 1794874 | <gh_stars>1000+
#!/usr/bin/env python
"""Create a data.csv file."""
import csv
try:
# import version included with old SymPy
from sympy.mpmath import mp
except ImportError:
# import newer version
from mpmath import mp
mp.dps = 1000 # set number of digits
pi = mp.pi
print(pi)
# Split pi in groups o... | 0 | 0 | 0 | 0 | 0 | 0 |
alipay/aop/api/domain/AccessProduceQrcode.py | snowxmas/alipay-sdk-python-all | 213 | 1794898 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import annotations
import json
from alipay.aop.api.constant.ParamConstants import *
class AccessProduceQrcode(object):
def __init__(self):
self._batch_id: None = None
self._core_url: None = None
self._produce_order_id: None = ... | 0 | 6 | 0 | 4 | 10 | 0 |
tests/test_loss.py | confusedcrib/riskquant | 567 | 1794927 | <reponame>confusedcrib/riskquant
import unittest
from riskquant import loss
class FixedValueModel(object):
def __init__(self, value):
self.value = value
def draw(self, n=1):
return [self.value] * n
class TestLoss(unittest.TestCase):
def test_simulate_losses_one_year(self):
loss... | 0 | 0 | 0 | 0 | 0 | 0 |
formats/ycd/AnimSequence.py | Adobe12327/Sollumz | 131 | 1794929 | from mathutils import Vector, Quaternion
from collections import Counter
from ...tools import xml as Xml
from .utils import find_bone_by_tag
from .Channel import ChannelConst, ChannelStaticFloat, ChannelQuantizeFloat, ChannelIndirectQuantizeFloat, ChannelCachedQuaternion1, ChannelStaticVector, ChannelStaticQuaternion
... | 0 | 12 | 6 | 0 | 18 | 0 |
python-exercises/elo.py | cclauss/Python-for-beginners | 158 | 1794938 | <filename>python-exercises/elo.py
def elo(player_rating, opponent_rating, won, k=32):
q1 = 10**(player_rating / 400)
q2 = 10**(opponent_rating / 400)
expected_score = q1 / (q1 + q2)
true_score = int(won)
final_score = player_rating + k * (true_score - expected_score)
return int(final_score)
... | 0 | 0 | 0 | 0 | 0 | 0 |
Z - Tool Box/BeRoot/Linux/parse_yaml.py | dfirpaul/Active-Directory-Exploitation-Cheat-Sheet-1 | 1,290 | 1794948 | <gh_stars>1000+
#!/usr/bin/env python
import os
import json
import yaml # install pyyaml if needed
"""
Get a dictionary from yaml files
- cd /tmp/
- git clone https://github.com/GTFOBins/GTFOBins.github.io/
- ./parse_yaml.py
This script should help me to update easily my binary list here:
- https://github.com/Aless... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/e2e-home-appliance-status-monitoring/server/main.py | ruchirjain86/professional-services | 2,116 | 1794970 | # Copyright 2019 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 | 1 | 0 | 0 | 1 | 0 |
sdk/python/pulumi_azure/media/transform.py | henriktao/pulumi-azure | 109 | 1795003 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
from __future__ import annotations
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Seque... | 48 | 16 | 0 | 0 | 64 | 0 |
openpoiservice/server/db_import/objects.py | larsrinn/openpoiservice | 131 | 1795023 | # openpoiservice/server/poi_entity.py
class PoiObject(object):
def __init__(self, osm_type, osmid, lat_lng, categories):
self.osmtype = int(osm_type)
self.osmid = int(osmid)
self.categories = categories
self.geom: str = f"SRID=4326;POINT({float(lat_lng[0])} {float(lat_lng[1])})"
... | 0 | 0 | 0 | 2 | 2 | 0 |
hydrachain/consensus/synchronizer.py | bts/hydrachain | 406 | 1795034 | <filename>hydrachain/consensus/synchronizer.py
import gevent
from .base import Proposal
from .protocol import HDCProtocol
class Synchronizer(object):
timeout = 5
max_getproposals_count = HDCProtocol.max_getproposals_count
max_queued = 3 * max_getproposals_count
def __init__(self, consensusmanager):
... | 0 | 0 | 0 | 0 | 0 | 0 |
plenum/test/input_validation/message_validation/test_consistencyproof_message.py | andkononykhin/plenum | 148 | 1795044 | import pytest
from plenum.common.messages.node_messages import ConsistencyProof
from collections import OrderedDict
from plenum.common.messages.fields import NonNegativeNumberField, \
LedgerIdField, MerkleRootField, IterableField
EXPECTED_ORDERED_FIELDS = OrderedDict([
("ledgerId", LedgerIdField),
("seqNoS... | 0 | 0 | 0 | 0 | 0 | 0 |
slimta/http/wsgi.py | nanojob/python-slimta | 141 | 1795100 | <reponame>nanojob/python-slimta<filename>slimta/http/wsgi.py
# Copyright (c) 2013 <NAME>
#
# 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 th... | 0 | 0 | 0 | 0 | 0 | 0 |
modules.py | lcylcy/FastSpeech | 745 | 1795116 | <filename>modules.py
import torch
import torch.nn as nn
import torch.nn.functional as F
from collections import OrderedDict
from numba import jit
import numpy as np
import copy
import math
import hparams as hp
import utils
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
def get_sinusoid_encod... | 0 | 0 | 0 | 0 | 0 | 0 |
mppsolar/protocols/__init__.py | palmtech/mpp-solar | 132 | 1795138 | from __future__ import annotations
import importlib
import logging
log = logging.getLogger("protocols")
def get_protocol(protocol) -> object | None:
"""
Get the protocol based on the protocol name
"""
log.debug(f"Protocol {protocol}")
if protocol is None:
return None
protocol_id = pr... | 0 | 1 | 0 | 0 | 1 | 0 |
tools/codegen/update_hdr_ftr_adoc.py | tate2301/covid19-app-system-public | 169 | 1795154 | <reponame>tate2301/covid19-app-system-public
#!/usr/bin/env python3
import os
import re
import argparse
import glob
def slurp_file(path):
data = ''
try:
with open(path, 'r') as fin:
data = fin.read()
except IOError:
pass
if not (data and not data.isspace()):
assent ... | 0 | 0 | 0 | 0 | 0 | 0 |
Python/tdw/FBOutput/AvatarSimpleBody.py | felixbinder/tdw | 307 | 1795181 | # automatically generated by the FlatBuffers compiler, do not modify
# namespace: FBOutput
from __future__ import annotations
import tdw.flatbuffers
class AvatarSimpleBody(object):
__slots__: list[str] = ['_tab']
@classmethod
def GetRootAsAvatarSimpleBody(cls, buf, offset) -> object:
... | 0 | 11 | 1 | 0 | 12 | 0 |
rl_coach/architectures/mxnet_components/embedders/__init__.py | jl45621/coach | 1,960 | 1795217 | <reponame>jl45621/coach<gh_stars>1000+
from .image_embedder import ImageEmbedder
from .tensor_embedder import TensorEmbedder
from .vector_embedder import VectorEmbedder
__all__ = ['ImageEmbedder',
'TensorEmbedder',
'VectorEmbedder']
| 0 | 0 | 0 | 0 | 0 | 0 |
lib/python/treadmill/tests/cli/admin/ldap/allocation_test.py | krcooke/treadmill | 133 | 1795224 | <reponame>krcooke/treadmill
"""Unit test for treadmill.cli.admin.ldap.allocation."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import unittest
import click
import click.testing
import mock
import treadmill
from... | 0 | 0 | 0 | 0 | 0 | 0 |
utils/python_lint.py | paulmenage/apple-swift | 427 | 1795240 | <filename>utils/python_lint.py
#!/usr/bin/env python
# python_lint.py - Runs flake8 linting over the repository ------*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime L... | 0 | 0 | 0 | 0 | 0 | 0 |
bindings/mcclient/mcclient.py | quarkslab/samsung-trustzone-research | 101 | 1795241 | <reponame>quarkslab/samsung-trustzone-research<filename>bindings/mcclient/mcclient.py
import ctypes
import io
import os
import struct
import sys
from contextlib import contextmanager
from . import mcclient_const as const
from . import mcclient_types as types
if 'sphinx' in sys.modules:
client = None
else:
c... | 0 | 0 | 0 | 0 | 0 | 0 |
lib/bats.py | alexanu/trading-with-python | 318 | 1795287 | <reponame>alexanu/trading-with-python<gh_stars>100-1000
#-------------------------------------------------------------------------------
# Name: BATS
# Purpose: get data from BATS exchange
#
# Author: jev
#
# Created: 17/08/2013
# Copyright: (c) <NAME> 2013
# Licence: BSD
#-----------... | 0 | 0 | 0 | 0 | 0 | 0 |
esphome/components/mcp23s17/__init__.py | OttoWinter/esphomeyaml | 249 | 1795296 | import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import spi, mcp23x17_base, mcp23xxx_base
from esphome.const import CONF_ID
AUTO_LOAD = ["mcp23x17_base"]
CODEOWNERS = ["@SenexCrenshaw", "@jesserockz"]
DEPENDENCIES = ["spi"]
MULTI_CONF = True
CONF_DEVICEADDRESS = "deviceaddre... | 0 | 0 | 0 | 0 | 0 | 0 |
pypeit/tests/test_procimg.py | brackham/PypeIt | 107 | 1795316 | """
Module to run tests on core.procimg functions.
"""
from IPython import embed
import numpy as np
from pypeit.core import procimg
def test_replace_columns():
y = np.zeros((10,3), dtype=float)
y[:,2] = 2
bad_col = np.array([False, True, False])
assert np.array_equal(procimg.replace_columns(y, bad_col... | 0 | 0 | 0 | 0 | 0 | 0 |
fabric_bolt/hosts/views.py | jooni22/fabric-bolt | 219 | 1795342 | from django.views.generic import CreateView, UpdateView, DeleteView, DetailView, TemplateView, FormView
from django.core.urlresolvers import reverse_lazy, reverse
from django.contrib import messages
from django_tables2.views import SingleTableView
from fabric_bolt.core.mixins.views import MultipleGroupRequiredMixin, ... | 0 | 9 | 9 | 0 | 18 | 0 |
src/toil/test/lib/test_misc.py | PolusAI/toil | 516 | 1795466 | <reponame>PolusAI/toil
# Copyright (C) 2015-2022 Regents of the University of California
#
# 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/plugin/region/scan/test_scan.py | rkoval/naomi | 600 | 1795482 | # 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, software
# distributed under th... | 0 | 2 | 0 | 0 | 2 | 0 |
PaddleNLP/Research/Dialogue-PLATO/plato/data/dataset.py | XiaoguangHu01/models | 1,319 | 1795498 | <filename>PaddleNLP/Research/Dialogue-PLATO/plato/data/dataset.py
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# htt... | 0 | 0 | 0 | 0 | 0 | 0 |
data/transcoder_evaluation_gfg/python/INTEGER_POSITIVE_VALUE_POSITIVE_NEGATIVE_VALUE_ARRAY.py | mxl1n/CodeGen | 241 | 1795515 | <filename>data/transcoder_evaluation_gfg/python/INTEGER_POSITIVE_VALUE_POSITIVE_NEGATIVE_VALUE_ARRAY.py
# 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):
... | 0 | 0 | 0 | 0 | 0 | 0 |
src/ScrapydAPI/models.py | Superbsco/weibo-analysis-system | 199 | 1795542 | from django.db import models
# Create your models here.
from django.db import models
# Create your models here.
# -*- utf-8 -*-
from datetime import datetime
from django.db import models
# Create your models here.
class Target(models.Model):
uid = models.CharField(max_length=20, verbose_name=u"爬取用户")
cookie... | 0 | 5 | 5 | 0 | 10 | 0 |
ppg2mel/utils/cnn_postnet.py | KnightNic/MockingBird | 133 | 1795544 | import torch
import torch.nn as nn
import torch.nn.functional as F
from .basic_layers import Linear, Conv1d
class Postnet(nn.Module):
"""Postnet
- Five 1-d convolution with 512 channels and kernel size 5
"""
def __init__(self, num_mels: int=80,
num_layers: int=5,
... | 4 | 1 | 0 | 0 | 5 | 0 |
xbox/webapi/api/provider/profile/__init__.py | Landcross/xbox-webapi-python | 122 | 1795565 | <filename>xbox/webapi/api/provider/profile/__init__.py
"""
Profile
Get Userprofiles by XUID or Gamertag
"""
from typing import List
from xbox.webapi.api.provider.baseprovider import BaseProvider
from xbox.webapi.api.provider.profile.models import ProfileResponse, ProfileSettings
class ProfileProvider(BaseProvider):... | 0 | 0 | 0 | 0 | 0 | 0 |
core/Connection.py | SpudGunMan/spraykatz | 726 | 1795575 | # coding: utf-8
# Author: @aas_s3curity
# Imports
from __future__ import annotations
from __future__ import division
from __future__ import print_function
import logging
from core.Colors import debugBlue
from impacket.smbconnection import SMBConnection, SMB_DIALECT, SMB2_DIALECT_002, SMB2_DIALECT_21
class Conne... | 9 | 1 | 0 | 3 | 13 | 0 |
test/run/t129.py | timmartin/skulpt | 2,671 | 1795579 | a = range(30)
print a[19::-7]
| 0 | 0 | 0 | 0 | 0 | 0 |
res/TensorFlowPythonExamples/examples/sparse_to_dense/__init__.py | periannath/ONE | 255 | 1795588 | import tensorflow as tf
in_ = tf.compat.v1.sparse_placeholder(tf.float32, name="Hole")
op_ = tf.compat.v1.sparse_tensor_to_dense(in_)
| 0 | 0 | 0 | 0 | 0 | 0 |
pycoinnet/peergroup/TxHandler.py | Jsn2win/pycoinnet | 114 | 1795589 | <gh_stars>100-1000
"""
TxHandler
This class should be instantiated once per client.
It takes an InvCollector and a TxStore, and an optional Tx validator.
When a new Tx object is noted by the InvCollector, this object will
fetch it, validate it, then store it in the TxStore and tell the
InvCollector to advertise it t... | 0 | 0 | 0 | 0 | 0 | 0 |
third_party/tests/Rsd/Processor/Tools/QEMU_SimDriver/GDB_CommandFileGenerator.py | little-blue/Surelog | 670 | 1795615 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
# python3 GDB_CommandFileGenerator GDB_CommandFile SimCycle
#
# QEMUでのシミュレーションに必要なGDBのコマンドファイルを生成します
# わざわざコマンドファイルを生成しているのは
# GDBに, MakefileのMAX_TEST_CYCLESを渡す方法がわからなかったからです
import os
import sys
import subprocess
import struct
import re
from optparse import OptionParser
co... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/nydus/db/backends/redis/tests.py | Elec/nydus | 102 | 1795632 | from __future__ import absolute_import
from nydus.db import create_cluster
from nydus.db.base import BaseCluster
from nydus.db.backends.redis import Redis
from nydus.db.promise import EventualCommand
from nydus.testutils import BaseTest, fixture
import mock
import redis as redis_
class RedisPipelineTest(BaseTest):
... | 0 | 0 | 0 | 0 | 0 | 0 |
data/task_scripts/main/task01007.py | k101w/phyre_ODE | 432 | 1795637 | <reponame>k101w/phyre_ODE
# Copyright (c) Facebook, Inc. and its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 0 | 0 | 0 | 0 | 0 | 0 |
env/Lib/site-packages/OpenGL/raw/GL/VERSION/GL_4_6.py | 5gconnectedbike/Navio2 | 210 | 1795646 | '''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 |
mopo/parallel/parallel_env.py | Yizhao111/mopo | 107 | 1795652 | <reponame>Yizhao111/mopo
import gym
import mujoco_py as mjc
import pdb
from mopo.parallel.parallel_hopper import ParallelHopperEnv
if __name__ == '__main__':
N = 10
env = ParallelHopperEnv()
# env = gym.make('Hopper-v2')
# sim = env.unwrapped.sim
# pool = mjc.MjSimPool.create_from_sim(sim, N)
pdb.set_trace() | 0 | 0 | 0 | 0 | 0 | 0 |
story5/grammar.py | bfoz/pegen | 169 | 1795681 | <reponame>bfoz/pegen
"""Parser for the grammar file."""
from token import DEDENT, INDENT, NAME, NEWLINE, STRING, ENDMARKER
from story5.parser import Parser
class Rule:
def __init__(self, name, alts):
self.name = name
self.alts = alts
def __repr__(self):
return f"Rule({self.name!r}, ... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_utilities/test_service_access_point.py | amih90/bacpypes | 240 | 1795708 | <reponame>amih90/bacpypes
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Test Utilities Trapped Services
-------------------------------
"""
import unittest
from bacpypes.debugging import bacpypes_debugging, ModuleLogger
from bacpypes.comm import ServiceAccessPoint, ApplicationServiceElement, bind
from ..trapped... | 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.