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 |
|---|---|---|---|---|---|---|---|---|---|---|
pylayers/antprop/examples/ex_antenna4.py | usmanwardag/pylayers | 143 | 125640 | from pylayers.antprop.antenna import *
from pylayers.antprop.antvsh import *
import matplotlib.pylab as plt
from numpy import *
import pdb
"""
This test :
1 : loads a measured antenna
2 : applies an electrical delay obtained from data with getdelay method
3 : evaluate the antenna vsh coefficient with a d... | 0 | 0 | 0 | 0 | 0 | 0 |
netbuilder/lego/data.py | nrupatunga/pynetbuilder | 381 | 125702 | <gh_stars>100-1000
"""
Copyright 2016 Yahoo Inc.
Licensed under the terms of the 2 clause BSD license.
Please see LICENSE file in the project root for terms.
"""
from base import BaseLego
from caffe.proto import caffe_pb2
import google.protobuf as pb
from caffe import layers as L
from caffe import params as P
import... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/core/test_urn.py | joshuataylor/great_expectations | 6,451 | 125719 | <gh_stars>1000+
from urllib.parse import parse_qs
import pytest
from pyparsing import ParseException
from great_expectations.core.urn import ge_urn
def test_ge_validations_urn():
# We should be able to parse validations urns
urn = (
"urn:great_expectations:validations:my_suite:expect_something.obser... | 0 | 0 | 0 | 0 | 0 | 0 |
Burp/lib/issue_listener.py | wisdark/HUNT | 1,628 | 125724 | from javax.swing.event import ListSelectionListener
class IssueListener(ListSelectionListener):
def __init__(self, view, table, scanner_pane, issue_name, issue_param):
self.view = view
self.table = table
self.scanner_pane = scanner_pane
self.issue_name = issue_name
self.issu... | 0 | 0 | 0 | 0 | 0 | 0 |
recipes/Python/580736_xtopdf_Publish_DelimiterSeparated_Values_DSV/recipe-580736.py | tdiprima/code | 2,023 | 125738 | <reponame>tdiprima/code
from __future__ import print_function
"""
DSVToPDF.py
Author: <NAME>
Web site: https://vasudevram.github.io
Blog: https://jugad2.blogspot.com
Product store: https://gumroad.com/vasudevram
Twitter: https://mobile.twitter.com/vasudevram
Purpose: Show how to publish DSV data (Delimiter-Separated V... | 0 | 0 | 0 | 0 | 0 | 0 |
nbtutor/ipython/factories/kvp_heap_object_factory.py | vincentxavier/nbtutor | 423 | 125788 | <filename>nbtutor/ipython/factories/kvp_heap_object_factory.py
from typing import Any, Collection, Dict, Union, Optional
from ..models.heap_object import HeapObject, RenderOptions
from ..models.options import Options
from ..models.unique_identifier import UniqueIdentifier
from .base_heap_object_factory import HeapObje... | 0 | 0 | 0 | 0 | 0 | 0 |
core/REST_permissions.py | gcnoopy/YaraGuardian | 178 | 125821 | <filename>core/REST_permissions.py
from rest_framework import permissions
from rest_framework.permissions import BasePermission
from django.core.exceptions import ObjectDoesNotExist
from django.contrib.auth.models import Group
def group_owner(request):
group_name = request.resolver_match.kwargs.get('group_name')
... | 0 | 0 | 0 | 0 | 0 | 0 |
imapfw/drivers/imap.py | paralax/imapfw | 492 | 125835 | # The MIT License (MIT).
# Copyright (c) 2015, <NAME> & contributors.
from imapfw.imap import Imap as ImapBackend
from imapfw.interface import adapts, checkInterfaces
from .driver import Driver, DriverInterface
# Annotations.
from imapfw.imap import SearchConditions, FetchAttributes
from imapfw.types.folder import F... | 4 | 9 | 1 | 0 | 14 | 0 |
mxnet/tests/unittests/test_rl_scheduler.py | zhiqiangdon/autogluon | 4,462 | 125836 | <gh_stars>1000+
import numpy as np
import pickle
import autogluon.core as ag
def test_rl_scheduler():
@ag.args(
lr=ag.space.Categorical(1e-3, 1e-2),
wd=ag.space.Categorical(1e-3, 1e-2),
epochs=10)
def rl_train_fn(args, reporter):
for e in range(args.epochs):
dummy_a... | 0 | 0 | 0 | 0 | 0 | 0 |
services/core/VolttronCentral/tests/test_platforms.py | cloudcomputingabc/volttron | 406 | 125869 | import pytest
import base64
from mock import MagicMock
from volttrontesting.utils.utils import AgentMock
from volttron.platform.vip.agent import Agent
from volttroncentral.platforms import PlatformHandler, Platforms
from volttroncentral.agent import VolttronCentralAgent
@pytest.fixture
def mock_vc():
VolttronCent... | 0 | 0 | 0 | 0 | 0 | 0 |
example_app/main.py | iwpnd/fastapi-aws-lambda-example | 117 | 125917 | <filename>example_app/main.py
from fastapi import FastAPI
from mangum import Mangum
from example_app.api.api_v1.api import router as api_router
from example_app.core.config import API_V1_STR, PROJECT_NAME
app = FastAPI(
title=PROJECT_NAME,
# if not custom domain
# openapi_prefix="/prod"
)
app.include_ro... | 0 | 0 | 0 | 0 | 0 | 0 |
example.py | abersheeran/index.py | 242 | 125948 | <gh_stars>100-1000
import asyncio
from pathlib import Path as FilePath
from typing_extensions import Annotated
from indexpy import (
HTTPException,
HttpRoute,
Index,
SocketRoute,
required_method,
websocket,
)
from indexpy.parameters.field_functions import Path
from indexpy.openapi import OpenA... | 0 | 0 | 0 | 0 | 0 | 0 |
spikeextractors/extractors/nixioextractors/__init__.py | zekearneodo/spikeextractors | 145 | 125952 | <filename>spikeextractors/extractors/nixioextractors/__init__.py
from .nixioextractors import NIXIORecordingExtractor, NIXIOSortingExtractor
| 0 | 0 | 0 | 0 | 0 | 0 |
zhaquirks/aurora/__init__.py | WolfRevo/zha-device-handlers | 213 | 125971 | """Module for Aurora devices."""
| 0 | 0 | 0 | 0 | 0 | 0 |
cli/tests/pcluster/models/test_imagebuilder_resources.py | enrico-usai/cfncluster | 415 | 125984 | <reponame>enrico-usai/cfncluster
# Copyright 2021 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# o... | 0 | 0 | 0 | 0 | 0 | 0 |
demo/demo_sem.py | Alias-Alan/pypsy | 169 | 125999 | # coding=utf-8
# 结构方程模型的参数估计
from __future__ import division, print_function, unicode_literals
from psy import sem, data
import numpy as np
data_ = data['ex5.11.dat']
beta = np.array([
[0, 0],
[1, 0]
])
gamma = np.array([
[1, 1],
[0, 0]
])
x = [0, 1, 2, 3, 4, 5]
lam_x = np.array([
[1, 0],
[... | 0 | 0 | 0 | 0 | 0 | 0 |
open_seq2seq/parts/centaur/conv_block.py | gioannides/OpenSeq2Seq | 1,459 | 126018 | <filename>open_seq2seq/parts/centaur/conv_block.py<gh_stars>1000+
# Copyright (c) 2019 NVIDIA Corporation
import tensorflow as tf
from .batch_norm import BatchNorm1D
class ConvBlock:
"""
Convolutional block for Centaur model.
"""
def __init__(self,
name,
conv,
no... | 0 | 0 | 0 | 0 | 0 | 0 |
pyclustering/nnet/examples/pcnn_segmentation.py | JosephChataignon/pyclustering | 1,013 | 126033 | <reponame>JosephChataignon/pyclustering<filename>pyclustering/nnet/examples/pcnn_segmentation.py
"""!
@brief Examples of usage and demonstration of abilities of Pulse Coupled Neural Network in image segmentation.
@authors <NAME> (<EMAIL>)
@date 2014-2020
@copyright BSD-3-Clause
"""
from PIL import Image
... | 0 | 0 | 0 | 0 | 0 | 0 |
pytorch_tools/losses/base.py | bonlime/pytorch-tools | 155 | 126065 | from torch.nn.modules.loss import _Loss
import torch
from enum import Enum
from typing import Union
class Mode(Enum):
BINARY: str = "binary"
MULTICLASS: str = "multiclass"
MULTILABEL: str = "multilabel"
class Reduction(Enum):
SUM: str = "sum"
MEAN: str = "mean"
NONE: str = "none"
SAMPLE_S... | 3 | 7 | 7 | 0 | 17 | 0 |
setup.py | peteroconnor-bc/artemis | 235 | 126095 | from setuptools import setup, find_packages
import re
# Get the version, following advice from https://stackoverflow.com/a/7071358/851699
VERSIONFILE="artemis/_version.py"
verstrline = open(VERSIONFILE, "rt").read()
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
mo = re.search(VSRE, verstrline, re.M)
if mo:
verstr =... | 0 | 0 | 0 | 0 | 0 | 0 |
sdk/python/pulumi_azure/servicebus/get_topic.py | henriktao/pulumi-azure | 109 | 126130 | # 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... | 22 | 17 | 0 | 0 | 39 | 0 |
mayan/apps/authentication/utils.py | bonitobonita24/Mayan-EDMS | 343 | 126152 | def get_context_user(context) -> object:
if 'user' in context:
return context['user']
elif 'request' in context:
return getattr(context['request'], 'user', None)
| 0 | 1 | 0 | 0 | 1 | 0 |
tables/req_versions.py | xmatthias/PyTables | 869 | 126249 | <reponame>xmatthias/PyTables
"""Required versions for PyTables dependencies."""
from packaging.version import Version
# **********************************************************************
# Keep these in sync with setup.cfg and user's guide
# **********************************************************************... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_port/test_misc.py | tadeu/markdown-it-py | 285 | 126252 | <reponame>tadeu/markdown-it-py
from markdown_it import MarkdownIt
from markdown_it import presets
def test_highlight_arguments():
def highlight_func(str_, lang, attrs):
assert lang == "a"
assert attrs == "b c d"
return "<pre><code>==" + str_ + "==</code></pre>"
conf = presets.common... | 0 | 0 | 0 | 0 | 0 | 0 |
align/schema/pdk.py | mabrains/ALIGN-public | 119 | 126254 | from pydantic import validator, ValidationError, Field
from .types import BaseModel, Union, Optional, Literal, List
from typing import Dict
import pathlib
class ParasiticValues(BaseModel):
mean: int = 0
min: int = 0
max: int = 0
class Layer(BaseModel):
name: str
gds_layer_number: int
gds_dat... | 7 | 8 | 37 | 0 | 52 | 0 |
app/lib/daemon/manager.py | grepleria/SnitchDNS | 152 | 126256 | <reponame>grepleria/SnitchDNS
import ipaddress
import time
class DaemonManager:
@property
def ip(self):
return self.__bind_ip
@property
def port(self):
return self.__bind_port
def __init__(self, bind_ip, bind_port, system, shell):
self.__bind_ip = bind_ip
self.__b... | 0 | 0 | 0 | 0 | 0 | 0 |
ch06-Drawing function/Drawing_UTF-8_strings.py | Anancha/OpenCV-Python-Tutorial | 2,875 | 126307 | <filename>ch06-Drawing function/Drawing_UTF-8_strings.py<gh_stars>1000+
# -*- coding: utf-8 -*-
# @Time : 2017/7/23 下午9:11
# @Author : play4fun
# @File : Drawing_UTF-8_strings.py
# @Software: PyCharm
"""
Drawing_UTF-8_strings.py:
https://fireant.github.io/misc/2017/01/28/ttf-opencv.html
"""
import cv2
import ... | 0 | 0 | 0 | 0 | 0 | 0 |
extras/forms.py | maznu/peering-manager | 127 | 126326 | <filename>extras/forms.py
from django import forms
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from requests.exceptions import HTTPError
from utils.forms import (
APISelectMultiple,
BootstrapMixin,
DynamicModelMultipleChoiceField,
StaticSelect,
add... | 0 | 0 | 0 | 0 | 0 | 0 |
crf/alphabet.py | Pandinosaurus/crf | 348 | 126348 | from __future__ import annotations
class Alphabet:
"""
Bijective mapping from strings to integers.
>>> a = Alphabet()
>>> [a[x] for x in 'abcd']
[0, 1, 2, 3]
>>> list(map(a.lookup, range(4)))
['a', 'b', 'c', 'd']
>>> a.stop_growth()
>>> a['e']
>>> a.freeze()
>>> a.add('z')
... | 1 | 14 | 0 | 5 | 20 | 0 |
stonesoup/dataassociator/tests/conftest.py | Red-Portal/Stone-Soup-1 | 157 | 126357 | # -*- coding: utf-8 -*-
import pytest
import numpy as np
from ...hypothesiser.probability import PDAHypothesiser
from ...hypothesiser.distance import DistanceHypothesiser
from ...measures import Mahalanobis
from ...models.measurement.linear import LinearGaussian
from ...types.array import CovarianceMatrix
from ...mode... | 0 | 5 | 0 | 0 | 5 | 0 |
passwords/type7.py | m00tiny/scripts | 877 | 126410 | <filename>passwords/type7.py
import sys
V = [0x64, 0x73, 0x66, 0x64, 0x3b, 0x6b, 0x66, 0x6f, 0x41, 0x2c, 0x2e,
0x69, 0x79, 0x65, 0x77, 0x72, 0x6b, 0x6c, 0x64, 0x4a, 0x4b, 0x44,
0x48, 0x53, 0x55, 0x42, 0x73, 0x67, 0x76, 0x63, 0x61, 0x36, 0x39,
0x38, 0x33, 0x34, 0x6e, 0x63, 0x78, 0x76, 0x39, 0x38, 0x37, 0x33... | 0 | 0 | 0 | 0 | 0 | 0 |
batchflow/models/torch/blocks/__init__.py | analysiscenter/dataset | 101 | 126427 | """ Blocks: large parts that implement idea/named entity from popular articles. """
from .core import Block, DefaultBlock, Downsample, Upsample
from .named_blocks import VGGBlock, ResBlock, ResNeStBlock, DenseBlock, MBConvBlock, InvResBlock, ConvNeXtBlock
from .attention import SEBlock, SCSEBlock, SimpleSelfAttention, ... | 0 | 0 | 0 | 0 | 0 | 0 |
venv/Lib/site-packages/pydeck/types/image.py | ajayiagbebaku/NFL-Model | 7,702 | 126457 | <reponame>ajayiagbebaku/NFL-Model
import base64
import os
import pathlib
import re
from pydeck.types import String
from pydeck.types.base import PydeckType
# See https://github.com/django/django/blob/stable/1.3.x/django/core/validators.py#L45
valid_url_regex = re.compile(
r"^(?:http|ftp)s?://"
r"(?:(?:[A-Z0-... | 0 | 0 | 0 | 0 | 0 | 0 |
dialogue-engine/test/programytest/parser/template/graph_tests/test_resetlearn.py | cotobadesign/cotoba-agent-oss | 104 | 126462 | """
Copyright (c) 2020 COTOBA DESIGN, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distri... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_density_GaussianDensity.py | SyedZiaul/freud | 172 | 126502 | import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import numpy.testing as npt
import pytest
import freud
matplotlib.use("agg")
class TestGaussianDensity:
def test_random_point_with_cell_list(self):
fftpack = pytest.importorskip("scipy.fftpack")
fft = fftpack.fft
fftshi... | 0 | 0 | 0 | 0 | 0 | 0 |
library/oci_identity_tag_default.py | slmjy/oci-ansible-modules | 106 | 126515 | <filename>library/oci_identity_tag_default.py
#!/usr/bin/python
# Copyright (c) 2017, 2019 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/question_answering_confidence.py | skirdey/FARM | 1,551 | 126531 | <reponame>skirdey/FARM<gh_stars>1000+
import logging
import torch
from pathlib import Path
from farm.utils import set_all_seeds, MLFlowLogger, initialize_device_settings
from farm.modeling.tokenization import Tokenizer
from farm.data_handler.processor import SquadProcessor
from farm.data_handler.data_silo import DataS... | 0 | 0 | 0 | 0 | 0 | 0 |
pytorch-commen-code/code2.py | riciche/SimpleCVReproduction | 923 | 126551 | <reponame>riciche/SimpleCVReproduction<gh_stars>100-1000
import torch
tensor = torch.randn(3,4,5)
print(tensor.type())
print(tensor.size())
# size不是shape
print(tensor.dim())
print(tensor.shape)
# 骚操作:命名张量
images = torch.randn(3,3,4,4)
print(images.sum(dim=1).shape)
print(images.select(dim=1, index=0).shape)
# pytorc... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_numpy.py | lishoujun/pysimdjson | 531 | 126564 | import json
import pytest
import simdjson
def with_buffer(content):
import numpy
parser = simdjson.Parser()
doc = parser.parse(content)
assert len(numpy.frombuffer(doc.as_buffer(of_type='d'))) == 10001
def without_buffer(content):
import numpy
parser = simdjson.Parser()
doc = parser.... | 0 | 0 | 0 | 0 | 0 | 0 |
test/test_rnadiff.py | khourhin/sequana | 138 | 126565 | from sequana.rnadiff import RNADiffResults, RNADiffAnalysis, RNADesign
from . import test_dir
import pytest
def test_design():
d = RNADesign(f"{test_dir}/data/rnadiff/design.csv")
assert d.comparisons == [('Complemented_csrA', 'Mut_csrA'), ('Complemented_csrA', 'WT'), ('Mut_csrA', 'WT')]
assert d.conditi... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_socfaker_pcap.py | priamai/soc-faker | 122 | 126606 | def test_socfaker_pcap(socfaker_fixture):
assert socfaker_fixture.pcap()
| 0 | 0 | 0 | 0 | 0 | 0 |
nitorch/metrics.py | ArneBinder/Pytorch-LRP | 117 | 126659 | from sklearn.metrics import recall_score, roc_curve, auc
def specificity(y_true, y_pred) -> object:
return recall_score(y_true, y_pred, pos_label=0)
def sensitivity(y_true, y_pred) -> object:
return recall_score(y_true, y_pred, pos_label=1)
def balanced_accuracy(y_true, y_pred) -> object:
spec = specif... | 0 | 4 | 0 | 0 | 4 | 0 |
tests/notebooks/percent/hydrogen.py | st--/jupytext | 5,378 | 126661 | # %%
import pandas as pd
# %% Display a data frame
df = pd.DataFrame({'A': [1, 2], 'B': [3, 4]},
index=pd.Index(['x0', 'x1'], name='x'))
df
# %% Pandas plot {"tags": ["parameters"]}
df.plot(kind='bar')
| 0 | 0 | 0 | 0 | 0 | 0 |
bookstore/tests/test_archive.py | anderser/bookstore | 192 | 126685 | <reponame>anderser/bookstore
"""Tests for archive"""
import asyncio
import pytest
import json
import logging
from bookstore.archive import ArchiveRecord, BookstoreContentsArchiver
from nbformat.v4 import new_notebook
def test_create_contentsarchiver():
assert BookstoreContentsArchiver()
def test_create_content... | 0 | 0 | 0 | 0 | 0 | 0 |
Image_Synthesis_From_Text/char-CNN-RNN/pascal1k/create_word_rep.py | alexkrojas13/Deep-Learning-Challenges | 298 | 126715 | <gh_stars>100-1000
import numpy as np
import lutorpy as lua
require("torch")
file_list = open('filelist.txt', 'r')
alphabet = "abcdefghijklmnopqrstuvwxyz0123456789-,;.!?:'\"/\\|_@#$%^&*~`+-=<>()[]{} "
key_idx = 1
dictionary = {}
for alph_idx in range(len(alphabet)):
dictionary[alphabet[alph_idx]] = key_idx
key_i... | 0 | 0 | 0 | 0 | 0 | 0 |
prepro/prepro_atis.py | SeonjeongHwang/xlnet_extension_cuda11 | 137 | 126724 | <gh_stars>100-1000
import argparse
import json
import os.path
import uuid
def add_arguments(parser):
parser.add_argument("--input_dir", help="input data directory", required=True)
parser.add_argument("--output_dir", help="output data directory", required=True)
def preprocess(input_dir,
output_d... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/cmt/test/__init__.py | kamilisa/cmt | 199 | 126749 | <gh_stars>100-1000
"""
CMT Unit Test framework.
"""
from cmt.test.mayaunittest import TestCase
__all__ = ["TestCase", "run_tests"]
| 0 | 0 | 0 | 0 | 0 | 0 |
samples/copy_feature_service_deforgorg.py | kevinsigwart/ArcREST | 208 | 126765 | <filename>samples/copy_feature_service_deforgorg.py
"""
This sample shows how to copy a feature service
"""
import arcrest
import tempfile
import os
import uuid
import json
from arcresthelper import securityhandlerhelper
def trace():
"""
trace finds the line, the filename
and error message and r... | 0 | 0 | 0 | 0 | 0 | 0 |
mmrotate/core/visualization/__init__.py | liuyanyi/mmrotate | 449 | 126777 | <gh_stars>100-1000
# Copyright (c) OpenMMLab. All rights reserved.
from .image import imshow_det_rbboxes
from .palette import get_palette
__all__ = ['imshow_det_rbboxes', 'get_palette']
| 0 | 0 | 0 | 0 | 0 | 0 |
examples/synthetic/borehole_constrained/in_code_demo.py | hase1128/dragonfly | 675 | 126793 | <reponame>hase1128/dragonfly
"""
In code demo for borehole_constrained example.
-- <EMAIL>
"""
from __future__ import print_function
from dragonfly import load_config, maximise_function, maximise_multifidelity_function
# From current directory
from borehole_constrained import objective
from borehole_constrained_m... | 0 | 0 | 0 | 0 | 0 | 0 |
src/states/menu.py | AnonVodka/VALORANT-rank-yoinker | 107 | 126814 | <reponame>AnonVodka/VALORANT-rank-yoinker
class Menu:
def __init__(self, Requests, log, presences):
self.Requests = Requests
self.log = log
self.presences = presences
def get_party_json(self, GamePlayersPuuid, presencesDICT):
party_json = {}
for presence in presence... | 0 | 0 | 0 | 0 | 0 | 0 |
loudml/loudml/schemas.py | jkbrandt/loudml | 245 | 126823 | <gh_stars>100-1000
"""
Common schemas for user input validation
"""
import loudml.errors
from voluptuous import (
All,
Any,
Boolean,
Invalid,
Length,
Match,
message,
Required,
Optional,
Range,
Schema,
)
import voluptuous as vol
from urllib.parse import urlparse
from .misc ... | 0 | 0 | 0 | 0 | 0 | 0 |
networks/emotions_recognition_retail_0003/emotions_recognition_retail_0003.py | neuralbotnetworks/ncappzoo | 968 | 126832 | #! /usr/bin/env python3
# Copyright(c) 2019 Intel Corporation.
# License: MIT See LICENSE file in root directory.
from argparse import ArgumentParser, SUPPRESS
from openvino.inference_engine import IENetwork, IEPlugin, IECore
import cv2
import logging as log
import numpy as np
import os
import sys
import time
# Spec... | 0 | 1 | 0 | 0 | 1 | 0 |
examples/pyramid_backbone_redis_chat_persistence/chatter4/__init__.py | benthomasson/gevent-socketio | 625 | 126866 | #!/usr/bin/env python
from __future__ import annotations
from sqlalchemy import engine_from_config
from pyramid.config import Configurator
from chatter4.models import DBSession
from chatter4.views import socketio_service
from chatter4.views import index
from chatter4.views import get_log
def simple_route(config, na... | 1 | 1 | 0 | 0 | 2 | 0 |
docs_src/path_params/tutorial003.py | Aryabhata-Rootspring/fastapi | 53,007 | 126913 | <reponame>Aryabhata-Rootspring/fastapi
from fastapi import FastAPI
app = FastAPI()
@app.get("/users/me")
async def read_user_me():
return {"user_id": "the current user"}
@app.get("/users/{user_id}")
async def read_user(user_id: str):
return {"user_id": user_id}
| 0 | 0 | 0 | 0 | 0 | 0 |
setup.py | adamchainz/ec2_metadata | 284 | 126971 | <gh_stars>100-1000
from __future__ import annotations
from setuptools import setup
setup()
| 0 | 0 | 0 | 0 | 0 | 0 |
TopQuarkAnalysis/TopEventProducers/python/producers/TtFullLepEvtFilter_cfi.py | ckamtsikis/cmssw | 852 | 126976 | <reponame>ckamtsikis/cmssw
import FWCore.ParameterSet.Config as cms
#
# module to filter events based on member functions of the TtFullLeptonicEvent
#
ttFullLepEventFilter = cms.EDFilter("TtFullLepEvtFilter",
src = cms.InputTag("ttFullLepEvent"),
cut = cms.string("isHypoValid('kGenMatch') & genMatchSumDR < 999... | 0 | 0 | 0 | 0 | 0 | 0 |
tutorials/W0D5_Statistics/solutions/W0D5_Tutorial2_Solution_aba8ef46.py | eduardojdiniz/CompNeuro | 2,294 | 126978 | <filename>tutorials/W0D5_Statistics/solutions/W0D5_Tutorial2_Solution_aba8ef46.py
"""
Remember that joint probability can generally be expressed as 𝑃(𝑎,𝑏)=𝑃(𝑎|𝑏)𝑃(𝑏)
𝑃(ℎ+,𝑣+)=𝑃(ℎ+|𝑣+)𝑃(𝑣+)=0.1∗0.3=0.03
""" | 0 | 0 | 0 | 0 | 0 | 0 |
tests/export/html/test_drawing_graphic_blip.py | botzill/pydocx | 127 | 126988 | # coding: utf-8
from __future__ import (
absolute_import,
print_function,
unicode_literals,
)
import base64
from pydocx.constants import EMUS_PER_PIXEL
from pydocx.openxml.packaging import ImagePart, MainDocumentPart
from pydocx.test import DocumentGeneratorTestCase
from pydocx.test.utils import Wordproc... | 0 | 0 | 0 | 0 | 0 | 0 |
mode/examples/Topics/Vectors/AccelerationWithVectors/AccelerationWithVectors.pyde | timgates42/processing.py | 1,224 | 126994 | """
Acceleration with Vectors
by <NAME>.
Demonstration of the basics of motion with vector.
A "Mover" object stores location, velocity, and acceleration as vectors The
motion is controlled by affecting the acceleration (in this case towards the
mouse)
For more examples of simulating motion and physics with vectors, se... | 0 | 0 | 0 | 0 | 0 | 0 |
deep-rl/lib/python2.7/site-packages/OpenGL/raw/GL/SUN/triangle_list.py | ShujaKhalid/deep-rl | 210 | 127021 | <reponame>ShujaKhalid/deep-rl
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import C... | 0 | 0 | 0 | 0 | 0 | 0 |
lang-python/src/test/resources/tiny_py_interpreter/tinypy/AST/stmt.py | nrs011/steady | 357 | 127053 | <filename>lang-python/src/test/resources/tiny_py_interpreter/tinypy/AST/stmt.py
import copy
from enum import Enum
from tinypy.AST.ast import Statement, Expression, MemoryContext
from tinypy.AST.expr import AddOp, SubOp, MultOp, DivOp, ModOp, LshiftOp, RshiftOp, BinOp, UnaryOp, Compare
from tinypy.AST.expr import BitAnd... | 0 | 0 | 0 | 0 | 0 | 0 |
test/tst_compression.py | timgates42/netcdf4-python | 574 | 127057 | <filename>test/tst_compression.py
from numpy.random.mtrand import uniform
from netCDF4 import Dataset
from netCDF4.utils import _quantize
from numpy.testing import assert_almost_equal
import os, tempfile, unittest
ndim = 100000
ndim2 = 100
chunk1 = 10; chunk2 = ndim2
nfiles = 7
files = [tempfile.NamedTemporaryFile(suf... | 0 | 0 | 0 | 0 | 0 | 0 |
pytorch/examples/SRNN/helpermethods.py | krantikiran/EdgeML | 719 | 127062 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license.
import argparse
def getSRNN2Args() -> object:
def checkIntPos(value) -> object:
ivalue = int(value)
if ivalue <= 0:
raise argparse.ArgumentTypeError(
"%s is an invalid positive... | 0 | 5 | 0 | 0 | 5 | 0 |
L1Trigger/L1TMuonBarrel/test/kalmanTools/makePTPhiLUTs.py | ckamtsikis/cmssw | 852 | 127095 | from __future__ import print_function
from math import pi,floor
print(int(((-330+1024)*pi/(6.0*2048.0))/(0.625*pi/180.0)))
#phi=[]
#for i in range(0,2048):
# p = int((i*pi/(6.0*2048.0)+15.0*pi/180.0)/(0.625*pi/180.0))
# p = int((i*2*pi/(6.0*2048.0))/(0.625*pi/180.0))
# phi.append(str(p))
#print('const ap... | 0 | 2 | 0 | 0 | 2 | 0 |
src/foreground_scaling.py | ML-Toolkit/trimap_generator | 168 | 127096 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import cv2, os, sys
import numpy as np
from abc import ABC, abstractmethod
def extractImage(path) -> object:
# error handller if the intended path is not found
image = cv2.imread(path, cv2.IMREAD_GRAYSCALE);
return image
def checkImage(image) -> bool:
"""
... | 0 | 4 | 0 | 0 | 4 | 0 |
src/nvim/testdir/pyxfile/pyx.py | uga-rosa/neovim | 48,021 | 127109 | import sys
print(sys.version)
| 0 | 0 | 0 | 0 | 0 | 0 |
Chapter15/python_object_to_json.py | add54/ADMIN_SYS_PYTHON | 116 | 127114 | <filename>Chapter15/python_object_to_json.py<gh_stars>100-1000
import json
python_dict = {"Name": "Harry", "Age": 26}
python_list = ["Mumbai", "Pune"]
python_tuple = ("Basketball", "Cricket")
python_str = ("hello_world")
python_int = (150)
python_float = (59.66)
python_T = (True)
python_F = (False)
python_N = ... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/ecommerce-app/checkout-api/src/remove_sensitive_data.py | carvantes/aws-serverless-event-fork-pipelines | 126 | 127150 | <reponame>carvantes/aws-serverless-event-fork-pipelines
"""Lambda function handler."""
# must be the first import in files with lambda function handlers
import lambdainit # noqa: F401
import base64
import json
import lambdalogging
LOG = lambdalogging.getLogger(__name__)
def handler(event, context):
"""Remove... | 0 | 0 | 0 | 0 | 0 | 0 |
rman_operators/rman_operators_utils.py | N500/RenderManForBlender | 432 | 127164 | from .. import rman_bl_nodes
from ..rfb_icons import get_bxdf_icon, get_light_icon, get_lightfilter_icon, get_projection_icon
from ..rman_constants import RMAN_BL_NODE_DESCRIPTIONS
def get_description(category, node_name) -> object:
description = None
for n in rman_bl_nodes.__RMAN_NODES__.get(category, list())... | 0 | 5 | 0 | 0 | 5 | 0 |
pycantonese/tests/test_docs.py | jacksonllee/pycantonese | 124 | 127193 | <reponame>jacksonllee/pycantonese<filename>pycantonese/tests/test_docs.py
"""Tests related to the documentation."""
import pytest
import requests
@pytest.mark.parametrize(
"url",
[
"https://talkbank.org/manuals/CHAT.pdf",
"https://pylangacq.org/",
"http://compling.hss.ntu.edu.sg/hkca... | 0 | 0 | 0 | 0 | 0 | 0 |
terrascript/provider/camptocamp/jwt.py | mjuenema/python-terrascript | 507 | 127197 | <reponame>mjuenema/python-terrascript
# terrascript/provider/camptocamp/jwt.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:19:50 UTC)
import terrascript
class jwt(terrascript.Provider):
"""Terraform Provider for generating JSON Web Tokens"""
__description__ = "Terraform Provider for gener... | 0 | 0 | 0 | 0 | 0 | 0 |
cloudia/word_data.py | kakadaXY/cloudia | 128 | 127216 | <reponame>kakadaXY/cloudia
from typing import Any, List, Tuple, Dict, Callable, Union
from itertools import repeat, chain, zip_longest
from collections import Counter
from joblib import Parallel, delayed
import pandas as pd
from cloudia.utils import function_wrapper, make_nagisa_tagger
class WordData:
def __ini... | 0 | 0 | 0 | 0 | 0 | 0 |
src/api/extension.py | piwaniuk/critic | 216 | 127227 | # -*- mode: python; encoding: utf-8 -*-
#
# Copyright 2015 the Critic contributors, 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/licenses/LI... | 4 | 7 | 0 | 0 | 11 | 0 |
listings/chap6/listing_6_4_find_metric_groups.py | genekuo/fight-churn | 151 | 127278 | import pandas as pd
import numpy as np
import os
from collections import Counter
from scipy.cluster.hierarchy import linkage, fcluster
from scipy.spatial.distance import squareform
def find_correlation_clusters(corr,corr_thresh) -> object:
dissimilarity = 1.0 - corr
hierarchy = linkage(squareform(dissimilarit... | 1 | 3 | 0 | 0 | 4 | 0 |
tools/eval.py | briana-jin-zhang/spatial-segmentation | 733 | 127299 | import argparse
from pycocotools.coco import COCO
from pycocotools.cocoeval import COCOeval
import sys
sys.path.append('.')
def parse_args() -> object:
parser = argparse.ArgumentParser()
parser.add_argument('res', type=str)
parser.add_argument('gt', type=str)
args = parser.parse_args()
return args
... | 0 | 1 | 0 | 0 | 1 | 0 |
devtools/print_requirements.py | Wheelspawn/pudl | 285 | 127337 | <reponame>Wheelspawn/pudl<filename>devtools/print_requirements.py
#!/usr/bin/python3
"""Print out install requirements from setup.py for use with pip install."""
import distutils.core
setup = distutils.core.run_setup("setup.py")
for dep in setup.install_requires:
print(dep)
| 0 | 0 | 0 | 0 | 0 | 0 |
libp2p/security/exceptions.py | swedneck/py-libp2p | 315 | 127357 | from libp2p.exceptions import BaseLibp2pError
class HandshakeFailure(BaseLibp2pError):
pass
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/functional/simple_snapshot/test_changing_check_cols_snapshot.py | tomasfarias/dbt-core | 799 | 127386 | from __future__ import annotations
import pytest
from dbt.tests.util import run_dbt, check_relations_equal
snapshot_sql = """
{% snapshot snapshot_check_cols_new_column %}
{{
config(
target_database=database,
target_schema=schema,
strategy='check',
unique_key... | 0 | 3 | 0 | 0 | 3 | 0 |
panel/api/views.py | freejooo/vigilio | 137 | 127440 | <reponame>freejooo/vigilio<gh_stars>100-1000
import logging
from dataclasses import asdict
from typing import List, Dict, Any
import dotenv
from celery.app.control import Inspect
from django.conf import settings
from django.contrib.auth.models import User
from qbittorrent import Client
from rest_framework import statu... | 0 | 0 | 0 | 0 | 0 | 0 |
task/game_signin.py | dhbowen1/unicom-task | 178 | 127450 | # -*- coding: utf-8 -*-
# @Time : 2021/08/14 16:30
# @Author : srcrs
# @Email : <EMAIL>
import requests,json,time,re,login,logging,traceback,os,random,notify,datetime
from lxml.html import fromstring
#游戏任务中心每日打卡领积分,游戏任务自然数递增至7,游戏频道每日1积分
#位置: 首页 --> 游戏 --> 每日打卡
class game_signin:
def run(self, client, user):
... | 0 | 0 | 0 | 0 | 0 | 0 |
lib/company_jira.py | Rehzende/project-dev-kpis | 113 | 127473 | <reponame>Rehzende/project-dev-kpis<filename>lib/company_jira.py<gh_stars>100-1000
import os
from jira import JIRA
JIRA_API_SERVER = os.getenv('JIRA_API_SERVER')
JIRA_API_USER = os.getenv('JIRA_API_USER')
JIRA_API_PASSWORD = os.getenv('JIRA_API_PASSWORD')
jira = JIRA(
server=JIRA_API_SERVER,
basic_auth=(JIRA_... | 0 | 0 | 0 | 0 | 0 | 0 |
typed_python/compiler/global_variable_definition.py | APrioriInvestments/typed_python | 105 | 127504 | <reponame>APrioriInvestments/typed_python
# Copyright 2020 typed_python 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 |
caffe-grid/src/main/python/com/yahoo/__init__.py | jenniew/IntelCaffeOnSpark_mirror | 1,436 | 127623 | from ml import *
__all__=["ml"]
| 0 | 0 | 0 | 0 | 0 | 0 |
Models/License-Plate-Recognition-Nigerian-vehicles-master/License-Plate-Recognition-Nigerian-vehicles-master/plotting.py | nipunjain099/AutoGuard | 147 | 127627 | import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
def plot_cca(image, objects_cordinates):
fig, ax = plt.subplots(ncols=1, nrows=1, figsize=(12, 12))
ax.imshow(image, cmap=plt.cm.gray)
for each_cordinate in objects_cordinates:
min_row, min_col, max_row, max_col = each_cordinate... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/_init_paths.py | sibeiyang/sgmn | 130 | 127661 | import os.path as osp
import sys
def add_path(path):
if path not in sys.path:
sys.path.insert(0, path)
# path
this_dir = osp.dirname(__file__)
# refer path
refer_dir = osp.join(this_dir, '..', 'data', 'ref')
sys.path.insert(0, refer_dir)
# lib path
sys.path.insert(0, osp.join(this_dir, '..'))
sys.pat... | 0 | 0 | 0 | 0 | 0 | 0 |
src/network/socket_depth.py | nitsanw/grav | 283 | 127686 | #!/usr/bin/python
## Heavily inspired by /usr/share/bcc/tools/tcptop
import sys
import time
import datetime
from bcc import BPF
from socket import inet_ntop, AF_INET, AF_INET6
from struct import pack
prog="""
#include <linux/types.h>
#include <uapi/linux/ptrace.h>
#include <uapi/linux/bpf_perf_event.h>
#include <l... | 0 | 1 | 0 | 0 | 1 | 0 |
docs/assets/update_formats.py | Kronuz/Xapiand | 370 | 127720 | <filename>docs/assets/update_formats.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
import json
import msgpack
from collections import OrderedDict
def main():
if len(sys.argv) != 2:
print("usage: {} <file.json>".format(sys.argv[0]))
sys... | 0 | 0 | 0 | 0 | 0 | 0 |
DiffAugment-biggan-imagenet/compare_gan/architectures/infogan.py | Rian-T/data-efficient-gans | 1,902 | 127727 | # coding=utf-8
# Copyright 2018 Google LLC & <NAME>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 0 | 2 | 0 | 0 | 2 | 0 |
vh/gate_proxy.py | rEinve/ajenti-v | 150 | 127742 | <reponame>rEinve/ajenti-v
from ajenti.api import plugin
from ajenti.plugins.vh.api import ApplicationGatewayComponent
@plugin
class ProxyPass (ApplicationGatewayComponent):
id = 'proxy'
title = _('Reverse proxy') | 0 | 0 | 0 | 0 | 0 | 0 |
tests/Python/Delay/PyATKDelay_stereouniversaldelay_test.py | D-J-Roberts/AudioTK | 249 | 127745 | <reponame>D-J-Roberts/AudioTK
#!/usr/bin/env python
from ATK.Core import DoubleInPointerFilter, DoubleOutPointerFilter, PipelineGlobalSinkFilter
from ATK.Delay import DoubleDualMultipleUniversalFixedDelayLineFilter
sample_rate = 96000
def filter(inputl, inputr, blend_ch1=0, blend_ch2=0,
feedback_ch1_ch1=0, feedb... | 0 | 0 | 0 | 0 | 0 | 0 |
academicstoday_project/teacher/views/overview.py | LeeDoona/EasyGrading | 146 | 127748 | from django.shortcuts import render
from django.core import serializers
from django.http import HttpResponse
from django.contrib.auth.models import User
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from django.conf import settings
import json
impo... | 0 | 4 | 0 | 0 | 4 | 0 |
tests/test_api.py | proteanblank/poseidon | 251 | 127766 | import falcon
import pytest
from falcon import testing
from poseidon_api.api import api
@pytest.fixture
def client() -> object:
return testing.TestClient(api)
def test_v1(client):
response = client.simulate_get('/v1')
assert response.status == falcon.HTTP_OK
def test_network(client):
response = cl... | 0 | 1 | 0 | 0 | 1 | 0 |
tests/test_camera_distortion.py | aferrall/redner | 1,146 | 127793 | import pyredner
import torch
pyredner.set_use_gpu(torch.cuda.is_available())
position = torch.tensor([1.0, 0.0, -3.0])
look_at = torch.tensor([1.0, 0.0, 0.0])
up = torch.tensor([0.0, 1.0, 0.0])
fov = torch.tensor([45.0])
clip_near = 1e-2
# randomly generate distortion parameters
torch.manual_seed(1234)
target_distor... | 0 | 0 | 0 | 0 | 0 | 0 |
user_agents/__init__.py | nagesh4193/python-user-agents | 1,166 | 127803 | VERSION = (2, 2, 0)
from .parsers import parse
| 0 | 0 | 0 | 0 | 0 | 0 |
tutorials/stock-wallet/microservices/crypto/tests/test_commands/test_services.py | bhardwajRahul/minos-python | 247 | 127810 | import sys
import unittest
import pendulum
from src import (
Crypto,
CryptoCommandService,
)
from minos.networks import (
InMemoryRequest,
Response,
)
from tests.utils import (
build_dependency_injector,
)
class TestCryptoCommandService(unittest.IsolatedAsyncioTestCase):
def setUp(self) -> N... | 0 | 3 | 0 | 0 | 3 | 0 |
src/add_lat_lon_2d.py | deephyper/WeatherBench | 343 | 127833 | from __future__ import annotations
import argparse
import xarray as xr
import numpy as np
import xesmf as xe
from glob import glob
import os
import shutil
def add_2d(
ds,
) -> object:
"""
Regrid horizontally.
:param ds: Input xarray dataset
"""
ds['lat2d'] = ds.lat.expand_dims({'lon': ds.lo... | 1 | 2 | 0 | 0 | 3 | 0 |
pykka/_envelope.py | fjarri/pykka | 796 | 127847 | <filename>pykka/_envelope.py
class Envelope:
"""
Envelope to add metadata to a message.
This is an internal type and is not part of the public API.
:param message: the message to send
:type message: any
:param reply_to: the future to reply to if there is a response
:type reply_to: :class:`... | 0 | 0 | 0 | 0 | 0 | 0 |
minlp-tokenizer/minlptokenizer/tokenizer.py | ishine/MiNLP | 749 | 127857 | # Copyright 2020 The MiNLP Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 3 | 4 | 1 | 0 | 8 | 0 |
examples/example_project/context.py | szabolcsdombi/zengl | 116 | 127886 | import zengl
class Context:
context: None = None
main_uniform_buffer: None = None
main_uniform_buffer_data = bytearray(b'\x00' * 64)
@classmethod
def initialize(cls):
ctx = zengl.context()
cls.context = ctx
cls.main_uniform_buffer = ctx.buffer(size=64)
ctx.includes... | 0 | 0 | 2 | 0 | 2 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.