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 |
|---|---|---|---|---|---|---|---|---|---|---|
scripts/check_signature.py | nishp77/lbry-sdk | 4,996 | 1759797 | <reponame>nishp77/lbry-sdk
import argparse
import sqlite3
from binascii import hexlify
from lbry.wallet.transaction import Output
def check(db_path, claim_id):
db = sqlite3.connect(db_path)
db.row_factory = sqlite3.Row
claim = db.execute('select * from claim where claim_id=?', (claim_id,)).fetchone()
... | 0 | 0 | 0 | 0 | 0 | 0 |
code/example.py | DarkSuniuM/skillshare-downloader | 292 | 1759807 | from downloader import Downloader
cookie = """
ADD YOUR COOKIE HERE
"""
dl = Downloader(cookie=cookie)
# download by class URL:
dl.download_course_by_url('https://www.skillshare.com/classes/Art-Fundamentals-in-One-Hour/189505397')
# or by class ID:
# dl.download_course_by_class_id(189505397)
| 0 | 0 | 0 | 0 | 0 | 0 |
recipes/Python/577342_AutoRenamepy/recipe-577342.py | tdiprima/code | 2,023 | 1759820 | <filename>recipes/Python/577342_AutoRenamepy/recipe-577342.py
import os
import sys
def main():
program = os.path.abspath(sys.argv[0])
# Get the current working directory and
# walk through it and its subdirectories.
cwd = os.getcwd()
for root, dirs, files in os.walk(cwd, False):
# Rename al... | 0 | 0 | 0 | 0 | 0 | 0 |
src/UQpy/SampleMethods/Strata/__init__.py | marrov/UQpy | 132 | 1759830 | <filename>src/UQpy/SampleMethods/Strata/__init__.py
from UQpy.SampleMethods.Strata.delaunay import DelaunayStrata
from UQpy.SampleMethods.Strata.rectangular import RectangularStrata
from UQpy.SampleMethods.Strata.voronoi import VoronoiStrata
from UQpy.SampleMethods.Strata.strata import Strata
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/conftest.py | arvindmuralie77/gradsflow | 253 | 1759832 | <gh_stars>100-1000
# Copyright (c) 2021 GradsFlow. 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 requ... | 0 | 0 | 0 | 0 | 0 | 0 |
rotkehlchen/chain/ethereum/modules/liquity/constants.py | rotkehlchenio/rotkehlchen | 137 | 1759837 | CPT_LIQUITY = 'liquity'
| 0 | 0 | 0 | 0 | 0 | 0 |
easyreg/affine_net.py | uncbiag/easyreg | 107 | 1759839 | <reponame>uncbiag/easyreg<filename>easyreg/affine_net.py
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from .modules import *
from .net_utils import Bilinear
from torch.utils.checkpoint import checkpoint
from .utils import sigmoid_decay
from .losses import... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/hwsim/test_fst_module.py | sergey2x/hostap | 138 | 1759847 | # FST functionality tests
# Copyright (c) 2015, Qualcomm Atheros, Inc.
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from __future__ import annotations
import logging
logger = logging.getLogger()
import struct
import subprocess
import time
import os
import re
... | 5 | 2 | 0 | 0 | 7 | 0 |
env/lib/python3.8/site-packages/plotly/validators/violin/_meanline.py | acrucetta/Chicago_COVI_WebApp | 11,750 | 1759854 | import _plotly_utils.basevalidators
class MeanlineValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name: str="meanline", parent_name: str="violin", **kwargs):
super(MeanlineValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_na... | 2 | 0 | 0 | 0 | 2 | 0 |
Python3/443.py | rakhi2001/ecom7 | 854 | 1759858 | __________________________________________________________________________________________________
sample 48 ms submission
class Solution:
def compress(self, chars: List[str]) -> int:
result = 0
index = 0
while index < len(chars):
curr = chars[index]
count = 0
... | 0 | 0 | 0 | 0 | 0 | 0 |
pymunk/tests/__main__.py | conductiveIT/pymunk-1 | 670 | 1759872 | <gh_stars>100-1000
import argparse
import doctest
import faulthandler
import os
import os.path
import platform
import sys
import unittest
from typing import Any, Iterator
import cffi # type: ignore
from . import doctests
def main(args: Any) -> None:
def list_of_tests_gen(s: Any) -> Iterator[Any]:
for t... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/modelzoo/test_wordnet.py | gabgoh/lucid | 4,537 | 1759885 | import pytest
import nltk
nltk.download("wordnet")
from nltk.corpus import wordnet as wn
from lucid.modelzoo.wordnet import (
id_from_synset,
synset_from_id,
imagenet_synset_ids,
imagenet_synsets,
imagenet_synset_from_description,
)
@pytest.fixture()
def synset() -> object:
return wn.synset... | 0 | 2 | 0 | 0 | 2 | 0 |
DQM/L1TMonitor/python/L1TObjectsTiming_cfi.py | ckamtsikis/cmssw | 852 | 1759905 | <filename>DQM/L1TMonitor/python/L1TObjectsTiming_cfi.py
import FWCore.ParameterSet.Config as cms
# the uGMT eta/phi map DQM module
from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
l1tObjectsTiming = DQMEDAnalyzer(
"L1TObjectsTiming",
muonProducer = cms.InputTag("gtStage2Digis", "Muon"),
stage2Calo... | 0 | 0 | 0 | 0 | 0 | 0 |
ironic/tests/unit/drivers/modules/redfish/test_vendor.py | yanndegat/ironic | 350 | 1759913 | # Copyright 2018 DMTF. 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 applicabl... | 0 | 0 | 0 | 0 | 0 | 0 |
demo.py | LeDSantos/Dancing2Music | 466 | 1759914 | # Copyright (c) 2020, NVIDIA Corporation. All rights reserved.
#
# This work is made available
# under the Nvidia Source Code License (1-way Commercial).
# To view a copy of this license, visit
# https://nvlabs.github.io/Dancing2Music/License.txt
import os
import argparse
import functools
import librosa
import shutil
i... | 0 | 2 | 0 | 0 | 2 | 0 |
twilio/rest/events/v1/subscription/subscribed_event.py | BrimmingDev/twilio-python | 1,362 | 1759944 | # coding=utf-8
from __future__ import annotations
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource impor... | 5 | 24 | 0 | 5 | 34 | 0 |
tests/test_vunit/vunit_mock/vunit/ui.py | mfkiwl/edalize | 398 | 1759946 | <reponame>mfkiwl/edalize
from unittest.mock import MagicMock
class Library(MagicMock):
def add_source_files(self, file):
print("add_source_files()")
class VUnit(MagicMock):
@staticmethod
def from_argv():
return VUnit()
def add_library(self):
print("add_library()")
... | 0 | 0 | 0 | 0 | 0 | 0 |
python/graphscope/nx/tests/algorithms/forward/connectivity/test_edge_kcomponents.py | LI-Mingyu/GraphScope-MY | 1,521 | 1759957 | <gh_stars>1000+
import pytest
#import networkx.algorithms.connectivity.tests.test_edge_kcomponents
#from graphscope.nx.utils.compat import import_as_graphscope_nx
#import_as_graphscope_nx(
# networkx.algorithms.connectivity.tests.test_edge_kcomponents,
# decorators=pytest.mark.usefixtures("graphscope_session")... | 0 | 0 | 0 | 0 | 0 | 0 |
mayan/apps/mirroring/dependencies.py | nattangwiwat/Mayan-EDMS-recitation | 343 | 1759964 | <filename>mayan/apps/mirroring/dependencies.py
from mayan.apps.dependencies.classes import PythonDependency
PythonDependency(
module=__name__, name='fusepy', version_string='==3.0.1'
)
| 0 | 0 | 0 | 0 | 0 | 0 |
setup.py | nisiddharth/lyrics-in-terminal | 163 | 1759979 | from setuptools import setup, find_packages
from setuptools.command.install import install
import os
from lyrics import __version__, CONFIG_PATH
this_directory = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
c... | 0 | 0 | 0 | 0 | 0 | 0 |
descarteslabs/workflows/types/geospatial/groupby.py | descarteslabs/descarteslabs-python | 167 | 1760002 | <filename>descarteslabs/workflows/types/geospatial/groupby.py
from descarteslabs.common.graft import client
from ..core import typecheck_promote, GenericProxytype, merge_params
from ..containers import Dict, Tuple
from ..function import Function
from .image import Image
from .imagecollection import ImageCollection
... | 0 | 0 | 0 | 0 | 0 | 0 |
setup.py | motey/py2neo | 545 | 1760004 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright 2011-2021, <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/licenses/LICENSE-2.0
#
# Unless re... | 0 | 5 | 0 | 1 | 6 | 0 |
4/4-14-parse.py | iroan/practice-prometheus | 222 | 1760008 | from prometheus_client.parser import text_string_to_metric_families
for family in text_string_to_metric_families(u"counter_total 1.0\n"):
for sample in family.samples:
print("Name: {0} Labels: {1} Value: {2}".format(*sample))
| 0 | 0 | 0 | 0 | 0 | 0 |
stethoscope/__init__.py | HoriaHorvat/stethoscope | 1,865 | 1760063 | # vim: set fileencoding=utf-8 :
from pkg_resources import DistributionNotFound, get_distribution
try:
__version__ = get_distribution(__name__).version
except DistributionNotFound:
# package is not installed
pass
| 0 | 0 | 0 | 0 | 0 | 0 |
differential-privacy-library-main/diffprivlib/models/k_means.py | gonzalo-munillag/Exponential_Randomised_Response | 597 | 1760068 | <reponame>gonzalo-munillag/Exponential_Randomised_Response<gh_stars>100-1000
# MIT License
#
# Copyright (C) IBM Corporation 2019
#
# 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 restr... | 0 | 0 | 0 | 0 | 0 | 0 |
ssim/__init__.py | zldrobit/pyssim | 310 | 1760135 | <filename>ssim/__init__.py
"""Module for computing the Structural Similarity Image Metric (SSIM)."""
from __future__ import absolute_import
from ssim.ssimlib import SSIM
from ssim.ssimlib import SSIMImage
from ssim.ssimlib import get_gaussian_kernel
from ssim.compat import Image
def compute_ssim(image1, image2, gaus... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/report/print_model1_assoc.py | gitter-badger/FlexNeuART | 101 | 1760145 | <filename>scripts/report/print_model1_assoc.py
#!/usr/bin/env python
#
# Copyright 2014+ Carnegie Mellon University
#
# 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.... | 0 | 0 | 0 | 0 | 0 | 0 |
demos/polls/aiohttpdemo_polls/generate_data.py | asvetlov/aiohttp_admin | 221 | 1760162 | import asyncio
import pathlib
import aiohttpdemo_polls.db as db
import psycopg2
from faker import Factory
from aiohttpdemo_polls.utils import init_postgres
from sqlalchemy.schema import CreateTable, DropTable
PROJ_ROOT = pathlib.Path(__file__).parent.parent
conf = {"host": "127.0.0.1",
"port": 8080,
... | 0 | 3 | 0 | 0 | 3 | 0 |
examples/rl/environments/shipsteer/shipbench_pgpe.py | sveilleux1/pybrain | 2,208 | 1760169 | #!/usr/bin/env python
#########################################################################
# Reinforcement Learning with PGPE on the ShipSteering Environment
#
# Requirements: pylab (for plotting only). If not available, comment the
# last 3 lines out
# Author: <NAME>, <EMAIL>
#####################################... | 0 | 0 | 0 | 0 | 0 | 0 |
king_phisher/server/graphql/types/misc.py | chachabooboo/king-phisher | 1,143 | 1760205 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# king_phisher/server/graphql/types/misc.py
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# ... | 0 | 12 | 9 | 0 | 21 | 0 |
software/glasgow/applet/memory/onfi/__init__.py | whitequark/glasgow | 280 | 1760211 | # Memory organization
# -------------------
#
# The NAND flash architecture is highly parallel to improve throughput, and is built around
# limitations of the storage medium. This results in a somewhat confusing set of terms used to
# refer to various subdivisions of the memory array. The following is a short introduct... | 9 | 18 | 5 | 0 | 32 | 0 |
CommonTools/RecoUtils/test/pf_pu_assomap_cfg.py | ckamtsikis/cmssw | 852 | 1760212 | <filename>CommonTools/RecoUtils/test/pf_pu_assomap_cfg.py
import FWCore.ParameterSet.Config as cms
process = cms.Process("OWNPARTICLES")
process.load("FWCore.MessageService.MessageLogger_cfi")
process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(100) )
process.source = cms.Source("PoolSource",
fi... | 0 | 0 | 0 | 0 | 0 | 0 |
image_synthesis/data/mscoco_dataset.py | adampolyak/VQ-Diffusion | 236 | 1760237 | from __future__ import annotations
from torch.utils.data import Dataset
import numpy as np
import io
from PIL import Image
import os
import json
import random
from image_synthesis.utils.misc import instantiate_from_config
def load_img(filepath) -> object:
img = Image.open(filepath).convert('RGB')
return img
c... | 2 | 3 | 0 | 0 | 5 | 0 |
ykdl/extractors/sohu/edu.py | panda-mute/ykdl | 136 | 1760254 | # -*- coding: utf-8 -*-
from .sohubase import SohuBase
class EduSohu(SohuBase):
name: str = '搜狐课堂 (Sohu Edu)'
apiurl: str = 'http://my.tv.sohu.com/play/videonew.do'
apiparams: dict[str,str] = {
'vid': '',
'referer': 'http://edu.tv.sohu.com/'
}
site = EduSohu()
| 0 | 0 | 3 | 0 | 3 | 0 |
cctbx/sgtbx/direct_space_asu/facet_analysis.py | dperl-sol/cctbx_project | 155 | 1760284 | <reponame>dperl-sol/cctbx_project<filename>cctbx/sgtbx/direct_space_asu/facet_analysis.py<gh_stars>100-1000
from __future__ import absolute_import, division, print_function
from operator import itemgetter
from cctbx.sgtbx.direct_space_asu import cut_plane
from cctbx.array_family import flex
from scitbx import matrix
im... | 0 | 0 | 0 | 0 | 0 | 0 |
aioquant/market.py | littleyanglovegithub/aioquant | 175 | 1760285 | # -*- coding:utf-8 -*-
from __future__ import annotations
"""
Market module.
Author: HuangTao
Date: 2019/02/16
Email: <EMAIL>
"""
import json
from aioquant import const
from aioquant.utils import logger
class Orderbook:
"""Orderbook object.
Args:
platform: Exchange platform name, e.g. `binance... | 20 | 15 | 0 | 0 | 35 | 0 |
devil/devil/android/cpu_temperature_test.py | tingshao/catapult | 138 | 1760327 | <reponame>tingshao/catapult
#!/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.
"""
Unit tests for the contents of cpu_temperature.py
"""
# pylint: disable=unused-argument
import logging... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/python-api/script.py | gudeh/yosys | 1,718 | 1760328 | <gh_stars>1000+
#!/usr/bin/python3
from pyosys import libyosys as ys
import matplotlib.pyplot as plt
import numpy as np
design = ys.Design()
ys.run_pass("read_verilog ../../tests/simple/fiedler-cooley.v", design);
ys.run_pass("prep", design)
ys.run_pass("opt -full", design)
cell_stats = {}
for module in design.sele... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/integration/testdata/invoke/cdk/assets/asset.93b9d2c968973fe6eba35b65fd456a7bdc12e483512088a38fa8e43b5b62c452/app.py | zhuhaow/aws-sam-cli | 2,959 | 1760341 | def lambda_handler(event, context) -> str:
return "Hello from PythonFunction!"
| 0 | 1 | 0 | 0 | 1 | 0 |
autots/models/base.py | winedarksea/AutoTS | 442 | 1760361 | # -*- coding: utf-8 -*-
from __future__ import annotations
"""
Base model information
@author: Colin
"""
import datetime
import numpy as np
import pandas as pd
class ModelObject(object):
"""Generic class for holding forecasting models.
Models should all have methods:
.fit(df, future_regressor = []) ... | 24 | 9 | 0 | 0 | 33 | 0 |
AV_MiniHack2_SimpleBuy/finalModel.py | galileoSolution/ML | 212 | 1760364 | import sys
from math import sqrt
import numpy as np
import pandas as pd
from sklearn.preprocessing import LabelEncoder, OneHotEncoder
from sklearn.cross_validation import KFold
from sklearn import ensemble
from sklearn import linear_model as lm
from sklearn.metrics import mean_squared_error as mse
import xgboost as xgb... | 0 | 0 | 0 | 0 | 0 | 0 |
sysutils/createrepo/files/patch-dumpMetadata.py | matsimon/macports-ports | 1,199 | 1760389 | --- dumpMetadata.py 2006-06-10 18:28:03.000000000 +0200
+++ dumpMetadata.py 2006-06-10 19:13:42.000000000 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/python -t
+#!__PYTHON__ -t
# base classes and functions for dumping out package Metadata
#
# This program is free software; you can redistribute it and/or modify
| 0 | 0 | 0 | 0 | 0 | 0 |
venv/Lib/site-packages/wcwidth/unicode_versions.py | gilbertekalea/booking.com_crawler | 6,989 | 1760407 | """
Exports function list_versions() for unicode version level support.
This code generated by bin/update-tables.py on 2020-06-23 16:03:21.350604.
"""
def list_versions() -> tuple[str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, str]:
"""
Return Unicode version levels supported by t... | 0 | 1 | 0 | 0 | 1 | 0 |
examples/juniper/get-configuration-jnpr.py | NorthLandTeam/ncclient | 498 | 1760461 | #!/usr/bin/env python
import json
import logging
from ncclient import manager
from ncclient.xml_ import *
def connect(host, port, user, password):
conn = manager.connect(host=host,
port=port,
username=user,
password=password,
... | 0 | 0 | 0 | 0 | 0 | 0 |
onnxruntime/test/testdata/transform/computation_reduction/e2e.py | dennyac/onnxruntime | 6,036 | 1760466 | import onnx
from onnx import helper
from onnx import AttributeProto, TensorProto, GraphProto, OperatorSetIdProto
from onnx import numpy_helper
import numpy as np
vocab_size=256 #30258
X = helper.make_tensor_value_info('input', TensorProto.FLOAT, ["batch", "seqlen", 128])
unsqueezed_masked_lm_positions = helper.make_t... | 0 | 0 | 0 | 0 | 0 | 0 |
embedding-calculator/src/services/flask_/needs_attached_file.py | Precistat/CompreFace | 1,779 | 1760473 | # Copyright (c) 2020 the original author or 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 0 | 2 | 0 | 0 | 2 | 0 |
code/exnumpy.py | timgates42/pypng | 329 | 1760501 | <filename>code/exnumpy.py
#!/usr/bin/env python
"""
Example code integrating RGB PNG files, PyPNG and NumPy
(abstracted from Mel Raab's functioning code)
"""
import numpy
import png
import pngsuite
"""
Reading from PNG file into numpy array.
If you have a PNG file for an RGB image,
and want to create a numpy arra... | 0 | 0 | 0 | 0 | 0 | 0 |
utils/lit/tests/Inputs/shtest-env/print_environment.py | kkeita/llvm_autofdo | 938 | 1760545 | <filename>utils/lit/tests/Inputs/shtest-env/print_environment.py
#!/usr/bin/env python
from __future__ import print_statement
import os
sorted_environment = sorted(os.environ.items())
for name,value in sorted_environment:
print(name,'=',value)
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_wmi.py | IMULMUL/PythonForWindows | 479 | 1760548 | <gh_stars>100-1000
import pytest
import windows
import windows.generated_def as gdef
from windows.pycompat import basestring
from .pfwtest import *
## This comment was in test_system.py: still revelant ?
# Well, pytest initialize COM with its own parameters
# It might make our own com.init() in WMI fail and therefor... | 0 | 0 | 0 | 0 | 0 | 0 |
test/network_tests/test_unstable.py | dseifert/catkin | 250 | 1760553 | #!/usr/bin/env python3
import os
import shutil
import tempfile
from test.utils import MAKE_CMD
from test.utils import MOCK_DIR
from test.utils import PYTHON_INSTALL_PATH
from test.utils import assert_exists
from test.utils import create_catkin_workspace
from test.utils import succeed
from .network_test_utils import A... | 0 | 0 | 0 | 0 | 0 | 0 |
third_party/boto/services/sonofmmm.py | stdft112/depot_tools | 2,151 | 1760574 | <reponame>stdft112/depot_tools<filename>third_party/boto/services/sonofmmm.py
# Copyright (c) 2006,2007 <NAME> http://garnaat.org/
#
# 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 re... | 0 | 0 | 0 | 0 | 0 | 0 |
datasets/base/video/dataset.py | zhangzhengde0225/SwinTrack | 143 | 1760601 | <filename>datasets/base/video/dataset.py
import os
from miscellanies.platform_style_path import join_path
from .manipulator import VideoDatasetManipulator
from datasets.types.specialized_dataset import SpecializedVideoDatasetType
from datasets.base.common.dataset import _BaseDataset, _BaseDatasetObject
__all__ = ['Vid... | 0 | 0 | 0 | 0 | 0 | 0 |
s3prl/downstream/speech_translation/AdditionalDataset.py | hhhaaahhhaa/s3prl | 856 | 1760620 | <filename>s3prl/downstream/speech_translation/AdditionalDataset.py<gh_stars>100-1000
import fairseq
from fairseq.data import Dictionary, encoders
import csv
from argparse import Namespace
import torch
class AdditionalDataset:
@classmethod
def from_tsv(cls, file, key, bpe_tokenizer=None, pre_tokenizer=None):
... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/bin/pythonSrc/pychecker-0.8.18/test_input/test74.py | YangHao666666/hawq | 450 | 1760637 | 'test __getattr[ibute]__ returning None'
class A:
'no warning'
def __getattr__(self, attr) -> object:
return attr
class B:
'no warning'
def __getattribute__(self, attr) -> object:
return attr
class C:
'warning'
def __getattr__(self, attr):
pass
class D:
'warning'
... | 0 | 5 | 0 | 0 | 5 | 0 |
applications/DEMApplication/DEMApplication.py | lkusch/Kratos | 778 | 1760712 | from KratosDEMApplication import *
from KratosMultiphysics import _ImportApplication
application = KratosDEMApplication()
application_name = "KratosDEMApplication"
_ImportApplication(application, application_name)
| 0 | 0 | 0 | 0 | 0 | 0 |
create-files.py | LewisJohnson/unity-ui-examples | 176 | 1760761 | <gh_stars>100-1000
import os
import string
from shutil import copyfile
folders = ["Animations", "Images", "Prefabs", "Scenes", "Scripts"]
def get_type():
print("1 - Screen Space")
print("2 - World Space")
example_type = int(input())
if example_type == 1:
return "ScreenSpace"
elif example... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/layers/test_pooling.py | Saumitra-Shukla/keras-bert | 2,465 | 1760762 | from unittest import TestCase
import numpy as np
from keras_bert.backend import keras
from keras_bert.layers import MaskedGlobalMaxPool1D
class TestPooling(TestCase):
def test_masked_global_max_pool_1d_predict(self):
input_layer = keras.layers.Input(shape=(None,))
embed_layer = keras.layers.Embed... | 0 | 0 | 0 | 0 | 0 | 0 |
_solved/solutions/case-conflict-mapping33.py | lleondia/geopandas-tutorial | 341 | 1760787 | <reponame>lleondia/geopandas-tutorial
data_within_protected = geopandas.sjoin(data_utm, protected_areas_utm[['NAME_AP', 'geometry']],
op='within', how='inner') | 0 | 0 | 0 | 0 | 0 | 0 |
tests/commands/util/test_bitcoin_computer.py | febuiles/two1-python | 415 | 1760796 | # standard python imports
import unittest.mock as mock
import builtins
import json
import socket
# 3rd party imports
import pytest
# two1 imorts
from two1.commands.util import bitcoin_computer
# String to use as the content of the mocked file
UUID_STR = "12345678-1234-1234-1234-123456789012"
@pytest.mark.parametri... | 0 | 0 | 0 | 0 | 0 | 0 |
python/phonenumbers/shortdata/region_PG.py | rodgar-nvkz/python-phonenumbers | 2,424 | 1760802 | <gh_stars>1000+
"""Auto-generated file, do not edit by hand. PG metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_PG = PhoneMetadata(id='PG', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='[01]\\d{2,6}', possible... | 0 | 0 | 0 | 0 | 0 | 0 |
_google_/gmail/__init__.py | janmechtel/gmail-helper | 437 | 1760840 | <gh_stars>100-1000
from apiclient import errors
import os
import _config_ as _cfg
import _dbms_ as _db
import _logging_ as _log
def get_labels(db, labels_obj, user_id='me'):
results = labels_obj.list(userId='me').execute()
labels = results.get('labels', [])
if not labels:
_log.logger.info("No la... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/language_model/end_to_end_memory_networks/data.py | JeremyZhao1998/PaddleNLP | 7,091 | 1760851 | <filename>examples/language_model/end_to_end_memory_networks/data.py
# Copyright (c) 2021 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
#
# ht... | 0 | 0 | 0 | 0 | 0 | 0 |
python/tests/unittest/test_cython_ast.py | LI-Mingyu/GraphScope-MY | 1,521 | 1760880 | <filename>python/tests/unittest/test_cython_ast.py<gh_stars>1000+
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020 Alibaba Group Holding Limited. 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.
#... | 0 | 0 | 0 | 0 | 0 | 0 |
meshrcnn/modeling/roi_heads/mask_head.py | MAYURGAIKWAD/meshrcnn | 1,028 | 1760910 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import torch
from detectron2.layers import cat
from detectron2.utils.events import get_event_storage
from torch.nn import functional as F
from meshrcnn.structures.mask import batch_crop_masks_within_box
def mask_rcnn_loss(pred_mask_logits, instan... | 0 | 1 | 0 | 0 | 1 | 0 |
napalm_logs/scripts/__init__.py | bittsi/napalm-logs | 133 | 1760963 | # -*- coding: utf-8 -*-
'''
napalm-logs scripts
'''
| 0 | 0 | 0 | 0 | 0 | 0 |
python/tests/integration/test_check.py | jordanyaker/drunken-data-quality | 206 | 1760973 | <reponame>jordanyaker/drunken-data-quality
import unittest
from uuid import UUID, uuid4
from pyspark import SparkContext, StorageLevel
from pyspark.sql import SQLContext
from pyddq.core import Check
class ConstructorTest(unittest.TestCase):
def setUp(self):
self.sc = SparkContext()
self.sql = SQL... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/server/blueprints/cases/test_cases_controllers.py | Clinical-Genomics/scout | 111 | 1760979 | """Tests for the cases controllers"""
import requests # import requests for the purposes of monkeypatching
from flask import Blueprint, Flask, url_for
from scout.server.blueprints.cases.controllers import (
case,
case_report_content,
mt_coverage_stats,
phenotypes_genes,
)
from scout.server.extensions ... | 0 | 2 | 0 | 1 | 3 | 0 |
operations.py | HYPJUDY/Decouple-SSAD | 104 | 1760980 | # -*- coding: utf-8 -*-
from __future__ import annotations
"""
@author: HYPJUDY 2019/4/15
https://github.com/HYPJUDY
Decoupling Localization and Classification in Single Shot Temporal Action Detection
-----------------------------------------------------------------------------------
Operations used by Decouple-SSAD... | 9 | 20 | 0 | 0 | 29 | 0 |
banding_removal/fastmri/optimizer/__init__.py | sbelenki/fastMRI | 815 | 1761000 | <filename>banding_removal/fastmri/optimizer/__init__.py
"""
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 torch
import torch.optim
def load(p, args):
if args.method == "adam":
... | 0 | 0 | 0 | 0 | 0 | 0 |
sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/models/_recovery_services_backup_passive_client_enums.py | vincenttran-msft/azure-sdk-for-python | 2,728 | 1761003 | <gh_stars>1000+
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator... | 0 | 0 | 0 | 0 | 0 | 0 |
lib/python3.4/site-packages/pip/_vendor/html5lib/trie/__init__.py | LChristakis/chalice-hunter | 2,151 | 1761024 | <filename>lib/python3.4/site-packages/pip/_vendor/html5lib/trie/__init__.py
from __future__ import absolute_import, division, unicode_literals
from .py import Trie as PyTrie
Trie = PyTrie
try:
from .datrie import Trie as DATrie
except ImportError:
pass
else:
Trie = DATrie
| 0 | 0 | 0 | 0 | 0 | 0 |
ahmia/views_static.py | keyboardcowboy42/search | 148 | 1761043 | <gh_stars>100-1000
"""
Views
Static HTML pages.
These pages does not require database connection.
"""
from django.http import HttpResponse, HttpResponseNotAllowed
from django.template import Context, loader
from django.views.decorators.http import require_GET
import view_help_functions as helpers # My view_help_fun... | 0 | 0 | 0 | 0 | 0 | 0 |
quarkchain/cluster/log_filter.py | QuarkChain/pyquarkchain | 237 | 1761048 | import time
from typing import List, Optional
from quarkchain.cluster.shard_db_operator import ShardDbOperator
from quarkchain.core import Address, Log, MinorBlock, MinorBlockHeader
from quarkchain.evm.bloom import bloom
from quarkchain.utils import Logger
class LogFilter:
"""
Filter class for logs, blocks, ... | 10 | 7 | 1 | 2 | 20 | 0 |
dm_flags.py | david-gpu/deep-makeover | 267 | 1761049 |
import tensorflow as tf
FLAGS = tf.app.flags.FLAGS
def define_flags():
# Configuration (alphabetically)
tf.app.flags.DEFINE_integer('annealing_half_life', 10000,
"Number of batches until annealing temperature is halved")
tf.app.flags.DEFINE_string('attribute_file', 'list_... | 0 | 0 | 0 | 0 | 0 | 0 |
dataset_scripts/ddd/ddd_find_thresholds.py | Goulustis/v2e-1 | 104 | 1761100 | import logging
import os
import sys
import numpy as np
import argparse
from tempfile import TemporaryDirectory
import matplotlib.pyplot as plt
import matplotlib
# matplotlib.use("TkAgg") # use in pycharm to avoid scientific mode plot?
from tqdm import tqdm
from v2e import desktop
from v2e.emulator import EventEmulato... | 0 | 0 | 0 | 0 | 0 | 0 |
mayan/apps/common/tests/test_links.py | bonitobonita24/Mayan-EDMS | 343 | 1761126 | <reponame>bonitobonita24/Mayan-EDMS
from django.db import models
from mayan.apps.testing.tests.base import GenericViewTestCase
from ..classes import ModelCopy
from ..permissions import permission_object_copy
from .literals import TEST_OBJECT_LABEL
from .mixins import ObjectCopyLinkTestMixin
class ObjectCopyLinkTes... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/unit/cli/test_global_config.py | zhuhaow/aws-sam-cli | 2,959 | 1761155 | <gh_stars>1000+
import os
from unittest.mock import ANY, MagicMock, patch
from unittest import TestCase
from samcli.cli.global_config import ConfigEntry, DefaultEntry, GlobalConfig
from pathlib import Path
class TestGlobalConfig(TestCase):
def setUp(self):
# Force singleton to recreate after each test
... | 0 | 0 | 0 | 0 | 0 | 0 |
utils/greedysearch.py | fakegit/Chinese-Chatbot-PyTorch-Implementation | 710 | 1761172 | # -*- coding: utf-8 -*-
import torch
import torch.nn as nn
class GreedySearchDecoder(nn.Module):
def __init__(self, encoder, decoder):
super(GreedySearchDecoder, self).__init__()
self.encoder = encoder
self.decoder = decoder
def forward(self, sos, eos, input_seq, input... | 0 | 1 | 0 | 0 | 1 | 0 |
models/segmentation.py | guotao0628/ReferFormer | 125 | 1761183 | from __future__ import annotations
"""
Segmentaion Part
Modified from DETR (https://github.com/facebookresearch/detr)
"""
from collections import defaultdict
from typing import List, Optional
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import Tensor
from PIL import Image
from einops... | 30 | 13 | 0 | 0 | 43 | 0 |
deepchem/models/gbdt_models/gbdt_model.py | cjgalvin/deepchem | 3,782 | 1761185 | """
Gradient Boosting Decision Tree wrapper interface
"""
import os
import logging
import tempfile
import warnings
from typing import Callable, Optional, Union
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.model_selection import train_test_split
from deepchem.data import Dataset
from deepche... | 7 | 1 | 0 | 2 | 10 | 0 |
Training/MOOC Tensorflow 2.0/BeiDa/class5/CIFAR10_CNN/p24_cifar10_datasets.py | church06/Pythons | 177 | 1761187 | <gh_stars>100-1000
import tensorflow as tf
from matplotlib import pyplot as plt
import numpy as np
np.set_printoptions(threshold=np.inf)
cifar10 = tf.keras.datasets.cifar10
(x_train, y_train), (x_test, y_test) = cifar10.load_data()
# 可视化训练集输入特征的第一个元素
plt.imshow(x_train[0]) # 绘制图片
plt.show()
# 打印出训练集输入特征的第一个元素
prin... | 0 | 0 | 0 | 0 | 0 | 0 |
algorithm/dynamic_programming.py | ganeshskudva/Algorithm_Templates | 190 | 1761189 | # simplifying a complicated problem by breaking it down into simpler sub-problems in a recursive manner
# dynamic programming = recursion + memorized
# state definition, state transition equation, optimal substructure
# direction: bottom-up or top-down
def dynamic_programming_template_with_example(word1, word2) -> ob... | 0 | 1 | 0 | 0 | 1 | 0 |
compiler/onnx-tools/onnx-dump.py | chogba6/ONE | 255 | 1761190 | <gh_stars>100-1000
#!/usr/bin/env python3
# Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/... | 0 | 0 | 0 | 0 | 0 | 0 |
src/python/nimbusml/examples/examples_from_dataframe/EnsembleClassifier_iris_df.py | michaelgsharp/NimbusML | 134 | 1761197 | <reponame>michaelgsharp/NimbusML
###############################################################################
# EnsembleClassifier
import numpy as np
import pandas as pd
from nimbusml.datasets import get_dataset
from nimbusml.ensemble import EnsembleClassifier
from nimbusml.ensemble.feature_selector import RandomFea... | 0 | 0 | 0 | 0 | 0 | 0 |
NodeGraphQt/widgets/nodes_palette.py | uclatommy/NodeGraphQt | 582 | 1761210 | <reponame>uclatommy/NodeGraphQt
#!/usr/bin/python
# -*- coding: utf-8 -*-
from collections import defaultdict
from Qt import QtWidgets, QtCore, QtGui
from ..constants import URN_SCHEME
class NodesGridDelagate(QtWidgets.QStyledItemDelegate):
def paint(self, painter, option, index):
"""
Args:
... | 0 | 0 | 0 | 0 | 0 | 0 |
objectModel/Python/cdm/persistence/syms/types/purpose.py | rt112000/CDM | 884 | 1761225 | <filename>objectModel/Python/cdm/persistence/syms/types/purpose.py<gh_stars>100-1000
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
from typing import Union, List
from .purpose_reference import *
from .trait_r... | 0 | 0 | 0 | 0 | 0 | 0 |
lightbus_examples/ex06_django/example_app/views.py | gcollard/lightbus | 178 | 1761227 | <reponame>gcollard/lightbus<gh_stars>100-1000
from django.http import HttpResponse
from django.shortcuts import render
from lightbus.exceptions import LightbusTimeout
from lightbus_examples.ex06_django.bus import bus
from lightbus_examples.ex06_django.example_app.models import PageView
def home_page(request):
cu... | 0 | 0 | 0 | 0 | 0 | 0 |
tensorforce/core/optimizers/__init__.py | DLPerf/tensorforce | 1,132 | 1761231 | # Copyright 2020 Tensorforce Team. 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 appli... | 0 | 0 | 0 | 0 | 0 | 0 |
Python/ZipAndUnzip/zipunzip.py | ieternalleo/AlgoCode | 151 | 1761246 | <reponame>ieternalleo/AlgoCode<filename>Python/ZipAndUnzip/zipunzip.py<gh_stars>100-1000
# importing required modules
from zipfile import ZipFile
import os
import sys
def getAllFilePaths(directory):
# initializing empty file paths list
filePaths = []
# crawling through directory and subdirecto... | 0 | 0 | 0 | 0 | 0 | 0 |
backend/www/test/facebook_utils.py | sleepingAnt/viewfinder | 645 | 1761250 | <gh_stars>100-1000
#!/usr/bin/env python
#
# Copyright 2012 Viewfinder Inc. All Rights Reserved.
"""Facebook-specific test functions.
Creating facebook test users should only need to be done once--they
persist across unittest runs and are shared by all developers. Create
the universe of test users with:
% python -m ... | 0 | 0 | 0 | 0 | 0 | 0 |
tensornetwork/linalg/linalg.py | khanhgithead/TensorNetwork | 1,681 | 1761272 | <reponame>khanhgithead/TensorNetwork<filename>tensornetwork/linalg/linalg.py
# Copyright 2019 The TensorNetwork 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.apa... | 0 | 0 | 0 | 0 | 0 | 0 |
node.py | myqq156001980/jbc | 201 | 1761274 | <reponame>myqq156001980/jbc
from block import Block
import mine
from flask import Flask, jsonify, request
import sync
import requests
import os
import json
import sys
import apscheduler
import argparse
import utils
from config import *
node = Flask(__name__)
sync.sync(save=True) #want to sync and save the overall "b... | 0 | 0 | 0 | 0 | 0 | 0 |
qd3dt/datasets/video/bdd_vid_3d.py | mengmengliu1998/qd-3dt | 384 | 1761277 | <reponame>mengmengliu1998/qd-3dt
import numpy as np
import os.path as osp
import mmcv
from mmcv.parallel import DataContainer as DC
from pycocotools.coco import COCO
from .video_dataset import VideoDataset
from .video_parser import VID
from qd3dt.datasets.registry import DATASETS
from qd3dt.datasets.utils import to_t... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/GenerateTokenSubscriptionExample.py | msitt/blpapi-python | 228 | 1761308 | <reponame>msitt/blpapi-python
# GenerateTokenSubscriptionExample.py
from __future__ import print_function
from __future__ import absolute_import
from optparse import OptionParser
import os
import platform as plat
import sys
if sys.version_info >= (3, 8) and plat.system().lower() == "windows":
# pylint: disable=no... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/command.py | jonasmr/voltron | 5,856 | 1761312 | """
Example command plugin
Copy this to your ~/.voltron/plugins directory. It will be loaded when
Voltron is initialised, and register a debugger command that works as follows:
$ lldb /tmp/inferior
Voltron loaded.
Run `voltron init` after you load a target.
(lldb) target create "/tmp/inferior"
Current executable set ... | 0 | 0 | 1 | 0 | 1 | 0 |
tutorial_exercises/vgg16-nnef-openvx/vgg16_export.py | relrotciv/openvx_tutorial | 220 | 1761315 | # Copyright (c) 2017 The Khronos Group 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 |
src/sage/tests/numpy.py | UCD4IDS/sage | 1,742 | 1761417 | <reponame>UCD4IDS/sage<filename>src/sage/tests/numpy.py
r"""
TESTS:
Sage integers can index NumPy matrices (see :trac:`10928`)::
sage: import numpy as np
sage: m = np.matrix(np.arange(4).reshape(2, 2))
sage: a = m[:, int(0)]
sage: b = m[:, Integer(0)]
sage: a.shape, b.shape
((2, 1), (2, 1))
... | 0 | 0 | 0 | 0 | 0 | 0 |
lightreid/data/datasets/wildtrack.py | wangguanan/light-reid | 296 | 1761428 | <reponame>wangguanan/light-reid<filename>lightreid/data/datasets/wildtrack.py<gh_stars>100-1000
"""
@author: wangguanan
@contact: <EMAIL>
"""
import os, copy
import os.path as osp
from .reid_samples import ReIDSamples
from lightreid.utils import os_walk
class WildTrackCrop(ReIDSamples):
"""WildTrack.
Re... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/convert_nuScenes_full_frames.py | mengmengliu1998/qd-3dt | 384 | 1761464 | from __future__ import annotations
import os
import os.path as osp
from tqdm import tqdm
from pathlib import Path
from collections import defaultdict
import numpy as np
from pyquaternion import Quaternion
from scipy.spatial.transform import Rotation as R
from nuscenes.nuscenes import NuScenes
from nuscenes.utils impo... | 0 | 3 | 0 | 0 | 3 | 0 |
DQM/DTMonitorClient/python/dtSegmentAnalysisTest_cfi.py | Purva-Chaudhari/cmssw | 852 | 1761517 | import FWCore.ParameterSet.Config as cms
from DQMServices.Core.DQMEDHarvester import DQMEDHarvester
segmentTest = DQMEDHarvester("DTSegmentAnalysisTest",
detailedAnalysis = cms.untracked.bool(False),
#Perform basic diagnostic in endLumi/EndRun
... | 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.