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 |
|---|---|---|---|---|---|---|---|---|---|---|
iotbx/scalepack/merge.py | dperl-sol/cctbx_project | 155 | 1754870 | <gh_stars>100-1000
"Reading and writing of scalepack merge reflection files."
from __future__ import absolute_import, division, print_function
# Sample scalepack OUTPUT FILE
# 1
# -987
# 34.698 71.491 54.740 90.000 106.549 90.000 p21
# 0 0 4 3617.6 287.2
# 0 1 6 12951.7 1583.6 12039... | 0 | 0 | 0 | 0 | 0 | 0 |
src/genie/libs/parser/iosxe/tests/ShowBootflash/cli/equal/golden_output_1_expected.py | balmasea/genieparser | 204 | 1754888 | <gh_stars>100-1000
expected_output = {
"bytes_available": 13755338752,
"bytes_used": 489017344,
"files": {
1: {
"file_date": "Oct 12 2020 07:23:32 +00:00",
"file_length": 4096,
"file_name": "/bootflash/"
},
2: {
"file_date": "Apr 20 2017 ... | 0 | 0 | 0 | 0 | 0 | 0 |
evaluate.py | zhaoxiaodong95/lsm | 255 | 1754904 | from __future__ import annotations
import matplotlib.pyplot as plt
import numpy as np
from tabulate import tabulate
############################################
##### Utility functions for evaluation #####
############################################
def init_iou(im_batch, thresh) -> object:
iou = dict()
for... | 5 | 7 | 0 | 0 | 12 | 0 |
benchmarks/webpage_downloader.py | pycampers/zproc | 106 | 1754918 | """
Downloads a couple of web-pages and compares their sizes.
Prints out the time taken by different frameworks to complete the task
(excluding warm-up/setup time)
"""
import asyncio
from time import time
import zproc
SAMPLES = 1
sites = list(
{
"https://www.yahoo.com/",
"http://www.cnn.com",
... | 0 | 1 | 0 | 0 | 1 | 0 |
test/fixtures/python/corpus/if-statement.B.py | matsubara0507/semantic | 8,844 | 1754934 | if c:
a
b
| 0 | 0 | 0 | 0 | 0 | 0 |
ztag/annotations/computec.py | justinbastress/ztag | 107 | 1754937 | <filename>ztag/annotations/computec.py
from ztag.annotation import *
class ComputecOYMEIDevice(Annotation):
protocol = protocols.MODBUS
subprotocol = protocols.MODBUS.DEVICE_ID
port = None
tests = {
"computec": {
"global_metadata": {
"manufacturer": Manufacturer.C... | 0 | 0 | 0 | 0 | 0 | 0 |
testpy/waltzdb_data.py | kingofsystem/rules | 1,045 | 1754969 | create_and_assert({'t':'label' ,'j_t':'2j' ,'name':'L' ,'lid':'1' ,'n1':'B' ,'n2':'B'})
create_and_assert({'t':'label' ,'j_t':'2j' ,'name':'L' ,'lid':'2' ,'n1':'+' ,'n2':'B'})
create_and_assert({'t':'label' ,'j_t':'2j' ,'name':'L' ,'lid':'3' ,'n1':'B' ,'n2':'+'})
create_and_assert({'t':'label' ,'j_t':'2j' ,'name':'L' ,... | 0 | 0 | 0 | 0 | 0 | 0 |
pydip/src/PyDIP_py.py | DIPlib/diplib | 140 | 1754979 | # PyDIP 3.0, Python bindings for DIPlib 3.0
#
# (c)2017-2019, Flagship Biosciences, Inc., written by <NAME>.
#
# 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/licen... | 0 | 0 | 0 | 0 | 0 | 1 |
src/Python/Visualization/Lorenz.py | cvandijck/VTKExamples | 309 | 1754995 | #!/usr/bin/env python
"""
Create an iso-surface of the Lorenz attractor.
Here we visualize a Lorenz strange attractor by integrating the Lorenz equations in a volume.
The number of visits in each voxel is recorded as a scalar function.
The surface is extracted via marching cubes using a visit value of 50.
The number ... | 0 | 0 | 0 | 0 | 0 | 0 |
sfepy/terms/terms_volume.py | clazaro/sfepy | 510 | 1755006 | from __future__ import annotations
from sfepy.terms.terms import Term, terms
class LinearVolumeForceTerm(Term):
r"""
Vector or scalar linear volume forces (weak form) --- a right-hand side
source term.
:Definition:
.. math::
\int_{\Omega} \ul{f} \cdot \ul{v} \mbox{ or } \int_{\Omega} f q
... | 3 | 1 | 3 | 0 | 7 | 0 |
scripts/vae_helpers_pytorch.py | vipavlovic/pyprobml | 4,895 | 1755010 | # Library of pytorch functions related to convolutional variational autoencoders
from __future__ import annotations
import superimport
import os
import time
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import PIL
import imageio
import torch
from torch import nn
from torch.nn import fun... | 9 | 13 | 0 | 1 | 23 | 0 |
Packs/EmailRepIO/Integrations/EmailRepIO/EmailRepIO.py | diCagri/content | 799 | 1755013 | """EmailRepIO Integration for Cortex XSOAR"""
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
import urllib3
import traceback
from typing import Any, Dict, List, Optional
# Disable insecure warnings
urllib3.disable_warnings()
''' CONSTANTS '''
ACCEPTED_TAGS = ['... | 13 | 7 | 1 | 0 | 21 | 0 |
src/clarinet/loss.py | roberthoenig/VQ-VAE-Speech | 241 | 1755025 | #####################################################################################
# MIT License #
# #
# Copyright (C) 2018 <NAME> ... | 2 | 3 | 0 | 0 | 5 | 0 |
core/admin/migrations/versions/9400a032eb1a_.py | mboogert/Mailu | 3,620 | 1755028 | <gh_stars>1000+
""" Add authentication tokens
Revision ID: 9400a032eb1a
Revises: <PASSWORD>
Create Date: 2017-10-29 14:31:58.032989
"""
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<PASSWORD>'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table('token'... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/unit/pypyr/steps/jsonparse_test.py | mofm/pypyr | 261 | 1755034 | <filename>tests/unit/pypyr/steps/jsonparse_test.py
"""jsonparse.py unit tests."""
from pypyr.context import Context
from pypyr.dsl import SicString
from pypyr.errors import KeyInContextHasNoValueError, KeyNotInContextError
import pypyr.steps.jsonparse as jsonparse
import pytest
def test_jsonparse_no_jsonparse_raises(... | 0 | 0 | 0 | 0 | 0 | 0 |
archive/conv2d_theano.py | FDKevin0/Micro-Expression-with-Deep-Learning | 249 | 1755036 | from __future__ import annotations
def conv2d(x, kernel, strides: tuple[int, int]=(1, 1), padding: str='valid',
data_format: object | None=None, dilation_rate: tuple[int, int]=(1, 1)):
"""2D convolution.
# Arguments
kernel: kernel tensor.
strides: strides tuple.
padding: strin... | 4 | 0 | 0 | 0 | 4 | 0 |
angr/analyses/cfg/indirect_jump_resolvers/resolver.py | Kyle-Kyle/angr | 6,132 | 1755045 | <filename>angr/analyses/cfg/indirect_jump_resolvers/resolver.py<gh_stars>1000+
from ....errors import SimMemoryError
class IndirectJumpResolver:
def __init__(self, project, timeless=False, base_state=None):
self.project = project
self.timeless = timeless
self.base_state = base_state
... | 0 | 0 | 0 | 0 | 0 | 0 |
Demo/parser/simple.py | arvindm95/unladen-swallow | 2,293 | 1755063 | <reponame>arvindm95/unladen-swallow<filename>Demo/parser/simple.py
def f(): "maybe a docstring"
| 0 | 0 | 0 | 0 | 0 | 0 |
btcopyannounce.py | crossbrowsertesting/BitTornado | 116 | 1755069 | <reponame>crossbrowsertesting/BitTornado
#!/usr/bin/env python3
'Copy announce URLs from one torrent to others'
# btreannounce.py written by <NAME>' James and <NAME>
# multitracker extensions by <NAME>
# see LICENSE.txt for license information
import sys
import os
import getopt
from BitTornado.Meta.Info import MetaIn... | 0 | 0 | 0 | 0 | 0 | 0 |
common/src/stack/command/stack/commands/swap/host/interface/__init__.py | knutsonchris/stacki | 123 | 1755082 | <reponame>knutsonchris/stacki
# @copyright@
# Copyright (c) 2006 - 2019 Teradata
# All rights reserved. Stacki(r) v5.x stacki.com
# https://github.com/Teradata/stacki/blob/master/LICENSE.txt
# @copyright@
#
# @rocks@
# Copyright (c) 2000 - 2010 The Regents of the University of California
# All rights reserved. Rocks(r)... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_analysis.py | TheGableMethod/diffy | 577 | 1755091 | <filename>tests/test_analysis.py
import pytest
from diffy_api.analysis.views import * # noqa
@pytest.mark.parametrize("token,status", [("", 200)])
def test_analysis_list_get(client, token, status):
assert client.get(api.url_for(AnalysisList), headers=token).status_code == status
@pytest.mark.parametrize("token... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_nba_py_game.py | evanmjohnson/nba-awards-predictor | 1,189 | 1755092 | <gh_stars>1000+
from nba_py import game
def test():
gid = '0041400122'
assert game.BoxscoreSummary(gid)
assert game.Boxscore(gid)
assert game.BoxscoreScoring(gid)
assert game.BoxscoreUsage(gid)
assert game.BoxscoreMisc(gid)
assert game.BoxscoreAdvanced(gid)
assert game.BoxscoreFourFacto... | 0 | 0 | 0 | 0 | 0 | 0 |
apps/interface/business/interfaceproject.py | rainydaygit/testtcloudserver | 349 | 1755106 | from __future__ import annotations
import json
from flask import current_app, jsonify
from sqlalchemy import asc, desc
from apps.auth.models.users import UserBindProject
from apps.interface.models.interfacecase import InterfaceCase
from apps.interface.models.interfacecaseset import InterfaceCaseSet
from apps.interfac... | 0 | 13 | 0 | 0 | 13 | 0 |
test/test_reconscan.py | ekristen/appcompatprocessor | 152 | 1755115 | <reponame>ekristen/appcompatprocessor
from __future__ import absolute_import
import logging
from unittest import TestCase
import settings
import sys, traceback
reload(sys)
sys.setdefaultencoding("utf-8")
import os
from AppCompatProcessor import main
import tempfile
# Setup the logger
logger = logging.getLogger()
DB = ... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/integration/test_executable_dictionary/test.py | chalice19/ClickHouse | 8,629 | 1755132 | import os
import sys
import time
import pytest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
from helpers.cluster import ClickHouseCluster
cluster = ClickHouseCluster(__file__)
node = cluster.add_instance("node", stay_alive=T... | 0 | 0 | 0 | 0 | 0 | 0 |
databuilder/databuilder/extractor/vertica_metadata_extractor.py | defendercrypt/amundsen | 2,072 | 1755140 | # Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
import logging
from collections import namedtuple
from itertools import groupby
from typing import (
Any, Dict, Iterator, Union,
)
from pyhocon import ConfigFactory, ConfigTree
from databuilder import Scoped
from databuilder.... | 2 | 6 | 6 | 1 | 15 | 0 |
ambari-common/src/main/python/ambari_commons/repo_manager/zypper_parser.py | likenamehaojie/Apache-Ambari-ZH | 1,664 | 1755153 | """
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 use this ... | 1 | 1 | 0 | 0 | 2 | 0 |
airmozilla/main/tests/views/test_misc.py | mozilla/airmozilla | 115 | 1755159 | import cgi
import json
import urlparse
from nose.tools import eq_
import mock
from django.core.cache import cache
from django.core.urlresolvers import reverse
from airmozilla.base.tests.testbase import DjangoTestCase, Response
class TestCuratedGroups(DjangoTestCase):
def tearDown(self):
super(TestCura... | 0 | 2 | 0 | 0 | 2 | 0 |
cookietemple/create/domains/cli_creator.py | e2jk/cookietemple | 117 | 1755160 | <filename>cookietemple/create/domains/cli_creator.py
import os
from dataclasses import dataclass
from pathlib import Path
from typing import Any, Dict, Optional
from cookietemple.common.version import load_ct_template_version
from cookietemple.create.domains.cookietemple_template_struct import CookietempleTemplateStru... | 0 | 0 | 0 | 0 | 0 | 0 |
models/postprocessors.py | bonejay/mdetr | 601 | 1755211 | # Copyright (c) <NAME> & <NAME>. Licensed under the Apache License 2.0. All Rights Reserved
"""Postprocessors class to transform MDETR output according to the downstream task"""
from typing import Dict
import numpy as np
import torch
import torch.nn.functional as F
from torch import nn
from util import box_ops
clas... | 2 | 5 | 1 | 0 | 8 | 0 |
scrapydserver/build/lib/bot/settings.py | Superbsco/weibo-analysis-system | 199 | 1755220 | # -*- coding: utf-8 -*-
# Scrapy settings for bot project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# https://doc.scrapy.org/en/latest/topics/settings.html
# https://doc.scrapy.org/en/latest/topics/do... | 0 | 0 | 0 | 0 | 0 | 0 |
airmozilla/main/views/reports.py | mozilla/airmozilla | 115 | 1755234 | <reponame>mozilla/airmozilla<gh_stars>100-1000
import datetime
from django import http
from django.utils import timezone
from django.shortcuts import get_object_or_404, redirect, render
from django.db.models import Count
from django.contrib import messages
from django.db import transaction
from django.contrib.auth.dec... | 0 | 0 | 0 | 0 | 0 | 0 |
android/art/tools/findbuildbotwarnings.py | Solotov/deoptfuscator | 206 | 1755269 | <gh_stars>100-1000
#!/usr/bin/env python
#
# Copyright (C) 2017 The Android Open Source Project
#
# 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... | 0 | 0 | 0 | 0 | 0 | 0 |
evaluation.py | nolan-dev/stylegan_reimplementation | 135 | 1755270 | <reponame>nolan-dev/stylegan_reimplementation
import tensorflow as tf
import numpy as np
import math
import os
import csv
import json
from tensorflow.python.tools import freeze_graph
from PIL import Image
from utils import build_label_list_from_file
from train import build_models
from train import restore_models_and_o... | 0 | 0 | 0 | 0 | 0 | 0 |
caffe2/python/onnx/backend_cpp_rep.py | VisualJoyce/caffe2 | 585 | 1755272 | # Copyright (c) 2016-present, Facebook, 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 applicable law or agreed... | 0 | 1 | 0 | 0 | 1 | 0 |
mimic/test/test_identity_objects.py | mfens98/mimic | 141 | 1755291 | <filename>mimic/test/test_identity_objects.py
from __future__ import absolute_import, division, unicode_literals
import ddt
from twisted.trial.unittest import SynchronousTestCase
from mimic.model.identity_errors import (
EndpointTemplateAlreadyExists,
EndpointTemplateDisabledForTenant,
EndpointTemplateDo... | 0 | 0 | 0 | 0 | 0 | 0 |
pastepwn/analyzers/emailpasswordpairanalyzer.py | kiyanmair/pastepwn | 113 | 1755317 | # -*- coding: utf-8 -*-
from __future__ import annotations
from .regexanalyzer import RegexAnalyzer
_EMAIL_PASSWORD_REGEX = r'[\w\.\+_-]+@[\w\._-]+\.[a-zA-Z]*\:[\w\.\+\!\$\#\^&\*\(\)\{\}\[\]\_\-\@\%\=\§\\\/\'\`\´\?\<\>\;\"\:\|\,\~]+'
class EmailPasswordPairAnalyzer(RegexAnalyzer):
"""Analyzer to match username:p... | 1 | 1 | 1 | 0 | 3 | 0 |
maestro/plays/tasks.py | digitalsatori/maestro-ng | 168 | 1755352 | <reponame>digitalsatori/maestro-ng
# Copyright (C) 2013-2014 SignalFuse, Inc.
# Copyright (C) 2015-2018 SignalFx, Inc.
#
# Docker container orchestration utility.
from __future__ import print_function
import collections
try:
from docker.errors import APIError
except ImportError:
# Fall back to <= 0.3.1 locat... | 0 | 0 | 0 | 0 | 0 | 0 |
typed_python/compiler/tests/held_class_interpreter_semantics_test.py | APrioriInvestments/typed_python | 105 | 1755380 | import unittest
import math
import sys
import time
from flaky import flaky
from typed_python import Class, Final, ListOf, Held, Member, PointerTo, pointerTo
from typed_python.test_util import currentMemUsageMb
@Held
class H(Class, Final):
x = Member(int)
y = Member(float)
def f(self) -> object:
... | 0 | 22 | 0 | 1 | 23 | 0 |
packages/cli/test/base-python/src-pipenv/sub/handler.py | harshit9715/serverless-stack | 5,922 | 1755404 | from __future__ import annotations
import json
def hello(event, context) -> dict[str,int | str]:
return {
"statusCode": 200,
"body": "Hello, I'm sub!"
}
| 0 | 1 | 0 | 0 | 1 | 0 |
accelerator/examples/build_example-subjobs.py | eBay/accelerator | 143 | 1755406 | <reponame>eBay/accelerator
from accelerator import Job
from .printer import prt
description = "Jobs: Subjob"
def main(urd):
prt.source(__file__)
prt()
prt('This job will execute a subjob')
job = urd.build('example_buildsubjob')
prt()
prt('Print subjob info')
for sjob in job.post.subjobs:
prt.plain('subjob'... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/components/renault/conftest.py | andersop91/core | 22,481 | 1755407 | <gh_stars>1000+
"""Provide common Renault fixtures."""
import contextlib
from types import MappingProxyType
from typing import Any
from unittest.mock import patch
import pytest
from renault_api.kamereon import exceptions, schemas
from renault_api.renault_account import RenaultAccount
from homeassistant.components.ren... | 0 | 0 | 0 | 0 | 0 | 0 |
Beginner/Coldplay (SLOOP)/coldplay.py | anishsingh42/CodeChef | 127 | 1755413 | for _ in range(int(input())):
m,s = map(int,input().split())
print(m//s) | 0 | 0 | 0 | 0 | 0 | 0 |
var/spack/repos/builtin/packages/py-arviz/package.py | LiamBindle/spack | 2,360 | 1755528 | # 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 PyArviz(PythonPackage):
"""ArviZ (pronounced "AR-vees") is a Python package for explorator... | 0 | 0 | 2 | 0 | 2 | 0 |
chrome/test/functional/extensions.py | nagineni/chromium-crosswalk | 231 | 1755551 | <gh_stars>100-1000
#!/usr/bin/env python
# Copyright (c) 2011 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.
"""
This module is a simple qa tool that installs extensions and tests whether the
browser crashes while visitin... | 0 | 0 | 0 | 0 | 0 | 0 |
develop.py | cohmoti/clai | 391 | 1755570 | <filename>develop.py
#
# Copyright (C) 2020 IBM. All Rights Reserved.
#
# See LICENSE.txt file in the root directory
# of this source tree for licensing information.
#
# pylint: disable=broad-except,invalid-name
import os
import sys
import json
import argparse
from install import download_file
from install import reg... | 0 | 0 | 0 | 0 | 0 | 0 |
ldaptor/samba/smbpassword.py | scottcarr/ldaptor | 133 | 1755578 | from passlib.hash import nthash as passlib_nthash, lmhash as passlib_lmhash
from ldaptor import config
def nthash(password: bytes=b"") -> object:
"""Generates nt md4 password hash for a given password."""
return passlib_nthash.hash(password[:128]).encode("ascii").upper()
def lmhash_locked(password: bytes=b... | 3 | 3 | 0 | 0 | 6 | 0 |
funsor/elbo.py | fritzo/funsor | 198 | 1755584 | # Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
from functools import reduce
from multipledispatch.variadic import Variadic
from funsor.cnf import Contraction
from funsor.integrate import Integrate
from funsor.interpretations import StatefulInter... | 0 | 3 | 0 | 0 | 3 | 0 |
inferno/extensions/layers/convolutional.py | 0h-n0/inferno | 204 | 1755597 | <reponame>0h-n0/inferno
import torch.nn as nn
import sys
import functools
from ..initializers import (
OrthogonalWeightsZeroBias,
KaimingNormalWeightsZeroBias,
SELUWeightsZeroBias,
)
from ..initializers import Initializer
from .normalization import BatchNormND
from .activations import SELU
from ...utils.exc... | 0 | 0 | 0 | 0 | 0 | 0 |
facets_atlasmaker/atlasmaker.py | winnerineast/facets | 7,209 | 1755601 | <gh_stars>1000+
"""Main function for sprite atlas maker command line utility."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from absl import app
from absl import flags
from absl import logging
from PIL import ImageColor
import atlasmaker_io
i... | 0 | 0 | 0 | 0 | 0 | 0 |
nydus/db/__init__.py | Elec/nydus | 102 | 1755614 | <gh_stars>100-1000
"""
nydus.db
~~~~~~~~
Disqus generic connections wrappers.
>>> from nydus.db import create_cluster
>>> redis = create_cluster({
>>> 'backend': 'nydus.db.backends.redis.Redis',
>>> })
>>> res = conn.incr('foo')
>>> assert res == 1
:copyright: (c) 2011-2012 DISQUS.
:license: Apache License 2.0, ... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_decorators.py | dimagi/architect | 352 | 1755621 | <filename>tests/test_decorators.py
"""
Tests decorators only.
"""
from . import unittest, mock
from architect import install, uninstall
from architect.orms.bases import BaseFeature
class BaseDecoratorTestCase(object):
def setUp(self):
with mock.patch('pkgutil.iter_modules') as modules:
modul... | 0 | 0 | 0 | 0 | 0 | 0 |
timesketch/lib/analyzers/chain_test.py | rushattac/timesketch | 1,810 | 1755658 | <reponame>rushattac/timesketch<gh_stars>1000+
"""Tests for Chain analyzer."""
from __future__ import unicode_literals
import uuid
import mock
from timesketch.lib import emojis
from timesketch.lib import testlib
from timesketch.lib.analyzers import chain
from timesketch.lib.analyzers.chain_plugins import interface
f... | 0 | 0 | 0 | 0 | 0 | 0 |
nengo/spa/action_objects.py | Michaeljurado24/nengo | 762 | 1755664 | <filename>nengo/spa/action_objects.py
"""Syntactic parsing of the subexpressions of all action expressions."""
from nengo.exceptions import SpaParseError
from nengo.utils.numpy import is_number
class Symbol:
"""A set of semantic pointer symbols and associated math.
This is an abstract semantic pointer (not ... | 0 | 0 | 0 | 0 | 0 | 0 |
setup.py | acdha/bagit | 152 | 1755674 | <reponame>acdha/bagit<gh_stars>100-1000
#!/usr/bin/env python
# encoding: utf-8
from __future__ import absolute_import, print_function
import glob
import os
import subprocess
import sys
from codecs import open
from setuptools import setup
if sys.version_info < (2, 7):
print("Python 2.7 or higher is required")
... | 0 | 0 | 0 | 0 | 0 | 0 |
biostar/recipes/factory.py | tangibleai/biostar-central | 477 | 1755678 | <reponame>tangibleai/biostar-central
from django import forms
from django.conf import settings
from django.db import connection
import sqlite3
from biostar.recipes import const, models, util
# Share the logger with models.
logger = models.logger
def float_field(data):
numrange = data.get("range", [1.0, 100000.0... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/anchor_free/test_anchor_free_helper.py | wqliu657/DSNet | 113 | 1755696 | import numpy as np
from anchor_free import anchor_free_helper
def test_get_loc_label():
inputs = np.array([0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0])
output = anchor_free_helper.get_loc_label(inputs)
answer = np.array([[0, 0],
[0, 0],
[0, 0],
... | 0 | 0 | 0 | 0 | 0 | 0 |
custom_components/authenticated/providers.py | Nag94/HomeAssistantConfig | 163 | 1755699 | from __future__ import annotations
"""Providers"""
import logging
import requests
from . import AuthenticatedBaseException
_LOGGER = logging.getLogger(__name__)
PROVIDERS = {}
def register_provider(classname) -> object:
"""Decorator used to register providers."""
PROVIDERS[classname.name] = classname
re... | 0 | 10 | 7 | 1 | 18 | 0 |
python/federatedml/framework/homo/blocks/diffie_hellman.py | hubert-he/FATE | 3,787 | 1755724 | <reponame>hubert-he/FATE<gh_stars>1000+
#
# Copyright 2019 The FATE 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/L... | 0 | 0 | 0 | 0 | 0 | 0 |
listen1/trayshell/launcher.py | xielutian/listen | 4,515 | 1755736 | <filename>listen1/trayshell/launcher.py<gh_stars>1000+
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from PySide.QtGui import *
from PySide.QtCore import *
from trayshell.shell_pyside import Shell
from multiprocessing import freeze_support
def main():
... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/planning_example.py | david-abel/mdps | 230 | 1755746 | <filename>examples/planning_example.py<gh_stars>100-1000
#!/usr/bin/env python
# Python imports.
from __future__ import print_function
# Other imports.
import srl_example_setup
from simple_rl.tasks import GridWorldMDP
from simple_rl.planning import ValueIteration, MCTS
def main():
# Setup MDP, Agents.
mdp = ... | 0 | 0 | 0 | 0 | 0 | 0 |
pyscf/lib/test/test_diis.py | robert-anderson/pyscf | 501 | 1755753 | <gh_stars>100-1000
#!/usr/bin/env python
# Copyright 2014-2018 The PySCF Developers. 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/license... | 0 | 0 | 0 | 0 | 0 | 0 |
LeetCode/python/1042.py | ZintrulCre/LeetCode_Archiver | 279 | 1755755 | <reponame>ZintrulCre/LeetCode_Archiver<filename>LeetCode/python/1042.py<gh_stars>100-1000
class Solution(object):
def gardenNoAdj(self, N, paths):
"""
:type N: int
:type paths: List[List[int]]
:rtype: List[int]
"""
adjacent, res = [[] for _ in range(N)], [0 for _ in r... | 0 | 0 | 0 | 0 | 0 | 0 |
env/lib/python3.8/site-packages/plotly/validators/layout/updatemenu/__init__.py | acrucetta/Chicago_COVI_WebApp | 11,750 | 1755774 | import sys
if sys.version_info < (3, 7):
from ._yanchor import YanchorValidator
from ._y import YValidator
from ._xanchor import XanchorValidator
from ._x import XValidator
from ._visible import VisibleValidator
from ._type import TypeValidator
from ._templateitemname import Templateitemnam... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/addr/test_xlm_addr.py | MIPPLTeam/bip_utils | 149 | 1755781 | # Copyright (c) 2021 <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 the rights
# to use, copy, modify, merge, publish, distribute, ... | 0 | 0 | 0 | 0 | 0 | 0 |
pandashells/bin/p_rand.py | timgates42/pandashells | 878 | 1755800 | #! /usr/bin/env python
# standard library imports
import argparse
import textwrap
import sys # NOQA importing sys so I can mock sys.argv in tests
from pandashells.lib import module_checker_lib, arg_lib
module_checker_lib.check_for_modules(['pandas'])
from pandashells.lib import io_lib
import pandas as pd
import n... | 0 | 2 | 0 | 0 | 2 | 0 |
tha2/mocap/ifacialmocap_constants.py | jyoonab/EasyVtuber | 151 | 1755803 | <reponame>jyoonab/EasyVtuber<filename>tha2/mocap/ifacialmocap_constants.py
EYE_LOOK_IN_LEFT = "eyeLookInLeft"
EYE_LOOK_OUT_LEFT = "eyeLookOutLeft"
EYE_LOOK_DOWN_LEFT = "eyeLookDownLeft"
EYE_LOOK_UP_LEFT = "eyeLookUpLeft"
EYE_BLINK_LEFT = "eyeBlinkLeft"
EYE_SQUINT_LEFT = "eyeSquintLeft"
EYE_WIDE_LEFT = "eyeWideLeft"
EYE... | 0 | 0 | 0 | 0 | 0 | 0 |
Packs/DeHashed/Integrations/DeHashed/DeHashed.py | diCagri/content | 799 | 1755825 | from __future__ import annotations
from typing import Union, Dict, Optional, List
from CommonServerPython import * # noqa: E402 lgtm [py/polluting-import]
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
INTEGRATION_CONTEXT_BRAND = "DeHashed"
BASE_URL = "https://api.dehashed.com/"
RESULTS_FR... | 22 | 7 | 0 | 0 | 29 | 0 |
ufora/FORA/CUDA/GpuCodegen_test.py | ufora/ufora | 571 | 1755839 | <filename>ufora/FORA/CUDA/GpuCodegen_test.py
# Copyright 2016 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
#
# Unl... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/perf/page_sets/partial_invalidation_cases.py | google-ar/chromium | 777 | 1755853 | # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import page as page_module
from telemetry import story
# Even though we don't specialize page behavior directly, we have to define our
#... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/pinball_ext/job/job_runner_test.py | DotModus/pinball | 1,143 | 1755855 | # Copyright 2015, Pinterest, 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 applicable law or agreed to in writ... | 0 | 1 | 0 | 0 | 1 | 0 |
sample-apps/segmentation_left_atrium/lib/infer.py | IntroAI-termproject/MONAILabel | 214 | 1755877 | <gh_stars>100-1000
# Copyright 2020 - 2021 MONAI Consortium
# 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 ... | 0 | 0 | 0 | 0 | 0 | 0 |
DyCommon/Ui/DyTableWidget.py | Leonardo-YXH/DevilYuan | 135 | 1755917 | <gh_stars>100-1000
import re
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QColor
from PyQt5.QtWidgets import QTableWidget, QTableWidgetItem, QAbstractItemView, QMenu, QMessageBox
from PyQt5.Qt import QAction, QCursor
import numpy as np
import pandas as pd
from DyCommon.DyCommon import *
from .DySingleEditDlg i... | 0 | 0 | 0 | 0 | 0 | 0 |
recipes/Python/66064_Reading_Lines/recipe-66064.py | tdiprima/code | 2,023 | 1755949 | <reponame>tdiprima/code
class LogicalLines:
def __init__(self, fileobj, continued=None):
# self.seq: the underlying line-sequence
# self.phys_num: current index into self.seq (physical line number)
# self.logi_num: current index into self (logical line number)
import xreadlines
... | 0 | 0 | 0 | 0 | 0 | 0 |
python/federatedml/ensemble/secureboost/secureboost_util/tree_model_io.py | rubenlozanoaht3m/DataDogm | 715 | 1755979 | <reponame>rubenlozanoaht3m/DataDogm<gh_stars>100-1000
from federatedml.param.boosting_param import DecisionTreeParam
from federatedml.ensemble.basic_algorithms import HeteroFastDecisionTreeGuest, HeteroFastDecisionTreeHost, \
HeteroDecisionTreeGuest, HeteroDecisionTreeHost
from federatedml.util import consts
def ... | 0 | 0 | 0 | 0 | 0 | 0 |
onir/bin/component_info.py | tgeral68/OpenNIR | 140 | 1755990 | import onir
COMPONENTS = {
'rankers': onir.rankers.registry,
'vocabs': onir.vocab.registry,
'datasets': onir.datasets.registry,
'trainers': onir.trainers.registry,
'predictors': onir.predictors.registry,
'pipelines': onir.pipelines.registry,
}
def main():
for name, registry in COMPONENTS... | 0 | 0 | 0 | 0 | 0 | 0 |
mayan/apps/tags/menus.py | eshbeata/open-paperless | 2,743 | 1755997 | <gh_stars>1000+
from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
from navigation import Menu
menu_tags = Menu(
icon='fa fa-tag', label=_('Tags'), name='tags menu'
)
| 0 | 0 | 0 | 0 | 0 | 0 |
external_tools/pystache/specloader.py | singhalshubh/echronos | 154 | 1756018 | # coding: utf-8
from __future__ import annotations
"""
This module supports customized (aka special or specified) template loading.
"""
import os.path
from pystache.loader import Loader
# TODO: add test cases for this class.
class SpecLoader(object):
"""
Supports loading custom-specified templates (from ... | 1 | 3 | 0 | 0 | 4 | 0 |
qucumber/utils/gradients_utils.py | ZvonimirBandic/QuCumber | 163 | 1756023 | <filename>qucumber/utils/gradients_utils.py
# Copyright 2019 PIQuIL - 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 |
donghuangzhong/src/lib/scapy/supersocket.py | onsis/hack-tools | 171 | 1756050 | ## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) <NAME> <<EMAIL>>
## This program is published under a GPLv2 license
from __future__ import annotations
import socket,time
from config import conf
from data import *
class _SuperSocket_metaclass(type):
... | 6 | 10 | 5 | 1 | 22 | 0 |
base_model.py | sunilkmaurya/planetoid | 690 | 1756052 | <reponame>sunilkmaurya/planetoid<gh_stars>100-1000
import lasagne
import cPickle
import random
import numpy as np
class base_model(object):
"""the base model for both transductive and inductive learning."""
def __init__(self, args):
"""
args (an object): contains the arguments used for inital... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/unit-tests/test_rst_transitions.py | bob-schumaker/confluencebuilder | 158 | 1756059 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
"""
:copyright: Copyright 2016-2020 Sphinx Confluence Builder Contributors (AUTHORS)
:license: BSD-2-Clause (LICENSE)
"""
from tests.lib import build_sphinx
from tests.lib import parse
from tests.lib import prepare_conf
import os
import unittest
class TestConfluenceRstTransi... | 0 | 0 | 0 | 0 | 0 | 0 |
common/compression.py | tianqiyuan/douyin_downloader | 402 | 1756094 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
from PIL import Image
import math
import os
def resize_image(origin_img, optimize_img, threshold):
"""
shrink image by size
:param origin_img:
:param optimize_img:
:param threshold:
:return:
"""
file_size = os.path.getsize(origin_img)
wit... | 0 | 0 | 0 | 0 | 0 | 0 |
src/config.py | LAC-Japan/ransomwatch | 244 | 1756099 | <reponame>LAC-Japan/ransomwatch
import os
from typing import Dict
import yaml
with open(os.getenv("RW_CONFIG_PATH", "config.yaml"), "r") as f:
Config: Dict = yaml.load(f, Loader=yaml.CLoader) | 0 | 0 | 0 | 0 | 0 | 0 |
vehicle/OVMS.V3/components/duktape/tools/dump_bytecode.py | Daisy000888/Open-Vehicle-Monitoring-System-3 | 322 | 1756142 | <filename>vehicle/OVMS.V3/components/duktape/tools/dump_bytecode.py
#!/usr/bin/env python2
#
# Utility to dump bytecode into a human readable form.
#
import os
import sys
import optparse
import struct
import yaml
script_path = sys.path[0] # http://stackoverflow.com/questions/4934806/how-can-i-find-scripts-directory... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/utils/test_distance_from_divide.py | amanaster2/landlab | 257 | 1756145 | import numpy as np
import pytest
from landlab import FieldError, RasterModelGrid
from landlab.components import FlowAccumulator, FlowDirectorSteepest
from landlab.utils.distance_to_divide import calculate_distance_to_divide
def test_no_flow_receivers():
"""Test that correct error is raised when no flow recievers... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/fixtures/settings.py | productdev-catalyst/django-tenant-users | 165 | 1756219 | """
This module is used to modify SETTINGS during tests.
All defined fixtures should include settings()
"""
import pytest
@pytest.fixture(autouse=True)
def _password_hashers(settings) -> None:
"""Forces django to use fast password hashers for tests."""
settings.PASSWORD_HASHERS = [
'django.contrib.a... | 0 | 2 | 0 | 0 | 2 | 0 |
abusehelper/tools/botnet/commands.py | AbuseSA/abusehelper | 117 | 1756236 | from __future__ import annotations
import os
import re
import sys
import time
import errno
import signal
import select
from botnet import Command
# Helpers
def popen(*args, **keys) -> object:
import subprocess
defaults = {
"stdout": subprocess.PIPE,
"stderr": subprocess.PIPE,
"stdin... | 4 | 16 | 0 | 0 | 20 | 0 |
Raspberry_Pi_Animated_Gif_Player/pygame_player.py | gamblor21/Adafruit_Learning_System_Guides | 665 | 1756244 | <gh_stars>100-1000
"""
This example is for use on (Linux) computers that are using CPython with
Adafruit Blinka to support CircuitPython libraries. CircuitPython does
not support PIL/pillow (python imaging library)!
Author(s): <NAME> for Adafruit Industries
"""
import serial
import adafruit_board_toolkit.circuitpython... | 0 | 0 | 0 | 0 | 0 | 0 |
test/sru/test_sru.py | PeiyuChen1005/sru | 1,832 | 1756249 | import pytest
import sru
import torch
@pytest.mark.parametrize(
"cuda",
[
False,
pytest.param(
True,
marks=pytest.mark.skipif(
not torch.cuda.is_available(), reason="no cuda available"
),
),
],
)
@pytest.mark.parametrize("with_gra... | 0 | 3 | 0 | 0 | 3 | 0 |
python_modules/libraries/dagster-azure/dagster_azure_tests/blob_tests/conftest.py | dbatten5/dagster | 4,606 | 1756251 | import pytest
@pytest.fixture(scope="session")
def storage_account():
yield "dagsterdatabrickstests"
@pytest.fixture(scope="session")
def container():
yield "dagster-databricks-tests"
@pytest.fixture(scope="session")
def credential():
yield "super-secret-creds"
| 0 | 0 | 0 | 0 | 0 | 0 |
src/main/python/org/broadinstitute/hellbender/gatktool/toolconstants.py | sunboy0523/gatk | 1,273 | 1756262 | """
Constants that must remain in sync with the companion StreamingProcessController Java
code in GATK. See StreamingToolConstants.java.
"""
"""
Command acknowledgement messages used to signal positive acknowledgement ('ack',
negative acknowledgement ('nck'), and negative acknowledgement with an accompanying
message ... | 0 | 0 | 0 | 0 | 0 | 0 |
autoload/thesaurus_query/backends/openthesaurus_de_lookup.py | ri-aje/thesaurus_query.vim | 224 | 1756300 | # python wrapper for word query from openthesaurus.de
# Author: <NAME> [[<EMAIL>][E-mail]]
from __future__ import annotations
try:
from urllib2 import urlopen
from urllib2 import URLError, HTTPError
except ImportError:
from urllib.request import urlopen
from urllib.error import URLError, HTTPErr... | 1 | 3 | 0 | 0 | 4 | 0 |
tests/functional/test_scoping/test_children.py | stanislaw/textX | 346 | 1756349 | <filename>tests/functional/test_scoping/test_children.py
from __future__ import unicode_literals
import re
from operator import eq
import textx.scoping.providers as scoping_providers
from textx import get_children, get_children_of_type
from textx import metamodel_from_str
metamodel_str = '''
Model:
packages*=Pac... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/ReturnChecks.py | YangHao666666/hawq | 450 | 1756359 | from __future__ import annotations
from pychecker2.Check import Check
from pychecker2.Check import Warning
from pychecker2.util import BaseVisitor, type_filter
from pychecker2 import symbols
from compiler import ast, walk
class Returns(BaseVisitor):
def __init__(self):
self.result: list[object] = []
... | 0 | 1 | 0 | 1 | 2 | 0 |
semantic_seg_synthia/data_prep/gen_label_weights.py | HarmoniaLeo/meteornet | 127 | 1756389 | <gh_stars>100-1000
import numpy as np
import os
import glob
import argparse
import class_mapping
parser = argparse.ArgumentParser()
parser.add_argument('--data_root', default='../processed_data', help='Data dir [default: .]')
FLAGS = parser.parse_args()
data_root = FLAGS.data_root
npz_files = glob.glob(os.path... | 0 | 0 | 0 | 0 | 0 | 0 |
Python/Tests/TestData/TestDiscoverer/Timeout/test_timeout_ut.py | techkey/PTVS | 404 | 1756403 | <filename>Python/Tests/TestData/TestDiscoverer/Timeout/test_timeout_ut.py
import unittest
while True:
pass
class TestClassUT(unittest.TestCase):
def test_ut_fail(self):
self.fail("Not implemented")
def test_ut_pass(self):
pass
if __name__ == '__main__':
unittest.main()
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/unit/crs/test_cr_copy_build_artefact.py | guvenbz/amazon-s3-find-and-forget | 165 | 1756467 | <reponame>guvenbz/amazon-s3-find-and-forget<filename>tests/unit/crs/test_cr_copy_build_artefact.py<gh_stars>100-1000
import pytest
from mock import patch, MagicMock
from backend.lambdas.custom_resources.copy_build_artefact import create, delete, handler
pytestmark = [pytest.mark.unit, pytest.mark.task]
@patch("back... | 0 | 0 | 0 | 0 | 0 | 0 |
market1501/make_hdf5_for_market1501.py | vohoaiviet/Implementation-CVPR2015-CNN-for-ReID | 150 | 1756471 | # -*- coding: utf-8 -*-
import os
import h5py
import numpy as np
from PIL import Image
def make_positive_index_market1501(train_or_test = 'train',user_name = 'ubuntu'):
f = h5py.File('market1501_positive_index.h5')
path_list = get_image_path_list(train_or_test = train_or_test, system_user_name = user_n... | 0 | 0 | 0 | 0 | 0 | 0 |
FasterRunner/auth.py | FuxiongYang/faster | 227 | 1756478 | import time
import jwt
from django.contrib.auth import get_user_model
from django.utils.translation import gettext as _
from rest_framework import exceptions
from rest_framework.authentication import BaseAuthentication
from rest_framework_jwt.authentication import JSONWebTokenAuthentication, jwt_get_username_fr... | 0 | 7 | 0 | 0 | 7 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.