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 |
|---|---|---|---|---|---|
from newway.thecode import *
def test_the_function():
output = powerful_function_and_new_too()
assert output == 2, "Doh! Got %s instead" % (output)
| gregorynicholas/paver | docs/samples/started/newway/newway/tests/test_thecode.py | Python | bsd-3-clause | 161 |
# Copyright 2014 the V8 project 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 os
from testrunner.local import commands
from testrunner.local import testsuite
from testrunner.local import utils
from testrunner.objects import t... | kingland/go-v8 | v8-3.28/test/fuzz-natives/testcfg.py | Python | mit | 1,755 |
from zope.interface import implements
from twisted.trial import unittest
from twisted.internet import defer
from twisted.python.failure import Failure
from foolscap.api import fireEventually
from allmydata import uri
from allmydata.immutable import encode, upload, checker
from allmydata.util import hashutil
from allmyd... | pombredanne/tahoe-lafs | src/allmydata/test/test_encode.py | Python | gpl-2.0 | 15,824 |
#!/usr/bin/env python
# coding=utf-8
"""
Site: http://www.beebeeto.com/
Framework: https://github.com/n0tr00t/Beebeeto-framework
"""
import re
import urllib2
from baseframe import BaseFrame
class MyPoc(BaseFrame):
poc_info = {
# poc相关信息
'poc': {
'id': 'poc-2014-0005', # 由Beebeeto官方... | forbidden-ali/Beebeeto-framework | demo/bonfire_0_7_info_disclosure.py | Python | gpl-2.0 | 2,380 |
from base import *
CONF = """
vserver!1!rule!820!match = directory
vserver!1!rule!820!match!directory = /auth_header
vserver!1!rule!820!match!final = 0
vserver!1!rule!820!auth = plain
vserver!1!rule!820!auth = plain
vserver!1!rule!820!auth!methods = basic
vserver!1!rule!820!auth!realm = Test
vserver!1!rule!820!auth!pa... | lmcro/webserver | qa/082-Auth-header.py | Python | gpl-2.0 | 769 |
# Copyright (c) 2018 Cisco and/or its affiliates.
#
# 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 v... | anryko/ansible | lib/ansible/plugins/httpapi/restconf.py | Python | gpl-3.0 | 2,790 |
# We can test part of the module without zlib.
try:
import zlib
except ImportError:
zlib = None
import os
import io
import sys
import time
import struct
import zipfile
import unittest
from StringIO import StringIO
from tempfile import TemporaryFile
from random import randint, random
from unittest import skipU... | jlspyaozhongkai/Uter | third_party_build/Python-2.7.9/lib/python2.7/test/test_zipfile.py | Python | gpl-3.0 | 66,876 |
# 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... | tornadomeet/mxnet | python/mxnet/gluon/data/dataloader.py | Python | apache-2.0 | 8,412 |
#
# 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
# ... | kwrobert/heat-templates | tests/software_config/test_heat_config_notify.py | Python | apache-2.0 | 6,515 |
from __future__ import with_statement
import sys
from nose.tools import assert_raises
import textwrap
from webassets.env import Environment
from webassets.utils import StringIO
from webassets.bundle import Bundle
from webassets.loaders import PythonLoader, YAMLLoader, LoaderError
from nose import SkipTest
class TestY... | john2x/webassets | tests/test_loaders.py | Python | bsd-2-clause | 6,249 |
#Copyright ReportLab Europe Ltd. 2000-2004
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/tools/docco/yaml2pdf.py
# yaml2pdf - turns stuff in Yet Another Markup Language
# into PDF documents. Very crude - it assumes a
# doc template and sty... | makinacorpus/reportlab-ecomobile | tools/docco/yaml2pdf.py | Python | bsd-3-clause | 3,449 |
'''tzinfo timezone information for America/Argentina/Cordoba.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Cordoba(DstTzInfo):
'''America/Argentina/Cordoba timezone definition. See datetime.tzinfo for details'''
zone =... | newvem/pytz | pytz/zoneinfo/America/Argentina/Cordoba.py | Python | mit | 2,753 |
'''
This illustrates the NonUniformImage class, which still needs
an axes method interface; either a separate interface, or a
generalization of imshow.
'''
from matplotlib.pyplot import figure, show
import numpy as np
from matplotlib.image import NonUniformImage
from matplotlib import cm
interp='nearest'
x = np.lins... | lthurlow/Network-Grapher | proj/external/matplotlib-1.2.1/lib/mpl_examples/pylab_examples/image_nonuniform.py | Python | mit | 1,488 |
from .state import EOF
from .tokens import TokenEof
from .tokens_base import TOKEN_COMMAND_SET_LOCAL
from .tokens_base import TokenOfCommand
from Vintageous import ex
@ex.command('setlocal', 'setlocal')
class TokenSet(TokenOfCommand):
def __init__(self, params, *args, **kwargs):
super().__init__(params,
... | zhangtuoparis13/Vintageous | ex/parser/scanner_command_set_local.py | Python | mit | 963 |
# 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... | reminisce/mxnet | tests/python/unittest/test_contrib_svrg_optimizer.py | Python | apache-2.0 | 3,499 |
# 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... | himanshu-setia/keystone | keystone/version/routers.py | Python | apache-2.0 | 2,825 |
from celery.task import task
from django.db.models import get_model
@task(name='c.unittest.SomeAppTask')
def SomeAppTask(**kwargs):
return 42
@task(name='c.unittest.SomeModelTask')
def SomeModelTask(pk):
model = get_model('someapp', 'Thing')
thing = model.objects.get(pk=pk)
return thing.name
| pexip/os-django-celery | tests/someapp/tasks.py | Python | bsd-3-clause | 314 |
#!/usr/bin/env python3
"""
Purpose
This script is a small wrapper around the abi-compliance-checker and
abi-dumper tools, applying them to compare the ABI and API of the library
files from two different Git revisions within an Mbed TLS repository.
The results of the comparison are either formatted as HTML and stored a... | openthread/openthread | third_party/mbedtls/repo/scripts/abi_check.py | Python | bsd-3-clause | 18,120 |
#! /usr/bin/env python2.7
# template.py (and other filenames)
# By Max Eliaser (max.eliaser@intel.com)
# Copyright (c) 2014 Intel Corp.
# 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 with... | wwright2/dcim3-angstrom1 | sources/openembedded-core/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/template.py | Python | mit | 4,545 |
import sys, string
import traceback
from win32com.axdebug import axdebug
from win32com.client.util import Enumerator
import pythoncom
def DumpDebugApplicationNode(node, level = 0):
# Recursive dump of a DebugApplicationNode
spacer = " " * level
for desc, attr in [("Node Name", axdebug.DOCUMENTNAMETYPE_APPN... | sserrot/champion_relationships | venv/Lib/site-packages/win32comext/axdebug/dump.py | Python | mit | 1,814 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Joseph Callen <jcallen () csc.com>
# Copyright: (c) 2018, Ansible Project
# 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
... | hryamzik/ansible | lib/ansible/modules/cloud/vmware/vmware_target_canonical_facts.py | Python | gpl-3.0 | 6,166 |
#!/bin/false
# This file is part of Espruino, a JavaScript interpreter for Microcontrollers
#
# Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk>
#
# 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 h... | dptechnics/Espruino | boards/CARAMBOLA.py | Python | mpl-2.0 | 1,706 |
#!/usr/bin/python
# NOTE: this file is taken from the Python source distribution
# It can be found under Tools/gdb/libpython.py. It is shipped with Cython
# because it's not installed as a python module, and because changes are only
# merged into new python versions (v3.2+).
'''
From gdb 7 onwards, gdb's build can be... | devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/Cython/Debugger/libpython.py | Python | agpl-3.0 | 83,603 |
"""
Tests for the course completion helper functions.
"""
from datetime import datetime
from badges.events import course_complete
from student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
class ... | pepeportela/edx-platform | lms/djangoapps/badges/events/tests/test_course_complete.py | Python | agpl-3.0 | 2,548 |
# coding=utf-8
# Copyright 2015 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)
from collections imp... | cevaris/pants | tests/python/pants_test/backend/jvm/tasks/jvm_compile/java/test_java_compile_settings_partitioning.py | Python | apache-2.0 | 11,138 |
"""Testing for Spectral Clustering methods"""
from __future__ import division
import numpy as np
from scipy import sparse
import pytest
from sklearn.externals.six.moves import cPickle
from sklearn.utils import check_random_state
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert... | vortex-ape/scikit-learn | sklearn/cluster/tests/test_spectral.py | Python | bsd-3-clause | 7,970 |
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# 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, modi... | palladius/gcloud | packages/gsutil/boto/boto/ec2/reservedinstance.py | Python | gpl-3.0 | 8,480 |
# coding=UTF-8
"""
Tests courseware views.py
"""
import unittest
from datetime import datetime
from mock import MagicMock, patch, create_autospec
from pytz import UTC
from django.test import TestCase
from django.http import Http404
from django.test.utils import override_settings
from django.contrib.auth.models import... | dsajkl/reqiop | lms/djangoapps/courseware/tests/test_views.py | Python | agpl-3.0 | 24,805 |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_duration,
)
class RtlNlIE(InfoExtractor):
IE_NAME = 'rtl.nl'
IE_DESC = 'rtl.nl and rtlxl.nl'
_VALID_URL = r'''(?x)
https?://(www\.)?
(?:
r... | marxin/youtube-dl | youtube_dl/extractor/rtlnl.py | Python | unlicense | 4,005 |
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
OUT = WallLocationLine.CoreInterior | andydandy74/ClockworkForDynamo | nodes/0.9.x/python/WallLocationLine.CoreInterior.py | Python | mit | 108 |
__author__ = 'cthiebault'
| apruden/opal | opal-python-client/src/main/python/__init__.py | Python | gpl-3.0 | 26 |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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,... | eXistenZNL/SickRage | sickbeard/metadata/kodi.py | Python | gpl-3.0 | 4,562 |
import os
import json
import logging
import logging.handlers
class CallbackModule(object):
"""
logs ansible-playbook and ansible runs to a syslog server in json format
make sure you have in ansible.cfg:
callback_plugins = <path_to_callback_plugins_folder>
and put the plugin in <path_to_call... | saada/ansible | plugins/callbacks/syslog_json.py | Python | gpl-3.0 | 2,804 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.
#
... | mkrupcale/ansible | lib/ansible/modules/cloud/amazon/ec2_group.py | Python | gpl-3.0 | 18,413 |
import json
from lxml import etree
from ..exceptions import except_orm
from ..models import (
MetaModel,
BaseModel,
Model, TransientModel, AbstractModel,
MAGIC_COLUMNS,
LOG_ACCESS_COLUMNS,
)
from odoo.tools.safe_eval import safe_eval
# extra definitions for backward compatibility
browse_record_l... | hip-odoo/odoo | odoo/osv/orm.py | Python | agpl-3.0 | 6,191 |
#!/usr/bin/env python
# coding: utf-8
# Copyright 2017 Google 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... | HubSpot/vitess | test/vtgate_utils_test.py | Python | apache-2.0 | 2,924 |
#
# Copyright (c) 2009-2015 Tom Keffer <tkeffer@gmail.com>
#
# See the file LICENSE.txt for your full rights.
#
"""
Package of user extensions to weewx.
This package is for your use. Generally, extensions to weewx go here.
Any modules you add to it will not be touched by the upgrade process.
"""
| tony-rasskazov/meteo | weewx/bin/user/__init__.py | Python | mit | 306 |
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# $Id: xmlrpc.py 428 2009-07-14 03:48:07Z tobias $
# ----------------------------------------------------------------------------
#
# Copyright (C) 2008-2009 Caktus Consulting Group, LLC
#
# This file is part of... | coassets/initial-d | sample_project/external_apps/crm/xmlrpc.py | Python | gpl-2.0 | 3,740 |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from ggplot import *
gg = ggplot(mtcars, aes("wt", "mpg")) + geom_point()
g2 = gg + geom_text(aes(label="name"), data=mtcars[mtcars.cyl == 6])
g2.draw()
#print(g2) | kmather73/ggplot | tests/test_geom_with_data.py | Python | bsd-2-clause | 272 |
# -*- coding: utf-8 -*-
"""
A BIP0032-style hierarchical wallet.
Implement a BIP0032-style hierarchical wallet which can create public
or private wallet keys. Each key can create many child nodes. Each node
has a wallet key and a corresponding private & public key, which can
be used to generate Bitcoin addresses or WI... | thirdkey-solutions/pycoin | pycoin/key/BIP32Node.py | Python | mit | 11,795 |
"""
`SQLite`_ database specific implementations of changeset classes.
.. _`SQLite`: http://www.sqlite.org/
"""
try: # Python 3
from collections import MutableMapping as DictMixin
except ImportError: # Python 2
from UserDict import DictMixin
from copy import copy
import re
from sqlalchemy.databases imp... | VasuAgrawal/tartanHacks2015 | site/flask/lib/python2.7/site-packages/migrate/changeset/databases/sqlite.py | Python | mit | 7,218 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
# MySQL Connector/Python is licensed under the terms of the GPLv2
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most... | mrquim/mrquimrepo | script.module.myconnpy/lib/examples/dates.py | Python | gpl-2.0 | 3,561 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
# ERPNext - web based ERP (http://erpnext.com)
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, flt, get... | YuriGural/erpnext | erpnext/stock/doctype/material_request/material_request.py | Python | gpl-3.0 | 14,608 |
# ***************************************************************************
# * Copyright (c) 2016 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... | sanguinariojoe/FreeCAD | src/Mod/Fem/femviewprovider/view_constraint_selfweight.py | Python | lgpl-2.1 | 2,188 |
#
# 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... | pgandhi999/spark | python/pyspark/mllib/clustering.py | Python | apache-2.0 | 36,857 |
# Copyright 2013 IBM Corp.
#
# 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 t... | silenceli/nova | nova/tests/functional/v3/test_suspend_server.py | Python | apache-2.0 | 1,600 |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | jbedorf/tensorflow | tensorflow/python/tools/api/generator/create_python_api_test.py | Python | apache-2.0 | 4,092 |
#!/usr/bin/env python
# Copyright 2010-2014 RethinkDB, all rights reserved.
from __future__ import print_function
import os, sys, time
startTime = time.time()
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, 'common')))
import driver, rdb_workload_common, scenario_common, util... | matthaywardwebdesign/rethinkdb | test/scenarios/rebalance.py | Python | agpl-3.0 | 3,786 |
##
## Copyright (c) 2010 The WebM project authors. All Rights Reserved.
##
## Use of this source code is governed by a BSD-style license
## that can be found in the LICENSE file in the root of the source
## tree. An additional intellectual property rights grant can be found
## in the file PATENTS. All contributin... | LewisHaley/stb-tester | tests/webminspector/ebml_header.py | Python | lgpl-2.1 | 10,457 |
# ==================================================================================================
# Copyright 2011 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | Yasumoto/commons | tests/python/twitter/common/quantity/test_parsing.py | Python | apache-2.0 | 1,695 |
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Matti Hamalainen <msh@nmr.mgh.harvard.edu>
# Denis Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
from copy import deepcopy
import numpy as np
from .constants import FIFF
from .tag import find_tag, has_tag, r... | rajegannathan/grasp-lift-eeg-cat-dog-solution-updated | python-packages/mne-python-0.10/mne/io/ctf.py | Python | bsd-3-clause | 8,024 |
"""Support for D-Link W215 smart switch."""
from datetime import timedelta
import logging
import urllib
from pyW215.pyW215 import SmartPlug
import voluptuous as vol
from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchEntity
from homeassistant.const import (
ATTR_TEMPERATURE,
CONF_HOST,
CONF... | nkgilley/home-assistant | homeassistant/components/dlink/switch.py | Python | apache-2.0 | 4,948 |
# Copyright 2012 Nebula, 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 agree... | tanglei528/nova | nova/tests/api/openstack/compute/contrib/test_flavor_swap.py | Python | apache-2.0 | 3,421 |
# Copyright 2013-2014 MongoDB, 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 writin... | thelok/mongo-connector | tests/test_mongo.py | Python | apache-2.0 | 10,256 |
from pulp.common.config import parse_bool
from pulp.server.config import config as pulp_conf
from pulp.bindings.server import PulpConnection
from pulp.bindings.bindings import Bindings
from pulp_node.config import read_config
def parent_bindings(host, port=443):
"""
Get a pulp bindings object for the parent ... | beav/pulp | nodes/common/pulp_node/resources.py | Python | gpl-2.0 | 1,788 |
########################################################################
#
# (C) 2015, Brian Coca <bcoca@ansible.com>
#
# 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... | azaghal/ansible | lib/ansible/galaxy/role.py | Python | gpl-3.0 | 17,254 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'PushSubscription'
db.create_table('push_pushsubscription', (
('id', self.gf('d... | AlphaCluster/NewsBlur | apps/push/migrations/0001_initial.py | Python | mit | 5,913 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2009 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | davidfraser/genshi | genshi/__init__.py | Python | bsd-3-clause | 935 |
import numpy as np
from numpy.testing import assert_equal, assert_raises
from skimage import img_as_int, img_as_float, \
img_as_uint, img_as_ubyte
from skimage.util.dtype import convert
from skimage._shared._warnings import expected_warnings
dtype_range = {np.uint8: (0, 255),
np.uin... | michaelaye/scikit-image | skimage/util/tests/test_dtype.py | Python | bsd-3-clause | 3,486 |
from distutils.core import setup
from Cython.Build import cythonize
from distutils.extension import Extension
import numpy as np
# To compile and install locally run "python setup.py build_ext --inplace"
# To install library to Python site-packages run "python setup.py build_ext install"
ext_modules = [
Extension... | deepakkumar1984/sia-cog | vis/rcnn/pycocotools/setup.py | Python | mit | 579 |
import unittest
from django.db import connection, migrations, models, transaction
from django.db.migrations.migration import Migration
from django.db.migrations.operations import CreateModel
from django.db.migrations.state import ModelState, ProjectState
from django.db.models.fields import NOT_PROVIDED
from django.db.... | mattseymour/django | tests/migrations/test_operations.py | Python | bsd-3-clause | 117,318 |
#!/usr/bin/env python3
#
# pyconsole-vte: Example program showing use of console functions
# in the lxc python binding
#
# (C) Copyright Oracle. 2013
#
# Authors:
# Dwight Engen <dwight.engen@oracle.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the ... | fwilson42/lxc | src/python-lxc/examples/pyconsole-vte.py | Python | lgpl-2.1 | 2,202 |
# Copyright 2008-2015 Nokia Solutions and Networks
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | caio2k/RIDE | src/robotide/lib/robot/output/console/__init__.py | Python | apache-2.0 | 1,337 |
# coding=utf-8
# Copyright 2015 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 unittest
fro... | sameerparekh/pants | tests/python/pants_test/tasks/test_execution_graph.py | Python | apache-2.0 | 10,773 |
"""
Abstract base class for the various polynomial Classes.
The ABCPolyBase class provides the methods needed to implement the common API
for the various polynomial classes. It operates as a mixin, but uses the
abc module from the stdlib, hence it is only available for Python >= 2.6.
"""
from __future__ import divisi... | b-carter/numpy | numpy/polynomial/_polybase.py | Python | bsd-3-clause | 30,092 |
# Copyright (c) 2011 The Chromium OS Authors.
#
# SPDX-License-Identifier: GPL-2.0+
#
import collections
import command
import gitutil
import os
import re
import sys
import terminal
def FindCheckPatch():
top_level = gitutil.GetTopLevel()
try_list = [
os.getcwd(),
os.path.join(os.getcwd(), '..'... | mdxy2010/forlinux-ok6410 | u-boot15/tools/patman/checkpatch.py | Python | gpl-2.0 | 6,127 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
RenderingStyles.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***********************... | dracos/QGIS | python/plugins/processing/gui/RenderingStyles.py | Python | gpl-2.0 | 2,692 |
#!/usr/bin/python
# Copyright (c) 2016 Hewlett-Packard Enterprise
# 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',
'stat... | valentin-krasontovitsch/ansible | lib/ansible/modules/cloud/openstack/os_zone.py | Python | gpl-3.0 | 6,554 |
"""
Tests for course_info
"""
import ddt
from django.conf import settings
from xmodule.html_module import CourseInfoModule
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.xml_importer import import_course_from_xml
from ..testutils import (
... | xuxiao19910803/edx-platform | lms/djangoapps/mobile_api/course_info/tests.py | Python | agpl-3.0 | 5,270 |
# Copyright 2012-2015 Spotify AB
#
# 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, ... | ChrisBeaumont/luigi | test/contrib/redshift_test.py | Python | apache-2.0 | 4,471 |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | vmanoria/bluemix-hue-filebrowser | hue-3.8.1-bluemix/apps/sqoop/src/sqoop/api/exception.py | Python | gpl-2.0 | 1,529 |
# 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 ... | samsu/neutron | plugins/ml2/drivers/mechanism_ncs.py | Python | apache-2.0 | 6,920 |
from flask import Flask
app = Flask(__name__)
<error descr="Unresolved reference 'request'"><caret>request</error> | smmribeiro/intellij-community | python/testData/quickFixes/PyAddImportQuickFixTest/reexportedName/main.py | Python | apache-2.0 | 116 |
# -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: PopMenu.py 36560 2004-07-18 06:16:08Z tim_one $
#
# Tix Demostration Program
#
# This sample program is structured in such a way so that it can be
# executed from the Tix demo program "tixwidgets.py": it must have a
# procedur... | xbmc/xbmc-antiquated | xbmc/lib/libPython/Python/Demo/tix/samples/PopMenu.py | Python | gpl-2.0 | 2,151 |
#!/usr/bin/python
#
# This is a 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.
#
# This Ansible library is distributed in the hope that i... | geerlingguy/ansible-modules-extras | cloud/amazon/ec2_eni.py | Python | gpl-3.0 | 14,246 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | chand3040/sree_odoo | openerp/addons/event_sale/event_sale.py | Python | agpl-3.0 | 13,597 |
#!/usr/bin/python
# Copyright: Ansible Project
# 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'],
... | hryamzik/ansible | lib/ansible/modules/cloud/linode/linode.py | Python | gpl-3.0 | 24,269 |
#!/usr/bin/python
# Copyright (C) International Business Machines Corp., 2005
# Author: Li Ge <lge@us.ibm.com>
# Negative Test: attempt list of non-existent domain
... | flexiant/xen | tools/xm-test/tests/block-list/05_block-list_nonexist_neg.py | Python | gpl-2.0 | 918 |
# Copyright 2013, Big Switch Networks, 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 applicabl... | FNST-OpenStack/horizon | openstack_dashboard/dashboards/project/routers/extensions/routerrules/tables.py | Python | apache-2.0 | 2,806 |
#!/usr/bin/env python
# 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.
"""Mutational ClusterFuzz fuzzer. A pre-built corpus of ipcdump files has
to be uploaded to ClusterFuzz along with this script. As chro... | Jonekee/chromium.src | tools/ipc_fuzzer/mutate/ipc_fuzzer_mut.py | Python | bsd-3-clause | 2,990 |
# (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... | aperigault/ansible | test/units/modules/network/fortimanager/test_fmgr_provisioning.py | Python | gpl-3.0 | 2,942 |
import unittest
from xmodule import templates
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, TEST_DATA_SPLIT_MODULESTORE
from xmodule.course_module import CourseDescriptor... | ahmadiga/min_edx | cms/djangoapps/contentstore/tests/test_crud.py | Python | agpl-3.0 | 6,006 |
# 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.
"""Xcode project file generator.
This module is both an Xcode project file generator and a documentation of the
Xcode project file format. Knowledge of the proje... | mateusz880/mtasa-blue | vendor/google-breakpad/src/tools/gyp/pylib/gyp/xcodeproj_file.py | Python | gpl-3.0 | 118,710 |
def array(p_object, dtype=None, copy=True, order=None, subok=False, ndmin=0): # real signature unknown; restored from __doc__
"""
array(object, dtype=None, copy=True, order=None, subok=False, ndmin=0)
Create an array.
Parameters
----------
object : array_like
An arr... | idea4bsd/idea4bsd | python/testData/types/NumpyArrayType/numpy/core/multiarray.py | Python | apache-2.0 | 7,955 |
# (c) 2013, Bradley Young <young.bradley@gmail.com>
#
# 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... | kaarolch/ansible | lib/ansible/plugins/lookup/cartesian.py | Python | gpl-3.0 | 1,841 |
#!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... | rhuss/gofabric8 | vendor/k8s.io/kubernetes/hack/verify-flags-underscore.py | Python | apache-2.0 | 8,826 |
class A:
def method(self): pass
def test(self): self.method() | idea4bsd/idea4bsd | python/testData/completion/selfMethod.after.py | Python | apache-2.0 | 65 |
# -*- coding: utf-8 -*-
import unittest
from nose.tools import * # noqa (PEP8 asserts)
from flask import Flask
from webtest_plus import TestApp
from framework.exceptions import HTTPError
from framework.routing import json_renderer, process_rules, Rule
def error_view():
raise HTTPError(400)
def error_with_msg()... | ticklemepierce/osf.io | tests/framework_tests/test_routing.py | Python | apache-2.0 | 1,317 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Proposal.created'
db.add_column('proposal_proposal', 'created',
self.g... | arscariosus/django-mango | mango/apps/proposal/migrations/0002_auto__add_field_proposal_created__add_field_proposal_updated.py | Python | isc | 2,889 |
print("\n###########################")
print("##### 2.5.0 - Tuples: #####")
print("###########################\n")
a_tuple = ("a", "b", "mpilgrim", "z", "example")
print(a_tuple)
print("a_tuple[0] = {0}".format(a_tuple[0]))
print("a_tuple[-1] = {0}".format(a_tuple[-1]))
print("a_tuple[1:3] = {0}".format(a_tuple[1:3])... | Krakn/learning | src/python/dive_input_python_3/chapters/ch02/ch02sc05.py | Python | isc | 1,696 |
#!/usr/bin/env python3
# Goshu IRC Bot
# written by Daniel Oaks <daniel@danieloaks.net>
# licensed under the ISC license
from gbot.modules import Module
from gbot.users import USER_LEVEL_ADMIN
class list_module(Module):
"""Provides help and command listings to users."""
core = True
def help_listener(sel... | DanielOaks/goshu | modules/list_module.py | Python | isc | 7,390 |
#!/usr/bin/env python
# DickServ IRC Bot - Developed by acidvegas in Python (https://acid.vegas/dickserv)
# dictionary.py
import httplib
import functions
def define(word):
source = httplib.get_source('http://www.merriam-webster.com/dictionary/' + word.replace(' ', '%20'))
results = functions.between(source, f'<met... | acidvegas/dickserv | dickserv/modules/dictionary.py | Python | isc | 669 |
# -*- coding: utf-8 -*-
# EForge project management system, Copyright © 2010, Element43
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWA... | oshepherd/eforge | eforge/vcs/interface.py | Python | isc | 9,374 |
import os
from distutils.core import setup
from setuptools import find_packages
import transtool
setup(
name='django-transtool',
version=transtool.__version__,
description='Make translating your django project easier.',
long_description=open(os.path.join(os.path.dirname(__file__), 'README.rst')).read(... | liminspace/django-transtool | setup.py | Python | mit | 1,423 |
from __future__ import unicode_literals
import swapper
from factory import (
Sequence,
SubFactory,
)
from factory.django import DjangoModelFactory
from accelerator.tests.factories import NewsletterFactory
from accelerator_abstract.models.base_section import INCLUDE_FOR_CHOICES
Section = swapper.load_model('a... | masschallenge/django-accelerator | accelerator/tests/factories/section_factory.py | Python | mit | 683 |
import uuid
from contextlib import suppress
from flask import redirect, render_template, url_for
from app import service_api_client
from app.main import main
from app.main.forms import SearchByNameForm
from app.utils.user import user_is_platform_admin
@main.route("/find-services-by-name", methods=['GET', 'POST'])
@... | alphagov/notifications-admin | app/main/views/find_services.py | Python | mit | 900 |
#!flask/bin/python
from flask import Flask, jsonify
from getTrends import getTrends
app = Flask(__name__)
@app.route('/')
def get_trends():
return jsonify(getTrends())
if __name__ == '__main__':
app.run(debug=True)
| mayankkh/twitter-python-sandbox | app.py | Python | mit | 227 |
import httplib
import re
from datetime import datetime, timedelta, time
from BeautifulSoup import BeautifulSoup
from utils import split_weeks, convert_time
from basecalendar import BaseCalendar, BaseEvent, convert_type_to_description
class CourseEvent(BaseEvent):
def __init__(self, **kwargs):
super(CourseE... | Psycojoker/geholparser | src/gehol/coursecalendar.py | Python | mit | 5,733 |
import webbrowser
import os
import re
# Styles and scripting for the page
main_page_head = '''
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Fresh Tomatoes!</title>
<!-- Bootstrap 3 -->
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.... | famunity/deep-learning-term1 | 2Programming/project2/fresh_tomatoes.py | Python | mit | 5,634 |
from marshmallow import Schema, fields, post_load
from ..resource import Resource
from collections import namedtuple
class DataSource(Resource):
"""
https://dev.chartmogul.com/v1.0/reference#data-sources
"""
_path = '/data_sources{/uuid}'
_root_key = 'data_sources'
_many = namedtuple('DataSour... | chartmogul/chartmogul-python | chartmogul/api/data_source.py | Python | mit | 651 |