repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
awemulya/fieldsight-kobocat
refs/heads/master
onadata/apps/main/tests/test_form_enter_data.py
1
import os import re import requests import unittest from urlparse import urlparse from time import time from httmock import urlmatch, HTTMock from django.test import RequestFactory from django.core.urlresolvers import reverse from django.core.validators import URLValidator from django.conf import settings from django...
divio/django-cms
refs/heads/develop
menus/exceptions.py
2
class NamespaceAlreadyRegistered(Exception): pass class NoParentFound(Exception): pass
petroniocandido/pyFTS
refs/heads/master
docs/conf.py
1
# -*- coding: utf-8 -*- # # Configuration file for the Sphinx documentation builder. # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/stable/config # -- Path setup ------------------------------------------------------------...
anntzer/numpy
refs/heads/master
numpy/typing/tests/data/reveal/flatiter.py
2
from typing import Any import numpy as np a: np.flatiter[np.ndarray[Any, np.dtype[np.str_]]] reveal_type(a.base) # E: numpy.ndarray[Any, numpy.dtype[numpy.str_]] reveal_type(a.copy()) # E: numpy.ndarray[Any, numpy.dtype[numpy.str_]] reveal_type(a.coords) # E: tuple[builtins.int] reveal_type(a.index) # E: int reve...
herilalaina/scikit-learn
refs/heads/master
sklearn/utils/fixes.py
10
"""Compatibility fixes for older version of python, numpy and scipy If you add content to this file, please give the version of the package at which the fixe is no longer needed. """ # Authors: Emmanuelle Gouillart <[email protected]> # Gael Varoquaux <[email protected]> # ...
jideobs/twilioAngular
refs/heads/master
venv/lib/python2.7/site-packages/twilio/rest/monitor.py
12
from twilio.rest.base import TwilioClient from twilio.rest.resources import UNSET_TIMEOUT from twilio.rest.resources.monitor.alerts import Alerts from twilio.rest.resources.monitor.events import Events class TwilioMonitorClient(TwilioClient): """ A client for accessing the Twilio Monitor API. The Twilio ...
MSM8226-Samsung/android_kernel_samsung_ms013g
refs/heads/cm-13.0
scripts/tracing/draw_functrace.py
14679
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <[email protected]> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
omergertel/chords
refs/heads/master
chords/exceptions.py
1
class ChordError(Exception): pass class UnsatisfiedResourcesError(ChordError): pass class UnknownResourceClassError(ChordError): pass class UnsatisfiableRequestError(ChordError): pass
Luffin/powerline
refs/heads/develop
powerline/theme.py
23
# vim:fileencoding=utf-8:noet from __future__ import (unicode_literals, division, absolute_import, print_function) import itertools from powerline.segment import gen_segment_getter, process_segment, get_fallback_segment from powerline.lib.unicode import u, safe_unicode def requires_segment_info(func): func.powerli...
xgds/xgds_sample
refs/heads/master
xgds_sample/management/appCommands/prep.py
1
#__BEGIN_LICENSE__ # Copyright (c) 2015, United States Government, as represented by the # Administrator of the National Aeronautics and Space Administration. # All rights reserved. # # The xGDS platform is licensed under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance ...
NetApp/manila
refs/heads/master
manila/tests/fake_notifier.py
7
# Copyright 2014 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 agre...
ebachelet/pyLIMA
refs/heads/master
pyLIMA/microlguess.py
1
# -*- coding: utf-8 -*- """ Created on Mon May 23 16:00:51 2016 @author: ebachelet """ import numpy as np import scipy.signal as ss from pyLIMA import microltoolbox def initial_guess_PSPL(event): """Function to find initial PSPL guess for Levenberg-Marquardt solver (method=='LM'). This assumes no blendi...
boundarydevices/android_external_chromium_org
refs/heads/cm-12.0
tools/python/google/platform_utils_mac.py
183
# Copyright (c) 2011 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. """Platform-specific utility methods shared by several scripts.""" import os import subprocess import google.path_utils class PlatformUtility(object)...
tutumcloud/python-social-auth
refs/heads/master
social/pipeline/user.py
8
from uuid import uuid4 from social.utils import slugify, module_member USER_FIELDS = ['username', 'email'] def get_username(strategy, details, user=None, *args, **kwargs): if 'username' not in strategy.setting('USER_FIELDS', USER_FIELDS): return storage = strategy.storage if not user: ...
jk1/intellij-community
refs/heads/master
python/testData/intentions/replaceBackQuoteExpression_after.py
83
repr(a + b, 34 + a)
fhe-odoo/odoo
refs/heads/8.0
openerp/tools/safe_eval.py
25
# -*- coding: utf-8 -*- ############################################################################## # Copyright (C) 2004-2014 OpenERP s.a. (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # ...
stutivarshney/Bal-Aveksha
refs/heads/master
WebServer/BalAvekshaEnv/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/sjisprober.py
1776
######################## 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...
jptomo/rpython-lang-scheme
refs/heads/master
rpython/rtyper/lltypesystem/rdict.py
1
from rpython.tool.pairtype import pairtype from rpython.flowspace.model import Constant from rpython.rtyper.rdict import AbstractDictRepr, AbstractDictIteratorRepr from rpython.rtyper.lltypesystem import lltype from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rlib import objectmodel, jit from rpyth...
isandlaTech/cohorte-demos
refs/heads/dev
led/dump/led-demo-raspberry/cohorte/dist/cohorte-1.0.0-1.0.0-20141201.234602-19-python-distribution/repo/bundles/cohorte/composer/node/criteria/reliability/__init__.py
8
#!/usr/bin/env python # -- Content-Encoding: UTF-8 -- """ Cohorte Composer criteria components :author: Thomas Calmant :license: Apache Software License 2.0 .. Copyright 2014 isandlaTech Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with t...
chenziliang/aws-meta-snaps
refs/heads/develop
snaps/cloudwatch_defaults.py
1
CLOUDWATCH_DEFAULT_METRICS = { "AWS/AutoScaling": [ "GroupDesiredCapacity", "GroupInServiceInstances", "GroupMaxSize", "GroupMinSize", "GroupPendingInstances", "GroupStandbyInstances", "GroupTerminatingInstances", "GroupTotalInstances" ], "AWS/...
wfxiang08/django197
refs/heads/master
django/db/migrations/recorder.py
478
from __future__ import unicode_literals from django.apps.registry import Apps from django.db import models from django.db.utils import DatabaseError from django.utils.encoding import python_2_unicode_compatible from django.utils.timezone import now from .exceptions import MigrationSchemaMissing class MigrationRecor...
ProjectivePlane/hello-world
refs/heads/master
sumsquares.py
1
#!/usr/bin/python import math Max=10000 squareSet=set() for n in xrange(1,int(math.sqrt(Max)+1)): squareSet.add(n*n) for m in xrange(1,Max+1): for n in squareSet: k=m-n if k in squareSet and k<=n: print m,"=",n,"+",k
nycholas/ask-undrgz
refs/heads/master
src/ask-undrgz/django/middleware/gzip.py
321
import re from django.utils.text import compress_string from django.utils.cache import patch_vary_headers re_accepts_gzip = re.compile(r'\bgzip\b') class GZipMiddleware(object): """ This middleware compresses content if the browser allows gzip compression. It sets the Vary header accordingly, so that cac...
jesuscript/topo-mpi
refs/heads/cleanmpi
topo/misc/pyxhandler.py
2
""" Support for optional Cython .pyx files. $Id$ """ # CEBENHANCEMENT: If we begin using Cython components, consider adding # more features of inlinec.py (ie: test of Cython compilation, control # over warnings). # CEBALERT: currently, need to do something like # "export C_INCLUDE_PATH=lib/python2.6/site-packages/nu...
Amarchuk/2FInstability
refs/heads/master
core/n7217.py
1
__author__ = 'amarch' # -*- coding: utf-8 -*- import time import shutil from main import * def correctGasData(r_g1, v_g1, dv_g1): '''Функция, куда убраны все операции подгонки с данными по газу.''' r_g = r_g1 v_g = v_g1 dv_g = dv_g1 #Если необходимо выпрямить апроксимацию на краю - можно добав...
JenSte/pyqtgraph
refs/heads/develop
pyqtgraph/canvas/TransformGuiTemplate_pyqt5.py
30
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file './pyqtgraph/canvas/TransformGuiTemplate.ui' # # Created: Wed Mar 26 15:09:28 2014 # by: PyQt5 UI code generator 5.0.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Form(ob...
0x0mar/MITMf
refs/heads/master
plugins/BeefAutorun.py
1
from plugins.plugin import Plugin from plugins.Inject import Inject from time import sleep import sys import json import threading import logging import libs.beefapi as beefapi try: from configobj import ConfigObj except: sys.exit('[-] configobj library not installed!') requests_log = logging.getLogger("reque...
jackkiej/SickRage
refs/heads/master
lib/sqlalchemy/dialects/postgresql/zxjdbc.py
79
# postgresql/zxjdbc.py # Copyright (C) 2005-2014 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 """ .. dialect:: postgresql+zxjdbc :name: zxJDBC for Jython :dbapi: zxjdb...
benpatterson/edx-platform
refs/heads/master
lms/djangoapps/licenses/migrations/0001_initial.py
188
# -*- 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 model 'CourseSoftware' db.create_table('licenses_coursesoftware', ( ('id', self.gf('dja...
duyetdev/openerp-6.1.1
refs/heads/master
openerp/addons/l10n_pe/__openerp__.py
8
# -*- 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...
BeATz-UnKNoWN/python-for-android
refs/heads/master
python-modules/pybluez/examples/advanced/inquiry-with-rssi.py
47
# performs a simple device inquiry, followed by a remote name request of each # discovered device import os import sys import struct import bluetooth._bluetooth as bluez def printpacket(pkt): for c in pkt: sys.stdout.write("%02x " % struct.unpack("B",c)[0]) print def read_inquiry_mode(sock): ""...
whyscream/dspam-milter
refs/heads/master
dspam/__init__.py
1
# Copyright (c) 2012, Tom Hendrikx # All rights reserved. # # See LICENSE for the license. VERSION = '0.3.5.dev0'
mdrumond/tensorflow
refs/heads/master
tensorflow/python/training/queue_runner.py
139
# 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...
PyFilesystem/pyfilesystem
refs/heads/master
fs/expose/serve/__init__.py
20
# Work in progress
rahulunair/nova
refs/heads/master
nova/api/openstack/compute/__init__.py
10
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # 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 ...
ducksboard/libsaas
refs/heads/master
libsaas/services/twilio/numbers.py
4
from libsaas import http, parsers from libsaas.services import base from libsaas.services.twilio import resource class AvailablePhoneNumbersBase(resource.TwilioResource): path = '{0}' def get_url(self): path = self.path.format(self.object_id) return '{0}/{1}'.format(self.parent.get_url(), p...
GGoussar/scikit-image
refs/heads/master
doc/examples/transform/plot_matching.py
21
""" ============================ Robust matching using RANSAC ============================ In this simplified example we first generate two synthetic images as if they were taken from different view points. In the next step we find interest points in both images and find correspondences based on a weighted sum of squ...
pgmillon/ansible
refs/heads/devel
test/units/parsing/test_splitter.py
117
# coding: utf-8 # (c) 2015, Toshio Kuratomi <[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 o...
BobCromwell/gyp
refs/heads/master
test/win/gyptest-link-update-manifest.py
226
#!/usr/bin/env python # Copyright (c) 2013 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. """ Make sure binary is relinked when manifest settings are changed. """ import TestGyp import os import sys if sys.platform == 'win32': ...
cristianveron/HACKERS-ADDONS
refs/heads/master
pyaes.py
189
"""Simple AES cipher implementation in pure Python following PEP-272 API Homepage: https://bitbucket.org/intgr/pyaes/ The goal of this module is to be as fast as reasonable in Python while still being Pythonic and readable/understandable. It is licensed under the permissive MIT license. Hopefully the code is readabl...
rodorad/spark-tk
refs/heads/master
integration-tests/tests/test_random_forest_classifier.py
3
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # #       http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
MiltosD/CEFELRC
refs/heads/master
lib/python2.7/site-packages/django/contrib/messages/models.py
634
# Models module required so tests are discovered.
100Shapes/wagtail
refs/heads/master
wagtail/contrib/wagtailstyleguide/views.py
5
from django import forms from django.shortcuts import render from django.utils.translation import ugettext as _ from django.contrib import messages from django.contrib.auth.decorators import permission_required from wagtail.wagtailadmin.forms import SearchForm CHOICES = ( ('choice1', 'choice 1'), ('choice2',...
anhstudios/swganh
refs/heads/develop
data/scripts/templates/object/draft_schematic/structure/shared_installation_mining_organic_creature.py
2
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Intangible() result.template = "object/draft_schematic/structure/shared_installation_mining_organic_creature.iff" ...
dreki/GitSavvy
refs/heads/master
git_savvy.py
4
import sys import sublime if sys.version_info[0] == 2: raise ImportWarning("GitSavvy does not support Sublime Text 2.") else: def plugin_loaded(): from .common import util util.file.determine_syntax_files() # Ensure all interfaces are ready. sublime.set_timeout_async( ...
lucidmotifs/auto-aoc
refs/heads/master
.venv/lib/python3.5/site-packages/pylint/test/functional/bad_indentation.py
12
# pylint: disable=missing-docstring, pointless-statement from __future__ import print_function def totoo(): print('malindented') # [bad-indentation] def tutuu(): print('good indentation') def titii(): 1 # and this. # [bad-indentation] def tataa(kdict): for key in ['1', '2', '3']: key = key.l...
chrisdickinson/nojs
refs/heads/master
build/android/play_services/update.py
1
#!/usr/bin/env python # Copyright 2015 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. ''' Script to help uploading and downloading the Google Play services library to and from a Google Cloud storage. ''' import argparse ...
simontakite/sysadmin
refs/heads/master
pythonscripts/learningPython/Gui/Tools/big_gui.py
2
""" GUI demo implementation - combines maker, mixin, and this """ import sys, os from tkinter import * # widget classes from PP4E.Gui.Tools.guimixin import * # mix-in methods: quit, spawn, etc. from PP4E.Gui.Tools.guimaker import * # frame, plus menu/toolbar builder class...
xxd3vin/spp-sdk
refs/heads/master
opt/Python27/Lib/test/test_posixpath.py
36
import unittest from test import test_support, test_genericpath import posixpath, os from posixpath import realpath, abspath, dirname, basename # An absolute path to a temporary filename for testing. We can't rely on TESTFN # being an absolute path, so we need this. ABSTFN = abspath(test_support.TESTFN) def safe_rm...
fast90/youtube-dl
refs/heads/master
youtube_dl/extractor/gazeta.py
23
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor class GazetaIE(InfoExtractor): _VALID_URL = r'(?P<url>https?://(?:www\.)?gazeta\.ru/(?:[^/]+/)?video/(?:main/)*(?:\d{4}/\d{2}/\d{2}/)?(?P<id>[A-Za-z0-9-_.]+)\.s?html)' _TESTS = [{ 'url': 'http://www.g...
BaichuanWu/Blog_on_django
refs/heads/master
site-packages/wheel/__main__.py
565
""" Wheel command line tool (enable python -m wheel syntax) """ import sys def main(): # needed for console script if __package__ == '': # To be able to run 'python wheel-0.9.whl/wheel': import os.path path = os.path.dirname(os.path.dirname(__file__)) sys.path[0:0] = [path] imp...
NullNoname/dolphin
refs/heads/master
Externals/scons-local/scons-local-2.0.1/SCons/SConf.py
61
"""SCons.SConf Autoconf-like configuration support. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal i...
napalm-automation/napalm-logs
refs/heads/develop
tests/test_base.py
1
# -*- coding: utf-8 -*- ''' Test the napalm-logs base class. ''' from __future__ import absolute_import from __future__ import unicode_literals
VaneCloud/horizon
refs/heads/stable/kilo
openstack_dashboard/test/test_data/ceilometer_data.py
56
# Copyright 2012 Canonical Ltd. # # 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...
Trois-Six/ansible-modules-core
refs/heads/devel
cloud/rackspace/rax_cbs_attachments.py
157
#!/usr/bin/python # 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) any later version. # # Ansible is distributed...
AleksNeStu/ggrc-core
refs/heads/release/0.10-Raspberry
src/ggrc_basic_permissions/roles/ProgramOwner.py
7
# Copyright (C) 2017 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> scope = "Private Program" description = """ User with authorization to peform administrative tasks such as associating users to roles within the scope of of a program.<br/><br/>When a person creates a ...
NickShaffner/rhea
refs/heads/master
rhea/cores/usbext/__init__.py
2
from __future__ import absolute_import from .fpgalink import fpgalink from .fpgalink import fpgalink_fx2 #from usbp import m_usbp
tomhughes/mapnik
refs/heads/master
scons/scons-local-4.1.0/SCons/Tool/install.py
2
"""SCons.Tool.install Tool-specific initialization for the install tool. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # __COPYRIGHT__ # # Permission is hereby granted, free of charge, to any person obtai...
mdj2/django
refs/heads/master
django/contrib/gis/maps/google/zoom.py
224
from django.contrib.gis.geos import GEOSGeometry, LinearRing, Polygon, Point from django.contrib.gis.maps.google.gmap import GoogleMapException from django.utils.six.moves import xrange from math import pi, sin, log, exp, atan # Constants used for degree to radian conversion, and vice-versa. DTOR = pi / 180. RTOD = 18...
crs4/hl7apy
refs/heads/develop
hl7apy/v2_5/messages.py
1
from .groups import GROUPS from .segments import SEGMENTS MESSAGES = { 'ACK': ('sequence', (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), ('MSA', SEGMENTS['MSA'], (1, 1), 'SEG'), ('ERR', SEGMENTS['ERR'], (0, -1), 'SEG'),)), ...
Knoema/knoema-python-driver
refs/heads/master
knoema/api_config.py
1
"""This module contains Api configuration class""" import os class ApiConfig(object): """ This class configures knoema api. The class contains fields: host -- the host where kneoma is going to connect app_id -- application id that will have access to knoema. Application should ...
danielharbor/openerp
refs/heads/master
addons/account_payment/account_move_line.py
73
# -*- 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...
surdy/dcos
refs/heads/master
packages/dcos-integration-test/extra/test_composition.py
1
import json import logging import os import platform import subprocess import dns.exception import dns.resolver import kazoo.client import pytest import requests from test_helpers import expanded_config __maintainer__ = 'mnaboka' __contact__ = '[email protected]' @pytest.mark.first @pytest.mark.suppor...
JanOosting/ed-questionnaire
refs/heads/master
questionnaire/page/models.py
1
from django.db import models from django.core.urlresolvers import reverse class Page(models.Model): slug = models.SlugField(unique=True, primary_key=True) title = models.CharField(u"Title", max_length=256) body = models.TextField(u"Body") public = models.BooleanField(default=True) def __unicode__...
berendkleinhaneveld/VTK
refs/heads/master
Examples/GUI/Python/OrthogonalPlanesWithTkPhoto.py
9
import vtk from vtk import * import Tkinter from Tkinter import * import sys, os import vtk.tk import vtk.tk.vtkLoadPythonTkWidgets import vtk.tk.vtkTkImageViewerWidget from vtk.tk.vtkTkPhotoImage import * from vtk.util.misc import * class SampleViewer: def __init__ ( self ): self.Tk = Tk = Tkinter.Tk(); ...
powerjg/gem5-ci-test
refs/heads/master
src/arch/x86/isa/insts/simd128/floating_point/data_conversion/convert_floating_point_to_floating_point.py
90
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
pybrain2/pybrain2
refs/heads/master
pybrain/tools/shortcuts.py
25
__author__ = 'Tom Schaul and Thomas Rueckstiess' from itertools import chain import logging from sys import exit as errorexit from pybrain.structure.networks.feedforward import FeedForwardNetwork from pybrain.structure.networks.recurrent import RecurrentNetwork from pybrain.structure.modules import BiasUnit, SigmoidL...
ingenioustechie/zamboni
refs/heads/master
mkt/files/helpers.py
6
import codecs import json import mimetypes import os import time from collections import OrderedDict from django.conf import settings from django.core.urlresolvers import reverse from django.template.defaultfilters import filesizeformat from django.utils.encoding import smart_unicode import commonware.log import jinj...
orekyuu/intellij-community
refs/heads/master
python/testData/quickFixes/PyMoveAttributeToInitQuickFixTest/addSuperCall_after.py
79
__author__ = 'ktisha' class Base(object): def __init__(self): self.param = 2 class Child(Base): def __init__(self): super(Child, self).__init__() self.my = 2 def f(self): pass
sharad/calibre
refs/heads/master
src/chardet/charsetprober.py
216
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All ...
Kreiswolke/gensim
refs/heads/develop
gensim/summarization/graph.py
65
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html from abc import ABCMeta, abstractmethod class IGraph(object): """ Represents the interface or contract that the graph for TextRank should implement. """ __metaclass__ = ABCMeta ...
otherness-space/myProject
refs/heads/master
my_project_001/lib/python2.7/site-packages/django/core/mail/backends/console.py
137
""" Email backend that writes messages to console instead of sending them. """ import sys import threading from django.core.mail.backends.base import BaseEmailBackend class EmailBackend(BaseEmailBackend): def __init__(self, *args, **kwargs): self.stream = kwargs.pop('stream', sys.stdout) self._loc...
anton-golubkov/Garland
refs/heads/master
src/ipf/ipfblock/connection.py
1
#------------------------------------------------------------------------------- # Copyright (c) 2011 Anton Golubkov. # All rights reserved. This program and the accompanying materials # are made available under the terms of the GNU Lesser Public License v2.1 # which accompanies this distribution, and is available at #...
faun/django_test
refs/heads/master
django/shortcuts/__init__.py
81
""" This module collects helper functions and classes that "span" multiple levels of MVC. In other words, these functions/classes introduce controlled coupling for convenience's sake. """ from django.template import loader from django.http import HttpResponse, Http404 from django.http import HttpResponseRedirect, Http...
dinhkhanh/trac
refs/heads/master
trac/tests/resource.py
6
# -*- coding: utf-8 -*- # # Copyright (C) 2007-2009 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://trac.edgewall.org/wiki/TracLicense. # # This software consi...
sw-irou/flasktest
refs/heads/master
lib/setuptools/command/install_lib.py
454
from distutils.command.install_lib import install_lib as _install_lib import os class install_lib(_install_lib): """Don't add compiled flags to filenames of non-Python files""" def _bytecode_filenames (self, py_filenames): bytecode_files = [] for py_file in py_filenames: if not py_...
cloudera/hue
refs/heads/master
desktop/core/ext-py/SQLAlchemy-1.3.17/examples/dogpile_caching/advanced.py
4
"""Illustrate usage of Query combined with the FromCache option, including front-end loading, cache invalidation and collection caching. """ from .caching_query import FromCache from .caching_query import RelationshipCache from .environment import Session from .model import cache_address_bits from .model import Perso...
fighterCui/L4ReFiascoOC
refs/heads/master
l4/pkg/python/contrib/Lib/test/test_cmd.py
56
#!/usr/bin/env python """ Test script for the 'cmd' module Original by Michael Schneider """ import cmd import sys class samplecmdclass(cmd.Cmd): """ Instance the sampleclass: >>> mycmd = samplecmdclass() Test for the function parseline(): >>> mycmd.parseline("") (None, None, '') >>> myc...
pedrotari7/euro
refs/heads/master
players.py
1
import requests,os import urllib from bs4 import BeautifulSoup as BS main = 'https://en.wikipedia.org' link = main + '/wiki/UEFA_Euro_2016_squads' r = requests.get(link) s = BS(r.text,'lxml') tables = s.findAll(attrs={"class":"sortable"}) teams_name = [t.text for t in s.findAll(attrs={"class":"mw-headline"}) ...
m11s/MissionPlanner
refs/heads/master
Lib/ctypes/_endian.py
51
###################################################################### # This file should be kept compatible with Python 2.3, see PEP 291. # ###################################################################### import sys from ctypes import * _array_type = type(c_int * 3) def _other_endian(typ): """Ret...
isaacyeaton/pyadisi
refs/heads/develop
pyadisi/pyqtgraph/multiprocess/remoteproxy.py
4
import os, time, sys, traceback, weakref import numpy as np try: import __builtin__ as builtins import cPickle as pickle except ImportError: import builtins import pickle # color printing for debugging from ..util import cprint class ClosedError(Exception): """Raised when an event handler receives...
leb2dg/osf.io
refs/heads/develop
api_tests/base/test_utils.py
6
# -*- coding: utf-8 -*- from nose.tools import * # flake8: noqa import mock # noqa import unittest from rest_framework import fields from rest_framework.exceptions import ValidationError from api.base import utils as api_utils from framework.status import push_status_message class TestTruthyFalsy: """Check th...
dcondrey/scrapy-spiders
refs/heads/master
mandy/mandy/items.py
1
# Define here the models for your scraped items # # See documentation in: # http://doc.scrapy.org/en/latest/topics/items.html from scrapy.item import Item, Field class MandyItem(Item): # define the fields for your item here like: # name = Field() pass
misterhat/youtube-dl
refs/heads/master
youtube_dl/utils.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import base64 import binascii import calendar import codecs import contextlib import ctypes import datetime import email.utils import errno import functools import gzip import io import itertools import json import locale import mat...
j-carpentier/nova
refs/heads/master
nova/tests/functional/api_sample_tests/test_extended_availability_zone.py
21
# 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...
d0ugal/django-rest-framework
refs/heads/master
tests/test_serializer.py
5
# coding: utf-8 from __future__ import unicode_literals from .utils import MockObject from rest_framework import serializers from rest_framework.compat import unicode_repr import pickle import pytest # Tests for core functionality. # ----------------------------- class TestSerializer: def setup(self): cl...
sbalde/edxplatform
refs/heads/master
lms/djangoapps/shoppingcart/tests/test_payment_fake.py
147
""" Tests for the fake payment page used in acceptance tests. """ from django.test import TestCase from shoppingcart.processors.CyberSource2 import sign, verify_signatures from shoppingcart.processors.exceptions import CCProcessorSignatureException from shoppingcart.tests.payment_fake import PaymentFakeView from colle...
davidenitti/ML
refs/heads/master
autoencoders/input_data.py
165
# 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...
maciekcc/gemmlowp
refs/heads/master
meta/generators/transform_kernels_common.py
7
# Copyright 2016 The Gemmlowp 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 applicable...
doismellburning/edx-platform
refs/heads/master
lms/djangoapps/discussion_api/api.py
5
""" Discussion API internal interface """ from collections import defaultdict from urllib import urlencode from urlparse import urlunparse from django.core.exceptions import ValidationError from django.core.urlresolvers import reverse from django.http import Http404 from rest_framework.exceptions import PermissionDen...
brstew/MBED-BUILD
refs/heads/master
Jinja2-2.8/examples/profile.py
75
try: from cProfile import Profile except ImportError: from profile import Profile from pstats import Stats from jinja2 import Environment as JinjaEnvironment context = { 'page_title': 'mitsuhiko\'s benchmark', 'table': [dict(a=1,b=2,c=3,d=4,e=5,f=6,g=7,h=8,i=9,j=10) for x in range(1000)] } source = ""...
xin3liang/platform_external_chromium_org_third_party_skia
refs/heads/master
platform_tools/android/tests/makefile_writer_tests.py
65
#!/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. """ Test makefile_writer.py """ import argparse import os import shutil import sys import tempfile import test_variables import unittest import utils sys.path.append...
pgmillon/ansible
refs/heads/devel
lib/ansible/modules/network/slxos/slxos_interface.py
91
#!/usr/bin/python # # (c) 2018 Extreme Networks Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any late...
RossBrunton/django
refs/heads/master
tests/backends/tests.py
77
# -*- coding: utf-8 -*- # Unit and doctests for specific database backends. from __future__ import unicode_literals import copy import datetime import re import threading import unittest import warnings from decimal import Decimal, Rounded from django.conf import settings from django.core.exceptions import Improperly...
mthornhill/django-tastypie
refs/heads/master
tests/manage_core.py
20
#!/usr/bin/env python import os, sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings_core") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
rs2/bokeh
refs/heads/master
examples/app/sliders.py
7
''' Present an interactive function explorer with slider widgets. Scrub the sliders to change the properties of the ``sin`` curve, or type into the title text box to update the title of the plot. Use the ``bokeh serve`` command to run the example by executing: bokeh serve sliders.py at your command prompt. Then...
esuncloud/p2pool
refs/heads/master
wstools/__init__.py
293
#! /usr/bin/env python """WSDL parsing services package for Web Services for Python.""" ident = "$Id$" import WSDLTools import XMLname import logging
devs4v/devs4v-information-retrieval15
refs/heads/master
project/venv/lib/python2.7/site-packages/django/contrib/auth/migrations/0002_alter_permission_name_max_length.py
586
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('auth', '0001_initial'), ] operations = [ migrations.AlterField( model_name='permission', name='name'...
jlombacher/pyqtgraph
refs/heads/develop
examples/CustomGraphItem.py
24
# -*- coding: utf-8 -*- """ Simple example of subclassing GraphItem. """ import initExample ## Add path to library (just for examples; you do not need this) import pyqtgraph as pg from pyqtgraph.Qt import QtCore, QtGui import numpy as np # Enable antialiasing for prettier plots pg.setConfigOptions(antialias=True) w...
beardypig/streamlink
refs/heads/master
tests/plugins/test_reuters.py
2
import unittest from streamlink.plugins.reuters import Reuters class TestPluginReuters(unittest.TestCase): def test_can_handle_url(self): should_match = [ 'https://uk.reuters.com/video/watch/east-africa-battles-locust-invasion-idOVC2J9BHJ?chan=92jv7sln', 'https://www.reuters.com/l...