repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
shelbycruver/real-python-test
refs/heads/master
env/lib/python2.7/site-packages/pip/_vendor/html5lib/filters/optionaltags.py
1727
from __future__ import absolute_import, division, unicode_literals from . import _base class Filter(_base.Filter): def slider(self): previous1 = previous2 = None for token in self.source: if previous1 is not None: yield previous2, previous1, token previous2...
hgomes88/ardupilot
refs/heads/master
Tools/autotest/apm_unit_tests/dev/arducopter_RTL.py
250
import arducopter def unit_test(mavproxy, mav): '''A scripted flight plan''' if ( arducopter.calibrate_level(mavproxy, mav) and arducopter.arm_motors(mavproxy, mav) and arducopter.takeoff(mavproxy,mav, alt_min=80, takeoff_throttle=1510) and arducopter.hover(mavproxy,mav, hove...
gerv/bedrock
refs/heads/master
bedrock/security/urls.py
5
# 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/. from django.conf.urls import url from bedrock.mozorg.util import page from bedrock.security.views import ( Advisori...
gustavofonseca/packtools
refs/heads/master
tests/test_schematron_1_9.py
2
# coding: utf-8 from __future__ import unicode_literals import unittest import io from lxml import isoschematron, etree from packtools.catalogs import SCHEMAS SCH = etree.parse(SCHEMAS['sps-1.9']) def TestPhase(phase_name, cache): """Factory of parsed Schematron phases. :param phase_name: the phase name ...
kchodorow/tensorflow
refs/heads/master
tensorflow/contrib/factorization/python/__init__.py
182
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
valkyriesavage/gasustainability
refs/heads/master
django/contrib/localflavor/pl/forms.py
273
""" Polish-specific form helpers """ import re from django.forms import ValidationError from django.forms.fields import Select, RegexField from django.utils.translation import ugettext_lazy as _ from django.core.validators import EMPTY_VALUES class PLProvinceSelect(Select): """ A select widget with list of P...
BFriedland/UserDataBase-Heroku
refs/heads/master
venv/Lib/site-packages/pip/_vendor/html5lib/treewalkers/genshistream.py
1730
from __future__ import absolute_import, division, unicode_literals from genshi.core import QName from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT from . import _base from ..constants import voidElements, namespaces class ...
h4ck3rm1k3/pip
refs/heads/develop
pip/_vendor/__init__.py
252
""" pip._vendor is for vendoring dependencies of pip to prevent needing pip to depend on something external. Files inside of pip._vendor should be considered immutable and should only be updated to versions from upstream. """ from __future__ import absolute_import import glob import os.path import sys # Downstream r...
jonathanf/portalfacturas-e
refs/heads/master
portalfacturas/__init__.py
1
# # Copyright (C) 2015 Jonathan Finlay <jfinlay@riseup.net> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later...
rogallic/learnen.ru
refs/heads/master
parsDict/concatJSONs.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- from os import listdir from os.path import isfile, join with open('concatedDict-en.json', 'w') as w: w.write('{\n') counter = 0 dn = 'tmpThreads' pref = 'parsWiki-1416645459-en'; for fn in listdir(dn): if fn[0:len(pref)] == pref: if counter: w.write(',') ...
alanjw/GreenOpenERP-Win-X86
refs/heads/7.0
python/Lib/site-packages/win32/test/test_win32guistruct.py
4
import unittest import win32gui import win32gui_struct import win32con import array import pythoncom class TestBase(unittest.TestCase): def assertDictEquals(self, d, **kw): checked = dict() for n, v in kw.iteritems(): self.failUnlessEqual(v, d[n], ...
fragaria/suds
refs/heads/master
suds/xsd/__init__.py
206
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) 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. # # This program is distributed in the hope that it will ...
eonpatapon/nova
refs/heads/master
nova/api/openstack/compute/schemas/v3/cells.py
70
# Copyright 2014 NEC Corporation. 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 ...
KokareIITP/django
refs/heads/master
tests/null_fk_ordering/models.py
210
""" Regression tests for proper working of ForeignKey(null=True). Tests these bugs: * #7512: including a nullable foreign key reference in Meta ordering has un xpected results """ from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible ...
androbwebb/JenniferVirtualAssistant
refs/heads/master
quick_run.py
1
#!/usr/bin/env python from server.brain import JenniferBrain from ioclients.terminal import JenniferTerminalClient from ioclients.terminal_with_sound import JenniferTerminalWithSoundClient brain = JenniferBrain(allow_network_plugins=True) client = JenniferTerminalWithSoundClient(brain) client.run() """ $: dollar ...
StuartChaffe/responsive-table
refs/heads/master
node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py
1812
# 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. """Utility functions shared amongst the Windows generators.""" import copy import os # A dictionary mapping supported target types to extensions. TARGET_TYPE_EX...
titasakgm/brc-stock
refs/heads/master
openerp/addons/account/wizard/account_journal_select.py
56
# -*- 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...
Jaiz909/youtube-dl
refs/heads/master
youtube_dl/extractor/youku.py
36
# coding: utf-8 from __future__ import unicode_literals import math import random import re import time from .common import InfoExtractor from ..utils import ( ExtractorError, ) class YoukuIE(InfoExtractor): _VALID_URL = r'''(?x) (?: http://(?:v|player)\.youku\.com/(?:v_show/id_|player\...
CptLemming/paramiko
refs/heads/master
demos/demo_sftp.py
32
#!/usr/bin/env python # Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko 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 2....
VisionSystemsInc/voxel_globe
refs/heads/master
voxel_globe/tools/__init__.py
2
from .voxel_dir import task_dir, storage_dir, image_dir, image_sha_dir, get_image_sha_dir, log_dir
SGCreations/Flask
refs/heads/master
Work/Trivia - Module 5/env/Lib/site-packages/flask/testsuite/deprecations.py
563
# -*- coding: utf-8 -*- """ flask.testsuite.deprecations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests deprecation support. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import flask import unittest from flask.testsuite import FlaskTestCase, catch_warnings class ...
solashirai/edx-platform
refs/heads/master
lms/djangoapps/courseware/tests/test_tabs.py
6
""" Test cases for tabs. """ from django.conf import settings from django.core.urlresolvers import reverse from django.http import Http404 from mock import MagicMock, Mock, patch from nose.plugins.attrib import attr from opaque_keys.edx.locations import SlashSeparatedCourseKey from courseware.courses import get_cours...
sauloal/pycluster
refs/heads/master
pypy-1.9_64/lib-python/2.7/plat-mac/Carbon/Resources.py
81
# Generated from 'Resources.h' resSysHeap = 64 resPurgeable = 32 resLocked = 16 resProtected = 8 resPreload = 4 resChanged = 2 mapReadOnly = 128 mapCompact = 64 mapChanged = 32 resSysRefBit = 7 resSysHeapBit = 6 resPurgeableBit = 5 resLockedBit = 4 resProtectedBit = 3 resPreloadBit = 2 resChangedBit = 1 mapReadOnlyBit...
chintal/tendril-sofficehelpers
refs/heads/master
sofficehelpers/ooutils.py
1
# LibreOffice utils. # # Based on code from: # PyODConverter (Python OpenDocument Converter) v1.0.0 - 2008-05-05 # Copyright (C) 2008 Mirko Nasato <mirko@artofsolving.com> # Licensed under the GNU LGPL v2.1 - or any later version. # http://www.gnu.org/licenses/lgpl-2.1.html # import sys import os import time i...
CodeDJ/qt5-hidpi
refs/heads/master
qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/reftests/__init__.py
6014
# Required for Python to search this directory for module files
shaheemirza/pupy
refs/heads/master
pupy/genpayload.py
18
#!/usr/bin/env python # -*- coding: UTF8 -*- # --------------------------------------------------------------- # Copyright (c) 2015, Nicolas VERDIER (contact@n1nj4.eu) # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following c...
romain-dartigues/ansible
refs/heads/devel
lib/ansible/modules/network/vyos/vyos_vlan.py
13
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
DazWorrall/ansible
refs/heads/devel
lib/ansible/modules/network/cloudengine/ce_eth_trunk.py
27
#!/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 distribut...
byronmccollum/rpc-openstack
refs/heads/master
maas/plugins/service_api_local_check.py
11
#!/usr/bin/env python # Copyright 2014, Rackspace US, 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 applicabl...
gdi2290/django
refs/heads/master
tests/proxy_model_inheritance/app1/models.py
515
# TODO: why can't I make this ..app2 from app2.models import NiceModel class ProxyModel(NiceModel): class Meta: proxy = True
storm-computers/odoo
refs/heads/9.0
openerp/addons/test_limits/__init__.py
2355
# -*- coding: utf-8 -*- import models
nightjean/Deep-Learning
refs/heads/master
tensorflow/python/ops/lookup_ops.py
15
# 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...
azureplus/hue
refs/heads/master
apps/proxy/src/proxy/urls.py
33
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
BorisJeremic/Real-ESSI-Examples
refs/heads/master
analytic_solution/test_cases/Contact/Dynamic_Shear_Behaviour/Frictional_SDOF_With_Damping/c_t_1/NonLinHardSoftShear/compare_txt.py
637
#!/usr/bin/python import h5py import sys import numpy as np import os import re import random # find the path to my own python function: cur_dir=os.getcwd() sep='test_cases' test_DIR=cur_dir.split(sep,1)[0] scriptDIR=test_DIR+'compare_function' sys.path.append(scriptDIR) # import my own function for color and comparat...
khagler/boto
refs/heads/develop
scripts/rebuild_endpoints.py
79
import json from pyquery import PyQuery as pq import requests class FetchError(Exception): pass def fetch_endpoints(): # We utilize what the Java SDK publishes as a baseline. resp = requests.get('https://raw2.github.com/aws/aws-sdk-java/master/src/main/resources/etc/regions.xml') if int(resp.status...
raildo/nova
refs/heads/master
nova/api/openstack/compute/deferred_delete.py
26
# Copyright 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
marcel-dancak/QGIS
refs/heads/master
python/plugins/processing/algs/grass7/ext/i_albedo.py
4
# -*- coding: utf-8 -*- """ *************************************************************************** i_albedo.py ----------- Date : February 2016 Copyright : (C) 2016 by Médéric Ribreux Email : medspx at medspx dot fr ************************************...
procrasti/electrum
refs/heads/master
plugins/greenaddress_instant/__init__.py
24
from electrum.i18n import _ fullname = 'GreenAddress instant' description = _("Allows validating if your transactions have instant confirmations by GreenAddress") available_for = ['qt']
cristiana214/cristianachavez214-cristianachavez
refs/heads/master
python/src/Lib/encodings/cp850.py
593
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP850.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): ...
mancoast/CPythonPyc_test
refs/heads/master
cpython/200_regex_tests.py
12
# Regex test suite and benchmark suite v1.5a2 # Due to the use of r"aw" strings, this file will # only work with Python 1.5 or higher. # The 3 possible outcomes for each pattern [SUCCEED, FAIL, SYNTAX_ERROR] = range(3) # Benchmark suite (needs expansion) # # The benchmark suite does not test correctness, just speed...
debasishm89/OpenXMolar
refs/heads/master
ExtDepLibs/autoit/autoit.py
1
# -*- coding: utf-8 -*- __author__ = 'Jace Xu' import ctypes import os import platform from ctypes.wintypes import * from functools import wraps dll = "AutoItX3.dll" bit, _ = platform.architecture() if "(x86)" in os.environ['PROGRAMFILES'] and bit == "64bit": # if 64bit version of python within 64bit version of...
robovm/robovm-studio
refs/heads/master
python/testData/refactoring/changeSignature/addPositionalParam.before.py
415
def bar(a, b): pass bar(1, 2)
simongoffin/my_odoo_tutorial
refs/heads/master
addons/mass_mailing/wizard/mail_compose_message.py
33
# -*- coding: utf-8 -*- from openerp.osv import osv, fields class MailComposeMessage(osv.TransientModel): """Add concept of mass mailing campaign to the mail.compose.message wizard """ _inherit = 'mail.compose.message' _columns = { 'mass_mailing_campaign_id': fields.many2one( 'ma...
lhidalgo42/DTSA
refs/heads/master
Libreria/Python/tests/test_ieee.py
5
#! /usr/bin/python """ test_ieee.py By Paul Malmsten, 2010 pmalmsten@gmail.com Tests the XBee (IEEE 802.15.4) implementation class for XBee API compliance """ import unittest, sys, traceback from xbee.tests.Fake import FakeDevice, FakeReadDevice from xbee.ieee import XBee from xbee.python2to3 import byteToInt, intToB...
aileron/dokku
refs/heads/master
tests/apps/python-flask/hello.py
236
import os from flask import Flask app = Flask(__name__) @app.route('/') def hello(): return 'python/flask'
Walt280/cosmos
refs/heads/master
code/graph-algorithms/hamiltonian_cycle/hamiltonian_cycle.py
3
# Part of Cosmos by OpenGenus Foundation # Python program for solution of # hamiltonian cycle problem class Graph(): def __init__(self, vertices): self.graph = [[0 for column in range(vertices)]\ for row in range(vertices)] self.V = vertices ''' Check if this ve...
yawnosnorous/python-for-android
refs/heads/master
python3-alpha/extra_modules/pyxmpp2/expdict.py
46
# # (C) Copyright 2003-2011 Jacek Konieczny <jajcus@jajcus.net> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License Version # 2.1 as published by the Free Software Foundation. # # This program is distributed in the hope that it will be u...
jimga150/HealthNet
refs/heads/master
HealthNet/core/urls.py
1
from django.conf.urls import url from django.core.urlresolvers import reverse_lazy from . import views urlpatterns = [ url(r'^register/', views.register_patient_page, name='register'), url(r'^patient/', views.patient_landing, name='patient'), url(r'^patients/', views.view_patients, name='view patients'), ...
ieuan1630-cmis/ieuan1630-cmis-cs2
refs/heads/master
functions2.py
1
#import: from math import pi from math import sqrt import str_manip #define functions: #basic maths functions def add(x, y): #takes two variables and adds their values return x + y def sub(x, y): #takes two variables and subtracts the second from the first value return x - y def mul(x, y): #takes two var...
Immortalin/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/lib2to3/tests/data/py2_test_grammar.py
285
# Python test set -- part 1, grammar. # This just tests whether the parser accepts them all. # NOTE: When you run this test as a script from the command line, you # get warnings about certain hex/oct constants. Since those are # issued by the parser, you can't suppress them by adding a # filterwarnings() call to this...
keithlee/shakeAppPyDev
refs/heads/master
djangoappengine/db/base.py
48
from ..boot import DATA_ROOT from ..utils import appid, on_production_server from .creation import DatabaseCreation from .stubs import stub_manager from django.db.backends.util import format_number from djangotoolbox.db.base import NonrelDatabaseFeatures, \ NonrelDatabaseOperations, NonrelDatabaseWrapper, NonrelDat...
merc-devel/merc
refs/heads/master
merc/features/rfc1459/lusers.py
1
from merc import feature from merc import message class LUsersFeature(feature.Feature): NAME = __name__ install = LUsersFeature.install class LUserUnknown(message.Reply): NAME = "253" FORCE_TRAILING = True MIN_ARITY = 2 def __init__(self, num_unknown, reason="unknown connections", *args): self.num_...
yencarnacion/jaikuengine
refs/heads/master
.google_appengine/lib/django-1.3/tests/regressiontests/defer_regress/tests.py
53
from operator import attrgetter from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.contrib.sessions.backends.db import SessionStore from django.db import connection from django.db.models.loading import cache from django.test import TestCase from models import Resol...
aequitas/home-assistant
refs/heads/dev
homeassistant/components/rainmachine/__init__.py
2
"""Support for RainMachine devices.""" import asyncio import logging from datetime import timedelta import voluptuous as vol from homeassistant.config_entries import SOURCE_IMPORT from homeassistant.const import ( ATTR_ATTRIBUTION, CONF_BINARY_SENSORS, CONF_IP_ADDRESS, CONF_PASSWORD, CONF_PORT, CONF_SCAN_INTE...
sharph/lifx-python
refs/heads/master
lights_on.py
1
#!/usr/bin/env python3 import lifx lifx.set_power(lifx.BCAST, True)
subramani95/neutron
refs/heads/master
neutron/tests/unit/test_post_mortem_debug.py
3
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Red Hat, 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/LICE...
tectronics/marioai
refs/heads/master
src/amico/python/agents/forwardjumpingagent.py
21
# -*- coding: utf-8 -*- __author__ = "Sergey Karakovskiy, sergey at idsia fullstop ch" __date__ = "$August 26, 2010 1:33:34 PM$" from marioagent import MarioAgent class ForwardJumpingAgent(MarioAgent): """ In fact the Python twin of the corresponding Java ForwardJumpingAgent. """ action = None ...
JTarball/docker-django-polymer-starter-kit
refs/heads/master
docker/app/app/backend/apps/_archive/blog_old__/urls.py
8
""" URLconf for 'blog' application """ from django.conf.urls import patterns, url from .views import PostListView, PostUserListView, PostYearListView, PostCategoryListView, PostDetailView urlpatterns = patterns('', url(r'^$', PostListView.as_view(), name="list"), url(r'^user/(?P<username>[\w-]+)/', PostUserL...
jollyroger/debian-buildbot
refs/heads/master
buildbot/monkeypatches/bug4520.py
3
# coding=utf-8 # This file is part of Buildbot. Buildbot is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRAN...
Lokke/eden
refs/heads/master
modules/tests/core/core_dataTable.py
26
# -*- coding: utf-8 -*- __all__ = ["dt_filter", "dt_row_cnt", "dt_data", "dt_data_item", "dt_find", "dt_links", "dt_action", ] # @ToDo: There are performance issues # - need to profile and find out in which functions are the bottlenec...
anthonydillon/horizon
refs/heads/master
openstack_dashboard/dashboards/project/loadbalancers/tabs.py
30
# Copyright 2013, Big Switch 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 required by applic...
Javiercerna/MissionPlanner
refs/heads/master
Lib/site-packages/scipy/fftpack/_fftpack.py
53
import sys if sys.platform == 'cli': import clr clr.AddReference("_fftpack") from scipy__fftpack___fftpack import *
KrzysztofStachanczyk/Sensors-WWW-website
refs/heads/master
www/env/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/constants.py
3007
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
salguarnieri/intellij-community
refs/heads/master
python/testData/refactoring/extractsuperclass/importNotBroken.before.py
80
from shared import SharedClass class Source(SharedClass): pass
IshankGulati/scikit-learn
refs/heads/master
sklearn/neighbors/tests/test_kde.py
26
import numpy as np from sklearn.utils.testing import (assert_allclose, assert_raises, assert_equal) from sklearn.neighbors import KernelDensity, KDTree, NearestNeighbors from sklearn.neighbors.ball_tree import kernel_norm from sklearn.pipeline import make_pipeline from sklearn.dataset...
capravictoriae/Space-Mission-Design-and-Operations-EE585x-MOOC-Python-
refs/heads/master
Unit2/P2.1_A.py
1
iss_orbit_apogee = 417 * 1000 # Km to m iss_orbit_perigee = 401 * 1000 # Km to m earth_mu = 3.986e14 # m^3/s^-2 earth_r = 6.378e6 # m dist = earth_r + iss_orbit_perigee grav = earth_mu / dist**2 print(grav)
reflectometry/osrefl
refs/heads/master
osrefl/viewers/view.py
1
# Copyright (C) 2008 University of Maryland # All rights reserved. # See LICENSE.txt for details. # Author: Christopher Metting #Starting Date:6/5/2009 from numpy import size,array,shape,indices, searchsorted, linspace from numpy import log, log10, abs, min, max, nonzero,isnan from .zoom_colorbar import * import sys,c...
AnotherIvan/calibre
refs/heads/master
src/calibre/ebooks/html/__init__.py
16
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' import re def tostring(root, strip_comments=False, pretty_print=False): ''' ...
wenhuizhang/swift
refs/heads/master
test/unit/common/middleware/test_tempurl.py
2
# Copyright (c) 2011-2014 Greg Holt # Copyright (c) 2012-2013 Peter Portante # Copyright (c) 2012 Iryoung Jeong # Copyright (c) 2012 Michael Barton # Copyright (c) 2013 Alex Gaynor # Copyright (c) 2013 Chuck Thier # Copyright (c) 2013 David Goetz # Copyright (c) 2015 Donagh McCabe # Copyright (c) 2013 Greg Lange # Copy...
hatwar/buyback-frappe
refs/heads/master
frappe/templates/pages/message.py
40
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import strip_html_tags no_cache = 1 no_sitemap = 1 def get_context(context): message_context = {} if hasattr(frappe.local, "message"): messa...
jc0n/scrapy
refs/heads/master
scrapy/mail.py
11
""" Mail sending helpers See documentation in docs/topics/email.rst """ import logging from six.moves import cStringIO as StringIO import six from email.utils import COMMASPACE, formatdate from six.moves.email_mime_multipart import MIMEMultipart from six.moves.email_mime_text import MIMEText from six.moves.email_mim...
meabsence/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/idlelib/textView.py
45
"""Simple text browser for IDLE """ from tkinter import * import tkinter.messagebox as tkMessageBox class TextViewer(Toplevel): """A simple text viewer dialog for IDLE """ def __init__(self, parent, title, text): """Show the given text in a scrollable window with a 'close' button """ ...
Gordon01/vanilla
refs/heads/master
update-translations.py
7
#!/usr/bin/python # Fetch the translations from http://crowdin.net/project/vanilla-music and save # them to res/ in the current directory. Removes files that contain no # translations and removes incomplete plurals (they cause crashes). # # This script does not force crowdin to rebuild the translation package. That # ...
bwall/bamfdetect
refs/heads/master
BAMF_Detect/modules/cythosia.py
1
from common import Modules, data_strings_wide, load_yara_rules, PEParseModule, ModuleMetadata class Cythosia(PEParseModule): def __init__(self): md = ModuleMetadata( module_name="cythosia", bot_name="Cythosia", description="DDoS Bot", authors=["Brian Wallace...
olexiim/edx-platform
refs/heads/master
common/lib/xmodule/xmodule/modulestore/store_utilities.py
19
import re import logging from collections import namedtuple import uuid def _prefix_only_url_replace_regex(pattern): """ Match urls in quotes pulling out the fields from pattern """ return re.compile(ur""" (?x) # flags=re.VERBOSE (?P<quote>\\?['"]) # the op...
urda/mrbutler-bot
refs/heads/master
tests/unit/mrb/test_versioning.py
1
""" Copyright 2017 Peter Urda 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 dis...
dferguso/IGT4SAR
refs/heads/master
ElevationDifferenceModel_Example.py
1
#------------------------------------------------------------------------------- # Name: ElevationDifferenceModel_Example # Purpose: This is not an actual script but examples of the calculations that # would be performed inside of the Raster Calculator to complete the Elevation # Model as described in Koester...
Lukasa/zmusic-ng
refs/heads/master
backend/zmusic/picard/util/mimetype.py
3
# -*- coding: utf-8 -*- # # Picard, the next-generation MusicBrainz tagger # Copyright (C) 2009 Philipp Wolfer # # 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...
Jessicamiejiu/a-journey-to-python-jessicamiejiu
refs/heads/master
_src/om2pyItem/scaffold/modules/__init__.py
107
# -*- coding: utf-8 -*- import sys #sys.path.append("..")
proxysh/Safejumper-for-Mac
refs/heads/master
buildmac/Resources/env/lib/python2.7/site-packages/pyasn1/compat/__init__.py
3653
# This file is necessary to make this directory a package.
shail2810/nova
refs/heads/master
nova/objects/instance_group.py
16
# Copyright (c) 2013 OpenStack Foundation # # 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 ...
acshan/odoo
refs/heads/8.0
openerp/workflow/__init__.py
378
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2014 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
unreal666/outwiker
refs/heads/master
plugins/updatenotifier/updatenotifier/updatecontroller.py
2
# -*- coding: utf-8 -*- import datetime import logging import threading import os.path import json import shutil import html import wx import outwiker.core from outwiker.gui.longprocessrunner import LongProcessRunner from outwiker.core.commands import getCurrentVersion, MessageBox, setStatusText from ...
jondong/crosswalk
refs/heads/master
app/tools/android/make_apk.py
4
#!/usr/bin/env python # Copyright (c) 2013, 2014 Intel Corporation. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # pylint: disable=F0401 import atexit import json import optparse import os import re import shutil import struct import subpro...
thobbs/cassandra-dtest
refs/heads/master
stress_tool_test.py
2
from __future__ import division from dtest import Tester from tools import rows_to_list, since @since('3.0') class TestStressSparsenessRatio(Tester): """ @jira_ticket CASSANDRA-9522 Tests for the `row-population-ratio` parameter to `cassandra-stress`. """ def uniform_ratio_test(self): "...
mahmoudhossam/Google-Python-Exercises
refs/heads/master
basic/string1.py
1
#!/usr/bin/python2 -tt # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ # Basic string exercises # Fill in the code for the functions below. main() is already s...
mfilotto/hipache
refs/heads/master
test/functional/test_simple.py
14
import base class SimpleTestCase(base.TestCase): def test_simple(self): """ Simple test: valid backend """ port = 2080 self.spawn_httpd(port) self.register_frontend('foobar', ['http://localhost:{0}'.format(port)]) self.assertEqual(self.http_request('foobar'), 200) de...
Juraci/tempest
refs/heads/master
tempest/api/volume/v2/test_volumes_list.py
8
# Copyright 2012 OpenStack Foundation # Copyright 2013 IBM Corp. # 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/LIC...
jgosmann/plume
refs/heads/master
plume/datastructure.py
1
import numpy as np class EnlargeableArray(object): def __init__(self, shape, expected_rows=20): self._data = np.empty((expected_rows,) + shape) self._num_rows = 0 data = property(lambda self: self._data[:len(self)]) def append(self, arr): if len(self) >= len(self._data): ...
robjohnson189/home-assistant
refs/heads/dev
homeassistant/components/introduction.py
27
""" Component that will help guide the user taking its first steps. For more details about this component, please refer to the documentation at https://home-assistant.io/components/introduction/ """ import logging import voluptuous as vol DOMAIN = 'introduction' CONFIG_SCHEMA = vol.Schema({ DOMAIN: vol.Schema({...
alexthered/kienhoc-platform
refs/heads/master
lms/djangoapps/teams/management/commands/reindex_course_team.py
34
""" Management command to update course_teams' search index. """ from django.core.management import BaseCommand, CommandError from django.core.exceptions import ObjectDoesNotExist from django.conf import settings from optparse import make_option from textwrap import dedent from teams.models import CourseTeam class C...
ericholscher/django-haystack
refs/heads/master
tests/whoosh_tests/tests/forms.py
10
# To ensure spelling suggestions work... from django.conf import settings from django.http import HttpRequest from haystack.forms import SearchForm from haystack.views import SearchView from whoosh_tests.tests.whoosh_backend import LiveWhooshRoundTripTestCase # Whoosh appears to flail on providing a useful suggestion...
dagnir/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/html5lib/html5lib/tests/support.py
450
from __future__ import absolute_import, division, unicode_literals import os import sys import codecs import glob import xml.sax.handler base_path = os.path.split(__file__)[0] test_dir = os.path.join(base_path, 'testdata') sys.path.insert(0, os.path.abspath(os.path.join(base_path, ...
Belxjander/Kirito
refs/heads/master
Python-3.5.0-main/Lib/idlelib/idle_test/test_autoexpand.py
20
"""Unit tests for idlelib.AutoExpand""" import unittest from test.support import requires from tkinter import Text, Tk #from idlelib.idle_test.mock_tk import Text from idlelib.AutoExpand import AutoExpand class Dummy_Editwin: # AutoExpand.__init__ only needs .text def __init__(self, text): self.text =...
Noviat/odoo
refs/heads/8.0
addons/website/models/ir_qweb.py
44
# -*- coding: utf-8 -*- """ Website-context rendering needs to add some metadata to rendered fields, as well as render a few fields differently. Also, adds methods to convert values back to openerp models. """ import cStringIO import datetime import itertools import logging import os import urllib2 import urlparse im...
lenstr/rethinkdb
refs/heads/next
external/v8_3.30.33.16/tools/testrunner/objects/testcase.py
44
# Copyright 2012 the V8 project authors. All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditi...
rajatguptarg/infro
refs/heads/master
infro/ansible/tasks.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # flake8: noqa from celery import Celery import os import crypt import json app = Celery('tasks', backend='redis://localhost', broker='redis://localhost:6379/0') KEY = 'guest' def _spawn_ec2_instance(username, password): """ Spawn a EC2 Instance using Ansible an...
leoliujie/odoo
refs/heads/8.0
addons/product/__openerp__.py
262
# -*- 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...
messense/douban2kindle
refs/heads/master
douban2kindle/utils/download.py
1
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import os import urllib2 import logging import multiprocessing from multiprocessing.pool import ThreadPool logger = logging.getLogger(__name__) def _download_image(url, save_dir): try: data = urllib2.urlopen(url).read() ...
filannim/Temporalia-TQIC
refs/heads/master
feature_extractor.py
1
#!/usr/bin/python from __future__ import division import pprint import re import sys import time import os from collections import Counter, namedtuple, defaultdict from nltk.corpus import wordnet as wn from nltk.corpus.reader import wordnet from nltk.tag import pos_tag from nltk.tokenize import word_tokenize from nl...