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
iliamo/video-prototype
.waf-tools/dcf.py
8
2944
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- from waflib import Logs, Configure def options(opt): opt.add_option('--debug', '--with-debug', action='store_true', default=False, dest='debug', help='''Compile in debugging mode without optimizations (-O0 or -Og...
lgpl-3.0
wadobo/GECO
src/gecod/gecod/xmlrpc_frontend.py
1
3242
#!/usr/bin/python # -*- coding: utf-8 -*- ''' Provides a xmlrpc frontend to gecod backend ''' import backend import secure_xmlrpc as sxmlrpc HOST = 'localhost' PORT = 4343 DATABASE = 'sqlite:///database.sqlite' KEYFILE='certs/key.pem' CERTFILE='certs/cert.pem' def parseconfig(configfile): global HOST, PORT, DAT...
gpl-3.0
prior/webinars
webinars_web/webinars/views/events.py
1
10543
from operator import attrgetter from django.http import HttpResponse,HttpResponseRedirect,HttpResponseNotFound,HttpResponseForbidden from django.shortcuts import render_to_response from django.views.decorators.http import require_GET, require_POST from webinars_web.webinars.forms.event import EventForm from marketplace...
apache-2.0
brucetsao/arduino-ameba
build/windows/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/arm-none-eabi/lib/libstdc++.a-gdb.py
3
2389
# -*- python -*- # Copyright (C) 2009-2013 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 versio...
lgpl-2.1
andcor02/mbed-os
tools/export/qtcreator/__init__.py
21
2260
""" mbed SDK Copyright (c) 2014-2017 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 law or agreed to in wr...
apache-2.0
eeshangarg/oh-mainline
vendor/packages/twisted/twisted/enterprise/sqlreflector.py
19
11865
# -*- test-case-name: twisted.test.test_reflector -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. from twisted.enterprise import reflector from twisted.enterprise.util import DBError, getKeyColumn, quote, safe from twisted.enterprise.util import _TableInfo from twisted.enterprise.row impor...
agpl-3.0
edmundgentle/schoolscript
SchoolScript/bin/Debug/pythonlib/Lib/distutils/command/bdist_dumb.py
1
4801
"""distutils.command.bdist_dumb Implements the Distutils 'bdist_dumb' command (create a "dumb" built distribution -- i.e., just an archive to be unpacked under $prefix or $exec_prefix).""" __revision__ = "$Id$" import os from distutils.core import Command from distutils.util import get_platform from distu...
gpl-2.0
remitamine/youtube-dl
youtube_dl/extractor/puhutv.py
2
9093
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import ( compat_HTTPError, compat_str, ) from ..utils import ( ExtractorError, int_or_none, float_or_none, parse_resolution, str_or_none, try_get, unified_timestamp, url_or_no...
unlicense
icejoywoo/tornado
maint/scripts/test_resolvers.py
115
1494
#!/usr/bin/env python from __future__ import print_function import pprint import socket from tornado import gen from tornado.ioloop import IOLoop from tornado.netutil import Resolver, ThreadedResolver from tornado.options import parse_command_line, define, options try: import twisted except ImportError: twis...
apache-2.0
prefetchnta/questlab
bin/python/Lib/_markupbase.py
891
14598
"""Shared support for scanning document type declarations in HTML and XHTML. This module is used as a foundation for the html.parser module. It has no documented public API and should not be used directly. """ import re _declname_match = re.compile(r'[a-zA-Z][-_.a-zA-Z0-9]*\s*').match _declstringlit_match = re.com...
lgpl-2.1
sunlightlabs/billy
billy/tests/importers/test_bills.py
4
11960
import copy from billy.core import db from billy.importers import bills, names from nose.tools import with_setup, assert_equal from .. import fixtures def setup_func(): db.bills.drop() db.votes.drop() db.legislators.drop() db.document_ids.drop() db.vote_ids.drop() db.committees.drop() na...
bsd-3-clause
Zord13appdesa/python-for-android
python-modules/twisted/twisted/conch/ssh/session.py
56
10307
# -*- test-case-name: twisted.conch.test.test_session -*- # Copyright (c) 2001-2009 Twisted Matrix Laboratories. # See LICENSE for details. """ This module contains the implementation of SSHSession, which (by default) allows access to a shell and a python interpreter over SSH. Maintainer: Paul Swartz """ import stru...
apache-2.0
ryantjohnson/py-roots
lib/jinja2/exceptions.py
977
4428
# -*- coding: utf-8 -*- """ jinja2.exceptions ~~~~~~~~~~~~~~~~~ Jinja exceptions. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ from jinja2._compat import imap, text_type, PY2, implements_to_string class TemplateError(Exception): """Baseclass for al...
apache-2.0
cristiana214/cristianachavez214-cristianachavez
python/BeautifulSoup/setup.py
88
2927
from distutils.core import setup import unittest import warnings warnings.filterwarnings("ignore", "Unknown distribution option") import sys # patch distutils if it can't cope with the "classifiers" keyword if sys.version < '2.2.3': from distutils.dist import DistributionMetadata DistributionMetadata.classifie...
apache-2.0
redhat-openstack/cinder
cinder/openstack/common/fileutils.py
6
4041
# Copyright 2011 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 req...
apache-2.0
tjyang/vitess
py/vtproto/topodata_pb2.py
3
52839
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: topodata.proto from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf imp...
bsd-3-clause
WillisXChen/django-oscar
src/oscar/apps/catalogue/app.py
19
1907
from django.conf.urls import include, url from oscar.apps.catalogue.reviews.app import application as reviews_app from oscar.core.application import Application from oscar.core.loading import get_class class BaseCatalogueApplication(Application): name = 'catalogue' detail_view = get_class('catalogue.views', ...
bsd-3-clause
parjong/coreclr
src/ToolBox/SOS/tests/t_cmd_bpmd_nofuturemodule_module_function.py
43
1576
import lldb import re import testutils as test # bpmd -nofuturemodule <module name> <managed function name> def runScenario(assembly, debugger, target): process = target.GetProcess() res = lldb.SBCommandReturnObject() ci = debugger.GetCommandInterpreter() # Process must be stopped here while libcore...
mit
Fabien-B/Web_ASA_Sourdoire
www/parcelle.py
1
4236
import mysql.connector import datetime class Parcelle(object): database = 'IENAC14_asa' user = 'root' password = 'root' host = '127.0.0.1' def __init__(self,id_parc,compteur=None,nom=None,lat=None,lon=None,altitude=None): if id_parc>0: self.load(id_parc) else: ...
lgpl-3.0
walterst/qiime
qiime/compare_alpha_diversity.py
15
11927
#!/usr/bin/env python # File created on 19 May 2011 from __future__ import division __author__ = "William Van Treuren" __copyright__ = "Copyright 2011, The QIIME project" __credits__ = ["William Van Treuren", "Greg Caporaso", "Jai Ram Rideout"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "William Va...
gpl-2.0
littleyang/shadows
shadowsocks/eventloop.py
949
7288
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2013-2015 clowwindy # # 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 requi...
apache-2.0
saknis/upelis
logs4.py
1
5178
#!/usr/bin/env python import base64 import cgi import datetime import logging import os import time #from datetime import datetime, date, time import urllib import wsgiref.handlers import string from google.appengine.api import users from google.appengine.api.logservice import logservice from google....
lgpl-2.1
agiliq/django-secure-login
secure_login/tests.py
1
9858
from django.test import TestCase from django.contrib.auth.models import User from django.contrib.auth import authenticate from django.core import mail from django.test.utils import override_settings from django.conf import settings from django import forms from django.contrib.auth.backends import ModelBackend from .mo...
bsd-3-clause
clearpathrobotics/axis_camera
nodes/axis.py
1
8123
#!/usr/bin/env python # # Axis camera image driver. Based on: # https://code.ros.org/svn/wg-ros-pkg/branches/trunk_cturtle/sandbox/axis_camera # /axis.py # import threading import urllib2 import rospy from sensor_msgs.msg import CompressedImage, CameraInfo import camera_info_manager class StreamThread(threading.Thr...
bsd-3-clause
jdramani/servo
tests/wpt/css-tests/tools/wptserve/tests/functional/test_stash.py
299
1231
import os import unittest import urllib2 import json import uuid import wptserve from wptserve.router import any_method from base import TestUsingServer, doc_root class TestResponseSetCookie(TestUsingServer): def test_put_take(self): @wptserve.handlers.handler def handler(request, response): ...
mpl-2.0
renard/ansible-modules-core
web_infrastructure/htpasswd.py
99
8780
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Nimbis Services, Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (...
gpl-3.0
bolabola/PTVS
Python/Tests/TestData/VirtualEnv/env/Lib/encodings/gbk.py
61
1054
# # gbk.py: Python Unicode Codec for GBK # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_cn, codecs import _multibytecodec as mbc codec = _codecs_cn.getcodec('gbk') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.Multibyte...
apache-2.0
jacebrowning/gridcommand
setup.py
1
1810
#!/usr/bin/env python """Setup script for the package.""" import os import sys import setuptools PACKAGE_NAME = 'gridcommand' MINIMUM_PYTHON_VERSION = 3, 5 def check_python_version(): """Exit when the Python version is too low.""" if sys.version_info < MINIMUM_PYTHON_VERSION: sys.exit("Python {}....
lgpl-3.0
Impactstory/oadoi
queue_pdf_url_check.py
2
7965
import argparse import os import random import logging from datetime import datetime from multiprocessing import Pool, current_process from time import sleep from time import time from sqlalchemy import orm from sqlalchemy import text from sqlalchemy.orm import make_transient from app import db from app import logger...
mit
ashang/calibre
src/calibre/ebooks/lrf/pylrs/elements.py
24
2078
""" elements.py -- replacements and helpers for ElementTree """ class ElementWriter(object): def __init__(self, e, header=False, sourceEncoding="ascii", spaceBeforeClose=True, outputEncodingName="UTF-16"): self.header = header self.e = e self.sourceEncoding=sourceEncoding ...
gpl-3.0
xpndlabs/kivy
kivy/tests/test_uix_stacklayout.py
55
4058
''' uix.stacklayout tests ===================== ''' import unittest from kivy.uix.stacklayout import StackLayout from kivy.uix.widget import Widget class UixStackLayoutTest(unittest.TestCase): def test_stacklayout_no_children(self): sl = StackLayout() sl.do_layout() def test_stacklayout_de...
mit
fedorpatlin/ansible
lib/ansible/modules/cloud/vmware/vmware_host.py
65
7742
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Joseph Callen <jcallen () csc.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 Li...
gpl-3.0
nsoranzo/tools-iuc
tools/extract_genomic_dna/extract_genomic_dna_utils.py
16
16710
import copy import os import subprocess import sys import tempfile from bx.intervals.io import Comment, GenomicInterval, Header from bx.intervals.io import GenomicIntervalReader, NiceReaderWrapper, ParseError from six import Iterator # Default chrom, start, end, strand cols for a bed file BED_DEFAULT_COLS = 0, 1, 2, ...
mit
ledbutter/ProjectEulerPython
Problem39.py
1
1375
# If p is the perimeter of a right angle triangle with integral length sides, {a,b,c}, there are exactly three solutions for p = 120. # {20,48,52}, {24,45,51}, {30,40,50} # For which value of p 1000, is the number of solutions maximised? # p = 120 # sols = 0 # for a in range(1, p//2): # for b in range...
mit
hansey/youtube-dl
youtube_dl/extractor/tenplay.py
114
3653
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( int_or_none, float_or_none, ) class TenPlayIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?ten(play)?\.com\.au/.+' _TEST = { 'url': 'http://tenplay.com.au/ten-insider/extra/sea...
unlicense
bitcoinknots/bitcoin
test/functional/test_framework/key.py
27
13480
# Copyright (c) 2019 Pieter Wuille # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test-only secp256k1 elliptic curve implementation WARNING: This code is slow, uses bad randomness, does not properly protect keys, and is trivia...
mit
silenceli/nova
nova/tests/unit/api/test_wsgi.py
111
2195
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2010 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance wi...
apache-2.0
NoelMacwan/SXDHuashan
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
ericmckean/syzygy
syzygy/py/test_utils/testing.py
4
19518
# Copyright 2012 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 a...
apache-2.0
MioYvo/Tornado-Redis-Chat
auth.py
2
5149
# coding=UTF-8 # Tornado modules. import tornado.web import tornado.escape # Import application modules. from base import BaseHandler # General modules. import logging class LoginHandler(BaseHandler, tornado.auth.GoogleMixin): """ Handler for logins with Google Open ID / OAuth http://www.tornadoweb.or...
mit
sander76/home-assistant
homeassistant/components/tankerkoenig/sensor.py
5
4469
"""Tankerkoenig sensor integration.""" import logging from homeassistant.components.sensor import SensorEntity from homeassistant.const import ( ATTR_ATTRIBUTION, ATTR_LATITUDE, ATTR_LONGITUDE, CURRENCY_EURO, ) from homeassistant.helpers.update_coordinator import ( CoordinatorEntity, DataUpdat...
apache-2.0
7kbird/chrome
chrome/common/extensions/docs/server2/instance_servlet.py
17
3770
# 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. from branch_utility import BranchUtility from compiled_file_system import CompiledFileSystem from environment import IsDevServer, IsReleaseServer from github...
bsd-3-clause
goyalankit/po-compiler
object_files/networkx-1.8.1/build/lib.linux-i686-2.7/networkx/readwrite/json_graph/tests/test_serialize.py
35
1329
import json from nose.tools import assert_equal, assert_raises, assert_not_equal,assert_true import networkx as nx from networkx.readwrite.json_graph import * class TestAdjacency: def test_graph(self): G = nx.path_graph(4) H = loads(dumps(G)) nx.is_isomorphic(G,H) def test_graph_attri...
apache-2.0
overtherain/scriptfile
software/googleAppEngine/lib/django_1_2/django/template/smartif.py
331
6261
""" Parser and utilities for the smart 'if' tag """ import operator # Using a simple top down parser, as described here: # http://effbot.org/zone/simple-top-down-parsing.htm. # 'led' = left denotation # 'nud' = null denotation # 'bp' = binding power (left = lbp, right = rbp) class TokenBase(object): """ Ba...
mit
AOSPU/external_chromium_org
build/linux/unbundle/remove_bundled_libraries.py
43
2549
#!/usr/bin/env python # 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. """ Removes bundled libraries to make sure they are not used. See README for more details. """ import optparse import os.path import...
bsd-3-clause
delinhabit/django
django/core/files/move.py
554
2794
""" Move a file in the safest way possible:: >>> from django.core.files.move import file_move_safe >>> file_move_safe("/tmp/old_file", "/tmp/new_file") """ import os from shutil import copystat from django.core.files import locks __all__ = ['file_move_safe'] def _samefile(src, dst): # Macintosh, Unix....
bsd-3-clause
android-ia/platform_external_chromium_org
tools/telemetry/telemetry/core/platform/power_monitor/android_dumpsys_power_monitor.py
26
4609
# 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 csv import logging from collections import defaultdict from telemetry.core.platform.power_monitor import sysfs_power_monitor class DumpsysPowerMoni...
bsd-3-clause
google/personfinder
app/indexing.py
1
10056
# Copyright 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
apache-2.0
SujaySKumar/bedrock
bedrock/tabzilla/middleware.py
29
1054
# 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/. from django.conf import settings from bedrock.base.middleware import LocaleURLMiddleware class TabzillaLocaleURLMiddl...
mpl-2.0
hynnet/hiwifi-openwrt-HC5661-HC5761
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/test/test_set.py
61
62916
import unittest from test import test_support import gc import weakref import operator import copy import pickle from random import randrange, shuffle import sys import collections class PassThru(Exception): pass def check_pass_thru(): raise PassThru yield 1 class BadCmp: def __hash__(self): ...
gpl-2.0
mat650/metagoofil
hachoir_parser/audio/s3m.py
38
24149
""" The ScreamTracker 3.0x module format description for .s3m files. Documents: - Search s3m on Wotsit http://www.wotsit.org/ Author: Christophe GISQUET <christophe.gisquet@free.fr> Creation: 11th February 2007 """ from hachoir_parser import Parser from hachoir_core.field import (StaticFieldSet, FieldSet, Field, ...
gpl-2.0
mateor/pants
src/python/pants/backend/jvm/repository.py
16
1356
# 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) import os class Re...
apache-2.0
brianbeale/flask
tests/test_instance_config.py
157
4365
# -*- coding: utf-8 -*- """ tests.test_instance ~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2015 by the Flask Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import os import sys import pytest import flask from flask._compat import PY2 def test_explicit_instance_paths(mo...
bsd-3-clause
mdanielwork/intellij-community
python/lib/Lib/encodings/iso2022_kr.py
816
1053
# # iso2022_kr.py: Python Unicode Codec for ISO2022_KR # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_iso2022, codecs import _multibytecodec as mbc codec = _codecs_iso2022.getcodec('iso2022_kr') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncod...
apache-2.0
gnowxilef/youtube-dl
youtube_dl/extractor/toypics.py
21
2763
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor import re class ToypicsIE(InfoExtractor): IE_DESC = 'Toypics user profile' _VALID_URL = r'https?://videos\.toypics\.net/view/(?P<id>[0-9]+)/.*' _TEST = { 'url': 'http://videos.toypics.net/view/514/chancebulg...
unlicense
biosbits/bits
python/cpu_nhm.py
2
7337
# Copyright (c) 2012, Intel Corporation # 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 condit...
bsd-3-clause
nlloyd/SubliminalCollaborator
libs/twisted/python/context.py
25
3917
# -*- test-case-name: twisted.test.test_context -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. # """ Dynamic pseudo-scoping for Python. Call functions with context.call({key: value}, func); func and functions that it calls will be able to use 'context.get(key)' to retrieve 'value'. This...
apache-2.0
KhalidGit/flask
Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/pip/_vendor/html5lib/treewalkers/pulldom.py
1729
2302
from __future__ import absolute_import, division, unicode_literals from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, \ COMMENT, IGNORABLE_WHITESPACE, CHARACTERS from . import _base from ..constants import voidElements class TreeWalker(_base.TreeWalker): def __iter__(self): ignore_until = None...
apache-2.0
lewischeng-ms/pox
tests/generate.py
32
3745
#!/usr/bin/env python from fnmatch import fnmatchcase import hashlib from optparse import OptionParser import sys from os import path import os import re import stat from string import Template SCRIPT_DIR=path.dirname(path.abspath(sys.modules['__main__'].__file__)) ROOT=path.abspath(path.join(SCRIPT_DIR,"..")) UNIT_T...
gpl-3.0
benthomasson/ansible
lib/ansible/modules/notification/typetalk.py
8
3392
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: Ansible Project # 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.0', ...
gpl-3.0
mozvip/Sick-Beard
lib/hachoir_parser/image/pcx.py
90
2745
""" PCX picture filter. """ from lib.hachoir_parser import Parser from lib.hachoir_core.field import ( UInt8, UInt16, PaddingBytes, RawBytes, Enum) from lib.hachoir_parser.image.common import PaletteRGB from lib.hachoir_core.endian import LITTLE_ENDIAN class PcxFile(Parser): endian = LITTLE_ENDIAN ...
gpl-3.0
miguelalba89/hfdp-python
combining/observer.py
1
7761
""" Ducks problem with quackologists (observers) Author: m1ge7 Date: 2014/03/24 """ from abc import ABCMeta, abstractmethod ############################################################################### # ############################################################################### class QuackObservable: _...
gpl-3.0
cvicentiu/mariadb-10.0
storage/tokudb/mysql-test/tokudb/t/change_column_int.py
21
1913
#!/usr/bin/env python import sys def gen_test(types, values): for a in range(len(types)): for b in range(len(types)): print print "CREATE TABLE t (a %s);" % (types[a]) if a > b: print "--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/" print "--er...
gpl-2.0
akopytov/percona-xtradb-cluster
percona-xtradb-cluster-tests/python/subunit/tests/__init__.py
63
1546
# # subunit: extensions to python unittest to get test results from subprocesses. # Copyright (C) 2005 Robert Collins <robertc@robertcollins.net> # # Licensed under either the Apache License, Version 2.0 or the BSD 3-clause # license at the users choice. A copy of both licenses are available in the # project sour...
gpl-2.0
bolkedebruin/airflow
tests/providers/google/cloud/operators/test_compute_system_helper.py
1
5190
#!/usr/bin/env python # -*- coding: utf-8 -*- # # 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 Licen...
apache-2.0
xuru/pyvisdk
pyvisdk/do/virtual_serial_port_file_backing_option.py
1
1088
import logging from pyvisdk.exceptions import InvalidArgumentError ######################################## # Automatically generated, do not edit. ######################################## log = logging.getLogger(__name__) def VirtualSerialPortFileBackingOption(vim, *args, **kwargs): '''The data object type con...
mit
dpetzold/django
tests/gis_tests/geoapp/test_serializers.py
245
3731
from __future__ import unicode_literals import json from django.contrib.gis.geos import LinearRing, Point, Polygon from django.core import serializers from django.test import TestCase, mock, skipUnlessDBFeature from django.utils import six from .models import City, MultiFields, PennsylvaniaCity @skipUnlessDBFeatur...
bsd-3-clause
batxes/4Cin
Six_mouse_models/Six_mouse_models_final_output_0.2_-0.1_11000/Six_mouse_models39307.py
4
18205
import _surface import chimera try: import chimera.runCommand except: pass from VolumePath import markerset as ms try: from VolumePath import Marker_Set, Link new_marker_set=Marker_Set except: from VolumePath import volume_path_dialog d= volume_path_dialog(True) new_marker_set= d.new_marker_set marker_set...
gpl-3.0
ptisserand/portage
pym/_emerge/emergelog.py
11
1675
# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import unicode_literals import io import sys import time import portage from portage import os from portage import _encodings from portage import _unicode_decode from portage import _unicode_enco...
gpl-2.0
bendmorris/jython-pgu
examples/gui11.py
13
1166
import sys sys.path.insert(0, '..') import pygame from pygame.locals import * from pgu import gui _count = 1 # for added items def clear_list(arg): my_list.clear() my_list.resize() my_list.repaint() def remove_list_item(arg): v = my_list.value if v: item = v my_list.remove(ite...
lgpl-2.1
vabs22/zulip
analytics/management/commands/active_user_stats.py
6
3027
from __future__ import absolute_import from __future__ import print_function from django.core.management.base import BaseCommand from django.utils.timezone import now as timezone_now from typing import Any, Dict, List from zerver.models import UserPresence, UserActivity from zerver.lib.utils import statsd, statsd_key...
apache-2.0
waseem18/oh-mainline
vendor/packages/markupsafe/markupsafe/__init__.py
371
8205
# -*- coding: utf-8 -*- """ markupsafe ~~~~~~~~~~ Implements a Markup string. :copyright: (c) 2010 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import re from markupsafe._compat import text_type, string_types, int_types, \ unichr, PY2 __all__ = ['Markup', 'soft_unicod...
agpl-3.0
sstrigger/Sick-Beard
lib/hachoir_parser/archive/tar.py
90
4459
""" Tar archive parser. Author: Victor Stinner """ from lib.hachoir_parser import Parser from lib.hachoir_core.field import (FieldSet, Enum, UInt8, SubFile, String, NullBytes) from lib.hachoir_core.tools import humanFilesize, paddingSize, timestampUNIX from lib.hachoir_core.endian import BIG_ENDIAN import re cla...
gpl-3.0
akshatharaj/django
django/db/models/fields/files.py
129
19629
import datetime import os import warnings from django import forms from django.core import checks from django.core.files.base import File from django.core.files.images import ImageFile from django.core.files.storage import default_storage from django.db.models import signals from django.db.models.fields import Field f...
bsd-3-clause
habibmasuro/django-wiki
django_notify/migrations/0001_initial.py
3
9233
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models try: from django.contrib.auth import get_user_model except ImportError: # django < 1.5 from django.contrib.auth.models import User else: User = get_user_model() user_orm_label...
gpl-3.0
fintech-circle/edx-platform
common/djangoapps/util/tests/test_django_utils.py
60
2110
""" THE TESTS IN THIS MODULE SHOULD BE RUN ON THE SAME PROCESS TO BE MEANINGFUL!!! The tests in this module look kind of goofy, but the idea is to make sure that cache values can't leak between different TestCase classes and methods. The need for this will go away whenever Django merges the fix to reset the caches bet...
agpl-3.0
cctaylor/googleads-python-lib
examples/dfp/v201502/label_service/get_all_labels.py
3
1711
#!/usr/bin/python # # Copyright 2015 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 b...
apache-2.0
dulems/hue
desktop/core/ext-py/Django-1.6.10/tests/custom_managers_regress/models.py
64
1192
""" Regression tests for custom manager classes. """ from django.db import models from django.utils.encoding import python_2_unicode_compatible class RestrictedManager(models.Manager): """ A manager that filters out non-public instances. """ def get_queryset(self): return super(RestrictedMana...
apache-2.0
Zerknechterer/pyload
module/lib/thrift/TSerialization.py
74
1344
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
gpl-3.0
heeraj123/oh-mainline
vendor/packages/Django/django/contrib/gis/tests/inspectapp/tests.py
134
5128
from __future__ import absolute_import import os from django.db import connections from django.test import TestCase from django.contrib.gis.gdal import Driver from django.contrib.gis.geometry.test_data import TEST_DATA from django.contrib.gis.utils.ogrinspect import ogrinspect from .models import AllOGRFields clas...
agpl-3.0
pattisdr/osf.io
api/meetings/views.py
1
9146
from rest_framework import generics, permissions as drf_permissions from rest_framework.exceptions import NotFound from django.db.models import Q, Count, Subquery, OuterRef, Case, When, Value, CharField, F, IntegerField from django.db.models.functions import Length, Substr, Coalesce from django.contrib.contenttypes.mo...
apache-2.0
vijayendrabvs/ssl-neutron
neutron/plugins/ml2/driver_api.py
1
21254
# Copyright (c) 2013 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 ...
apache-2.0
yamada-h/ryu
ryu/lib/packet/igmp.py
31
18918
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation. # # 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 appli...
apache-2.0
duonys/deep-learning-chainer
dlchainer/SdA.py
1
5225
#-*- coding: utf-8 -*- from abc import ABCMeta, abstractmethod import copy import numpy as np from sklearn.base import BaseEstimator, ClassifierMixin, RegressorMixin from sklearn.externals.six import with_metaclass from chainer import Variable, FunctionSet, optimizers, cuda import chainer.functions as F from .dA impor...
mit
dzan/xenOnArm
tools/python/xen/xend/server/vscsiif.py
44
9529
#============================================================================ # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in the hope th...
gpl-2.0
igemsoftware/SYSU-Software2013
project/Python27_32/Lib/site-packages/jinja2/compiler.py
121
61899
# -*- coding: utf-8 -*- """ jinja2.compiler ~~~~~~~~~~~~~~~ Compiles nodes into python code. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ from cStringIO import StringIO from itertools import chain from copy import deepcopy from jinja2 import nodes from j...
mit
gskachkov/phantomjs
src/qt/qtwebkit/Tools/QueueStatusServer/loggers/recordbotevent.py
122
1925
# Copyright (C) 2013 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
vladikr/nova_drafts
nova/tests/api/ec2/test_ec2_validate.py
9
11292
# Copyright 2012 Cloudscaling, Inc. # All Rights Reserved. # Copyright 2013 Red Hat, 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/L...
apache-2.0
matthieudumont/dipy
dipy/reconst/tests/test_dsi_metrics.py
8
1713
import numpy as np from dipy.reconst.dsi import DiffusionSpectrumModel from dipy.data import get_data from dipy.core.gradients import gradient_table from numpy.testing import (assert_almost_equal, run_module_suite) from dipy.sims.voxel import (SticksAndBall, Multi...
bsd-3-clause
SecPi/SecPi
worker/temperature_sensor.py
1
2642
from tools.sensor import Sensor import glob import logging import os import threading import time class TemperatureSensor(Sensor): #DS18B20 digital temperature sensor def __init__(self, id, params, worker): super(TemperatureSensor, self).__init__(id, params, worker) #self.active = False try: self.min = int...
gpl-3.0
bcoca/ansible
test/units/module_utils/basic/test_dict_converters.py
166
1032
# -*- coding: utf-8 -*- # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2016 Toshio Kuratomi <tkuratomi@ansible.com> # (c) 2017 Ansible Project # 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 ...
gpl-3.0
robbymeals/scikit-learn
sklearn/cluster/tests/test_dbscan.py
114
11393
""" Tests for DBSCAN clustering algorithm """ import pickle import numpy as np from scipy.spatial import distance from scipy import sparse from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.utils.testing im...
bsd-3-clause
openstates/openstates
openstates/ct/events.py
1
1993
import datetime import json from pupa.scrape import Scraper, Event import pytz from .utils import open_csv class CTEventScraper(Scraper): _tz = pytz.timezone("US/Eastern") def __init__(self, *args, **kwargs): super(CTEventScraper, self).__init__(*args, **kwargs) def scrape(self): for...
gpl-3.0
martinjrobins/hobo
pints/tests/test_opt_cmaes.py
1
5620
#!/usr/bin/env python3 # # Tests the basic methods of the CMAES optimiser. # # This file is part of PINTS. # Copyright (c) 2017-2018, University of Oxford. # For licensing information, see the LICENSE file distributed with the PINTS # software package. # import unittest import numpy as np import pints import pints....
bsd-3-clause
menpo/menpo
menpo/model/gmrf.py
2
47953
from functools import partial import numpy as np from scipy.sparse import bsr_matrix from menpo.base import name_of_callable from menpo.math import as_matrix from menpo.shape import UndirectedGraph from menpo.visualize import print_progress, bytes_str, print_dynamic def _covariance_matrix_inverse(cov_mat, n_componen...
bsd-3-clause
akhan7/servo
tests/wpt/web-platform-tests/tools/pytest/testing/test_resultlog.py
171
7770
import os import _pytest._code import py import pytest from _pytest.main import Node, Item, FSCollector from _pytest.resultlog import generic_path, ResultLog, \ pytest_configure, pytest_unconfigure def test_generic_path(testdir): from _pytest.main import Session config = testdir.parseconfig() ses...
mpl-2.0
awatts/boto
tests/integration/route53/test_zone.py
100
7729
# Copyright (c) 2011 Blue Pines Technologies LLC, Brad Carleton # www.bluepines.org # Copyright (c) 2012 42 Lines Inc., Jim Browne # # 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 re...
mit
EvanK/ansible
lib/ansible/modules/net_tools/netbox/netbox_ip_address.py
6
15128
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Mikhail Yohman (@fragmentedpacket) <mikhail.yohman@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_MET...
gpl-3.0
ksrajkumar/openerp-6.1
openerp/addons/stock/report/report_stock.py
9
7021
# -*- 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
huvermann/CiscoPhoneDirectory
Cisco79xxPhoneDirectory/PhonebookProvider/PhoneBookProviderBase.py
1
5669
# -*- coding: utf-8 -*- from flask import request from configuration import config, ConfFields from Cisco79xxPhoneDirectory import app from flask.views import View class PhoneBookProviderBase(View): """Phonebook provider base class.""" Routing = {} NameFieldKey = "name" NumberFieldKey = "number" Pa...
mit