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 |
|---|---|---|---|---|---|---|---|---|---|---|
janitor/functions/bin_numeric.py | vishalbelsare/pyjanitor | 674 | 3305321 | <filename>janitor/functions/bin_numeric.py
from typing import Hashable, Optional
import pandas_flavor as pf
import pandas as pd
from janitor.utils import deprecated_alias
@pf.register_dataframe_method
@deprecated_alias(from_column="from_column_name", to_column="to_column_name")
def bin_numeric(
df: pd.DataFrame,... | 0 | 0 | 0 | 0 | 0 | 0 |
cctbx/regression/tst_geometry_restraints.py | dperl-sol/cctbx_project | 155 | 3305327 | from __future__ import absolute_import, division, print_function
from iotbx.pdb.tst_pdb import dump_pdb
from cctbx import geometry_restraints
from iotbx.pymol import pml_stick, pml_write
from cctbx.array_family import flex
from scitbx.matrix import col, sqr
from scitbx.math import euler_angles_as_matrix
from libtbx.tes... | 5 | 5 | 0 | 0 | 10 | 0 |
landlab/components/radiation/__init__.py | amanaster2/landlab | 257 | 3305341 | <reponame>amanaster2/landlab
from .radiation import Radiation
__all__ = ["Radiation"]
| 0 | 0 | 0 | 0 | 0 | 0 |
server/libs/webserver/blueprints/general_settings_executer.py | teemosauce/rpi-cube | 195 | 3305374 | from libs.webserver.executer_base import ExecuterBase
class GeneralSettingsExecuter(ExecuterBase):
def get_general_setting(self, setting_key) -> object:
return self._config["general_settings"][setting_key]
def get_general_settings(self) -> object:
general_settings = dict()
for settin... | 0 | 4 | 0 | 0 | 4 | 0 |
doc/src/rw/OneDimParticle.py | solisius/ComputationalPhysics | 220 | 3305387 | # Program to test the Metropolis algorithm with one particle at given temp in one dimension
import numpy as np
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
import random
from math import sqrt, exp, log
# initialize the rng with a seed
random.seed()
# Hard coding of input parameters
MCcycles = 100000
T... | 0 | 0 | 0 | 0 | 0 | 0 |
fuzzers/ECP5/121-eclk/fuzzer.py | Keno/prjtrellis | 256 | 3305432 | from fuzzconfig import FuzzConfig
import interconnect
import pytrellis
jobs = [
{
"cfg": FuzzConfig(job="LECLK_45K", family="ECP5", device="LFE5U-45F", ncl="emux_45k.ncl",
tiles=["CIB_R34C2:ECLK_L"]),
"eclk_loc": ["R34C0", "R35C0"],
"prefix": "45K_",
"bank_... | 0 | 1 | 0 | 0 | 1 | 0 |
src/python/phyre/eval_task_complexity.py | k101w/phyre_ODE | 432 | 3305437 | <filename>src/python/phyre/eval_task_complexity.py
# Copyright (c) Facebook, Inc. and its affiliates.
#
# 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/LI... | 0 | 0 | 0 | 0 | 0 | 0 |
chainerx/_docs/context.py | zaltoprofen/chainer | 3,705 | 3305460 | <gh_stars>1000+
import chainerx
from chainerx import _docs
def set_docs():
Context = chainerx.Context
_docs.set_doc(
Context,
"""Context()
An isolated execution environment of ChainerX.
In Python binding, a single context is automatically created and set as the
global default context on impo... | 0 | 0 | 0 | 0 | 0 | 0 |
pgl/sampling/sage.py | zbmain/PGL | 1,389 | 3305461 | <gh_stars>1000+
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 0 | 0 | 0 | 0 | 0 | 0 |
apps/order/migrations/0003_auto_20190923_1554.py | vinny-YZF/django | 290 | 3305473 | <filename>apps/order/migrations/0003_auto_20190923_1554.py
# Generated by Django 2.2.5 on 2019-09-23 07:54
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("order", "0002_auto_20190916_1514"),
]
operations = [
migrations.AlterModelOptions(
... | 0 | 0 | 0 | 0 | 0 | 0 |
objax/functional/core/ops.py | kihyuks/objax | 715 | 3305483 | <gh_stars>100-1000
# Copyright 2020 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 |
aten.bzl | wenhaopeter/read_pytorch_code | 206 | 3305486 | <reponame>wenhaopeter/read_pytorch_code
load("@rules_cc//cc:defs.bzl", "cc_library")
CPU_CAPABILITY_NAMES = ["DEFAULT", "AVX", "AVX2"]
CAPABILITY_COMPILER_FLAGS = {
"AVX2": ["-mavx2", "-mfma"],
"AVX": ["-mavx"],
"DEFAULT": [],
}
PREFIX = "aten/src/ATen/native/"
def intern_build_aten_ops(copts, deps):
... | 0 | 0 | 0 | 0 | 0 | 0 |
test/rplugin/python3/deoppet/test_parser.py | Shougo/deoppet.nvim | 289 | 3305524 | <filename>test/rplugin/python3/deoppet/test_parser.py<gh_stars>100-1000
import sys
print(sys.path)
from deoppet.parser import Parser
from unittest.mock import Mock
def test_parse_success():
vim = Mock()
parser = Parser(vim, 'test', [])
test_snippet0 = """
"""
assert parser.parse(test_snippet0) == {}
... | 0 | 0 | 0 | 0 | 0 | 0 |
social_core/tests/backends/test_taobao.py | shnaqawi/social-core | 745 | 3305549 | <reponame>shnaqawi/social-core
import json
from .oauth import OAuth2Test
class TaobaoOAuth2Test(OAuth2Test):
backend_path = 'social_core.backends.taobao.TAOBAOAuth'
user_data_url = 'https://eco.taobao.com/router/rest'
expected_username = 'foobar'
access_token_body = json.dumps({
'access_token... | 0 | 0 | 0 | 0 | 0 | 0 |
histomicstk/preprocessing/color_deconvolution/rgb_separate_stains_macenko_pca.py | basanto/HistomicsTK | 249 | 3305559 | from .separate_stains_macenko_pca import separate_stains_macenko_pca
from ..color_conversion import rgb_to_sda
def rgb_separate_stains_macenko_pca(im_rgb, I_0, *args, **kwargs) -> object:
"""Compute the stain matrix for color deconvolution with the "Macenko"
method from an RGB image or matrix.
Parameters... | 0 | 1 | 0 | 0 | 1 | 0 |
Covid -19-Detection-Using-Chest-X-Ray/test.py | A-kriti/Amazing-Python-Scripts | 930 | 3305580 | <filename>Covid -19-Detection-Using-Chest-X-Ray/test.py
import numpy as np
import matplotlib.pyplot as plt
import tensorflow.keras as keras
#from keras.layers import *
#from keras.models import *
from tensorflow.keras.preprocessing import image
from tensorflow.keras.preprocessing.image import load_img
from tensorflow.k... | 0 | 0 | 0 | 0 | 0 | 0 |
source/code/troubleshooter/modules/syslog_tst/check_rsysng.py | akenamon/OMS-Agent-for-Linux | 252 | 3305604 | import os
import subprocess
from error_codes import *
from errors import error_info, is_error
from helpers import add_geninfo, geninfo_lookup
RSYSLOG_DIR = "/etc/rsyslog.d"
OLD_RSYSLOG_DEST = "/etc/rsyslog.conf"
RSYSLOG_DEST = os.path.join(RSYSLOG_DIR, "95-omsagent.conf")
SYSLOG_NG_DEST = "/etc/syslog-ng/sys... | 0 | 6 | 0 | 0 | 6 | 0 |
src/robusta/core/sinks/opsgenie/opsgenie_sink.py | pavangudiwada/robusta | 273 | 3305609 | <gh_stars>100-1000
import logging
import opsgenie_sdk
from typing import List
from .opsgenie_sink_params import OpsGenieSinkConfigWrapper
from ..transformer import Transformer
from ...reporting.base import (
Finding,
Enrichment,
FindingSeverity,
)
from ..sink_base import SinkBase
# Robusta has only 4 seve... | 0 | 0 | 0 | 0 | 0 | 0 |
helpers/feature_extraction.py | zoegroes/Amazon | 144 | 3305610 | """feature_extraction.py
Create the requested datasets.
Author: <NAME> <<EMAIL>>
"""
from __future__ import division
import logging
import cPickle as pickle
import numpy as np
import math
from scipy import sparse
from sklearn import preprocessing
from external import greedy, ben
from data import save_dataset
from... | 7 | 8 | 0 | 1 | 16 | 0 |
concourse-driver-python/concourse/thriftapi/data/ttypes.py | surendranaidu/concourse | 371 | 3305613 | <filename>concourse-driver-python/concourse/thriftapi/data/ttypes.py
#
# Autogenerated by Thrift Compiler (0.9.2)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
from ..shared.ttypes import *... | 0 | 0 | 0 | 0 | 0 | 0 |
test/SIM_test_sched/RUN_test/unit_test.py | gilbertguoze/trick | 647 | 3305681 | <reponame>gilbertguoze/trick<gh_stars>100-1000
from trick.unit_test import *
if trick.mc_get_slave_id() == 0:
trick_utest.unit_tests.enable();
trick_utest.unit_tests.set_file_name( os.getenv("TRICK_HOME") + "/trick_test/SIM_test_sched.xml")
my_integ_loop.getIntegrator(trick.Runge_Kutta_4, 2)
trick.sim_servic... | 0 | 0 | 0 | 0 | 0 | 0 |
alf/utils/dist_utils.py | www2171668/alf | 175 | 3305683 | <filename>alf/utils/dist_utils.py
# Copyright (c) 2020 Horizon Robotics and ALF Contributors. 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.o... | 0 | 0 | 0 | 0 | 0 | 0 |
src/tests/docs/t_conduit_docs_tutorial_python_parse.py | adrienbernede/conduit | 120 | 3305698 | # Copyright (c) Lawrence Livermore National Security, LLC and other Conduit
# Project developers. See top-level LICENSE AND COPYRIGHT files for dates and
# other details. No copyright assignment is required to contribute to Conduit.
"""
file: t_conduit_docs_tutorial_python_examples.py
"""
import sys
import unittest
i... | 0 | 0 | 0 | 0 | 0 | 0 |
api/features/multivariate/migrations/0002_add_unique_constraint_for_mv_feature_states.py | SolidStateGroup/Bullet-Train-API | 126 | 3305702 | # Generated by Django 2.2.24 on 2021-10-21 13:51
from django.db import migrations
from django.db.models import Max
def remove_duplicate_mv_feature_state_values(apps, schema_editor):
MultivariateFeatureStateValue = apps.get_model(
"multivariate", "MultivariateFeatureStateValue"
)
# This query ess... | 0 | 0 | 2 | 0 | 2 | 0 |
01_train_and_debug/source_dir/train_xgboost.py | derickcity/reinvent2019-aim362-sagemaker-debugger-model-monitor | 129 | 3305712 | import argparse
import bz2
import json
import os
import pickle
import random
import tempfile
import urllib.request
import pandas as pd
import glob
import pickle as pkl
import xgboost
from smdebug import SaveConfig
from smdebug.xgboost import Hook
def parse_args() -> object:
parser = argparse.ArgumentParser()
... | 0 | 1 | 0 | 0 | 1 | 0 |
tests/py/test_cron.py | liberapay/liberapay.com | 1,322 | 3305759 | from datetime import datetime, timedelta
import json
from unittest.mock import patch
from psycopg2.extras import execute_values
from liberapay.cron import Daily, Weekly
from liberapay.i18n.currencies import fetch_currency_exchange_rates
from liberapay.models.participant import send_account_disabled_notifications
from... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/python_/typesets/test_python_standard_set.py | bhumikapahariapuresoftware/visions | 142 | 3305776 | from typing import Dict, Set, Type
import pytest
from visions import StandardSet, VisionsBaseType
from visions.backends.python.sequences import get_sequences
from visions.test.utils import (
cast,
contains,
convert,
get_cast_cases,
get_contains_cases,
get_convert_cases,
get_inference_cases... | 0 | 0 | 1 | 0 | 1 | 0 |
tools/distributed_train.py | sketscripter/emotional-chatbot-cakechat | 1,608 | 3305787 | <reponame>sketscripter/emotional-chatbot-cakechat
import os
import sys
import argparse
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from cakechat.utils.env import run_horovod_train
def parse_args():
argparser = argparse.ArgumentParser()
argparser.add_argument('-g', '--gpu-ids... | 0 | 0 | 0 | 0 | 0 | 0 |
socks5-node-docker/sentinel/server/__init__.py | 14avengers/sentinel | 342 | 3305807 | <reponame>14avengers/sentinel
# coding=utf-8
from .token import Token
from .vpn import GetSockCreds
| 0 | 0 | 0 | 0 | 0 | 0 |
lldb/test/API/functionalities/breakpoint/breakpoint_by_file_colon_line/TestBreakpointByFileColonLine.py | mkinsner/llvm | 2,338 | 3305850 | <gh_stars>1000+
"""
Test setting a breakpoint by line and column.
"""
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class BreakpointByLineAndColumnTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
def testBreakpoin... | 0 | 0 | 0 | 0 | 0 | 0 |
django_tenants/files/storages.py | buraketmen/django-tenants | 514 | 3305853 | <gh_stars>100-1000
import warnings
from django_tenants.files.storage import TenantFileSystemStorage as NewTenantFileSystemStorage
class TenantFileSystemStorage(NewTenantFileSystemStorage):
"""
Deprecated - Use django_tenants.files.storage.TenantFileSystemStorage instead
"""
def __init__(self, locati... | 0 | 0 | 0 | 0 | 0 | 0 |
scitbx/lbfgs/tst_func_free_line_search.py | dperl-sol/cctbx_project | 155 | 3305876 | <reponame>dperl-sol/cctbx_project
from __future__ import absolute_import, division, print_function
from scitbx.array_family import flex
import scitbx.lbfgs
from libtbx import adopt_init_args
from libtbx.test_utils import approx_equal
def func(x1,x2,x3):
return (x1-2)**2 + (x2+5)**2 + (x3-500)**4
def grad(x1,x2,x3):... | 0 | 0 | 0 | 0 | 0 | 0 |
python/IECoreMaya/Collapsible.py | bradleyhenke/cortex | 386 | 3305878 | <filename>python/IECoreMaya/Collapsible.py<gh_stars>100-1000
##########################################################################
#
# Copyright (c) 2011, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided t... | 0 | 0 | 0 | 0 | 0 | 0 |
thred/util/wget.py | panxuemiao111/THRED | 102 | 3305879 | <gh_stars>100-1000
"""
Taken from https://github.com/tqdm/tqdm/blob/master/examples/tqdm_wget.py
"""
from tqdm import tqdm
from urllib.request import urlretrieve
class TqdmUpTo(tqdm):
"""Alternative Class-based version of the above.
Provides `update_to(n)` which uses `tqdm.update(delta_n)`.
Inspired by [... | 0 | 0 | 0 | 0 | 0 | 0 |
src/dispatch/plugin/models.py | axellaurelut/dispatch | 3,417 | 3305891 | <reponame>axellaurelut/dispatch
from typing import Any, List, Optional
from pydantic import Field, SecretStr
from pydantic.json import pydantic_encoder
from sqlalchemy.orm import relationship
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy import Column, Integer, String, Boolean, Foreign... | 0 | 0 | 0 | 0 | 0 | 0 |
solidity/python/InputGenerator/__init__.py | frankwei98/contracts | 200 | 3305920 | <reponame>frankwei98/contracts<gh_stars>100-1000
from math import log
def UniformDistribution(minimumValue,maximumValue,samplesCount):
return [minimumValue+n*(maximumValue-minimumValue)//(samplesCount-1) for n in range(samplesCount)]
def ExponentialDistribution(minimumValue,maximumValue,growthFactor):
retur... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/bufile_2_hdf5.py | alfred100p/VC-R-CNN | 344 | 3305931 | import numpy as np
import h5py
import os
bu_rcnn_dir = '/data4/tingjia/wt/budata/coco_cor2_all_bu'
#box_dir = '/data4/tingjia/wt/budata/cocobu_box'
bu_list = os.listdir(bu_rcnn_dir)
for image in bu_list:
feature = np.load(os.path.join(bu_rcnn_dir, image))
#bbox = np.load(os.path.join(box_dir, image)... | 0 | 0 | 0 | 0 | 0 | 0 |
btmakemetafile.py | crossbrowsertesting/BitTornado | 116 | 3306024 | #!/usr/bin/env python3
# Written by <NAME>
# multitracker extensions by <NAME>
# see LICENSE.txt for license information
import sys
import os
from BitTornado.Application.makemetafile import make_meta_file, defaults, \
announcelist_details
from BitTornado.Application.parseargs import parseargs, formatDefinitions
... | 0 | 1 | 0 | 0 | 1 | 0 |
src/beanmachine/ppl/experimental/tests/mala/mala_proposer_test.py | facebookresearch/beanmachine | 177 | 3306029 | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import beanmachine.ppl as bm
import pytest
import torch
import torch.distributions as dist
from beanmachine.ppl.experimental.mala.mala_propo... | 0 | 4 | 0 | 0 | 4 | 0 |
examples/speech_recognition/data/replabels.py | nedo0shki/fairseq-editor | 5,129 | 3306063 | #!/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.
"""
Replabel transforms for use with wav2letter's ASG criterion.
"""
def replabel_symbol(i) -> object:
"""
R... | 0 | 3 | 0 | 0 | 3 | 0 |
tests/test_virtual_chassis.py | arvbb/sonic-swss | 132 | 3306065 | from swsscommon import swsscommon
from dvslib.dvs_database import DVSDatabase
import ast
class TestVirtualChassis(object):
def set_lag_id_boundaries(self, vct):
"""This functions sets lag id boundaries in the chassis app db.
In VOQ systems the lag id boundaries need to be set before confi... | 0 | 8 | 0 | 0 | 8 | 0 |
tensorlog/xctargets.py | saraswat/TensorLog | 108 | 3306078 | <filename>tensorlog/xctargets.py
# collect available target languages:
try:
import tensorflow as private1
tf=True
except:
tf=False
try:
import theano as private2
theano=True
except:
theano=False
# disable theano tests for now, some of them fail and it's not a
# priority...
theano=False
| 0 | 0 | 0 | 0 | 0 | 0 |
benchmarks/gen_data.py | davidjamesknight/NimData | 331 | 3306100 | #!/usr/bin/env python
from __future__ import division, print_function
import pandas as pd
import numpy as np
import itertools
def gen_data(filename, N, num_int_cols: int=2, num_float_cols: int=2):
data = {}
for col in xrange(num_int_cols):
data["int_col_{}".format(col)] = np.random.randint(0, 100,... | 4 | 1 | 0 | 0 | 5 | 0 |
george/solvers/trivial.py | rychallener/george | 379 | 3306102 | # -*- coding: utf-8 -*-
from __future__ import annotations
from __future__ import division, print_function
__all__ = ["TrivialSolver"]
import numpy as np
from ..kernels import EmptyKernel
class TrivialSolver(object):
def __init__(self, kernel: object | None=None):
if (kernel is not None and
... | 2 | 3 | 0 | 2 | 7 | 0 |
rplugin/python3/deoplete/sources/tmuxcomplete.py | stungkit/tmux-complete.vim | 465 | 3306105 | <reponame>stungkit/tmux-complete.vim
from subprocess import check_output
from deoplete.base.source import Base
class Source(Base):
def __init__(self, vim):
Base.__init__(self, vim)
self.name = 'tmux-complete'
self.kind = 'keyword'
self.mark = '[tmux]'
self.rank = 4
d... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_common.py | dimidd/skift | 244 | 3306116 | """Test common skift functionalities."""
import pytest
import pandas as pd
from sklearn.model_selection import cross_val_score
from skift import (
FirstColFtClassifier,
IdxBasedFtClassifier,
ColLblBasedFtClassifier,
FirstObjFtClassifier,
SeriesFtClassifier,
)
def _ftdf() -> object:
return pd... | 0 | 2 | 0 | 0 | 2 | 0 |
screeninfo/__init__.py | benshep/screeninfo | 131 | 3306124 | <gh_stars>100-1000
from .common import Enumerator, Monitor
from .screeninfo import get_monitors
| 0 | 0 | 0 | 0 | 0 | 0 |
rlgraph/tests/performance/test_backends.py | RLGraph/RLGraph | 290 | 3306125 | <reponame>RLGraph/RLGraph<gh_stars>100-1000
# Copyright 2018/2019 The RLgraph 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/licen... | 0 | 0 | 0 | 0 | 0 | 0 |
.travis-run-local.py | max619/GameNetworkingSockets | 6,199 | 3306131 | #!/usr/bin/python
from __future__ import annotations
"""
Usage:
.travis-run-local.py [--arch=<arch>] [--image=<image> --image-tag=<tag>]
Options:
-h --help Print this help message.
--arch=<arch> Only build in containers with this CPU architecture. [default: any]
--image=<image> Only bu... | 0 | 5 | 0 | 0 | 5 | 0 |
leaf/weixin/accesstoken/settings.py | guiqiqi/leaf | 119 | 3306152 | <reponame>guiqiqi/leaf<filename>leaf/weixin/accesstoken/settings.py
"""
AccessToken 获取配置
"""
# 默认最大的重试次数 - 大于零
MaxRetries = 5
# 每两次获取之间的时间间隔
Pre = 30
Gap = 7200 - Pre
# 请求的地址
Address = "https://api.weixin.qq.com/cgi-bin/token"
| 0 | 0 | 0 | 0 | 0 | 0 |
recipes/Python/279230_getReverseConnectivity/recipe-279230.py | tdiprima/code | 2,023 | 3306153 | <reponame>tdiprima/code<filename>recipes/Python/279230_getReverseConnectivity/recipe-279230.py<gh_stars>1000+
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def getReverseConnectivity(connectivity):
"""getReverseConnectivity(connectivity) -->
resort connectivity dict with nodes as keys"""
reverseConnectivity ... | 0 | 0 | 0 | 0 | 0 | 0 |
bumblebee_status/modules/contrib/network_traffic.py | spxtr/bumblebee-status | 1,089 | 3306180 | <filename>bumblebee_status/modules/contrib/network_traffic.py<gh_stars>1000+
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Displays network traffic
* No extra configuration needed
contributed by `izn <https://github.com/izn>`_ - many thanks!
"""
import psutil
import netifaces
import core.module
import core.wi... | 0 | 0 | 0 | 0 | 0 | 0 |
icssploit/test/__init__.py | reanimat0r/isf | 845 | 3306182 | from icssploit.test.test_case import icssploitTestCase
| 0 | 0 | 0 | 0 | 0 | 0 |
videos/manimTutorial/part1_Mobjectmethod/Method.py | AStarySky/manim_sandbox | 366 | 3306193 | <filename>videos/manimTutorial/part1_Mobjectmethod/Method.py<gh_stars>100-1000
from manimlib.imports import *
from manim_sandbox.utils.imports import *
class VideoCover(Scene):
def construct(self):
background = Rectangle(width=18, height=3.5, fill_opacity=0.7, fill_color=BLACK, stroke_width=0).shi... | 0 | 0 | 0 | 0 | 0 | 0 |
src/wagtailmedia/migrations/0003_copy_media_permissions_to_collections.py | cursive-works/wagtailmedia | 176 | 3306225 | <filename>src/wagtailmedia/migrations/0003_copy_media_permissions_to_collections.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def get_media_permissions(apps):
# return a queryset of the 'add_media' and 'change_media' permissions
Permission = apps.get_mod... | 0 | 0 | 0 | 0 | 0 | 0 |
subsync/model/convert.py | tympanix/subsync | 108 | 3306267 | # https://github.com/bitbionic/keras-to-tensorflow
import os
import os.path as osp
import argparse
import tensorflow as tf
from keras.models import load_model
from keras import backend as K
def convertGraph(modelPath, output, outPath):
'''
Converts an HD5F file to a .pb file for use with Tensorflow.
Arg... | 0 | 0 | 0 | 0 | 0 | 0 |
swampdragon/serializers/object_map.py | aswinkp/swampdragon | 366 | 3306288 | from __future__ import annotations
try:
# bis 1.8.x
from django.db.models.fields.related import ReverseSingleRelatedObjectDescriptor
from django.db.models.fields.related import ManyRelatedObjectsDescriptor
from django.db.models.fields.related import ReverseManyRelatedObjectsDescriptor
from django.db... | 1 | 3 | 0 | 0 | 4 | 0 |
release/scripts/freestyle/modules/freestyle/utils.py | MarkC-b3d/blender-mc3d | 365 | 3306310 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | 6 | 24 | 1 | 2 | 33 | 0 |
components/alibi-detect-server/adserver/protocols/request_handler.py | juldou/seldon-core | 3,049 | 3306319 | from typing import Dict, List, Union
class RequestHandler(object):
def __init__(self, request: Dict):
self.request = request
def validate(self):
"""
Validate the request
"""
raise NotImplementedError
def extract_request(self) -> Union[List,Dict]:
"""
... | 1 | 1 | 0 | 0 | 2 | 0 |
utils/progress_disp.py | merlinarer/scrl | 102 | 3306342 | import re
from tqdm import tqdm
import logging
from distributed import comm
from utils import Colorer
LINE_DISPLAY_FREQ = 0.1
log = logging.getLogger('main')
C = Colorer.instance()
class DistributedProgressDisplayer(object):
"""Progress logger for the distributed learning environment. Tqdm progress
bars ar... | 3 | 2 | 0 | 1 | 6 | 0 |
vendor/github.com/elastic/beats/packetbeat/tests/system/test_0025_procs_config.py | rfraposa/hadoopbeat | 115 | 3306363 | from packetbeat import BaseTest
"""
Tests for checking the procs monitoring configuration.
"""
class Test(BaseTest):
MsgNotOnLinux: str = "Disabled /proc/ reading because not on linux"
MsgEnabled: str = "Process matching enabled"
def test_procs_default(self):
"""
Should be disabled by d... | 0 | 0 | 2 | 0 | 2 | 0 |
examples/onnx/pytorch/translation/bart_onnx/reduce_onnx_size.py | cnarte/transformers | 50,404 | 3306370 | import os
import numpy
import onnx
def is_equal_tensor_proto(a, b) -> object:
name_a = a.name
name_b = b.name
a.name = ""
b.name = ""
res = a == b
a.name = name_a
b.name = name_b
return res
def node_replace_input_with(node_proto, name, new_name):
for i, input_name in enumer... | 0 | 2 | 0 | 0 | 2 | 0 |
google-api-client-generator/src/googleapis/codegen/utilities/ordered_set.py | cclauss/discovery-artifact-manager | 178 | 3306376 | #!/usr/bin/python2.7
from __future__ import annotations
"""Ordered set implementations."""
import collections
class _OrderedSetBase(object):
def __init__(self, iterable: object | None=None):
self._set = collections.OrderedDict()
if iterable:
for i in iterable:
self._set[i] = 1
def __len__... | 1 | 3 | 0 | 0 | 4 | 0 |
train.py | ivendrov/order-embedding | 180 | 3306402 | """
Main trainer function
"""
import theano
import cPickle as pkl
import json
import os
import time
import datasource
from utils import *
from optim import adam
from model import init_params, build_model, build_sentence_encoder, build_image_encoder, build_errors
from vocab import build_dictionary
from evaluation im... | 0 | 0 | 0 | 0 | 0 | 0 |
moshmosh/extensions/pattern_matching/runtime.py | Aloxaf/moshmosh | 114 | 3306424 | <filename>moshmosh/extensions/pattern_matching/runtime.py<gh_stars>100-1000
from copy import copy
import itertools
class NotExhaustive(Exception):
pass
class ListViewProspectiveGrowError(Exception):
pass
class ListView(list):
# noinspection PyMissingConstructor
def __init__(self, src, view_indices)... | 0 | 0 | 0 | 0 | 0 | 0 |
dagon.py | fir3storm/Dagon | 188 | 3306429 | #!/usr/bin/env python
import optparse
import os
import random
import subprocess
import sys
import time
import traceback
from bin.verify_hashes.verify import verify_hash_type
from bin.generators import Generators
from bin.attacks.bruteforce.bf_attack import (
bruteforce_main,
)
from lib.settings import (
LOGGE... | 0 | 0 | 0 | 0 | 0 | 0 |
winapi__screenshot_window.py | DazEB2/SimplePyScripts | 117 | 3306435 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
# SOURCE: https://stackoverflow.com/a/24352388/5909792
import win32gui
import win32ui
from ctypes import windll
from PIL import Image
hwnd = win32gui.FindWindow(None, 'Telegram')
# Change the line below depending on whether you want the whole... | 0 | 0 | 0 | 0 | 0 | 0 |
demos/shrine/libs/baseclass/box_bottom_sheet.py | Jonypr-code/KivyMD | 1,111 | 3306456 | from kivy.animation import Animation
from kivy.clock import Clock
from kivy.core.window import Window
from kivy.metrics import dp
from kivy.properties import BooleanProperty, ObjectProperty, StringProperty
from kivy.uix.behaviors import ButtonBehavior
from kivy.uix.image import Image
from kivy.uix.recycleview import Re... | 0 | 0 | 0 | 0 | 0 | 0 |
chrome/test/enterprise/e2e/policy/password_manager_enabled/password_manager_enabled_webdriver_test.py | zealoussnow/chromium | 14,668 | 3306457 | # Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import annotations
import test_util
from absl import app
def getElementFromShadowRoot(driver, element, selector) -> object | None:
if ele... | 0 | 1 | 0 | 0 | 1 | 0 |
3]. Competitive Programming/03]. LeetCode/1]. Problems/Python/0021)_ii_Merge_Two_Sorted_Lists.py | MLinesCode/The-Complete-FAANG-Preparation | 6,969 | 3306461 | <reponame>MLinesCode/The-Complete-FAANG-Preparation<gh_stars>1000+
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def mergeTwoLists(self, l1, l2):
if not l1:
return l2
... | 0 | 0 | 0 | 0 | 0 | 0 |
openbook_posts/migrations/0008_auto_20181113_1830.py | TamaraAbells/okuna-api | 164 | 3306462 | # Generated by Django 2.1.3 on 2018-11-13 17:30
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies: list[tuple[str, str]] = [
('openbook_posts', '0007_postcomment_post'),
]
operations: list[object] = [
migrations... | 0 | 0 | 2 | 0 | 2 | 0 |
corehq/messaging/scheduling/tests/util.py | dimagilg/commcare-hq | 471 | 3306473 | from corehq.messaging.scheduling.models import AlertSchedule, TimedSchedule
from corehq.util.test_utils import unit_testing_only
@unit_testing_only
def delete_alert_schedules(domain):
for schedule in AlertSchedule.objects.filter(domain=domain):
schedule.delete_related_events()
schedule.delete()
... | 0 | 0 | 0 | 0 | 0 | 0 |
test/jpypetest/test_javadoc.py | pitmanst/jpype | 531 | 3306494 | # *****************************************************************************
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | 0 | 0 | 0 | 0 | 0 | 0 |
test/run/t266.py | timmartin/skulpt | 2,671 | 3306517 | <reponame>timmartin/skulpt
print False == None
if not None:
print "This statement evaluates to True."
if None:
print "This statement evaluates to False."
| 0 | 0 | 0 | 0 | 0 | 0 |
aboleth/initialisers.py | determinant-io/aboleth | 117 | 3306523 | """Functions for initialising weights or distributions."""
import numpy as np
import tensorflow as tf
from aboleth.random import seedgen
from aboleth.util import pos_variable, summary_scalar
def _glorot_std(n_in, n_out) -> object:
"""
Compute the standard deviation for initialising weights.
See Glorot a... | 0 | 4 | 0 | 0 | 4 | 0 |
leonardo/module/leonardo_auth/widget/registration/models.py | timgates42/django-leonardo | 102 | 3306538 | <filename>leonardo/module/leonardo_auth/widget/registration/models.py
# -#- coding: utf-8 -#-
from django.utils.translation import ugettext_lazy as _
from leonardo.module.web.models import Widget
class UserRegistrationWidget(Widget):
def get_context_data(self, request):
context = super(UserRegistratio... | 0 | 0 | 0 | 0 | 0 | 0 |
hikyuu/data/common_sqlite3.py | kknet/hikyuu | 1,283 | 3306573 | <filename>hikyuu/data/common_sqlite3.py
# coding:utf-8
#
# The MIT License (MIT)
#
# Copyright (c) 2010-2019 fasiondog/hikyuu
#
# 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 restric... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/resources/tagging.py | stitchfix/hamilton | 298 | 3306609 | from hamilton.function_modifiers import tag, extract_fields
@tag(test='a')
def a() -> int:
return 0
@tag(test='b_c')
@extract_fields({'b': int, 'c': str})
def b_c(a: int) -> dict:
return {'b': a, 'c': str(a)}
def d(a: int) -> int:
return a
| 2 | 3 | 0 | 0 | 5 | 0 |
Configuration/ProcessModifiers/python/run2_miniAOD_UL_preSummer20_cff.py | ckamtsikis/cmssw | 852 | 3306612 | import FWCore.ParameterSet.Config as cms
from Configuration.ProcessModifiers.run2_miniAOD_UL_cff import run2_miniAOD_UL
from Configuration.ProcessModifiers.miniAOD_skip_trackExtras_cff import miniAOD_skip_trackExtras
# This modifier is for additional settings to run miniAOD on top of
# ultra-legacy (during LS2) Run-... | 0 | 0 | 0 | 0 | 0 | 0 |
atlas/foundations_internal/src/integration/__init__.py | DeepLearnI/atlas | 296 | 3306684 | <reponame>DeepLearnI/atlas
import integration.config | 0 | 0 | 0 | 0 | 0 | 0 |
needl/tasks/google.py | NeuroWinter/Needl | 413 | 3306688 | <reponame>NeuroWinter/Needl
import needl, needl.schedule as schedule, needl.utils as utils
GOOGLE = needl.settings['google']['base_url']
def register():
# todo: ugly as hell
se = needl.settings['google']['search_interval']
args = map(int, se.split('..'))
schedule.every(*args).minutes.do(search)
def... | 0 | 0 | 0 | 0 | 0 | 0 |
spatialpandas/geometry/ring.py | giancastro/spatialpandas | 207 | 3306690 | import numpy as np
from dask.dataframe.extensions import make_array_nonempty
from pandas.core.dtypes.dtypes import register_extension_dtype
from ..geometry.line import Line, LineArray, LineDtype
@register_extension_dtype
class RingDtype(LineDtype):
_geometry_name: str = 'ring'
@classmethod
def construct... | 0 | 7 | 1 | 0 | 8 | 0 |
lib/augment3D/random_rotate.py | McMasterAI/RadiologyandAI-MedicalZooPytorch | 995 | 3306695 | <reponame>McMasterAI/RadiologyandAI-MedicalZooPytorch
import numpy as np
import scipy.ndimage as ndimage
def random_rotate3D(img_numpy, min_angle, max_angle):
"""
Returns a random rotated array in the same shape
:param img_numpy: 3D numpy array
:param min_angle: in degrees
:param max_angle: in deg... | 0 | 0 | 0 | 0 | 0 | 0 |
notifications/migrations/0001_initial.py | gaybro8777/django-notifs | 145 | 3306699 | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-06-24 00:20
from __future__ import unicode_literals
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial: bool = True
dependencies: list[object] = ... | 0 | 0 | 3 | 0 | 3 | 0 |
python/samples/gui.py | robn/spidriver | 142 | 3306717 | <reponame>robn/spidriver
# coding=utf-8
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, GLib
import re
import struct
from spidriver import SPIDriver
def ison(button): return button.get_state() == Gtk.StateType.ACTIVE
def ishex(s): return re.match("[0-9a-fA-F]{2}$", s) is not None
class SP... | 0 | 0 | 0 | 0 | 0 | 0 |
example_project/settings.py | PetrDlouhy/django-experiments | 237 | 3306720 | <filename>example_project/settings.py
import os.path
import sys
# Experiments Settings
EXPERIMENTS_GOALS = (
'page_goal',
'js_goal',
'cookie_goal',
)
EXPERIMENTS_AUTO_CREATE = True
EXPERIMENTS_VERIFY_HUMAN = True #Careful with this setting, if it is toggled then participant counters will not increment ac... | 0 | 0 | 0 | 0 | 0 | 0 |
c7n/resources/waf.py | StevenGunn/cloud-custodian | 1,787 | 3306733 | # Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from c7n.manager import resources
from c7n.query import ConfigSource, QueryResourceManager, TypeInfo, DescribeSource
from c7n.tags import universal_augment
class DescribeRegionalWaf(DescribeSource):
def augment(self, resources) -> obje... | 0 | 3 | 29 | 0 | 32 | 0 |
arnold/Arnold-DomemasterStereo-src/mtoa/ae/LatLongStereoTemplate.py | dspirovcg/domemaster-stereo-shader | 135 | 3306736 | <filename>arnold/Arnold-DomemasterStereo-src/mtoa/ae/LatLongStereoTemplate.py
# LatLong Stereo Shader Template File
# 2015-01-31 09.29 am
import pymel.core as pm
import maya.cmds as cmds
import mtoa.ui.ae.templates as templates
#from mtoa.ui.ae.customShapeAttributes import CameraTemplate as CameraTemplate
def LatLong... | 0 | 0 | 0 | 0 | 0 | 0 |
libs/utils/auth.py | dok529/smart-social-distancing | 113 | 3306737 | <filename>libs/utils/auth.py
import json
import logging
import os
from datetime import datetime, timedelta
from jose import jwt
from passlib.context import CryptContext
logger = logging.getLogger(__name__)
API_USER_CREDENTIALS_FOLDER = "/repo/data/auth/"
API_USER_PATH = f"{API_USER_CREDENTIALS_FOLDER}/api_user.txt"
... | 0 | 0 | 0 | 0 | 0 | 0 |
api/desecapi/mail_backends.py | logolive/desec-stack | 197 | 3306761 | <gh_stars>100-1000
import logging
from celery import shared_task
from django.conf import settings
from django.core.mail import get_connection
from django.core.mail.backends.base import BaseEmailBackend
from djcelery_email.utils import dict_to_email, email_to_dict
from desecapi import metrics
logger = logging.getLog... | 0 | 0 | 0 | 0 | 0 | 0 |
mtdnn/tasks/utils.py | microsoft/mt-dnn | 113 | 3306801 | # coding=utf-8
# Copyright (c) Microsoft. All rights reserved.
from __future__ import annotations
import os
import pdb
from random import shuffle
from sys import path
from mtdnn.common.metrics import calc_metrics
from mtdnn.common.types import DataFormat
def process_data_and_dump_rows(
rows: list,
out_path: ... | 20 | 15 | 0 | 0 | 35 | 0 |
orator/orm/scopes/soft_deleting.py | wjzero/orator | 1,484 | 3306820 | <reponame>wjzero/orator
# -*- coding: utf-8 -*-
from .scope import Scope
class SoftDeletingScope(Scope):
_extensions = ["force_delete", "restore", "with_trashed", "only_trashed"]
def apply(self, builder, model):
"""
Apply the scope to a given query builder.
:param builder: The quer... | 0 | 0 | 0 | 0 | 0 | 0 |
pybits/ptghci/indent.py | litxio/ptghci-engine | 331 | 3306825 | from __future__ import annotations
import re
import prompt_toolkit
from prompt_toolkit.filters import is_searching, vi_insert_mode, emacs_insert_mode, is_read_only
from prompt_toolkit.filters.utils import is_true
from prompt_toolkit.document import Document
shiftwidth = 2
indent_let = 4
indent_if = 3
indent_after_bare... | 0 | 7 | 0 | 0 | 7 | 0 |
praatio/data_classes/data_point.py | timmahrt/praatIO | 208 | 3306845 | <filename>praatio/data_classes/data_point.py
"""
An PointObject is used for storing non-annotation data in praat
There are two variants: PointObject1D and PointObject2D
PointObject1D only stores temporal data (it can track pulses/occurances in time).
PointObject2D stores temporal data and some other data (eg pitch). ... | 0 | 0 | 0 | 0 | 0 | 0 |
bdy/oauth_browser.py | wishchen/baiduyun | 346 | 3306856 | # coding: utf-8
##
# @file oauth_browser.py
# @brief
# @author <EMAIL>
# @version 0.1.00
# @date 2016-12-30
from __future__ import annotations
from __future__ import print_function, unicode_literals
import webbrowser
from . import utils
def get_oa_info(oa_url, oa_result_base) -> object | str:
print("请在浏览器中登录您的百度... | 0 | 2 | 0 | 0 | 2 | 0 |
archive/nvdm/util.py | jennhu/vmf_vae_nlp | 159 | 3306875 | <reponame>jennhu/vmf_vae_nlp
import math
import os
import random
import numpy as np
import torch
from NVLL.util.gpu_flag import device
class NewsCorpus(object):
def __init__(self, path):
self.test, self.test_cnt = self.read_data(os.path.join(path, 'test.feat'))
self.train, self.train_cnt = self.r... | 0 | 0 | 0 | 0 | 0 | 0 |
src/netius/common/pop.py | timgates42/netius | 107 | 3306885 | <reponame>timgates42/netius<gh_stars>100-1000
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Hive Netius System
# Copyright (c) 2008-2020 Hive Solutions Lda.
#
# This file is part of Hive Netius System.
#
# Hive Netius System is free software: you can redistribute it and/or modify
# it under the terms of the Apa... | 0 | 0 | 0 | 0 | 0 | 0 |
setup.py | sskmy1024y/alfred-python | 136 | 3306892 | <reponame>sskmy1024y/alfred-python<gh_stars>100-1000
from distutils.core import setup
setup(name='alfred-python',
version='1.0.0',
description='Simple Python access to the Alfred workflow API',
author='<NAME>',
url='https://github.com/nikipore/alfred-python',
py_modules=['alfred'])
| 0 | 0 | 0 | 0 | 0 | 0 |
app/tests/organizations_tests/test_signals.py | amickan/grand-challenge.org | 101 | 3306896 | <reponame>amickan/grand-challenge.org
import pytest
from tests.algorithms_tests.factories import AlgorithmFactory
from tests.archives_tests.factories import ArchiveFactory
from tests.evaluation_tests.test_permissions import get_groups_with_set_perms
from tests.factories import ChallengeFactory, ExternalChallengeFactor... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/integrations/test_conferences.py | theSage21/junction | 192 | 3306904 | # -*- coding: utf-8 -*-
from django.core.urlresolvers import reverse
from .. import factories as f
def test_conferences(client, db):
conference = f.ConferenceFactory()
response = client.get("/")
assert str(conference.name) in str(response.content)
# should not display the conference if it's set as ... | 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.