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 |
|---|---|---|---|---|---|---|---|---|---|---|
npt/datasets/cifar10.py | jacobkimmel/non-parametric-transformers | 302 | 1745432 | import torch
from npt.datasets.base import BaseDataset
class CIFAR10Dataset(BaseDataset):
def __init__(self, c):
super().__init__(
fixed_test_set_index=None)
self.c = c
def load(self):
"""
Classification dataset.
Target in last column.
60 000 rows... | 0 | 0 | 0 | 0 | 0 | 0 |
projects/UniDet/unidet/data/custom_dataset_dataloader.py | Othinus099/interior | 349 | 1745437 | from __future__ import annotations
import copy
import logging
import numpy as np
import operator
import torch
import torch.utils.data
import json
from detectron2.utils.comm import get_world_size
from detectron2.data import samplers
from torch.utils.data.sampler import BatchSampler, Sampler
from detectron2.data.common ... | 3 | 2 | 0 | 0 | 5 | 0 |
froide/account/management/commands/send_mass_mail.py | xenein/froide | 198 | 1745446 | from django.core.management.base import BaseCommand
from django.utils import translation
from django.conf import settings
from froide.account.models import User
class Command(BaseCommand):
help: str = "Sends mail to all users"
def handle(self, *args, **options):
translation.activate(settings.LANGUAG... | 0 | 1 | 1 | 0 | 2 | 0 |
src/actions/actions/saltstack-cmdscript/__init__.py | anderson-attilio/runbook | 155 | 1745451 | <reponame>anderson-attilio/runbook<gh_stars>100-1000
#!/usr/bin/python
######################################################################
# Cloud Routes Bridge
# -------------------------------------------------------------------
# Actions Module
#####################################################################... | 0 | 0 | 0 | 0 | 0 | 0 |
scale/data/test/filter/json/test_filter_v6.py | kaydoh/scale | 121 | 1745453 | <gh_stars>100-1000
from __future__ import unicode_literals
import django
from django.test import TestCase
from data.filter.filter import DataFilter
from data.filter.exceptions import InvalidDataFilter
from data.filter.json.filter_v6 import convert_filter_to_v6_json, DataFilterV6
class TestDataFilterV6(TestCase):
... | 0 | 0 | 0 | 0 | 0 | 0 |
changes/api/build_details.py | vault-the/changes | 443 | 1745459 | from __future__ import annotations
from __future__ import absolute_import
from collections import defaultdict
from flask_restful.reqparse import RequestParser
from itertools import groupby
from sqlalchemy.orm import contains_eager, joinedload, subqueryload_all
from typing import List # NOQA
from changes.api.base imp... | 0 | 4 | 0 | 0 | 4 | 0 |
nni/algorithms/hpo/curvefitting_assessor/curvefitting_assessor.py | dutxubo/nni | 2,305 | 1745461 | <filename>nni/algorithms/hpo/curvefitting_assessor/curvefitting_assessor.py
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import logging
import datetime
from schema import Schema, Optional
from nni import ClassArgsValidator
from nni.assessor import Assessor, AssessResult
from nni.utils impo... | 0 | 0 | 0 | 0 | 0 | 0 |
third_party/gsutil/gslib/tests/test_gsutil.py | tingshao/catapult | 2,151 | 1745479 | <filename>third_party/gsutil/gslib/tests/test_gsutil.py<gh_stars>1000+
# -*- coding: utf-8 -*-
# Copyright 2013 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 a... | 0 | 0 | 0 | 0 | 0 | 0 |
OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeServer.py | defraged/opensim | 132 | 1745517 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# Copyright (c) Contributors, http://opensimulator.org/
# See CONTRIBUTORS.TXT for a full list of copyright holders.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# ... | 0 | 1 | 0 | 0 | 1 | 0 |
src/clusto/test/base/countertests.py | thekad/clusto | 216 | 1745588 | from clusto.test import testbase
from clusto.schema import *
from clusto.drivers.base import *
class TestClustoCounter(testbase.ClustoTestBase):
def testCounterDefault(self):
e = Entity('e1')
c = Counter(e, 'key1')
self.assertEqual(c.value, 0)
d = Counter(e, 'key2', start=10)
... | 0 | 0 | 0 | 0 | 0 | 0 |
pysd/py_backend/functions.py | JamesPHoughton/pysd | 240 | 1745594 | <gh_stars>100-1000
"""
These functions have no direct analog in the standard python data analytics
stack, or require information about the internal state of the system beyond
what is present in the function call. We provide them in a structure that
makes it easy for the model elements to call.
"""
import inspect
impor... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/integration/cqlengine/test_lwt_conditional.py | clohfink/python-driver | 1,163 | 1745599 | # Copyright DataStax, 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 writing, softwa... | 0 | 0 | 0 | 0 | 0 | 0 |
mushroom_rl/algorithms/value/td/sarsa_lambda_continuous.py | PuzeLiu/mushroom-rl | 344 | 1745601 | <reponame>PuzeLiu/mushroom-rl
import numpy as np
from mushroom_rl.algorithms.value.td import TD
from mushroom_rl.approximators import Regressor
from mushroom_rl.utils.parameters import to_parameter
class SARSALambdaContinuous(TD):
"""
Continuous version of SARSA(lambda) algorithm.
"""
def __init__(s... | 0 | 0 | 0 | 0 | 0 | 0 |
lib/python3.4/site-packages/flask/module.py | LChristakis/chalice-hunter | 21,684 | 1745614 | # -*- coding: utf-8 -*-
from __future__ import annotations
"""
flask.module
~~~~~~~~~~~~
Implements a class that represents module blueprints.
:copyright: (c) 2011 by <NAME>.
:license: BSD, see LICENSE for more details.
"""
import os
from .blueprints import Blueprint
def blueprint_is_module(bp... | 4 | 1 | 0 | 1 | 6 | 0 |
var/spack/repos/builtin/packages/r-tzdb/package.py | LiamBindle/spack | 2,360 | 1745617 | <gh_stars>1000+
# 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 RTzdb(RPackage):
"""Time Zone Database Information.
Provides an up-to... | 0 | 0 | 0 | 0 | 0 | 0 |
pyocd/target/builtin/target_HC32M423.py | majorlin/pyOCD | 276 | 1745621 | <reponame>majorlin/pyOCD<filename>pyocd/target/builtin/target_HC32M423.py
# pyOCD debugger
# Copyright (c) 2021 Huada Semiconductor Corporation
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# Y... | 0 | 0 | 0 | 0 | 0 | 0 |
qiskit/providers/aer/library/save_instructions/__init__.py | garrison/qiskit-aer | 313 | 1745629 | <gh_stars>100-1000
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modif... | 0 | 0 | 0 | 0 | 0 | 0 |
kur/containers/layers/squeeze.py | greedyuser/kur | 867 | 1745661 | from __future__ import annotations
"""
Copyright 2017 Deepgram
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 ag... | 0 | 4 | 0 | 1 | 5 | 0 |
tools/Vitis-AI-Quantizer/vai_q_pytorch/nndct_shared/nndct_graph/base_tensor.py | bluetiger9/Vitis-AI | 848 | 1745662 | <reponame>bluetiger9/Vitis-AI<gh_stars>100-1000
# Copyright 2019 Xilinx 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 requ... | 0 | 0 | 0 | 0 | 0 | 0 |
platform/polycommon/polycommon/test_cases/fixtures/grid.py | admariner/polyaxon | 3,200 | 1745667 | #!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 ... | 0 | 1 | 0 | 0 | 1 | 0 |
Pytorch/DQN/Load_Agent.py | FitMachineLearning/FitML | 171 | 1745683 | <filename>Pytorch/DQN/Load_Agent.py
## DQN Tutorial
## https://www.youtube.com/watch?v=WHRQUZrxxGw
import torch
import gym
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import numpy as np
from dataclasses import dataclass
from typing import Any
from random import random
... | 0 | 0 | 0 | 0 | 0 | 0 |
deps/libgdal/gyp-formats/ogr_htf.gyp | jimgambale/node-gdal | 462 | 1745686 | {
"includes": [
"../common.gypi"
],
"targets": [
{
"target_name": "libgdal_ogr_htf_frmt",
"type": "static_library",
"sources": [
"../gdal/ogr/ogrsf_frmts/htf/ogrhtfdatasource.cpp",
"../gdal/ogr/ogrsf_frmts/htf/ogrhtfdriver.cpp",
"../gdal/ogr/ogrsf_frmts/htf/ogrhtflayer.cpp"
],
"include... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/bin/pythonSrc/pychecker-0.8.18/test_input/test57.py | YangHao666666/hawq | 450 | 1745696 | "doesn't work in 1.5.2"
def ttt(c):
return None
def x():
"should not complain about either, we can't check # args"
columns = [ 1, 2 ]
print zip(*columns)
print ttt(*columns)
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/__init__.py | XianranZ/geemap | 1,894 | 1745705 | """Unit test package for geemap."""
| 0 | 0 | 0 | 0 | 0 | 0 |
courses/machine_learning/deepdive2/production_ml/labs/samples/contrib/e2e-outlier-drift-explainer/seldon/seldon_e2e_cifar10.kale.default.py | memeyankm/training-data-analyst | 6,140 | 1745715 | <reponame>memeyankm/training-data-analyst<gh_stars>1000+
import kfp.dsl as dsl
import json
import kfp.components as comp
from collections import OrderedDict
from kubernetes import client as k8s_client
def setup(MINIO_ACCESS_KEY: str, MINIO_HOST: str, MINIO_MODEL_BUCKET: str, MINIO_SECRET_KEY: str):
pipeline_param... | 0 | 0 | 0 | 0 | 0 | 0 |
third_party/gsutil/third_party/retry-decorator/retry_decorator/__init__.py | tingshao/catapult | 5,079 | 1745759 | <filename>third_party/gsutil/third_party/retry-decorator/retry_decorator/__init__.py<gh_stars>1000+
# -*- coding: utf-8 -*-
from .retry_decorator import *
__title__ = 'retry_decorator'
__version__ = "1.0.0"
| 0 | 0 | 0 | 0 | 0 | 0 |
Python/Tests/GlassTests/PythonTests/Python/setup_cpp_mod.py | techkey/PTVS | 404 | 1745763 | <reponame>techkey/PTVS
from setuptools import setup, Extension
setup(name='cpp_mod_pkg',
version='1.0',
ext_modules = [Extension('cpp_mod',
['initmod.cpp', 'cpp_mod.cpp'],
extra_compile_args = ['/Zi', '/Fdbuild'],
... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/checkbins/checkbins.py | google-ar/chromium | 777 | 1745780 | #!/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.
"""Makes sure that all EXE and DLL files in the provided directory were built
correctly.
In essense it runs a subset of BinScope t... | 0 | 0 | 0 | 0 | 0 | 0 |
var/spack/repos/builtin/packages/libmad/package.py | LiamBindle/spack | 2,360 | 1745794 | # 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 Libmad(AutotoolsPackage):
"""MAD is a high-quality MPEG audio decoder."""
homepage: s... | 0 | 0 | 4 | 0 | 4 | 0 |
chrome/test/functional/multiprofile.py | nagineni/chromium-crosswalk | 231 | 1745829 | <reponame>nagineni/chromium-crosswalk
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import re
import pyauto_functional
import pyauto
class MultiprofileTest(pyauto.PyUITest):
... | 0 | 0 | 0 | 0 | 0 | 0 |
ppcls/arch/backbone/model_zoo/vision_transformer.py | zhusonghe/PaddleClas-1 | 150 | 1745833 | # copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 53 | 17 | 0 | 0 | 70 | 0 |
.venv/lib/python3.8/site-packages/mkdocs/exceptions.py | MCMaurer/mkdocs-learning-materials-home | 13,746 | 1745840 | <reponame>MCMaurer/mkdocs-learning-materials-home<filename>.venv/lib/python3.8/site-packages/mkdocs/exceptions.py
from click import ClickException, echo
class MkDocsException(ClickException):
"""Base exceptions for all MkDocs Exceptions"""
class Abort(MkDocsException):
"""Abort the build"""
def show(sel... | 0 | 0 | 0 | 0 | 0 | 0 |
ai_imu_dr/main_kitti.py | wachinaba/ai-imu-dr | 499 | 1745857 | import os
import shutil
import numpy as np
from collections import namedtuple
import glob
import time
import datetime
import pickle
import torch
import matplotlib.pyplot as plt
from termcolor import cprint
from navpy import lla2ned
from collections import OrderedDict
from dataset import BaseDataset
from utils_torch_fil... | 0 | 9 | 28 | 0 | 37 | 0 |
crits/indicators/migrate.py | dutrow/crits | 738 | 1745873 | from crits.core.crits_mongoengine import EmbeddedCampaign
from crits.vocabulary.indicators import (
IndicatorThreatTypes,
IndicatorAttackTypes
)
def migrate_indicator(self):
"""
Migrate to the latest schema version.
"""
migrate_4_to_5(self)
def migrate_4_to_5(self):
"""
Migrate from s... | 0 | 0 | 0 | 0 | 0 | 0 |
client/verta/verta/_swagger/_public/modeldb/api/HydratedServiceApi.py | stefan-petrov-toptal/modeldb | 835 | 1745889 | <reponame>stefan-petrov-toptal/modeldb<filename>client/verta/verta/_swagger/_public/modeldb/api/HydratedServiceApi.py
# THIS FILE IS AUTO-GENERATED. DO NOT EDIT
class HydratedServiceApi:
def __init__(self, client, base_path = "/v1"):
self.client = client
self.base_path = base_path
def findHydratedDatasetV... | 0 | 0 | 0 | 0 | 0 | 0 |
comparison/masif_ligand/Kripo/similarity_results/generate_ROCs.py | NBDsoftware/masif | 309 | 1745892 | <filename>comparison/masif_ligand/Kripo/similarity_results/generate_ROCs.py
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.metrics import roc_auc_score, roc_curve
import multiprocessing
n_train = multiprocessing.cpu_count()
n_test = multiprocessing.cpu_count(... | 0 | 0 | 0 | 0 | 0 | 0 |
cupcake2/ice2/IceFiles2.py | ArthurDondi/cDNA_Cupcake | 205 | 1745914 | from __future__ import annotations
__author__ = '<EMAIL>'
"""
Diff with IceFiles:
1. <subread_xml> replaces <bas_fofn> (for running Arrow)
2. removed <fasta_fofn>
3. removed <ccs_fofn>
4. s/quiver/arrow
"""
import os.path as op
import re
import logging
from pbtranscript.Utils import real_ppath, now_str, mkdi... | 4 | 16 | 2 | 0 | 22 | 0 |
demo/import/paypal/settings.py | benhunter/owasp-pysec | 416 | 1745931 | <reponame>benhunter/owasp-pysec
# coding=utf-8
"""
This module contains config objects needed by paypal.interface.PayPalInterface.
Most of this is transparent to the end developer, as the PayPalConfig object
is instantiated by the PayPalInterface object.
"""
from paypal.exceptions import PayPalConfigError, PayPalError... | 0 | 0 | 0 | 0 | 0 | 0 |
Python/basicrequest.py | Chris-469/mq-dev-patterns | 102 | 1745961 | # -*- coding: utf-8 -*-
# Copyright 2019 IBM
#
# 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 | 4 | 0 | 0 | 4 | 0 |
neutronclient/tests/unit/osc/v2/fakes.py | casual-lemon/python-neutronclient | 120 | 1745971 | <reponame>casual-lemon/python-neutronclient
# 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 o... | 0 | 0 | 0 | 0 | 0 | 0 |
pylearn2/scripts/benchmark/time_relu.py | BouchardLab/pylearn2 | 2,045 | 1745977 | '''
This is the benchmark of 4 different implementations
of rectified linear activation in Theano.
Two types of computations are tested w.r.t.
each implementation: fprop and grad.
Results: in seconds, float32 (details in the code)
Implementation, CPU (fprop, bprop), GPU (fprop, bprop), (final score)
a) ScalarRectifie... | 0 | 3 | 0 | 0 | 3 | 0 |
dataprofiler/tests/labelers/test_base_model.py | gautomdas/DataProfiler | 690 | 1745983 | import unittest
from unittest import mock
from dataprofiler.labelers import base_model
class TestBaseModel(unittest.TestCase):
@mock.patch('dataprofiler.labelers.base_model.BaseModel.'
'_BaseModel__subclasses',
new_callable=mock.PropertyMock)
def test_register_subclass(self, ... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/basic/mesh_modify.py | hadivafaii/vedo | 836 | 1746020 | """Modify mesh vertex positions"""
from vedo import *
t = Text2D(__doc__)
dsc = Disc().lineWidth(0.1)
coords = dsc.points()
for i in range(50):
coords[:,2] = sin(i/10.*coords[:,0])/5 # move vertices in z
dsc.points(coords) # modify mesh
show(dsc, t, resetcam=not i, interactive=0, axes=7) # resetcam only... | 0 | 0 | 0 | 0 | 0 | 0 |
scout/commands/update/omim.py | gmc-norr/scout | 111 | 1746027 | """Code to handle updates of the OMIM-AUTO gene panel via scout CLI"""
import logging
import click
from flask.cli import current_app, with_appcontext
from scout.server.extensions import store
from scout.utils.handle import get_file_handle
from scout.utils.scout_requests import fetch_mim_files
LOG = logging.getLogger... | 0 | 0 | 0 | 0 | 0 | 0 |
Documents/Router/CVE-2017-7494/impacket/examples/remcomsvc.py | edinjapan/NSABlocklist | 201 | 1746040 | # Copyright (c) 2003-2016 CORE Security Technologies
#
# This software is provided under under a slightly modified version
# of the Apache Software License. See the accompanying LICENSE file
# for more information.
#
# REMCOMSVC library. It provides a way to retrieve the RemComSvc binary file to be
# uploaded to the ta... | 0 | 0 | 0 | 0 | 0 | 0 |
vulture/lines.py | kianmeng/vulture | 2,081 | 1746058 | <filename>vulture/lines.py<gh_stars>1000+
import ast
import sys
def _get_last_child_with_lineno(node):
"""
Return the last direct child of `node` that has a lineno attribute,
or None if `node` has no such children.
Almost all node._field lists are sorted by the order in which they
appear in sourc... | 0 | 0 | 0 | 0 | 0 | 0 |
PyFunceble/query/requests/adapter/base.py | veracioux/PyFunceble | 213 | 1746063 | """
The tool to check the availability or syntax of domain, IP or URL.
::
██████╗ ██╗ ██╗███████╗██╗ ██╗███╗ ██╗ ██████╗███████╗██████╗ ██╗ ███████╗
██╔══██╗╚██╗ ██╔╝██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝██╔══██╗██║ ██╔════╝
██████╔╝ ╚████╔╝ █████╗ ██║ ██║██╔██╗ ██║██║ █████╗ █... | 4 | 5 | 3 | 0 | 12 | 0 |
mods/_SensorTest/environment.py | SummitChen/opennero | 215 | 1746068 | <reponame>SummitChen/opennero
from OpenNero import *
from common import *
from constants import *
from math import *
class SensorTestEnvironment(Environment):
def __init__(self):
Environment.__init__(self)
self.counter = 0
self.sensor_info = FeatureVectorInfo()
self.expected = []
... | 0 | 0 | 0 | 0 | 0 | 0 |
proselint/checks/cliches/__init__.py | kerri-hicks/proselint | 4,163 | 1746086 | """Avoid cliches."""
| 0 | 0 | 0 | 0 | 0 | 0 |
sdk/python/pulumi_gcp/bigtable/_inputs.py | sisisin/pulumi-gcp | 121 | 1746100 | # 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! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 42 | 21 | 0 | 0 | 63 | 0 |
omnizart/models/t2t.py | nicolasanjoran/omnizart | 1,145 | 1746102 | from __future__ import annotations
"""Implementation of memory efficient attention.
Original implemetation are from `tensor2tensor <https://github.com/tensorflow/tensor2tensor>`_.
Rewrite in tensorflow 2.0.
"""
# pylint: disable=C0103,R0914,E1120
import functools
import operator
import numpy as np
import tensorflow... | 29 | 20 | 0 | 0 | 49 | 0 |
src/main/resources/resource/Clock/clock_4_clock_pulse.py | holgerfriedrich/myrobotlab | 179 | 1746121 | def clock_pulse(timedata):
print("The clock has pulsed " + str(timedata)) | 0 | 0 | 0 | 0 | 0 | 0 |
Algo and DSA/LeetCode-Solutions-master/Python/high-five.py | Sourav692/FAANG-Interview-Preparation | 3,269 | 1746124 | # Time: O(nlogn)
# Space: O(n)
import collections
import heapq
class Solution(object):
def highFive(self, items) -> object:
"""
:type items: List[List[int]]
:rtype: List[List[int]]
"""
min_heaps = collections.defaultdict(list)
for i, val in items:
heap... | 0 | 1 | 0 | 0 | 1 | 0 |
tools/lava_validation.py | RoelVdP/Angora | 792 | 1746126 | #!/usr/bin/env python3
# coding=utf-8
# python >= 3.5
"""
python3 lava_validation.py path-to-output-dir path-to-validated_bugs-file path-to-program [args..]
e.g.
python3 lava_validation.py ./output/ ./path-to-lava-M/who/validated_bugs ./who
python3 lava_validation.py ./output/ ./path-to-lava-M/md5sum/validated_bugs ./... | 0 | 2 | 0 | 0 | 2 | 0 |
tests/test_sparse.py | GabrielWen/spartan | 156 | 1746145 | import unittest
import numpy as np
from spartan import expr, util
from spartan.util import Assert
import test_common
ARRAY_SIZE = (10, 10)
class TestReduce(test_common.ClusterTest):
def test_sparse_create(self):
x = expr.sparse_rand(ARRAY_SIZE, density=0.001)
x.evaluate()
def test_sparse_glom(self):
... | 0 | 0 | 0 | 0 | 0 | 0 |
ote_sdk/ote_sdk/entities/graph.py | ntyukaev/training_extensions | 775 | 1746157 | from __future__ import annotations
"""This module implements the TrainParameters entity."""
# Copyright (C) 2021-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
from typing import Union
import networkx as nx
from ote_sdk.entities.interfaces.graph_interface import IGraph
class Graph(IGraph):
"""
... | 4 | 14 | 0 | 1 | 19 | 0 |
docs/gendoctools/python2rst.py | BuildJet/siconos | 137 | 1746178 | <filename>docs/gendoctools/python2rst.py
"""Tools used during configuration and build process of
Siconos documentation.
This modules contains functions dedicated to the generation
of rst files from xml output generated by doxygen,
from python docstrings.
It also includes tools to create docstrings in swig
from c++ he... | 0 | 0 | 0 | 0 | 0 | 0 |
python/app/thirdparty/oneforall/modules/datasets/cloudflare_api.py | taomujian/linbing | 351 | 1746197 | <reponame>taomujian/linbing
from app.thirdparty.oneforall.config import settings
from app.thirdparty.oneforall.common.query import Query
from app.thirdparty.oneforall.config.log import logger
from time import sleep
class CloudFlareAPI(Query):
def __init__(self, domain):
Query.__init__(self)
self.... | 0 | 0 | 0 | 0 | 0 | 0 |
h2o-py/tests/pyunit_utils/__init__.py | vishalbelsare/h2o-3 | 6,098 | 1746218 | <reponame>vishalbelsare/h2o-3
from __future__ import absolute_import
from .utilsPY import *
from .utils_model_metrics import *
from .utils_model_custom_distribution import *
from .sklearn_multinomial_auc_method import roc_auc_score
| 0 | 0 | 0 | 0 | 0 | 0 |
examples/scripts/cdl/onlinecdl_msk_gry.py | vishalbelsare/sporco | 217 | 1746236 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the SPORCO package. Details of the copyright
# and user license can be found in the 'LICENSE.txt' file distributed
# with the package.
"""
Online Convolutional Dictionary Learning with Spatial Mask
====================================================... | 0 | 0 | 0 | 0 | 0 | 0 |
src/ics/todo.py | aureooms-contrib/ics-py | 312 | 1746245 | # mypy: ignore_errors
# this is because mypy doesn't like the converter of CalendarEntryAttrs.{created,last_modified,dtstamp} and due to some
# bug confuses the files
from datetime import datetime
from typing import Optional, ClassVar, Type
import attr
from attr.validators import in_, optional as v_optional
from ics... | 3 | 0 | 5 | 0 | 8 | 0 |
test/ut/sdk/__init__.py | dutxubo/nni | 9,680 | 1746284 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import os
os.environ['NNI_PLATFORM'] = 'unittest'
os.environ['NNI_TRIAL_JOB_ID'] = 'test_trial_job_id'
| 0 | 0 | 0 | 0 | 0 | 0 |
mpf/core/randomizer.py | Scottacus64/mpf | 163 | 1746285 | from __future__ import annotations
"""Generic list randomizer."""
from uuid import uuid4
import random
class Randomizer:
"""Generic list randomizer."""
def __init__(self, items, machine: object | None=None, template_type: object | None=None):
"""Initialise Randomizer."""
self.fallback_value:... | 4 | 9 | 0 | 8 | 21 | 0 |
pl_examples/basic_examples/mnist_examples/image_classifier_1_pytorch.py | neptune-ml/pytorch-lightning | 15,666 | 1746308 | # Copyright The PyTorch Lightning team.
#
# 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 i... | 0 | 1 | 0 | 0 | 1 | 0 |
models/sml/sml_voxceleb.py | siavash-khodadadeh/MetaLearning-TF2.0 | 102 | 1746317 | import tensorflow as tf
import tensorflow_hub as hub
from models.sml.sml import SML
from networks.maml_umtra_networks import MiniImagenetModel, VoxCelebModel
from databases import VoxCelebDatabase
def run_celeba():
vox_celeb_database = VoxCelebDatabase()
feature_model = hub.Module("https://tfhub.dev/google/s... | 0 | 0 | 0 | 0 | 0 | 0 |
python/jittor/loss3d/__init__.py | Exusial/jittor | 2,571 | 1746329 | from .chamfer import chamfer_loss, ChamferLoss
from .emd import earth_mover_distance, EarthMoverDistance
| 0 | 0 | 0 | 0 | 0 | 0 |
examples/pybullet/gym/pybullet_envs/minitaur/robots/minitaur_motor_model_v2.py | felipeek/bullet3 | 9,136 | 1746352 | # Lint as: python3
from __future__ import annotations
"""This file implements an accurate motor model."""
from typing import Tuple
import gin
import numpy as np
from pybullet_envs.minitaur.robots import hybrid_motor_model
from pybullet_envs.minitaur.robots import robot_config
VOLTAGE_CLIPPING = 50
# TODO(b/73728631... | 13 | 4 | 0 | 2 | 19 | 0 |
attendance/models.py | akshaya9/fosswebsite | 369 | 1746389 | import random
import string
from django.db import models
from django_mysql.models import JSONField
class DailyAttendance(models.Model):
"""
attendance = { "2016": {"user_id": [1, s_time, e_time], "user_id": [0, s_time, e_time]} }
"""
date = models.DateField()
attendance = JSONField()
def __... | 0 | 2 | 0 | 0 | 2 | 0 |
Open3D/python/conda_meta/test_import.py | xdeng7/redwood_open3d_3dreconstruction | 113 | 1746426 | from open3d.io import read_point_cloud # even if import * works, this line could fail
from open3d import *
| 0 | 0 | 0 | 0 | 0 | 0 |
mmrotate/datasets/dota.py | open-mmlab/mmrotate | 449 | 1746465 | # Copyright (c) OpenMMLab. All rights reserved.
from __future__ import annotations
import glob
import os
import os.path as osp
import re
import tempfile
import time
import zipfile
from collections import defaultdict
from functools import partial
import mmcv
import numpy as np
import torch
from mmcv.ops import nms_rota... | 12 | 8 | 2 | 0 | 22 | 0 |
python/058_Length_of_Last_Word.py | dvlpsh/leetcode-1 | 4,416 | 1746477 | <gh_stars>1000+
class Solution(object):
def lengthOfLastWord(self, s):
"""
:type s: str
:rtype: int
"""
if len(s) == 0:
return 0
temp = s.split(' ')
temp = [t for t in temp if len(t) > 0]
if len(temp) == 0:
return 0
else... | 0 | 0 | 0 | 0 | 0 | 0 |
src/pytorch_adapt/validators/class_cluster_validator.py | KevinMusgrave/pytorch-adapt | 131 | 1746479 | <reponame>KevinMusgrave/pytorch-adapt<filename>src/pytorch_adapt/validators/class_cluster_validator.py
import numpy as np
import torch
from sklearn.cluster import KMeans
from sklearn.decomposition import PCA
from sklearn.metrics import adjusted_mutual_info_score
from ..utils import common_functions as c_f
from . impor... | 0 | 0 | 0 | 0 | 0 | 0 |
overholt/api/users.py | prdonahue/overholt | 1,152 | 1746480 | <reponame>prdonahue/overholt
# -*- coding: utf-8 -*-
"""
overholt.api.users
~~~~~~~~~~~~~~~~~~
User endpoints
"""
from flask import Blueprint
from flask_login import current_user
from ..services import users
from . import route
bp = Blueprint('users', __name__, url_prefix='/users')
@route(bp, '/')
def... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/boost_motor_position.py | ElTentakel/bricknil | 103 | 1746515 | import logging
from curio import sleep, Queue
from bricknil import attach, start
from bricknil.hub import PoweredUpRemote, BoostHub
from bricknil.sensor import InternalMotor, RemoteButtons, LED, Button, ExternalMotor
from bricknil.process import Process
from bricknil.const import Color
from random import randint
@at... | 0 | 0 | 0 | 0 | 0 | 0 |
bitshares/utils.py | silverchen0402/python-bitshares | 102 | 1746527 | # -*- coding: utf-8 -*-
from .exceptions import ObjectNotInProposalBuffer
from .instance import BlockchainInstance
# Load methods from graphene and provide them to bitshares
from graphenecommon.utils import (
formatTime,
timeFormat,
formatTimeString,
formatTimeFromNow,
parse_time,
assets_from_s... | 0 | 0 | 0 | 0 | 0 | 0 |
pylibs/benchmarking/download_benchmarks/download_benchmarks.py | famousyub/smartyphp | 359 | 1746544 | #!/usr/bin/env python
##############################################################################
# Copyright 2017-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.
################################... | 0 | 4 | 0 | 1 | 5 | 0 |
tests/unit/test_stream.py | Aspire1Inspire2/td-ameritrade-python-api | 610 | 1746552 | <gh_stars>100-1000
import unittest
from datetime import datetime
from datetime import timedelta
from unittest import TestCase
from configparser import ConfigParser
from td.client import TDClient
from td.stream import TDStreamerClient
class TDSession(TestCase):
"""Will perform a unit test for the TD session."""
... | 0 | 0 | 0 | 0 | 0 | 0 |
graph_embedding/simulations/sbm_simulator_test.py | xxdreck/google-research | 23,901 | 1746569 | <reponame>xxdreck/google-research<gh_stars>1000+
# coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lic... | 0 | 0 | 0 | 0 | 0 | 0 |
cut_twist_process/cut_twist_join.py | ericosmic/2019-CCF-BDCI-OCR-MCZJ-OCR-IdentificationIDElement | 886 | 1746575 | # -*- coding: utf-8 -*-
# @Time : 19-11-19 22:10
# @Author : <NAME>
# @Reference : None
# @File : cut_twist_join.py
# @IDE : PyCharm Community Edition
"""
将身份证正反面从原始图片中切分出来,如果方向不正确则旋转。使用传统图像处理方法实现。
需要的参数有:
1.图片所在路径。
2.图片处理结果保存路径
输出结果为:
切分和旋转后的身份证正反面图片。
对于图片A.jpg,... | 0 | 2 | 0 | 0 | 2 | 0 |
nlpcda/config.py | blmoistawinde/nlpcda | 959 | 1746588 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
root_path = os.path.abspath(os.path.dirname(__file__))
data_path = os.path.join(root_path, 'data')
homophone_path = os.path.join(data_path, '同音意字.txt')
Equivalent_char_path = os.path.join(data_path, '等价字.txt')
similarword_path = os.path.join(data_path, '同义词.txt')
co... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_formtype_model.py | MasterScott/Formasaurus | 132 | 1746617 | <filename>tests/test_formtype_model.py<gh_stars>100-1000
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division
import itertools
from sklearn.metrics import accuracy_score
from formasaurus.formtype_model import get_realistic_form_labels
def test_get_realistic_formtypes(storage):
annotations = ... | 0 | 0 | 0 | 0 | 0 | 0 |
python/perspective/perspective/core/_version.py | finos/perspective | 2,436 | 1746639 | <reponame>finos/perspective<gh_stars>1000+
__version__ = "1.0.0"
major_minor_version = "1.0"
| 0 | 0 | 0 | 0 | 0 | 0 |
jaxopt/_src/armijo_sgd.py | GeoffNN/jaxopt | 434 | 1746667 | <gh_stars>100-1000
# 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 agr... | 0 | 0 | 0 | 0 | 0 | 0 |
models/scan.py | ZGSLZL/LGSC-for-FAS | 195 | 1746678 | from __future__ import annotations
import paddle.fluid as fluid
import paddle.fluid.dygraph.nn as nn
import paddle.fluid.layers as L
from utils import ConvModule, model_size
from models.resnet import ResNet, BasicBlock, make_res_layer
from models.triple_loss import TripletLoss
class DeCoder(fluid.dygraph.Layer):
... | 12 | 3 | 0 | 3 | 18 | 0 |
spotdl/encode/tests/test_encode_base.py | khjxiaogu/spotify-downloader | 4,698 | 1746680 | from spotdl.encode import EncoderBase
from spotdl.encode.exceptions import EncoderNotFoundError
import pytest
class TestAbstractBaseClass:
def test_error_abstract_base_class_encoderbase(self):
encoder_path = "ffmpeg"
_loglevel = "-hide_banner -nostats -v panic"
_additional_arguments = ["-b... | 0 | 1 | 0 | 0 | 1 | 0 |
dockerscan/actions/image/modifiers/api.py | michalkoczwara/dockerscan | 1,286 | 1746690 | <reponame>michalkoczwara/dockerscan
import json
import os.path
import logging
from contextlib import contextmanager
from dockerscan import DockerscanReturnContextManager
from .model import *
from ..docker_api import *
log = logging.getLogger("dockerscan")
REMOTE_SHELL_PATH = "/usr/share/lib/reverse_shell.so"
def r... | 0 | 0 | 0 | 0 | 0 | 0 |
utils/utils_bbox.py | wangjun-creat/yolo3-pytorch | 1,336 | 1746707 | import torch
import torch.nn as nn
from torchvision.ops import nms
import numpy as np
class DecodeBox():
def __init__(self, anchors, num_classes, input_shape, anchors_mask: list[list[int]] = [[6,7,8], [3,4,5], [0,1,2]]):
super(DecodeBox, self).__init__()
self.anchors = anchors
... | 3 | 3 | 0 | 0 | 6 | 0 |
orator/query/grammars/postgres_grammar.py | wjzero/orator | 1,484 | 1746708 | <gh_stars>1000+
# -*- coding: utf-8 -*-
from .grammar import QueryGrammar
from ...utils import basestring
class PostgresQueryGrammar(QueryGrammar):
_operators = [
"=",
"<",
">",
"<=",
">=",
"<>",
"!=",
"like",
"not like",
"between",... | 0 | 0 | 0 | 0 | 0 | 0 |
apps/challenges/migrations/0001_initial.py | kaustubh-s1/EvalAI | 1,470 | 1746709 | <filename>apps/challenges/migrations/0001_initial.py
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-11-28 04:11
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies ... | 0 | 0 | 0 | 0 | 0 | 0 |
integration/common/tests/great_expectations/test_great_expectations_validation_action.py | tomassatka/OpenLineage | 746 | 1746713 | <gh_stars>100-1000
import json
import os
import sqlite3
import tempfile
import pandas
import pytest
from great_expectations.core import ExpectationSuiteValidationResult, \
ExpectationValidationResult, ExpectationConfiguration
from great_expectations.data_context import BaseDataContext
from great_expectations.data_... | 0 | 0 | 0 | 0 | 0 | 0 |
annotator/kcftracker/fhog.py | korabelnikov/eva | 114 | 1746719 | <gh_stars>100-1000
import numpy as np
import cv2
import math
from .fhog_utils import map_points_to_bins, aggregate_to_hog_feature_map, create_normalized_features, hog_pca
# constant
NUM_SECTOR = 9
FLT_EPSILON = 0.0000001 # To not have division by zero
def compile_fhog():
import glob
import os
try:
... | 0 | 0 | 0 | 0 | 0 | 0 |
manila/share/access.py | openstack/manila | 159 | 1746723 | # Copyright (c) 2015 Mirantis 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 require... | 16 | 13 | 0 | 0 | 29 | 0 |
awacs/workspaces.py | michael-k/awacs | 358 | 1746780 | <filename>awacs/workspaces.py
# Copyright (c) 2012-2021, <NAME> <<EMAIL>>
# All rights reserved.
#
# See LICENSE file for full license.
from .aws import Action as BaseAction
from .aws import BaseARN
service_name = "Amazon WorkSpaces"
prefix = "workspaces"
class Action(BaseAction):
def __init__(self, action: str... | 0 | 0 | 0 | 0 | 0 | 0 |
deprecated/benchmark.py | Pandinosaurus/VNect | 220 | 1746781 | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
from __future__ import annotations
import cv2
import time
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d
from src import utils
from src.OneEuroFilter import OneEuroFilter
class VNectEstimator:
def __init__... | 2 | 0 | 0 | 11 | 13 | 0 |
mmdeploy/codebase/mmrotate/core/bbox/__init__.py | grimoire/mmdeploy | 746 | 1746800 | <gh_stars>100-1000
# Copyright (c) OpenMMLab. All rights reserved.
from .delta_midpointoffset_rbbox_coder import * # noqa: F401,F403
from .delta_xywha_rbbox_coder import * # noqa: F401,F403
| 0 | 0 | 0 | 0 | 0 | 0 |
dp/cloud/python/magma/mappings/types.py | nstng/magma | 539 | 1746801 | """
Copyright 2021 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... | 0 | 0 | 33 | 0 | 33 | 0 |
redbot/syntax/rfc7231.py | gusdleon/redbot | 167 | 1746802 | <reponame>gusdleon/redbot
# pylint: disable=line-too-long, unused-import
"""
Regex for RFC7231
These regex are directly derived from the collected ABNF in RFC7231.
<http://httpwg.org/specs/rfc7231.html#collected.abnf>
They should be processed with re.VERBOSE.
"""
from .rfc3986 import URI_reference, absolute_URI
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/nnapi/specs/V1_0/mul_float_square_nnfw.mod.py | periannath/ONE | 255 | 1746821 | # model
model = Model()
i1 = Input("op1", "TENSOR_FLOAT32", "{1, 2, 2, 1}")
act = Int32Scalar("act", 0) # an int32_t scalar fuse_activation
i3 = Output("op3", "TENSOR_FLOAT32", "{1, 2, 2, 1}")
model = model.Operation("MUL", i1, i1, act).To(i3)
# Example 1. Input in operand 0,
input0 = {i1: # input 0
[2, -4, ... | 0 | 0 | 0 | 0 | 0 | 0 |
src/models/dpg.py | sieumap43/GazeML | 445 | 1746827 | from __future__ import annotations
"""Deep Pictorial Gaze architecture."""
from typing import Dict
import numpy as np
import scipy
import tensorflow as tf
from core import BaseDataSource, BaseModel
from datasources import UnityEyes
import util.gaze
class DPG(BaseModel):
"""Deep Pictorial Gaze architecture as in... | 16 | 13 | 10 | 0 | 39 | 0 |
teether/__init__.py | s-mallow/teether-erc20 | 102 | 1746836 | <reponame>s-mallow/teether-erc20<gh_stars>100-1000
from . import cfg
from . import constraints
from . import evm
from . import exploit
from . import explorer
from . import memory
from . import project
from . import slicing
from . import util
| 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.