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 |
|---|---|---|---|---|---|---|---|---|---|---|
bw_plex/db.py | Hellowlol/bw_plex | 371 | 1719931 | from __future__ import annotations
from contextlib import contextmanager
from sqlalchemy import create_engine, Boolean, Column, DateTime, Integer, String, LargeBinary
from sqlalchemy.orm import scoped_session
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from . import... | 1 | 1 | 4 | 0 | 6 | 0 |
convnets-keras/convnetskeras/customlayers.py | wentaozhu/deep-mil-for-whole-mammogram-classification | 106 | 1719939 | from __future__ import annotations
import numpy as np
from keras.layers.core import Lambda, Merge
from keras.layers.convolutional import Convolution2D
from keras import backend as K
from keras.regularizers import l1l2, Regularizer
from keras.engine import Layer
def crosschannelnormalization(alpha: float = 1e-... | 20 | 21 | 0 | 1 | 42 | 0 |
qcengine/programs/xtb.py | MolSSI/dqm_compute | 105 | 1719986 | <gh_stars>100-1000
"""
Harness for the extended tight binding (xtb) package.
This implementation interfaces with the xtb C-API via the xtb-python project,
which is providing Python bindings and native extensions for common computational
chemistry frameworks, like QCEngine.
Therefore, this harness only has to provide a... | 0 | 0 | 0 | 0 | 0 | 0 |
python/render_template.py | bcajes/glow | 214 | 1719991 | <filename>python/render_template.py
#!/usr/bin/env python
# Copyright 2019 The Glow 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 | 0 |
src/Python/VisualizationAlgorithms/TensorAxes.py | cvandijck/VTKExamples | 309 | 1720008 | <reponame>cvandijck/VTKExamples<filename>src/Python/VisualizationAlgorithms/TensorAxes.py<gh_stars>100-1000
#!/usr/bin/env python
# Translated from TenAxes.tcl
import vtk
def main():
colors = vtk.vtkNamedColors()
# Create the RenderWindow, Renderer and interactive renderer.
#
ren = vtk.vtkRenderer(... | 0 | 0 | 0 | 0 | 0 | 0 |
scannet_seg/scannet_block2scene_index.py | zb12138/sph3dR | 153 | 1720011 | import argparse
import numpy as np
import tensorflow as tf
import os
import sys
import scipy.io as sio
baseDir = os.path.dirname(os.path.abspath(__file__))
rootDir = os.path.dirname(baseDir)
sys.path.append(baseDir)
sys.path.append(os.path.join(rootDir, 'models'))
sys.path.append(os.path.join(rootDir, 'utils'))
parse... | 1 | 3 | 0 | 0 | 4 | 0 |
tests/resources/android-emulator/emulator.py | IamSaurabh1/taurus | 1,743 | 1720046 | # Mock for emulator
# it supports next functional:
# 1. wait for terminate if no 2 parameters are sent
import sys
import time
if len(sys.argv) == 2 and sys.argv[1] == '-list-avds':
print('Fake emulator')
exit(0)
if len(sys.argv) == 3 and sys.argv[1] == '-avd':
print('wait for terminating...')
time.sle... | 0 | 0 | 0 | 0 | 0 | 0 |
SBR/lib/models/initialization.py | yerang823/landmark-detection | 612 | 1720074 | <filename>SBR/lib/models/initialization.py
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import torch
import torch.nn as nn
from torch.nn import init
def weights_init_... | 0 | 0 | 0 | 0 | 0 | 0 |
sphinx_gallery/tests/tinybuild/examples/plot_svg.py | andriyor/sphinx-gallery | 309 | 1720080 | """
==================
"SVG":-`graphics_`
==================
Make sure we can embed SVG graphics.
Use title that has punctuation marks.
"""
import numpy as np
import matplotlib.pyplot as plt
from local_module import N # N = 1000
t = np.arange(N) / float(N)
win = np.hanning(N)
plt.figure()
plt.plot(t, win, color='r... | 0 | 0 | 0 | 0 | 0 | 0 |
src/extensions/resource.py | fekblom/critic | 216 | 1720090 | <reponame>fekblom/critic
# -*- mode: python; encoding: utf-8 -*-
#
# Copyright 2012 <NAME>, Opera Software ASA
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/lic... | 0 | 0 | 0 | 0 | 0 | 0 |
opencanary/iphelper.py | p1r473/opencanary | 1,412 | 1720101 | import struct
import socket
def ip2int(addr) -> object:
"""
Convert an IP in string format to decimal format
"""
return struct.unpack("!I", socket.inet_aton(addr))[0]
def check_ip(ip, network_range) -> object:
"""
Test if the IP is in range
Range is expected to be in CIDR notation format... | 0 | 2 | 0 | 0 | 2 | 0 |
mpi/main.py | whitmans-max/python-examples | 140 | 1720104 | <filename>mpi/main.py
#!/usr/bin/env python2
#
# https://pythonhosted.org/mpi4py/usrman/tutorial.html
#
# mpiexec -n 5 python test-mpi.py
#
import requests
from mpi4py import MPI
# --- functions ---
def build_ranges(value, numsplits, rank):
print '[RANK: %d ] build_ranges: %s/%s' % (rank, value, numsplits)... | 0 | 0 | 0 | 0 | 0 | 0 |
pytube/monostate.py | JarbasAl/pytube | 4,079 | 1720130 | from typing import Any, Callable, Optional
class Monostate:
def __init__(
self,
on_progress: Optional[Callable[[Any, bytes, int], None]],
on_complete: Optional[Callable[[Any, Optional[str]], None]],
title: Optional[str] = None,
duration: Optional[int] = None,
):
... | 4 | 0 | 0 | 0 | 4 | 0 |
scripts/release19/lodobject_display.py | tdapper/cinema4d_py_sdk | 113 | 1720161 | <filename>scripts/release19/lodobject_display.py
# This example configures the display settings for each level of the active LOD object 'op'.
import c4d
# get active LOD object number of levels
levelCount = op.GetLevelCount()
for level in xrange(levelCount):
descID = op.GetDisplayBFCDescID(level)
# enable ... | 0 | 0 | 0 | 0 | 0 | 0 |
koku/masu/external/downloader/downloader_interface.py | rubik-ai/koku | 157 | 1720177 | <gh_stars>100-1000
#
# Copyright 2021 Red Hat Inc.
# SPDX-License-Identifier: Apache-2.0
#
"""Downloader interface to be used by Masu."""
from abc import ABC
from abc import abstractmethod
class DownloaderInterface(ABC):
"""Masu interface definition to download cost usage reports."""
@abstractmethod
def ... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/github/test_issue_0032.py | next-franciscoalgaba/python-benedict | 365 | 1720185 | <reponame>next-franciscoalgaba/python-benedict
# -*- coding: utf-8 -*-
from benedict import benedict
import unittest
class github_issue_0032_test_case(unittest.TestCase):
"""
https://github.com/fabiocaccamo/python-benedict/issues/32
To run this specific test:
- For each method comment @unittest.sk... | 0 | 0 | 0 | 0 | 0 | 0 |
bmtk/utils/hdf5_helper.py | aaberbach/bmtk | 216 | 1720187 | <filename>bmtk/utils/hdf5_helper.py
import sys
if sys.version_info[0] == 3:
using_py3 = True
range_itr = range
else:
using_py3 = False
range_itr = xrange
def get_attribute_h5(h5obj, attribut_name, default=None):
val = h5obj.attrs.get(attribut_name, default)
if using_py3 and isinstance(val, by... | 0 | 0 | 0 | 0 | 0 | 0 |
binding/python/multiverso/theano_ext/param_manager.py | yesme/Multiverso | 445 | 1720234 | <filename>binding/python/multiverso/theano_ext/param_manager.py
#!/usr/bin/env python
# coding:utf8
import lasagne
import numpy as np
import multiverso as mv
class MVModelParamManager(object):
'''
MVModelParamManager is manager to make managing and synchronizing the
variables in lasagne more easily
'... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/conftest.py | eadwinCode/django-ninja | 2,809 | 1720237 | <reponame>eadwinCode/django-ninja<gh_stars>1000+
import os
import sys
ROOT = os.path.abspath(os.path.join(os.path.dirname(os.path.dirname(__file__))))
sys.path.insert(0, ROOT)
sys.path.insert(0, os.path.join(ROOT, "tests/demo_project"))
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "demo.settings")
# from django.co... | 0 | 0 | 0 | 0 | 0 | 0 |
recipes/Python/578044_Fractal_painter/recipe-578044.py | tdiprima/code | 2,023 | 1720262 | # PREAMBLE
# My original intention was to create some
# disruptive visual camoflage, inspired by the pattern on
# the bark of plane trees. The result was never quite what I intended
# and several fixes had to be incorperated to aproximate what I wanted.
# The end result is effective though and reminds me of a Ja... | 0 | 0 | 0 | 0 | 0 | 0 |
PutTextOnImage.py | OluSure/Hacktoberfest2021-1 | 215 | 1720287 | import cv2
img = cv2.imread("../image/squirrel.jpg")
rectangledImg = cv2.rectangle(img,(120,100),(370,380),(0,0,255), 2)
writeText = cv2.putText(rectangledImg,"This is Squirrel", (118,95), cv2.FONT_HERSHEY_SIMPLEX, 0.8, (255,0,0), 2)
cv2.imwrite("putText.jpg",writeText)
cv2.imshow("TextedImg",writeText)
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_gui/test_menu/test_node_manager/test_configuration_dialog.py | saxobroko/node-launcher | 249 | 1720290 | <reponame>saxobroko/node-launcher
from unittest.mock import MagicMock
from tempfile import NamedTemporaryFile
import pytest
from node_launcher.gui.menu.nodes_manage.manage_dialogs.configuration import ConfigurationDialog
from node_launcher.node_set.lib.configuration import Configuration
from node_launcher.node_set.li... | 0 | 0 | 0 | 0 | 0 | 0 |
RecoParticleFlow/PFClusterProducer/python/particleFlowClusterTimeAssigner_cfi.py | ckamtsikis/cmssw | 852 | 1720301 | <filename>RecoParticleFlow/PFClusterProducer/python/particleFlowClusterTimeAssigner_cfi.py
import FWCore.ParameterSet.Config as cms
from RecoParticleFlow.PFClusterProducer.particleFlowClusterTimeAssignerDefault_cfi import *
particleFlowTimeAssignerECAL = particleFlowClusterTimeAssignerDefault.clone(
timeSrc =... | 0 | 0 | 0 | 0 | 0 | 0 |
effects/collision.py | Bosken85/hyperion.ng | 1,808 | 1720352 | # Two projectiles are sent from random positions and collide with each other
# Template from https://github.com/nickpesce/lit/blob/master/lit/effects/collision.py
import hyperion, time, colorsys, random
# Get parameters
sleepTime = max(0.02, float(hyperion.args.get('speed', 100))/1000.0)
trailLength = max(3, int... | 0 | 0 | 0 | 0 | 0 | 0 |
lucida/commandcenter/controllers/ConfigChecker.py | extremenelson/sirius | 1,808 | 1720364 | <reponame>extremenelson/sirius<filename>lucida/commandcenter/controllers/ConfigChecker.py
from Config import *
# Check Config.py.
if MAX_DOC_NUM_PER_USER <= 0:
print 'MAX_DOC_NUM_PER_USER must be non-negative'
exit()
if not (TRAIN_OR_LOAD == 'train' or TRAIN_OR_LOAD == 'load'):
print 'TRAIN_OR_LOAD must be either t... | 0 | 0 | 0 | 0 | 0 | 0 |
nanobrok/tests/conftest.py | retr0-13/nanobroK | 142 | 1720375 | <gh_stars>100-1000
import pytest
from nanobrok.app import create_app, minimal_app
from nanobrok.ext.commands import populate_db
from nanobrok.ext.database import db
# This file is part of the Nanobrok Open Source Project.
# nanobrok is licensed under the Apache 2.0.
# Copyright 2021 p0cL4bs Team - <NAME> (mh4x0f)
#... | 0 | 0 | 0 | 0 | 0 | 0 |
dbus-mongo-extractor/mongo_connector/doc_managers/kafka_client_creator.py | JunZCn/DBus | 1,232 | 1720377 | # Copyright 2013-2014 MongoDB, 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 writin... | 0 | 4 | 0 | 0 | 4 | 0 |
tensordash/fastdash.py | flyeyesport/TensorDash | 166 | 1720387 | import json
import fastai
from fastai.torch_core import Any, Tensor, MetricsList, ifnone
from fastai.basic_train import LearnerCallback, Learner
import time
from firebasedata import SendDataToFirebase
SendData = SendDataToFirebase()
class Fastdash(LearnerCallback):
"""
Uses callbacks to in torchdash to sen... | 0 | 0 | 0 | 0 | 0 | 0 |
gdmix-trainer/src/gdmix/models/custom/binary_logistic_regression.py | Kostyansa/gdmix | 130 | 1720401 | <gh_stars>100-1000
import numpy as np
import scipy.sparse
from scipy.optimize import fmin_l_bfgs_b
from scipy.special import expit
from sklearn import metrics
class BinaryLogisticRegressionTrainer:
"""
Class to train l2-regularized binary logistic regression. Supports the following:
[1] Training
[2]... | 0 | 0 | 0 | 0 | 0 | 0 |
airmozilla/main/migrations/0021_location_prep_time.py | mozilla/airmozilla | 115 | 1720417 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies: list[tuple[str, str]] = [
('main', '0020_chapter_image'),
]
operations: list[object] = [
migrations.AddField(
model_n... | 0 | 0 | 2 | 0 | 2 | 0 |
odk_logger/models/instance.py | curenamo/ssmreleva | 123 | 1720430 | <filename>odk_logger/models/instance.py
from django.db import models
from django.db.models.signals import post_save
from django.db.models.signals import post_delete
from django.contrib.auth.models import User
from django.utils import timezone
from .xform import XForm
from .survey_type import SurveyType
from odk_logger.... | 0 | 0 | 0 | 0 | 0 | 0 |
modules/ModelMarketplace/backend/marketplaceWorker.py | MattSkiff/aerial_wildlife_detection | 166 | 1720435 | from __future__ import annotations
'''
This class deals with all tasks related to the Model Marketplace,
including model sharing, im-/export, download preparation, etc.
2020-21 <NAME>
'''
import os
import io
import re
import shutil
import tempfile
import zipfile
from datetime import datetime
from uuid imp... | 18 | 7 | 3 | 0 | 28 | 0 |
bin/collect_minidumps.py | suifengzhuliu/impala | 1,523 | 1720456 | #!/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... | 3 | 5 | 0 | 2 | 10 | 0 |
src/discurses/processing.py | StarlitGhost/Discurses | 168 | 1720457 | <reponame>StarlitGhost/Discurses<filename>src/discurses/processing.py
import re
import logging
logger = logging.getLogger(__name__)
def format_incomming(message, chat_widget):
text = message.content
newtxt = []
for m in re.split("(<(?:@|@!|#|@&)[0-9]+>)", text):
match = re.match("<(@|@!|#|@&)([0-... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/common/test_op/ascend/apply_adadelta.py | tianjiashuo/akg | 286 | 1720467 | <gh_stars>100-1000
# Copyright 2020-2021 Huawei Technologies Co., Ltd
#
# 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 app... | 0 | 0 | 0 | 0 | 0 | 0 |
lookup_plugins/os_cinder.py | nixpanic/openshift-ansible-contrib | 324 | 1720476 | <reponame>nixpanic/openshift-ansible-contrib
from ansible.errors import AnsibleError
from ansible.plugins.lookup import LookupBase
import shade
class LookupModule(LookupBase):
def run(self, volume_names, variables=None, **kwargs):
cloud = shade.openstack_cloud()
volume_attributes = [
... | 0 | 0 | 0 | 0 | 0 | 0 |
src/genie/libs/parser/junos/tests/MonitorInterfaceTraffic/cli/equal/golden_output_1_expected.py | balmasea/genieparser | 204 | 1720493 | expected_output={'no-output': True} | 0 | 0 | 0 | 0 | 0 | 0 |
src/pytorch_adapt/layers/symnets_category_loss.py | KevinMusgrave/pytorch-adapt | 131 | 1720526 | import torch
import torch.nn.functional as F
from .concat_softmax import ConcatSoftmax
from .utils import split_half
class SymNetsCategoryLoss(torch.nn.Module):
def __init__(self):
super().__init__()
self.softmax_fn = ConcatSoftmax()
# x and y are the first and second halves of "p^st"
de... | 0 | 2 | 0 | 0 | 2 | 0 |
etl/parsers/etw/Microsoft_Windows_Power_Meter_Polling.py | IMULMUL/etl-parser | 104 | 1720531 | <reponame>IMULMUL/etl-parser
# -*- coding: utf-8 -*-
"""
Microsoft-Windows-Power-Meter-Polling
GUID : 306c4e0b-e148-543d-315b-c618eb93157c
"""
from construct import Int8sl, Int8ul, Int16ul, Int16sl, Int32sl, Int32ul, Int64sl, Int64ul, Bytes, Double, Float32l, Struct
from etl.utils import WString, CString, SystemTime, G... | 0 | 0 | 0 | 0 | 0 | 0 |
terrascript/provider/vra7.py | mjuenema/python-terrascript | 507 | 1720556 | # terrascript/provider/vra7.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:30:50 UTC)
#
# For imports without namespace, e.g.
#
# >>> import terrascript.provider.vra7
#
# instead of
#
# >>> import terrascript.provider.vmware.vra7
#
# This is only available for 'official' and 'partner' providers.
... | 0 | 0 | 0 | 0 | 0 | 0 |
src/segment.py | izuane/BrainPrep_MSUCL | 116 | 1720594 | <filename>src/segment.py
from __future__ import print_function
import os
import numpy as np
import nibabel as nib
import skfuzzy as fuzz
from sklearn.cluster import KMeans
from multiprocessing import Pool, cpu_count
def create_dir(path):
if not os.path.isdir(path):
os.makedirs(path)
return
def load... | 0 | 0 | 0 | 0 | 0 | 0 |
data_conversions/quick_draw_utils.py | mateoKutnjak/PointCNN | 1,310 | 1720615 | from __future__ import annotations
import os
import sys
import math
import random
import numpy as np
from datetime import datetime
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import data_utils
def _stoke_decoding(stoke) -> tuple[object, object]:
lift_pen_padding = 2.0
lines =... | 2 | 4 | 0 | 0 | 6 | 0 |
fnss/__init__.py | brucespang/fnss | 114 | 1720632 | <reponame>brucespang/fnss<filename>fnss/__init__.py
"""
The Fast Network Simulation Setup (FNSS) core library is a Python library
providing a set of features allowing network researchers and engineers to
simplify the setup of a network simulation.
These features include the ability to:
* Parse a topology from a datas... | 0 | 0 | 0 | 0 | 0 | 0 |
odin/utilities/finance/modern_portfolio_theory/__init__.py | gsamarakoon/Odin | 103 | 1720658 | <gh_stars>100-1000
from .markowitz import solve_markowitz
from .black_litterman import solve_black_litterman
| 0 | 0 | 0 | 0 | 0 | 0 |
Lib/test/test_import/data/circular_imports/indirect.py | shawwn/cpython | 52,316 | 1720708 | <reponame>shawwn/cpython
from . import basic, basic2
| 0 | 0 | 0 | 0 | 0 | 0 |
test_scripts/explicit_relative_import/greetings/greeting.py | mwilliamson/stickytape | 158 | 1720716 | <filename>test_scripts/explicit_relative_import/greetings/greeting.py<gh_stars>100-1000
from .messages import message
__all__ = ["message"]
| 0 | 0 | 0 | 0 | 0 | 0 |
Snapchat_Filters/Witch Filter/Script/halloween_masks_vid.py | swapnilgarg7/Face-X | 175 | 1720724 | import cv2
import numpy as np
path = '/Users/mitchellkrieger/opt/anaconda3/envs/learn-env/share/opencv4/haarcascades/'
#get facial classifiers
face_cascade = cv2.CascadeClassifier(path +'haarcascade_frontalface_default.xml')
eye_cascade = cv2.CascadeClassifier(path +'haarcascade_eye.xml')
#read images
witch = cv2.i... | 0 | 0 | 0 | 0 | 0 | 0 |
vimfiles/bundle/vim-python/submodules/pylint/tests/functional/u/unused/unused_import_positional_only_py38.py | ciskoinch8/vimrc | 463 | 1720732 | """Test that positional only argument annotations are properly marked as consumed
https://github.com/PyCQA/pylint/issues/3462
"""
from typing import AnyStr, Set
def func(arg: AnyStr, /, arg2: Set[str]) -> tuple[object, object]:
"""Uses positional only arguments"""
return arg, arg2
| 2 | 1 | 0 | 0 | 3 | 0 |
homeassistant/components/decora/__init__.py | domwillcode/home-assistant | 30,023 | 1720751 | """The decora component."""
| 0 | 0 | 0 | 0 | 0 | 0 |
notebooks/notebookUtils.py | amenic-hub/aima-java | 1,418 | 1720772 | <filename>notebooks/notebookUtils.py
def pseudocode(algorithm):
"""Print the pseudocode for the given algorithm."""
from urllib.request import urlopen
from IPython.display import Markdown
algorithm = algorithm.replace(' ', '-')
url = "https://raw.githubusercontent.com/aimacode/aima-pseudocode/maste... | 0 | 0 | 0 | 0 | 0 | 0 |
venv/Lib/site-packages/mpl_toolkits/axisartist/axes_grid.py | EkremBayar/bayar | 603 | 1720783 | import mpl_toolkits.axes_grid1.axes_grid as axes_grid_orig
from .axislines import Axes
class CbarAxes(axes_grid_orig.CbarAxesBase, Axes):
pass
class Grid(axes_grid_orig.Grid):
_defaultAxesClass = Axes
class ImageGrid(axes_grid_orig.ImageGrid):
_defaultAxesClass = Axes
_defaultCbarAxesClass = CbarA... | 0 | 0 | 0 | 0 | 0 | 0 |
EventFilter/L1GlobalTriggerRawToDigi/test/testGmtUnpack_cfg.py | ckamtsikis/cmssw | 852 | 1720819 | <filename>EventFilter/L1GlobalTriggerRawToDigi/test/testGmtUnpack_cfg.py<gh_stars>100-1000
import FWCore.ParameterSet.Config as cms
process = cms.Process("GMTTEST")
# load and configure modules
process.load("EventFilter.L1GlobalTriggerRawToDigi.l1GtTextToRaw_cfi")
# FED Id (default 813)
#replace l1GtTextToRaw.FedId =... | 0 | 0 | 0 | 0 | 0 | 0 |
dapper/__init__.py | yoavfreund/DAPPER | 225 | 1720826 | <reponame>yoavfreund/DAPPER<gh_stars>100-1000
"""Data Assimilation with Python: a Package for Experimental Research
.. include:: ./README.md
"""
__version__ = "1.3.0"
# A parsimonious list of imports used in the examples
from .dpr_config import rc
from .tools.datafiles import find_latest_run, load_xps
from .tools.ro... | 0 | 0 | 0 | 0 | 0 | 0 |
yolo/examples/simple_speed.py | hilman-dayo/ObjectDetection-OneStageDet | 331 | 1720828 | import time
import torch
import os
import sys
sys.path.insert(0, '.')
import vedanet as vn
__all__ = ['speed']
def speed():
print('Creating network')
batch = 1
gpus = '7'
network_size = (544, 544)
max_iters = 200
use_cuda = True if gpus is not None else False
if gpus is not None:
... | 0 | 0 | 0 | 0 | 0 | 0 |
backend/db/test/metric_test.py | xuantan/viewfinder | 645 | 1720856 | <filename>backend/db/test/metric_test.py
# Copyright 2012 Viewfinder Inc. All Rights Reserved.
"""Tests for Metric upload process.
"""
__author__ = '<EMAIL> (<NAME>)'
import json
import time
from base_test import DBBaseTestCase
from functools import partial
from tornado.ioloop import IOLoop
from viewfinder.backend.... | 0 | 0 | 0 | 0 | 0 | 0 |
pythreejs/materials/Material.py | aliddell/pythreejs | 451 | 1720860 |
from traitlets import Bool, validate
from .Material_autogen import Material as MaterialAutogen
class Material(MaterialAutogen):
# Do not sync this automatically:
needsUpdate = Bool(False)
@validate('needsUpdate')
def onNeedsUpdate(self, proposal) -> bool:
if proposal.value:
cont... | 0 | 1 | 0 | 0 | 1 | 0 |
make_clusters.py | SanghyukChun/rebias | 129 | 1720881 | <gh_stars>100-1000
"""ReBias
Copyright (c) 2020-present NAVER Corp.
MIT license
"""
import argparse
import os
import time
import torch
import torch.nn as nn
import torchvision
from torchvision import transforms
from torchvision.utils import save_image
import numpy as np
from PIL import Image
from sklearn.cluster imp... | 0 | 0 | 0 | 0 | 0 | 0 |
yaml2json.py | joschiwald/timescaledb-kubernetes | 194 | 1720952 | #!/usr/bin/env python3
import json
import yaml
import sys
docs = []
for doc in yaml.safe_load_all(sys.stdin.read()):
if doc:
docs.append(doc)
print(json.dumps(docs, indent=4, sort_keys=True))
| 0 | 0 | 0 | 0 | 0 | 0 |
pyecharts/charts/composite_charts/tab.py | CharileWithZoe/pyecharts | 11,032 | 1721000 | <filename>pyecharts/charts/composite_charts/tab.py
import uuid
from jinja2 import Environment
from ... import types
from ...commons import utils
from ...globals import CurrentConfig, ThemeType
from ...render import engine
from ..mixins import CompositeMixin
class Tab(CompositeMixin):
def __init__(self, page_tit... | 0 | 0 | 0 | 0 | 0 | 0 |
ppci/cli/build.py | rakati/ppci-mirror | 161 | 1721026 | from __future__ import annotations
""" Build utility.
Use this to execute build files.
"""
import argparse
from .base import base_parser, LogSetup
from .. import api
parser = argparse.ArgumentParser(description=__doc__, parents=[base_parser])
parser.add_argument(
"-f",
"--buildfile",
metavar="build-fil... | 1 | 0 | 0 | 0 | 1 | 0 |
spk/sabnzbd/src/SabToSyno.py | BKSteve/spksrc | 2,211 | 1721034 | #!/usr/local/python3
#
# Created by LapinFou.
# https://forums.sabnzbd.org/viewtopic.php?f=9&p=122338
#
# date | version | comment
#---------------------------------------
# 2020-09-13 | 1.0 | Initial version
# 2020-09-19 | 1.1 | Code clean-up
# 2020-09-25 | 1.2 | Removed 7zip recursive unpack opt... | 0 | 1 | 0 | 0 | 1 | 0 |
dot_vim/plugged/powerline/powerline/matchers/vim/plugin/nerdtree.py | gabefgonc/san-francisco-rice-dotfiles | 11,435 | 1721042 | <filename>dot_vim/plugged/powerline/powerline/matchers/vim/plugin/nerdtree.py
# vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import os
import re
from powerline.bindings.vim import buffer_name
NERD_TREE_RE = re.compile(b'NERD_tree_\\d+')
def nerdt... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/custom_action/example_server/swagger_server/models/responder.py | ritvikshrivastava/mindmeld | 580 | 1721054 | <reponame>ritvikshrivastava/mindmeld
# coding: utf-8
from __future__ import absolute_import
from typing import List
from .base_model_ import Model
from .directive import Directive
from .params import Params
from .. import util
class Responder(Model):
"""NOTE: This class is auto generated by the swagger code ge... | 0 | 0 | 0 | 0 | 0 | 0 |
custom_components/samsungtv_custom/samsungctl_080b/config.py | AdamOttvar/ha-samsungtv-custom | 117 | 1721071 | # -*- coding: utf-8 -*-
from __future__ import annotations
import os
import socket
import json
import logging
import uuid as _uuid
# noinspection PyCompatibility
from . import exceptions
logger = logging.getLogger('samsungctl')
LOGGING_FORMAT = '''\
[%(levelname)s][%(thread)d] %(name)s.%(module)s.%(funcName)s
%(mess... | 44 | 16 | 0 | 1 | 61 | 0 |
code/python/src/vm/closure.py | ShakeM/luago-book | 723 | 1721077 | class Closure:
def __init__(self, proto, py_func, n):
self.proto = proto
self.py_func = py_func
self.upvals: list[object] = []
if proto and len(proto.upvalues) > 0:
self.upvals = [None] * len(proto.upvalues)
elif py_func and n > 0:
self.upvals = [None]... | 0 | 0 | 0 | 1 | 1 | 0 |
pil_pillow__examples/thumbnails/main.py | DazEB2/SimplePyScripts | 117 | 1721090 | <reponame>DazEB2/SimplePyScripts
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
# pip install Pillow
from PIL import Image
image_file = "input.jpg"
img = Image.open(image_file)
size = 128, 128
img.thumbnail(size)
img.save('output_thumbnail.png')
img.show()
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/08-native-runs/11-aes-ccm/generate-test-vectors.py | ismaelamezcua-ucol/contiki-ng | 948 | 1721104 | <filename>tests/08-native-runs/11-aes-ccm/generate-test-vectors.py
#!/usr/bin/env python3
from Crypto.Cipher import AES
from Crypto.Random import get_random_bytes
from binascii import *
import os
key = unhexlify("<KEY>")
nonce = unhexlify("cb72d71df3c953aaec3ca4d75b")
def test(hdr, clrmsg):
global nonce
ciph... | 0 | 0 | 0 | 0 | 0 | 0 |
pygtkweb/library/pygtk.py | takipsizad/pyjs | 739 | 1721114 | <reponame>takipsizad/pyjs<filename>pygtkweb/library/pygtk.py
version = '2.0'
def require(ver):
if float(version) > float(ver):
raise Exception("required version % not found" % ver)
| 0 | 0 | 0 | 0 | 0 | 0 |
kaldi/tfrnnlm/__init__.py | mxmpl/pykaldi | 916 | 1721121 | <reponame>mxmpl/pykaldi
try:
from ._tensorflow_rnnlm import *
except:
import logging
logging.error("Cannot import the Python module for TensorFlow RNNLM.")
logging.error("This module depends on kaldi-tensorflow-rnnlm library.")
logging.error("See kaldi/src/tfrnnlm/Makefile for details.")
raise
... | 0 | 0 | 0 | 0 | 0 | 0 |
optimus/engines/spark/functions.py | ironmussa/Optimus | 1,045 | 1721135 | from __future__ import annotations
import databricks.koalas as ks
import numpy as np
# These function can return a Column Expression or a list of columns expression
# Must return None if the data type can not be handle
import pandas as pd
from pyspark.sql import functions as F
from optimus.engines.base.commons.functio... | 8 | 44 | 0 | 0 | 52 | 0 |
cbl/base_types.py | Commodoreprime/Command-Block-Assembly | 223 | 1721136 | from .containers import LiteralInt, LiteralDec, Temporary, DelegatedWrite
from .cbl_type import CBLType, CBLTypeInstance
from .native_type import NativeType, as_var
from .operator_mixins import LogOperatorMixin, IntegerOperators, \
NumericalOperators, IntrinsicOperatorType
import cmd_ir.instructions as i
class V... | 0 | 16 | 0 | 0 | 16 | 0 |
drf_admin/apps/system/jobs/warehouse/backup.py | guohaihan/myproject | 228 | 1721140 | # -*- coding: utf-8 -*-
"""
@author : <NAME>
@github : https://github.com/tianpangji
@software : PyCharm
@file : backup.py
@create : 2020/12/9 20:27
"""
import os
import time
from django.conf import settings
def mysql():
"""mysql数据库备份"""
db_user = ''
db_pwd = ''
db_name = ''
backup_dir ... | 0 | 0 | 0 | 0 | 0 | 0 |
mcpipy/updateallscripts.py | wangtt03/raspberryjammod | 338 | 1721160 | <gh_stars>100-1000
import json
import sys
import os.path
import os
try:
import urllib.request as urllib_request
except:
import urllib2 as urllib_request
baseDir = os.path.dirname(sys.argv[0])
def updateDirectory(dir, path):
url = "https://api.github.com/repos/arpruss/raspberryjammod/... | 0 | 0 | 0 | 0 | 0 | 0 |
simdeblur/dataset/build.py | ljzycmd/SimDeblur | 190 | 1721179 | <gh_stars>100-1000
from ..utils.registry import Registry
DATASET_REGISTRY = Registry("dataset")
def build_dataset(cfg):
"""
Build the module with cfg.
Args:
cfg (dict): the config of the modules
Returns:
The built module.
"""
args = cfg
name = args.get("name")
datase... | 0 | 0 | 0 | 0 | 0 | 0 |
opacus/distributed.py | iamgroot42/opacus | 195 | 1721237 | <filename>opacus/distributed.py
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and 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/licen... | 0 | 0 | 0 | 0 | 0 | 0 |
PythonCode/adk/counting.py | konny0311/algorithms-nutshell-2ed | 522 | 1721248 | <reponame>konny0311/algorithms-nutshell-2ed
"""
Demonstrate probabilistic method of counting a set by sampling.
Provide own average function to eliminate dependence on numpy.
"""
import random
import math
def computeK(generator):
"""
Compute estimate of using probabilistic counting algorithm... | 0 | 0 | 0 | 0 | 0 | 0 |
test/fixtures/rules/custom/bad_rule_name/E000.py | netlify/sqlfluff | 3,024 | 1721266 | <filename>test/fixtures/rules/custom/bad_rule_name/E000.py
"""Test std rule import."""
class E000:
"""This will fail to import because it does not start with Rule_."""
pass
| 0 | 0 | 0 | 0 | 0 | 0 |
net-percolation-plot.py | RachidStat/PyCX | 176 | 1721281 | <reponame>RachidStat/PyCX<filename>net-percolation-plot.py<gh_stars>100-1000
from pylab import *
import networkx as nx
p = 0.0001
pdata = []
gdata = []
while p < 0.1:
pdata.append(p)
g = nx.erdos_renyi_graph(100, p)
ccs = nx.connected_components(g)
gdata.append(max(len(cc) for cc in ccs))
p *= 1.1... | 0 | 0 | 0 | 0 | 0 | 0 |
test/style_data/tag_seg_BMES.py | leileixiao/Macropodus | 485 | 1721292 | # !/usr/bin/python
# -*- coding: utf-8 -*-
# @time : 2019/12/21 23:11
# @author : Mo
# @function: BMES标注法
from macropodus.preprocess.tools_common import load_json, save_json
from macropodus.preprocess.tools_common import txt_write, txt_read
import json
pku_training = txt_read("pku_training.utf8")
file = open("pk... | 0 | 0 | 0 | 0 | 0 | 0 |
lib/yahoo/finance/utils.py | goztrk/django-htk | 206 | 1721308 | import yahoo_finance
def get_stock_info_and_historical_data(symbol) -> object:
"""Retrieve stock info and historical data for `symbol`
Leverages yahoo-finance for Python
https://github.com/lukaszbanasiak/yahoo-finance
"""
share = yahoo_finance.Share(symbol)
info = share.get_info()
start_d... | 0 | 2 | 0 | 0 | 2 | 0 |
Game9/modules/food.py | tkq111/1 | 4,013 | 1721331 | '''
Function:
定义金币等掉落的物品
Author:
Charles
微信公众号:
Charles的皮卡丘
'''
import pygame
import random
'''定义食物类'''
class Food(pygame.sprite.Sprite):
def __init__(self, images_dict, selected_key, screensize, **kwargs):
pygame.sprite.Sprite.__init__(self)
self.screensize = screensize
self.i... | 0 | 1 | 0 | 0 | 1 | 0 |
dts/utils/utils.py | albertogaspar/dts | 139 | 1721339 | import keras.backend as K
import numpy as np
import pandas as pd
from datetime import time, datetime
import tensorflow as tf
from argparse import ArgumentParser
def get_flops(model) -> object:
run_meta = tf.RunMetadata()
opts = tf.profiler.ProfileOptionBuilder.float_operation()
# We use the Keras session... | 2 | 6 | 0 | 0 | 8 | 0 |
src/users/migrations/0009_auto_20180522_1342.py | nixplay/bullet-train-api | 1,259 | 1721368 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-05-22 13:42
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies: list[tuple[str, str]] = [
('api', '0015_auto_20180522_0931'),
('users', '0008_auto_20180... | 0 | 0 | 2 | 0 | 2 | 0 |
codeformatter/jsformatter.py | ephenyxshop/sublimetext-codeformatter | 676 | 1721399 | # @author <NAME>
# @copyright Copyright (c) 2008-2015, <NAME> aka LONGMAN (<EMAIL>)
# @link http://longman.me
# @license The MIT License (MIT)
import re
import jsbeautifier
class JsFormatter:
def __init__(self, formatter):
self.formatter = formatter
self.o... | 0 | 2 | 0 | 0 | 2 | 0 |
mayan/apps/tags/tests/literals.py | nattangwiwat/Mayan-EDMS-recitation | 343 | 1721413 | <gh_stars>100-1000
TEST_TAG_LABEL = 'test-tag'
TEST_TAG_LABEL_EDITED = 'test-tag-edited'
TEST_TAG_COLOR = '#001122'
TEST_TAG_COLOR_EDITED = '#221100'
TEST_TAG_INDEX_HAS_TAG = 'HAS_TAG'
TEST_TAG_INDEX_NO_TAG = 'NO_TAG'
TEST_TAG_INDEX_NODE_TEMPLATE = '''
{{% for tag in document.tags.all %}}
{{% if tag.label == "{tag_lab... | 0 | 0 | 0 | 0 | 0 | 0 |
bcs-ui/backend/container_service/clusters/node_tasks.py | laodiu/bk-bcs | 599 | 1721427 | # -*- coding: utf-8 -*-
from __future__ import annotations
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 TH<NAME>, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may no... | 1 | 4 | 0 | 0 | 5 | 0 |
deepcell/callbacks.py | jizhouh/deepcell-tf | 250 | 1721429 | # Copyright 2016-2021 The <NAME> at the California Institute of
# Technology (Caltech), with support from the Paul Allen Family Foundation,
# Google, & National Institutes of Health (NIH) under Grant U24CA224309-01.
# All rights reserved.
#
# Licensed under a modified Apache License, Version 2.0 (the "License");
# you ... | 6 | 0 | 0 | 3 | 9 | 0 |
pml/nn/visualize.py | gatapia/py_ml_utils | 183 | 1721452 | <filename>pml/nn/visualize.py
from __future__ import print_function, absolute_import
import matplotlib as plt
import itertools, img_utils
def viz_history_loss(history, filename='viz\\validation_curve.png'):
losses = {'loss': history['loss']}
if 'val_loss' in history: losses.add('val_loss', history['val_los... | 0 | 0 | 0 | 0 | 0 | 0 |
napari/utils/events/containers/_dict.py | MaksHess/napari | 1,345 | 1721470 | """Evented dictionary"""
import sys
from typing import (
Any,
Dict,
Iterator,
Mapping,
MutableMapping,
Sequence,
Type,
TypeVar,
Union,
)
_K = TypeVar("_K")
_T = TypeVar("_T")
class TypedMutableMapping(MutableMapping[_K, _T]):
"""Dictionary mixin that enforces item type."""
... | 8 | 9 | 0 | 1 | 18 | 0 |
packages/stub/build.py | singhalshubh/echronos | 154 | 1721492 | #
# eChronos Real-Time Operating System
# Copyright (c) 2017, Commonwealth Scientific and Industrial Research
# Organisation (CSIRO) ABN 41 687 119 230.
#
# All rights reserved. CSIRO is willing to grant you a licence to the eChronos
# real-time operating system under the terms of the CSIRO_BSD_MIT license. See
# the f... | 1 | 1 | 0 | 0 | 2 | 0 |
tests/util/test_config.py | SGeetansh/dffml | 171 | 1721506 | import unittest
from dffml.util.config.numpy import numpy_docstring_args
from .double_ret import double_ret as numpy_double_ret
class TestMakeConfig(unittest.TestCase):
def test_numpy_docstring_args(self):
args = numpy_docstring_args(numpy_double_ret)
self.assertIn("super_cool_arg", args)
... | 0 | 0 | 0 | 0 | 0 | 0 |
src/arcrest/cmp/community.py | kevinsigwart/ArcREST | 208 | 1721517 | <gh_stars>100-1000
from __future__ import print_function
from __future__ import absolute_import
import json
from ..packages.six.moves.urllib_parse import quote
from ..agol import FeatureService
from .._abstract.abstract import BaseCMP
from ..security.security import AGOLTokenSecurityHandler, CommunityMapsSecurityHandle... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/cpu_dump_check/cpu_dump_check.py | artkuli/openvino | 1,127 | 1721584 | #!/usr/bin/python3
# Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
from openvino.runtime import Core, Model, Tensor, PartialShape, Type
from openvino.runtime import opset8 as opset
from openvino.runtime.op import Constant, Parameter, tensor_iterator... | 3 | 9 | 25 | 0 | 37 | 0 |
sdk/python/pulumi_gcp/networkmanagement/connectivity_test.py | sisisin/pulumi-gcp | 121 | 1721585 | <filename>sdk/python/pulumi_gcp/networkmanagement/connectivity_test.py<gh_stars>100-1000
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.ru... | 0 | 0 | 0 | 0 | 0 | 0 |
telegrambot/bot_views/generic/compound.py | matteing/django-telegram-bot | 156 | 1721595 | <reponame>matteing/django-telegram-bot<filename>telegrambot/bot_views/generic/compound.py
from telegrambot.bot_views.generic.base import TemplateCommandView
class ListDetailCommandView(TemplateCommandView):
list_view_class = None
detail_view_class = None
@classmethod
def as_command_view(cls, **ini... | 0 | 0 | 0 | 0 | 0 | 0 |
Python/Coroutines/coroutines.py | Gjacquenot/training-material | 115 | 1721610 | <filename>Python/Coroutines/coroutines.py
#!/usr/bin/env python
def my_printer():
try:
counter = 0
while True:
buffer = (yield)
counter += 1
print('{0:03d}: {1}'.format(counter, buffer))
except GeneratorExit:
pass
def main():
coroutine = my_pri... | 0 | 0 | 0 | 0 | 0 | 0 |
flambe/const.py | ethan-asapp/flambe | 148 | 1721621 | <gh_stars>100-1000
from pathlib import Path
import os
FLAMBE_GLOBAL_FOLDER = os.path.join(str(Path.home()), ".flambe")
| 0 | 0 | 0 | 0 | 0 | 0 |
frontend/api/probes/controllers.py | krisshol/bach-kmno | 248 | 1721649 | <reponame>krisshol/bach-kmno
#
# 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 dist... | 0 | 0 | 0 | 0 | 0 | 0 |
skidl/libs/pspice_sklib.py | arjenroodselaar/skidl | 700 | 1721652 | from skidl import SKIDL, TEMPLATE, Part, Pin, SchLib
SKIDL_lib_version = '0.0.1'
pspice = SchLib(tool=SKIDL).add_parts(*[
Part(name='0',dest=TEMPLATE,tool=SKIDL,do_erc=True),
Part(name='CAP',dest=TEMPLATE,tool=SKIDL,do_erc=True,aliases=['C']),
Part(name='DIODE',dest=TEMPLATE,tool=SKIDL,do_erc=... | 0 | 0 | 0 | 0 | 0 | 0 |
utils/exceptions.py | Leo-xxx/NeuronBlocks | 1,257 | 1721661 | <reponame>Leo-xxx/NeuronBlocks
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license.
import sys
class BaseError(RuntimeError):
""" Error base class
"""
def __init__(self, arg, err_id=None):
self.arg = arg
self.err_id = err_id
def __str__(self)... | 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.