repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
YangSongzhou/django
tests/utils_tests/test_jslex.py
153
9837
# -*- coding: utf-8 -*- """Tests for jslex.""" # originally from https://bitbucket.org/ned/jslex from __future__ import unicode_literals from django.test import SimpleTestCase from django.utils.jslex import JsLexer, prepare_js_for_gettext class JsTokensTest(SimpleTestCase): LEX_CASES = [ # ids ("...
bsd-3-clause
ovnicraft/edx-platform
common/lib/chem/chem/chemcalc.py
162
14775
from __future__ import division from fractions import Fraction from pyparsing import (Literal, StringEnd, OneOrMore, ParseException) import nltk from nltk.tree import Tree ARROWS = ('<->', '->') ## Defines a simple pyparsing tokenizer for chemical equations elements = ['Ac', 'Ag', 'Al', 'Am', 'Ar', 'As', 'At', 'Au',...
agpl-3.0
tempbottle/pulsar
pulsar/async/futures.py
5
11508
from collections import Mapping from inspect import isgeneratorfunction from functools import wraps, partial from asyncio import Future, CancelledError, TimeoutError, async, sleep from .consts import MAX_ASYNC_WHILE from .access import get_event_loop, LOGGER, isfuture, is_async __all__ = ['maybe_async', '...
bsd-3-clause
fishcorn/pylearn2
pylearn2/sandbox/lisa_rl/bandit/average_agent.py
44
2251
__author__ = "Ian Goodfellow" import numpy as np from theano import function from theano import tensor as T from pylearn2.compat import OrderedDict from pylearn2.sandbox.lisa_rl.bandit.agent import Agent from pylearn2.utils import sharedX class AverageAgent(Agent): """ A simple n-armed bandit playing agent...
bsd-3-clause
Erethon/synnefo
snf-cyclades-app/synnefo/logic/tests/rapi_pool_tests.py
9
2959
# Copyright (C) 2010-2014 GRNET S.A. # # 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 i...
gpl-3.0
ojengwa/oh-mainline
vendor/packages/python-openid/openid/yadis/xri.py
167
4383
# -*- test-case-name: openid.test.test_xri -*- """Utility functions for handling XRIs. @see: XRI Syntax v2.0 at the U{OASIS XRI Technical Committee<http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=xri>} """ import re XRI_AUTHORITIES = ['!', '=', '@', '+', '$', '('] try: unichr(0x10000) except ValueErr...
agpl-3.0
russel1237/scikit-learn
sklearn/gaussian_process/correlation_models.py
230
7630
# -*- coding: utf-8 -*- # Author: Vincent Dubourg <vincent.dubourg@gmail.com> # (mostly translation, see implementation details) # Licence: BSD 3 clause """ The built-in correlation models submodule for the gaussian_process module. """ import numpy as np def absolute_exponential(theta, d): """ Abs...
bsd-3-clause
lintzc/gpdb
src/test/tinc/ext/suds/metrics.py
211
2004
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) 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. # # This program is distributed in the hope that it will ...
apache-2.0
topic2k/EventGhost
lib27/site-packages/requests/packages/chardet/cp949prober.py
2801
1782
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
gpl-2.0
jumpjam/django-storages
storages/tests/s3boto.py
13
11381
import mock import datetime import urlparse from django.test import TestCase from django.core.files.base import ContentFile from boto.s3.key import Key from storages.backends import s3boto __all__ = ( 'ParseTsExtendedCase', 'SafeJoinTest', 'S3BotoStorageTests', #'S3BotoStorageFileTest...
bsd-3-clause
OpenUpgrade-dev/OpenUpgrade
addons/hr_payroll/wizard/hr_payroll_contribution_register_report.py
337
2074
# -*- 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...
agpl-3.0
daniell/django-notification
notification/lockfile.py
39
15067
""" lockfile.py - Platform-independent advisory file locks. Requires Python 2.5 unless you apply 2.4.diff Locking is done on a per-thread basis instead of a per-process basis. Usage: >>> lock = FileLock('somefile') >>> try: ... lock.acquire() ... except AlreadyLocked: ... print 'somefile', 'is locked alread...
mit
bob-the-hamster/commandergenius
project/jni/python/src/Lib/test/test_os.py
48
23971
# As a test suite for the os module, this is woefully inadequate, but this # does add tests for a few functions which have been determined to be more # portable than they had been thought to be. import os import unittest import warnings import sys from test import test_support warnings.filterwarnings("ignore", "tempn...
lgpl-2.1
ashengwang/node-gyp
gyp/pylib/gyp/generator/dump_dependency_json.py
899
2768
# 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. import collections import os import gyp import gyp.common import gyp.msvs_emulation import json import sys generator_supports_multiple_toolsets = True generator_...
mit
crobinso/virt-manager
virtinst/cloner.py
2
19014
# # Copyright 2013, 2015 Red Hat, Inc. # Copyright(c) FUJITSU Limited 2007. # # Cloning a virtual machine module. # # This work is licensed under the GNU GPLv2 or later. # See the COPYING file in the top-level directory. import re import os import libvirt from . import generatename from . import progress from . impo...
gpl-2.0
aronnem/IMProToo
examples/batch_makeQuicklooks.py
1
6396
# -*- coding: utf-8 -*- ''' Copyright (C) 2011,2012 Maximilian Maahn, IGMK (mmaahn@meteo.uni-koeln.de) make quicklooks from IMProToo NetCDF files. use: python batch_makeQuicklooks.py pathIn pathOut site requires: numpy, matplotlib, netcdf4-python or python-netcdf ''' import sys import numpy as np import glob i...
gpl-3.0
sherazkasi/SabreSoftware
Lib/site-packages/numpy/core/code_generators/numpy_api.py
54
13599
"""Here we define the exported functions, types, etc... which need to be exported through a global C pointer. Each dictionary contains name -> index pair. Whenever you change one index, you break the ABI (and the ABI version number should be incremented). Whenever you add an item to one of the dict, the API needs to ...
gpl-3.0
woggle/mesos-old
third_party/boto-2.0b2/boto/cloudfront/distribution.py
4
19098
# 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...
apache-2.0
xkollar/spacewalk
backend/server/repomd/view.py
10
14048
# # Copyright (c) 2008--2015 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a c...
gpl-2.0
hopeall/odoo
addons/l10n_et/__openerp__.py
387
1968
#-*- coding:utf-8 -*- ############################################################################## # # Copyright (C) 2012 Michael Telahun Makonnen <mmakonnen@gmail.com>. # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero G...
agpl-3.0
zerebubuth/mapnik
scons/scons-local-2.5.0/SCons/Job.py
3
16096
"""SCons.Job This module defines the Serial and Parallel classes that execute tasks to complete a build. The Jobs class provides a higher level interface to start, stop, and wait on jobs. """ # # Copyright (c) 2001 - 2016 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining ...
lgpl-2.1
jakirkham/lazyflow
lazyflow/utility/io/tiledVolume.py
2
18511
import os import numpy import vigra from functools import partial from StringIO import StringIO ## Instead of importing requests and PIL here, ## use late imports (below) so people who don't use TiledVolume don't have to have them # New dependency: requests is way more convenient than urllib or httplib #import reque...
lgpl-3.0
zsiciarz/django
tests/utils_tests/test_numberformat.py
25
3750
from decimal import Decimal from sys import float_info from unittest import TestCase from django.utils.numberformat import format as nformat class TestNumberFormat(TestCase): def test_format_number(self): self.assertEqual(nformat(1234, '.'), '1234') self.assertEqual(nformat(1234.2, '.'), '1234.2...
bsd-3-clause
ThiagoGarciaAlves/intellij-community
python/lib/Lib/site-packages/django/conf/global_settings.py
73
20942
# Default Django settings. Override these with settings in the module # pointed-to by the DJANGO_SETTINGS_MODULE environment variable. # This is defined here as a do-nothing function because we can't import # django.utils.translation -- that module depends on the settings. gettext_noop = lambda s: s #################...
apache-2.0
openmv/openmv
scripts/examples/OpenMV/09-Feature-Detection/keypoints_save.py
4
1209
# Keypoints descriptor example. # This example shows how to save a keypoints descriptor to file. Show the camera an object # and then run the script. The script will extract and save a keypoints descriptor and the image. # You can use the keypoints_editor.py util to remove unwanted keypoints. # # NOTE: Please reset the...
mit
111pontes/ydk-py
cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_infra_correlator_oper.py
1
63673
""" Cisco_IOS_XR_infra_correlator_oper This module contains a collection of YANG definitions for Cisco IOS\-XR infra\-correlator package operational data. This module contains definitions for the following management objects\: suppression\: Suppression operational data correlator\: correlator Copyright (c) 2013...
apache-2.0
JimCircadian/ansible
lib/ansible/modules/storage/netapp/na_ontap_interface.py
8
13359
#!/usr/bin/python """ this is interface module (c) 2018, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) """ from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status...
gpl-3.0
benthomasson/ansible
lib/ansible/modules/network/f5/bigip_gtm_facts.py
78
16084
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2016 F5 Networks 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 # ...
gpl-3.0
nguyentu1602/numpy
numpy/distutils/command/install.py
240
3127
from __future__ import division, absolute_import, print_function import sys if 'setuptools' in sys.modules: import setuptools.command.install as old_install_mod have_setuptools = True else: import distutils.command.install as old_install_mod have_setuptools = False from distutils.file_util import write...
bsd-3-clause
FreicoinAlliance/p2pool
SOAPpy/Parser.py
158
36216
# SOAPpy modules from Config import Config from Types import * from NS import NS from Utilities import * import string import fpconst import xml.sax from wstools.XMLname import fromXMLname try: from M2Crypto import SSL except: pass ident = '$Id: Parser.py 1497 2010-03-08 06:06:52Z pooryorick $' from ve...
gpl-3.0
magic0704/neutron
neutron/agent/linux/dhcp.py
2
38663
# Copyright 2012 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...
apache-2.0
repotvsupertuga/tvsupertuga.repository
plugin.video.youtube/resources/lib/kodion/impl/abstract_context_ui.py
31
1364
__author__ = 'bromix' class AbstractContextUI(object): def __init__(self): pass def create_progress_dialog(self, heading, text=None, background=False): raise NotImplementedError() def set_view_mode(self, view_mode): raise NotImplementedError() def get_view_mode(self): ...
gpl-2.0
Parsely/Petrel
petrel/petrel/emitter.py
3
1030
import os import sys import storm class EmitterBase(object): DEFAULT_PYTHON = 'python%d.%d' % (sys.version_info.major, sys.version_info.minor) def __init__(self, script): # We assume 'script' is in the current directory. We simply get the # base part and turn it into a .py name for inclusion ...
bsd-3-clause
barentsen/dave
pipeline/task.py
1
6229
# -*- coding: utf-8 -*- from multiprocessing import pool import multiprocessing import contextlib import clipboard import traceback import parmap import signal import time import pdb import sys __version__ = "$Id: task.py 2130 2015-09-11 16:56:55Z fmullall $" __URL__ = "$URL: svn+ssh://flux/home/fmullall/svn/kepler...
mit
krishna11888/ai
third_party/pattern/test/test_metrics.py
21
17844
import os, sys; sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) import unittest import time import math from pattern import metrics try: PATH = os.path.dirname(os.path.realpath(__file__)) except: PATH = "" #------------------------------------------------------------------------------------...
gpl-2.0
kressi/erpnext
erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.py
39
3748
# 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 from frappe import _ from erpnext.accounts.report.accounts_receivable.accounts_receivable import get_ageing_data from frappe.utils import ...
gpl-3.0
Hndrx616/Group-Clustering
python_Lib/bs4/bs4/element.py
4
49509
import collections import re import sys import warnings from bs4.dammit import EntitySubstitution DEFAULT_OUTPUT_ENCODING = "utf-8" PY3K = (sys.version_info[0] > 2) whitespace_re = re.compile("\s+") def _alias(attr): """Alias one attribute name to another for backward compatibility""" @property def alias...
gpl-3.0
paulbnjl/PySerSpec
PySerSpec/ASC_nozzle.py
1
1507
#-*- coding: UTF-8 -* ############################################################################ ############################################################################ #### Person responsible for this pure evil spaghetti code : #### #### Paul Bonijol -> paul [.] bnjl ['AT'] gmail [.] com #### #### Works...
gpl-3.0
rishilification/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/applywatchlistlocal_unittest.py
128
2653
# Copyright (c) 2011 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 ...
bsd-3-clause
miing/mci_migo
identityprovider/migrations/0007_auto__add_field_invalidatedemailaddress_date_invalidated__add_field_in.py
1
19118
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from identityprovider.models import InvalidatedEmailAddress class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'InvalidatedEmailAddress.date_invalidated...
agpl-3.0
jamespcole/home-assistant
homeassistant/components/websocket_api/http.py
1
6675
"""View to accept incoming websocket connection.""" import asyncio from contextlib import suppress from functools import partial import json import logging from aiohttp import web, WSMsgType import async_timeout from homeassistant.const import EVENT_HOMEASSISTANT_STOP from homeassistant.core import callback from home...
apache-2.0
bgris/ODL_bgris
lib/python3.5/site-packages/pygments/styles/fruity.py
31
1298
# -*- coding: utf-8 -*- """ pygments.styles.fruity ~~~~~~~~~~~~~~~~~~~~~~ pygments version of my "fruity" vim theme. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Token, Co...
gpl-3.0
dsweet04/rekall
rekall-core/rekall/plugins/overlays/darwin/darwin.py
1
54906
# Rekall Memory Forensics # Copyright 2013 Google Inc. All Rights Reserved. # # 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 ver...
gpl-2.0
hongliang5623/sentry
src/sentry/api/endpoints/organization_access_request_details.py
22
2318
from __future__ import absolute_import from rest_framework import serializers from rest_framework.response import Response from sentry.api.bases.organization import OrganizationEndpoint from sentry.api.exceptions import ResourceDoesNotExist from sentry.models import ( AuditLogEntryEvent, OrganizationAccessRequest...
bsd-3-clause
mzweilin/pdfrw
pdfrw/objects/pdfstring.py
1
2811
# A part of pdfrw (pdfrw.googlecode.com) # Copyright (C) 2006-2012 Patrick Maupin, Austin, Texas # MIT license -- See LICENSE.txt for details import re class PdfString(str): ''' A PdfString is an encoded string. It has a decode method to get the actual string data out, and there is an encode cla...
mit
jacquesd/indico
doc/dev/source/conf.py
2
6719
# -*- coding: utf-8 -*- # # cds-indico documentation build configuration file, created by # sphinx-quickstart on Sun Nov 29 13:19:24 2009. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # ...
gpl-3.0
henri-hulski/cartridge_braintree
cartridge_braintree/countries.py
2
7200
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ # This module defines the dictionary of countries (ISO-3166) supported by # Braintree, with Alpha2 codes as keys and translatable country names as values # Data originally copied from # https://de...
bsd-2-clause
ryano144/intellij-community
plugins/hg4idea/testData/bin/hgext/convert/darcs.py
94
7726
# darcs.py - darcs support for the convert extension # # Copyright 2007-2009 Matt Mackall <mpm@selenic.com> and others # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from common import NoRepo, checktool, commandline, commit, con...
apache-2.0
docker-infra/ansible-modules-core
network/basics/slurp.py
134
2115
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <michael.dehaan@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...
gpl-3.0
gaddman/ansible
lib/ansible/modules/cloud/misc/virt_pool.py
43
21722
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Maciej Delmanowski <drybjed@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 = {'metadata_version': '1.1...
gpl-3.0
sradl1981/LIGGGHTS-PUBLIC-ParScale
tools/moltemplate/common/amber/amberparm_dihedral_to_lt.py
8
5261
#!/usr/bin/env python # SOME UGLY CODE HERE import sys lines_gaff = sys.stdin.readlines() dihedral_style_name = 'fourier' in_dihedral_coeffs = [] for i in range(0, len(lines_gaff)): line = lines_gaff[i] atypes = line[:11].split('-') atype1 = atypes[0].strip() atype2 = atypes[1].strip() atype3 =...
gpl-2.0
SoftwareIntrospectionLab/MininGit
pycvsanaly2/AsyncQueue.py
2
4434
# Copyright (C) 2008 Libresoft # # 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 distributed in the ...
gpl-2.0
yuyu2172/chainercv
tests/links_tests/model_tests/test_pickable_sequential_chain.py
3
8325
import numpy as np import unittest import chainer from chainer.backends.cuda import to_cpu from chainer.function import Function from chainer import testing from chainer.testing import attr from chainercv.links import PickableSequentialChain from chainercv.utils.testing import ConstantStubLink class DummyFunc(Funct...
mit
blablack/beatslash-lv2
waflib/extras/javatest.py
53
4133
#! /usr/bin/env python # encoding: utf-8 # Federico Pellegrin, 2017 (fedepell) """ Provides Java Unit test support using :py:class:`waflib.Tools.waf_unit_test.utest` task via the **javatest** feature. This gives the possibility to run unit test and have them integrated into the standard waf unit test environment. It ...
gpl-3.0
cpe/VAMDC-VALD
nodes/IDEADB/node/models.py
3
12054
""" This module defines the database schema of the node. Each model class defines a table in the database. The fields define the columns of this table. """ # library import from django.db.models import * from django.core.exceptions import ValidationError from vamdctap import bibtextools import re import datetime ...
gpl-3.0
SimonSapin/servo
tests/wpt/webgl/tests/closure-library/closure/bin/build/depswriter.py
135
6286
#!/usr/bin/env python # # Copyright 2009 The Closure Library 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 ...
mpl-2.0
jabesq/home-assistant
homeassistant/components/netdata/sensor.py
7
4799
"""Support gathering system information of hosts which are running netdata.""" from datetime import timedelta import logging import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( CONF_HOST, CONF_ICON, CONF_NAME, CONF_PORT, CONF_RESOURCES) from homea...
apache-2.0
skerit/romcollectionbrowser
resources/lib/dialogbase.py
11
3363
import xbmc, xbmcgui import os import util, config from util import * ACTION_CANCEL_DIALOG = (9,10,51,92,110) CONTROL_BUTTON_EXIT = 5101 class DialogBaseEdit(xbmcgui.WindowXMLDialog): def getControlById(self, controlId): try: control = self.getControl(controlId) except: return None...
gpl-2.0
phenoxim/nova
nova/tests/functional/api/openstack/placement/db/test_resource_class_cache.py
1
6056
# 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 # d...
apache-2.0
huanpc/IoT-1
gui/controller/.venv/lib/python3.5/site-packages/django/contrib/gis/utils/wkt.py
589
1923
""" Utilities for manipulating Geometry WKT. """ from django.utils import six def precision_wkt(geom, prec): """ Returns WKT text of the geometry according to the given precision (an integer or a string). If the precision is an integer, then the decimal places of coordinates WKT will be truncated t...
mit
zerc/django
django/template/response.py
84
5682
from django.http import HttpResponse from django.utils import six from .loader import get_template, select_template class ContentNotRenderedError(Exception): pass class SimpleTemplateResponse(HttpResponse): rendering_attrs = ['template_name', 'context_data', '_post_render_callbacks'] def __init__(self...
bsd-3-clause
xionzz/earthquake
venv/lib/python2.7/site-packages/numpy/core/numerictypes.py
37
29192
""" numerictypes: Define the numeric type objects This module is designed so "from numerictypes import \\*" is safe. Exported symbols include: Dictionary with all registered number types (including aliases): typeDict Type objects (not all will be available, depends on platform): see variable sctypes fo...
mit
javiplx/cobbler-old_jobs
cobbler/yaml/stream.py
12
5417
""" pyyaml legacy Copyright (c) 2001 Steve Howell and Friends; All Rights Reserved (see open source license information in docs/ directory) """ import re import string def indentLevel(line): n = 0 while n < len(line) and line[n] == ' ': n = n + 1 return n class LineNumberStream: ...
gpl-2.0
finoradin/automation-tools
transfers/examples/tms.py
1
4164
#!/usr/bin/env python from __future__ import print_function import json import os import sys import urllib2 import ast import csv def main(transfer_path): basename = os.path.basename(transfer_path) try: comp_num, comp_id, obj_id = basename.split('---') except ValueError: return 1 # pr...
agpl-3.0
bcheung92/Paperproject
gem5/src/mem/slicc/generate/dot.py
92
2077
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood # Copyright (c) 2009 The Hewlett-Packard Development Company # 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 co...
mit
jalexvig/tensorflow
tensorflow/contrib/factorization/python/ops/factorization_ops_test_utils.py
116
6182
# 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...
apache-2.0
scripteed/mtasa-blue
vendor/google-breakpad/src/tools/gyp/test/win/gyptest-link-large-pdb.py
218
2332
#!/usr/bin/env python # Copyright (c) 2013 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. """ Make sure msvs_large_pdb works correctly. """ import TestGyp import struct import sys CHDIR = 'large-pdb' def CheckImageAndPdb(tes...
gpl-3.0
sxjscience/tvm
python/tvm/micro/compiler.py
1
11811
# 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...
apache-2.0
ThiagoGarciaAlves/intellij-community
python/lib/Lib/rfc822.py
89
33167
"""RFC 2822 message manipulation. Note: This is only a very rough sketch of a full RFC-822 parser; in particular the tokenizing of addresses does not adhere to all the quoting rules. Note: RFC 2822 is a long awaited update to RFC 822. This module should conform to RFC 2822, and is thus mis-named (it's not worth rena...
apache-2.0
dsm054/pandas
pandas/tests/plotting/test_boxplot_method.py
3
16170
# coding: utf-8 import pytest import itertools import string from pandas import Series, DataFrame, MultiIndex from pandas.compat import range, lzip import pandas.util.testing as tm import pandas.util._test_decorators as td import numpy as np from numpy import random import pandas.plotting as plotting from pandas.t...
bsd-3-clause
shuggiefisher/crowdstock
django/conf/locale/fr/formats.py
232
1530
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j F Y' TIME_FORMAT = 'H:i:s' DATETIME_FORMAT = 'j F Y H:i:s' YEAR_MONTH_F...
bsd-3-clause
BeyondTheClouds/nova
nova/block_device.py
6
20984
# Copyright 2011 Isaku Yamahata <yamahata@valinux co jp> # 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...
apache-2.0
csminpp/docker-1.9.1
vendor/src/github.com/hashicorp/go-msgpack/codec/msgpack_test.py
1232
3478
#!/usr/bin/env python # This will create golden files in a directory passed to it. # A Test calls this internally to create the golden files # So it can process them (so we don't have to checkin the files). import msgpack, msgpackrpc, sys, os, threading def get_test_data_list(): # get list with all primitive typ...
apache-2.0
studio1247/gertrude
generation/export_tablette.py
1
5449
# -*- coding: utf-8 -*- # This file is part of Gertrude. # # Gertrude 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
pwendell/mesos
third_party/libprocess/third_party/gmock-1.6.0/gtest/test/gtest_test_utils.py
397
10437
#!/usr/bin/env python # # Copyright 2006, 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...
apache-2.0
mamaddeveloper/telegrambot
modules/mod_xkcd.py
2
1742
from modules.module_base import ModuleBase import requests from lxml import html from urllib.parse import urljoin from urllib.request import urlretrieve class ModuleXKCD(ModuleBase): def __init__(self, bot): ModuleBase.__init__(self, bot) self.name = "xkcd" def getXKCDImage(self, chat, path = ...
mit
rdo-management/tuskar
tuskar/tests/test_utils.py
1
3658
# Copyright 2011 Justin Santa Barbara # Copyright 2012 Hewlett-Packard Development Company, L.P. # # 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/lic...
apache-2.0
nrwahl2/ansible
lib/ansible/plugins/test/files.py
62
1339
# (c) 2015, Ansible, 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 di...
gpl-3.0
ULHPC/modules
easybuild/easybuild-easyblocks/easybuild/easyblocks/j/java.py
12
1652
## # Copyright 2012-2015 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # the Hercules foundation (htt...
mit
rockyzhang/zhangyanhit-python-for-android-mips
python-build/python-libs/gdata/src/gdata/tlslite/FileObject.py
359
6807
"""Class returned by TLSConnection.makefile().""" class FileObject: """This class provides a file object interface to a L{tlslite.TLSConnection.TLSConnection}. Call makefile() on a TLSConnection to create a FileObject instance. This class was copied, with minor modifications, from the _fileobject...
apache-2.0
Tehsmash/nova
nova/api/openstack/compute/contrib/certificates.py
79
2729
# Copyright (c) 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 ...
apache-2.0
DirtyUnicorns/android_external_chromium-org
mojo/public/bindings/generators/mojom_pack.py
23
4051
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import mojom # mojom_pack provides a mechanism for determining the packed order and offsets # of a mojom.Struct. # # ps = mojom_pack.PackedStruct(struct) # ...
bsd-3-clause
fivejjs/inasafe
safe_qgis/test_map.py
1
9228
"""**Tests for map creation in QGIS plugin.** """ __author__ = 'Tim Sutton <tim@linfiniti.com>' __revision__ = '$Format:%H$' __date__ = '01/11/2010' __license__ = "GPL" __copyright__ = 'Copyright 2012, Australia Indonesia Facility for ' __copyright__ += 'Disaster Reduction' import unittest from unittest import expec...
gpl-3.0
jasonthomas/zamboni
mkt/api/exceptions.py
6
2724
from django.conf import settings from django.core.signals import got_request_exception from rest_framework import status from rest_framework.exceptions import APIException, ParseError as DRFParseError from rest_framework.response import Response from rest_framework.views import exception_handler class AlreadyPurchas...
bsd-3-clause
oliciv/youtube-dl
youtube_dl/extractor/wimp.py
37
1647
from __future__ import unicode_literals from .common import InfoExtractor from .youtube import YoutubeIE class WimpIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?wimp\.com/(?P<id>[^/]+)/' _TESTS = [{ 'url': 'http://www.wimp.com/maruexhausted/', 'md5': 'ee21217ffd66d058e8b16be340b74883', ...
unlicense
dbckz/ansible
contrib/inventory/spacewalk.py
19
8810
#!/usr/bin/env python """ Spacewalk external inventory script ================================= Ansible has a feature where instead of reading from /etc/ansible/hosts as a text file, it can query external programs to obtain the list of hosts, groups the hosts are in, and even variables to assign to each host. To use...
gpl-3.0
Alkxzv/zoonas
django/apps/comments/views.py
1
4479
from django.contrib import messages as msg from django.core.exceptions import PermissionDenied from django.http import HttpResponseRedirect from django.utils.translation import ugettext as _ from django.views.generic.detail import SingleObjectMixin from django.views.generic.edit import FormView, ProcessFormView from n...
gpl-3.0
skirsdeda/django
tests/decorators/tests.py
47
9902
from functools import wraps, update_wrapper from unittest import TestCase import warnings from django.contrib.admin.views.decorators import staff_member_required from django.contrib.auth.decorators import login_required, permission_required, user_passes_test from django.http import HttpResponse, HttpRequest, HttpRespo...
bsd-3-clause
swiftstack/swift
test/unit/common/middleware/s3api/test_cfg.py
3
1196
# Copyright (c) 2014 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 ...
apache-2.0
utkbansal/kuma
kuma/wiki/feeds.py
5
15307
"""Feeds for documents""" import datetime import json from django.conf import settings from django.db.models import F from django.contrib.syndication.views import Feed from django.utils.html import escape from django.utils.feedgenerator import (SyndicationFeed, Rss201rev2Feed, A...
mpl-2.0
PaulKinlan/cli-caniuse
site/app/scripts/bower_components/jsrepl-build/extern/python/closured/lib/python2.7/encodings/zlib_codec.py
533
3015
""" Python 'zlib_codec' Codec - zlib compression encoding Unlike most of the other codecs which target Unicode, this codec will return Python string objects for both encode and decode. Written by Marc-Andre Lemburg (mal@lemburg.com). """ import codecs import zlib # this codec needs the optional zlib modu...
apache-2.0
detiber/ansible
lib/ansible/utils/helpers.py
34
1270
# (c) 2016, Ansible by Red Hat <info@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, either version 3 of the License, or # (at your option) any later v...
gpl-3.0
erikr/django
django/utils/functional.py
25
14721
import copy import operator import warnings from functools import total_ordering, wraps from django.utils import six from django.utils.deprecation import RemovedInDjango20Warning # You can't trivially replace this with `functools.partial` because this binds # to classes and returns bound instances, whereas functools...
bsd-3-clause
ChinaQuants/blaze
blaze/compute/tests/test_pyfunc.py
16
2071
import datetime from blaze.compute.pyfunc import symbol, lambdify, cos, math, broadcast from blaze.compute.pyfunc import _print_python from blaze.expr.broadcast import broadcast_collect t = symbol('t', '{x: int, y: int, z: int, when: datetime}') def test_simple(): f = lambdify([t], t.x + t.y) assert f((1, ...
bsd-3-clause
mathspace/django
tests/flatpages_tests/test_sitemaps.py
380
1326
from __future__ import unicode_literals from django.apps import apps from django.contrib.sites.models import Site from django.test import TestCase from django.test.utils import modify_settings, override_settings @override_settings( ROOT_URLCONF='flatpages_tests.urls', SITE_ID=1, ) @modify_settings( INSTA...
bsd-3-clause
40223246/0622cdb-Final-TEST2-1
static/Brython3.1.1-20150328-091302/Lib/site-packages/header.py
409
2444
from browser import document as doc from browser.html import * trans_menu = { 'menu_console':{'en':'Console','es':'Consola','fr':'Console', 'pt':'Console'}, 'menu_editor':{'en':'Editor','es':'Editor','fr':'Editeur', 'pt':'Editor'}, 'menu_gallery':{'en':'Gallery','es':'Galería','fr':'Galerie', 'pt':'Galeri...
gpl-3.0
michaelray/Iristyle-ChocolateyPackages
EthanBrown.SublimeText2.UtilPackages/tools/PackageCache/Package Control/package_control/clients/readme_client.py
9
2434
import re import os import base64 try: # Python 3 from urllib.parse import urlencode except (ImportError): # Python 2 from urllib import urlencode from .json_api_client import JSONApiClient from ..downloaders.downloader_exception import DownloaderException # Used to map file extensions to formats _r...
mit
avneesh91/django
django/core/management/commands/sqlmigrate.py
48
2742
from django.core.management.base import BaseCommand, CommandError from django.db import DEFAULT_DB_ALIAS, connections from django.db.migrations.executor import MigrationExecutor from django.db.migrations.loader import AmbiguityError class Command(BaseCommand): help = "Prints the SQL statements for the named migra...
bsd-3-clause
JerryLead/spark
examples/src/main/python/ml/dataframe_example.py
72
2670
# # 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...
apache-2.0
harlequin/sickbeard
lib/hachoir_core/error.py
90
1350
""" Functions to display an error (error, warning or information) message. """ from lib.hachoir_core.log import log from lib.hachoir_core.tools import makePrintable import sys, traceback def getBacktrace(empty="Empty backtrace."): """ Try to get backtrace as string. Returns "Error while trying to get back...
gpl-3.0