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 |
|---|---|---|---|---|---|
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | jiaphuan/models | research/adversarial_text/graphs.py | Python | apache-2.0 | 24,710 |
# -*- coding: utf-8 -*-
# Copyright (c) 2018 the Pockets team, see AUTHORS.
# Licensed under the BSD License, see LICENSE for details.
"""A pocket full of useful collection tools!"""
from __future__ import absolute_import, print_function
from collections import defaultdict
from inspect import isclass
try:
from ... | smmribeiro/intellij-community | python/helpers/pockets/collections.py | Python | apache-2.0 | 13,770 |
# Copyright 2014 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... | yanheven/neutron | neutron/tests/api/test_ports.py | Python | apache-2.0 | 17,851 |
# -*- coding: utf-8 -*-
"""Deletes all feedback that have a description that's an empty
string.
"""
from __future__ import unicode_literals
import sys
from django.db import models, migrations
def delete_feedback(apps, schema_editor):
"""Delete all feedback with an empty description"""
Response = apps.get_... | staranjeet/fjord | fjord/feedback/migrations/0003_delete_empty_desc_feedback.py | Python | bsd-3-clause | 783 |
"""
This module implements the FormRequest class which is a more convenient class
(than Request) to generate Requests based on form data.
See documentation in docs/topics/request-response.rst
"""
import six
from six.moves.urllib.parse import urljoin, urlencode
import lxml.html
from parsel.selector import create_root... | Ryezhang/scrapy | scrapy/http/request/form.py | Python | bsd-3-clause | 7,658 |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
class BaseError(Exception):
"""Base error for all test runner errors."""
def __init__(self, message, is_infra_error=False):
super(BaseError, self).... | catapult-project/catapult | devil/devil/base_error.py | Python | bsd-3-clause | 747 |
import unittest
import os
import numpy
from rmgpy.tools.canteraModel import findIgnitionDelay, CanteraCondition, Cantera
from rmgpy.quantity import Quantity
import rmgpy
class CanteraTest(unittest.TestCase):
def testIgnitionDelay(self):
"""
Test that findIgnitionDelay() works.
"""
... | chatelak/RMG-Py | rmgpy/tools/canteraTest.py | Python | mit | 3,597 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-14 19:45
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('pootle_store', '0045_remov... | claudep/pootle | pootle/apps/pootle_score/migrations/0003_add_pootle_user_store_score.py | Python | gpl-3.0 | 1,645 |
from __future__ import absolute_import
import json
import logging
from pip._vendor import six
from pip._vendor.six.moves import zip_longest
from pip._internal.cli import cmdoptions
from pip._internal.cli.base_command import Command
from pip._internal.exceptions import CommandError
from pip._internal.index import Pac... | Karosuo/Linux_tools | xls_handlers/xls_sum_venv/lib/python3.6/site-packages/pip/_internal/commands/list.py | Python | gpl-3.0 | 10,150 |
# -*- coding: utf-8 -*-
"""
Code to manage fetching and storing the metadata of IdPs.
"""
import datetime
import logging
import dateutil.parser
import pytz
import requests
from celery.task import task
from lxml import etree
from onelogin.saml2.utils import OneLogin_Saml2_Utils
from requests import exceptions
from th... | angelapper/edx-platform | common/djangoapps/third_party_auth/tasks.py | Python | agpl-3.0 | 9,113 |
"""
This page is in the table of contents.
Plugin to home the tool at beginning of each layer.
The home manual page is at:
http://fabmetheus.crsndoo.com/wiki/index.php/Skeinforge_Home
==Operation==
The default 'Activate Home' checkbox is on. When it is on, the functions described below will work, when it is off, not... | nophead/Skeinforge50plus | skeinforge_application/skeinforge_plugins/craft_plugins/home.py | Python | agpl-3.0 | 8,025 |
import bleach
import json
from django import forms
from osf.models import CollectionProvider, CollectionSubmission
from admin.base.utils import get_nodelicense_choices, get_defaultlicense_choices, validate_slug
class CollectionProviderForm(forms.ModelForm):
collected_type_choices = forms.CharField(widget=forms.... | baylee-d/osf.io | admin/collection_providers/forms.py | Python | apache-2.0 | 9,406 |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | DeepThoughtTeam/tensorflow | tensorflow/python/ops/constant_op.py | Python | apache-2.0 | 7,338 |
# Copyright 2015 Mellanox Technologies, Ltd
#
# 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... | mmnelemane/neutron | neutron/tests/unit/plugins/ml2/drivers/mech_sriov/agent/extension_drivers/test_qos_driver.py | Python | apache-2.0 | 3,672 |
"""Support for ADS sensors."""
import logging
import voluptuous as vol
from homeassistant.components import ads
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_NAME, CONF_UNIT_OF_MEASUREMENT
import homeassistant.helpers.config_validation as cv
from . import CONF_ADS_F... | nkgilley/home-assistant | homeassistant/components/ads/sensor.py | Python | apache-2.0 | 2,424 |
from __future__ import absolute_import, print_function, unicode_literals
import platform
import sys
import warnings
if not (2, 7) <= sys.version_info < (3,):
sys.exit(
'ERROR: Mopidy requires Python 2.7, but found %s.' %
platform.python_version())
warnings.filterwarnings('ignore', 'could not op... | pacificIT/mopidy | mopidy/__init__.py | Python | apache-2.0 | 357 |
#!/usr/bin/env python
# This script updates the allowed address pairs in Neutron with the
# 'neutron port-update' command. This is required by Calico in OpenStack,
# otherwise BGP will not be working. We query OpenStack API directly to prevent
# installing any dependencies such as python-neutronclient.
#
# USAGE: scrip... | KaGeN101/mantl | roles/calico/files/neutron_port_update.py | Python | apache-2.0 | 4,467 |
import gen_utils
from module_base import ModuleBase
from module_mixins import NoConfigModuleMixin
import module_utils
import vtktud
class imageGradientStructureTensor(ModuleBase, NoConfigModuleMixin):
def __init__(self, module_manager):
# initialise our base class
ModuleBase.__init__(self, module_... | nagyistoce/devide | modules/user/imageGradientStructureTensor.py | Python | bsd-3-clause | 2,195 |
"""
Test basic std::weak_ptr functionality.
"""
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestSharedPtr(TestBase):
mydir = TestBase.compute_mydir(__file__)
@add_test_categories(["libc++"])
@skipIf(compiler=no_match("clang"))
... | endlessm/chromium-browser | third_party/llvm/lldb/test/API/commands/expression/import-std-module/weak_ptr/TestWeakPtrFromStdModule.py | Python | bsd-3-clause | 944 |
from unittest import TestCase
from decimal import Decimal
import datetime
import sys
if sys.version_info[0] == 3:
unicode_str = '\u2603'
else:
unicode_str = unicode('snowman')
import validictory
class TestType(TestCase):
def test_schema(self):
schema = {
"type": [
{"... | travelbird/validictory | validictory/tests/test_type.py | Python | mit | 4,940 |
from src.platform.jboss.interfaces import JMXInterface
class FPrint(JMXInterface):
def __init__(self):
super(FPrint, self).__init__()
self.version = "5.0"
| GHubgenius/clusterd | src/platform/jboss/fingerprints/JBoss5JMX.py | Python | mit | 182 |
import unittest
from test import support
import collections, random, string
import collections.abc
import gc, weakref
import pickle
class DictTest(unittest.TestCase):
def test_invalid_keyword_arguments(self):
class Custom(dict):
pass
for invalid in {1 : 2}, Custom({1 : 2}):
... | michalliu/OpenWrt-Firefly-Libraries | staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/test/test_dict.py | Python | gpl-2.0 | 30,334 |
asd = gwdata.asd(2, 1)
plot = asd.plot(figsize=(8, 6))
plot.add_frequencyseries(rayleigh, newax=True, sharex=plot.axes[0])
asdax, rayax = plot.axes
asdax.set_xlabel('')
asdax.set_xlim(30, 1500)
asdax.set_ylim(5e-24, 1e-21)
asdax.set_ylabel(r'[strain/\rtHz]')
rayax.set_ylim(0, 2)
rayax.set_ylabel('Rayleigh statistic')
a... | gwpy/gwpy.github.io | docs/0.9.0/examples/frequencyseries/rayleigh-3.py | Python | gpl-3.0 | 409 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2011 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | jerbob92/CouchPotatoServer | libs/guessit/language.py | Python | gpl-3.0 | 13,849 |
import sys
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.backends.backend_pdf import PdfPages
sys.path.append('../../')
from util import readCSVToMatrix
file_path = sys.argv[1]
file = open(file_path)
def plotErrorRibbon(x, mu, std, metric, pp):
fig, ax = plt.subplots(1)
ax.fill_between(x, mu... | SteerSuite/steersuite-rutgers | steerstats/tools/plotting/errorRibbonPlotMulti.py | Python | gpl-3.0 | 1,412 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, _
class HrEmployee(models.Model):
_inherit = 'hr.employee'
def action_open_work_entries(self):
self.ensure_one()
return {
'type': 'ir.actions.act_window',
... | jeremiahyan/odoo | addons/hr_work_entry/models/hr_employee.py | Python | gpl-3.0 | 596 |
"""M2Crypto enhancement to Python's urllib for handling
'https' url's.
Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved."""
import string, sys, urllib
from urllib import *
import SSL
import httpslib
DEFAULT_PROTOCOL='sslv23'
def open_https(self, url, data=None, ssl_context=None):
if ssl_context is ... | GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/M2Crypto/m2urllib.py | Python | agpl-3.0 | 2,124 |
"""
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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 wr... | nabilbendafi/mbed | workspace_tools/toolchains/arm.py | Python | apache-2.0 | 7,354 |
# This file is part of the Soletta Project
#
# Copyright (C) 2015 Intel Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/license... | tripzero/soletta | data/gdb/libsoletta.so-gdb.py | Python | apache-2.0 | 29,075 |
from django.contrib.messages import constants, get_level, set_level, utils
from django.contrib.messages.api import MessageFailure
from django.contrib.messages.constants import DEFAULT_LEVELS
from django.contrib.messages.storage import base, default_storage
from django.contrib.messages.storage.base import Message
from d... | ar4s/django | tests/messages_tests/base.py | Python | bsd-3-clause | 14,187 |
#!/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.
""" Unit tests for the ninja.py file. """
import sys
import unittest
import gyp.generator.ninja as ninja
class TestPrefixesAndSuffixes(u... | onecoolx/picasso | tools/gyp/pylib/gyp/generator/ninja_test.py | Python | bsd-3-clause | 1,909 |
# This file is not meant for public use and will be removed in SciPy v2.0.0.
# Use the `scipy.sparse.linalg` namespace for importing the functions
# included below.
import warnings
from . import _eigen
__all__ = [ # noqa: F822
'ArpackError', 'ArpackNoConvergence',
'eigs', 'eigsh', 'lobpcg', 'svds', 'arpack'... | scipy/scipy | scipy/sparse/linalg/eigen.py | Python | bsd-3-clause | 1,151 |
"""Implements a widget that displays the player's current commitments."""
| yongwen/makahiki | makahiki/apps/widgets/my_commitments/__init__.py | Python | mit | 74 |
#!/usr/bin/env python
# This file is part of VoltDB.
# Copyright (C) 2008-2010 VoltDB Inc.
#
# VoltDB 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... | apavlo/h-store | src/catgen/catalog_utils/testdata.py | Python | gpl-3.0 | 1,429 |
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
from pootle.core.delegate import config
from... | claudep/pootle | pootle/apps/pootle_config/getters.py | Python | gpl-3.0 | 1,264 |
#!/usr/bin/env python
#
# Copyright 2005,2007,2010,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at ... | gnu-sandhi/sandhi | modules/gr36/gr-blocks/python/qa_packed_to_unpacked.py | Python | gpl-3.0 | 10,891 |
#!/usr/bin/env python
#-----------------------------------------------------------------------------
# Copyright (c) 2008-2012, David P. D. Moss. All rights reserved.
#
# Released under the BSD license. See the LICENSE file for details.
#-----------------------------------------------------------------------------
... | ecolitan/fatics | venv/lib/python2.7/site-packages/netaddr/ip/iana.py | Python | agpl-3.0 | 14,149 |
from gi.repository import Gtk
"""
Since GTK+3 Gtk.CellRenderer doesn't have a destroy signal anymore.
We can do the cleanup in the python destructor method instead.
"""
class MyCellRenderer(Gtk.CellRenderer):
def __init__(self):
Gtk.CellRenderer.__init__(self)
def __del__(self):
print "cell... | gusDuarte/sugar-toolkit-gtk3 | tests/graphics/customdestroy.py | Python | lgpl-2.1 | 918 |
# Copyright (c) 2010-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 agree... | bkolli/swift | test/unit/proxy/test_sysmeta.py | Python | apache-2.0 | 16,039 |
import h2o, h2o_config
l = h2o_config.setup_test_config(test_config_json='test_config.json')
print "\nsetup_test_config returns list of test config objs:", l
# Here are some ways to reference the config state that the json created
print "\nHow to reference.."
for i, obj in enumerate(h2o_config.configs):
print "k... | 111t8e/h2o-2 | py/test_config_basic.py | Python | apache-2.0 | 597 |
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | clarko1/Cramd | appengine/standard/ndb/modeling/keyproperty_models.py | Python | apache-2.0 | 2,072 |
# Copyright 2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | zhimin711/nova | nova/tests/unit/objects/test_image_meta.py | Python | apache-2.0 | 12,384 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 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 th... | zenodo/invenio | invenio/legacy/bibclassify/ontology_reader.py | Python | gpl-2.0 | 44,242 |
# -*- coding: utf-8 -*-
"""
| This file is part of the web2py Web Framework
| Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
| License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
|
This file contains the DAL support for many relational databases, including:
- SQLite & SpatiaLite
- MySQL
- Postg... | ShySec/scrimmage-scoreboard | web2py/gluon/packages/dal/pydal/base.py | Python | gpl-2.0 | 48,012 |
# This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | seankelly/buildbot | master/buildbot/test/unit/test_data_root.py | Python | gpl-2.0 | 3,723 |
# goto_assignments command tests are different in syntax
definition = 3
#! 0 ['a = definition']
a = definition
#! []
b
#! ['a = definition']
a
b = a
c = b
#! ['c = b']
c
cd = 1
#! 1 ['cd = c']
cd = c
#! 0 ['cd = e']
cd = e
#! ['module math']
import math
#! ['import math']
math
#! ['import math']
b = math
#! ['b =... | Eddy0402/Environment | vim/ycmd/third_party/jedi/test/completion/goto.py | Python | gpl-3.0 | 2,526 |
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# Copyright 2015 Abhijit Menon-Sen <ams@2ndQuadrant.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, eithe... | filipenf/ansible | lib/ansible/plugins/connection/ssh.py | Python | gpl-3.0 | 29,029 |
# urllib2 work-alike interface
# ...from urllib2...
from urllib2 import \
URLError, \
HTTPError, \
BaseHandler, \
UnknownHandler, \
FTPHandler, \
CacheFTPHandler
# ...and from mechanize
from _auth import \
HTTPPasswordMgr, \
HTTPPasswordMgrWithDefaultRealm, \
AbstractBasicAu... | deanhiller/databus | webapp/play1.3.x/samples-and-tests/i-am-a-developer/mechanize/_urllib2.py | Python | mpl-2.0 | 1,415 |
# -*- coding: utf-8 -*-
from openerp import SUPERUSER_ID
from openerp.addons.web import http
from openerp.addons.web.http import request
from openerp.addons.website.models.website import unslug
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT
from openerp.tools.translate import _
import time
import werkzeug.urls
... | be-cloud-be/horizon-addons | server/addons/website_membership/controllers/main.py | Python | agpl-3.0 | 9,678 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Admin Passkey module for Odoo
# Copyright (C) 2013-2014 GRAP (http://www.grap.coop)
# @author Sylvain LE GAL (https://twitter.com/legalsylvain)
#
# This program is free software: you can redistribute... | acsone/server-tools | auth_admin_passkey/tests/__init__.py | Python | agpl-3.0 | 1,069 |
"""
Middleware to auto-expire inactive sessions after N seconds, which is configurable in
settings.
To enable this feature, set in a settings.py:
SESSION_INACTIVITY_TIMEOUT_IN_SECS = 300
This was taken from StackOverflow (http://stackoverflow.com/questions/14830669/how-to-expire-django-session-in-5minutes)
"""
f... | eduNEXT/edx-platform | openedx/core/djangoapps/session_inactivity_timeout/middleware.py | Python | agpl-3.0 | 2,044 |
# This file is part of DEAP.
#
# DEAP 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 later version.
#
# DEAP is distributed ... | IGITUGraz/scoop | examples/dependency/sortingnetwork.py | Python | lgpl-3.0 | 4,724 |
# 3dproj.py
#
"""
Various transforms used for by the 3D code
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from six.moves import zip
from matplotlib.collections import LineCollection
from matplotlib.patches import Circle
import numpy as np
... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/mpl_toolkits/mplot3d/proj3d.py | Python | bsd-2-clause | 6,988 |
#!/usr/bin/env python
# encoding: utf-8
################################################################################
#
# RMG - Reaction Mechanism Generator
#
# Copyright (c) 2002-2009 Prof. William H. Green (whgreen@mit.edu) and the
# RMG Team (rmg_dev@mit.edu)
#
# Permission is hereby granted, free of cha... | faribas/RMG-Py | rmgpy/statmech/rotationTest.py | Python | mit | 34,218 |
## @file
# This file is used to define class objects of INF file [Ppis] section.
# It will consumed by InfParser.
#
# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License whi... | carmark/vbox | src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/Object/Parser/InfPpiObject.py | Python | gpl-2.0 | 12,929 |
#!/usr/bin/env python
# encoding: utf-8
"""
Creates a new sound table from random chunks of a soundfile.
"""
from pyo import *
import random, os
s = Server(sr=44100, nchnls=2, buffersize=512, duplex=0).boot()
path = "../snds/baseballmajeur_m.aif"
dur = sndinfo(path)[1]
t = SndTable(path, start=0, stop=1)
amp = Fade... | orbitfold/pyo | examples/tables/05_table_maker.py | Python | gpl-3.0 | 1,093 |
from collections import OrderedDict
from django.core.cache import cache
from django.conf import settings
import jingo
import jinja2
from bedrock.firefox.models import FirefoxOSFeedLink
from bedrock.firefox.firefox_details import firefox_desktop, firefox_android
from bedrock.base.urlresolvers import reverse
from lib.... | SujaySKumar/bedrock | bedrock/firefox/helpers.py | Python | mpl-2.0 | 8,166 |
"""
HTML Widget classes
"""
try:
set
except NameError:
from sets import Set as set # Python 2.3 fallback
import copy
from itertools import chain
from django.conf import settings
from django.utils.datastructures import MultiValueDict, MergeDict
from django.utils.html import escape, conditional_escape
from dj... | AloneRoad/Inforlearn | vendor/django/forms/widgets.py | Python | apache-2.0 | 25,335 |
# 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... | szha/mxnet | python/mxnet/gluon/model_zoo/model_store.py | Python | apache-2.0 | 6,036 |
#!/usr/bin/env python
#
# 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 "Lic... | innovimax/vxquery | vxquery-benchmark/src/main/resources/util/diff_xml_files.py | Python | apache-2.0 | 3,401 |
# 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... | ghchinoy/tensorflow | tensorflow/python/keras/datasets/mnist.py | Python | apache-2.0 | 1,993 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
import time
from os import listdir
from os.path import join
from Queue import Queue, Empty
from select import select
from threading import Thread, Lock
from odoo import http
import odoo.addons.hw_proxy.c... | chienlieu2017/it_management | odoo/addons/hw_scanner/controllers/main.py | Python | gpl-3.0 | 8,110 |
# (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... | mo-g/iris | lib/iris/tests/unit/fileformats/pp_rules/test__reshape_vector_args.py | Python | gpl-3.0 | 5,242 |
###############################################################################
##
## Copyright 2012 Tavendo GmbH
##
## 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... | CSF-JH/crossbarexamples | rest/needs_cleanup/python/example/auth/__init__.py | Python | apache-2.0 | 2,784 |
from contextlib import contextmanager
from mpconstants.countries import COUNTRY_DETAILS
from nose.tools import eq_, ok_
from tower import activate
import mkt.constants.regions as regions
from mkt.site.tests import TestCase
class TestRegions(TestCase):
def test_no_missing_region(self):
"""Test that we hav... | jamesthechamp/zamboni | mkt/constants/tests/test_regions.py | Python | bsd-3-clause | 3,275 |
#!/usr/bin/python
#
# 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 distribut... | gundalow/ansible-modules-core | network/nxos/nxos_udld_interface.py | Python | gpl-3.0 | 15,900 |
def foo(someParam: int):
pass
someParam = 1
foo(<caret>) | jwren/intellij-community | python/testData/codeInsight/mlcompletion/receiverMatchesSimple.py | Python | apache-2.0 | 59 |
from .m1 import f
from p1.m1 import f
from m1 import f
from a import g
<warning descr="Unused import statement 'from a import h'">from a import h</warning>
__all__ = ['f', 'g']
| jwren/intellij-community | python/testData/inspections/PyUnresolvedReferencesInspection/UnusedImportsInPackage/p1/__init__.py | Python | apache-2.0 | 178 |
import re
from django import forms
from django.conf import settings
from django.template.defaultfilters import slugify
from tower import ugettext_lazy as _lazy
from kitsune.products.models import Product, Topic
from kitsune.sumo.form_fields import MultiUsernameField, StrippedCharField
from kitsune.wiki.config import... | YOTOV-LIMITED/kitsune | kitsune/wiki/forms.py | Python | bsd-3-clause | 12,418 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/globocom/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
from thumbor.filters import BaseFilter, filter_method
class Filter... | food52/thumbor | thumbor/filters/strip_icc.py | Python | mit | 413 |
#
# Copyright (c) 2014 Juniper Networks, Inc.
#
import setuptools
def requirements(filename):
with open(filename) as f:
lines = f.read().splitlines()
return lines
setuptools.setup(
name='contrail-vrouter-api',
version='1.0',
packages=setuptools.find_packages(),
# metadata
author... | facetothefate/contrail-controller | src/vnsw/contrail-vrouter-api/setup.py | Python | apache-2.0 | 624 |
#!/usr/bin/env python
#
# Copyright 2007 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 by applicable law o... | ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/admin/modules_handler.py | Python | bsd-3-clause | 934 |
# -*- coding: utf-8 -*-
"""
flask.templating
~~~~~~~~~~~~~~~~
Implements the bridge to Jinja2.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import posixpath
from jinja2 import BaseLoader, Environment as BaseEnvironment, \
TemplateNotFound
from .glo... | zwChan/VATEC | ~/eb-virt/Lib/site-packages/flask/templating.py | Python | apache-2.0 | 4,707 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: POGOProtos/Settings/Master/EquippedBadgeSettings.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from go... | favll/pogom | pogom/pgoapi/protos/POGOProtos/Settings/Master/EquippedBadgeSettings_pb2.py | Python | mit | 3,197 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import ast
from odoo import api, fields, models, _
from odoo.exceptions import UserError
class IrFilters(models.Model):
_name = 'ir.filters'
_description = 'Filters'
_order = 'model_id, name, id desc'
... | chienlieu2017/it_management | odoo/odoo/addons/base/ir/ir_filters.py | Python | gpl-3.0 | 7,581 |
"""bug 867387 Bixie draft schema
Revision ID: 22e4e60e03f
Revises: 37004fc6e41e
Create Date: 2013-05-10 13:20:35.750954
"""
# revision identifiers, used by Alembic.
revision = '22e4e60e03f'
down_revision = '37004fc6e41e'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
from ... | KaiRo-at/socorro | alembic/versions/22e4e60e03f_bug_867387_bixie_dra.py | Python | mpl-2.0 | 9,842 |
from __future__ import absolute_import
from itertools import cycle
import logging
import random
import six
from six.moves import xrange
from .base import Producer
log = logging.getLogger(__name__)
class SimpleProducer(Producer):
"""A simple, round-robin producer.
See Producer class for Base Arguments
... | ianawilson/kafka-python | kafka/producer/simple.py | Python | apache-2.0 | 1,893 |
from setuptools import setup
version = '1.5.0a0'
testing_extras = ['nose', 'coverage']
docs_extras = ['Sphinx']
setup(
name='WebOb',
version=version,
description="WSGI request and response object",
long_description="""\
WebOb provides wrappers around the WSGI request environment, and an
object to he... | endlessm/chromium-browser | third_party/catapult/third_party/WebOb/setup.py | Python | bsd-3-clause | 2,154 |
# test re.sub with unmatched groups, behaviour changed in CPython 3.5
try:
import ure as re
except ImportError:
try:
import re
except ImportError:
print("SKIP")
raise SystemExit
try:
re.sub
except AttributeError:
print("SKIP")
raise SystemExit
# first group matches, se... | kerneltask/micropython | tests/extmod/ure_sub_unmatched.py | Python | mit | 419 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "travis-ci.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| uw-it-aca/mdot-developers | travis-ci/manage.py | Python | apache-2.0 | 252 |
from ...scheme import Scheme
from ..schemeinfo import SchemeInfoDialog
from ...gui import test
class TestSchemeInfo(test.QAppTestCase):
def test_scheme_info(self):
scheme = Scheme(title="A Scheme", description="A String\n")
dialog = SchemeInfoDialog()
dialog.setScheme(scheme)
stat... | cheral/orange3 | Orange/canvas/application/tests/test_schemeinfo.py | Python | bsd-2-clause | 680 |
# Ansible module to manage CheckPoint Firewall (c) 2019
#
# 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 dist... | thaim/ansible | test/units/modules/network/check_point/test_cp_mgmt_service_icmp.py | Python | mit | 3,878 |
# Ansible module to manage CheckPoint Firewall (c) 2019
#
# 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 dist... | kvar/ansible | test/units/modules/network/check_point/test_cp_mgmt_host.py | Python | gpl-3.0 | 3,853 |
from website.addons.base.serializer import CitationsAddonSerializer
class MendeleySerializer(CitationsAddonSerializer):
addon_short_name = 'mendeley'
| zachjanicki/osf.io | website/addons/mendeley/serializer.py | Python | apache-2.0 | 155 |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
# Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use t... | takeshineshiro/horizon | openstack_dashboard/dashboards/project/access_and_security/tabs.py | Python | apache-2.0 | 5,203 |
# Copyright 2014-2015 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... | nichung/wwwflaskBlogrevA | venv/lib/python2.7/site-packages/pymongo/ismaster.py | Python | mit | 3,733 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Tim Rightnour <thegarbledone@gmail.com>
# 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 = {
'metadat... | thaim/ansible | lib/ansible/modules/notification/snow_record.py | Python | mit | 10,616 |
# Copyright (c) 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.
from telemetry.page import test_expectations
# Valid expectation conditions are:
#
# Operating systems:
# win, xp, vista, win7, mac, leopard, snowle... | qtekfun/htcDesire820Kernel | external/chromium_org/content/test/gpu/gpu_tests/webgl_conformance_expectations.py | Python | gpl-2.0 | 9,671 |
#!/usr/bin/env python
# (c) 2013, Greg Buehler
#
# 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 ve... | alexlo03/ansible | contrib/inventory/zabbix.py | Python | gpl-3.0 | 4,795 |
# 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... | nburn42/tensorflow | tensorflow/python/kernel_tests/spacetodepth_op_test.py | Python | apache-2.0 | 13,957 |
#!/usr/bin/env python
#
# This script is designed to be invoked by soy2html.sh.
# Usage:
#
# buck/docs$ python soy2html.py <output_dir>
#
# This will write all of the static content to the specified output directory.
# You may want to verify that things worked correctly by running:
#
# python -m SimpleHTTPServer ... | raviagarwal7/buck | docs/soy2html.py | Python | apache-2.0 | 3,176 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2007 Zuza Software Foundation
# 2013 F Wolff
#
# This file is part of translate.
#
# translate 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... | biswajitsahu/kuma | vendor/packages/translate/filters/spelling.py | Python | mpl-2.0 | 2,109 |
# -*- coding: utf-8 -*-
# __
# /__) _ _ _ _ _/ _
# / ( (- (/ (/ (- _) / _)
# /
"""
Requests HTTP library
~~~~~~~~~~~~~~~~~~~~~
Requests is an HTTP library, written in Python, for human beings. Basic GET
usage:
>>> import requests
>>> r = requests.get('https://www.python.org')
>>> ... | LockScreen/Backend | venv/lib/python2.7/site-packages/requests/__init__.py | Python | mit | 1,861 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | dariemp/odoo | openerp/tools/translate.py | Python | agpl-3.0 | 45,371 |
# -*- coding: utf-8 -*-
"""
tests.contrib
~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests the contrib modules.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
| pjknkda/werkzeug | tests/contrib/__init__.py | Python | bsd-3-clause | 207 |
"""
This module contains transformation functions (clip->clip)
One file for one fx. The file's name is the fx's name
"""
| kerimlcr/ab2017-dpyo | ornek/moviepy/moviepy-0.2.2.12/moviepy/video/fx/__init__.py | Python | gpl-3.0 | 121 |
## This file is part of Invenio.
## Copyright (C) 2008, 2010, 2011 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) any later versio... | NikolaYolov/invenio_backup | modules/websubmit/lib/functions/Ask_For_Record_Details_Confirmation.py | Python | gpl-2.0 | 5,952 |
import sys
from remoteserver import DirectResultRemoteServer
class SpecialErrors(object):
def continuable(self, message, traceback):
return self._special_error(message, traceback, continuable=True)
def fatal(self, message, traceback):
return self._special_error(message, traceback,
... | yahman72/robotframework | atest/testdata/standard_libraries/remote/specialerrors.py | Python | apache-2.0 | 689 |
import io
import json
class Stream(object):
__shortname__ = "stream"
"""
This is a base class that should be inherited when implementing
different stream types. Should only be created by plugins.
"""
def __init__(self, session):
self.session = session
def __repr__(self):
... | ethanhlc/streamlink | src/streamlink/stream/stream.py | Python | bsd-2-clause | 915 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, 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',
... | helldorado/ansible | lib/ansible/modules/network/f5/bigip_dns_cache_resolver.py | Python | gpl-3.0 | 16,802 |