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 |
|---|---|---|---|---|---|---|---|---|---|---|
domi_owned/hashdump.py | symsal/domi-owned | 106 | 1735745 | # Copyright (c) 2017, <NAME> [coldfusion]
#
# 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... | 0 | 1 | 0 | 0 | 1 | 0 |
tests/test_tools.py | zwgtdev/pdf_reports | 158 | 1735775 | import pdf_reports.tools as tools
import pandas
dataframe = pandas.DataFrame.from_records(
{
"Name": ["Anna", "Bob", "Claire", "Denis"],
"Age": [12, 22, 33, 44],
"Height (cm)": [140, 175, 173, 185],
},
columns=["Name", "Age", "Height (cm)"],
)
def test_tr_modifier():
html = to... | 0 | 0 | 0 | 0 | 0 | 0 |
rasa/core/channels/__init__.py | fintzd/rasa | 9,701 | 1735784 | from typing import Text, Dict, List, Type
from rasa.core.channels.channel import ( # noqa: F401
InputChannel,
OutputChannel,
UserMessage,
CollectingOutputChannel,
)
# this prevents IDE's from optimizing the imports - we need to import the
# above first, otherwise we will run into import cycles
from r... | 0 | 0 | 2 | 0 | 2 | 0 |
zeus/web/views/index.py | conrad-kronos/zeus | 221 | 1735788 | <filename>zeus/web/views/index.py
from flask import current_app, render_template
def index(path=None):
return render_template(
"index.html",
**{
"PUBSUB_ENDPOINT": current_app.config.get("PUBSUB_ENDPOINT") or "",
"SENTRY_DSN_FRONTEND": current_app.config.get("SENTRY_DSN_FRO... | 0 | 0 | 0 | 0 | 0 | 0 |
test/functional/wallet_address_types.py | Kuosumi/XSN | 107 | 1735810 | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test that the wallet can send and receive using all combinations of address types.
There are 5 nodes-under-... | 1 | 1 | 0 | 0 | 2 | 0 |
src/django-nonrel/django/contrib/gis/tests/test_spatialrefsys.py | adamjmcgrath/glancydesign | 790 | 1735813 | from django.db import connection
from django.contrib.gis.gdal import GDAL_VERSION
from django.contrib.gis.tests.utils import mysql, no_mysql, oracle, postgis, spatialite
from django.utils import unittest
test_srs = ({'srid' : 4326,
'auth_name' : ('EPSG', True),
'auth_srid' : 4326,
... | 1 | 1 | 0 | 0 | 2 | 0 |
docs/atelier-schemes/output/pygments/base16-atelierestuary.light.py | atelierbram/syntax-highlighting | 110 | 1735825 | # -*- coding: utf-8 -*-
"""
Base16 Atelier Estuary Light
by <NAME> (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/estuary)
Pygments template by <NAME> (https://github.com/idleberg)
Created with Base16 Builder by <NAME> (https://github.com/chriskempson/base16-builder)
"""
from pygments.style import ... | 0 | 0 | 2 | 0 | 2 | 0 |
utils/func.py | BiggerBinBin/e3d_handpose_x-master | 158 | 1735839 | <gh_stars>100-1000
from torchvision.transforms.functional import *
def batch_denormalize(tensor, mean, std, inplace=False):
"""Normalize a tensor image with mean and standard deviation.
.. note::
This transform acts out_testset of place by default, i.e., it does not mutates the input tensor.
See... | 0 | 0 | 0 | 0 | 0 | 0 |
exchangelib/folders/base.py | RossK1/exchangelib | 1,006 | 1735843 | from __future__ import annotations
import abc
import logging
from fnmatch import fnmatch
from operator import attrgetter
from .collections import FolderCollection, SyncCompleted
from .queryset import SingleFolderQuerySet, SHALLOW as SHALLOW_FOLDERS, DEEP as DEEP_FOLDERS
from ..errors import ErrorAccessDenied, ErrorFol... | 26 | 55 | 9 | 1 | 91 | 0 |
datalad/interface/tests/test_download_url.py | psychoinformatics-de/datalad | 298 | 1735865 | <filename>datalad/interface/tests/test_download_url.py
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
# ex: set sts=4 ts=4 sw=4 noet:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package... | 0 | 0 | 0 | 0 | 0 | 0 |
cdlib/test/test_attributeclustering.py | dongoknam/cdlib | 248 | 1735889 | <reponame>dongoknam/cdlib
import unittest
from cdlib import algorithms
import networkx as nx
import random
class AttrCommunityDiscoveryTests(unittest.TestCase):
def test_eva(self):
l1 = ["one", "two", "three", "four"]
l2 = ["A", "B", "C"]
g = nx.barabasi_albert_graph(100, 5)
label... | 0 | 0 | 0 | 0 | 0 | 0 |
models/ops/l2_loss.py | rs9899/Parsing-R-CNN | 289 | 1735916 | import torch
def l2_loss(input, target) -> object:
"""
very similar to the smooth_l1_loss from pytorch, but with
the extra beta parameter
"""
pos_inds = torch.nonzero(target > 0.0).squeeze(1)
if pos_inds.shape[0] > 0:
cond = torch.abs(input[pos_inds] - target[pos_inds])
loss = ... | 0 | 1 | 0 | 0 | 1 | 0 |
Interaction/Widgets/Testing/Python/TestCameraOrientationWidget.py | cclauss/VTK | 1,755 | 1735917 | <filename>Interaction/Widgets/Testing/Python/TestCameraOrientationWidget.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
=========================================================================
Program: Visualization Toolkit
Module: TestNamedColorsIntegration.py
Copyright (c) <NAME>, <NAME>, <NAME>
... | 0 | 0 | 0 | 0 | 0 | 0 |
docs/conf.py | hero9968/scikit-neuralnetwork | 1,375 | 1735934 | # -*- coding: utf-8 -*-
#
# scikit-neuralnetwork documentation build configuration file, created by
# sphinx-quickstart on Tue Mar 31 20:28:10 2015.
import sys
import os
project = u'scikit-neuralnetwork'
copyright = u'2015, scikit-neuralnetwork developers (BSD License)'
# -- Configuration of documentation --------... | 0 | 1 | 0 | 0 | 1 | 0 |
research/object_detection/utils/visualization_utils_test.py | hamediramin/ObjectDetectionAPI | 3,326 | 1735941 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 0 | 1 | 0 | 0 | 1 | 0 |
data.py | WebisD/long-summarization | 176 | 1735946 | <filename>data.py
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
# Modifications Copyright 2017 <NAME>
# Modifications Copyright 2018 <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 th... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/pot/openvino/tools/pot/algorithms/quantization/fake_quantize.py | akhakimova/openvino | 2,406 | 1735957 | <gh_stars>1000+
# Copyright (C) 2020-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from copy import copy, deepcopy
import numpy as np
from addict import Dict
from .fake_quantize_configuration import read_all_fake_quantize_configurations, get_configurations_by_preset, \
get_configurations_by_qschem... | 0 | 0 | 0 | 0 | 0 | 0 |
Hash Table/447. Number of Boomerangs.py | beckswu/Leetcode | 138 | 1735961 | <gh_stars>100-1000
"""
447. Number of Boomerangs
Input:
[[0,0],[1,0],[2,0]]
Output:
2
Explanation:
The two boomerangs are [[1,0],[0,0],[2,0]] and [[1,0],[2,0],[0,0]]
"""
class Solution:
def numberOfBoomerangs(self, points):
"""
:type points: List[List[int]]
:rtype: i... | 0 | 0 | 0 | 0 | 0 | 0 |
loginas/urls.py | Microdisseny/django-loginas | 234 | 1735972 | <filename>loginas/urls.py
from django.urls import path
from loginas.views import user_login, user_logout
urlpatterns = [
path("login/user/<str:user_id>/", user_login, name="loginas-user-login"),
path("logout/", user_logout, name="loginas-logout"),
]
| 0 | 0 | 0 | 0 | 0 | 0 |
pepper_variant/modules/python/models/predict_distributed_gpu.py | kishwarshafin/pepper | 155 | 1735973 | import sys
import os
import torch
import torch.distributed as dist
import torch.nn as nn
from torch.utils.data import DataLoader
import torch.multiprocessing as mp
from torch.nn.parallel import DataParallel
from datetime import datetime
from pepper_variant.modules.python.models.dataloader_predict import SequenceDatase... | 0 | 0 | 0 | 0 | 0 | 0 |
lib/layers/container.py | minhtannguyen/ffjord | 518 | 1735974 | from __future__ import annotations
import torch.nn as nn
class SequentialFlow(nn.Module):
"""A generalized nn.Sequential container for normalizing flows.
"""
def __init__(self, layersList):
super(SequentialFlow, self).__init__()
self.chain = nn.ModuleList(layersList)
def forward(self... | 3 | 1 | 0 | 0 | 4 | 0 |
tests/python/relay/aot/test_crt_aot.py | pansn1995/tvm | 2,084 | 1735984 | # 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 u... | 0 | 0 | 0 | 0 | 0 | 0 |
Lib/site-packages/django/template/loader.py | ashutoshsuman99/Web-Blog-D19 | 123 | 1735998 | <filename>Lib/site-packages/django/template/loader.py<gh_stars>100-1000
import warnings
from django.utils import six
from django.utils.deprecation import (
DeprecationInstanceCheck, RemovedInDjango20Warning,
RemovedInDjango110Warning,
)
from . import engines
from .backends.django import DjangoTemplates
from .... | 0 | 0 | 0 | 0 | 0 | 0 |
pyshopee2/public.py | tjengbudi/python-shopee | 166 | 1736042 | from .base import BaseModule
class Public(BaseModule):
def get_shop_by_partner(self, **kwargs) -> object:
"""
:param kwargs
:return
"""
return self.client.execute("public/get_shop_by_partner", "GET", kwargs) | 0 | 1 | 0 | 0 | 1 | 0 |
homeassistant/components/ring/light.py | domwillcode/home-assistant | 22,481 | 1736048 | """This component provides HA switch support for Ring Door Bell/Chimes."""
from datetime import timedelta
import logging
import requests
from homeassistant.components.light import LightEntity
from homeassistant.core import callback
import homeassistant.util.dt as dt_util
from . import DOMAIN
from .entity import Ring... | 0 | 5 | 0 | 0 | 5 | 0 |
alipay/aop/api/response/AlipayUserIdenticalAuthbaseQueryResponse.py | snowxmas/alipay-sdk-python-all | 213 | 1736052 | <reponame>snowxmas/alipay-sdk-python-all<filename>alipay/aop/api/response/AlipayUserIdenticalAuthbaseQueryResponse.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayUserIdenticalAuthbaseQueryResponse(AlipayResponse):
def __... | 0 | 0 | 0 | 0 | 0 | 0 |
tensorflow/python/kernel_tests/batch_gather_op_test.py | abhaikollara/tensorflow | 848 | 1736099 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 0 | 1 | 0 | 0 | 1 | 0 |
data_collection/gazette/spiders/sc_monte_castelo.py | kaiocp/querido-diario | 454 | 1736139 | <reponame>kaiocp/querido-diario
from gazette.spiders.base.fecam import FecamGazetteSpider
class ScMonteCasteloSpider(FecamGazetteSpider):
name = "sc_monte_castelo"
FECAM_QUERY = "cod_entidade:170"
TERRITORY_ID = "4211108"
| 0 | 0 | 0 | 0 | 0 | 0 |
var/spack/repos/builtin/packages/py-geocube/package.py | LiamBindle/spack | 2,360 | 1736148 | # 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 PyGeocube(PythonPackage):
"""Tool to convert geopandas vector data into rasterized xarray ... | 0 | 0 | 3 | 0 | 3 | 0 |
Lib/importlib/resources.py | pxeger/cpython | 5,926 | 1736155 | import os
import io
from . import _common
from ._common import as_file, files
from .abc import ResourceReader
from contextlib import suppress
from importlib.abc import ResourceLoader
from importlib.machinery import ModuleSpec
from io import BytesIO, TextIOWrapper
from pathlib import Path
from types import ModuleType
f... | 17 | 12 | 0 | 0 | 29 | 0 |
src/algo/processor.py | jumperavocado/staketaxcsv | 140 | 1736173 | import logging
import urllib.parse
from datetime import datetime
from algo import constants as co
from algo.asset import Algo
from algo.config_algo import localconfig
from algo.handle_akita import handle_akita_swap_transaction, is_akita_swap_transaction
from algo.handle_algodex import handle_algodex_transaction, is_al... | 0 | 3 | 0 | 0 | 3 | 0 |
tests/pytests/unit/beacons/test_smartos_vmadm.py | tomdoherty/salt | 9,425 | 1736194 | <filename>tests/pytests/unit/beacons/test_smartos_vmadm.py
# Python libs
import pytest
# Salt libs
import salt.beacons.smartos_vmadm as vmadm
from tests.support.mock import MagicMock, patch
@pytest.fixture
def configure_loader_modules():
return {vmadm: {"__context__": {}, "__salt__": {}}}
@pytest.fixture
def m... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/models_master.py | rickiepark/keras-io | 1,542 | 1736211 |
MODELS_MASTER = {
'path': 'models/',
'title': 'Models API', # TODO
'toc': True,
'children': [
{
'path': 'model',
'title': 'The Model class', # TODO
'generate': [
'tensorflow.keras.Model',
'tensorflow.keras.Model.summary',
... | 0 | 0 | 0 | 0 | 0 | 0 |
kws_streaming/models/xception.py | DionysisChristopoulos/google-research | 23,901 | 1736253 | <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/licenses/LICENSE-2.0
#
# Unless requ... | 0 | 0 | 0 | 0 | 0 | 0 |
modules/show_diff.py | yuki1318/GitGutter | 1,866 | 1736262 | from __future__ import annotations
import sublime
class GitGutterShowDiff(object):
region_names: tuple[str, str, str, str, str, str, str] = ('deleted_top', 'deleted_bottom', 'deleted_dual',
'inserted', 'changed', 'untracked', 'ignored')
def __init__(self, git_handler, status_bar):
... | 1 | 7 | 1 | 4 | 13 | 0 |
mitmproxy/contrib/kaitaistruct/gif.py | 0x7c48/mitmproxy | 24,939 | 1736265 | <reponame>0x7c48/mitmproxy<gh_stars>1000+
# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
import array
import struct
import zlib
from enum import Enum
from pkg_resources import parse_version
from kaitaistruct import __version__ as ks_version, KaitaiStruct, KaitaiStre... | 0 | 0 | 0 | 0 | 0 | 0 |
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/generate_pipeline_stacks.py | StewartW/aws-deployment-framework | 490 | 1736279 | #!/usr/bin/env python3
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
"""This file is pulled into CodeBuild containers
and used to build the pipeline cloudformation stacks via the AWS CDK
"""
import glob
import os
import json
# CDK Specific
from aws_cdk... | 0 | 0 | 0 | 0 | 0 | 0 |
packages/core/minos-microservice-aggregate/tests/test_aggregate/test_snapshots/test_repositories/test_database.py | minos-framework/minos-python | 247 | 1736293 | <reponame>minos-framework/minos-python<filename>packages/core/minos-microservice-aggregate/tests/test_aggregate/test_snapshots/test_repositories/test_database.py<gh_stars>100-1000
import unittest
from itertools import (
chain,
cycle,
)
from unittest.mock import (
MagicMock,
patch,
)
from minos.aggregat... | 0 | 0 | 0 | 0 | 0 | 0 |
wxStocks_modules/wxStocks_default_functions/wxStocks_default_custom_analysis_spreadsheet_builder.py | scoofy/wxStocks | 211 | 1736298 | from __future__ import annotations
import os, glob, config, logging
from wxStocks_modules.wxStocks_classes import SpreadsheetCell as Cell
'''
Here, you must use the class "Cell" to refer to a cell you want processed.
This allows the program to process your data in to function wxPython code.
The class Cell has the follo... | 8 | 8 | 0 | 2 | 18 | 0 |
OmniMarkupLib/Renderers/libs/python3/docutils/transforms/universal.py | henumohe/OmniMarkupPreviewer | 476 | 1736303 | # $Id$
# -*- coding: utf8 -*-
# Authors: <NAME> <<EMAIL>>; <NAME>; <NAME>
# Maintainer: <EMAIL>
# Copyright: This module has been placed in the public domain.
from __future__ import annotations
"""
Transforms needed by most or all documents:
- `Decorations`: Generate a document's header & footer.
- `Messages`: Placem... | 0 | 6 | 8 | 1 | 15 | 0 |
kinto/core/storage/postgresql/client.py | vincentfretin/kinto | 4,618 | 1736336 | <reponame>vincentfretin/kinto
import contextlib
import logging
import warnings
from collections import defaultdict
import transaction as zope_transaction
from kinto.core.storage import exceptions
from kinto.core.utils import sqlalchemy
logger = logging.getLogger(__name__)
BLACKLISTED_SETTINGS = [
"backend",
... | 0 | 0 | 0 | 0 | 0 | 0 |
pyx12/scripts/x12valid.py | azoner/pyx12 | 120 | 1736338 | #!/usr/bin/env python
######################################################################
# Copyright (c)
# <NAME> <<EMAIL>>
# All rights reserved.
#
# This software is licensed as described in the file LICENSE.txt, which
# you should have received as part of this distribution.
#
#################################... | 0 | 2 | 0 | 0 | 2 | 0 |
lit_nlp/examples/models/pretrained_lms_int_test.py | eichinflo/lit | 2,854 | 1736343 | <reponame>eichinflo/lit
"""Integration tests for pretrained_lms."""
from absl.testing import absltest
from lit_nlp.examples.models import pretrained_lms
class PretrainedLmsIntTest(absltest.TestCase):
"""Test that model classes can predict."""
def test_bertmlm(self):
# Run prediction to ensure no failure.
... | 0 | 0 | 0 | 0 | 0 | 0 |
facedancer/backends/MAXUSBApp.py | hugmyndakassi/Facedancer | 345 | 1736369 | <reponame>hugmyndakassi/Facedancer
# MAXUSBApp.py
#
# Contains class definition for MAXUSBApp.
import time
from ..core import FacedancerApp
from ..USB import *
from ..USBDevice import USBDeviceRequest
class MAXUSBApp(FacedancerApp):
reg_ep0_fifo = 0x00
reg_ep1_out_fifo = 0x0... | 0 | 0 | 0 | 0 | 0 | 0 |
ui/editingapp.py | JingfengRong/editnerf | 176 | 1736379 | <reponame>JingfengRong/editnerf
import copy
import os
import torch
import numpy as np
import imageio
from torch.nn import functional as F
from torchvision import utils, transforms
from PIL import Image
from ui_utils import renormalize, show, labwidget, paintwidget, mean_colors
from rendering import render_path, rende... | 0 | 0 | 0 | 0 | 0 | 0 |
kubernetes_py/models/v2alpha1/CronJob.py | Venkat1729/kubernetes-py | 129 | 1736388 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is subject to the terms and conditions defined in
# file 'LICENSE.md', which is part of this source code package.
#
from __future__ import annotations
from kubernetes_py.models.unversioned.BaseModel import BaseModel
from kubernetes_py.models.v1.ObjectMeta im... | 4 | 3 | 0 | 2 | 9 | 0 |
great_expectations/profile/multi_batch_validation_meta_analysis.py | joshuataylor/great_expectations | 6,451 | 1736396 | <reponame>joshuataylor/great_expectations<gh_stars>1000+
# import logging
# from collections import defaultdict
# import collections
#
# import warnings
# from great_expectations.datasource.types import BatchKwargs
# from great_expectations.profile.metrics_store import MetricsStore
# from great_expectations.profile.met... | 0 | 0 | 0 | 0 | 0 | 0 |
hanlp/datasets/lm/lm_dataset.py | housemecn/HanLP | 27,208 | 1736397 | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2020-06-05 21:42
from __future__ import annotations
import os
from typing import Union, Callable, List
import torch
import hanlp_common.io
from hanlp.common.dataset import TransformSequentialDataset
from hanlp.common.transform import ToChar, WhitespaceTokenizer, AppendE... | 8 | 8 | 0 | 3 | 19 | 0 |
optuna/samplers/_partial_fixed.py | agarwalrounak/optuna | 4,950 | 1736399 | from typing import Any
from typing import Dict
from typing import Optional
from typing import Sequence
import warnings
from optuna._experimental import experimental
from optuna.distributions import BaseDistribution
from optuna.samplers import BaseSampler
from optuna.study import Study
from optuna.trial import FrozenTr... | 15 | 6 | 0 | 0 | 21 | 0 |
pygithub3/services/repos/commits.py | teamorchard/python-github3 | 107 | 1736401 | # -*- encoding: utf-8 -*-
from __future__ import annotations
from pygithub3.services.base import Service, MimeTypeMixin
class Commits(Service, MimeTypeMixin):
""" Consume `Commits API
<http://developer.github.com/v3/repos/commits>`_
.. note::
This service support :ref:`mimetypes-section` configu... | 19 | 7 | 0 | 0 | 26 | 0 |
rep/data/storage.py | HolyBayes/rep | 726 | 1736406 | <reponame>HolyBayes/rep
"""
This is a wrapper for `pandas.DataFrame`, which allows you to define dataset (data, labels/values, sample weights) for an estimator in a simple way.
"""
from __future__ import division, print_function, absolute_import
import numbers
from numpy.random.mtrand import RandomState
import pandas
... | 0 | 0 | 0 | 0 | 0 | 0 |
env/lib/python3.6/site-packages/numpy/distutils/lib2def.py | anthowen/duplify | 652 | 1736438 | <reponame>anthowen/duplify
from __future__ import division, absolute_import, print_function
import re
import sys
import os
import subprocess
__doc__ = """This module generates a DEF file from the symbols in
an MSVC-compiled DLL import library. It correctly discriminates between
data and functions. The data is colle... | 0 | 0 | 0 | 0 | 0 | 0 |
setup.py | seraveea/ChineseWordSegmentation | 511 | 1736453 | <filename>setup.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import pkg_resources
from setuptools import setup, find_packages
import os
import codecs
import re
import sys
def read(*parts):
path ... | 0 | 0 | 0 | 0 | 0 | 0 |
venv/Lib/site-packages/statsmodels/sandbox/distributions/tests/_est_fit.py | EkremBayar/bayar | 6,931 | 1736456 | # NOTE: contains only one test, _est_cont_fit, that is renamed so that
# the test runner does not run it
# I put this here for the record and for the case when someone wants to
# verify the quality of fit
# with current parameters: relatively small sample size, default starting values
# Ran 84 tests in 401.... | 0 | 0 | 0 | 0 | 0 | 0 |
plaso/serializer/interface.py | pyllyukko/plaso | 1,253 | 1736467 | <reponame>pyllyukko/plaso
# -*- coding: utf-8 -*-
"""The serializer object interfaces."""
import abc
# Since abc does not seem to have an @abc.abstractclassmethod we're using
# @abc.abstractmethod instead and shutting up pylint about:
# E0213: Method should have "self" as first argument.
# pylint: disable=no-self-ar... | 0 | 0 | 0 | 0 | 0 | 0 |
quantpy/gui/app.py | jsmidt/QuantPy | 216 | 1736477 | <reponame>jsmidt/QuantPy
import os
import sys
# 3rd party
from gi.repository import Gio, Gtk
from matplotlib.backends.backend_gtk3cairo import FigureCanvasGTK3Cairo as\
FigureCanvas
from matplotlib.figure import Figure
import pandas as pd
import pylab as pl
import quantpy as qp
DATA_DIR = os.path.join(os.path.di... | 0 | 0 | 0 | 0 | 0 | 0 |
rl/envs/blackjack.py | fancyerii/blog-codes | 159 | 1736488 | from __future__ import annotations
import gym
from gym import spaces
from gym.utils import seeding
def cmp(a, b) -> object:
return int((a > b)) - int((a < b))
# 1 = Ace, 2-10 = Number cards, Jack/Queen/King = 10
deck = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10]
def draw_card(np_random) -> object:
return np... | 2 | 12 | 0 | 1 | 15 | 0 |
blackbox/testutils/ports.py | autophagy/crate | 3,066 | 1736490 | # Licensed to Crate.io GmbH ("Crate") under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. Crate licenses
# this file to you under the Apache License, Version 2.0 (the "License");
# you may not use this file exce... | 4 | 3 | 0 | 0 | 7 | 0 |
pook/__init__.py | astagi/pook | 304 | 1736518 | from .api import * # noqa
from .api import __all__ as api_exports
# Delegate to API export
__all__ = api_exports
# Package metadata
__author__ = '<NAME>'
__license__ = 'MIT'
# Current version
__version__ = '1.0.2'
| 0 | 0 | 0 | 0 | 0 | 0 |
examples/compare_gaussian_methods.py | ozert/semisup-learn | 531 | 1736519 | import numpy as np
from frameworks.CPLELearning import CPLELearningModel
from frameworks.SelfLearning import SelfLearningModel
from methods.scikitWQDA import WQDA
from examples.plotutils import evaluate_and_plot
# number of data points
N = 60
supevised_data_points = 4
# generate data
meandistance = 1
s = np.random.... | 0 | 0 | 0 | 0 | 0 | 0 |
rl_coach/run_multiple_seeds.py | Lpallett4/coach | 1,960 | 1736522 | #
# Copyright (c) 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 0 | 0 | 0 | 0 | 0 | 0 |
numba/tests/test_typedlist.py | auderson/numba | 6,620 | 1736553 | <reponame>auderson/numba
import sys
import subprocess
from itertools import product
from textwrap import dedent
import numpy as np
from numba import config
from numba import njit
from numba import int32, float32, prange
from numba.core import types
from numba import typeof
from numba.typed import List, Dict
from numb... | 0 | 0 | 0 | 0 | 0 | 0 |
aws_lambda_powertools/utilities/feature_flags/schema.py | nayaverdier/aws-lambda-powertools-python | 1,208 | 1736592 | import logging
from enum import Enum
from typing import Any, Dict, List, Optional, Union
from ... import Logger
from .base import BaseValidator
from .exceptions import SchemaValidationError
RULES_KEY = "rules"
FEATURE_DEFAULT_VAL_KEY = "default"
CONDITIONS_KEY = "conditions"
RULE_MATCH_VALUE = "when_match"
CONDITION_... | 21 | 3 | 14 | 2 | 40 | 0 |
tools/polly/bin/detail/get_nmake_environment.py | Kondr11/LABA7 | 861 | 1736607 | # Copyright (c) 2014, <NAME>
# All rights reserved.
import detail.util
import os
import sys
def get(arch, vs_version) -> object:
vs_path_env = 'VS{}0COMNTOOLS'.format(vs_version)
vs_path = os.getenv(vs_path_env)
if not vs_path:
sys.exit(
'Environment variable {} is empty, '
'looks like Visua... | 0 | 1 | 0 | 0 | 1 | 0 |
src/lib/evaluate/model_analysis_v4_coco.py | EvelynYihuiYang/MCMOT | 306 | 1736628 | <reponame>EvelynYihuiYang/MCMOT
import os
import darknet as dn
import cv2
import time
import numpy
import copy
import cmp_det_label as cdl
from readAndSaveDarknetDetRes import readDetRes,saveDetRes
from readAnnotations import LoadLabel
from voc_eval import voc_eval
#读取文件列表
def LoadFileList(files):
fl = open(file... | 0 | 0 | 0 | 0 | 0 | 0 |
docs_src/queries/docs004.py | naterenegar/ormar | 905 | 1736631 | import databases
import ormar
import sqlalchemy
database = databases.Database("sqlite:///db.sqlite")
metadata = sqlalchemy.MetaData()
class ToDo(ormar.Model):
class Meta:
tablename: str = "todos"
metadata = metadata
database = database
id: int = ormar.Integer(primary_key=True)
te... | 0 | 0 | 3 | 0 | 3 | 0 |
qiskit/circuit/controlledgate.py | Roshan-Thomas/qiskit-terra | 1,456 | 1736635 | <reponame>Roshan-Thomas/qiskit-terra
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-... | 0 | 0 | 0 | 0 | 0 | 0 |
PaddleFSL/paddlefsl/backbones/mlp.py | tianxin1860/FSL-Mate | 982 | 1736720 | from __future__ import annotations
import paddle
import paddle.nn as nn
__all__ = ['LinearBlock', 'MLP']
class LinearBlock(nn.Layer):
"""
Implementation of a linear block: linear-BatchNorm-ReLU
Args:
input_size(int): size of the input
output_size(int): size of the output
Examples:
... | 1 | 2 | 0 | 0 | 3 | 0 |
tests/test_resource_tracker/test_api/test_resource_pool_api_views/test_rp_attribute_definition_api_views/test_update.py | LaudateCorpus1/squest | 112 | 1736730 | <reponame>LaudateCorpus1/squest
from rest_framework import status
from rest_framework.reverse import reverse
from tests.test_resource_tracker.test_api.base_test_api import BaseTestAPI
class TestResourcePoolAttributeDefinitionUpdate(BaseTestAPI):
def setUp(self):
super(TestResourcePoolAttributeDefinition... | 0 | 0 | 0 | 0 | 0 | 0 |
third_party/catapult/telemetry/telemetry/value/trace_unittest.py | zipated/src | 2,151 | 1736736 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import codecs
import json
import mock
import os
import shutil
import tempfile
import unittest
from telemetry import story
from telemetry import page as page... | 0 | 6 | 0 | 0 | 6 | 0 |
open_spiel/contrib/python/export_graph.py | ajain-23/open_spiel | 3,167 | 1736756 | <filename>open_spiel/contrib/python/export_graph.py
# Copyright 2019 DeepMind Technologies 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.... | 0 | 0 | 0 | 0 | 0 | 0 |
tracdb/views.py | sreekanth1990/djangoproject.com | 1,440 | 1736793 | <reponame>sreekanth1990/djangoproject.com
import datetime
from django import db
from django.shortcuts import render
from django.utils.timezone import FixedOffset
def bouncing_tickets(request):
c = db.connections['trac'].cursor()
c.execute("""SELECT * FROM bouncing_tickets
WHERE times_reopene... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_annotate.py | hgroll/tikzplotlib | 646 | 1736802 | import matplotlib.pyplot as plt
import numpy as np
def plot() -> object:
fig = plt.figure(1, figsize=(8, 5))
ax = fig.add_subplot(111, autoscale_on=False, xlim=(-1, 5), ylim=(-4, 3))
t = np.arange(0.0, 5.0, 0.2)
s = np.cos(2 * np.pi * t)
ax.plot(t, s, color="blue")
ax.annotate(
"text",... | 0 | 1 | 0 | 0 | 1 | 0 |
cvnets/models/classification/mobilenetv3.py | apple/ml-cvnets | 209 | 1736803 | <reponame>apple/ml-cvnets<filename>cvnets/models/classification/mobilenetv3.py
#
# For licensing see accompanying LICENSE file.
# Copyright (C) 2022 Apple Inc. All Rights Reserved.
#
from torch import nn
import argparse
from typing import Optional, Tuple
from utils.math_utils import make_divisible, bound_fn
from . i... | 0 | 0 | 0 | 0 | 0 | 0 |
det3d/core/sampler/sample_ops.py | reinforcementdriving/CIA-SSD | 382 | 1736811 | from __future__ import annotations
import copy
import pathlib
import pickle
import time
from functools import partial, reduce
import numpy as np
from det3d.core.bbox import box_np_ops
from det3d.core.sampler import preprocess as prep
from det3d.utils.check import shape_mergeable
class DataBaseSamplerV2:
def __in... | 7 | 6 | 0 | 9 | 22 | 0 |
pandapower/pypower/d2Ibr_dV2.py | Zamwell/pandapower | 221 | 1736840 | <filename>pandapower/pypower/d2Ibr_dV2.py
# Copyright (c) 1996-2015 PSERC. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
"""Computes 2nd derivatives of complex branch current w.r.t. voltage.
"""
from numpy import ones, arange
from scipy.spar... | 0 | 0 | 0 | 0 | 0 | 0 |
rest_framework_datatables/django_filters/filterset.py | vanschelven/django-rest-framework-datatables | 327 | 1736846 | <filename>rest_framework_datatables/django_filters/filterset.py
from django_filters.rest_framework.filterset import FilterSet
class DatatablesFilterSet(FilterSet):
"""Basic FilterSet used by default in DatatablesFilterBackend
Datatables parameters are parsed and only the relevant parts are
stored and prop... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/custom_cluster/test_krpc_metrics.py | Keendata/impala | 1,523 | 1736877 | <reponame>Keendata/impala
# 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
#... | 0 | 0 | 0 | 0 | 0 | 0 |
openhtf/util/argv.py | frankalicious/openhtf | 372 | 1736879 | """Utilities for handling command line arguments."""
import argparse
import sys
import typing
from typing import Any, Optional, Text
def module_parser() -> argparse.ArgumentParser:
return argparse.ArgumentParser(add_help=False)
class StoreInModule(argparse.Action):
"""ArgParse action emulating a gflags-esque A... | 23 | 5 | 0 | 0 | 28 | 0 |
tests/protocol/__init__.py | bianhaoyi/necache | 351 | 1736887 | __all__ = ['badbasic', 'badstartup']
| 0 | 0 | 0 | 0 | 0 | 0 |
src/text/__init__.py | alihassanijr/Compact-Transformers | 281 | 1736888 | <reponame>alihassanijr/Compact-Transformers
from .vit import *
from .cvt import *
from .cct import *
| 0 | 0 | 0 | 0 | 0 | 0 |
sponsors/migrations/0051_auto_20211022_1403.py | Manny27nyc/pythondotorg | 911 | 1736898 | # Generated by Django 2.2.24 on 2021-10-22 14:03
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies: list[tuple[str, str]] = [
('sponsors', '0050_emailtargetable_emailtargetableconfiguration'),
]
operations: list[object]... | 0 | 0 | 2 | 0 | 2 | 0 |
functions/setting/__init__.py | hsokooti/RegNet | 187 | 1736928 |
__version__ = "0.3.0"
__author__ = "hsokooti" | 0 | 0 | 0 | 0 | 0 | 0 |
wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executors/asyncio.py | borisgrafx/client | 3,968 | 1736929 | from __future__ import annotations
from __future__ import absolute_import
from asyncio import Future, get_event_loop, iscoroutine, wait
from promise import Promise
try:
from asyncio import ensure_future
except ImportError:
# ensure_future is only implemented in Python 3.4.4+
def ensure_future(coro_or_fut... | 2 | 2 | 0 | 1 | 5 | 0 |
two1/bitcoin/hash.py | febuiles/two1-python | 415 | 1736933 | """this submodule provides a Hash class for interacting with SHA-256 hashes
in a user-friendly way."""
import hashlib
from two1.bitcoin.utils import bytes_to_str
class Hash(object):
""" Wrapper around a byte string for handling SHA-256 hashes used
in bitcoin. Specifically, this class is useful for disamb... | 1 | 5 | 0 | 0 | 6 | 0 |
terrascript/data/cloudknox/cloudknox.py | mjuenema/python-terrascript | 507 | 1736934 | <reponame>mjuenema/python-terrascript
# terrascript/data/cloudknox/cloudknox.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:14:14 UTC)
import terrascript
class cloudknox_role_policy(terrascript.Data):
pass
__all__ = [
"cloudknox_role_policy",
]
| 0 | 0 | 0 | 0 | 0 | 0 |
bin/make_graph_report.py | DwangoMediaVillage/Comicolorization | 122 | 1736961 | <gh_stars>100-1000
"""
python3 bin/make_graph_report.py \
projectA \
projectB \
--path_output `pwd`/graph_linelike_without_real.png \
--key_x iteration \
--key_y validation/main/loss validation/train/main/loss \
--title loss-graph\
--figsize 16 9 \
--xlim 0 100000 \
--ylim 0 500 \
... | 0 | 0 | 0 | 0 | 0 | 0 |
pyqtgraph/graphicsItems/ViewBox/ViewBox.py | herodotus77/pyqtgraph | 2,762 | 1736979 | <reponame>herodotus77/pyqtgraph<filename>pyqtgraph/graphicsItems/ViewBox/ViewBox.py
# -*- coding: utf-8 -*-
import weakref
import sys
import math
from copy import deepcopy
import numpy as np
from ...Qt import QtGui, QtCore
from ...Point import Point
from ... import functions as fn
from .. ItemGroup import ItemGroup
fro... | 0 | 0 | 0 | 0 | 0 | 0 |
knowledge/templatetags/knowledge_tags.py | bitmazk/django-knowledge | 199 | 1736992 | from __future__ import annotations
from hashlib import md5
from urllib import urlencode
from django import template
register = template.Library()
@register.simple_tag
def get_gravatar(email, size: int=60, rating: str='g', default: object | None=None) -> object:
""" Return url for a Gravatar. From Zinnia blog. "... | 3 | 2 | 0 | 0 | 5 | 0 |
source/speechViewer.py | XLTechie/nvdaTests | 1,592 | 1737006 | # A part of NonVisual Desktop Access (NVDA)
# Copyright (C) 2006-2021 NV Access Limited, <NAME>, Accessolutions, <NAME>
# This file is covered by the GNU General Public License.
# See the file COPYING for more details.
from __future__ import annotations
import wx
import gui
import config
from logHandler impor... | 2 | 6 | 2 | 1 | 11 | 0 |
models/pt_3dpose/detectron/utils/model_convert_utils.py | DreaJulca/uxsense | 27,213 | 1737011 | # Copyright (c) 2017-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... | 7 | 20 | 0 | 8 | 35 | 0 |
src/genie/libs/parser/iosxr/show_controllers.py | balmasea/genieparser | 204 | 1737027 | from __future__ import annotations
''' show_controllers.py
IOSXR parsers for the following show commands:
* show controller fia diagshell {diagshell_unit} 'l2 show' location {location}
* show controllers coherentDSP {port}
* show controllers optics {port}
* show controllers fia diagshell {diagshell_un... | 10 | 6 | 14 | 0 | 30 | 0 |
tg/migrations/0003_chat_title.py | horacexd/clist | 166 | 1737030 | <filename>tg/migrations/0003_chat_title.py
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-04-02 03:43
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tg', '0002_auto_20180402_0255'),
]
operations = [
migrations.AddField(... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/raysgd_nyctaxi.py | wybryan/raydp | 119 | 1737037 | import ray
from ray.util.sgd.torch import TrainingOperator
from ray.util.sgd import TorchTrainer
from ray import tune
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data.dataloader import DataLoader
import raydp
from raydp.torch import TorchEstimator
from raydp.utils import random_... | 0 | 1 | 0 | 0 | 1 | 0 |
mantraml/tests/test_task.py | cclauss/mantra | 330 | 1737044 | <reponame>cclauss/mantra<filename>mantraml/tests/test_task.py
import os
import numpy as np
import pandas as pd
import yaml
from mantraml.tasks import Task
import pytest
class MockData:
X = np.array([[1,2,3,4,5,6,7,8,9], [2,3,4,5,6,7,8,9,10]]).T
y = np.array([10, 11, 12, 13, 14, 15, 16, 17, 18])
def __... | 0 | 0 | 0 | 0 | 0 | 0 |
parlai/agents/legacy_agents/seq2seq/seq2seq_v1.py | ricsinaruto/ParlAI | 258 | 1737046 | <reponame>ricsinaruto/ParlAI
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from .torch_agent_v1 import TorchAgent, Output, Beam
from .utils_v1 import padded_tensor
fr... | 0 | 0 | 0 | 0 | 0 | 0 |
treeio/infrastructure/api/tests.py | Andrea-MariaDB-2/treeio | 242 | 1737047 | # encoding: utf-8
# Copyright 2011 Tree.io Limited
# This file is part of Treeio.
# License www.tree.io/license
"""
Infrastructure: test api
"""
import json
from django.test import TestCase
from django.test.client import Client
from django.test.utils import override_settings
from django.core.urlresolvers import rever... | 0 | 0 | 5 | 0 | 5 | 0 |
src/etcd/client.py | ellipses/python-etcd | 459 | 1737062 | """
.. module:: python-etcd
:synopsis: A python etcd client.
.. moduleauthor:: <NAME> <<EMAIL>>
"""
import logging
try:
# Python 3
from http.client import HTTPException
except ImportError:
# Python 2
from httplib import HTTPException
import socket
import urllib3
from urllib3.exceptions import HTTP... | 0 | 0 | 0 | 0 | 0 | 0 |
pca/application/tests/test_interactor.py | pcah/python-clean-architecture | 278 | 1737069 | <gh_stars>100-1000
import typing as t
import mock
import pytest
from pca.application.interactor import (
Interactor,
RequestModel,
ResponseModel,
interactor_factory,
)
from pca.domain.entity import (
Entity,
SequenceId,
field,
)
from pca.domain.repository import Repository
from pca.excepti... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/importer/tflite_/combine/test_conv2d_act.py | xhuohai/nncase | 510 | 1737076 | # Copyright 2019-2021 Canaan 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 | 2 | 0 | 0 | 2 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.