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 |
|---|---|---|---|---|---|---|---|---|---|---|
improving_code_performance/vectorize_operations.py | airalcorn2/NBA_Tutorials | 123 | 1627696 | # Import pandas, numpy and RidgeCV from sklearn
import datetime
import pandas as pd
# Set display options for pandas for easier printing
pd.set_option('display.max_columns', 500)
pd.set_option('display.width', 1000)
# Read possessions CSV
possessions = pd.read_csv('data/rapm_possessions.csv')
# Filter out 0 possess... | 0 | 0 | 0 | 0 | 0 | 0 |
venv/Lib/site-packages/nuitka/nodes/TryNodes.py | patmloi/PalettePal | 1,228 | 1627707 | <reponame>patmloi/PalettePal<gh_stars>1000+
# Copyright 2021, <NAME>, mailto:<EMAIL>
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use ... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/lazy/test_reflected_occultation_derivs.py | shashankdholakia/starry | 116 | 1627762 | from starry.compat import theano
from starry.compat import tt
import numpy as np
import starry
import matplotlib.pyplot as plt
import pytest
@pytest.fixture
def model() -> object:
class Model:
def __init__(self):
self.map = starry.Map(ydeg=1, reflected=True)
_b = tt.dvector("b")
... | 12 | 10 | 0 | 0 | 22 | 0 |
wpc/views.py | eleweek/WatchPeopleCode | 200 | 1627783 | from wpc import db, app, socketio
from wpc.flask_utils import url_for_other_page, url_change_args, nl2br, nl2br_py, get_or_create, is_safe_url
from wpc.models import MozillaStreamHack # NOQA
from wpc.models import YoutubeStream, WPCStream, Stream, Streamer, Subscriber, Idea, ChatMessage
from wpc.forms import Subscribe... | 0 | 0 | 0 | 0 | 0 | 0 |
tapiriik/requests_lib.py | jerm/tapiriik | 1,445 | 1627807 | <gh_stars>1000+
# For whatever reason there's no built-in way to specify a global timeout for requests operations.
# socket.setdefaulttimeout doesn't work since requests overriddes the default with its own default.
# There's probably a better way to do this in requests 2.x, but...
def patch_requests_with_default_timeo... | 0 | 0 | 0 | 0 | 0 | 0 |
automated_email/automated_email.py | elishahyousaf/Awesome-Python-Scripts | 1,026 | 1627825 | from smtplib import SMTP as smtp
import json
def sendmail(sender_add, reciever_add, msg, password):
server = smtp('smtp.gmail.com:587')
server.starttls()
server.login(sender_add, password)
server.sendmail(sender_add, reciever_add, msg)
print("Mail sent succesfully....!")
group = {}
print('\t\t ..... | 0 | 0 | 0 | 0 | 0 | 0 |
client/python/ovmsclient/lib/ovmsclient/tfs_compat/base/errors.py | IntelAI/OpenVINO-model-server | 305 | 1627836 | <reponame>IntelAI/OpenVINO-model-server
#
# Copyright (c) 2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | 0 | 0 | 0 | 0 | 0 | 0 |
common/security-features/scope/document.py | meyerweb/wpt | 14,668 | 1627856 | import os, sys, json
from wptserve.utils import isomorphic_decode, isomorphic_encode
import importlib
util = importlib.import_module("common.security-features.scope.util")
def main(request, response):
policyDeliveries = json.loads(request.GET.first(b"policyDeliveries", b"[]"))
maybe_additional_headers = {}
met... | 0 | 0 | 0 | 0 | 0 | 0 |
transformer_courses/BERT_distillation/PaddleSlim-develop/paddleslim/dygraph/prune/__init__.py | wwhio/awesome-DeepLearning | 1,150 | 1627871 | <reponame>wwhio/awesome-DeepLearning
from . import var_group
from .var_group import *
from . import l1norm_pruner
from .l1norm_pruner import *
from . import pruner
from .pruner import *
from . import filter_pruner
from .filter_pruner import *
from . import l2norm_pruner
from .l2norm_pruner import *
from . import fpgm_p... | 0 | 0 | 0 | 0 | 0 | 0 |
app/views/image_view.py | awesome-archive/susnote | 136 | 1627907 | <reponame>awesome-archive/susnote
import logging
from sanic import Blueprint, response
from sanic.response import json, text, html, redirect
import ujson
import datetime
from hashlib import md5
from random import Random, random
import os
import sys
from os.path import getsize
sys.path.append("..")
from config import ... | 0 | 0 | 0 | 0 | 0 | 0 |
rastervision_core/rastervision/core/data/raster_source/raster_source_config.py | theoway/raster-vision | 1,577 | 1627924 | from __future__ import annotations
from typing import List, Optional
from pydantic.dataclasses import dataclass
from rastervision.pipeline.config import (Config, register_config, Field,
validator, ConfigError)
from rastervision.core.data.raster_transformer import RasterTransfo... | 3 | 2 | 7 | 0 | 12 | 0 |
Tutorials/GAN-PyTorch/generative_adversial_network.py | astricks/Voice-Conversion-GAN | 104 | 1627947 | import os
import torch
import torchvision
import torch.nn as nn
from torchvision import transforms
from torchvision.utils import save_image
# Device Configuration
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
# Hyper-parameters
latent_size = 64
hidden_size = 256
image_size = 784
num_epochs = 2... | 0 | 1 | 0 | 0 | 1 | 0 |
projects/OneNet/onenet/config.py | PeizeSun/OneNet | 611 | 1627950 | <filename>projects/OneNet/onenet/config.py
# -*- coding: utf-8 -*-
#
# Modified by <NAME>
# Contact: <EMAIL>
#
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from detectron2.config import CfgNode as CN
def add_onenet_config(cfg):
"""
Add config for OneNet.
"""
cfg.MODEL.OneNet ... | 0 | 0 | 0 | 0 | 0 | 0 |
test/detext/layers/test_embedding_layer.py | StarWang/detext | 1,229 | 1627951 | import copy
import shutil
import tensorflow as tf
import tensorflow_hub as hub
from detext.layers import embedding_layer
from detext.utils.layer_utils import get_sorted_dict
from detext.utils.parsing_utils import InternalFtrType
from detext.utils.testing.data_setup import DataSetup
class TestEmbeddingLayer(tf.test.... | 0 | 0 | 5 | 0 | 5 | 0 |
recipes/Python/305888_way_deal__checking/recipe-305888.py | tdiprima/code | 2,023 | 1627974 | from types import *
def check_type(obj,atts=[],callables=[]):
got_atts=True
for att in atts:
if not hasattr(obj,att):
got_atts=False;break
got_callables=True
for call in callables:
if not hasattr(obj,call):
got_callables=False;break
the_attr=getattr(obj,call)
if not ca... | 0 | 0 | 0 | 0 | 0 | 0 |
.modules/.metagoofil/hachoir_metadata/file_system.py | termux-one/EasY_HaCk | 1,103 | 1627977 | <filename>.modules/.metagoofil/hachoir_metadata/file_system.py
from hachoir_metadata.metadata import RootMetadata, registerExtractor
from hachoir_metadata.safe import fault_tolerant
from hachoir_parser.file_system import ISO9660
from datetime import datetime
class ISO9660_Metadata(RootMetadata):
def extract(self, ... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/ner_data_preprocess.py | awesome-archive/bi-lstm-crf | 343 | 1627989 | <reponame>awesome-archive/bi-lstm-crf
import os
import re
import argparse
def print_process(process):
num_processed = int(30 * process)
num_unprocessed = 30 - num_processed
print(
f"{''.join(['['] + ['='] * num_processed + ['>'] + [' '] * num_unprocessed + [']'])}, {(process * 100):.2f} %")
def c... | 0 | 0 | 0 | 0 | 0 | 0 |
bibliopixel/drivers/__init__.py | rec/leds | 253 | 1628006 | from .. util import deprecated
if deprecated.allowed():
from . channel_order import ChannelOrder
| 0 | 0 | 0 | 0 | 0 | 0 |
pytest_bdd/parsers.py | epkanol/pytest-bdd | 944 | 1628057 | <reponame>epkanol/pytest-bdd<filename>pytest_bdd/parsers.py<gh_stars>100-1000
"""Step parsers."""
import re as base_re
from functools import partial
import parse as base_parse
from parse_type import cfparse as base_cfparse
class StepParser:
"""Parser of the individual step."""
def __init__(self, name):
... | 0 | 0 | 0 | 0 | 0 | 0 |
deep_recommenders/estimator/models/feature_interaction/__init__.py | LongmaoTeamTf/deep_recommenders | 143 | 1628070 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
from deep_recommenders.estimator.models.feature_interaction.fm import fm
from deep_recommenders.estimator.models.feature_interaction.fm import FM
from deep_recommenders.estimator.models.feature_interaction.dnn import dnn
| 0 | 0 | 0 | 0 | 0 | 0 |
CalibTracker/SiPixelLorentzAngle/python/ALCARECOSiPixelLorentzAngle_cff.py | ckamtsikis/cmssw | 852 | 1628077 | <gh_stars>100-1000
import FWCore.ParameterSet.Config as cms
from CalibTracker.SiPixelLorentzAngle.SiPixelLorentzAngleHLTFilter_cfi import *
seqALCARECOSiPixelLorentzAngle = cms.Sequence(SiPixelLorentzAngleHLTFilter)
| 0 | 0 | 0 | 0 | 0 | 0 |
uq360/utils/hidden_markov_model.py | Sclare87/UQ360 | 148 | 1628099 | <reponame>Sclare87/UQ360
import autograd
import autograd.numpy as np
import scipy.optimize
from autograd import grad
from autograd.scipy.special import logsumexp
from sklearn.cluster import KMeans
class HMM:
"""
A Hidden Markov Model with Gaussian observations with
unknown means and known precisions.
... | 0 | 0 | 0 | 0 | 0 | 0 |
dynaconf/vendor/click/_termui_impl.py | sephiartlist/dynaconf | 2,293 | 1628104 | <filename>dynaconf/vendor/click/_termui_impl.py
_H='replace'
_G='less'
_F='You need to use progress bars in a with block.'
_E=' '
_D='\n'
_C=False
_B=True
_A=None
import contextlib,math,os,sys,time
from ._compat import _default_text_stdout,CYGWIN,get_best_encoding,isatty,open_stream,strip_ansi,term_len,WIN
from .except... | 0 | 0 | 0 | 0 | 0 | 0 |
Python/demos/d02_SampleData.py | tsadakane/TIGRE | 326 | 1628108 | #%% DEMO 02: Sample data in TIGRE
#
#
# TIGRE has some sample data so you can use without the need of having
# your own data. This code sample shows how to load the data.
#
# Sample data is stored in "data" folder, inside TIGRE/Common.
#
# If you want to contribute your own phantom/real data, please do. Send an
# email... | 0 | 0 | 0 | 0 | 0 | 0 |
mutant/contrib/temporal/models.py | pombredanne/django-mutant | 152 | 1628123 | from __future__ import unicode_literals
from django.db.models import fields
from django.utils.translation import ugettext_lazy as _
from ...models import FieldDefinition, FieldDefinitionManager
auto_now_help_text = _('Automatically set the field to now every time the '
'object is saved.')
auto... | 0 | 0 | 6 | 0 | 6 | 0 |
tests/benchmarks/math_isprime_lib.py | feihong/arturo | 401 | 1628138 | import sympy
maxLimit = 10000
for n in range(maxLimit+1):
print "true" if sympy.isprime(n) else "false" | 0 | 0 | 0 | 0 | 0 | 0 |
src/orion/serving/responses.py | Epistimio/orion | 177 | 1628153 | <filename>src/orion/serving/responses.py
# -*- coding: utf-8 -*-
"""
Helpers for building responses according to the specification
=============================================================
Offers functions and attributes to generate response objects according to the API specification.
"""
from orion.core.worker.e... | 0 | 0 | 0 | 0 | 0 | 0 |
data-structures/InorderTreeTraversal.py | Vineet2000-dotcom/python | 204 | 1628170 | from __future__ import annotations
class Node:
"""A binary tree node"""
def __init__(self, data, left: object | None=None, right: object | None=None):
self.data = data
self.left = left
self.right = right
def morris_traversal(root):
"""Generator function for iterative inor... | 2 | 0 | 0 | 0 | 2 | 0 |
src/appier/http.py | BeeMargarida/appier | 127 | 1628225 | <filename>src/appier/http.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Hive Appier Framework
# Copyright (c) 2008-2021 Hive Solutions Lda.
#
# This file is part of Hive Appier Framework.
#
# Hive Appier Framework is free software: you can redistribute it and/or modify
# it under the terms of the Apache Lice... | 0 | 0 | 0 | 0 | 0 | 0 |
job-queue-portal/postgres_django_queue/djangoenv/lib/python3.8/site-packages/channels_redis/pubsub.py | Sruthi-Ganesh/postgres-django-queue | 363 | 1628305 | <gh_stars>100-1000
import asyncio
import functools
import logging
import sys
import types
import uuid
import aioredis
import msgpack
from .utils import _consistent_hash
logger = logging.getLogger(__name__)
if sys.version_info >= (3, 7):
get_running_loop = asyncio.get_running_loop
else:
get_running_loop = a... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/common/test_run/ascend/tanh_grad_run.py | tianjiashuo/akg | 286 | 1628322 | <filename>tests/common/test_run/ascend/tanh_grad_run.py
# Copyright 2019-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/lice... | 0 | 0 | 0 | 0 | 0 | 0 |
wenet/bin/export_onnx.py | pengchengguo/wenet | 1,166 | 1628334 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 18 | 3 | 0 | 0 | 21 | 0 |
evennia/server/connection_wizard.py | Jaykingamez/evennia | 1,544 | 1628339 | <gh_stars>1000+
"""
Link Evennia to external resources (wizard plugin for evennia_launcher)
"""
import sys
from os import path
import pprint
from django.conf import settings
from evennia.utils.utils import list_to_string, mod_import
class ConnectionWizard(object):
def __init__(self):
self.data = {}
... | 0 | 0 | 0 | 0 | 0 | 0 |
venv/lib/python3.6/site-packages/skvideo/tests/test_scenedet.py | mesquitadev/grpc | 615 | 1628340 | import warnings
warnings.filterwarnings('ignore', category=UserWarning)
from numpy.testing import assert_equal, assert_almost_equal
import os
import sys
import numpy as np
import skvideo.io
import skvideo.datasets
import skvideo.measure
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import u... | 0 | 0 | 0 | 0 | 0 | 0 |
setup.py | zjzh/wharfee | 489 | 1628349 | from wharfee.__init__ import __version__
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
description='Wharfee: a shell for Docker',
author='<NAME>',
url='http://wharfee.com',
download_url='http://github.com/j-bennet/wharfee',
author_email='i[do... | 0 | 0 | 0 | 0 | 0 | 0 |
vendor-local/lib/python/caching/ext.py | Mozilla-GitHub-Standards/93f18f14efcf5fdfc0e04f9bf247f66baf46663f37b1d2087ab8d850abc90803 | 285 | 1628356 | <filename>vendor-local/lib/python/caching/ext.py
from django.conf import settings
from django.utils import encoding
from jinja2 import nodes
from jinja2.ext import Extension
import caching.base
class FragmentCacheExtension(Extension):
"""
Cache a chunk of template code based on a queryset. Since looping ov... | 0 | 0 | 0 | 0 | 0 | 0 |
setup.py | FinalTheory/WirelessNetworkReproduction | 263 | 1628377 | """
This is a setup.py script generated by py2applet
Usage:
python setup.py py2app
"""
import os
import re
import sys
import glob
import shutil
import subprocess
import PIL
dirname, filename = os.path.split(os.path.abspath(__file__))
sys.path.append(os.path.join(dirname, 'tcptrace_gui'))
from setuptools import ... | 0 | 0 | 0 | 0 | 0 | 0 |
92_Trap/python/trap.py | jcoehoorn/basic-computer-games | 7,880 | 1628403 | <gh_stars>1000+
#!/usr/bin/env python3
# TRAP
#
# <NAME>, 8-1-72
# Converted from BASIC to Python by <NAME>
import random
number_max = 100
guess_max = 6
def play_game():
"""Play one round of the game"""
number_computer = random.randint(1, number_max)
turn = 0
while True:
turn += 1
u... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/radar/plot_radar.py | ThomasSeidl/mplsoccer | 157 | 1628470 | <filename>examples/radar/plot_radar.py
"""
============
Radar Charts
============
* ``mplsoccer``, ``radar_chart`` module helps one to plot radar charts in a few lines of code.
* The radar-chart inspiration is `StatsBomb <https://twitter.com/StatsBomb/>`_
and `<NAME> <https://cargocollective.com/ramimo/2013-NBA-All... | 0 | 0 | 0 | 0 | 0 | 0 |
lib/bindings/samples/server/test/test_algorithm_scheduler.py | tlalexander/stitchEm | 182 | 1628479 | <filename>lib/bindings/samples/server/test/test_algorithm_scheduler.py<gh_stars>100-1000
import unittest
from algorithm.algorithm_runner import AlgorithmRunner
from project_manager import ProjectManager
from algorithm.algorithm_scheduler import AlgorithmScheduler
from utils.settings_manager import SETTINGS
TEST_PTV_F... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/quick_postprocess.py | bigblue/pynab | 161 | 1628483 | import sys
import os
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..'))
import pynab.ids
from pynab.db import db_session, MetaBlack
def local_postprocess():
with db_session() as db:
# noinspection PyComparisonWithNone,PyComparisonWithNone
db.query(MetaBlack).filter(... | 0 | 0 | 0 | 0 | 0 | 0 |
libtiff/tiff_h_4_0_2.py | IanZhao/pylibtiff | 101 | 1628514 | <filename>libtiff/tiff_h_4_0_2.py<gh_stars>100-1000
TIFF_VERSION = 42
TIFF_BIGTIFF_VERSION = 43
TIFF_BIGENDIAN = 19789
TIFF_LITTLEENDIAN = 18761
MDI_LITTLEENDIAN = 20549
MDI_BIGENDIAN = 17744
TIFF_MAGIC_SIZE = 2
TIFF_VERSION_SIZE = 2
TIFF_DIROFFSET_SIZE = 4
TIFFTAG_SUBFILETYPE = 254
FILETYPE_REDUCEDIMAGE = 1
FILETYPE_P... | 0 | 0 | 0 | 0 | 0 | 0 |
crython/tab.py | a-mere-peasant/crython | 136 | 1628529 | from __future__ import annotations
"""
crython/tab
~~~~~~~~~~~
Contains functionality for executing jobs (python functions) from cron expressions.
"""
# pylint: disable=global-statement, invalid-name
from __future__ import unicode_literals
import datetime
import multiprocessing
import threading
import ti... | 1 | 1 | 0 | 2 | 4 | 0 |
platypush/backend/stt/__init__.py | RichardChiang/platypush | 228 | 1628549 | <gh_stars>100-1000
import time
from platypush.backend import Backend
from platypush.context import get_plugin
from platypush.plugins.stt import SttPlugin
class SttBackend(Backend):
"""
Base class for speech-to-text backends.
"""
def __init__(self, plugin_name: str, retry_sleep: float = 5.0, *args, *... | 0 | 0 | 0 | 0 | 0 | 0 |
openhgnn/trainerflow/HeGAN_trainer.py | jingmouren/OpenHGNN | 235 | 1628573 | <reponame>jingmouren/OpenHGNN<filename>openhgnn/trainerflow/HeGAN_trainer.py
import argparse
import copy
import dgl
import numpy as np
import torch
from tqdm import tqdm
import torch.nn.functional as F
from openhgnn.models import build_model
from . import BaseFlow, register_flow
from ..tasks import build_task
import ra... | 0 | 0 | 0 | 0 | 0 | 0 |
src/onedrivesdk/collection_base.py | meson800/onedrive-sdk-python | 912 | 1628591 | from __future__ import annotations
'''
------------------------------------------------------------------------------
Copyright (c) 2015 Microsoft Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
i... | 2 | 2 | 0 | 1 | 5 | 0 |
Web_Scraping/Saavn/saavn3.py | heykush/Youtube | 152 | 1628593 | from bs4 import BeautifulSoup
import requests
choice = {
'1': 'english',
'2': 'hindi',
'3': 'punjabi',
'4': 'bengali',
'5': 'gujarati'
}
ch = input('Enter your choice (1-5) : ')
res = requests.get('https://www.saavn.com/s/featured/' + choice[ch] + '/Weekly_Top_Songs')
soup = BeautifulSoup(res.te... | 0 | 0 | 0 | 0 | 0 | 0 |
pyzo/core/kernelbroker.py | vishalbelsare/pyzo | 235 | 1628608 | <filename>pyzo/core/kernelbroker.py
# -*- coding: utf-8 -*-
# Copyright (C) 2016, the Pyzo development team
#
# Pyzo is distributed under the terms of the 2-Clause BSD License.
# The full license can be found in 'license.txt'.
""" Module kernelBroker
This module implements the interface between Pyzo and the kernel.
... | 0 | 0 | 0 | 0 | 0 | 0 |
MacroPad_Braille_Keycaps/shortcuts.py | gamblor21/Adafruit_Learning_System_Guides | 665 | 1628615 | """
A Python dictionary containing information to be associated with the twelve keys on a
MacroPad.
"""
from adafruit_macropad import MacroPad
macropad = MacroPad()
"""
** Understanding the Dictionary **
The following explains how to configure each entry below.
Sound:
Can be an integer for a tone in Hz, e.g.196, OR, a... | 0 | 0 | 0 | 0 | 0 | 0 |
release/stubs.min/Autodesk/Revit/DB/Structure/__init___parts/RebarShapeVertex.py | htlcnn/ironpython-stubs | 182 | 1628618 | <reponame>htlcnn/ironpython-stubs
class RebarShapeVertex(object,IDisposable):
""" A bend between segments of a rebar shape definition. """
def Dispose(self):
""" Dispose(self: RebarShapeVertex) """
pass
def GetConstraints(self):
"""
GetConstraints(self: RebarShapeVertex) -> IList[RebarShapeConstraint]... | 0 | 0 | 0 | 0 | 0 | 0 |
sdk/python/pulumi_aws/redshift/get_orderable_cluster.py | rapzo/pulumi-aws | 260 | 1628639 | # 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! ***
from __future__ import annotations
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Seque... | 16 | 9 | 0 | 0 | 25 | 0 |
src/test/tests/rendering/evalcubic.py | visit-dav/vis | 226 | 1628644 | # ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: evalcubic.py
#
# Tests: mesh - 3D structured, single domain
# plots - pseudocolor
#
# Programmer: <NAME>
# Date: Mon Feb 7 15:52:37 PST 2011
#
# Modifications:
#
# --... | 0 | 0 | 0 | 0 | 0 | 0 |
setup.py | ForkedReposBak/CapsLayer | 379 | 1628696 | <reponame>ForkedReposBak/CapsLayer<gh_stars>100-1000
from setuptools import setup
from setuptools import find_packages
install_requires = [
'numpy',
'scipy',
'tqdm'
]
setup(
name="capslayer",
version="0.1.5",
packages=find_packages(),
include_package_data=True,
author="<NAME>",
aut... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_04_dxf_high_level_structs/test_408_objects_section.py | jkjt/ezdxf | 515 | 1628707 | <gh_stars>100-1000
# Copyright (c) 2011-2021, <NAME>
# License: MIT License
import ezdxf
from ezdxf.tools.test import load_entities
from ezdxf.sections.objects import ObjectsSection
from ezdxf.entities import Point
def test_load_section():
doc = ezdxf.new("R2000")
ent = load_entities(TESTOBJECTS, "OBJECTS")
... | 0 | 0 | 0 | 0 | 0 | 0 |
park/envs/abr_sim/trace_loader.py | utkarsh5k/park | 180 | 1628710 | <reponame>utkarsh5k/park
import os
import wget
import zipfile
import numpy as np
import park
from park.utils.misc import create_folder_if_not_exists
def get_chunk_time(trace, t_idx):
if t_idx == len(trace[0]) - 1:
return 1 # bandwidth last for 1 second
else:
return trace[0][t_idx + 1] - trac... | 0 | 0 | 0 | 0 | 0 | 0 |
src/jodel_api/__init__.py | hackspace-marburg/jodel_api | 175 | 1628734 | from __future__ import (absolute_import, print_function, unicode_literals)
from jodel_api.protos import mcs_pb2
from jodel_api.protos import checkin_pb2
from jodel_api.gcmhack import AndroidAccount
from jodel_api.jodel_api import *
| 0 | 0 | 0 | 0 | 0 | 0 |
nodes/0.9.x/python/FamilyInstance.FlipHandOrientation.py | jdehotin/Clockworkfordynamo | 147 | 1628738 | import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
faminstances = UnwrapElement(I... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/sample-ui-dialog_activity-button.py | tqchagas/AndroidViewClient | 1,155 | 1628741 | <filename>examples/sample-ui-dialog_activity-button.py
#! /usr/bin/env python
'''
Copyright (C) 2012 <NAME>
Created on Aug 31, 2012
@author: diego
'''
import re
import sys
import os
# This must be imported before MonkeyRunner and MonkeyDevice,
# otherwise the import fails.
# PyDev sets PYTHONPATH, use it
try:
... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/c7n_gcp/c7n_gcp/actions/iampolicy.py | al3pht/cloud-custodian | 2,415 | 1628799 | <gh_stars>1000+
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from c7n.utils import local_session, type_schema
from c7n_gcp.actions import MethodAction
class SetIamPolicy(MethodAction):
""" Sets IAM policy. It works with bindings only.
The action supports two lists for m... | 0 | 0 | 0 | 0 | 0 | 0 |
apps/filebrowser/src/filebrowser/lib/xxd_test.py | yetsun/hue | 5,079 | 1628808 | <reponame>yetsun/hue
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the... | 0 | 0 | 0 | 0 | 0 | 0 |
Lib/site-packages/eventtools/__init__.py | nateonmission/nateonmission.com | 108 | 1628821 | <filename>Lib/site-packages/eventtools/__init__.py
from . import _version
__version__ = _version.__version__
| 0 | 0 | 0 | 0 | 0 | 0 |
applications/FemToDemApplication/python_scripts/MainFEM_for_PFEM_coupling.py | lkusch/Kratos | 778 | 1628837 | <reponame>lkusch/Kratos<filename>applications/FemToDemApplication/python_scripts/MainFEM_for_PFEM_coupling.py<gh_stars>100-1000
import KratosMultiphysics
import KratosMultiphysics.FemToDemApplication.MainFEM_for_coupling as MainFEM_for_coupling
import KratosMultiphysics.FemToDemApplication as KratosFemDem
import K... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/bench/var-5-class-attr.py | learnforpractice/micropython-cpp | 692 | 1628841 | import bench
class Foo:
num: int = 20000000
def test(num):
i = 0
while i < Foo.num:
i += 1
bench.run(test)
| 0 | 0 | 1 | 0 | 1 | 0 |
tests/common/factories/token.py | BearerPipelineTest/h | 2,103 | 1628855 | <gh_stars>1000+
from datetime import datetime, timedelta
import factory
from h import models, security
from h.services.developer_token import PREFIX as DEVELOPER_TOKEN_PREFIX
from h.services.oauth import ACCESS_TOKEN_PREFIX, REFRESH_TOKEN_PREFIX
from .auth_client import AuthClient
from .base import FAKER, ModelFacto... | 0 | 0 | 0 | 0 | 0 | 0 |
WebMirror/management/rss_parser_funcs/feed_parse_extractHokageTrans.py | fake-name/ReadableWebProxy | 193 | 1628857 | from __future__ import annotations
def extractHokageTrans(item) -> bool | object | None:
"""
# Hokage Translations
"""
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or 'preview' in item['title'].lower():
return None
if any([('Aim the Deepest Part of the Different... | 0 | 1 | 0 | 0 | 1 | 0 |
nigt_optimizer/nigt_test.py | deepneuralmachine/google-research | 23,901 | 1628868 | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 0 | 0 | 0 | 0 | 0 | 0 |
dirtorch/datasets/paris.py | dongan-beta/deep-image-retrieval | 253 | 1628875 | <reponame>dongan-beta/deep-image-retrieval
from .generic import ImageListRelevants
import os
DB_ROOT = os.environ['DB_ROOT']
class Paris6K(ImageListRelevants):
def __init__(self):
ImageListRelevants.__init__(self, os.path.join(DB_ROOT, 'paris6k/gnd_paris6k.pkl'),
root=os.p... | 0 | 0 | 0 | 0 | 0 | 0 |
baselines/EMNLP2019/config.py | ParikhKadam/knowledge-net | 240 | 1628876 | <filename>baselines/EMNLP2019/config.py<gh_stars>100-1000
#MODEL = "simple_pipeline"
#MODEL = "pipeline_without_global"
#MODEL = "best_pipeline"
#MODEL = "ours"
MODEL = "bert"
NUMBER_URI_CANDIDATES = 1 if MODEL == "ours" else 1
NUMBER_URI_CANDIDATES_TO_CONSIDER = 1
URI_THRESHOLD = 0.0
SOFT_COREF_CANDIDATES = MODEL == ... | 0 | 0 | 0 | 0 | 0 | 0 |
models/plot_mnist_scores.py | chihyunsong/oc-nn | 203 | 1628877 | <gh_stars>100-1000
import numpy as np
import pandas as pd
from sklearn import utils
import matplotlib.pyplot as plt
dataPath = './data/'
activations = ["Linear","Sigmoid"]
methods = ["Linear","RBF"]
def plot_decision_scores_MNIST(dataset,df_mnist_scores):
# Four axes, returned as a 2-d array
#
# import ... | 0 | 0 | 0 | 0 | 0 | 0 |
03_SweynTooth/libs/smp_server/test.py | Charmve/BLE-Security-Att-Def | 149 | 1628895 | <reponame>Charmve/BLE-Security-Att-Def<filename>03_SweynTooth/libs/smp_server/test.py
from scapy.all import *
from scapy.layers.bluetooth import SM_Master_Identification
from scapy.layers.bluetooth import SM_Identity_Information
from scapy.layers.bluetooth import SM_Pairing_Request
from scapy.layers.bluetooth import SM... | 0 | 0 | 0 | 0 | 0 | 0 |
client/verta/verta/monitoring/alert/status/__init__.py | fool-sec-review/modeldb | 624 | 1628916 | <reponame>fool-sec-review/modeldb
# -*- coding: utf-8 -*-
"""Alert statuses."""
from verta._internal_utils import documentation
from ._status import (
_AlertStatus,
Alerting,
Ok,
)
documentation.reassign_module(
[
Alerting,
Ok,
],
module_name=__name__,
)
| 0 | 0 | 0 | 0 | 0 | 0 |
examples/dcgan/dcgan_fuzzer.py | johnnytheboii/TensorFuzz_2.0 | 196 | 1628939 | <gh_stars>100-1000
# Copyright 2018 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 agreed... | 0 | 0 | 0 | 0 | 0 | 0 |
compute_feature.py | bankbiz/image-matching-benchmark | 271 | 1628943 | # Copyright 2020 Google LLC, University of Victoria, Czech Technical University
#
# 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 ... | 0 | 2 | 0 | 0 | 2 | 0 |
src/backend/data.py | scopeInfinity/Video2Description | 152 | 1628949 | <reponame>scopeInfinity/Video2Description
import cv2
import json
import os
import re
from pytube import YouTube
from subprocess import check_output
DIR = 'Videos'
CATEGORIES = (1<<3)
with open('train_2017/videodatainfo_2017.json') as f:
vdi = json.loads(f.read())
_videos={}
for v in vdi['videos']:
... | 0 | 0 | 0 | 0 | 0 | 0 |
sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/models/_models_py3.py | rsdoherty/azure-sdk-for-python | 2,728 | 1628950 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 635 | 0 | 404 | 157 | 1,196 | 0 |
applications/cli/platform_resources/experiment.py | nparkstar/nauta | 390 | 1628957 | <filename>applications/cli/platform_resources/experiment.py
#
# Copyright (c) 2019 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LI... | 0 | 0 | 0 | 0 | 0 | 0 |
lambda_toolkit/modules/logger.py | lucioveloso/lambda-toolkit | 136 | 1628960 | <gh_stars>100-1000
#!/usr/bin/env python
import logging
import sys
class ShutdownHandler(logging.Handler):
def emit(self, record):
logging.shutdown()
sys.exit(1)
def get_my_logger(name):
handler = logging.StreamHandler(sys.stdout)
handler.setFormatter(logging.Formatter('[%(levelname)s] ... | 0 | 0 | 0 | 0 | 0 | 0 |
pogom/pgoapi/protos/POGOProtos/Settings/Master/Item/ExperienceBoostAttributes_pb2.py | tier4fusion/pogom-updated | 2,557 | 1629004 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: POGOProtos/Settings/Master/Item/ExperienceBoostAttributes.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _messag... | 0 | 0 | 0 | 0 | 0 | 0 |
blocks/utils/__init__.py | KIKOcaoyue/blocks | 1,067 | 1629017 | # This is basically equivalent to
#
# from .utils import <everything in UtilsModule.utils_attrs>
# from .theano_utils import <everything in UtilsModule.theano_utils_attrs>
#
# but acts lazily, meaning that the submodule imported only if needed
import sys
import importlib
from types import ModuleType
class UtilsModule... | 0 | 1 | 2 | 0 | 3 | 0 |
tests/policy/perf/gen-policy.py | Flickswitch/vpp | 230 | 1629032 | <filename>tests/policy/perf/gen-policy.py<gh_stars>100-1000
#!/usr/bin/env python
import random
import socket
import struct
# Config
podLabel = "role: db"
numCidrs = 1000
numExcepts = 5
numPorts = 20
policyTemplate = """apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: test-network-policy
name... | 0 | 0 | 0 | 0 | 0 | 0 |
notebook/pandas_to_numpy.py | vhn0912/python-snippets | 174 | 1629055 | import numpy as np
import pandas as pd
df = pd.DataFrame(data=[[1, 2, 3], [4, 5, 6]], columns=['a', 'b', 'c'])
print(df)
# a b c
# 0 1 2 3
# 1 4 5 6
a_df = df.values
print(a_df)
# [[1 2 3]
# [4 5 6]]
print(type(a_df))
# <class 'numpy.ndarray'>
print(a_df.dtype)
# int64
s = df['a']
print(s)
# 0 1
# 1... | 0 | 0 | 0 | 0 | 0 | 0 |
rpplugins/dof/dof_stage.py | bluekyu/RenderPipeline | 1,031 | 1629075 | <filename>rpplugins/dof/dof_stage.py
"""
RenderPipeline
Copyright (c) 2014-2016 tobspr <<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... | 0 | 0 | 0 | 0 | 0 | 0 |
LemonGraph/algorithms.py | d4tocchini/lg | 1,124 | 1629076 | <reponame>d4tocchini/lg<gh_stars>1000+
from collections import deque
# source/target must be LemonGraph.Node objects from the same graph
# if cost_cb is supplied:
# it must be a callable and will be passed the edge being traversed
# it must return a number that will be interpreted as edge weight/cost
# else cost_f... | 0 | 0 | 0 | 0 | 0 | 0 |
selfdrive/can/parser.py | BoneE562/openpilot | 114 | 1629128 | import os
import subprocess
can_dir = os.path.dirname(os.path.abspath(__file__))
libdbc_fn = os.path.join(can_dir, "libdbc.so")
subprocess.check_call(["make"], cwd=can_dir)
from selfdrive.can.parser_pyx import CANParser # pylint: disable=no-name-in-module, import-error
assert CANParser
| 0 | 0 | 0 | 0 | 0 | 0 |
Code/Python/middle_element_linked_list.py | yasharth291/Algo-Tree | 356 | 1629129 | #Ques: Find the middle data of the linked list
#Language: Python3
#First approach which comes in our mind is by using number of nodes and then get the mid node by dividing length of linked list by 2 but #we have more optimize approach for finding middle element of linkrd list, i.e
#by using two pointers of "Node" (dat... | 0 | 3 | 0 | 2 | 5 | 0 |
tensorflow_probability/python/layers/weight_norm.py | jakee417/probability-1 | 3,670 | 1629136 | # Copyright 2019 The TensorFlow Probability 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 required by applicable law o... | 2 | 2 | 0 | 0 | 4 | 0 |
tests/server_with_workers.py | HorsemanWSGI/bjoern | 2,326 | 1629144 | <gh_stars>1000+
#!/usr/bin/python
import os
import signal
import sys
import time
import bjoern
host = "0.0.0.0"
port = int(sys.argv[1]) if len(sys.argv) == 2 else 8081
workers = 3
worker_pids = []
socket = bjoern.bind_and_listen(host=host, port=port, listen_backlog=1)
requests_count = 0
print(f"http://{host}:{po... | 0 | 0 | 0 | 0 | 0 | 0 |
samples/openapi3/client/petstore/python-legacy/test/test_format_test.py | JigarJoshi/openapi-generator | 11,868 | 1629160 | <filename>samples/openapi3/client/petstore/python-legacy/test/test_format_test.py
# coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of ... | 0 | 0 | 0 | 0 | 0 | 0 |
pytext/metrics/tests/calibration_metrics_test.py | baronrustamov/pytext | 6,199 | 1629169 | <reponame>baronrustamov/pytext
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import unittest
from pytext.metrics.calibration_metrics import (
calculate_error,
get_bucket_accuracy,
get_bucket_confidence,
get_bucket_scores,
)
class CalibrationUtilsTest(u... | 0 | 0 | 0 | 0 | 0 | 0 |
ML/TensorFlow/Basics/tutorial16-customloops.py | xuyannus/Machine-Learning-Collection | 3,094 | 1629171 | import os
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2"
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from tensorflow.keras.datasets import mnist
import tensorflow_datasets as tfds
physical_devices = tf.config.list_physical_devices("GPU")
tf.config.experimental.set_memory_growth... | 0 | 1 | 0 | 0 | 1 | 0 |
opy/demo/docstring.py | Schweinepriester/oil | 2,209 | 1629179 | """
module DOCSTRING
"""
class Foo(object):
"""class DOCSTRING"""
def inc(self, x) -> object:
"""func DOCSTRING"""
return x + 1
| 0 | 1 | 0 | 0 | 1 | 0 |
panel/tests/command/test_serve.py | datalayer-contrib/holoviz-panel | 1,130 | 1629185 | <filename>panel/tests/command/test_serve.py
import contextlib
import os
import re
import subprocess
import sys
import pytest
import requests
from queue import Empty, Queue
from threading import Thread
not_windows = pytest.mark.skipif(sys.platform == 'win32', reason="Does not work on Windows")
@contextlib.contextma... | 0 | 0 | 0 | 0 | 0 | 0 |
src/exabgp/reactor/api/command/limit.py | pierky/exabgp | 1,560 | 1629189 | <gh_stars>1000+
# encoding: utf-8
"""
command/limit.py
Created by <NAME> on 2017-07-01.
Copyright (c) 2009-2017 Exa Networks. All rights reserved.
License: 3-clause BSD. (See the COPYRIGHT file)
"""
import re
def extract_neighbors(command):
"""Return a list of neighbor definition : the neighbor definition is a ... | 0 | 0 | 0 | 0 | 0 | 0 |
leo/core/leoRope.py | ATikhonov2/leo-editor | 1,550 | 1629212 | <reponame>ATikhonov2/leo-editor
# -*- coding: utf-8 -*-
#@+leo-ver=5-thin
#@+node:ekr.20140526082700.18440: * @file leoRope.py
#@@first
#@+<< leoRope imports >>
#@+node:ekr.20140525065558.15807: ** << leoRope imports >>
import time
import importlib
from leo.core import leoGlobals as g
# Third-party imports.
try:
# ... | 0 | 0 | 0 | 0 | 0 | 0 |
test/programytest/utils/language/test_default.py | motazsaad/fit-bot-fb-clt | 345 | 1629218 | import unittest
from programy.utils.language.default import DefaultLangauge
#############################################################################
#
class DefaultTests(unittest.TestCase):
def test_split_into_sentences(self):
sentences = DefaultLangauge.split_into_sentences("")
self.asser... | 0 | 0 | 0 | 0 | 0 | 0 |
armi/utils/properties.py | keckler/armi | 162 | 1629224 | # Copyright 2019 TerraPower, 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 1 | 4 | 0 | 0 | 5 | 0 |
lib/pymedphys/_experimental/plancomplexity/operations.py | ethanio12345/pymedphys | 207 | 1629226 | # -*- coding: utf-8 -*-
"""
Created on Fri Mar 13 14:29:35 2020
@author: <NAME>
*******************************************************************************
Some operations to load and prepare plan data for calculation of plan metrics
openPlan - Opens a DICOM plan file and returns the whole data as 'ds'
... | 0 | 3 | 0 | 0 | 3 | 0 |
adaptnlp/inference/translation.py | chsafouane/adaptnlp | 410 | 1629233 | <reponame>chsafouane/adaptnlp<gh_stars>100-1000
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/08_translation.ipynb (unless otherwise specified).
__all__ = ['logger', 'TranslationResult', 'TransformersTranslator', 'EasyTranslator']
# Cell
import logging
from typing import List, Dict, Union
from collections import de... | 0 | 0 | 0 | 0 | 0 | 0 |
datashader/data_libraries/__init__.py | goncaloperes/datashader | 758 | 1629250 | from . import pandas, xarray # noqa (API import)
try:
import dask as _dask # noqa (Test dask installed)
from . import dask # noqa (API import)
except ImportError:
pass
try:
import cudf as _cudf # noqa (Test cudf installed)
import cupy as _cupy # noqa (Test cupy installed)
from . import ... | 0 | 0 | 0 | 0 | 0 | 0 |
apps/samples/usb-label-printer/dettach_kernel_driver.py | HannesGitH/chrome-extensions-samples | 2,981 | 1629260 | # not required for ChromeOS. May be required for other operational systems, like Linux or Mac
import usb
dev = usb.core.find(idVendor=0x0922, idProduct=0x0020)
dev.detach_kernel_driver(0)
| 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.