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 |
|---|---|---|---|---|---|---|---|---|---|---|
test/test_svs.py | yasics/vpp | 751 | 1678434 | #!/usr/bin/env python3
import unittest
from framework import VppTestCase, VppTestRunner
from vpp_ip_route import VppIpTable
from scapy.packet import Raw
from scapy.layers.l2 import Ether
from scapy.layers.inet import IP, UDP, ICMP
from scapy.layers.inet6 import IPv6
from vpp_papi import VppEnum
NUM_PKTS = 67
cla... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_plan/test_truncate_plan.py | Jyrno42/django-test-migrations | 294 | 1678444 | import pytest
from django_test_migrations.exceptions import MigrationNotInPlan
from django_test_migrations.plan import truncate_plan
@pytest.mark.parametrize(('targets', 'index'), [
([], 9), # full plan for empty targets
([('app1', None)], 0),
([('app1', None), ('app3', None)], 7),
([('app2', '0002_... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_classification_models/test_backbones/test_resnet12.py | BIGWangYuDong/mmfewshot | 376 | 1678447 | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
from mmfewshot.classification.models.backbones.resnet12 import (BasicBlock,
ResNet12)
def test_basicblock():
downsample = nn.Sequential(
nn.Conv2d(3, 64, kern... | 0 | 0 | 0 | 0 | 0 | 0 |
packages/engine/stdlib/src/py/hstd/neighbor.py | mschrader15/hash | 219 | 1678470 | <gh_stars>100-1000
"""
Neighbor utility functions.
"""
from typing import List
from .spatial import distance_between
from .agent import AgentFieldError, AgentState
def neighbors_on_position(agent: AgentState, neighbors: List[AgentState]) -> List[AgentState]:
"""
Returns all `neighbors` whose position is iden... | 0 | 0 | 0 | 0 | 0 | 0 |
tracardi/process_engine/action/v1/log_action.py | Tracardi/tracardi | 153 | 1678491 | from pydantic import BaseModel
from tracardi.service.plugin.domain.register import Plugin, Spec, MetaData, Documentation, PortDoc, Form, FormGroup, \
FormField, FormComponent
from tracardi.service.plugin.runner import ActionRunner
from tracardi.service.plugin.domain.result import Result
from tracardi.service.notat... | 1 | 3 | 2 | 0 | 6 | 0 |
wagtail/search/utils.py | melisayu/wagtail | 8,851 | 1678509 | <reponame>melisayu/wagtail<filename>wagtail/search/utils.py
import operator
import re
from functools import partial
from django.apps import apps
from django.db import connections
from wagtail.search.index import RelatedFields, SearchField
from .query import MATCH_NONE, Phrase, PlainText
NOT_SET = object()
def b... | 0 | 0 | 0 | 0 | 0 | 0 |
mbuild/formats/par_writer.py | daico007/mbuild | 101 | 1678528 | """CHARMM Par format."""
import warnings
__all__ = ["write_par"]
def write_par(structure, filename):
"""Write CHARMM Par file given a parametrized structure.
Notes
-----
Follows format according to
https://www.ks.uiuc.edu/Training/Tutorials/namd/namd-tutorial-unix-html/
node25.html
Furth... | 0 | 0 | 0 | 0 | 0 | 0 |
package/management/commands/calculate_score.py | dmoney/djangopackages | 383 | 1678551 | <reponame>dmoney/djangopackages
import logging
from django.core.management.base import BaseCommand
from package.models import Package
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = "Updates the score for all packages"
def handle(self, *args, **options):
count = 0
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/unit_tests/1004_lib_plugin_manifest_test.py | astralblue/iocage | 827 | 1678564 | import pytest
from iocage_lib.ioc_common import validate_plugin_manifest
VALID_MANIFEST = {
"name": "test_plugin",
"release": "12.2-RELEASE",
"pkgs": [],
"packagesite": "http://pkg.FreeBSD.org/${ABI}/latest",
"fingerprints": {
"iocage-plugins": [
{
"function": "... | 0 | 0 | 0 | 0 | 0 | 0 |
var/spack/repos/builtin/packages/r-lattice/package.py | LiamBindle/spack | 2,360 | 1678572 | <filename>var/spack/repos/builtin/packages/r-lattice/package.py
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RLattice(RPackage):
"""Tre... | 0 | 0 | 0 | 0 | 0 | 0 |
sdk/python/pulumi_aws/resourcegroupstaggingapi/get_resources.py | chivandikwa/pulumi-aws | 260 | 1678593 | <filename>sdk/python/pulumi_aws/resourcegroupstaggingapi/get_resources.py<gh_stars>100-1000
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi... | 0 | 0 | 0 | 0 | 0 | 0 |
orbit/estimators/base_estimator.py | uber/orb | 1,332 | 1678598 | <filename>orbit/estimators/base_estimator.py
from abc import abstractmethod
import numpy as np
# from ..utils.docstring_style import merge_numpy_docs_dedup
# import custom_inherit as ci
# ci.store["numpy_with_merge_dedup"] = merge_numpy_docs_dedup
# ci.add_style("numpy_with_merge_dedup", merge_numpy_docs_dedup)
class... | 0 | 0 | 0 | 0 | 0 | 0 |
exercises/salmon_pymc.py | gjcooper/intro_stat_modeling_2017 | 163 | 1678635 | lsd_and_math.loc[7] = [6, 70]
x, y = lsd_and_math.T.values
b0, b1 = fmin(sum_of_squares, [0,1], args=(x,y))
b0_abs, b1_abs = fmin(sum_of_absval, [0,0], args=(x,y))
print('\nintercept: {0:.2}, slope: {1:.2}'.format(b0,b1))
ax = lsd_and_math.plot(x='Drugs', y='Score', style='ro', legend=False, xlim=(0,8))
ax.plot([0,10... | 0 | 0 | 0 | 0 | 0 | 0 |
demo/benchmark.py | nigma/pywt | 101 | 1678637 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import gc
import sys
import time
import numpy
import pylab
import pywt
if sys.platform == 'win32':
clock = time.clock
else:
clock = time.time
sizes = [20, 50, 100, 120, 150, 200, 250, 300, 400, 500, 600, 750,
1000, 2000, 3000, 4000, 5000, 6000, 7500,
... | 0 | 0 | 0 | 0 | 0 | 0 |
workalendar/europe/monaco.py | taiyeoguns/workalendar | 405 | 1678659 | <filename>workalendar/europe/monaco.py
from ..core import WesternCalendar
from ..registry_tools import iso_register
@iso_register('MC')
class Monaco(WesternCalendar):
'Monaco'
# Christian holidays
include_easter_monday = True
include_ascension = True
include_whit_monday = True
include_all_sai... | 0 | 0 | 0 | 0 | 0 | 0 |
dymos/utils/indexing.py | yonghoonlee/dymos | 104 | 1678674 | import numpy as np
def get_src_indices_by_row(row_idxs, shape, flat: bool=True) -> object:
"""
Provide the src_indices when connecting a vectorized variable from an output to an input.
Indices are selected by choosing the first indices to be passed, corresponding to node
index in Dymos.
Paramete... | 1 | 1 | 0 | 0 | 2 | 0 |
demo/videotext/yoro/det/config/east_r50_rbox.py | icedream2/DAVAR-Lab-OCR | 387 | 1678696 | """
#########################################################################
# Copyright (c) <NAME> @ Hikvision Research Institute. All rights reserved.
# Filename : east_r50_rbox.py
# Abstract : Model settings for EAST detector on ICDAR2015(RBOX mode)
# Current Version: 1.0.0
# Date : ... | 0 | 0 | 0 | 0 | 0 | 0 |
bmtk/utils/sonata/config/sonata_config.py | aaberbach/bmtk | 216 | 1678710 | <reponame>aaberbach/bmtk
# Copyright 2017. <NAME>. All rights reserved
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
# following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of condition... | 0 | 0 | 0 | 0 | 0 | 0 |
tick/base/learner/__init__.py | sumau/tick | 411 | 1678738 | <filename>tick/base/learner/__init__.py
from .learner_glm import LearnerGLM
from .learner_optim import LearnerOptim
| 0 | 0 | 0 | 0 | 0 | 0 |
utils/operator.py | manmanCover/OCNet.pytorch | 424 | 1678758 | import torch
import torch.nn as nn
import torch.nn.functional as F
affine_par = True
class Separable_transpose_convolution(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size: int=3, stride: int=2,
padding: int=1, output_padding: int=0, bias: bool=False, dilation: int=1):
... | 11 | 2 | 0 | 0 | 13 | 0 |
examples/materialized_paths/materialized_paths.py | Dreamsorcerer/sqlalchemy | 5,383 | 1678853 | <filename>examples/materialized_paths/materialized_paths.py
"""Illustrates the "materialized paths" pattern.
Materialized paths is a way to represent a tree structure in SQL with fast
descendant and ancestor queries at the expense of moving nodes (which require
O(n) UPDATEs in the worst case, where n is the number of ... | 0 | 0 | 0 | 0 | 0 | 0 |
problog/__init__.py | HEmile/problog | 189 | 1678902 | <filename>problog/__init__.py<gh_stars>100-1000
"""
Part of the ProbLog distribution.
Copyright 2015 <NAME>, DTAI Research Group
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.apac... | 0 | 0 | 0 | 0 | 0 | 0 |
daphne/__init__.py | francoiscampbell/daphne | 1,638 | 1678904 | <gh_stars>1000+
import sys
__version__ = "3.0.2"
# Windows on Python 3.8+ uses ProactorEventLoop, which is not compatible with
# Twisted. Does not implement add_writer/add_reader.
# See https://bugs.python.org/issue37373
# and https://twistedmatrix.com/trac/ticket/9766
PY38_WIN = sys.version_info >= (3, 8) and sys.p... | 0 | 0 | 0 | 0 | 0 | 0 |
packages/pytea/pylib/torch/nn/modules/linear.py | Sehun0819/pytea | 241 | 1678908 | import LibCall
from .module import Module
from .. import functional as F
class Linear(Module):
def __init__(self, in_features, out_features, bias: bool=True):
super(Linear, self).__init__()
self.in_features = in_features
self.out_features = out_features
self.weight = LibCall.torch.c... | 1 | 1 | 0 | 1 | 3 | 0 |
alipay/aop/api/response/MybankCreditLoantradeLoanarrangementQueryResponse.py | snowxmas/alipay-sdk-python-all | 213 | 1678914 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.InstRepayPlan import InstRepayPlan
from alipay.aop.api.domain.InstallmentMetaInfo import InstallmentMetaInfo
from alipay.aop.api.domain.InstallmentMetaInfo import Insta... | 0 | 14 | 0 | 14 | 28 | 0 |
speakeasy/winenv/api/usermode/ncrypt.py | dtrizna/speakeasy | 816 | 1678921 | <filename>speakeasy/winenv/api/usermode/ncrypt.py<gh_stars>100-1000
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
import base64
import speakeasy.winenv.defs.windows.windows as windefs
from .. import api
class Ncrypt(api.ApiHandler):
"""
Implements exported functions from ncrypt.dll
"""
na... | 0 | 0 | 0 | 0 | 0 | 0 |
gan/op.py | pumperknickle/DoppelGANger | 157 | 1678941 | import tensorflow as tf
import numpy as np
def linear(input_, output_size, scope_name: str="linear") -> object:
with tf.variable_scope(scope_name):
input_ = tf.reshape(
input_,
[-1, np.prod(input_.get_shape().as_list()[1:])])
output = tf.layers.dense(
input_,
... | 21 | 7 | 0 | 0 | 28 | 0 |
tutorials/01.game_sales_predict/05.save_trained_model.py | msgi/nlp-tour | 1,559 | 1678945 | import pandas as pd
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import *
training_data_df = pd.read_csv("dataset/sales_data_training_scaled.csv")
X = training_data_df.drop('销售总额', axis=1).values
Y = training_data_df[['销售总额']].values
# 定义模型:全连接网络
model = Sequential()
model.add(Dense(50... | 0 | 0 | 0 | 0 | 0 | 0 |
loadDataFilesUI.py | webclinic017/backtrader-pyqt-ui | 105 | 1679003 | <reponame>webclinic017/backtrader-pyqt-ui
from PyQt5 import QtCore, QtWidgets, uic
import os
class LoadDataFilesUI(QtWidgets.QWidget):
def __init__(self, controller, parent = None):
super(LoadDataFilesUI, self).__init__()
self.controller = controller
self.parent = parent
#self... | 0 | 0 | 0 | 0 | 0 | 0 |
src/pandas_profiling/report/presentation/core/__init__.py | abhicantdraw/pandas-profiling | 8,107 | 1679039 | <gh_stars>1000+
from pandas_profiling.report.presentation.core.alerts import Alerts
from pandas_profiling.report.presentation.core.collapse import Collapse
from pandas_profiling.report.presentation.core.container import Container
from pandas_profiling.report.presentation.core.duplicate import Duplicate
from pandas_prof... | 0 | 0 | 0 | 0 | 0 | 0 |
gfootball/env/controller_base.py | seccoboy/football | 3,091 | 1679046 | # coding=utf-8
# Copyright 2019 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | 0 | 3 | 0 | 1 | 4 | 0 |
api-inference-community/docker_images/allennlp/app/pipelines/question_answering.py | mishig25/huggingface_hub | 362 | 1679053 | from typing import Any, Dict
# Even though it is not imported, it is actually required, it downlaods some stuff.
import allennlp_models # noqa: F401
from allennlp.predictors.predictor import Predictor
from app.pipelines import Pipeline
class QuestionAnsweringPipeline(Pipeline):
def __init__(
self,
... | 2 | 1 | 0 | 0 | 3 | 0 |
tf3d/object_detection/model_utils.py | deepneuralmachine/google-research | 23,901 | 1679071 | <filename>tf3d/object_detection/model_utils.py
# 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/licen... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/cloudformation/graph/graph_builder/test_render.py | niradler/checkov | 4,013 | 1679082 | import os
from unittest.case import TestCase
from checkov.cloudformation.graph_builder.graph_components.block_types import BlockType
from checkov.cloudformation.graph_manager import CloudformationGraphManager
from checkov.common.graph.db_connectors.networkx.networkx_db_connector import NetworkxConnector
TEST_DIRNAME ... | 16 | 1 | 0 | 0 | 17 | 0 |
manimlib/scene/three_d_scene.py | OrKedar/geo-manimgl-app | 45,280 | 1679092 | from __future__ import annotations
from manimlib.scene.scene import Scene
class ThreeDScene(Scene):
CONFIG: dict[str,dict[str,int]] = {
"camera_config": {
"samples": 4,
"anti_alias_width": 0,
}
}
def begin_ambient_camera_rotation(self, rate: float=0.02):
pa... | 6 | 0 | 1 | 0 | 7 | 0 |
tests/Unit/PointwiseFunctions/AnalyticSolutions/Elasticity/BentBeam.py | nilsvu/spectre | 117 | 1679126 | # Distributed under the MIT License.
# See LICENSE.txt for details.
import numpy as np
from Elasticity.ConstitutiveRelations.IsotropicHomogeneous import (
youngs_modulus, poisson_ratio)
def displacement(x, length, height, bending_moment, bulk_modulus,
shear_modulus) -> object:
local_youngs_m... | 0 | 5 | 0 | 0 | 5 | 0 |
bcs-ui/backend/bcs_web/audit_log/client.py | laodiu/bk-bcs | 599 | 1679128 | <reponame>laodiu/bk-bcs<gh_stars>100-1000
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License... | 0 | 0 | 0 | 0 | 0 | 0 |
glasses/types.py | rentainhe/glasses | 271 | 1679142 | from typing import Dict
from torch import Tensor
StateDict = Dict[str, Tensor]
| 0 | 0 | 0 | 0 | 0 | 0 |
RecoJets/JetProducers/python/caloJetsForTrk_cff.py | Purva-Chaudhari/cmssw | 852 | 1679152 | <reponame>Purva-Chaudhari/cmssw
import FWCore.ParameterSet.Config as cms
from RecoJets.JetProducers.ak4CaloJets_cfi import ak4CaloJets as _ak4CaloJets
from RecoHI.HiJetAlgos.HiRecoJets_cff import akPu4CaloJets as _akPu4CaloJets
from RecoLocalCalo.CaloTowersCreator.calotowermaker_cfi import calotowermaker
caloTowerForT... | 0 | 0 | 0 | 0 | 0 | 0 |
Python/Examples/bglib_test_htm_collector.py | inksoldier/Arduio-Code | 145 | 1679160 | <reponame>inksoldier/Arduio-Code
#!/usr/bin/env python
""" Bluegiga BGAPI/BGLib demo: health thermometer collector
Changelog:
2014-10-15 - Add logfile output mode
2014-07-05 - Fix indication subscription to use 2-byte value
2013-06-07 - Fix "address_type" to support Random (e.g. iPhone as peripheral)
... | 0 | 0 | 0 | 0 | 0 | 0 |
networks.py | JohnGiorgi/PyTorch-Image-Retrieval | 262 | 1679167 | from __future__ import annotations
"""
SE-ResNet, SE_ResNeXt codes are gently borrowed from
https://github.com/Cadene/pretrained-models.pytorch/blob/master/pretrainedmodels/models/senet.py
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision import models
from senet import se_resnext... | 6 | 5 | 0 | 0 | 11 | 0 |
insights/parsers/tests/test_tmpfilesd.py | mglantz/insights-core | 121 | 1679171 | from insights.parsers.tmpfilesd import TmpFilesD
from insights.tests import context_wrap
SAP_CONF = """
# systemd tmpfiles exclude file for SAP
# SAP software stores some important files
# in /tmp which should not be deleted
# Exclude SAP socket and lock files
x /tmp/.sap*
# Exclude HANA lock file
x /tmp/.hdb*lock
"... | 0 | 0 | 0 | 0 | 0 | 0 |
src/azure-cli/azure/cli/command_modules/monitor/tests/latest/test_monitor_action_groups.py | staer/azure-cli | 3,287 | 1679177 | <filename>src/azure-cli/azure/cli/command_modules/monitor/tests/latest/test_monitor_action_groups.py
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project... | 0 | 0 | 0 | 0 | 0 | 0 |
supar/modules/lstm.py | rootofmylife/parser | 439 | 1679184 | # -*- coding: utf-8 -*-
from __future__ import annotations
import torch
import torch.nn as nn
from supar.modules.dropout import SharedDropout
from torch.nn.modules.rnn import apply_permutation
from torch.nn.utils.rnn import PackedSequence, pack_padded_sequence
class CharLSTM(nn.Module):
r"""
CharLSTM aims to... | 8 | 6 | 0 | 0 | 14 | 0 |
gpMgmt/bin/gpload_test/gpload2/TEST_local_options.py | bradfordb-vmware/gpdb | 5,535 | 1679190 | <reponame>bradfordb-vmware/gpdb<filename>gpMgmt/bin/gpload_test/gpload2/TEST_local_options.py
from TEST_local_base import *
@prepare_before_test(num=301, times=1)
def test_301_gpload_yaml_with_header():
"301 gpload yaml config with header true"
copy_data('external_file_301.txt','data_file.txt')
write_confi... | 0 | 0 | 0 | 0 | 0 | 0 |
python/tests/dictionary/dictionary_merger_test.py | vvucetic/keyvi | 199 | 1679194 | # -*- coding: utf-8 -*-
# Usage: py.test tests
import sys
import os
import json
import tempfile
import shutil
import collections
import pytest
from os import path
from keyvi.compiler import JsonDictionaryCompiler, JsonDictionaryMerger
from keyvi.dictionary import Dictionary
from keyvi import loading_strategy_types
... | 0 | 0 | 0 | 0 | 0 | 0 |
piccolo/testing/model_builder.py | 0scarB/piccolo | 750 | 1679212 | import json
import typing as t
from datetime import date, datetime, time, timedelta
from decimal import Decimal
from uuid import UUID
from piccolo.columns.base import Column
from piccolo.table import Table
from piccolo.testing.random_builder import RandomBuilder
from piccolo.utils.sync import run_sync
class ModelBui... | 13 | 4 | 1 | 0 | 18 | 0 |
adversarialbox/defences/thermometer_encoding.py | StijnMatsHendriks/adversarial_attack_demo | 819 | 1679226 | from __future__ import annotations
"""
This module provide the defence method for THERMOMETER ENCODING's implement.
THERMOMETER ENCODING: ONE HOT WAY TO RESIST ADVERSARIAL EXAMPLES
"""
from builtins import range
import logging
logger=logging.getLogger(__name__)
import numpy as np
from keras.utils import to_categori... | 3 | 2 | 0 | 0 | 5 | 0 |
tests/unitdata.py | StephanEggermont/python-pptx | 1,429 | 1679246 | # encoding: utf-8
"""
Shared objects for unit data builder modules
"""
from __future__ import absolute_import, print_function, unicode_literals
from pptx.oxml import parse_xml
from pptx.oxml.ns import nsdecls
class BaseBuilder(object):
"""
Provides common behavior for all data builders.
"""
def __... | 1 | 12 | 0 | 6 | 19 | 0 |
homeassistant/components/abode/sensor.py | andersop91/core | 22,481 | 1679253 | """Support for Abode Security System sensors."""
from __future__ import annotations
import abodepy.helpers.constants as CONST
from homeassistant.components.sensor import (
SensorDeviceClass,
SensorEntity,
SensorEntityDescription,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.co... | 4 | 2 | 1 | 2 | 9 | 0 |
distblast/scripts/homolog_seq_retrieval.py | bgruening/bcbb | 339 | 1679256 | <gh_stars>100-1000
#!/usr/bin/env python
"""Retrieve sequences for a group of homologs based on a gene list.
Usage:
homolog_seq_retrieval.py <base config> <org config> <id result file>
"""
import sys
import csv
import os
import re
import yaml
from Bio import SeqIO
def main(base_file, org_file, result_file):
... | 0 | 0 | 0 | 0 | 0 | 0 |
sarpy/utils/convert_to_sicd.py | bombaci-vsc/sarpy | 119 | 1679269 | <reponame>bombaci-vsc/sarpy
"""
Convert from complex SAR image format to SICD format.
For a basic help on the command-line, check
>>> python -m sarpy.utils.convert_to_sicd --help
"""
import argparse
from sarpy.io.complex.converter import conversion_utility
__classification__ = "UNCLASSIFIED"
__author__ = "<NAME>"
... | 0 | 0 | 0 | 0 | 0 | 0 |
park/unittest/test_circuit.py | utkarsh5k/park | 180 | 1679281 | <reponame>utkarsh5k/park
import unittest
from park.unittest.run_env import run_env_with_random_agent
class TestCircuit(unittest.TestCase):
def test_evaluator(self):
run_env_with_random_agent('circuit_three_stage_transimpedance', seed=None)
| 0 | 0 | 0 | 0 | 0 | 0 |
mayan/apps/documents/serializers/favorite_document_serializers.py | atitaya1412/Mayan-EDMS | 336 | 1679287 | from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
from mayan.apps.rest_api.serializer_mixins import CreateOnlyFieldSerializerMixin
from mayan.apps.user_management.serializers import UserSerializer
from ..models.favorite_document_models import FavoriteDocument
from .docum... | 0 | 0 | 3 | 0 | 3 | 0 |
blendergltf/exporters/material.py | iamthad/blendergltf | 343 | 1679291 | <reponame>iamthad/blendergltf<filename>blendergltf/exporters/material.py<gh_stars>100-1000
from distutils.version import StrictVersion as Version
from .base import BaseExporter
from .common import (
Reference,
)
class MaterialExporter(BaseExporter):
gltf_key = 'materials'
blender_key = 'materials'
@... | 0 | 0 | 0 | 0 | 0 | 0 |
dev/Tools/build/waf-1.7.13/waflib/extras/netcache_client.py | jeikabu/lumberyard | 1,738 | 1679296 | #! /usr/bin/env python
# encoding: utf-8
# <NAME>, 2011 (ita)
from __future__ import annotations
"""
A client for the network cache (playground/netcache/). Launch the server with:
./netcache_server, then use it for the builds by adding the following:
def options(opt):
opt.load('netcache_client')
The parameters sh... | 2 | 7 | 0 | 0 | 9 | 0 |
actions/get_repair_status.py | cognifloyd/stackstorm-opscenter | 164 | 1679348 | <filename>actions/get_repair_status.py
import requests
from lib.base import OpscenterAction
class GetClusterRepairStatusAction(OpscenterAction):
def run(self, cluster_id=None):
if not cluster_id:
cluster_id = self.cluster_id
url = self._get_full_url([cluster_id, 'services', 'repair']... | 0 | 0 | 0 | 0 | 0 | 0 |
gcsa/serializers/event_serializer.py | JulesGrd/google-calendar-simple-api | 139 | 1679361 | <filename>gcsa/serializers/event_serializer.py
import dateutil.parser
from datetime import date, datetime
from tzlocal import get_localzone
from gcsa.event import Event
from .attachment_serializer import AttachmentSerializer
from .attendee_serializer import AttendeeSerializer
from .base_serializer import BaseSeriali... | 0 | 0 | 0 | 0 | 0 | 0 |
Packs/SymantecDLP/Integrations/SymantecDLP/SymantecDLP.py | diCagri/content | 799 | 1679374 | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
''' IMPORTS '''
from requests import Session
from zeep import Client, Settings
from zeep.transports import Transport
from requests.auth import AuthBase, HTTPBasicAuth
from zeep import helpers
from zeep.cache import Sqlit... | 39 | 23 | 100 | 0 | 162 | 0 |
src/gen.py | jvstokes/python-language-server | 695 | 1679385 | #!/usr/bin/env python
from __future__ import annotations
import argparse
import contextlib
from collections import defaultdict
import string
import sys
import os
def main() -> None:
script_path = os.path.realpath(__file__)
script_dir = os.path.dirname(script_path)
default_input = os.path.join(
sc... | 0 | 4 | 1 | 0 | 5 | 0 |
catprinter/img.py | disrupted/catprinter | 534 | 1679407 | from __future__ import annotations
import cv2
from math import ceil
import numpy as np
def floyd_steinberg_dither(img) -> object | None:
'''Applies the Floyd-Steinberf dithering to img, in place.
img is expected to be a 8-bit grayscale image.
Algorithm borrowed from wikipedia.org/wiki/Floyd%E2%80%93Stein... | 0 | 5 | 0 | 0 | 5 | 0 |
rootpy/plotting/box.py | masonproffitt/rootpy | 146 | 1679411 | <reponame>masonproffitt/rootpy<filename>rootpy/plotting/box.py
from __future__ import absolute_import
from .. import ROOT, QROOT, asrootpy
from ..base import Object
from .utils import canvases_with
__all__ = [
'Pave',
'PaveStats',
]
ANCHORS = (
'upper left', 'upper right',
'lower left', 'lower right'... | 0 | 0 | 0 | 0 | 0 | 0 |
v1/list/migrations/0004_auto_20170203_1045.py | akkord64/openeats-api | 113 | 1679434 | <filename>v1/list/migrations/0004_auto_20170203_1045.py<gh_stars>100-1000
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-02-03 10:45
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('list', '0003_auto_20... | 0 | 0 | 0 | 0 | 0 | 0 |
PyObjCTest/test_cfbyteorder.py | Khan/pyobjc-framework-Cocoa | 132 | 1679447 | from PyObjCTools.TestSupport import *
import sys
from CoreFoundation import *
class TestByteOrder (TestCase):
def testConstants(self):
self.assertEqual(CFByteOrderUnknown , 0)
self.assertEqual(CFByteOrderLittleEndian , 1)
self.assertEqual(CFByteOrderBigEndian , 2)
def testCurrent(sel... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/h/models/feature_test.py | tgiardina/rpp-h | 2,103 | 1679463 | from unittest import mock
import pytest
from h.models import Feature
@pytest.mark.usefixtures("features_override", "features_pending_removal_override")
class TestFeature:
def test_description_returns_hardcoded_description(self):
feat = Feature(name="notification")
assert feat.description == "A ... | 0 | 0 | 0 | 0 | 0 | 0 |
server/tests.py | fortiko/Crypt-Server | 101 | 1679487 | from django.test import TestCase, Client
from django.contrib.auth.models import User
from datetime import datetime
from server.models import Computer, Secret, Request
class RequestProcess(TestCase):
def test_request_passes_correct_data_to_template(self):
admin = User.objects.create_superuser("admin", "<EM... | 0 | 0 | 0 | 0 | 0 | 0 |
tracardi/process_engine/tql/condition.py | bytepl/tracardi | 153 | 1679503 | import asyncio
from tracardi.service.singleton import Singleton
from tracardi.service.notation.dot_accessor import DotAccessor
from tracardi.process_engine.tql.parser import Parser
from tracardi.process_engine.tql.transformer.expr_transformer import ExprTransformer
class Condition(metaclass=Singleton):
def __i... | 1 | 2 | 0 | 0 | 3 | 0 |
core/src/struct_classes/setting_struct.py | azurlane-doujin/AzurLanePaintingExtract-v1.0 | 144 | 1679534 | <filename>core/src/struct_classes/setting_struct.py
import collections
import functools
from core.src.struct_classes.basic_class import BasicInfo, BasicInfoList
class PerSetting(BasicInfo):
def __init__(self, name, val):
super(PerSetting, self).__init__(name, val)
self.val = self._val
... | 0 | 0 | 0 | 0 | 0 | 0 |
pdfannots/cli.py | 0xabu/pdfannots | 265 | 1679536 | import argparse
import logging
import sys
import typing
from pdfminer.layout import LAParams
from . import __doc__, __version__, process_file
from .printer import Printer
from .printer.markdown import MarkdownPrinter, GroupedMarkdownPrinter
from .printer.json import JsonPrinter
MD_FORMAT_ARGS = ['print_filename', '... | 2 | 4 | 1 | 0 | 7 | 0 |
intro/numpy/solutions/2_a_call_fortran.py | zmoon/scipy-lecture-notes | 2,538 | 1679557 | <reponame>zmoon/scipy-lecture-notes<gh_stars>1000+
import numpy as np
import fortran_module
def some_function(input):
"""
Call a Fortran routine, and preserve input shape
"""
input = np.asarray(input)
# fortran_module.some_function() only accepts 1-D arrays!
output = fortran_module.some_functio... | 0 | 0 | 0 | 0 | 0 | 0 |
cookbook/gravmag_eqlayer_pel_upcontinue.py | XuesongDing/fatiando | 179 | 1679615 | """
GravMag: Use the polynomial equivalent layer to upward continue gravity data
"""
from fatiando.gravmag import prism, sphere
from fatiando.gravmag.eqlayer import PELGravity, PELSmoothness
from fatiando import gridder, utils, mesher
from fatiando.vis import mpl
# Make synthetic data
props = {'density': 1000}
model =... | 0 | 0 | 0 | 0 | 0 | 0 |
slack/web/classes/interactions.py | timgates42/python-slack-sdk | 2,486 | 1679635 | import json
from typing import List, NamedTuple
from . import BaseObject
class IDNamePair(NamedTuple):
"""Simple type used to help with unpacking event data"""
id: str
name: str
class InteractiveEvent(BaseObject):
response_url: str
user: IDNamePair
team: IDNamePair
channel: IDNamePair
... | 6 | 2 | 19 | 3 | 30 | 0 |
tests/unit/html/test_player_identification_row.py | tttgm/basketball_reference_web_scraper | 325 | 1679636 | <gh_stars>100-1000
from unittest import TestCase
from unittest.mock import MagicMock, patch, PropertyMock
from basketball_reference_web_scraper.html import PlayerIdentificationRow
class TestPlayerIdentificationRow(TestCase):
def setUp(self):
self.html = MagicMock()
def test_player_cell_when_cells_ex... | 0 | 0 | 0 | 0 | 0 | 0 |
autoencoder/datasets/reuters.py | hugochan/K-Competitive-Autoencoder-for-Text-Analytics | 133 | 1679652 | '''
Created on Dec, 2016
@author: hugo
'''
from __future__ import absolute_import
import os
import re
from random import shuffle
import numpy as np
from collections import Counter, defaultdict
from ..preprocessing.preprocessing import build_vocab, generate_bow, count_words
from ..utils.io_utils import dump_json
cl... | 0 | 0 | 0 | 0 | 0 | 0 |
part2-steps-challenge/load-testing/plot-hey-data.py | viartemev/vertx-in-action | 201 | 1679666 | #!/usr/bin/env python
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import argparse
parser = argparse.ArgumentParser(description="Plot some data from Hey csv output")
parser.add_argument("input", help="Data file in CSV format")
parser.add_argument("output", help="Output file name")
parser.add... | 0 | 0 | 0 | 0 | 0 | 0 |
scenic/projects/layout_denoise/layers/common.py | techthiyanes/scenic | 688 | 1679682 | from __future__ import annotations
"""Common utils."""
import functools
import flax.linen as nn
import jax
from jax.nn import initializers
import jax.numpy as jnp
import numpy as np
pytorch_kernel_init = functools.partial(initializers.variance_scaling,
1. / 3., 'fan_in', 'unifor... | 3 | 4 | 0 | 0 | 7 | 0 |
hug/interface.py | ulmentflam/hug | 6,045 | 1679706 | <gh_stars>1000+
"""hug/interface.py
Defines the various interface hug provides to expose routes to functions
Copyright (C) 2016 <NAME>
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 re... | 0 | 0 | 0 | 0 | 0 | 0 |
tfx/utils/proto_utils_test.py | avelez93/tfx | 1,813 | 1679708 | <filename>tfx/utils/proto_utils_test.py
# Copyright 2020 Google LLC. 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
#
... | 0 | 0 | 0 | 0 | 0 | 0 |
alipay/aop/api/domain/AlipayBossCsChannelQueryModel.py | snowxmas/alipay-sdk-python-all | 213 | 1679723 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import annotations
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayBossCsChannelQueryModel(object):
def __init__(self):
self._att: None = None
self._connectionrate: None = None
self._curragentslogg... | 0 | 14 | 0 | 12 | 26 | 0 |
package/awesome_panel/designer/services/__init__.py | Jhsmit/awesome-panel | 179 | 1679749 | <reponame>Jhsmit/awesome-panel
"""Exports"""
from awesome_panel.designer.services.reload_service import ReloadService
| 0 | 0 | 0 | 0 | 0 | 0 |
scale/job/messages/process_job_input.py | kaydoh/scale | 121 | 1679751 | <reponame>kaydoh/scale
"""Defines a command message that processes the input for a job"""
from __future__ import unicode_literals
import logging
from django.db import transaction
from django.utils.timezone import now
from data.data.exceptions import InvalidData
from job.messages.cancel_jobs import create_cancel_jobs... | 0 | 0 | 0 | 0 | 0 | 0 |
sktime/classification/feature_based/tests/test_catch22_classifier.py | BINAYKUMAR943/sktime | 5,349 | 1679766 | <filename>sktime/classification/feature_based/tests/test_catch22_classifier.py
# -*- coding: utf-8 -*-
"""Catch22Classifier test code."""
import numpy as np
from numpy import testing
from sklearn.ensemble import RandomForestClassifier
from sktime.classification.feature_based import Catch22Classifier
from sktime.datase... | 0 | 0 | 0 | 0 | 0 | 0 |
twarc/config.py | Emiliano978/twarc | 1,011 | 1679790 | import logging
import configobj
# Adapted from click_config_file.configobj_provider so that we can store the
# file path that the config was loaded from in order to log it later.
log = logging
class ConfigProvider:
def __init__(self):
self.file_path: None = None
def __call__(self, file_path, cmd_na... | 0 | 1 | 0 | 1 | 2 | 0 |
vumi/tests/utils.py | seidu626/vumi | 199 | 1679807 | # -*- test-case-name: vumi.tests.test_testutils -*-
from __future__ import annotations
import re
from datetime import datetime, timedelta
import warnings
from functools import wraps
import pytz
from twisted.internet import reactor
from twisted.web.resource import Resource
from twisted.internet.defer import DeferredQu... | 8 | 15 | 2 | 4 | 29 | 0 |
etc/benchmarks/avro-serialization-implementations/scripts/encode/python-avro.py | kaluza-tech/avsc | 1,103 | 1679823 | <reponame>kaluza-tech/avsc
#!/usr/bin/env python2.7
# encoding: utf-8
"""Python avro official implementation encoding benchmark."""
from io import BytesIO
from itertools import repeat
from time import time
from avro.datafile import DataFileReader, DataFileWriter
from avro.io import DatumReader, DatumWriter, BinaryEnc... | 0 | 0 | 0 | 0 | 0 | 0 |
mgn/test_market1501.py | bochuanwu/reid-mgn | 161 | 1679853 | <filename>mgn/test_market1501.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import unittest
from mock import patch
from torch.utils.data import DataLoader
from torchvision.transforms import ToTensor
from market1501 import Market1501, RandomIdSampler
root = os.path.dirname(os.path.realpath(__file__)) + '... | 0 | 0 | 0 | 0 | 0 | 0 |
electroncash_gui/qt/utils/aspect_svg_widget.py | christroutner/Electron-Cash | 208 | 1679880 | <reponame>christroutner/Electron-Cash
#!/usr/bin/env python3
#
# Electron Cash - lightweight Bitcoin client
# Copyright (C) 2019 <NAME> <<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 Soft... | 0 | 0 | 0 | 0 | 0 | 0 |
vrProjector/EquirectangularProjection.py | AmyPhung/vrProjector | 102 | 1679882 | # Copyright 2016 <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 or agreed to in writing, software
# ... | 0 | 2 | 0 | 0 | 2 | 0 |
tests/testapp/widgets/models.py | HOYINWUN/django-map-widgets | 425 | 1679909 | from __future__ import unicode_literals
from django.contrib.gis.db import models
class PointField(models.Model):
name = models.CharField(max_length=255)
location = models.PointField(srid=4326)
city = models.PointField(blank=True, null=True, srid=3857)
def __unicode__(self) -> object:
return ... | 0 | 1 | 0 | 0 | 1 | 0 |
tests/test_querysets.py | Roconda/django-behaviors | 225 | 1679912 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_django-behaviors
------------
Tests for `django-behaviors` querysets module.
"""
from django.contrib.auth import get_user_model
from django.utils import timezone
from test_plus.test import TestCase
from datetime import timedelta
from .models import AuthoredMoc... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/Resource_Principle_v2.2_Functions_example/func.py | Manny27nyc/oci-python-sdk | 249 | 1679932 | <reponame>Manny27nyc/oci-python-sdk
# coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache... | 0 | 0 | 0 | 0 | 0 | 0 |
src/westpa/tools/plot.py | burntyellow/adelman_ci | 140 | 1679938 |
#import warnings
#warnings.filterwarnings('ignore', category=DeprecationWarning)
#warnings.filterwarnings('ignore', category=RuntimeWarning)
#warnings.filterwarnings('ignore', category=FutureWarning)
from __future__ import annotations
import numpy as np
import h5py
# We don't care if we're reimporting blessings, under... | 11 | 2 | 0 | 4 | 17 | 0 |
tests/test_extract.py | mnm-team/pyzx-heuristics | 219 | 1679960 | # PyZX - Python library for quantum circuit rewriting
# and optimization using the ZX-calculus
# Copyright (C) 2018 - <NAME> and <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
... | 0 | 0 | 0 | 0 | 0 | 0 |
bw_plex/plex.py | Hellowlol/bw_plex | 371 | 1680019 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import itertools
import logging
import os
import tempfile
import struct
import signal
import time
import threading
import webbrowser
from collections import defaultdict
from functools import wraps
import click
import plexapi
from lomond import WebSocket
from lomond.persi... | 0 | 0 | 0 | 0 | 0 | 0 |
python/federatedml/param/hetero_sshe_lr_param.py | rubenlozanoaht3m/DataDogm | 715 | 1680027 | <gh_stars>100-1000
#
# Copyright 2019 The FATE 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
#
# Unles... | 0 | 0 | 0 | 0 | 0 | 0 |
test/python/circuit/library/test_state_preparation.py | QAMP-Spring-2022-Transpiler-Hackathon/qiskit-terra | 1,456 | 1680050 | <gh_stars>1000+
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications ... | 0 | 0 | 0 | 0 | 0 | 0 |
src/main/python/trec-covid/generate_round2_baselines.py | cakiki/anserini | 626 | 1680066 | #
# Pyserini: Python interface to the Anserini IR toolkit built on Lucene
#
# 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... | 2 | 0 | 0 | 0 | 2 | 0 |
apps/challenges/migrations/0047_add_model_to_invite_user_in_challenge.py | kaustubh-s1/EvalAI | 1,470 | 1680122 | <reponame>kaustubh-s1/EvalAI
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-03-24 20:13
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
... | 0 | 0 | 0 | 0 | 0 | 0 |
octopus/platforms/EOS/explorer.py | SillyTin/octopus | 212 | 1680123 | from __future__ import annotations
from octopus.engine.explorer import Explorer
from requests.exceptions import ConnectionError as RequestsConnectionError
import json
EOS_DEFAULT_RPC_PORT = 8888
EOS_WALLET_RPC_PORT = 8889
class EosExplorer(Explorer):
"""
EOS REST RPC client class
doc: https://eosio.git... | 10 | 23 | 0 | 0 | 33 | 0 |
step4_sentiments/model_evaluation/eva.py | tanlitao/Weibo-Analyst | 545 | 1680142 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 4 09:59:46 2018
@author: <NAME>
"""
#from snownlp import sentiment
#import numpy as np
from snownlp import SnowNLP
#from snownlp.sentiment import Sentiment
comment = []
array1 =[]
array2 =[]
count_num = 0
count_sum=200
for line_data in open("e... | 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.