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 |
|---|---|---|---|---|---|---|---|---|---|---|
samples/query_agol_layer_using_ArcMap_Creds.py | kevinsigwart/ArcREST | 208 | 1701279 |
"""
@author: ArcREST Team
@contact: www.github.com/Esri/ArcREST
@company: Esri
@version: 1.0.0
@description: Querys a layer using ArcMap Creds.
@requirements: Python 2.7.x, ArcGIS 10.3, ArcREST 3.5.0
@copyright: Esri, 2015
"""
import os
from arcpy import env
from arcpy import mapping
from... | 0 | 2 | 0 | 0 | 2 | 0 |
cumulusci/tasks/salesforce/GetInstalledPackages.py | davisagli/CumulusCI | 163 | 1701291 | <filename>cumulusci/tasks/salesforce/GetInstalledPackages.py
# for backwards compatibility
from cumulusci.tasks.preflight.packages import * # noqa
| 0 | 0 | 0 | 0 | 0 | 0 |
yawast/scanner/plugins/http/response_scanner.py | Prodject/yawast | 200 | 1701319 | <gh_stars>100-1000
# Copyright (c) 2013 - 2020 <NAME> and Contributors.
# This file is part of YAWAST which is released under the MIT license.
# See the LICENSE file or go to https://yawast.org/license/ for full license details.
from datetime import datetime
from typing import List, Union
from bs4 import Beautiful... | 0 | 0 | 0 | 0 | 0 | 0 |
meerk40t/device/ch341/__init__.py | apbarratt/meerk40t | 118 | 1701330 | <reponame>apbarratt/meerk40t
name = "ch341"
| 0 | 0 | 0 | 0 | 0 | 0 |
django_tests/test_user_agent.py | goodtune/pycloudinary | 199 | 1701332 | <reponame>goodtune/pycloudinary
import six
from django.test import TestCase
import cloudinary
class TestUserAgent(TestCase):
def test_django_user_agent(self):
agent = cloudinary.get_user_agent()
six.assertRegex(self, agent, r'^Django\/\d\.\d+\.?\d* CloudinaryPython\/\d\.\d+\.\d+ \(Python \d\.\d+... | 0 | 0 | 0 | 0 | 0 | 0 |
shapely/vectorized/__init__.py | Jeremiah-England/Shapely | 2,382 | 1701345 | """Provides multi-point element-wise operations such as ``contains``."""
from shapely import speedups
from ._vectorized import (contains, touches)
| 0 | 0 | 0 | 0 | 0 | 0 |
atlas/foundations_core_rest_api_components/src/test/filters/test_null_filter.py | DeepLearnI/atlas | 296 | 1701361 | <reponame>DeepLearnI/atlas<gh_stars>100-1000
import unittest
from mock import patch
from foundations_core_rest_api_components.filters.null_filter import NullFilter
class TestNullFilter(unittest.TestCase):
class MockJobInfo(object):
def __init__(self, **kwargs):
for key, value in kwargs.items... | 0 | 0 | 0 | 0 | 0 | 0 |
sponsors/migrations/0029_auto_20210715_2015.py | ewjoachim/pythondotorg | 911 | 1701364 | # Generated by Django 2.0.13 on 2021-07-15 20:15
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies: list[tuple[str, str]] = [
('contenttypes', '0002_remove_content_type_name'),
('sponsors', '0028_auto_20210707_1426'),
... | 0 | 0 | 2 | 0 | 2 | 0 |
knox_project/urls.py | nnamdei/django-rest-knox | 788 | 1701368 | from django.urls import include, re_path
from .views import RootView
urlpatterns = [
re_path(r'^api/', include('knox.urls')),
re_path(r'^api/$', RootView.as_view(), name="api-root"),
]
| 0 | 0 | 0 | 0 | 0 | 0 |
src/homework/tests/api/tests_answer_update_is_blocked.py | denkasyanov/education-backend | 151 | 1701392 | import pytest
pytestmark = [
pytest.mark.django_db,
pytest.mark.usefixtures('purchase'),
]
def test_patch(api, answer):
api.patch(f'/api/v2/homework/answers/{answer.slug}/', {'text': 'test'}, expected_status_code=405)
def test_put(api, answer):
api.put(f'/api/v2/homework/answers/{answer.slug}/', {'... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_errorcallback.py | webpolis/python-rtmidi | 260 | 1701399 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for the error callback"""
import unittest
try:
from unittest import mock
except ImportError:
import mock
import rtmidi
class TestErrorCallback(unittest.TestCase):
INVALID_PORT_NUMBER: int = 9999
MIDI_OUT_ERROR_USER_DATA: str = 'midiOutError'
... | 0 | 0 | 3 | 0 | 3 | 0 |
pnacl/scripts/parse_llvm_test_report.py | cohortfsllc/cohort-cocl2-sandbox | 2,151 | 1701421 | <reponame>cohortfsllc/cohort-cocl2-sandbox<filename>pnacl/scripts/parse_llvm_test_report.py
#!/usr/bin/python
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Parse the report output of the llvm... | 0 | 0 | 0 | 0 | 0 | 0 |
deep-rl/lib/python2.7/site-packages/OpenGL/raw/WGL/ARB/create_context.py | ShujaKhalid/deep-rl | 210 | 1701465 | <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.WGL import _types as _cs
# End users want this...
from OpenGL.raw.WGL._types import *
from OpenGL.raw.WGL import _errors
from OpenGL.constant impor... | 0 | 0 | 0 | 0 | 0 | 0 |
v2/backend/admin/form.py | jonfairbanks/rtsp-nvr | 558 | 1701477 | <reponame>jonfairbanks/rtsp-nvr<filename>v2/backend/admin/form.py
import sqlalchemy
from flask_admin.form import BaseForm
from flask_admin.form.fields import Select2Field
from flask_admin.model.form import converts
from flask_admin.contrib.sqla.form import AdminModelConverter
class ReorderableForm(BaseForm):
def ... | 0 | 0 | 0 | 0 | 0 | 0 |
dm_control/mujoco/render_test.py | h8907283/dm_control | 2,863 | 1701480 | # Copyright 2017-2018 The dm_control 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 or agreed... | 0 | 0 | 0 | 0 | 0 | 0 |
pypeit/core/wavecal/spectrographs/templ_keck_lris.py | brackham/PypeIt | 107 | 1701501 | <reponame>brackham/PypeIt<gh_stars>100-1000
""" Generate the wavelength templates for Keck/LRIS"""
import os
from pypeit.core.wavecal import templates
# Keck/DEIMOS
def keck_lris_red_mark4_R400(overwrite=False):
binspec = 1
outroot = 'keck_lris_red_mark4_R400.fits'
# PypeIt fits
wpath = os.path.join... | 0 | 0 | 0 | 0 | 0 | 0 |
saleor/csv/tests/test_notifications.py | victor-abz/saleor | 1,392 | 1701502 | <reponame>victor-abz/saleor
from unittest import mock
from django.core.files import File
from freezegun import freeze_time
from ...core.notification.utils import get_site_context
from ...core.notify_events import AdminNotifyEvent
from ...core.utils import build_absolute_uri
from .. import notifications
from ..notific... | 0 | 0 | 0 | 0 | 0 | 0 |
pyclustering/cluster/examples/birch_examples.py | JosephChataignon/pyclustering | 1,013 | 1701503 | """!
@brief Examples of usage and demonstration of abilities of BIRCH algorithm in cluster analysis.
@authors <NAME> (<EMAIL>)
@date 2014-2020
@copyright BSD-3-Clause
"""
from pyclustering.cluster import cluster_visualizer
from pyclustering.cluster.birch import birch
from pyclustering.container.cftree... | 7 | 1 | 0 | 0 | 8 | 0 |
courses/machine_learning/deepdive2/structured/solutions/serving/application/lib/googleapiclient/_auth.py | laurenzberger/training-data-analyst | 6,140 | 1701537 | <reponame>laurenzberger/training-data-analyst
# Copyright 2016 Google Inc. 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... | 0 | 0 | 0 | 0 | 0 | 0 |
solutions/text_search_engine/quick_deploy/server/src/operations/load.py | kilianovski/bootcamp | 789 | 1701548 | <filename>solutions/text_search_engine/quick_deploy/server/src/operations/load.py
import sys
import numpy as np
import pandas as pd
sys.path.append("..")
from config import DEFAULT_TABLE
from logs import LOGGER
# Get the vector of question
def extract_features(file_dir, model):
try:
data = pd.read_csv(fi... | 0 | 0 | 0 | 0 | 0 | 0 |
mayan/apps/mailer/literals.py | atitaya1412/Mayan-EDMS | 343 | 1701552 | <gh_stars>100-1000
from django.utils.translation import ugettext_lazy as _
from mayan.apps.documents.models.document_file_models import DocumentFile
from mayan.apps.documents.models.document_version_models import DocumentVersion
DEFAULT_DOCUMENT_BODY_TEMPLATE = _(
'Attached to this email is the {{ object_name }}:... | 0 | 0 | 0 | 0 | 0 | 0 |
loafer/ext/aws/providers.py | hartungstenio/loafer | 111 | 1701597 | from __future__ import annotations
import asyncio
import logging
import botocore.exceptions
from .bases import BaseSQSClient
from loafer.exceptions import ProviderError
from loafer.providers import AbstractProvider
logger = logging.getLogger(__name__)
class SQSProvider(AbstractProvider, BaseSQSClient):
def __... | 1 | 4 | 0 | 0 | 5 | 0 |
sdk/monitor/azure-monitor-query/samples/sample_server_timeout.py | praveenkuttappan/azure-sdk-for-python | 2,728 | 1701605 | <filename>sdk/monitor/azure-monitor-query/samples/sample_server_timeout.py
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
"""
FILE: sample_server_timeout.py
DESCRIPTION:
This sample demonstrates how to update a server timeout for a long running query.
USAGE:
python... | 0 | 0 | 0 | 0 | 0 | 0 |
mode/examples/Basics/Color/Relativity/Relativity.pyde | timgates42/processing.py | 1,224 | 1701638 | <gh_stars>1000+
"""
Relativity.
Each color is perceived in relation to other colors. The top and bottom
bars each contain the same component colors, but a different display order
causes individual colors to appear differently.
"""
a = color(165, 167, 20)
b = color(77, 86, 59)
c = color(42, 106, 105)
d = color(165... | 0 | 0 | 0 | 0 | 0 | 0 |
polyfile/zipmatcher.py | trailofbits/polyfile | 190 | 1701654 | import zipfile
from kaitaistruct import KaitaiStructError
from .fileutils import Tempfile
from .kaitai.parser import KaitaiParser
from .kaitai.parsers.zip import Zip
from .kaitaimatcher import ast_to_matches
from .polyfile import InvalidMatch, Match, submatcher
@submatcher("application/zip")
class ZipFile(Match):
... | 0 | 0 | 0 | 0 | 0 | 0 |
py/moma/sensors/prop_pose_sensor_test.py | wx-b/dm_robotics | 128 | 1701665 | # Copyright 2020 DeepMind Technologies Limited.
#
# 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 ag... | 0 | 0 | 0 | 0 | 0 | 0 |
stanza/tests/resources/test_common.py | asears/stanza | 3,633 | 1701672 | """
Test various resource downloading functions from resources/common.py
"""
import pytest
import tempfile
import stanza
pytestmark = [pytest.mark.travis, pytest.mark.client]
def test_download_tokenize_mwt():
with tempfile.TemporaryDirectory(dir=".") as test_dir:
stanza.download("en", model_dir=test_di... | 0 | 0 | 0 | 0 | 0 | 0 |
amla/stubs/tf/cell_classification.py | CiscoAI/amla | 118 | 1701675 | # Copyright 2018 Cisco Systems 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 law or agre... | 0 | 2 | 0 | 1 | 3 | 0 |
corrMCNN/XRMB_CNN_17.06.v2.py | kishormishra3/DeepLearn | 1,756 | 1701697 | #Note
#CNN used
#XRMB Dataset
# had to degrade numpy to 1.11.0 as 1.13.0 doesn't support float index type in arrays
# myarray = np.fromfile('BinaryData.dat',dtype=float)
from __future__ import annotations
import sys
import math
import random
import warnings
import numpy as np
from sklearn import svm
i... | 3 | 13 | 0 | 0 | 16 | 0 |
uq360/models/bayesian_neural_networks/bnn_models/horseshoe_mlp.py | Sclare87/UQ360 | 148 | 1701700 | <filename>uq360/models/bayesian_neural_networks/bnn_models/horseshoe_mlp.py<gh_stars>100-1000
from abc import ABC
import numpy as np
import torch
from torch import nn
from uq360.models.bayesian_neural_networks.layers import HorseshoeLayer, BayesianLinearLayer, RegularizedHorseshoeLayer
from uq360.models.noise_models.... | 0 | 0 | 0 | 0 | 0 | 0 |
FAS_challenge_CVPRW2020/Track1 Multi-modal/model3_tensorflow/utils.py | Turing311/CDCN | 463 | 1701722 | <filename>FAS_challenge_CVPRW2020/Track1 Multi-modal/model3_tensorflow/utils.py<gh_stars>100-1000
""" Utility functions. """
import numpy as np
import os
import random
import tensorflow as tf
from tensorflow.contrib.layers.python import layers as tf_layers
from tensorflow.python.platform import flags
FLAGS = flags.FL... | 0 | 0 | 0 | 0 | 0 | 0 |
Custom/events/Zabbix/API/httpretty/__init__.py | aplishka-az/Deadline | 113 | 1701734 | <filename>Custom/events/Zabbix/API/httpretty/__init__.py
# #!/usr/bin/env python
# -*- coding: utf-8 -*-
# <HTTPretty - HTTP client mock for Python>
# Copyright (C) <2011-2013> <NAME> <<EMAIL>>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated docu... | 0 | 0 | 0 | 0 | 0 | 0 |
RecoJets/JetPlusTracks/python/ZSPJetCorrections332_cff.py | ckamtsikis/cmssw | 852 | 1701741 | <filename>RecoJets/JetPlusTracks/python/ZSPJetCorrections332_cff.py
import FWCore.ParameterSet.Config as cms
# Modules
#
# Define the producers of corrected jet collections for each algorithm.
#
ZSPJetCorJetIcone5 = cms.EDProducer("CaloJetProducer",
src = cms.InputTag("iterativeCone5CaloJets"),
tagName = c... | 0 | 0 | 0 | 0 | 0 | 0 |
test/test_pipeline/components/data_preprocessing/test_numerical_imputation.py | Louquinze/auto-sklearn | 6,390 | 1701748 | from scipy import sparse
from autosklearn.pipeline.components.data_preprocessing.imputation.numerical_imputation\
import NumericalImputation
from autosklearn.pipeline.util import _test_preprocessing, PreprocessingTestCase
class NumericalImputationTest(PreprocessingTestCase):
def test_default_configuration(se... | 0 | 0 | 0 | 0 | 0 | 0 |
data/h36m_dataset.py | Shimingyi/MotioNet | 368 | 1701769 | <filename>data/h36m_dataset.py<gh_stars>100-1000
# -*- coding:utf-8 -*-
import copy
import random
import numpy as np
from utils.Quaternions import Quaternions
from torch.utils.data import Dataset
from utils import h36m_utils, util
class h36m_dataset(Dataset):
def __init__(self, config, is_train=True):
po... | 0 | 0 | 0 | 0 | 0 | 0 |
modules/dbnd/src/dbnd/_vendor/splitter.py | ipattarapong/dbnd | 224 | 1701773 | # COPY PASTED FROM ansible 2.6 using BSD license
#
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, an... | 0 | 5 | 0 | 0 | 5 | 0 |
cx_Freeze/samples/relimport/pkg1/pkg2/sub3.py | lexa/cx_Freeze | 358 | 1701781 | <reponame>lexa/cx_Freeze<gh_stars>100-1000
print("importing pkg1.pkg2.sub3")
from . import sub5
from .. import sub6
| 0 | 0 | 0 | 0 | 0 | 0 |
tutorials/advanced/image_captioning/model/create_encoder_cnn_backbone_scriptmodule.py | shyney7/pytorch-cpp | 1,369 | 1701785 | import torch
import torchvision
import argparse
class EncoderCNNBackbone(torch.nn.Module):
def __init__(self):
super(EncoderCNNBackbone, self).__init__()
resnet_children = list(torchvision.models.resnet50(pretrained=True).children())[:-2]
self.layers = torch.nn.Sequential(*resnet_c... | 0 | 2 | 0 | 0 | 2 | 0 |
python/eggroll/core/datastructure/queue.py | liszekei/eggroll | 209 | 1701806 | # Copyright (c) 2019 - now, Eggroll 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 ... | 4 | 5 | 0 | 0 | 9 | 0 |
flappy/envs/fwmav/MyGLUTWindow.py | Leo-xxx/flappy | 192 | 1701817 | <reponame>Leo-xxx/flappy
########################## FWMAV Simulation #########################
# Version 0.3
# <NAME>, <NAME> Feb 2019
# Direct motor driven flapping wing MAV simulation
#######################################################################
import pydart2 as pydart
from pydart2.gui.glut.window impo... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/ut/python/pynative_mode/test_pynative_model.py | GuoSuiming/mindspore | 3,200 | 1701828 | # Copyright 2020 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 applicable law or agreed to... | 0 | 7 | 0 | 0 | 7 | 0 |
function/python/brightics/function/statistics/levene.py | sharon1321/studio | 202 | 1701847 | <gh_stars>100-1000
"""
Copyright 2019 Samsung SDS
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... | 0 | 0 | 0 | 0 | 0 | 0 |
Stock_Analysis/stock_statistical_dist.py | vhn0912/Finance | 441 | 1701883 | <reponame>vhn0912/Finance
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import warnings
warnings.filterwarnings("ignore")
import yfinance as yf
yf.pdr_override()
import datetime as dt
import scipy.stats as scs
# input
symbol = 'AMD'
market = 'SPY'
start = dt.date.today()... | 0 | 0 | 0 | 0 | 0 | 0 |
src/footprint/azext_footprint/vendored_sdks/footprint/models/__init__.py | Mannan2812/azure-cli-extensions | 207 | 1701927 | <reponame>Mannan2812/azure-cli-extensions<filename>src/footprint/azext_footprint/vendored_sdks/footprint/models/__init__.py
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See Licens... | 0 | 0 | 0 | 0 | 0 | 0 |
tabulator/parsers/inline.py | BCODMO/tabulator-py | 224 | 1701931 | # -*- coding: utf-8 -*-
from __future__ import annotations
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import six
from collections import OrderedDict
from ..parser import Parser
from .. import exceptions
# Module... | 2 | 3 | 1 | 3 | 9 | 0 |
luna/gateware/platform/ulx3s.py | modwizcode/luna | 609 | 1701947 | #
# This file is part of LUNA.
#
# Copyright (c) 2020 <NAME> <<EMAIL>>
# SPDX-License-Identifier: BSD-3-Clause
""" ULX3S platform definitions.
This is a non-core platform. To use it, you'll need to set your LUNA_PLATFORM variable,
as appropriate:
> export LUNA_PLATFORM="luna.gateware.platform.ulx3s:ULX3S_12F_Pla... | 0 | 1 | 8 | 0 | 9 | 0 |
dataset/preparation/preparedata_train.py | WestCityInstitute/DeepSFM | 235 | 1701967 | <filename>dataset/preparation/preparedata_train.py
import os
import sys
import subprocess
from joblib import Parallel, delayed
import numpy as np
import imageio
imageio.plugins.freeimage.download()
from imageio.plugins import freeimage
import h5py
from lz4.block import decompress
import scipy.misc
import cv2
from pat... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_config.py | teaglebuilt/bocadillo | 434 | 1701993 | import pytest
from bocadillo import configure, create_client, settings
def test_cannot_reconfigure(app):
with pytest.raises(RuntimeError):
configure(app)
def test_must_be_configured_to_serve(raw_app):
@raw_app.route("/")
async def index(req, res):
pass
with pytest.raises(RuntimeErr... | 1 | 0 | 0 | 0 | 1 | 0 |
doc/sphinx/generate-components.py | elinjammal/opensmile | 245 | 1701995 | <reponame>elinjammal/opensmile
import argparse
import json
import os
import re
def main(args):
with open(args.json_help_path) as f:
json_help = json.load(f)
# Directory storing the results.
dir_output = os.path.abspath("./_components")
if not os.path.exists(dir_output):
os.mkdir(dir_o... | 0 | 0 | 0 | 0 | 0 | 0 |
datasets/texture_synthesis_datasets.py | fyviezhao/dressing-in-order | 172 | 1702028 | from __future__ import annotations
import torch.utils.data as data
import torch
from .human_parse_labels import get_label_map
from PIL import Image
import numpy as np
import cv2
import torchvision.transforms as transforms
import torch
import copy, os, collections
import json
import random
def listdir(root) -> object:
... | 6 | 10 | 0 | 0 | 16 | 0 |
Install/esri2open/topojson/clockwise.py | fb98/esri2open | 116 | 1702040 | from __future__ import annotations
class Clock:
def __init__(self,area):
self.area=area
def clock(self,feature) -> object:
if 'geometries' in feature:
feature['geometries'] = map(self.clock_geometry,feature['geometries'])
elif 'geometry' in feature:
featur... | 0 | 4 | 0 | 0 | 4 | 0 |
src/cli/onefuzz/job_templates/builder.py | tonybaloney/onefuzz | 2,692 | 1702054 | <reponame>tonybaloney/onefuzz<gh_stars>1000+
#!/usr/bin/env python
#
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import logging
from inspect import Parameter, signature
from typing import Any, Dict, List, Optional
from onefuzztypes.enums import ContainerType, UserFieldType
from onefuzztyp... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/integration/python_await/success/__main__.py | pcen/pulumi | 12,004 | 1702068 | import asyncio
import pulumi
output = pulumi.Output.from_input(asyncio.sleep(1, "magic string"))
output.apply(print)
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/K8sSmokeTest.py | eracle/docker-selenium | 5,930 | 1702074 | <gh_stars>1000+
import json
import sys
import time
try:
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen
SELENIUM_GRID_URL = sys.argv[1]
max_attempts = 6
sleep_interval = 10
def get_grid_status():
try:
response = urlopen('%s/status' % (SELENIUM_GRID_URL))
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_filters.py | greggles/cutadapt | 375 | 1702078 | """
Tests write output (should it return True or False or write)
"""
import pytest
from dnaio import Sequence
from cutadapt.filters import TooManyN
from cutadapt.steps import PairedEndFilter
@pytest.mark.parametrize('seq,count,expected', [
('AAA', 0, False),
('AAA', 1, False),
('AAACCTTGGN', 1, False),
... | 0 | 0 | 0 | 0 | 0 | 0 |
lldb/packages/Python/lldbsuite/test/functionalities/command_history/TestCommandHistory.py | tkf/opencilk-project | 427 | 1702105 | """
Test the command history mechanism
"""
from __future__ import print_function
import os
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class CommandHistoryTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@no_deb... | 0 | 0 | 0 | 0 | 0 | 0 |
lib/loaders/dets_loader.py | wangshauitj/Mutatt | 312 | 1702114 | <reponame>wangshauitj/Mutatt<gh_stars>100-1000
"""
data_json has
0. refs : list of {ref_id, ann_id, box, image_id, split, category_id, sent_ids}
1. images : list of {image_id, ref_ids, ann_ids, file_name, width, height, h5_id}
2. anns : list of {ann_id, category_id, image_id, box, h5_id}
3. sentence... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/layers/positional_encoder_test.py | richarajpal/deep_qa | 459 | 1702116 | <reponame>richarajpal/deep_qa<gh_stars>100-1000
# pylint: disable=no-self-use,invalid-name
from keras.layers import Input, Embedding
from keras.models import Model
import numpy as np
from deep_qa.layers.encoders import PositionalEncoder
class TestPositionalEncoder:
def test_on_unmasked_input(self):
senten... | 0 | 0 | 0 | 0 | 0 | 0 |
projects/data_generation/synthetic_multi_view_facial_image_generation/algorithm/Rotate_and_Render/models/networks/loss.py | ESOGU-SRLAB/opendr | 217 | 1702163 | from __future__ import annotations
import torch
import torch.nn as nn
import torch.nn.functional as F
from .architecture import VGG19, VGGFace19
# Defines the GAN loss which uses either LSGAN or the regular GAN.
# When LSGAN is used, it is basically same as MSELoss,
# but it abstracts away the need to create the targ... | 9 | 10 | 0 | 4 | 23 | 0 |
kitsune/inproduct/migrations/0001_initial.py | AndrewDVXI/kitsune | 929 | 1702168 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies: list[object] = [
]
operations: list[object] = [
migrations.CreateModel(
name='Redirect',
fields=[
... | 0 | 0 | 2 | 0 | 2 | 0 |
Lib/test/eof_fodder1.py | jeff5/jython-whinchat | 577 | 1702179 | def d():
def e():
pass | 0 | 0 | 0 | 0 | 0 | 0 |
test/unit/test_represent_file_metadata.py | sigmavirus24/B2_Command_Line_Tool | 475 | 1702213 | ######################################################################
#
# File: test/unit/test_represent_file_metadata.py
#
# Copyright 2021 Backblaze Inc. All Rights Reserved.
#
# License https://www.backblaze.com/using_b2_code.html
#
######################################################################
from io imp... | 8 | 0 | 0 | 0 | 8 | 0 |
libreasr/lib/layers/haste/__init__.py | johnpaulbin/LibreASR | 680 | 1702227 | from .lstm import LSTM
from .layer_norm_lstm import LayerNormLSTM
from .gru import GRU
from .nbrc import NBRC
| 0 | 0 | 0 | 0 | 0 | 0 |
src/run_eval.py | maromaSamsa/mobile-semantic-segmentation-master | 713 | 1702257 | import albumentations as A
import matplotlib.pyplot as plt
import numpy as np
import torch
from torch.utils.data import DataLoader
from mobile_seg.const import EXP_DIR
from mobile_seg.dataset import load_df, MaskDataset, split_df
from mobile_seg.modules.net import load_trained_model
from mobile_seg.params import DataP... | 1 | 1 | 0 | 0 | 2 | 0 |
scripts/block_entity_renderers_converter.py | robertaird/Create | 188 | 1702269 | rendererLineStart = ".renderer(() -> "
allTileEntities = "../src/main/java/com/simibubi/create/AllTileEntities.java"
lines = []
file = open(allTileEntities)
for line in file:
if rendererLineStart in line:
if "//" in line:
lines.append(line)
continue
toReplace = line.split(ren... | 0 | 0 | 0 | 0 | 0 | 0 |
code/removeduplicate.py | caitryx/interview | 1,187 | 1702289 | <filename>code/removeduplicate.py
class Solution:
def removeDuplicates(self, nums: [int]):
if not nums: return []
k = 1
for i in range(1, len(nums)):
if nums[i] != nums[i - 1]:
k += 1
return k
print(Solution().removeDuplicates([1,1,2,3,3,3,4,4,5,5])) | 0 | 0 | 0 | 0 | 0 | 0 |
demo/GLUE/STS-B/stsb.py | SchenbergZY/keras-xlnet | 183 | 1702307 | <filename>demo/GLUE/STS-B/stsb.py
import os
import numpy as np
from scipy.stats import pearsonr, spearmanr
from keras_xlnet.backend import keras
from keras_bert.layers import Extract
from keras_xlnet import PretrainedList, get_pretrained_paths
from keras_xlnet import Tokenizer, load_trained_model_from_checkpoint, ATT... | 0 | 0 | 0 | 0 | 0 | 0 |
nni/tools/nnictl/url_utils.py | dutxubo/nni | 9,680 | 1702308 | <gh_stars>1000+
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import socket
import psutil
BASE_URL = 'http://localhost'
API_ROOT_URL = '/api/v1/nni'
EXPERIMENT_API = '/experiment'
CLUSTER_METADATA_API = '/experiment/cluster-metadata'
IMPORT_DATA_API = '/experiment/import-data'
CHECK_ST... | 0 | 0 | 0 | 0 | 0 | 0 |
hw/ip/otbn/dv/rig/rig/gens/loop_dup_end.py | GregAC/opentitan | 1,375 | 1702311 | # Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
from typing import List, Optional, Tuple
from shared.insn_yaml import InsnsFile
from shared.operand import ImmOperandType, OperandType
from .loop import Loop
from ..confi... | 25 | 7 | 0 | 2 | 34 | 0 |
pycharm2020.1.3/script/client/component/puppet/CompDungeon.py | LaudateCorpus1/realtime-server | 465 | 1702362 | <reponame>LaudateCorpus1/realtime-server<gh_stars>100-1000
from core.common.EntityFactory import EntityFactory
from common.component.Component import Component
from common import gv
class CompDungeon(Component):
VAR_NAME = 'CompDungeon'
def __init__(self):
super(CompDungeon, self).__init__()
... | 0 | 0 | 0 | 0 | 0 | 0 |
runtime/python/Lib/site-packages/lazy_object_proxy/utils_py3.py | hwaipy/InteractionFreeNode | 209 | 1702418 | <reponame>hwaipy/InteractionFreeNode<filename>runtime/python/Lib/site-packages/lazy_object_proxy/utils_py3.py
from collections.abc import Awaitable
from inspect import CO_ITERABLE_COROUTINE
from types import CoroutineType
from types import GeneratorType
async def do_await(obj):
return await obj
def do_yield_fro... | 0 | 0 | 0 | 0 | 0 | 0 |
fbchat_archive_parser/writers/writer.py | alvin-c/fbmessenger-visualizer | 356 | 1702461 | <gh_stars>100-1000
import sys
import pytz
from ..parser import ChatThread, ChatMessage, FacebookChatHistory
class UnserializableObject(Exception):
pass
DATE_DOC_FORMAT = "%Y-%m-%dT%H:%M"
class Writer(object):
def write(self, data, stream=sys.stdout):
if isinstance(data, FacebookChatHistory):
... | 0 | 0 | 0 | 0 | 0 | 0 |
gen_tacotron.py | dieserRobin/ForwardTacotron | 556 | 1702472 | import argparse
from pathlib import Path
from typing import Tuple, Dict, Any
import torch
from models.fatchord_version import WaveRNN
from models.tacotron import Tacotron
from utils.display import simple_table
from utils.dsp import DSP
from utils.files import read_config
from utils.paths import Paths
from utils.text.... | 2 | 2 | 0 | 0 | 4 | 0 |
pip_audit/_format/__init__.py | westonsteimel/pip-audit | 447 | 1702505 | <filename>pip_audit/_format/__init__.py
"""
Output format interfaces and implementations for `pip-audit`.
"""
from .columns import ColumnsFormat
from .cyclonedx import CycloneDxFormat
from .interface import VulnerabilityFormat
from .json import JsonFormat
__all__ = [
"ColumnsFormat",
"CycloneDxFormat",
"V... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/dev/parsePRs.py | gaocegege/openFrameworks | 6,436 | 1702529 | <reponame>gaocegege/openFrameworks<filename>scripts/dev/parsePRs.py<gh_stars>1000+
#! /usr/bin/env python
import urllib2
import json
import os
f = open ("/home/arturo/.ofprojectgenerator/config")
path = f.readline()
if path[-1]=='\n':
path=path[:-1]
os.chdir(path)
f.close()
prssocket = urllib2.urlopen('https://a... | 0 | 0 | 0 | 0 | 0 | 0 |
lldb/examples/summaries/cocoa/CFString.py | bytesnake/Enzyme | 427 | 1702537 | <filename>lldb/examples/summaries/cocoa/CFString.py
"""
LLDB AppKit formatters
part of The LLVM Compiler Infrastructure
This file is distributed under the University of Illinois Open Source
License. See LICENSE.TXT for details.
"""
# example synthetic children and summary provider for CFString (and related NSString cl... | 0 | 0 | 0 | 0 | 0 | 0 |
venv/Lib/site-packages/statsmodels/discrete/tests/results/results_count_margins.py | EkremBayar/bayar | 6,931 | 1702551 | import numpy as np
from statsmodels.tools.testing import MarginTableTestBunch
est = dict(
rank=7,
N=17,
ic=6,
k=7,
k_eq=1,
k_dv=1,
converged=1,
rc=0,
k_autoCns=0,
ll=-28.46285727296058,
k_eq_model=... | 0 | 0 | 0 | 0 | 0 | 0 |
articles/firefox-extensions-with-selenium/firefox_profile.py | sangaline/intoli-article-materials | 248 | 1702564 | from __future__ import annotations
import json
import os
import sys
from selenium.webdriver.firefox.firefox_profile import AddonFormatError
class FirefoxProfileWithWebExtensionSupport(webdriver.FirefoxProfile):
def _addon_details(self, addon_path) -> dict[str,bool | object] | object:
try:
ret... | 0 | 1 | 0 | 0 | 1 | 0 |
tests/test_stem.py | matchup-ir/whooshy | 270 | 1702579 | from whoosh.lang.snowball.english import EnglishStemmer
from whoosh.lang.snowball.french import FrenchStemmer
from whoosh.lang.snowball.finnish import FinnishStemmer
from whoosh.lang.snowball.spanish import SpanishStemmer
def test_english():
s = EnglishStemmer()
assert s.stem("hello") == "hello"
assert s.... | 0 | 0 | 0 | 0 | 0 | 0 |
ax/service/tests/test_best_point_utils.py | facebook/Ax | 1,803 | 1702601 | <filename>ax/service/tests/test_best_point_utils.py
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
from ax.core.arm import Arm
from ax.core.generat... | 0 | 0 | 0 | 0 | 0 | 0 |
v2/backend/site/__init__.py | jonfairbanks/rtsp-nvr | 558 | 1702645 | <filename>v2/backend/site/__init__.py
from backend.magic import Bundle
site_bundle = Bundle(__name__, admin_icon_class='glyphicon glyphicon-envelope')
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_processor.py | 9seconds/hrss | 124 | 1702671 | # -*- coding: utf-8 -*-
import concierge.core.lexer as lexer
import concierge.core.parser as parser
import concierge.core.processor as process
CONTENT = """\
Compression yes
Host q
Port 22
-Host e
Protocol 2
Host h
HostName hew
LocalForward 22 b:22
Loca... | 0 | 0 | 0 | 0 | 0 | 0 |
batchflow/models/metrics/__init__.py | bestetc/batchflow | 101 | 1702693 | """ Contains model evaluation metrics """
from .utils import binarize, sigmoid, get_components, infmean
from .base import Metrics
from .classify import ClassificationMetrics
from .segment import SegmentationMetricsByPixels, SegmentationMetricsByInstances
from .regression import RegressionMetrics
from .loss import Loss
| 0 | 0 | 0 | 0 | 0 | 0 |
PythonAPI/examples/gamma_crowd.py | AdaCompNUS/summ | 103 | 1702709 | #!/usr/bin/env python
from __future__ import annotations
import glob
import os
import sys
try:
sys.path.append(glob.glob(os.path.abspath('%s/../../carla/dist/carla-*%d.%d-%s.egg' % (
os.path.realpath(__file__),
sys.version_info.major,
sys.version_info.minor,
'win-amd64' if os.name ... | 8 | 49 | 0 | 27 | 84 | 0 |
tina/postp/tonemap.py | xuhao1/taichi_three | 152 | 1702719 | from ..advans import *
@ti.data_oriented
class ToneMapping:
def __init__(self, res):
self.res = res
@ti.kernel
def apply(self, image: ti.template()):
for I in ti.grouped(image):
image[I] = aces_tonemap(image[I])
| 1 | 0 | 0 | 0 | 1 | 0 |
generator/builders/property_builder.py | wreiner/Office365-REST-Python-Client | 544 | 1702722 | import ast
class PropertyBuilder(ast.NodeTransformer):
pass
| 0 | 0 | 0 | 0 | 0 | 0 |
python/paddle/fluid/tests/unittests/test_bitwise_op.py | zmxdream/Paddle | 17,085 | 1702753 | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 0 | 0 | 0 | 0 | 0 | 0 |
ml/lasagne_extensions/stochastic_recurrent_layer.py | marcofraccaro/srnn | 120 | 1702756 | <gh_stars>100-1000
import theano
import theano.tensor as T
from lasagne.utils import unroll_scan
from lasagne.layers import MergeLayer, helper, get_output
from lasagne.random import get_rng
from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
class StochsticRecurrentLayer(MergeLayer):
def __init_... | 0 | 0 | 0 | 0 | 0 | 0 |
simpleAICV/classification/backbones/vovnet.py | LANCEREN/simpleAICV-pytorch-ImageNet-COCO-training | 154 | 1702786 | '''
CenterMask : Real-Time Anchor-Free Instance Segmentation
https://github.com/youngwanLEE/vovnet-detectron2/blob/master/vovnet/vovnet.py
'''
import os
import sys
BASE_DIR = os.path.dirname(
os.path.dirname(os.path.dirname(os.path.dirname(
os.path.abspath(__file__)))))
sys.path.append(BASE_DIR)
from simp... | 26 | 15 | 0 | 2 | 43 | 0 |
ghostwriter/shepherd/migrations/0004_auto_20190910_0113.py | bbhunter/Ghostwriter | 601 | 1702839 | # Generated by Django 2.2.3 on 2019-09-10 01:13
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies: list[tuple[str, str]] = [
('shepherd', '0003_auto_20190824_0401'),
]
operations: list[object] = [
migrations.AlterModelOptions(
name=... | 0 | 0 | 2 | 0 | 2 | 0 |
Python/Algorithms/SortingAlgorithms/GnomeSort.py | m-payal/AlgorithmsAndDataStructure | 195 | 1702848 | <reponame>m-payal/AlgorithmsAndDataStructure
"""
Title - Gnome Sort Algorithm
Pupose - Sorts a given array in ascending order.
Time Complexity - O(n^2)
"""
import random
class GnomeSort:
""" GnomeSort Algorithm Implementation
arr: an unordered list
output: return list in ascending order
... | 0 | 0 | 0 | 0 | 0 | 0 |
content/lib/pencilcode.py | codio/pencilcode | 144 | 1702866 | <reponame>codio/pencilcode
import pencilcode_internal
# The SpriteObject class wraps a jQuery-turtle object so it can be used in Python.
# This includes Turtle, Sprite, Piano, and Pencil objects.
class SpriteObject():
def __init__(self, jsSpriteObject):
self.jsSpriteObject = jsSpriteObject
###########... | 0 | 0 | 0 | 0 | 0 | 0 |
source/comHelper.py | marlon-sousa/nvda | 1,592 | 1702873 | <reponame>marlon-sousa/nvda<filename>source/comHelper.py
#comHelper.py
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2013 NV Access Limited
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
"""Utilities to help with issues related to COM.
"""
import ... | 0 | 0 | 0 | 0 | 0 | 0 |
lib/hachoir/wx/dialogs.py | 0x20Man/Watcher3 | 320 | 1702895 | import wx
import os
def file_open_dialog() -> object:
dialog_style = wx.FD_OPEN | wx.FD_FILE_MUST_EXIST
dialog = wx.FileDialog(
None, message='Open',
defaultDir=os.getcwd(),
defaultFile='', style=dialog_style)
return dialog
def file_save_dialog(title) -> object:
dialog_styl... | 0 | 2 | 0 | 0 | 2 | 0 |
onnx_tf/handlers/backend/gemm.py | malisit/onnx-tensorflow | 1,110 | 1702910 | import tensorflow as tf
from onnx_tf.handlers.backend_handler import BackendHandler
from onnx_tf.handlers.handler import onnx_op
from onnx_tf.common import sys_config
from onnx_tf.common import exception
import onnx_tf.common.data_type as data_type
@onnx_op("Gemm")
class Gemm(BackendHandler):
cast_map: dict[object... | 0 | 7 | 2 | 0 | 9 | 0 |
ch03/03_12.py | leeseedong/book-cryptocurrency | 121 | 1702936 | <gh_stars>100-1000
import sys
from PyQt5.QtWidgets import *
app = QApplication(sys.argv)
label = QLabel("Hello")
label.show()
app.exec_()
| 0 | 0 | 0 | 0 | 0 | 0 |
HunterAdminApi/networkproxy/authentication/ldap_auth.py | tt9133github/hunter | 322 | 1702942 | #!/ usr/bin/env
# coding=utf-8
#
# Copyright 2019 ztosec & https://www.zto.com/
#
# 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 r... | 0 | 1 | 0 | 0 | 1 | 0 |
easyrobust/test_scripts/metrics/imagenet_adv_utils.py | thu-ml/realsafe | 107 | 1702952 | from __future__ import annotations
import json
import os
import torch
from PIL import Image
class ImageDataset_Adv(torch.utils.data.Dataset):
def __init__(self, data_dir, transform: object | None=None):
self.data_dir = data_dir
self.transform = transform
self._indices: list[object] = []
... | 1 | 2 | 0 | 1 | 4 | 0 |
heat/common/profiler.py | noironetworks/heat | 265 | 1702956 | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | 0 | 0 | 0 | 0 | 0 | 0 |
tgintegration/expectation.py | JosXa/TgIntegration | 109 | 1702965 | """
"""
import logging
from dataclasses import dataclass
from typing import List
from typing import Union
from pyrogram.types import Message
from tgintegration.containers.responses import InvalidResponseError
from tgintegration.timeout_settings import TimeoutSettings
from tgintegration.utils.sentinel import NotSet
... | 6 | 4 | 2 | 0 | 12 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.