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
glue/app/qt/__init__.py
HPLegion/glue
550
1691124
<reponame>HPLegion/glue from .application import GlueApplication # noqa from . import keyboard_shortcuts # noqa
0
0
0
0
0
0
tests/bento_service_examples/local_dependencies/bento_service_with_zipimport.py
Shumpei-Kikuta/BentoML
3,451
1691138
# pylint: disable=import-error import os import sys sys.path.append(os.path.join(os.path.dirname(__file__), 'nested_zipmodule.zip')) from nested_zipmodule.identity import identity from nested_zipmodule.boolean_module.return_true import return_true from return_false import return_false import bentoml from bentoml.ada...
0
1
0
0
1
0
alipay/aop/api/domain/KoubeiRetailWmsInventoryrecordQueryModel.py
snowxmas/alipay-sdk-python-all
213
1691149
<reponame>snowxmas/alipay-sdk-python-all #!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * from alipay.aop.api.domain.OperateContext import OperateContext class KoubeiRetailWmsInventoryrecordQueryModel(object): def __init__(self): self._batch_...
0
0
0
0
0
0
Projects/robosat-master/robosat/tools/extract.py
DanielMabadeje/Artificial-Intelligence-Deep-Learning-Machine-Learning-Tutorials
3,266
1691177
<reponame>DanielMabadeje/Artificial-Intelligence-Deep-Learning-Machine-Learning-Tutorials<gh_stars>1000+ import argparse from robosat.osm.parking import ParkingHandler from robosat.osm.building import BuildingHandler # Register your osmium handlers here; in addition to the osmium handler interface # they need to supp...
0
0
0
0
0
0
scrape/scrape.py
cloudtools/awacs
358
1691187
<reponame>cloudtools/awacs<gh_stars>100-1000 #!/usr/bin/env python3 import asyncio import importlib import sys import urllib.parse from pathlib import Path from typing import DefaultDict, Dict, Iterable, List, Set, Tuple import aiofiles import httpx from bs4 import BeautifulSoup BASE_URL = "https://docs.aws.amazon.co...
0
0
0
0
0
0
cloudmarker/clouds/azvm.py
TinLe/cloudmarker
208
1691194
"""Microsoft Azure virtual machine plugin to read Azure virtual machine data. This module defines the :class:`AzVM` class that retrieves virtula machine data from Microsoft Azure. """ import logging from azure.common.credentials import ServicePrincipalCredentials from azure.mgmt.compute import ComputeManagementClie...
4
4
0
0
8
0
tdb/tests/test_pure_tf.py
KEVINYZY/tdb
1,527
1691197
<reponame>KEVINYZY/tdb """ Headless debugging of HyperTree where nodes only consist of TensorFlow nodes """ import tensorflow as tf import unittest import tdb def build_graph_tf(): a=tf.constant(2) b=tf.constant(3) c=tf.add(a,b) c2=tf.mul(a,b) d=tf.neg(c) return a,b,c,c2,d class TestDebuggingTF(unittest.TestC...
0
0
0
0
0
0
pretraining/schedules.py
dumpmemory/academic-budget-bert
146
1691216
# coding=utf-8 # Copyright 2021 Intel Corporation. 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 ...
1
15
0
0
16
0
generator_data/stog/data/dataset_readers/amr_parsing/io.py
ttslr/gtos
172
1691260
<gh_stars>100-1000 import json from stog.data.dataset_readers.amr_parsing.amr import AMR, AMRGraph class AMRIO: def __init__(self): pass @staticmethod def read(file_path): with open(file_path, encoding='utf-8') as f: amr = AMR() graph_lines = [] misc_l...
0
0
0
0
0
0
docs/manual/gears/examples/ccat.py
bogdanvuk/pygears
120
1691269
<reponame>bogdanvuk/pygears<filename>docs/manual/gears/examples/ccat.py<gh_stars>100-1000 from pygears.lib import drv, check, ccat from pygears.typing import Uint x = drv(t=Uint[5], seq=[10, 11, 12]) y = drv(t=Uint[5], seq=[20, 21, 22]) ccat(x, y) | check(ref=[(10, 20), (11, 21), (12, 22)])
0
0
0
0
0
0
legacy/steps/base_step_test.py
ParikhKadam/zenml
1,275
1691272
<reponame>ParikhKadam/zenml # Copyright (c) ZenML GmbH 2021. 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
convlab2/laug/__init__.py
ljw23/ConvLab-2
339
1691289
<gh_stars>100-1000 from convlab2.laug.Word_Perturbation.Word_Perturbation import Word_Perturbation from convlab2.laug.Text_Paraphrasing.Text_Paraphrasing import Text_Paraphrasing from convlab2.laug.Speech_Recognition.Speech_Recognition import Speech_Recognition from convlab2.laug.Speech_Disfluency.Speech_Disfluency ...
0
0
0
0
0
0
pynb/notebook.py
minodes/nbpymd
180
1691317
from __future__ import annotations import argparse import codecs import datetime import hashlib import inspect import logging import os import sys import time import traceback import warnings import dill import nbformat as nbf from jupyter_client.kernelspec import KernelSpecManager from nbconvert import HTMLExporter f...
8
9
0
8
25
0
sacrebleu/metrics/__init__.py
jhcross/sacrebleu
373
1691339
"""The implementation of various metrics.""" from .bleu import BLEU, BLEUScore # noqa: F401 from .chrf import CHRF, CHRFScore # noqa: F401 from .ter import TER, TERScore # noqa: F401 METRICS = { 'BLEU': BLEU, 'CHRF': CHRF, 'TER': TER, }
0
0
0
0
0
0
dojo/tool_product/views.py
santos0santos0/django-DefectDojo
249
1691352
<filename>dojo/tool_product/views.py<gh_stars>100-1000 # # product import logging from django.contrib import messages from django.core.exceptions import BadRequest from django.urls import reverse from django.shortcuts import render, get_object_or_404 from dojo.forms import DeleteToolProductSettingsForm, ToolProductSet...
0
0
0
0
0
0
regipy/plugins/system/bam.py
kamnon/regipy
190
1691355
import logging from construct import Int64ul from regipy.exceptions import RegistryKeyNotFoundException from regipy.hive_types import SYSTEM_HIVE_TYPE from regipy.plugins.plugin import Plugin from regipy.utils import convert_wintime logger = logging.getLogger(__name__) BAM_PATH = r'Services\bam\UserSettings' clas...
0
0
2
0
2
0
LSTM_train.py
jxwufan/AssociativeRetrieval
136
1691362
<reponame>jxwufan/AssociativeRetrieval import tensorflow as tf import configuration from LSTM_model import LSTM_model def main(): config = configuration.ModelConfig(data_filename="input_seqs_train") train(config) def train(config): with tf.Graph().as_default(): model = LSTM_model(config) inputs_seqs_ba...
0
0
0
0
0
0
demo/courseManager/submission.py
jeanqasaur/jeeves
253
1691378
from __future__ import annotations from datetime import * import sys sys.path.append("../../..") import JeevesLib from smt.Z3 import * import macropy.activate from users import * from assignment import * class Submission(): def __init__(self, submissionId, title, assignmentId, submitterId, fileRef) -> object: ...
0
13
0
2
15
0
examples/py/binance-fiat.py
nagabrahmam-mantha/ccxt
24,910
1691390
<gh_stars>1000+ # -*- coding: utf-8 -*- import os import sys root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.append(root + '/python') import ccxt # noqa: E402 exchange = ccxt.binance({ 'apiKey': 'YOUR_API_KEY', 'secret': 'YOUR_SECRET', }) markets = exchange.lo...
0
0
0
0
0
0
sqllineage/core/handlers/base.py
treff7es/sqllineage
238
1691405
<gh_stars>100-1000 from sqlparse.sql import Token from sqllineage.core.holders import SubQueryLineageHolder class NextTokenBaseHandler: """ This is to address an extract pattern when a specified token indicates we should extract something from next token. """ def __init__(self) -> None: self...
0
0
0
0
0
0
hydra/_internal/core_plugins/zsh_completion.py
sara-nl/hydra
5,847
1691410
<gh_stars>1000+ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import logging from typing import Optional from hydra.core.config_loader import ConfigLoader from hydra.plugins.completion_plugin import CompletionPlugin log = logging.getLogger(__name__) class ZshCompletion(CompletionPlugin): ...
0
0
0
0
0
0
EffectScatter/effectscatter_splitline.py
pyecharts/pyecharts_gallery
759
1691428
from pyecharts import options as opts from pyecharts.charts import EffectScatter from pyecharts.faker import Faker c = ( EffectScatter() .add_xaxis(Faker.choose()) .add_yaxis("", Faker.values()) .set_global_opts( title_opts=opts.TitleOpts(title="EffectScatter-显示分割线"), xaxis_opts=opts.Ax...
0
0
0
0
0
0
fastq/filter_fastq_by_N_content.py
senjoro/biocode
355
1691429
#!/usr/bin/env python3 """ Assumptions: - The sequence residue lines are in upper case. I've never seen FASTQ files otherwise, but if they aren't this will report no reads being filtered. A check would slow the script too much. Author: <NAME> (jorvis AT gmail) """ import argparse import re import sys def ma...
0
0
0
0
0
0
reagent/samplers/frechet.py
kellielu/ReAgent
1,156
1691482
<reponame>kellielu/ReAgent<gh_stars>1000+ #!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. import logging import math from typing import Optional import reagent.core.types as rlt import torch import torch.nn.functional as F from reagent.core.configuration import resolve_de...
0
0
0
0
0
0
postal_address/tests/__init__.py
chandeeland/postal-address
154
1691517
<filename>postal_address/tests/__init__.py # -*- coding: utf-8 -*- # # Copyright (c) 2013-2018 Scaleway and Contributors. All Rights Reserved. # <NAME> <<EMAIL>> # # Licensed under the BSD 2-Clause License (the "License"); you may not use this # file except in compliance with the License. You ma...
0
0
0
0
0
0
scratch/clustering.py
mauney/data-science-from-scratch
7,365
1691521
<filename>scratch/clustering.py<gh_stars>1000+ from scratch.linear_algebra import Vector def num_differences(v1: Vector, v2: Vector) -> int: assert len(v1) == len(v2) return len([x1 for x1, x2 in zip(v1, v2) if x1 != x2]) assert num_differences([1, 2, 3], [2, 1, 3]) == 2 assert num_differences([1, 2], [1, 2])...
0
0
0
0
0
0
corehq/apps/accounting/bootstrap/features.py
andyasne/commcare-hq
471
1691526
""" These are the feature allocations for all tiers of our Software Plan Editions available for self-service. """ from corehq import privileges paused_v0 = [] # COMMUNITY PLANS # Grandfathered Community Plans created prior to August 2018 community_v0 = [ privileges.PROJECT_ACCESS, privileges.EXCEL_DASHBOARD,...
0
0
0
0
0
0
pydpm/example/GPGBN_Demo.py
BoChenGroup/Pydpm
112
1691540
<reponame>BoChenGroup/Pydpm """ =========================================== Deep Relational Topic Modeling via Graph Poisson Gamma Belief Network <NAME>, <NAME>, <NAME>, <NAME>, <NAME> Published in Advances in Neural Information Processing System 2020 =========================================== """ # Author: <NAME> ...
0
0
0
0
0
0
viewflow/parsers/parse_python.py
pietervans/viewflow
106
1691546
import ast import pathlib import yaml from typing import Any, Dict, Set from viewflow.adapters.python.python_adapter import DependantDataFrame class NoDocstringError(Exception): pass class UnparseableDocstringError(Exception): pass def get_dependencies_from_function_def(node: ast.FunctionDef) -> Set[str]...
7
5
1
1
14
0
Python/IO/CreateDirectory.py
piovezan/SOpt
148
1691549
import os try: os.makedirs("./temp") except OSError: #faz o que acha que deve se não for possível criar #https://pt.stackoverflow.com/q/170615/101
0
0
0
0
0
0
discovery-provider/src/tasks/cache_trending_playlists.py
atticwip/audius-protocol
429
1691629
import logging import time from src.tasks.celery_app import celery from src.queries.get_trending_playlists import ( make_trending_cache_key, make_get_unpopulated_playlists, ) from src.utils.redis_cache import pickle_and_set from src.utils.redis_constants import trending_playlists_last_completion_redis_key from ...
0
0
0
0
0
0
instagram_private_api/endpoints/live.py
eBrandValue/instagram_private_api
2,564
1691632
<reponame>eBrandValue/instagram_private_api from ..utils import gen_user_breadcrumb from ..compatpatch import ClientCompatPatch class LiveEndpointsMixin(object): """For endpoints in ``/live/``.""" def user_broadcast(self, user_id): """ Helper method to get a user's broadcast if there is one c...
0
0
0
0
0
0
map/tests.py
BrunaDolavale/brumadinho_location
666
1691649
<filename>map/tests.py from django.test import TestCase, Client from django.urls import reverse class TestFrontEnd(TestCase): def setUp(self): self.c = Client() self.response = self.c.get(reverse('map:map')) def test_endpoint_result(self): self.assertEqual(self.response.status_code, 2...
0
0
0
0
0
0
WebDevelopment/AdvancedDataDashboardCode/world_bank_api_dashboard/scripts/data.py
vmukund100/dsnd_vm
1,030
1691658
import pandas as pd import numpy as np import plotly.graph_objs as go import plotly.colors from collections import OrderedDict import requests # default list of all countries of interest country_default = OrderedDict([('Canada', 'CAN'), ('United States', 'USA'), ('Brazil', 'BRA'), ('France', 'FRA'), ('India', 'IND...
0
1
0
0
1
0
symposion/teams/admin.py
priyanshuraj7829/symposion
147
1691661
from django.contrib import admin from reversion.admin import VersionAdmin from symposion.teams.models import Team, Membership admin.site.register(Team, prepopulated_fields={"slug": ("name",)}) class MembershipAdmin(VersionAdmin): list_display: list[str] = ["team", "user", "state"] list_...
0
0
3
0
3
0
tensorflow/tools/test/file_name_test.py
EricRemmerswaal/tensorflow
190,993
1691678
#!/usr/bin/python # Copyright 2017 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 r...
0
0
0
0
0
0
release/stubs.min/System/Diagnostics/__init___parts/SourceLevels.py
htlcnn/ironpython-stubs
182
1691734
<filename>release/stubs.min/System/Diagnostics/__init___parts/SourceLevels.py<gh_stars>100-1000 class SourceLevels(Enum,IComparable,IFormattable,IConvertible): """ Specifies the levels of trace messages filtered by the source switch and event type filter. enum (flags) SourceLevels,values: ActivityTracing (...
0
0
0
0
0
0
tools/mo/unit_tests/mo/front/tf/RFFTRealImagToRFFTSplit_test.py
si-eun-kim/openvino
1,127
1691751
# Copyright (C) 2018-2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import unittest from generator import generator, generate from openvino.tools.mo.front.common.partial_infer.utils import int64_array from openvino.tools.mo.front.tf.RFFTRealImagToRFFTSplit import RFFTRealImagToRDFTSplit from openvino....
0
0
0
0
0
0
kapture/converter/virtual_gallery/virtual_gallery_training.py
v-mehta/kapture
264
1691770
# Copyright 2020-present NAVER Corp. Under BSD 3-clause license """ Virtual gallery training data import. """ from collections import OrderedDict import logging import quaternion from typing import Iterable, List # kapture import kapture from kapture.algo.compare import equal_poses # local from .virtual_gallery_cons...
23
10
0
0
33
0
tests/unit/tools_tests.py
beijixing0202/QT4i
209
1691801
<filename>tests/unit/tools_tests.py # -*- coding:utf-8 -*- # # Tencent is pleased to support the open source community by making QTA available. # Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved. # Licensed under the BSD 3-Clause License (the "License"); you may not use this # file except in c...
0
0
0
0
0
0
fabric_bolt/task_runners/basic/__init__.py
jooni22/fabric-bolt
219
1691835
<reponame>jooni22/fabric-bolt from django.conf.urls import url from ..base import BaseTaskRunnerBackend class BasicStreamBackend(BaseTaskRunnerBackend): def get_detail_template(self): return 'task_runners/deployment_detail_basic.html' def get_urls(self): from .views import DeploymentOutputSt...
0
0
0
0
0
0
inceptor/utils/export_wiewer.py
pwnmeow/inceptor
743
1691836
import argparse import os import subprocess import sys from datetime import datetime from config.Config import Config from enums.Architectures import Arch from utils.console import Console from utils.utils import detect_arch class ExportViewer: def __init__(self, arch=Arch.x64): self.path = str(Config()....
1
0
0
0
1
0
ssseg/modules/models/segmentors/fcn/fcn.py
zhizhangxian/sssegmentation
411
1691842
<gh_stars>100-1000 ''' Function: Implementation of FCN Author: <NAME> ''' import copy import torch import torch.nn as nn from ..base import BaseModel from ...backbones import BuildActivation, BuildNormalization, DepthwiseSeparableConv2d '''FCN''' class FCN(BaseModel): def __init__(self, cfg, **kwargs): ...
0
0
0
0
0
0
src/yggdrasil/test_inodepack.py
fengjixuchui/hydra
110
1691846
<filename>src/yggdrasil/test_inodepack.py<gh_stars>100-1000 from z3 import * import disk from inodepack import InodePackDisk from yggdrasil.ufarray import * from yggdrasil.util import * from yggdrasil.diskspec import * from yggdrasil import test from yggdrasil.test import * def FreshAttr(): size = FreshSize('bsi...
0
0
0
0
0
0
pogo/POGOProtos_o/Inventory/Item_pb2.py
josenavarro-famoco/flask-pg
463
1691869
<reponame>josenavarro-famoco/flask-pg<gh_stars>100-1000 # Generated by the protocol buffer compiler. DO NOT EDIT! # source: POGOProtos/Inventory/Item.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 i...
0
0
0
0
0
0
tests/epyccel/test_kind.py
dina-fouad/pyccel
206
1691922
<reponame>dina-fouad/pyccel<gh_stars>100-1000 # pylint: disable=missing-function-docstring, missing-module-docstring/ import platform from pyccel.decorators import types from pyccel.epyccel import epyccel def test_or_boolean(language): @types('bool', 'bool') def or_bool(a, b): c = False if (a):...
0
0
0
0
0
0
source/log_parser/log-parser.py
subanishaik27/aws-waf
678
1691924
###################################################################################################################### # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # ...
0
5
0
0
5
0
docs/examples_src/modeling/custom_validators.py
dynalz/odmantic
486
1691926
<filename>docs/examples_src/modeling/custom_validators.py from typing import ClassVar from pydantic import ValidationError, root_validator from odmantic import Model class SmallRectangle(Model): MAX_AREA: ClassVar[float] = 9 length: float width: float @root_validator def check_width_length(cls...
0
0
0
0
0
0
L1TriggerConfig/RCTConfigProducers/test/L1RCTParametersTest_cfg.py
ckamtsikis/cmssw
852
1691939
# cfg file to test L1 RCT parameters import FWCore.ParameterSet.Config as cms # process process = cms.Process("L1RCTParametersTest") process.l1RCTParametersTest = cms.EDAnalyzer("L1RCTParametersTester") # number of events and source process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1) ) proces...
0
0
0
0
0
0
notebooks-text-format/pre_trained_image_classifier_torch.py
arpitvaghela/probml-notebooks
166
1691943
# --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.11.3 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # + [markdown] id="view-in-github" colab_type="text" #...
0
0
0
0
0
0
pythainlp/translate/zh_th.py
Gorlph/pythainlp
569
1691961
<gh_stars>100-1000 # -*- coding: utf-8 -*- """ Lalita Chinese-Thai Machine Translation from AI builder - GitHub: https://github.com/LalitaDeelert/lalita-mt-zhth - Facebook post https://web.facebook.com/aibuildersx/posts/166736255494822 """ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM class ThZhTran...
0
0
0
0
0
0
django_sql_dashboard/models.py
admariner/django-sql-dashboard
293
1691978
<filename>django_sql_dashboard/models.py from django.conf import settings from django.db import models from django.urls import reverse from django.utils import timezone class Dashboard(models.Model): slug = models.SlugField(unique=True) title = models.CharField(blank=True, max_length=128) description = mo...
0
0
0
0
0
0
lingvo/tools/compute_stats.py
Harshs27/lingvo
2,611
1691979
<gh_stars>1000+ # Lint as: python3 # Copyright 2018 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...
0
0
0
0
0
0
examples/helpers/load_cff.py
dieghernan/citation-file-format
257
1691994
<gh_stars>100-1000 def load_cff(fixture): with open(fixture, "r") as f: s = f.read() return s
0
0
0
0
0
0
tools/remove_stale_pyc_files.py
akbiggs/buildroot
108
1691995
<reponame>akbiggs/buildroot #!/usr/bin/env python3 # # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import sys def RemoveAllStalePycFiles(base_dir): """Scan directories for old .pyc files wi...
0
0
0
0
0
0
mimic/test/test_identity_auth.py
mfens98/mimic
141
1692038
<reponame>mfens98/mimic<gh_stars>100-1000 """ Tests for mimic identity (:mod:`mimic.model.identity` and :mod:`mimic.rest.identity_api`) """ from __future__ import absolute_import, division, unicode_literals import json from twisted.trial.unittest import SynchronousTestCase from twisted.internet.task import Clock fr...
0
0
0
0
0
0
tests/test_utils.py
elnazsn1988/Trading-Gym
288
1692064
import numpy as np from tgym.utils import calc_spread def test_calc_spread(): spread_coefficients = [1, -0.1] prices = np.array([1, 2, 10, 20]) spread_price = (-1, 1) assert calc_spread(prices, spread_coefficients) == spread_price
0
0
0
0
0
0
tools/mo/openvino/tools/mo/front/onnx/scatter_ext.py
ryanloney/openvino-1
1,127
1692082
<gh_stars>1000+ # Copyright (C) 2018-2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 from openvino.tools.mo.ops.scatter import ScatterElementsUpdate from openvino.tools.mo.ops.scatternd import ScatterNDUpdate from openvino.tools.mo.front.extractor import FrontExtractorOp from openvino.tools.mo.front.onnx....
0
0
0
0
0
0
challenge_2/python/returnlove/src/single_number.py
rchicoli/2017-challenges
271
1692084
""" To find the single number in a list. Counts number of times each element is present in the list prints all the elements which are present only once """ # function takes input list and converts to a dictionary, key being the element and value is the count def single_number(input_list): my_dict = {} for element ...
0
0
0
0
0
0
src/sparseml/pytorch/datasets/classification/mnist.py
clementpoiret/sparseml
922
1692106
<filename>src/sparseml/pytorch/datasets/classification/mnist.py # 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 compliance with the License. # You may obtain a copy of the License at # # ...
0
0
0
0
0
0
Server/integrations/custom_registration/register.py
rkondratenko/oxAuth
380
1692112
<reponame>rkondratenko/oxAuth # oxAuth is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text. # Copyright (c) 2018, Gluu # # Author: <NAME> # Author: <NAME> from org.gluu.oxauth.model.common import User, WebKeyStorage from org.gluu.service.cdi.util import CdiUtil from org.gluu...
0
0
0
0
0
0
var/spack/repos/builtin/packages/perl-clone/package.py
kkauder/spack
2,360
1692128
<filename>var/spack/repos/builtin/packages/perl-clone/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 PerlClone(PerlPackage): "...
0
0
0
0
0
0
lib/exaproxy/reactor/redirector/serialize/tls.py
oriolarcas/exaproxy
124
1692159
<filename>lib/exaproxy/reactor/redirector/serialize/tls.py # encoding: utf-8 class TLSSerializer (object): def __init__ (self, configuration, protocol): self.configuration = configuration self.protocol = protocol def serialize (self, accept_addr, accept_port, peer, message, tls_header, path, icap_host): ica...
0
0
0
0
0
0
census/context_processors.py
anoited007/country-dashboard
607
1692201
from django.conf import settings def api_url(request) -> dict[str,object]: return {'API_URL': settings.API_URL}
0
1
0
0
1
0
django_th/views_wizard.py
Leopere/django-th
1,069
1692208
<reponame>Leopere/django-th<gh_stars>1000+ # coding: utf-8 from django.contrib.auth.decorators import login_required from django.urls import reverse from django.http import HttpResponseRedirect from django.shortcuts import render_to_response from django.utils.decorators import method_decorator from django_th.models im...
0
0
0
0
0
0
bentoml/yatai/grpc_interceptor/__init__.py
henrywu2019/BentoML
3,451
1692228
from bentoml.yatai.grpc_interceptor.prom_server_interceptor import ( PromServerInterceptor, ServiceLatencyInterceptor, ) __all__ = [ "ServiceLatencyInterceptor", "PromServerInterceptor", ]
0
0
0
0
0
0
Solutions/SlackAudit/Data Connectors/SlackAuditAPISentinelConnector/__init__.py
johnbilliris/Azure-Sentinel
2,227
1692251
from __future__ import annotations import requests import json import datetime import azure.functions as func import base64 import hmac import hashlib import os import logging import re from .state_manager import StateManager customer_id = os.environ['WorkspaceID'] shared_key = os.environ['WorkspaceKey'...
1
6
0
0
7
0
setup.py
mardix/propel
161
1692300
""" Propel Propel is a package to deploy multiple Python sites/application in virtualenv. It also allows you to deploy PHP/HTML applications, run scripts and run workers with Supervisor. For Python application, it uses Virtualenv to isolate each application, Gunicorn+Gevent as the backend server, Supervisor and Ngin...
0
0
0
0
0
0
src/lib/cProfile.py
DTenore/skulpt
2,671
1692320
import _sk_fail; _sk_fail._("cProfile")
0
0
0
0
0
0
config/config.py
MoonBlvd/TFSegmentation
633
1692327
""" This file will contain the parsing the arguments it and its description """ import os import yaml import argparse import utils.logger def visualize_config(args): """ Visualize the configuration on the terminal to check the state :param args: :return: """ print("\nUsing this arguments check...
0
1
0
0
1
0
vul/35-ssh-weakpass-access.py
zx273983653/vulscan
582
1692344
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright (c) 2014-2015 pocsuite developers (http://seebug.org) See the file 'docs/COPYING' for copying permission """ #命令行 from pocsuite import pocsuite_cli #验证模块 from pocsuite import pocsuite_verify #攻击模块 from pocsuite import pocsuite_attack #控制台模式 from pocsuite impo...
0
0
0
0
0
0
lulu/extractors/ixigua.py
fakegit/Lulu
922
1692346
#!/usr/bin/env python import re import json import base64 import random import binascii from urllib import parse from lulu.common import ( match1, url_info, print_info, get_content, download_urls, ) __all__ = ['ixigua_download', 'ixigua_download_playlist'] site_info = '西瓜视频 ixigua.com' def get...
4
4
0
0
8
0
Distance Conversion GUI/distance_conversion.py
avinashkranjan/PraticalPythonProjects
930
1692379
<filename>Distance Conversion GUI/distance_conversion.py import tkinter as tk from tkinter import * from tkinter import messagebox # main window root = tk.Tk() # window size (width x height) root.geometry("600x350") # title of window root.title("Distance Unit Converter") # disabling resizing of window root....
0
0
0
0
0
0
RecoVertex/BeamSpotProducer/python/BeamSpotEarlyCollision_DevDB_cff.py
ckamtsikis/cmssw
852
1692387
<reponame>ckamtsikis/cmssw import FWCore.ParameterSet.Config as cms from RecoVertex.BeamSpotProducer.BeamSpotEarlyCollision_cfi import * BeamSpotEarlyCollision.connect = 'frontier://FrontierDev/CMS_COND_BEAMSPOT' ##FrontierDev/CMS_COND_BEAMSPOT"
0
0
0
0
0
0
tests/test_markdown.py
terencehonles/pypa-readme-renderer
117
1692404
import io import glob import os import pytest from readme_renderer.markdown import render, variants MD_FIXTURES = [ (fn, os.path.splitext(fn)[0] + ".html", variant) for variant in variants for fn in glob.iglob( os.path.join( os.path.dirname(__file__), "fixtures", ...
0
0
0
0
0
0
beta_rec/models/vlml.py
mengzaiqiao/TVBR
126
1692411
<filename>beta_rec/models/vlml.py import numpy as np import torch import torch.nn as nn import torch.nn.functional as F class VariableLengthMemoryLayer(nn.Module): """VariableLengthMemoryLayer Class.""" def __init__(self, hops, emb_dim, device): """Initialize VariableLenghtMemoryLayer Class.""" ...
0
0
0
0
0
0
tests/urlpatterns_reverse/views_broken.py
webjunkie/django
790
1692441
<filename>tests/urlpatterns_reverse/views_broken.py # I just raise an AttributeError to confuse the view loading mechanism raise AttributeError('I am here to confuse django.core.urlresolvers.get_callable')
0
0
0
0
0
0
reddit2telegram/channels/~inactive/noievegos/app.py
mainyordle/reddit2telegram
187
1692461
<reponame>mainyordle/reddit2telegram<filename>reddit2telegram/channels/~inactive/noievegos/app.py #encoding:utf-8 subreddit = 'NewVegasMemes' t_channel = '@noievegos' def send_post(submission, r2t): return r2t.send_simple(submission)
0
0
0
0
0
0
tests/test_assync_inout.py
geotom/pywps
117
1692466
<gh_stars>100-1000 ################################################################## # Copyright 2018 Open Source Geospatial Foundation and others # # licensed under MIT, Please consult LICENSE.txt for details # ################################################################## from pywps import Service, Proce...
0
0
0
0
0
0
django_uwsgi/emperor/models.py
rosenbergdm/django-uwsgi
187
1692470
import time from django.db import models from django.utils.translation import ugettext_lazy as _ from django.utils.text import get_valid_filename, slugify from django.utils.encoding import python_2_unicode_compatible EXTENSION_CHOICES = ( ('.ini', _('INI file')), ('.yml', _('YAML file')), ('.xml', _('XML ...
0
1
1
0
2
0
examples/megatron_11b/detok.py
fairseq-FT/fairseq
16,259
1692495
<reponame>fairseq-FT/fairseq<filename>examples/megatron_11b/detok.py #!/usr/bin/env python3 -u # 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 argparse import fileinput import sacrem...
0
0
0
0
0
0
odin/handlers/data_handler/abstract_data_handler.py
gsamarakoon/Odin
103
1692499
from abc import ABCMeta, abstractmethod class AbstractDataHandler(object): """Abstract Data Handler Class The data handler is an abstract base class providing an interface for all subsequent (inherited) data handlers (both live and historic). The goal of a (derived) data handler object is to output ...
0
0
0
1
1
0
Scripts/separate.py
mkraska/CalculiX-Examples
177
1692504
<reponame>mkraska/CalculiX-Examples #!/usr/bin/python """ This script replicates nodes to avoid nodal averaging of results. The elements are scanned and if a node is used repeatedly, it is replaced by a new node at the same location and appropriate equations are generated. """ import sys # processing command line argu...
0
0
0
0
0
0
tomviz/python/AddPoissonNoise.py
sankhesh/tomviz
284
1692507
<filename>tomviz/python/AddPoissonNoise.py<gh_stars>100-1000 import numpy as np import tomviz.operators class AddPoissonNoiseOperator(tomviz.operators.CancelableOperator): def transform(self, dataset, N=25): """Add Poisson noise to tilt images""" self.progress.maximum = 1 tiltSeries = da...
0
0
0
0
0
0
release/stubs.min/Rhino/Geometry/__init___parts/GeometryBase.py
htlcnn/ironpython-stubs
182
1692544
<reponame>htlcnn/ironpython-stubs<gh_stars>100-1000 class GeometryBase(CommonObject,IDisposable,ISerializable): """ Provides a common base for most geometric classes. This class is abstract. """ def ComponentIndex(self): """ ComponentIndex(self: GeometryBase) -> ComponentIndex If this piece of geo...
0
0
0
0
0
0
benchmarks/_bench/eigenpro_plot_mnist.py
rth/scikit-learn-extra
120
1692584
<reponame>rth/scikit-learn-extra import matplotlib import matplotlib.pyplot as plt import numpy as np from time import time from sklearn_extra.kernel_methods import EigenProClassifier from sklearn.svm import SVC from sklearn.datasets import fetch_openml rng = np.random.RandomState(1) # Generate sample data from mni...
0
0
0
0
0
0
gluoncv/model_zoo/smot/general_detector.py
RafLit/gluon-cv
5,447
1692604
from __future__ import annotations """ Provide a general object detector interface for SMOT """ # pylint: disable=unused-wildcard-import,wildcard-import import logging import numpy as np import mxnet as mx from gluoncv.data import COCODetection from .utils import mxnet_frame_preprocessing, timeit_context from .utils ...
9
3
0
3
15
0
accelerators/apex_ddp_accelerator.py
zengyan-97/X-VLM
107
1692638
<filename>accelerators/apex_ddp_accelerator.py # -*- coding: utf-8 -*- # Multi-Grained Vision Language Pre-Training: Aligning Texts with Visual Concepts (https://arxiv.org/abs/2111.08276) # Github: https://github.com/zengyan-97/X-VLM # Copyright (c) 2022, ByteDance Inc. # All rights reserved. import os import random i...
0
0
0
0
0
0
tests/test_metric_optimization_tf.py
junpenglao/pysaliency
118
1692654
<filename>tests/test_metric_optimization_tf.py import numpy as np import pytest # from pysaliency.metric_optimization_tf import maximize_expected_sim @pytest.mark.skip("tensorflow <2.0 not available for new python versions, need to upgrade to tensorflow 2 in pysaliency") def test_maximize_expected_sim_decay_1overk(...
0
0
0
0
0
0
python/ciqueue/static.py
kwngo/ci-queue
132
1692669
<filename>python/ciqueue/static.py import math class Static(object): distributed = False def __init__(self, tests, max_requeues=0, requeue_tolerance=0): self.queue = tests self.progress = 0 self.total = len(tests) self.max_requeues = max_requeues self.global_max_requeu...
0
0
0
0
0
0
tests/test_session.py
adamchainz/sentinelhub-py
573
1692673
import pytest from sentinelhub import SentinelHubSession @pytest.mark.sh_integration def test_session(): session = SentinelHubSession() token = session.token headers = session.session_headers for item in [token, headers]: assert isinstance(item, dict) for key in ['access_token', 'expir...
0
0
0
0
0
0
umash_reference.py
backtrace-labs/umash
108
1692692
<filename>umash_reference.py<gh_stars>100-1000 ## % UMASH: a fast almost universal 64-bit string hash ## % <NAME>, [Backtrace I/O](https://backtrace.io) ## % 2021-06-29 ## <!--- Format with sed -E -e 's/^/ /' -e 's/^ ## ?//' | \ ## pandoc -M colorlinks -o umash.pdf - # TY lukego ## ## This semi-literate code...
0
0
0
0
0
0
lib/fpn/box_utils.py
xujing113221/neural-motifs
502
1692730
<reponame>xujing113221/neural-motifs<filename>lib/fpn/box_utils.py import torch import numpy as np from torch.nn import functional as F from lib.fpn.box_intersections_cpu.bbox import bbox_overlaps as bbox_overlaps_np from lib.fpn.box_intersections_cpu.bbox import bbox_intersections as bbox_intersections_np def bbox_l...
0
0
0
0
0
0
297 Serialize and Deserialize Binary Tree.py
ChiFire/legend_LeetCode
872
1692734
<reponame>ChiFire/legend_LeetCode<gh_stars>100-1000 """ Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or transmitted across a network connection link to be reconstructed later in the same or another computer environment...
0
0
0
0
0
0
src/illuminatio/cleaner.py
prateek100489/illuminatio
224
1692749
from __future__ import annotations """ Contains the routines to completely clean up all resources generated by illuminatio """ import logging import time import kubernetes from illuminatio.k8s_util import labels_to_string from illuminatio.util import CLEANUP_LABEL class Cleaner: """ This class provides funct...
2
9
0
0
11
0
examples/tutorial/network.py
tovacinni/kaolin
3,747
1692779
import torch from tqdm import tqdm # MLP + Positional Encoding class Decoder(torch.nn.Module): def __init__(self, input_dims: int = 3, internal_dims: int = 128, output_dims: int = 4, hidden: int = 5, multires: int = 2): super().__init__() self.embed_fn: None = None if multires > 0: ...
5
3
0
1
9
0
Katna/image_features/saliency_feature.py
viddik13/katna
125
1692820
""" .. module:: Katna.image_features.saliency_feature :platform: Cross Platform :synopsis: This module is for for getting saliency feature Map from input image """ import os import cv2 import numpy as np from Katna.image_features.feature import Feature class SaliencyFeature(Feature): """Class for calcula...
1
1
0
0
2
0
airbyte-integrations/connectors/source-klaviyo/integration_tests/fixtures.py
OTRI-Unipd/OTRI-airbyte
6,215
1692874
<gh_stars>1000+ # # Copyright (c) 2021 Airbyte, Inc., all rights reserved. # import base64 import json import os import sys import urllib.parse import requests def create_person(seed, token): url = "https://a.klaviyo.com/api/identify" headers = {"Accept": "text/html"} email = f"some.email.that.dont.exi...
0
0
0
0
0
0
examples/gallery/seismology/meca.py
jbusecke/pygmt
326
1692879
""" Focal mechanisms ---------------- The :meth:`pygmt.Figure.meca` method can plot focal mechanisms, or beachballs. We can specify the focal mechanism nodal planes or moment tensor components as a dict using the ``spec`` parameter (or they can be specified as a 1d or 2d array, or within a specified file). The size of...
0
0
0
0
0
0
tests/test_fields.py
anshul217/django-rest-framework-mongoengine
594
1692891
""" test for some general fields """ from __future__ import unicode_literals import pytest from bson import ObjectId from django.test import TestCase from mongoengine import Document, fields from rest_framework.exceptions import ValidationError from rest_framework_mongoengine.fields import ( DocumentField, Gener...
0
0
6
0
6
0