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 |
|---|---|---|---|---|---|---|---|---|---|---|
zippy/benchmarks/src/benchmarks/unmarshall.py | lucapele/pele-c | 319 | 1738471 | <gh_stars>100-1000
import marshal
import time, struct, sys
# sys.argv[2] is the absolute path of the benchmark to be unmarshalled
# sys.argv[1] is the real argument to be passed to the benchmark
benchmark = sys.argv[2]
f = open(benchmark, "r+b")
magic = f.read(4)
moddate = f.read(4)
#modtime = time.asctime(time.local... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/strategyease_sdk/joinquant/test_executor.py | skylovead/StrategyEase-Python-SDK | 574 | 1738474 | <reponame>skylovead/StrategyEase-Python-SDK<filename>tests/strategyease_sdk/joinquant/test_executor.py
# -*- coding: utf-8 -*-
import collections
import datetime
import inspect
import logging
import os
import unittest
import six
from six.moves import configparser
if six.PY2:
ConfigParser = configparser.RawConfig... | 0 | 0 | 0 | 0 | 0 | 0 |
tensorflow_data_validation/statistics/generators/basic_stats_generator.py | tensorflow/data-validation | 621 | 1738494 | # 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 in writing, ... | 69 | 26 | 6 | 13 | 114 | 0 |
var/spack/repos/builtin/packages/py-gooey/package.py | LiamBindle/spack | 2,360 | 1738511 | <filename>var/spack/repos/builtin/packages/py-gooey/package.py<gh_stars>1000+
# 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 PyGooey(PythonPa... | 0 | 0 | 0 | 0 | 0 | 0 |
lvvit.py | Ackesnal/DynamicViT | 285 | 1738524 | <gh_stars>100-1000
import torch
import torch.nn as nn
import numpy as np
from functools import partial
import torch.nn.init as init
import torch.nn.functional as F
import math
from timm.models.layers import DropPath, to_2tuple
import torch
import torch.nn as nn
from timm.models.layers import trunc_normal_
import nump... | 0 | 0 | 0 | 0 | 0 | 0 |
bazel/revisions.bzl | gapcguy/emsdk | 1,423 | 1738532 | <gh_stars>1000+
# This file is automatically updated by emsdk/scripts/update_bazel_workspace.sh
# DO NOT MODIFY
EMSCRIPTEN_TAGS = {
"2.0.32": struct(
hash = "74646397e3c5010824ad60d1de86c6bcbe334dff",
sha_linux = "236b3954e71d3bb30d347c655b9f47f2a091aa2e61046e1912c8da90152f4ca1",
sha_mac = ... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_file.py | damianfs/canvasapi | 386 | 1738547 | import unittest
from os.path import isfile
import requests_mock
from canvasapi import Canvas
from canvasapi.file import File
from tests import settings
from tests.util import cleanup_file, register_uris
@requests_mock.Mocker()
class TestFile(unittest.TestCase):
def setUp(self):
self.canvas = Canvas(sett... | 0 | 0 | 0 | 0 | 0 | 0 |
source/Orchestrator/exec_ssm_doc.py | sybeck2k/aws-security-hub-automated-response-and-remediation | 129 | 1738567 | <reponame>sybeck2k/aws-security-hub-automated-response-and-remediation
#!/usr/bin/python
###############################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# ... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/ml/confusion_matrix_tests.py | freyrsae/pydatalab | 198 | 1738576 | # Copyright 2017 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-2.0
#
# Unless required by applicable law or agreed ... | 0 | 1 | 0 | 0 | 1 | 0 |
libnamebench/nameserver.py | djprmf/namebench | 195 | 1738587 | #!/usr/bin/env python
# Copyright 2009 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-2.0
#
# Unless required... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/mo/openvino/tools/mo/ops/scatternd.py | kurylo/openvino | 1,127 | 1738588 | # Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
from openvino.tools.mo.front.common.partial_infer.utils import compatible_shapes, strict_compare_tensors, \
is_fully_defined
from openvino.tools.mo.graph.graph import Node, Graph
from openvino.tools.mo.ops.op impo... | 7 | 0 | 5 | 0 | 12 | 0 |
pypinyin/contrib/_tone_rule.py | ZacheryGuan/python-pinyin | 3,853 | 1738610 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
标调位置
有 ɑ 不放过,
没 ɑ 找 o、e;
ɑ、o、e、i、u、ü
标调就按这顺序;
i、u 若是连在一起,
谁在后面就标谁。
http://www.hwjyw.com/resource/content/2010/06/04/8183.shtml
https://www.zhihu.com/question/23655297
https://github.com/mozillazg/python-pinyin/issues/160
http://ww... | 0 | 1 | 0 | 0 | 1 | 0 |
third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda10.0/windows/msvc_wrapper_for_nvcc.py | yage99/tensorflow | 1,814 | 1738616 | <reponame>yage99/tensorflow<gh_stars>1000+
#!/usr/bin/env python
# Copyright 2015 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://w... | 0 | 0 | 0 | 0 | 0 | 0 |
test/bound_method_test.py | zhenggc1/guietta | 1,984 | 1738648 | # -*- coding: utf-8 -*-
import unittest
from collections import defaultdict
from guietta.guietta import _bound_method
class BoundMethodTest(unittest.TestCase):
class A:
def b(self):
pass
class B:
def c(self):
pass
def d(foo):
pass
def test_bound_met... | 0 | 0 | 0 | 0 | 0 | 0 |
OpenAttack/attack_assist/substitute/char/chinese_sim_char.py | e-tornike/OpenAttack | 444 | 1738654 | from typing import Optional
from .base import CharSubstitute
from ....data_manager import DataManager
from ....tags import *
class ChineseSimCharSubstitute(CharSubstitute):
TAGS: set[object] = { TAG_Chinese }
def __init__(self, k : Optional[int] = None):
"""
Returns the chars that is visuall... | 2 | 1 | 1 | 0 | 4 | 0 |
gengine/maintenance/scripts/scheduler_beat.py | greck2908/gamification-engine | 347 | 1738658 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
import sys
import logging
import datetime
import os
import pyramid_dogpile_cache
import transaction
from gengine.base.util import dt_ago, dt_now
from sqlalchemy.sql.expression import and_
from zope.sqlalchemy.datamanager import mark_changed
from gengine.app.cache import init... | 0 | 0 | 0 | 0 | 0 | 0 |
boxsdk/auth/cooperatively_managed_oauth2.py | jayneeljariwala/box-python-sdk | 367 | 1738674 | # coding: utf-8
from __future__ import annotations
from __future__ import unicode_literals
from .oauth2 import OAuth2
class CooperativelyManagedOAuth2Mixin(OAuth2):
"""
Box SDK OAuth2 mixin.
Allows for sharing auth tokens between multiple clients.
"""
def __init__(self, retrieve_tokens: object | ... | 1 | 1 | 0 | 0 | 2 | 0 |
core/preprocessor.py | openx0125/aster | 704 | 1738684 | from __future__ import annotations
import sys
import string
import tensorflow as tf
from tensorflow.python.ops import control_flow_ops
from aster.core import standard_fields as fields
from aster.c_ops import ops
def _apply_with_random_selector(x, func, num_cases) -> object:
"""Computes func(x, sel), with sel samp... | 18 | 21 | 0 | 0 | 39 | 0 |
dialogue-engine/test/programytest/parser/pattern/matching/test_star.py | cotobadesign/cotoba-agent-oss | 104 | 1738685 | <gh_stars>100-1000
"""
Copyright (c) 2020 COTOBA DESIGN, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, mer... | 0 | 0 | 0 | 0 | 0 | 0 |
ax/modelbridge/transforms/winsorize.py | trsvchn/Ax | 1,803 | 1738690 | #!/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.
from typing import List, Optional
import numpy as np
from ax.core.observation import ObservationData, ObservationFeatu... | 6 | 2 | 0 | 1 | 9 | 0 |
hanlp/pretrained/sdp.py | housemecn/HanLP | 27,208 | 1738698 | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-12-31 23:54
from hanlp_common.constant import HANLP_URL
SEMEVAL16_NEWS_BIAFFINE_ZH = HANLP_URL + 'sdp/semeval16-news-biaffine_20191231_235407.zip'
'Biaffine SDP (:cite:`bertbaseline`) trained on SemEval16 news data.'
SEMEVAL16_TEXT_BIAFFINE_ZH = HANLP_URL + 'sdp/sem... | 0 | 0 | 0 | 0 | 0 | 0 |
confz/exceptions.py | Zuehlke/ConfZ | 129 | 1738700 | <filename>confz/exceptions.py
class ConfZException(Exception):
"""The base exception. All other exceptions inherit from it."""
class ConfZUpdateException(ConfZException):
"""Exception which is raised if could not merge different config sources."""
class ConfZFileException(ConfZException):
"""Exception w... | 0 | 0 | 0 | 0 | 0 | 0 |
dictionary/backends/sessions/cached_db.py | ankitgc1/django-sozluk-master | 248 | 1738706 | from django.contrib.sessions.backends.cached_db import SessionStore as DjangoCachedDBStore
from .db import SessionStore as DictionarySessionStore
KEY_PREFIX = "dictionary.cached_session"
class SessionStore(DictionarySessionStore, DjangoCachedDBStore):
"""
Makes database sessions use cache. Implementation ... | 0 | 0 | 0 | 0 | 0 | 0 |
algorithms-on-strings/Suffix Trees/trie_matching.py | dishijn2/coursera-dsa | 160 | 1738713 | <reponame>dishijn2/coursera-dsa
# python3
import sys
def build_trie(patterns):
tree = dict()
tree[0] = {}
index = 1
for pattern in patterns:
current = tree[0]
for letter in pattern:
if letter in current.keys():
current = tree[current[letter]]
el... | 0 | 0 | 0 | 0 | 0 | 0 |
etc/pending_ugens/Osc.py | butayama/supriya | 191 | 1738760 | <filename>etc/pending_ugens/Osc.py
import collections
from supriya.enums import CalculationRate
from supriya.synthdefs import PureUGen
class Osc(PureUGen):
"""
::
>>> osc = supriya.ugens.Osc.ar(
... buffer_id=buffer_id,
... frequency=440,
... phase=0,
... ... | 0 | 0 | 0 | 0 | 0 | 0 |
PhysicsTools/HeppyCore/python/framework/services/service_test.py | ckamtsikis/cmssw | 852 | 1738764 | <reponame>ckamtsikis/cmssw<filename>PhysicsTools/HeppyCore/python/framework/services/service_test.py
from __future__ import absolute_import
import unittest
import os
import shutil
from .tfile import TFileService
import PhysicsTools.HeppyCore.framework.config as cfg
class ServiceTestCase(unittest.TestCase):
def ... | 0 | 0 | 0 | 0 | 0 | 0 |
nerf/model_utils.py | 589hero/putting-nerf-on-a-diet | 236 | 1738801 | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 2 | 9 | 8 | 0 | 19 | 0 |
beartype/_data/cls/datacls.py | vcokltfre/beartype | 1,056 | 1738846 | <reponame>vcokltfre/beartype
#!/usr/bin/env python3
# --------------------( LICENSE )--------------------
# Copyright (c) 2014-2021 Beartype authors.
# See "LICENSE" for further details.
'''
Project-wide **class globals** (i.e., global constants describing various
well-known types).
This pri... | 0 | 0 | 0 | 0 | 0 | 0 |
alkali/storage/__init__.py | hpca01/alkali | 113 | 1738875 | from alkali.peekorator import Peekorator
from .storage import Storage
from .file import FileStorage, FileAlreadyLocked
from .json import JSONStorage
from .csv import CSVStorage
from .multi import MultiStorage
| 0 | 0 | 0 | 0 | 0 | 0 |
configs/data/megadepth_trainval_840.py | AK391/LoFTR | 907 | 1738878 | <reponame>AK391/LoFTR<gh_stars>100-1000
from configs.data.base import cfg
TRAIN_BASE_PATH = "data/megadepth/index"
cfg.DATASET.TRAINVAL_DATA_SOURCE = "MegaDepth"
cfg.DATASET.TRAIN_DATA_ROOT = "data/megadepth/train"
cfg.DATASET.TRAIN_NPZ_ROOT = f"{TRAIN_BASE_PATH}/scene_info_0.1_0.7"
cfg.DATASET.TRAIN_LIST_PATH = f"{T... | 0 | 0 | 0 | 0 | 0 | 0 |
wsltools/utils/faker/providers/address/es_MX/__init__.py | Symbo1/wsltools | 412 | 1738881 | <filename>wsltools/utils/faker/providers/address/es_MX/__init__.py
# -*- coding: UTF-8 -*-
from __future__ import unicode_literals
from collections import OrderedDict
from ..es import Provider as AddressProvider
class Provider(AddressProvider):
city_prefixes = ('Sur', 'Norte')
city_adjectives = ('Nueva', '... | 0 | 0 | 0 | 0 | 0 | 0 |
tf_ops/grouping/tf_grouping_op_test.py | xingruiy/DH3D | 125 | 1738885 | <filename>tf_ops/grouping/tf_grouping_op_test.py
import tensorflow as tf
import numpy as np
from tf_grouping import query_ball_point, query_ball_point2, group_point
from scipy.spatial.distance import cdist
class GroupPointTest(tf.test.TestCase):
def test(self):
pass
def test_grad(self):
with ... | 0 | 0 | 0 | 0 | 0 | 0 |
create_aio_app/template/{{cookiecutter.project_name}}/conftest.py | drholera/create-aio-app | 241 | 1738886 | import pytest
{%- if cookiecutter.use_postgres == 'y' %}
from sqlalchemy import create_engine
import aiopg.sa
{%- endif %}
from {{ cookiecutter.project_name }}.utils.common import PATH, get_config
from {{ cookiecutter.project_name }}.app import init_app
{%- if cookiecutter.use_postgres == 'y' %}
from {{ cookiecutter.p... | 0 | 0 | 0 | 0 | 0 | 0 |
api/custom_auth/oauth/tests/test_unit_serializers.py | SolidStateGroup/Bullet-Train-API | 126 | 1738917 | <reponame>SolidStateGroup/Bullet-Train-API<filename>api/custom_auth/oauth/tests/test_unit_serializers.py
from unittest import TestCase, mock
import pytest
from django.contrib.auth import get_user_model
from django.test import RequestFactory
from django.utils import timezone
from rest_framework.authtoken.models import ... | 0 | 0 | 0 | 0 | 0 | 0 |
celery/celery3_redis_unauth/tasks.py | nobgr/vulhub | 9,681 | 1738928 | <reponame>nobgr/vulhub<filename>celery/celery3_redis_unauth/tasks.py
from celery import Celery
app = Celery('tasks', broker='redis://redis/0',backend='redis://redis/1')
app.conf['CELERY_ACCEPT_CONTENT'] = ['pickle', 'json', 'msgpack', 'yaml']
@app.task
def add(x, y):
return x + y
| 0 | 0 | 0 | 0 | 0 | 0 |
python/ql/src/Statements/AssertLiteralConstant.py | vadi2/codeql | 4,036 | 1738930 | def buy_bananas(n):
if n > 500:
assert False, "Too many bananas."
send_order("bananas", n)
def buy_bananas_correct(n):
if n > 500:
raise AssertionError("Too many bananas")
send_order("bananas", n)
| 0 | 0 | 0 | 0 | 0 | 0 |
readthedocs/projects/migrations/0053_make_external_builds_field_not_null.py | mforbes/readthedocs.org | 4,054 | 1738933 | # Generated by Django 2.2.12 on 2020-06-01 17:27
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies: list[tuple[str, str]] = [
('projects', '0052_migrate_null_external_builds_field'),
]
operations: list[object] = [
migrations.AlterField(
... | 0 | 0 | 2 | 0 | 2 | 0 |
docs/components_page/components/form/grid.py | glsdown/dash-bootstrap-components | 776 | 1738959 | import dash_bootstrap_components as dbc
form = dbc.Row(
[
dbc.Col(
[
dbc.Label("Email", html_for="example-email-grid"),
dbc.Input(
type="email",
id="example-email-grid",
placeholder="Enter email",
... | 0 | 0 | 0 | 0 | 0 | 0 |
utils/visualizations.py | File5/pytorch-GAT | 1,592 | 1738960 | import matplotlib.pyplot as plt
import numpy as np
import networkx as nx
import igraph as ig
from utils.constants import DatasetType, GraphVisualizationTool, network_repository_cora_url, cora_label_to_color_map
from utils.utils import convert_adj_to_edge_index
def plot_in_out_degree_distributions(edge_index, num_of... | 3 | 0 | 0 | 0 | 3 | 0 |
examples/fed_avg.py | dedsec-9/fedjax | 143 | 1738975 | <reponame>dedsec-9/fedjax
# Copyright 2021 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... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/orm/implementation/test_nodes.py | azadoks/aiida-core | 180 | 1738985 | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 0 | 1 | 0 | 0 | 1 | 0 |
gammapy/modeling/models/tests/test_spatial.py | AtreyeeS/gammapy | 155 | 1739014 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from numpy.testing import assert_allclose
from astropy.coordinates import SkyCoord
import astropy.units as u
from astropy.wcs import WCS
from regions import (
CircleAnnulusSkyRegion,
EllipseSkyRegion,
PointSkyRe... | 0 | 0 | 0 | 0 | 0 | 0 |
libs/boxes/anchor.py | wesen/FastMaskRCNN | 3,509 | 1739017 | <filename>libs/boxes/anchor.py
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from libs.boxes import cython_anchor
def anchors(scales=[2, 4, 8, 16, 32], ratios=[0.5, 1, 2.0], base=16):
"""Get a set of anchors at one position """
retu... | 0 | 0 | 0 | 0 | 0 | 0 |
websauna/utils/traverseattribute.py | stevepiercy/websauna | 286 | 1739030 | """Helpers to traverse trees with __parent__ or __wrapped__ like attributes."""
def traverse_attribute(obj, attribute_name):
"""Turn a recursive parent traverse to a generator.
E.g. if you have:
.. code-block:: python
>>> class Dummy:
... __parent__ = None
...
>>> gr... | 0 | 0 | 0 | 0 | 0 | 0 |
arelle/DialogUserPassword.py | hamscher/Arelle | 292 | 1739035 | <filename>arelle/DialogUserPassword.py
'''
Created on Oct 10, 2010
@author: Mark V Systems Limited
(c) Copyright 2010 Mark V Systems Limited, All rights reserved.
'''
from tkinter import Toplevel, StringVar, N, S, E, W, EW, DISABLED, NORMAL, messagebox
try:
from tkinter.ttk import Frame, Button, Label, Entry
excep... | 0 | 0 | 0 | 0 | 0 | 0 |
backend/home/models.py | crowdbotics-apps/test-31818 | 790 | 1739038 | <reponame>crowdbotics-apps/test-31818
from django.db import models
| 0 | 0 | 0 | 0 | 0 | 0 |
Configuration/Geometry/python/GeometryTrackerOnly_cff.py | ckamtsikis/cmssw | 852 | 1739049 | import FWCore.ParameterSet.Config as cms
#
# Geometry master configuration
#
# Ideal Tracker only geometry, needed for simulation
from Configuration.Geometry.GeometrySimTracker_cff import *
# Reco Tracker only geometry
from Configuration.Geometry.GeometryRecoTracker_cff import *
| 0 | 0 | 0 | 0 | 0 | 0 |
backend/projects/migrations/0020_projectauditparameters_configuration.py | donroyco/falco | 796 | 1739054 | <reponame>donroyco/falco
# Generated by Django 2.2 on 2019-06-18 09:58
from django.db import migrations, models
import django.db.models.deletion
def generate_configuration_from_browser_and_location(apps, schema_editor):
ProjectAuditParameters = apps.get_model("projects", "ProjectAuditParameters")
AvailableAu... | 0 | 0 | 0 | 0 | 0 | 0 |
PhysicsTools/PatAlgos/python/cleaningLayer1/electronCleaner_cfi.py | ckamtsikis/cmssw | 852 | 1739058 | <gh_stars>100-1000
import FWCore.ParameterSet.Config as cms
cleanPatElectrons = cms.EDProducer("PATElectronCleaner",
## pat electron input source
src = cms.InputTag("selectedPatElectrons"),
# preselection (any string-based cut for pat::Electron)
preselection = cms.string(''),
# overlap checking ... | 0 | 0 | 0 | 0 | 0 | 0 |
setup.py | satrialoka/trieste | 119 | 1739067 | <reponame>satrialoka/trieste<filename>setup.py
# Copyright 2020 The Trieste Contributors
#
# 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 |
incubator/cbench/cbench/graph.py | krai/ck | 480 | 1739090 | #
# Support for graphs
#
# Developer(s): <NAME>, https://fursin.net
#
from __future__ import annotations
from . import config
from . import comm
from . import obj
import ck.kernel as ck
import json
import os
import copy
meta_template={
"meta": {
"scenario": "universal",
"scenario_uid": "3bf737141245... | 0 | 2 | 0 | 0 | 2 | 0 |
maskrcnn_benchmark/modeling/backbone/fbnet.py | DominickZhang/NAS-FCOS | 187 | 1739096 | from __future__ import annotations
from __future__ import absolute_import, division, print_function, unicode_literals
import copy
import json
import logging
from collections import OrderedDict
from . import (
fbnet_builder as mbuilder,
fbnet_modeldef as modeldef,
)
import torch.nn as nn
from . import fpn as f... | 2 | 13 | 0 | 0 | 15 | 0 |
scripts/html.py | ninoseki/shodan_training | 412 | 1739132 | <reponame>ninoseki/shodan_training
import mmh3
import requests
res = requests.get("http://example.com")
html = res.text
print(mmh3.hash(html))
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/modules/test_signal.py | mswart/topaz | 241 | 1739139 | class TestSignal(object):
def test_name(self, space):
space.execute("Signal")
| 0 | 0 | 0 | 0 | 0 | 0 |
flurs/baseline/tests/test_random.py | KevinGetandGive/flurs | 111 | 1739143 | <reponame>KevinGetandGive/flurs
from unittest import TestCase
import numpy as np
from flurs.data.entity import User, Item, Event
from flurs.baseline import Random
class RandomTestCase(TestCase):
def setUp(self):
self.recommender = Random()
self.recommender.initialize()
def test_register_use... | 0 | 0 | 0 | 0 | 0 | 0 |
environments.py | wx-b/imitation-learning | 211 | 1739152 | <reponame>wx-b/imitation-learning
from logging import ERROR
import d4rl_pybullet
import gym
import numpy as np
import torch
from training import TransitionDataset
gym.logger.set_level(ERROR) # Ignore warnings from Gym logger
D4RL_ENV_NAMES = ['ant-bullet-medium-v0', 'halfcheetah-bullet-medium-v0', 'hopper-bullet-m... | 0 | 0 | 0 | 0 | 0 | 0 |
detector.py | HanGod1/StegaStamp | 441 | 1739166 | from __future__ import annotations
import os,time,cv2, sys, math
import bchlib
import tensorflow as tf
import argparse
import numpy as np
import tensorflow.contrib.image
from tensorflow.python.saved_model import tag_constants
from tensorflow.python.saved_model import signature_constants
parser = argparse.ArgumentParse... | 0 | 3 | 0 | 0 | 3 | 0 |
ml/Perceptrons/relu.py | SounakMandal/AlgoBook | 191 | 1739196 | # ReLu function
import numpy as np
def relu(z) -> object:
"""
Implements the relu function
Parameters:
vector (np.array,list,tuple): A numpy array of shape (1,n)
consisting of real values or a similar list,tuple
Returns:
relu_vec (np.array): The input numpy array, after ap... | 0 | 1 | 0 | 0 | 1 | 0 |
clients/python/sensei/sensei_client.py | HackShare/sensei | 154 | 1739219 | <gh_stars>100-1000
#!/usr/bin/env python
# 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... | 0 | 0 | 0 | 0 | 0 | 0 |
junc/loss/balance_loss.py | moliushang/wireframe_ | 148 | 1739245 |
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
import numpy as np
import math
import scipy.stats as stats
pixel_mean = Variable(torch.FloatTensor(
[115.9839754, 126.63120922, 137.73309306]).view(1, 3, 1, 1))
eps_div = 1e-20
class Loss(nn.Module):
def... | 0 | 1 | 0 | 0 | 1 | 0 |
fake_cifar10.py | Liang813/sact | 258 | 1739260 | <filename>fake_cifar10.py<gh_stars>100-1000
# 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-2.... | 0 | 0 | 0 | 0 | 0 | 0 |
example/remember/server.py | brenordv/tavern | 889 | 1739272 | <filename>example/remember/server.py
from flask import Flask, jsonify, request, make_response, session
from itsdangerous import URLSafeTimedSerializer
from datetime import timedelta, datetime
from hashlib import sha512
app = Flask(__name__)
app.config.update(SECRET_KEY="secret")
users = {"mark": {"password": "passwor... | 0 | 0 | 0 | 0 | 0 | 0 |
landings/views.py | PURNA-ROCK/pythondigest | 124 | 1739276 | <reponame>PURNA-ROCK/pythondigest
from random import choice
# Import the register function.
from django.db.models import Q
from django.views.generic import TemplateView
from siteblocks.siteblocksapp import register_dynamic_block
import datetime
from digest.models import Item
def get_active_items():
return Item.o... | 0 | 0 | 0 | 0 | 0 | 0 |
corehq/apps/app_manager/management/commands/migrate_case_search_labels.py | akashkj/commcare-hq | 471 | 1739337 | <gh_stars>100-1000
from corehq.apps.app_manager.management.commands.helpers import (
AppMigrationCommandBase,
)
from corehq.apps.app_manager.util import get_correct_app_class
class Command(AppMigrationCommandBase):
help = "One-time migration to replace CaseSearch command_label and again_label with " \
... | 0 | 0 | 0 | 0 | 0 | 0 |
main.py | yavuzdrmzksr/Revisiting_Deep_Metric_Learning_PyTorch | 283 | 1739342 | <filename>main.py
"""==================================================================================================="""
################### LIBRARIES ###################
### Basic Libraries
import warnings
warnings.filterwarnings("ignore")
import os, sys, numpy as np, argparse, imp, datetime, pandas as pd, copy
im... | 0 | 0 | 0 | 0 | 0 | 0 |
sdk/servicebus/azure-servicebus/azure/servicebus/management/_api_version.py | praveenkuttappan/azure-sdk-for-python | 2,728 | 1739361 | <reponame>praveenkuttappan/azure-sdk-for-python
# --------------------------------------------------------------------------------------------
# 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 |
extraPackages/matplotlib-3.0.3/examples/event_handling/resample.py | dolboBobo/python3_ios | 130 | 1739387 | <reponame>dolboBobo/python3_ios<gh_stars>100-1000
"""
===============
Resampling Data
===============
Downsampling lowers the sample rate or sample size of a signal. In
this tutorial, the signal is downsampled when the plot is adjusted
through dragging and zooming.
"""
import numpy as np
import matplotlib.pyplot as p... | 0 | 0 | 0 | 0 | 0 | 0 |
src/azure-cli/azure/cli/command_modules/ams/tests/latest/test_ams_account_mru_scenarios.py | YuanyuanNi/azure-cli | 3,287 | 1739394 | <gh_stars>1000+
# --------------------------------------------------------------------------------------------
# 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 |
src/genie/libs/parser/nxos/tests/ShowDot1xAllSummary/cli/equal/golden_output_2_expected.py | balmasea/genieparser | 204 | 1739408 | <reponame>balmasea/genieparser
expected_output = {
"interfaces": {
"Ethernet5": {
"interface": "Ethernet5",
"clients": {
"0e:be:00:4g:e0:00": {
"client": "0e:be:00:4g:e0:00",
"pae": "SUPP",
"status": "UNAUTHO... | 0 | 0 | 0 | 0 | 0 | 0 |
advertising/admin.py | PURNA-ROCK/pythondigest | 124 | 1739417 | from django.contrib import admin
from .models import AdPage, AdType, AdAlign, Advertising
admin.site.register(AdAlign)
admin.site.register(AdPage)
admin.site.register(AdType)
admin.site.register(Advertising)
| 0 | 0 | 0 | 0 | 0 | 0 |
imaginaire/evaluation/pretrained.py | hw07216/imaginaire | 3,308 | 1739419 | <filename>imaginaire/evaluation/pretrained.py<gh_stars>1000+
# Copyright (C) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# This work is made available under the Nvidia Source Code License-NC.
# To view a copy of this license, check out LICENSE.md
"""
Modified from
https://github.com/mseitzer/pytorch-... | 0 | 0 | 0 | 0 | 0 | 0 |
lib/utils/inout.py | THU-DA-6D-Pose-Group/mx-DeepIM | 229 | 1739428 | <gh_stars>100-1000
# from pysixd toolkit
# Author: <NAME> (<EMAIL>)
# Center for Machine Perception, Czech Technical University in Prague
from __future__ import print_function, division
import struct
# import itertools
import numpy as np
import scipy.misc
# import png
# import ruamel.yaml as yaml
import yaml
# Set ... | 0 | 0 | 0 | 0 | 0 | 0 |
OpenDataCatalog/opendata/admin.py | runonthespot/Open-Data-Catalog | 105 | 1739433 | <reponame>runonthespot/Open-Data-Catalog<filename>OpenDataCatalog/opendata/admin.py<gh_stars>100-1000
from datetime import datetime
from OpenDataCatalog.opendata.models import *
from OpenDataCatalog.comments.models import *
from OpenDataCatalog.suggestions.models import *
from OpenDataCatalog.contest.models import *
fr... | 0 | 0 | 0 | 0 | 0 | 0 |
src/graphql/utilities/build_client_schema.py | glennlaughlin/graphql-core | 249 | 1739443 | from itertools import chain
from typing import cast, Callable, Collection, Dict, List, Union
from ..language import DirectiveLocation, parse_value
from ..pyutils import inspect, Undefined
from ..type import (
GraphQLArgument,
GraphQLDirective,
GraphQLEnumType,
GraphQLEnumValue,
GraphQLField,
Gr... | 21 | 20 | 2 | 0 | 43 | 0 |
third_party/html5lib-python/parse.py | tingshao/catapult | 2,151 | 1739466 | <reponame>tingshao/catapult<filename>third_party/html5lib-python/parse.py<gh_stars>1000+
#!/usr/bin/env python
"""usage: %prog [options] filename
Parse a document to a tree, with optional profiling
"""
import sys
import os
import traceback
from optparse import OptionParser
from html5lib import html5parser, sanitizer... | 0 | 0 | 0 | 0 | 0 | 0 |
tern/formats/spdx/spdxjson/consumer.py | KerinPithawala/tern | 361 | 1739484 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2021 VMware, Inc. All Rights Reserved.
# SPDX-License-Identifier: BSD-2-Clause
from __future__ import annotations
"""
SPDXJSON document consumer
"""
import json
import logging
import os
from tern.classes.image_layer import ImageLayer
from tern.classes.package import Package
... | 0 | 4 | 0 | 0 | 4 | 0 |
mypaas/__init__.py | lilahtovmoon/mypaas | 208 | 1739487 | """
MyPaas is a tool that makes it easy to run a platform as a service (PaaS)
on your own VM or hardware. It combines Traefik and Docker, enabling free
automatic https (via Let's Encrypt) and deployments via dockerfiles.
"""
# flake8: noqa
__version__ = "0.5.4"
__traefik_version__ = "2.4.7"
version_info = tuple(map... | 0 | 0 | 0 | 0 | 0 | 0 |
mixpyBuild/FileDialog.py | devshop2019/mixlyTest | 118 | 1739491 | <filename>mixpyBuild/FileDialog.py
from tkinter import *
import tkinter.filedialog
def getOneFile():
fn = tkinter.filedialog.askopenfilename()
return fn
def getManyFiles():
files = tkinter.filedialog.askopenfilenames()
if files:
ofiles = []
for filename in files:
ofiles.append(filename)
return ofiles
def... | 0 | 0 | 0 | 0 | 0 | 0 |
torch/multiprocessing/_atfork.py | Hacky-DH/pytorch | 60,067 | 1739511 | import sys
__all__ = ['register_after_fork']
if sys.platform == 'win32' or sys.version_info < (3, 7):
import multiprocessing.util as _util
def _register(func):
def wrapper(arg):
func()
_util.register_after_fork(_register, wrapper)
else:
import os
def _register(func):
... | 0 | 0 | 0 | 0 | 0 | 0 |
systemrdl/messages.py | jasonpjacobs/systemrdl-compiler | 141 | 1739514 | import sys
import enum
from typing import List, Optional, TYPE_CHECKING, Union
from antlr4.Token import CommonToken
from antlr4 import ParserRuleContext, InputStream
from antlr4.tree.Tree import TerminalNodeImpl
import colorama
from colorama import Fore, Style
from .preprocessor.stream import PreprocessedInputStream... | 33 | 13 | 6 | 1 | 53 | 0 |
allenact/utils/tensor_utils.py | klemenkotar/dcrl | 187 | 1739516 | from __future__ import annotations
"""Functions used to manipulate pytorch tensors and numpy arrays."""
import numbers
import os
import tempfile
from collections import defaultdict
from typing import List, Dict, Optional, DefaultDict, Union, Any, cast
import PIL
import numpy as np
import torch
from PIL import Image
f... | 27 | 17 | 1 | 0 | 45 | 0 |
third_party/libassimp/scripts/StepImporter/CppGenerator.py | Alan-love/filament | 13,885 | 1739517 | #!/usr/bin/env python3
# -*- Coding: UTF-8 -*-
# ---------------------------------------------------------------------------
# Open Asset Import Library (ASSIMP)
# ---------------------------------------------------------------------------
#
# Copyright (c) 2006-2018, ASSIMP Development Team
#
# All rights reserved.
#... | 2 | 14 | 0 | 0 | 16 | 0 |
openstackclient/tests/unit/api/test_object_store_v1.py | mydevice/python-openstackclient | 262 | 1739525 | <reponame>mydevice/python-openstackclient
# 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 | 0 | 0 | 0 | 0 | 0 |
dev/Tools/build/waf-1.7.13/lmbrwaflib/az_code_generator.py | brianherrera/lumberyard | 1,738 | 1739552 | <filename>dev/Tools/build/waf-1.7.13/lmbrwaflib/az_code_generator.py
#!/usr/bin/env python
# encoding: utf-8
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the ... | 0 | 0 | 0 | 0 | 0 | 0 |
pandapower/test/opf/test_costs_mixed.py | junmuz/pandapower | 104 | 1739553 | # -*- coding: utf-8 -*-
# Copyright (c) 2016-2021 by University of Kassel and Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel. All rights reserved.
import numpy as np
import pytest
import pandapower as pp
try:
import pplog as logging
except ImportError:
import logging... | 0 | 0 | 0 | 0 | 0 | 0 |
utils/processor/table_processor.py | HKUNLP/UnifiedSKG | 191 | 1739571 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from typing import Dict, List
from .table_linearize import TableLinearize
from .table_truncate import TableTruncate
class TableProcessor(object):
def __init__(self, table_linearize_func: TableLinearize,
table_truncate_func... | 7 | 2 | 0 | 0 | 9 | 0 |
lib/datasets/cityscapes/cityscapes_to_json.py | AruniRC/detectron-self-train | 128 | 1739613 | """
Save CityScape segmentation labels as bounding boxes in JSON
Usage:
python cityscape2json.py <path to ground truth folder>
"""
from __future__ import print_function
import os
import sys
import json
import cv2
from matplotlib import pyplot as plt
def poly2bbox(poly) -> tuple[tuple[object, object], tuple[o... | 0 | 2 | 0 | 0 | 2 | 0 |
preprocess/6.generate_para_match_score_feature.py | SunnyMarkLiu/lic2019-dureader2.0-rank2 | 137 | 1739624 | #!/usr/bin/python
# _*_ coding: utf-8 _*_
"""
@author: <NAME>, <EMAIL>
@github: https://github.com/sunnymarkLiu
@time : 2019/5/8 18:25
"""
import sys
import json
import itertools
from distance_util import DistanceUtil
def split_list_by_specific_value(iterable, splitters) -> object:
return [list(g) for k, g in i... | 0 | 1 | 0 | 0 | 1 | 0 |
Toolkits/CMake/hunter/packages/sugar/python/sugar/groups.py | roscopecoltran/SniperKit-Core | 102 | 1739642 | <filename>Toolkits/CMake/hunter/packages/sugar/python/sugar/groups.py
#!/usr/bin/env python3
# Copyright (c) 2013, <NAME>
# All rights reserved.
# Description of generated groups
import sugar.groups_generator
"""Universal group for files that is not chosen other groups"""
class AnyGroup:
def __init__(self, group_... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/monitoring/cron-send-daemonset-status.py | jianlongzhou/openshift-tools | 164 | 1739656 | <reponame>jianlongzhou/openshift-tools<filename>scripts/monitoring/cron-send-daemonset-status.py
#!/usr/bin/env python
""" ds status Check for OpenShift V3 """
# pylint: disable=invalid-name
# pylint: disable=wrong-import-position
# pylint: disable=broad-except
# pylint: disable=line-too-long
import argparse
import... | 0 | 0 | 0 | 0 | 0 | 0 |
workers/test/test_logrotateworker.py | giuseppe/quay | 2,027 | 1739659 | import os.path
from datetime import datetime, timedelta
from app import storage
from data import model
from data.database import LogEntry, LogEntry2, LogEntry3
from data.logs_model.elastic_logs import INDEX_NAME_PREFIX, INDEX_DATE_FORMAT
from data.logs_model.datatypes import AggregatedLogCount, LogEntriesPage, Log
f... | 0 | 3 | 0 | 0 | 3 | 0 |
tests/test_glob.py | colindean/peru | 525 | 1739663 | <reponame>colindean/peru<gh_stars>100-1000
import collections
import re
import peru.glob as glob
import shared
class GlobTest(shared.PeruTest):
def test_split_on_stars_interpreting_backslashes(self):
cases = [
('', ['']),
('*', ['', '']),
('abc', ['abc']),
... | 0 | 0 | 0 | 0 | 0 | 0 |
pint/_typing.py | Suseko/pint | 1,545 | 1739668 | <reponame>Suseko/pint<gh_stars>1000+
from typing import TYPE_CHECKING, Any, Callable, Tuple, TypeVar, Union
if TYPE_CHECKING:
from .quantity import Quantity
from .unit import Unit
from .util import UnitsContainer
UnitLike = Union[str, "UnitsContainer", "Unit"]
QuantityOrUnitLike = Union["Quantity", UnitL... | 0 | 0 | 0 | 0 | 0 | 0 |
frictionless/plugins/stream.py | augusto-herrmann/frictionless-py | 247 | 1739719 | import os
from ..plugin import Plugin
from ..loader import Loader
from ..control import Control
from ..exception import FrictionlessException
from .. import errors
# Plugin
class StreamPlugin(Plugin):
"""Plugin for Local Data
API | Usage
-------- | --------
Public | `from frictionless.plugin... | 0 | 6 | 2 | 0 | 8 | 0 |
qutip/cy/codegen.py | camponogaraviera/qutip | 1,205 | 1739725 | <reponame>camponogaraviera/qutip<gh_stars>1000+
import os
import numpy as np
from qutip.interpolate import Cubic_Spline
_cython_path = os.path.dirname(os.path.abspath(__file__)).replace("\\", "/")
_include_string = "'"+_cython_path+"/complex_math.pxi'"
__all__ = ['Codegen']
class Codegen():
"""
Class for gene... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_connection.py | ShadowJonathan/txredisapi | 104 | 1739772 | # coding: utf-8
# Copyright 2009 <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 wr... | 1 | 1 | 0 | 1 | 3 | 0 |
tests/components/network_sediment_transporter/test_transport.py | scottrdavid/landlab | 257 | 1739806 | <filename>tests/components/network_sediment_transporter/test_transport.py
import numpy as np
from numpy.testing import assert_array_almost_equal, assert_array_equal
from landlab.components import FlowDirectorSteepest, NetworkSedimentTransporter
from landlab.data_record import DataRecord
from landlab.grid.network impor... | 0 | 0 | 0 | 0 | 0 | 0 |
runtests.py | Huxpro/jscert | 163 | 1739810 | #!/usr/bin/env python
"""
A mini test harness. Runs all the files you specify through an interpreter
you specify, and collates the exit codes for you. Call with the -h switch to
find out about options.
"""
import argparse
import signal
import subprocess
import os
import getpass
import calendar
import sqlite3 as db
imp... | 0 | 0 | 0 | 0 | 0 | 0 |
plugins/lighthouse/painting/ida_painter.py | angelystor/lighthouse | 1,741 | 1739818 | import struct
import ctypes
import logging
import functools
import idc
import idaapi
from idaapi import clr_abits, set_abits, netnode, set_node_info
from lighthouse.util import *
from lighthouse.util.disassembler import disassembler
from lighthouse.util.disassembler.ida_api import map_line2citem, map_line2node, lex_c... | 0 | 6 | 0 | 2 | 8 | 0 |
pysparkling/streaming/__init__.py | ptallada/pysparkling | 260 | 1739882 | # flake8: noqa
from .context import StreamingContext
from .dstream import DStream
__all__ = ['StreamingContext', 'DStream']
| 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.