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 |
|---|---|---|---|---|---|---|---|---|---|---|
script/gen_model.py | wangshy31/Densely-Connected-CNN-with-Multi-scale-Feature-Attention | 134 | 1765218 | import gen_layer
import math
label_source = "/ssd/ijcai18/data/agnews" #training and testing label generated by 'gen_data.py'
data_source = "/ssd/ijcai18/data/agnews" #training and testing data generated by 'gen_data.py'
local_dict_source = "/ssd/ijcai18/data/agnews/local_dict.txt" #local dict generated by 'gen_data.p... | 25 | 2 | 0 | 0 | 27 | 0 |
deep_qa/training/__init__.py | richarajpal/deep_qa | 459 | 1765222 | from .text_trainer import TextTrainer
from .trainer import Trainer
| 0 | 0 | 0 | 0 | 0 | 0 |
paip/tests/test_emycin.py | skynetshrugged/paip-python | 304 | 1765248 | <reponame>skynetshrugged/paip-python
import unittest
from paip.emycin import *
def eq(x, y):
return x == y
class CFTests(unittest.TestCase):
def test_cf_or(self):
cases = [
(0.6, 0.4, 0.76),
(-0.3, -0.75, -0.825),
(0.3, -0.4, -1.0/7.0),
(-0.4, 0... | 0 | 0 | 0 | 0 | 0 | 0 |
nose2/tests/functional/support/scenario/test_classes_mp/test_fixtures_mp.py | deeplow/nose2 | 637 | 1765292 | class Test(object):
@classmethod
def setUpClass(cls):
cls.setup = 1
@classmethod
def tearDownClass(cls):
del cls.setup
def setUp(self):
self.test_setup = 1
def tearDown(self):
del self.test_setup
def test(self):
assert self.test_setup
asser... | 0 | 0 | 0 | 0 | 0 | 0 |
server/migrations/0015_secret_remove_old_secret.py | fortiko/Crypt-Server | 101 | 1765294 | <reponame>fortiko/Crypt-Server<filename>server/migrations/0015_secret_remove_old_secret.py
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2018-11-30 17:59
from __future__ import unicode_literals
from django.db import migrations
import encrypted_model_fields.fields
class Migration(migrations.Migration):
d... | 0 | 0 | 0 | 0 | 0 | 0 |
alipay/aop/api/domain/AlipayUserDetail.py | snowxmas/alipay-sdk-python-all | 213 | 1765305 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import annotations
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayUserDetail(object):
def __init__(self):
self._alipay_user_id: None = None
self._certified: None = None
self._logon_id: None = None... | 0 | 9 | 0 | 7 | 16 | 0 |
pyscf/cc/test/test_rccsd_lambda.py | umamibeef/pyscf | 501 | 1765320 | #!/usr/bin/env python
# Copyright 2014-2018 The PySCF Developers. 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
#
# U... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_configs.py | blazejdolicki/vissl | 2,512 | 1765328 | # 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 logging
import unittest
from hydra.errors import ConfigCompositionException, HydraException
from parameterized import parameterized
fro... | 0 | 0 | 0 | 0 | 0 | 0 |
hc/api/management/commands/pruneflips.py | sumonst21/healthchecks | 4,813 | 1765353 | from django.core.management.base import BaseCommand
from hc.api.models import Flip
from hc.lib.date import month_boundaries
class Command(BaseCommand):
help: str = "Prune old Flip objects."
def handle(self, *args, **options) -> object:
threshold = min(month_boundaries(months=3))
q = Flip.ob... | 0 | 1 | 1 | 0 | 2 | 0 |
tests/test_datasets/test_human_image_dataset.py | ykk648/mmhuman3d | 472 | 1765363 | import copy
import numpy as np
from mmhuman3d.data.datasets import HumanImageDataset
from mmhuman3d.data.datasets.pipelines import (
LoadImageFromFile,
MeshAffine,
RandomHorizontalFlip,
)
def test_human_image_dataset():
# test auto padding for bbox_xywh
train_dataset = HumanImageDataset(
... | 0 | 0 | 0 | 0 | 0 | 0 |
mgwr/tests/test_sel_bw.py | MarvelousRC/mgwr | 222 | 1765409 | <gh_stars>100-1000
"""
GWR is tested against results from GWR4
"""
import os
import numpy as np
from libpysal import io
import libpysal as ps
import unittest
from spglm.family import Gaussian, Poisson, Binomial
from ..sel_bw import Sel_BW
from numpy.testing import assert_allclose
class TestSelBWGaussian(unittest.Tes... | 0 | 0 | 0 | 0 | 0 | 0 |
tx_parse_xml/acl_update_License_for_GetterSources.py | DazEB2/SimplePyScripts | 117 | 1765425 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
from pathlib import Path
import re
from bs4 import BeautifulSoup
FILE_NAME_ACL = Path(r'C:\<...>\ads\<...>\src\<...>.xml')
LICENSE_PATH = "<...>/<...>/<...>/"
TEMPLATE_THIS_PROP = """
<xsc:Item>
<xsc:IdReference Path="{acl_id} {prop... | 0 | 0 | 0 | 0 | 0 | 0 |
tutorials/W2D3_BiologicalNeuronModels/solutions/W2D3_Tutorial2_Solution_be65591c.py | eduardojdiniz/CompNeuro | 2,294 | 1765427 |
"""
Discussion:
1. Anything that tries to reduce the mean or variance of the input e.g. mean can
be reduced by inhibition, sigma can be reduced by the membrane time constant.
Obviously, if the two neurons have different parameters that will decorrelate them.
But more importantly, it is the slope of neuron transfer fu... | 0 | 0 | 0 | 0 | 0 | 0 |
vcstool/commands/status.py | sloretz/vcstool | 230 | 1765455 | from __future__ import annotations
import argparse
import sys
from vcstool.streams import set_streams
from .command import Command
from .command import simple_main
class StatusCommand(Command):
command: str = 'status'
help: str = 'Show the working tree status'
def __init__(self, args):
super(S... | 3 | 2 | 2 | 0 | 7 | 0 |
modules/__init__.py | MattSkiff/aerial_wildlife_detection | 166 | 1765456 | <gh_stars>100-1000
'''
Register modules here. Module-specific parameters in the config .ini file
can be added under a section with the same name as the module.
2019-2020 <NAME>
'''
# set up Celery configuration
import celery_worker
from .LabelUI.app import LabelUI
from .Database.app import Database
from ... | 0 | 0 | 0 | 0 | 0 | 0 |
WebMirror/management/rss_parser_funcs/feed_parse_extractJiamintranslationCom.py | fake-name/ReadableWebProxy | 193 | 1765465 | from __future__ import annotations
def extractJiamintranslationCom(item) -> bool | object | None:
'''
Parser for 'jiamintranslation.com'
'''
if 'Calligraphy' in item['tags']:
return None
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].... | 0 | 1 | 0 | 0 | 1 | 0 |
examples/unix/machine_bios.py | sebastien-riou/micropython | 13,648 | 1765471 | # This example shows how to access Video BIOS memory area via machine.mem
# It requires root privilege and x86 legacy harfware (which has mentioned
# Video BIOS at all).
# It is expected to print 0xaa55, which is a signature at the start of
# Video BIOS.
import umachine as machine
print(hex(machine.mem16[0xC0000]))
| 0 | 0 | 0 | 0 | 0 | 0 |
tools/db/cosmosDbUtil.py | nitikagarw/openwhisk | 2,830 | 1765524 | #!/usr/bin/env python
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "Li... | 0 | 7 | 0 | 0 | 7 | 0 |
test/model/deepstate/test_issm.py | Xiaoxiong-Liu/gluon-ts | 2,648 | 1765548 | <gh_stars>1000+
# Copyright 2018 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://www.apache.org/licenses/LICENSE-2.0
#
# or... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/replication_tests/test_cmt.py | juicetinliu/VeRyPy | 156 | 1765565 | # -*- coding: utf-8 -*-
# Written in Python 2.7, but try to maintain Python 3+ compatibility
from __future__ import print_function
from __future__ import division
from replicationbase import ReplicationBase
from classic_heuristics.cmt_2phase import cmt_2phase_init
from os import path
import unittest
from util import ... | 0 | 1 | 0 | 0 | 1 | 0 |
task2/evaluation.py | sukh1222/cts_2018_baseline | 132 | 1765583 | <reponame>sukh1222/cts_2018_baseline
"""Evaluation for DCASE 2018 Task 2 Baseline models."""
import csv
from collections import defaultdict
import os
import random
import sys
import numpy as np
import tensorflow as tf
import inputs
import model
# For Kaggle evaluation, we want MAP@3.
TOP_N = 3
def get_top_predicte... | 0 | 0 | 0 | 0 | 0 | 0 |
Module/Spaghetti/modules/fingerprints/os/os.py | vishnudxb/Yuki-Chan-The-Auto-Pentest | 655 | 1765587 | <filename>Module/Spaghetti/modules/fingerprints/os/os.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Spaghetti: Web Application Security Scanner
#
# @url: https://github.com/m4ll0k/Spaghetti
# @author: <NAME> (M4ll0k)
# @license: See the file 'doc/LICENSE'
import bsd
import linux
import mac
import solaris
impor... | 0 | 0 | 0 | 0 | 0 | 0 |
Algo and DSA/LeetCode-Solutions-master/Python/stone-game-viii.py | Sourav692/FAANG-Interview-Preparation | 3,269 | 1765588 | <reponame>Sourav692/FAANG-Interview-Preparation<gh_stars>1000+
# Time: O(n)
# Space: O(1)
class Solution(object):
def stoneGameVIII(self, stones):
"""
:type stones: List[int]
:rtype: int
"""
for i in xrange(len(stones)-1):
stones[i+1] += stones[i]
return... | 0 | 0 | 0 | 0 | 0 | 0 |
torchsparse/tensor.py | collector-m/torchsparse | 428 | 1765609 | from __future__ import annotations
from typing import Any, Dict, Tuple, Union
import torch
from torchsparse.utils import make_ntuple
__all__ = ['SparseTensor', 'PointTensor']
class SparseTensor:
def __init__(self,
feats: torch.Tensor,
coords: torch.Tensor,
st... | 11 | 16 | 0 | 3 | 30 | 0 |
syte/views/blog.py | leliocampanile/lc-syte | 426 | 1765612 | # -*- coding: utf-8 -*-
import os
import re
import htmlentitydefs
import requests
from django.shortcuts import render
from django.conf import settings
from django.http import HttpResponse
from datetime import datetime
from pybars import Compiler
from HTMLParser import HTMLParser
# Takes a response (e.g. from Wordpre... | 0 | 7 | 0 | 1 | 8 | 0 |
vendor/typing.py | Schweinepriester/oil | 2,209 | 1765634 | # Stripped down version of typing.py for runtime support only!
#
# We got rid of runtime dependences on collections.py, copy.py, etc.
#
# MyPy has its own version of this, since it's written in Python 3. We don't
# need any support at runtime.
#
# If you need to define a type alias, do something like:
#
# if TYPE_CHEC... | 0 | 1 | 0 | 0 | 1 | 0 |
hc/api/tests/test_notify_whatsapp.py | gdepeyrot/healthchecks | 4,813 | 1765635 | # coding: utf-8
from datetime import timedelta as td
import json
from unittest.mock import patch
from django.core import mail
from django.utils.timezone import now
from hc.api.models import Channel, Check, Notification
from hc.test import BaseTestCase
class NotifyTestCase(BaseTestCase):
def _setup_data(self, va... | 1 | 0 | 0 | 0 | 1 | 0 |
test/unit/test_result.py | stjordanis/pyquil | 677 | 1765646 | <filename>test/unit/test_result.py<gh_stars>100-1000
import numpy as np
from pyquil.experiment import plusX
from pyquil.experiment._result import (
bitstrings_to_expectations,
correct_experiment_result,
ratio_variance,
ExperimentResult,
ExperimentSetting,
)
from pyquil.paulis import sZ
def test_b... | 0 | 0 | 0 | 0 | 0 | 0 |
bcs-ui/backend/tests/resources/utils/test_parse_cobj_api_version.py | laodiu/bk-bcs | 599 | 1765649 | <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 TH<NAME> Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use th... | 0 | 0 | 0 | 0 | 0 | 0 |
clarifai/rest/grpc/proto/clarifai/api/audio_pb2.py | Taik/clarifai-python | 322 | 1765663 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: proto/clarifai/api/audio.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import ref... | 0 | 0 | 0 | 0 | 0 | 0 |
baselines/VMM/print_model.py | sordonia/HierarchicalEncoderDecoder | 116 | 1765668 | <reponame>sordonia/HierarchicalEncoderDecoder
import pstfast
import argparse
import cPickle
import operator
import sys
if __name__ == "__main__":
pstree = pstfast.PST(4)
pstree.load(sys.argv[1])
print pstree
| 0 | 0 | 0 | 0 | 0 | 0 |
docqa/data_analysis/squad_upper_bound.py | Willyoung2017/doc-qa | 422 | 1765727 | <filename>docqa/data_analysis/squad_upper_bound.py
from tqdm import tqdm
from docqa.squad.squad_data import SquadCorpus
from docqa.squad.squad_official_evaluation import f1_score
from docqa.utils import flatten_iterable
"""
Explore errors caused by our tokenziation and/or token cleaning
"""
def main():
data = S... | 0 | 0 | 0 | 0 | 0 | 0 |
subsync/ffmpeg.py | tympanix/subsync | 108 | 1765738 | import random
import string
import subprocess
import os
import tempfile
import re
import sys
from datetime import timedelta
from subprocess import DEVNULL, STDOUT, PIPE
class Transcode:
"""
Transcode is a wrapper around the ffmpeg binary used to transcode
audio from media files.
"""
def __init__(... | 8 | 5 | 0 | 0 | 13 | 0 |
tensorflow/contrib/distributions/python/kernel_tests/kullback_leibler_test.py | jdehotin/TensorFlow | 680 | 1765761 | # Copyright 2016 The TensorFlow 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 applica... | 2 | 4 | 0 | 0 | 6 | 0 |
test/programytest/storage/stores/sql/store/test_sqlstore.py | cdoebler1/AIML2 | 345 | 1765789 | import unittest
import unittest.mock
import programytest.storage.engines as Engines
from programy.storage.stores.sql.config import SQLStorageConfiguration
from programy.storage.stores.sql.engine import SQLStorageEngine
from programy.storage.stores.sql.store.sqlstore import SQLStore
class SQLStoreTests(unittest.TestCa... | 0 | 0 | 0 | 0 | 0 | 0 |
drl_grasping/perception/camera_subscriber.py | Tiamat-Tech/drl_grasping | 126 | 1765821 | <reponame>Tiamat-Tech/drl_grasping<filename>drl_grasping/perception/camera_subscriber.py
from rclpy.executors import SingleThreadedExecutor
from rclpy.node import Node
from rclpy.parameter import Parameter
from rclpy.qos import QoSProfile, QoSDurabilityPolicy, QoSReliabilityPolicy, QoSHistoryPolicy
from sensor_msgs.msg... | 0 | 0 | 0 | 0 | 0 | 0 |
vega/algorithms/nas/modnas/contrib/callback/metrics_stats.py | This-50m/vega | 724 | 1765855 | <reponame>This-50m/vega
# -*- coding:utf-8 -*-
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the MIT License.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WAR... | 0 | 0 | 0 | 0 | 0 | 0 |
Benchmarks/scripts/bench_system_tables.py | omnisci/mapd-core | 266 | 1765872 | <filename>Benchmarks/scripts/bench_system_tables.py
import argparse
import sys
import pymapd
from heavy.thrift.ttypes import TDashboard
def getOptions(args=None):
parser = argparse.ArgumentParser(description='Basic benchmark for system tables')
parser.add_argument('--host', help='OmniSci server address', defa... | 0 | 0 | 0 | 0 | 0 | 0 |
monitor/migrations/0005_auto_20170718_2122.py | achow101/forkmon | 137 | 1765877 | <reponame>achow101/forkmon
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-07-19 04:22
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('monitor', '0004_auto_20170718_0105'),
]
ope... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/mesh-botnet/settings.py | eric-downes/mesh-networking | 368 | 1765927 | """Bot config"""
import getpass
import os
import socket
from system_info import (
get_hostname,
get_platform,
get_current_user,
get_main_user,
get_full_username,
get_irc_nickname,
)
### System Info
HOSTNAME = get_hostname()
SYSTEM = get_platform()
LOCAL_USER = get_current_user()
MAIN_USER = ... | 0 | 0 | 0 | 0 | 0 | 0 |
Skype4Py/lang/da.py | low456high/Skype4Py | 199 | 1765935 | <reponame>low456high/Skype4Py<filename>Skype4Py/lang/da.py
apiAttachAvailable = u'API forefindes'
apiAttachNotAvailable = u'Optaget'
apiAttachPendingAuthorization = u'Afventer godkendelse'
apiAttachRefused = u'Afvist'
apiAttachSuccess = u'Succes'
apiAttachUnknown = u'Ukendt'
budDeletedFriend = u'Slettet fra liste over ... | 0 | 0 | 0 | 0 | 0 | 0 |
mistral/db/sqlalchemy/migration/alembic_migrations/versions/030_increase_delayed_calls_v2_auth_context.py | soda-research/mistral | 205 | 1765940 | <reponame>soda-research/mistral
# Copyright 2018 OpenStack Foundation.
#
# 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... | 0 | 0 | 0 | 0 | 0 | 0 |
tensorflow_blade/tests/gpu/tf_to_trt_test.py | JamesTheZ/BladeDISC | 328 | 1765971 | # Copyright 2022 The BladeDISC 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 law or ... | 0 | 4 | 0 | 0 | 4 | 0 |
skyline/functions/database/queries/get_ionosphere_fp_ids_for_full_duration.py | datastreaming/skyline-1 | 396 | 1765972 | <reponame>datastreaming/skyline-1
import logging
import traceback
from sqlalchemy.sql import select
from database import get_engine, engine_disposal, ionosphere_table_meta
# @added 20210426 - Feature #4014: Ionosphere - inference
# Add a global method to query the DB for enabled (or disabled) features
# profiles f... | 0 | 0 | 0 | 0 | 0 | 0 |
recipes/Python/577660_Representing_set_compact/recipe-577660.py | tdiprima/code | 2,023 | 1765987 | class CompactSet:
def __init__(self, numbers = None, bits = None):
self.bits = bits or 0
if numbers:
for n in numbers:
self.add(n)
def add(self, n):
self.bits |= 1 << n
def remove(self, n):
self.bits &= ~(1 << n)
def clear(self):
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/torch/test_compression_training.py | openvinotoolkit/nncf_pytorch | 136 | 1765990 | from __future__ import annotations
"""
Copyright (c) 2019-2022 Intel Corporation
Licensed under the Apache License, Version 2.0 (the 'License');
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required ... | 17 | 33 | 3 | 16 | 69 | 0 |
utils/split_data.py | MarkWuNLP/StreamingTransformer | 252 | 1765994 | <filename>utils/split_data.py
#!/usr/bin/env python2
# encoding: utf-8
import argparse
import json
import os
def write_json(js, json_file):
with open(json_file, 'wb') as f:
f.write(json.dumps({'utts': js}, indent=4, sort_keys=True).encode('utf_8'))
if __name__ == '__main__':
parser = argparse.Argumen... | 0 | 0 | 0 | 0 | 0 | 0 |
sdl2/ext/draw.py | cmitu/py-sdl2 | 222 | 1766074 | <gh_stars>100-1000
"""Drawing routines for software surfaces."""
import ctypes
from .compat import isiterable, UnsupportedError
from .array import to_ctypes
from .color import convert_to_color
from .. import surface, pixels, rect
from .algorithms import clipline
from .sprite import SoftwareSprite
__all__ = ["prepare_c... | 0 | 0 | 0 | 0 | 0 | 0 |
blinkpy/__init__.py | magicalyak/blinkpy | 272 | 1766084 | """Init file for blinkpy."""
| 0 | 0 | 0 | 0 | 0 | 0 |
minemeld/flask/loginapi.py | zul126/minemeld-core | 147 | 1766105 | # Copyright 2015-2016 Palo Alto Networks, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 0 | 2 | 0 | 0 | 2 | 0 |
pylearn2/distributions/multinomial.py | ikervazquezlopez/Pylearn2 | 2,045 | 1766116 | """
.. todo::
WRITEME
"""
__authors__ = "<NAME>"
__copyright__ = "Copyright 2010-2012, Universite de Montreal"
__credits__ = ["<NAME>"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
__email__ = "<EMAIL>"
import numpy as N
class Multinomial(object):
"""
.. todo::
WRITEME
"""
d... | 1 | 1 | 0 | 0 | 2 | 0 |
server/clip_server/model/clip_onnx.py | jina-ai/bert-as-service | 110 | 1766125 | <reponame>jina-ai/bert-as-service
import os
from .clip import _download, available_models
_S3_BUCKET = 'https://clip-as-service.s3.us-east-2.amazonaws.com/models/onnx/'
_MODELS = {
'RN50': ('RN50/textual.onnx', 'RN50/visual.onnx'),
'RN101': ('RN101/textual.onnx', 'RN101/visual.onnx'),
'RN50x4': ('RN50x4/t... | 0 | 0 | 0 | 0 | 0 | 0 |
Bölüm 3 : Regresyon/3.4 cok degiskenli lineer regresyon/normal_equation/ozellik_normalizasyonu.py | Teknomar/Makine-Ogrenmesi | 115 | 1766154 | # coding=utf-8
""" Feature Normalization
Ozellik Normalizasyonu"""
import numpy as np
def ozellik_normalizasyonu(x) -> tuple[object, object, object]:
"""
:param x: normallestirilecek ozellikler
:return: normalize olmus X, ortalamasi ve sapmasi
"""
butun_ortalamalar = []
butun_standart_sapmal... | 0 | 1 | 0 | 0 | 1 | 0 |
plugins/cipher_plugin/lib/Cipher.py | MrT3acher/Android-Malware-Sandbox | 218 | 1766170 | <gh_stars>100-1000
import datetime
import re
import socket
from urllib.parse import urlparse
from sqlalchemy import Column, Integer, String, Boolean, ForeignKey, DateTime
from lib.model.database.Database import Database
Base = Database.get_declarative_base()
class Cipher(Base):
__tablename__ = 'cipher'
id ... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/domain/book/test_isbn.py | tamanobi/dddpy | 170 | 1766210 | import dataclasses
import pytest
from dddpy.domain.book import Isbn
class TestIsbn:
@pytest.mark.parametrize(
"value",
[
("978-0321125217"),
("978-4-949999-12-0"),
],
)
def test_constructor_should_create_instance(self, value):
isbn = Isbn(value)
... | 0 | 0 | 0 | 0 | 0 | 0 |
src/tests/fidl/dangerous_identifiers/generate/styles.py | allansrc/fuchsia | 210 | 1766223 | # Copyright 2020 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
__all__ = ['STYLES']
from dataclasses import dataclass
from typing import List, Callable, Tuple
from common import *
# Define ways that identifiers may be ... | 0 | 3 | 1 | 0 | 4 | 0 |
mqtt_io/modules/stream/__init__.py | DominicWindisch/mqtt-io | 231 | 1766270 | """
Contains the base class that is shared across all Stream modules.
"""
import asyncio
from abc import ABC, abstractmethod
from concurrent.futures import ThreadPoolExecutor
from typing import Optional
from ...types import ConfigType
class GenericStream(ABC):
"""
Abstracts a generic stream interface to be ... | 3 | 6 | 0 | 0 | 9 | 0 |
eval/inception/train.py | Batake/wavegan | 1,124 | 1766276 | from __future__ import print_function
import time
import tensorflow as tf
from six.moves import xrange
def model(x, nlogits, train: bool=False) -> object:
b = tf.shape(x)[0]
if args.infer_legacy:
window = tf.contrib.signal.hann_window(1024)
windows = []
for i in xrange(0, 16384, 128):
x_windo... | 1 | 4 | 0 | 0 | 5 | 0 |
datasets/annothelper.py | steuwe/deephar | 343 | 1766277 | <gh_stars>100-1000
import os
import sys
from keras.utils.data_utils import get_file
ORIGIN = 'https://github.com/dluvizon/deephar/releases/download/'
def check_mpii_dataset():
version = 'v0.1'
try:
mpii_path = os.path.join(os.getcwd(), 'datasets/MPII/')
annot_path = get_file(mpii_path + 'anno... | 0 | 0 | 0 | 0 | 0 | 0 |
InvenTree/report/migrations/0008_auto_20210204_2100.py | carlos-riquelme/InvenTree | 656 | 1766292 | <filename>InvenTree/report/migrations/0008_auto_20210204_2100.py<gh_stars>100-1000
# Generated by Django 3.0.7 on 2021-02-04 10:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('report', '0007_auto_20210204_1617'),
]
operations = [
mig... | 0 | 0 | 0 | 0 | 0 | 0 |
openbook_auth/migrations/0013_badge_userprofilebadge.py | TamaraAbells/okuna-api | 164 | 1766314 | <reponame>TamaraAbells/okuna-api
# Generated by Django 2.1.4 on 2018-12-31 13:32
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('openbook_auth', '0012_merge_20181207_1647'),
]
op... | 0 | 0 | 0 | 0 | 0 | 0 |
python/phonenumbers/shortdata/region_GN.py | rodgar-nvkz/python-phonenumbers | 2,424 | 1766328 | <filename>python/phonenumbers/shortdata/region_GN.py
"""Auto-generated file, do not edit by hand. GN metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_GN = PhoneMetadata(id='GN', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_nu... | 0 | 0 | 0 | 0 | 0 | 0 |
Neural_Decoding/__init__.py | horsto/Neural_Decoding | 274 | 1766331 | from .decoders import WienerFilterDecoder, WienerCascadeDecoder, KalmanFilterDecoder,\
DenseNNDecoder, SimpleRNNDecoder, GRUDecoder, LSTMDecoder, XGBoostDecoder, SVRDecoder, NaiveBayesDecoder
from .metrics import get_R2, get_rho
from .preprocessing_funcs import bin_output, bin_spikes, get_spikes_with_histor... | 0 | 0 | 0 | 0 | 0 | 0 |
test/sagemaker_tests/autogluon/training/resources/scripts/train_cv.py | waytrue17/deep-learning-containers | 383 | 1766369 | import argparse
import os
from pprint import pprint
import yaml
from autogluon.vision import ImagePredictor
def get_input_path(path) -> object:
file = os.listdir(path)[0]
if len(os.listdir(path)) > 1:
print(f'WARN: more than one file is found in {path} directory')
print(f'Using {file}')
filen... | 0 | 2 | 0 | 0 | 2 | 0 |
riptable/rt_groupbyops.py | 972d5defe3218bd62b741e6a2f11f5b3/riptable | 307 | 1766370 | <reponame>972d5defe3218bd62b741e6a2f11f5b3/riptable<filename>riptable/rt_groupbyops.py
__all__ = ['GroupByOps']
#import abc
from typing import TYPE_CHECKING, Optional
import warnings
import numpy as np
import riptide_cpp as rc
from .rt_enum import GB_FUNCTIONS, GB_STRING_ALLOWED, GB_FUNC_COUNT, GB_PACKUNPACK,... | 0 | 0 | 0 | 0 | 0 | 0 |
azure-devops/azext_devops/dev/team/security_group.py | keithlemon/azure-devops-cli-extension | 326 | 1766379 | <reponame>keithlemon/azure-devops-cli-extension
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------... | 0 | 0 | 0 | 0 | 0 | 0 |
binblog/sitemaps.py | enjoy-binbin/Django-blog | 111 | 1766396 | <filename>binblog/sitemaps.py
from django.contrib.sitemaps import Sitemap
from django.urls import reverse
from blog.models import Article, Category, Tag
class StaticViewSitemap(Sitemap):
""" 静态视图,例如抓取index页 """
priority = 0.5 # 优先级
changefreq = 'daily' # 更改频率,文档里查找可使用的属性值
def items(self):
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/jinja_config.py | meloncafe/django-activeurl | 139 | 1766397 | <filename>tests/jinja_config.py
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from jinja2 import Environment
from django_activeurl.ext.django_jinja import ActiveUrl
try:
# django < 2
from django.core.urlresolvers import reverse
except ImportError:
# django > 2
from ... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/reassignment.py | ZYAZP/python2 | 1,062 | 1766420 | <gh_stars>1000+
def f():
x = 'local'
x = 'reassigned'
x = 'reassigned again'
print f()
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/layer_tests/tensorflow_tests/test_tf_StridedSlice.py | ryanloney/openvino-1 | 1,127 | 1766426 | # Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
from common.tf_layer_test_class import CommonTFLayerTest
class TestStridedSlice(CommonTFLayerTest):
@staticmethod
def create_strided_slice_net(input_shape, begin, end, strides, begin_mask, end_mask,
... | 0 | 1 | 2 | 0 | 3 | 0 |
fectl/apps/__init__.py | fallenwood/fectl | 104 | 1766432 | <filename>fectl/apps/__init__.py
from .aiohttp_config import AiohttpSettings
AIOHTTP_SETTINGS = AiohttpSettings()
APPS = {
"aiohttp": "fectl.apps.aiohttp.AiohttpRunner",
}
| 0 | 0 | 0 | 0 | 0 | 0 |
scale/error/migrations/0006_update_retried.py | kaydoh/scale | 121 | 1766452 | from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies: list[tuple[str, str]] = [
('error', '0005_auto_20180621_2110'),
]
def update_should_be_retried(apps, schema_editor):
# Go through all of the Error models and up... | 0 | 0 | 2 | 0 | 2 | 0 |
research/information_retrieval/elastic_integration/dense_ranking.py | clementpoiret/sparseml | 922 | 1766454 | <reponame>clementpoiret/sparseml
# neuralmagic: no copyright
# flake8: noqa
# fmt: off
# isort: skip_file
#!/usr/bin/env python
# coding=utf-8
# Copyright (c) 2021 - present / Neuralmagic, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in... | 0 | 0 | 0 | 0 | 0 | 0 |
topicnet/cooking_machine/pretty_output.py | DmitriyValetov/TopicNet | 123 | 1766494 | from __future__ import annotations
import numpy as np
from datetime import datetime
from .routine import get_fix_string, get_fix_list
from .routine import get_equal_strings, get_equal_lists
from .models.base_model import MODEL_NAME_LENGTH
UP_END = "┌"
DOWN_END = "└"
MIDDLE = "├"
LAST = "┤"
EMPTY = "│"
START_END = "┐"... | 10 | 7 | 0 | 0 | 17 | 0 |
docs_src/tutorial/soonify/tutorial002.py | sanders41/asyncer | 596 | 1766499 | <filename>docs_src/tutorial/soonify/tutorial002.py
import anyio
import asyncer
async def do_work(name: str):
await anyio.sleep(1)
print(f"Hello, {name}")
async def get_data():
async with asyncer.create_task_group() as task_group:
task_group.soonify(do_work)(name="Yury")
task_group.soonif... | 0 | 0 | 0 | 0 | 0 | 0 |
alipay/aop/api/domain/KoubeiMerchantKbcloudSubuserloginstatusQueryModel.py | snowxmas/alipay-sdk-python-all | 213 | 1766518 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import annotations
import json
from alipay.aop.api.constant.ParamConstants import *
class KoubeiMerchantKbcloudSubuserloginstatusQueryModel(object):
def __init__(self):
self._session_id: None = None
self._sub_user_id: None = None
... | 0 | 4 | 0 | 2 | 6 | 0 |
utime/evaluation/plotting.py | learning310/U-Time | 138 | 1766555 | <reponame>learning310/U-Time
import matplotlib.pyplot as plt
import numpy as np
import os
def get_hypnogram(y_pred, y_true=None, id_=None):
def format_ax(ax):
ax.set_xlabel("Period number")
ax.set_ylabel("Sleep stage")
ax.set_yticks(range(6))
ax.set_yticklabels(["Wake", "N1", "N2",... | 0 | 0 | 0 | 0 | 0 | 0 |
mmdet/models/backbones/rr_cspdarknet53.py | Karybdis/mmdetection-mini | 834 | 1766558 | # -*- coding:utf-8 -*-
from __future__ import annotations
import torch.nn as nn
from torch.nn.modules.batchnorm import _BatchNorm
from ...cv_core import kaiming_init, constant_init
from ..utils import brick as vn_layer
from ..builder import BACKBONES
@BACKBONES.register_module()
class RRCSPDarknet53(nn.Module):
#... | 5 | 1 | 1 | 1 | 8 | 0 |
scripts/FileImportExport/import_SketchUp.py | tdapper/cinema4d_py_sdk | 113 | 1766580 | import c4d
from c4d import documents, plugins, storage
#Author: <NAME>
#SketchUp import settings example
def main():
# Get SketchUp import plugin, 1033845 is its ID
plug = plugins.FindPlugin(1033845, c4d.PLUGINTYPE_SCENELOADER)
if plug is None:
return
# Get a path to load the imported file
... | 0 | 0 | 0 | 0 | 0 | 0 |
ch22-直方图/hist.py | makelove/OpenCV-Python-Tutorial | 2,875 | 1766593 | <gh_stars>1000+
#!/usr/bin/env python
''' This is a sample for histogram plotting for RGB images and grayscale images for better understanding of colour distribution
Benefit : Learn how to draw histogram of images
Get familier with cv2.calcHist, cv2.equalizeHist,cv2.normalize and some drawing functions
Lev... | 0 | 0 | 0 | 0 | 0 | 0 |
elg/elg_server.py | ianroberts/Opus-MT | 194 | 1766604 | from __future__ import annotations
import json
import argparse
from tornado import web, ioloop, queues, gen, process
from server import ApiHandler, TranslatorWorker, initialize_workers, settings
class ElgApiHandler(ApiHandler):
def post(self, src_lang, target_lang) -> object | None:
self.prepare_arg... | 0 | 3 | 0 | 0 | 3 | 0 |
lib/eco/sample_space_model.py | Existever/PyCFTrackers | 231 | 1766607 | <reponame>Existever/PyCFTrackers
import numpy as np
from .config import gpu_config
if gpu_config.use_gpu:
import cupy as cp
from .config import otb_hc_config,otb_deep_config
"""
code tested no problem
"""
class GMM:
def __init__(self, num_samples,config):
self._num_samples = num_samples
sel... | 0 | 0 | 0 | 0 | 0 | 0 |
demo/selenium_tests/test_rate.py | HiveTechies/django-star-ratings | 296 | 1766618 | from __future__ import division, unicode_literals
from django.test import override_settings
from django.contrib.auth import get_user_model
from selenium.common.exceptions import NoSuchElementException, TimeoutException, WebDriverException
from selenium.webdriver.support.wait import WebDriverWait
from .testcase import ... | 0 | 4 | 0 | 0 | 4 | 0 |
datasets/hkcancor/hkcancor.py | WojciechKusa/datasets | 10,608 | 1766625 | # coding=utf-8
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lice... | 0 | 2 | 1 | 0 | 3 | 0 |
modoboa/core/management/commands/communicate_with_public_api.py | HarshCasper/modoboa | 1,602 | 1766642 | <filename>modoboa/core/management/commands/communicate_with_public_api.py
"""Management command to communicate with public API."""
from django.core.mail import EmailMessage
from django.core.management.base import BaseCommand, CommandError
from django.template.loader import render_to_string
from django.utils.translatio... | 0 | 0 | 0 | 0 | 0 | 0 |
raspberryio/userprofile/tests/__init__.py | cvautounix/raspberryio | 113 | 1766652 | <gh_stars>100-1000
from raspberryio.userprofile.tests.test_models import *
from raspberryio.userprofile.tests.test_views import *
from raspberryio.userprofile.tests.test_forms import *
| 0 | 0 | 0 | 0 | 0 | 0 |
insights/parsers/tests/test_samba_logs.py | lhuett/insights-core | 121 | 1766662 | <gh_stars>100-1000
from insights.parsers import samba_logs
from insights.parsers.samba_logs import SAMBALog
from insights.tests import context_wrap
import doctest
SAMBA_LOG_NORMAL = """
[2019/11/25 19:29:23.933547, 0] ../lib/util/become_daemon.c:138(daemon_ready) daemon_ready: STATUS=daemon 'smbd' finished starting ... | 0 | 0 | 0 | 0 | 0 | 0 |
reviewboard/diffviewer/models/diffset.py | b1pb1p/reviewboard | 921 | 1766663 | from __future__ import annotations
"""DiffSet model definiton."""
from __future__ import unicode_literals
from django.core.exceptions import ValidationError
from django.db import models
from django.utils import six, timezone
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation i... | 4 | 6 | 5 | 0 | 15 | 0 |
tests/test_padded_sequence.py | davidgolub/QuestionGeneration | 117 | 1766670 | import math
import torch
import random
import unittest
import itertools
import contextlib
from copy import deepcopy
from itertools import repeat, product
from functools import wraps
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.parallel as dp
import torch.nn.utils.rnn as rnn_utils
from torch.nn... | 3 | 3 | 0 | 0 | 6 | 0 |
opzoo/Convolution/Convolution.py | wkcn/MobulaOP | 161 | 1766679 | <filename>opzoo/Convolution/Convolution.py
import mobula
from mobula.const import req
@mobula.op.register
class Conv2D:
def __init__(self, channels, kernel_size, strides=(1, 1), padding=(0, 0), dilation=(1, 1), groups=1):
self.channels = channels
self.kernel_size = kernel_size
self.strides... | 0 | 0 | 0 | 0 | 0 | 0 |
cinder/policies/volume_metadata.py | arunvinodqmco/cinder | 571 | 1766683 | <filename>cinder/policies/volume_metadata.py
# Copyright (c) 2017 Huawei Technologies Co., Ltd.
# 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
#
# htt... | 0 | 0 | 0 | 0 | 0 | 0 |
pykeops/examples/pytorch/plot_test_invkernel_torch_helper.py | mdiazmel/keops | 695 | 1766688 | <gh_stars>100-1000
"""
KernelSolve reduction (with LazyTensors)
=========================================
Let's see how to solve discrete deconvolution problems
using the **conjugate gradient solver** provided by
the :meth:`pykeops.torch.LazyTensor.solve` method of KeOps :class:`pykeops.torch.LazyTensor`.
"""
#######... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/020-single_mol-multiple_desc.py | UnixJunkie/mordred | 199 | 1766695 | from multiprocessing import freeze_support
from rdkit import Chem
from mordred import Chi, ABCIndex, RingCount, Calculator, is_missing, descriptors
if __name__ == "__main__":
freeze_support()
benzene = Chem.MolFromSmiles("c1ccccc1")
# Create empty Calculator instance
calc1 = Calculator()
# Reg... | 0 | 0 | 0 | 0 | 0 | 0 |
integration_tests/web/test_admin_conversations.py | priya1puresoftware/python-slack-sdk | 2,486 | 1766741 | import asyncio
import logging
import os
import time
import unittest
from integration_tests.env_variable_names import (
SLACK_SDK_TEST_GRID_ORG_ADMIN_USER_TOKEN,
SLACK_SDK_TEST_GRID_IDP_USERGROUP_ID,
SLACK_SDK_TEST_GRID_TEAM_ID,
SLACK_SDK_TEST_GRID_USER_ID,
)
from integration_tests.helpers import async_... | 0 | 0 | 0 | 2 | 2 | 0 |
application/utils/account.py | yongli82/FlaskBookRead | 543 | 1766759 | <reponame>yongli82/FlaskBookRead<gh_stars>100-1000
# coding: utf-8
from flask import session
from ..models import User
def signin_user(user, permenent=True):
"""Sign in user."""
session.permanent = permenent
session['user_id'] = user.id
def signout_user():
"""Sign out user."""
session.pop('user_... | 0 | 0 | 0 | 0 | 0 | 0 |
osp/citations/utils.py | davidmcclure/open-syllabus-project | 220 | 1766814 |
from __future__ import annotations
import regex
import iso3166
import us
from wordfreq import word_frequency
def clean_field(value) -> object:
"""
Strip whitespace, cast empty -> None.
Args:
value (str): The field value.
Returns:
list: The cleaned tokens.
"""
return (val... | 0 | 5 | 0 | 0 | 5 | 0 |
vega/networks/pytorch/gan/fully_basic_blocks.py | jie311/vega | 724 | 1766834 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the MIT License.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRAN... | 0 | 0 | 0 | 0 | 0 | 0 |
Tools/absvalue.py | tetsuo-cpp/Pyjion | 1,398 | 1766881 | <filename>Tools/absvalue.py<gh_stars>1000+
"""Auto-generate a rough portion of absvalue.(h|cpp)."""
import dis
import operator
import pathlib
import types
forward_declaration = """
class {avk_name}Value : public AbstractValue {{
virtual AbstractValueKind kind();
virtual AbstractValue* binary(AbstractSource* ... | 0 | 0 | 0 | 0 | 0 | 0 |
data_collection/gazette/spiders/ms_maracaju.py | kaiocp/querido-diario | 454 | 1766886 | from gazette.spiders.base.instar import BaseInstarSpider
class MsMaracajuSpider(BaseInstarSpider):
TERRITORY_ID: str = "5005400"
name: str = "ms_maracaju"
allowed_domains: list[str] = ["maracaju.ms.gov.br"]
start_urls: list[str] = ["https://www.maracaju.ms.gov.br/portal/diario-oficial"]
| 0 | 0 | 4 | 0 | 4 | 0 |
pwncat/modules/windows/enumerate/protections/lsa.py | Mitul16/pwncat | 1,454 | 1766912 | #!/usr/bin/env python3
from pwncat.db import Fact
from pwncat.modules import ModuleFailed
from pwncat.platform.windows import Windows, PowershellError
from pwncat.modules.enumerate import EnumerateModule
class LSAProtectionData(Fact):
def __init__(self, source, active: bool):
super().__init__(source=sour... | 1 | 2 | 2 | 1 | 6 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.