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 |
|---|---|---|---|---|
venv/Lib/site-packages/zope/interface/common/io.py | asanka9/Quession-Discussion-App-Socket.Io-NLP | 275 | 12624670 | <gh_stars>100-1000
##############################################################################
# Copyright (c) 2020 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distrib... |
Python/Numpy/fft.py | Gjacquenot/training-material | 115 | 12624674 | <reponame>Gjacquenot/training-material
#!/usr/bin/env python
from argparse import ArgumentParser
from math import ceil
import numpy as np
import matplotlib.pyplot as plt
arg_parser = ArgumentParser(description='plot function and frequency '
'spectrum')
arg_parser.add_argument('... |
third_party/gsutil/test/gsutil_measure_imports.py | tingshao/catapult | 2,151 | 12624676 | # -*- coding: utf-8 -*-
# Copyright 2016 Google 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 require... |
tests/components/overland_flow/test_kinwave_implicit.py | amanaster2/landlab | 257 | 12624682 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Unit tests for KinwaveImplicitOverlandFlowModel.
Created on Sat Apr 1 10:49:33 2017
@author: gtucker
"""
import numpy as np
from landlab import RasterModelGrid
from landlab.components import KinwaveImplicitOverlandFlow
def test_initialization():
"""Test init... |
diffxpy/unit_test/test_partition.py | adkinsrs/diffxpy | 111 | 12624692 | <gh_stars>100-1000
import unittest
import logging
import numpy as np
import pandas as pd
import scipy.stats as stats
from batchglm.api.models.numpy.glm_nb import Simulator
import diffxpy.api as de
class TestPartitionNull(unittest.TestCase):
def test_null_distribution_wald(self, n_cells: int = 4000, n_genes: int... |
data/synthia_dataset.py | Jo-wang/ProDA | 193 | 12624693 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import os
import sys
import torch
import numpy as np
from PIL import Image
import random
import imageio
from data import BaseDataset
from data.randaugment import RandAugmentMC
class Synthia_loader(BaseDataset):
"""
Synthia synthetic ... |
Tilemap_Game_With_CircuitPython/tilegame_assets/text_helper.py | gamblor21/Adafruit_Learning_System_Guides | 665 | 12624714 | # SPDX-FileCopyrightText: 2020 FoamyGuy for Adafruit Industries
#
# SPDX-License-Identifier: MIT
def wrap_nicely(string, max_chars):
""" From: https://www.richa1.com/RichardAlbritton/circuitpython-word-wrap-for-label-text/
A helper that will return the string with word-break wrapping.
:param str string: Th... |
pyretri/utils/module_base.py | dongan-beta/PyRetri | 1,063 | 12624759 | <reponame>dongan-beta/PyRetri
# -*- coding: utf-8 -*-
from abc import ABCMeta
from copy import deepcopy
from typing import Dict
class ModuleBase:
"""
The base class of all classes. You can access default hyper-parameters by Class. And
set hyper-parameters for each instance at the initialization.
"""
... |
sympy/solvers/tests/test_polysys.py | bigfooted/sympy | 603 | 12624761 | """Tests for solvers of systems of polynomial equations. """
from sympy import (flatten, I, Integer, Poly, QQ, Rational, S, sqrt,
solve, symbols)
from sympy.abc import x, y, z
from sympy.polys import PolynomialError
from sympy.solvers.polysys import (solve_poly_system,
solve_triangulated, solve_biquadratic, So... |
tick/survival/simu_coxreg.py | sumau/tick | 411 | 12624794 | <filename>tick/survival/simu_coxreg.py
# License: BSD 3 clause
import numpy as np
from tick.base.simulation import SimuWithFeatures
from tick.preprocessing.features_binarizer import FeaturesBinarizer
# TODO: something better to tune the censoring level than this censoring factor
class SimuCoxReg(SimuWithFeatures):... |
awsiot/iotshadow.py | vietmaiquoc/aws-iot-device-sdk-python-v2 | 224 | 12624830 | <reponame>vietmaiquoc/aws-iot-device-sdk-python-v2
# Copyright Amazon.com, Inc. or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0.
# This file is generated
import awsiot
import concurrent.futures
import datetime
import typing
class IotShadowClient(awsiot.MqttServiceClient):
def publi... |
torch_kalman/kalman_filter/__init__.py | strongio/torch_kalman | 105 | 12624836 | from .base import KalmanFilter
|
test/run.py | miaopei/deep_landmark | 327 | 12624852 | #!/usr/bin/env python2.7
# coding: utf-8
"""
This file use Caffe model to predict data from http://mmlab.ie.cuhk.edu.hk/archive/CNN_FacePoint.htm
"""
import os, sys
from functools import partial
import cv2
from common import getDataFromTxt, createDir, logger, drawLandmark
from common import level1, level2, level3
... |
a02_TextCNN/data_util.py | sunshinenum/text_classification | 7,723 | 12624872 | <reponame>sunshinenum/text_classification
# -*- coding: utf-8 -*-
import codecs
import random
import numpy as np
from tflearn.data_utils import pad_sequences
from collections import Counter
import os
import pickle
PAD_ID = 0
UNK_ID=1
_PAD="_PAD"
_UNK="UNK"
def load_data_multilabel(traning_data_path,vocab_word2index,... |
Hackathon/hackerearth_improved_table.py | elawang9/Scripting-and-Web-Scraping | 119 | 12624913 | <reponame>elawang9/Scripting-and-Web-Scraping<filename>Hackathon/hackerearth_improved_table.py
# Install PhantomJS to use this script
from selenium import webdriver
from bs4 import BeautifulSoup
from time import sleep
from terminaltables import DoubleTable
from colorclass import Color
print('--- Fetching hackathons-... |
pwnlib/commandline/unhex.py | IMULMUL/python3-pwntools | 325 | 12624914 | <filename>pwnlib/commandline/unhex.py
#!/usr/bin/env python3
import argparse
import re
import sys
from pwnlib.util.fiddling import unhex
parser = argparse.ArgumentParser(description='''
Decodes hex-encoded data provided on the command line or via stdin.
''')
parser.add_argument('hex', nargs='*',
h... |
tests/plugins/slow_init.py | Bladez1753/lightning | 2,288 | 12624933 | <gh_stars>1000+
#!/usr/bin/env python3
from pyln.client import Plugin
import os
import time
plugin = Plugin()
@plugin.init()
def init(options, configuration, plugin):
plugin.log("slow_init.py initializing {}".format(configuration))
time.sleep(int(os.getenv('SLOWINIT_TIME', "0")))
plugin.run()
|
etc/release/bootstrap.py | quepop/scancode-toolkit | 1,511 | 12624951 | <gh_stars>1000+
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) nexB Inc. and others. All rights reserved.
# ScanCode is a trademark of nexB Inc.
# SPDX-License-Identifier: Apache-2.0
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
# See https://github.com/nexB/scancode-toolkit fo... |
contrib/python/CUBRIDdb/FIELD_TYPE.py | eido5/cubrid | 253 | 12624954 | <gh_stars>100-1000
"""CUBRID FIELD_TYPE Constants
These constants represent the various column (field) types that are
supported by CUBRID.
"""
CHAR = 1
VARCHAR = 2
NCHAR = 3
VARNCHAR = 4
BIT = 5
VARBIT = 6
NUMERIC = 7
INT = 8
SMALLINT = 9
MONETARY = 10
BIGINT = 21
FLOAT = 11
DOUBLE = 12
DATE ... |
nebula2/data/DataObject.py | xiaoronghuang/nebula-python | 110 | 12624987 | #!/usr/bin/env python
# --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 pytz
from datetime import datetime, timezone, timedelta
from nebula2.Exception ... |
openbook_connections/serializers.py | TamaraAbells/okuna-api | 164 | 12624989 | from django.conf import settings
from rest_framework import serializers
from openbook_auth.models import User, UserProfile
from openbook_auth.validators import user_username_exists, username_characters_validator
from openbook_circles.models import Circle
from openbook_circles.validators import circle_id_exists
from op... |
python/tvm/autotvm/tuner/metric.py | jiangzoi/incubator-tvm | 286 | 12625001 | <reponame>jiangzoi/incubator-tvm<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 Li... |
examples/copy_boot_volume_backup_example.py | Manny27nyc/oci-python-sdk | 249 | 12625005 | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... |
cacreader/swig-4.0.2/Examples/test-suite/python/cpp11_null_pointer_constant_runme.py | kyletanyag/LL-Smartcard | 1,031 | 12625022 | <reponame>kyletanyag/LL-Smartcard
import cpp11_null_pointer_constant
a = cpp11_null_pointer_constant.A()
if a._myA != None:
raise RuntimeError, (
"cpp11_null_pointer_constant: _myA should be None, but is ", a._myA)
b = cpp11_null_pointer_constant.A()
if a._myA != b._myA:
raise RuntimeError, (
... |
src/gausskernel/dbmind/tools/ai_server/common/logger.py | Yanci0/openGauss-server | 360 | 12625053 | <reponame>Yanci0/openGauss-server
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#############################################################################
# Copyright (c): 2021, Huawei Tech. Co., Ltd.
# FileName : logger.py
# Version :
# Date : 2021-4-7
# Description : Logger for project
#############... |
bibliopixel/util/threads/task_thread.py | rec/leds | 253 | 12625097 | import collections, threading
from . import runnable
class Task(object):
def __init__(self, task=None, event=None):
self.task = task or (lambda: None)
self.event = event or threading.Event()
def run(self, next_task):
"""Wait for the event, run the task, trigger the next task."""
... |
tools/cr/cr/targets/chrome.py | iplo/Chain | 231 | 12625107 | # Copyright 2013 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.
"""Module for the chrome targets."""
import cr
class ChromeTarget(cr.NamedTarget):
NAME = 'chrome'
DEFAULT = cr.Config.From(
# CR_URL is the pa... |
chainer/links/activation/simplified_dropconnect.py | zaltoprofen/chainer | 3,705 | 12625118 | <gh_stars>1000+
import numpy
from chainer.functions.noise import simplified_dropconnect
from chainer import initializers
from chainer import link
from chainer import variable
class SimplifiedDropconnect(link.Link):
"""Fully-connected layer with simplified dropconnect regularization.
Notice:
This implem... |
glucosetracker/blogs/views.py | arhanair/glucose-tracker-monitor | 134 | 12625120 | <filename>glucosetracker/blogs/views.py
from django.views.generic.base import ContextMixin
from django.views.generic import DetailView, ListView
from taggit.models import TaggedItem
from .models import Blog, BlogAd
class BlogBaseView(ContextMixin):
def get_context_data(self, **kwargs):
context = super(... |
vumi/errors.py | seidu626/vumi | 199 | 12625125 | class VumiError(Exception):
pass
class InvalidMessage(VumiError):
pass
class InvalidMessageType(VumiError):
pass
class MissingMessageField(InvalidMessage):
pass
class InvalidMessageField(InvalidMessage):
pass
class DuplicateConnectorError(VumiError):
pass
class InvalidEndpoint(VumiEr... |
tests/test_serialization_format.py | hsadeghidw/dimod | 101 | 12625129 | <filename>tests/test_serialization_format.py<gh_stars>100-1000
# Copyright 2019 D-Wave Systems 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 at
#
# http://www.apache.org/l... |
deepspeed/runtime/sparse_tensor.py | ganik/DeepSpeed | 6,728 | 12625132 | <gh_stars>1000+
"""
Copyright 2020 The Microsoft DeepSpeed Team
Implementation of a compressed sparse tensor. Similar in
functionality to TensorFlow's IndexedSlices implementation.
"""
import torch
class SparseTensor(object):
""" Compressed Sparse Tensor """
def __init__(self, dense_tensor=None):
se... |
src/network/advanceddispatcher.py | BeholdersEye/PyBitmessage | 1,583 | 12625147 | """
Improved version of asyncore dispatcher
"""
import socket
import threading
import time
import network.asyncore_pollchoose as asyncore
import state
from threads import BusyError, nonBlocking
class ProcessingError(Exception):
"""General class for protocol parser exception,
use as a base for others."""
... |
ttp/__init__.py | showipintbri/ttp | 254 | 12625153 | name = "ttp"
__all__ = ["ttp"]
__author__ = "<NAME> <<EMAIL>>"
__version__ = "0.0.2"
from sys import version_info
# get python version:
python_major_version = version_info.major
if python_major_version == 3:
from ttp.ttp import ttp
from ttp.utils.quick_parse import quick_parse
elif python_major_version == 2:... |
src/genie/libs/parser/iosxe/tests/ShowInventory/cli/equal/golden_output_5_expected.py | balmasea/genieparser | 204 | 12625166 | <gh_stars>100-1000
expected_output = {
"main": {
"chassis": {
"C9407R": {
"name": "Chassis",
"descr": "Cisco Catalyst 9400 Series 7 Slot Chassis",
"pid": "C9407R",
"vid": "V01",
"sn": "******",
}
... |
cairocffi/test_pixbuf.py | Afoucaul/cairocffi | 116 | 12625170 | """
cairocffi.test_pixbuf
~~~~~~~~~~~~~~~~~~~~~
Test suite for cairocffi.pixbuf.
:copyright: Copyright 2013-2019 by <NAME>
:license: BSD, see LICENSE for details.
"""
import base64
import sys
import zlib
import pytest
from . import constants, pixbuf
PNG_BYTES = base64.b64decode(
b'iVBORw0... |
glucosetracker/core/forms.py | arhanair/glucose-tracker-monitor | 134 | 12625211 | from django import forms
from crispy_forms.helper import FormHelper, Layout
from crispy_forms.layout import Submit, Fieldset, HTML, Field
from crispy_forms.bootstrap import FormActions
class ContactForm(forms.Form):
email = forms.EmailField(label='Your Email Address')
subject = forms.CharField(required=False... |
tests/utils/lp_utils_test.py | sash-a/Mava | 337 | 12625221 | <filename>tests/utils/lp_utils_test.py<gh_stars>100-1000
# python3
# Copyright 2021 InstaDeep 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.apac... |
tests/components/litterrobot/test_button.py | MrDelik/core | 22,481 | 12625264 | <filename>tests/components/litterrobot/test_button.py
"""Test the Litter-Robot button entity."""
from unittest.mock import MagicMock
from freezegun import freeze_time
from homeassistant.components.button import DOMAIN as BUTTON_DOMAIN, SERVICE_PRESS
from homeassistant.const import ATTR_ENTITY_ID, ATTR_ICON, STATE_UNK... |
skompiler/fromskast/sqlalchemy.py | odinsemvosem/SKompiler | 112 | 12625266 | <reponame>odinsemvosem/SKompiler
"""
SKompiler: Generate SQLAlchemy expressions from SKAST.
"""
from functools import reduce
from collections import namedtuple
import numpy as np
import sqlalchemy as sa
from sqlalchemy.sql.selectable import Join, FromGrouping
from ..ast import ArgMax, VecMax, Softmax, IsElemwise, VecSu... |
Packs/HealthCheck/Scripts/HealthCheckDiskUsageLine/HealthCheckDiskUsageLine.py | diCagri/content | 799 | 12625270 | <gh_stars>100-1000
from CommonServerPython import * # noqa: F401
def main():
res = execute_command("demisto-api-get", {"uri": "/system/config"})
config_json = res['response']
partition = config_json.get('sysConf', {}).get('disk.partitions.to.monitor') or '/'
res = execute_command(
"demisto-... |
inference/Megatron-LM-v2.3/tools/openwebtext/filter_ngrams.py | ganik/DeepSpeedExamples | 309 | 12625285 | <gh_stars>100-1000
# coding=utf-8
# Copyright (c) 2020, NVIDIA CORPORATION. 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/LICENS... |
tests/integrational/native_sync/test_revoke_v3.py | natekspencer/pubnub-python | 146 | 12625288 | from pubnub.pubnub import PubNub
from pubnub.models.consumer.v3.channel import Channel
from tests.integrational.vcr_helper import pn_vcr
from tests.helper import pnconf_pam_stub_copy
from pubnub.models.consumer.v3.access_manager import PNGrantTokenResult, PNRevokeTokenResult
pubnub = PubNub(pnconf_pam_stub_copy())
pub... |
nipy/utils/__init__.py | bpinsard/nipy | 236 | 12625316 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
General utilities for code support.
These are modules that we (broadly-speaking) wrote; packages that other people
wrote, that we ship, go in the nipy.externals tree.
"""
from __future__ import absolut... |
MITx-6.00.2x/Midterm Quiz/Problem_3-song_playlist.py | Sam-Gao-Xin/Courses- | 622 | 12625330 | # -*- coding: utf-8 -*-
"""
@author: salimt
"""
#Problem 3
#20.0/20.0 points (graded)
#You are creating a song playlist for your next party. You have a collection of songs that can be represented as a list of tuples. Each tuple has the following elements:
#name: the first element, representing the song name ... |
setup.py | MojixCoder/python-jalali | 235 | 12625366 | import setuptools
from distutils.core import setup
setup(
name='jdatetime',
version='3.7.0',
packages=['jdatetime', ],
license='Python Software Foundation License',
keywords='Jalali implementation of Python datetime',
platforms='any',
author='<NAME>',
author_email='<EMAIL>',
descri... |
src/tools/libraryInfo/BUILD.py | t3kt/raytk | 108 | 12625371 | <reponame>t3kt/raytk
# noinspection PyUnreachableCode
if False:
# noinspection PyUnresolvedReferences
from _stubs import *
from raytkBuild import BuildTaskContext
from .libraryInfoExt import LibraryInfoBuilder
ext.libraryInfo = LibraryInfoBuilder(COMP())
context = args[0] # type: BuildTaskContext
context.log('... |
GUI/AboutDialog.py | yasoob/youtube-dl-GUI | 203 | 12625378 | from PyQt5 import QtCore, QtWidgets
from UI.AboutDialog import Ui_Dialog
class AboutDialog(QtWidgets.QDialog):
def __init__(self, parent=None):
super(AboutDialog, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) # type: ignore
self.ui = Ui_Dialog()
self.u... |
Pytorch/train.py | jiajunhua/qjadud1994-Text_Detector | 221 | 12625387 | <filename>Pytorch/train.py
from __future__ import print_function
import time
import os
import argparse
import numpy as np
import cv2
from subprocess import Popen, PIPE
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
from tensorboardX... |
third_party/blink/renderer/build/scripts/make_document_policy_features_tests.py | zealoussnow/chromium | 14,668 | 12625393 | <reponame>zealoussnow/chromium
# Copyright 2021 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.
# Note(crbug.com/1167597): Do NOT change the file name to end with
# '_test.py' or '_unittest.py' as these files will be recog... |
Stephanie/TextProcessor/audio_text_manager.py | JeremyARussell/stephanie-va | 866 | 12625394 | import re
import speech_recognition as sr
from Stephanie.AudioManager.audio_manager import AudioManager
from Stephanie.TextManager.text_manager import TextManager
from Stephanie.TextProcessor.text_sorter import TextSorter
from Stephanie.TextProcessor.text_learner import TextLearner
class AudioTextManager(AudioManager... |
examples/basic/picture2mesh.py | evanphilip/vedo | 836 | 12625396 | # Transform a picture into a mesh
from vedo import Picture, dataurl, show
import numpy as np
pic = Picture(dataurl+"images/dog.jpg").smooth(5)
msh = pic.tomesh() # make a quad-mesh out of it
# build a scalar array with intensities
rgb = msh.pointdata["RGBA"]
intensity = np.sum(rgb, axis=1)
intensityz = np.zeros_lik... |
__scraping__/automationpractice.com - selenium/main.py | whitmans-max/python-examples | 140 | 12625414 | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import NoSuchElementException, TimeoutExcept... |
InnerEye-DataQuality/create_environment.py | faz1993/InnerEye-DeepLearning | 402 | 12625423 | <filename>InnerEye-DataQuality/create_environment.py<gh_stars>100-1000
# ------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.... |
scripts/change_incar_parameters.py | faradaymahe/VASPpy | 225 | 12625435 | '''
Modify recursively parameters in all INCAR file.
'''
import argparse
import commands
import logging
from vaspy import PY2
from vaspy.incar import InCar
SHELL_COMMAND = "find ./ -name 'INCAR'"
_logger = logging.getLogger("vaspy.script")
if "__main__" == __name__:
# Check command validity.
status, outp... |
cement/core/mail.py | tomekr/cement | 826 | 12625447 | """Cement core mail module."""
from abc import abstractmethod
from ..core.interface import Interface
from ..core.handler import Handler
from ..utils.misc import minimal_logger
LOG = minimal_logger(__name__)
class MailInterface(Interface):
"""
This class defines the Mail Interface. Handlers that implement ... |
romp/lib/models/resnet_50.py | iory/ROMP | 385 | 12625451 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch
import torch.nn as nn
import torchvision.models.resnet as resnet
import torchvision.transforms.functional as F
import sys, os
root_dir = os.path.join(os.path.dirname(__file__),'..')
if root_dir not ... |
synapse/logging/_terse_json.py | mlakkadshaw/synapse | 9,945 | 12625488 | <filename>synapse/logging/_terse_json.py<gh_stars>1000+
# Copyright 2019 The Matrix.org Foundation C.I.C.
#
# 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/license... |
alipay/aop/api/response/AlipayPcreditLoanBeikeaccountInterestfreeModifyResponse.py | antopen/alipay-sdk-python-all | 213 | 12625490 | <reponame>antopen/alipay-sdk-python-all
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.BeikeAccountResponse import BeikeAccountResponse
class AlipayPcreditLoanBeikeaccountInterestfreeModifyResponse(AlipayResponse)... |
websauna/tests/sitemapsamples.py | stevepiercy/websauna | 286 | 12625502 | <filename>websauna/tests/sitemapsamples.py
"""Permission test views."""
# Standard Library
import typing as t
# Pyramid
from pyramid.interfaces import ILocation
from pyramid.response import Response
from pyramid.view import view_config
from zope.interface import implementer
# Websauna
from websauna.system.core.interf... |
salt/tests/unit/formulas/fixtures/templates.py | SaintLoong/metalk8s | 255 | 12625521 | """Expose a `template_path` parameterized fixture to list all "testable" templates.
This will list all files with one of the extensions in `TEMPLATE_EXTS`, filtering out
directories listed in `EXCLUDE_DIRS`.
"""
from pathlib import Path
from typing import List, Optional
import pytest
from tests.unit.formulas import ... |
tools/gr_to_mtx_symmetric.py | jdwapman/gunrock | 790 | 12625531 | <filename>tools/gr_to_mtx_symmetric.py
#!/usr/local/bin/python
"""
Simple python script to convert .gr format graph to .mtx format
"""
import os
import sys
import string
### check command line args
if (len(sys.argv)) != 2:
print ' Usage: python gr_to_mtx_symmetric.py graph.gr'
sys.exit()
### gr graph input
... |
cli/tests/pcluster/models/test_s3_bucket.py | maclema/aws-parallelcluster | 415 | 12625537 | <filename>cli/tests/pcluster/models/test_s3_bucket.py
# Copyright 2021 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
#
# http://aws.amazon... |
horovod/common/exceptions.py | Null233/horovod | 5,089 | 12625628 | # Copyright 2019 Uber Technologies, Inc. All Rights Reserved.
# Modifications copyright Microsoft
#
# 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... |
examples/attach.py | DrKeineLust/pwntools | 8,966 | 12625699 | <filename>examples/attach.py
"""
Example showing `pwnlib.gdb.attach()`
"""
from pwn import *
bash = process('/bin/bash')
gdb.attach(bash, gdbscript = '''
p "hello from pwnlib"
c
''')
bash.interactive()
|
depthai_helpers/supervisor.py | Davidsastresas/depthai | 476 | 12625772 | <filename>depthai_helpers/supervisor.py<gh_stars>100-1000
import importlib.util
import os
import subprocess
import sys
import time
from pathlib import Path
def createNewArgs(args):
def removeArg(name, withValue=True):
if name in sys.argv:
idx = sys.argv.index(name)
if withValue:
... |
env/Lib/site-packages/OpenGL/GL/NV/conservative_raster_dilate.py | 5gconnectedbike/Navio2 | 210 | 12625785 | <reponame>5gconnectedbike/Navio2
'''OpenGL extension NV.conservative_raster_dilate
This module customises the behaviour of the
OpenGL.raw.GL.NV.conservative_raster_dilate to provide a more
Python-friendly API
Overview (from the spec)
This extension extends the conservative rasterization functionality
provided ... |
fedml_api/data_preprocessing/Landmarks/data_loader.py | xuwanwei/FedML | 1,120 | 12625798 | import os
import sys
import time
import logging
import collections
import csv
import numpy as np
import torch
import torch.utils.data as data
import torchvision.transforms as transforms
from .datasets import Landmarks
def _read_csv(path: str):
"""Reads a csv file, and returns the content inside a list of dictiona... |
flask_superadmin/tests/test_sqlamodel.py | romeojulietthotel/Flask-NotSuperAdmin | 414 | 12625801 | <filename>flask_superadmin/tests/test_sqlamodel.py
from nose.tools import eq_, ok_, raises
import wtforms
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy.exc import InvalidRequestError
from flask_superadmin import Admin
from flask_superadmin.model.backends.sqlalchemy.view import M... |
limits/storage/base.py | mymedia2/limits | 140 | 12625804 | import threading
from abc import ABCMeta, abstractmethod
import six
from limits.storage.registry import StorageRegistry
@six.add_metaclass(StorageRegistry)
@six.add_metaclass(ABCMeta)
class Storage(object):
"""
Base class to extend when implementing a storage backend.
"""
def __init__(self, uri=Non... |
src/condor_tests/test_late_materialization.py | datadvance/htcondor | 217 | 12625823 | <filename>src/condor_tests/test_late_materialization.py
#!/usr/bin/env pytest
# this test replicates the first part of job_late_materialize_py
import logging
import htcondor
from ornithology import (
config,
standup,
action,
Condor,
write_file,
parse_submit_result,
JobID,
SetAttribut... |
desktop/core/ext-py/nose-1.3.7/examples/plugin/setup.py | kokosing/hue | 5,079 | 12625839 | <reponame>kokosing/hue
"""
An example of how to create a simple nose plugin.
"""
try:
import ez_setup
ez_setup.use_setuptools()
except ImportError:
pass
from setuptools import setup
setup(
name='Example plugin',
version='0.1',
author='<NAME>',
author_email = '<EMAIL>',
description = '... |
mmtbx/command_line/nqh_minimize.py | dperl-sol/cctbx_project | 155 | 12625852 |
from __future__ import absolute_import, division, print_function
import sys
from mmtbx.validation.molprobity import nqh_minimize
if __name__ == "__main__":
nqh_minimize.run(sys.argv[1:])
|
hubspot/hubspot.py | fakepop/hubspot-api-python | 117 | 12625855 | <reponame>fakepop/hubspot-api-python<gh_stars>100-1000
from .client import Client
class HubSpot(Client):
pass
|
cuesubmit/cuesubmit/ui/Frame.py | mb0rt/OpenCue | 334 | 12625864 | <reponame>mb0rt/OpenCue
# Copyright Contributors to the OpenCue 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 requi... |
scripts/pendulum_irl.py | SaminYeasar/inverse_rl | 220 | 12625906 | import tensorflow as tf
from sandbox.rocky.tf.policies.gaussian_mlp_policy import GaussianMLPPolicy
from sandbox.rocky.tf.envs.base import TfEnv
from rllab.baselines.linear_feature_baseline import LinearFeatureBaseline
from rllab.envs.gym_env import GymEnv
from inverse_rl.algos.irl_trpo import IRLTRPO
from inverse_r... |
sdk/communication/azure-communication-identity/azure/communication/identity/_generated/models/__init__.py | vincenttran-msft/azure-sdk-for-python | 2,728 | 12625911 | # 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 ... |
sknetwork/utils/tests/test_projection_simplex.py | altana-tech/scikit-network | 457 | 12625948 | <gh_stars>100-1000
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""tests for simplex.py"""
import unittest
import numpy as np
from scipy import sparse
from sknetwork.utils.check import is_proba_array
from sknetwork.utils.simplex import projection_simplex
class TestProjSimplex(unittest.TestCase):
def test_ar... |
api/chalicelib/core/mobile.py | nogamenofun98/openreplay | 3,614 | 12625978 | <reponame>nogamenofun98/openreplay
from chalicelib.core import projects
from chalicelib.utils import s3
from chalicelib.utils.helper import environ
def sign_keys(project_id, session_id, keys):
result = []
project_key = projects.get_project_key(project_id)
for k in keys:
result.append(s3.get_presig... |
Lib/test/test_importlib/builtin/test_loader.py | deadsnakes/python3.3 | 652 | 12625983 | <reponame>deadsnakes/python3.3
import importlib
from importlib import machinery
from .. import abc
from .. import util
from . import util as builtin_util
import sys
import types
import unittest
class LoaderTests(abc.LoaderTests):
"""Test load_module() for built-in modules."""
verification = {'__name__': 'e... |
raiden/transfer/identifiers.py | tirkarthi/raiden | 2,101 | 12626008 | from dataclasses import dataclass
from raiden.constants import EMPTY_ADDRESS, UINT256_MAX
from raiden.utils.formatting import to_checksum_address
from raiden.utils.typing import (
Address,
ChainID,
ChannelID,
T_Address,
T_ChainID,
T_ChannelID,
TokenNetworkAddress,
typecheck,
)
@datacl... |
environ.py | XuhanLiu/DrugEx | 109 | 12626033 | #!/usr/bin/env python
import numpy as np
import pandas as pd
import torch
from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor
from sklearn.neighbors import KNeighborsClassifier, KNeighborsRegressor
from sklearn.preprocessing import MinMaxScaler as Scaler
from sklearn.cross_decomposition import PL... |
kolibri/core/__init__.py | MBKayro/kolibri | 545 | 12626036 | <reponame>MBKayro/kolibri
"""TODO: Write something about this module (everything in the docstring
enters the docs)
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
default_app_config = "kolibri.core.apps.KolibriCoreConfig"
|
koalixcrm/crm/factories/factory_payment_reminder.py | Cataldir/koalixcrm | 290 | 12626041 | # -*- coding: utf-8 -*-
from koalixcrm.crm.models import PaymentReminder
from koalixcrm.crm.factories.factory_sales_document import StandardSalesDocumentFactory
class StandardPaymentReminderFactory(StandardSalesDocumentFactory):
class Meta:
model = PaymentReminder
payable_until = "2018-05-20"
pa... |
src/exabgp/bgp/message/nop.py | pierky/exabgp | 1,560 | 12626047 | <gh_stars>1000+
# encoding: utf-8
"""
nop.py
Created by <NAME> on 2009-11-06.
Copyright (c) 2009-2017 Exa Networks. All rights reserved.
License: 3-clause BSD. (See the COPYRIGHT file)
"""
from exabgp.bgp.message.message import Message
# ========================================================================= NOP
#... |
pywsd/__init__.py | mihal277/pywsd | 581 | 12626061 | <reponame>mihal277/pywsd<gh_stars>100-1000
#!/usr/bin/env python -*- coding: utf-8 -*-
#
# Python Word Sense Disambiguation (pyWSD)
#
# Copyright (C) 2014-2020 alvations
# URL:
# For license information, see LICENSE.md
from __future__ import absolute_import, print_function
import sys
import time
from wn import WordN... |
fairseq/tokenizer.py | fairseq-FT/fairseq | 16,259 | 12626104 | # 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 re
SPACE_NORMALIZER = re.compile(r"\s+")
def tokenize_line(line):
line = SPACE_NORMALIZER.sub(" ", line)
line = line.strip(... |
scripts/stl/udp_inc_len_9k.py | ajitkhaparde/trex-core | 956 | 12626132 | <filename>scripts/stl/udp_inc_len_9k.py
from trex_stl_lib.api import *
import argparse
class STLS1(object):
def __init__ (self):
self.max_pkt_size_l3 =9*1024;
def create_stream (self):
# pkt
p_l2 = Ether();
p_l3 = IP(src="192.168.127.12",dst="172.16.58.3")
p_l4 =... |
tests/elf/test_equality.py | junghee/LIEF | 2,999 | 12626150 | <reponame>junghee/LIEF
#!/usr/bin/env python
import itertools
import logging
import os
import random
import stat
import subprocess
import sys
import tempfile
import unittest
from unittest import TestCase
import lief
from utils import get_sample
lief.logging.set_level(lief.logging.LOGGING_LEVEL.INFO)
class TestEquali... |
src/simian/mac/munki/handlers/pkgsinfo.py | tristansgray/simian | 326 | 12626152 | #!/usr/bin/env python
#
# Copyright 2018 Google 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 require... |
utils/swift_build_support/tests/test_xcrun.py | lwhsu/swift | 427 | 12626153 | <gh_stars>100-1000
# test_xcrun.py - Unit tests for swift_build_support.xcrun -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.... |
usaspending_api/awards/tests/unit/test_location_filter_geocode.py | g4brielvs/usaspending-api | 217 | 12626175 | <filename>usaspending_api/awards/tests/unit/test_location_filter_geocode.py<gh_stars>100-1000
import pytest
from model_mommy import mommy
from usaspending_api.search.models import ContractAwardSearchMatview
from usaspending_api.awards.v2.filters.location_filter_geocode import (
create_nested_object,
geocode_fi... |
gerapy_auto_extractor/__init__.py | zanachka/GerapyAutoExtractor | 214 | 12626181 | from gerapy_auto_extractor.settings import APP_DEBUG
from gerapy_auto_extractor.extractors import extract_detail, extract_list, extract_datetime, extract_content, \
extract_title
from gerapy_auto_extractor.classifiers.list import is_list, probability_of_list
from gerapy_auto_extractor.classifiers.detail import is_d... |
api/views.py | zhy0216/random-read | 239 | 12626215 | <reponame>zhy0216/random-read<gh_stars>100-1000
import random
from django.shortcuts import redirect
from django.http import Http404
from django.core.urlresolvers import reverse
from django.http import HttpResponse
from django.views.decorators.http import require_http_methods
from article.models import (Article, UserPo... |
dataviva/api/secex/models.py | joelvisroman/dataviva-site | 126 | 12626254 | from dataviva import db
from dataviva.api.secex.abstract_models import BaseSecex, Eci, Rca, Rca_wld, Rcd, Distance, OppGain
from dataviva.api.secex.abstract_models import BraId, WldId, HsId
from dataviva.api.secex.abstract_models import BraDiversity, HsDiversity, WldDiversity
class Ymb(BaseSecex, BraId, HsDiversity, W... |
mutant/contrib/numeric/models.py | pombredanne/django-mutant | 152 | 12626255 | <filename>mutant/contrib/numeric/models.py
from __future__ import unicode_literals
from django.db.models import fields
from django.utils.translation import ugettext_lazy as _
from ...models.field import FieldDefinition, FieldDefinitionManager
class _NumericMeta:
defined_field_category = _('Numeric')
class Sma... |
djs_playground/apps.py | akarca/django-summernote | 869 | 12626280 | from django.apps import AppConfig
class DjsConfig(AppConfig):
name = 'djs_playground'
|
ML/gan/discriminator_module.py | saneravi/ML_Stuff | 209 | 12626281 | <reponame>saneravi/ML_Stuff
#!/usr/bin/env python
from keras.layers import Input
from keras.layers.advanced_activations import LeakyReLU
from keras.layers.convolutional import Convolution2D
from keras.layers.core import Dense, Dropout, Flatten
from keras.models import Model
def create_model(shp=(28, 28, 1), dropout_... |
qmsolve/time_dependent_solver/split_step.py | quantum-visualizations/qmsolve | 356 | 12626296 | <filename>qmsolve/time_dependent_solver/split_step.py
import numpy as np
from .method import Method
import time
from ..util.constants import hbar, Å, femtoseconds
from ..particle_system import SingleParticle, TwoParticles
import progressbar
"""
Split-operator method for the Schrödinger equation.
Prototype and origina... |
tests/test_pyquery.py | roehling/jello | 265 | 12626325 | <reponame>roehling/jello
#!/usr/bin/env python3
import unittest
import jello.cli
from jello.cli import opts
class MyTests(unittest.TestCase):
def setUp(self):
# initialize options
opts.initialize = None
opts.version_info = None
opts.helpme = None
opts.compact = None
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.