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 |
|---|---|---|---|---|
lte/gateway/python/magma/pipelined/tests/test_internal_pkt_ipfix_export.py | Aitend/magma | 849 | 12740212 | <reponame>Aitend/magma<gh_stars>100-1000
"""
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed ... |
tests/pipeline/test_adjusted_array.py | leonarduschen/zipline | 14,525 | 12740219 | <gh_stars>1000+
"""
Tests for chunked adjustments.
"""
from collections import namedtuple
from itertools import chain, product
from string import ascii_lowercase, ascii_uppercase
from textwrap import dedent
from unittest import TestCase
from nose_parameterized import parameterized
from numpy import (
arange,
a... |
Programming Languages/Python/Theory/100_Python_Challenges/Section_7_Datetime_Module/85. number of days between two given dates.py | jaswinder9051998/Resources | 101 | 12740223 | <reponame>jaswinder9051998/Resources<gh_stars>100-1000
"""
Write a function that calculates the number of days between two given dates.
Input Data:
Date1 = 2011-1-1
Date2 = 2021-1-1'
"""
import datetime
def date_diff(Date1, Date2):
delta = Date2 - Date1
return (delta) |
Utilities/ReferenceImplementations/gru.py | vguerra/swift-apis | 848 | 12740226 | # Computes expected results for `testGRU()` in `Tests/TensorFlowTests/LayerTests.swift`.
# Requires 'tensorflow>=2.0.0a0' (e.g. "pip install tensorflow==2.2.0").
import sys
import numpy
import tensorflow as tf
# Set random seed for repetable results
tf.random.set_seed(0)
def indented(s):
return '\n'.join([' '... |
alf/examples/misc_playground_empowerment.py | www2171668/alf | 175 | 12740229 | <filename>alf/examples/misc_playground_empowerment.py<gh_stars>100-1000
# Copyright (c) 2019 Horizon Robotics. 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
#
# ht... |
library/oci_data_guard_association_facts.py | slmjy/oci-ansible-modules | 106 | 12740245 | <reponame>slmjy/oci-ansible-modules<gh_stars>100-1000
#!/usr/bin/python
# Copyright (c) 2018, Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.t... |
lib/python2.7/site-packages/sklearn/utils/random.py | wfehrnstrom/harmonize | 6,989 | 12740254 | <reponame>wfehrnstrom/harmonize
# Author: <NAME> <<EMAIL>>
#
# License: BSD 3 clause
from __future__ import division
import numpy as np
import scipy.sparse as sp
import operator
import array
from sklearn.utils import check_random_state
from sklearn.utils.fixes import astype
from ._random import sample_without_replacem... |
scripts/model_conversion/convert_stylegan.py | Gptao/BasicSR | 1,421 | 12740268 | <reponame>Gptao/BasicSR<filename>scripts/model_conversion/convert_stylegan.py
import torch
from basicsr.models.archs.stylegan2_arch import (StyleGAN2Discriminator,
StyleGAN2Generator)
def convert_net_g(ori_net, crt_net):
"""Convert network generator."""
for c... |
modelling/src/neuraldb/final_scoring_with_dbsize_sweep.py | j6mes/NeuralDB | 213 | 12740290 | <reponame>j6mes/NeuralDB
#
# Copyright (c) 2021 Facebook, Inc. and its affiliates.
#
# This file is part of NeuralDB.
# See https://github.com/facebookresearch/NeuralDB for further info.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License... |
CondFormats/PCLConfig/test/AlignPCLThresholdsWriter_cfg.py | ckamtsikis/cmssw | 852 | 12740300 | import FWCore.ParameterSet.Config as cms
import copy
process = cms.Process("ProcessOne")
##
## MessageLogger
##
process.load('FWCore.MessageService.MessageLogger_cfi')
process.MessageLogger.cerr.enable = False
process.MessageLogger.AlignPCLThresholdsWriter=dict()
process.MessageLogger.AlignPCLThresholds=dict() ... |
pycwr/GraphicalInterface/RadarInterface.py | 1271756664/study | 144 | 12740325 | # -*- coding: utf-8 -*-
"""
Module implementing MainWindow.
"""
import os
from .RadarUI import Ui_MainWindow
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5 import QtWidgets
from PyQt5.QtCore import pyqtSlot
from PyQt5.QtWidgets import QMainWindow
from ..io import read_auto
from ..io.util import ra... |
lixian_plugins/commands/get_torrent.py | deadblue/xunlei-lixian | 722 | 12740347 | <gh_stars>100-1000
from lixian_plugins.api import command
from lixian_cli_parser import command_line_parser, command_line_option
from lixian_cli_parser import with_parser
from lixian_cli import parse_login
from lixian_commands.util import create_client
@command(name='get-torrent', usage='get .torrent by task id or i... |
gdal/examples/pydrivers/ogr_DUMMY.py | jpapadakis/gdal | 3,100 | 12740379 | <reponame>jpapadakis/gdal
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This code is in the public domain, so as to serve as a template for
# real-world plugins.
# or, at the choice of the licensee,
# Copyright 2019 <NAME>
# SPDX-License-Identifier: MIT
# Metadata parsed by GDAL C++ code at driver pre-loading, start... |
modules/post-exploitation/empire.py | decidedlygray/ptf | 4,391 | 12740383 | #!/usr/bin/env python
#####################################
# Installation module for empire
#####################################
# AUTHOR OF MODULE NAME
AUTHOR="<NAME>"
# DESCRIPTION OF THE MODULE
DESCRIPTION="This module will install/update Empire - post exploitation python/powershell for windows and nix/osx"
... |
solution/graph_traversal/7569/main.py | jungyoonoh/baekjoon-1 | 2,236 | 12740406 | # Authored by : gusdn3477
# Co-authored by : tony9402
# Link : http://boj.kr/8a53cdacfc6340c894fb47257232f244
import sys
from collections import deque
def input():
return sys.stdin.readline().rstrip()
def checkMap():
for z in range(H):
for i in range(N):
for j in range(M):
... |
typed_python/compiler/type_wrappers/hash_wrapper.py | APrioriInvestments/typed_python | 105 | 12740419 | # Copyright 2017-2019 typed_python Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
tests/test_phoneme_conversion.py | jayten42/pororo | 1,137 | 12740426 | <gh_stars>1000+
"""Test Grapheme to Phoneme module"""
import unittest
from pororo import Pororo
class PororoPhonemeConversionTester(unittest.TestCase):
def test_modules(self):
g2pk = Pororo(task="g2p", lang="ko")
g2pk_res = g2pk("์ด์ ๋ ๋ ์จ๊ฐ ๋ง์๋๋ฐ, ์ค๋์ ํ๋ฆฌ๋ค.")
self.assertIsInstance(g2pk_res, ... |
guacozy_server/backend/models/guacdserver.py | yinm8315/guacozy-django-react | 121 | 12740429 | from django.db import models
from django.core.validators import MinValueValidator, MaxValueValidator
class GuacdServer(models.Model):
class Meta:
verbose_name = "Guacd Server"
verbose_name_plural = "Guacd Servers"
name = models.CharField(max_length=64, blank=False, unique=True,
... |
python/tvm/autotvm/graph_tuner/utils/traverse_graph.py | XiaoSong9905/tvm | 4,640 | 12740468 | # 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
# "License"); you may not u... |
plugins/webosint/who/whoami.py | Appnet1337/OSINT-SAN | 313 | 12740491 | <filename>plugins/webosint/who/whoami.py
import whois
from pythonping import ping
import re
def whoami(target,post):
#target=input("Enter the IP Address/Domain:")
getweb=str(ping(target))
ip = re.compile('(([2][5][0-5]\.)|([2][0-4][0-9]\.)|([0-1]?[0-9]?[0-9]\.)){3}'
+'(([2][5][0-5])|([2][0-4][0-9])|... |
assignment1/tests/test_sigmoid_to_solutions.py | gyubokLee/CS224 | 125 | 12740493 | '''
HOW TO RUN THIS CODE (if tests are within the assignment 1 root):
python -m py.test tests/test_sigmoid_to_solutions.py -vv -s -q
python -m py.test tests/test_sigmoid_to_solutions.py -vv -s -q --cov
py.test.exe --cov=cs224d/ tests/test_sigmoid_to_solutions.py --cov-report html
(if the tests are within the subfolde... |
coremltools/test/neural_network/test_keras2_numeric.py | tonybove-apple/coremltools | 2,740 | 12740496 | import itertools
import os
import shutil
import tempfile
import unittest
import numpy as np
import pytest
from coremltools._deps import _HAS_KERAS2_TF
from coremltools.models import _MLMODEL_FULL_PRECISION, _MLMODEL_HALF_PRECISION
from coremltools.models.utils import _macos_version, _is_macos
if _HAS_KERAS2_TF:
... |
tests/services/model_tester.py | aarontp/forseti-security | 921 | 12740501 | <filename>tests/services/model_tester.py<gh_stars>100-1000
# Copyright 2017 The Forseti Security 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://ww... |
utils/model.py | thatrobotdev/Image-Caption-Generator | 187 | 12740558 | <gh_stars>100-1000
import numpy as np
# Keras
from keras.applications.inception_v3 import InceptionV3
from keras.applications.vgg16 import VGG16
from keras.models import Model
from keras.layers import Input, Dense, Dropout, LSTM, Embedding, concatenate, RepeatVector, TimeDistributed, Bidirectional
from keras.preprocess... |
libnum/ecc.py | hellman/libnum | 222 | 12740562 | <filename>libnum/ecc.py
import random
from .sqrtmod import sqrtmod_prime_power, has_sqrtmod_prime_power
from .modular import invmod
__all__ = ('NULL_POINT', 'Curve')
NULL_POINT = (None, None)
class Curve:
def __init__(self, a, b, p, g=None,
order=None,
cofactor=None,
... |
experiments/lut_init/fuzz_lut_init.py | Keno/prjtrellis | 256 | 12740573 | <reponame>Keno/prjtrellis<gh_stars>100-1000
#!/usr/bin/env python3
import os
from os import path
import shutil
import diamond
from string import Template
import pytrellis
device = "LFE5U-25F"
lut_inputs = ("A", "B", "C", "D")
def run_get_bits(init_bits):
sop_terms = []
for i in range(16):
if init_b... |
salt/utils/stringutils.py | markgras/salt | 9,425 | 12740574 | """
Functions for manipulating or otherwise processing strings
"""
import base64
import difflib
import errno
import fnmatch
import logging
import os
import re
import shlex
import time
import unicodedata
from salt.utils.decorators.jinja import jinja_filter
log = logging.getLogger(__name__)
@jinja_filter("to_bytes"... |
Bot/Trade.py | mtranhoangson/bot | 199 | 12740575 | <filename>Bot/Trade.py
from collections import OrderedDict
import uuid
from typing import List
from Bot.EntryExitSettings import EntryExitSettings
from Bot.TradeEnums import Side
from Bot.StopLossSettings import StopLossSettings
from Bot.Target import *
class Trade(CustomSerializable):
# def __init__(self, symbol... |
tacker/vnfm/infra_drivers/openstack/update_template.py | h1r0mu/tacker | 116 | 12740577 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... |
src/skmultiflow/meta/adaptive_random_forests.py | denisesato/scikit-multiflow | 663 | 12740583 | <gh_stars>100-1000
from copy import deepcopy
import math
import itertools
import numpy as np
from skmultiflow.core import BaseSKMObject, ClassifierMixin, MetaEstimatorMixin
from skmultiflow.drift_detection.base_drift_detector import BaseDriftDetector
from skmultiflow.drift_detection import ADWIN
from skmultiflow.tree... |
ytdl.py | KenT2/tboplayer | 164 | 12740613 | import json
import pexpect
import re
import string
import sys
import requests
import os
from hashlib import sha256
from threading import Thread
from time import sleep
from vtt_to_srt import vtts_to_srt
# ***************************************
# YTDL CLASS
# ***************************************
class Ytdl:
... |
applications/ConvectionDiffusionApplication/test_examples/square_edgebased.gid/test_pureconvectionsolver_build_reference.py | lkusch/Kratos | 778 | 12740614 | <gh_stars>100-1000
from __future__ import print_function, absolute_import, division #makes KratosMultiphysics backward compatible with python 2.6 and 2.7
import sys
kratos_benchmarking_path = '../../../../benchmarking'
sys.path.append(kratos_benchmarking_path)
import benchmarking
print("Building reference data for edg... |
DPGAnalysis/Skims/python/MultiMuon_cfg.py | ckamtsikis/cmssw | 852 | 12740643 | <gh_stars>100-1000
import FWCore.ParameterSet.Config as cms
process = cms.Process("SKIM")
process.source = cms.Source("PoolSource",
fileNames = cms.untracked.vstring(
'/store/data/Commissioning09/Cosmics/RECO/v5/000/105/755/D266D139-D871-DE11-A709-001D09F28F0C.root',
'/store/data/Commissio... |
zip_file_example/extract_file_in_memory/main.py | DazEB2/SimplePyScripts | 117 | 12740655 | <gh_stars>100-1000
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
import zipfile
import sys
from pathlib import Path
sys.path.append(str(Path(__file__).resolve().parent.parent.parent))
from human_byte_size import sizeof_fmt
FILE_NAME = Path('Doc_df7c89c378c04e8daf69257ea95d9a2e.zip')
pri... |
qcfractal/alembic/versions/469ece903d76_migrate_provenance_to_not_null.py | MolSSI/dqm_server | 113 | 12740685 | <filename>qcfractal/alembic/versions/469ece903d76_migrate_provenance_to_not_null.py
"""migrate provenance to not null
Revision ID: 469ece903d76
Revises: <PASSWORD>
Create Date: 2021-05-02 09:48:57.061825
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.orm.session import Session
# revision identif... |
pyhealth/test/test_model_sequence.py | rkalahasty/PyHealth | 485 | 12740709 | <gh_stars>100-1000
import unittest
import numpy as np
import torch
import os
import shutil
from pyhealth.models.sequence.dipole import Dipole
from pyhealth.models.sequence.lstm import LSTM
from pyhealth.models.sequence.gru import GRU
from pyhealth.models.sequence.embedgru import EmbedGRU
from pyhealth.models.sequence... |
Printing all instances of a class/use__mixin_and_weakrefs.py | DazEB2/SimplePyScripts | 117 | 12740729 | <gh_stars>100-1000
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
# SOURCE: https://stackoverflow.com/a/328882/5909792
from collections import defaultdict
import weakref
class KeepRefs:
__refs__ = defaultdict(list)
def __init__(self):
self.__refs__[self.__class__].append(... |
src/systemtest/op-monitoring/integration/testcases/test_attachments.py | yannzido/new | 188 | 12740741 | #!/usr/bin/env python3
# The MIT License
# Copyright (c) 2016 Estonian Information System Authority (RIA), Population Register Centre (VRK)
#
# 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 ... |
recipes/Python/577654_DDE_Client/recipe-577654.py | tdiprima/code | 2,023 | 12740744 | #!/usr/bin/env python
# Send DDE Execute command to running program
from ctypes import POINTER, WINFUNCTYPE, c_char_p, c_void_p, c_int, c_ulong, c_char_p
from ctypes.wintypes import BOOL, DWORD, BYTE, INT, LPCWSTR, UINT, ULONG
# DECLARE_HANDLE(name) typedef void *name;
HCONV = c_void_p # = DECLARE_HANDLE(HCONV)
... |
EISeg/eiseg/widget/scene.py | JamesLim-sy/PaddleSeg | 4,708 | 12740746 | from qtpy import QtWidgets, QtCore
from qtpy.QtCore import Qt
class AnnotationScene(QtWidgets.QGraphicsScene):
clickRequest = QtCore.Signal(int, int, bool)
def __init__(self, parent=None):
super(AnnotationScene, self).__init__(parent)
self.creating = False
self.polygon_items = []
... |
gluon/packages/dal/pydal/dialects/couchdb.py | GeorgesBrantley/ResistanceGame | 408 | 12740747 | <filename>gluon/packages/dal/pydal/dialects/couchdb.py
from ..adapters.couchdb import CouchDB
from .base import NoSQLDialect
from . import dialects
@dialects.register_for(CouchDB)
class CouchDBDialect(NoSQLDialect):
def _and(self, first, second, query_env={}):
return "(%s && %s)" % (
self.expa... |
dash_docs/chapters/dash_core_components/Markdown/index.py | joelostblom/dash-docs | 379 | 12740759 | <reponame>joelostblom/dash-docs
# -*- coding: utf-8 -*-
import dash_core_components as dcc
import dash_html_components as html
from dash_docs import styles
from dash_docs import tools
from dash_docs import reusable_components as rc
examples = tools.load_examples(__file__)
layout = html.Div(children=[
html.H1("M... |
CalibTracker/SiStripDCS/python/popcon_last_value_cfg.py | ckamtsikis/cmssw | 852 | 12740760 | # Import configurations
import FWCore.ParameterSet.Config as cms
process = cms.Process("test")
process.load("CalibTracker.SiStripDCS.MessLogger_cfi")
process.SiStripConfigDb = cms.Service("SiStripConfigDb",
ConfDb = cms.untracked.string('username/password@cms_omds_nolb'),
TNS_ADMIN = cms.untracked.string('.'... |
pandas/tests/tseries/offsets/test_business_day.py | RakhithJK/pandas | 28,899 | 12740773 | <reponame>RakhithJK/pandas<gh_stars>1000+
"""
Tests for offsets.BDay
"""
from datetime import (
date,
datetime,
timedelta,
)
import pytest
from pandas._libs.tslibs.offsets import (
ApplyTypeError,
BDay,
BMonthEnd,
)
from pandas import (
DatetimeIndex,
_testing as tm,
)
from pandas.tes... |
analysis/tradeoff.py | harvardnlp/cascaded-generation | 122 | 12740778 | <reponame>harvardnlp/cascaded-generation
import sys, os
import re, subprocess
dataset = 0
if __name__ == '__main__':
if len(sys.argv) != 3:
print ('Usage: python %s <input> <output>'%sys.argv[0])
sys.exit(1)
with open(sys.argv[1]) as fin:
with open(sys.argv[2], 'w') as fout:
for line... |
data/morphology/grab_unimorph_data.py | wannaphong/wikipron | 111 | 12740780 | <reponame>wannaphong/wikipron
#!/usr/bin/env python
"""Downloads UniMorph morphological paradigms data."""
import json
import logging
import os
import time
from typing import Dict, List
import requests
UNIMORPH_DICT_PATH = "unimorph_languages.json"
def download(data_to_grab: Dict[str, List[str]]) -> Dict[str, Li... |
tests/backends/aiida_sqlalchemy/test_schema.py | azadoks/aiida-core | 180 | 12740809 | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
locations/spiders/bunnings.py | nbeecher/alltheplaces | 297 | 12740816 | # -*- coding: utf-8 -*-
import re
import json
import scrapy
from locations.items import GeojsonPointItem
class BunningsSpider(scrapy.Spider):
name = "bunnings"
allowed_domains = ["bunnings.com.au"]
start_urls = (
'https://www.bunnings.com.au/stores/',
)
def parse(self, response):
r... |
meteostat/interface/monthly.py | meteoDaniel/meteostat-python | 133 | 12740820 | """
Monthly Class
Meteorological data provided by Meteostat (https://dev.meteostat.net)
under the terms of the Creative Commons Attribution-NonCommercial
4.0 International Public License.
The code is licensed under the MIT license.
"""
from datetime import datetime
from typing import Union
import numpy as np
import ... |
tests/Unit/Visualization/Python/Test_Render1D.py | nilsvu/spectre | 117 | 12740826 | #!/usr/bin/env python
# Distributed under the MIT License.
# See LICENSE.txt for details.
from spectre.Visualization.Render1D import (find_extrema_over_data_set,
render_single_time)
import unittest
import os
import numpy as np
import matplotlib as mpl
mpl.use('agg')
clas... |
setup.py | XFFXFF/ElegantRL | 129 | 12740827 | from setuptools import setup, find_packages
setup(
name="elegantrl",
version="0.3.3",
author="<NAME>, <NAME>, <NAME>, <NAME>",
author_email="<EMAIL>",
url="https://github.com/AI4Finance-LLC/ElegantRL",
license="Apache 2.0",
packages=find_packages(),
install_requires=[
"gym",
... |
sample.py | jeammimi/chem2 | 537 | 12740836 | from __future__ import print_function
import argparse
import os
import h5py
import numpy as np
import sys
from molecules.model import MoleculeVAE
from molecules.utils import one_hot_array, one_hot_index, from_one_hot_array, \
decode_smiles_from_indexes, load_dataset
from pylab import figure, axes, scatter, title... |
codigo/Live112/locust_demo/demo_server/flask-server.py | cassiasamp/live-de-python | 572 | 12740838 | from random import randint
from flask import Flask, request, jsonify, redirect, make_response
app = Flask(__name__)
auth = randint(100, 50000)
@app.route('/get-auth', methods=['POST'])
def get_auth_cookie():
req = request.get_json()
if req['pass'] == '<PASSWORD>':
res = make_response(jsonify({'auth... |
widgets/toolbar/lisp_codegen.py | ardovm/wxGlade | 225 | 12740850 | <gh_stars>100-1000
"""\
Lisp generator functions for wxToolBar objects
@copyright: 2002-2004 <NAME>. aka crazyinsomniac on sourceforge
@copyright: 2014-2016 <NAME>
@license: MIT (see LICENSE.txt) - THIS PROGRAM COMES WITH NO WARRANTY
"""
import common
import wcodegen
from .tool import *
#from .codegen import ToolsH... |
tests/test_speed.py | dcslagel/lasio | 285 | 12740879 | import os, sys
sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
import glob
import fnmatch
import traceback
import logging
import numpy
import pytest
import lasio
test_dir = os.path.dirname(__file__)
egfn = lambda fn: os.path.join(os.path.dirname(__file__), "examples", fn)
stegfn = lambda vers, fn: o... |
modules/nltk_contrib/toolbox/errors.py | h4ck3rm1k3/NLP-project | 123 | 12740897 | <filename>modules/nltk_contrib/toolbox/errors.py
# Natural Language Toolkit: Shoebox Errors
#
# Copyright (C) 2001-2006 NLTK Project
# Author: <NAME> <<EMAIL>>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
"""
This module provides Shoebox exceptions.
"""
# ----------------------------------... |
dev/Gems/CloudGemComputeFarm/v1/Harness/main.py | BadDevCode/lumberyard | 1,738 | 12740900 | import argparse
import boto3
import json
import os
import sys
from six.moves import urllib
import uuid
import traceback
from botocore.exceptions import ClientError
from dictionary_sorter import divide
from dictionary_sorter import merge
from dictionary_sorter import build
from harness import config
from harness impor... |
test/integration/component/test_add_remove_network.py | ycyun/ablestack-cloud | 1,131 | 12740903 | # 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
# "License"); you may not u... |
Solutions/Module11WriteFileGuestListChallenge.py | amihaita/GeekTraine | 957 | 12740908 |
#Declare variables to hold the file name and access mode
fileName = "GuestList.txt"
accessMode = "w"
#Open the file for writing
myFile = open(fileName, accessMode)
#Write the guest names and ages to the file
#I can write an entire record in one write statement
myFile.write("<NAME>,27\n")
myFile.write("<NAME>,25\n")... |
seahub/organizations/api/admin/user_repos.py | samuelduann/seahub | 420 | 12740922 | <filename>seahub/organizations/api/admin/user_repos.py
# Copyright (c) 2012-2019 Seafile Ltd.
import logging
from rest_framework import status
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.authentication import SessionAuthentication
from django.utils.translat... |
pecan/log.py | antlarr/pecan | 114 | 12740928 | <filename>pecan/log.py
import logging
from logutils.colorize import ColorizingStreamHandler
class DefaultColorizer(ColorizingStreamHandler):
level_map = {
logging.DEBUG: (None, 'blue', True),
logging.INFO: (None, None, True),
logging.WARNING: (None, 'yellow', True),
logging.ERROR... |
vendor/python/asttokens/mark_tokens.py | hixio-mh/plugin-python | 362 | 12740963 | # Copyright 2016 <NAME>, 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/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
scripts/top_down_stress_tester.py | Unknoob/buck | 8,027 | 12740964 | # 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 ... |
codes/models/__init__.py | DanKDorda/BasicSR | 106 | 12741013 | import logging
logger = logging.getLogger('base')
def create_model(opt):
model = opt['model']
if model == 'sr':
from .SR_model import SRModel as M
elif model == 'srgan':
from .SRGAN_model import SRGANModel as M
elif model == 'srragan':
from .SRRaGAN_model import SRRaGANModel a... |
libsaas/services/pipedrive/files.py | MidtownFellowship/libsaas | 155 | 12741015 | from libsaas import http, parsers
from libsaas.services import base
class FilesResource(base.RESTResource):
path = 'files'
def create(self, *args, **kwargs):
raise base.MethodNotSupported()
class Files(FilesResource):
@base.apimethod
def get(self, start=None, limit=None):
"""
... |
ss_baselines/savi/models/visual_cnn.py | tynguyen/sound-spaces | 171 | 12741029 | <gh_stars>100-1000
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
import torch
import torch.nn as nn
from ss_baselines.common.u... |
tests/transforms/test_tape_expand.py | therooler/pennylane | 539 | 12741046 | <gh_stars>100-1000
# Copyright 2018-2021 Xanadu Quantum Technologies 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/licenses/LICENSE-2.0
# Unless required b... |
tests/test_functionhandler.py | NAnnamalai/gramex | 130 | 12741048 | import json
import gramex.cache
import pandas as pd
from . import TestGramex
from gramex.http import FOUND
from pandas.util.testing import assert_frame_equal as afe
class TestFunctionHandler(TestGramex):
def test_args(self):
etag = {'headers': {'Etag': True}}
text = '{"args": [0, 1], "kwargs": {"a... |
pixel_cnn_pp/nn.py | eyalbetzalel/pixelsnail-public | 133 | 12741068 | """
Various tensorflow utilities
"""
import numpy as np
import tensorflow as tf
from tensorflow.contrib.framework.python.ops import add_arg_scope
from tensorflow.python.ops import variables
import functools
def passthrough(obj, value): return value
try:
variables.Variable._build_initializer_expr=passt... |
tests/unit/server/bundle_manager/schedule_run_bundles_test.py | kl-chou/codalab-worksheets | 236 | 12741075 | <filename>tests/unit/server/bundle_manager/schedule_run_bundles_test.py
from codalab.worker.bundle_state import State
from freezegun import freeze_time
from tests.unit.server.bundle_manager import BaseBundleManagerTest
class BundleManagerScheduleRunBundlesTest(BaseBundleManagerTest):
def test_no_bundles(self):
... |
colour/colorimetry/datasets/lefs.py | rift-labs-developer/colour | 1,380 | 12741085 | # -*- coding: utf-8 -*-
"""
Spectral Distributions of the Luminous Efficiency Functions
===========================================================
Defines the spectral distributions of the luminous efficiency functions.
The luminous efficiency data is in the form of a *dict* of
:class:`colour.SpectralDistribution` c... |
site/tests/unittests/test/test_shelve.py | martinphellwig/brython_wf | 652 | 12741102 | <filename>site/tests/unittests/test/test_shelve.py
import unittest
import shelve
import glob
from test import support
from collections.abc import MutableMapping
from test.test_dbm import dbm_iterator
def L1(s):
return s.decode("latin-1")
class byteskeydict(MutableMapping):
"Mapping that supports bytes keys"
... |
pyflux/ssm/dar.py | ThomasHoppe/pyflux | 2,091 | 12741120 | import copy
import sys
if sys.version_info < (3,):
range = xrange
import numpy as np
import pandas as pd
import scipy.stats as ss
from patsy import dmatrices, dmatrix, demo_data
from .. import families as fam
from .. import tsm as tsm
from .. import data_check as dc
from .kalman import *
class DAR(tsm.TSM):
... |
atm/database.py | HDI-Project/ATM | 554 | 12741129 | <gh_stars>100-1000
from __future__ import absolute_import, unicode_literals
import hashlib
import json
import os
import pickle
from builtins import object
from datetime import datetime
from io import BytesIO
from operator import attrgetter
import boto3
import numpy as np
import pandas as pd
import pymysql
from sklear... |
wechat_django/tests/test_utils_decorator.py | UltraVacuum/wechat-django | 166 | 12741137 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.http import response
from django.urls import reverse
from django.urls.resolvers import get_ns_resolver
from .base import WeChatTestCase
class UtilDecoratorTestCase(WeChatTestCase):
pass
|
sdk/python/pulumi_aws/codecommit/_inputs.py | alexbowers/pulumi-aws | 260 | 12741140 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... |
DQM/BeamMonitor/test/beamspotdip_dqm_sourceclient-file_cfg.py | malbouis/cmssw | 852 | 12741148 | from __future__ import print_function
import FWCore.ParameterSet.Config as cms
#
process = cms.Process("BeamSpotDipServer")
process.load("DQMServices.Core.DQM_cfg")
# message logger
process.load("FWCore.MessageLogger.MessageLogger_cfi")
process.MessageLogger.cerr = cms.untracked.PSet(
threshold = cms.untracked.st... |
create_pretraining_data.py | alexa/bort | 469 | 12741149 | <reponame>alexa/bort
# Copyright 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.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# ... |
velocyto/commands/_run.py | subercui/velocyto.py | 119 | 12741169 | <gh_stars>100-1000
import sys
import os
import glob
import re
import gzip
import array
import loompy
import numpy as np
import random
import string
import subprocess
import multiprocessing
import csv
import itertools
from collections import defaultdict
import logging
import h5py
from typing import *
import velocyto as ... |
alipay/aop/api/response/AlipayOpenAppYufanlingsanyaowuYufalingsanyaowuQueryResponse.py | snowxmas/alipay-sdk-python-all | 213 | 12741203 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayOpenAppYufanlingsanyaowuYufalingsanyaowuQueryResponse(AlipayResponse):
def __init__(self):
super(AlipayOpenAppYufanlingsanyaowuYufalingsanyaowuQueryResponse, self).__in... |
features/steps/test_starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/pipelines/data_science/nodes.py | daniel-falk/kedro | 2,047 | 12741210 | """Example code for the nodes in the example pipeline. This code is meant
just for illustrating basic Kedro features.
Delete this when you start working on your own Kedro project.
"""
# pylint: disable=invalid-name
import logging
from typing import Any, Dict
import numpy as np
import pandas as pd
def train_model(
... |
source/OneNote.popclipext/auth.py | cnstntn-kndrtv/PopClip-Extensions | 1,262 | 12741214 | <reponame>cnstntn-kndrtv/PopClip-Extensions
from __future__ import print_function
import constants, rauth, subprocess, os, json, base64, urlparse
"""
Auth module for OneNote.
Our strategy is to store only the refresh token and use it every time to get a new access token.
"""
def get_oauth_service():
client_id, c... |
ch16-deployment/pages/tests.py | balazskiss1985/djangoforbeginners | 781 | 12741272 | from django.contrib.auth import get_user_model
from django.test import SimpleTestCase, TestCase
from django.urls import reverse
class HomePageTests(SimpleTestCase):
def test_home_page_status_code(self):
response = self.client.get('/')
self.assertEqual(response.status_code, 200)
def test_view... |
tools/misc/merge_imgs_flowmaps.py | ArlenCHEN/mmflow | 481 | 12741336 | # Copyright (c) OpenMMLab. All rights reserved.
import argparse
import os.path as osp
import cv2
import mmcv
import numpy as np
try:
import imageio
except ImportError:
imageio = None
def parse_args():
parser = argparse.ArgumentParser(
description='Merge images and visualized flow')
parser.ad... |
flexget/tests/test_npo_watchlist.py | Jeremiad/Flexget | 1,322 | 12741344 | # -*- coding: utf-8 -*-
import pytest
@pytest.mark.online
class TestNpoWatchlistInfo:
config = """
tasks:
test:
npo_watchlist:
email: '<EMAIL>'
password: '<PASSWORD>!'
"""
def test_npowatchlist_lookup(self, execute_task):
"""npo_watchlist:... |
tests/common/gcp_type/test_data/fake_groups.py | aarontp/forseti-security | 921 | 12741368 | # Copyright 2017 The Forseti Security 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 ap... |
docs/_downloads/df7502a0f8c6d7dcbf3e27a329b05d03/deep_learning_tutorial.py | woojinsong/PyTorch-tutorials-kr | 221 | 12741370 | <reponame>woojinsong/PyTorch-tutorials-kr<gh_stars>100-1000
# -*- coding: utf-8 -*-
r"""
PyTorch๋ฅผ ์ด์ฉํ ๋ฅ๋ฌ๋
**************************
**๋ฒ์ญ**: `ํฉ์ฑ์ <https://github.com/adonisues>`_
๋ฅ๋ฌ๋ ๋ธ๋ก ๊ตฌ์ถ : ์ํ ๋งต(affine maps), ๋น์ ํ์ฑ, ๊ฐ์ฒด
==========================================================================
๋ฅ๋ฌ๋์ ์๋ฆฌํ ๋ฐฉ๋ฒ์ผ๋ก ๋น์ ํ์ฑ์ ๊ฐ์ง ์ ... |
pose_estimation/datasets.py | arturohernandez10/pose-interpreter-networks | 110 | 12741381 | <filename>pose_estimation/datasets.py
import os
import numpy as np
import torch
import torch.utils.data
from skimage.draw import circle
from skimage.measure import find_contours
from PIL import Image
class RenderedPoseDataset(torch.utils.data.Dataset):
def __init__(self, data_root, objects, subset_num, transform... |
magnum/tests/unit/db/sqlalchemy/test_types.py | ajmadsen/magnum | 319 | 12741395 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... |
mmfashion/models/losses/cosine_embed_loss.py | RyanJiang0416/mmfashion | 952 | 12741400 | <gh_stars>100-1000
import torch.nn as nn
import torch.nn.functional as F
from ..registry import LOSSES
@LOSSES.register_module
class CosineEmbeddingLoss(nn.Module):
def __init__(self,
margin=0.,
size_average=None,
reduce=None,
reduction='mean')... |
cli/sawtooth_cli/keygen.py | EddyKIL/sawtooth-core | 1,530 | 12741452 | # Copyright 2016 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
scripts/lib-python/files/create_operator_scorecard_bundle.py | juljog/community-operators | 449 | 12741469 | #!/usr/bin/python3
import sys
import getopt
import yaml
import os
import random
import string
def randomString(stringLength=10):
"""Generate a random string of fixed length """
letters = string.ascii_lowercase
return ''.join(random.choice(letters) for i in range(stringLength))
def main(argv):
"""Creat... |
packages/Python/lldbsuite/test/lang/swift/objc_runtime_ivars/TestObjCIvarDiscovery.py | xiaobai/swift-lldb | 765 | 12741480 | <reponame>xiaobai/swift-lldb<filename>packages/Python/lldbsuite/test/lang/swift/objc_runtime_ivars/TestObjCIvarDiscovery.py
# TestObjCIvarDiscovery.py
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License ... |
azure_provisioning_e2e/iothubservice20180630/models/job_request.py | olivakar/azure-iot-sdk-python | 366 | 12741481 | <filename>azure_provisioning_e2e/iothubservice20180630/models/job_request.py
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# ----... |
demo/webcam_demo.py | Brym-Gyimah/mmdetection | 20,190 | 12741494 | <reponame>Brym-Gyimah/mmdetection
# Copyright (c) OpenMMLab. All rights reserved.
import argparse
import cv2
import torch
from mmdet.apis import inference_detector, init_detector
def parse_args():
parser = argparse.ArgumentParser(description='MMDetection webcam demo')
parser.add_argument('config', help='tes... |
algorithms/strings/reverse_vowel.py | zhengli0817/algorithms | 22,426 | 12741511 |
def reverse_vowel(s):
vowels = "AEIOUaeiou"
i, j = 0, len(s)-1
s = list(s)
while i < j:
while i < j and s[i] not in vowels:
i += 1
while i < j and s[j] not in vowels:
j -= 1
s[i], s[j] = s[j], s[i]
i, j = i + 1, j - 1
return "".join(s)
|
DataUtils/handle_wordEmbedding2File.py | bamtercelboo/cnn-lstm-bilstm-deepcnn-cnnlstm | 935 | 12741515 | <gh_stars>100-1000
# coding=utf-8
# @Author : bamtercelboo
# @Datetime : 2018/07/19 22:35
# @File : handle_wordEmbedding2File.py
# @Last Modify Time : 2018/07/19 22:35
# @Contact : <EMAIL>, 163.com}
"""
handle external word embedding to file
"""
import os
import tqdm
class WordEmbedding2File:
def __init__(se... |
megaman/setup.py | ffancheng/megaman | 303 | 12741550 | <reponame>ffancheng/megaman
# LICENSE: Simplified BSD https://github.com/mmp2/megaman/blob/master/LICENSE
import os
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('megaman', parent_package, top_path)
config.add_subpackage('... |
ryu/tests/unit/ofproto/test_parser_v10.py | hiArvin/ryu | 269 | 12741559 | <reponame>hiArvin/ryu
# Copyright (C) 2012 Nippon Telegraph and Telephone 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
#
# Un... |
third_party/catapult/dashboard/dashboard/common/utils_test.py | zipated/src | 2,151 | 12741575 | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import base64
import json
import unittest
import mock
from google.appengine.ext import ndb
from dashboard.common import testing_common
from dashboard.comm... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.