repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
HiroIshikawa/21playground
visualizer/_app_boilerplate/venv/lib/python3.5/site-packages/pip/_vendor/html5lib/treewalkers/pulldom.py
1729
2302
from __future__ import absolute_import, division, unicode_literals from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, \ COMMENT, IGNORABLE_WHITESPACE, CHARACTERS from . import _base from ..constants import voidElements class TreeWalker(_base.TreeWalker): def __iter__(self): ignore_until = None...
mit
beblount/Steer-Clear-Backend-Web
env/Lib/site-packages/pip/_vendor/lockfile/mkdirlockfile.py
478
3098
from __future__ import absolute_import, division import time import os import sys import errno from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout, AlreadyLocked) class MkdirLockFile(LockBase): """Lock file by creating a directory.""" def __init__(self, path, threaded=True, ...
mit
intip/django-cms
cms/test_utils/project/urls_3.py
47
1094
from cms.utils.conf import get_cms_setting from django.conf import settings from django.conf.urls import include, url from django.contrib import admin from django.conf.urls.i18n import i18n_patterns from django.contrib.staticfiles.urls import staticfiles_urlpatterns admin.autodiscover() urlpatterns = [ url(r'^m...
bsd-3-clause
WillGuan105/django
tests/context_processors/tests.py
300
3031
""" Tests for Django's bundled context processors. """ from django.test import SimpleTestCase, TestCase, override_settings @override_settings( ROOT_URLCONF='context_processors.urls', TEMPLATES=[{ 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'APP_DIRS': True, 'OPTIONS':...
bsd-3-clause
trezorg/django
tests/regressiontests/admin_inlines/tests.py
50
7030
from django.contrib.admin.helpers import InlineAdminForm from django.contrib.contenttypes.models import ContentType from django.test import TestCase # local test models from models import (Holder, Inner, InnerInline, Holder2, Inner2, Holder3, Inner3, Person, OutfitItem, Fashionista, Teacher, Parent, Child) class...
bsd-3-clause
nicholasserra/sentry
tests/sentry/api/serializers/test_base.py
15
1296
# -*- coding: utf-8 -*- from __future__ import absolute_import from sentry.api.serializers import serialize, Serializer from sentry.testutils import TestCase class Foo(object): pass class FooSerializer(Serializer): def serialize(self, *args, **kwargs): return 'lol' class BaseSerializerTest(TestC...
bsd-3-clause
nicolaka/troposphere
examples/S3_Website_Bucket_With_Retain_On_Delete.py
32
1345
# Converted from S3_Website_Bucket_With_Retain_On_Delete.template located at: # http://aws.amazon.com/cloudformation/aws-cloudformation-templates/ from troposphere import GetAtt, Join, Output, Template from troposphere.s3 import Bucket, PublicRead, WebsiteConfiguration t = Template() t.add_description( "AWS Clo...
bsd-2-clause
kvpradap/conda-pysm-appveyor
py_stringmatching/similarity_measure/overlap_coefficient.py
2
3137
from py_stringmatching import utils from py_stringmatching.similarity_measure.token_similarity_measure import \ TokenSimilarityMeasure class OverlapCoefficient(TokenSimilarityMeasure): """Computes overlap coefficient measure. The overlap coefficient is a si...
bsd-3-clause
Danath/gyp
test/ninja/action_dependencies/gyptest-action-dependencies.py
34
2086
#!/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. """ Verify that building an object file correctly depends on running actions in dependent targets, but not the targets themselves. """ impo...
bsd-3-clause
timduru/platform-external-chromium_org
build/android/pylib/surface_stats_collector.py
23
10779
# 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 Queue import datetime import logging import re import threading from pylib import perf_tests_helper # Log marker containing SurfaceTexture time...
bsd-3-clause
Godiyos/python-for-android
python-build/python-libs/gdata/tests/gdata_tests/calendar/service_test.py
87
15026
#!/usr/bin/python # # Copyright (C) 2006 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 ...
apache-2.0
ruba9/HotelChatbot
my_env/lib/python3.6/site-packages/pip/_vendor/packaging/_structures.py
1152
1416
# 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 class Infinity(object): def __repr__(self): return "Infinity...
mit
drmrd/ansible
lib/ansible/modules/cloud/vmware/vca_fw.py
104
7967
#!/usr/bin/python # Copyright: (c) 2015, VMware, Inc. All Rights Reserved. # 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', ...
gpl-3.0
thylong/cabu
cabu/tests/test_link_extractor.py
1
2910
# -*- coding: utf-8 -*- from cabu.tests.test_base import TestBase from cabu.utils.link_extractor import extract_links, filter_links from cabu.exceptions import LinkExtractorException class TestLinkExtractor(TestBase): def test_extract_links(self): response = '<a>http://tomato.org/test</a><b>http://tomato...
bsd-3-clause
nicobustillos/odoo
addons/website_sale_options/models/sale_order.py
90
2844
# -*- coding: utf-8 -*- from openerp import SUPERUSER_ID from openerp.osv import osv, orm, fields from openerp.tools.translate import _ class sale_order_line(osv.Model): _inherit = "sale.order.line" _columns = { 'linked_line_id': fields.many2one('sale.order.line', 'Linked Order Line', domain="[('orde...
agpl-3.0
jabesq/home-assistant
homeassistant/components/aquostv/media_player.py
7
7025
"""Support for interface with an Aquos TV.""" import logging import voluptuous as vol from homeassistant.components.media_player import ( MediaPlayerDevice, PLATFORM_SCHEMA) from homeassistant.components.media_player.const import ( SUPPORT_NEXT_TRACK, SUPPORT_PAUSE, SUPPORT_PLAY, SUPPORT_PREVIOUS_TRACK, S...
apache-2.0
supernifty/reference-bias
bin/draw_matrix.py
1
2392
#!/usr/bin/env python # # generates a chart illustrating the bias as generated from the calculate_bias_matrix command # also requires a mapping from donor to the label to display on the chart # usage # python draw_matrix.py genome_map < matrix.out > chart.pdf # genome_map has the format: # donor_filename,label,extra i...
apache-2.0
kumar303/zamboni
mkt/api/tests/test_middleware.py
19
12381
from urlparse import parse_qs from django.conf import settings from django.core.cache import cache from django.http import HttpResponse, HttpResponseServerError from django.test.client import RequestFactory from django.test.utils import override_settings import mock from multidb import this_thread_is_pinned from nose...
bsd-3-clause
zhoulingjun/django
django/contrib/gis/geos/point.py
338
4419
from ctypes import c_uint from django.contrib.gis.geos import prototypes as capi from django.contrib.gis.geos.error import GEOSException from django.contrib.gis.geos.geometry import GEOSGeometry from django.utils import six from django.utils.six.moves import range class Point(GEOSGeometry): _minlength = 2 _m...
bsd-3-clause
peterbe/django-sockjs-tornado
example/project/wsgi.py
1
1144
""" WSGI config for example_project project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLIC...
mit
jbedorf/tensorflow
tensorflow/python/ops/distributions/normal.py
8
9816
# 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...
apache-2.0
andfoy/margffoy-tuay-server
env/lib/python2.7/site-packages/pip/_vendor/_markerlib/markers.py
1769
3979
# -*- coding: utf-8 -*- """Interpret PEP 345 environment markers. EXPR [in|==|!=|not in] EXPR [or|and] ... where EXPR belongs to any of those: python_version = '%s.%s' % (sys.version_info[0], sys.version_info[1]) python_full_version = sys.version.split()[0] os.name = os.name sys.platform = sys.platfo...
gpl-2.0
swaroophangal/simulink2mavlink
mavlink/pymavlink/generator/lib/minixsv/xsvalSimpleTypes.py
79
35612
# # minixsv, Release 0.9.0 # file: xsvalSimpleTypes.py # # class for validation of XML schema simple types # # history: # 2004-09-09 rl created # 2006-08-18 rl W3C testsuite passed for supported features # 2007-05-24 rl Features for release 0.8 added, some bugs fixed # # Copyright (c) 2004-2007 by Rola...
gpl-2.0
evaschalde/odoo
openerp/workflow/instance.py
314
5594
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2014 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
kezabelle/clastic
clastic/sinter.py
1
5483
# -*- coding: utf-8 -*- import re import types import inspect from inspect import ArgSpec _VERBOSE = False _INDENT = ' ' def getargspec(f): # TODO: support partials if not (inspect.isfunction(f) or inspect.ismethod(f) or \ inspect.isbuiltin(f)) and hasattr(f, '__call__'): if isinstanc...
bsd-3-clause
AstroTech/workshop-python
network/solution/botnet/botnet/host/models.py
1
1174
from django.db import models from django.core.validators import MinValueValidator from django.core.validators import MaxValueValidator from django.utils.translation import ugettext_lazy as _ class Group(models.Model): name = models.CharField( verbose_name=_('Name'), db_index=True, max_lengt...
mit
mbiciunas/libnix
src/libnix/raw/procfs/mounts.py
1
2943
""" LibNix Copyright (C) 2017 Mark Biciunas This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in th...
gpl-3.0
Ahmad31/Web_Flask_Cassandra
flask/lib/python2.7/site-packages/sqlalchemy/sql/operators.py
31
25328
# sql/operators.py # Copyright (C) 2005-2017 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php # This module is part of SQLAlchemy and is released under # the MIT License: http:/...
apache-2.0
1st/django
tests/template_tests/filter_tests/test_length_is.py
360
3204
from django.template.defaultfilters import length_is from django.test import SimpleTestCase from ..utils import setup class LengthIsTests(SimpleTestCase): @setup({'length_is01': '{% if some_list|length_is:"4" %}Four{% endif %}'}) def test_length_is01(self): output = self.engine.render_to_string('len...
bsd-3-clause
ryanolson/cookiecutter-webapp
{{cookiecutter.app_name}}/{{cookiecutter.app_name}}/api/base.py
2
7858
# -*- coding: utf-8 -*- """ {{ cookiecutter.app_name }}.api.base {{ "~" * (cookiecutter.app_name ~ ".api.base")|count }} :author: {{ cookiecutter.author }} :copyright: © {{ cookiecutter.copyright }} :license: {{ cookiecutter.license }}, see LICENSE for more details. templated from https://gith...
mit
andrewleech/pydio-sync
src/pydio/ui/web_api.py
1
22015
# # Copyright 2007-2014 Charles du Jeu - Abstrium SAS <team (at) pyd.io> # This file is part of Pydio. # # Pydio 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 yo...
gpl-3.0
sbnoemi/notorhot
notorhot/forms.py
1
1476
from django import forms from django.utils.translation import ugettext as _ from notorhot.models import Competition, Candidate class VoteForm(forms.Form): """ Form for voting on a :class:`~notorhot.models.Competition`. Must be initialized with a ``competition`` keyword argument referring to the ...
bsd-3-clause
akosyakov/intellij-community
python/helpers/pydev/_pydev_imps/_pydev_Queue.py
53
8637
"""A multi-producer, multi-consumer queue.""" from _pydev_imps._pydev_time import time as _time from _pydev_imps import _pydev_thread try: import _pydev_threading as _threading except ImportError: import dummy_threading as _threading from collections import deque import heapq __all__ = ['Empty', 'Full', 'Queu...
apache-2.0
biocore/qiime
tests/test_workflow/test_pick_open_reference_otus.py
15
95164
#!/usr/bin/env python # File created on 02 Nov 2011 from __future__ import division __author__ = "Greg Caporaso" __copyright__ = "Copyright 2011, The QIIME project" __credits__ = ["Greg Caporaso"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "Greg Caporaso" __email__ = "gregcaporaso@gmail.com" from ...
gpl-2.0
anntzer/numpy
numpy/distutils/npy_pkg_config.py
17
12972
import sys import re import os from configparser import RawConfigParser __all__ = ['FormatError', 'PkgNotFound', 'LibraryInfo', 'VariableSet', 'read_config', 'parse_flags'] _VAR = re.compile(r'\$\{([a-zA-Z0-9_-]+)\}') class FormatError(IOError): """ Exception thrown when there is a problem parsing a...
bsd-3-clause
jesolem/PCV
PCV/tools/graphcut.py
9
3389
from pylab import * from numpy import * from pygraph.classes.digraph import digraph from pygraph.algorithms.minmax import maximum_flow from PCV.classifiers import bayes """ Graph Cut image segmentation using max-flow/min-cut. """ def build_bayes_graph(im,labels,sigma=1e2,kappa=1): """ Build a graph from 4-...
bsd-2-clause
mmangura/Base
applications/examples/controllers/simple_examples.py
10
3138
def hello1(): """ simple page without template """ return 'Hello World' def hello2(): """ simple page without template but with internationalization """ return T('Hello World') def hello3(): """ page rendered by template simple_examples/index3.html or generic.html""" return dict(message='...
mit
jorsea/odoomrp-wip
account_treasury_forecast_cashflow_banking/report/account_treasury_forecast_analysis.py
31
5233
# -*- encoding: utf-8 -*- ############################################################################## # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the...
agpl-3.0
anilmuthineni/tensorflow
tensorflow/python/kernel_tests/lrn_op_test.py
138
5675
# 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...
apache-2.0
aureooms/networkx
networkx/generators/line.py
15
8495
"""Functions for generating line graphs. """ # Copyright (C) 2013 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. __author__ = "\n".join(["Aric Hagberg (hagberg@lanl.gov)", "Pieter Sw...
bsd-3-clause
malariagen/agam-report-base
src/python/ag1k/phase1_ar3.py
1
5818
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, division import os import pyfasta import allel import seaborn as sns import petl as etl import h5py import pandas title = 'Phase 1 AR3 release' pop_ids = 'AOM', 'BFM', 'GWA', 'GNS', 'BFS', 'CMS', 'GAS', 'UGS', 'KES' pop_labels = { ...
mit
nzavagli/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Scrapy-1.0.1/scrapy/core/downloader/handlers/s3.py
31
2328
from urlparse import unquote from scrapy import optional_features from scrapy.exceptions import NotConfigured from scrapy.utils.httpobj import urlparse_cached from .http import HTTPDownloadHandler try: from boto.s3.connection import S3Connection except ImportError: S3Connection = object class _v19_S3Connecti...
mit
tkaitchuck/nupic
external/linux64/lib/python2.6/site-packages/numpy/core/tests/test_multiarray.py
6
87340
import tempfile import sys import os import numpy as np from numpy.testing import * from numpy.core import * from numpy.core.multiarray_tests import test_neighborhood_iterator, test_neighborhood_iterator_oob # Need to test an object that does not fully implement math interface from datetime import timedelta from nump...
gpl-3.0
delhivery/django
django/contrib/gis/gdal/prototypes/raster.py
320
4013
""" This module houses the ctypes function prototypes for GDAL DataSource (raster) related data structures. """ from ctypes import POINTER, c_char_p, c_double, c_int, c_void_p from functools import partial from django.contrib.gis.gdal.libgdal import GDAL_VERSION, std_call from django.contrib.gis.gdal.prototypes.genera...
bsd-3-clause
danieljl/namebench
nb_third_party/dns/rdtypes/IN/WKS.py
248
4116
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation 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 SOFTWARE IS PROVIDED ...
apache-2.0
martinep/foam-extend-3.0
ThirdParty/LocalDev/Hydro-Quebec/PyFoam/ChangeMixingPlaneBoundary.py
7
6854
""" Application-class that implements pyFoamChangeMixingPlaneBoundary.py Change various mixingPlane interface attributes in constant/polymesh/boundary file. Author: Martin Beaudoin, Hydro-Quebec, 2012. All rights reserved """ from PyFoamApplication import PyFoamApplication from PyFoam.RunDictionary.ParsedParamet...
gpl-2.0
emon10005/scikit-image
skimage/novice/_novice.py
19
14408
import os import imghdr from collections import namedtuple import numpy as np from .. import io, img_as_ubyte from ..transform import resize from ..color import color_dict from ..io.util import file_or_url_context, is_url import six from six.moves.urllib import request urlopen = request.urlopen # Convert colors from...
bsd-3-clause
bramsutarsa/koa-tv-tracker
node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/input.py
457
112827
# 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. from compiler.ast import Const from compiler.ast import Dict from compiler.ast import Discard from compiler.ast import List from compiler.ast import Module from co...
mit
gregorynicholas/paver
paver/bzr.py
10
1821
"""Convenience functions for working with bzr. This module does not include any tasks, only functions.""" import sys if sys.version_info[0] == 3: raise ImportError("Bazaar-NG is not available for Python 3") from paver.options import Bunch from bzrlib.builtins import cmd_branch, cmd_checkout, cmd_updat...
bsd-3-clause
calvinsettachatgul/athena
athena_env/lib/python3.7/site-packages/pip/_vendor/urllib3/util/connection.py
24
4279
from __future__ import absolute_import import socket from .wait import NoWayToWaitForSocketError, wait_for_read def is_connection_dropped(conn): # Platform-specific """ Returns True if the connection is dropped and should be closed. :param conn: :class:`httplib.HTTPConnection` object. Note:...
mit
samvarankashyap/linch-pin
linchpin/api/__init__.py
3
9733
from linchpin import LinchpinAPI from linchpin.context import LinchpinContext from linchpin.exceptions import LinchpinError import yaml import json import os import tempfile class Workspace(object): def __init__(self, path=None): """ Linchpin api workspace constructor :...
gpl-3.0
michath/ConMonkey
testing/mozbase/mozdevice/sut_tests/test_pull.py
5
1287
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import hashlib import os import posixpath from dmunit import DeviceManagerTestCase from mozdevice.devicemanager import ...
mpl-2.0
routeflow/AutomaticConfigurationRouteFlow
pox/ext/rfofmsg.py
13
4777
import binascii import logging from socket import inet_aton from pox.openflow.libopenflow_01 import * from pox.lib.addresses import * from pox.core import core from rflib.defs import * from rflib.types.Match import * from rflib.types.Action import * from rflib.types.Option import * log = core.getLogger("rfproxy") d...
apache-2.0
mariusbaumann/pyload
module/cli/AddPackage.py
42
1994
#!/usr/bin/env python # -*- coding: utf-8 -*- # #Copyright (C) 2011 RaNaN # #This program is free software; you can redistribute it and/or modify #it under the terms of the GNU General Public License as published by #the Free Software Foundation; either version 3 of the License, #or (at your option) any later version. ...
gpl-3.0
jmgilman/Omega-Python
lib/wtforms/widgets/core.py
51
8239
from __future__ import unicode_literals from cgi import escape from wtforms.compat import text_type, string_types, iteritems __all__ = ( 'CheckboxInput', 'FileInput', 'HiddenInput', 'ListWidget', 'PasswordInput', 'RadioInput', 'Select', 'SubmitInput', 'TableWidget', 'TextArea', 'TextInput', 'Option' ) ...
apache-2.0
entropycoin/entropycoin
contrib/pyminer/pyminer.py
1257
6438
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file license.txt or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib im...
mit
abid-mujtaba/BitcoinTracker-server
uwsgi/api.py
1
1564
""" Handles requests made to the /bitcoin/api/*/ end-point. """ import json import sqlite3 import common import current import error def handle_current(start_response, route): """ Handler for the /bitcoin/api/current/ endpoint. Returns the current bitcoin price as JSON. """ ts, buy, sell = cur...
apache-2.0
robbiet480/home-assistant
homeassistant/components/alarm_control_panel/__init__.py
7
5886
"""Component to interface with an alarm control panel.""" from abc import abstractmethod from datetime import timedelta import logging import voluptuous as vol from homeassistant.const import ( ATTR_CODE, ATTR_CODE_FORMAT, SERVICE_ALARM_ARM_AWAY, SERVICE_ALARM_ARM_CUSTOM_BYPASS, SERVICE_ALARM_ARM_...
apache-2.0
kwlzn/pants
src/python/pants/backend/jvm/tasks/jvm_compile/analysis.py
15
1320
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) class Analysis(obje...
apache-2.0
edenmark/CIRCOS_PanGenome
pangenome.py
1
11509
#!/usr/bin/python ############################################################################### # # pangenome.py version 1.0 # # Calculates the overlapping genes of multiple species and provides files # for CIRCOS visualization of the overlapping genomes # # Copyright (C) 2014 Evan Denmark & Matt...
mit
nwjs/blink
Source/build/scripts/make_settings.py
23
3760
#!/usr/bin/env python # Copyright (C) 2013 Google Inc. All rights reserved. # Copyright (C) 2013 Igalia S.L. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source cod...
bsd-3-clause
pythonvietnam/white
white/lang/zh_TW/global.py
4
1542
t = { # words 'save' : u'儲存', 'delete' : u'刪除', 'update' : u'更新', 'edit' : u'編輯', 'editing' : u'編輯', 'create' : u'建立', 'created' : u'建立', 'submit' : u'送交', 'close' : u'關閉', 'status' : u'狀態', 'manage' : u'管理', 'reset' : u'重設', 'all' : u'全部', # pagination 'next' : u'下一頁', 'previous' : u'上一頁', 'first' ...
gpl-2.0
shsingh/ansible
test/support/integration/plugins/modules/deploy_helper.py
149
19571
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Jasper N. Brouwer <jasper@nerdsweide.nl> # (c) 2014, Ramon de la Fuente <ramon@delafuente.nl> # # 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 __metaclas...
gpl-3.0
FusionSP/android_external_chromium_org
tools/usb_gadget/hid_gadget.py
54
12775
# 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. """Human Interface Device gadget module. This gadget emulates a USB Human Interface Device. Multiple logical components of a device can be composed together...
bsd-3-clause
Yukarumya/Yukarum-Redfoxes
python/pyasn1-modules/pyasn1_modules/rfc5208.py
132
1300
# # PKCS#8 syntax # # ASN.1 source from: # http://tools.ietf.org/html/rfc5208 # # Sample captures could be obtained with "openssl pkcs8 -topk8" command # from pyasn1.type import tag, namedtype, namedval, univ, constraint from pyasn1_modules.rfc2459 import * from pyasn1_modules import rfc2251 class KeyEncryptionAlgorit...
mpl-2.0
jcsilva/keras-punctuator
src/evaluate.py
1
1497
import h5py import numpy as np import sys from keras.models import model_from_json # Read input data input_text_file = sys.argv[1] # Read vocabulary data = np.load('../data/train1.pkl') vocabulary = data['vocabulary'] punctuation = data['punctuations'] inv_punctuation = dict((value, key) for key, value in punctuation...
mit
indautgrp/erpnext
erpnext/buying/doctype/purchase_order/purchase_order.py
1
13036
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe import json from frappe.utils import cstr, flt from frappe import msgprint, _ from frappe.model.mapper import get_mapped_doc from erpnext....
gpl-3.0
Connexions/cnx-epub
cnxepub/tests/test_collation.py
1
13693
# -*- coding: utf-8 -*- # ### # Copyright (c) 2016, Rice University # This software is subject to the provisions of the GNU Affero General # Public License version 3 (AGPLv3). # See LICENCE.txt for details. # ### import os import io import unittest try: from unittest import mock except ImportError: import mock ...
agpl-3.0
GovReady/govready-q
guidedmodules/answer_validation.py
1
13619
class question_input_parser: # Turns client-side input into the correct JSON-serializable # Python data structure for a particular question type. # # The input is typically a string submitted by an <input> field, # which is passed to this function by request.POST.getlist(), # giving us an array ...
gpl-3.0
senadmd/coinmarketwatch
test/functional/listsinceblock.py
13
2545
#!/usr/bin/env python3 # Copyright (c) 2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the listsincelast RPC.""" from test_framework.test_framework import BitcoinTestFramework from test_fra...
mit
dancingdan/tensorflow
tensorflow/contrib/graph_editor/tests/reroute_test.py
131
3915
# 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...
apache-2.0
pombredanne/git-git.fedorahosted.org-git-pyrpm
pyrpm/installer/network.py
2
5612
# # Copyright (C) 2005,2006 Red Hat, Inc. # Author: Thomas Woerner <twoerner@redhat.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Library General Public License as published by # the Free Software Foundation; version 2 only # # This program is distributed ...
gpl-2.0
NathanW2/featuretemplates
model.py
1
1097
from PyQt4.QtCore import QAbstractItemModel, QModelIndex, Qt class FeatureTemplatesModel(QAbstractItemModel): def __init__(self, templates=None, parent=None): super(FeatureTemplatesModel, self).__init__(parent) self.templates = templates or [] def columnCount(self, parent = QMod...
gpl-2.0
dharmabumstead/ansible
lib/ansible/modules/network/netscaler/netscaler_cs_vserver.py
52
43973
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2017 Citrix Systems # 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', ...
gpl-3.0
yograterol/django
tests/model_formsets_regress/tests.py
182
20697
from __future__ import unicode_literals from django import forms from django.forms.formsets import DELETION_FIELD_NAME, BaseFormSet from django.forms.models import ( BaseModelFormSet, inlineformset_factory, modelform_factory, modelformset_factory, ) from django.forms.utils import ErrorDict, ErrorList from djan...
bsd-3-clause
pniedzielski/fb-hackathon-2013-11-21
src/repl.it/jsrepl/extern/python/closured/lib/python2.7/UserList.py
327
3644
"""A more or less complete user-defined wrapper around list objects.""" import collections class UserList(collections.MutableSequence): def __init__(self, initlist=None): self.data = [] if initlist is not None: # XXX should this accept an arbitrary sequence? if type(initlis...
agpl-3.0
jyotsna1820/django
django/conf/locale/en_AU/formats.py
148
2111
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j M Y' # '25 Oc...
bsd-3-clause
valtech-mooc/edx-platform
lms/djangoapps/instructor_analytics/tests/test_csvs.py
175
4757
""" Tests for analytics.csvs """ from django.test import TestCase from nose.tools import raises from instructor_analytics.csvs import create_csv_response, format_dictlist, format_instances class TestAnalyticsCSVS(TestCase): """ Test analytics rendering of csv files.""" def test_create_csv_response_nodata(s...
agpl-3.0
iamutkarshtiwari/kivy
kivy/tests/test_doc_gallery.py
38
1210
from doc.gallery import * def test_parse_docstring_info(): assert 'error' in parse_docstring_info("No Docstring") assert 'error' in parse_docstring_info("'''No Docstring Title'''") assert 'error' in parse_docstring_info("'''No Sentence\n======\nPeriods'''") assert 'error' in parse_docstring_info( ...
mit
xbmc/atv2
xbmc/lib/libPython/Python/Lib/test/test_pow.py
43
4456
import test.test_support, unittest class PowTest(unittest.TestCase): def powtest(self, type): if type != float: for i in range(-1000, 1000): self.assertEquals(pow(type(i), 0), 1) self.assertEquals(pow(type(i), 1), type(i)) self.assertEquals(pow(t...
gpl-2.0
carlosb1/examples-python
crawlers/comment_for_hashtag.py
1
2398
import argparse import os import sys sys.path.append(os.path.join(sys.path[0], '../')) from instabot import Bot default_file_messages = 'example_message.txt' parser = argparse.ArgumentParser(add_help=True) parser.add_argument('-u', type=str, help="username") parser.add_argument('-p', type=str, help="password") parse...
gpl-2.0
dingdang2012/tlsprober
probedb/certs/models.py
3
14029
# Copyright 2010-2012 Opera Software ASA # # 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 ...
apache-2.0
szeged/servo
tests/wpt/web-platform-tests/tools/pywebsocket/mod_pywebsocket/extensions.py
23
26809
# Copyright 2012, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
mpl-2.0
DaanKrug/Rocker-Framework
samples/Rocker-Framework-Functional-Show-Case/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py
2698
3270
#!/usr/bin/env python # Copyright (c) 2011 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 easy_xml.py file. """ import gyp.easy_xml as easy_xml import unittest import StringIO class TestSequenceFunctions(...
gpl-3.0
dscorbett/pygments
pygments/lexers/solidity.py
4
3255
# -*- coding: utf-8 -*- """ pygments.lexers.solidity ~~~~~~~~~~~~~~~~~~~~~~~~ Lexers for Solidity. :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, bygroups, include, words from pygment...
bsd-2-clause
gjlawran/ckanext-bcgov
ckanext/bcgov/scripts/fix_single_quotes.py
6
2028
# Copyright 2015, Province of British Columbia # License: https://github.com/bcgov/ckanext-bcgov/blob/master/license import urllib2 import urllib import json import pprint import sys from base import (site_url, api_key) records = [] records_filename = './data/records_with_html_errors.txt' with open(records_file...
agpl-3.0
aimas/TuniErp-8.0
addons/procurement_jit/procurement_jit.py
244
1543
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2013 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
ep1cman/workload-automation
wlauto/instrumentation/hwmon/__init__.py
5
5018
# Copyright 2013-2015 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 w...
apache-2.0
wemanuel/smry
server-auth/ls/google-cloud-sdk/lib/googlecloudsdk/gcloud/sdktools/auth/print_refresh_token.py
11
1051
# Copyright 2013 Google Inc. All Rights Reserved. """A hidden command that prints access tokens. """ from oauth2client import client from googlecloudsdk.calliope import base from googlecloudsdk.calliope import exceptions as c_exc from googlecloudsdk.core import log from googlecloudsdk.core.credentials import store a...
apache-2.0
iABC2XYZ/abc
DM/BTL/T1.py
1
4591
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Wed Oct 11 16:51:40 2017 Author: Peiyong Jiang : jiangpeiyong@impcas.ac.cn Function: """ import matplotlib.pyplot as plt #import tensorflow as tf import numpy as np #from basicTF import Quad4D, Drift4D,TwissO4D plt.close('all') def MapQuad(K,L): ...
gpl-3.0
kinnou02/navitia
source/jormungandr/tests/proxy_realtime_synthese_integration_tests.py
3
12676
# coding=utf-8 # Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility an...
agpl-3.0
chupikov/sendmail.py
watch.py
1
1036
#!/usr/bin/env python3 """Runs FilesystemWatcher application 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 version. This program is ...
gpl-2.0
sporkchops81/titleplant
lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/chardetect.py
1786
2504
#!/usr/bin/env python """ Script which takes one or more file paths and reports on their detected encodings Example:: % chardetect somefile someotherfile somefile: windows-1252 with confidence 0.5 someotherfile: ascii with confidence 1.0 If no paths are provided, it takes its input from stdin. """ from...
gpl-3.0
bblay/iris
lib/iris/tests/test_pp_to_cube.py
2
10648
# (C) British Crown Copyright 2010 - 2013, 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...
gpl-3.0
ashwyn/eden-message_parser
private/templates/DRRPP/maintenance.py
20
2677
# -*- coding: utf-8 -*- from datetime import timedelta from gluon import * #from s3 import * # ============================================================================= class Daily(): """ Daily Maintenance Tasks """ def __call__(self): db = current.db request = current.request s...
mit
ibmdb/db2pythonbuildpack
vendor/distribute-0.6.36/setuptools/command/alias.py
135
2477
import distutils, os from setuptools import Command from distutils.util import convert_path from distutils import log from distutils.errors import * from setuptools.command.setopt import edit_config, option_base, config_file def shquote(arg): """Quote an argument for later parsing by shlex.split()""" for c in ...
mit
eonpatapon/contrail-controller
src/config/device-manager/device_manager/plugins/juniper/mx-e2/e2_conf.py
2
75953
# # Copyright (c) 2017 Juniper Networks, Inc. All rights reserved. # """ This file contains implementation of netconf interface for E2 services on physical router """ from ncclient import manager import datetime from lxml import etree from db import * from dm_utils import DMUtils from juniper_conf import JuniperConf ...
apache-2.0
BellScurry/gem5-fault-injection
ext/ply/test/yacc_nodoc.py
174
1506
# ----------------------------------------------------------------------------- # yacc_nodoc.py # # Rule with a missing doc-string # ----------------------------------------------------------------------------- import sys if ".." not in sys.path: sys.path.insert(0,"..") import ply.yacc as yacc from calclex import tok...
bsd-3-clause
Teagan42/home-assistant
homeassistant/components/tcp/sensor.py
3
4893
"""Support for TCP socket based sensors.""" import logging import select import socket import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( CONF_HOST, CONF_NAME, CONF_PAYLOAD, CONF_PORT, CONF_TIMEOUT, CONF_UNIT_OF_MEASUREMENT, ...
apache-2.0
guaix-ucm/numina
numina/dal/mockdal.py
3
1400
# # Copyright 2014-2015 Universidad Complutense de Madrid # # This file is part of Numina # # SPDX-License-Identifier: GPL-3.0+ # License-Filename: LICENSE.txt # """DAL Mock class""" from numina.core.utils import AlwaysSuccessRecipe from .stored import StoredProduct, StoredParameter from .stored import ObservingBloc...
gpl-3.0