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
grantsewell/nzbToMedia
libs/unidecode/x02a.py
148
3589
data = ( '', # 0x00 '', # 0x01 '', # 0x02 '', # 0x03 '', # 0x04 '', # 0x05 '', # 0x06 '', # 0x07 '', # 0x08 '', # 0x09 '', # 0x0a '', # 0x0b '', # 0x0c '', # 0x0d '', # 0x0e '', # 0x0f '', # 0x10 '', # 0x11 '', # 0x12 '', # 0x13 '', # 0x14 '', # 0x15 '',...
gpl-3.0
fccoelho/jogos_vorazes
estrategias/LeoRodrigues.py
1
2061
# -*- coding: utf8 -*- from .jogadores import Jogador class MeuJogador(Jogador): def percent(self,data,percentil): data = sorted(data) n = len(data) if n == 0: pass #print ("Lista vazia") else: return int(round(percentil*n+1)) ...
mit
nzmm/granite
reversion/helpers.py
8
3079
"""A number of useful helper functions to automate common tasks.""" from __future__ import unicode_literals from django.contrib import admin from django.contrib.admin.sites import NotRegistered from django.utils.encoding import force_text from reversion.admin import VersionAdmin def patch_admin(model, admin_site=N...
gpl-3.0
bussiere/pypyjs
website/demo/home/rfk/repos/pypy/lib-python/2.7/email/mime/message.py
573
1286
# Copyright (C) 2001-2006 Python Software Foundation # Author: Barry Warsaw # Contact: email-sig@python.org """Class representing message/* MIME documents.""" __all__ = ['MIMEMessage'] from email import message from email.mime.nonmultipart import MIMENonMultipart class MIMEMessage(MIMENonMultipart): """Class...
mit
dwadler/QGIS
python/plugins/processing/algs/qgis/PointDistance.py
1
13351
# -*- coding: utf-8 -*- """ *************************************************************************** PointDistance.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *************************...
gpl-2.0
mollstam/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Lib/unittest/test/test_runner.py
37
8609
import unittest from cStringIO import StringIO import pickle from unittest.test.support import (LoggingResult, ResultWithNoStartTestRunStopTestRun) class TestCleanUp(unittest.TestCase): def testCleanUp(self): class TestableTest(unittest.TestCase): def test...
mit
pfnet/chainer
docs/source/conf.py
4
14917
# -*- coding: utf-8 -*- # # Chainer documentation build configuration file, created by # sphinx-quickstart on Sun May 10 12:22:10 2015. # # 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...
mit
wujuguang/pystatsd
statsd/client/timer.py
2
2063
from __future__ import absolute_import, division, unicode_literals import functools # Use timer that's not susceptible to time of day adjustments. try: # perf_counter is only present on Py3.3+ from time import perf_counter as time_now except ImportError: # fall back to using time from time import time...
mit
StefanoSalsano/my-floodlight
apps/circuitpusher/circuitpusher.py
21
9773
#! /usr/bin/python """ circuitpusher utilizes floodlight rest APIs to create a bidirectional circuit, i.e., permanent flow entry, on all switches in route between two devices based on IP addresses with specified priority. Notes: 1. The circuit pusher currently only creates circuit with two IP end points 2. Prior...
apache-2.0
lexyan/SickBeard
sickbeard/image_cache.py
27
9346
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 t...
gpl-3.0
mingderwang/angr
tests/test_function_manager.py
9
3967
import nose import angr from archinfo import ArchAMD64 import logging l = logging.getLogger("angr.tests") import os test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../binaries/tests')) def test_amd64(): logging.getLogger('angr.analyses.cfg').setLevel(logging.DEBUG) fauxware...
bsd-2-clause
cristianquaglio/odoo
addons/analytic/analytic.py
27
18705
# -*- 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...
apache-2.0
JohanComparat/pySU
spm/bin_spiders/spiders_last_burst_vs_radius.py
1
5578
import astropy.cosmology as co aa=co.Planck15 import astropy.io.fits as fits import astropy.units as u from astropy.coordinates import angles #import AngularSeparation from astropy import coordinates as coord import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as p import numpy as n import os import sys ...
cc0-1.0
yangzhe1991/p2pool
SOAPpy/Parser.py
131
36152
# SOAPpy modules from Config import Config from Types import * from NS import NS from Utilities import * import string import fpconst import xml.sax from wstools.XMLname import fromXMLname try: from M2Crypto import SSL except: pass ident = '$Id: Parser.py 1497 2010-03-08 06:06:52Z pooryorick $' from ve...
gpl-3.0
OpenDataPolicingNC/Traffic-Stops
traffic_stops/base_views.py
1
3014
from django.core.exceptions import ImproperlyConfigured from django.shortcuts import redirect, Http404 from django.views.generic import DetailView, ListView, TemplateView from django.views.generic.edit import ProcessFormView, FormMixin from traffic_stops.utils import get_chunks from collections import defaultdict cla...
mit
mozilla/verbatim
vendor/lib/python/django/contrib/localflavor/mk/forms.py
89
3582
from __future__ import absolute_import import datetime from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import RegexField, Select from django.utils.translation import ugettext_lazy as _ from django.contrib.localflavor.mk.mk_choices import MK_MUNICIPALI...
gpl-2.0
brianjmiller/TinCanPython
test/remote_lrs_test.py
2
20808
# Copyright 2014 Rustici Software # # 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...
apache-2.0
lawnn/kernel10c
tools/perf/util/setup.py
4998
1330
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
gpl-2.0
alfredodeza/execnet
execnet/gateway_bootstrap.py
1
3067
# -*- coding: utf-8 -*- """ code to initialize the remote side of a gateway once the io is created """ import inspect import os import execnet from execnet import gateway_base from execnet.gateway import Gateway importdir = os.path.dirname(os.path.dirname(execnet.__file__)) class HostNotFound(Exception): pass ...
mit
CaptainDesAstres/Blender-Render-Manager
TaskList/TaskLog/FrameLog.py
1
1368
#!/usr/bin/python3.4 # -*-coding:Utf-8 -* '''module to manage task Frame log''' import xml.etree.ElementTree as xmlMod import datetime from usefullFunctions import * class FrameLog: '''class to manage task frame log''' def __init__(self, xml = None, frame = None, date = None, computingTime = Non...
mit
ivanlmj/Android-DNSSL
Flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/constants.py
3008
1335
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
gpl-2.0
ctberthiaume/keggannot
keggannot/annot.py
1
16296
import os, sys from decimal import Decimal import gzip from collections import OrderedDict import logging def blast_result_iterator(blast_file): _ = blast_file.readline() # burn header for line in blast_file: if not line.startswith("#"): yield BlastHit(line) class BlastHit(object): ""...
apache-2.0
johnctitus/troposphere
examples/ApplicationAutoScalingSample.py
5
1062
from troposphere import Template, Ref from troposphere.applicationautoscaling import ( ScalableTarget, StepAdjustment, StepScalingPolicyConfiguration, ScalingPolicy, ) t = Template() scalable_target = ScalableTarget( 'scalableTarget', MaxCapacity=2, MinCapacity=1, ResourceId='service/...
bsd-2-clause
AccelAI/accel.ai
flask-aws/lib/python2.7/site-packages/boto/cloudsearch2/layer2.py
6
3687
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. # All Rights Reserved # # 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...
mit
PaddlePaddle/Paddle
python/paddle/fluid/tests/unittests/test_bmm_op.py
2
3497
# Copyright (c) 2020 PaddlePaddle 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 app...
apache-2.0
daveferrara1/linkchecker
third_party/dnspython/dns/rdtypes/nsbase.py
100
2994
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "...
gpl-2.0
hzwjava/mongo-connector
mongo_connector/doc_managers/solr_doc_manager.py
7
13761
# Copyright 2013-2014 MongoDB, 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 writin...
apache-2.0
ryanpbrewster/SciVis-2015
examples/sdf_example.py
1
2689
""" The Example is from http://darksky.slac.stanford.edu/scivis2015/examples.html """ from sdfpy import load_sdf from thingking import loadtxt prefix = "../data/" # Load N-body particles from a = 1.0 dataset. Particles have positions with # units of proper kpc, and velocities with units of km/s. particles = load_sdf...
mit
le9i0nx/ansible
lib/ansible/modules/database/postgresql/postgresql_privs.py
7
25106
#!/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.1', ...
gpl-3.0
raygit/cuda-convnet2
convnet.py
174
14400
# Copyright 2014 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
rhcarvalho/kombu
kombu/tests/async/http/test_curl.py
1
5102
# -*- coding: utf-8 -*- from __future__ import absolute_import from kombu.async.http.curl import READ, WRITE, CurlClient from kombu.tests.case import ( HubCase, Mock, call, patch, case_requires, set_module_symbol, ) @case_requires('pycurl') class test_CurlClient(HubCase): class Client(CurlClient): ...
bsd-3-clause
iut-ibk/DynaMind-UrbanSim
3rdparty/opus/src/urbansim/zone/home_access_to_employment_DDD.py
2
6081
# Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE from abstract_zone_access_variable import Abstract_Zone_Access_Variable class home_access_to_employment_DDD(Abstract_Zone_Access_Variable): """The accessibility for the households in the g...
gpl-2.0
xxsergzzxx/python-for-android
python3-alpha/python3-src/Lib/test/test_urllib2_localnet.py
51
21528
#!/usr/bin/env python3 import os import email import urllib.parse import urllib.request import http.server import unittest import hashlib from test import support threading = support.import_module('threading') here = os.path.dirname(__file__) # Self-signed cert file for 'localhost' CERT_localhost = os.path.join(here...
apache-2.0
Azure/azure-sdk-for-python
sdk/graphrbac/azure-graphrbac/azure/graphrbac/models/application_create_parameters.py
1
8780
# 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
YOTOV-LIMITED/kitsune
kitsune/messages/tests/test_templates.py
14
3421
from nose.tools import eq_ from pyquery import PyQuery as pq from kitsune.messages.models import OutboxMessage from kitsune.sumo.helpers import urlparams from kitsune.sumo.tests import TestCase from kitsune.sumo.urlresolvers import reverse from kitsune.users.tests import user class SendMessageTestCase(TestCase): ...
bsd-3-clause
flotre/Sick-Beard
lib/requests/packages/oauthlib/oauth1/rfc5849/utils.py
74
3015
# -*- coding: utf-8 -*- """ oauthlib.utils ~~~~~~~~~~~~~~ This module contains utility methods used by various parts of the OAuth spec. """ import string import urllib2 from oauthlib.common import quote, unquote UNICODE_ASCII_CHARACTER_SET = (string.ascii_letters.decode('ascii') + string.digits.decode('ascii')...
gpl-3.0
paulcalabro/zato
code/run-tests.py
5
6003
#!./bin/py # -*- coding: utf-8 -*- """ Copyright (C) 2015 Dariusz Suchojad <dsuch at zato.io> Licensed under LGPLv3, see LICENSE.txt for terms and conditions. """ from __future__ import absolute_import, division, print_function, unicode_literals # stdlib from logging import getLogger from json import loads from uui...
gpl-3.0
diamondman/pys3streamer
s3streamer/streamer.py
1
4416
from __future__ import unicode_literals from __future__ import print_function from boto.s3.connection import S3Connection class S3Streamer(object): #def __init__(self, bucket_name, *key_names, s3_connection=None, key_is_prefix=False): def __init__(self, bucket_name, *key_names, **kwargs): """Create a...
mit
jnewland/home-assistant
homeassistant/components/lg_netcast/media_player.py
7
6977
"""Support for LG TV running on NetCast 3 or 4.""" from datetime import timedelta import logging from requests import RequestException import voluptuous as vol from homeassistant import util from homeassistant.components.media_player import ( MediaPlayerDevice, PLATFORM_SCHEMA) from homeassistant.components.media...
apache-2.0
YUNZHONGTAN/MY_Python_script
soft_ware/pymongo-3.2/test/version.py
16
2074
# Copyright 2009-2015 MongoDB, 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 writin...
gpl-3.0
DragonMastur/FakeRealNewsDetection
Serverless Functions/requests/packages/chardet/sbcharsetprober.py
2927
4793
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
agpl-3.0
Duroktar/cookbook
AIML Files/ALICE/ALICE_bot.py
1
1830
# - LINKS - ALICE Bot # # By: traBpUkciP (2016) import aiml # AI-Markup Language library import datetime import time import urllib # library for dealing with web stuff through Python import sys, os path = os.path.dirname(os.path.abspath(sys.argv[0])) BRAIN_FILE = path + "/bot_brain_ALICE.brn" k = aiml.Kerne...
gpl-3.0
birdonwheels5/p2pool-myrSkein
nattraverso/pynupnp/__init__.py
288
1088
""" This package offers ways to retreive ip addresses of the machine, and map ports through UPnP devices. @author: Raphael Slinckx @copyright: Copyright 2005 @license: LGPL @contact: U{raphael@slinckx.net<mailto:raphael@slinckx.net>} @version: 0.1.0 """ __revision__ = "$id" from nattraverso.pynupnp.upnp import search...
gpl-3.0
ULHPC/modules
easybuild/easybuild-framework/easybuild/tools/build_details.py
9
2178
# Copyright 2014-2015 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # the Hercules foundation (http:/...
mit
gpfreitas/bokeh
examples/glyphs/iris.py
44
1664
from __future__ import print_function from bokeh.browserlib import view from bokeh.document import Document from bokeh.embed import file_html from bokeh.models.glyphs import Circle from bokeh.models import ( Plot, DataRange1d, LinearAxis, Grid, ColumnDataSource, PanTool, WheelZoomTool ) from bokeh.resources import...
bsd-3-clause
xelfer/py-flask-signup
tests/application-tests.py
112
1640
# Copyright 2013. Amazon Web Services, 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 a...
apache-2.0
prantlf/node-gyp
gyp/pylib/gyp/MSVSSettings.py
87
43627
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Code to validate and convert settings of the Microsoft build tools. This file contains code to validate and convert settings of the Microsoft build tools. The...
mit
Mozta/pagina-diagnostijuego
venv/lib/python2.7/site-packages/django/db/migrations/graph.py
108
16656
from __future__ import unicode_literals import sys import warnings from collections import deque from functools import total_ordering from django.db.migrations.state import ProjectState from django.utils import six from django.utils.datastructures import OrderedSet from django.utils.encoding import python_2_unicode_c...
gpl-3.0
sonaht/ansible
test/runner/lib/thread.py
70
1572
"""Python threading tools.""" from __future__ import absolute_import, print_function import threading import sys try: # noinspection PyPep8Naming import Queue as queue except ImportError: # noinspection PyUnresolvedReferences import queue # pylint: disable=locally-disabled, import-error class Wrap...
gpl-3.0
Tchanders/socorro
alembic/versions/3f007539efc_fixes_bug_1024666_add_raw_adi_table.py
14
1535
"""Fixes bug 1024666 - add raw_adi table Revision ID: 3f007539efc Revises: 32b54dec3fc0 Create Date: 2014-06-13 09:38:29.347397 """ # revision identifiers, used by Alembic. revision = '3f007539efc' down_revision = '32b54dec3fc0' from alembic import op from socorro.lib import citexttype, jsontype, buildtype from soc...
mpl-2.0
igemsoftware/SYSU-Software2013
project/Python27_32/Lib/site-packages/pip/_pkgutil.py
93
20099
"""Utilities to support packages.""" # NOTE: This module must remain compatible with Python 2.3, as it is shared # by setuptools for distribution with Python 2.3 and up. import os import sys import imp import os.path from types import ModuleType __all__ = [ 'get_importer', 'iter_importers', 'get_loader', 'find_l...
mit
tmerrick1/spack
var/spack/repos/builtin/packages/tcl-tcllib/package.py
5
2246
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
endlessm/chromium-browser
third_party/catapult/third_party/google-endpoints/libpasteurize/main.py
59
5705
""" pasteurize: automatic conversion of Python 3 code to clean 2/3 code =================================================================== ``pasteurize`` attempts to convert existing Python 3 code into source-compatible Python 2 and 3 code. Use it like this on Python 3 code: $ pasteurize --verbose mypython3script...
bsd-3-clause
opadron/girder
girder/api/v1/resource.py
1
21286
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright 2013 Kitware 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 cop...
apache-2.0
kYc0o/RIOT
tests/emcute/tests/01-run.py
6
19545
#!/usr/bin/env python3 # Copyright (C) 2018 Freie Universität Berlin # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. import os import pprint import random import re import socket import sys import...
lgpl-2.1
PF2-pasteur-fr/seqan
apps/razers/tests/run_tests.py
13
13276
#!/usr/bin/env python """Execute the tests for the pair_align program. The golden test outputs are generated by the script generate_outputs.sh. You have to give the root paths to the source and the binaries as arguments to the program. These are the paths to the directory that contains the 'projects' directory. Usa...
bsd-3-clause
ATIX-AG/ansible
lib/ansible/modules/windows/win_firewall_rule.py
22
2784
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2014, Timothy Vandenbrande <timothy.vandenbrande@gmail.com> # Copyright: (c) 2017, Artem Zinenko <zinenkoartem@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1...
gpl-3.0
ubic135/odoo-design
addons/mail/tests/common.py
18
5722
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
arafsheikh/coala
coalib/tests/processes/ProcessingTest.py
2
22681
import multiprocessing import os import platform import queue import re import subprocess import sys import unittest from pyprint.ConsolePrinter import ConsolePrinter from coalib.output.printers.LogPrinter import LogPrinter from coalib.processes.CONTROL_ELEMENT import CONTROL_ELEMENT from coalib.processes.Processing ...
agpl-3.0
twiindan/selenium_lessons
01_Introducción/02_tools_and_environment.py
1
2414
#=============================================================================== # - CPython is the real name of default standard Python implementation # - Implemented in C # - There are Python implementations in other languages: # - Jython: Python 2.5 interpreter written in Java which runs bytecode in the JVM # ...
apache-2.0
wangyang59/tf_models
video_prediction/prediction_train_flo_learn_ip_sintel_test.py
1
30243
# # 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 # Copyright 2016 The TensorFlow Authors All Rights Reserved. # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
apache-2.0
jjmleiro/hue
desktop/core/ext-py/Django-1.6.10/django/contrib/gis/sitemaps/views.py
114
4439
from __future__ import unicode_literals from django.http import HttpResponse, Http404 from django.template import loader from django.contrib.sites.models import get_current_site from django.core import urlresolvers from django.core.paginator import EmptyPage, PageNotAnInteger from django.contrib.gis.db.models.fields i...
apache-2.0
vdmann/cse-360-image-hosting-website
lib/python2.7/site-packages/pip/pep425tags.py
469
2969
"""Generate and work with PEP 425 Compatibility Tags.""" import sys import warnings try: import sysconfig except ImportError: # pragma nocover # Python < 2.7 import distutils.sysconfig as sysconfig import distutils.util def get_abbr_impl(): """Return abbreviated implementation name.""" if hasat...
mit
lgrootnoob/android_kernel_lge_l1v
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
11088
3246
# Core.py - Python extension for perf script, core functions # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. from collections import defaultdict def aut...
gpl-2.0
rosmo/boto
boto/s3/tagging.py
236
1732
from boto import handler import xml.sax class Tag(object): def __init__(self, key=None, value=None): self.key = key self.value = value def startElement(self, name, attrs, connection): return None def endElement(self, name, value, connection): if name == 'Key': ...
mit
NCI-Cloud/horizon
openstack_dashboard/dashboards/admin/routers/ports/tables.py
69
1251
# Copyright 2012 NEC 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 applicable law or ag...
apache-2.0
pedro2d10/SickRage-FR
lib/mako/ext/turbogears.py
39
2132
# ext/turbogears.py # Copyright (C) 2006-2015 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from mako import compat from mako.lookup import TemplateLookup from mako.template import Templat...
gpl-3.0
cfossace/crits
crits/core/templatetags/filters.py
14
5069
import cgi import re import string from crits.indicators.handlers import does_indicator_relationship_exist from crits.vocabulary.indicators import IndicatorTypes from django import template from django.template.defaultfilters import stringfilter from django.utils.safestring import mark_safe register = template.Librar...
mit
m8ttyB/socorro
socorro/unittest/processor/test_processor_2015.py
3
6909
import ujson from socorro.unittest.testbase import TestCase from nose.tools import eq_, ok_ from mock import Mock, patch from configman import ConfigurationManager from configman.dotdict import DotDict from socorro.processor.processor_2015 import ( Processor2015, rule_sets_from_string ) from socorro.lib.tran...
mpl-2.0
indictranstech/focal-erpnext
erpnext/stock/get_item_details.py
4
12465
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _, throw from frappe.utils import flt, cint, add_days import json from erpnext.accounts.doctype.pricing_rule.pricing...
agpl-3.0
andrewsomething/digitalocean-indicator
digitalocean_indicator/__init__.py
1
1487
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- ### BEGIN LICENSE # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published # by the Free Software Foundation. # # This program is distributed in the hop...
gpl-3.0
ritzk/ansible-modules-extras
system/modprobe.py
30
3549
#!/usr/bin/python #coding: utf-8 -*- # (c) 2013, David Stygstra <david.stygstra@gmail.com> # # This file is part of Ansible # # This module 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 ...
gpl-3.0
Osmose/kitsune
kitsune/sumo/email_utils.py
12
5420
import logging from functools import wraps from django.conf import settings from django.contrib.sites.models import Site from django.core import mail from django.core.mail import EmailMultiAlternatives from django.utils import translation import jingo from premailer import transform from django.test.client import Req...
bsd-3-clause
ryfeus/lambda-packs
Spacy/source2.7/spacy/tests/lang/de/test_models.py
3
2468
# coding: utf-8 from __future__ import unicode_literals import numpy import pytest @pytest.fixture def example(DE): """ This is to make sure the model works as expected. The tests make sure that values are properly set. Tests are not meant to evaluate the content of the output, only make sure the out...
mit
skalkoto/snf-image-creator
image_creator/distro/windows/winexe.py
2
3776
# -*- coding: utf-8 -*- # # Copyright (C) 2011-2018 GRNET S.A. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Thi...
gpl-3.0
okfish/django-oscar
src/oscar/test/factories/__init__.py
4
8543
# coding=utf-8 from decimal import Decimal as D import random import datetime from django.conf import settings from django.utils import timezone from oscar.apps.offer import models from oscar.core.loading import get_class, get_model from oscar.test.factories.address import * # noqa from oscar.test.factories.basket i...
bsd-3-clause
valexandersaulys/prudential_insurance_kaggle
venv/lib/python2.7/site-packages/pandas/__init__.py
9
2140
# pylint: disable-msg=W0614,W0401,W0611,W0622 __docformat__ = 'restructuredtext' try: from pandas import hashtable, tslib, lib except ImportError as e: # pragma: no cover module = str(e).lstrip('cannot import name ') # hack but overkill to use re raise ImportError("C extension: {0} not built. If you wa...
gpl-2.0
adampax/AlloyActionJackson
plugins/ti.alloy/plugin.py
1729
5251
import os, sys, subprocess, hashlib import subprocess def check_output(*popenargs, **kwargs): r"""Run command with arguments and return its output as a byte string. Backported from Python 2.7 as it's implemented as pure python on stdlib. >>> check_output(['/usr/bin/python', '--version']) Python 2.6....
apache-2.0
vandorjw/django-template-project
project/project_name/views.py
1
1288
from django.views.generic import TemplateView from django.views.generic.edit import FormView from blog.models import Article from django.core.mail import send_mail from {{project_name}}.forms import ContactForm class HomePageView(TemplateView): template_name="index.html" def get_context_data(self, **kwargs): ...
mit
ptemplier/ansible
lib/ansible/modules/cloud/ovirt/ovirt_vmpools_facts.py
73
3398
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat, Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or #...
gpl-3.0
asacamano/keyczar
cpp/src/tools/scons/scons-local-1.2.0.d20090223/SCons/exitfuncs.py
19
2398
"""SCons.exitfuncs Register functions which are executed when SCons exits for any reason. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation fi...
apache-2.0
PaulKinlan/cli-caniuse
site/app/scripts/bower_components/jsrepl-build/extern/python/unclosured/lib/python2.7/encodings/cp1026.py
593
13369
""" Python Character Mapping Codec cp1026 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP1026.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,inp...
apache-2.0
sigmavirus24/glance
glance/tests/unit/v1/test_registry_client.py
12
36574
# Copyright 2010-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...
apache-2.0
a25kk/aha
src/aha.sitecontent/aha/sitecontent/browser/pagesection.py
1
7060
# -*- coding: utf-8 -*- """Module providing views for a contentpage section""" from AccessControl import Unauthorized from Acquisition import aq_inner from Acquisition import aq_parent from plone import api from plone.api.exc import InvalidParameterError from plone.protect.utils import addTokenToUrl from Products.CMFPl...
mit
dylanninin/schema
test_schema.py
1
18858
from __future__ import with_statement from collections import defaultdict, namedtuple from operator import methodcaller import os from pytest import raises from schema import Schema, Use, And, Or, Optional, SchemaError, JSONSchema try: basestring except NameError: basestring = str # Python 3 does not have ...
mit
arashn/senior-project
server/create_mission.py
1
2187
# This is a script to create a mission from a start # location to an end location and upload the mission # to the vehicle. The script uses the Google Maps # Directions API to obtain directions from the start # location to the end location, and uses the points # received as waypoints in the mission. import googlemaps fr...
gpl-3.0
Thib17/biggraphite
tests/cli/test_command_write.py
3
1198
#!/usr/bin/env python # Copyright 2018 Criteo # # 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 agree...
apache-2.0
j08lue/poppy
poppy/ts_flux_budget.py
1
6682
import numpy as np import warnings from oceanpy.fluxbudget import budget_over_region_2D from oceanpy.stats import central_differences def _fill0(a): return np.ma.filled(a,0.) def _warn_virtual_salt_flux_units(): warnings.warn('Output units are kg SALT s-1!',) warnings.filterwarnings("once") def fluxbudge...
gpl-2.0
fkolacek/FIT-VUT
bp-revok/python/lib/python2.7/cProfile.py
72
6259
#! /usr/bin/env python """Python interface for the 'lsprof' profiler. Compatible with the 'profile' module. """ __all__ = ["run", "runctx", "help", "Profile"] import _lsprof # ____________________________________________________________ # Simple interface def run(statement, filename=None, sort=-1): """Run s...
apache-2.0
johnloucaides/chipsec
chipsec/hal/uefi_search.py
6
7310
#!/usr/bin/python #CHIPSEC: Platform Security Assessment Framework #Copyright (c) 2010-2016, Intel Corporation # #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; Version 2. # #This program is distr...
gpl-2.0
tkem/mopidy-podcast-itunes
mopidy_podcast_itunes/__init__.py
1
4677
import pathlib import pkg_resources from mopidy import config, ext, httpclient __version__ = pkg_resources.get_distribution("Mopidy-Podcast").version CHARTS = ["podcasts", "audioPodcasts", "videoPodcasts"] COUNTRIES = [ "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "...
apache-2.0
FlightGear/flightgear
utils/Modeller/yasim_import.py
1
30696
#!BPY # """ # Name: 'YASim (.xml)' # Blender: 245 # Group: 'Import' # Tooltip: 'Loads and visualizes a YASim FDM geometry' # """ __author__ = "Melchior FRANZ < mfranz # aon : at >" __url__ = ["http://www.flightgear.org/", "http://cvs.flightgear.org/viewvc/source/utils/Modeller/yasim_import.py"] __version__ = "0.2" __...
gpl-2.0
sahat/bokeh
examples/plotting/server/remote_image.py
1
1468
import numpy as np from bokeh.plotting import * from bokeh.objects import Range1d, ServerDataSource """ In order to run this example, you have to execute ./bokeh-server -D remotedata the remote data directory in the bokeh checkout has the sample data for this example In addition, you must install ArrayManagement from...
bsd-3-clause
ilya-klyuchnikov/buck
third-party/py/pex/pex/crawler.py
38
4521
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). """Support for webpage parsing and crawling.""" import os import re import threading import traceback from .compatibility import PY3 from .http import Context from .link import Link from...
apache-2.0
zowpowow/W7_tmo_us-xkernel
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
1935
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
gpl-2.0
voidfiles/adn-beers
api/libs/unittest2/__init__.py
155
2406
""" unittest2 unittest2 is a backport of the new features added to the unittest testing framework in Python 2.7. It is tested to run on Python 2.4 - 2.6. To use unittest2 instead of unittest simply replace ``import unittest`` with ``import unittest2``. Copyright (c) 1999-2003 Steve Purcell Copyright (c) 2003-2010 P...
mit
kg-bot/SupyBot
plugins/Variables/test.py
1
3088
### # Copyright (c) 2011, Valentin Lorentz # 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 conditi...
gpl-3.0
TRox1972/youtube-dl
youtube_dl/extractor/dfb.py
87
2255
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import unified_strdate class DFBIE(InfoExtractor): IE_NAME = 'tv.dfb.de' _VALID_URL = r'https?://tv\.dfb\.de/video/(?P<display_id>[^/]+)/(?P<id>\d+)' _TEST = { 'url': 'http://tv.dfb.de/video/u-19-em...
unlicense
psiwczak/quantum
quantum/plugins/cisco/tests/unit/test_ucs_plugin.py
6
24863
#vim: tabstop=4 shiftwidth=4 softtabstop=4 #copyright 2011 Cisco Systems, 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/...
apache-2.0
Smart-Torvy/torvy-home-assistant
homeassistant/components/device_tracker/fritz.py
3
3567
""" Support for FRITZ!Box routers. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/device_tracker.fritz/ """ import logging from datetime import timedelta import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.c...
mit