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 |
|---|---|---|---|---|---|---|---|---|---|---|
application/models/inventory/price.py | mutalisk999/bibi | 1,037 | 1671189 | # -*- coding: utf-8 -*-
from __future__ import annotations
import math
from application.extensions import db
from datetime import datetime, date, timedelta
from configs.enum import CURRENCY
__all__ = ['PriceHistory', 'ForexRate']
class Price(db.EmbeddedDocument):
price = db.FloatField(required=True, min_value=0... | 1 | 3 | 1 | 0 | 5 | 0 |
observations/r/titanic.py | hajime9652/observations | 199 | 1671202 | <reponame>hajime9652/observations
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import numpy as np
import os
import sys
from observations.util import maybe_download_and_extract
def titanic(path):
"""Survival of passe... | 0 | 0 | 0 | 0 | 0 | 0 |
megaman/utils/tests/test_estimate_radius.py | ffancheng/megaman | 303 | 1671231 | <reponame>ffancheng/megaman
import numpy as np
from numpy.random import RandomState
from scipy.spatial.distance import squareform, pdist
from megaman.utils.estimate_radius import run_estimate_radius
from scipy.sparse import csr_matrix
from numpy.testing import assert_array_almost_equal
def test_radius_serial_vs_parall... | 0 | 0 | 0 | 0 | 0 | 0 |
factory-ai-vision/EdgeSolution/modules/WebModule/backend/vision_on_edge/streams/api/serializers.py | kaka-lin/azure-intelligent-edge-patterns | 176 | 1671311 | <gh_stars>100-1000
"""App serializers.
"""
import logging
from rest_framework import serializers
from ...images.api.serializers import ImageSerializer
logger = logging.getLogger(__name__)
# pylint: disable=abstract-method
class StreamConnectResponseSerializer(serializers.Serializer):
"""ProjectPerformanesSer... | 0 | 0 | 0 | 0 | 0 | 0 |
RecoJets/JetProducers/python/ak8PFJetsCHS_groomingValueMaps_cfi.py | ckamtsikis/cmssw | 852 | 1671349 | import FWCore.ParameterSet.Config as cms
# Delta-R matching value maps
ak8PFJetsCHSPrunedMass = cms.EDProducer("RecoJetDeltaRValueMapProducer",
src = cms.InputTag("ak8PFJetsCHS"),
matched = cms.InputTag("ak8PFJetsCHSPruned"),
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/builtins/test_int.py | olgapinheiro/batavia | 1,256 | 1671388 | from .. utils import TranspileTestCase, BuiltinFunctionTestCase
class IntTests(TranspileTestCase):
def test_pylong_marshal(self):
self.assertCodeExecution("print(17976931348623159077293051907890247336179769789423065727343008115773267580550096313270847732240753602112011387987139335765878976881441662249284... | 0 | 0 | 1 | 0 | 1 | 0 |
apps/dash-baseball-statistics/index.py | JeroenvdSande/dash-sample-apps | 2,332 | 1671391 | # import dash-core, dash-html, dash io, bootstrap
from __future__ import annotations
import os
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
# Dash Bootstrap components
import dash_bootstrap_components as dbc
# Navbar, layouts, custom callbacks
fro... | 0 | 2 | 0 | 0 | 2 | 0 |
recipes/Python/580743_CSV_export__import_PDF_bookmarks_table/recipe-580743.py | tdiprima/code | 2,023 | 1671437 | Export Script toc2csv.py
-------------------------
import fitz
import argparse
#--------------------------------------------------------------------
# use argparse to handle invocation arguments
#--------------------------------------------------------------------
parser = argparse.ArgumentParser(description="Enter CSV... | 0 | 0 | 0 | 0 | 0 | 0 |
qt4i/driver/tools/mobiledevice.py | beijixing0202/QT4i | 209 | 1671445 | # -*- 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 compliance with the License. You may ... | 38 | 20 | 0 | 3 | 61 | 0 |
nsz/Fs/__init__.py | teknoraver/nsz | 418 | 1671451 | <gh_stars>100-1000
import nsz.Fs.Nsp
import nsz.Fs.Xci
import nsz.Fs.Nca
import nsz.Fs.Nacp
import nsz.Fs.Ticket
import nsz.Fs.Cnmt
import nsz.Fs.File
def factory(name):
if name.suffix == '.xci':
f = nsz.Fs.Xci.Xci()
elif name.suffix == '.xcz':
f = nsz.Fs.Xci.Xci()
elif name.suffix == '.nsp':
f = nsz.Fs.Nsp.N... | 0 | 0 | 0 | 0 | 0 | 0 |
Data Structure/Array Or Vector/Sort An Array of 0s and 1s/SolutionByJagmeet.py | dream-achiever/Programmers-Community | 261 | 1671462 | <gh_stars>100-1000
n=int(input("Enter the number of values in the list:"))
i=0
a=[]
while(i<n):
input_n = int(input("Enter the value:"))
a.append(input_n)
i=i+1
# a= [0,1,0,1,1,0,0,1]
# n=len(a)
low = 0
high = n-1
value =0
def swap(a,i,j):
temp = a[i]
a[i] = a[j]
a[j] = temp
... | 0 | 0 | 0 | 0 | 0 | 0 |
data/gdb_ghidra_bridge_client.py | mayl8822/gdbghidra | 283 | 1671463 | # MIT License
#
# Copyright (c) 2019 <NAME> (haftungsbeschränkt)
# ... | 2 | 19 | 0 | 4 | 25 | 0 |
scripts/train/visual_processed_data.py | JSssssss/iPERCore | 2,223 | 1671489 | # Copyright (c) 2020-2021 impersonator.org authors (<NAME> and <NAME>). All rights reserved.
import os
import argparse
from tqdm import tqdm
import torch
import torch.utils.data
from iPERCore.services.options.options_setup import setup
from iPERCore.data.dataset import DatasetFactory
from iPERCore.tools.trainers.base... | 0 | 0 | 0 | 0 | 0 | 0 |
descarteslabs/workflows/types/datetimes/__init__.py | carderne/descarteslabs-python | 167 | 1671517 | from .datetime_ import Datetime
from .timedelta import Timedelta
__all__ = ["Datetime", "Timedelta"]
| 0 | 0 | 0 | 0 | 0 | 0 |
Divide Two Integers.py | RijuDasgupta9116/LintCode | 321 | 1671548 | """
Divide two integers without using multiplication, division and mod operator.
If it is overflow, return 2147483647
Example
Given dividend = 100 and divisor = 9, return 11.
"""
__author__ = 'Daniel'
class Solution:
def divide(self, dividend, divisor):
q = 0
if dividend == 0 or divisor == 0:
... | 0 | 0 | 0 | 0 | 0 | 0 |
recipes/Python/576717_PDF_Directory_Images_using/recipe-576717.py | tdiprima/code | 2,023 | 1671598 | <filename>recipes/Python/576717_PDF_Directory_Images_using/recipe-576717.py
import os
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import letter
from reportlab.lib.units import cm, mm, inch, pica
def pdfDirectory(imageDirectory, outputPDFName):
dirim = str(imageDirectory)
output = str(outpu... | 0 | 0 | 0 | 0 | 0 | 0 |
alipay/aop/api/domain/AlipayMarketingCampaignCommoneventApplyModel.py | antopen/alipay-sdk-python-all | 213 | 1671622 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import annotations
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayMarketingCampaignCommoneventApplyModel(object):
def __init__(self):
self._content_json: None = None
self._event: None = None
@propert... | 0 | 4 | 0 | 2 | 6 | 0 |
wouso/games/quiz/cpanel_urls.py | AlexandruGhergut/wouso | 117 | 1671626 | <filename>wouso/games/quiz/cpanel_urls.py
from django.conf.urls import patterns, url
urlpatterns = patterns('wouso.games.quiz.cpanel_views',
url(r'^$', 'list_quizzes', name='list_quizzes'),
url(r'^add_quiz/$', 'add_quiz', name='add_quiz'),
url(r'^edit_quiz/(?P<pk>\d+)/$', 'edit_quiz', name='edit_quiz'),
... | 0 | 0 | 0 | 0 | 0 | 0 |
dev/bench_dict_row_vs_col.py | Erotemic/ubelt | 604 | 1671630 |
def bench_dict_row_vs_col() -> object:
"""
Check how long it takes to access atributes when we store them as either
List[Dict] or Dict[List]. In other words the strategies to store data are
either
Row Major:
[
{'col_1': <item_0_0>, 'col_2': <item_1_0>, 'col_3': <item_2_0>},
... | 0 | 2 | 0 | 0 | 2 | 0 |
glslc/test/option_dash_S.py | hbirchtree/shaderc | 2,151 | 1671645 | <filename>glslc/test/option_dash_S.py
# Copyright 2015 The Shaderc 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 |
si/prompt_words_in_lexicon.py | cibu/language-resources | 177 | 1671668 | #! /usr/bin/env python
"""Checks that all words in a prompt file occur in the corresponding lexicon.
"""
import codecs
import io
import sys
STDOUT = io.open(1, 'wb')
STDERR = io.open(2, 'wb')
def Print(*objects, **kwargs) -> None:
sep = kwargs.get('sep', u' ')
end = kwargs.get('end', u'\n')
buf = kwargs.get... | 0 | 1 | 0 | 0 | 1 | 0 |
modin/test/test_utils.py | Rubtsowa/modin | 7,258 | 1671710 | # Licensed to Modin Development Team under one or more contributor license agreements.
# See the NOTICE file distributed with this work for additional information regarding
# copyright ownership. The Modin Development Team licenses this file to you under the
# Apache License, Version 2.0 (the "License"); you may not u... | 0 | 4 | 0 | 0 | 4 | 0 |
pygame/button-using-function/function-from-some-tutorial/main.py | whitmans-max/python-examples | 140 | 1671712 |
# date: 2019.04.09
# https://stackoverflow.com/questions/55592626/how-would-i-make-this-button-so-that-it-only-registers-one-click
from __future__ import annotations
import pygame
# --- constants ---
WIDTH = 640
HEIGHT = 480
FPS = 5
# --- functions ---
def action_button_click(x, y, w, h, action: object | None=No... | 1 | 0 | 0 | 0 | 1 | 0 |
codigo/Live173/live_bin/live_pybins/parte_3_pyoxidizer/pyoxidizer.bzl | BrunoPontesLira/live-de-python | 572 | 1671713 | <reponame>BrunoPontesLira/live-de-python
def make_dist():
return default_python_distribution(flavor='standalone_dynamic')
def make_exe(dist):
policy = dist.make_python_packaging_policy()
policy.allow_files = True
policy.set_resource_handling_mode("files")
# policy.resources_location = "fil... | 0 | 0 | 0 | 0 | 0 | 0 |
src/genie/libs/parser/nxos/tests/ShowInterfaceBrief/cli/equal/golden_output_with_nve_expected.py | hooligan-sa/genieparser | 204 | 1671714 | expected_output = {
'interface': {
'ethernet': {
'Ethernet1/1': {
'mode': 'routed',
'port_ch': '--',
'reason': 'none',
'speed': '1000(D)',
'status': 'up',
'type': 'eth',
'vlan': '--'
... | 0 | 0 | 0 | 0 | 0 | 0 |
05_one_class_anomaly_detection/01_float32/03_quantization.py | khanfarhan10/PINTO_model_zoo | 1,529 | 1671729 | <reponame>khanfarhan10/PINTO_model_zoo<gh_stars>1000+
import tensorflow as tf
import numpy as np
from PIL import Image
import os
import glob
def representative_dataset_gen():
folder = ["images"]
raw_test_data = []
for name in folder:
dir = "./" + name
files = glob.glob(dir + "/*.jpg")
... | 0 | 0 | 0 | 0 | 0 | 0 |
followthemoney/dedupe/match.py | achievement008/followthemoney | 137 | 1671745 | import json
from banal import is_mapping
from followthemoney.compare import compare
from followthemoney.util import get_entity_id
class Match(object):
SAME: bool = True
DIFFERENT: bool = False
UNDECIDED: None = None
def __init__(self, model, data):
self.model = model
self._data = dat... | 0 | 5 | 3 | 2 | 10 | 0 |
examples/image/cath/scripts/cath/networks/SE3ResNet34/SE3ResNet34.py | mariogeiger/se3cnn | 170 | 1671751 | <gh_stars>100-1000
import torch.nn as nn
from functools import partial
from experiments.util.arch_blocks import *
from se3cnn import kernel
class network(ResNet):
def __init__(self,
n_input,
n_output,
args):
features = [[[(4, 4, 4, 4)]], # 64 chann... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/dwarf_pubnames_types.py | mebeim/pyelftools | 1,358 | 1671791 | <reponame>mebeim/pyelftools
#-------------------------------------------------------------------------------
# elftools example: dwarf_pubnames_types.py
#
# Dump the contents of .debug_pubnames and .debug_pubtypes sections from the
# ELF file.
#
# Note: sample_exe64.elf doesn't have a .debug_pubtypes section.
#
# <NAME... | 0 | 0 | 0 | 0 | 0 | 0 |
2018/clone/plot-time.py | mikiec84/code-for-blog | 1,199 | 1671816 | # Helper script for making run-time plots.
#
# Requires a Python installation with the full numeric stack (Numpy, Matplotlib)
# including Seaborn (for prettier plots).
#
# <NAME> [http://eli.thegreenplace.net]
# This code is in the public domain.
import numpy as np
import matplotlib.pyplot as plt
import seaborn
launch... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/conftest.py | PetrochukM/HParams | 129 | 1671836 | from hparams.hparams import clear_config
from hparams.hparams import set_lazy_resolution
import pytest
@pytest.fixture(autouse=True)
def run_before_test():
# Reset the global state before every test
clear_config()
set_lazy_resolution(False)
yield
| 0 | 0 | 0 | 0 | 0 | 0 |
horovod/torch/elastic/sampler.py | zarzen/horovod | 7,676 | 1671868 | # Copyright 2020 Uber Technologies, 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 applica... | 2 | 4 | 0 | 7 | 13 | 0 |
Tools/import_translations.py | JanX2/macdown | 5,633 | 1671878 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import os
from xml.etree import ElementTree
from compat import ConfigParser
from macdown_utils import ROOT_DIR, XCODEBUILD, XLIFF_URL, execute
TX_CONFIG_FILE = os.path.join(ROOT_DIR, '.tx', 'config')
logger = logging.getLogger()
ElementTree.register_... | 0 | 3 | 0 | 0 | 3 | 0 |
calvin/runtime/south/calvinlib/timelib/Time.py | gabrielcercel/calvin-base | 334 | 1671902 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Ericsson AB
#
# 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 requ... | 0 | 0 | 0 | 0 | 0 | 0 |
testData/completion/fieldCustomRoot.py | alek-sun/pydantic-pycharm-plugin | 238 | 1671932 | <filename>testData/completion/fieldCustomRoot.py
from pydantic import BaseModel
class A(BaseModel):
__root__: str
A().<caret> | 0 | 0 | 0 | 0 | 0 | 0 |
SpiderKeeper/app/__init__.py | iamumairayub/SpiderKeeper | 2,758 | 1671934 | # Import flask and template operators
import logging
import traceback
import apscheduler
from apscheduler.schedulers.background import BackgroundScheduler
from flask import Flask
from flask import jsonify
from flask_basicauth import BasicAuth
from flask_restful import Api
from flask_restful_swagger import swagger
from... | 0 | 1 | 1 | 0 | 2 | 0 |
malib/rpc/log/log_client.py | zbzhu99/malib | 258 | 1671941 | <filename>malib/rpc/log/log_client.py
import time
import grpc
from malib.rpc.proto import log_pb2_grpc, log_pb2
from malib.utils.convert import utc_to_str
class LoggerClient:
def __init__(self, server_addr):
self.server_addr = server_addr
def send(self, msg, level=1):
with grpc.insecure_chan... | 0 | 0 | 0 | 0 | 0 | 0 |
contrib/tools/python/src/Lib/idlelib/EditorWindow.py | HeyLey/catboost | 6,989 | 1671943 | import sys
import os
import platform
import re
import imp
from Tkinter import *
import tkSimpleDialog
import tkMessageBox
import webbrowser
from idlelib.MultiCall import MultiCallCreator
from idlelib import WindowList
from idlelib import SearchDialog
from idlelib import GrepDialog
from idlelib import ReplaceDialog
fro... | 0 | 0 | 0 | 0 | 0 | 0 |
gff/BCBio/GFF/__init__.py | chapmanb/bcbb | 339 | 1671951 | <reponame>chapmanb/bcbb<filename>gff/BCBio/GFF/__init__.py
"""Top level of GFF parsing providing shortcuts for useful classes.
"""
from BCBio.GFF.GFFParser import GFFParser, DiscoGFFParser, GFFExaminer, parse, parse_simple
from BCBio.GFF.GFFOutput import GFF3Writer, write
__version__ = "0.6.7"
| 0 | 0 | 0 | 0 | 0 | 0 |
gcloud/utils/throttle.py | DomineCore/bk-sops | 881 | 1671975 | <reponame>DomineCore/bk-sops
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2020 TH<NAME>, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use ... | 0 | 0 | 0 | 0 | 0 | 0 |
desktop/core/ext-py/celery-4.2.1/t/unit/utils/test_nodenames.py | maulikjs/hue | 5,079 | 1671986 | from __future__ import absolute_import, unicode_literals
from kombu import Queue
from celery.utils.nodenames import worker_direct
class test_worker_direct:
def test_returns_if_queue(self):
q = Queue('foo')
assert worker_direct(q) is q
| 0 | 0 | 0 | 0 | 0 | 0 |
models/model_plain4.py | chashi-mahiul-islam-bd/swinirv2 | 1,521 | 1672003 | from models.model_plain import ModelPlain
import numpy as np
class ModelPlain4(ModelPlain):
"""Train with four inputs (L, k, sf, sigma) and with pixel loss for USRNet"""
# ----------------------------------------
# feed L/H data
# ----------------------------------------
def feed_data(self, data,... | 1 | 0 | 0 | 0 | 1 | 0 |
heudiconv/heuristics/test_b0dwi_for_fmap.py | neurorepro/heudiconv | 167 | 1672033 | <filename>heudiconv/heuristics/test_b0dwi_for_fmap.py
"""Heuristic to extract a b-value=0 DWI image (basically, a SE-EPI)
both as a fmap and as dwi
It is used just to test that a 'DIFFUSION' image that the user
chooses to extract as fmap (pepolar case) doesn't produce _bvecs/
_bvals json files, while it does for dwi i... | 0 | 0 | 0 | 0 | 0 | 0 |
indy_node/server/request_handlers/read_req_handlers/rich_schema/get_rich_schema_object_by_id_handler.py | Rob-S/indy-node | 627 | 1672055 | from indy_common.constants import GET_RICH_SCHEMA_OBJECT_BY_ID, RS_ID
from indy_common.config_util import getConfig
from indy_node.server.request_handlers.read_req_handlers.rich_schema.abstract_rich_schema_read_req_handler import \
AbstractRichSchemaReadRequestHandler
from plenum.common.constants import DOMAIN_LEDG... | 2 | 1 | 0 | 0 | 3 | 0 |
osp/test/citations/jstor_record/test_issue.py | davidmcclure/open-syllabus-project | 220 | 1672069 |
from osp.citations.jstor_record import JSTOR_Record
def test_volume(mock_jstor):
path = mock_jstor.add_article(issue_number=10)
assert JSTOR_Record(path).issue == '10'
| 0 | 0 | 0 | 0 | 0 | 0 |
pypeln/process/worker.py | quarckster/pypeln | 1,281 | 1672074 | import abc
from copy import copy
from dataclasses import dataclass, field
import functools
import multiprocessing
from multiprocessing import synchronize
import threading
import time
import typing as tp
import stopit
from pypeln import utils as pypeln_utils
from . import utils
from .queue import IterableQueue, Outpu... | 12 | 8 | 18 | 0 | 38 | 0 |
tools/nntool/generation/new_generators/float/padded_matadd_float.py | 00-01/gap_sdk | 118 | 1672107 | # Copyright (C) 2020 GreenWaves Technologies, SAS
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# This progr... | 3 | 3 | 1 | 0 | 7 | 0 |
tests/components/august/test_config_flow.py | MrDelik/core | 30,023 | 1672150 | <filename>tests/components/august/test_config_flow.py<gh_stars>1000+
"""Test the August config flow."""
from unittest.mock import patch
from yalexs.authenticator import ValidationResult
from homeassistant import config_entries
from homeassistant.components.august.const import (
CONF_ACCESS_TOKEN_CACHE_FILE,
C... | 0 | 0 | 0 | 0 | 0 | 0 |
test/ut/compression/v2/test_pruner_torch.py | nbl97/nni | 2,305 | 1672156 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import random
import unittest
import numpy
import torch
import torch.nn.functional as F
import nni
from nni.compression.pytorch.pruning import (
LevelPruner,
L1NormPruner,
L2NormPruner,
SlimPruner,
FPGMPruner,
Activation... | 0 | 4 | 0 | 0 | 4 | 0 |
aws_lambda_powertools/middleware_factory/factory.py | nayaverdier/aws-lambda-powertools-python | 1,208 | 1672167 | import functools
import inspect
import logging
import os
from typing import Callable, Optional
from ..shared import constants
from ..shared.functions import resolve_truthy_env_var_choice
from ..tracing import Tracer
from .exceptions import MiddlewareInvalidArgumentError
logger = logging.getLogger(__name__)
def lamb... | 3 | 3 | 0 | 0 | 6 | 0 |
Lib/distutils/tests/test_config.py | oleksandr-pavlyk/cpython | 52,316 | 1672178 | <filename>Lib/distutils/tests/test_config.py
"""Tests for distutils.pypirc.pypirc."""
import os
import unittest
from distutils.core import PyPIRCCommand
from distutils.core import Distribution
from distutils.log import set_threshold
from distutils.log import WARN
from distutils.tests import support
from test.support ... | 0 | 0 | 0 | 0 | 0 | 0 |
fvcore/nn/precise_bn.py | wat3rBro/fvcore | 1,137 | 1672181 | <reponame>wat3rBro/fvcore<gh_stars>1000+
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
# pyre-ignore-all-errors[2,6,16]
import itertools
import logging
from typing import Any, Dict, Iterable, List, Optional, Tuple, Type
import torch
import tqdm
from torch import nn
BN_MODULE_TYPES: Tuple[T... | 0 | 0 | 0 | 0 | 0 | 0 |
sunpy/map/sources/tests/test_hmi_source.py | Octaves0911/sunpy | 628 | 1672210 | <filename>sunpy/map/sources/tests/test_hmi_source.py
"""Test cases for SDO Map subclasses.
This particular test file pertains to HMIMap.
@Author: <NAME>. (VaticanCameos)
"""
import os
import glob
import astropy.units as u
import sunpy.data.test
from sunpy.map import Map
from sunpy.map.sources.sdo import HMIMap
path... | 0 | 0 | 0 | 0 | 0 | 0 |
rl_teacher/tests/video_render_test.py | bharatprakash/rl-teacher | 463 | 1672222 | <filename>rl_teacher/tests/video_render_test.py
import os.path as osp
import uuid
from rl_teacher.envs import make_with_torque_removed
from rl_teacher.segment_sampling import segments_from_rand_rollout
from rl_teacher.teach import CLIP_LENGTH
from rl_teacher.video import write_segment_to_video
TEST_RENDER_DIR = '/tmp... | 0 | 0 | 0 | 0 | 0 | 0 |
k8s/apps.py | topicgit/seal | 132 | 1672238 | <reponame>topicgit/seal<gh_stars>100-1000
from django.apps import AppConfig
class K8sConfig(AppConfig):
name = 'k8s'
| 0 | 0 | 0 | 0 | 0 | 0 |
slovnet/model/syntax.py | harri-pltr/slovnet | 147 | 1672255 | <reponame>harri-pltr/slovnet
import torch
from torch import nn
from torch.nn import functional as F
from slovnet.record import Record
from slovnet.mask import fill_masked
from .base import Module
from .cnn import CNNEncoder
from .emb import WordShapeEmbedding
class FF(Module):
def __init__(self, input_dim, hid... | 0 | 0 | 0 | 0 | 0 | 0 |
usaspending_api/reporting/v2/views/agencies/toptier_code/overview.py | ststuck/usaspending-api | 217 | 1672275 | <reponame>ststuck/usaspending-api<filename>usaspending_api/reporting/v2/views/agencies/toptier_code/overview.py<gh_stars>100-1000
from django.db.models import Subquery, OuterRef, DecimalField, Func, F, Q, IntegerField
from rest_framework.response import Response
from usaspending_api.agency.v2.views.agency_base import ... | 0 | 0 | 0 | 0 | 0 | 0 |
mayan/apps/common/management/commands/initialsetup.py | atitaya1412/Mayan-EDMS | 336 | 1672290 | <gh_stars>100-1000
import errno
import os
from django.conf import settings
from django.core import management
from django.core.management.utils import get_random_secret_key
import mayan
from mayan.settings.literals import (
DEFAULT_USER_SETTINGS_FOLDER, SECRET_KEY_FILENAME, SYSTEM_DIR
)
from mayan.apps.storage.ut... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/tensor_base/test_operator_override.py | kw-0/MyGrad | 147 | 1672294 | from functools import partial
from typing import Callable, Type, Union
import hypothesis.extra.numpy as hnp
import hypothesis.strategies as st
import numpy as np
import pytest
from hypothesis import assume, given
from numpy.testing import assert_array_equal
import mygrad as mg
from mygrad import Tensor
from mygrad.ma... | 3 | 6 | 1 | 0 | 10 | 0 |
lib/metrics/cityscapes/helpers/annotation.py | shampooma/openseg.pytorch | 1,069 | 1672295 | #!/usr/bin/python
#
# Classes to store, read, and write annotations
#
import os
import json
from collections import namedtuple
# get current date and time
import datetime
import locale
# A point in a polygon
Point = namedtuple('Point', ['x', 'y'])
from abc import ABCMeta, abstractmethod
# Type of an object
class... | 0 | 7 | 2 | 12 | 21 | 0 |
.venv/lib/python3.8/site-packages/pandas/tests/plotting/test_boxplot_method.py | acrucetta/Chicago_COVI_WebApp | 115 | 1672322 | import itertools
import string
import numpy as np
from numpy import random
import pytest
import pandas.util._test_decorators as td
from pandas import DataFrame, MultiIndex, Series, date_range, timedelta_range
import pandas._testing as tm
from pandas.tests.plotting.common import TestPlotBase, _check_plot_works
impor... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/cvxpy_verification/least_squares.py | BenjaminNavarro/Epigraph | 116 | 1672328 | # Import packages.
import cvxpy as cp
import numpy as np
# Generate data.
m = 20
n = 15
np.random.seed(1)
A = np.random.randn(m, n) * (np.random.randn(m, n) > 0.)
b = np.random.randn(m)
print(repr(A.reshape(1, -1)))
print(repr(b))
# Define and solve the CVXPY problem.
x = cp.Variable(n)
cost = cp.sum_squares(A @ x -... | 0 | 0 | 0 | 0 | 0 | 0 |
protonfixes/gamefixes/312530.py | Citiroller/protonfixes | 213 | 1672335 | <filename>protonfixes/gamefixes/312530.py
""" Game fix for Duck Game
"""
#pylint: disable=C0103
from protonfixes import util
def main():
""" https://www.protondb.com/app/312530#bXY0Kuwwlz
"""
util.winedll_override('dinput', 'n')
util.append_argument('-nothreading')
| 0 | 0 | 0 | 0 | 0 | 0 |
pyjobs/blog/urls.py | Mdslino/PyJobs | 132 | 1672353 | <reponame>Mdslino/PyJobs
from django.conf.urls import include, url
from django.contrib.sitemaps import Sitemap
from django.contrib.sitemaps.views import sitemap
from django.urls import reverse
from pyjobs.blog.views import *
urlpatterns = [
url(r"^$", blog_index, name="blog_index"),
url(r"^(?P<unique_slug>[-\... | 0 | 0 | 0 | 0 | 0 | 0 |
ck/repo/module/model.tf/module_linear_classifier.py | santosh653/ck | 480 | 1672360 | # 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 appl... | 0 | 1 | 0 | 0 | 1 | 0 |
env/lib/python3.6/site-packages/scipy/sparse/csgraph/tests/test_spanning_tree.py | anthowen/duplify | 6,989 | 1672365 | """Test the minimum spanning tree function"""
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import assert_
import numpy.testing as npt
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import minimum_spanning_tree
def test_minimum_spanning_tree():
... | 0 | 0 | 0 | 0 | 0 | 0 |
services/core/ExternalData/external_data/agent.py | cloudcomputingabc/volttron | 406 | 1672374 | <gh_stars>100-1000
# -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
#
# Copyright 2020, Battelle Memorial Institute.
#
# 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 Licens... | 0 | 0 | 0 | 0 | 0 | 0 |
cfgov/v1/admin.py | Colin-Seifer/consumerfinance.gov | 156 | 1672383 | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from login.email import send_password_reset_email
from v1.models import Contact, PortalCategory, PortalTopic
admin.site.register(Contact)
admin.site.unregister(User)
@admin.register(User)
c... | 0 | 4 | 2 | 0 | 6 | 0 |
tensorflow/python/kernel_tests/boosted_trees/resource_ops_test.py | abhaikollara/tensorflow | 848 | 1672389 | # 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-2.0
#
# Unless required by applica... | 0 | 0 | 0 | 0 | 0 | 0 |
core/yolov3.py | XiaoJake/Image-Adaptive-YOLO | 144 | 1672393 | #! /usr/bin/env python
# coding=utf-8
from __future__ import annotations
import numpy as np
import tensorflow as tf
import core.utils as utils
import core.common as common
import core.backbone as backbone
from core.config import cfg
import time
class YOLOV3(object):
"""Implement tensoflow yolov3 here"""
def... | 4 | 7 | 0 | 0 | 11 | 0 |
make_huge_world.py | MestreLion/mcedit | 146 | 1672395 | import pymclevel
from pymclevel.minecraft_server import MCServerChunkGenerator
from pymclevel import BoundingBox
import logging
logging.basicConfig(level=logging.INFO)
gen = MCServerChunkGenerator()
half_width = 4096
gen.createLevel("HugeWorld", BoundingBox((-half_width, 0, -half_width), (half_width, 0, half_width))... | 0 | 0 | 0 | 0 | 0 | 0 |
release/stubs.min/Autodesk/Revit/DB/__init___parts/Document.py | htlcnn/ironpython-stubs | 182 | 1672460 | from __future__ import annotations
class Document(object,IDisposable):
""" An object that represents an open Autodesk Revit project. """
def AutoJoinElements(self):
"""
AutoJoinElements(self: Document)
Forces the elements in the Revit document to automatically join to their
neighbors where appr... | 6 | 0 | 9 | 0 | 15 | 0 |
examples/scripts/cdl/cbpdndl_md_gry.py | vishalbelsare/sporco | 217 | 1672464 | <gh_stars>100-1000
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the SPORCO package. Details of the copyright
# and user license can be found in the 'LICENSE.txt' file distributed
# with the package.
"""
Convolutional Dictionary Learning with Spatial Mask
========================================... | 0 | 0 | 0 | 0 | 0 | 0 |
sympy/physics/quantum/pauli.py | iamabhishek0/sympy | 603 | 1672468 | from __future__ import annotations
"""Pauli operators and states"""
from sympy import I, Mul, Add, Pow, exp, Integer
from sympy.physics.quantum import Operator, Ket, Bra
from sympy.physics.quantum import ComplexSpace
from sympy.matrices import Matrix
from sympy.functions.special.tensor_functions import KroneckerDelta
... | 0 | 81 | 0 | 0 | 81 | 0 |
anomalib/models/components/freia/modules/base.py | dreaquil/anomalib | 689 | 1672473 | <filename>anomalib/models/components/freia/modules/base.py
"""Base Module."""
# Copyright (c) 2018-2022 <NAME>, Visual Learning Lab Heidelberg.
# SPDX-License-Identifier: MIT
#
# flake8: noqa
# pylint: skip-file
# type: ignore
# pydocstyle: noqa
from typing import Iterable, List, Tuple
import torch.nn as nn
from to... | 0 | 0 | 0 | 0 | 0 | 0 |
qd3dt/core/anchor/anchor_generator.py | mengmengliu1998/qd-3dt | 384 | 1672476 | from __future__ import annotations
import torch
class AnchorGenerator(object):
def __init__(self, base_size, scales, ratios, scale_major: bool=True, ctr: object | None=None):
self.base_size = base_size
self.scales = torch.Tensor(scales)
self.ratios = torch.Tensor(ratios)
self.scal... | 6 | 5 | 0 | 0 | 11 | 0 |
libs/numpy/doc/ufuncs.py | rocketbot-cl/recognition | 353 | 1672482 | <gh_stars>100-1000
"""
===================
Universal Functions
===================
Ufuncs are, generally speaking, mathematical functions or operations that are
applied element-by-element to the contents of an array. That is, the result
in each output array element only depends on the value in the corresponding... | 0 | 0 | 0 | 0 | 0 | 0 |
1_detectron_infer/infer_airbus.py | zitongzhan/kaggle_airbus_ship_detection | 254 | 1672483 | <gh_stars>100-1000
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from collections import defaultdict
import argparse
import cv2 # NOQA (Must import before importing caffe2 due to bug in cv2)
import glob
import loggi... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/tests_preprocessing/test_encoding_selector.py | stjordanis/mljar-supervised | 1,882 | 1672507 | <reponame>stjordanis/mljar-supervised<filename>tests/tests_preprocessing/test_encoding_selector.py
import unittest
import tempfile
import numpy as np
import pandas as pd
from supervised.preprocessing.encoding_selector import EncodingSelector
from supervised.preprocessing.preprocessing_categorical import PreprocessingCa... | 0 | 0 | 0 | 0 | 0 | 0 |
pymc/tests/test_mixture.py | MarcoGorelli/pymc | 1,554 | 1672558 | # Copyright 2020 The PyMC Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 2 | 6 | 0 | 0 | 8 | 0 |
Python/Syntax/Yield2.py | piovezan/SOpt | 148 | 1672569 | <filename>Python/Syntax/Yield2.py
def impar(elems):
for i in elems:
if i % 2:
yield i
for x in impar(range(1000)):
def numeros():
yield 1
yield 2
yield 3
print numeros()
print numeros()
print numeros()
#https://pt.stackoverflow.com/q/92921/101
| 0 | 0 | 0 | 0 | 0 | 0 |
models/xlnet/modeling.py | doojin88/embedding | 386 | 1672575 | <gh_stars>100-1000
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
def gelu(x):
"""Gaussian Error Linear Unit.
This is a smoother version of the RELU.
Original paper: https://arxiv.org/abs/1606.08415
Args... | 0 | 0 | 0 | 0 | 0 | 0 |
src/fitly/app.py | ethanopp/fitly | 107 | 1672582 | <reponame>ethanopp/fitly<gh_stars>100-1000
from . import create_flask, create_dash, db_startup
from .layouts import main_layout_header, main_layout_sidebar
from apscheduler.schedulers.background import BackgroundScheduler
from .utils import spotify_credentials_supplied
# The Flask instance
server = create_flask()
# T... | 0 | 0 | 0 | 0 | 0 | 0 |
python/tf_cnn_benchmarks/benchmark_cnn_distributed_test.py | joehandzik/dlcookbook-dlbs | 123 | 1672585 | <filename>python/tf_cnn_benchmarks/benchmark_cnn_distributed_test.py
# 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... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/providers/google/cloud/utils/test_mlengine_prediction_summary.py | takuti/airflow | 8,092 | 1672604 | # 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
# "License"); you may not u... | 0 | 2 | 0 | 0 | 2 | 0 |
lldb/test/API/lang/swift/implementation_only_imports/library_resilient/TestLibraryResilient.py | LaudateCorpus1/llvm-project-staging | 605 | 1672611 | # TestLibraryResilient.py
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2019 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
# See https://swift.org/CONTRIBUTO... | 0 | 1 | 0 | 0 | 1 | 0 |
main.py | hack654a/w12scan-client | 159 | 1672612 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2019/1/14 4:35 PM
# @Author : w8ay
# @File : main.py
import os
import random
import sys
import threading
import time
from config import THREAD_NUM, DEBUG, NODE_NAME
from lib.data import PATHS, logger
from lib.engine import Schedular
from lib.redis import ... | 0 | 1 | 0 | 0 | 1 | 0 |
tlslite/session.py | jayvdb/tlslite | 2,151 | 1672633 | <reponame>jayvdb/tlslite
# Authors:
# <NAME>
# <NAME> (Arcode Corporation) - canonicalCipherName
#
# See the LICENSE file for legal information regarding use of this file.
"""Class representing a TLS session."""
from .utils.compat import *
from .mathtls import *
from .constants import *
class Session(object):
... | 0 | 0 | 0 | 0 | 0 | 0 |
python/surf/devices/transceivers/_Qsfp.py | slaclab/surf | 134 | 1672662 | #-----------------------------------------------------------------------------
# Description:
#
# Based on SFF-8636 Rev Rev 2.10a (24SEPT2019)
# https://members.snia.org/document/dl/26418
#
#-----------------------------------------------------------------------------
# This file is part of the 'SLAC Firmware Standard ... | 0 | 0 | 0 | 0 | 0 | 0 |
miniconda3-lnx/pyzo-4.10.2/source/pyzo/yoton/tests/hops.py | Thibaut-Kovaltchouk/MultiPyzo | 235 | 1672669 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
# This example creates three contexts that are connected in a row.
# A message is send at the first and received at the last.
import yoton
# Three contexts
verbosity = 2
c1 = yoton.Context(verbosity)
c2 = yoton.Context(verbosity)
c3 = yoton.Context(verbosity)
c4 = yoton.Cont... | 0 | 0 | 0 | 0 | 0 | 0 |
__scraping__/wordpress.org - support - BS/main.py | whitmans-max/python-examples | 140 | 1672701 | <reponame>whitmans-max/python-examples<gh_stars>100-1000
#!/usr/bin/env python3
# date: 2020.06.14
# https://stackoverflow.com/questions/62373373/bs4-fetching-thread-titles-description-plus-more-from-wordpress-org-support-fo
import requests
from bs4 import BeautifulSoup as BS
session = requests.Session()
session.hea... | 0 | 0 | 0 | 0 | 0 | 0 |
custom_components/tesla_custom/button.py | carleeno/tesla | 108 | 1672705 | <reponame>carleeno/tesla<filename>custom_components/tesla_custom/button.py<gh_stars>100-1000
"""Support for Tesla charger buttons."""
from custom_components.tesla_custom.const import ICONS
import logging
_LOGGER = logging.getLogger(__name__)
from homeassistant.components.button import ButtonEntity
from . import DOMA... | 0 | 0 | 0 | 0 | 0 | 0 |
wavelet.py | monocilindro/Python-Practical-Application-on-Climate-Variability-Studies | 125 | 1672717 | def wavelet(Y,dt,pad: float=0.,dj: float=0.25,s0=-1,J1=-1,mother: str="MORLET",param=-1) -> tuple[object, object, object, object]:
"""
This function is the translation of wavelet.m by Torrence and Compo
import wave_bases from wave_bases.py
The following is the original comment in wavelet.m
#WAVELET 1D W... | 3 | 1 | 0 | 0 | 4 | 0 |
ryu/tests/integrated/test_vrrp_multi.py | shivani305/ryu | 269 | 1672728 | # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013 <NAME> <yamahata at valinux co jp>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apac... | 0 | 2 | 2 | 1 | 5 | 0 |
python/oneflow/compatible/single_client/test/ops/test_TestMultiOutputOrder.py | wangyuyue/oneflow | 3,285 | 1672732 | <filename>python/oneflow/compatible/single_client/test/ops/test_TestMultiOutputOrder.py
"""
Copyright 2020 The OneFlow 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
... | 0 | 0 | 0 | 0 | 0 | 0 |
old/ex6_1a_ae_fc_mnist_mc.py | soyoung9306/-3-keras | 200 | 1672744 | ###########################
# AE 모델링
###########################
from keras import layers, models # (Input, Dense), (Model)
class AE(models.Model):
def __init__(self, x_nodes: int=784, z_dim: int=36):
x_shape = (x_nodes,)
x = layers.Input(shape=x_shape)
z = layers.Dense(z_dim, activation... | 2 | 2 | 0 | 0 | 4 | 0 |
piwise/network.py | huyalvchuan/piwise | 418 | 1672787 | <filename>piwise/network.py<gh_stars>100-1000
import torch
import torch.nn as nn
import torch.nn.init as init
import torch.nn.functional as F
from torch.utils import model_zoo
from torchvision import models
class FCN8(nn.Module):
def __init__(self, num_classes):
super().__init__()
feats = list(m... | 0 | 0 | 0 | 0 | 0 | 0 |
rlcard/games/mahjong/game.py | randombenj/rlcard | 1,735 | 1672828 | import numpy as np
from copy import deepcopy
from rlcard.games.mahjong import Dealer
from rlcard.games.mahjong import Player
from rlcard.games.mahjong import Round
from rlcard.games.mahjong import Judger
class MahjongGame:
def __init__(self, allow_step_back: bool=False):
'''Initialize the class MajongGam... | 1 | 9 | 0 | 1 | 11 | 0 |
brewpi-script/scriptlibs/BrewPiUtil.py | fossabot/fermentrack | 114 | 1672842 | # Copyright 2013 BrewPi
# This file is part of BrewPi.
# BrewPi is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# BrewPi is distribut... | 5 | 7 | 0 | 0 | 12 | 0 |
tests/test_decompilerjadx.py | amimo/androguard | 4,084 | 1672848 | from __future__ import annotations
import unittest
import sys
import re
import os
from androguard.misc import AnalyzeAPK
from androguard.decompiler.decompiler import DecompilerJADX
def which(program) -> object | None:
"""
Thankfully copied from https://stackoverflow.com/a/377028/446140
"""
def is_exe... | 0 | 2 | 0 | 0 | 2 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.