repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
yakky/django
refs/heads/master
tests/admin_scripts/simple_app/__init__.py
12133432
iychoi/syndicate
refs/heads/master
old/RG-python/test/closure/__init__.py
12133432
De4dc0de/deadc0debot
refs/heads/master
bot.py
1
#!/usr/bin/python import random, string, os, telepot #Usual imports try: import configfile #Just some config except: os.system("cp configfile.py.sample configfile.py") try: os.system("nano configfile.py") except: os.system("vi configfile.py") import configfile #And again try: ...
toninhofpt/my-first-blog1
refs/heads/master
myven/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/__init__.py
1730
"""A collection of modules for building different kinds of tree from HTML documents. To create a treebuilder for a new type of tree, you need to do implement several things: 1) A set of classes for various types of elements: Document, Doctype, Comment, Element. These must implement the interface of _base.treebuilders...
servo/servo
refs/heads/master
tests/wpt/web-platform-tests/html/canvas/tools/gentest.py
23
from gentestutils import genTestUtils genTestUtils('../element', '../element', 'templates.yaml', 'name2dir.yaml', False) genTestUtils('../offscreen', '../offscreen', 'templates-offscreen.yaml', 'name2dir-offscreen.yaml', True)
SEL-Columbia/commcare-hq
refs/heads/master
corehq/ex-submodules/casexml/apps/case/sharedmodels.py
2
import mimetypes from couchdbkit.ext.django.schema import StringProperty, IntegerProperty, DictProperty from dimagi.utils.mixins import UnicodeMixIn from dimagi.utils.couch import LooselyEqualDocumentSchema """ Shared models live here to avoid cyclical import issues """ class CommCareCaseIndex(LooselyEqualDocument...
jasonthomas/zamboni
refs/heads/master
mkt/feed/migrations/0001_initial.py
13
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import mkt.site.fields import mkt.constants.carriers import mkt.ratings.validators import mkt.feed.models import mkt.constants.regions class Migration(migrations.Migration): dependencies = [ ] opera...
technologiescollege/Blockly-rduino-communication
refs/heads/master
scripts_XP/Lib/site-packages/prompt_toolkit/contrib/telnet/__init__.py
28
from .server import * from .application import *
stormi/tsunami
refs/heads/master
src/secondaires/cuisine/recette.py
1
# -*-coding:Utf-8 -* # Copyright (c) 2012 NOEL-BARON Léo # 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...
Jaemu/haiku.py
refs/heads/master
lib/flask/helpers.py
776
# -*- coding: utf-8 -*- """ flask.helpers ~~~~~~~~~~~~~ Implements various helpers. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os import sys import pkgutil import posixpath import mimetypes from time import time from zlib import adler32 from th...
WebSQL/wsql
refs/heads/master
wsql/converters.py
1
""" WSQL ==== An asynchronous DB API v2.0 compatible interface to MySQL --------------------------------------------------------- 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 th...
jlnaudin/x-drone
refs/heads/master
MissionPlanner-master/Lib/wsgiref/handlers.py
109
"""Base classes for server/gateway implementations""" from types import StringType from util import FileWrapper, guess_scheme, is_hop_by_hop from headers import Headers import sys, os, time __all__ = ['BaseHandler', 'SimpleHandler', 'BaseCGIHandler', 'CGIHandler'] try: dict except NameError: def dict(items)...
lechat/jenkinsflow
refs/heads/master
test/propagation_warn_only_test.py
1
# Copyright (c) 2012 - 2015 Lars Hupfeldt Nielsen, Hupfeldt IT # All rights reserved. This work is under a BSD license, see LICENSE.TXT. from pytest import raises from jenkinsflow.flow import serial, parallel, FailedChildJobException, FailedChildJobsException, Propagation, BuildResult from .framework import api_selec...
aravindavk/glusterfs-web
refs/heads/master
src/glusterfsweb/config.py
1
# -*- coding: utf-8 -*- """ config.py :copyright: (c) 2013 by Aravinda VK :license: BSD, GPL v2, see LICENSE for more details. """ DB_PATH = "/var/lib/glusterd/nodestate/" DB_FILE = DB_PATH + "glusternodestate.db" HOOKS_ROOT = "/var/lib/glusterd/hooks/1/" DEBUG = False
saullocastro/compmech
refs/heads/master
compmech/stiffpanelbay/tests/test_stiffpanelbay.py
1
import numpy as np from compmech.stiffpanelbay import StiffPanelBay def test_freq_models(): print('Testing frequency analysis for StiffPanelBay with 2 plates') # From Table 4 of # Lee and Lee. "Vibration analysis of anisotropic plates with eccentric # stiffeners". Computers & Structures, Vol. 57, ...
p4datasystems/CarnotKE
refs/heads/master
jyhton/lib-python/2.7/distutils/text_file.py
46
"""text_file provides the TextFile class, which gives an interface to text files that (optionally) takes care of stripping comments, ignoring blank lines, and joining lines with backslashes.""" __revision__ = "$Id$" import sys class TextFile: """Provides a file-like object that takes care of all the things yo...
atiqueahmedziad/addons-server
refs/heads/master
src/olympia/amo/tests/test_cache_nuggets.py
12133432
simone-campagna/daikon
refs/heads/master
test_zirkon/__init__.py
12133432
bpshetty/erpnext
refs/heads/master
erpnext/accounts/doctype/journal_entry_account/__init__.py
12133432
mxOBS/deb-pkg_trusty_chromium-browser
refs/heads/master
third_party/libvpx/source/libvpx/tools/intersect-diffs.py
98
#!/usr/bin/env python ## Copyright (c) 2012 The WebM project authors. All Rights Reserved. ## ## Use of this source code is governed by a BSD-style license ## that can be found in the LICENSE file in the root of the source ## tree. An additional intellectual property rights grant can be found ## in the file PATENT...
JetBrains/intellij-community
refs/heads/master
python/testData/refactoring/introduceVariable/substringAfterFormatTuple.after.py
166
a = "World" print("%s: %s %s" % ("Error", "Hello", a))
Cnidarias/al-go-rithms
refs/heads/master
search/binary_search/python/binary_search.py
5
def binary_search(list, num): found = False first = 0 last = len(list) - 1 while first <= last and not found: middle = (first + last)//2 if list[middle] == num: found = True elif list[middle] < num: first = middle + 1 else: l...
bassosimone/neubot-server
refs/heads/master
regress/neubot/database/table_speedtest_gen.py
4
# regress/neubot/database/table_speedtest_gen.py # # Copyright (c) 2010-2011 Simone Basso <bassosimone@gmail.com>, # NEXA Center for Internet & Society at Politecnico di Torino # Copyright (c) 2011 Roberto D'Auria <everlastingfire@autistici.org> # # This file is part of Neubot <http://www.neubot.org/>. # # Neubot is ...
valdur55/py3status
refs/heads/master
tests/test_py3.py
3
from pprint import pformat from py3status.py3 import Py3 py3 = Py3() def test_format_units(): tests = [ # basic unit guessing (dict(value=100), (100, "B")), (dict(value=999), (999, "B")), (dict(value=1000), (0.977, "KiB")), (dict(value=1024), (1.0, "KiB")), (dic...
mavenlin/tensorflow
refs/heads/master
tensorflow/contrib/learn/python/learn/datasets/synthetic.py
120
# 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...
stackforge/python-solumclient
refs/heads/master
solumclient/common/__init__.py
12133432
lopter/raven-python-old
refs/heads/master
tests/contrib/__init__.py
12133432
dfunckt/django
refs/heads/master
tests/handlers/__init__.py
12133432
odicraig/kodi2odi
refs/heads/master
addons/plugin.video.prosport/js2py/host/__init__.py
12133432
wcybxzj/django_xadmin17
refs/heads/master
setup.py
19
#!/usr/bin/env python from setuptools import setup # version_tuple = __import__('xadmin.version').VERSION # version = ".".join([str(v) for v in version_tuple]) setup( name='django-xadmin', version='0.5.0', description='Drop-in replacement of Django admin comes with lots of goodies, fully extensible with p...
felixbb/forseti-security
refs/heads/master
google/cloud/security/scanner/audit/base_rules_engine.py
1
# Copyright 2017 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 or agreed to in writing, s...
tensorflow/probability
refs/heads/main
tensorflow_probability/python/bijectors/softsign.py
1
# Copyright 2018 The TensorFlow Probability Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
cjaymes/pyscap
refs/heads/master
src/scap/model/oval_5/res/DefinitionType.py
1
# Copyright 2016 Casey Jaymes # This file is part of PySCAP. # # PySCAP 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. # # PySCAP is ...
neerajvashistha/pa-dude
refs/heads/master
lib/python2.7/site-packages/django/contrib/postgres/fields/__init__.py
1015
from .array import * # NOQA from .hstore import * # NOQA from .jsonb import * # NOQA from .ranges import * # NOQA
75651/kbengine_cloud
refs/heads/master
demo/res/scripts/bots/Account.py
4
# -*- coding: utf-8 -*- import KBEngine from KBEDebug import * class Account(KBEngine.Entity): def __init__(self): KBEngine.Entity.__init__(self) DEBUG_MSG("Account::__init__:%s." % (self.__dict__)) self.base.reqAvatarList() def onReqAvatarList(self, infos): """ define method. """ DEBUG_MSG("Acco...
kangfend/django
refs/heads/master
tests/sites_tests/tests.py
15
from __future__ import unicode_literals from django.apps import apps from django.conf import settings from django.contrib.sites import models from django.contrib.sites.management import create_default_site from django.contrib.sites.middleware import CurrentSiteMiddleware from django.contrib.sites.models import Site, c...
hxfxjun/ImageMagick-6.9.1
refs/heads/redhat
glib/gio/gdbus-2.0/codegen/codegen_docbook.py
9
# -*- Mode: Python -*- # GDBus - GLib D-Bus Library # # Copyright (C) 2008-2011 Red Hat, Inc. # # 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 # version 2 of the License, or (at ...
CSC-ORG/Dynamic-Dashboard-2015
refs/heads/master
engine/lib/python2.7/site-packages/django/db/models/sql/expressions.py
56
import copy from django.core.exceptions import FieldError from django.db.models.constants import LOOKUP_SEP from django.db.models.fields import FieldDoesNotExist class SQLEvaluator(object): def __init__(self, expression, query, allow_joins=True, reuse=None): self.expression = expression self.opts...
broferek/ansible
refs/heads/devel
lib/ansible/modules/cloud/amazon/s3_lifecycle.py
7
#!/usr/bin/python # Copyright: Ansible Project # 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', 'status': ['stableinterf...
piotrek-golda/CivilHubCopy
refs/heads/master
hitcounter/__init__.py
12133432
centrahackathon2017/bdvis
refs/heads/master
core/migrations/__init__.py
12133432
eeshangarg/oh-mainline
refs/heads/master
vendor/packages/Django/tests/regressiontests/admin_scripts/app_with_import/__init__.py
12133432
dashng/netseen
refs/heads/master
netseen/tests/models/__init__.py
12133432
Pablo126/SSBW
refs/heads/master
Tarea4/tarea4/lib/python3.5/site-packages/django/contrib/flatpages/urls.py
667
from django.conf.urls import url from django.contrib.flatpages import views urlpatterns = [ url(r'^(?P<url>.*)$', views.flatpage, name='django.contrib.flatpages.views.flatpage'), ]
shakamunyi/pybuilder
refs/heads/master
src/main/python/pybuilder/plugins/python/install_dependencies_plugin.py
1
# This file is part of PyBuilder # # Copyright 2011-2014 PyBuilder Team # # 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 re...
morepath/more.chameleon
refs/heads/master
more/chameleon/tests/fixtures/template.py
1
from more.chameleon import ChameleonApp class App(ChameleonApp): pass @App.path(path="persons/{name}") class Person: def __init__(self, name): self.name = name @App.template_directory() def get_template_dir(): return "templates" @App.html(model=Person, template="person.pt") def person_defaul...
mganeva/mantid
refs/heads/master
Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/SANSStitchTest.py
1
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifier: GPL - 3.0 + from __future__ import (absolute_import, divi...
Balachan27/django
refs/heads/master
tests/migrations/faulty_migrations/__init__.py
12133432
openstake/python-oauth2
refs/heads/master
oauth2/clients/__init__.py
12133432
kamiswin/body
refs/heads/master
userena/contrib/__init__.py
12133432
ryangallen/django
refs/heads/master
tests/migrations/migrations_test_apps/__init__.py
12133432
bobwalker99/Pydev
refs/heads/master
plugins/org.python.pydev.jython/jysrc/tests/test_convert.py
9
#Note that this test is run from org.python.pydev.jythontests.JythonTest from convert_api_to_pypredef import Convert, Contains try: import unittest except: import sys sys.stderr.write('--- PYTHONPATH FOUND:\n') sys.stderr.write('\n'.join(sys.path)) sys.stderr.write('\n--- END PYTHONPATH\n') rai...
mKeRix/home-assistant
refs/heads/dev
homeassistant/components/panasonic_viera/const.py
7
"""Constants for the Panasonic Viera integration.""" DOMAIN = "panasonic_viera" DEVICE_MANUFACTURER = "Panasonic" CONF_ON_ACTION = "turn_on_action" CONF_APP_ID = "app_id" CONF_ENCRYPTION_KEY = "encryption_key" DEFAULT_NAME = "Panasonic Viera TV" DEFAULT_PORT = 55000 ATTR_REMOTE = "remote" ERROR_NOT_CONNECTED = "no...
hpc/hypnotoad
refs/heads/master
hypnotoad/plugins/actions/nfsdirs/setup_helper.py
1
# # Helpers related to setup. # import logging import os import sys import shlex try: import json except ImportError, e: import simplejson as json sys.path.append(os.path.abspath('plugins/actions/nfsdirs')) from hypnotoad.core import hypnofs from base_classes import * LOG = logging.getLogger('root') FS = h...
StrikeForceZero/PJSip-CSharp
refs/heads/master
tests/pjsua/scripts-sendto/120_sdp_with_video_dynamic_2.py
59
# $Id: 120_sdp_with_video_dynamic_2.py 2081 2008-06-27 21:59:15Z bennylp $ import inc_sip as sip import inc_sdp as sdp # In this case the video codec uses dynamic payload type sdp = \ """ v=0 o=- 0 0 IN IP4 127.0.0.1 s=- c=IN IP4 127.0.0.1 t=0 0 m=video 4000 RTP/AVP 100 a=rtpmap:100 myvideo/96000 m=audio 5000 RTP/AVP ...
alexsmx/djangoAppengineSrcTemplate
refs/heads/master
django/contrib/localflavor/id/id_choices.py
439
import warnings from django.utils.translation import ugettext_lazy as _ # Reference: http://id.wikipedia.org/wiki/Daftar_provinsi_Indonesia # Indonesia does not have an official Province code standard. # I decided to use unambiguous and consistent (some are common) 3-letter codes. warnings.warn( 'There have been...
benslice/ggplot
refs/heads/master
ggplot/scales/scale_y_discrete.py
12
from .scale import scale from copy import deepcopy class scale_y_discrete(scale): """ Scale y axis as discrete values Parameters ---------- breaks: list maps to ybreaks labels: list, dict maps to ytick_labels Examples -------- >>> print ggplot(mtcars, aes('mpg', 'q...
Dee-UK/D33_KK_RK3066
refs/heads/master
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
phalf/kernel_mint2g
refs/heads/testing
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
shcalm/wx_pplab
refs/heads/master
main/plugins/music.py
2
#!/usr/bin/env python # -*- coding: utf-8 -*- import requests from .. import app, celery from . import wechat_custom @celery.task def get_douban_fm(openid): """抓取豆瓣FM""" url = 'http://www.douban.com/j/app/radio/people?' + \ 'app_name=radio_android&version=100&channel=0&type=n' try: r = re...
goldsborough/.emacs
refs/heads/master
.emacs.d/.python-environments/default/lib/python3.5/site-packages/pip/_vendor/progress/bar.py
510
# -*- coding: utf-8 -*- # Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS P...
Britefury/scikit-image
refs/heads/master
doc/examples/plot_brief.py
32
""" ======================= BRIEF binary descriptor ======================= This example demonstrates the BRIEF binary description algorithm. The descriptor consists of relatively few bits and can be computed using a set of intensity difference tests. The short binary descriptor results in low memory footprint and ve...
ychen820/microblog
refs/heads/master
y/google-cloud-sdk/platform/google_appengine/lib/django-1.2/django/db/backends/mysql/__init__.py
12133432
boehlke/OpenSlides
refs/heads/master
tests/unit/agenda/__init__.py
12133432
KAsante95/osf.io
refs/heads/develop
scripts/create_fakes.py
14
# -*- coding: utf-8 -*- """Fake data generator. To use: 1. Install fake-factory. pip install fake-factory 2. Create your OSF user account 3. Run the script, passing in your username (email). :: python -m scripts.create_fakes --user fred@cos.io This will create 3 fake public projects, each with 3 fake con...
qiulin/leonardo
refs/heads/master
leonardo/extensions.py
1
from flask.ext.cache import Cache from flask.ext.debugtoolbar import DebugToolbarExtension from flask.ext.login import LoginManager from flask_assets import Environment from leonardo.models import User # Setup flask cache cache = Cache() # init flask assets assets_env = Environment() debug_toolbar = DebugToolbarExt...
stvstnfrd/edx-platform
refs/heads/master
openedx/core/lib/api/tests/test_view_utils.py
5
""" Tests for (some of) the view utilities. """ from django.conf.urls import url from django.test.utils import override_settings from rest_framework.response import Response from rest_framework.test import APITestCase from rest_framework.views import APIView from openedx.core.djangoapps.content.course_overviews.models...
tmpkus/photivo
refs/heads/master
scons-local-2.2.0/SCons/Tool/tar.py
14
"""SCons.Tool.tar Tool-specific initialization for tar. 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 (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foun...
mdanielwork/intellij-community
refs/heads/master
python/testData/inspections/PyUnresolvedReferencesInspection/bytesIOMethods.py
82
from io import BytesIO fd = BytesIO('foo') fd.read(10) # Should resolve fd.<warning descr="Unresolved attribute reference 'foo' for class 'BytesIO'">foo</warning>()
rosmo/ansible
refs/heads/devel
lib/ansible/modules/windows/win_reg_stat.py
38
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2016, Ansible, inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # this is a windows documentation stub. actual code lives in the .ps1 # file of the same name ANSIBLE_METADATA = {'metadata_version': '1.1', ...
hradec/gaffer
refs/heads/master
startup/GafferScene/shaderAssignmentCompatibility.py
8
########################################################################## # # Copyright (c) 2019, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistrib...
Crystalnix/omaha
refs/heads/omaha_latest
omaha/enterprise/__init__.py
12133432
jonatron/django-s3-stream
refs/heads/master
zipgen/uploader/management/__init__.py
12133432
FNST-OpenStack/cloudkitty-dashboard
refs/heads/master
cloudkittydashboard/dashboards/__init__.py
12133432
nimasmi/wagtail
refs/heads/master
wagtail/project_template/project_name/__init__.py
12133432
emersonsoftware/ansiblefork
refs/heads/devel
test/units/parsing/__init__.py
12133432
nathanhilbert/geonode
refs/heads/master
docs/tutorials/users/conf.py
35
# -*- coding: utf-8 -*- # # GeoNode Users Workshop documentation build configuration file, created by # sphinx-quickstart on Mon Dec 17 15:21:27 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerate...
achals/servo
refs/heads/master
tests/wpt/run_css.py
140
# 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 run import sys paths = {"include_manifest": run.wpt_path("include_css.ini"), "config": run.wpt_path("co...
mecax/pyrobotlab
refs/heads/master
home/kmcgerald/pingdar-basic.py
3
# adjust for your system from time import sleep port = "/dev/tty.usbmodem1411" trigPin = 7 echoPin = 8 servoPin = 6 # start a pingdar pingdar = Runtime.start("pingdar","Pingdar") # attach all the parts pingdar.attach(port, trigPin, echoPin, servoPin) # sweep from servo position 10 to 170 step by 1 pingdar.sweep(10, ...
praekelt/rapidpro
refs/heads/develop
temba/triggers/views.py
1
from __future__ import unicode_literals import json import regex from datetime import timedelta from django import forms from django.core.urlresolvers import reverse from django.utils.timezone import get_current_timezone_name from django.views.decorators.csrf import csrf_exempt from django.http import HttpResponseRed...
alisonjo2786/old-python-lessons-fork
refs/heads/master
section_14_(exceptions)/exceptions_03.py
7
# Example #3: Different types of exceptions can be caught. print "Example #3: Phonebook!" phonebook = {} while True: # this will loop forever until we issue a break! key = raw_input(" (Ex #3, Phonebook) Please enter a person's name, or leave blank to quit: ") if key == '': break value = ra...
nicktimko/multiworm
refs/heads/master
tests/test_summary.py
1
from __future__ import absolute_import, print_function, unicode_literals import six from six.moves import zip, filter, map, reduce, input, range import inspect import pathlib import unittest import multiworm import multiworm.readers.summary as mrs from change_defaults import change_defaults TEST_ROOT = pathlib.Path...
vladozc/watermarks
refs/heads/master
utils/profile.py
1
'''Generate profile statistics. Something similar can be done with commands: PYTHONPATH=src python -m cProfile -o reader_lsb.profile bin/reader.py -m lsb -d tmp/ test/data/shape1-rgb-l9.png PYTHONPATH=src python -m cProfile -o writer_lsb.profile bin/writer.py -m lsb -d tmp/ -w test/data/shape1-rgb-l9.png test/data/sha...
heprom/pymicro
refs/heads/master
examples/plotting/pyplot_show_pixel_value.py
1
#!/usr/bin/env python import os from matplotlib import pyplot as plt, cm from pymicro.view.vol_utils import AxShowPixelValue from pymicro.file.file_utils import HST_read from pymicro.crystal.microstructure import Microstructure if __name__ == '__main__': ''' This example first demonstrate how to plot a slice o...
google-code-export/los-cocos
refs/heads/master
test/test_htmllabel.py
6
from __future__ import division, print_function, unicode_literals # This code is so you can run the samples without installing the package import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) # testinfo = "s, t 5, s, t 10.1, s, q" tags = "HTMLLabel, text" import cocos from cocos.dir...
kustomzone/Fuzium
refs/heads/master
bin/core/src/Test/__init__.py
12133432
GaussDing/django
refs/heads/master
tests/field_subclassing/__init__.py
12133432
rohitwaghchaure/vestasi-frappe
refs/heads/develop
frappe/patches/v4_3/__init__.py
12133432
domain51/d51.django.apps.invites
refs/heads/master
d51/django/apps/invites/migrations/__init__.py
12133432
xinwu/horizon
refs/heads/master
openstack_dashboard/dashboards/project/databases/__init__.py
12133432
tanglu-org/tdak
refs/heads/master
dak/dakdb/update83.py
7
#!/usr/bin/env python # coding=utf8 """ switch to new ACL implementation and add pre-suite NEW @contact: Debian FTP Master <ftpmaster@debian.org> @copyright: 2012 Ansgar Burchardt <ansgar@debian.org> @license: GNU General Public License version 2 or later """ # This program is free software; you can redistribute it ...
rajul/Pydev
refs/heads/development
plugins/com.python.pydev.refactoring/tests/pysrcrefactoring/reflib/renameattribute2/mod2.py
6
class Container: def method(self): self.attribute_to_be_found = True
asnir/airflow
refs/heads/master
tests/api/client/__init__.py
1049
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
ASCrookes/django
refs/heads/master
tests/auth_tests/test_hashers.py
185
# -*- coding: utf-8 -*- from __future__ import unicode_literals from unittest import skipUnless from django.conf.global_settings import PASSWORD_HASHERS from django.contrib.auth.hashers import ( UNUSABLE_PASSWORD_PREFIX, UNUSABLE_PASSWORD_SUFFIX_LENGTH, BasePasswordHasher, PBKDF2PasswordHasher, PBKDF2SHA1Pass...
hmen89/odoo
refs/heads/master
openerp/addons/test_access_rights/tests/__init__.py
404
import test_ir_rules
macbre/index-digest
refs/heads/master
indexdigest/linters/linter_0094_generic_primary_key.py
1
""" This linter checks for ... """ from indexdigest.utils import LinterEntry GENERIC_PRIMARY_KEY = 'id' def check_generic_primary_key(database): """ :type database indexdigest.database.Database :rtype: list[LinterEntry] """ for table_name in database.get_tables(): indices = [ ...
alexwlchan/alexwlchan.net
refs/heads/live
recategorise.py
1
#!/usr/bin/env python # -*- encoding: utf-8 import os import pathlib import frontmatter import iterfzf def get_post_paths(root): for dirpath, _, filenames in os.walk(root): for f in filenames: if f.endswith(".md"): yield pathlib.Path(dirpath) / f def get_posts(root): fo...
astonshane/AdventOfCode
refs/heads/master
2015/python/day17/chal34.py
1
import sys from itertools import combinations def sumCombo(combo): total = 0 for i in combo: total += i return total # ###################### if len(sys.argv) != 3: print "need an input file and storage capacity" exit(1) storage = int(sys.argv[2]) containers = [] f = open(sys.argv[1]) f...
pascalchevrel/bedrock
refs/heads/master
bedrock/utils/models.py
9
from datetime import datetime from django.db import models import timeago class GitRepoState(models.Model): repo_name = models.CharField(max_length=200, blank=True) repo_url = models.CharField(max_length=200, blank=True) repo_id = models.CharField(max_length=100, db_index=True, unique=True) latest_r...
Nicop06/ansible
refs/heads/devel
lib/ansible/executor/task_executor.py
2
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # 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...