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 |
|---|---|---|---|---|---|
#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
from __future__ import absolute_import
from rapidsms.message import Message, EmailMessage
from rapidsms.connection import Connection
from . import backend
import imaplib
import time
import smtplib
import re
import Queue
from datetime import datetime
from email impo... | rapidsms/rapidsms-legacy | lib/rapidsms/backends/email.py | Python | bsd-3-clause | 6,507 |
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | TextusData/Mover | thirdparty/protobuf-2.2.0/python/google/protobuf/internal/test_util.py | Python | gpl-3.0 | 25,634 |
#
# 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 us... | wangmiao1981/spark | python/pyspark/sql/pandas/serializers.py | Python | apache-2.0 | 12,308 |
#!/usr/bin/env python3
import os, sys
import unittest
from gppylib import gplog
from gpsegstart import GpSegStart
from mock import patch
logger = gplog.get_unittest_logger()
class GpSegStartTestCase(unittest.TestCase):
@patch('gpsegstart.GpSegStart.getOverallStatusKeys', return_value=[])
@patch('gpsegstart.... | 50wu/gpdb | gpMgmt/bin/gppylib/test/unit/test_cluster_gpsegstart.py | Python | apache-2.0 | 1,966 |
# coding: utf-8
import os
from gppylib.db import dbconn
from gppylib.test.behave_utils.utils import run_gpcommand
from gppylib.gparray import GpArray
from gppylib.test.behave_utils.utils import get_all_hostnames_as_list
from gppylib.operations.backup_utils import generate_report_filename, generate_global_filename, gen... | randomtask1155/gpdb | gpMgmt/bin/gppylib/test/behave/mgmt_utils/steps/netbackup_mgmt_utils.py | Python | apache-2.0 | 27,950 |
from io import StringIO
import json
import logging
import sys
import uuid
import csv
from redash.query_runner import *
from redash.utils import JSONEncoder
logger = logging.getLogger(__name__)
try:
import atsd_client
from atsd_client.exceptions import SQLException
from atsd_client.services import SQLServ... | hudl/redash | redash/query_runner/axibase_tsd.py | Python | bsd-2-clause | 6,833 |
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | jvrsantacruz/XlsxWriter | xlsxwriter/test/comparison/test_chart_points05.py | Python | bsd-2-clause | 1,796 |
from __future__ import unicode_literals
from django_evolution.mutations import AddField
from django.db import models
MUTATIONS = [
AddField('Group', 'visible', models.BooleanField, initial=True)
]
| 1tush/reviewboard | reviewboard/reviews/evolutions/group_visible.py | Python | mit | 204 |
import time
import sys
from mitmproxy.script import concurrent
@concurrent
def request(flow):
time.sleep(0.1)
| Kriechi/mitmproxy | test/mitmproxy/data/addonscripts/concurrent_decorator.py | Python | mit | 116 |
import numpy
from pycbc.filter import matched_filter
snr = matched_filter(hp, zoom.to_pycbc(), psd=psd.to_pycbc(),
low_frequency_cutoff=15)
snrts = TimeSeries.from_pycbc(snr).abs() | gwpy/gwpy.github.io | docs/v0.5/examples/timeseries/pycbc-snr-5.py | Python | gpl-3.0 | 201 |
#
# Copyright (c) 2001 - 2014 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge... | stonekyx/binary | vendor/scons-local-2.3.4/SCons/Tool/mssdk.py | Python | gpl-3.0 | 1,804 |
""" codecs -- Python Codec Registry, API and helpers.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""#"
import builtins, sys
### Registry and builtin stateless codec functions
try:
from _codecs import *
except ImportError as why:
raise SystemErro... | technologiescollege/Blockly-rduino-communication | scripts_XP/Lib/codecs.py | Python | gpl-3.0 | 35,910 |
"""
The Python API layer of the country access settings. Essentially the middle tier of the project, responsible for all
business logic that is not directly tied to the data itself.
This API is exposed via the middleware(emabargo/middileware.py) layer but may be used directly in-process.
"""
import logging
import pyg... | synergeticsedx/deployment-wipro | openedx/core/djangoapps/embargo/api.py | Python | agpl-3.0 | 6,954 |
#!/usr/bin/env python
# Line too long - pylint: disable=C0301
# Invalid name - pylint: disable=C0103
#
# Copyright (c) Greenplum Inc 2010. All Rights Reserved.
#
# Note: the option to recover to a new host is not very good if we have a multi-home configuration
#
# Options removed when 4.0 gprecov... | zuowang/incubator-hawq | tools/bin/gppylib/programs/clsRecoverSegment.py | Python | apache-2.0 | 55,995 |
'''
Copyright 2017, Dell, Inc.
Author(s):
UCS test script that tests:
-All the ucs service APIs
-The Discovery workflow
-The Catalog workflow
'''
import fit_path # NOQA: unused import
import unittest
from common import fit_common
from nosedep import depends
import flogging
from nose.plugins.attrib import attr
from... | johren/RackHD | test/tests/ucs/test_ucs_api.py | Python | apache-2.0 | 8,978 |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | eadgarchen/tensorflow | tensorflow/python/ops/logging_ops.py | Python | apache-2.0 | 14,418 |
# coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | kaffeel/oppia | extensions/interactions/EndExploration/EndExploration.py | Python | apache-2.0 | 1,767 |
from planout.experiment import SimpleExperiment
import psycopg2 as pg
from psycopg2.extras import Json as pJson
class PostgresLoggedExperiment(SimpleExperiment):
def configure_logger(self):
""" Sets up a logger to postgres.
1. Modify the connection_parameters variable to be a dictionary of the
... | rawls238/planout | contrib/postgres_logger.py | Python | bsd-3-clause | 1,366 |
from app.config.cplog import CPLog
import cherrypy
import urllib
import urllib2
import telnetlib
import re
log = CPLog(__name__)
try:
import xml.etree.cElementTree as etree
except ImportError:
import xml.etree.ElementTree as etree
class NMJ:
host = ''
database = ''
mount = ''
def __init__(s... | brototyp/CouchPotato | app/lib/nmj.py | Python | gpl-3.0 | 4,088 |
import datetime
try:
import urllib.parse as urlparse
except ImportError:
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
def urlparams(url_, ha... | mozilla/sugardough | {{ cookiecutter.project_name }}/{{ cookiecutter.project_name }}/base/templatetags/helpers.py | Python | apache-2.0 | 1,004 |
"""
A model for coal mining disasters data with a changepoint
switchpoint ~ U(0, 110)
early_mean ~ Exp(1.)
late_mean ~ Exp(1.)
disasters[t] ~ Po(early_mean if t <= switchpoint, late_mean otherwise)
"""
from pymc3 import *
import theano.tensor as t
from numpy import arange, array, ones, concatenate
from numpy.random... | tyarkoni/pymc3 | pymc3/examples/disaster_model_missing.py | Python | apache-2.0 | 2,328 |
"""
Contingency table functions (:mod:`scipy.stats.contingency`)
============================================================
Functions for creating and analyzing contingency tables.
.. currentmodule:: scipy.stats.contingency
.. autosummary::
:toctree: generated/
chi2_contingency
relative_risk
crosstab
... | anntzer/scipy | scipy/stats/contingency.py | Python | bsd-3-clause | 13,835 |
#!/usr/bin/env python2
# Copyright (c) 2013-2014 ARM Limited
# All rights reserved
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | HwisooSo/gemV-update | util/decode_inst_trace.py | Python | bsd-3-clause | 5,387 |
# 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 agreed to in... | eharney/nova | nova/tests/api/openstack/compute/plugins/v3/test_migrations.py | Python | apache-2.0 | 3,995 |
# coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | MaximLich/oppia | extensions/rich_text_components/Link/Link.py | Python | apache-2.0 | 1,451 |
import os
from django.conf import settings
from nose.tools import ok_
import mkt.site.tests
from mkt.developers.utils import check_upload
from mkt.site.storage_utils import local_storage, private_storage
from mkt.site.tests.test_utils_ import get_image_path
class TestCheckUpload(mkt.site.tests.TestCase, mkt.site.t... | ddurst/zamboni | mkt/developers/tests/test_utils_.py | Python | bsd-3-clause | 2,956 |
"""
PhysicsWalker.py is for avatars.
A walker control such as this one provides:
- creation of the collision nodes
- handling the keyboard and mouse input for avatar movement
- moving the avatar
it does not:
- play sounds
- play animations
although it does send messeges that allow a listener to p... | hj3938/panda3d | direct/src/controls/PhysicsWalker.py | Python | bsd-3-clause | 32,513 |
# Copyright (c) 2012 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 logging
import os
import shutil
import sys
import tempfile
from pylib import cmd_helper
from pylib import constants
from pylib import pexpect
f... | wangscript/libjingle-1 | trunk/build/android/pylib/gtest/test_package_executable.py | Python | bsd-3-clause | 6,540 |
"""
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2013 Nathanael C. Fritz, Lance J.T. Stout
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
"""
import logging
from sleekxmpp.stanza import Iq, Message
from sleekxmpp.xmlstream.handler import Callback
from sleekxmpp.xmlstr... | danielvdao/facebookMacBot | venv/lib/python2.7/site-packages/sleekxmpp/plugins/google/nosave/nosave.py | Python | mit | 2,759 |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from flexget.utils.simple_persistence import SimplePersistence
class TestSimplePersistence(object):
config = """
tasks:
test:
mock:
... | jawilson/Flexget | flexget/tests/test_simple_persistence.py | Python | mit | 968 |
#!/usr/bin/python
#
# One-time tool to convert from old custom API document format to YAML.
#
# $ for i in api/*.txt; do python api2yaml.py $i ${i%%.txt}.yaml; done
#
import os
import sys
def main(f_in, f_out, funcname):
parts = {}
curr = None
partname = None
def quoted(line):
if line.strip() == '':
# Don... | kphillisjr/duktape | website/api2yaml.py | Python | mit | 2,302 |
# (C) British Crown Copyright 2014 - 2015, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | decvalts/iris | lib/iris/tests/unit/fileformats/grib/load_convert/test_product_definition_template_0.py | Python | gpl-3.0 | 4,457 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Huawei
# GNU General Public License v3.0+ (see COPYING or
# https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
#################################################################... | simonwydooghe/ansible | lib/ansible/modules/cloud/huawei/hwc_vpc_eip.py | Python | gpl-3.0 | 26,658 |
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import itertools
import operator
import warnings
import pretend
import py... | CYBAI/servo | tests/wpt/web-platform-tests/tools/third_party/packaging/tests/test_version.py | Python | mpl-2.0 | 31,863 |
import numpy as np
import matplotlib.pyplot as plt
mu, sigma = 2, 0.5
v = np.random.normal(mu, sigma, 10000)
plt.hist(v, bins=50, density=1)
plt.show()
<caret> | smmribeiro/intellij-community | python/testData/codeInsight/mlcompletion/prev2calls/assignmentVisitorTwoDifferentPackages.py | Python | apache-2.0 | 159 |
"""task_duration
Revision ID: 2e541a1dcfed
Revises: 1b38cef5b76e
Create Date: 2015-10-28 20:38:41.266143
"""
# revision identifiers, used by Alembic.
revision = '2e541a1dcfed'
down_revision = '1b38cef5b76e'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialect... | mtustin-handy/airflow | airflow/migrations/versions/2e541a1dcfed_task_duration.py | Python | apache-2.0 | 718 |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# 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 Lic... | thaim/ansible | lib/ansible/modules/network/fortios/fortios_firewall_ldb_monitor.py | Python | mit | 12,596 |
import netrc, os, unittest, sys, textwrap
from test import test_support
temp_filename = test_support.TESTFN
class NetrcTestCase(unittest.TestCase):
def tearDown(self):
os.unlink(temp_filename)
def make_nrc(self, test_data):
test_data = textwrap.dedent(test_data)
mode = 'w'
if... | adaussy/eclipse-monkey-revival | plugins/python/org.eclipse.eclipsemonkey.lang.python/Lib/test/test_netrc.py | Python | epl-1.0 | 4,100 |
def f(spam, eggs):
"""
:type spam: list of string
:type eggs: (bool, int, unicode)
"""
return spam, eggs
def test():
f(<warning descr="Expected type 'list[Union[str, unicode]]', got 'list[int]' instead">[1, 2, 3]</warning>,
<warning descr="Expected type 'Tuple[bool, int, unicode]', got '... | amith01994/intellij-community | python/testData/inspections/PyTypeCheckerInspection/ListTuple.py | Python | apache-2.0 | 378 |
class My<caret>Class:
pass | jwren/intellij-community | python/testData/qualifiedName/topLevelClassReference/pkg/subpkg/mod.py | Python | apache-2.0 | 30 |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/tensorflow/python/util/deprecation.py | Python | bsd-2-clause | 15,050 |
#openerp.loggers.handlers. -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import ConfigParser
import optparse
import os
import sys
import openerp
import openerp.conf
import openerp.loglevels as loglevels
import logging
import openerp.release as release
import appdirs
... | angelapper/odoo | openerp/tools/config.py | Python | agpl-3.0 | 31,112 |
# -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from . import stock_move
| raycarnes/odoomrp-utils | stock_move_partner_info/models/__init__.py | Python | agpl-3.0 | 286 |
# Copyright 2014 Netflix, 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... | pradeep-aradhya/security_monkey | security_monkey/watchers/sqs.py | Python | apache-2.0 | 4,045 |
# Copyright 2011 OpenStack Foundation
# 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 requ... | scripnichenko/nova | nova/tests/unit/scheduler/fakes.py | Python | apache-2.0 | 4,507 |
# 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... | zouyapeng/horizon-newtouch | openstack_dashboard/test/settings.py | Python | apache-2.0 | 5,898 |
#!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Argument-less script to select what to run on the buildbots."""
import os
import shutil
import subprocess
import sys
if sys.platform ... | AVarfolomeev/picasso-graphic | tools/gyp/buildbot/buildbot_run.py | Python | bsd-3-clause | 4,948 |
import Orange
data = Orange.data.Table("lenses")
myope_subset = [d for d in data if d["prescription"] == "myope"]
new_data = Orange.data.Table(data.domain, myope_subset)
new_data.save("lenses-subset.tab")
| marinkaz/orange3 | doc/data-mining-library/source/tutorial/code/data-save.py | Python | bsd-2-clause | 205 |
import vstruct
from vstruct.primitives import *
class IMAGE_BASE_RELOCATION(vstruct.VStruct):
def __init__(self):
vstruct.VStruct.__init__(self)
self.VirtualAddress = v_uint32()
self.SizeOfBlock = v_uint32()
class IMAGE_DATA_DIRECTORY(vstruct.VStruct):
def __init__(self):
v... | foreni-administrator/pyew | vstruct/defs/pe.py | Python | gpl-2.0 | 10,708 |
'''Pexpect is a Python module for spawning child applications and controlling
them automatically. Pexpect can be used for automating interactive applications
such as ssh, ftp, passwd, telnet, etc. It can be used to a automate setup
scripts for duplicating software package installations on different servers. It
can be u... | endlessm/chromium-browser | third_party/llvm/lldb/third_party/Python/module/pexpect-4.6/pexpect/__init__.py | Python | bsd-3-clause | 3,902 |
# 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 u... | ctrlaltdel/neutrinator | vendor/stevedore/tests/test_example_simple.py | Python | gpl-3.0 | 972 |
# Copyright (c) 2013 OpenStack Foundation.
# 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... | virtualopensystems/neutron | neutron/extensions/multiprovidernet.py | Python | apache-2.0 | 4,327 |
import Skype4Py
if __name__ == '__main__':
skype = Skype4Py.Skype()
skype.FriendlyName = 'main'
skype.Attach()
print 'Your Skypename:'
print ' ', skype.CurrentUserHandle
print 'Your contacts:'
for user in skype.Friends:
print ' ', user.Handle
| FloatingGhost/skype4py | examples/py2exe/main.py | Python | bsd-3-clause | 294 |
#!/usr/bin/python
# (c) 2017, NetApp, Inc
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | Jorge-Rodriguez/ansible | lib/ansible/modules/storage/netapp/na_ontap_iscsi.py | Python | gpl-3.0 | 8,339 |
"""
kombu.serialization
===================
Serialization utilities.
"""
from __future__ import absolute_import
import codecs
import os
import sys
import pickle as pypickle
try:
import cPickle as cpickle
except ImportError: # pragma: no cover
cpickle = None # noqa
from collections import namedtuple
from ... | nirmeshk/oh-mainline | vendor/packages/kombu/kombu/serialization.py | Python | agpl-3.0 | 14,799 |
"""
A Marketplace only command that finds apps missing from the search index and
adds them.
"""
import sys
import elasticsearch
from django.core.management.base import BaseCommand
from mkt.webapps.indexers import WebappIndexer
from mkt.webapps.models import Webapp
class Command(BaseCommand):
help = 'Fix up Mar... | mozilla/zamboni | lib/es/management/commands/fixup_mkt_index.py | Python | bsd-3-clause | 1,143 |
import logging
import platform
import os
from twilio.exceptions import TwilioException
from twilio.rest.resources import Connection
from twilio.rest.resources import UNSET_TIMEOUT
from twilio.rest.resources import make_request
from twilio.version import __version__ as LIBRARY_VERSION
def find_credentials(environ=Non... | kramwens/order_bot | venv/lib/python2.7/site-packages/twilio/rest/base.py | Python | mit | 3,986 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from lxml import etree
from translate.storage import aresource, test_monolingual
from translate.misc.multistring import multistring
from translate.storage.base import TranslationStore
class TestAndroidResourceUnit(test_monolingual.TestMonolingualUnit):
UnitClass = a... | bluemini/kuma | vendor/packages/translate/storage/test_aresource.py | Python | mpl-2.0 | 15,276 |
""" A sparse matrix in COOrdinate or 'triplet' format"""
from __future__ import division, print_function, absolute_import
__docformat__ = "restructuredtext en"
__all__ = ['coo_matrix', 'isspmatrix_coo']
from warnings import warn
import numpy as np
from scipy._lib.six import xrange, zip as izip
from ._sparsetools ... | ales-erjavec/scipy | scipy/sparse/coo.py | Python | bsd-3-clause | 17,960 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015-16, Ritesh Khadgaray <khadgaray () gmail.com>
# Copyright: (c) 2018, Ansible Project
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__... | kustodian/ansible | lib/ansible/modules/cloud/vmware/vmware_vm_shell.py | Python | gpl-3.0 | 13,417 |
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible 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.
#
# Ansible is dis... | ppanczyk/ansible | test/units/modules/network/vyos/test_vyos_user.py | Python | gpl-3.0 | 3,752 |
import os
from django.template import Context, Template
from django.test import SimpleTestCase, override_settings
from django.utils.translation import activate, get_language, trans_real
from .utils import POFileAssertionMixin
SAMPLEPROJECT_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'sampleproject... | georgemarshall/django | tests/i18n/test_percents.py | Python | bsd-3-clause | 6,626 |
#
# 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
# ... | FNST-OpenStack/horizon | openstack_dashboard/contrib/sahara/test/helpers.py | Python | apache-2.0 | 1,346 |
# -*- coding: utf-8 -*-
""" Sahana Eden Staff Module Automated Tests
@copyright: 2011-2012 (c) Sahana Software Foundation
@license: MIT
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... | devinbalkind/eden | modules/tests/staff/staff.py | Python | mit | 1,563 |
#
# The Python Imaging Library.
# $Id$
#
# base class for image file handlers
#
# history:
# 1995-09-09 fl Created
# 1996-03-11 fl Fixed load mechanism.
# 1996-04-15 fl Added pcx/xbm decoders.
# 1996-04-30 fl Added encoders.
# 1996-12-14 fl Added load helpers
# 1997-01-11 fl Use encode_to_file where possibl... | whitehorse-io/encarnia | pyenv/lib/python2.7/site-packages/PIL/ImageFile.py | Python | mit | 16,120 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | ravibhure/ansible | lib/ansible/modules/network/f5/bigip_device_sshd.py | Python | gpl-3.0 | 9,949 |
#!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
ANSIB... | alxgu/ansible | lib/ansible/modules/network/avi/avi_webhook.py | Python | gpl-3.0 | 3,916 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
test_records = [
[{
"doctype": "UOM",
"uom_name": "_Test UOM",
"must_be_whole_number": 1
}],
[{
"doctype": "UOM",
"uom_name": "_Test UOM 1"
}]
] | saurabh6790/test-med-app | setup/doctype/uom/test_uom.py | Python | agpl-3.0 | 289 |
#!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | loretoparisi/nupic | tests/unit/nupic/research/sp_learn_inference_test.py | Python | agpl-3.0 | 5,473 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models, tools
class HrHolidaysRemainingLeavesUser(models.Model):
_name = "hr.holidays.remaining.leaves.user"
_description = "Total holidays by type"
_auto = False
name = field... | chienlieu2017/it_management | odoo/addons/hr_holidays/report/hr_holidays_leaves_report.py | Python | gpl-3.0 | 1,428 |
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsLocalDefaultSettings.
.. note:: 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
(at your option) any later versio... | pblottiere/QGIS | tests/src/python/test_qgslocaldefaultsettings.py | Python | gpl-2.0 | 2,306 |
#
# formatter.py
#
# Convert parsed content blocks to a structured document (library file).
#
# Copyright 2002-2016 by
# David Turner.
#
# This file is part of the FreeType project, and may only be used,
# modified, and distributed under the terms of the FreeType project
# license, LICENSE.TXT. By continuing ... | lophyel/mupdf-for-mac | thirdparty/freetype/src/tools/docmaker/formatter.py | Python | gpl-3.0 | 6,195 |
from django.test import TestCase
from django.conf import settings
import mock
from oscar.apps.basket import forms
from oscar.test import factories
class TestBasketLineForm(TestCase):
def setUp(self):
self.basket = factories.create_basket()
self.line = self.basket.all_lines()[0]
def mock_ava... | ahmetdaglarbas/e-commerce | tests/integration/basket/form_tests.py | Python | bsd-3-clause | 3,927 |
from django.db.models import CharField, Value
from django.db.models.functions import Left, Lower
from django.test import TestCase
from ..models import Author
class LeftTests(TestCase):
@classmethod
def setUpTestData(cls):
Author.objects.create(name='John Smith', alias='smithj')
Author.objects... | nesdis/djongo | tests/django_tests/tests/v22/tests/db_functions/text/test_left.py | Python | agpl-3.0 | 1,219 |
#!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# This module 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 late... | haad/ansible-modules-core | cloud/openstack/os_client_config.py | Python | gpl-3.0 | 2,339 |
from twisted.internet.protocol import ServerFactory, Protocol, ClientCreator
from twisted.internet.defer import DeferredList, maybeDeferred, Deferred
from twisted.trial import unittest
from twisted.internet import reactor
from twisted.python import log
from zope.interface.verify import verifyClass
class StopStartRead... | sorenh/cc | vendor/Twisted-10.0.0/twisted/internet/test/test_iocp.py | Python | apache-2.0 | 3,873 |
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | alxgu/ansible | lib/ansible/module_utils/network/voss/voss.py | Python | gpl-3.0 | 7,726 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Taneli Leppä <taneli@crasman.fi>
#
# This file is part of Ansible (sort of)
#
# Ansible 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 o... | yfauser/ansible-modules-extras | system/gluster_volume.py | Python | gpl-3.0 | 14,777 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Project: Create a Proxy Class
#
# In this assignment, create a proxy class (one is started for you
# below). You should be able to initialize the proxy object with any
# object. Any attributes called on the proxy object should be forwarded
# to the target object. As e... | Krakn/learning | src/python/python_koans/python2/about_proxy_object_project.py | Python | isc | 4,194 |
#!/usr/bin/env python
def main():
return 0
if __name__ == '__main__': main()
var = 'hi'
var2 = 'hi' # blah = blah
| R1dO/geany | tests/ctags/test.py | Python | gpl-2.0 | 120 |
# -*- coding: utf-8 -*-
"""
werkzeug.testsuite.exceptions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The tests for the exception classes.
TODO:
- This is undertested. HTML is never checked
:copyright: (c) 2013 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
fro... | l8orre/nxtBridge | werkzeug/testsuite/exceptions.py | Python | mit | 3,325 |
import sys
from django.contrib.auth.models import Group
from django.template import Context, Engine, TemplateSyntaxError
from django.template.base import UNKNOWN_SOURCE
from django.test import SimpleTestCase, override_settings
from django.urls import NoReverseMatch
from django.utils import translation
class Template... | edmorley/django | tests/template_tests/tests.py | Python | bsd-3-clause | 6,410 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("migrations", "0001_initial"),
]
operations = [
migrations.DeleteModel("Tribble"),
migrations.RemoveField("Author", "silly_field"),
migrations.AddField("Author", "rating",... | edmorley/django | tests/migrations/test_migrations_no_changes/0002_second.py | Python | bsd-3-clause | 609 |
""" Utility functions related to HTTP requests """
import re
from django.conf import settings
from microsite_configuration import microsite
from opaque_keys import InvalidKeyError
from opaque_keys.edx.locations import SlashSeparatedCourseKey
COURSE_REGEX = re.compile(r'^.*?/courses/{}'.format(settings.COURSE_ID_PAT... | Semi-global/edx-platform | common/djangoapps/util/request.py | Python | agpl-3.0 | 1,285 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# sparkonda documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# 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
# a... | moutai/sparkonda | docs/conf.py | Python | isc | 8,343 |
import json, urllib, requests
from flask import Flask, session, redirect, request, url_for
app = Flask(__name__)
app.secret_key = 'insecureappsecretkey'
app.debug = True
# NOTE - these endpoints SHOULD be using HTTPS (for communication with the CAS server)
CAS_ADDR = 'http://localhost:3000/'
SERVICE_URL = 'http://loc... | t3hmrman/casgo | reference_apps/python/reference_app.py | Python | isc | 1,929 |
print("\n###############################################")
print("##### 5.5.0 - Verbose Regular Expressions #####")
print("###############################################\n")
print("import re")
import re
print()
print("\
pattern = '''\n\
^ # beginning of string\n\
M{0,3} # thous... | Krakn/learning | src/python/dive_input_python_3/chapters/ch05/ch05sc05.py | Python | isc | 1,857 |
'''
Created on Jul 22, 2011
@author: Rio
'''
from mclevelbase import *
import tempfile
from collections import defaultdict
import materials
log = logging.getLogger(__name__)
warn, error, info, debug = log.warn, log.error, log.info, log.debug
def computeChunkHeightMap(materials, blocks, HeightMap = None):
"""Co... | codewarrior0/pymclevel | level.py | Python | isc | 28,376 |
# -*- coding: utf-8 -*-
import logging
from transitions import Machine, logger
from .states import LogInState, SelectionState, ExitState
logger.setLevel(logging.INFO)
logging.basicConfig(filename='./testmanager.log', level=logging.DEBUG)
class Test_Manager(Machine):
def __init__(self):
self.login = Lo... | trottmpq/test_manager | test_manager/test_manager.py | Python | mit | 1,111 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import codecs
import os
import re
from setuptools import find_packages, setup
def read(*parts):
"""
Read file content and return it as string.
"""
filename = os.path.join(os.path.dirname(__file__), *parts)
with codecs.open(filename, encoding='utf-8') ... | dreadatour/tarantool-deque-python | setup.py | Python | mit | 1,654 |
import requests
from io import BytesIO
from urllib.parse import urlparse
from django.conf import settings
from django.core.files.storage import DefaultStorage
from django.http import Http404
from django.http import HttpResponse
from django.views.decorators.http import require_safe
def process_options(options):
p... | g3rd/django-rszio | rszio/views.py | Python | mit | 2,110 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Blueprint
from flask import jsonify
from flask import redirect
from flask import render_template
from flask import request
from flask import url_for
from flask.ext.login import login_required
import json
from oldhawaii_metadata.apps.api import digital_ass... | oldhawaii/oldhawaii-metadata | www/oldhawaii_metadata/apps/digital_assets/views.py | Python | mit | 2,440 |
"""
Test specific settings.
"""
import os
import logging
if os.getenv('TRAVIS') is None:
from django_envie.workroom import convertfiletovars
convertfiletovars()
from .base import *
logging.disable(logging.CRITICAL)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME... | andela-uawili/django-bucketlist-application | bucketlist/bucketlist/settings/testing.py | Python | mit | 382 |
"""
This module contains the functions necessary to extract data from text files
and put it into numpy arrays to be usable by other functions.
"""
import os
import re
import numpy as np
class IO():
"""An object that points to a desired file location and either extracts data
from an existing text file, or wri... | tristanbrown/whaler | whaler/dataprep.py | Python | mit | 5,735 |
from django.test import TestCase
from bluebox.converters import Sanitizer
class BlueboxSanitizerTestCase(TestCase):
def test_strip_tags(self):
test_html = ('<div><p>HelloWorld<b>boldtext</b></p>'
'<img src="http://bukk.it/l2internet2.gif" /></div>')
expected_output = "<div><p... | duner/django-bluebox | bluebox/tests/test_converter.py | Python | mit | 1,289 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2015 by Gaik Tamazian
# gaik (dot) tamazian (at) gmail (dot) com
import chromosomer.cli
import os
import shutil
import sys
import tempfile
import unittest
class TestFragmentSimulator(unittest.TestCase):
def setUp(self):
self.__output_dir = te... | gtamazian/Chromosomer | tests/test_simulator.py | Python | mit | 731 |
#!/usr/bin/env python
import sys
import six
import agate
try:
from mock import patch
except ImportError:
from unittest.mock import patch
from csvkit.utilities.csvstat import CSVStat, launch_new_instance
from tests.utils import CSVKitTestCase, ColumnsTests, EmptyFileTests, NamesTests
class TestCSVStat(CSV... | onyxfish/csvkit | tests/test_utilities/test_csvstat.py | Python | mit | 3,548 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'profilerdock.ui'
#
# Created: Tue Apr 15 11:26:58 2014
# by: pyside-uic 0.2.15 running on PySide 1.2.1
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, QtGui
class Ui_profilerdock(object):
def se... | Vavius/moai-ide | editor/layout/profilerdock_ui.py | Python | mit | 5,122 |
#!/usr/bin/env python
"""Installer for gemini: a lightweight db framework for disease and population genetics.
https://github.com/arq5x/gemini
Handles installation of:
- Required third party software
- Required Python libraries
- Gemini application
- Associated data files
Requires: Python 2.7, git, and compilers (g... | bgruening/gemini-versioned-install | gemini_install_0.9.1.py | Python | mit | 13,871 |
import click
from ghutil.showing import print_json
from ghutil.types import Repository
@click.command()
@Repository.option(
"-R",
"--repo",
"--repository",
"repo",
help="Repository to which the milestones belong",
)
@click.option("-v", "--verbose", is_flag=True, help="Show full response body")
@cl... | jwodder/ghutil | src/ghutil/cli/milestone/show.py | Python | mit | 480 |