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 |
|---|---|---|---|---|---|---|---|---|---|---|
unshorten_url.py | DazEB2/SimplePyScripts | 117 | 3313544 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
# SOURCE: https://ru.stackoverflow.com/a/847070/201445
import requests
def unshorten_url(url) -> object:
return requests.head(url, allow_redirects=True).url
if __name__ == '__main__':
url = 'https://goo.gl/7RvxZh'
print(unshorte... | 0 | 1 | 0 | 0 | 1 | 0 |
release.py | jasper-perf/japicmp | 576 | 3313549 | #!/usr/bin/python
import sys, getopt
import subprocess
import os
import fileinput
def main(argv):
(gpgpassphrase, dryRun, devVersion, releaseVersion, releaseTag, oldVersion) = parseCli(argv)
replaceOldVersion(oldVersion, releaseVersion, dryRun)
releaseBuild(gpgpassphrase, dryRun, devVersion, releaseVersion, relea... | 0 | 1 | 0 | 0 | 1 | 0 |
tests/test_encoding/check_estimator_encoders.py | janrito/feature_engine | 650 | 3313579 | <reponame>janrito/feature_engine<filename>tests/test_encoding/check_estimator_encoders.py
import pytest
from sklearn.utils.estimator_checks import check_estimator
from feature_engine.encoding import (
CountFrequencyEncoder,
DecisionTreeEncoder,
MeanEncoder,
OneHotEncoder,
OrdinalEncoder,
PRatio... | 0 | 0 | 0 | 0 | 0 | 0 |
utils/pytool/pydygateway.py | madehao/ABTestingGateway | 1,827 | 3313586 | # -*- coding:utf-8 -*-
#!/usr/bin/env python
import argparse, requests
import sys, string, time
from xml.parsers.expat import ParserCreate
try:
import json
except:
import simplejson as json
cmdFileMode = 'cmd file mode'
cmdInteractMode = 'cmd interaction mode'
specialArgs = ['host']
commonArgs = ['add_upstr... | 0 | 0 | 0 | 0 | 0 | 0 |
DenseASPP_PyTorch/denseaspp.py | lx709/PyTorch_Semantic_Segmentation | 195 | 3313595 | <gh_stars>100-1000
'''
[description]
DenseASPP
'''
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchsummary import summary
import resnet101
class _DenseASPPHead(nn.Module):
def __init__(self, in_channels, class_num, norm_layer=nn.BatchNorm2d, norm_kwargs=None, **kwargs):
... | 0 | 0 | 0 | 0 | 0 | 0 |
piwheels/monitor/tui/dialogs.py | jgillis/piwheels | 120 | 3313615 | <reponame>jgillis/piwheels
#!/usr/bin/env python
# The piwheels project
# Copyright (c) 2017 <NAME> <https://github.com/bennuttall>
# Copyright (c) 2017 <NAME> <<EMAIL>>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are m... | 0 | 0 | 0 | 0 | 0 | 0 |
src/api-service/__app__/onefuzzlib/events.py | tonybaloney/onefuzz | 2,692 | 3313620 | #!/usr/bin/env python
#
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import logging
from typing import List
from onefuzztypes.events import Event, EventMessage, EventType, get_event_type
from onefuzztypes.models import UserInfo
from pydantic import BaseModel
from .azure.creds import get_i... | 6 | 5 | 2 | 0 | 13 | 0 |
datmo/core/storage/driver/tests/test_blitzdb_dal_driver.py | dmh43/datmo | 331 | 3313639 | <reponame>dmh43/datmo
"""
Tests for blitzdb_dal_driver.py
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import tempfile
import datetime
import platform
from datmo.core.storage.driver.blitzdb_dal_driver import BlitzDBDALDriver
from datmo.cor... | 0 | 0 | 0 | 0 | 0 | 0 |
exploits_builder.py | chenjj/EmailFuzz | 741 | 3313644 | from common.common import *
class ExploitsBuilder(object):
def __init__(self, test_cases, config):
self.config = config
self.case_id = config['case_id'].decode("utf-8")
self.mode = config['mode']
self.test_cases = self.fixup_test_case_data(test_cases)
def fixup_test_case_data(self, t) -> object:
if self... | 0 | 3 | 0 | 0 | 3 | 0 |
tests/hierarchical/test_hier_prototyping_1.py | jmabry/pyaf | 377 | 3313662 | import pandas as pd
import numpy as np
import pyaf.ForecastEngine as autof
import pyaf.Bench.TS_datasets as tsds
import datetime
#get_ipython().magic('matplotlib inline')
trainfile = "data/Hierarchical/hts_dataset.csv"
lDateColumn = 'Date'
df = pd.read_csv(trainfile, sep=r',', engine='python', skiprows=0);
df[lDat... | 0 | 0 | 0 | 0 | 0 | 0 |
src/ddpg/batch_norm.py | jimkon/Deep-Reinforcement-Learning-in-Large-Discrete-Action-Spaces | 154 | 3313687 | from __future__ import annotations
import tensorflow as tf
decay = 0.95
TAU = 0.001
class Batch_norm:
def __init__(self, inputs, size, is_training, sess, parForTarget: object | None=None, bn_param: object | None=None) -> object:
self.sess = sess
self.scale = tf.Variable(tf.random_uniform([size], ... | 2 | 3 | 0 | 0 | 5 | 0 |
pacu/modules/apigateway__enum/main.py | kingofthebeat/pacu | 2,582 | 3313697 | #!/usr/bin/env python3
from __future__ import annotations
import argparse
import os
from pathlib import Path
import pprint
import json
import time
from pacu.core.lib import downloads_dir
module_info = {
'name': 'enum__apigateway',
'author': '<NAME> <EMAIL>',
'category': 'ENUM',
'one_liner': 'Enumerat... | 1 | 9 | 0 | 0 | 10 | 0 |
python/server/response_stream.py | userlea/BatchExplorer | 111 | 3313715 | import asyncio
class ResponseStreamManager:
def __init__(self):
self.loop = asyncio.new_event_loop()
class ResponseStream:
def __init__(self):
self.callbacks: list[object] = []
def onData(self, callback):
self.callbacks.append(callback)
async def send(self, data, last: bool =... | 1 | 0 | 0 | 1 | 2 | 0 |
BuildTools/tidy.py | DoctorVanGogh/AvalonEdit | 1,390 | 3313718 | <reponame>DoctorVanGogh/AvalonEdit<filename>BuildTools/tidy.py
import os, sys
def check(filename):
ok = True
with open(filename, 'r') as f:
for i, line in enumerate(f):
if line.startswith(' '):
print('{}:{}: Line starting with spaces. Use tabs for indentation instead!'.forma... | 0 | 0 | 0 | 0 | 0 | 0 |
src/mcedit2/imports.py | elcarrion06/mcedit2 | 673 | 3313750 | """
imports
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
from PySide import QtCore, QtGui
from PySide.QtCore import Qt
from mcedit2.handles.boxhandle import BoxHandle
from mcedit2.rendering.depths import DepthOffsets
from mcedit2.rendering.scenegraph.matrix i... | 2 | 16 | 1 | 8 | 27 | 0 |
dash_docs/chapters/dash_html_components/__init__.py | joelostblom/dash-docs | 379 | 3313772 | <reponame>joelostblom/dash-docs<gh_stars>100-1000
from .import index
from .import content_module
| 0 | 0 | 0 | 0 | 0 | 0 |
chrome/test/functional/bookmark_bar.py | Scopetta197/chromium | 212 | 3313785 | <reponame>Scopetta197/chromium<gh_stars>100-1000
#!/usr/bin/env python
# Copyright (c) 2011 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 time
import unittest
import pyauto_functional
import pyauto
class Bookmar... | 0 | 0 | 0 | 0 | 0 | 0 |
samcli/lib/iac/cfn/cfn_iac.py | zhuhaow/aws-sam-cli | 2,959 | 3313788 | <gh_stars>1000+
"""
Provide a CFN implementation of IaCPluginInterface
"""
import os
import logging
from typing import List, Optional
from urllib.parse import unquote, urlparse
import jmespath
from samcli.lib.utils.packagetype import IMAGE, ZIP
from samcli.lib.iac.constants import PARAMETER_OVERRIDES, GLOBAL_PARAMET... | 0 | 0 | 0 | 0 | 0 | 0 |
websauna/tests/core/test_frontpage.py | stevepiercy/websauna | 286 | 3313793 | <filename>websauna/tests/core/test_frontpage.py
def test_frontpage(web_server, browser, ini_settings):
"""Open the front page as anonymous user."""
b = browser
b.visit(web_server)
site_name = ini_settings["websauna.site_name"]
element = b.find_by_css("h1#front-page-title")
assert len(element) ... | 0 | 0 | 0 | 0 | 0 | 0 |
step26_lambda_destination/example00_lambda_destination_event_bridge/Python/example00_lambda_destination_event_bridge/lambda/app.py | fullstackwebdev/full-stack-serverless-cdk | 192 | 3313797 | <filename>step26_lambda_destination/example00_lambda_destination_event_bridge/Python/example00_lambda_destination_event_bridge/lambda/app.py
import boto3
import json
import os
from botocore.exceptions import ClientError
def handler(event):
print('request: {}'.format(json.dumps(event)))
try:
topic_arn... | 0 | 0 | 0 | 0 | 0 | 0 |
cli.py | JackEasons/SerpentAI | 6,762 | 3313844 | import warnings
warnings.filterwarnings("ignore") # Silence warnings in CLI
import os
import pathlib
import shutil
import subprocess
# Some imports are inline in CLI commands to keep initialization times low
import click
from serpent.utilities import (
clear_terminal,
display_serpent_logo,
is_windows,... | 0 | 5 | 0 | 0 | 5 | 0 |
notify-server/notify_server/models/topics.py | anuwrag/opentrons | 235 | 3313860 | """Event topics."""
import enum
class RobotEventTopics(str, enum.Enum):
"""All robot-server event topics."""
HARDWARE_EVENTS: str = "hardware_events"
| 0 | 0 | 1 | 0 | 1 | 0 |
tests/test_result.py | RevanMacQueen/HpBandSter | 546 | 3313877 | <reponame>RevanMacQueen/HpBandSter
import unittest
from hpbandster.core.result import Run, extract_HBS_learning_curves, \
json_result_logger, logged_results_to_HBS_result
from hpbandster.core.base_iteration import Datum
import ConfigSpace as CS
import tempfile
import sys
import os.path
class TestResult(unittest... | 0 | 0 | 0 | 0 | 0 | 0 |
test/probe/test_object_versioning.py | fossabot/swift-1 | 1,802 | 3313878 | <filename>test/probe/test_object_versioning.py<gh_stars>1000+
#!/usr/bin/python -u
# Copyright (c) 2010-2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:/... | 0 | 0 | 0 | 0 | 0 | 0 |
model_compiler/src/model_compiler/compilers/tf_model_file_to_tf_model.py | yuanliya/Adlik | 548 | 3313896 | # Copyright 2019 ZTE corporation. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import tensorflow as tf
from . import repository
from .. import utilities
from ..models.irs.tf_model import Input, TensorFlowModel
from ..models.sources.tf_model_file import TfModelFile
from ..tensorflow_util import Config, g... | 2 | 2 | 0 | 0 | 4 | 0 |
insights/parsers/tests/test_blkid.py | mglantz/insights-core | 121 | 3313906 | from insights.parsers.blkid import BlockIDInfo
from insights.tests import context_wrap
BLKID_INFO = """
/dev/sda1: UUID="3676157d-f2f5-465c-a4c3-3c2a52c8d3f4" TYPE="xfs"
/dev/sda2: UUID="UVTk76-UWOc-vk7s-galL-dxIP-4UXO-0jG4MH" TYPE="LVM2_member"
/dev/mapper/rhel_hp--dl160g8--3-root: UUID="11124c1d-990b-4277-9f74-c5a34... | 0 | 0 | 0 | 0 | 0 | 0 |
lib/GANDCTAnalysis/compute_mean_var.py | vwesselkamp/deepfake-fingerprint-atacks | 108 | 3313910 | <reponame>vwesselkamp/deepfake-fingerprint-atacks
import argparse
import os
import numpy as np
from src.dataset import image_paths
from src.image_np import dct2, load_image
from src.math import log_scale, welford
def main(args):
paths = list()
for data in args.DATASETS:
paths += image_paths(data)[:a... | 0 | 0 | 0 | 0 | 0 | 0 |
test_schema_validation.py | CodeMonk/pyresttest | 1,193 | 3313915 | # Tests for autoloading schema validation module
| 0 | 0 | 0 | 0 | 0 | 0 |
thirdparty/nsiqcppstyle/rules/RULE_10_1_A_do_not_use_bufferoverflow_risky_function_for_unix.py | cfsengineering/tigl | 171 | 3313921 | <gh_stars>100-1000
"""
Do not use buffer overflow risky functions in unix env.
if they're found, this rule reports a volation.
== Buffer Overflow Risky Function List ==
- strcpy()
- strcat()
- sprintf()
- vsprintf()
- gets()
- realpath()
- getopt()
- getpass()
- streadd()
-... | 0 | 0 | 0 | 0 | 0 | 0 |
1000-1100q/1080.py | rampup01/Leetcode | 990 | 3313925 | from __future__ import annotations
'''
Given the root of a binary tree, consider all root to leaf paths: paths from the root to any leaf. (A leaf is a node with no children.)
A node is insufficient if every such root to leaf path intersecting this node has sum strictly less than limit.
Delete all insufficient nodes ... | 0 | 2 | 0 | 0 | 2 | 0 |
tests/test_onnxml_label_encoder_converter.py | vumichien/hummingbird | 2,772 | 3313931 | <gh_stars>1000+
"""
Tests onnxml LabelEncoder converter
"""
from distutils.version import LooseVersion
import unittest
import warnings
import numpy as np
from sklearn.preprocessing import LabelEncoder
import torch
from hummingbird.ml._utils import onnx_ml_tools_installed, onnx_runtime_installed, lightgbm_installed
fr... | 0 | 0 | 0 | 0 | 0 | 0 |
sandbox/grist/test_replay.py | nataliemisasi/grist-core | 2,667 | 3313934 | <reponame>nataliemisasi/grist-core
"""
Replay binary data sent from JS to reproduce behaviour in the sandbox.
This isn't really a test and it doesn't run under normal circumstances,
but it's convenient to run it alongside other tests to measure total coverage.
This is a tool to directly run some python code of intere... | 0 | 0 | 0 | 0 | 0 | 0 |
cirq-ionq/cirq_ionq/sampler_test.py | Saibaba-Alapati/Cirq | 3,326 | 3313974 | <reponame>Saibaba-Alapati/Cirq
# Copyright 2020 The Cirq 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | 0 | 0 | 0 | 0 | 0 | 0 |
lib/smpl.py | Lotayou/tex2shape | 246 | 3313998 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import annotations
import sys
import chumpy as ch
import scipy.sparse as sp
from chumpy.ch import Ch
from vendor.smpl.posemapper import posemap, Rodrigues
from vendor.smpl.serialization import backwards_compatibility_replacements
from ch_ext import sp_... | 0 | 3 | 2 | 0 | 5 | 0 |
Validation/Configuration/python/gemSimValid_cff.py | Purva-Chaudhari/cmssw | 852 | 3314004 | import FWCore.ParameterSet.Config as cms
from Validation.MuonGEMHits.MuonGEMHits_cff import *
from Validation.MuonGEMDigis.MuonGEMDigis_cff import *
from Validation.MuonGEMRecHits.MuonGEMRecHits_cff import *
from DQM.GEM.GEMDQM_cff import *
GEMDigiSource.modeRelVal = True
GEMRecHitSource.modeRelVal = True
gemSimVali... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_bvll/__init__.py | amih90/bacpypes | 240 | 3314014 | #!/usr/bin/python
"""
Test BVLL Module
"""
from . import test_codec
from . import test_simple
from . import test_foreign
from . import test_bbmd
| 0 | 0 | 0 | 0 | 0 | 0 |
speecht/speech_input.py | Mehdi-Habibi/MySpeechT | 154 | 3314072 | # Copyright 2016 <NAME>. 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 agree... | 2 | 8 | 0 | 1 | 11 | 0 |
py/moma/sensors/robot_arm_sensor.py | wx-b/dm_robotics | 128 | 3314081 | # Copyright 2020 DeepMind Technologies Limited.
#
# 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... | 9 | 7 | 0 | 1 | 17 | 0 |
tests/cpydiff/syntax_unicode_nameesc.py | learnforpractice/micropython-cpp | 13,648 | 3314096 | """
categories: Syntax,Unicode
description: Unicode name escapes are not implemented
cause: Unknown
workaround: Unknown
"""
print("\N{LATIN SMALL LETTER A}")
| 0 | 0 | 0 | 0 | 0 | 0 |
Torch-1 DDPG/Torch-4 DDPG GPU 重构和可视化/agent/access.py | summerRainn/DeepLearningNotes | 345 | 3314127 | <filename>Torch-1 DDPG/Torch-4 DDPG GPU 重构和可视化/agent/access.py
"""
@author: Young
@license: (C) Copyright 2013-2017
@contact: <EMAIL>
@file: access.py
@time: 2018/1/18 20:51
"""
from collections import namedtuple
import random
import numpy as np
Memory = namedtuple("Memory",
["state", "action", "r... | 0 | 0 | 0 | 0 | 0 | 0 |
hubblestack/grains/default_gw.py | buddwm/hubble | 363 | 3314128 | # -*- coding: utf-8 -*-
from __future__ import annotations
"""
Populates grains which describe whether a server has a default gateway
configured or not. Uses `ip -4 route show` and `ip -6 route show` and greps
for a `default` at the beginning of any line.
If the `ip` command is unavailable, no grains will be populated... | 0 | 1 | 0 | 0 | 1 | 0 |
pyethapp/validator_service.py | josephites/pyethapp | 1,519 | 3314150 | from __future__ import annotations
from __future__ import print_function
import time
import random
import gevent
from devp2p.service import BaseService
from ethereum.slogging import get_logger
from ethereum.utils import privtoaddr, encode_hex, sha3
from ethereum.casper_utils import generate_validation_code, call_casper... | 1 | 5 | 2 | 5 | 13 | 0 |
gallery/matplotlib/tornado/tornado.py | sivakar94/gif-1 | 485 | 3314235 | import gif
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
N = 100
@gif.frame
def plot_spiral(i):
fig = plt.figure(figsize=(5, 3), dpi=100)
ax = fig.gca(projection="3d")
a, b = 0.5, 0.2
th = np.linspace(475, 500, N)
x = a * np.exp(b * th) * np.cos(th)
... | 0 | 0 | 0 | 0 | 0 | 0 |
neurvps/models/conic.py | keatonkraiger/neurvps | 133 | 3314248 | import torch
from torch import nn
from torch.nn.modules.utils import _pair
from neurvps.config import M
from neurvps.models.deformable import DeformConv
class ConicConv(nn.Module):
def __init__(self, c_in, c_out, kernel_size: int=3, bias: bool=False):
super().__init__()
self.deform_conv = DeformC... | 2 | 1 | 0 | 0 | 3 | 0 |
gymfc/msgs/State_pb2.py | xabierolaz/gymfc | 270 | 3314282 | <reponame>xabierolaz/gymfc
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: State.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf im... | 0 | 0 | 0 | 0 | 0 | 0 |
nuplan/database/nuplan_db/tests/test_lidar_box.py | motional/nuplan-devkit | 128 | 3314303 | <reponame>motional/nuplan-devkit
import unittest
from copy import deepcopy
from sys import maxsize
from unittest.mock import MagicMock, Mock, PropertyMock, patch
import numpy as np
from pyquaternion import Quaternion
from nuplan.common.actor_state.agent import Agent
from nuplan.common.actor_state.static_object import... | 0 | 0 | 0 | 0 | 0 | 0 |
webrecorder/webrecorder/models/auto.py | ssteo/webrecorder | 1,217 | 3314304 | <filename>webrecorder/webrecorder/models/auto.py
from webrecorder.models.base import RedisUniqueComponent
import json
import requests
import os
from urllib.parse import urlsplit
# ============================================================================
class Auto(RedisUniqueComponent):
MY_TYPE = 'auto'
AL... | 0 | 0 | 0 | 0 | 0 | 0 |
tf_quant_finance/experimental/pricing_platform/framework/core/daycount_conventions.py | slowy07/tf-quant-finance | 3,138 | 3314312 | <reponame>slowy07/tf-quant-finance
# Lint as: python3
# Copyright 2020 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unles... | 0 | 0 | 0 | 0 | 0 | 0 |
cooka/service/experiment_service.py | DataCanvasIO/Cooka | 222 | 3314320 | # -*- encoding: utf-8 -*-
from __future__ import annotations
from collections import OrderedDict
from cooka.common import consts
from cooka.common.exceptions import EntityNotExistsException
from cooka.common.model import ExperimentConf, TrainJobConf, FrameworkType, JobStep, TrainStep, CrossValidation, \
TrainValida... | 20 | 25 | 4 | 0 | 49 | 0 |
DQM/EcalCommon/python/EcalMEFormatter_cfi.py | ckamtsikis/cmssw | 852 | 3314323 | import FWCore.ParameterSet.Config as cms
from DQMServices.Core.DQMEDHarvester import DQMEDHarvester
from DQM.EcalMonitorTasks.ClusterTask_cfi import ecalClusterTask
from DQM.EcalMonitorTasks.EnergyTask_cfi import ecalEnergyTask
from DQM.EcalMonitorTasks.IntegrityTask_cfi import ecalIntegrityTask
from DQM.EcalMonitorTa... | 0 | 0 | 0 | 0 | 0 | 0 |
dashboard/chart.py | DongjunLee/kino-bot | 109 | 3314334 |
from __future__ import annotations
import arrow
import calendar
import copy
import datetime
from dateutil import parser
import math
import random
import plotly.express as px
import plotly.figure_factory as ff
import plotly.graph_objs as go
from plotly.subplots import make_subplots
from data_handler import DataHandle... | 0 | 14 | 0 | 0 | 14 | 0 |
vidstab/layer_utils.py | LS11111/video | 487 | 3314341 | <reponame>LS11111/video
import cv2
import numpy as np
from .frame import Frame
def layer_overlay(foreground, background):
"""put an image over the top of another
Intended for use in VidStab class to create a trail of previous frames in the stable video output.
:param foreground: image to be laid over to... | 0 | 0 | 0 | 0 | 0 | 0 |
guillotina/auth/users.py | rboixaderg/guillotina | 173 | 3314346 | from __future__ import annotations
from guillotina.interfaces import Allow
from guillotina.interfaces import IPrincipal
from typing import Optional
from zope.interface import implementer
ROOT_USER_ID = "root"
ANONYMOUS_USER_ID = "Anonymous User"
@implementer(IPrincipal)
class BaseUser:
groups: list
id: str
... | 8 | 6 | 6 | 5 | 25 | 0 |
optimus/engines/base/cudf/columns.py | ironmussa/Optimus | 1,045 | 3314354 | <reponame>ironmussa/Optimus
from abc import abstractmethod
class CUDFBaseColumns():
pass | 0 | 0 | 0 | 0 | 0 | 0 |
holocron/models/pyconvresnet.py | MateoLostanlen/Holocron | 181 | 3314381 | <reponame>MateoLostanlen/Holocron
# Copyright (C) 2019-2021, <NAME>.
# This program is licensed under the Apache License version 2.
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.
import sys
from torch.nn import Module
from holocron.nn import PyConv2d
from .resnet im... | 0 | 0 | 0 | 0 | 0 | 0 |
networks/EDSR/common.py | donegaci/memc-net | 145 | 3314394 | <filename>networks/EDSR/common.py
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
def default_conv(in_channelss, out_channels, kernel_size, bias=True):
return nn.Conv2d(
in_channelss, out_channels, kernel_size,
padding=(kernel_siz... | 0 | 0 | 0 | 0 | 0 | 0 |
cscs-checks/microbenchmarks/cpu/fft/fftw_benchmark.py | CLIP-HPC/reframe | 167 | 3314415 | # Copyright 2016-2021 Swiss National Supercomputing Centre (CSCS/ETH Zurich)
# ReFrame Project Developers. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
import reframe as rfm
import reframe.utility.sanity as sn
@rfm.simple_test
class FFTWTest(rfm.RegressionTest):
exec_mode... | 0 | 2 | 9 | 0 | 11 | 0 |
cadence/tests/test_clock_decision_context.py | simkimsia/temporal-python-sdk | 141 | 3314457 | import json
from typing import Callable
from unittest.mock import MagicMock, Mock
import pytest
from cadence.cadence_types import StartTimerDecisionAttributes, TimerFiredEventAttributes, HistoryEvent, \
TimerCanceledEventAttributes, EventType, MarkerRecordedEventAttributes, Header
from cadence.clock_decision_cont... | 1 | 3 | 2 | 0 | 6 | 0 |
webdataset/fluid.py | OCRoArchive/webdataset | 389 | 3314472 | #
# Copyright (c) 2017-2021 NVIDIA CORPORATION. All rights reserved.
# This file is part of the WebDataset library.
# See the LICENSE file for licensing terms (BSD-style).
#
"""A deprecated interface to WebDataset."""
from .dataset import (
WebDataset,
default_cache_dir,
default_cache_name,
default_c... | 3 | 4 | 0 | 0 | 7 | 0 |
bazel/serf.bzl | arunvc/incubator-pagespeed-mod | 535 | 3314503 | <filename>bazel/serf.bzl
serf_build_rule = """
cc_library(
name = "serf",
srcs = [
"auth/auth.c",
"auth/auth_basic.c",
"auth/auth_digest.c",
"auth/auth_spnego.c",
"auth/auth_spnego_gss.c",
"auth/auth_spnego_sspi.c",
"buckets/aggregate_buckets.c",
... | 0 | 0 | 0 | 0 | 0 | 0 |
rpython/jit/backend/llsupport/test/test_ffisupport.py | nanjekyejoannah/pypy | 381 | 3314514 | <filename>rpython/jit/backend/llsupport/test/test_ffisupport.py
from rpython.rlib.jit_libffi import types, CIF_DESCRIPTION, FFI_TYPE_PP
from rpython.rlib.clibffi import FFI_DEFAULT_ABI
from rpython.rtyper.lltypesystem import lltype, rffi
from rpython.jit.codewriter.longlong import is_64_bit
from rpython.jit.backend.lls... | 0 | 0 | 0 | 0 | 0 | 0 |
simpleAICV/datasets/cocodataset.py | LouieShao/importance_based_downsampling | 154 | 3314538 | from __future__ import annotations
import os
import cv2
import math
import numpy as np
from torch.utils.data import Dataset
from pycocotools.coco import COCO
from pycocotools import mask as maskUtils
COCO_CLASSES = [
'person',
'bicycle',
'car',
'motorcycle',
'airplane',
'bus',
'train',
... | 10 | 14 | 0 | 0 | 24 | 0 |
examples/flava/data/multitask.py | facebookresearch/multimodal | 128 | 3314541 | <gh_stars>100-1000
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import random
import warnings
from functools import partial
from typing import Callable, Lis... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/arkane/species/H/input.py | tza0035/RMG-Py | 250 | 3314555 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
modelChemistry = "CBS-QB3"
useHinderedRotors = True
useBondCorrections = True
species('H', 'H.py')
statmech('H')
thermo('H', 'Wilhoit')
| 0 | 0 | 0 | 0 | 0 | 0 |
src/newt/db/_object.py | bmjjr/db | 153 | 3314636 | import persistent
class Object(persistent.Persistent):
def __init__(self, **kw):
self.__dict__.update(kw)
| 0 | 0 | 0 | 0 | 0 | 0 |
omega_miya/plugins/omega_statistic/__init__.py | rinrini001/omega-miya | 120 | 3314659 | """
@Author : Ailitonia
@Date : 2021/08/15 1:19
@FileName : __init__.py.py
@Project : nonebot2_miya
@Description :
@GitHub : https://github.com/Ailitonia
@Software : PyCharm
"""
from datetime import datetime
from nonebot import on_command, logger
from nonebot.plugin.e... | 12 | 1 | 0 | 0 | 13 | 0 |
vyper/codegen/return_.py | onlymaresia/vyper | 1,471 | 3314666 | <gh_stars>1000+
from typing import Any, Optional
from vyper.address_space import MEMORY
from vyper.codegen.abi_encoder import abi_encode, abi_encoding_matches_vyper
from vyper.codegen.context import Context
from vyper.codegen.core import (
calculate_type_for_external_return,
check_assign,
dummy_node_for_ty... | 0 | 0 | 0 | 0 | 0 | 0 |
milano/exec_utils.py | NVIDIA/Milano | 145 | 3314703 | # Copyright (c) 2018 NVIDIA Corporation
import asyncio
import numpy as np
import pandas as pd
import re
import traceback
from typing import Iterable, Mapping, Any, Tuple, Optional
from .backends.base import Backend, JobStatus, RetrievingJobLogsError, \
IsWorkerAvailableError, GettingJobStatu... | 29 | 12 | 0 | 2 | 43 | 0 |
nodes/1.x/python/String.BinaryToDecimal.py | jdehotin/Clockworkfordynamo | 147 | 3314705 | <reponame>jdehotin/Clockworkfordynamo
binstr = IN[0]
elementlist = []
for bin in binstr:
elementlist.append(int(bin,2))
OUT = elementlist | 0 | 0 | 0 | 0 | 0 | 0 |
data_preparation/visuailization.py | kay-wong/DiscoBERT | 154 | 3314708 | <reponame>kay-wong/DiscoBERT
import torch
def read_single_data(d):
src = d['src']
segs = d['segs']
clss = d['clss']
disco_text = d['disco_txt']
tgt_txt = d['tgt_txt']
d_labels = d['d_labels']
d_span = d['d_span']
assert len(disco_text) == len(d_labels) == len(d_span)
print(tgt_tx... | 0 | 0 | 0 | 0 | 0 | 0 |
zmirror/lru_dict.py | Yamtt/zmirror | 2,550 | 3314771 | # coding=utf-8
from collections import OrderedDict
class LRUDictManual(OrderedDict): # pragma: no cover
"""一个手动实现的LRUDict"""
def __init__(self, size: int=32):
super().__init__()
self.maxsize = size
def __getitem__(self, key) -> object:
value = super().__getitem__(key)
tr... | 1 | 5 | 0 | 0 | 6 | 0 |
sequana/summary.py | khourhin/sequana | 138 | 3314795 | # -*- coding: utf-8 -*-
#
# This file is part of Sequana software
#
# Copyright (c) 2016 - Sequana Development Team
#
# File author(s):
# <NAME> <<EMAIL>>
#
# Distributed under the terms of the 3-clause BSD license.
# The full license is in the LICENSE file, distributed with this software.
#
# website: https... | 5 | 7 | 0 | 6 | 18 | 0 |
alarm/src/save.py | cnof/satori | 249 | 3314840 | <filename>alarm/src/save.py
# -*- coding: utf-8 -*-
# -- stdlib --
import logging
# -- third party --
import gevent
import redis
# -- own --
from state import State
from utils import spawn_autorestart
# -- code --
log = logging.getLogger('save')
def dump():
r = redis.from_url(State.config['redis'])
r.set(... | 0 | 0 | 0 | 0 | 0 | 0 |
EventFilter/L1GlobalTriggerRawToDigi/test/L1GtEvmUnpacker_cfg.py | ckamtsikis/cmssw | 852 | 3314855 | <reponame>ckamtsikis/cmssw
from __future__ import print_function
#
# cfg file to unpack RAW L1 GT EVM data
# V <NAME> 2009-04-03
import FWCore.ParameterSet.Config as cms
# process
process = cms.Process('TestL1GtEvmUnpacker')
print('\n')
from L1Trigger.GlobalTriggerAnalyzer.UserOptions_cff import *
if errorUserOpti... | 0 | 0 | 0 | 0 | 0 | 0 |
Contents/Code/interface/menu_helpers.py | tomerblecher/Sub-Zero.bundle | 1,553 | 3314863 | # coding=utf-8
from __future__ import annotations
import types
import datetime
from func import enable_channel_wrapper, route_wrapper
from support.i18n import is_localized_string, _
from support.items import get_item_thumb
from support.helpers import get_video_display_title, pad_title
from support.ignore import get_de... | 9 | 7 | 0 | 0 | 16 | 0 |
Scripts/sims4communitylib/classes/common_resource_key.py | ColonolNutty/Sims4CommunityLibrary | 118 | 3314899 | """
The Sims 4 Community Library is licensed under the Creative Commons Attribution 4.0 International public license (CC BY 4.0).
https://creativecommons.org/licenses/by/4.0/
https://creativecommons.org/licenses/by/4.0/legalcode
Copyright (c) COLONOLNUTTY
"""
import os
from typing import Union
# ReadTheDocs
from sims... | 9 | 11 | 0 | 0 | 20 | 0 |
ds2/figs/__init__.py | aslisabanci/datastructures | 159 | 3314931 | <filename>ds2/figs/__init__.py<gh_stars>100-1000
from ds2.figs.drawing import *
| 0 | 0 | 0 | 0 | 0 | 0 |
rotkehlchen/tests/api/test_historical_assets_price.py | rotkehlchenio/rotkehlchen | 137 | 3314939 | import random
from http import HTTPStatus
from typing import Any, Dict, List
import pytest
import requests
from rotkehlchen.constants import ZERO
from rotkehlchen.constants.assets import A_CRV, A_USD
from rotkehlchen.fval import FVal
from rotkehlchen.tests.utils.api import (
api_url_for,
assert_error_response... | 2 | 1 | 0 | 0 | 3 | 0 |
gmail/snippet/smime_snippets.py | anuraggoogler/python-samples | 479 | 3314951 | from __future__ import annotations
"""Snippets for managing S/MIME certificate for a user's account.
These snippets appear at:
https://developers.google.com/gmail/api/guides/smime_certs
"""
import base64
import csv
import datetime
from apiclient import errors
# [START create_smime_info]
def create_smime_info(cert_f... | 7 | 3 | 0 | 0 | 10 | 0 |
csvconverter/csvapi.py | elxavicio/QSTK | 339 | 3314952 | import numpy as np
import dircache
from sets import Set
import time
import tables as pt
import sys
import time
import os
from optparse import OptionParser
class TimestampsModel (pt.IsDescription):
timestamp = pt.Time64Col()
#class TimestampsModel ends
class StrategyDataModel(pt.IsDescription):
... | 0 | 0 | 0 | 0 | 0 | 0 |
search/settings/settings_api.py | AmyYH/phantoscope | 144 | 3314959 | # Copyright (C) 2019-2020 Zilliz. 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 ag... | 0 | 1 | 0 | 0 | 1 | 0 |
Modules/ego_planner/ego-planner-swarm/src/uav_simulator/Utils/quadrotor_msgs/src/quadrotor_msgs/msg/_PPROutputData.py | 473867143/Prometheus | 1,217 | 3315006 | <filename>Modules/ego_planner/ego-planner-swarm/src/uav_simulator/Utils/quadrotor_msgs/src/quadrotor_msgs/msg/_PPROutputData.py
"""autogenerated by genpy from quadrotor_msgs/PPROutputData.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
import std_msgs... | 0 | 0 | 0 | 0 | 0 | 0 |
ursina/prefabs/tilemap.py | LyfeOnEdge/ursina | 1,431 | 3315031 | <reponame>LyfeOnEdge/ursina
from ursina import *
from ursina.prefabs.grid_editor import GridEditor, PixelEditor
import re
class Tilemap(GridEditor):
def __init__(self, tilemap='', tileset='', tileset_size=(8,8), **kwargs):
if isinstance(tilemap, str):
self.tilemap = load_texture(tilemap)
... | 0 | 0 | 0 | 0 | 0 | 0 |
testing/examples/descriptor.py | dry-python/dependencies | 175 | 3315038 | <reponame>dry-python/dependencies<filename>testing/examples/descriptor.py
class Foo:
"""Create method descriptor."""
def __get__(self, instance, owner=None):
raise RuntimeError
foo_instance = Foo()
@property
def foo_property(self):
"""Create data descriptor."""
raise RuntimeError
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_solver_variable.py | gaphor/gaphas | 108 | 3315058 | <gh_stars>100-1000
from gaphas.solver import STRONG, Variable, variable
def test_variable_decorator():
class A:
x = variable(varname="sx", strength=STRONG)
a = A()
assert isinstance(A.x, variable)
assert a.x == 0
assert a.x.strength == STRONG
def test_variable_decorator_value():
cl... | 0 | 0 | 0 | 0 | 0 | 0 |
REST/python/Targets/upgrade-targets.py | gdesai1234/OctopusDeploy-Api | 199 | 3315074 | import json
import requests
octopus_server_uri = 'https://your.octopus.app/api'
octopus_api_key = 'API-YOURAPIKEY'
headers = {'X-Octopus-ApiKey': octopus_api_key}
def get_octopus_resource(uri) -> object:
response = requests.get(uri, headers=headers)
response.raise_for_status()
return json.loads(response.... | 0 | 2 | 0 | 0 | 2 | 0 |
zproc/task/result.py | pycampers/zproc | 106 | 3315076 | import zmq
from zproc import util, serializer
class _TaskResultBase:
def __init__(self, server_address: str, task_id: bytes):
#: Passed on from the constructor
self.task_id = task_id
self._zmq_ctx = util.create_zmq_ctx()
self._server_meta = util.get_server_meta(self._zmq_ctx, ser... | 7 | 7 | 0 | 0 | 14 | 0 |
tests/test_transport.py | mrmaxi/smbprotocol | 176 | 3315100 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, <NAME> (@jborean93) <<EMAIL>>
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)
import pytest
import re
import socket
import struct
import threading
import time
from smbprotocol.transport import (
DirectTCPPacket,
Tcp,
)
@py... | 0 | 0 | 0 | 0 | 0 | 0 |
digits/tools/tensorflow/gandisplay.py | gheinrich/DIGITS-GAN | 111 | 3315112 | <reponame>gheinrich/DIGITS-GAN<filename>digits/tools/tensorflow/gandisplay.py
import wxversion
import wx
import numpy as np
import random
import time
# This has been set up to optionally use the wx.BufferedDC if
# USE_BUFFERED_DC is True, it will be used. Otherwise, it uses the raw
# wx.Memory DC , etc.
#USE_BUFFER... | 0 | 0 | 0 | 0 | 0 | 0 |
tutorials/ai-core-aiapi-postman-workflows/files/infer/infer_scikit.py | LarsVlyminckx/Tutorials | 504 | 3315134 | <reponame>LarsVlyminckx/Tutorials
# -*- coding: utf-8 -*-
"""
Inference script that extends from the base infer interface
"""
from os.path import exists
from joblib import load
from flask import Flask, request
app = Flask(__name__)
text_pipeline, target_classes = None, None
@app.before_first_request
def init():
... | 0 | 0 | 0 | 0 | 0 | 0 |
alipay/aop/api/response/AlipayMarketingCampaignCertCreateResponse.py | snowxmas/alipay-sdk-python-all | 213 | 3315138 | <filename>alipay/aop/api/response/AlipayMarketingCampaignCertCreateResponse.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayMarketingCampaignCertCreateResponse(AlipayResponse):
def __init__(self):
super(AlipayMark... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_tutorial/test_many_to_many/test_tutorial002.py | spawn08/sqlmodel | 5,490 | 3315206 | <gh_stars>1000+
from unittest.mock import patch
from sqlmodel import create_engine
from ...conftest import get_testing_print_function
expected_calls = [
[
"Deadpond:",
{"id": 1, "secret_name": "<NAME>", "age": None, "name": "Deadpond"},
],
[
"Deadpond teams:",
[
... | 0 | 0 | 0 | 0 | 0 | 0 |
webserver.py | zhouyonglong/Sequence-Semantic-Embedding | 466 | 3315237 | # coding=utf-8
################################################################################
#
# Copyright (c) 2016 eBay Software Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License a... | 0 | 5 | 0 | 4 | 9 | 0 |
forge/ethyr/torch/policy.py | wwxFromTju/neural-mmo | 1,450 | 3315273 | <reponame>wwxFromTju/neural-mmo<gh_stars>1000+
#Previous networks tried. Fully connected nets are much
#easier to get working than conv nets.
from pdb import set_trace as T
import torch
from torch import nn
from torch.nn import functional as F
from forge.ethyr.torch import utils as tu
class Attention(nn.Module):
d... | 0 | 0 | 0 | 0 | 0 | 0 |
ffjord_tabular.py | jirufengyu/ode | 214 | 3315281 | from __future__ import annotations
"""
FFJORD on MNIST, implemented with Haiku.
"""
import argparse
import collections
import os
import pickle
import sys
import time
import haiku as hk
import jax
import jax.numpy as jnp
from jax import lax
from jax.config import config
from jax.experimental import optimizers
from jax.... | 0 | 34 | 0 | 0 | 34 | 0 |
tensorboard/plugins/hparams/get_experiment.py | Digitaltransform/tensorboard | 6,139 | 3315312 | <filename>tensorboard/plugins/hparams/get_experiment.py
# Copyright 2019 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... | 0 | 0 | 0 | 0 | 0 | 0 |
insights/parsers/tests/test_sysconfig_prelink.py | mglantz/insights-core | 121 | 3315339 | <reponame>mglantz/insights-core<filename>insights/parsers/tests/test_sysconfig_prelink.py
from insights.tests import context_wrap
from insights.parsers.sysconfig import PrelinkSysconfig
PRELINK_SYSCONFIG = """
# Set this to no to disable prelinking altogether
# (if you change this from yes to no prelink -ua
# will be ... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/extmod/uasyncio_fair.py | sebastien-riou/micropython | 13,648 | 3315357 | <reponame>sebastien-riou/micropython<filename>tests/extmod/uasyncio_fair.py
# Test fairness of scheduler
try:
import uasyncio as asyncio
except ImportError:
try:
import asyncio
except ImportError:
print("SKIP")
raise SystemExit
async def task(id, t):
print("task start", id)
... | 0 | 0 | 0 | 0 | 0 | 0 |
unittest_reinvent/fixtures/test_data.py | lilleswing/Reinvent-1 | 183 | 3315365 | <reponame>lilleswing/Reinvent-1
import numpy as np
INVALID = 'INVALID'
NONSENSE = 'C1CC(Br)CCC1[ClH]'
ASPIRIN='O=C(C)Oc1ccccc1C(=O)O'
CELECOXIB='O=S(=O)(c3ccc(n1nc(cc1c2ccc(cc2)C)C(F)(F)F)cc3)N'
IBUPROFEN='CC(C)Cc1ccc(cc1)[C@@H](C)C(=O)O'
ETHANE = 'CC'
PROPANE='CCC'
BUTANE='CCCC'
PENTANE = 'CCCCC'
HEXANE = 'CCCCCC'
ME... | 0 | 0 | 0 | 0 | 0 | 0 |
PyQt5/Part-1/part-1.py | haha517/mywriter | 177 | 3315370 | # -*- coding: utf-8 -*-
from __future__ import annotations
import sys
#PYQT5 PyQt4’s QtGui module has been split into PyQt5’s QtGui, QtPrintSupport and QtWidgets modules
from PyQt5 import QtWidgets
#PYQT5 QAction, QMainWindow, QApplication, QTextEdit, QFileDialog, QDialog
from PyQt5 import QtPrintSupport
#PYQT5 QPr... | 1 | 0 | 0 | 1 | 2 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.