code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
import re
import itertools
import subprocess
import collections
def convert_pdf(filename, type='xml'):
commands = {'text': ['pdftotext', '-layout', filename, '-'],
'text-nolayout': ['pdftotext', filename, '-'],
'xml': ['pdftohtml', '-xml', '-stdout', filename],
'htm... | sunlightlabs/billy | billy/scrape/utils.py | Python | bsd-3-clause | 5,127 |
"""
This module contains the BinMapper class.
BinMapper is used for mapping a real-valued dataset into integer-valued bins.
Bin thresholds are computed with the quantiles so that each bin contains
approximately the same number of samples.
"""
# Author: Nicolas Hug
import numpy as np
from ...utils import check_random... | bnaul/scikit-learn | sklearn/ensemble/_hist_gradient_boosting/binning.py | Python | bsd-3-clause | 8,237 |
###############################################################################
##
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary for... | Nikea/VisTrails | vistrails/core/db/locator.py | Python | bsd-3-clause | 30,882 |
"""
This module holds a common parser for the add and modify command.
"""
import datetime
import pytz
def init_id_flag(command, subparser):
"""
Init the parser
It adds the id argument to the argument parser
"""
parser = subparser.add_parser(command, help="")
parser.add_argument("id", type=in... | tantSinnister/doto | doto/cli/parser.py | Python | bsd-3-clause | 762 |
from functools import partial
from importlib import reload
from io import (
BytesIO,
StringIO,
)
import os
from pathlib import Path
import re
import threading
from urllib.error import URLError
import numpy as np
import pytest
from pandas.compat import is_platform_windows
from pandas.errors import ParserError
... | datapythonista/pandas | pandas/tests/io/test_html.py | Python | bsd-3-clause | 40,117 |
from typing import NamedTuple
import numpy as np
from numpy.testing import assert_allclose
import pandas as pd
from pandas.testing import assert_index_equal
import pytest
from statsmodels.datasets import danish_data
from statsmodels.iolib.summary import Summary
from statsmodels.tools.sm_exceptions import Specificatio... | statsmodels/statsmodels | statsmodels/tsa/ardl/tests/test_ardl.py | Python | bsd-3-clause | 24,282 |
# 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.
try:
_STRING_TYPE = basestring
except NameError: # pragma: no cover
_STRING_TYPE = str
from recipe_engine.config import config_item_context, ConfigGrou... | CoherentLabs/depot_tools | recipes/recipe_modules/gclient/config.py | Python | bsd-3-clause | 18,342 |
from __future__ import absolute_import, print_function, division
import numpy
import numpy.linalg
import theano
from theano import tensor, function
from theano.tensor.basic import _allclose
from theano.tests.test_rop import break_op
from theano.tests import unittest_tools as utt
from theano import config
from theano.t... | JazzeYoung/VeryDeepAutoEncoder | theano/sandbox/linalg/tests/test_linalg.py | Python | bsd-3-clause | 5,038 |
from corehq.apps.hqwebapp.testcases import WebUserTestCase
from corehq.apps.hqwebapp import selenium
from selenium.common.exceptions import NoSuchElementException
import re
class ReportsTestCase(WebUserTestCase):
app = selenium.get_app('reports')
max_preload_time = app.MAX_PRELOAD_TIME
max_load_time ... | puttarajubr/commcare-hq | corehq/apps/reports/tests/selenium/test_reports.py | Python | bsd-3-clause | 2,369 |
import pyexcel as p
from nose.tools import eq_
def test_a_dictionary_of_sheet():
test_data = [["a", "b"]]
book_dict = {"test": p.Sheet(test_data)}
book = p.Book(book_dict)
eq_(book.test.array, test_data)
def test_book_len():
test_data = [["a", "b"]]
book_dict = {"test": p.Sheet(test_data... | chfw/pyexcel | tests/test_book.py | Python | bsd-3-clause | 609 |
# Generic tests that all raw classes should run
from os import path as op
import math
import numpy as np
from numpy.testing import assert_allclose, assert_array_almost_equal
from nose.tools import assert_equal, assert_true
from mne import concatenate_raws
from mne.datasets import testing
from mne.io import read_raw_f... | nicproulx/mne-python | mne/io/tests/test_raw.py | Python | bsd-3-clause | 5,337 |
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests for miscellaneous functionality in the `funcs` module
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import pytest
import numpy as np
from numpy import t... | kelle/astropy | astropy/coordinates/tests/test_funcs.py | Python | bsd-3-clause | 2,515 |
from django.apps.registry import Apps
from django.db import models
from django.db.migrations.state import ProjectState, ModelState, InvalidBasesError
from django.test import TestCase
class StateTests(TestCase):
"""
Tests state construction, rendering and modification by operations.
"""
def test_creat... | mbox/django | tests/migrations/test_state.py | Python | bsd-3-clause | 12,382 |
#!/usr/bin/python
import os
import signal
import struct
import sys
import time
ALLOWED_INTERFACES = [ "cpu_dma_latency", "network_latency", "network_throughput" ]
def read_pmqos(name):
filename = "/dev/%s" % name
old = open(filename)
old_value = struct.unpack("i", old.read())[0]
print "PMQOS value for %s is %d"%(n... | apanda/NetBricks | scripts/tuning/read_cpu_dma_latency.py | Python | isc | 588 |
from tests.test_pip import (reset_env, run_pip,
_create_test_package, _change_test_package_version)
from tests.local_repos import local_checkout
def test_install_editable_from_git_with_https():
"""
Test cloning from Git with https.
"""
reset_env()
result = run_pip('install', ... | radiosilence/pip | tests/test_vcs_backends.py | Python | mit | 5,930 |
import urlparse
from google.appengine.ext import ndb
from consts.district_type import DistrictType
from models.district import District
from models.district_team import DistrictTeam
from models.team import Team
from models.robot import Robot
class FMSAPITeamDetailsParser(object):
def __init__(self, year):
... | verycumbersome/the-blue-alliance | datafeeds/parsers/fms_api/fms_api_team_details_parser.py | Python | mit | 3,057 |
from scipy import *
import json
import scipy
import numpy as np
import time as tm
import gc
import struct
import getopt, sys
import os
import traceback
# ------------------------------------------------------------
# Logging & Timer
# ------------------------------------------------------------
logging_level = 0;
... | cvdlab/lar-running-demo | py/computation/old/step_convert_binarychains.py | Python | mit | 3,895 |
# Copyright 2016 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.com/apache2.0/
#
# or in the "license" file accompa... | quickresolve/accel.ai | flask-aws/lib/python2.7/site-packages/ebcli/lib/elbv2.py | Python | mit | 2,545 |
import unittest
import logging
import tempfile
from .test_commons import conn_info
import vertica_python
from vertica_python import errors
logger = logging.getLogger('vertica')
def init_table(cur):
# clean old table
cur.execute('DROP TABLE IF EXISTS vertica_python_unit_test;')
# create test table
... | twneale/vertica-python | vertica_python/tests/basic_tests.py | Python | mit | 12,619 |
# 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 ... | v-iam/azure-sdk-for-python | azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_database_activity_paged.py | Python | mit | 950 |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
import logging
from flexget import plugin
from flexget.event import event
from flexget.plugin import PluginError
log = logging.getLogger('list_clear')
class ListClear(object... | oxc/Flexget | flexget/plugins/modify/list_clear.py | Python | mit | 2,149 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "plataforma_fadcanic.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| CARocha/plataforma_fadcanic | manage.py | Python | mit | 262 |
# -*- coding:utf-8 -*-
import operator
import string
import operator
import itertools
import snowballstemmer
from textblob import TextBlob, Word
LOWER_MAP = {
'tr': {
ord('I'): u'ı'
}
}
STEMMERS = {
'en': snowballstemmer.stemmer('english'),
'tr': snowballstemmer.stemmer('turkish'),
}
def no... | bahattincinic/arguman.org | web/nouns/utils.py | Python | mit | 1,877 |
#!/usr/bin/env python
# REQUIRES both rst2pdf and wikir project from google code.
import sys
import subprocess
sys.path.insert(0, '../../rson/py2x')
from rson import loads
from simplejson import dumps
subprocess.call('../../rst2pdf/bin/rst2pdf manual.txt -e preprocess -e dotted_toc -o manual.pdf'.split())
lines = i... | pmaupin/playtag | doc/make.py | Python | mit | 745 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2014 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) a... | MSusik/invenio | invenio/modules/webhooks/signatures.py | Python | gpl-2.0 | 1,447 |
import os
import subprocess
import infra.basetest
def jffs2dump_find_file(files_list, fname):
for file_name in files_list:
file_name = file_name.strip()
if file_name.startswith("Dirent") and file_name.endswith(fname):
return True
return False
class TestJffs2(infra.basetest.BRTest)... | tSed/buildroot | support/testing/tests/fs/test_jffs2.py | Python | gpl-2.0 | 1,675 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... | Venris/crazyflie-multilink | lib/cfclient/utils/input.py | Python | gpl-2.0 | 15,839 |
#####################################################################
# -*- coding: iso-8859-1 -*- #
# #
# Frets on Fire #
# Copyright (C) 2006 Sami Kyöstilä ... | GabrieleNunez/fofix | fofix/game/Dialogs.py | Python | gpl-2.0 | 87,557 |
import os
from translate.convert import po2idml, test_convert
class TestPo2IDMLCommand(test_convert.TestConvertCommand):
"""Tests running actual po2idml commands on files"""
convertmodule = po2idml
def test_convert(self):
posource = """
#: idPkg:Story[0]/%7B%7DStory[0]/%7B%7DXMLElement[0]/%7B%7... | translate/translate | translate/convert/test_po2idml.py | Python | gpl-2.0 | 751 |
#! /usr/bin/env python
###############################################################################
#
# simulavr - A simulator for the Atmel AVR family of microcontrollers.
# Copyright (C) 2001, 2002 Theodore A. Roth
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of th... | simark/simulavr | regress/test_opcodes/test_LPM_Z.py | Python | gpl-2.0 | 2,490 |
from CUBRIDPy.constants.DATA_TYPES import *
from CUBRIDPy.constants.CUBRID import *
from CUBRIDPy.protocol.CUBRIDProtocol import CUBRIDProtocol
from CUBRIDPy.protocol.ColumnMetaData import ColumnMetaData
from CUBRIDPy.protocol.ResultInfo import ResultInfo
import datetime
import logging
from array import array
f... | cubrid-talks/CUBRIDPy | trunk/CUBRIDPy/protocol/PrepareAndExecuteQuery.py | Python | gpl-2.0 | 17,149 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated by generateDS.py.
#
#
# Command line options:
# ('--no-dates', '')
# ('--no-versions', '')
# ('-f', '')
# ('-o', '.../addon/doxmlparser/doxmlparser/index.py')
#
# Command line arguments:
# .../templates/xml/index.xsd
#
# Command line:
# .../generat... | doxygen/doxygen | addon/doxmlparser/doxmlparser/index.py | Python | gpl-2.0 | 64,593 |
# Copyright (C) 2011 Jeremy S. Sanders
# Email: Jeremy Sanders <jeremy@jeremysanders.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# ... | KDB2/veusz | veusz/document/export.py | Python | gpl-2.0 | 15,098 |
# SPDX-License-Identifier: GPL-3.0-or-later
class Object:
def __init__(self):
self.vertices = []
self.mtl_list = []
| onpon4/naev | utils/model-view/obj_view/object.py | Python | gpl-3.0 | 137 |
#!/usr/bin/env python
# PYTHON_ARGCOMPLETE_OK
"""Verify the current Shippable run has the required number of jobs."""
from __future__ import absolute_import, print_function
# noinspection PyCompatibility
import argparse
import errno
import os
import sys
from lib.http import (
HttpClient,
)
from lib.util import ... | archf/ansible | test/runner/shippable.py | Python | gpl-3.0 | 2,577 |
from frappe import _
def get_data():
return {
'fieldname': 'bank_account',
'non_standard_fieldnames': {
'Customer': 'default_bank_account',
'Supplier': 'default_bank_account',
},
'transactions': [
{
'label': _('Payments'),
'items': ['Payment Entry', 'Payment Request', 'Payment Order', 'Payro... | mhbu50/erpnext | erpnext/accounts/doctype/bank_account/bank_account_dashboard.py | Python | gpl-3.0 | 502 |
# coding=utf-8
# This file is part of Medusa.
#
#
# Medusa is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Medusa is distributed i... | pymedusa/Medusa | medusa/media/banner.py | Python | gpl-3.0 | 1,222 |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Canal para cuevana
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import re
import urlparse
from channelselector import get_thum... | ChopChopKodi/pelisalacarta | python/main-classic/channels/descargacineclasico.py | Python | gpl-3.0 | 6,362 |
from __future__ import (absolute_import, division, print_function)
import filecmp
import numpy as np
import os
import stresstesting
import tempfile
import mantid.simpleapi as mantid
import mantid.kernel as kernel
from tube_calib_fit_params import TubeCalibFitParams
from tube_calib import getCalibratedPixelPositions, ... | wdzhou/mantid | Testing/SystemTests/tests/analysis/WishCalibrate.py | Python | gpl-3.0 | 8,447 |
# -*- coding: utf-8 -*-
# Copyright (C) Duncan Macleod (2018-2020)
#
# This file is part of GWpy.
#
# GWpy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option)... | areeda/gwpy | gwpy/plot/tests/test_segments.py | Python | gpl-3.0 | 5,755 |
# -*- coding: utf-8 -*-
"""
orthopoly.py - A suite of functions for generating orthogonal polynomials
and quadrature rules.
Copyright (c) 2014 Greg von Winckel
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated do... | NicovincX2/Python-3.5 | Analyse (mathématiques)/Analyse numérique/Équations différentielles numériques/Collocation method/orthopoly.py | Python | gpl-3.0 | 11,766 |
#**************************************
# Current Database Info
#**************************************
# To Access...
# from database_config import db_config
# from py2neo import neo4j
# graph_db = neo4j.GraphDatabaseService(db_config['uri'])
db_config = {}
#db_config['address'] = "http://162.212.130.189"
... | cuoretech/syncform | database_config.py | Python | gpl-3.0 | 2,408 |
# -*- coding: utf-8 -*-
##Copyright (C) [2010] [Jürgen Hamel, D-32584 Löhne]
##This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as
##published by the Free Software Foundation; either version 3 of the License, or (at your option) any later versio... | BackupTheBerlios/cuon-svn | cuon_server/WEB/html/fromGladeToHtml.py | Python | gpl-3.0 | 9,485 |
import datetime
try:
import urllib.parse as urlparse
except ImportError:
from urllib.urlparse import urlparse
from django_jinja import library
from django.utils.http import urlencode
@library.global_function
def thisyear():
"""The current year."""
return datetime.date.today().year
@library.filter
d... | mozilla/lumbergh | careers/base/templatetags/helpers.py | Python | mpl-2.0 | 1,025 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
"""
add permissions to the profile
"""
__all__ = ['MissingPrimaryLocationError', 'MultiplePrimaryLocationsError',
... | SlateScience/MozillaJS | js/src/testing/mozbase/mozprofile/mozprofile/permissions.py | Python | mpl-2.0 | 12,792 |
import sys
import unittest
import pytest
from .. import parser, serializer
class TokenizerTest(unittest.TestCase):
def setUp(self):
self.serializer = serializer.ManifestSerializer()
self.parser = parser.Parser()
def serialize(self, input_str):
return self.serializer.serialize(self.p... | dati91/servo | tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/wptmanifest/tests/test_serializer.py | Python | mpl-2.0 | 4,547 |
from __future__ import division, absolute_import, with_statement, print_function, unicode_literals
import cgi
import six
from reportlab.lib.colors import red, orange, lawngreen, white, black, blue
from reportlab.lib.enums import TA_CENTER, TA_RIGHT
from reportlab.lib.pagesizes import letter
from reportlab.lib.styles... | jmlong1027/multiscanner | utils/pdf_generator/generic_pdf.py | Python | mpl-2.0 | 9,383 |
# This file is part of Shuup.
#
# Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
import pytest
from django.test import override_settings
from shuup.admin.modules.shops.vi... | suutari-ai/shoop | shuup_tests/admin/test_multishop_setting.py | Python | agpl-3.0 | 1,030 |
"""Proxy for coordinates stored outside Shapely geometries
"""
from shapely.geos import lgeos
from shapely import wkb
EMPTY = wkb.deserialize('010700000000000000'.decode('hex'))
class CachingGeometryProxy(object):
context = None
factory = None
__geom__ = EMPTY
_gtag = None
def __init__(self, c... | GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/shapely/geometry/proxy.py | Python | agpl-3.0 | 1,342 |
# -*- coding: utf-8 -*-
"""
Models for Student Identity Verification
This is where we put any models relating to establishing the real-life identity
of a student over a period of time. Right now, the only models are the abstract
`PhotoVerification`, and its one concrete implementation
`SoftwareSecurePhotoVerification`... | eestay/edx-platform | lms/djangoapps/verify_student/models.py | Python | agpl-3.0 | 36,885 |
# -*- coding: utf-8 -*-
import re
from ..base.downloader import BaseDownloader
class VeehdCom(BaseDownloader):
__name__ = "VeehdCom"
__type__ = "downloader"
__version__ = "0.29"
__status__ = "testing"
__pattern__ = r"http://veehd\.com/video/\d+_\S+"
__config__ = [
("enabled", "bool",... | vuolter/pyload | src/pyload/plugins/downloaders/VeehdCom.py | Python | agpl-3.0 | 2,189 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import datetime
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('gym', '0001_initial'),
... | petervanderdoes/wger | wger/gym/migrations/0002_auto_20151003_1944.py | Python | agpl-3.0 | 1,061 |
"""Deprecated import support. Auto-generated by import_shims/generate_shims.sh."""
# pylint: disable=redefined-builtin,wrong-import-position,wildcard-import,useless-suppression,line-too-long
from import_shims.warn import warn_deprecated_import
warn_deprecated_import('discussion.tests.test_views', 'lms.djangoapps.disc... | eduNEXT/edunext-platform | import_shims/lms/discussion/tests/test_views.py | Python | agpl-3.0 | 404 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Abstract
# (<http://abstract.it>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as publish... | abstract-open-solutions/l10n-italy | l10n_it_ateco/__openerp__.py | Python | agpl-3.0 | 1,563 |
# -*- coding: utf-8 -*-
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Pexego Sistemas Informáticos. All Rights Reserved
# $Id$
#
# This program is free software: you can redistri... | Pexego/sale_commission | __unported__/pxgo_account_admin_tools/__init__.py | Python | agpl-3.0 | 1,283 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PerlConfigGeneral(PerlPackage):
"""Config::General - Generic Config Module"""
homepag... | iulian787/spack | var/spack/repos/builtin/packages/perl-config-general/package.py | Python | lgpl-2.1 | 557 |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | wscullin/spack | var/spack/repos/builtin/packages/xdm/package.py | Python | lgpl-2.1 | 1,876 |
############################ Copyrights and license ############################
# #
# Copyright 2020 Steve Kowalik <steven@wedontsleep.org> #
# Copyright 2020 Pascal Hofmann <mail@pascalhofmann.de> ... | ahmad88me/PyGithub | tests/Deployment.py | Python | lgpl-3.0 | 3,609 |
# -*- coding: UTF-8 -*-
##############################################################################
#
# OERPLib
# Copyright (C) 2012-2013 Sébastien Alix.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# ... | etsinko/oerplib | oerplib/rpc/xmlrpclib_custom.py | Python | lgpl-3.0 | 5,967 |
#
# 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... | clemensv/qpid-proton | tests/python/proton_tests/engine.py | Python | apache-2.0 | 75,989 |
# Copyright IBM Corp. 2017 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 law or ag... | phariel/fabric | test/feature/environment.py | Python | apache-2.0 | 3,050 |
"""
Handler for Juniper device specific information.
Note that for proper import, the classname has to be:
"<Devicename>DeviceHandler"
...where <Devicename> is something like "Default", "Junos", etc.
All device-specific handlers derive from the DefaultDeviceHandler, which implements the
generic information need... | ncclient/ncclient | ncclient/devices/junos.py | Python | apache-2.0 | 6,467 |
import pytest
class TestOSDs(object):
@pytest.mark.no_docker
def test_ceph_osd_package_is_installed(self, node, host):
assert host.package("ceph-osd").is_installed
def test_osds_listen_on_public_network(self, node, host):
# TODO: figure out way to paramaterize this test
nb_port =... | travmi/ceph-ansible | tests/functional/tests/osd/test_osds.py | Python | apache-2.0 | 1,919 |
# Copyright 2012 OpenStack Foundation
#
# 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... | dpgoetz/swift | swift/common/middleware/keystoneauth.py | Python | apache-2.0 | 25,905 |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import copy
import f... | kslundberg/pants | src/python/pants/backend/jvm/tasks/junit_run.py | Python | apache-2.0 | 37,903 |
from ..adapters.postgres import Postgre, PostgreNew, PostgreBoolean
from ..helpers.methods import varquote_aux
from ..objects import Expression
from .base import SQLDialect
from . import dialects, sqltype_for, register_expression
@dialects.register_for(Postgre)
class PostgreDialect(SQLDialect):
true_exp = "TRUE"
... | xiang12835/python_web | py2_web2py/web2py/gluon/packages/dal/pydal/dialects/postgre.py | Python | apache-2.0 | 11,219 |
import threading
import unittest
from unittest import mock
import pykka
from mopidy import audio
from mopidy.audio.constants import PlaybackState
from mopidy.internal import path
from mopidy.internal.gi import Gst
from tests import dummy_audio, path_to_data_dir
# We want to make sure both our real audio class and t... | jcass77/mopidy | tests/audio/test_actor.py | Python | apache-2.0 | 22,260 |
"""Tests for the Abode cover device."""
from unittest.mock import patch
from homeassistant.components.abode import ATTR_DEVICE_ID
from homeassistant.components.cover import DOMAIN as COVER_DOMAIN
from homeassistant.const import (
ATTR_ENTITY_ID,
ATTR_FRIENDLY_NAME,
SERVICE_CLOSE_COVER,
SERVICE_OPEN_COV... | partofthething/home-assistant | tests/components/abode/test_cover.py | Python | apache-2.0 | 2,112 |
# !/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import time
import math
from BeautifulSoup import BeautifulSoup
import config
from toolkit.downloader import Downloader, DownloadError
from toolkit import datetimelib as dt
from parser.commonblogparser import CommonBlogParser
class PreprocessError(Exception):... | YuepengGuo/sina_weibo_crawler | crawler/blogcrawler.py | Python | apache-2.0 | 10,877 |
#! /usr/bin/python
'''
Bookmarks.py - Main Executable
- Identifies current BBC programmes and generates keywords based on them.
- Collects Twitter streaming API data based on generated keywords.
- Analyses the collected data to identify frequent words, hence allowing the web interface to generate bookmarks.
'''
### D... | sparkslabs/kamaelia_ | Sketches/AB/Bookmarks-Dev/App/Bookmarks.py | Python | apache-2.0 | 7,466 |
# 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... | bolkedebruin/airflow | tests/providers/apache/livy/operators/test_livy.py | Python | apache-2.0 | 6,889 |
from __future__ import print_function
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2016,2017
import sys
import sysconfig
import inspect
if sys.version_info.major == 2:
import funcsigs
import imp
import glob
import os
import shutil
import argparse
import subprocess
import xml.etree.ElementTree as ET
im... | IBMStreams/streamsx.topology | test/python/spl/tk17/opt/.__splpy/packages/streamsx/scripts/extract.py | Python | apache-2.0 | 18,964 |
#!/usr/bin/env python
#
# This file is part of pyasn1-modules software.
#
# Copyright (c) 2005-2019, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
# Read ASN.1/PEM X.509 certificate requests (PKCS#10 format) on stdin,
# parse each into plain text, then build substrate from it
#
... | kawamon/hue | desktop/core/ext-py/pyasn1-modules-0.2.6/tools/pkcs10dump.py | Python | apache-2.0 | 1,165 |
from __future__ import unicode_literals
import logging
logging.getLogger('boto').setLevel(logging.CRITICAL)
__title__ = 'moto'
__version__ = '0.4.19'
from .autoscaling import mock_autoscaling # flake8: noqa
from .cloudformation import mock_cloudformation # flake8: noqa
from .cloudwatch import mock_cloudwatch # fla... | behanceops/moto | moto/__init__.py | Python | apache-2.0 | 1,306 |
# # ===============================================================================
# # Copyright 2014 Jake Ross
# #
# # 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.apa... | USGSDenverPychron/pychron | pychron/experiment/notifier/user_notifier.py | Python | apache-2.0 | 6,871 |
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import unittest
from pants.option.option_value_container import OptionValueContainerBuilder
from pants.option.ranked_value import Rank, RankedValue
class OptionValueContainerTest(unitte... | benjyw/pants | src/python/pants/option/option_value_container_test.py | Python | apache-2.0 | 3,316 |
from __future__ import absolute_import
from __future__ import unicode_literals
import os.path
import random
import py
import pytest
from docker.errors import APIError
from docker.errors import NotFound
from .. import mock
from ..helpers import build_config as load_config
from ..helpers import create_host_file
from .... | shakamunyi/fig | tests/integration/project_test.py | Python | apache-2.0 | 55,924 |
"""Test Hue setup process."""
from unittest.mock import Mock
import pytest
from homeassistant import config_entries
from homeassistant.components import hue
from homeassistant.setup import async_setup_component
from tests.async_mock import AsyncMock, patch
from tests.common import MockConfigEntry
@pytest.fixture
d... | titilambert/home-assistant | tests/components/hue/test_init.py | Python | apache-2.0 | 8,339 |
import os
os.environ["qwiejioqwjeioqwjeioqwje"]
| supercheetah/diceroller | pyinstaller/buildtests/import/error_during_import2.py | Python | artistic-2.0 | 48 |
# $Id$
#
# Copyright (C) 2000-2008 greg Landrum and Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
""" command line util... | rvianello/rdkit | rdkit/ML/BuildComposite.py | Python | bsd-3-clause | 35,920 |
#!/usr/bin/env python
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('tract_querier', parent_package, top_path)
config.add_subpackage('tractography')
config.add_subpackage('tract_math')
config.add_subpackage('code_uti... | oesteban/tract_querier | tract_querier/setup.py | Python | bsd-3-clause | 766 |
# -*- encoding:utf-8 -*-
import sys, os
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from docscrape import NumpyDocString, FunctionDoc
from docscrape_sphinx import SphinxDocString
from nose.tools import *
doc_txt = '''\
numpy.multivariate_normal(mean, cov, shape=None)
Draw values from a multiv... | chadnetzer/numpy-gaurdro | doc/sphinxext/tests/test_docscrape.py | Python | bsd-3-clause | 13,185 |
"""
====================================================
Compute envelope correlations in volume source space
====================================================
Compute envelope correlations of orthogonalized activity [1]_ [2]_ in source
space using resting state CTF data in a volume source space.
"""
# Authors: Er... | Teekuningas/mne-python | examples/connectivity/plot_mne_inverse_envelope_correlation_volume.py | Python | bsd-3-clause | 4,055 |
"""Functions to make simple plots with M/EEG data
"""
from __future__ import print_function
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis Engemann <denis.engemann@gmail.com>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Eric Larson <larson.eric.d@gmail.com... | cmoutard/mne-python | mne/viz/misc.py | Python | bsd-3-clause | 19,712 |
#
# This file is part of CONCUSS, https://github.com/theoryinpractice/concuss/,
# and is Copyright (C) North Carolina State University, 2015. It is licensed
# under the three-clause BSD license; see LICENSE.
#
from collections import deque
from dp import KPattern, DPTable
from double_count import InclusionExclusion
... | TheoryInPractice/CONCUSS | lib/pattern_counting/pattern_counter.py | Python | bsd-3-clause | 8,882 |
from __future__ import division, absolute_import, print_function
import sys
import itertools
import pytest
import numpy as np
from numpy.testing import assert_, assert_equal, assert_raises, IS_PYPY
# This is the structure of the table used for plain objects:
#
# +-+-+-+
# |x|y|z|
# +-+-+-+
# Structure of a plain ar... | ahaldane/numpy | numpy/core/tests/test_numerictypes.py | Python | bsd-3-clause | 18,601 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2020, the cclib development team
#
# This file is part of cclib (http://cclib.github.io) and is distributed under
# the terms of the BSD 3-Clause License.
"""Parser for GAMESS-UK output files"""
import re
import numpy
from cclib.parser import logfileparser
from cclib.parse... | berquist/cclib | cclib/parser/gamessukparser.py | Python | bsd-3-clause | 30,330 |
"""
django-helpdesk - A Django powered ticket tracker for small enterprise.
(c) Copyright 2008 Jutda. All Rights Reserved. See LICENSE for details.
urls.py - Mapping of URL's to our various views. Note we always used NAMED
views for simplicity in linking later on.
"""
from django.conf.urls import url
from ... | mrkiwi-nz/django-helpdesk | helpdesk/urls.py | Python | bsd-3-clause | 5,961 |
"""
====================================================
Shuffle channels' data in the time domain and plot.
====================================================
"""
# Author: Eberhard Eich
# Praveen Sripad
#
# License: BSD (3-clause)
import numpy as np
import os.path as op
import mne
from jumeg.j... | fboers/jumeg | examples/connectivity/plot_shuffle_time_slices.py | Python | bsd-3-clause | 2,449 |
"""A simple inspector overlay for plots
This module provides the SimpleInspectorOverlay for displaying
information gathered from an inspector tool in a TextGrid. By default
it is configured to work with a SimpleInspectorTool.
The module also provides some helper factory functions for creating text
formatters for dic... | ContinuumIO/chaco | chaco/overlays/simple_inspector_overlay.py | Python | bsd-3-clause | 6,043 |
from django import template
from django.template.base import VariableDoesNotExist
from waffle import flag_is_active, sample_is_active, switch_is_active
register = template.Library()
class WaffleNode(template.Node):
def __init__(self, nodelist_true, nodelist_false, condition, name,
compiled_nam... | 11craft/django-waffle | waffle/templatetags/waffle_tags.py | Python | bsd-3-clause | 2,343 |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from measurements import startup
import page_sets
from telemetry import benchmark
class _StartWithUrl(benchmark.Benchmark):
page_set = page_sets.StartupP... | sgraham/nope | tools/perf/benchmarks/start_with_url.py | Python | bsd-3-clause | 1,178 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
import gzip
import bz2
import zipfile
from tempfile import NamedTemporaryFile
from petl.compat import PY2
from petl.test.helpers import ieq, eq_
import petl as etl
from petl.io.sources import MemorySource, PopenSource, ZipSourc... | psnj/petl | petl/test/io/test_sources.py | Python | mit | 3,696 |
import re
from thefuck.utils import get_all_matched_commands, replace_command, for_app
@for_app('tsuru')
def match(command):
return (' is not a tsuru command. See "tsuru help".' in command.output
and '\nDid you mean?\n\t' in command.output)
def get_new_command(command):
broken_cmd = re.findall(r... | scorphus/thefuck | thefuck/rules/tsuru_not_command.py | Python | mit | 527 |
"""Get a trajectory to a grasp before executing it.
"""
from openravepy import *
import numpy, time
env=Environment()
env.Load('data/lab1.env.xml')
env.SetViewer('qtcoin')
robot = env.GetRobots()[0]
target = env.GetKinBody('mug1')
gmodel = databases.grasping.GraspingModel(robot,target)
if not gmodel.load():
gmodel.... | jdsika/TUM_HOly | openrave/docs/source/tutorials/openravepy_examples/returning_trajectory.py | Python | mit | 847 |
# This file is part of beets.
# Copyright 2013, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, ... | Wen777/beets | test/test_pipeline.py | Python | mit | 6,779 |
from direct.interval.IntervalGlobal import LerpFunctionInterval
from direct.gui.DirectGui import DirectLabel, DirectFrame, DGG
from direct.showbase.PythonUtil import bound as clamp
from pandac.PandaModules import TextNode, NodePath
from toontown.toonbase import ToontownGlobals
import CogdoUtil
import CogdoFlyingGameGlo... | Spiderlover/Toontown | toontown/cogdominium/CogdoFlyingGameGuis.py | Python | mit | 8,010 |
# -*- coding: utf-8 -*-
#
# libsaas documentation build configuration file, created by
# sphinx-quickstart on Sun May 20 14:45:58 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... | ducksboard/libsaas | doc/conf.py | Python | mit | 8,086 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import json
from builtins import *
import pandas as pd
from . import utils
class EntrustOrder(object):
def __init__(self, security, action, price, size):
... | harveywwu/vnpy | vnpy/trader/gateway/tkproGateway/TradeApi/trade_api.py | Python | mit | 19,713 |
#
for key in container:
# ...
#
| general-language-syntax/GLS | test/integration/ForEachKeyStart/for each key start.py | Python | mit | 36 |