repo_name
stringlengths
5
104
path
stringlengths
4
248
content
stringlengths
102
99.9k
alexissmirnov/donomo
donomo_archive/lib/reportlab/platypus/doctemplate.py
#Copyright ReportLab Europe Ltd. 2000-2004 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/platypus/doctemplate.py __version__=''' $Id: doctemplate.py 3047 2007-02-23 17:45:16Z rgbecker $ ''' __doc__=""" This module contains the core struct...
GhostshipSoftware/avaloria
src/commands/default/cmdset_unloggedin.py
""" This module describes the unlogged state of the default game. The setting STATE_UNLOGGED should be set to the python path of the state instance in this module. """ from src.commands.cmdset import CmdSet from src.commands.default import unloggedin class UnloggedinCmdSet(CmdSet): """ Sets up the unlogged cm...
jonathanslenders/pymux-test
pymux/server.py
from __future__ import unicode_literals import getpass import json import socket import logging from prompt_toolkit.layout.screen import Size from prompt_toolkit.terminal.vt100_input import InputStream from prompt_toolkit.terminal.vt100_output import Vt100_Output from prompt_toolkit.input import Input __all__ = ( ...
canvasnetworks/canvas
website/canvas/migrations/0138_populate_daily_signup_uniques.py
# encoding: utf-8 import datetime from south.db import db from south.v2 import DataMigration from django.db import models from canvas.redis_models import redis, RedisSet class Migration(DataMigration): def forwards(self, orm): User = orm['auth.User'] for x in range(40): day =...
canvasnetworks/canvas
website/canvas/migrations/0084_fix_comment_judged_default.py
# encoding: utf-8 import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." for comment in orm.Comment.objects.all(): comment.judged = False ...
mvaled/sentry
tests/sentry/utils/test_apidocs.py
from __future__ import absolute_import from sentry.utils import apidocs def test_simplify_regex(): out = apidocs.simplify_regex(r"^/organizations/(?P<org_id>\w+)/$") assert out == "/organizations/{org_id}/" out = apidocs.simplify_regex(r"^/orgs/(?P<org_id>[\w]+)/project/(?P<id>[\d]+)/$") assert out =...
dayongxie/mod-pbxproj
pbxproj/pbxcli/pbxproj_folder.py
""" usage: pbxproj folder [options] <project> <path> [--exclude <regex>...] [(--recursive | -r)] [(--no-create-groups | -G)] [(--weak | -w)] ...
imankulov/sentry
src/sentry/templatetags/sentry_assets.py
from __future__ import absolute_import from django.template import Library from sentry.utils.assets import get_asset_url from sentry.utils.http import absolute_uri register = Library() @register.simple_tag def asset_url(module, path): """ Returns a versioned asset URL (located within Sentry's static files)...
ecoal95/angle
scripts/bmp_to_nv12.py
#!/usr/bin/python # # Copyright 2016 The ANGLE Project Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # # bmp_to_nv12.py: # Script to convert a simple BMP file to an NV12 format. Used to create # test images for the NV12 texture st...
EnglishConnection/djangocms-blog
djangocms_blog/cms_plugins.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals from cms.models.pluginmodel import CMSPlugin from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from django.utils.translation import ugettext_lazy as _ from .forms import LatestEntriesForm f...
tkosciol/micronota
micronota/commands/info.py
# ---------------------------------------------------------------------------- # Copyright (c) 2015--, micronota development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. # ---------------------------------------------...
Nikea/VisTrails
vistrails/gui/vistrail_controller.py
############################################################################### ## ## Copyright (C) 2011-2014, NYU-Poly. ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## "Redistribution and use in source and binary for...
weikang9009/giddy
giddy/ergodic.py
""" Summary measures for ergodic Markov chains. """ __author__ = "Sergio J. Rey <sjsrey@gmail.com>, Wei Kang <weikang9009@gmail.com>" __all__ = ["steady_state", "var_fmpt_ergodic", "fmpt"] import numpy as np import numpy.linalg as la import quantecon as qe from .util import fill_empty_diagonals def _steady_state_er...
peteflorence/flight
LCM/lcm-tester/test-beep.py
import lcm import sys if len(sys.argv) != 2: print 'Must supply 1 or 0 for beep or no beep. Example: python test-beep.py 1' exit(1) beep_int = int(sys.argv[1]) if beep_int > 1 or beep_int < 0: print 'Error: must supply 0 or 1 as an argument' exit(1) lc = lcm.LCM() sys.path.insert(0, '../') from lcm...
WarrenWeckesser/scikits-image
doc/examples/plot_local_equalize.py
""" ============================ Local Histogram Equalization ============================ This examples enhances an image with low contrast, using a method called *local histogram equalization*, which spreads out the most frequent intensity values in an image. The equalized image [1]_ has a roughly linear cumulative...
patrys/opbeat_python
opbeat/utils/lru.py
""" Backported LRU cache from Python 3.3 http://code.activestate.com/recipes/578078-py26-and-py30-backport-of-python-33s-lru-cache/ """ from collections import namedtuple from threading import RLock _CacheInfo = namedtuple("CacheInfo", ["hits", "misses", "maxsize", "currsize"]) class LRUCache(object): def __ini...
cjb/curveship
preparer.py
'Tokenize input text for the Recognizer.' __author__ = 'Nick Montfort' __copyright__ = 'Copyright 2011 Nick Montfort' __license__ = 'ISC' __version__ = '0.5.0.0' __status__ = 'Development' import sys import re try: import readline except ImportError: pass import input_model def prepare(separator, prompt='',...
hacksterio/pygments.rb
vendor/pygments-main/pygments/styles/perldoc.py
# -*- coding: utf-8 -*- """ pygments.styles.perldoc ~~~~~~~~~~~~~~~~~~~~~~~ Style similar to the style used in the `perldoc`_ code blocks. .. _perldoc: http://perldoc.perl.org/ :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from...
mravikumar281/staging-server
emis/sms.py
import urllib import urllib2 class Error(Exception): pass class GatewayNotAvailableError(Error): pass class SmsGupshupError(Error): '''An sms error with two attributes - errorcode, errormessage''' def __init__(self, errorcode, errormessage): self.errorcode = errorcode self.errormessa...
tavaresdong/courses-notes
ucb_cs61A/projects/scheme/tests/01.py
test = { 'name': 'Question 1', 'points': 1, 'suites': [ { 'cases': [ { 'code': r""" >>> read_line('3') 3 >>> read_line('-123') -123 >>> read_line('1.25') 1.25 >>> read_line('true') True >>> read_l...
raprasad/dataverse-dot-org
thedata/apps/search/solr_highlight_field_list.py
highlight_field_list = (\ 'accessToSources'\ , 'actionsToMinimizeLoss'\ , 'affiliation_ss'\ , 'astroFacility'\ , 'astroInstrument'\ , 'astroObject'\ , 'astroType'\ , 'author'\ , 'authorAffiliation'\ , 'authorIdentifier'\ , 'authorIdentifierScheme'\ , 'authorName'\ , 'characteristicOfSources'\ , 'city...
Amber-Creative/amber-frappe
frappe/desk/form/linked_with.py
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe, json from frappe.model.meta import is_single from frappe.modules import load_doctype_module import frappe.desk.form.meta import frappe.desk.form.load @frappe.white...
Winterflower/mdf
mdf/viewer/panels/plotpanel.py
""" Panel for showing graphs """ import wx import numpy as np # force matplotlib to use whatever wx is installed import sys sys.frozen = True from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg from matplotlib.figure import Figure class PlotPanel(wx.Panel): """ The PlotPanel has a Figure and a Ca...
S0lll0s/powerline
tests/test_config_merging.py
# vim:fileencoding=utf-8:noet from __future__ import (unicode_literals, division, absolute_import, print_function) import os import json from subprocess import check_call from operator import add from shutil import rmtree from powerline.lib.dict import mergedicts_copy as mdc from powerline import Powerline from tes...
igemsoftware/SYSU-Software2013
project/Python27_32/Lib/site-packages/pypm/external/2/sqlalchemy/connectors/pyodbc.py
# connectors/pyodbc.py # Copyright (C) 2005-2011 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from sqlalchemy.connectors import Connector from sqlalchemy.util import asbool i...
miurahr/django-admin-tools
admin_tools/menu/utils.py
""" Menu utilities. """ from django.conf import settings try: from importlib import import_module except ImportError: # Django < 1.9 and Python < 2.7 from django.utils.importlib import import_module from django.core.urlresolvers import reverse def _get_menu_cls(menu_cls, context): if isinstance(menu_...
MattClarke131/league
app/league/api/views.py
# -*- coding: utf-8 -*- """API.""" from datetime import timezone from flask import Blueprint, jsonify, request, url_for from flask_login import login_required from league.api.forms import GameCreateForm, GameUpdateForm from league.extensions import csrf_protect, messenger from league.models import Color, Game, Player...
SirCmpwn/truecraft.io
alembic/env.py
from __future__ import with_statement import os, sys sys.path.append(os.getcwd()) from alembic import context from sqlalchemy import engine_from_config, pool from logging.config import fileConfig # this is the Alembic Config object, which provides # access to the values within the .ini file in use. config = context.co...
bryback/quickseq
genescript/Bio/PDB/NeighborSearch.py
# Copyright (C) 2002, Thomas Hamelryck (thamelry@binf.ku.dk) # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """Fast atom neighbor lookup using a KD tree (implemented in C++).""" import numpy from ...
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-2.6/Lib/test/test_hash.py
# test the invariant that # iff a==b then hash(a)==hash(b) # # Also test that hash implementations are inherited as expected import unittest from test import test_support from collections import Hashable class HashEqualityTestCase(unittest.TestCase): def same_hash(self, *objlist): # Hash each object g...
sarnold/exaile
plugins/helloworld/__init__.py
# Copyright (C) 2009-2010 Aren Olson, 2014 Dustin Spicuzza # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distri...
ryandougherty/mwa-capstone
MWA_Tools/build/matplotlib/lib/mpl_examples/pylab_examples/integral_demo.py
#!/usr/bin/env python # implement the example graphs/integral from pyx from pylab import * from matplotlib.patches import Polygon def func(x): return (x-3)*(x-5)*(x-7)+85 ax = subplot(111) a, b = 2, 9 # integral area x = arange(0, 10, 0.01) y = func(x) plot(x, y, linewidth=1) # make the shaded region ix = aran...
rdhyee/metadata
docs/conf.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # gitenberg.metadata documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in...
givanaldo/invesalius3
invesalius/data/converters.py
#-------------------------------------------------------------------------- # Software: InVesalius - Software de Reconstrucao 3D de Imagens Medicas # Copyright: (C) 2001 Centro de Pesquisas Renato Archer # Homepage: http://www.softwarepublico.gov.br # Contact: invesalius@cti.gov.br # License: GNU ...
cardoe/virt-manager
virtinst/ImageFetcher.py
# # Convenience module for fetching files from a network source # # Copyright 2006-2007 Red Hat, Inc. # Daniel P. Berrange <berrange@redhat.com> # # 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 Foundatio...
WSCU/crazyflie_ros
src/cfclient/ui/main.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # || ____ _ __ # +------+ / __ )(_) /_______________ _____ ___ # | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ # +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ # || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ # # Copyright (C) 20...
SophieIPP/ipp-macro-series-parser
ipp_macro_series_parser/agregats_transports/transports_tidy_data.py
# -*- coding: utf-8 -*- """ Created on Mon Jul 20 17:27:38 2015 @author: thomas.douenne """ import pandas as pd from ipp_macro_series_parser.agregats_transports.transports_cleaner import * def tidy_melt_categorie_index(data_frame): annees = list(data_frame) data_frame = pd.melt(data_frame, id_vars = ['cate...
nielsbuwen/ilastik
ilastik/workflows/tracking/manual/manualTrackingWorkflow.py
############################################################################### # ilastik: interactive learning and segmentation toolkit # # Copyright (C) 2011-2014, the ilastik developers # <team@ilastik.org> # # This program is free software; you can redistribute it and/or # mod...
mbr0wn/gnuradio
gr-qtgui/examples/pyqt_time_c.py
#!/usr/bin/env python # # Copyright 2011,2012,2015 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # from gnuradio import gr from gnuradio import blocks import sys try: from gnuradio import qtgui from PyQt5 import QtWidgets, Qt import sip e...
decvalts/iris
lib/iris/tests/integration/test_grib2.py
# (C) British Crown Copyright 2014 - 2015, 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 l...
HackerEcology/SuggestU
suggestu/social/backends/stocktwits.py
""" Stocktwits OAuth2 backend, docs at: http://psa.matiasaguirre.net/docs/backends/stocktwits.html """ from social.backends.oauth import BaseOAuth2 class StocktwitsOAuth2(BaseOAuth2): """Stockwiths OAuth2 backend""" name = 'stocktwits' AUTHORIZATION_URL = 'https://api.stocktwits.com/api/2/oauth/author...
isnnn/Sick-Beard-TPB
sickbeard/providers/publichd.py
# Author: Mr_Orange <mr_orange@hotmail.it> # 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 the...
ruibarreira/linuxtrail
usr/lib/python2.7/dist-packages/reportlab/platypus/tableofcontents.py
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/platypus/tableofcontents.py __version__=''' $Id$ ''' __doc__="""Experimental class to generate Tables of Contents easily This module defines a single...
Gustry/inasafe
safe/gis/vector/test/test_prepare_vector_layer.py
# coding=utf-8 """Unit Test for Prepare Vector Layer.""" import unittest from osgeo import gdal from safe.test.utilities import ( get_qgis_app, load_test_vector_layer) QGIS_APP, CANVAS, IFACE, PARENT = get_qgis_app() from safe.gis.vector.tools import create_memory_layer from safe.gis.vector.prepare_vector_l...
moonbury/notebooks
github/MatplotlibCookbook/Chapter 2/24.py
import numpy import matplotlib.path as mpath from matplotlib import pyplot as plot shape_description = [ ( 1., 2., mpath.Path.MOVETO), ( 1., 1., mpath.Path.LINETO), ( 2., 1., mpath.Path.LINETO), ( 2., -1., mpath.Path.LINETO), ( 1., -1., mpath.Path.LINETO), ( 1., -2., mpath.Path.LINETO), (-1., -2., mpath.Pat...
DevinDewitt/pyqt5
examples/dbus/chat/ui_chatmainwindow.py
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'chatmainwindow.ui' # # Created: Fri Jul 26 06:48:06 2013 # by: PyQt5 UI code generator 5.0.1-snapshot-2a99e59669ee # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_ChatMainWi...
specialunderwear/django-easymode
easymode/views.py
from django import http from django.contrib.admin.views.decorators import staff_member_required from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ObjectDoesNotExist from easymode.utils.languagecode import fix_language_code @staff_member_required def preview(request, content...
sergiusens/snapcraft
tests/integration/store/test_store_validate.py
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2016-2018 Canonical Ltd # # 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 ...
edx/edx-platform
lms/djangoapps/experiments/factories.py
""" Experimentation factories """ import factory import factory.fuzzy from common.djangoapps.student.tests.factories import UserFactory from lms.djangoapps.experiments.models import ExperimentData, ExperimentKeyValue class ExperimentDataFactory(factory.django.DjangoModelFactory): # lint-amnesty, pylint: disable=m...
bankonme/www.freedomsponsors.org
djangoproject/core/migrations/0060_auto__add_field_watch_entity.py
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Watch.entity' db.add_column('core_watch', 'entity', self.gf('django.db...
abhinavp13/IITBX-edx-platform-dev
common/lib/xmodule/xmodule/discussion_module.py
from pkg_resources import resource_string from xmodule.x_module import XModule from xmodule.raw_module import RawDescriptor from xmodule.editing_module import MetadataOnlyEditingDescriptor from xblock.core import String, Scope class DiscussionFields(object): discussion_id = String(scope=Scope.settings) discu...
yiqingj/work
tests/python_tests/osm_test.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from nose.tools import * from utilities import execution_path, run_all import os, mapnik def setup(): # All of the paths used are relative, if we run the tests # from another directory we need to chdir() os.chdir(execution_path('.')) if 'osm' in mapnik.Dataso...
iulian787/spack
var/spack/repos/builtin/packages/libnrm/package.py
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Libnrm(AutotoolsPackage): """Libnrm, the application instrumentation library for the Node ...
andreas-koukorinis/ambhas
ambhas/stics.py
# -*- coding: utf-8 -*- """ Created on Fri Feb 03 18:12:26 2012 @author: K. Sreelash @website: www.ambhas.com @email: satkumartomer@gmail.com """ # import required libraries from __future__ import division import numpy as np from ambhas.xls import xlsread #input infile_name = 'D:/svn/ambhas/exampl...
ypid/subuser
logic/subuserlib/classes/fileBackedObject.py
#!/usr/bin/env python # This file should be compatible with both Python 2 and 3. # If it is not, please file a bug report. # pylint: disable=no-init,old-style-class """ If an object has persistant state which needs to be serialzed to disk, that object should be backed by a file. """ #external imports import abc #inte...
ForensicTools/GRREAT-475_2141-Chaigon-Failey-Siebert
lib/rdfvalues/checks.py
#!/usr/bin/env python """Implementation of check types.""" from grr.lib import config_lib from grr.lib import rdfvalue from grr.lib.checks import checks from grr.lib.checks import filters from grr.lib.checks import hints from grr.lib.checks import triggers from grr.lib.rdfvalues import structs from grr.proto import che...
fhueske/flink
flink-python/pyflink/table/table_schema.py
################################################################################ # 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...
maxziv/SEApp
server/lib/flask_mongoengine/__init__.py
# -*- coding: utf-8 -*- from __future__ import absolute_import from flask import abort import mongoengine from mongoengine.queryset import MultipleObjectsReturned, DoesNotExist, QuerySet from mongoengine.base import ValidationError from .sessions import * from .pagination import * def _include_mongoengine(obj): ...
dragorosson/heat
heat/tests/clients/test_sahara_client.py
# # 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 # ...
caioserra/apiAdwords
examples/adspygoogle/adwords/v201306/basic_operations/get_keywords.py
#!/usr/bin/python # # 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 b...
JshWright/home-assistant
tests/components/light/test_zwave.py
"""Test Z-Wave lights.""" from unittest.mock import patch, MagicMock import homeassistant.components.zwave from homeassistant.components.zwave import const from homeassistant.components.light import ( zwave, ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_RGB_COLOR, ATTR_TRANSITION, SUPPORT_BRIGHTNESS, SUPPORT_TRANSITI...
ewandor/home-assistant
homeassistant/components/api.py
""" Rest API for Home Assistant. For more details about the RESTful API, please refer to the documentation at https://home-assistant.io/developers/api/ """ import asyncio import json import logging from aiohttp import web import async_timeout import homeassistant.core as ha import homeassistant.remote as rem from ho...
citrix-openstack-build/tempest
tempest/services/volume/xml/snapshots_client.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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...
mlperf/training_results_v0.5
v0.5.0/google/cloud_v2.512/resnet-tpuv2-512/code/resnet/model/models/samples/core/get_started/custom_estimator.py
# 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 appl...
wjzhang/pyOCD
pyOCD/target/target_MKV11Z128xxx7.py
""" mbed CMSIS-DAP debugger Copyright (c) 2006-2013 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 ...
onepercentclub/django-taggit-autocomplete-modified
src/taggit_autocomplete_modified/widgets.py
# -*- coding: utf-8 -*- # # This file is part of django-taggit-autocomplete-modified. # # django-taggit-autocomplete-modified provides autocomplete functionality # to the tags form field of django-taggit. # # Development Web Site: # - http://www.codetrax.org/projects/django-taggit-autocomplete-modified # Public...
leppa/home-assistant
tests/helpers/test_area_registry.py
"""Tests for the Area Registry.""" import asyncio import asynctest import pytest from homeassistant.core import callback from homeassistant.helpers import area_registry from tests.common import flush_store, mock_area_registry @pytest.fixture def registry(hass): """Return an empty, loaded, registry.""" retu...
airbnb/airflow
airflow/providers/google/cloud/hooks/compute.py
# # 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...
nzlosh/st2
st2exporter/tests/unit/test_dumper.py
# Copyright 2020 The StackStorm Authors. # Copyright 2019 Extreme Networks, 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 ...
lumig242/Hue-Integration-with-CDAP
cdap/src/cdap/settings.py
# coding=utf8 # Copyright © 2016 Cask Data, 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...
dmm92/troposphere
troposphere/opsworks.py
# Copyright (c) 2014, Yuta Okamoto <okapies@gmail.com> # All rights reserved. # # See LICENSE file for full license. from . import AWSObject, AWSProperty from .validators import boolean, integer class Source(AWSProperty): props = { 'Password': (basestring, False), 'Revision': (basestring, False),...
AMICI-developer/AMICI
python/tests/conftest.py
"""pytest configuration file""" import copy import importlib import os import shutil import sys import amici import pytest @pytest.fixture(scope="session") def sbml_example_presimulation_module(): """SBML example_presimulation model module fixture""" sbml_file = os.path.join(os.path.dirname(__file__), '..',...
tomchristie/django-rest-framework
rest_framework/schemas/coreapi.py
import warnings from collections import Counter, OrderedDict from urllib import parse from django.db import models from django.utils.encoding import force_str from rest_framework import exceptions, serializers from rest_framework.compat import coreapi, coreschema, uritemplate from rest_framework.settings import api_s...
moreati/trac-gitsvn
sample-plugins/Timestamp.py
"""Inserts the current time (in seconds) into the wiki page.""" revision = "$Rev$" url = "$URL$" # # The following shows the code for macro, old-style. # # The `execute` function serves no purpose other than to illustrate # the example, it will not be used anymore. # # ---- (ignore in your own macro) ---- # -- import...
ioam/topographica
models/stevens.jn13/jn13_figures/lib/measurement.py
""" Measurement Analysis functions that measure orientation maps and analyse them within each running Topographica simulation. These functions return dictionaries which allow the data to be collated by RunBatchCommand in the Topographica Lancet extension (topo/misc/lancext.py). """ from topo.analysis.featureresponses...
kaedroho/wagtail
wagtail/admin/views/pages/lock.py
from django.core.exceptions import PermissionDenied from django.shortcuts import get_object_or_404, redirect from django.utils import timezone from django.utils.http import is_safe_url from django.utils.translation import gettext as _ from django.views.decorators.http import require_POST from wagtail.admin import mess...
Alwnikrotikz/los-cocos
cocos/path.py
# ---------------------------------------------------------------------------- # cocos2d # Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa, # Lucio Torre # Copyright (c) 2009-2014 Richard Jones, Claudio Canepa # All rights reserved. # # Redistribution and use in source and binary forms, with o...
mdlui/Sigil2
src/Backends/SynchroTraceGen/scripts/stgen_capnp_parser_uncompressed.py
#!/bin/python import sys import os from warnings import warn import capnp import STEventTraceUncompressed_capnp def processSTEventTrace(file): for stream in (STEventTraceUncompressed_capnp.EventStreamUncompressed .read_multiple_packed(file, traversal_limit_in_words=2**63)): for event i...
gogobebe2/deep_q_rl
deep_q_rl/launcher.py
#! /usr/bin/env python """This script launches all of the processes necessary to train a deep Q-network on an ALE game. """ import subprocess import multiprocessing import os import argparse import logging from rlglue.agent import AgentLoader def launch_rlglue_agent(parameters): """Start the rlglue agent. (...
Alwnikrotikz/marinemap
lingcod/studyregion/migrations/0001_initial.py
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from django.conf import settings class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'StudyRegion' db.create_table(u'mm_study_region', ( ...
Darthkpo/xtt
openpyxl/styles/tests/conftest.py
from __future__ import absolute_import # Copyright (c) 2010-2015 openpyxl import pytest @pytest.fixture def datadir(): """DATADIR as a LocalPath""" import os here = os.path.split(__file__)[0] DATADIR = os.path.join(here, "data") from py._path.local import LocalPath return LocalPath(DATADIR) ...
stevepiercy/readthedocs.org
readthedocs/gold/forms.py
"""Gold subscription forms""" from django import forms from stripe.error import InvalidRequestError from readthedocs.payments.forms import StripeModelForm, StripeResourceMixin from .models import LEVEL_CHOICES, GoldUser class GoldSubscriptionForm(StripeResourceMixin, StripeModelForm): """Gold subscription pay...
awagnon/maraschino
modules/transmission.py
# Author: Geoffrey Huntley <ghuntley@ghuntley.com> from flask import render_template import transmissionrpc from datetime import timedelta from maraschino.tools import * from maraschino import app, logger def log_exception(e): logger.log('Transmission :: EXCEPTION -- %s' % e, 'DEBUG') @app.route('/xhr/transmi...
gi11es/thumbor
tests/filters/test_upscale.py
#!/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 tornado.testing import gen_test fro...
neharejanjeva/techstitution
venv/lib/python2.7/site-packages/pymongo/__init__.py
# 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...
garrettcap/Bulletproof-Backup
wx/tools/XRCed/globals.py
# Name: globals.py # Purpose: XRC editor, global variables # Author: Roman Rolinsky <rolinsky@mema.ucl.ac.be> # Created: 02.12.2002 # RCS-ID: $Id: globals.py 71790 2012-06-17 15:43:08Z ROL $ import os,sys import wx import wx.xrc as xrc try: import wx.wizard except: pass import lo...
Taapat/enigma2
lib/python/Components/Converter/MenuEntryCompare.py
from Components.Converter.Converter import Converter from Components.Element import cached class MenuEntryCompare(Converter): def __init__(self, type): Converter.__init__(self, type) self.entry_id = type def selChanged(self): self.downstream_elements.changed((self.CHANGED_ALL, 0)) @cached def getBool(self...
medspx/QGIS
python/plugins/processing/tests/AlgorithmsTestBase.py
# -*- coding: utf-8 -*- """ *************************************************************************** AlgorithmsTest.py --------------------- Date : January 2016 Copyright : (C) 2016 by Matthias Kuhn Email : matthias@opengis.ch ***************************...
fabricehong/zim-desktop
zim/templates/processor.py
# -*- coding: utf-8 -*- # Copyright 2008-2014 Jaap Karssenberg <jaap.karssenberg@gmail.com> '''This module contains the main object to "execute" a template and fill in the parameters, call functions etc. The L{TemplateProcessor} defined here takes care of the template control flow ('IF', 'FOR', etc.). Also see the L...
narasimhan-v/avocado-misc-tests-1
perf/perftool.py
#!/usr/bin/env python # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that...
waynesun09/tp-libvirt
libguestfs/tests/guestfish_misc.py
import commands import re from autotest.client.shared import error from virttest import utils_test from virttest import data_dir def prepare_image(params): """ (1) Create a image (2) Create file system on the image """ params["image_path"] = utils_test.libguestfs.preprocess_image(params) if ...
dsweet04/rekall
rekall-core/rekall/plugins/windows/connections.py
# Rekall Memory Forensics # # Copyright 2013 Google Inc. All Rights Reserved. # # Authors: # Mike Auty <mike.auty@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of...
eudoxos/woodem
examples/densepack.py
import woo, woo.pack from woo.dem import * from woo.core import * S=woo.master.scene=woo.core.Scene(fields=[DemField()]) # predicate to generate packing for predicate=woo.pack.inHyperboloid((0,0,-.5*.15),(0,0,.5*.15),.25*.15,.17*.15) # with capsules and randomDensePack2 (sp2 is a ShapePack) generator=woo.dem.PsdCaps...
soltraconpotprojectNLDA/SoltraConpot
conpot/tests/test_kamstrup_decoder.py
# Copyright (C) 2014 Johnny Vestergaard <jkv@unixcluster.dk> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This...
Nebucatnetzer/tamagotchi
pygame/lib/python3.4/site-packages/faker/providers/person/de_AT/__init__.py
# coding=utf-8 from __future__ import unicode_literals from .. import Provider as PersonProvider class Provider(PersonProvider): formats = ( '{{first_name}} {{last_name}}', '{{first_name}} {{last_name}}', '{{first_name}} {{last_name}}', '{{first_name}} {{last_name}}', '{{fi...
dkliban/pulp_puppet
pulp_puppet_handlers/test/unit/test_module_handler.py
import subprocess import unittest import mock from pulp.agent.lib.report import ContentReport from pulp_puppet.common import constants from pulp_puppet.handlers.puppet import ModuleHandler def mock_puppet_pre33(f): return mock.patch.object(ModuleHandler, '_detect_puppet_version', sp...
batxes/4Cin
SHH_WT_models_highres/SHH_WT_models_highres_final_output_0.1_-0.1_5000/mtx1_models/SHH_WT_models_highres8956.py
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...
tkasp/osmose-backend
analysers/analyser_merge_carpool_FR.py
#!/usr/bin/env python #-*- coding: utf-8 -*- ########################################################################### ## ## ## Copyrights Adrien PAVIE 2019 ## ## ...
nanocell/lsync
python/boto/swf/__init__.py
# 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...
rosarior/rua
rua/apps/main/settings.py
"""Configuration options for the main app""" from django.utils.translation import ugettext_lazy as _ from smart_settings.api import register_setting register_setting( namespace=u'main', module=u'main.settings', name=u'SIDE_BAR_SEARCH', global_name=u'MAIN_SIDE_BAR_SEARCH', default=False, descr...