repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
vvv1559/intellij-community
python/lib/Lib/site-packages/django/core/serializers/pyyaml.py
108
2081
""" YAML serializer. Requires PyYaml (http://pyyaml.org/), but that's checked for in __init__. """ from StringIO import StringIO import decimal import yaml from django.db import models from django.core.serializers.python import Serializer as PythonSerializer from django.core.serializers.python import Deserializer as...
apache-2.0
Trixter69/BookMarka
lib/cherrypy/lib/auth.py
68
3224
import cherrypy from cherrypy.lib import httpauth def check_auth(users, encrypt=None, realm=None): """If an authorization header contains credentials, return True or False. """ request = cherrypy.serving.request if 'authorization' in request.headers: # make sure the provided credentials are co...
gpl-3.0
amarullz/libaroma
libs/freetype/src/tools/docmaker/tohtml.py
55
23387
# # tohtml.py # # A sub-class container of the `Formatter' class to produce HTML. # # Copyright 2002-2015 by # David Turner. # # This file is part of the FreeType project, and may only be used, # modified, and distributed under the terms of the FreeType project # license, LICENSE.TXT. By continuing to use, mo...
apache-2.0
vntarasov/openpilot
selfdrive/crash.py
1
2009
"""Install exception handler for process crash.""" import os import sys import threading import capnp from selfdrive.version import version, dirty from selfdrive.swaglog import cloudlog from common.hardware import PC if os.getenv("NOLOG") or os.getenv("NOCRASH") or PC: def capture_exception(*args, **kwargs): pa...
mit
netfoo/volatility
volatility/registry.py
57
6699
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # # Derived from source in PyFlag developed by: # Copyright 2004: Commonwealth of Australia. # Michael Cohen <scudette@users.sourceforge.net> # David Collett <daveco@users.sourceforge.net> # # Subclassing plugin code developed by: # # Mike Auty <mike.auty@gm...
gpl-2.0
gurneyalex/odoo
addons/website_slides/tests/test_security.py
7
12127
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.addons.website_slides.tests import common from odoo.exceptions import AccessError, UserError from odoo.tests import tagged from odoo.tests.common import users from odoo.tools import mute_logger @tagged('secur...
agpl-3.0
def-/commandergenius
project/jni/python/src/Lib/test/test_logging.py
48
29218
#!/usr/bin/env python # # Copyright 2001-2004 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright n...
lgpl-2.1
Pokechu22/Burger
burger/toppings/objects.py
2
5569
#!/usr/bin/env python # -*- coding: utf8 -*- """ Copyright (c) 2011 Tyler Kenendy <tk@tkte.ch> 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...
mit
jeonghoonkang/BerePi
apps/logger/berepi_logger.py
1
1372
# -*- coding: utf-8 -*- # author : http://github.com/jeonghoonkang import logging #import logging.config from logging.handlers import RotatingFileHandler #logging.config.fileConfig('logging.conf') LOG_FILENAME = "/home/pi/devel/BerePi/logs/berelogger.log" logger = logging.getLogger('BereLogger') logger.setLevel(logg...
bsd-2-clause
kraja1/bfgminer-bfgminer
api-example.py
13
1510
#!/usr/bin/python # Copyright 2013 Christian Berendt # Copyright 2013 Luke Dashjr # # 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...
gpl-3.0
cvsuser-chromium/chromium
chrome/common/extensions/docs/examples/apps/hello-python/main.py
148
5230
#!/usr/bin/env python # 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. from google.appengine.ext import webapp from google.appengine.ext.webapp import util from google.appengine.api import users from go...
bsd-3-clause
beni55/django
django/conf/project_template/project_name/settings.py
31
2745
""" Django settings for {{ project_name }} project. Generated by 'django-admin startproject' using Django {{ django_version }}. For more information on this file, see https://docs.djangoproject.com/en/{{ docs_version }}/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.c...
bsd-3-clause
wanglongqi/sympy
sympy/geometry/point.py
33
28002
"""Geometrical Points. Contains ======== Point Point2D Point3D """ from __future__ import division, print_function from sympy.core import S, sympify from sympy.core.compatibility import iterable, range from sympy.core.containers import Tuple from sympy.simplify import nsimplify, simplify from sympy.geometry.excepti...
bsd-3-clause
fluxer/spm
nuitka/nuitka/codegen/IdCodes.py
1
1739
# Copyright 2016, Kay Hayen, mailto:kay.hayen@gmail.com # # Part of "Nuitka", an optimizing Python compiler that is compatible and # integrates with CPython, but also works on its own. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complianc...
gpl-2.0
koichi626/hadoop-gpu
hadoop-gpu-0.20.1/build/contrib/hod/hodlib/Hod/hod.py
182
29420
#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 use thi...
apache-2.0
tquilian/exeNext
exe/engine/error.py
15
1664
# =========================================================================== # eXe # Copyright 2004-2006, University of Auckland # # Config settings loaded from exe.conf # Is responsible for the system-wide settings we use # # This program is free software; you can redistribute it and/or modify # it under the terms of...
gpl-2.0
endlessm/chromium-browser
third_party/catapult/third_party/gsutil/third_party/rsa/rsa/common.py
81
4640
# -*- coding: utf-8 -*- # # Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu> # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Un...
bsd-3-clause
mkret2/root
tutorials/pyroot/DynamicSlice.py
7
3847
## \file ## \ingroup tutorial_pyroot ## Example of function called when a mouse event occurs in a pad. ## When moving the mouse in the canvas, a second canvas shows the ## projection along X of the bin corresponding to the Y position ## of the mouse. The resulting histogram is fitted with a gaussian. ## A "dynamic" lin...
lgpl-2.1
ashishnerkar1/scrapy
scrapy/utils/defer.py
33
3241
""" Helper functions for dealing with Twisted deferreds """ from twisted.internet import defer, reactor, task from twisted.python import failure from scrapy.exceptions import IgnoreRequest def defer_fail(_failure): """Same as twisted.internet.defer.fail, but delay calling errback until next reactor loop ...
bsd-3-clause
VimanyuAgg/Have_a_seat
nltk_data/taggers/universal_tagset/universal_tags.py
3
2883
''' Interface for converting POS tags from various treebanks to the universal tagset of Petrov, Das, & McDonald. The tagset consists of the following 12 coarse tags: VERB - verbs (all tenses and modes) NOUN - nouns (common and proper) PRON - pronouns ADJ - adjectives ADV - adverbs ADP - adpositions (prepositions an...
apache-2.0
high5g/hospital
Highfive_Hospital/web/bundles/high5hospitalpatient/eternicode-bootstrap-datepicker-809a5c2/docs/conf.py
46
7918
# -*- coding: utf-8 -*- # # bootstrap-datepicker documentation build configuration file, created by # sphinx-quickstart on Fri Aug 2 14:45:57 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated ...
mit
wangjun/jinja2
tests/test_loader.py
21
8121
# -*- coding: utf-8 -*- """ jinja2.testsuite.loader ~~~~~~~~~~~~~~~~~~~~~~~ Test the loaders. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import os import sys import tempfile import shutil import pytest from jinja2 import Environment, loaders from jinj...
bsd-3-clause
andrewyoung1991/abjad
abjad/tools/pitchtools/test/test_pitchtools_PitchSet_from_selection.py
2
1108
# -*- encoding: utf-8 -*- from abjad import * def test_pitchtools_PitchSet_from_selection_01(): r'''Works with notes. ''' note = Note(13, (1, 4)) pitch_set = pitchtools.PitchSet.from_selection(note) assert len(pitch_set) == 1 def test_pitchtools_PitchSet_from_selection_02(): r'''Works with ...
gpl-3.0
bjolivot/ansible
lib/ansible/playbook/task_include.py
92
2704
# (c) 2012-2014, 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 the License, or # (at your option) an...
gpl-3.0
pdellaert/ansible
lib/ansible/module_utils/connection.py
8
7622
# # This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete ...
gpl-3.0
darktears/chromium-crosswalk
chromecast/tools/build/chromecast_repack_locales.py
24
4485
#!/usr/bin/env python # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Helper script to repack paks for a list of locales. Gyp doesn't have any built-in looping capability, so this just provides a way t...
bsd-3-clause
cokirix/p2pool
p2pool/util/datachunker.py
288
1407
import collections class StringBuffer(object): 'Buffer manager with great worst-case behavior' def __init__(self, data=''): self.buf = collections.deque([data]) self.buf_len = len(data) self.pos = 0 def __len__(self): return self.buf_len - self.pos def add...
gpl-3.0
mrmarkhurlburt/django_media_library
catalog/views.py
1
4650
from django.shortcuts import render # Create your views here. from .models import Book, Author, BookInstance, Genre, Language def index(request): """ View function for home page of site. """ # Generate counts of some of the main objects num_books=Book.objects.all().count() num_instances=BookI...
cc0-1.0
karyon/django
django/core/management/commands/squashmigrations.py
162
8767
from django.conf import settings from django.core.management.base import BaseCommand, CommandError from django.db import DEFAULT_DB_ALIAS, connections, migrations from django.db.migrations.loader import AmbiguityError, MigrationLoader from django.db.migrations.migration import SwappableTuple from django.db.migrations.o...
bsd-3-clause
berguner/svmap
assemble.py
1
6568
import sys import shutil import subprocess import argparse import os import commands from multiprocessing import Pool parser = argparse.ArgumentParser(description='Assemble reads extracted from each region') parser.add_argument('--bed', help='.bed file of SV regions', type=str) parser.add_argument('--dipspades', help=...
gpl-3.0
gkarlin/django-jenkins
build/Django/tests/regressiontests/generic_views/base.py
42
14853
from __future__ import absolute_import import time from django.core.exceptions import ImproperlyConfigured from django.http import HttpResponse from django.test import TestCase, RequestFactory from django.utils import unittest from django.views.generic import View, TemplateView, RedirectView from . import views cla...
lgpl-3.0
rwakulszowa/servo
tests/wpt/css-tests/tools/py/testing/io_/test_saferepr.py
162
2388
# -*- coding: utf-8 -*- from __future__ import generators import py import sys saferepr = py.io.saferepr class TestSafeRepr: def test_simple_repr(self): assert saferepr(1) == '1' assert saferepr(None) == 'None' def test_maxsize(self): s = saferepr('x'*50, maxsize=25) assert l...
mpl-2.0
marrow/WebCore
example/annotation.py
1
2204
# encoding: utf-8 """Python 3 function annotation and AnnotationExtension example.""" from json import dumps class Root: def __init__(self, context): self._ctx = context def tmpl(self) -> 'mako:./template.html': return dict() def mul(self, a: int = None, b: int = None) -> 'json': """Multiply two values...
mit
vorwerkc/pymatgen
pymatgen/analysis/chemenv/coordination_environments/voronoi.py
5
44209
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ This module contains the object used to describe the possible bonded atoms based on a Voronoi analysis. """ __author__ = "David Waroquiers" __copyright__ = "Copyright 2012, The Materials Project" __credit...
mit
abesto/fig
tests/unit/split_buffer_test.py
3
1474
from __future__ import unicode_literals from __future__ import absolute_import from compose.cli.utils import split_buffer from .. import unittest class SplitBufferTest(unittest.TestCase): def test_single_line_chunks(self): def reader(): yield b'abc\n' yield b'def\n' yiel...
apache-2.0
havard024/prego
crm/lib/python2.7/site-packages/sphinx/domains/rst.py
11
4254
# -*- coding: utf-8 -*- """ sphinx.domains.rst ~~~~~~~~~~~~~~~~~~ The reStructuredText domain. :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from sphinx import addnodes from sphinx.domains import Domain, ObjType from sphinx...
mit
gautamkmr/incubator-mxnet
tools/caffe_converter/caffe_parser.py
31
2767
# 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
wattad169/sportbuddy_server
lib/django/core/serializers/json.py
320
3782
""" Serialize data to/from JSON """ # Avoid shadowing the standard library json module from __future__ import absolute_import, unicode_literals import datetime import decimal import json import sys import uuid from django.core.serializers.base import DeserializationError from django.core.serializers.python import ( ...
bsd-3-clause
tedder/ansible
lib/ansible/plugins/doc_fragments/onyx.py
44
3063
# -*- coding: utf-8 -*- # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) class ModuleDocFragment(object): # Standard files documentation fragment DOCUMENTATION = r''' options: provider: description: - A dict object containing connection details. ty...
gpl-3.0
FNCS/ns-3.26
src/mpi/bindings/modulegen__gcc_LP64.py
38
220836
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
sgraham/nope
third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer_unittest.py
45
3916
# Copyright (C) 2013 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
avedaee/DIRAC
Interfaces/scripts/dirac-admin-add-user.py
15
2988
#!/usr/bin/env python ######################################################################## # $HeadURL$ ######################################################################## __RCSID__ = "$Id$" import DIRAC from DIRAC.Core.Base import Script userName = None userDN = None userMail...
gpl-3.0
leighpauls/k2cro4
native_client_sdk/src/build_tools/sdk_tools/sdk_update_main.py
2
11039
#!/usr/bin/env python # 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. # CMD code copied from git_cl.py in depot_tools. import config import cStringIO import download import json import logging import ...
bsd-3-clause
tchernomax/ansible
lib/ansible/modules/network/f5/bigip_software_image.py
6
14441
#!/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', ...
gpl-3.0
yungyuc/solvcon
ftests/gasplus/test_tube_2d_triangle_regular.py
2
11859
#!/usr/bin/env python # -*- coding: UTF-8 -*- # # Copyright (c) 2017, Yung-Yu Chen <yyc@solvcon.net> # # 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 ret...
bsd-3-clause
kblomqvist/yasha
yasha/cli.py
1
9767
""" The MIT License (MIT) Copyright (c) 2015-2021 Kim Blomqvist Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, ...
mit
compmetagen/micca
micca/tp/muscle.py
1
1664
## Copyright 2016 Davide Albanese <davide.albanese@gmail.com> ## Copyright 2016 Fondazione Edmund Mach (FEM) ## This file is part of micca. ## ## micca 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 ...
gpl-3.0
tersmitten/ansible-modules-core
system/authorized_key.py
55
15877
#!/usr/bin/python # -*- coding: utf-8 -*- """ Ansible module to add authorized_keys for ssh logins. (c) 2012, Brad Olson <brado@movedbylight.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 ...
gpl-3.0
zanderle/django
tests/basic/tests.py
97
29877
from __future__ import unicode_literals import threading import warnings from datetime import datetime, timedelta from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist from django.db import DEFAULT_DB_ALIAS, DatabaseError, connections from django.db.models.fields import Field from django.db.m...
bsd-3-clause
ChenJunor/hue
desktop/core/ext-py/tablib-0.10.0/tablib/packages/xlrd3/biffh.py
54
17755
# Support module for the xlrd3 package. # # Portions copyright (c) 2005-2008 Stephen John Machin, Lingfo Pty Ltd # This module is part of the xlrd package, which is released under a # BSD-style licence. # # 2010-12-08 mozman refactoring for python 3 # 2008-02-10 SJM BIFF2 BLANK record # 2008-02-08 SJM Preparati...
apache-2.0
wuga214/Django-Wuga
env/lib/python2.7/site-packages/django/db/migrations/writer.py
58
11569
from __future__ import unicode_literals import os import re from importlib import import_module from django import get_version from django.apps import apps from django.db import migrations from django.db.migrations.loader import MigrationLoader from django.db.migrations.serializer import serializer_factory from djang...
apache-2.0
eptmp3/Sick-Beard
lib/requests/packages/chardet/langbulgarianmodel.py
235
12820
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client 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 R...
gpl-3.0
sdarji/lpthw
Lib/encodings/cp864.py
593
33919
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP864.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): ...
unlicense
elmerdpadilla/iv
addons/account/wizard/account_report_account_balance.py
378
1741
# -*- 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
cuongnv23/ansible
lib/ansible/modules/cloud/ovirt/ovirt_datacenter.py
18
7530
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat, Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or #...
gpl-3.0
djgagne/scikit-learn
sklearn/linear_model/tests/test_randomized_l1.py
214
4690
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # License: BSD 3 clause import numpy as np from scipy import sparse from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.linear_model.randomized_l1 i...
bsd-3-clause
i5on9i/echoserver
lib/markupsafe/tests.py
674
6107
# -*- coding: utf-8 -*- import gc import sys import unittest from markupsafe import Markup, escape, escape_silent from markupsafe._compat import text_type class MarkupTestCase(unittest.TestCase): def test_adding(self): # adding two strings should escape the unsafe one unsafe = '<script type="appl...
apache-2.0
mat650/metagoofil
hachoir_parser/audio/modplug.py
95
10655
""" Modplug metadata inserted into module files. Doc: - http://modplug.svn.sourceforge.net/viewvc/modplug/trunk/modplug/soundlib/ Author: Christophe GISQUET <christophe.gisquet@free.fr> Creation: 10th February 2007 """ from hachoir_core.field import (FieldSet, UInt32, UInt16, UInt8, Int8, Float32, RawBytes, ...
gpl-2.0
adit-chandra/tensorflow
tensorflow/lite/experimental/micro/examples/micro_speech/apollo3/compare_1k.py
11
5011
# Copyright 2018 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
costypetrisor/scikit-learn
sklearn/gaussian_process/tests/test_gaussian_process.py
267
6813
""" Testing for Gaussian Process module (sklearn.gaussian_process) """ # Author: Vincent Dubourg <vincent.dubourg@gmail.com> # Licence: BSD 3 clause from nose.tools import raises from nose.tools import assert_true import numpy as np from sklearn.gaussian_process import GaussianProcess from sklearn.gaussian_process ...
bsd-3-clause
nhippenmeyer/django
django/template/backends/base.py
584
2894
# Since this package contains a "django" module, this is required on Python 2. from __future__ import absolute_import from django.core.exceptions import ( ImproperlyConfigured, SuspiciousFileOperation, ) from django.template.utils import get_app_template_dirs from django.utils._os import safe_join from django.util...
bsd-3-clause
gerald-yang/ubuntu-iotivity-demo
grovepi/pygrovepi/grove_oled/grove_i2c_oled_96x96_hello_world.py
9
1970
#!/usr/bin/env python # # GrovePi Example for using the Grove OLED Display 96*96 (http://www.seeedstudio.com/wiki/Grove_-_OLED_Display_1.12%22) # # The GrovePi connects the Raspberry Pi and Grove sensors. You can learn more about GrovePi here: http://www.dexterindustries.com/GrovePi # # Have a question about this exa...
apache-2.0
thechampanurag/django-oscar
src/oscar/apps/address/forms.py
28
1105
from django.conf import settings from django import forms from oscar.core.loading import get_model from oscar.views.generic import PhoneNumberMixin UserAddress = get_model('address', 'useraddress') class AbstractAddressForm(forms.ModelForm): def __init__(self, *args, **kwargs): """ Set fields i...
bsd-3-clause
AOSP-S4-KK/platform_external_chromium_org
native_client_sdk/src/build_tools/sdk_tools/command/list.py
152
1736
# 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. def List(remote_manifest, local_manifest, display_revisions): any_bundles_need_update = False print 'Bundles:' print ' I: installed\n *: update ava...
bsd-3-clause
JioCloud/cinder
cinder/quota.py
7
40237
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # 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 ...
apache-2.0
westerhofffl/appengine-mapreduce
python/src/mapreduce/api/map_job/mapper.py
31
1923
#!/usr/bin/env python """Interface for user defined mapper.""" from mapreduce import shard_life_cycle # pylint: disable=protected-access # pylint: disable=invalid-name # TODO(user): Move common APIs to parent class. class Mapper(shard_life_cycle._ShardLifeCycle): """Interface user's mapper should implement. Ea...
apache-2.0
youprofit/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/thread/messagepump.py
151
2482
# Copyright (c) 2010 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
sinergatis/pathagar
accounts/migrations/0002_auto_20160222_1003.py
2
2599
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('accounts', '0001_initial'), ] operations = [ migrations.RemoveField( model_name='profile', name='fav...
gpl-2.0
marcmo/delegates
.ycm_extra_conf.py
2
6345
# This file is NOT licensed under the GPLv3, which is the license for the rest # of YouCompleteMe. # # Here's the license text for this file: # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either...
mit
mpetyx/palmdrop
venv/lib/python2.7/site-packages/cms/plugins/text/migrations/0002_freeze.py
30
2475
# -*- coding: utf-8 -*- from south.db import db from django.db import models from cms.plugins.text.models import * class Migration: def forwards(self, orm): "Write your forwards migration here" def backwards(self, orm): "Write your backwards migration here" models =...
apache-2.0
TeamTwisted/external_chromium_org
third_party/protobuf/python/google/protobuf/internal/reflection_cpp_generated_test.py
215
4054
#! /usr/bin/python # -*- coding: utf-8 -*- # # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following cond...
bsd-3-clause
drxaero/calibre
src/calibre/ebooks/oeb/writer.py
24
2728
''' Directory output OEBBook writer. ''' from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2008, Marshall T. Vandegrift <llasram@gmail.com>' import os from calibre.ebooks.oeb.base import OPF_MIME, xml2str from calibre.ebooks.oeb.base import DirContainer, OEBError __all__ = ['OEBWriter']...
gpl-3.0
samthor/intellij-community
python/helpers/pydev/tests_runfiles/test_pydevd_property.py
56
4121
''' Created on Aug 22, 2011 @author: hussain.bohra @author: fabioz ''' import os import sys import unittest #======================================================================================================================= # Test #================================================================================...
apache-2.0
matthaywardwebdesign/rethinkdb
external/v8_3.30.33.16/build/gyp/test/library/gyptest-static.py
430
2241
#!/usr/bin/env python # Copyright (c) 2009 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. """ Verifies simple build of a "Hello, world!" program with static libraries, including verifying that libraries are rebuilt correctly when ...
agpl-3.0
4022321818/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/imp.py
637
9839
"""This module provides the components needed to build your own __import__ function. Undocumented functions are obsolete. In most cases it is preferred you consider using the importlib module's functionality over this module. """ # (Probably) need to stay in _imp from _imp import (lock_held, acquire_lock, release_lo...
gpl-3.0
tuxxy/CloudBot
plugins/youtube.py
16
5563
import re import time import isodate import requests from cloudbot import hook from cloudbot.util import timeformat from cloudbot.util.formatting import pluralize youtube_re = re.compile(r'(?:youtube.*?(?:v=|/v/)|youtu\.be/|yooouuutuuube.*?id=)([-_a-zA-Z0-9]+)', re.I) base_url = 'https://www.googleapis.com/youtube...
gpl-3.0
varunarya10/heat
heat/db/sqlalchemy/migrate_repo/versions/015_grizzly.py
4
6650
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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
ntymtsiv/CloudFerry
cloudferrylib/os/actions/cleanup_images.py
9
1638
# Copyright (c) 2014 Mirantis 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, so...
apache-2.0
triskadecaepyon/pyworkout-toolkit
pyworkout/parsers/tcxtools.py
1
4560
""" Tools to process TCX files, specifically for parsing and converting to other formats. """ import numpy as np import pandas as pd from lxml import objectify import dateutil.parser import logging TPXNS = "{http://www.garmin.com/xmlschemas/ActivityExtension/v2}TPX" LXNS = "{http://www.garmin.com/xmlschemas/ActivityE...
bsd-3-clause
cdondrup/strands_qsr_lib
qsr_lib/dbg/dbg_template_bounding_boxes_qsrs.py
8
2711
#!/usr/bin/python # import numpy as np from matplotlib import pyplot as plt from matplotlib.patches import Rectangle class Dbg(object): def __init__(self): pass def return_bounding_box_2d(self, x, y, xsize, ysize): """Return the bounding box :param x: x center :param y: y cen...
mit
scs/uclinux
lib/libxml2/libxml2-2.7.3/python/tests/error.py
87
1055
#!/usr/bin/python -u # # This test exercise the redirection of error messages with a # functions defined in Python. # import sys import libxml2 # Memory debug specific libxml2.debugMemory(1) expect='--> I/O --> warning : --> failed to load external entity "missing.xml"\n' err="" def callback(ctx, str): global er...
gpl-2.0
Ensighten/Diamond
src/collectors/unbound/test/testunbound.py
31
9021
#!/usr/bin/python # coding=utf-8 ########################################################################## from test import CollectorTestCase from test import get_collector_config from test import unittest from mock import Mock from mock import patch from diamond.collector import Collector from unbound import Unbou...
mit
tinloaf/home-assistant
homeassistant/components/sensor/duke_energy.py
8
2457
""" Support for Duke Energy Gas and Electric meters. For more details about this component, please refer to the documentation at https://home-assistant.io/components/sensor.duke_energy/ """ import logging import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const im...
apache-2.0
habnabit/pip
tests/lib/path.py
56
6574
# flake8: noqa # -*- coding: utf-8 -*- # Author: Aziz Köksal from __future__ import absolute_import import glob import os import sys import shutil try: from os import supports_fd except ImportError: supports_fd = set() if sys.version_info >= (3,): unicode = str u = str else: unicode = unicode ...
mit
michaeltchapman/kubernetes
cluster/juju/charms/trusty/kubernetes-master/unit_tests/test_install.py
105
4115
#!/usr/bin/env python # Copyright 2015 The Kubernetes Authors All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unle...
apache-2.0
Grk0/python-libconf
setup.py
1
1185
from setuptools import setup setup( name='libconf', version='2.0.1', description="A pure-Python libconfig reader/writer with permissive license", long_description=open('README.rst').read(), author="Christian Aichinger", author_email="Greek0@gmx.net", url='https://github.com/Grk0/python-libc...
mit
sensepost/Snoopy
snoopy/server/bin/snoopy/src/snoopy/db/models.py
4
3432
"""Contains all SQLAlchemy ORM models.""" from cryptacular import bcrypt from sqlalchemy import Column from sqlalchemy import Boolean, CHAR, DateTime, Integer, Numeric, SmallInteger, String from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.ext.hybrid import hybrid_property crypt = bcrypt.BCRYPT...
mit
40223117cda/cda
static/Brython3.1.1-20150328-091302/Lib/_thread.py
740
4879
"""Drop-in replacement for the thread module. Meant to be used as a brain-dead substitute so that threaded code does not need to be rewritten for when the thread module is not present. Suggested usage is:: try: import _thread except ImportError: import _dummy_thread as _thread """ # Exports ...
gpl-3.0
B-MOOC/configuration
playbooks/roles/gh_mirror/files/repos_from_orgs.py
79
3314
#!/usr/bin/python # Given a list of repos in a yaml # file will create or update mirrors # # Generates /var/tmp/repos.json from # a yaml file containing a list of # github organizations import yaml import sys import requests import json import subprocess import os import logging import fcntl from os.path imp...
agpl-3.0
browseinfo/odoo_saas3_nicolas
addons/l10n_fr_rib/bank.py
39
4961
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 Numérigraphe SARL. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Genera...
agpl-3.0
nvoron23/hue
desktop/core/src/desktop/api2.py
4
2227
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
apache-2.0
tedder/ansible
test/units/modules/network/routeros/test_routeros_facts.py
49
4308
# 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 distributed in the hope that ...
gpl-3.0
jyotsna1820/django
django/core/checks/model_checks.py
525
2390
# -*- coding: utf-8 -*- from __future__ import unicode_literals import inspect import types from django.apps import apps from django.core.checks import Error, Tags, register @register(Tags.models) def check_all_models(app_configs=None, **kwargs): errors = [] for model in apps.get_models(): if app_co...
bsd-3-clause
imoseyon/leanKernel-d2usc-deprecated
external/webkit/Tools/Scripts/webkitpy/tool/commands/sheriffbot.py
15
4417
# Copyright (c) 2009 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...
gpl-2.0
LumaPictures/rez
src/rez/utils/sourcecode.py
1
11788
from rez.utils.formatting import indent from rez.utils.data_utils import cached_property from rez.utils.logging_ import print_debug from inspect import getsourcelines from textwrap import dedent from glob import glob import traceback import os.path import imp def early(): """Used by functions in package.py to har...
lgpl-3.0
josephpbuarao/Preside-CMS
support/docs/source/conf.py
2
10367
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Preside CMS documentation build configuration file, created by # sphinx-quickstart on Sun May 18 22:23:25 2014. # # 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 ...
gpl-2.0
joone/chromium-crosswalk
tools/grit/grit/format/policy_templates/writers/admx_writer_unittest.py
41
21095
#!/usr/bin/env python # 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. """Unittests for grit.format.policy_templates.writers.admx_writer.""" import os import sys import unittest if __name__ == '__mai...
bsd-3-clause
myerpengine/odoo
addons/report/tests/test_reports.py
385
2251
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
AloneRoad/Inforlearn
vendor/django/forms/util.py
12
2577
from django.utils.html import conditional_escape from django.utils.encoding import smart_unicode, StrAndUnicode, force_unicode from django.utils.safestring import mark_safe def flatatt(attrs): """ Convert a dictionary of attributes to a single string. The returned string will contain a leading space follow...
apache-2.0
tealover/nova
nova/pci/utils.py
52
4704
# Copyright (c) 2013 Intel, Inc. # Copyright (c) 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/li...
apache-2.0