repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
lcweb/node-oauth
node_modules/grunt/node_modules/gzip-js/node_modules/deflate-js/test/deflate.py
177
2329
import os from colorama import Fore from helpers import deflate, inflate, run_cmd outDirDefault = 'test-outs' testDirDefault = 'test-files' """ Run a single test @param tFile- required; the full path to the file to run @param level- optional (default: all); the compression level [1-9] @param delete- optional (defaul...
mit
pombredanne/numba
numba/cuda/tests/cudadrv/test_cuda_array_slicing.py
6
2372
from __future__ import print_function import numpy as np from numba import cuda from numba.cuda.testing import unittest class CudaArrayIndexing(unittest.TestCase): def test_index_1d(self): arr = np.arange(10) darr = cuda.to_device(arr) for i in range(arr.size): self.assertEqual...
bsd-2-clause
gangadhar-kadam/mic-erpnext
accounts/report/accounts_receivable/accounts_receivable.py
5
5040
from __future__ import unicode_literals import webnotes from webnotes import msgprint, _ from webnotes.utils import getdate, nowdate, flt, cstr def execute(filters=None): if not filters: filters = {} columns = get_columns() entries = get_gl_entries(filters) entries_after_report_date = [[gle.voucher_type, gle.vou...
agpl-3.0
VikramShetty/google-diff-match-patch
python2/diff_match_patch.py
337
67934
#!/usr/bin/python2.4 from __future__ import division """Diff Match and Patch Copyright 2006 Google Inc. http://code.google.com/p/google-diff-match-patch/ 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 Lice...
apache-2.0
d2bit/compose
compose/cli/log_printer.py
21
2616
from __future__ import unicode_literals from __future__ import absolute_import import sys from itertools import cycle from .multiplexer import Multiplexer from . import colors from .utils import split_buffer class LogPrinter(object): def __init__(self, containers, attach_params=None, output=sys.stdout, monochro...
apache-2.0
jaggu303619/asylum
openerp/addons/account/wizard/account_tax_chart.py
51
3332
# -*- 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
mikelarre/odoomrp-wip-1
warning_log/models/warning.py
2
6419
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # # 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 ...
agpl-3.0
ejpbruel/servo
tests/wpt/web-platform-tests/tools/pytest/testing/test_junitxml.py
166
27154
# -*- coding: utf-8 -*- from xml.dom import minidom from _pytest.main import EXIT_NOTESTSCOLLECTED import py import sys import os from _pytest.junitxml import LogXML import pytest def runandparse(testdir, *args): resultpath = testdir.tmpdir.join("junit.xml") result = testdir.runpytest("--junitxml=%s" % resul...
mpl-2.0
chauhanmohit/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/checkout/baselineoptimizer.py
121
13839
# 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
samuelhavron/heroku-buildpack-python
Python-3.4.3/Lib/distutils/tests/test_build.py
147
1919
"""Tests for distutils.command.build.""" import unittest import os import sys from test.support import run_unittest from distutils.command.build import build from distutils.tests import support from sysconfig import get_platform class BuildTestCase(support.TempdirManager, support.LoggingSilencer, ...
mit
dwnld/thrift
contrib/fb303/py/setup.py
67
1629
#!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "L...
apache-2.0
denny820909/builder
lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/words/xish/xpath.py
67
9290
# -*- test-case-name: twisted.words.test.test_xpath -*- # # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ XPath query support. This module provides L{XPathQuery} to match L{domish.Element<twisted.words.xish.domish.Element>} instances against XPath-like expressions. """ try: import cSt...
mit
andresgz/django
django/contrib/gis/utils/layermapping.py
335
27300
# LayerMapping -- A Django Model/OGR Layer Mapping Utility """ The LayerMapping class provides a way to map the contents of OGR vector files (e.g. SHP files) to Geographic-enabled Django models. For more information, please consult the GeoDjango documentation: https://docs.djangoproject.com/en/dev/ref/contrib/gi...
bsd-3-clause
dnozay/lettuce
tests/integration/lib/Django-1.3/django/conf/locale/pl/formats.py
238
1288
# -*- 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 E Y' TIME_FORMAT = 'H:i:s' DATETIME_FORMAT = 'j E Y H:i:s' YEAR_MONTH_F...
gpl-3.0
RyanNoelk/ClanLadder
MatchHistory/protocols/protocol32283.py
4
27069
# Copyright (c) 2013 Blizzard Entertainment # # 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, merge, publi...
mit
RI-imaging/nrefocus
docs/conf.py
1
4846
# -*- coding: utf-8 -*- # # project documentation build configuration file, created by # sphinx-quickstart on Sat Feb 22 09:35:49 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 # autogenerated file. # # A...
bsd-3-clause
Chilledheart/depot_tools
tests/download_from_google_storage_unittests.py
20
10966
#!/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. # pylint: disable=W0212 """Unit tests for download_from_google_storage.py.""" import optparse import os import Queue import shutil...
bsd-3-clause
NERC-CEH/jules-jasmin
majic/joj/websetup_watch_driving_dataset.py
1
9887
""" # Majic # Copyright (C) 2014 CEH # # 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 pr...
gpl-2.0
pmisik/buildbot
master/buildbot/process/build.py
2
32806
# 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
hackshel/py-aluminium
src/__furture__/simplepool.py
2
3289
#!/usr/bin/env python """simple thread pool @author: dn13(dn13@gmail.com) @author: Fibrizof(dfang84@gmail.com) """ import threading import Queue import new def WorkerPoolError( Exception ): pass class Task(threading.Thread): def __init__(self, queue, result_queue): threading.Thread.__init__(self) ...
bsd-3-clause
hyowon/servo
tests/wpt/web-platform-tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/resource.py
113
6305
import os import re def main(request, response): type = request.GET['type'] encoding = request.GET['encoding'] # We want the raw input for 'q' q = re.search(r'q=([^&]+)', request.url_parts.query).groups()[0] if type == 'html': return [("Content-Type", "text/html; charset=utf-8")], q eli...
mpl-2.0
deKupini/erp
addons/l10n_in_hr_payroll/report/payslip_report.py
8
3911
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-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
indie1982/osmc-fixes
package/mediacenter-skin-osmc/files/usr/share/kodi/addons/script.module.unidecode/lib/unidecode/x054.py
251
4583
data = ( 'Mie ', # 0x00 'Xu ', # 0x01 'Mang ', # 0x02 'Chi ', # 0x03 'Ge ', # 0x04 'Xuan ', # 0x05 'Yao ', # 0x06 'Zi ', # 0x07 'He ', # 0x08 'Ji ', # 0x09 'Diao ', # 0x0a 'Cun ', # 0x0b 'Tong ', # 0x0c 'Ming ', # 0x0d 'Hou ', # 0x0e 'Li ', # 0x0f 'Tu ', # 0x10 'Xiang ...
gpl-2.0
dgrat/ardupilot
Tools/LogAnalyzer/LogAnalyzer.py
63
12567
#!/usr/bin/env python # # A module to analyze and identify any common problems which can be determined from log files # # Initial code by Andrew Chapman (amchapman@gmail.com), 16th Jan 2014 # # some logging oddities noticed while doing this, to be followed up on: # - tradheli MOT labels Mot1,Mot2,Mot3,Mot4,GGain # ...
gpl-3.0
fbossy/SickRage
tornado/test/twisted_test.py
18
25239
# Author: Ovidiu Predescu # Date: July 2011 # # 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 ...
gpl-3.0
pedropena/iteexe
twisted/test/test_defer.py
14
20998
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """ Test cases for defer module. """ from __future__ import nested_scopes from twisted.trial import unittest, util from twisted.internet import reactor, defer from twisted.python import failure, log class GenericError(Exception): ...
gpl-2.0
mozilla/normandy
normandy/studies/migrations/0004_auto_20190115_0812.py
1
1814
# Generated by Django 2.0.9 on 2019-01-15 08:12 import hashlib import json import untangle import zipfile from django.core.files.storage import default_storage from django.db import migrations def populate_metadata(apps, schema_editor): Extension = apps.get_model("studies", "Extension") for extension in Ext...
mpl-2.0
PrashantKuntala/Machine-Learning
Feature Selection/scripts/pearsonFilter.py
1
1377
#!/usr/bin/python # # author : prashant kuntala # date : 31th October,2016 # last modified : 11/4/16 # script that takes feature file and ranks the features based on Pearson Correlation. from __future__ import division import os import numpy as np import scipy.stats # reading the data file into an array data = np...
mit
IronLanguages/ironpython2
Src/StdLib/Lib/test/test_glob.py
4
6944
import glob import os import shutil import sys import unittest from test.test_support import run_unittest, TESTFN def fsdecode(s): return unicode(s, sys.getfilesystemencoding()) class GlobTests(unittest.TestCase): def norm(self, *parts): return os.path.normpath(os.path.join(self.tempdir, *parts)) ...
apache-2.0
anthonyalmarza/hendrix
setup.py
1
1886
from hendrix import __version__ import errno import os import sys from setuptools import setup, find_packages def file_name(rel_path): dir_path = os.path.dirname(__file__) return os.path.join(dir_path, rel_path) def read(rel_path): with open(file_name(rel_path)) as f: return f.read() def readl...
mit
t794104/ansible
test/units/modules/remote_management/lxca/test_lxca_cmms.py
43
4394
import json import pytest from units.compat import mock from ansible.modules.remote_management.lxca import lxca_cmms @pytest.fixture(scope='module') @mock.patch("ansible.module_utils.remote_management.lxca.common.close_conn", autospec=True) def setup_module(close_conn): close_conn.return_value = True class Tes...
gpl-3.0
pdeesawat/PSIT58_test_01
Test_Python_code/final_code/Malaysia/earthquake.py
1
2089
import plotly.plotly as py import plotly.graph_objs as go #Get data data = open('Real_Final_database_02.csv') alldata = data.readlines() listdata = [] for i in alldata: listdata.append(i.strip().split(',')) #Seperate information year = [] affect = [] damage = [] death =[] for j in listdata: if j[0] == 'Malays...
apache-2.0
scrollback/kuma
vendor/packages/sqlalchemy/test/perf/masseagerload.py
7
1564
from sqlalchemy import * from sqlalchemy.orm import * from sqlalchemy.test import profiling NUM = 500 DIVISOR = 50 engine = create_engine('sqlite://') meta = MetaData(engine) items = Table('items', meta, Column('item_id', Integer, primary_key=True), Column('value', String(100))) subitems =...
mpl-2.0
scripteed/mtasa-blue
vendor/google-breakpad/src/third_party/protobuf/protobuf/gtest/test/gtest_xml_output_unittest.py
306
9711
#!/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...
gpl-3.0
rubencabrera/odoo
addons/l10n_be/wizard/l10n_be_account_vat_declaration.py
309
10685
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # Adapted by Noviat to # - enforce correct vat number # - support negative balance # - assign...
agpl-3.0
hhaoyan/keras
keras/layers/noise.py
66
1791
from __future__ import absolute_import import numpy as np from .core import MaskedLayer import theano import theano.tensor as T from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams class GaussianNoise(MaskedLayer): ''' Corruption process with GaussianNoise ''' def __init__(self, s...
mit
cxxgtxy/tensorflow
tensorflow/contrib/tensor_forest/hybrid/python/models/forest_to_data_then_nn_test.py
159
3275
# 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
ldoktor/autotest
client/fsdev_disks.py
2
20751
import sys, os, re from autotest.client import utils, fsinfo, fsdev_mgr, partition from autotest.client.shared import error fd_mgr = fsdev_mgr.FsdevManager() # For unmounting / formatting file systems we may have to use a device name # that is different from the real device name that we have to use to set I/O # sche...
gpl-2.0
chyeh727/django
django/db/__init__.py
376
2322
from django.core import signals from django.db.utils import ( DEFAULT_DB_ALIAS, DJANGO_VERSION_PICKLE_KEY, ConnectionHandler, ConnectionRouter, DatabaseError, DataError, Error, IntegrityError, InterfaceError, InternalError, NotSupportedError, OperationalError, ProgrammingError, ) __all__ = [ 'backe...
bsd-3-clause
Ayrx/cryptography
src/_cffi_src/commoncrypto/common_digest.py
10
1574
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function INCLUDES = """ #include <CommonCrypto/CommonDigest.h> """ TYPES = """ ty...
bsd-3-clause
telwertowski/QGIS
tests/src/python/test_authmanager_pki_ows.py
15
7719
# -*- coding: utf-8 -*- """ Tests for auth manager WMS/WFS using QGIS Server through PKI enabled qgis_wrapped_server.py. This is an integration test for QGIS Desktop Auth Manager WFS and WMS provider and QGIS Server WFS/WMS that check if QGIS can use a stored auth manager auth configuration to access an HTTP Basic pro...
gpl-2.0
abhishekgahlot/flask
scripts/flaskext_compat.py
6
5023
# -*- coding: utf-8 -*- """ flaskext_compat ~~~~~~~~~~~~~~~ Implements the ``flask.ext`` virtual package for versions of Flask older than 0.7. This module is a noop if Flask 0.8 was detected. Usage:: import flaskext_compat flaskext_compat.activate() from flask.ext import ...
bsd-3-clause
blueboxgroup/nova
doc/source/conf.py
13
9460
# -*- coding: utf-8 -*- # # nova documentation build configuration file, created by # sphinx-quickstart on Sat May 1 15:17:47 2010. # # 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. # # All ...
apache-2.0
funkyfuture/inxs
docs/conf.py
1
8439
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import os # Get the project root dir, which is the parent dir of this cwd = os.getcwd() project_root = os.path.dirname(cwd) # Insert the project root dir as the first element in the PYTHONPATH. # This lets us ensure that the source package is imported, and tha...
agpl-3.0
VeritasOS/cloud-custodian
c7n/executor.py
2
2908
# Copyright 2016 Capital One Services, 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 agreed to in...
apache-2.0
SatoshiNXSimudrone/sl4a-damon-clone
python-build/python-libs/gdata/samples/oauth/oauth_on_appengine/appengine_utilities/cron.py
129
18386
""" Copyright (c) 2008, appengine-utilities project 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 ...
apache-2.0
akshaynathr/mailman
src/mailman/commands/eml_help.py
3
3002
# Copyright (C) 2012 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 opt...
gpl-3.0
credativ/pulp
client_lib/pulp/client/extensions/loader.py
15
8665
# -*- coding: utf-8 -*- """ Functionality related to loading extensions from a set location. The client context is constructed ahead of time and provided to this module, which then uses it to instantiate the extension components. """ import copy from gettext import gettext as _ import logging import os import sys im...
gpl-2.0
JohnDenker/brython
www/src/Lib/unittest/signals.py
1016
2403
import signal import weakref from functools import wraps __unittest = True class _InterruptHandler(object): def __init__(self, default_handler): self.called = False self.original_handler = default_handler if isinstance(default_handler, int): if default_handler == signal.SIG_D...
bsd-3-clause
ealgis/ealgis
django/ealgis/ealauth/migrations/0009_auto_20170112_0911.py
2
1405
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2017-01-12 09:11 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('ealauth', '0008_auto_20161217_1337'), ] operations = [ migrations.AlterUniqueTogeth...
gpl-3.0
dreamhost/ceilometer
ceilometer/objectstore/swift_middleware.py
1
5594
#!/usr/bin/env python # -*- encoding: utf-8 -*- # # Copyright © 2012 eNovance <licensing@enovance.com> # # Author: Julien Danjou <julien@danjou.info> # # 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 Lice...
apache-2.0
williamfeng323/py-web
flask/lib/python3.6/site-packages/alembic/ddl/mysql.py
13
12426
from sqlalchemy.ext.compiler import compiles from sqlalchemy import types as sqltypes from sqlalchemy import schema from ..util.compat import string_types from .. import util from .impl import DefaultImpl from .base import ColumnNullable, ColumnName, ColumnDefault, \ ColumnType, AlterColumn, format_column_name, \ ...
mit
cnsoft/kbengine-cocos2dx
kbe/src/lib/python/Lib/test/test_cmd_line_script.py
6
14270
# tests command line execution of scripts import unittest import sys import os import os.path import py_compile from test import support from test.script_helper import ( make_pkg, make_script, make_zip_pkg, make_zip_script, assert_python_ok, assert_python_failure, temp_dir) verbose = support.verbose example...
lgpl-3.0
x111ong/django
django/core/handlers/wsgi.py
339
9181
from __future__ import unicode_literals import cgi import codecs import logging import sys from io import BytesIO from threading import Lock from django import http from django.conf import settings from django.core import signals from django.core.handlers import base from django.core.urlresolvers import set_script_pr...
bsd-3-clause
nordri/check_domains
lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/introspection.py
79
1925
import cx_Oracle import sys from django.db.backends.oracle.introspection import DatabaseIntrospection from django.utils import six class OracleIntrospection(DatabaseIntrospection): # Associating any OBJECTVAR instances with GeometryField. Of course, # this won't work right on Oracle objects that aren't MDSYS...
gpl-3.0
skython/eXe
exe/webui/appletblock.py
2
7890
# =========================================================================== # eXe # Copyright 2004-2005, University of Auckland # Copyright 2004-2007 eXe Project http://eXeLearning.org/ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as...
gpl-2.0
sauloal/pycluster
pypy-1.9_64/lib-python/2.7/unittest/test/test_discovery.py
45
13032
import os import re import sys import unittest class TestDiscovery(unittest.TestCase): # Heavily mocked tests so I can avoid hitting the filesystem def test_get_name_from_path(self): loader = unittest.TestLoader() loader._top_level_dir = '/foo' name = loader._get_name_from_path('/fo...
mit
chiviak/CouchPotatoServer
libs/pyutil/test/current/test_iputil.py
106
1287
#!/usr/bin/env python try: from twisted.trial import unittest unittest # http://divmod.org/trac/ticket/1499 except ImportError, le: print "Skipping test_iputil since it requires Twisted and Twisted could not be imported: %s" % (le,) else: from pyutil import iputil, testutil import re DOTTED_QU...
gpl-3.0
laperry1/android_external_chromium_org
tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py
25
17290
# 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 logging import os import pipes import re import subprocess import sys import time from telemetry.core import exceptions from telemetry.core import fo...
bsd-3-clause
MilaPetrova/python-training-group3
contact_Dima.py
1
3567
__author__ = 'Dzmitry' from model.contact import Group class ContactHelper: def __init__(self, app): self.app = app def create(self, contact): wd = self.app.wd wd.get("http://localhost/addressbook/") # init new contact creation wd.find_element_by_link_text("add new").c...
apache-2.0
erickt/hue
desktop/core/ext-py/guppy-0.1.10/guppy/heapy/Monitor.py
37
12734
#._cv_part guppy.heapy.Monitor import os, pprint, signal, socket, SocketServer, sys, threading, time, traceback import cPickle as pickle try: import readline # Imported to _enable_ command line editing except ImportError: pass import select, Queue from guppy.heapy.RemoteConstants import * from guppy.heapy.Co...
apache-2.0
x13945/Android-ImageMagick
library/src/main/jni/libwebp-0.3.1/swig/libwebp.py
107
6605
# This file was automatically generated by SWIG (http://www.swig.org). # Version 2.0.4 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. from sys import version_info if version_info >= (2,6,0): def swig_import_helper(): from os.path import ...
mit
henkvos/xhtml2pdf
demo/tgpisa/setup.py
168
2452
# -*- coding: utf-8 -*- from setuptools import setup, find_packages from turbogears.finddata import find_package_data import os execfile(os.path.join("tgpisa", "release.py")) packages=find_packages() package_data = find_package_data(where='tgpisa', package='tgpisa') if os.path.isdir('locales'): packages.appe...
apache-2.0
elliotthill/django-oscar
tests/functional/dashboard/offer_tests.py
49
3843
from django.core.urlresolvers import reverse from oscar.test import testcases, factories from oscar.apps.offer import models class TestAnAdmin(testcases.WebTestCase): # New version of offer tests buy using WebTest is_staff = True def setUp(self): super(TestAnAdmin, self).setUp() self.ran...
bsd-3-clause
denisKaranja/django-dive-in
karanja_me/polls/views.py
2
1695
from django.shortcuts import get_object_or_404, render, HttpResponse from django.http import HttpResponseRedirect, HttpResponse from django.core.urlresolvers import reverse from django.views import generic from django.utils import timezone from .models import Choice, Question # entry point of the polls app class Inde...
mit
Zanzibar82/pelisalacarta
python/main-classic/core/samba.py
5
7516
# -*- coding: iso-8859-1 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Acceso a directorios con samba # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import logger import os import config ...
gpl-3.0
rseubert/scikit-learn
sklearn/datasets/mldata.py
309
7838
"""Automatically download MLdata datasets.""" # Copyright (c) 2011 Pietro Berkes # License: BSD 3 clause import os from os.path import join, exists import re import numbers try: # Python 2 from urllib2 import HTTPError from urllib2 import quote from urllib2 import urlopen except ImportError: # Pyt...
bsd-3-clause
samuelshaner/openmc
openmc/clean_xml.py
3
2913
def sort_xml_elements(tree): # Retrieve all children of the root XML node in the tree elements = list(tree) # Initialize empty lists for the sorted and comment elements sorted_elements = [] # Initialize an empty set of tags (e.g., Surface, Cell, and Lattice) tags = set() # Find the uniqu...
mit
ROM-Jeremy/android_kernel_x5
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
sbellem/django
tests/migrations/test_executor.py
202
24097
from django.apps.registry import apps as global_apps from django.db import connection from django.db.migrations.executor import MigrationExecutor from django.db.migrations.graph import MigrationGraph from django.db.migrations.recorder import MigrationRecorder from django.db.utils import DatabaseError from django.test i...
bsd-3-clause
eunchong/build
scripts/common/twisted_util/netrc_authorizer.py
2
1382
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """NETRCAuthorizer class""" import base64 import netrc import urlparse from common.twisted_util.authorizer import IAuthorizer from zope.interface import im...
bsd-3-clause
loic/django
django/core/checks/security/csrf.py
62
2003
from django.conf import settings from .. import Tags, Warning, register from ..utils import patch_middleware_message W003 = Warning( "You don't appear to be using Django's built-in " "cross-site request forgery protection via the middleware " "('django.middleware.csrf.CsrfViewMiddleware' is not in your " ...
bsd-3-clause
webmasterraj/FogOrNot
flask/lib/python2.7/site-packages/boto/sdb/__init__.py
14
1972
# 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...
gpl-2.0
waaaaargh/di_playlist_grabber
di.py
1
2209
#!/usr/bin/env python3 from argparse import ArgumentParser import json import os.path import sys from urllib.request import urlopen if __name__ == '__main__': parser = ArgumentParser(description='Grab di.fm playlists') parser.add_argument('--key', help='Listening key') parser.add_argument('--destination',...
gpl-3.0
vicky2135/lucious
oscar/lib/python2.7/site-packages/sqlparse/filters/tokens.py
20
1612
# -*- coding: utf-8 -*- # # Copyright (C) 2016 Andi Albrecht, albrecht.andi@gmail.com # # This module is part of python-sqlparse and is released under # the BSD License: https://opensource.org/licenses/BSD-3-Clause from sqlparse import tokens as T from sqlparse.compat import text_type class _CaseFilter(object): ...
bsd-3-clause
rwl/PyCIM
CIM15/IEC61970/Informative/InfGMLSupport/GmlTopologyStyle.py
1
3427
# Copyright (C) 2010-2011 Richard Lincoln # # 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, merge, publish...
mit
bjmc/kodos
modules/regexLibrary.py
2
1540
from regexLibraryBA import RegexLibraryBA from parseRegexLib import ParseRegexLib from qt import * from util import restoreWindowSettings, saveWindowSettings, kodos_toolbar_logo import os GEO = "regex-lib_geometry" class RegexLibrary(RegexLibraryBA): def __init__(self, parent, filename): RegexLibraryBA._...
gpl-2.0
swalladge/ranger
ranger/gui/widgets/taskview.py
2
2868
# This file is part of ranger, the console file manager. # License: GNU GPL version 3, see the file "AUTHORS" for details. """The TaskView allows you to modify what the loader is doing.""" from __future__ import (absolute_import, division, print_function) from ranger.ext.accumulator import Accumulator from . import...
gpl-3.0
bvernoux/micropython
tests/bytecode/pylib-tests/runpy.py
28
10413
"""runpy.py - locating and running Python code using the module namespace Provides support for locating and running Python scripts using the Python module namespace instead of the native filesystem. This allows Python code to play nicely with non-filesystem based PEP 302 importers when locating support scripts as wel...
mit
Dancovich/libgdx_blender_g3d_exporter
io_scene_g3d/domain_classes.py
1
25899
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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 distrib...
gpl-3.0
tinloaf/home-assistant
homeassistant/components/binary_sensor/fritzbox.py
4
1775
""" Support for Fritzbox binary sensors. For more details about this component, please refer to the documentation at https://home-assistant.io/components/binary_sensor.fritzbox/ """ import logging import requests from homeassistant.components.binary_sensor import BinarySensorDevice from homeassistant.components.frit...
apache-2.0
sysalexis/kbengine
kbe/res/scripts/common/Lib/crypt.py
104
1879
"""Wrapper to the POSIX crypt library call and associated functionality.""" import _crypt import string as _string from random import SystemRandom as _SystemRandom from collections import namedtuple as _namedtuple _saltchars = _string.ascii_letters + _string.digits + './' _sr = _SystemRandom() class _Method(_named...
lgpl-3.0
EvgeneOskin/taiga-back
taiga/projects/migrations/0001_initial.py
26
6614
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings import django_pgjson.fields import django.utils.timezone import django.db.models.deletion import djorm_pgarray.fields import taiga.projects.history.models class Migration(migratio...
agpl-3.0
saeedhadi/linux-at91
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # import os import sys import getopt import sh...
gpl-2.0
osvalr/odoo
addons/document/document.py
152
83929
# -*- 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
dhorelik/django-cms
cms/management/commands/subcommands/moderator.py
66
1954
# -*- coding: utf-8 -*- from logging import getLogger from cms.management.commands.subcommands.base import SubcommandsCommand from cms.models import CMSPlugin, Title from cms.models.pagemodel import Page from django.core.management.base import NoArgsCommand log = getLogger('cms.management.moderator') class Moderato...
bsd-3-clause
sio2project/oioioi
oioioi/problems/management/commands/showbrokensolutions.py
1
1774
from django.core.management.base import BaseCommand from django.db.models import F from django.utils.translation import ugettext as _ from oioioi.problems.models import Problem from oioioi.programs.models import ModelProgramSubmission class Command(BaseCommand): help = str( _( "Prints problems...
gpl-3.0
SnappleCap/oh-mainline
vendor/packages/scrapy/scrapyd/website.py
16
3773
from datetime import datetime from twisted.web import resource, static from twisted.application.service import IServiceCollection from .interfaces import IPoller, IEggStorage, ISpiderScheduler from . import webservice class Root(resource.Resource): def __init__(self, config, app): resource.Resource.__in...
agpl-3.0
ljhljh235/AutoRest
src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/CustomBaseUri/setup.py
14
1138
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
pjv/easyengine
tests/cli/2_test_stack_services_start.py
9
1582
from ee.utils import test from ee.cli.main import get_test_app class CliTestCaseStack(test.EETestCase): def test_ee_cli(self): self.app.setup() self.app.run() self.app.close() def test_ee_cli_stack_services_start_nginx(self): self.app = get_test_app(argv=['stack', 'start', '-...
mit
justinlulejian/fah-gae
lib/google/protobuf/internal/more_messages_pb2.py
43
4177
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/internal/more_messages.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.proto...
mit
pombredanne/django-bulbs
bulbs/campaigns/migrations/0001_initial.py
2
1592
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import djbetty.fields class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Campaign', fields=[ ('id'...
mit
bspink/django
django/contrib/gis/db/backends/oracle/models.py
475
2275
""" The GeometryColumns and SpatialRefSys models for the Oracle spatial backend. It should be noted that Oracle Spatial does not have database tables named according to the OGC standard, so the closest analogs are used. For example, the `USER_SDO_GEOM_METADATA` is used for the GeometryColumns model and the `SDO_...
bsd-3-clause
adrienbrault/home-assistant
tests/components/kodi/__init__.py
8
1248
"""Tests for the Kodi integration.""" from unittest.mock import patch from homeassistant.components.kodi.const import CONF_WS_PORT, DOMAIN from homeassistant.const import ( CONF_HOST, CONF_NAME, CONF_PASSWORD, CONF_PORT, CONF_SSL, CONF_USERNAME, ) from .util import MockConnection from tests.c...
mit
Eseoghene/bite-project
deps/gdata-python-client/src/gdata/tlslite/integration/ClientHelper.py
285
7021
""" A helper class for using TLS Lite with stdlib clients (httplib, xmlrpclib, imaplib, poplib). """ from gdata.tlslite.Checker import Checker class ClientHelper: """This is a helper class used to integrate TLS Lite with various TLS clients (e.g. poplib, smtplib, httplib, etc.)""" def __init__...
apache-2.0
Reimilia/pdb_sth
native_contact.py
1
1442
import numpy as np maximum = 4.5 minimum = 3 def make_pair(x, y): xx, yy = np.meshgrid(range(len(x)), range(len(y))) return np.c_[xx.ravel(), yy.ravel()] def compute_distance(x, y, pairs): return np.array([np.sqrt(np.sum(np.power(x[i] - y[j], 2))) for (i, j) in pairs]) def compute_native_contact(x, y...
mit
samanehsan/osf.io
api_tests/comments/views/test_comment_detail.py
5
22955
from urlparse import urlparse from nose.tools import * # flake8: noqa from api.base.settings.defaults import API_BASE from tests.base import ApiTestCase from tests.factories import ProjectFactory, AuthUserFactory, CommentFactory, RegistrationFactory class TestCommentDetailView(ApiTestCase): def setUp(self): ...
apache-2.0
HyperBaton/ansible
test/units/modules/network/f5/test_bigip_sys_global.py
22
4116
# -*- coding: utf-8 -*- # # Copyright (c) 2017 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 import os import json import pytest import sys if sys.version_info < (2, ...
gpl-3.0
tudorvio/tempest
tempest/cmd/cleanup_service.py
7
30333
#!/usr/bin/env python # Copyright 2015 Dell 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 appl...
apache-2.0
crs4/ProMort
promort/shared_datasets_manager/migrations/0001_initial.py
2
2500
# Generated by Django 3.1.8 on 2021-05-09 16:06 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('slid...
mit