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 |
|---|---|---|---|---|---|---|---|---|---|---|
ide/api/project.py | Ramonrlb/cloudpebble | 147 | 138404 | from __future__ import annotations
import re
import json
import time
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.db import transaction, IntegrityError
from django.shortcuts import get_object_or_404
from django.views.decorators.http import require_safe, require... | 0 | 14 | 0 | 0 | 14 | 0 |
test/completion/comprehensions.py | kirat-singh/jedi | 4,213 | 138472 | <gh_stars>1000+
# -----------------
# list comprehensions
# -----------------
# basics:
a = ['' for a in [1]]
#? str()
a[0]
#? ['insert']
a.insert
a = [a for a in [1]]
#? int()
a[0]
y = 1.0
# Should not leak.
[y for y in [3]]
#? float()
y
a = [a for a in (1, 2)]
#? int()
a[0]
a = [a for a,b in [(1,'')]]
#? int()
... | 0 | 0 | 0 | 0 | 0 | 0 |
events/migrations/0047_participant_date_of_birth.py | horacexd/clist | 166 | 138502 | <filename>events/migrations/0047_participant_date_of_birth.py<gh_stars>100-1000
# Generated by Django 2.2.10 on 2020-04-16 20:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('events', '0046_participant_addition_fields'),
]
operations = [
... | 0 | 0 | 0 | 0 | 0 | 0 |
bitcoinetl/cli/stream.py | BTCGPU/bitcoin-etl | 274 | 138557 | <filename>bitcoinetl/cli/stream.py
# MIT License
#
# Copyright (c) 2018 <NAME>, <EMAIL>
#
# 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... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/contrib/aiopg/py37/test.py | p7g/dd-trace-py | 308 | 138585 | import aiopg
# project
from ddtrace import Pin
from ddtrace.contrib.aiopg.patch import patch
from ddtrace.contrib.aiopg.patch import unpatch
from tests.contrib.asyncio.utils import AsyncioTestCase
from tests.contrib.asyncio.utils import mark_asyncio
from tests.contrib.config import POSTGRES_CONFIG
TEST_PORT = str(PO... | 0 | 1 | 1 | 0 | 2 | 0 |
UVTextureConverter/__init__.py | shiba6v/UVTextureConverter | 115 | 138586 | <reponame>shiba6v/UVTextureConverter<filename>UVTextureConverter/__init__.py<gh_stars>100-1000
from .Atlas2Normal import Atlas2Normal
from .Normal2Atlas import Normal2Atlas
from .UVConverter import UVConverter
| 0 | 0 | 0 | 0 | 0 | 0 |
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/test/coding20731.py | brianherrera/lumberyard | 1,738 | 138595 | #coding:latin1
| 0 | 0 | 0 | 0 | 0 | 0 |
sc2/generate_ids.py | Yousazoe/oxBot | 242 | 138599 | import importlib
import json
import platform
import subprocess
import sys
from pathlib import Path
from loguru import logger
from sc2.game_data import AbilityData, GameData, UnitTypeData, UpgradeData
try:
from sc2.ids.id_version import ID_VERSION_STRING
except ImportError:
ID_VERSION_STRING = "4.11.4.78285"
... | 3 | 3 | 0 | 5 | 11 | 0 |
dynamic_models/exceptions.py | wieczorek1990/django-dynamic-models | 122 | 138617 | """Provide exceptions to be raised by the `dynamic_models` app.
All exceptions inherit from a `DynamicModelError` base class.
"""
class DynamicModelError(Exception):
"""Base exception for use in dynamic models."""
class OutdatedModelError(DynamicModelError):
"""Raised when a model's schema is outdated on s... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/cluster.py | adujardin/OpenIBL | 182 | 138650 | <reponame>adujardin/OpenIBL<gh_stars>100-1000
from __future__ import print_function, absolute_import
import argparse
import os.path as osp
import random
import numpy as np
import sys, os
import math
import h5py
from sklearn.cluster import KMeans
import torch
from torch import nn
from torch.backends import cudnn
import... | 0 | 0 | 0 | 0 | 0 | 0 |
arelle/PrototypeInstanceObject.py | DataFinnovation/Arelle | 292 | 138696 | <filename>arelle/PrototypeInstanceObject.py<gh_stars>100-1000
from arelle import XmlUtil
from arelle.ModelValue import QName
from arelle.ModelObject import ModelObject
Aspect = None
class FactPrototype(): # behaves like a fact for dimensional validity testing
def __init__(self, v, aspectValues=None):
... | 0 | 0 | 0 | 0 | 0 | 0 |
third-party/llvm/llvm-src/utils/docker/scripts/llvm_checksum/llvm_checksum.py | jhh67/chapel | 2,338 | 138697 | <reponame>jhh67/chapel
#!/usr/bin/env python
""" A small program to compute checksums of LLVM checkout.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import hashlib
import logging
import re
import sys
from argparse import ArgumentParser
from project_tr... | 0 | 0 | 0 | 0 | 0 | 0 |
gnocchi/tests/test_bin.py | Dmitry-Eremeev/gnocchi | 299 | 138712 | # -*- encoding: utf-8 -*-
#
# Copyright © 2017 Red Hat, 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 applica... | 0 | 0 | 0 | 0 | 0 | 0 |
score_lib.py | jazzmozart/text_scalpel | 183 | 138724 | <reponame>jazzmozart/text_scalpel
# coding=utf-8
# Copyright 2019 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 | 0 | 0 | 0 | 0 | 0 |
AzureEnhancedMonitor/ext/test/test_aem.py | shridpant/azure-linux-extensions | 266 | 138726 | <filename>AzureEnhancedMonitor/ext/test/test_aem.py
#!/usr/bin/env python
#
#CustomScript extension
#
# Copyright 2014 Microsoft 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
#
... | 0 | 0 | 0 | 0 | 0 | 0 |
chrome/browser/resources/settings/people_page/compiled_resources2.gyp | google-ar/chromium | 777 | 138727 | <filename>chrome/browser/resources/settings/people_page/compiled_resources2.gyp
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'camera',
'dependencies': [
... | 0 | 0 | 0 | 0 | 0 | 0 |
exps/losses/customize.py | YacobBY/DFF | 196 | 138731 | <gh_stars>100-1000
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Created by: <NAME>
# Email: <EMAIL>
# Copyright (c) 2019
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
"""Calculate Multi-label Loss (Semantic Loss)"""
import torch
from torch.nn.modules.loss ... | 0 | 0 | 0 | 0 | 0 | 0 |
jupyter_ascending/requests/sync.py | nikvdp/jupyter_ascending | 178 | 138734 | import argparse
from pathlib import Path
from loguru import logger
from jupyter_ascending._environment import SYNC_EXTENSION
from jupyter_ascending.json_requests import SyncRequest
from jupyter_ascending.logger import setup_logger
from jupyter_ascending.requests.client_lib import request_notebook_command
@logger.ca... | 1 | 1 | 0 | 0 | 2 | 0 |
turbo/helper.py | wecatch/app-turbo | 157 | 138740 | from __future__ import absolute_import, division, print_function, with_statement
import sys
from turbo.log import helper_log
from turbo.util import import_object, camel_to_underscore
class _HelperObjectDict(dict):
def __setitem__(self, name, value) -> object:
return super(_HelperObjectDict, self).setd... | 0 | 2 | 0 | 0 | 2 | 0 |
gpustat_web/app.py | Linyxus/gpustat-web | 234 | 138753 | <filename>gpustat_web/app.py
"""
gpustat.web
MIT License
Copyright (c) 2018-2020 <NAME> (@wookayin)
"""
from typing import List, Tuple, Optional
import os
import sys
import traceback
import urllib
import ssl
import asyncio
import asyncssh
import aiohttp
from datetime import datetime
from collections import Ordere... | 0 | 0 | 0 | 0 | 0 | 0 |
pandas_ml/skaccessors/pipeline.py | matsavage/pandas-ml | 305 | 138782 | #!/usr/bin/env python
from pandas_ml.core.accessor import _AccessorMethods
class PipelineMethods(_AccessorMethods):
"""
Accessor to ``sklearn.pipeline``.
"""
_module_name: str = 'sklearn.pipeline'
@property
def make_pipeline(self) -> object:
"""``sklearn.pipeline.make_... | 0 | 2 | 1 | 0 | 3 | 0 |
utests/specs/test.py | linarnan/ptf | 113 | 138792 | import ptf
from ptf.base_tests import BaseTest
from ptf import testutils
class TestParamsGet(BaseTest):
def setUp(self):
BaseTest.setUp(self)
def runTest(self):
params = testutils.test_params_get(default=None)
if params is None:
print(">>>None")
else:
fo... | 0 | 0 | 0 | 0 | 0 | 0 |
alipay/aop/api/domain/AlipayUserSafeboxRecordSaveModel.py | snowxmas/alipay-sdk-python-all | 213 | 138794 | <reponame>snowxmas/alipay-sdk-python-all<filename>alipay/aop/api/domain/AlipayUserSafeboxRecordSaveModel.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayUserSafeboxRecordSaveModel(object):
def __init__(self):
self._content = N... | 0 | 0 | 0 | 0 | 0 | 0 |
machina/algos/qtopt.py | krish-dx/machina | 302 | 138797 | <reponame>krish-dx/machina
"""
This is an implementation of QT-Opt.
https://arxiv.org/abs/1806.10293
"""
from machina import loss_functional as lf
from machina import logger
def train(traj,
qf, lagged_qf, targ_qf1, targ_qf2,
optim_qf,
epoch, batch_size, # optimization hypers
... | 0 | 0 | 0 | 0 | 0 | 0 |
internetdefense/apps/include/management/commands/clearcache.py | gnubrasil/idl-members | 175 | 138805 | <reponame>gnubrasil/idl-members
from django.core.cache import cache
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'Flush the entire cache'
def handle(self, *args, **options):
cache.clear()
self.stdout.write('Cache cleared\n')
| 0 | 0 | 0 | 0 | 0 | 0 |
veles/external/manhole.py | AkshayJainG/veles | 1,007 | 138810 | <gh_stars>1000+
from __future__ import print_function
from logging import getLogger
logger = getLogger(__name__)
import traceback
import socket
import struct
import sys
import os
import atexit
import signal
import errno
import platform
import weakref
try:
import signalfd
except ImportError:
signalfd = None
tr... | 0 | 0 | 0 | 0 | 0 | 0 |
ocs_ci/utility/baremetal.py | annagitel/ocs-ci | 130 | 138815 | import logging
import pyipmi
import pyipmi.interfaces
from ocs_ci.ocs import constants, defaults
from ocs_ci.ocs.constants import VM_POWERED_OFF, VM_POWERED_ON
from ocs_ci.ocs.exceptions import UnexpectedBehaviour
from ocs_ci.ocs.node import wait_for_nodes_status, get_worker_nodes, get_master_nodes
from ocs_ci.ocs.oc... | 4 | 4 | 0 | 0 | 8 | 0 |
opcode/opcode/__init__.py | MaxTurchin/pycopy-lib | 126 | 138819 | <gh_stars>100-1000
# This file is part of the standard library of Pycopy project, minimalist
# and lightweight Python implementation.
#
# https://github.com/pfalcon/pycopy
# https://github.com/pfalcon/pycopy-lib
#
# The MIT License (MIT)
#
# Copyright (c) 2019 <NAME>
#
# Permission is hereby granted, free of charge, to... | 0 | 0 | 0 | 0 | 0 | 0 |
src/db-up/azext_db_up/vendored_sdks/azure_mgmt_sql/sql/models/server.py | Mannan2812/azure-cli-extensions | 207 | 138846 | <filename>src/db-up/azext_db_up/vendored_sdks/azure_mgmt_sql/sql/models/server.py
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license in... | 0 | 0 | 0 | 0 | 0 | 0 |
src/data_gen/ohem.py | kehuaWangfff/FashionAI_KeyPoint_Detection_Challenge_Keras | 169 | 138848 | <filename>src/data_gen/ohem.py
import sys
sys.path.insert(0, "../unet/")
from keras.models import *
from keras.layers import *
from utils import np_euclidean_l2
from dataset import getKpNum
def generate_topk_mask_ohem(input_data, gthmap, keras_model, graph, topK, image_category, dynamicFlag=False):
'''
:para... | 0 | 0 | 0 | 0 | 0 | 0 |
cortex/mapper/samplers.py | mvdoc/pycortex | 423 | 138849 | <filename>cortex/mapper/samplers.py
import numpy as np
def collapse(j, data):
"""Collapses samples into a single row"""
uniques = np.unique(j)
return uniques, np.array([data[j == u].sum() for u in uniques])
def nearest(coords, shape, **kwargs):
valid = ~(np.isnan(coords).all(1))
valid = np.logical... | 0 | 0 | 0 | 0 | 0 | 0 |
recipes/Python/499350_NonLinear_Units/recipe-499350.py | tdiprima/code | 2,023 | 138903 | class DB:
'''
Convience class for decibel scale. Other non-linear scales such as the richter scale could be handled similarly.
Usage:
dB = DB()
.
. (later)
.
gain = 15 * dB
'''
def __rmul__(self, val) -> object:
'''
Only allow multiplication from the right to av... | 0 | 1 | 0 | 0 | 1 | 0 |
cortex_DIM/nn_modules/convnet.py | Soapy-Salted-Fish-King/DIM | 749 | 138905 | <reponame>Soapy-Salted-Fish-King/DIM<filename>cortex_DIM/nn_modules/convnet.py
'''Convnet encoder module.
'''
import copy
import torch
import torch.nn as nn
from cortex.built_ins.networks.utils import get_nonlinearity
from cortex_DIM.nn_modules.misc import Expand2d, Fold, Unfold, View
class Convnet(nn.Module):
... | 0 | 0 | 0 | 0 | 0 | 0 |
internal/core/build-support/run_cpplint.py | chriswarnock/milvus | 10,504 | 138970 | #!/usr/bin/env python
# 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
# "Li... | 0 | 2 | 0 | 0 | 2 | 0 |
h5Nastran/h5Nastran/h5/nastran/__init__.py | ACea15/pyNastran | 293 | 138971 | <reponame>ACea15/pyNastran
from .nastran_node import NastranNode | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_data_structures.py | proudzhu/algorithms | 2,545 | 139043 | <reponame>proudzhu/algorithms
from random import shuffle
import unittest
from algorithms.data_structures import (
binary_search_tree,
digraph,
queue,
singly_linked_list,
stack,
undirected_graph,
union_find,
union_find_by_rank,
union_find_with_path_compression,
lcp_array
)
clas... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/example/reflexes/example_reflex.py | FarhanAliRaza/django-sockpuppet | 371 | 139049 | <reponame>FarhanAliRaza/django-sockpuppet
from sockpuppet.reflex import Reflex
class ExampleReflex(Reflex):
def increment(self, step=1):
self.session['count'] = int(self.element.dataset['count']) + step
class DecrementReflex(Reflex):
def decrement(self, step=1):
self.session['otherCount'] = ... | 0 | 0 | 0 | 0 | 0 | 0 |
PhysicsTools/PatExamples/bin/PatBasicFWLiteJetAnalyzer_Selector_cfg.py | ckamtsikis/cmssw | 852 | 139050 | <filename>PhysicsTools/PatExamples/bin/PatBasicFWLiteJetAnalyzer_Selector_cfg.py<gh_stars>100-1000
import FWCore.ParameterSet.Config as cms
process = cms.Process("FWLitePlots")
#input stuff for Run/Lumi selection with the "JSON"-formatted files from the PVT group
import FWCore.PythonUtilities.LumiList as LumiList
#... | 0 | 0 | 0 | 0 | 0 | 0 |
src/ZODB/tests/testConfig.py | timgates42/ZODB | 514 | 139057 | ##############################################################################
#
# Copyright (c) 2003 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | 0 | 2 | 0 | 0 | 2 | 0 |
src/ostorlab/runtimes/cloud/runtime.py | bbhunter/ostorlab | 113 | 139082 | """Remote runtime runs on Ostorlab cloud.
The remote runtime provides capabilities identical to local runtime with extra features, like data persistence,
improved data visualization, automated scaling for improved performance, agent improved data warehouse for improved
detection and several other improvements.
"""
fr... | 34 | 12 | 3 | 0 | 49 | 0 |
scripts/external_libs/pyzmq-14.5.0/python3/ucs4/64bit/zmq/backend/cffi/_cffi.py | alialnu/trex-core | 652 | 139139 | <gh_stars>100-1000
# coding: utf-8
"""The main CFFI wrapping of libzmq"""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
import json
import os
from os.path import dirname, join
from cffi import FFI
from zmq.utils.constant_names import all_names, no_prefix
base_zmq_vers... | 0 | 0 | 0 | 0 | 0 | 0 |
Python-Regular-Expressions/emails.py | sagarsaliya/code_snippets | 9,588 | 139151 | import re
emails = '''
<EMAIL>
<EMAIL>
<EMAIL>
'''
pattern = re.compile(r'[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+')
matches = pattern.finditer(emails)
for match in matches:
print(match)
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/unit/test_curved_polygon.py | kianmeng/bezier | 165 | 139198 | <filename>tests/unit/test_curved_polygon.py
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | 0 | 0 | 0 | 0 | 0 | 0 |
skdist/distribute/search.py | synapticarbors/sk-dist | 292 | 139203 | <gh_stars>100-1000
"""
Distributed grid search meta-estimators
"""
import time
import numbers
import random
import numpy as np
import pandas as pd
from copy import copy
from abc import ABCMeta
from joblib import Parallel, delayed
from sklearn.model_selection import (
ParameterGrid,
GridSearchCV,
Randomize... | 0 | 0 | 0 | 0 | 0 | 0 |
python/121_Best_Time_to_Buy_and_Sell_Stock.py | dvlpsh/leetcode-1 | 4,416 | 139227 | <gh_stars>1000+
class Solution(object):
def maxProfit(self, prices):
"""
:type prices: List[int]
:rtype: int
"""
length = len(prices)
if length == 0:
return 0
max_profit, low = 0, prices[0]
for i in range(1, length):
if low > pr... | 0 | 0 | 0 | 0 | 0 | 0 |
saleor/graphql/invoice/types.py | siyoola/saleor | 1,392 | 139275 | import graphene
from ...invoice import models
from ..core.types import Job, ModelObjectType
from ..meta.types import ObjectWithMetadata
class Invoice(ModelObjectType):
number = graphene.String()
external_url = graphene.String()
created_at = graphene.DateTime(required=True)
updated_at = graphene.DateT... | 0 | 0 | 2 | 0 | 2 | 0 |
tests/test_bert.py | clarencechen/keras-transformer | 555 | 139277 | <reponame>clarencechen/keras-transformer<filename>tests/test_bert.py
import random
from itertools import islice
import numpy as np
from keras_transformer.bert import BatchGeneratorForBERT
def test_bert_sample_generator():
token_ids = list(range(3, 1000))
def sampler(size):
start = random.randint(0, ... | 0 | 0 | 0 | 0 | 0 | 0 |
lingvo/tasks/car/calibration_processing.py | allenwang28/lingvo | 2,611 | 139301 | <filename>lingvo/tasks/car/calibration_processing.py
# Lint as: python3
# Copyright 2019 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
#
# h... | 0 | 0 | 0 | 0 | 0 | 0 |
core/lib/constant.py | duruyi/OnlineSchemaChange | 949 | 139316 | #!/usr/bin/env python3
"""
Copyright (c) 2017-present, Facebook, Inc.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
"""
PREFIX = "__osc_"
OUTFILE_TABLE = "__osc_tbl_"
OUTFILE_EXCLUDE_ID = "__osc_ex_"
OUTFILE_INCLUDE_I... | 0 | 0 | 0 | 0 | 0 | 0 |
frontend/api/tasks/frontend_app.py | quarkslab/irma | 248 | 139321 | #
# Copyright (c) 2013-2018 Quarkslab.
# This file is part of IRMA project.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License in the top-level directory
# of this distribution and at:
#
# http:... | 6 | 3 | 0 | 0 | 9 | 0 |
convlab/lib/util.py | ngduyanhece/ConvLab | 405 | 139439 | # Modified by Microsoft Corporation.
# Licensed under the MIT license.
from __future__ import annotations
import json
import operator
import os
import pickle
import subprocess
import sys
import time
from collections import deque
from contextlib import contextmanager
from datetime import datetime
from importlib import ... | 9 | 48 | 0 | 0 | 57 | 0 |
pymagnitude/third_party/allennlp/tests/data/dataset_readers/penn_tree_bank_reader_test.py | tpeng/magnitude | 1,520 | 139443 | # pylint: disable=no-self-use,invalid-name,protected-access
from __future__ import division
from __future__ import absolute_import
from nltk.tree import Tree
from allennlp.data.dataset_readers import PennTreeBankConstituencySpanDatasetReader
from allennlp.common.testing import AllenNlpTestCase
from allennlp.data.da... | 0 | 0 | 0 | 0 | 0 | 0 |
blesuite/cli/blesuite_cli.py | jreynders/BLESuite-1 | 198 | 139449 | import argparse
from blesuite.connection_manager import BLEConnectionManager
from blesuite_wrapper import ble_service_read, ble_service_read_async, ble_service_write, \
ble_handle_subscribe, ble_service_scan, ble_service_write_async, ble_run_smart_scan
from blesuite import utils
from blesuite.utils.print_helper imp... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/sandbox/c7n_autodoc/setup.py | al3pht/cloud-custodian | 2,415 | 139461 | # Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from setuptools import setup
import os
description = ""
if os.path.exists('README.md'):
description = open('README.md', 'r').read()
setup(
name="c7n_autodoc",
version='0.3',
description="Cloud Custodian - Automated Policy ... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/mnist/keras/mnist_inference.py | tornado12345/TensorFlowOnSpark | 4,363 | 139466 | # Copyright 2018 Yahoo Inc.
# Licensed under the terms of the Apache 2.0 license.
# Please see LICENSE file in the project root for terms.
# This example demonstrates how to leverage Spark for parallel inferencing from a SavedModel.
#
# Normally, you can use TensorFlowOnSpark to just form a TensorFlow cluster for trai... | 0 | 2 | 0 | 0 | 2 | 0 |
bindings/python/setup.py | wangjia3015/marisa-trie | 388 | 139471 | <gh_stars>100-1000
from distutils.core import setup, Extension
marisa_module = Extension("_marisa",
sources=["marisa-swig_wrap.cxx", "marisa-swig.cxx"],
libraries=["marisa"])
setup(name = "marisa",
ext_modules = [marisa_module],
py_modules = ["marisa"])
| 0 | 0 | 0 | 0 | 0 | 0 |
pyeit/mesh/wrapper.py | ccfbeltran/pyEIT | 107 | 139488 | # coding: utf-8
# pylint: disable=invalid-name, no-member, too-many-arguments
from __future__ import annotations
""" wrapper function of distmesh for EIT """
# Copyright (c) <NAME>. All rights reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
from __future__ import division, absolute_i... | 10 | 3 | 0 | 0 | 13 | 0 |
cupy/_indexing/indexing.py | prkhrsrvstv1/cupy | 6,180 | 139509 | from __future__ import annotations
import cupy
from cupy._core import internal
def take(a, indices, axis: object | None=None, out: object | None=None) -> object:
"""Takes elements of an array at specified indices along an axis.
This is an implementation of "fancy indexing" at single axis.
This function ... | 10 | 7 | 0 | 0 | 17 | 0 |
gemini/gemini_main.py | bgruening/gemini | 221 | 139515 | #!/usr/bin/env python
import os.path
import sys
import tempfile
import argparse
import gemini.version
def add_inheritance_args(parser, min_kindreds: int=1, depth: bool=True, gt_ll: bool=False,
allow_unaffected: bool=True, lenient: bool=True, gq: bool=True):
"""Common arguments added to various sub-parsers"... | 6 | 1 | 0 | 0 | 7 | 0 |
devil/devil/utils/reset_usb.py | tingshao/catapult | 138 | 139516 | <reponame>tingshao/catapult<gh_stars>100-1000
#!/usr/bin/env python
# Copyright 2015 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 sys
if sys.platform == 'win32':
raise ImportError('devil.utils.reset_usb only su... | 0 | 0 | 0 | 0 | 0 | 0 |
NVLL/analysis/word_freq.py | jennhu/vmf_vae_nlp | 159 | 139557 | <filename>NVLL/analysis/word_freq.py<gh_stars>100-1000
import os
def count(dic, fname):
with open(fname, 'r') as fd:
lines = fd.read().splitlines()
filtered_sents = []
for l in lines:
words = l.split(" ")
_ratio = comp_unk_ratio(words)
if _ratio <= 0.05:... | 0 | 0 | 0 | 0 | 0 | 0 |
ibl/datasets/pitts.py | adujardin/OpenIBL | 182 | 139565 | <gh_stars>100-1000
from __future__ import print_function, absolute_import
import os.path as osp
from collections import namedtuple
import torch.distributed as dist
from ..utils.data import Dataset
from ..utils.osutils import mkdir_if_missing
from ..utils.serialization import write_json, read_mat
from ..utils.dist_util... | 0 | 0 | 0 | 0 | 0 | 0 |
SimG4Core/Configuration/python/SimG4Core_cff.py | ckamtsikis/cmssw | 852 | 139570 | import FWCore.ParameterSet.Config as cms
# Geometry and Magnetic field must be initialized separately
# Geant4-based CMS Detector simulation (OscarProducer)
# - returns label "g4SimHits"
#
from SimG4Core.Application.g4SimHits_cfi import *
| 0 | 0 | 0 | 0 | 0 | 0 |
rest/addresses/list-post-example-1/list-post-example-1.6.x.py | Tshisuaka/api-snippets | 234 | 139602 | <filename>rest/addresses/list-post-example-1/list-post-example-1.6.x.py
# Download the Python helper library from twilio.com/docs/python/install
import os
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/user/account
# To set up environmental variables, see http://twil.io/secure
account... | 0 | 0 | 0 | 0 | 0 | 0 |
pyoutline/outline/plugins/manager.py | mb0rt/OpenCue | 334 | 139622 | <filename>pyoutline/outline/plugins/manager.py
# Copyright Contributors to the OpenCue Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENS... | 0 | 0 | 0 | 0 | 0 | 0 |
pyp.py | hauntsaninja/pyp | 1,194 | 139639 | <filename>pyp.py
#!/usr/bin/env python3
import argparse
import ast
import importlib
import inspect
import itertools
import os
import sys
import textwrap
import traceback
from collections import defaultdict
from typing import Any, Dict, Iterator, List, Optional, Set, Tuple, cast
__all__ = ["pypprint"]
__version__ = "0.... | 0 | 0 | 0 | 0 | 0 | 0 |
heronpy/streamlet/impl/transformbolt.py | pjfanning/incubator-heron | 3,348 | 139651 | #!/usr/bin/env python3
# -*- encoding: utf-8 -*-
# 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 Apach... | 0 | 2 | 1 | 0 | 3 | 0 |
ipyvolume/traittypes.py | gridbugs/ipyvolume | 1,784 | 139703 | <reponame>gridbugs/ipyvolume
from traitlets import TraitType
import PIL.Image
class Image(TraitType):
"""A trait for PIL images."""
default_value = None
info_text = 'a PIL Image object'
def validate(self, obj, value):
if isinstance(value, PIL.Image.Image):
return value
se... | 0 | 0 | 0 | 0 | 0 | 0 |
pyannote/audio/labeling/tasks/speech_activity_detection.py | avramandrei/pyannote-audio | 1,543 | 139709 | #!/usr/bin/env python
# encoding: utf-8
# The MIT License (MIT)
# Copyright (c) 2018-2020 CNRS
# 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 limita... | 20 | 7 | 1 | 0 | 28 | 0 |
tests/tilemap_tests/test_file_formats.py | yegarti/arcade | 824 | 139719 | import arcade
TILE_SCALING = 1.0
def test_csv_left_up():
# Read in the tiled map
my_map = arcade.load_tilemap("../tiled_maps/csv_left_up_embedded.json")
assert my_map.tile_width == 128
assert my_map.tile_height == 128
assert my_map.width == 10
assert my_map.height == 10
# --- Platforms ... | 0 | 0 | 0 | 0 | 0 | 0 |
dragonfly/nn/unittest_nn_domains.py | hase1128/dragonfly | 675 | 139723 | """
Unit tests for functions/classes in nn_constraint_checker.py
-- <EMAIL>
"""
# pylint: disable=no-member
# pylint: disable=invalid-name
# pylint: disable=relative-import
# Local imports
from . import nn_domains
from .unittest_neural_network import generate_cnn_architectures, \
... | 0 | 0 | 0 | 0 | 0 | 0 |
autolens/interferometer/model/result.py | Jammy2211/PyAutoLens | 114 | 139730 | import numpy as np
import autoarray as aa
import autogalaxy as ag
from autolens.lens.model.result import ResultDataset
class ResultInterferometer(ResultDataset):
@property
def max_log_likelihood_fit(self) -> object:
return self.analysis.fit_interferometer_for_instance(instance=self.instan... | 1 | 9 | 0 | 0 | 10 | 0 |
modelvshuman/datasets/base.py | TizianThieringer/model-vs-human | 158 | 139738 | <reponame>TizianThieringer/model-vs-human<filename>modelvshuman/datasets/base.py<gh_stars>100-1000
#!/usr/bin/env python3
import os
from os.path import join as pjoin
class Dataset(object):
"""Base Dataset class
Attributes:
name (str): name of the dataset
params (object): Dataclass object con... | 0 | 0 | 0 | 0 | 0 | 0 |
causalinference/core/propensity.py | youngminju-phd/Causalinference | 392 | 139757 | from __future__ import annotations
from __future__ import division
import numpy as np
from scipy.optimize import fmin_bfgs
from itertools import combinations_with_replacement
import causalinference.utils.tools as tools
from .data import Dict
class Propensity(Dict):
"""
Dictionary-like class containing propensity ... | 2 | 17 | 0 | 1 | 20 | 0 |
rigl/experimental/jax/train_test.py | vishalbelsare/rigl | 276 | 139761 | <reponame>vishalbelsare/rigl
# coding=utf-8
# Copyright 2021 RigL 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 requir... | 0 | 0 | 0 | 0 | 0 | 0 |
third_party/libxml/chromium/roll.py | Ron423c/chromium | 575 | 139837 | <filename>third_party/libxml/chromium/roll.py
#!/usr/bin/env python
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import os
import os.path
import shutil
import subprocess
import sys
impo... | 0 | 0 | 0 | 0 | 0 | 0 |
release/stubs.min/Autodesk/Revit/UI/__init___parts/TableViewUIUtils.py | htlcnn/ironpython-stubs | 182 | 139845 | class TableViewUIUtils(object):
""" This utility class contains members that involve the Revit UI and operate on schedule views or MEP electrical panel schedules. """
@staticmethod
def TestCellAndPromptToEditTypeParameter(tableView,sectionType,row,column):
"""
TestCellAndPromptToEditTypeParameter(tableView:... | 0 | 0 | 1 | 0 | 1 | 0 |
blog_notebooks/cyber/raw_data_generator/raw_data_generator/raw_data_generator.py | BradReesWork/notebooks-contrib | 155 | 139858 | <reponame>BradReesWork/notebooks-contrib
from jinja2 import Environment, PackageLoader, select_autoescape
import os
import json
import logging
class RawDataGenerator:
def __init__(self):
# Read templates
self.env = Environment(loader=PackageLoader('raw_data_generator', 'templates'),)
self.s... | 0 | 0 | 0 | 0 | 0 | 0 |
digital_image_processing/filters/gabor_filter.py | Vaibhav19102008/Python | 145,614 | 139870 | # Implementation of the Gaborfilter
# https://en.wikipedia.org/wiki/Gabor_filter
import numpy as np
from cv2 import COLOR_BGR2GRAY, CV_8UC3, cvtColor, filter2D, imread, imshow, waitKey
def gabor_filter_kernel(
ksize: int, sigma: int, theta: int, lambd: int, gamma: int, psi: int
) -> np.ndarray:
"""
:param... | 6 | 1 | 0 | 0 | 7 | 0 |
examples/environment_features/scim_ideal_grid_simulation.py | RaviPandey33/gym-electric-motor-1 | 179 | 139875 | """This example simulates the start-up behavior of the squirrel cage induction motor connected to
an ideal three-phase grid. The state and action space is continuous.
Running the example will create a formatted plot that show the motor's angular velocity, the drive torque,
the applied voltage in three-phase abc-coordin... | 0 | 2 | 0 | 0 | 2 | 0 |
src/admin/widgets/datetime.py | aimanow/sft | 280 | 139881 | <filename>src/admin/widgets/datetime.py
from datetime import datetime, date
from wtforms.fields.html5 import DateTimeField
from godmode.widgets.base import BaseWidget
class DatetimeWidget(BaseWidget):
field = DateTimeField(format="%Y-%m-%d %H:%M:%S")
field_kwargs = {"step": 1}
def render_list(self, ite... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_inheritance_routers.py | kmlee78/django-ninja | 2,809 | 139889 | import pytest
from ninja import NinjaAPI, Router
from ninja.testing import TestClient
api = NinjaAPI()
@api.get("/endpoint")
# view->api
def global_op(request) -> str:
return "global"
first_router = Router()
@first_router.get("/endpoint_1")
# view->router, router->api
def router_op1(request) -> str:
ret... | 2 | 7 | 0 | 0 | 9 | 0 |
spyder/plugins/layout/api.py | Earthman100/spyder | 7,956 | 139892 | <filename>spyder/plugins/layout/api.py
# -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
Layout Plugin API.
"""
# Standard libray imports
import copy
# Third party imports
from qtpy.QtCore import QRectF, Qt
fro... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/plotting/plot_graph.py | WeilerP/cellrank | 172 | 139915 | """
Plot graph structures
---------------------
This functions show how to plot graph structures, such as the transition matrix.
"""
import cellrank as cr
import numpy as np
adata = cr.datasets.pancreas_preprocessed("../example.h5ad")
adata
# %%
# First, we create a forward transition matrix using the high-level ... | 0 | 0 | 0 | 0 | 0 | 0 |
psq/__init__.py | Tomesco/bookshelf-demo-project | 210 | 139990 | # Copyright 2015 Google 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, ... | 0 | 0 | 0 | 0 | 0 | 0 |
twiml/voice/say/say-2/say-2.6.x.py | Tshisuaka/api-snippets | 234 | 139994 | from twilio.twiml.voice_response import VoiceResponse, Say
response = VoiceResponse()
response.say('Chapeau!', voice='alice', language='fr-FR')
print(response)
| 0 | 0 | 0 | 0 | 0 | 0 |
redbot/message/headers/content_base.py | Malvoz/redbot | 167 | 139998 | #!/usr/bin/env python
from redbot.message import headers
class content_base(headers.HttpHeader):
canonical_name: str = "Content-Base"
description: str = """\
The `Content-Base` header field established the base URI of the message. It has been
deprecated, because it was not implemented widely.
"""
refer... | 0 | 0 | 8 | 0 | 8 | 0 |
tests/softmax_regression_test.py | SanggunLee/edgetpu | 320 | 140006 | <filename>tests/softmax_regression_test.py
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | 0 | 0 | 0 | 0 | 0 | 0 |
python/topology/generator.py | marcfrei/scion | 211 | 140024 | <filename>python/topology/generator.py
#!/usr/bin/env python3
# Copyright 2014 ETH Zurich
# Copyright 2018 ETH Zurich, Anapaya Systems
#
# 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 |
src/genie/libs/parser/iosxr/tests/ShowSpanningTreeMst/cli/equal/golden_output_2_expected.py | balmasea/genieparser | 204 | 140033 | <reponame>balmasea/genieparser
expected_output = {
'mstp': {
'blocked-ports': {
'mst_instances': {
'0': {
'mst_id': '0',
'interfaces': {
'GigabitEthernet0/0/4/4': {
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/input/func_models_float_money_field.py | enefeq/django_linter | 101 | 140051 | <reponame>enefeq/django_linter
"""
Check for correct type for money related field
"""
from django.db import models
class Product(models.Model):
name = models.CharField(max_length=255)
price = models.FloatField()
def __unicode__(self):
return self.name
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/db_functions/math/test_log.py | Lord-Elrond/django | 61,676 | 140063 | <reponame>Lord-Elrond/django
import math
from decimal import Decimal
from django.db.models.functions import Log
from django.test import TestCase
from ..models import DecimalModel, FloatModel, IntegerModel
class LogTests(TestCase):
def test_null(self):
IntegerModel.objects.create(big=100)
obj = ... | 0 | 0 | 0 | 0 | 0 | 0 |
beartype/_util/func/utilfunctest.py | vcokltfre/beartype | 1,056 | 140105 | #!/usr/bin/env python3
# --------------------( LICENSE )--------------------
# Copyright (c) 2014-2021 Beartype authors.
# See "LICENSE" for further details.
'''
Project-wide **callable tester** (i.e., callable testing various properties of
passed callables) utilities.
This private submodule... | 9 | 7 | 0 | 0 | 16 | 0 |
pymoo/problems/constr_as_penalty.py | jarreguit/pymoo | 762 | 140113 | from pymoo.core.problem import Problem
from pymoo.problems.meta import MetaProblem
from pymoo.util.misc import at_least_2d_array
class ConstraintsAsPenalty(MetaProblem):
def __init__(self, problem, penalty: float=1e6):
super().__init__(problem)
self.penalty = penalty
# set the constraint... | 1 | 0 | 0 | 1 | 2 | 0 |
airbyte-integrations/connectors/source-s3/unit_tests/test_abstract_file_parser.py | darian-heede/airbyte | 6,215 | 140116 | #
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
#
import pyarrow as pa
import pytest
from airbyte_cdk import AirbyteLogger
from source_s3.source_files_abstract.formats.abstract_file_parser import AbstractFileParser
LOGGER = AirbyteLogger()
class TestAbstractFileParserStatics:
@pytest.mark.parametrize... | 0 | 0 | 0 | 0 | 0 | 0 |
contrib/memtest.py | achievement008/followthemoney | 137 | 140121 | <filename>contrib/memtest.py
import sys
import logging
import balkhash
from followthemoney import model
from followthemoney.types import registry
fmt = "%(name)s [%(levelname)s] %(message)s"
logging.basicConfig(stream=sys.stderr, level=logging.INFO, format=fmt)
registry.text.max_size = 1 * 1024 * 1024
dataset = balk... | 0 | 0 | 0 | 0 | 0 | 0 |
anuga/operators/base_operator.py | samcom12/anuga_core | 136 | 140144 | <reponame>samcom12/anuga_core
from __future__ import print_function
from builtins import object
from anuga.utilities.system_tools import log_to_file
class Operator(object):
"""Operator - generic structure for a fractional operator
This is the base class for all fractional step operators
"""
co... | 0 | 0 | 0 | 0 | 0 | 0 |
data_collection/gazette/spiders/sc_garopaba.py | kaiocp/querido-diario | 454 | 140153 | from gazette.spiders.base.fecam import FecamGazetteSpider
class ScGaropabaSpider(FecamGazetteSpider):
name: str = "sc_garopaba"
FECAM_QUERY: str = "cod_entidade:98"
TERRITORY_ID: str = "4205704"
| 0 | 0 | 3 | 0 | 3 | 0 |
lib/datasets/textdataset_catalog.py | Ocelot7777/masktextspotter.caffe2 | 287 | 140160 | <gh_stars>100-1000
# Modified by <NAME>
# ##############################################################################
# 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 obt... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/train_classifier.py | TwentyBN/Sense | 483 | 140173 | #!/usr/bin/env python
from __future__ import annotations
"""
Finetuning script that can be used to train a custom classifier on top of our pretrained models.
Usage:
train_classifier.py --path_in=PATH
[--model_name=NAME]
[--model_version=VERSION]
[... | 5 | 1 | 0 | 0 | 6 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.