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
chiragjogi/odoo
addons/website_forum/models/res_users.py
281
5198
# -*- coding: utf-8 -*- from datetime import datetime from urllib import urlencode import hashlib from openerp import SUPERUSER_ID from openerp.osv import osv, fields class Users(osv.Model): _inherit = 'res.users' def __init__(self, pool, cr): init_res = super(Users, self).__init__(pool, cr) ...
agpl-3.0
gptech/ansible
lib/ansible/playbook/__init__.py
83
4214
# (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
achals/servo
tests/wpt/web-platform-tests/tools/py/py/_io/saferepr.py
273
2483
import py import sys builtin_repr = repr reprlib = py.builtin._tryimport('repr', 'reprlib') class SafeRepr(reprlib.Repr): """ subclass of repr.Repr that limits the resulting size of repr() and includes information on exceptions raised during the call. """ def repr(self, x): return self._c...
mpl-2.0
prrvchr/GContactOOo
CloudContactOOo/OAuth2OOo/python/enum/__init__.py
24
31101
"""Python Enumerations""" import sys as _sys __all__ = ['Enum', 'IntEnum', 'unique'] version = 1, 1, 10 pyver = float('%s.%s' % _sys.version_info[:2]) try: any except NameError: def any(iterable): for element in iterable: if element: return True return False try...
gpl-3.0
h3biomed/ansible
test/runner/units/test_diff.py
203
2975
"""Tests for diff module.""" import os import subprocess import pytest from lib.diff import ( parse_diff, FileDiff, ) def get_diff(base, head=None): """Return a git diff between the base and head revision. :type base: str :type head: str | None :rtype: list[str] """ if not head or hea...
gpl-3.0
sreecha/grpc
tools/interop_matrix/client_matrix.py
1
14790
#!/usr/bin/env python2.7 # Copyright 2017 gRPC authors. # # 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 la...
apache-2.0
omeid/binutils-gdb
gdb/testsuite/gdb.python/py-completion.py
18
1935
# Copyright (C) 2014 Free Software Foundation, Inc. # 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...
gpl-2.0
sgraham/nope
testing/gtest/test/gtest_color_test.py
3259
4911
#!/usr/bin/env python # # Copyright 2008, 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...
bsd-3-clause
KirillMysnik/obs-ws-rc
tests/test_client.py
1
5311
# ============================================================================= # >> IMPORTS # ============================================================================= # Python import asyncio import logging import sys import unittest # obs-ws-rc from obswsrc import OBSWS from obswsrc.client import AuthError from ...
mit
osvalr/odoo
addons/survey/__openerp__.py
261
2391
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms...
agpl-3.0
pyroscope/pyrocore
src/pyrocore/torrent/filter.py
1
2552
# -*- coding: utf-8 -*- # pylint: disable=I0011 """ rTorrent Item Filter Jobs. Copyright (c) 2012 The PyroScope Project <pyroscope.project@gmail.com> """ # 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...
gpl-2.0
sergiocorato/odoomrp-wip
procurement_orderpoint_no_confirm/models/procurement_order.py
29
1362
# -*- 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
yewang15215/django
django/core/mail/backends/filebased.py
558
2771
"""Email backend that writes messages to a file.""" import datetime import os from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.mail.backends.console import \ EmailBackend as ConsoleEmailBackend from django.utils import six class EmailBackend(ConsoleEmailB...
bsd-3-clause
gram526/VTK
ThirdParty/Twisted/twisted/trial/test/test_doctest.py
31
1715
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test Twisted's doctest support. """ from twisted.trial import itrial, runner, unittest, reporter from twisted.trial.test import mockdoctest class TestRunners(unittest.SynchronousTestCase): """ Tests for Twisted's doctest support. ...
bsd-3-clause
AnthonyHullDiamond/scanning
org.eclipse.scanning.points/scripts/numpy/jycore.py
2
50530
### # Copyright (c) 2016 Diamond Light Source Ltd. # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html # # Contributors: # Pe...
epl-1.0
mohsenSy/zulip
zerver/lib/rate_limiter.py
14
8043
from __future__ import absolute_import from six import text_type from typing import Any, Iterator, Tuple from django.conf import settings from zerver.lib.redis_utils import get_redis_client from six.moves import zip from zerver.models import UserProfile import redis import time import logging # Implement a rate-li...
apache-2.0
Itxaka/st2
st2actions/tests/unit/test_queue_consumers.py
11
6266
# Licensed to the StackStorm, Inc ('StackStorm') 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 th...
apache-2.0
ChrisGoedhart/Uforia
source/django/contrib/gis/tests/__init__.py
75
4666
from django.conf import settings from django.test.simple import build_suite, DjangoTestSuiteRunner from django.utils import unittest def run_tests(*args, **kwargs): from django.test.simple import run_tests as base_run_tests return base_run_tests(*args, **kwargs) def geo_apps(namespace=True, runtests=False): ...
gpl-2.0
codelion/pathgrind
fuzz/gui.py
3
21403
#!/usr/bin/env python # This file is part of Fuzzgrind. # Copyright (C) 2009 Gabriel Campana # # This work is licensed under the terms of the GNU GPL, version 3. # See the LICENSE file in the top-level directory. # http://faq.pygtk.org/index.py?req=index import gobject import pango import pygtk pygtk.requi...
gpl-3.0
crazy-canux/django
django/contrib/staticfiles/management/commands/runserver.py
216
1360
from django.conf import settings from django.contrib.staticfiles.handlers import StaticFilesHandler from django.core.management.commands.runserver import \ Command as RunserverCommand class Command(RunserverCommand): help = "Starts a lightweight Web server for development and also serves static files." d...
bsd-3-clause
houzhenggang/hiwifi-openwrt-HC5661-HC5761
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/root-ralink/usr/lib/python2.7/cookielib.py
31
64448
"""HTTP cookie handling for web clients. This module has (now fairly distant) origins in Gisle Aas' Perl module HTTP::Cookies, from the libwww-perl library. Docstrings, comments and debug strings in this code refer to the attributes of the HTTP cookie system as cookie-attributes, to distinguish them clearly from Pyth...
gpl-2.0
flochaz/horizon
openstack_dashboard/test/tests/policy.py
14
3514
# Copyright (c) 2013 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/licenses/LICENSE-2.0 # # Unless re...
apache-2.0
shoelzer/buildbot
master/buildbot/test/unit/test_db_dbconfig.py
10
4039
# This file is part of Buildbot. Buildbot is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
bodi000/odoo
addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/tools.py
384
1576
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
anarchivist/nyples
nyples.py
1
6074
#!/usr/bin/env PYTHONPATH=/home/matienzo/lib/python2.4/site-packages python2.4 """ nyples.py """ import pymarc import web from Ft.Xml import InputSource from Ft.Xml.Xslt.Processor import Processor from Ft.Lib import UriException from PyZ3950 import zoom import urllib2 urls = ('/', 'usage', '/opac/(.*)', 'opac...
mit
jasonabele/gnuradio
gr-noaa/apps/file_rx_hrpt.py
9
11669
#!/usr/bin/env python ################################################## # Gnuradio Python Flow Graph # Title: USRP HRPT Receiver # Generated: Mon Nov 9 07:47:17 2009 ################################################## from gnuradio import eng_notation from gnuradio import gr from gnuradio import noaa from gnuradio im...
gpl-3.0
jnns/wagtail
wagtail/contrib/wagtailapi/utils.py
13
1299
from django.conf import settings from django.utils.six.moves.urllib.parse import urlparse from wagtail.wagtailcore.models import Page class BadRequestError(Exception): pass class URLPath(object): """ This class represents a URL path that should be converted to a full URL. It is used when the domai...
bsd-3-clause
sYnfo/samba-1
third_party/dnspython/dns/rdtypes/ANY/RRSIG.py
76
5736
# Copyright (C) 2004-2007, 2009-2011 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 "...
gpl-3.0
sam-geek/mbed
workspace_tools/make.py
5
11382
#! /usr/bin/env python """ mbed SDK Copyright (c) 2011-2013 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable...
apache-2.0
ariakerstein/twitterFlaskClone
project/lib/python2.7/site-packages/werkzeug/posixemulation.py
364
3519
# -*- coding: utf-8 -*- r""" werkzeug.posixemulation ~~~~~~~~~~~~~~~~~~~~~~~ Provides a POSIX emulation for some features that are relevant to web applications. The main purpose is to simplify support for systems such as Windows NT that are not 100% POSIX compatible. Currently this only imple...
mit
Achint08/open-event-orga-server
migrations/env.py
8
2925
from __future__ import with_statement from alembic import context from sqlalchemy import engine_from_config, pool from logging.config import fileConfig import logging from flask import current_app # this is the Alembic Config object, which provides # access to the values within the .ini file in use. config = context....
gpl-3.0
retomerz/intellij-community
python/helpers/pydev/tests_pydevd_mainloop/gui-wx.py
46
3355
#!/usr/bin/env python """ A Simple wx example to test PyDev's event loop integration. To run this: 1) Enable the PyDev GUI event loop integration for wx 2) do an execfile on this script 3) ensure you have a working GUI simultaneously with an interactive console Ref: Modified from wxPython source code wxPython/samp...
apache-2.0
root-mirror/root
bindings/pyroot_legacy/JupyROOT/helpers/handlers.py
19
5658
# -*- coding:utf-8 -*- #----------------------------------------------------------------------------- # Authors: Danilo Piparo # Omar Zapata <Omar.Zapata@cern.ch> http://oproject.org #----------------------------------------------------------------------------- ##############################################...
lgpl-2.1
oblitum/ycmd
ycmd/tests/__init__.py
3
2695
# Copyright (C) 2016-2017 ycmd contributors # # This file is part of ycmd. # # ycmd 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
istrategylabs/mo-django
{{cookiecutter.repo_name}}/{{cookiecutter.package_name}}/settings.py
1
6441
""" Django settings for {{ cookiecutter.project_name }} project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ import os import dj_database_url from decouple im...
mit
crlang/sublime-text---front-end-config
Data/Packages/pygments/all/pygments/formatters/html.py
12
31252
# -*- coding: utf-8 -*- """ pygments.formatters.html ~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for HTML output. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from __future__ import print_function import os import sys import os.path from ...
mit
sputnick-dev/weboob
modules/happn/module.py
4
12367
# -*- coding: utf-8 -*- # Copyright(C) 2014 Roger Philibert # # This file is part of weboob. # # weboob 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 License, or # (at yo...
agpl-3.0
udrg/rpg_svo
svo_analysis/src/svo_analysis/hand_eye_calib.py
17
7489
# -*- coding: utf-8 -*- """ Created on Sun Aug 4 15:47:55 2013 @author: cforster """ import os import yaml import numpy as np import svo_analysis.tum_benchmark_tools.associate as associate import vikit_py.align_trajectory as align_trajectory import vikit_py.transformations as transformations import matplotlib.pyplot ...
gpl-3.0
RichardLitt/wyrd-django-dev
tests/regressiontests/admin_views/tests.py
4
170858
# coding: utf-8 from __future__ import absolute_import, unicode_literals import os import re import datetime try: from urllib.parse import urljoin except ImportError: # Python 2 from urlparse import urljoin from django.conf import settings, global_settings from django.core import mail from django.core.exc...
bsd-3-clause
meabsence/python-for-android
python-build/python-libs/gdata/src/gdata/tlslite/SharedKeyDB.py
359
1914
"""Class for storing shared keys.""" from utils.cryptomath import * from utils.compat import * from mathtls import * from Session import Session from BaseDB import BaseDB class SharedKeyDB(BaseDB): """This class represent an in-memory or on-disk database of shared keys. A SharedKeyDB can be passed to a s...
apache-2.0
thinkopensolutions/l10n-brazil
finan/tests/test_finan_lancamento_a_pagar_2.py
2
3821
# -*- coding: utf-8 -*- # Copyright 2018 KMEE # Bianca Bartolomei <bianca.bartolomei@kmee.com.br> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from openerp import fields import openerp.tests.common as test_common class FinanLancamentoPagarManual(test_common.SingleTransactionCase): def setUp(s...
agpl-3.0
hopshadoop/hops-util-py
hops/featurestore_impl/dao/featuregroups/online_featuregroup.py
1
1470
from hops import constants class OnlineFeaturegroup(): """ Represents an online featuregroup in the featurestore """ def __init__(self, online_featuregroup_json): """ Initialize the online feature group from JSON payload Args: :online_featuregroup_json: JSON repres...
apache-2.0
tickbox-smc-ltd/xfero
src/xfero/workflow_manager/transform_filename.py
1
15518
#!/usr/bin/env python '''Transform Filename''' import logging.config import os from /xfero/ import get_conf as get_conf from /xfero/.workflow_manager import copy_file as renameFile try: (xfero_logger,.xfero_database, outbound_directory, transient_directory, error_directory, xfero_pid) = get_conf.get.xfero_con...
agpl-3.0
rohe/saml2test2
src/saml2test/check/html.py
2
1054
import re import sys import inspect from aatest.check import Check from aatest.check import CRITICAL from aatest.check import TestResult from aatest.events import EV_HTML_SRC __author__ = 'roland' class VerifyPage(Check): """ Verify that the specified patterns appear in the HTML page """ cid = "veri...
bsd-2-clause
leiferikb/bitpop
build/scripts/slave/unittests/expect_tests/handle_test.py
1
3382
# 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. import sys import time import collections from cStringIO import StringIO from .type_definitions import Handler, Failure from .serialize import GetCurrentDa...
gpl-3.0
endlessm/chromium-browser
third_party/catapult/dashboard/dashboard/add_histograms.py
1
17019
# Copyright 2017 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. """URL endpoint for adding new histograms to the dashboard.""" from __future__ import print_function from __future__ import division from __future__ import a...
bsd-3-clause
Officine-KOIN/Officine-Koin
koin-ewb/share/qt/make_spinner.py
4415
1035
#!/usr/bin/env python # W.J. van der Laan, 2011 # Make spinning .mng animation from a .png # Requires imagemagick 6.7+ from __future__ import division from os import path from PIL import Image from subprocess import Popen SRC='img/reload_scaled.png' DST='../../src/qt/res/movies/update_spinner.mng' TMPDIR='/tmp' TMPNAM...
mit
cchamberlain/gyp
test/compiler-override/gyptest-compiler-env.py
100
3337
#!/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. """ Verifies that the user can override the compiler and linker using CC/CXX/LD environment variables. """ import TestGyp import os import co...
bsd-3-clause
MortimerGoro/servo
tests/wpt/web-platform-tests/tools/html5lib/html5lib/tokenizer.py
1710
76929
from __future__ import absolute_import, division, unicode_literals try: chr = unichr # flake8: noqa except NameError: pass from collections import deque from .constants import spaceCharacters from .constants import entities from .constants import asciiLetters, asciiUpper2Lower from .constants import digits, ...
mpl-2.0
lich/limf
limf/hostlist.py
2
1067
import urllib import json def retrieve_online_host_list(): try: url = "https://raw.githubusercontent.com/lich/limf/master/host_list.json" return json.loads(urllib.request.urlopen(url).read().decode('utf-8')) except urllib.error.URLError: print("Check your internet connection.") ...
mit
albertomurillo/ansible
lib/ansible/modules/system/firewalld.py
11
29835
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2013, Adam Miller <maxamillion@fedoraproject.org> # 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...
gpl-3.0
pli3/Openwebif
plugin/controllers/views/web/getservices.py
1
5531
#!/usr/bin/env python ################################################## ## DEPENDENCIES import sys import os import os.path try: import builtins as builtin except ImportError: import __builtin__ as builtin from os.path import getmtime, exists import time import types from Cheetah.Version import MinCompatib...
gpl-2.0
cpcloud/blaze
blaze/tests/test_interactive.py
2
12275
import datetime import sys from types import MethodType from datashape import dshape import pandas as pd import pandas.util.testing as tm import pytest import numpy as np from odo import into, append from odo.backends.csv import CSV from blaze import discover, transform from blaze.compatibility import pickle from bla...
bsd-3-clause
birocorneliu/youtube-dl
youtube_dl/extractor/youjizz.py
148
2297
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, ) class YouJizzIE(InfoExtractor): _VALID_URL = r'https?://(?:\w+\.)?youjizz\.com/videos/[^/#?]+-(?P<id>[0-9]+)\.html(?:$|[?#])' _TEST = { 'url': 'http://www.youjizz.com/video...
unlicense
printedheart/micropsi2
micropsi_core/micropsi_logger.py
2
4585
""" Logging classes for storing log records in memory so browser clients can fetch them. """ __author__ = 'rvuine' import os import logging import time from operator import itemgetter MAX_RECORDS_PER_STORAGE = 1000 class RecordWebStorageHandler(logging.Handler): def __init__(self, record_storage): ...
mit
zsiciarz/django
tests/db_functions/test_strindex.py
50
2592
from django.db.models import Value from django.db.models.functions import StrIndex from django.test import TestCase from django.utils import timezone from .models import Article, Author class StrIndexTests(TestCase): def test_annotate_charfield(self): Author.objects.create(name='George. R. R. Martin') ...
bsd-3-clause
bousmalis/models
street/python/vgslspecs.py
15
19565
# 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
wfxiang08/sqlalchemy
test/orm/test_subquery_relations.py
25
77964
from sqlalchemy.testing import eq_, is_, is_not_ from sqlalchemy import testing from sqlalchemy.testing.schema import Table, Column from sqlalchemy import Integer, String, ForeignKey, bindparam, inspect from sqlalchemy.orm import backref, subqueryload, subqueryload_all, \ mapper, relationship, clear_mappers, create...
mit
wwood/graftM
graftm/clusterer.py
2
4380
from graftm.deduplicator import Deduplicator from graftm.sequence_io import SequenceIO from graftm.orfm import OrfM import logging import os class Clusterer: def __init__(self): self.clust = Deduplicator() self.seqio = SequenceIO() self.seq_library = {} self.orfm_regex = OrfM.regu...
gpl-3.0
wweiradio/django
tests/unmanaged_models/tests.py
296
2174
from __future__ import unicode_literals from django.db import connection from django.test import TestCase from .models import A01, A02, B01, B02, C01, C02, Managed1, Unmanaged2 class SimpleTests(TestCase): def test_simple(self): """ The main test here is that the all the models can be created w...
bsd-3-clause
mohamed--abdel-maksoud/chromium.src
third_party/typ/setup.py
10
1764
# Copyright 2014 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
bsd-3-clause
varunarya10/rally
rally/deploy/engines/devstack.py
2
4853
# Copyright 2013: Mirantis Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
apache-2.0
sambiak/recommandation-film
compte rendu/recomendation_system_final.py
1
4773
import numpy as np import math from movielens import tableau_des_notes, tableau_bricole_de_l_lignes_et_c_colonnes def fonction_cout(Y, theta, X): """ :param Y: tableau de notes avec utilisateurs en lignes et films en colonnes :param theta: tableau avec des lignes de profils d'utilisateurs :param X: ta...
gpl-3.0
marmarek/anaconda
pyanaconda/anaconda_argparse.py
5
13981
# # anaconda_argparse.py: option parsing for anaconda (CLI and boot args) # # Copyright (C) 2012 Red Hat, 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 vers...
gpl-2.0
iWuzHere/node-gyp
gyp/tools/graphviz.py
2679
2878
#!/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. """Using the JSON dumped by the dump-dependency-json generator, generate input suitable for graphviz to render a dependency graph of targets...
mit
felixonmars/suds-ng
suds/umx/attrlist.py
1
2757
# 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 b...
lgpl-3.0
vmendez/DIRAC
DataManagementSystem/Agent/NamespaceBrowser.py
7
1213
# ABANDONWARE ### ABANDONWARE ### ABANDONWARE ### ABANDONWARE ### ABANDONWARE ### ABANDONWARE ### # ABANDONWARE ### ABANDONWARE ### ABANDONWARE ### ABANDONWARE ### ABANDONWARE ### ABANDONWARE ### # # import random,types # from DIRAC.Core.Utilities.List import sortList # # class NamespaceBrowser: # # def __init__(se...
gpl-3.0
sublime1809/django
django/contrib/gis/feeds.py
99
5980
from __future__ import unicode_literals from django.contrib.syndication.views import Feed as BaseFeed from django.utils.feedgenerator import Atom1Feed, Rss201rev2Feed class GeoFeedMixin(object): """ This mixin provides the necessary routines for SyndicationFeed subclasses to produce simple GeoRSS or W3C ...
bsd-3-clause
lahosken/pants
tests/python/pants_test/backend/project_info/tasks/test_depmap.py
7
10179
# 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) from textwrap import...
apache-2.0
conwayje/ase-python
ase/io/pdb.py
7
2715
import numpy as np from ase.atoms import Atom, Atoms from ase.parallel import paropen """Module to read and write atoms in PDB file format""" def read_pdb(fileobj, index=-1): """Read PDB files. The format is assumed to follow the description given in http://www.wwpdb.org/documentation/format32/sect9.h...
gpl-2.0
plotly/python-api
packages/python/plotly/plotly/validators/treemap/_tiling.py
2
1772
import _plotly_utils.basevalidators class TilingValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__(self, plotly_name="tiling", parent_name="treemap", **kwargs): super(TilingValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
mit
dewadg/mako-kernel
tools/perf/python/twatch.py
7370
1334
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
gpl-2.0
sharma1nitish/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/port/leakdetector_unittest.py
121
9172
# 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 f...
bsd-3-clause
JioCloud/tempest
tempest/services/object_storage/account_client.py
11
5477
# 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
kohnle-lernmodule/KITexe201based
twisted/protocols/htb.py
17
8591
# -*- test-case-name: twisted.test.test_htb -*- # # Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """Hierarchical Token Bucket traffic shaping. Patterned after U{Martin Devera's Hierarchical Token Bucket traffic shaper for the Linux kernel<http://luxik.cdi.cz/~devik/qos/htb/>}. @se...
gpl-2.0
Jorge-Rodriguez/ansible
lib/ansible/module_utils/redhat.py
141
10351
# 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 wo...
gpl-3.0
cccs-web/mezzanine
setup.py
1
3318
import os import sys from setuptools import setup, find_packages from shutil import rmtree from mezzanine import __version__ as version exclude = ["mezzanine/project_template/dev.db", "mezzanine/project_template/local_settings.py"] if sys.argv == ["setup.py", "test"]: exclude = [] exclude = dict([(e, ...
bsd-2-clause
yarikoptic/NiPy-OLD
nipy/io/imageformats/tests/test_endiancodes.py
1
1046
''' Tests for endiancodes module ''' import sys import numpy as np from nose.tools import assert_raises, assert_true from nipy.io.imageformats.volumeutils import endian_codes, \ native_code, swapped_code def test_native_swapped(): native_is_le = sys.byteorder == 'little' if native_is_le: asser...
bsd-3-clause
Serag8/Bachelor
google_appengine/lib/django-1.4/django/db/models/fields/subclassing.py
104
1819
""" Convenience routines for creating non-trivial Field subclasses, as well as backwards compatibility utilities. Add SubfieldBase as the __metaclass__ for your Field subclass, implement to_python() and the other necessary methods and everything will work seamlessly. """ class SubfieldBase(type): """ A metacl...
mit
odejesush/tensorflow
tensorflow/python/framework/ops.py
3
154684
# 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
andrewleech/SickRage
sickbeard/providers/rarbg.py
10
6962
# coding=utf-8 # Author: Dustyn Gibson <miigotu@gmail.com> # # URL: https://sickrage.github.io # # This file is part of SickRage. # # SickRage is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 o...
gpl-3.0
HuaweiSwitch/ansible
test/units/modules/cloud/amazon/test_lambda.py
47
11588
# # (c) 2017 Michael De La Rue # # 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...
gpl-3.0
gylian/Sick-Beard
lib/unidecode/x0ad.py
253
4766
data = ( 'gwan', # 0x00 'gwanj', # 0x01 'gwanh', # 0x02 'gwad', # 0x03 'gwal', # 0x04 'gwalg', # 0x05 'gwalm', # 0x06 'gwalb', # 0x07 'gwals', # 0x08 'gwalt', # 0x09 'gwalp', # 0x0a 'gwalh', # 0x0b 'gwam', # 0x0c 'gwab', # 0x0d 'gwabs', # 0x0e 'gwas', # 0x0f 'gwass', #...
gpl-3.0
koceg/gouda
gouda/engines/dtk.py
1
3651
import os import tempfile import cv2 try: from win32com import client as com from win32com.client import constants as c except ImportError: com = c = None from gouda.barcode import Barcode from gouda.gouda_error import GoudaError from gouda.util import debug_print, is_clsid_registered class DTKEngine(...
gpl-2.0
manasjune115/python-django
mysite/login/form.py
3
1449
#files.py import re from django import forms from django.contrib.auth.models import User from django.utils.translation import ugettext_lazy as _ class RegistrationForm(forms.Form): username = forms.RegexField(regex=r'^\w+$', widget=forms.TextInput(attrs=dict(required=True, max_length=30)), label=_("Username"), ...
gpl-2.0
popazerty/beyonwiz-sh4
lib/python/Plugins/SystemPlugins/FastScan/plugin.py
59
13191
# -*- coding: utf-8 -*- from os import path as os_path, walk as os_walk, unlink as os_unlink from Plugins.Plugin import PluginDescriptor from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Components.config import config, ConfigSelection, ConfigYesNo, getConfigListEntry, ConfigSubsection,...
gpl-2.0
planetcoin/planetcoin
share/qt/make_spinner.py
4415
1035
#!/usr/bin/env python # W.J. van der Laan, 2011 # Make spinning .mng animation from a .png # Requires imagemagick 6.7+ from __future__ import division from os import path from PIL import Image from subprocess import Popen SRC='img/reload_scaled.png' DST='../../src/qt/res/movies/update_spinner.mng' TMPDIR='/tmp' TMPNAM...
mit
linktlh/Toontown-journey
toontown/coghq/CashbotMintBoilerRoom_Action00.py
7
21901
from toontown.coghq.SpecImports import * GlobalEntities = {1000: {'type': 'levelMgr', 'name': 'LevelMgr', 'comment': '', 'parentEntId': 0, 'cogLevel': 0, 'farPlaneDistance': 1500, 'modelFilename': 'phase_10/models/cashbotHQ/ZONE08a', 'wantDoors': 1}, 1001: {'type...
apache-2.0
Rosebotics/cwc-projects
lego-ev3/sandbox/src/motors/m5_drive_polygon.py
1
1616
#!/usr/bin/env python3 """ This module lets you integrate your work on drive_inches and turn_degrees into a neat application. You will ask the user for how many sides they would like in their polygon, the length of each side, and a speed. Then your robot will drive that polygon shape. Authors: David Fisher and PUT_YO...
gpl-3.0
Inventor1938/android_kernel_samsung_klte
tools/perf/scripts/python/syscall-counts-by-pid.py
11180
1927
# system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os, sys sys.path.append(os.env...
gpl-2.0
diagramsoftware/odoo
addons/hr_timesheet_invoice/hr_timesheet_invoice.py
55
18165
# -*- 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
arifgursel/pyglet
tools/upload/googlecode_upload.py
31
6896
#!/usr/bin/env python # # Copyright 2006 Google Inc. All Rights Reserved. # Author: danderson@google.com (David Anderson) # # Script for uploading files to a Google Code project. # # This is intended to be both a useful script for people who want to # streamline project uploads and a reference implementation for # uplo...
bsd-3-clause
hectoruelo/scrapy
docs/utils/linkfix.py
141
1764
#!/usr/bin/python """ Linkfix - a companion to sphinx's linkcheck builder. Uses the linkcheck's output file to fix links in docs. Originally created for this issue: https://github.com/scrapy/scrapy/issues/606 Author: dufferzafar """ import re # Used for remembering the file (and its contents) # so we don't have ...
bsd-3-clause
h4ck3rm1k3/orca-sonar
src/orca/scripts/apps/planner/speech_generator.py
5
2453
# Orca # # Copyright 2006-2009 Sun Microsystems Inc. # # This library 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 2.1 of the License, or (at your option) any later version. # # This...
lgpl-2.1
Communities-Communications/cc-odoo
openerp/addons/base/ir/__init__.py
379
1444
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
rubund/debian-pyvisa-py
pyvisa-py/protocols/rpc.py
1
24244
# -*- coding: utf-8 -*- """ pyvisa-py.protocols.rpc ~~~~~~~~~~~~~~~~~~~~~~~ Sun RPC version 2 -- RFC1057 This file is drawn from Python's RPC demo, updated for python 3. XXX There should be separate exceptions for the various reasons why XXX an RPC can fail, rather than using RuntimeError for...
mit
dataxu/ansible
test/units/plugins/inventory/test_group.py
32
4176
# Copyright 2018 Alan Rominger <arominge@redhat.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 late...
gpl-3.0
mollstam/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/numpy-1.9.2/numpy/testing/tests/test_doctesting.py
224
1322
""" Doctests for NumPy-specific nose/doctest modifications """ from __future__ import division, absolute_import, print_function # try the #random directive on the output line def check_random_directive(): ''' >>> 2+2 <BadExample object at 0x084D05AC> #random: may vary on your system ''' # check the ...
mit
JohnReid/biopsy
Python/gapped_pssms/information_content.py
1
12761
# # Copyright John Reid 2009 # """ Code to examine information content of gapped PWMs. """ import numpy as N, fpconst def inc_index(idx, max=4): "Increment the index." for i in xrange(len(idx)): idx[i] = (idx[i] + 1) % max if 0 != idx[i]: break else: return False ...
mit
googleapis/googleapis-gen
google/iam/admin/v1/iam-admin-v1-py/google/iam/admin_v1/types/__init__.py
1
3328
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # 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...
apache-2.0