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 |
|---|---|---|---|---|---|---|---|---|---|---|
samples/discover_and_add_interfaces.py | oniram22/orionsdk-python | 177 | 1676871 | import requests
from orionsdk import SwisClient
def main():
npm_server = 'localhost'
username = 'admin'
password = ''
swis = SwisClient(npm_server, username, password)
print("Discover and add interfaces:")
results = swis.invoke('Orion.NPM.Interfaces', 'DiscoverInterfacesOnNode', 1)
# use... | 0 | 0 | 0 | 0 | 0 | 0 |
diylang/evaluator.py | knittl/diy-lang | 108 | 1676881 | # -*- coding: utf-8 -*-
from .types import Environment, DiyLangError, Closure, String
from .ast import is_boolean, is_atom, is_symbol, is_list, is_closure, \
is_integer, is_string
from .parser import unparse
"""
This is the Evaluator module. The `evaluate` function below is the heart
of your language, and the foc... | 0 | 0 | 0 | 0 | 0 | 0 |
src/qa-lstm-autoencoder.py | Asteur/qa | 261 | 1676895 | # -*- coding: utf-8 -*-
from __future__ import division, print_function
from keras.layers import Input, RepeatVector
from keras.models import Model
from keras.layers.recurrent import LSTM
from sklearn.cross_validation import train_test_split
import numpy as np
import os
import kaggle
DATA_DIR = "../data/comp_data"
QA... | 0 | 0 | 0 | 0 | 0 | 0 |
src/nsupdate/main/migrations/0002_auto_20141115_2227.py | mirzazulfan/nsupdate.info | 774 | 1676899 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import nsupdate.main.models
from django.conf import settings
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('main', '0001_initial'),
]
... | 0 | 0 | 0 | 0 | 0 | 0 |
test_project/serializers/child_b_serializers.py | SousaPedro11/django-auto-prefetching | 194 | 1676905 | <gh_stars>100-1000
from rest_framework import serializers
from rest_framework.serializers import ModelSerializer
from rest_framework.viewsets import ModelViewSet
from test_project.models import ChildA, ChildB, TopLevel
class TopLevelSerializer(ModelSerializer):
class Meta:
model = TopLevel
fields... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/psptools/psptool/prxtypes/type9.py | DaveeFTW/infinity | 137 | 1676910 | <reponame>DaveeFTW/infinity
from ecdsa.ellipticcurve import CurveFp, Point
import hashlib
from ecdsa.numbertheory import inverse_mod
from ecdsa import SigningKey
from ecdsa.curves import Curve
import psptool.kirk as kirk
from .common import expand_seed, prx_header, set_kirk_cmd_1
from Crypto.Util.strxor import strxor ... | 0 | 0 | 0 | 0 | 0 | 0 |
client/tests/process_test.py | ekmixon/pyre-check | 5,975 | 1676916 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from pathlib import Path
from typing import Optional
from unittest.mock import MagicMock, patch
import psutil
from .. import... | 25 | 13 | 0 | 0 | 38 | 0 |
Lib/test/test_super.py | deadsnakes/python3.2 | 319 | 1676919 | <reponame>deadsnakes/python3.2<filename>Lib/test/test_super.py
"""Unit tests for new super() implementation."""
import sys
import unittest
from test import support
class A:
def f(self):
return 'A'
@classmethod
def cm(cls):
return (cls, 'A')
class B(A):
def f(self):
return sup... | 0 | 0 | 0 | 0 | 0 | 0 |
flexbe_core/src/flexbe_core/behavior.py | duwke/flexbe_behavior_engine | 119 | 1676938 | <gh_stars>100-1000
#!/usr/bin/env python
from flexbe_core.logger import Logger
from flexbe_core.core import PreemptableState, OperatableStateMachine, LockableStateMachine
class Behavior(object):
'''
This is the superclass for all implemented behaviors.
'''
def __init__(self):
'''
Plea... | 0 | 0 | 0 | 0 | 0 | 0 |
plugins/dbnd-gcp/src/dbnd_gcp/dataflow/dataflow.py | ipattarapong/dbnd | 224 | 1676945 | import logging
import re
from dbnd._core.utils.better_subprocess import run_cmd
from dbnd_gcp.apache_beam.apache_beam_ctrl import ApacheBeamJobCtrl
from dbnd_gcp.dataflow.dataflow_config import DataflowConfig
from dbnd_gcp.gs_sync_ctrl import GsSyncCtrl
logger = logging.getLogger(__name__)
_DATAFLOW_ID_REGEXP = re.... | 0 | 1 | 0 | 1 | 2 | 0 |
examples/regression_with_tuning_example.py | rozlana-g/FEDOT | 358 | 1676958 | from datetime import timedelta
import numpy as np
from sklearn.metrics import mean_absolute_error
from sklearn.model_selection import train_test_split
from fedot.core.data.data import InputData
from fedot.core.pipelines.node import PrimaryNode, SecondaryNode
from fedot.core.pipelines.pipeline import Pipeline
from fed... | 2 | 1 | 0 | 0 | 3 | 0 |
fortytwo/s19_optimize_imports.py | rpharoah/42-workshop | 221 | 1676975 | <gh_stars>100-1000
"""19: Optimize Imports
Automate the organizing and cleaning up of your Python imports with Optimize Imports.
- Problems:
- One unused import
- Unsorted import list, per group
- I want multiple per line
- Optimize Imports (``Ctrl-Alt-O`` Win/Linux/macOS)
- Undo/Redo
- Split import... | 0 | 0 | 0 | 0 | 0 | 0 |
jmetal/problem/singleobjective/unconstrained.py | 12yuens2/jMetalPy | 335 | 1676987 | <reponame>12yuens2/jMetalPy<gh_stars>100-1000
import math
import random
from jmetal.core.problem import BinaryProblem, FloatProblem
from jmetal.core.solution import BinarySolution, FloatSolution
"""
.. module:: unconstrained
:platform: Unix, Windows
:synopsis: Unconstrained test problems for single-objective op... | 0 | 0 | 0 | 0 | 0 | 0 |
dynamo/plot/streamtube.py | xing-lab-pitt/dynamo-release | 236 | 1676989 | <gh_stars>100-1000
import numpy as np
import pandas as pd
from pandas.api.types import is_categorical_dtype
from numbers import Number
from .utils import is_gene_name, is_cell_anno_column, _to_hex
from ..tools.Markov import prepare_velocity_grid_data
from ..configuration import _themes
def plot_3d_streamtube(
ad... | 0 | 0 | 0 | 0 | 0 | 0 |
models/classification_models.py | yuemind/DilatedRNN | 378 | 1676991 | import tensorflow as tf
from drnn import multi_dRNN_with_dilations
def _contruct_cells(hidden_structs, cell_type) -> object:
"""
This function contructs a list of cells.
"""
# error checking
if cell_type not in ["RNN", "LSTM", "GRU"]:
raise ValueError("The cell type is not currently support... | 2 | 3 | 0 | 0 | 5 | 0 |
tests/unit/apis/test_queue.py | guvenbz/amazon-s3-find-and-forget | 165 | 1677019 | <reponame>guvenbz/amazon-s3-find-and-forget
import json
import os
from types import SimpleNamespace
from decimal import Decimal
import pytest
from mock import patch, ANY
with patch.dict(os.environ, {"DeletionQueueTable": "DeletionQueueTable"}):
from backend.lambdas.queue import handlers
pytestmark = [pytest.mark... | 0 | 0 | 0 | 0 | 0 | 0 |
test/mitmproxy/addons/test_asgiapp.py | KarlParkinson/mitmproxy | 24,939 | 1677048 | import asyncio
import json
import flask
import pytest
from flask import request
from mitmproxy.addons import asgiapp
from mitmproxy.addons import next_layer
from mitmproxy.addons.proxyserver import Proxyserver
from mitmproxy.test import taddons
tapp = flask.Flask(__name__)
@tapp.route("/")
def hello() -> str:
... | 0 | 4 | 0 | 0 | 4 | 0 |
v2/cantest.py | Dilepa/micropython-async | 443 | 1677091 | # cantest.py Tests of task cancellation
# The MIT License (MIT)
#
# Copyright (c) 2017-2018 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without li... | 4 | 4 | 0 | 0 | 8 | 0 |
datasets/fake_news_filipino/fake_news_filipino.py | zidingz/datasets | 10,608 | 1677094 | <reponame>zidingz/datasets
# coding=utf-8
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# 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 |
snerg/nerf/models.py | xxdreck/google-research | 23,901 | 1677107 | <reponame>xxdreck/google-research
# coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... | 0 | 0 | 0 | 0 | 0 | 0 |
files/core/util.py | rockonedege/ezored | 129 | 1677110 | <reponame>rockonedege/ezored
"""Module: Util"""
import platform
# -----------------------------------------------------------------------------
def filter_list(full_list, excludes):
s = set(excludes)
return (x for x in full_list if x not in s)
# -------------------------------------------------------------... | 0 | 0 | 0 | 0 | 0 | 0 |
data/task_scripts/main/task00001.py | aallaire91/phyre | 432 | 1677186 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 0 | 0 | 0 | 0 | 0 | 0 |
recognition/arcface_torch/torch2onnx.py | qaz734913414/insightface | 12,377 | 1677216 | <gh_stars>1000+
import numpy as np
import onnx
import torch
def convert_onnx(net, path_module, output, opset=11, simplify=False):
assert isinstance(net, torch.nn.Module)
img = np.random.randint(0, 255, size=(112, 112, 3), dtype=np.int32)
img = img.astype(np.float)
img = (img / 255. - 0.5) / 0.5 # tor... | 0 | 0 | 0 | 0 | 0 | 0 |
model/train.py | flapedriza/neural_chat | 163 | 1677224 | <gh_stars>100-1000
from solver import *
from data_loader import get_loader
from configs import get_config
from model.utils import Vocab
import os
import pickle
from model.models import VariationalModels
def load_pickle(path):
if 'streaming' in str(path):
return load_streaming_pickle(path)
with open(pa... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_sdb.py | State-xyz/pyoidc | 290 | 1677238 | <reponame>State-xyz/pyoidc
import base64
import datetime
import hashlib
import hmac
import json
import random
import time
import pytest
from freezegun import freeze_time
from oic.oic.message import AuthorizationRequest
from oic.oic.message import OpenIDRequest
from oic.utils.sdb import AccessCodeUsed
from oic.utils.s... | 0 | 0 | 0 | 0 | 0 | 0 |
aries_cloudagent/vc/tests/contexts/did_v1.py | kuraakhilesh8230/aries-cloudagent-python | 247 | 1677270 | <gh_stars>100-1000
DID_V1 = {
"@context": {
"@protected": True,
"id": "@id",
"type": "@type",
"alsoKnownAs": {
"@id": "https://www.w3.org/ns/activitystreams#alsoKnownAs",
"@type": "@id",
},
"assertionMethod": {
"@id": "https://w3id.... | 0 | 0 | 0 | 0 | 0 | 0 |
inf_tvc.py | bryant1410/HERO | 173 | 1677290 | """
Copyright (c) Microsoft Corporation.
Licensed under the MIT license.
TVC inference
generate prediction from JSON file
"""
import argparse
import json
from time import time
import torch
from horovod import torch as hvd
from transformers import RobertaTokenizer
from apex import amp
from tqdm import tqdm
from data.... | 0 | 1 | 0 | 0 | 1 | 0 |
test/manual/trash/test_move_to_trash.py | membranepotential/mendeley-python-sdk | 103 | 1677294 | import pytest
from mendeley.exception import MendeleyApiException
from test import cassette
from test.resources.documents import *
def test_should_trash_document():
session = get_user_session()
delete_all_documents()
with cassette('fixtures/resources/trash/move_to_trash/trash_document.yaml'), \
... | 0 | 0 | 0 | 0 | 0 | 0 |
app/users/views.py | Wriley-Herring/bookwrm | 145 | 1677302 | <filename>app/users/views.py<gh_stars>100-1000
import json
import stripe
from allauth.account.views import (
PasswordChangeView as AllauthPasswordChangeView,
EmailView as AllauthEmailView,
)
from allauth.account.adapter import get_adapter
from allauth.account import signals
from allauth.account.models import E... | 0 | 0 | 0 | 0 | 0 | 0 |
nuplan/planning/script/builders/training_metrics_builder.py | motional/nuplan-devkit | 128 | 1677306 | import logging
from typing import List
from hydra.utils import instantiate
from omegaconf import DictConfig
from nuplan.planning.script.builders.utils.utils_type import validate_type
from nuplan.planning.training.modeling.metrics.abstract_training_metric import AbstractTrainingMetric
logger = logging.getLogger(__nam... | 1 | 1 | 1 | 0 | 3 | 0 |
venv/Lib/site-packages/win32/Demos/FileSecurityTest.py | ajayiagbebaku/NFL-Model | 150 | 1677307 | <gh_stars>100-1000
# Contributed by <NAME>.
import os, sys
import win32security, ntsecuritycon, pywintypes, winerror
# get security information
# name=r"c:\autoexec.bat"
# name= r"g:\!workgrp\lim"
name = sys.argv[0]
if not os.path.exists(name):
print(name, "does not exist!")
sys.exit()
print("On file ", name... | 0 | 0 | 0 | 0 | 0 | 0 |
compiler-rt/test/shadowcallstack/lit.cfg.py | medismailben/llvm-project | 2,338 | 1677315 | # -*- Python -*-
import os
# Setup config name.
config.name = 'ShadowCallStack'
# Setup source root.
config.test_source_root = os.path.dirname(__file__)
# Test suffixes.
config.suffixes = ['.c', '.cpp', '.m', '.mm', '.ll', '.test']
# Add clang substitutions.
config.substitutions.append( ("%clang_noscs ", config.cl... | 0 | 0 | 0 | 0 | 0 | 0 |
modules/nltk_contrib/scripttranscriber/pronouncer.py | h4ck3rm1k3/NLP-project | 123 | 1677322 | <reponame>h4ck3rm1k3/NLP-project<gh_stars>100-1000
## 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 l... | 0 | 0 | 0 | 0 | 0 | 0 |
pyes/decorators.py | ttimasdf/pyes | 175 | 1677324 | <filename>pyes/decorators.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import warnings
from functools import wraps
from .exceptions import ESPendingDeprecationWarning, ESDeprecationWarning
PENDING_DEPRECATION_FMT = """
%(description)s is scheduled for deprecation in \
version %(deprecation)s and remova... | 0 | 0 | 0 | 0 | 0 | 0 |
module/__init__.py | yayorbitgum/Discord-Scraper | 271 | 1677332 | <reponame>yayorbitgum/Discord-Scraper
# Entering my username as the author of the library.
__author__ = 'Dracovian'
# You can contact me via Github, we can set up other forms of communication if needed.
__contact__ = 'https://github.com/Dracovian'
# There's no copyright information for this.
__copyright__ = None
# F... | 0 | 0 | 0 | 0 | 0 | 0 |
albu/src/config.py | chritter/kaggle_carvana_segmentation | 447 | 1677333 | from collections import namedtuple
Config = namedtuple("Config", [
"dataset_path",
"models_dir",
"folder",
"img_rows",
"img_cols",
"target_rows",
"target_cols",
"num_channels",
"network",
"loss",
"lr",
"optimizer",
"batch_size",
"epoch_size",
"use_clahe",
... | 0 | 0 | 0 | 0 | 0 | 0 |
python/taichi/lang/any_array.py | mzmzm/taichi | 11,699 | 1677388 | from taichi._lib import core as _ti_core
from taichi.lang.enums import Layout
from taichi.lang.expr import Expr, make_expr_group
from taichi.lang.util import taichi_scope
class AnyArray:
"""Class for arbitrary arrays in Python AST.
Args:
ptr (taichi_core.Expr): A taichi_core.Expr wrapping a taichi_co... | 0 | 3 | 0 | 0 | 3 | 0 |
datasets/cnn_dailymail/cnn_dailymail.py | leondz/datasets | 3,395 | 1677412 | # coding=utf-8
# Copyright 2020 The TensorFlow Datasets Authors and the HuggingFace Datasets 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/LI... | 0 | 9 | 0 | 0 | 9 | 0 |
Zhihu/NN/_extra/one/Networks.py | leoatchina/MachineLearning | 1,107 | 1677414 | <reponame>leoatchina/MachineLearning<gh_stars>1000+
import matplotlib.pyplot as plt
from Zhihu.NN._extra.Layers import *
from Zhihu.NN._extra.Optimizers import *
class NNDist:
NNTiming = Timing()
def __init__(self):
self._layers, self._weights, self._bias = [], [], []
self._w_optimizer = sel... | 0 | 0 | 0 | 0 | 0 | 0 |
py/testdir_multi_jvm/test_rf_parity_cmp.py | gigliovale/h2o | 882 | 1677441 | <reponame>gigliovale/h2o
import unittest, time, sys
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_import as h2i, h2o_rf
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
h2o.init(3, java_heap_GB=4)
... | 0 | 0 | 0 | 0 | 0 | 0 |
APIs/Telegram API/tests/readthedocs/quick_references/test_client_reference.py | Gregor-Davies/Awesome-Scripts-1 | 141 | 1677448 | import re
from telethon import TelegramClient
def test_all_methods_present(docs_dir):
"""
Determine if all methods existance of the given documentation.
Args:
docs_dir: (str): write your description
"""
with (docs_dir / 'quick-references/client-reference.rst').open(encoding='utf-8') as f... | 0 | 0 | 0 | 0 | 0 | 0 |
onnx/backend/test/case/node/hardmax.py | XavierAtShanghai/onnx | 137 | 1677457 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np # type: ignore
import onnx
from ..base import Base
from . import expect
class Hardmax(Base):
@staticmethod
def export(): # type: () -> No... | 0 | 2 | 0 | 0 | 2 | 0 |
main.py | awesome-archive/CAIL2019 | 300 | 1677486 | #!/usr/bin/python
# coding: utf-8
import os
import warnings
from timeit import default_timer as timer
import torch
from torch.utils.data import DataLoader
from datasets.cail_dataset import CAILDataset
from loss.loss import TripletLoss_op
from models.net import (
BertEmbedding2ForTripletNet,
BertEmbeddingForT... | 0 | 0 | 0 | 0 | 0 | 0 |
python/app/thirdparty/oneforall/modules/datasets/hackertarget.py | taomujian/linbing | 351 | 1677495 | <filename>python/app/thirdparty/oneforall/modules/datasets/hackertarget.py<gh_stars>100-1000
from app.thirdparty.oneforall.common.query import Query
class HackerTarget(Query):
def __init__(self, domain):
Query.__init__(self)
self.domain = domain
self.module = 'Dataset'
self.source ... | 0 | 0 | 0 | 0 | 0 | 0 |
micropolis/MicropolisCore/src/pyMicropolis/__init__.py | zegerk/gym-micropolis | 775 | 1677497 | <gh_stars>100-1000
"""
@package pyMicropolis
Python code of the Micropolis project.
@todo Move all Python code to here.
"""
| 0 | 0 | 0 | 0 | 0 | 0 |
test/test_isl.py | connorjward/loopy | 436 | 1677524 | __copyright__ = "Copyright (C) 2012 <NAME>"
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, mer... | 0 | 0 | 0 | 0 | 0 | 0 |
app/tests/evaluation_tests/test_forms.py | kaczmarj/grand-challenge.org | 101 | 1677532 | <filename>app/tests/evaluation_tests/test_forms.py
import pytest
from grandchallenge.evaluation.forms import SubmissionForm
from grandchallenge.evaluation.models import Phase
from tests.algorithms_tests.factories import (
AlgorithmFactory,
AlgorithmImageFactory,
AlgorithmJobFactory,
)
from tests.evaluation... | 0 | 0 | 0 | 0 | 0 | 0 |
lib/luminol/src/luminol/algorithms/correlator_algorithms/all.py | richardhsu/naarad | 180 | 1677562 | <reponame>richardhsu/naarad<gh_stars>100-1000
# coding=utf-8
"""
© 2014 LinkedIn Corp. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0... | 0 | 0 | 0 | 0 | 0 | 0 |
pylearn2/sandbox/cuda_convnet/tests/test_img_acts.py | ikervazquezlopez/Pylearn2 | 2,045 | 1677565 | from __future__ import print_function
__authors__ = "<NAME>, <NAME>"
__copyright__ = "Copyright 2010-2012, Universite de Montreal"
__credits__ = ["<NAME>", "<NAME>"]
__license__ = "3-clause BSD"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
from pylearn2.testing.skip import skip_if_no_gpu
skip_if_no_gpu()
import n... | 0 | 0 | 0 | 0 | 0 | 0 |
Chapter02/2_mnist_cnn.py | yasin-gh/Deep-Learning-for-Computer-Vision | 200 | 1677571 | <filename>Chapter02/2_mnist_cnn.py<gh_stars>100-1000
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
mnist_data = input_data.read_data_sets('MNIST_data', one_hot=True)
input_size = 784
no_classes = 10
batch_size = 100
total_batches = 200
x_input = tf.placeholder(tf.float32, shape=[... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/common/utils.py | CPWstatic/nebula | 816 | 1677578 | # --coding:utf-8--
#
# Copyright (c) 2020 vesoft inc. All rights reserved.
#
# This source code is licensed under Apache 2.0 License,
# attached with Common Clause Condition 1.0, found in the LICENSES directory.
import os
import random
import string
import time
import yaml
from typing import Pattern
from nebula2.Conf... | 0 | 0 | 0 | 0 | 0 | 0 |
Python/Dice Rolling by Muhammad Bilal.py | thefool76/hacktoberfest2021 | 448 | 1677580 | <gh_stars>100-1000
#Developer : <NAME> (Muhammad-Bilal-MB)
from tkinter import *
from tkinter import messagebox
import random
def Roll():
a = a1.get()
b = a2.get()
c = int(a3.get())
d = int(a4.get())
e = a5.get()
diceNumber = random.randint(1,6)
if c == d:
messagebox.showinfo("Err... | 0 | 0 | 0 | 0 | 0 | 0 |
h2o-py/tests/testdir_munging/pyunit_op_precedence.py | ahmedengu/h2o-3 | 6,098 | 1677598 | <reponame>ahmedengu/h2o-3
from __future__ import print_function
from builtins import zip
from builtins import range
import sys
sys.path.insert(1,"../../")
import h2o
from tests import pyunit_utils
import random
import numpy as np
def op_precedence():
# Connect to a pre-existing cluster
a = [[random.un... | 0 | 0 | 0 | 0 | 0 | 0 |
flearn/trainers/maml.py | Iacob-Alexandru-Andrei/fair_flearn | 171 | 1677612 | import numpy as np
from tqdm import trange, tqdm
import tensorflow as tf
from .fedbase import BaseFedarated
from flearn.utils.tf_utils import process_grad, cosine_sim, softmax, norm_grad
from flearn.utils.model_utils import batch_data, gen_batch, gen_epoch
class Server(BaseFedarated):
def __init__(self, params,... | 0 | 0 | 0 | 0 | 0 | 0 |
magnum/common/short_id.py | ajmadsen/magnum | 319 | 1677663 | <reponame>ajmadsen/magnum
#
# 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... | 0 | 0 | 0 | 0 | 0 | 0 |
Packs/XMatters/Integrations/xMatters/xMatters_test.py | diCagri/content | 799 | 1677686 | <reponame>diCagri/content<filename>Packs/XMatters/Integrations/xMatters/xMatters_test.py
# from xMatters import Client
# from typing import Any, Dict, Tuple, List, Optional, cast
# import unittest
def test_xm_trigger_workflow_command(requests_mock):
"""Tests trigger workflow command
:param requests_mock:
... | 0 | 0 | 0 | 0 | 0 | 0 |
benchmarks/image_recognition/tensorflow_serving/inceptionv3/inference/fp32/util.py | ashahba/models | 357 | 1677689 | <reponame>ashahba/models<filename>benchmarks/image_recognition/tensorflow_serving/inceptionv3/inference/fp32/util.py
#
# -*- coding: utf-8 -*-
#
# Copyright (c) 2019 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#... | 0 | 0 | 0 | 0 | 0 | 0 |
uiautomator2/messagebox.py | hiyongz/uiautomator2 | 4,493 | 1677692 | <gh_stars>1000+
# coding: utf-8
#
import time
try:
import Tkinter as tk
except ImportError:
import tkinter as tk
def retryskipabort(message, timeout=20):
"""
Show dialog of RETRY,SKIP,ABORT
Returns:
one of "retry", "skip", "abort"
"""
root = tk.Tk()
root.geometry("400x200")
... | 0 | 0 | 0 | 0 | 0 | 0 |
samcli/lib/cookiecutter/exceptions.py | torresxb1/aws-sam-cli | 2,959 | 1677719 | """ Exceptions raised from the cookiecutter workflow"""
class CookiecutterErrorException(Exception):
fmt: str = "An unspecified error occurred"
def __init__(self, **kwargs): # type: ignore
msg: str = self.fmt.format(**kwargs)
Exception.__init__(self, msg)
self.kwargs = kwargs
class... | 0 | 0 | 6 | 0 | 6 | 0 |
koko/cam/workflow.py | TheBeachLab/kokopelli | 196 | 1677741 | from __future__ import annotations
""" @module CAM workflow module
"""
import sys
import wx
import wx.lib.stattext
import koko
from koko.cam.inputs import INPUTS
from koko.cam.machines import MACHINES
from koko.cam.panel import OutputPanel
from koko.themes import APP_THEME
##########################... | 3 | 1 | 0 | 3 | 7 | 0 |
training_dataset/vid/visual.py | Anonymous502/siamfda-for-eccv | 216 | 1677749 | from os.path import join
from os import listdir
import cv2
import numpy as np
import glob
import xml.etree.ElementTree as ET
visual = True
color_bar = np.random.randint(0, 255, (90, 3))
VID_base_path = './ILSVRC2015'
ann_base_path = join(VID_base_path, 'Annotations/VID/train/')
img_base_path = join(VID_base_path, 'Da... | 0 | 0 | 0 | 0 | 0 | 0 |
Packs/MicrosoftTeams/Integrations/MicrosoftTeams/MicrosoftTeams_test.py | diCagri/content | 799 | 1677771 | import demistomock as demisto
import json
import pytest
from CommonServerPython import entryTypes
entryTypes['warning'] = 11
bot_id: str = '9bi5353b-md6a-4458-8321-e924af433amb'
tenant_id: str = 'pbae9ao6-01ql-249o-5me3-4738p3e1m941'
team_id: str = '19:<EMAIL>'
team_aad_id: str = '7d8efdf8-0c5a-42e3-a489-5ef5c3fc7... | 1 | 2 | 56 | 0 | 59 | 0 |
Gfg/Python/Generate_Balanced_parenthesis.py | abdzitter/Daily-Coding-DS-ALGO-Practice | 289 | 1677794 | <reponame>abdzitter/Daily-Coding-DS-ALGO-Practice
'''
Given: N=2
Output:
(())
()()
now to form all of the sequences of these balanced bracket subsequencefor n.
we know that there are n opening brackets and n closing brackerts with us.
so subsequence will be of length = (length*2)
so we're going with a naive typ... | 0 | 0 | 0 | 0 | 0 | 0 |
shop/rest/renderers.py | 2000-ion/TIDPP-Lab3 | 2,160 | 1677804 | <reponame>2000-ion/TIDPP-Lab3
from rest_framework import renderers
from rest_framework.exceptions import APIException
from shop.models.cart import CartModel
from shop.serializers.cart import CartSerializer
class TemplateContextMixin:
"""
Alternative implementation which does not pollute the template context ... | 0 | 0 | 0 | 0 | 0 | 0 |
models/ObjectDetection/CornerNet.py | Dou-Yu-xuan/deep-learning-visal | 150 | 1677809 | import torch
import torch.nn as nn
def ConvBNReLU(in_channels,out_channels,kernel_size,stride,padding: int=1) -> object:
return nn.Sequential(
nn.Conv2d(in_channels=in_channels, out_channels=out_channels, kernel_size=kernel_size, stride=stride, padding=kernel_size//2),
nn.BatchNorm2d(out_ch... | 1 | 7 | 0 | 0 | 8 | 0 |
tests/test_some_of.py | notmatthancock/audiomentations | 930 | 1677829 | <reponame>notmatthancock/audiomentations
import os
import unittest
import numpy as np
from numpy.testing import assert_array_equal, assert_array_almost_equal
from audiomentations import Gain, SpecFrequencyMask, SomeOf
from audiomentations.augmentations.transforms import (
ClippingDistortion,
AddBackgroundNois... | 0 | 0 | 0 | 0 | 0 | 0 |
packages/syft/src/syft/core/node/common/node_service/request_receiver/request_receiver_messages.py | jackbandy/PySyft | 8,428 | 1677832 | # stdlib
from enum import Enum
from typing import List
from typing import Optional
# third party
from google.protobuf.reflection import GeneratedProtocolMessageType
from nacl.signing import VerifyKey
# relative
from ...... import deserialize
from ...... import serialize
from ......logger import critical
from ......lo... | 22 | 12 | 4 | 9 | 47 | 0 |
tests/app_test.py | wecatch/app-turbo | 157 | 1677868 | <reponame>wecatch/app-turbo
from __future__ import absolute_import, division, print_function, with_statement
import multiprocessing
import os
import signal
from bson.objectid import ObjectId
import requests
from turbo import app
from turbo import register
from turbo.conf import app_config
from turbo.util import base... | 0 | 0 | 0 | 0 | 0 | 0 |
hvplot/plotting/andrews_curves.py | sdrees/hvplot | 177 | 1677891 | from __future__ import annotations
import numpy as np
import pandas as pd
import holoviews as hv
import colorcet as cc
from ..backend_transforms import _transfer_opts_cur_backend
from ..util import with_hv_extension
@with_hv_extension
def andrews_curves(data, class_column, samples: int=200, alpha: float=0.5,
... | 6 | 1 | 0 | 0 | 7 | 0 |
censors/censor8b.py | tgragnato/geneva | 1,182 | 1677904 | <gh_stars>1000+
"""
Censor 8b is a RST censor designed to mimic TCB teardown GFW behavior. It
tracks multiple connections using TCBs, but does not enter a TCB resynchronization
state if a RST or FIN, it simply tears down. It creates new TCBs for connections it is not
yet aware of, but does not check the checksums of in... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_factories.py | sl-dsteinke/ptable | 133 | 1677912 | # !/usr/bin/python
# This Python file uses the following encoding: utf-8
from __future__ import print_function
import unittest
from prettytable.factory import from_md, split_md_row, strip_md_content
md = \
'''| name | age | 姓名 | 年龄 | |
|------|-----|---|---|---|
| ke | 1 | Kane | 二十 | |
| wa | 2 | 王 ... | 0 | 0 | 0 | 0 | 0 | 0 |
go/multiple_prediction.py | douglasrizzo/ELF | 2,230 | 1677925 | import torch
import torch.nn as nn
from torch.autograd import Variable
import math
from rlpytorch import ArgsProvider, add_err
from rlpytorch.trainer import topk_accuracy
class MultiplePrediction:
def __init__(self):
self.args = ArgsProvider(
call_from = self,
define_args = [
... | 0 | 0 | 0 | 0 | 0 | 0 |
litex/build/xilinx/__init__.py | osterwood/litex | 1,501 | 1677955 | <filename>litex/build/xilinx/__init__.py<gh_stars>1000+
from litex.build.xilinx.platform import XilinxPlatform
from litex.build.xilinx.programmer import UrJTAG, XC3SProg, FpgaProg, VivadoProgrammer, iMPACT, Adept
| 0 | 0 | 0 | 0 | 0 | 0 |
Python/Tests/TestData/Grammar/Literals36.py | techkey/PTVS | 695 | 1677965 | <reponame>techkey/PTVS
10_000_000.0
0xCAFE_F00D
0b_0011_1111_0100_1110
0b_1111_0000
_1
1_0
1_0e0_1
1_0e_1
1_e1
3_.14
3._14
3.1_4
3.14_
0x_CAFE_F00D
0xCAFE_F00D_
0o_777
0o7_77
0o77_7
0o777_
| 0 | 0 | 0 | 0 | 0 | 0 |
examples/visual_cueing/03r__cueing_behaviour_analysis_winter2019.py | jartuso/eeg-notebooks | 370 | 1678019 | """
Cueing Behavioural Analysis Winter 2019
=======================================
"""
###################################################################################################
# Setup
# ---------------------
#
# Standard Pythonic imports
import os,sys,glob,numpy as np,pandas as pd
import matplotlib.pypl... | 0 | 0 | 0 | 0 | 0 | 0 |
dev/import_all_classes.py | Piatachock/airflow | 15,947 | 1678026 | #!/usr/bin/env python3
# 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
# "L... | 5 | 2 | 2 | 0 | 9 | 0 |
tensorflow/python/util/compat.py | MathMachado/tensorflow | 848 | 1678027 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 2 | 4 | 0 | 0 | 6 | 0 |
test/python/transpiler/test_gate_direction.py | TheGupta2012/qiskit-terra | 1,599 | 1678037 | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 0 | 0 | 0 | 0 | 0 | 0 |
kitsune/groups/views.py | AndrewDVXI/kitsune | 929 | 1678038 | <gh_stars>100-1000
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.models import Group, User
from django.core.exceptions import PermissionDenied
from django.core.files.storage import default_storage
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
fr... | 0 | 0 | 0 | 0 | 0 | 0 |
xv_leak_tools/test_components/git/git.py | UAEKondaya1/expressvpn_leak_testing | 219 | 1678050 | from xv_leak_tools import tools_root
from xv_leak_tools.log import L
from xv_leak_tools.process import check_subprocess
from xv_leak_tools.test_components.local_component import LocalComponent
from xv_leak_tools.test_device.connector_helper import ConnectorHelper
class Git(LocalComponent):
@staticmethod
def _... | 0 | 2 | 0 | 0 | 2 | 0 |
models/multitask/mmoe/net.py | ziyoujiyi/PaddleRec | 2,739 | 1678101 | <gh_stars>1000+
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | 0 | 0 | 0 | 0 | 0 | 0 |
internal/providers/test/run_node_test.bzl | Aghassi/rules_nodejs | 645 | 1678108 | <gh_stars>100-1000
"""
Contrived rule for writing some content to a file using run_node
Tests that two run_node calls can be made from the same rule context, where each run_node call
uses a different executable (and therefore the content of the modules manifest file is different)
"""
load("//:providers.bzl", "run_node... | 0 | 0 | 0 | 0 | 0 | 0 |
osxphotos/photoinfo/_photoinfo_exifinfo.py | scanner/osxphotos | 656 | 1678110 | from __future__ import annotations
""" PhotoInfo methods to expose EXIF info from the library """
import logging
from dataclasses import dataclass
from .._constants import _PHOTOS_4_VERSION
@dataclass(frozen=True)
class ExifInfo:
""" EXIF info associated with a photo from the Photos library """
flash_fired... | 0 | 1 | 19 | 0 | 20 | 0 |
docker/s3tests/test_object_head.py | yuchen-sun/chubaofs | 2,498 | 1678122 | <reponame>yuchen-sun/chubaofs<gh_stars>1000+
# Copyright 2020 The ChubaoFS 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
#
# Unle... | 0 | 0 | 0 | 0 | 0 | 0 |
model.py | wangpinggl/TREQS | 149 | 1678175 | '''
@author <NAME> and <NAME>
Please contact <EMAIL> or <EMAIL>
'''
import os
import time
import torch
from torch.autograd import Variable
from seq2sql.model_seq2seq_base import modelSeq2SeqBase
from LeafNATS.data.seq2sql.process_batch_cqa_v1 import process_batch
from LeafNATS.modules.embedding.nats_embedding import... | 1 | 3 | 0 | 0 | 4 | 0 |
test/optimization/test_grover_optimizer.py | stefan-woerner/aqua | 504 | 1678181 | <gh_stars>100-1000
# This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modificatio... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/git-role-management/internal/model/pipeline_model.py | msleprosy/cloud-pipeline | 126 | 1678191 | <reponame>msleprosy/cloud-pipeline
# Copyright 2017-2019 EPAM Systems, Inc. (https://www.epam.com/)
#
# 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/LICEN... | 0 | 0 | 0 | 0 | 0 | 0 |
sikuli-script/src/test/python/old/test-wait.py | mgrundy/sikuli | 1,292 | 1678208 | # Copyright 2010-2011, Sikuli.org
# Released under the MIT License.
from __future__ import with_statement
from sikuli.Sikuli import *
print wait("test-res/apple.png",0)
assert( waitVanish("test-res/about-this-mac.png", 0) == True)
with Region(10, 0, 200,200) as r:
p = Pattern("test-res/apple.png").targetOffset(30,5... | 0 | 0 | 0 | 0 | 0 | 0 |
third_party/tests/Ibex/vendor/google_riscv-dv/pygen/pygen_src/isa/rv32i_instr.py | parzival3/Surelog | 1,375 | 1678224 | <filename>third_party/tests/Ibex/vendor/google_riscv-dv/pygen/pygen_src/isa/rv32i_instr.py
"""
Copyright 2020 Google LLC
Copyright 2020 PerfectVIPs Inc.
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 ... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/archive.py | kamino/dragonffi | 523 | 1678226 | <reponame>kamino/dragonffi
# REQUIRES: linux && libarchive
# RUN: tar cf %t.tar %s
# RUN: %python "%s" "%t.tar" | %FileCheck "%s"
# CHECK: archive.py
import pydffi
import ctypes.util
import sys
pydffi.dlopen(ctypes.util.find_library("archive"))
D = pydffi.FFI()
CU=D.cdef('''
#include <archive.h>
#include <archive_en... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/data/fware_test_stub/frozen/utokenize.py | golyalpha/micropy-cli | 180 | 1678250 | # (c) 2019 <NAME>, MIT license
from token import *
from ucollections import namedtuple
NL = 55
ENCODING = 56
tok_name[NL] = "NL"
tok_name[ENCODING] = "ENCODING"
class TokenInfo(namedtuple("TokenInfo", ("type", "string", "start", "end", "line"))):
def __str__(self) -> object:
return "TokenInfo(type=%d (%... | 0 | 2 | 0 | 0 | 2 | 0 |
src/holodeck/util.py | LaudateCorpus1/holodeck | 518 | 1678273 | from __future__ import annotations
"""Helpful Utilities"""
import math
import os
import holodeck
from holodeck.command import DebugDrawCommand
try:
unicode # Python 2
except NameError:
unicode = str # Python 3
def get_holodeck_version() -> object:
"""Gets the current version of holodeck
Returns:... | 8 | 10 | 0 | 0 | 18 | 0 |
compiler_opt/rl/regalloc/config.py | google/ml-compiler-opt | 130 | 1678278 | # coding=utf-8
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 4 | 6 | 0 | 0 | 10 | 0 |
tests/test_acl_db.py | jccardonar/trigger | 380 | 1678290 | <gh_stars>100-1000
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Test the functionality of `~trigger.acl.db` (aka ACLs.db)
"""
# Make sure we load the mock redis library
from utils import mock_redis
mock_redis.install()
# And now we can load the Trigger libs that call Redis
from trigger.netdevices import NetDevi... | 0 | 0 | 0 | 0 | 0 | 0 |
indra/databases/uniprot_client.py | zebulon2/indra | 136 | 1678297 | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
import os
import logging
from indra.util import read_unicode_csv
logger = logging.getLogger(__name__)
from protmapper.uniprot_client import *
def _build_uniprot_subcell_loc() -> object:
fname = os.path.dirna... | 0 | 1 | 0 | 0 | 1 | 0 |
0_download_dataset.py | taipahuchu/RNN-Time-Series | 902 | 1678319 | import requests
import os
from pathlib import Path
import pickle
from shutil import unpack_archive
urls = dict()
urls['ecg']=['http://www.cs.ucr.edu/~eamonn/discords/ECG_data.zip',
'http://www.cs.ucr.edu/~eamonn/discords/mitdbx_mitdbx_108.txt',
'http://www.cs.ucr.edu/~eamonn/discords/qtdbsele... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/docs_snippets_crag/docs_snippets_crag_tests/concepts_tests/resources_tests/test_resources.py | dagster-io/dagster | 4,606 | 1678331 | <gh_stars>1000+
from dagster import build_init_resource_context, build_op_context
from docs_snippets_crag.concepts.resources.resources import (
cereal_fetcher,
connect,
db_resource,
do_database_stuff_dev,
do_database_stuff_job,
do_database_stuff_prod,
op_requires_resources,
test_cm_resou... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/aarch64_gem5/gem5script.py | lambdaxymox/barrelfish | 111 | 1678348 | # Simple M5 script for use with Barrelfish. This creates a very
# basic machine with a set of CPUs connected directly to the
# simulated memory.
#
# (See configs/example/* in the M5 distribution for examples of
# fuller scripts -- caches, etc.).
# Determine script pathname
import inspect, os
import optparse
import... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/datasets/test_mtg_jamendo_autotagging_moodtheme.py | migperfer/mirdata | 224 | 1678417 | import numpy as np
import pytest
from mirdata.datasets import mtg_jamendo_autotagging_moodtheme
from tests.test_utils import run_track_tests
def test_track():
default_trackid = "track_0000948"
data_home = "tests/resources/mir_datasets/mtg_jamendo_autotagging_moodtheme"
dataset = mtg_jamendo_autotagging_m... | 0 | 0 | 0 | 0 | 0 | 0 |
yotta/test/cli/test_link.py | microbit-foundation/yotta | 176 | 1678426 | #!/usr/bin/env python
# Copyright 2014-2015 ARM Limited
#
# Licensed under the Apache License, Version 2.0
# See LICENSE file for details.
# standard library modules, , ,
import unittest
import os
import tempfile
# internal modules:
from yotta.lib.folders import globalInstallDirectory
from yotta.test.cli import cli... | 0 | 0 | 0 | 0 | 0 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.