repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
okfish/django-oscar
refs/heads/master
src/oscar/apps/catalogue/views.py
15
import warnings from django.contrib import messages from django.core.paginator import InvalidPage from django.http import Http404, HttpResponsePermanentRedirect from django.shortcuts import get_object_or_404, redirect from django.utils.http import urlquote from django.utils.translation import ugettext_lazy as _ from d...
skearnes/pylearn2
refs/heads/master
pylearn2/sandbox/cuda_convnet/tests/test_rop_pool.py
5
import copy import numpy import theano from theano.tensor import grad from theano.tests import unittest_tools import theano.sandbox.cuda as tcn import warnings if not tcn.cuda_available: from nose.plugins.skip import SkipTest raise SkipTest('Optional package cuda disabled.') from pylearn2.sandbox.cuda_convne...
vipins/ccccms
refs/heads/master
env/Lib/encodings/mac_croatian.py
593
""" Python Character Mapping Codec mac_croatian generated from 'MAPPINGS/VENDORS/APPLE/CROATIAN.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...
airbnb/s3cmd
refs/heads/master
S3/FileDict.py
18
# -*- coding: utf-8 -*- ## Amazon S3 manager ## Author: Michal Ludvig <[email protected]> ## http://www.logix.cz/michal ## License: GPL Version 2 ## Copyright: TGRMN Software and contributors import logging from SortedDict import SortedDict import Utils import Config zero_length_md5 = "d41d8cd98f00b204e9800998...
curzona/pytest-bdd
refs/heads/master
tests/feature/test_wrong.py
1
"""Test wrong feature syntax.""" import pytest from pytest_bdd import scenario from pytest_bdd.feature import FeatureError @pytest.fixture(params=[ 'When after then', 'Then first', 'Given after When', 'Given after Then', ]) def scenario_name(request): return request.param def test_wrong(reques...
cidles/poio-api
refs/heads/master
src/poioapi/io/memory.py
1
# -*- coding: utf-8 -*- # # Poio Tools for Linguists # # Copyright (C) 2009-2014 Poio Project # Author: Peter Bouda <[email protected]> # URL: <http://media.cidles.eu/poio/> # For license information, see LICENSE.TXT """ This modules provides classes to store informations from Parsers to a data structure in memors. The...
nhomar/odoo-mirror
refs/heads/8.0
addons/l10n_pa/__openerp__.py
117
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 Cubic ERP - Teradata SAC (<http://cubicerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the...
cfbraun/django-admintools-bootstrap
refs/heads/master
admintools_bootstrap/settings.py
8
from appconf import AppConf class AdminToolsBootstrapConf(AppConf): SITE_LINK = '/' class Meta: prefix = 'ADMINTOOLS_BOOTSTRAP'
mark47/OESandbox
refs/heads/master
liquibase/HaitiLNSPMassive/scripts/uom.py
2
#!/usr/bin/env python # -*- coding: utf-8 -*- old = [] old_file = open("currentUOM.txt") new_file = open("newUOM.txt") result = open("MassiveUOM.sql",'w') for line in old_file: old.append(line.strip()) old_file.close() for line in new_file: if len(line) > 1: values = line.split(',') for val...
aroche/django
refs/heads/master
tests/save_delete_hooks/models.py
409
""" Adding hooks before/after saving and deleting To execute arbitrary code around ``save()`` and ``delete()``, just subclass the methods. """ from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Person(...
FHannes/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/contrib/gis/db/backends/mysql/operations.py
312
from django.db.backends.mysql.base import DatabaseOperations from django.contrib.gis.db.backends.adapter import WKTAdapter from django.contrib.gis.db.backends.base import BaseSpatialOperations class MySQLOperations(DatabaseOperations, BaseSpatialOperations): compiler_module = 'django.contrib.gis.db.models.sql.co...
ayushagrawal288/zamboni
refs/heads/master
mkt/regions/tests/test_utils_.py
19
# -*- coding: utf-8 -*- from nose.tools import eq_ from mkt.constants import regions from mkt.regions.utils import parse_region, remove_accents def test_parse_region(): eq_(parse_region('restofworld'), regions.RESTOFWORLD) eq_(parse_region('br'), regions.BRA) eq_(parse_region('brazil'), regions.BRA) ...
coordcn/LuaIO
refs/heads/master
tools/gyp/pylib/gyp/common_test.py
2542
#!/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. """Unit tests for the common.py file.""" import gyp.common import unittest import sys class TestTopologicallySorted(unittest.TestCase): ...
Metaswitch/calico-nova
refs/heads/calico-readme
nova/virt/disk/vfs/__init__.py
129
# Copyright 2012 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
Alzemand/ubi-virtual-assistant
refs/heads/master
lib/notify-module.py
2
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author: Edilson Alzemand import pynotify pynotify.init("Aplicativo") notify = pynotify.Notification("Olá Edilson, em que eu posso ajudar?", "", "/home/edilson/Projetos/ubi-virtual-assistant/ubi.svg") notify.show()
PrefPy/opra
refs/heads/master
compsocsite/groups/migrations/0002_group_open.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2017-01-09 15:05 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('groups', '0001_initial'), ] operations = [ migrations.AddField( mo...
CeltonMcGrath/TACTIC
refs/heads/master
src/tactic/ui/sync/sync_filter.py
6
############################################################ # # Copyright (c) 2011, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way witho...
osiloke/Flumotion-Transcoder
refs/heads/master
flumotion/transcoder/admin/datastore/activity.py
1
# vi:si:et:sw=4:sts=4:ts=4 # Flumotion - a streaming media server # Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L. # Copyright (C) 2010,2011 Flumotion Services, S.A. # All rights reserved. # # This file may be distributed and/or modified under the terms of # the GNU Lesser General Public License version 2.1...
MoKee/android_kernel_sony_tianchi
refs/heads/kk_mkt
tools/perf/util/setup.py
4998
#!/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...
shuggiefisher/django-on-google-app-engine-base
refs/heads/master
django/db/models/related.py
231
from django.utils.encoding import smart_unicode from django.db.models.fields import BLANK_CHOICE_DASH class BoundRelatedObject(object): def __init__(self, related_object, field_mapping, original): self.relation = related_object self.field_mappings = field_mapping[related_object.name] def templ...
mwrock/boxstarter
refs/heads/master
BuildPackages/example-light/tools/sublime/Packages/PowershellUtils/tests/sublimeplugin.py
20
class Plugin(object): def onNew(self, view): pass def onClone(self, view): pass def onLoad(self, view): pass def onClose(self, view): pass def onPreSave(self, view): pass def onPostSave(self, view): pass def onModified(self, view):...
ppoile/athletica-adapter
refs/heads/master
main/migrations/0002_auto_20150304_0224.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('main', '0001_squashed_0005_auto_20150304_0020'), ] operations = [ migrations.AlterField( model_name='rundenset',...
yuecong/dd-agent
refs/heads/master
tests/checks/integration/test_zk.py
27
# stdlib from nose.plugins.attrib import attr # project from checks import AgentCheck from tests.checks.common import AgentCheckTest @attr(requires='zookeeper') class ZooKeeperTestCase(AgentCheckTest): CHECK_NAME = 'zk' CONFIG = { 'host': "127.0.0.1", 'port': 2181, 'expected_mode': "...
unnikrishnankgs/va
refs/heads/master
venv/lib/python3.5/site-packages/IPython/frontend.py
9
""" Shim to maintain backwards compatibility with old frontend imports. We have moved all contents of the old `frontend` subpackage into top-level subpackages (`html`, `qt` and `terminal`), and flattened the notebook into just `IPython.html`, formerly `IPython.frontend.html.notebook`. This will let code that was maki...
jtoppins/beaker
refs/heads/master
Server/bkr/server/needpropertyxml.py
1
# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. import operator from sqlalchemy import or_, and_, not_, exists from s...
andyzsf/django
refs/heads/master
tests/defaultfilters/tests.py
15
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime import decimal import unittest import warnings from django.template.defaultfilters import ( add, addslashes, capfirst, center, cut, date, default, default_if_none, dictsort, dictsortreversed, divisibleby, escape, escapejs_filter, ...
lucafavatella/otp
refs/heads/maint
lib/asn1/test/asn1_SUITE_data/LargeConstraints.py
95
LargeConstraints DEFINITIONS ::= BEGIN -- Maximum number that can be encoded as a constrained whole number: 1 bsl (255*8) -- The number of octets needed to represent a number cannot be more than 255 -- As the length field is encoded as a 8-bit bitfield. RangeMax ::= INTEGER (1..1262383049660586222684174870651169998454...
ostrokach/bioconda-recipes
refs/heads/master
recipes/deepvariant/dv_postprocess_variants.py
9
#!/opt/anaconda1anaconda2anaconda3/bin/python # # Wrapper script for DeepVariant postprocess_variants BINARY_DIR="/opt/anaconda1anaconda2anaconda3/BINARYSUB" import argparse import os import subprocess import sys def real_dirname(path): """Return the symlink-resolved, canonicalized directory-portion of path.""" ...
amith01994/intellij-community
refs/heads/master
python/helpers/pycharm_generator_utils/constants.py
11
import os import re import types import sys import string import time # !!! Don't forget to update VERSION and required_gen_version if necessary !!! VERSION = "1.137" OUT_ENCODING = 'utf-8' version = ( (sys.hexversion & (0xff << 24)) >> 24, (sys.hexversion & (0xff << 16)) >> 16 ) if version[0] >= 3: #no...
JesseLivezey/pylearn2
refs/heads/master
pylearn2/utils/python26.py
49
""" .. todo:: WRITEME """ import functools import sys if sys.version_info[:2] < (2, 7): def cmp_to_key(mycmp): """Convert a cmp= function into a key= function""" class K(object): __slots__ = ['obj'] def __init__(self, obj, *args): self.obj = obj ...
abenzbiria/clients_odoo
refs/heads/master
addons/base_action_rule/base_action_rule.py
12
# -*- 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...
madarivi/QuantumDynamics
refs/heads/master
QD_Crank_Nicolson.py
1
import scipy.sparse as sparse import scipy.sparse.linalg as linalg import matplotlib.pyplot as plt import numpy as np import matplotlib.animation as animation import sys from time import gmtime, strftime # Crank-Nicolson method QD time evolution simulation of a gaussian # wave packet incident on a rectangular potenti...
suninsky/ReceiptOCR
refs/heads/master
Python/server/lib/python2.7/site-packages/click/testing.py
136
import os import sys import shutil import tempfile import contextlib from ._compat import iteritems, PY2 # If someone wants to vendor click, we want to ensure the # correct package is discovered. Ideally we could use a # relative import here but unfortunately Python does not # support that. clickpkg = sys.modules[_...
Crypto-Expert/Electrum-obsolete
refs/heads/master
gui/qt/main_window.py
2
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # 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...
pballand/congress
refs/heads/master
thirdparty/antlr3-antlr-3.5/runtime/Python/tests/t031emptyAlt.py
22
import antlr3 import testbase import unittest class t031emptyAlt(testbase.ANTLRTest): def setUp(self): self.compileGrammar() def testValid1(self): cStream = antlr3.StringStream('foo') lexer = self.getLexer(cStream) tStream = antlr3.CommonTokenStream(lexer) par...
vijayanandnandam/youtube-dl
refs/heads/master
youtube_dl/extractor/bet.py
64
from __future__ import unicode_literals from .mtv import MTVServicesInfoExtractor from ..utils import unified_strdate class BetIE(MTVServicesInfoExtractor): _VALID_URL = r'https?://(?:www\.)?bet\.com/(?:[^/]+/)+(?P<id>.+?)\.html' _TESTS = [ { 'url': 'http://www.bet.com/news/politics/2014/...
vine/luigi
refs/heads/master
examples/foo_complex.py
32
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
nop33/indico-plugins
refs/heads/master
search_invenio/indico_search_invenio/forms.py
1
# This file is part of Indico. # Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
kjc88/sl4a
refs/heads/master
python/gdata/tests/module_test_runner.py
132
#!/usr/bin/python # # Copyright (C) 2006 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
UWPCE-PythonCert/IntroPython2016
refs/heads/master
students/weidnem/session2/series.py
3
# -*- coding: utf-8 -*- """ Created on Thu Oct 6 17:09:17 2016 @author: weidner, matthew """ fib = 0 def fibonacci(n): series = [0,1] get_next(series,n) def get_next(series,n): if len(series) != n: series.append(series[-2]+series[-1]) get_next(series,n) else: pr...
amyvmiwei/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/test/test_sys_setprofile.py
177
import gc import pprint import sys import unittest from test import support class TestGetProfile(unittest.TestCase): def setUp(self): sys.setprofile(None) def tearDown(self): sys.setprofile(None) def test_empty(self): self.assertIsNone(sys.getprofile()) def test_setget(self)...
nvoron23/arangodb
refs/heads/devel
3rdParty/V8-4.3.61/third_party/python_26/Lib/json/tests/test_separators.py
55
import textwrap from unittest import TestCase import json class TestSeparators(TestCase): def test_separators(self): h = [['blorpie'], ['whoops'], [], 'd-shtaeou', 'd-nthiouh', 'i-vhbjkhnth', {'nifty': 87}, {'field': 'yes', 'morefield': False} ] expect = textwrap.dedent("""\ ...
karlw00t/flask
refs/heads/master
tests/test_appctx.py
7
# -*- coding: utf-8 -*- """ tests.appctx ~~~~~~~~~~~~ Tests the application context. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import pytest import flask def test_basic_url_generation(): app = flask.Flask(__name__) app.config['SERVER_NAME'...
nkming2/sc-studio
refs/heads/master
src/sc_studio/config.py
2
''' sc_studio.config Author: Ming Tsang Copyright (c) 2014-2015 HKUST SmartCar Team Refer to LICENSE for details ''' # Comment out to disable logging LOGFILE = "scstudio.log" REMOTE_DEBUG = False PYSRC = "" COL_GREY_100 = "#F5F5F5" COL_GREY_200 = "#EEEEEE" COL_GREY_700 = "#616161" COL_GREY_900 = "#212121" FONT = "C...
CZ-NIC/foris
refs/heads/master
foris/config_handlers/backups.py
1
# Foris - web administration interface for OpenWrt based on NETCONF # Copyright (C) 2017 CZ.NIC, z.s.p.o. <http://www.nic.cz> # # 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...
xNovax/SickRage
refs/heads/master
lib/github/AuthorizationApplication.py
74
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <[email protected]> # # Copyright 2012 Zearin <[email protected]> ...
direvus/ansible
refs/heads/devel
lib/ansible/modules/cloud/scaleway/scaleway_sshkey.py
75
#!/usr/bin/python # # Scaleway SSH keys management module # # Copyright (C) 2018 Online SAS. # https://www.scaleway.com # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA...
azureplus/hue
refs/heads/master
desktop/core/ext-py/Babel-0.9.6/babel/messages/checkers.py
47
# -*- coding: utf-8 -*- # # Copyright (C) 2007 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://babel.edgewall.org/wiki/License. # # This software cons...
laperry1/android_external_chromium_org
refs/heads/cm-12.1
tools/usb_gadget/server.py
91
# 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. """WSGI application to manage a USB gadget. """ import datetime import hashlib import re import subprocess import sys import time import urllib2 from torna...
mm1ke/portage
refs/heads/master
pym/portage/_emirrordist/main.py
6
# Copyright 2013-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import argparse import logging import sys import portage from portage import os from portage.util import normalize_path, writemsg_level, _recursive_file_list from portage.util._async.run_main_scheduler import ru...
Qwertycal/19520-Eye-Tracker
refs/heads/master
Accuracy/imgThreshold.py
1
#author: Nadezhda Shivarova #date created: 19/03/16 #Description: Combining thresholding and math morphology into #a single function to use within main() import numpy as np import math import cv2 #import removeOutliersThresh as outliers import bi_level_img_threshold as thresh from matplotlib import pyplot as plt d...
uranusjr/django
refs/heads/master
tests/custom_columns/tests.py
40
from django.core.exceptions import FieldError from django.test import TestCase from .models import Article, Author class CustomColumnsTests(TestCase): def setUp(self): self.a1 = Author.objects.create(first_name="John", last_name="Smith") self.a2 = Author.objects.create(first_name="Peter", last_n...
sdeleeuw/mediocris
refs/heads/master
project/settings_docker.py
1
from .settings_shared import * SECRET_KEY = '1234567890' DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS += [ 'corsheaders', ] MIDDLEWARE = [ 'corsheaders.middleware.CorsMiddleware', ] + MIDDLEWARE # Database # https://docs.djangoproject.com/en/1.11/ref/settings/#databases DAT...
supergis/QGIS
refs/heads/master
python/plugins/processing/gui/SilentProgress.py
17
# -*- coding: utf-8 -*- """ *************************************************************************** SilentProgress.py --------------------- Date : April 2013 Copyright : (C) 2013 by Victor Olaya Email : volayaf at gmail dot com *************************...
UdK-VPT/Open_eQuarter
refs/heads/master
mole3x/extensions/calc_geometry/oeq_geometry.py
2
# -*- coding: utf-8 -*- import os from qgis.core import NULL from mole3 import oeq_global from mole3.project import config from mole3.extensions import OeQExtension from mole3.stat_corr import common_walls_by_population_density_corr,window_wall_ratio_AVG_by_building_age_lookup def calculation(self=None, parameters={}...
vmthunder/packages
refs/heads/master
volt/volt/__init__.py
3
# -*- 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, softw...
jeffchau1979/pyFormUI
refs/heads/master
Demo/CustomControl.py
1
#!/usr/bin/env python ## Copyright 2012, En7788.com, Inc. All rights reserved. ## ## FormUI is a easy used GUI framwork for python, which is based on wxpython. ## FormUI is a free software: you can redistribute it and/or modify it under ## the terms of version 3 of the GNU Lesser General Public License as ## published ...
edvardlindelof/ERICA-prediction
refs/heads/master
models/QLasso/train_and_export_model.py
1
# -*- coding: utf-8 -*- import tensorflow as tf from tensorflow.contrib import learn from tensorflow.contrib.learn import LinearRegressor from tensorflow.contrib import layers from tensorflow.contrib.learn.python.learn.utils import input_fn_utils tf.logging.set_verbosity(tf.logging.INFO) import pandas as pd import nu...
coxley/ansible
refs/heads/devel
lib/ansible/vars/__init__.py
15
# (c) 2012-2014, Michael DeHaan <[email protected]> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
pongem/python-bot-project
refs/heads/master
appengine/standard/background/main.py
8
# Copyright 2016 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
laumann/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/manifest/update.py
230
#!/usr/bin/env python import argparse import imp import os import sys import manifest import vcs from log import get_logger from tree import GitTree, NoVCSTree here = os.path.dirname(__file__) localpaths = imp.load_source("localpaths", os.path.abspath(os.path.join(here, os.pardir, "localpaths.py"))) def update(tests...
jbuchbinder/youtube-dl
refs/heads/master
youtube_dl/extractor/googlesearch.py
168
from __future__ import unicode_literals import itertools import re from .common import SearchInfoExtractor from ..compat import ( compat_urllib_parse, ) class GoogleSearchIE(SearchInfoExtractor): IE_DESC = 'Google Video search' _MAX_RESULTS = 1000 IE_NAME = 'video.google:search' _SEARCH_KEY = 'g...
david30907d/feedback_django
refs/heads/master
spirit/topic/notification/__init__.py
12
# -*- coding: utf-8 -*- from __future__ import unicode_literals default_app_config = 'spirit.topic.notification.apps.SpiritTopicNotificationConfig'
LunarLanding/moviepy
refs/heads/master
moviepy/video/fx/painting.py
19
#------- CHECKING DEPENDENCIES ----------------------------------------- painting_possible = True try: from skimage.filter import sobel except: try: from scipy.ndimage.filters import sobel except: painting_possible = False #-------------------------------------------------------------------...
erdosmiller/pybase
refs/heads/master
pybase/objectify.py
1
class Objectify(object): def __init__(self,tree,parent=None): self._parent = parent if isinstance(tree,str): self._tree = fromstring(tree) else: self._tree = tree #this is required to call on all the children self._children = [python...
liuzheng712/jumpserver
refs/heads/master
apps/assets/views/system_user.py
1
# ~*~ coding: utf-8 ~*~ from django.utils.translation import ugettext as _ from django.views.generic import TemplateView from django.views.generic.edit import CreateView, DeleteView, UpdateView from django.urls import reverse_lazy from django.contrib.messages.views import SuccessMessageMixin from django.views.generic....
gtaylor/django-athumb
refs/heads/master
athumb/templatetags/athumb.py
4
from django.template import Library from thumbnail import thumbnail register = Library() register.tag(thumbnail)
glwu/python-for-android
refs/heads/master
python-modules/zope/zope/interface/exceptions.py
50
############################################################################## # # Copyright (c) 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
IllusionRom-deprecated/android_platform_external_chromium_org
refs/heads/illusion-4.4
tools/telemetry/telemetry/core/bitmap_unittest.py
23
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import tempfile import os import unittest from telemetry.core import bitmap from telemetry.core import util # This is a simple base64 encoded 2x2 PNG whic...
kurtgeebelen/rawesome
refs/heads/master
rawekite/kiteutils.py
1
# Copyright 2012-2013 Greg Horn # # This file is part of rawesome. # # rawesome 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 version. ...
pkruskal/scikit-learn
refs/heads/master
sklearn/datasets/tests/test_base.py
205
import os import shutil import tempfile import warnings import nose import numpy from pickle import loads from pickle import dumps from sklearn.datasets import get_data_home from sklearn.datasets import clear_data_home from sklearn.datasets import load_files from sklearn.datasets import load_sample_images from sklearn...
arborh/tensorflow
refs/heads/master
tensorflow/python/autograph/pyct/static_analysis/activity_test.py
4
# Copyright 2017 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...
gsehub/edx-platform
refs/heads/gsehub-release
common/djangoapps/xblock_django/management/commands/ensure_indexes.py
129
""" Creates Indexes on contentstore and modulestore databases. """ from django.core.management.base import BaseCommand from xmodule.contentstore.django import contentstore from xmodule.modulestore.django import modulestore class Command(BaseCommand): """ This command will create indexes on the stores used fo...
sanmiguel/home-assistant
refs/heads/master
homeassistant/components/frontend/__init__.py
1
""" homeassistant.components.frontend ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Provides a frontend for Home Assistant. """ import re import os import logging from . import version import homeassistant.util as util from homeassistant.const import URL_ROOT, HTTP_OK DOMAIN = 'frontend' DEPENDENCIES = ['api'] INDEX_PATH = os....
michellemorales/OpenMM
refs/heads/master
models/ptn/nets/im2vox_factory.py
10
# Copyright 2017 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 applicab...
pjryan126/solid-start-careers
refs/heads/master
store/api/zillow/venv/lib/python2.7/site-packages/requests/packages/chardet/compat.py
2942
######################## BEGIN LICENSE BLOCK ######################## # Contributor(s): # Ian Cordasco - port to Python # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # versio...
systers/mailman
refs/heads/master
src/mailman/interfaces/database.py
7
# Copyright (C) 2007-2015 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 you...
sajuptpm/magnum
refs/heads/master
magnum/api/app.py
6
# 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 # di...
s20121035/rk3288_android5.1_repo
refs/heads/master
external/chromium_org/tools/perf/page_sets/key_silk_cases.py
25
# 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.page import page as page_module from telemetry.page import page_set as page_set_module class KeySilkCasesPage(page_module.Page): def __ini...
telwertowski/Books-Mac-OS-X
refs/heads/master
Export Plugins/WhatsOnMyBookShelf Exporter/SOAPpy/wstools/test/test_wstools.py
308
#!/usr/bin/env python ############################################################################ # Joshua R. Boverhof, David W. Robertson, LBNL # See LBNLCopyright for copyright notice! ########################################################################### import unittest, tarfile, os, ConfigParser import test...
haoxli/crosswalk-test-suite
refs/heads/master
webapi/tct-csp-w3c-tests/csp-py/csp_ro_img-src_self_allowed_ext-manual.py
30
def main(request, response): import simplejson as json f = file('config.json') source = f.read() s = json.JSONDecoder().decode(source) url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1]) url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0]) _CSP = "img-src 'self'" r...
chrisseto/osf.io
refs/heads/feature/reviews
api_tests/institutions/views/test_institution_nodes_list.py
3
import pytest from api.base.settings.defaults import API_BASE from api_tests.nodes.filters.test_filters import NodesListFilteringMixin, NodesListDateFilteringMixin from osf_tests.factories import ( InstitutionFactory, AuthUserFactory, ProjectFactory, NodeFactory, RegistrationFactory, ) @pytest.ma...
mediawiki-utilities/python-mwcites
refs/heads/master
mwcites/extractors/doi.py
3
import re from collections import defaultdict from more_itertools import peekable from ..identifier import Identifier DOI_START_RE = re.compile(r'10\.[0-9]{4,}/') HTML_TAGS = ['ref', 'span', 'div', 'table', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'b', 'u', 'i', 's', 'ins', 'del', 'code', 'tt', 'blockquote', '...
janhahne/nest-simulator
refs/heads/master
pynest/examples/brunel_alpha_evolution_strategies.py
2
# -*- coding: utf-8 -*- # # brunel_alpha_evolution_strategies.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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 versio...
orangeduck/PyAutoC
refs/heads/master
Python27/Lib/encodings/gb18030.py
816
# # gb18030.py: Python Unicode Codec for GB18030 # # Written by Hye-Shik Chang <[email protected]> # import _codecs_cn, codecs import _multibytecodec as mbc codec = _codecs_cn.getcodec('gb18030') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.MultibyteInc...
MichaelNedzelsky/intellij-community
refs/heads/master
python/testData/resolve/ClassPrivateOutsideClass.py
83
class A(object): __X = 1 A._<ref>_X
vFense/vFenseAgent-nix
refs/heads/development
agent/deps/rpm6-32/Python-2.7.5/lib/python2.7/test/test_threaded_import.py
137
# This is a variant of the very old (early 90's) file # Demo/threads/bug.py. It simply provokes a number of threads into # trying to import the same module "at the same time". # There are no pleasant failure modes -- most likely is that Python # complains several times about module random having no attribute # randran...
40023256/2015cdag1man
refs/heads/master
static/Brython3.1.3-20150514-095342/Lib/site-packages/pygame/event.py
603
#!/usr/bin/env python '''Pygame module for interacting with events and queues. Pygame handles all it's event messaging through an event queue. The routines in this module help you manage that event queue. The input queue is heavily dependent on the pygame display module. If the display has not been initialized and a ...
ulope/django
refs/heads/master
tests/migrations/migrations_test_apps/migrated_app/migrations/0001_initial.py
2995
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): operations = [ migrations.CreateModel( "Author", [ ("id", models.AutoField(primary_key=True)), ("name",...
jkonecny12/pykickstart
refs/heads/master
tests/commands/lang.py
8
import unittest from tests.baseclass import CommandTest from pykickstart.errors import KickstartValueError class FC3_TestCase(CommandTest): command = "lang" def runTest(self): # pass self.assert_parse("lang en_US", "lang en_US\n") # fail # Fail if less than or more than one a...
Maximilian-Reuter/SickRage-1
refs/heads/master
lib/feedparser/http.py
43
from __future__ import absolute_import, unicode_literals, with_statement import datetime import gzip import re import struct import zlib try: import urllib.parse import urllib.request except ImportError: from urllib import splithost, splittype, splituser from urllib2 import build_opener, HTTPDigestAut...
pombredanne/pants
refs/heads/master
src/python/pants/util/fileutil.py
16
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os import ran...
gururajl/deep-learning
refs/heads/master
transfer-learning/tensorflow_vgg/utils.py
145
import skimage import skimage.io import skimage.transform import numpy as np # synset = [l.strip() for l in open('synset.txt').readlines()] # returns image of shape [224, 224, 3] # [height, width, depth] def load_image(path): # load image img = skimage.io.imread(path) img = img / 255.0 assert (0 <= ...
sander76/home-assistant
refs/heads/dev
homeassistant/components/webhook/trigger.py
5
"""Offer webhook triggered automation rules.""" from functools import partial from aiohttp import hdrs import voluptuous as vol from homeassistant.const import CONF_PLATFORM, CONF_WEBHOOK_ID from homeassistant.core import HassJob, callback import homeassistant.helpers.config_validation as cv # mypy: allow-untyped-de...
scroggo/skia
refs/heads/master
platform_tools/android/tests/test_variables.py
132
#!/usr/bin/python # Copyright 2014 Google Inc. # # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Common variables for tests. """ import os # Find this file so we can find the python files to test. SCRIPT_DIR = os.path.dirname(__file__) ANDROID_DIR = os.path....
wbc2010/django1.2.5
refs/heads/master
django1.2.5/django/contrib/syndication/views.py
43
import datetime from django.conf import settings from django.contrib.sites.models import get_current_site from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist from django.http import HttpResponse, Http404 from django.template import loader, Template, TemplateDoesNotExist, RequestContext from djan...
linearregression/socorro
refs/heads/master
socorro/unittest/external/postgresql/test_adi.py
1
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import datetime from nose.plugins.attrib import attr from nose.tools import eq_, assert_raises from socorro.external.p...
umitproject/packet-manipulator
refs/heads/master
umit/pm/backend/abstract/basecontext/__init__.py
2
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2008 Adriano Monteiro Marques # # Author: Francesco Piccinno <[email protected]> # ...
gangadharkadam/v5_erp
refs/heads/v5.0
erpnext/manufacturing/doctype/bom/bom.py
3
# 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.utils import cint, cstr, flt from frappe import _ from frappe.model.document import Document from operator import itemget...
anandpdoshi/frappe
refs/heads/develop
frappe/patches/v6_6/fix_file_url.py
41
from __future__ import unicode_literals import frappe from frappe.model.meta import is_single def execute(): """Fix old style file urls that start with files/""" fix_file_urls() fix_attach_field_urls() def fix_file_urls(): for file in frappe.db.sql_list("""select name from `tabFile` where file_url like 'files/%'"...