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
jlowdermilk/test-infra
gubernator/secrets.py
22
1724
#!/usr/bin/env python # Copyright 2018 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
apache-2.0
codepython/sockjs-tornado
examples/chat/chat.py
7
1466
# -*- coding: utf-8 -*- """ Simple sockjs-tornado chat application. By default will listen on port 8080. """ import tornado.ioloop import tornado.web import sockjs.tornado class IndexHandler(tornado.web.RequestHandler): """Regular HTTP handler to serve the chatroom page""" def get(self): self.ren...
mit
visi0nary/P8000-Kernel
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py
4653
3596
# EventClass.py # # This is a library defining some events types classes, which could # be used by other scripts to analyzing the perf samples. # # Currently there are just a few classes defined for examples, # PerfEvent is the base class for all perf event sample, PebsEvent # is a HW base Intel x86 PEBS event, and use...
gpl-2.0
quantopian/toolz
toolz/sandbox/tests/test_core.py
9
3878
from toolz import curry, unique, first, take from toolz.sandbox.core import EqualityHashKey, unzip from itertools import count, repeat from toolz.compatibility import map, zip def test_EqualityHashKey_default_key(): EqualityHashDefault = curry(EqualityHashKey, None) L1 = [1] L2 = [2] data1 = [L1, L1, ...
bsd-3-clause
alex/pip
pip/_vendor/html5lib/inputstream.py
435
31665
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type from pip._vendor.six.moves import http_client import codecs import re from .constants import EOF, spaceCharacters, asciiLetters, asciiUppercase from .constants import encodings, ReparseException from . import util...
mit
sim0629/irc
setup.py
1
1516
import sys import setuptools def read_long_description(): with open('README.rst') as f: data = f.read() with open('CHANGES.rst') as f: data += '\n\n' + f.read() return data importlib_req = ['importlib'] if sys.version_info < (2,7) else [] argparse_req = ['argparse'] if sys.ver...
lgpl-2.1
CoDEmanX/ArangoDB
3rdParty/V8-4.3.61/third_party/python_26/Lib/encodings/cp775.py
593
34732
""" Python Character Mapping Codec cp775 generated from 'VENDORS/MICSFT/PC/CP775.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_map) def decode(self,input,errors='strict...
apache-2.0
tinker20/tinker-society
venv/lib/python2.7/site-packages/pip/wheel.py
184
20618
""" Support for installing and building the "wheel" binary package format. """ from __future__ import with_statement import compileall import csv import functools import hashlib import os import re import shutil import sys from base64 import urlsafe_b64encode from email.parser import Parser from pip.backwardcompat i...
cc0-1.0
Impactstory/total-impact-webapp
totalimpact/providers/altmetric_com.py
2
8342
from totalimpact.providers import provider from totalimpact.providers.provider import Provider, ProviderContentMalformedError import json, re, os, requests, socket from operator import itemgetter import logging logger = logging.getLogger('ti.providers.altmetric_com') class Altmetric_Com(Provider): example_id ...
mit
landgraf/zeromq-Ada
fixHeader.py
1
4068
#!/usr/bin/env python import GPS from os.path import * HEADER="""############################################################################## ## ## ## 0MQ Ada-binding ## ## ...
gpl-2.0
sbsdev/daisyproducer
daisyproducer/documents/models.py
1
14120
import uuid, datetime from os.path import join from shutil import rmtree from daisyproducer.documents.storage import OverwriteStorage from django.conf import settings from django.contrib.auth.models import User, Group from django.db import models from django.db.models import Max from django.forms import ModelForm from...
agpl-3.0
coberger/DIRAC
ResourceStatusSystem/Policy/test/Test_RSS_Policy_AlwaysActivePolicy.py
8
1380
# $HeadURL: $ ''' Test_RSS_Policy_AlwaysActivePolicy ''' import unittest import DIRAC.ResourceStatusSystem.Policy.AlwaysActivePolicy as moduleTested __RCSID__ = '$Id: $' ################################################################################ class AlwaysActivePolicy_TestCase( unittest.TestCase ): de...
gpl-3.0
EttusResearch/gnuradio
gr-blocks/python/blocks/qa_type_conversions.py
33
11818
#!/usr/bin/env python # # Copyright 2012,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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 optio...
gpl-3.0
openmotics/gateway
testing/unittests/gateway_tests/output_controller_test.py
1
15041
# Copyright (C) 2020 OpenMotics BV # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distribu...
agpl-3.0
ahmadassaf/zulip
zerver/lib/db.py
3
2323
from __future__ import absolute_import import time from psycopg2.extensions import cursor, connection from typing import Callable, Optional, Iterable, Any, Dict, Union, TypeVar, \ Mapping, Sequence from six import text_type from zerver.lib.str_utils import NonBinaryStr CursorObj = TypeVar('CursorObj', bound=curs...
apache-2.0
mavenlin/tensorflow
tensorflow/contrib/ffmpeg/ffmpeg_ops.py
22
3729
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
liuwenf/moose
python/chigger/annotations/TimeAnnotationSource.py
6
2466
#pylint: disable=missing-docstring ################################################################# # DO NOT MODIFY THIS HEADER # # MOOSE - Multiphysics Object Oriented Simulation Environment # # # # (c) 2010...
lgpl-2.1
florianholzapfel/home-assistant
homeassistant/components/media_player/mpchc.py
10
4969
""" Support to interface with the MPC-HC Web API. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/media_player.mpchc/ """ import logging import re import requests import voluptuous as vol from homeassistant.components.media_player import ( SUPPORT_V...
mit
flavour/ssf
modules/eden/project.py
1
132310
# -*- coding: utf-8 -*- """ Sahana Eden Project Model @copyright: 2011-2012 (c) Sahana Software Foundation @license: MIT 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 witho...
mit
rafaduran/python-mcollective
tests/integration/test_with_activemq.py
2
1425
import os from pymco.test import ctxt from . import base class ActiveMQTestCase(base.IntegrationTestCase): '''RabbitMQ integration test case.''' CTXT = { 'plugin.activemq.pool.1.port': 61614, 'plugin.activemq.pool.1.password': 'marionette', } class TestWithActiveMQMCo20x(base.MCollecti...
bsd-3-clause
yoer/hue
desktop/core/ext-py/Django-1.6.10/django/views/debug.py
98
44106
from __future__ import unicode_literals import datetime import os import re import sys import types from django.conf import settings from django.http import (HttpResponse, HttpResponseServerError, HttpResponseNotFound, HttpRequest, build_request_repr) from django.template import Template, Context, TemplateDoesNot...
apache-2.0
r-barnes/waterviz
server/gauges.py
2
4840
#!/usr/bin/env python3 import os from flask import Flask, jsonify, send_from_directory, abort, Response, request, g import psycopg2 import psycopg2.extras import json import pickle import numpy as np import re app = Flask(__name__) aggregated_stats_file = 'county_agg_stats.p' aggdata = pickle.load(open(...
bsd-3-clause
koying/xbmc-vidonme
lib/gtest/test/gtest_output_test.py
184
12027
#!/usr/bin/env python # # Copyright 2008, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
gpl-2.0
iuliat/nova
nova/tests/functional/v3/test_scheduler_hints.py
18
1955
# 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
andrewjpage/gff3toembl
gff3toembl/EMBLWriter.py
2
4237
import sys import subprocess from gt import GFF3InStream import os import re from gff3toembl.EMBLConverter import EMBLConverter from gff3toembl.VisitorStream import VisitorStream class EMBLWriter(object): def __init__(self, gff3_file, organism, taxonid, project, description, authors, title, publication, genome_...
gpl-3.0
yongtang/tensorflow
tensorflow/python/ops/image_ops.py
14
11536
# 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
incaser/server-tools
database_cleanup/model/purge_models.py
31
6248
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2014 Therp BV (<http://therp.nl>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
Remillard/VHDL-Mode
vhdl_lang.py
1
62003
# pylint: disable=C0103, C0111 """ -------------------------------------------------------------------------------- VHDL Language Module. Defines class structures and methods for identifying and manipulating text structures, and extracting and replicating lexical elements. ---------------------------------...
mit
cfehring/slack-onnow
requests/packages/chardet/charsetgroupprober.py
2929
3791
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights ...
gpl-3.0
gr3yman/TileControl
TileCtrl.py
1
2772
#!/usr/env/python3 import subprocess import tinydb from tinydb.storages import MemoryStorage import tkinter as tk ## who knows if this is working or not? def keypress(event): if event.keysym == 'Escape': root.destroy() x = event.char if x == "Ctrl-Z": print('c z') elif x == "Ctrl-X": ...
gpl-2.0
tymofij/werkzeug
werkzeug/http.py
110
35031
# -*- coding: utf-8 -*- """ werkzeug.http ~~~~~~~~~~~~~ Werkzeug comes with a bunch of utilities that help Werkzeug to deal with HTTP data. Most of the classes and functions provided by this module are used by the wrappers, but they are useful on their own, too, especially if the response and ...
bsd-3-clause
kdheepak89/RTDT
RTDT/transit.py
1
13035
from __future__ import print_function from google.transit import gtfs_realtime_pb2 import requests import pandas as pd from io import BytesIO import zipfile import os import os.path import datetime import math UTC_OFFSET = int(os.getenv('OFFSET', 7)) DEFAULT_LOCATION = {u'lat': 39.7433814, u'lng': -104.98910989999999}...
bsd-3-clause
40223108/w18
static/Brython3.1.3-20150514-095342/Lib/warnings.py
752
13825
"""Python part of the warnings subsystem.""" # Note: function level imports should *not* be used # in this module as it may cause import lock deadlock. # See bug 683658. import linecache import sys __all__ = ["warn", "showwarning", "formatwarning", "filterwarnings", "resetwarnings", "catch_warnings"] def...
gpl-3.0
longman694/youtube-dl
youtube_dl/extractor/noz.py
64
3665
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import ( compat_urllib_parse_unquote, compat_xpath, ) from ..utils import ( int_or_none, find_xpath_attr, xpath_text, update_url_query, ) class NozIE(InfoExtractor): _VALID_URL = r'http...
unlicense
d3trax/asuswrt-merlin
release/src/router/samba-3.5.8/source3/stf/pythoncheck.py
82
1720
#! /usr/bin/python # Comfychair test cases for Samba python extensions # Copyright (C) 2003 by Tim Potter <tpot@samba.org> # # 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 o...
gpl-2.0
pmaigutyak/mp-shop
wishlist/models.py
1
2022
from django.conf import settings from django.db import models from django.utils.translation import ugettext_lazy as _ from wishlist import exceptions class WishListItem(models.Model): user = models.ForeignKey( settings.AUTH_USER_MODEL, related_name='wishlist_items', verbose_name=_('Owner'), on_...
isc
CyanogenMod/android_external_chromium_org
tools/perf/benchmarks/thread_times.py
8
2093
# 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. from telemetry import test from benchmarks import silk_flags from measurements import thread_times import page_sets class ThreadTimesKeySilkCases(test.Test...
bsd-3-clause
yyjiang/scikit-learn
examples/linear_model/plot_ols_3d.py
350
2040
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Sparsity Example: Fitting only features 1 and 2 ========================================================= Features 1 and 2 of the diabetes-dataset are fitted and plotted below. It illustrates that although feature...
bsd-3-clause
joseihf/coding-events
web/forms/event_form.py
3
7889
# -*- coding: utf-8 -*- from django import forms from django_countries.fields import countries from api.models import Event from api.models.events import EventTheme, EventAudience class AddEventForm(forms.ModelForm): email_errors = { 'required': u'Please enter a valid email, so we can contact you in case of quest...
mit
Gnomjolnir/CoAPthon
plugtest_resources.py
4
5907
# coding=utf-8 import logging import threading import time import datetime from coapthon import defines from coapthon.resources.resource import Resource __author__ = 'Giacomo Tanganelli' logger = logging.getLogger(__name__) class TestResource(Resource): def __init__(self, name="TestResource", coap_server=Non...
mit
jsfan/flask-dance
setup.py
1
2079
# coding=utf-8 from __future__ import unicode_literals import re from setuptools import setup, Command, find_packages class PyTest(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): import sys,subprocess err...
mit
Jozhogg/iris
lib/iris/tests/unit/fileformats/grib/load_convert/test_translate_phenomenon.py
1
2806
# (C) British Crown Copyright 2014, Met Office # # This file is part of Iris. # # Iris 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 3 of the License, or # (at your option) any later ve...
lgpl-3.0
MobleyLab/SAMPL6
host_guest/Analysis/Scripts/analyze_sampling.py
1
116143
#!/usr/bin/env python # ============================================================================= # GLOBAL IMPORTS # ============================================================================= import collections import copy import itertools import json import math import os import numpy as np import pandas as ...
mit
scorphus/thumbor
tests/metrics/test_logger_metrics.py
4
1137
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/thumbor/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com thumbor@googlegroups.com from preggy import expect from thumbor.context import Context from ...
mit
alexanderjfink/miner
library/maps/uscensus_old.py
1
3983
""" miner map for U.S. Census 2010 Minnesota database """ from miner import * class USCensus2010: description = 'Data from the 2010 Dicennial US Census.' homepage = 'http://www.census.gov' # Place all download functionality in here, should download files to a standard download directory # Should check whether ...
gpl-2.0
ssorgatem/pulsar
galaxy/tools/deps/resolvers/modules.py
1
6098
""" This file contains the outline of an implementation to load environment modules (http://modules.sourceforge.net/). This is a community contributed feature and the core Galaxy team does utilize it, hence support for it will be minimal. The Galaxy team eagerly welcomes community contribution and maintenance however....
apache-2.0
sdague/home-assistant
homeassistant/components/isy994/binary_sensor.py
9
18206
"""Support for ISY994 binary sensors.""" from datetime import timedelta from typing import Callable, Union from pyisy.constants import ( CMD_OFF, CMD_ON, ISY_VALUE_UNKNOWN, PROTO_INSTEON, PROTO_ZWAVE, ) from pyisy.nodes import Group, Node from homeassistant.components.binary_sensor import ( DE...
apache-2.0
mtdewulf/incubator-airflow
airflow/settings.py
13
4567
# -*- 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
AuyaJackie/odoo
openerp/addons/base/module/wizard/base_module_configuration.py
447
2274
# -*- 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
dit/dit
dit/divergences/copy_mutual_information.py
1
2403
""" The copy mutual information, as defined by Kolchinsky & Corominas-Murtra. """ from .pmf import relative_entropy from ..utils import unitful __all__ = ( 'copy_mutual_information', ) def binary_kullback_leibler_divergence(p, q): """ Compute the binary Killback-Leibler divergence. Parameters ...
bsd-3-clause
crodrigues96/mtasa-blue
vendor/google-breakpad/src/tools/gyp/test/builddir/gyptest-default.py
185
2696
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verify the settings that cause a set of programs to be created in a specific build directory, and that no intermediate built files get c...
gpl-3.0
sulaweyo/torrentflux-b4rt-php7
html/bin/clients/mainline/BitTorrent/configfile.py
6
17671
# The contents of this file are subject to the BitTorrent Open Source License # Version 1.1 (the License). You may not copy or use this file, in either # source code or executable form, except in compliance with the License. You # may obtain a copy of the License at http://www.bittorrent.com/license/. # # Software di...
gpl-2.0
ClimbsRocks/scikit-learn
examples/linear_model/plot_sgd_comparison.py
112
1819
""" ================================== Comparing various online solvers ================================== An example showing how different online solvers perform on the hand-written digits dataset. """ # Author: Rob Zinkov <rob at zinkov dot com> # License: BSD 3 clause import numpy as np import matplotlib.pyplot a...
bsd-3-clause
larsks/cloud-init-patches
cloudinit/sources/DataSourceDigitalOcean.py
2
4286
# vi: ts=4 expandtab # # Author: Neal Shrader <neal@digitalocean.com> # Author: Ben Howard <bh@digitalocean.com> # # 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. # # ...
gpl-3.0
jewettaij/moltemplate
moltemplate/pdbsort.py
2
5841
#!/usr/bin/env python # Author: Andrew Jewett (jewett.aij at g mail) # License: MIT License (See LICENSE.md) # Copyright (c) 2013 """ Unfortunately, the lines in a PDB files are not always listed in the correct order. Software that reads PDB files is expected to re-sort this data before interpreting it. (...
mit
lshain-android-source/external-chromium_org-tools-gyp
test/mac/gyptest-app.py
13
1477
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that app bundles are built correctly. """ import TestGyp import sys if sys.platform == 'darwin': test = TestGyp.TestGyp(fo...
bsd-3-clause
xgt001/uav_msr_ip14
opencv_rnd/test_shape_detect.py
1
1569
__author__ = 'ganesh' __author__ = 'ganesh' import cv2 import numpy as np # TODO: loop through folder files filename = "alpha_N.JPG" image = cv2.imread(filename) newx,newy = image.shape[1]/6,image.shape[0]/6 #new size (w,h) img = cv2.resize(image,(newx,newy)) img_sav = img # CODE: Resize Image Toggle # cv2.ims...
mit
imtapps/django-imt-fork
django/contrib/auth/tests/views.py
22
24717
import os import re from django.conf import global_settings, settings from django.contrib.sites.models import Site, RequestSite from django.contrib.auth.models import User from django.core import mail from django.core.exceptions import SuspiciousOperation from django.core.urlresolvers import reverse, NoReverseMatch fr...
bsd-3-clause
ccastell/Transfer-System
Website/env/lib/python3.5/site-packages/pip/_vendor/progress/__init__.py
916
3023
# Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com> # # Permission to use, copy, modify, and distribute this software 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 "AS IS" AND THE A...
apache-2.0
coxmediagroup/googleads-python-lib
examples/adwords/v201506/reporting/download_criteria_report_as_stream.py
3
2519
#!/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
rmehta/erpnext
erpnext/setup/doctype/authorization_rule/authorization_rule.py
121
2292
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import cstr, flt from frappe import _, msgprint from frappe.model.document import Document class AuthorizationRule(Do...
gpl-3.0
vmx/spring
spring/docgen.py
1
6786
import math import time from hashlib import md5 from itertools import cycle import random import numpy as np from spring.states import STATES, NUM_STATES from fastdocgen import build_achievements class Iterator(object): def __init__(self): self.prefix = None def __iter__(self): return sel...
apache-2.0
angelapper/edx-platform
common/lib/xmodule/xmodule/mongo_utils.py
6
2979
""" Common MongoDB connection functions. """ import logging import pymongo from mongodb_proxy import MongoProxy logger = logging.getLogger(__name__) # pylint: disable=invalid-name # pylint: disable=bad-continuation def connect_to_mongodb( db, host, port=27017, tz_aware=True, user=None, password=None, r...
agpl-3.0
brennentsmith/teletraan
deploy-board/deploy_board/webapp/helpers/builds_helper.py
6
2445
# Copyright 2016 Pinterest, 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 writi...
apache-2.0
hainm/statsmodels
examples/python/robust_models_1.py
25
8588
## M-Estimators for Robust Linear Modeling from __future__ import print_function import numpy as np from scipy import stats import matplotlib.pyplot as plt import statsmodels.api as sm # * An M-estimator minimizes the function # # $$Q(e_i, \rho) = \sum_i~\rho \left (\frac{e_i}{s}\right )$$ # # where $\rho$ is a...
bsd-3-clause
wfxiang08/django185
django/contrib/sites/models.py
82
3951
from __future__ import unicode_literals import string import warnings from django.core.exceptions import ImproperlyConfigured, ValidationError from django.db import models from django.db.models.signals import pre_delete, pre_save from django.utils.deprecation import RemovedInDjango19Warning from django.utils.encoding...
bsd-3-clause
thomaslima/PySpice
ngspice-shared/test-module.py
1
2074
#################################################################################################### import PySpice.Logging.Logging as Logging logger = Logging.setup_logging() #################################################################################################### from PySpice.Spice.NgSpice.Shared import...
gpl-3.0
horizontracy/rpi_tool
api/venv/lib/python2.7/site-packages/werkzeug/contrib/testtools.py
295
2449
# -*- coding: utf-8 -*- """ werkzeug.contrib.testtools ~~~~~~~~~~~~~~~~~~~~~~~~~~ This module implements extended wrappers for simplified testing. `TestResponse` A response wrapper which adds various cached attributes for simplified assertions on various content types. :copyright:...
mit
gram526/VTK
Common/Core/Testing/Python/TestSwigPointer.py
21
1362
"""Test swig-style wrapped pointers Created on Oct 2, 2014 by David Gobbi """ import sys import vtk from vtk.test import Testing class TestSwigPointer(Testing.vtkTest): def testVoidPointer(self): a = vtk.vtkIntArray() a.SetNumberOfTuples(1) a.SetValue(0, 1) b = vtk.vtkIntArray() ...
bsd-3-clause
drnextgis/mapproxy
mapproxy/service/base.py
13
1692
# This file is part of the MapProxy project. # Copyright (C) 2010 Omniscale <http://omniscale.de> # # 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/LICEN...
apache-2.0
MickSandoz/compassion-switzerland
sponsorship_switzerland/models/child.py
1
2660
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (C) 2016 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: Emanuel Cino <ecino@compassion.ch> # # The licence is in the file __openerp__.p...
agpl-3.0
birdsarah/bokeh
examples/embed/slideshow/app_reveal.py
42
7875
# -*- coding: utf-8 -*- """ In this example, we want to show you how you can take isolated blocks of code (featuring different kinds of Bokeh visualizations) and rearrange them in a bigger (encompassing) flask-based application without losing the independence of each example. This is the reason of some weirdness throug...
bsd-3-clause
Unidata/MetPy
v0.6/_downloads/Find_Natural_Neighbors_Verification.py
3
2729
# Copyright (c) 2016 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause """ Find Natural Neighbors Verification =================================== Finding natural neighbors in a triangulation A triangle is a natural neighbor of a point if that point i...
bsd-3-clause
maxisi/gwsumm
gwsumm/plot/range.py
1
8183
# -*- coding: utf-8 -*- # Copyright (C) Duncan Macleod (2013) # # This file is part of GWSumm. # # GWSumm 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) ...
gpl-3.0
johannes-gehrs/centos_packages
packages.py
1
6353
from __future__ import absolute_import, division, unicode_literals import xml.etree.ElementTree as ElT import bz2 import io import os import uuid import sqlite3 import config import re import datetime import pickle import requests REPODATA_ARC_SUFFIX = "x86_64/" METADATA_SUFFIX = "repodata/repomd.xml" PACKAGE_TIMESTAM...
mit
florian-f/sklearn
sklearn/datasets/svmlight_format.py
1
13269
"""This module implements a loader and dumper for the svmlight format This format is a text-based format, with one sample per line. It does not store zero valued features hence is suitable for sparse dataset. The first element of each line can be used to store a target variable to predict. This format is used as the...
bsd-3-clause
GitHublong/hue
desktop/core/ext-py/Django-1.6.10/django/contrib/sessions/backends/cache.py
122
2505
from django.conf import settings from django.contrib.sessions.backends.base import SessionBase, CreateError from django.core.cache import get_cache from django.utils.six.moves import xrange KEY_PREFIX = "django.contrib.sessions.cache" class SessionStore(SessionBase): """ A cache-based session store. """ ...
apache-2.0
farazrehman/aws-resources
CloudFormation/nash/lib/python2.7/site-packages/troposphere/elasticbeanstalk.py
18
2738
# Copyright (c) 2013, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from . import AWSObject, AWSProperty, Tags WebServer = "WebServer" Worker = "Worker" WebServerType = "Standard" WorkerType = "SQS/HTTP" class SourceBundle(AWSProperty): props = { 'S3Bucket': (b...
gpl-2.0
garbled1/ansible
test/runner/injector/importer.py
163
7660
#!/usr/bin/env python """Interpreter and code coverage injector for use with ansible-test. The injector serves two main purposes: 1) Control the python interpreter used to run test tools and ansible code. 2) Provide optional code coverage analysis of ansible code. The injector is executed one of two ways: 1) On the...
gpl-3.0
egenerat/flight-manager
django/contrib/gis/db/backends/postgis/adapter.py
12
1200
""" This object provides quoting for GEOS geometries into PostgreSQL/PostGIS. """ from psycopg2 import Binary from psycopg2.extensions import ISQLQuote class PostGISAdapter(object): def __init__(self, geom): "Initializes on the geometry." # Getting the WKB (in string form, to allow easy...
mit
0x90sled/catapult
tracing/third_party/tvcm/third_party/rcssmin/_setup/py2/dist.py
43
1436
# -*- coding: ascii -*- # # Copyright 2007, 2008, 2009, 2010, 2011 # Andr\xe9 Malo or his licensors, as applicable # # 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.or...
bsd-3-clause
hivam/doctor_dental_care
models/doctor_list_report_odontologia.py
1
6674
# -*- encoding: 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
0k/odoo
addons/portal/tests/test_portal.py
116
14150
# -*- 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
rajathkumarmp/numpy
numpy/testing/decorators.py
66
8409
""" Decorators for labeling and modifying behavior of test objects. Decorators that merely return a modified version of the original function object are straightforward. Decorators that return a new function object need to use :: nose.tools.make_decorator(original_function)(decorator) in returning the decorator, i...
bsd-3-clause
sotdjin/glibglab
venv/lib/python2.7/site-packages/pip/_vendor/distlib/manifest.py
335
14810
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2013 Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """ Class representing the list of files in a distribution. Equivalent to distutils.filelist, but fixes some problems. """ import fnmatch import logging import os import re import sys from . impor...
mit
jcfr/girder
plugins/mongo_search/plugin_tests/search_test.py
9
6301
#!/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
qc88209818/JHGame
JHGame/external/emscripten/tests/poppler/poppler/gen-unicode-tables.py
61
1234
UNICODE_LAST_CHAR_PART1 = 0x2FAFF HANGUL_S_BASE = 0xAC00 HANGUL_S_COUNT = 19 * 21 * 28 import unicodedata print """// Generated by gen-unicode-tables.py typedef struct { Unicode character; int length; int offset; } decomposition; """ decomp_table = [] max_index = 0 decomp_expansion_index = {} decomp_expansion ...
gpl-2.0
marios-zindilis/musicbrainz-django-models
musicbrainz_django_models/models/release_status.py
1
2847
""" .. module:: release_status The **Release Status** is one of: 1. Official 2. Promotion 3. Bootleg 4. Pseudo-Release The Release Status is referenced by the Release model. Read more at the `Release documentation on MusicBrainz`_. .. _Release documentation on MusicBrainz: https://musicbrainz.org/doc/Release Postr...
gpl-2.0
lberruti/ansible
lib/ansible/runner/connection_plugins/funcd.py
110
3517
# Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # Based on chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com> # (c) 2013, Michael Scherer <misc@zarb.org> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU Gene...
gpl-3.0
mollstam/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/boto-2.38.0/boto/ec2/address.py
147
5348
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
mit
Mistobaan/tensorflow
tensorflow/tools/dist_test/scripts/k8s_tensorflow_lib.py
131
9280
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
cristian69/KernotekV3
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/cp949prober.py
2801
1782
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
gpl-3.0
berkeley-stat159/project-delta
code/utils/hrf.py
1
1130
""" This script contains the hrf() function, which is a utility for computing values of the hemodynamic response function at given times. This is a necessary tool for predicting BOLD signals. Future Python scripts can take advantage of the hrf() function by including the command sys.path.append("code/utils") fr...
bsd-3-clause
rajvishah/SfM_Init
sfminit/rotsolver.py
2
2527
import os import shutil import numpy as np import tempfile import subprocess from .sfminittypes import EG, write_EGs_file, read_rot_file def solve_global_rotations(indices, pairwise_rotations, cc=None): """ Solve the multiple rotations averaging problem using Chatterjee and Govindu's L1_IRLS method. The i...
bsd-2-clause
somcom3x/android_kernel_motorola_msm8992
Documentation/target/tcm_mod_builder.py
2358
40707
#!/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
idrogeno/IdroMips
lib/python/Plugins/Extensions/CutListEditor/plugin.py
4
13188
from Plugins.Plugin import PluginDescriptor from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Components.ServicePosition import ServicePositionGauge from Components.ActionMap import HelpableActionMap from Components.ServiceEventTracker import ServiceEventTracker, InfoBarBase from Compone...
gpl-2.0
tbetbetbe/grpc
src/objective-c/change-comments.py
52
3621
#!/usr/bin/env python2.7 # Copyright 2015, 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
ammarkhann/FinalSeniorCode
lib/python2.7/site-packages/django/contrib/auth/admin.py
83
8318
from django.conf import settings from django.conf.urls import url from django.contrib import admin, messages from django.contrib.admin.options import IS_POPUP_VAR from django.contrib.admin.utils import unquote from django.contrib.auth import update_session_auth_hash from django.contrib.auth.forms import ( AdminPass...
mit
jmerkow/VTK
ThirdParty/Twisted/twisted/trial/test/test_script.py
28
29651
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. import StringIO import gc import re import sys import textwrap import types from twisted.trial import unittest from twisted.trial.runner import ( TrialRunner, TestSuite, DestructiveTestSuite, TestLoader) from twisted.trial._dist.disttrial imp...
bsd-3-clause
kodibrasil/xbmc
lib/libUPnP/Neptune/Extras/Scripts/GenTrustAnchorsTables.py
264
5364
#! /usr/bin/env python ### ### Generate trust anchor tables from a text file ### like, for example, TLS-Trust-Anchors-base.crt ## and TLS-Trust-Anchors-extended.crt located under Extras/Data ### ### imports import sys import base64 ### generate a C file with bult-in TLS trust anchors FILE_HEADER = """/**************...
gpl-2.0