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
inares/edx-platform
lms/djangoapps/support/tests/test_views.py
70
3760
""" Tests for support views. """ import ddt from django.test import TestCase from django.core.urlresolvers import reverse from student.roles import GlobalStaff, SupportStaffRole from student.tests.factories import UserFactory class SupportViewTestCase(TestCase): """ Base class for support view tests. ""...
agpl-3.0
ivan-fedorov/intellij-community
python/helpers/pydev/pydevd_attach_to_process/winappdbg/plugins/do_symfix.py
102
1894
#!~/.wine/drive_c/Python25/python.exe # -*- coding: utf-8 -*- # Command line debugger using WinAppDbg # Fix the symbol store path # Copyright (c) 2009-2014, Mario Vilas # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the followin...
apache-2.0
OpenUpgrade-dev/OpenUpgrade
addons/account/account_analytic_line.py
304
7914
# -*- 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
Perferom/android_external_chromium_org
build/android/pylib/instrumentation/setup.py
25
1209
# 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. """Generates test runner factory and tests for instrumentation tests.""" import logging import os import test_package import test_runner def Setup(test_o...
bsd-3-clause
mancoast/CPythonPyc_test
fail/331_test_bufio.py
112
2599
import unittest from test import support import io # C implementation. import _pyio as pyio # Python implementation. # Simple test to ensure that optimizations in the IO library deliver the # expected results. For best testing, run this under a debug-build Python too # (to exercise asserts in the C code). lengths =...
gpl-3.0
garbled1/ansible
lib/ansible/modules/web_infrastructure/ansible_tower/tower_project.py
34
6336
#!/usr/bin/python # coding: utf-8 -*- # (c) 2017, Wayne Witzel III <wayne@riotousliving.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1...
gpl-3.0
SKA-ScienceDataProcessor/FastImaging-Python
src/fastimgproto/scripts/casa/simulate_vis.py
1
1700
""" Simulated pipeline run """ import logging import os import astropy.units as u import click from astropy.coordinates import Angle, SkyCoord import fastimgproto.casa.simulation as casa_sim from fastimgproto.pipeline.skymodel import get_spiral_source_test_pattern from fastimgproto.skymodel.helpers import SkyRegion, ...
apache-2.0
apoelstra/elements
qa/rpc-tests/forknotify.py
161
2179
#!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test -alertnotify # from test_framework import BitcoinTestFramework from bitcoinrpc.authproxy import Aut...
mit
SEL-Columbia/commcare-hq
corehq/apps/migration/util/submission_xml.py
2
4429
from lxml import etree import functools from sys import stdin def get_xmlns(el): return el.tag.split('}')[0][1:] def get_subnode(el, name): # the following way seems to work only (deterministically) non-deterministically: WTF!? # return el.find('m:{name}'.format(name=name), namespaces={'m': get_xmlns(el)}...
bsd-3-clause
pombredanne/django-rest-encrypted-lookup
rest_framework_encrypted_lookup/views.py
2
1405
""" Django-Rest-Framework replacement Views for rest_framework_encrypted_lookup """ import binascii from django.http import Http404 from rest_framework import viewsets class EncryptedLookupGenericViewSet(viewsets.GenericViewSet): """ GenericViewSet subclass capable of decrypting our encrypted lookup field ...
gpl-3.0
danialbehzadi/Nokia-RM-1013-2.0.0.11
webkit/Source/WebKit/chromium/scripts/concatenate_css_files.py
15
4373
#!/usr/bin/env python # # 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...
gpl-3.0
xuweiliang/Codelibrary
nova/virt/block_device.py
1
22007
# 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 agreed to in...
apache-2.0
quantiply-fork/schema-registry
docs/conf.py
1
8507
# -*- coding: utf-8 -*- # # Schema Registry documentation build configuration file, created by # sphinx-quickstart on Wed Dec 17 14:17:15 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 fil...
apache-2.0
epsylon3/torrentflux
html/bin/clients/mainline/BTL/ipfreemmap.py
6
1933
# binary tree search of data file for countrycode # # by Greg Hazel import os import mmap import struct import socket import bisect root, file = os.path.split(__file__) addrmap = os.path.join(root, "addrmap.dat") if not os.path.exists(addrmap): from BTL.platform import get_module_filename root, file = os.path...
gpl-2.0
OpringaoDoTurno/airflow
tests/ti_deps/deps/test_prev_dagrun_dep.py
38
5377
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
stasiek/robotframework
src/robot/result/configurer.py
20
2818
# Copyright 2008-2015 Nokia Solutions and Networks # # 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 l...
apache-2.0
lakshmivyas/commando
commando/tests/test_conf.py
5
1988
from commando.conf import AutoProp, ConfigDict class TestClass(AutoProp): @AutoProp.default def source(self): return 'source' def test_auto(): t = TestClass() assert t.source == 'source' def test_override(): t = TestClass() t.source = 'source1' assert t.source == 'source1' ...
mit
bencharb/django-sql-explorer
explorer/tests/test_forms.py
12
1110
from django.test import TestCase from django.forms.models import model_to_dict from explorer.tests.factories import SimpleQueryFactory from explorer.forms import QueryForm class TestFormValidation(TestCase): def test_form_is_valid_with_valid_sql(self): q = SimpleQueryFactory(sql="select 1;", created_by_u...
mit
KaOSx/calamares
src/modules/localecfg/main.py
2
6225
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # === This file is part of Calamares - <https://calamares.io> === # # SPDX-FileCopyrightText: 2014 Anke Boersma <demm@kaosx.us> # SPDX-FileCopyrightText: 2015 Philip Müller <philm@manjaro.org> # SPDX-FileCopyrightText: 2016 Teo Mrnjavac <teo@kde.org> # SPDX-FileC...
gpl-3.0
soldag/home-assistant
homeassistant/components/zodiac/sensor.py
9
4747
"""Support for tracking the zodiac sign.""" from homeassistant.helpers.entity import Entity from homeassistant.util.dt import as_local, utcnow from .const import ( ATTR_ELEMENT, ATTR_MODALITY, DOMAIN, ELEMENT_AIR, ELEMENT_EARTH, ELEMENT_FIRE, ELEMENT_WATER, MODALITY_CARDINAL, MODALI...
apache-2.0
mglukhikh/intellij-community
python/lib/Lib/modjy/modjy_params.py
109
2453
### # # Copyright Alan Kennedy. # # You may contact the copyright holder at this uri: # # http://www.xhaus.com/contact/modjy # # The licence under which this code is released is the Apache License v2.0. # # The terms and conditions of this license are listed in a file contained # in the distribution that also cont...
apache-2.0
msabramo/ansible
lib/ansible/plugins/shell/powershell.py
5
44897
# (c) 2014, Chris Church <chris@ninemoreminutes.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 lat...
gpl-3.0
ArcherSys/ArcherSys
eclipse/plugins/org.python.pydev.jython_4.5.5.201603221110/Lib/tokenize.py
76
16542
"""Tokenization help for Python programs. generate_tokens(readline) is a generator that breaks a stream of text into Python tokens. It accepts a readline-like method which is called repeatedly to get the next line of input (or "" for EOF). It generates 5-tuples with these members: the token type (see token.py) ...
mit
wizardofozzie/python-bitcoinlib
bitcoin/tests/test_core.py
9
11343
# Copyright (C) 2013-2014 The python-bitcoinlib developers # # This file is part of python-bitcoinlib. # # It is subject to the license terms in the LICENSE file found in the top-level # directory of this distribution. # # No part of python-bitcoinlib, including this file, may be copied, modified, # propagated, or dist...
lgpl-3.0
robovm/robovm-studio
python/lib/Lib/site-packages/django/template/loader_tags.py
73
10511
from django.template.base import TemplateSyntaxError, TemplateDoesNotExist, Variable from django.template.base import Library, Node, TextNode from django.template.context import Context from django.template.defaulttags import token_kwargs from django.template.loader import get_template from django.conf import settings ...
apache-2.0
marshall007/rethinkdb
test/rql_test/connections/http_support/jinja2/testsuite/ext.py
402
18086
# -*- coding: utf-8 -*- """ jinja2.testsuite.ext ~~~~~~~~~~~~~~~~~~~~ Tests for the extensions. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import re import unittest from jinja2.testsuite import JinjaTestCase from jinja2 import Environment, DictLoader...
agpl-3.0
esho/yabl.tap
tap/security/providers.py
1
5781
import requests from datetime import datetime, timedelta from mesh.standard import ForbiddenError, OK from spire.core import Unit, Configuration, Dependency from spire.mesh import MeshDependency from spire.support.logs import LogHelper from scheme.fields import * from tap.security.password import PasswordManager __a...
bsd-3-clause
ingadhoc/odoo
openerp/report/render/rml2html/utils.py
438
2386
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2005, Fabien Pinckaers, UCL, FSA # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesse...
agpl-3.0
ericzhou2008/zulip
api/integrations/hg/zulip-changegroup.py
114
6096
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Zulip hook for Mercurial changeset pushes. # Copyright © 2012-2014 Zulip, Inc. # # 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 rest...
apache-2.0
kingvuplus/xx-v
lib/python/Plugins/Extensions/GraphMultiEPG/GraphMultiEpg.py
11
54099
from skin import parseColor, parseFont, parseSize from Components.config import config, ConfigClock, ConfigInteger, ConfigSubsection, ConfigYesNo, ConfigSelection, ConfigSelectionNumber from Components.Pixmap import Pixmap from Components.Button import Button from Components.ActionMap import HelpableActionMap from Comp...
gpl-2.0
Pouf/CodingCompetition
CG/hard_the-labyrinth.py
1
3623
# Your mission is to: # - find the control room from which you will be able to deactivate the tracker beam # - get back to your starting position once you've deactivated the tracker beam # The structure is arranged as a rectangular maze composed of cells. Within the # maze Kirk can go in any of the following dire...
mit
addition-it-solutions/project-all
addons/l10n_uy/__init__.py
8
1069
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2011 Openerp.uy <openerp.uy@lists.launchpad.net> # Proyecto de Localización de OperERP para Uruguay # $Id$ # # This program i...
agpl-3.0
tomtor/QGIS
python/plugins/processing/algs/grass7/ext/r_li_cwed.py
45
1289
# -*- coding: utf-8 -*- """ *************************************************************************** r_li_cwed.py ------------ Date : February 2016 Copyright : (C) 2016 by Médéric Ribreux Email : medspx at medspx dot fr **********************************...
gpl-2.0
FHannes/intellij-community
python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_xrange.py
326
2699
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer that changes xrange(...) into range(...).""" # Local imports from .. import fixer_base from ..fixer_util import Name, Call, consuming_calls from .. import patcomp class FixXrange(fixer_base.BaseFix): BM_...
apache-2.0
davidbuzz/ardupilot
Tools/scripts/apj_tool.py
28
8504
#!/usr/bin/env python ''' tool to manipulate ArduPilot firmware files, changing default parameters ''' import os, sys, struct, json, base64, zlib, hashlib import argparse def to_ascii(s): '''get ascii string''' if sys.version_info.major >= 3: return str(s, 'ascii') else: return str(s) de...
gpl-3.0
pratapvardhan/scikit-learn
examples/decomposition/plot_faces_decomposition.py
103
4394
""" ============================ Faces dataset decompositions ============================ This example applies to :ref:`olivetti_faces` different unsupervised matrix decomposition (dimension reduction) methods from the module :py:mod:`sklearn.decomposition` (see the documentation chapter :ref:`decompositions`) . """...
bsd-3-clause
bretlowery/snakr
lib/django/contrib/gis/gdal/envelope.py
477
7009
""" The GDAL/OGR library uses an Envelope structure to hold the bounding box information for a geometry. The envelope (bounding box) contains two pairs of coordinates, one for the lower left coordinate and one for the upper right coordinate: +----------o Upper right; (max_x, max_y) ...
bsd-3-clause
hal0x2328/neo-python
neo/VM/ExecutionEngine.py
1
47965
import hashlib import datetime import traceback from neo.VM.OpCode import * from neo.VM.RandomAccessStack import RandomAccessStack from neo.VM.ExecutionContext import ExecutionContext from neo.VM import VMState from neo.VM.InteropService import Array, Struct, CollectionMixin, Map, Boolean from neo.Core.UInt160 import ...
mit
ioram7/keystone-federado-pgid2013
build/sqlalchemy/build/lib.linux-x86_64-2.7/sqlalchemy/connectors/pyodbc.py
17
5959
# connectors/pyodbc.py # Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from sqlalchemy.connectors import Connector from sqlalchemy.util import asbool i...
apache-2.0
artitj/authomatic
tests/functional_tests/expected_values/foursquare.py
12
3364
import calendar import re import fixtures import constants from authomatic.providers import oauth2 conf = fixtures.get_configuration('foursquare') CONFIG = { 'logout_url': 'https://foursquare.com/logout', 'login_xpath': '//*[@id="username"]', 'password_xpath': '//*[@id="password"]', 'consent_xpaths'...
mit
svn2github/chromium-depot-tools
third_party/boto/gs/key.py
51
31785
# Copyright 2010 Google Inc. # # 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, dis- # trib...
bsd-3-clause
nhippenmeyer/django
tests/template_tests/filter_tests/test_ljust.py
521
1081
from django.template.defaultfilters import ljust from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class LjustTests(SimpleTestCase): @setup({'ljust01': '{% autoescape off %}.{{ a|ljust:"5" }}. .{{ b|ljust:"5" }}.{% endautoescape %}'}) def test_lju...
bsd-3-clause
gerald-yang/ubuntu-iotivity-demo
snappy/grovepi/python-env/local/lib/python2.7/encodings/utf_16_be.py
860
1037
""" Python 'utf-16-be' Codec Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ import codecs ### Codec APIs encode = codecs.utf_16_be_encode def decode(input, errors='strict'): return codecs.utf_16_be_decode(input, errors, True) class IncrementalEncod...
apache-2.0
happyleavesaoc/home-assistant
tests/helpers/test_discovery.py
15
7537
"""Test discovery helpers.""" import asyncio from unittest.mock import patch import pytest from homeassistant import loader, setup from homeassistant.core import callback from homeassistant.exceptions import HomeAssistantError from homeassistant.helpers import discovery from tests.common import ( get_test_home_a...
apache-2.0
meine-stadt-transparent/meine-stadt-transparent
mainapp/tests/main/test_citytools.py
1
1865
import json from unittest import skip import pytest import responses from django.test import TestCase from mainapp.functions.citytools import import_outline, import_streets from mainapp.models import Body, SearchStreet @skip class TestCitytools(TestCase): fixtures = ["initdata"] ags_munich = "09162000" ...
mit
wilebeast/FireFox-OS
B2G/device/ti/panda/audio/test/music-monkey.py
3
2288
#!/usr/bin/env monkeyrunner # Imports the monkeyrunner modules used by this program from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice import time import random # Connects to the current device, returning a MonkeyDevice object device = MonkeyRunner.waitForConnection() # sets a variable with the package's...
apache-2.0
PeteW/luigi
luigi/contrib/pyspark_runner.py
2
4034
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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
txt/mase
python101/code/cartalk2.py
14
1058
"""This module contains code from Think Python by Allen B. Downey http://thinkpython.com Copyright 2012 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html http://www.cartalk.com/content/palindromic-odometer """ def has_palindrome(i, start, len): """Returns True if the integer i, when wri...
unlicense
makermade/arm_android-21_arm-linux-androideabi-4.8
lib/python2.7/multiprocessing/__init__.py
134
7805
# # Package analogous to 'threading.py' but using processes # # multiprocessing/__init__.py # # This package is intended to duplicate the functionality (and much of # the API) of threading.py but uses processes instead of threads. A # subpackage 'multiprocessing.dummy' has the same API but is a simple # wrapper for 't...
gpl-2.0
nishad89/newfies-dialer
newfies/apirest/view_subscriber.py
4
4726
# -*- coding: utf-8 -*- # # Newfies-Dialer License # http://www.newfies-dialer.org # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Copyright (C) 2011-2014 Star2Bil...
mpl-2.0
citizensense/pasture
database.py
1
12063
#!/usr/bin/python3 import os, sqlite3, json, time # Got some great tips from: # http://www.pythoncentral.io/introduction-to-sqlite-in-python/ # Class to manage all database operations class Database: # Create a new database connection _ def __init__(self, dbfile, dbstruct, ignore='locals'): self.msg =...
gpl-2.0
arokem/PyEMMA
pyemma/msm/tests/test_its.py
1
9069
# Copyright (c) 2015, 2014 Computational Molecular Biology Group, Free University # Berlin, 14195 Berlin, Germany. # 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 ...
bsd-2-clause
naveentata/coala-bears
tests/python/PyromaBearTest.py
23
2191
import unittest import os.path from queue import Queue from coalib.settings.Section import Section from bears.python.PyromaBear import PyromaBear def get_testdir_path(name): return os.path.join(os.path.dirname(__file__), 'pyroma_test_files', name) def get_message_list(results): return [result.message for r...
agpl-3.0
scenarios/tensorflow
tensorflow/contrib/layers/python/layers/regularizers_test.py
18
5956
# 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
tflink/testCloud
testCloud.py
1
9870
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2014, Red Hat, Inc. # License: GPL-2.0+ <http://spdx.org/licenses/GPL-2.0+> # See the LICENSE file for more details on Licensing """ This is a module for downloading fedora cloud images (and probably any other qcow2) and then booting them locally with qemu. """...
gpl-2.0
b0ttl3z/SickRage
lib/stevedore/extension.py
21
11403
"""ExtensionManager """ import pkg_resources import logging from .exception import NoMatches LOG = logging.getLogger(__name__) class Extension(object): """Book-keeping object for tracking extensions. The arguments passed to the constructor are saved as attributes of the instance using the same names,...
gpl-3.0
EchO-KID/google-breakpad
src/tools/python/filter_syms.py
76
8032
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this lis...
bsd-3-clause
carlgao/lenga
images/lenny64-peon/usr/share/python-support/python-django/django/contrib/auth/tests/models.py
318
1493
from django.conf import settings from django.test import TestCase from django.contrib.auth.models import User, SiteProfileNotAvailable class ProfileTestCase(TestCase): fixtures = ['authtestdata.json'] def setUp(self): """Backs up the AUTH_PROFILE_MODULE""" self.old_AUTH_PROFILE_MODULE = getattr...
mit
reingart/pyafipws
pyfepdf.py
1
65434
#!/usr/bin/python # -*- coding: latin-1 -*- # 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, or (at your option) any later # version. # # This program is distributed in the hope...
gpl-3.0
mlperf/training_results_v0.6
Google/benchmarks/transformer/implementations/tpu-v3-512-transformer/transformer/bin/t2t_trainer_vizier.py
6
1850
"""Auto tune Transformer via Vizier.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from absl import app from absl import flags import tensorflow as tf from bin import t2t_trainer from bin import vizier_flags # pylint: disable=unused-import from bin ...
apache-2.0
NeovaHealth/odoo
addons/mrp/wizard/change_production_qty.py
44
4920
# -*- 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
motion2015/edx-platform
openedx/core/djangoapps/user_api/migrations/0001_initial.py
114
4833
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'UserPreference' db.create_table('user_api_userpreference', ( ('id', self.gf('dja...
agpl-3.0
Jitrixis/2ARC-Network-stack
TVpy/api.py
1
1265
__author__ = 'jitrixis' from Factory.machinery import * class Api: def __init__(self, device="wlan0"): self.__engine = Engine(device) pass def getIP(self, mac): r = self.__engine.getArpIP(mac) return r def getMAC(self, ip): r = self.__engine.getArpMAC(ip) ...
mit
CyanogenMod/android_kernel_bn_omap
Documentation/target/tcm_mod_builder.py
3119
42754
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
charithag/iot-server-agents
RaspberryPiAgent/debian/usr/local/src/RaspberryAgent/httpServer.py
4
4665
#!/usr/bin/env python """ /** * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * WSO2 Inc. licenses this file to you 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...
apache-2.0
mathieu-aubin/multibootusb
scripts/pyudev/_qt_base.py
6
2635
# -*- coding: utf-8 -*- # Copyright (C) 2010, 2011, 2012 Sebastian Wiesner <lunaryorn@gmail.com> # 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...
gpl-3.0
SpamExperts/trac-slack
application.py
1
18428
#! /usr/bin/env python # -*- coding: utf-8 -*- """""" import os import pwd import json import logging import calendar import urlparse import functools try: import configparser except ImportError: import ConfigParser as configparser try: from xmlrpc import client except ImportError: import xmlrpclib ...
gpl-2.0
thurt/arangodb
3rdParty/V8-4.3.61/third_party/python_26/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...
apache-2.0
GbalsaC/bitnamiP
common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_modulev1.py
76
53383
import json import logging import traceback from lxml import etree from xmodule.timeinfo import TimeInfo from xmodule.capa_module import ComplexEncoder from xmodule.progress import Progress from xmodule.stringify import stringify_children from xmodule.open_ended_grading_classes import self_assessment_module from xmodul...
agpl-3.0
DamnWidget/mamba
mamba/unittest/fixtures.py
3
4944
# -*- test-case-name: mamba.test.test_fixtures -*- # Copyright (c) 2012 - 2014 Oscar Campos <oscar.campos@member.fsf.org> # See LICENSE for more details """ .. module:: fixtures :paltform: Unix, Windows :synopsis: Wrapper around Storm patch/schema mechanism to make mamba model objects testing ea...
gpl-3.0
gsmartway/odoo
addons/website_blog/__init__.py
373
1036
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-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
danbeam/catapult
third_party/webapp2/tests/extras_i18n_test.py
24
17726
# -*- coding: utf-8 -*- import datetime import gettext as gettext_stdlib import os from babel.numbers import NumberFormatError from pytz.gae import pytz import webapp2 from webapp2_extras import i18n import test_base class I18nTestCase(test_base.BaseTestCase): def setUp(self): super(I18nTestCase, self...
bsd-3-clause
cindyyu/kuma
vendor/packages/pygments/lexers/algebra.py
72
6167
# -*- coding: utf-8 -*- """ pygments.lexers.algebra ~~~~~~~~~~~~~~~~~~~~~~~ Lexers for computer algebra systems. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, bygroups, words from py...
mpl-2.0
Antiun/bank-payment
account_banking_sepa_direct_debit/models/res_company.py
13
3327
# -*- encoding: utf-8 -*- ############################################################################## # # SEPA Direct Debit module for OpenERP # Copyright (C) 2013 Akretion (http://www.akretion.com) # @author: Alexis de Lattre <alexis.delattre@akretion.com> # # This program is free software: you can redi...
agpl-3.0
erickt/hue
desktop/core/ext-py/South-1.0.2/south/tests/logger.py
128
2939
import io import logging import os import tempfile from south.tests import unittest import sys from django.conf import settings from django.db import connection, models from south.db import db from south.logger import close_logger class TestLogger(unittest.TestCase): """ Tests if the logging is working reas...
apache-2.0
saadatqadri/airflow
airflow/operators/__init__.py
8
2147
''' Imports operators dynamically while keeping the package API clean, abstracting the underlying modules ''' from airflow.utils import import_module_attrs as _import_module_attrs # These need to be integrated first as other operators depend on them _import_module_attrs(globals(), { 'check_operator': [ 'Ch...
apache-2.0
dims/cinder
cinder/tests/unit/test_api.py
36
2639
# 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
nugget/home-assistant
homeassistant/components/hangouts/config_flow.py
3
3879
"""Config flow to configure Google Hangouts.""" import voluptuous as vol from homeassistant import config_entries from homeassistant.const import CONF_EMAIL, CONF_PASSWORD from homeassistant.core import callback from .const import CONF_2FA, CONF_REFRESH_TOKEN, DOMAIN as HANGOUTS_DOMAIN @callback def configured_hang...
apache-2.0
burke-software/odfpy
odf/odfmanifest.py
76
3570
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2006-2007 Søren Roug, European Environment Agency # # 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 ...
gpl-2.0
kailIII/emaresa
aeroo/report_aeroo_direct_print/check_deps.py
16
1946
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (c) 2008-2012 Alistek Ltd (http://www.alistek.com) All Rights Reserved. # General contacts <info@alistek.com> # # WARNING: This program as such is intended to be used by professional...
agpl-3.0
justathoughtor2/atomicApe
cygwin/lib/python2.7/site-packages/docutils/parsers/rst/directives/misc.py
106
22888
# $Id: misc.py 7487 2012-07-22 21:20:28Z milde $ # Authors: David Goodger <goodger@python.org>; Dethe Elza # Copyright: This module has been placed in the public domain. """Miscellaneous directives.""" __docformat__ = 'reStructuredText' import sys import os.path import re import time from docutils import io, nodes, ...
gpl-3.0
akashsinghal/Speech-Memorization-App
Python_Backend/env/lib/python3.6/site-packages/pip/_vendor/html5lib/filters/inject_meta_charset.py
354
2742
from __future__ import absolute_import, division, unicode_literals from . import base class Filter(base.Filter): def __init__(self, source, encoding): base.Filter.__init__(self, source) self.encoding = encoding def __iter__(self): state = "pre_head" meta_found = (self.encodin...
apache-2.0
RobinQuetin/CAIRIS-web
cairis/cairis/controllers/UserController.py
1
2731
import httplib from flask.ext.restful_swagger import swagger from flask import request, make_response, session from flask.ext.restful import Resource from jsonpickle import encode from Borg import Borg from CairisHTTPError import MissingParameterHTTPError, MalformedJSONHTTPError from tools.ModelDefinitions import Use...
apache-2.0
blackzw/openwrt_sdk_dev1
staging_dir/host/lib/python2.7/random.py
35
32268
"""Random variable generators. integers -------- uniform within range sequences --------- pick random element pick random sample generate random permutation distributions on the real line: ------------------------------ uniform ...
gpl-2.0
0x0all/SASM
Windows/MinGW64/opt/lib/python2.7/encodings/shift_jisx0213.py
816
1059
# # shift_jisx0213.py: Python Unicode Codec for SHIFT_JISX0213 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_jp, codecs import _multibytecodec as mbc codec = _codecs_jp.getcodec('shift_jisx0213') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEnc...
gpl-3.0
cstorey/clap-rs
clap-tests/run_tests.py
1
8808
#!/usr/bin/env python import sys import subprocess import re import difflib failed = False _ansi = re.compile(r'\x1b[^m]*m') _help = '''claptests v1.4.8 Kevin K. <kbknapp@gmail.com> tests clap library USAGE: \tclaptests [FLAGS] [OPTIONS] [ARGS] [SUBCOMMAND] FLAGS: -f, --flag tests flags -F ...
mit
0k/OpenUpgrade
addons/account/wizard/account_report_common_journal.py
385
2942
# -*- 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
sajeeshcs/nested_quota
nova/tests/integrated/v3/test_cells.py
31
4201
# Copyright 2012 Nebula, Inc. # Copyright 2013 IBM Corp. # # 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...
apache-2.0
aiyappaganesh/OP
handlers/request_handler.py
1
1093
from util import http_util import webapp2 import webapp2_extras from webapp2_extras import sessions webapp2_extras.sessions.default_config['secret_key'] = 'asdfasdf' webapp2_extras.sessions.default_config['cookie_name'] = 'underdogs' APP_JSON = "application/json" class RequestHandlerMixin(object): def write(self...
gpl-2.0
ConvergenceDev/apiai-selvycure-booking-webhook
action_processor.py
1
5739
# -*- coding: utf-8 -*- import os from datetime import datetime import json from apscheduler.schedulers.background import BackgroundScheduler import requests FACEBOOK_SEND_URL = "https://graph.facebook.com/v2.6/me/messages" class ActionProcessor(object): action = None request = None sender_id = None ...
apache-2.0
cosbynator/NPSGD
npsgd_queue.py
1
18139
#!/usr/bin/python # Author: Thomas Dimson [tdimson@gmail.com] # Date: January 2011 # For distribution details, see LICENSE """Queue server for npsgd modelling tasks. The queue server is the data backend for NPSGD. It listens to both workers and the web interface. The web interface populates it with requests while t...
bsd-3-clause
abergmeier-dsfishlabs/bazel
tools/cpp/wrapper/bin/pydir/msvc_link.py
6
4313
# pylint: disable=g-bad-file-header # Copyright 2016 The Bazel 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 ...
apache-2.0
ChanduERP/odoo
addons/account_analytic_plans/report/__init__.py
445
1084
# -*- 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...
agpl-3.0
Lincoln-Cybernetics/Explore-
player.py
1
21476
import pygame import random class Player(pygame.sprite.Sprite): def __init__(self, level, *groups): super(Player, self).__init__(*groups) #the game level self.level = level #spritegrups self.unpassable = pygame.sprite.Group() #base image sel...
unlicense
fernandoacorreia/DjangoWAWSLogging
DjangoWAWSLogging/env/Lib/encodings/unicode_internal.py
827
1196
""" Python 'unicode-internal' Codec Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ import codecs ### Codec APIs class Codec(codecs.Codec): # Note: Binding these as C functions will result in the class not # converting them to methods. This is in...
mit
Microsoft/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/conda_env/env.py
1
5704
from __future__ import absolute_import, print_function from collections import OrderedDict from copy import copy from itertools import chain import os from conda.base.context import context from conda.cli import common # TODO: this should never have to import form conda.cli from conda.common.serialize import yaml_lo...
apache-2.0
telefonicaid/perseo-fe
test/acceptance/integration/__init__.py
1
1548
# -*- coding: utf-8 -*- # # Copyright 2015 Telefonica Investigación y Desarrollo, S.A.U # # This file is part of perseo-fe # # perseo-fe 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 ...
agpl-3.0
bogdal/django-payments
payments/widgets.py
8
1257
import re from django.template.loader import render_to_string from django.forms.widgets import TextInput, MultiWidget class CreditCardNumberWidget(TextInput): def render(self, name, value, attrs=None): if value: value = re.sub('[\s-]', '', value) if len(value) == 16: ...
bsd-3-clause
tmenjo/cinder-2015.1.1
cinder/cmd/manage.py
4
19153
#!/usr/bin/env python # Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # 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 ...
apache-2.0
dirtycold/git-cola
cola/widgets/diff.py
3
24027
from __future__ import division, absolute_import, unicode_literals import re from qtpy import QtGui from qtpy import QtWidgets from qtpy.QtCore import Qt from qtpy.QtCore import Signal from .. import actions from .. import cmds from .. import core from .. import gitcfg from .. import gitcmds from .. import gravatar f...
gpl-2.0