max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 7 115 | max_stars_count int64 101 368k | id stringlengths 2 8 | content stringlengths 6 1.03M |
|---|---|---|---|---|
src/_main/RTyyyy_main.py | ufo2011/NXP-MCUBootUtility | 174 | 11144374 | #! /usr/bin/env python
# -*- coding: UTF-8 -*-
import wx
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import os
import time
sys.path.append(os.path.abspath(".."))
from mem import RTyyyy_memcore
from ui import RTyyyy_uidef
from ui import uidef
from ui import uivar
from ui import uilang
from fuse import RTyyyy_... |
utils/CoNLLeval.py | heathher/neural_sequence_labeling | 240 | 11144375 | <reponame>heathher/neural_sequence_labeling
import argparse
import json
import re
import sys
from collections import defaultdict
"""
Borrowed from: https://github.com/AdolfVonKleist/rnn-slu/blob/master/rnnslu/CoNLLeval.py
"""
class CoNLLeval:
"""Evaluate the result of processing CoNLL-2000 shared task
Evalua... |
catboost/spark/catboost4j-spark/core/src/test/python/catboost_classifier_test.py | mjjohns1/catboost | 6,989 | 11144382 | <reponame>mjjohns1/catboost<gh_stars>1000+
import collections
import os
import shutil
import tempfile
import test_helpers
import pool_test_helpers
from pyspark.ml.linalg import Vectors, VectorUDT
from pyspark.sql import Row
from pyspark.sql.types import *
def testBinaryClassificationSimpleOnDataFrame():
spark =... |
tools/nntool/generation/generators/globals/mult8_rnn_infos_generator.py | 00-01/gap_sdk | 118 | 11144383 | # Copyright (C) 2020 GreenWaves Technologies, SAS
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# This progr... |
rplugin/python3/deoplete/sources/deoplete_go/clang_index.py | zchee/deoplete-vim-go | 115 | 11144398 | <reponame>zchee/deoplete-vim-go<filename>rplugin/python3/deoplete/sources/deoplete_go/clang_index.py
class Clang_Index(object):
kinds = dict(
{
# Declarations
1: "t", # CXCursor_UnexposedDecl # A declaration whose specific kind
# is not exposed via this interface
... |
tests/r/test_wage2.py | hajime9652/observations | 199 | 11144399 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import shutil
import sys
import tempfile
from observations.r.wage2 import wage2
def test_wage2():
"""Test module wage2.py by downloading
wage2.csv and testing shape of
extracted data has 935 rows and... |
d3net/semantic-segmentation/segmentation_data.py | ishine/ai-research-code | 199 | 11144422 | # Copyright 2021 Sony Group Corporation.
#
# 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 ... |
quetz/testing/mockups.py | maresb/quetz | 108 | 11144429 | from typing import Callable, Optional, Union
import requests
from quetz.config import Config
from quetz.dao import Dao
from quetz.tasks.workers import job_wrapper
class TestWorker:
"synchronous worker for testing"
def __init__(
self,
config: Config,
db,
dao: Dao,
ses... |
test/pytest/test_conv1d.py | julesmuhizi/hls4ml | 263 | 11144473 | from hls4ml.converters.keras_to_hls import keras_to_hls
import pytest
import hls4ml
import numpy as np
from sklearn.metrics import accuracy_score
import tensorflow as tf
from tensorflow.keras.models import model_from_json
import yaml
@pytest.fixture(scope='module')
def data():
X = np.random.rand(100,100,7)
ret... |
launcher/launch.py | zarzen/byteps | 3,361 | 11144477 | #!/usr/bin/python
from __future__ import print_function
import os
import re
import subprocess
import threading
import sys
import time
from functools import reduce
class PropagatingThread(threading.Thread):
""" propagate exceptions to the parent's thread
refer to https://stackoverflow.com/a/31614591/9601110
... |
tutorials/W3D3_ReinforcementLearningForGames/solutions/W3D3_Tutorial1_Solution_ef26beca.py | justynaekert/course-content-dl | 473 | 11144491 | <reponame>justynaekert/course-content-dl
class PolicyBasedPlayer():
def __init__(self, game, pnet, greedy=True):
self.game = game
self.pnet = pnet
self.greedy = greedy
def play(self, board):
valids = self.game.getValidMoves(board, 1)
action_probs = self.pnet.predict(board)
vap = action_prob... |
tests/test_cases/test_cocotb/test_handle.py | lavanyajagan/cocotb | 350 | 11144502 | # Copyright cocotb contributors
# Licensed under the Revised BSD License, see LICENSE for details.
# SPDX-License-Identifier: BSD-3-Clause
"""
Tests for handles
"""
import logging
import random
import pytest
import cocotb
from cocotb.binary import BinaryValue
from cocotb.handle import _Limits
from cocotb.triggers imp... |
benchmark/opperf/nd_operations/misc_operators.py | mchoi8739/incubator-mxnet | 211 | 11144516 | <reponame>mchoi8739/incubator-mxnet<gh_stars>100-1000
# 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... |
sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/_models_py3.py | rsdoherty/azure-sdk-for-python | 2,728 | 11144536 | # coding=utf-8
# --------------------------------------------------------------------------
# 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 ... |
SCRAPE/Lib/site-packages/twisted/python/constants.py | Chinmoy-Prasad-Dutta/scrapy_scraper | 4,612 | 11144568 | <reponame>Chinmoy-Prasad-Dutta/scrapy_scraper
# -*- test-case-name: twisted.python.test.test_constants -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Symbolic constant support, including collections and constants with text,
numeric, and bit flag values.
"""
# Import and re-export Con... |
scipy/special/tests/test_spence.py | Ennosigaeon/scipy | 9,095 | 11144573 | <filename>scipy/special/tests/test_spence.py
import numpy as np
from numpy import sqrt, log, pi
from scipy.special._testutils import FuncData
from scipy.special import spence
def test_consistency():
# Make sure the implementation of spence for real arguments
# agrees with the implementation of spence for imag... |
test/test_form.py | syscocloud/puppetboard | 352 | 11144587 | <gh_stars>100-1000
from puppetboard import app, forms
def test_form_valid(capsys):
for form in [forms.QueryForm]:
with app.app.test_request_context():
qf = form()
out, err = capsys.readouterr()
assert qf is not None
assert err == ""
assert out ==... |
models/vgg_11.py | LucaBonfiglioli/Early-Bird-Tickets | 132 | 11144594 | import math
import torch.nn as nn
import torch.utils.model_zoo as model_zoo
__all__ = [
'slimmingvgg',
]
model_urls = {
'vgg11_bn': 'https://download.pytorch.org/models/vgg11_bn-6002323d.pth',
}
class VGG(nn.Module):
def __init__(self, features, cfg, num_classes=1000, init_weights=True):
super... |
src/operation/typechecker_unittest.py | fekblom/critic | 216 | 11144608 | <gh_stars>100-1000
import copy
import json
def basic():
import htmlutils
from operation.basictypes import OperationError, OperationFailure
from operation.typechecker import (
Optional, TypeChecker, TypeCheckerContext, BooleanChecker,
StringChecker, RestrictedString, SHA1, IntegerChecker,
... |
onsets_and_frames/mel.py | chenchy/onsets-and-frames | 149 | 11144631 | import numpy as np
import torch.nn.functional as F
from librosa.filters import mel
from librosa.util import pad_center
from scipy.signal import get_window
from torch.autograd import Variable
from .constants import *
class STFT(torch.nn.Module):
"""adapted from <NAME>'s https://github.com/pseeth/pytorch-stft"""
... |
deepfence_backend/cve_scan_registry/utils/credentials.py | tuapuikia/ThreatMapper | 1,281 | 11144670 | import requests
def get_registry_credential(credential_id, api_url, api_key):
headers = {"Content-Type": "application/json", "deepfence-key": api_key}
registry_credential_response = requests.post(
"https://{0}/df-api/registry-credential".format(api_url),
json={"credential_id": credential_id},
... |
test/ipython_etherbone.py | skiphansen/litex-buildenv | 198 | 11144699 | #!/usr/bin/env python3
from IPython import embed
from litescope.software.driver.analyzer import LiteScopeAnalyzerDriver
from common import *
from make import get_testdir
def main():
args, wb = connect("LiteX Etherbone Interactive Console")
print_memmap(wb)
print()
analyzer_csv = '{}/analyzer.csv'.f... |
Chap6PracPrintTable.py | viju4you/Python | 110 | 11144707 | <filename>Chap6PracPrintTable.py
#! /usr/bin/env python3
# Table Printer Chap. 6
# Function for taking lists of strings and displays in an organized table
tableData = [['apples','oranges','cherries','bananas'],
['Alice','Bob','Carol','David'],
['dogs','cats','moose','goose']]
def printTable... |
rl_coach/architectures/tensorflow_components/embedders/image_embedder.py | JohnnyPeng18/coach | 1,960 | 11144715 | <filename>rl_coach/architectures/tensorflow_components/embedders/image_embedder.py<gh_stars>1000+
#
# Copyright (c) 2017 Intel Corporation
#
# 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
#
# ... |
netbox/extras/tests/dummy_plugin/__init__.py | TheFlyingCorpse/netbox | 4,994 | 11144719 | from extras.plugins import PluginConfig
class DummyPluginConfig(PluginConfig):
name = 'extras.tests.dummy_plugin'
verbose_name = 'Dummy plugin'
version = '0.0'
description = 'For testing purposes only'
base_url = 'dummy-plugin'
min_version = '1.0'
max_version = '9.0'
middleware = [
... |
scitbx/linalg/tests/tst_cholesky.py | dperl-sol/cctbx_project | 155 | 11144722 | from __future__ import absolute_import, division, print_function
import scitbx.math
import scitbx.linalg
from scitbx import matrix
from scitbx.array_family import flex
from libtbx.test_utils import approx_equal
import random
from six.moves import range
def exercise_cholesky_decomposition():
from scitbx.examples impo... |
tests/property_test.py | jimustafa/gdstk | 135 | 11144781 | <reponame>jimustafa/gdstk<gh_stars>100-1000
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2020 <NAME>.
# This file is part of gdstk, distributed under the terms of the
# Boost Software License - Version 1.0. See the accompanying
# LICENSE file or <http://www.boost.org/LICENSE_1_0.txt>
import gdstk
def ... |
vmtkScripts/vmtkbifurcationreferencesystems.py | michelebucelli/vmtk | 217 | 11144782 | #!/usr/bin/env python
## Program: VMTK
## Module: $RCSfile: vmtkbifurcationreferencesystems.py,v $
## Language: Python
## Date: $Date: 2005/09/14 09:48:31 $
## Version: $Revision: 1.8 $
## Copyright (c) <NAME>, <NAME>. All rights reserved.
## See LICENSE file for details.
## This software is di... |
perma_web/perma/migrations/0014_auto_20160916_1953.py | rachelaus/perma | 317 | 11144803 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2016-09-16 19:53
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('perma', '0013_auto_20160829_2012'),
]
operations = [
migrations.AddField(
... |
tests/hare/assert_hare.py | josebalius/go-spacemesh | 586 | 11144847 | <reponame>josebalius/go-spacemesh<filename>tests/hare/assert_hare.py
from pytest_testconfig import config as testconfig
from tests.delayed_assert.delayed_assert import expect, assert_expectations
from tests.queries import query_hare_output_set, query_round_1, query_round_2, query_round_3, query_pre_round, \
query_... |
code/scripts/plan2scene/metric_impl/substance_classifier/prepare_texture_crops.py | madhawav/plan2scene | 305 | 11144852 | <gh_stars>100-1000
#!/bin/python3
import sys
import os
import os.path as osp
from PIL import Image
import argparse
import logging
from plan2scene.config_manager import ConfigManager
from plan2scene.texture_gen.custom_transforms.random_crop import RandomResizedCropAndDropAlpha
if __name__ == "__main__":
"""
T... |
mahotas/tests/test_center_of_mass.py | langner/mahotas | 541 | 11144867 | import numpy as np
from scipy import ndimage
import mahotas.center_of_mass
np.random.seed(2321)
def _mean_out(img, axis):
if len(img.shape) == 2: return img.mean(1-axis)
if axis == 0:
return _mean_out(img.mean(1), 0)
return _mean_out(img.mean(0), axis - 1)
def slow_center_of_mass(img):
'''
... |
lib/tool_shed/util/hg_util.py | rhpvorderman/galaxy | 1,085 | 11144873 | <gh_stars>1000+
import logging
import os
import subprocess
import tempfile
from datetime import datetime
from time import gmtime
from galaxy.tool_shed.util import basic_util
from galaxy.tool_shed.util.hg_util import (
clone_repository,
copy_file_from_manifest,
get_changectx_for_changeset,
get_config_fr... |
djstripe/management/commands/djstripe_clear_expired_idempotency_keys.py | iqbalabd/dj-stripe | 937 | 11144893 | <filename>djstripe/management/commands/djstripe_clear_expired_idempotency_keys.py<gh_stars>100-1000
from django.core.management.base import BaseCommand
from ...utils import clear_expired_idempotency_keys
class Command(BaseCommand):
help = "Deleted expired Stripe idempotency keys."
def handle(self, *args, **... |
compiler-rt/test/memprof/lit.cfg.py | acidburn0zzz/llvm-project | 2,338 | 11144909 | <reponame>acidburn0zzz/llvm-project
# -*- Python -*-
import os
import platform
import re
import lit.formats
# Get shlex.quote if available (added in 3.3), and fall back to pipes.quote if
# it's not available.
try:
import shlex
sh_quote = shlex.quote
except:
import pipes
sh_quote = pipes.quote
def get_requir... |
Pytorch/ActorCritic/agent_and_model.py | FitMachineLearning/FitML | 171 | 11144912 | <filename>Pytorch/ActorCritic/agent_and_model.py
## DQN Tutorial
## Implementation from https://github.com/FitMachineLearning
import torch
import gym
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import numpy as np
from dataclasses import dataclass
from typing import Any
fr... |
tools/mo/openvino/tools/mo/front/mxnet/eye_ext.py | opencv/dldt | 1,127 | 11144913 | <reponame>opencv/dldt
# Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
from openvino.tools.mo.ops.eye import MXEye
from openvino.tools.mo.front.extractor import FrontExtractorOp
from openvino.tools.mo.front.mxnet.extractors.utils import get_mxnet_layer_attrs
class... |
pytorch-pretrained-bert/src/gen_pt_squad.py | lianapanatau/BERT-for-RRC-ABSA | 425 | 11144917 | <gh_stars>100-1000
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team and authors from University of Illinois at Chicago.
# Copyright (c) 2018, <NAME>. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complian... |
src/nlpia/features.py | byukan/nlpia | 532 | 11144924 | import pandas as pd
import numpy as np
def optimize_feature_power(df, output_column_name=None, exponents=[2., 1., .8, .5, .25, .1, .01]):
""" Plot the correlation coefficient for various exponential scalings of input features
>>> np.random.seed(314159)
>>> df = pd.DataFrame()
>>> df['output'] = np.ra... |
scripts/readme.py | abdullahzamanbabar/syntribos | 277 | 11144925 | #!/usr/bin/env python
# Copyright 2016 Intel
#
# 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 ... |
src/gamesbyexample/ulamspiral.py | spp2/PythonStdioGames | 736 | 11144960 | """Ulam Spiral, by <NAME> <EMAIL>
The Ulam spiral is a mysterious mathematics pattern for prime numbers
with turtle graphics.
More info at https://en.wikipedia.org/wiki/Ulam_spiral"""
__version__ = 0
import turtle
import math
turtle.tracer(1000, 0) # Make the turtle draw faster.
SPACING = 3
DOT_SIZE = 4
def main():
... |
contrib/performance/sqlusage/requests/propfind_invite.py | backwardn/ccs-calendarserver | 462 | 11144997 | ##
# Copyright (c) 2012-2017 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
torchnlp/encoders/encoder.py | MPetrochuk/PyTorch-NLP | 2,125 | 11145071 | <filename>torchnlp/encoders/encoder.py
class Encoder(object):
"""
Base class for a encoder employing an identity function.
Args:
enforce_reversible (bool, optional): Check for reversibility on ``Encoder.encode`` and
``Encoder.decode``. Formally, reversible means:
``Encoder.decod... |
google_play_scraper/exceptions.py | shikher-chhawchharia/google-play-scraper | 325 | 11145073 | <filename>google_play_scraper/exceptions.py
class GooglePlayScraperException(Exception):
pass
class NotFoundError(GooglePlayScraperException):
pass
class ExtraHTTPError(GooglePlayScraperException):
pass
|
modules/nltk_contrib/coref/tag.py | h4ck3rm1k3/NLP-project | 123 | 11145128 | <gh_stars>100-1000
import os
import re
import subprocess
try:
from cStringIO import StringIO
except:
from StringIO import StringIO
from nltk.util import LazyMap, LazyConcatenation
from nltk.internals import find_binary, java
from nltk.tag import TaggerI
from nltk_contrib.coref import CorpusReaderDecorator
c... |
tcc/tcc/alignment.py | deepneuralmachine/google-research | 23,901 | 11145179 | <gh_stars>1000+
# 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
#
# Unless requ... |
src/pretalx/common/urls.py | hrchu/pretalx | 418 | 11145194 | <gh_stars>100-1000
from contextlib import suppress
from urllib.parse import urljoin, urlparse
from django.conf import settings
from django.urls import resolve, reverse
from urlman import Urls
def get_base_url(event=None, url=None):
if url and url.startswith("/orga"):
return settings.SITE_URL
if event... |
lisrd/models/lisrd_sift.py | liuyuzhenn/LISRD | 225 | 11145202 | """ Module to train and run LISRD-SIFT. """
import warnings
warnings.filterwarnings(action='once')
warnings.filterwarnings("ignore", message="numpy.ufunc size changed")
import cv2
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as func
from .base_model import BaseModel, Mode
from .bac... |
sdk/core/azure-common/tests/test_profile.py | rsdoherty/azure-sdk-for-python | 2,728 | 11145233 | <filename>sdk/core/azure-common/tests/test_profile.py
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#---------------------------------... |
notebooks/utils.py | gongda0e/AVT | 102 | 11145238 | # Copyright (c) Facebook, Inc. and its affiliates.
"""Utils for notebook."""
import sys
import os
import os.path as osp
import glob
from collections import OrderedDict
from collections.abc import Iterable
import json
import subprocess
import pickle as pkl
import logging
import h5py
import math
import operator
import ... |
autoPyTorch/utils/config_space_hyperparameter.py | mens-artis/Auto-PyTorch | 1,657 | 11145246 | import ConfigSpace as CS
import ConfigSpace.hyperparameters as CSH
def get_hyperparameter(hyper_type, name, value_range, log = False):
if isinstance(value_range, tuple) and len(value_range) == 2 and isinstance(value_range[1], bool) and \
isinstance(value_range[0], (tuple, list)):
value_range, log ... |
cirq-core/cirq/contrib/qcircuit/qcircuit_diagram_info_test.py | Saibaba-Alapati/Cirq | 3,326 | 11145254 | # Copyright 2018 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 applicable law or agreed to in ... |
alembic/versions/2020081018_added_group_uuid_to_worker_9d3ab0b9d304.py | kl-chou/codalab-worksheets | 236 | 11145262 | <filename>alembic/versions/2020081018_added_group_uuid_to_worker_9d3ab0b9d304.py<gh_stars>100-1000
"""Added group_uuid to worker
Revision ID: 9d3ab0b9d304
Revises: <PASSWORD>
Create Date: 2020-08-10 18:07:31.646054
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision ... |
simplemonitor/Loggers/seq.py | cgroschupp/simplemonitor | 373 | 11145276 | <filename>simplemonitor/Loggers/seq.py
"""
Simplemonitor logger for seq
Inspiration from
https://raw.githubusercontent.com/eifinger/appdaemon-scripts/master/seqSink/seqSink.py
"""
import datetime
import json
from typing import cast
import requests
from ..Monitors.monitor import Monitor
from .logger import Logger, r... |
validation_tests/analytical_exact/trapezoidal_channel/plot_results.py | samcom12/anuga_core | 136 | 11145293 | from anuga.utilities import plot_utils as util
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as pyplot
import numpy
from project import *
filename = 'channel_floodplain.sww'
# Time-index to plot outputs from
p2 = util.get_output(filename)
p=util.get_centroids(p2, velocity_extrapol... |
modoboa/maillog/lib.py | HarshCasper/modoboa | 1,602 | 11145302 | <filename>modoboa/maillog/lib.py
# coding: utf-8
import sys
import time
def date_to_timestamp(timetuple):
"""Date conversion.
Returns a date and a time in seconds from the epoch.
:param list timetuple: list containing date
:return: an integer
"""
date = " ".join(
[("%d" % elem) if is... |
netrd/dynamics/SIS.py | sdmccabe/netrd | 116 | 11145314 | <filename>netrd/dynamics/SIS.py<gh_stars>100-1000
"""
SIS.py
------
Implementation of Susceptible-Infected-Susceptible models dynamics on a
network.
author: <NAME>
Submitted as part of the 2019 NetSI Collabathon.
"""
from netrd.dynamics import BaseDynamics
import numpy as np
import networkx as nx
class SISModel(... |
stix/test/extensions/identity/ciq_identity_3_0_test.py | saegel/python-stix | 194 | 11145321 | # Copyright (c) 2017, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import unittest
from mixbox.vendor.six import BytesIO, text_type
from stix.threat_actor import ThreatActor
import stix.extensions.identity.ciq_identity_3_0 as ciq
from stix.test import EntityTestCase
from stix.core... |
tests/test_provider_gavinbunney_bitbucketserver.py | mjuenema/python-terrascript | 507 | 11145348 | <gh_stars>100-1000
# tests/test_provider_gavinbunney_bitbucketserver.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:13:29 UTC)
def test_provider_import():
import terrascript.provider.gavinbunney.bitbucketserver
def test_resource_import():
from terrascript.resource.gavinbunney.bitbucketser... |
vh-gunicorn/gunicorn.py | rEinve/ajenti-v | 150 | 11145376 | <filename>vh-gunicorn/gunicorn.py
import os
import shutil
from ajenti.api import *
from ajenti.plugins.supervisor.client import SupervisorServiceManager
from ajenti.plugins.vh.api import ApplicationGatewayComponent, SanityCheck
from ajenti.plugins.vh.processes import SupervisorRestartable
from ajenti.util import platf... |
samples/14-semparsing/ucca/scripts/annotate.py | tomshafer/nn4nlp | 1,037 | 11145384 | <reponame>tomshafer/nn4nlp
#!/usr/bin/env python3
import argparse
import glob
import sys
from ucca.ioutil import file2passage, passage2file
from ucca.textutil import annotate
desc = """Read UCCA standard format in XML or binary pickle, and write back with POS tags and dependency parse."""
def main():
argparser... |
tests/math/test_geometry.py | AdvaitDhingra/scikit-hep | 150 | 11145413 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license, see LICENSE.
"""
Tests for the skhep.math.geometry module.
"""
# -----------------------------------------------------------------------------
# Import statements
# -------------------------------------------------------------... |
NKUCodingCat/0021/encry.py | saurabh896/python-1 | 3,976 | 11145426 | <filename>NKUCodingCat/0021/encry.py<gh_stars>1000+
#coding=utf-8
import os,time,random,hashlib,math
def md5(str):
m = hashlib.md5()
m.update(str)
return m.hexdigest()
def Salt(len=64):
return "%s"*len%tuple([chr(65+random.randint(0,25)) for i in range(len)])
def encry(Str):
Log = int(math.log(len(Str),2))+1
M... |
service_catalog/admin.py | LaudateCorpus1/squest | 112 | 11145441 | <reponame>LaudateCorpus1/squest
from django.db import models
from django.contrib import admin
from martor.widgets import AdminMartorWidget
from service_catalog.models.documentation import Doc
class DocAdmin(admin.ModelAdmin):
formfield_overrides = {
models.TextField: {'widget': AdminMartorWidget},
}... |
mmdet/models/detectors/dense_reppoints_detector.py | azuredsky/RepPointsV2 | 295 | 11145458 | <reponame>azuredsky/RepPointsV2
import mmcv
import numpy as np
import scipy.interpolate
import torch
from mmdet.core import bbox2result
from .single_stage import SingleStageDetector
from ..builder import DETECTORS
@DETECTORS.register_module()
class DenseRepPointsDetector(SingleStageDetector):
def __init__(self,... |
paypal/standard/ipn/migrations/0008_auto_20181128_1032.py | americanhandelsociety/django-paypal | 563 | 11145516 | # Generated by Django 2.1.3 on 2018-11-28 10:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ipn', '0007_auto_20160219_1135'),
]
operations = [
migrations.AlterField(
model_name='paypalipn',
name='flag',
... |
models/department.py | noryb009/rmc | 164 | 11145548 | <gh_stars>100-1000
import mongoengine as me
class Department(me.Document):
# eg. earth
id = me.StringField(primary_key=True)
# eg. Earth Sciences
name = me.StringField(required=True)
# eg. sci
faculty_id = me.StringField(required=True)
# TODO(mack): url is broken, a lot of urls are for ... |
tests/unit/wallet/test_transaction.py | nishp77/lbry-sdk | 4,996 | 11145583 | import os
import unittest
import tempfile
import shutil
from binascii import hexlify, unhexlify
from itertools import cycle
from lbry.testcase import AsyncioTestCase
from lbry.wallet.constants import CENT, COIN, NULL_HASH32
from lbry.wallet import Wallet, Account, Ledger, Database, Headers, Transaction, Output, Input
... |
models/mnist_models.py | SanghyukChun/rebias | 129 | 11145593 | <filename>models/mnist_models.py
"""ReBias
Copyright (c) 2020-present NAVER Corp.
MIT license
Implementation for simple statcked convolutional networks.
"""
import torch
import torch.nn as nn
class SimpleConvNet(nn.Module):
def __init__(self, num_classes=None, kernel_size=7, feature_pos='post'):
super(Si... |
src/reader/__main__.py | mirekdlugosz/reader | 205 | 11145602 | <filename>src/reader/__main__.py
import sys
CANNOT_IMPORT = """\
Error: cannot import reader._cli
This might be due to missing dependencies. The command-line interface is
optional, use the 'cli' extra to install its dependencies:
pip install reader[cli]
"""
try:
from reader._cli import cli
cli(prog_nam... |
profiles/migrations/0003_role_team_teamrolebinding_userrolebinding.py | slarimore02/squest | 112 | 11145605 | # Generated by Django 3.2.9 on 2021-12-01 21:43
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
from profiles.migrations import _rbac as rbac
class Migration(migrations.Migration):
dependencies = [
('auth', '0012_alter_user_first_name_max_length... |
features/steps/line.py | kckaiwei/python-pptx | 1,429 | 11145617 | # encoding: utf-8
"""Step implementations for LineFormat-related features."""
from __future__ import absolute_import, print_function, unicode_literals
from behave import given, then, when
from pptx import Presentation
from pptx.enum.dml import MSO_LINE
from pptx.util import Length, Pt
from helpers import test_pptx... |
tapiriik/web/views/rollback.py | prohfesor/tapiriik | 1,445 | 11145636 | from tapiriik.services.rollback import RollbackTask
from django.http import HttpResponse
from django.views.decorators.http import require_GET
from django.shortcuts import redirect, render
def account_rollback_initiate(req):
if not req.user:
return HttpResponse(status=403)
task = RollbackTask.Create(re... |
urizen/core/utils.py | vurmux/urizen | 107 | 11145649 | <filename>urizen/core/utils.py
#!/usr/bin/env python3
import pkgutil
import importlib
import sys
from inspect import getmembers, isfunction
import urizen as uz
def find_generators(module):
path_dict = {}
spec_list = []
for importer, modname, ispkg in pkgutil.walk_packages(module.__path__):
import... |
src/sage/tests/books/computational-mathematics-with-sagemath/sol/graphique_doctest.py | UCD4IDS/sage | 1,742 | 11145650 | <filename>src/sage/tests/books/computational-mathematics-with-sagemath/sol/graphique_doctest.py
## -*- encoding: utf-8 -*-
"""
This file (./sol/graphique_doctest.sage) was *autogenerated* from ./sol/graphique.tex,
with sagetex.sty version 2011/05/27 v2.3.1.
It contains the contents of all the sageexample environments f... |
src/mattermostdriver/endpoints/status.py | fried/python-mattermost-driver | 142 | 11145658 | <reponame>fried/python-mattermost-driver<gh_stars>100-1000
from .base import Base
class Status(Base):
def get_user_status(self, user_id):
return self.client.get(
'/users/' + user_id + '/status'
)
def update_user_status(self, user_id, options=None):
return self.client.put(
'/users/' + user_id + '/statu... |
__scraping__/associatedrealtorsaruba.com - selenium/main.py | whitmans-max/python-examples | 140 | 11145662 | <filename>__scraping__/associatedrealtorsaruba.com - selenium/main.py<gh_stars>100-1000
#!/usr/bin/env python3
# date: 2020.01.07
# https://stackoverflow.com/questions/59632031/how-to-extract-href-when-href-element-is-a-hyperlink?noredirect=1#comment105434826_59632031
import selenium.webdriver
url = 'https:/... |
software/glasgow/gateware/analyzer.py | electroniceel/Glasgow | 1,014 | 11145674 | from functools import reduce
from collections import OrderedDict
from nmigen.compat import *
from nmigen.compat.genlib.fifo import _FIFOInterface, SyncFIFOBuffered
from nmigen.compat.genlib.coding import PriorityEncoder, PriorityDecoder
__all__ = ["EventSource", "EventAnalyzer", "TraceDecodingError", "TraceDecoder"]
... |
main/model.py | tucan9389/MobileHumanPose | 137 | 11145686 | <reponame>tucan9389/MobileHumanPose
import torch
import torch.nn as nn
from torch.nn import functional as F
from backbone import *
from config import cfg
import os.path as osp
model_urls = {
'MobileNetV2': 'https://download.pytorch.org/models/mobilenet_v2-b0353104.pth',
'ResNet18': 'https://download.p... |
pypower/t/t_skip.py | Bengt/PYPOWER | 221 | 11145691 | <filename>pypower/t/t_skip.py
# Copyright (c) 1996-2015 PSERC. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
"""Skips a number of tests.
"""
from pypower.t.t_globals import TestGlobals
def t_skip(cnt, msg=''):
"""Skips a number of test... |
python/tvm/ir/op.py | XiaoSong9905/tvm | 4,640 | 11145713 | <filename>python/tvm/ir/op.py
# 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 (t... |
pygithub3/services/pull_requests/__init__.py | teamorchard/python-github3 | 107 | 11145737 | # -*- encoding: utf-8 -*-
from pygithub3.services.base import Service, MimeTypeMixin
from .comments import Comments
class PullRequests(Service, MimeTypeMixin):
"""Consume `Pull Request API <http://developer.github.com/v3/pulls/>`_"""
def __init__(self, **config):
self.comments = Comments(**config)
... |
evennia/scripts/migrations/0003_checksessions_defaultscript_donothing_scriptbase_store_validatechannelhandler_validateidmappercache_.py | Jaykingamez/evennia | 1,544 | 11145747 | <gh_stars>1000+
# -*- coding: utf-8 -*-
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [("scripts", "0002_auto_20150118_1625")]
operations = [
migrations.CreateModel(
name="ScriptBase", fields=[], options={"proxy": True}, bases=("scripts.... |
tests/some_test.py | lmicra/paco | 208 | 11145763 | <reponame>lmicra/paco<filename>tests/some_test.py
# -*- coding: utf-8 -*-
import pytest
import asyncio
from paco import some
from .helpers import run_in_loop
@asyncio.coroutine
def coro(num):
return num < 2
@asyncio.coroutine
def coro_false(num):
return num > 10
def test_some_truly():
task = some(coro... |
rlschool/quadrotor/render.py | ANCL/QuadPPO | 169 | 11145771 | <reponame>ANCL/QuadPPO
# Copyright (c) 2019 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
# Un... |
easytransfer/model_zoo/modeling_utils.py | mczhuge/Kaleido-BERT | 109 | 11145780 | <reponame>mczhuge/Kaleido-BERT
# coding=utf-8
# Copyright (c) 2019 Alibaba PAI team.
#
# 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
#
# Unl... |
bench_fio/benchlib/runfio.py | Flowrey/fio-plot | 148 | 11145788 | #!/usr/bin/env python3
import subprocess
import sys
import os
import copy
from numpy import linspace
import time
from . import (
supporting,
checks
)
def check_fio_version(settings):
"""The 3.x series .json format is different from the 2.x series format.
This breaks fio-plot, thus this older version... |
vcx/wrappers/python3/demo/alice_create_with_message_flow.py | sklump/indy-sdk | 636 | 11145802 | <reponame>sklump/indy-sdk
import asyncio
import json
from alice import init, connect, accept_offer, create_proof
from demo_utils import download_message, update_message_as_read
from vcx import logging
from vcx.api.credential import Credential
from vcx.api.disclosed_proof import DisclosedProof
async def main():
... |
common/utils/analysis/tsne.py | billzhonggz/Transfer-Learning-Library | 1,474 | 11145834 | <reponame>billzhonggz/Transfer-Learning-Library<filename>common/utils/analysis/tsne.py
"""
@author: <NAME>
@contact: <EMAIL>
"""
import torch
import matplotlib
matplotlib.use('Agg')
from sklearn.manifold import TSNE
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as col
def visualize(sour... |
tests/test_03_files.py | tilschaef/genomepy | 146 | 11145860 | <gh_stars>100-1000
import filecmp
import os
import shutil
import subprocess as sp
from tempfile import NamedTemporaryFile
import pytest
from pyfaidx import Fasta
import genomepy.files
@pytest.fixture
def zipped_genome():
tmp = NamedTemporaryFile(suffix=".fa.zip", delete=False)
shutil.copyfile("tests/data/zi... |
etc/theory/experiments/huffman_idealness/analysis.py | Cancelll/rupture | 184 | 11145911 | <reponame>Cancelll/rupture
from string import printable
from generate_huffman import get_huffman_tree
import matplotlib.pyplot as plt
from collections import OrderedDict
import numpy as np
from string import whitespace
def get_ideal_tree(freq_list):
freq_list = sorted(freq_list, reverse=True)
output = []
... |
examples/pp_stochastic_control_flow.py | zhangyewu/edward | 5,200 | 11145951 | """Stochastic control flow.
We sample from a geometric random variable by using samples from
Bernoulli random variables. It requires a while loop whose condition
is stochastic.
References
----------
https://probmods.org/chapters/02-generative-models.html#stochastic-recursion
"""
from __future__ import absolute_import... |
kolibri/core/test/test_setlanguage.py | MBKayro/kolibri | 545 | 11146000 | from django.conf import settings
from django.http import HttpResponseNotAllowed
from django.test import TestCase
from django.urls import reverse
from django.urls import translate_url
from django.utils.translation import get_language
from django.utils.translation import LANGUAGE_SESSION_KEY
class I18NTests(TestCase):
... |
py/testdir_single_jvm/test_export_import.py | gigliovale/h2o | 882 | 11146008 | import unittest, random, sys, time
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_rf as h2o_rf, h2o_import as h2i, h2o_exec, h2o_jobs, h2o_gbm
paramDict = {
'response': 'C55',
'cols': None,
# 'ignored_cols_by_name': 'C1,C2,C6,C7,C8',
'ignored_cols_by_name': None,
'classification'... |
classifier/classifier_tuner.py | meghanaravikumar/sigopt-examples | 213 | 11146049 | <filename>classifier/classifier_tuner.py
"""Class for searching for the best classification hyperparameters for a given dataset."""
from __future__ import print_function
import argparse
import itertools
import json
import numpy
import sys
from sklearn import datasets, svm, ensemble
from sigopt import Connection
from s... |
Intermediate Challenges/Challenge 0046 Intermediate/solutions/solution.py | FreddieV4/DailyProgrammerChallenges | 331 | 11146067 | <reponame>FreddieV4/DailyProgrammerChallenges
# tlseabra@github
import random
def game():
indices = list(range(8))
places = [None] * 8
while indices:
d = random.randint(0,9)
i = round(d*7/9)
real_index, c = i, 1
while not real_index in indices:
if all(x in indice... |
openproblems/tasks/dimensionality_reduction/methods/__init__.py | rcannood/openproblems | 134 | 11146119 | from .pca import pca
from .phate import phate_default
from .phate import phate_scanpy
from .tsne import tsne
from .umap import umap
|
dbaas/notification/tests/test_notification.py | didindinn/database-as-a-service | 303 | 11146125 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from mock import patch
from django.test import TestCase
from django.core import mail
from account.tests.factory import TeamFactory
from logical.tests.factory import DatabaseFactory
from system.models import Configuration
from notification.tasks import dat... |
scripts/automation/regression/hltapi_playground.py | timgates42/trex-core | 956 | 11146130 | <filename>scripts/automation/regression/hltapi_playground.py
#!/router/bin/python
import outer_packages
#from trex_stl_lib.trex_stl_hltapi import CTRexHltApi, CStreamsPerPort
from trex_stl_lib.trex_stl_hltapi import *
import traceback
import sys, time
from pprint import pprint
import argparse
def error(err = None):
... |
tensorflow/python/data/kernel_tests/range_test.py | abhaikollara/tensorflow | 848 | 11146156 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.