repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
Anislav/Stream-Framework
refs/heads/master
feedly/tests/managers/redis.py
5
from feedly.feed_managers.base import Feedly from feedly.feeds.base import UserBaseFeed from feedly.feeds.redis import RedisFeed from feedly.tests.managers.base import BaseFeedlyTest import pytest class RedisUserBaseFeed(UserBaseFeed, RedisFeed): pass class RedisFeedly(Feedly): feed_classes = { 'fee...
emollient/WITRapp
refs/heads/master
witrapp/witrapp/views.py
1
from pyramid.view import view_config from sqlalchemy.exc import DBAPIError import urllib2 @view_config(route_name='home', renderer='templates/index.mako') def home(request): response = urllib2.urlopen('http://witr.rit.edu/static/live.m3u') response = response.read() print response return {'response'...
blacklin/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/lib2to3/fixes/fix_import.py
136
"""Fixer for import statements. If spam is being imported from the local directory, this import: from spam import eggs Becomes: from .spam import eggs And this import: import spam Becomes: from . import spam """ # Local imports from .. import fixer_base from os.path import dirname, join, exists, sep f...
chrisschuette/Nyx
refs/heads/master
third_party/gtest/test/gtest_break_on_failure_unittest.py
2140
#!/usr/bin/env python # # Copyright 2006, Google 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: # # * Redistributions of source code must retain the above copyright # notice, this list...
YijunZh/openplatform-python
refs/heads/master
guardianapi/__init__.py
9
from client import Client
joshloyal/scikit-learn
refs/heads/master
doc/sphinxext/numpy_ext/docscrape_sphinx.py
408
import re import inspect import textwrap import pydoc from .docscrape import NumpyDocString from .docscrape import FunctionDoc from .docscrape import ClassDoc class SphinxDocString(NumpyDocString): def __init__(self, docstring, config=None): config = {} if config is None else config self.use_plots...
saydulk/django
refs/heads/master
tests/admin_views/forms.py
339
from django import forms from django.contrib.admin.forms import AdminAuthenticationForm class CustomAdminAuthenticationForm(AdminAuthenticationForm): class Media: css = {'all': ('path/to/media.css',)} def clean_username(self): username = self.cleaned_data.get('username') if username ...
himleyb85/django
refs/heads/master
tests/template_tests/filter_tests/test_timeuntil.py
161
from __future__ import unicode_literals from datetime import datetime, timedelta from django.template.defaultfilters import timeuntil_filter from django.test import SimpleTestCase from django.test.utils import requires_tz_support from ..utils import setup from .timezone_utils import TimezoneTestCase class Timeunti...
jzoldak/edx-platform
refs/heads/master
common/lib/capa/capa/tests/test_customrender.py
37
from lxml import etree import unittest import xml.sax.saxutils as saxutils from capa.tests.helpers import test_capa_system from capa import customrender # just a handy shortcut lookup_tag = customrender.registry.get_class_for_tag def extract_context(xml): """ Given an xml element corresponding to the output...
IllusionRom-deprecated/android_platform_tools_idea
refs/heads/master
python/testData/refactoring/rename/renameInheritors.py
83
class A: def f<caret>oo(self): pass class B(A): def foo(self): pass
chris-chris/tensorflow
refs/heads/master
tensorflow/compiler/tests/momentum_test.py
72
# 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...
ganga-devs/ganga
refs/heads/develop
ganga/GangaCore/test/GPI/Mergers/TestCustomMerger.py
1
import os import tempfile import pytest from GangaTest.Framework.utils import write_file from GangaCore.GPIDev.Base.Proxy import addProxy from GangaCore.GPIDev.Adapters.IPostProcessor import PostProcessException from GangaCore.testlib.GangaUnitTest import GangaUnitTest from GangaCore.testlib.monitoring import run_...
Z2PackDev/bands_inspect
refs/heads/master
bands_inspect/eigenvals.py
2
# -*- coding: utf-8 -*- # (c) 2017-2019, ETH Zurich, Institut fuer Theoretische Physik # Author: Dominik Gresch <greschd@gmx.ch> """ Defines the data container for eigenvalue data (bandstructures). """ import types import numpy as np from fsc.export import export from fsc.hdf5_io import HDF5Enabled, subscribe_hdf5 ...
alviano/wasp
refs/heads/master
tests/sat/Models/test2.SAT.dimacs.test.py
5
input = """ c soddisfacibile p cnf 4 4 1 2 3 0 2 3 4 0 1 -2 -3 0 1 0 """ output = """ sat """
lemonsoda/pythonlearning
refs/heads/master
pythonlearn/search.py
1
import os def search(word,curdir): files=[x for x in os.listdir(curdir) if os.path.isfile(x)] dirs=[x for x in os.listdir(curdir) if os.path.isdir(x)] for filename in files: if word in filename: print os.path.join(curdir,filename) #print dirs for dirname in dirs: searc...
vladon/omim
refs/heads/master
3party/protobuf/gtest/scripts/pump.py
2471
#!/usr/bin/env python # # Copyright 2008, Google 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: # # * Redistributions of source code must retain the above copyright # notice, this list...
islacoin/islacoin
refs/heads/master
share/qt/extract_strings_qt.py
1294
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt4 stringdefs so that they can be picked up by Qt linguist. ''' from subprocess import Popen, PIPE import glob OUT_CPP="src/qt/bitcoinstrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' format produced by xgettext. Ret...
hvekriya/mojwmt
refs/heads/master
node_modules/grunt-sass/node_modules/node-sass/node_modules/node-gyp/gyp/tools/pretty_sln.py
1831
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Prints the information in a sln file in a diffable way. It first outputs each projects in alphabetical order with their dependenci...
scottfrazer/hermes
refs/heads/develop
examples/xml/test.py
1
import hermes with open('xml.hgr') as fp: xml_parser = hermes.compile(fp, module='xml_parser', debug=False) tokens = xml_parser.lex('<a x="1" y="2"><b><c>hello</c><d>world</d></b></a>', '<string>') for token in tokens: print(token) #tree = xml_parser.parse('<a x="1" y="2"><b><c>hello</c><d>world</d></b></a>') ...
samdowd/drumm-farm
refs/heads/master
drumm_env/lib/python2.7/site-packages/phonenumbers/data/region_JM.py
1
"""Auto-generated file, do not edit by hand. JM metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_JM = PhoneMetadata(id='JM', country_code=1, international_prefix='011', general_desc=PhoneNumberDesc(national_number_pattern='[589]\\d{9}', possible_length=(10,), poss...
arakashic/shadowsocks
refs/heads/master
shadowsocks/asyncdns.py
655
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2014-2015 clowwindy # # 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 r...
ojake/django
refs/heads/master
django/conf/locale/zh_Hans/formats.py
1008
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'Y年n月j日' # 2016年9月5...
lanselin/pysal
refs/heads/master
pysal/spatial_dynamics/util.py
11
""" Utilities for the spatial dynamics module. """ __all__ = ['shuffle_matrix', 'get_lower'] import numpy as np def shuffle_matrix(X, ids): """ Random permutation of rows and columns of a matrix Parameters ---------- X : array (k, k), array to be permutated. ids : array ...
jaysonsantos/servo
refs/heads/master
components/script/dom/bindings/codegen/parser/tests/test_treatNonCallableAsNull.py
170
import WebIDL def WebIDLTest(parser, harness): parser.parse(""" [TreatNonCallableAsNull] callback Function = any(any... arguments); interface TestTreatNonCallableAsNull1 { attribute Function? onfoo; attribute Function onbar; }; """) results = parser.finish() ...
hainm/scipy
refs/heads/master
scipy/integrate/quadpack.py
42
# Author: Travis Oliphant 2001 # Author: Nathan Woods 2013 (nquad &c) from __future__ import division, print_function, absolute_import import sys import warnings from functools import partial from . import _quadpack import numpy from numpy import Inf __all__ = ['quad', 'dblquad', 'tplquad', 'nquad', 'quad_explain', ...
wgertler/wgertler.github.io
refs/heads/master
articles/bht/classical-thermodynamics/multiplicity_graph.py
1
from matplotlib.pyplot import bar, xlabel, ylabel, title, show from factorial import factorial from multiplicity import choice import sys def mult_plotter(x,y): a = [] b = [] d = [] i = 0 while i <= int(x): a.append(choice(int(y) + i -1 , i)) b.append(choice(int(y) + int(x) -i -1 , ...
g19-hs/personfinder
refs/heads/master
app/script_variant.py
2
import jautils from unidecode import unidecode import os.path import re def read_dictionary(file_name): """ Reads dictionary file. Args: file_name: file name. format: kanji + '\t' + yomigana Return: {kanj: yomigana, ...} """ dictionary = {} try: ...
apocalypsebg/odoo
refs/heads/8.0
addons/account/res_currency.py
340
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2010 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 # p...
wesm/statsmodels
refs/heads/master
scikits/statsmodels/base/data.py
1
""" Base tools for handling various kinds of data structures, attaching metadata to results, and doing data cleaning """ import numpy as np from pandas import DataFrame, Series, TimeSeries from scikits.timeseries import time_series from scikits.statsmodels.tools.decorators import (resettable_cache, cac...
g0v/nowin_core
refs/heads/master
nowin_core/source/command.py
2
from twisted.protocols.basic import LineReceiver from nowin_core.source import channel class CommandReceiver(channel.ChannelReceiver): def __init__(self): self.lineReceiver = LineReceiver() self.lineReceiver.lineReceived = self.lineReceived def lineReceived(self, line): cmd, data = ...
dongweiming/wechat-admin
refs/heads/master
wechat/celeryconfig.py
1
from config import REDIS_URL BROKER_URL = REDIS_URL CELERY_RESULT_BACKEND = REDIS_URL CELERY_TASK_SERIALIZER = 'msgpack' CELERY_RESULT_SERIALIZER = 'json' CELERY_TASK_RESULT_EXPIRES = 60 * 60 * 24 CELERY_ACCEPT_CONTENT = ['json', 'msgpack']
tinkerthaler/odoo
refs/heads/8.0
addons/auth_signup/res_users.py
90
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
iradul/qtwebkit
refs/heads/pjs
Tools/Scripts/webkitpy/port/win_unittest.py
115
# Copyright (C) 2011 Google 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: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
hlange/LogSoCR
refs/heads/master
.waf/waflib/extras/run_r_script.py
51
#!/usr/bin/env python # encoding: utf-8 # Hans-Martin von Gaudecker, 2012 """ Run a R script in the directory specified by **ctx.bldnode**. For error-catching purposes, keep an own log-file that is destroyed if the task finished without error. If not, it will show up as rscript_[index].log in the bldnode directory. ...
hroncok/freeipa
refs/heads/master
ipatests/test_integration/test_dnssec.py
5
# # Copyright (C) 2015 FreeIPA Contributors see COPYING for license # import dns.dnssec import dns.resolver import dns.name import time from ipatests.test_integration.base import IntegrationTest from ipatests.test_integration import tasks from ipaplatform.paths import paths test_zone = "dnssec.test." test_zone_repl...
emakarov/django-parakeet
refs/heads/master
djparakeet/routing.py
1
from channels import route from .consumers import ws_message, ws_connect, ws_disconnect websocket_routing = [ route("websocket.receive", ws_message), route("websocket.connect", ws_connect), route("websocket.disconnect", ws_disconnect), ]
mrquim/repository.mrquim
refs/heads/master
plugin.video.netflix/resources/lib/UniversalAnalytics/__init__.py
19
import Tracker
alberto-antonietti/nest-simulator
refs/heads/master
pynest/nest/tests/test_getconnections.py
3
# -*- coding: utf-8 -*- # # test_getconnections.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the Lic...
jhseu/tensorflow
refs/heads/master
tensorflow/python/autograph/pyct/testing/decorators.py
24
# 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...
PennartLoettring/Poettrix
refs/heads/master
rootfs/usr/lib/python3.4/xmlrpc/client.py
69
# # XML-RPC CLIENT LIBRARY # $Id$ # # an XML-RPC client interface for Python. # # the marshalling and response parser code can also be used to # implement XML-RPC servers. # # Notes: # this version is designed to work with Python 2.1 or newer. # # History: # 1999-01-14 fl Created # 1999-01-15 fl Changed dateTime to u...
laiqiqi886/kbengine
refs/heads/master
kbe/src/lib/python/Lib/email/charset.py
90
# Copyright (C) 2001-2007 Python Software Foundation # Author: Ben Gertzfield, Barry Warsaw # Contact: email-sig@python.org __all__ = [ 'Charset', 'add_alias', 'add_charset', 'add_codec', ] from functools import partial import email.base64mime import email.quoprimime from email import errors fro...
GraFiddle/grafiddle
refs/heads/master
server/lib/werkzeug/contrib/iterio.py
318
# -*- coding: utf-8 -*- r""" werkzeug.contrib.iterio ~~~~~~~~~~~~~~~~~~~~~~~ This module implements a :class:`IterIO` that converts an iterator into a stream object and the other way round. Converting streams into iterators requires the `greenlet`_ module. To convert an iterator into a stream...
schlueter/ansible
refs/heads/devel
lib/ansible/modules/notification/office_365_connector_card.py
50
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2017 Marc Sensenich <hello@marc-sensenich.com> # Copyright (c) 2017 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__ = t...
minhphung171093/GreenERP
refs/heads/master
openerp/addons/payment/__init__.py
1516
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import models
puzan/ansible
refs/heads/devel
lib/ansible/module_utils/azure_rm_common.py
48
# # Copyright (c) 2016 Matt Davis, <mdavis@ansible.com> # Chris Houseknecht, <house@redhat.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, e...
jrclaramunt/django-cms
refs/heads/develop
cms/test_utils/project/sampleapp/ns_urls.py
12
from django.conf.urls import patterns, url from django.utils.translation import ugettext_lazy as _ """ Also used in cms.tests.ApphooksTestCase """ urlpatterns = patterns('cms.test_utils.project.sampleapp.views', url(r'^current-app/$', 'current_app', name='current-app'), url(_('page'), 'current_app', name='tra...
belmiromoreira/nova
refs/heads/master
nova/tests/unit/api/openstack/compute/contrib/test_aggregates.py
25
# Copyright (c) 2012 Citrix Systems, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
hmen89/odoo
refs/heads/master
addons/document/__init__.py
434
# -*- 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...
bejmy/backend
refs/heads/master
bejmy/accounts/migrations/0004_account_order.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.11.1 on 2017-06-13 09:46 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('accounts', '0003_account_balance_initial'), ] operations = [ migrations.Add...
thenakliman/nirikshak
refs/heads/basic_framework
nirikshak/tests/unit/post_task/test_dummy.py
1
# Copyright 2017 <thenakliman@gmail.com> # # 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...
zeroonegit/python
refs/heads/master
crossincode.com/Python_Getting_Started/isEqual2.py
2
def isEqual(num1, num2): if num1 < num2: print('too small') return False if num1 > num2: print('too big') return False if num1 == num2: print('bingo') return True from random import randint num = randint(1, 100) print('Guess what I think? ') bingo = False w...
JorisE/xhtml2pdf
refs/heads/master
test/witherror.py
154
# -*- coding: utf-8 -*- # Copyright 2010 Dirk Holtwick, holtwick.it # # 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 ...
michaelgallacher/intellij-community
refs/heads/master
python/testData/formatter/newLineAfterColonMultiClause.py
83
try: pass finally: pass
wwj718/ANALYSE
refs/heads/master
cms/djangoapps/contentstore/management/commands/tests/test_export_all_courses.py
37
""" Test for export all courses. """ import shutil from tempfile import mkdtemp from contentstore.management.commands.export_all_courses import export_courses_to_output_path from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.django import modulestore from xmodule.modulestore.tests.django_utils i...
sungkim11/mhargadh
refs/heads/master
django/utils/simplejson/__init__.py
324
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format. :mod:`simplejson` exposes an API familiar to users of the standard library :mod:`marshal` and :mod:`pickle` modules. It is the externally maintained version of ...
zedshaw/librelist
refs/heads/master
lib/metaphone.py
1
#!python #coding= latin-1 # This script implements the Double Metaphone algorythm (c) 1998, 1999 by Lawrence Philips # it was translated to Python from the C source written by Kevin Atkinson (http://aspell.net/metaphone/) # By Andrew Collins - January 12, 2007 who claims no rights to this work # http://atomboy.isa...
fpy171/django
refs/heads/master
django/contrib/gis/db/backends/spatialite/adapter.py
586
from django.contrib.gis.db.backends.base.adapter import WKTAdapter from django.db.backends.sqlite3.base import Database class SpatiaLiteAdapter(WKTAdapter): "SQLite adaptor for geometry objects." def __conform__(self, protocol): if protocol is Database.PrepareProtocol: return str(self)
ErikAndren/linux
refs/heads/master
scripts/gdb/vmlinux-gdb.py
367
# # gdb helper commands and functions for Linux kernel debugging # # loader module # # Copyright (c) Siemens AG, 2012, 2013 # # Authors: # Jan Kiszka <jan.kiszka@siemens.com> # # This work is licensed under the terms of the GNU GPL version 2. # import os sys.path.insert(0, os.path.dirname(__file__) + "/scripts/gdb"...
naglis/mopidy-leftasrain
refs/heads/master
mopidy_leftasrain/backend.py
2
# -*- coding: utf-8 -*- from __future__ import unicode_literals import urlparse from mopidy import backend from mopidy.exceptions import BackendError from mopidy.models import Album, Artist, SearchResult, Track import pykka from . import logger from .remote import COVER_URL, LeftAsRain, SONG_URL def track_from_so...
jonathonwalz/ansible
refs/heads/devel
test/runner/lib/ansible_util.py
70
"""Miscellaneous utility functions and classes specific to ansible cli tools.""" from __future__ import absolute_import, print_function import os from lib.util import common_environment def ansible_environment(args, color=True): """ :type args: CommonConfig :type color: bool :rtype: dict[str, str] ...
tedsunnyday/Tweet2DowJones
refs/heads/master
examples/search_tweets.py
1
from TwitterAPI import TwitterAPI SEARCH_TERM = 'pizza' CONSUMER_KEY = '' CONSUMER_SECRET = '' ACCESS_TOKEN_KEY = '' ACCESS_TOKEN_SECRET = '' api = TwitterAPI( CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN_KEY, ACCESS_TOKEN_SECRET) r = api.request('search/tweets', {'q': SEARCH_TERM}) for item in r...
ejones/mythril
refs/heads/master
mythril/css.py
1
""" Python values representing CSS rules, allowing you to create (nestable) CSS rules in Python. Here is an example:: from mythril.css import css css( MyClass, border='1px solid #CCC', padding=5, size=( 200, 50 ) )[ css( ('some-class', SomeUtility), pos=( 1, 0, 'relative' ) ) ] Corresponds to somethi...
kotfic/girder
refs/heads/master
girder/cli/build.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright Kitware 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 ...
vmanoria/bluemix-hue-filebrowser
refs/heads/master
hue-3.8.1-bluemix/desktop/core/ext-py/pysqlite/doc/includes/sqlite3/insert_more_people.py
49
from pysqlite2 import dbapi2 as sqlite3 con = sqlite3.connect("mydb") cur = con.cursor() newPeople = ( ('Lebed' , 53), ('Zhirinovsky' , 57), ) for person in newPeople: cur.execute("insert into people (name_last, age) values (?, ?)", person) # The changes will not be saved unless the transaction...
maurizi/otm-core
refs/heads/develop
opentreemap/treemap/tests/test_udfs.py
3
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals from __future__ import division import json from random import shuffle from datetime import datetime import psycopg2 from django.db import connection from django.db.models import Q from django.core.exceptions import ...
rivuletaudio/rivulet
refs/heads/master
server/search/torrent_search_provider.py
1
from tornado.web import gen import re re_prepositions = r'((\ba\b|\bthe\b)\s*)|(\s*\ba\b|\bthe\b)' re_splitter = re.compile(r'[\W_]+') def remove_prepositions(text): return re.sub(re_prepositions, '', text, flags=(re.IGNORECASE & re.UNICODE)) def clean_path(path): path = path.split('/')[-1].lower() # kil...
lovelysystems/pyjamas
refs/heads/ls-production
pyjd/pywebkitgtk.py
1
#!/usr/bin/env python # Copyright (C) 2006, Red Hat, Inc. # Copyright (C) 2007, One Laptop Per Child # Copyright (C) 2007 Jan Alonzo <jmalonzo@unpluggable.com> # Copyright (C) 2008, 2009 Luke Kenneth Casson Leighton <lkcl@lkcl.net> # # This program is free software; you can redistribute it and/or modify # it under the ...
BaskerShu/typeidea
refs/heads/master
typeidea/blog/adminforms.py
1
# -*- coding: utf-8 -*- from dal import autocomplete from django import forms from ckeditor_uploader.widgets import CKEditorUploadingWidget from .models import Category, Tag from typeidea.widget import CustomAdminMarkdownxWidget class PostAdminForm(forms.ModelForm): desc = forms.CharField(widget=forms.Textarea,...
mhbu50/frappe
refs/heads/develop
frappe/email/doctype/email_queue_recipient/email_queue_recipient.py
22
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document class EmailQueueRecipient(Document): pass
kingvuplus/ts-gui-3
refs/heads/master
lib/python/Plugins/Extensions/DVDBurn/Process.py
64
from Components.Task import Task, Job, DiskspacePrecondition, Condition, ToolExistsPrecondition from Components.Harddisk import harddiskmanager from Screens.MessageBox import MessageBox import os class png2yuvTask(Task): def __init__(self, job, inputfile, outputfile): Task.__init__(self, job, "Creating menu video")...
deathping1994/sendmail-api
refs/heads/master
venv/lib/python2.7/site-packages/setuptools/command/__init__.py
475
__all__ = [ 'alias', 'bdist_egg', 'bdist_rpm', 'build_ext', 'build_py', 'develop', 'easy_install', 'egg_info', 'install', 'install_lib', 'rotate', 'saveopts', 'sdist', 'setopt', 'test', 'install_egg_info', 'install_scripts', 'register', 'bdist_wininst', 'upload_docs', ] from distutils.command.bdist imp...
timothyclarke/ansible-modules-extras
refs/heads/devel
system/alternatives.py
29
#!/usr/bin/python # -*- coding: utf-8 -*- """ Ansible module to manage symbolic link alternatives. (c) 2014, Gabe Mulley <gabe.mulley@gmail.com> (c) 2015, David Wittman <dwittman@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 Gene...
lecaoquochung/ddnb.django
refs/heads/master
tests/model_package/models/publication.py
586
from django.db import models class Publication(models.Model): title = models.CharField(max_length=30)
lokirius/python-for-android
refs/heads/master
python3-alpha/extra_modules/pyxmpp2/xmppserializer.py
46
# # (C) Copyright 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 useful...
xapharius/mrEnsemble
refs/heads/master
Engine/src/datahandler/image/image_training_conf.py
2
''' Created on Jan 15, 2014 @author: Simon ''' from protocol.n_image_input_protocol import NImageInputProtocol from datahandler.abstract_job_conf import AbstractJobConf class ImageTrainingConf(AbstractJobConf): ''' classdocs ''' INPUT_PROTOCOL = NImageInputProtocol INTERNAL_PROTOCOL = NImageI...
TateWalker/AV-Query
refs/heads/master
velocities.py
2
import requests import itertools import threading import time import sys def animate(): for c in itertools.cycle(['|', '/', '-', '\\']): if done: break sys.stdout.write('\rloading ' + c) sys.stdout.flush() time.sleep(0.1) print(chr(27) + "[2J") sys.stdout.write('...
LeJay/android_kernel_samsung_jactiveltexx
refs/heads/cm-10.1
tools/perf/scripts/python/netdev-times.py
11271
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
vuteam/BlackHole-New
refs/heads/master
lib/python/Screens/ChannelSelection.py
2
# -*- coding: utf-8 -*- from Tools.Profile import profile from Screen import Screen import Screens.InfoBar import Components.ParentalControl from Components.Button import Button from Components.Renderer.Picon import getPiconName from Components.ServiceList import ServiceList, refreshServiceList from Components.ActionMa...
rombie/contrail-controller
refs/heads/master
src/container/mesos-manager/mesos_manager/vnc/vnc_common.py
1
# # Copyright (c) 2018 Juniper Networks, Inc. All rights reserved. # from vnc_mesos_config import VncMesosConfig as vnc_mesos_config from vnc_api.vnc_api import (KeyValuePair,KeyValuePairs) from config_db import DBBaseMM class VncCommon(object): """VNC mesos common functionality. """ def __init__(self, mes...
royalharsh/grpc
refs/heads/master
tools/buildgen/plugins/make_fuzzer_tests.py
14
# Copyright 2016, Google 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: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
Avantol13/music_generator
refs/heads/master
mgen/__init__.py
2
from mgen.create import MusicGenerator from mgen.style import Style from mgen.style import DEFAULT_CFG_FILE from mgen.style import JAZZ_CFG_FILE from mgen import cfg_import
schlueter/ansible
refs/heads/devel
lib/ansible/modules/cloud/azure/azure_rm_containerregistry.py
21
#!/usr/bin/python # # Copyright (c) 2017 Yawei Wang, <yaweiw@microsoft.com> # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
olemis/brython
refs/heads/master
www/tests/test_list.py
12
# list examples z=[1,2,3] assert z.__class__ == list assert isinstance(z,list) assert str(z)=="[1, 2, 3]" a=['spam','eggs',100,1234] print(a[:2]+['bacon',2*2]) print(3*a[:3]+['Boo!']) print(a[:]) a[2]=a[2]+23 print(a) a[0:2]=[1,12] print(a) a[0:2]=[] print(a) a[1:1]=['bletch','xyzzy'] print(a) a[:0]=a print(a) a[:]=[...
vamsirajendra/nupic
refs/heads/master
tests/unit/nupic/engine/network_test.py
22
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2014, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
batxes/4c2vhic
refs/heads/master
SHH_WT_models_highres/SHH_WT_models_highres_final_output_0.1_-0.1_5000/Representative.py
6
import _surface import chimera try: import chimera.runCommand except: pass from VolumePath import markerset as ms try: from VolumePath import Marker_Set, Link new_marker_set=Marker_Set except: from VolumePath import volume_path_dialog d= volume_path_dialog(True) new_marker_set= d.new_marker_set marker_set...
ZenithDK/mopidy
refs/heads/develop
tests/local/test_library.py
12
from __future__ import absolute_import, unicode_literals import os import shutil import tempfile import unittest import mock import pykka from mopidy import core, exceptions from mopidy.local import actor, json from mopidy.models import Album, Artist, Image, Track from tests import path_to_data_dir # TODO: updat...
zrzka/blackmamba
refs/heads/master
blackmamba/lib/docutils/languages/zh_cn.py
52
# -*- coding: utf-8 -*- # $Id: zh_cn.py 4564 2006-05-21 20:44:42Z wiemann $ # Author: Pan Junyong <panjy@zopechina.com> # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two ...
caiocsalvador/whats_the_craic
refs/heads/master
lib/python3.4/site-packages/django/contrib/auth/migrations/0007_alter_validators_add_error_messages.py
369
# -*- coding: utf-8 -*- from __future__ import unicode_literals import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('auth', '0006_require_contenttypes_0002'), ] operations = [ migrations.AlterField( ...
tysonclugg/django
refs/heads/master
tests/sitemaps_tests/test_http.py
34
import os from datetime import date from unittest import skipUnless from django.apps import apps from django.conf import settings from django.contrib.sitemaps import Sitemap from django.contrib.sites.models import Site from django.core.exceptions import ImproperlyConfigured from django.test import modify_settings, ove...
jniznan/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers
refs/heads/master
Chapter2_MorePyMC/separation_plot.py
86
# separation plot # Author: Cameron Davidson-Pilon,2013 # see http://mdwardlab.com/sites/default/files/GreenhillWardSacks.pdf import matplotlib.pyplot as plt import numpy as np def separation_plot( p, y, **kwargs ): """ This function creates a separation plot for logistic and probit classification. Se...
moxon6/chemlab
refs/heads/master
build/lib.win32-3.4/chemlab/contrib/gromacs.py
5
'''A set of utilities to interact with gromacs''' # Need to add a parser to insert this contrib script # $ chemlab gromacs energy # it should show a little interface to view the energy # Let's launch the program and determine what happens from chemlab.io import datafile from pylab import * from chemlab.molsim.analys...
msebire/intellij-community
refs/heads/master
python/testData/intentions/addMissingParamsInGoogleDocStringNoParamSection.py
53
def <caret>f(x, y, z): """ """
mcltn/ansible-modules-extras
refs/heads/devel
cloud/centurylink/clc_firewall_policy.py
40
#!/usr/bin/python # # Copyright (c) 2015 CenturyLink # # 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 la...
bencomp/dataverse.org
refs/heads/master
dataverse_org/apps/dataverse_stats/views.py
6445
from django.shortcuts import render # Create your views here.
schieb/angr
refs/heads/master
angr/analyses/identifier/runner.py
2
import random import logging import os import claripy from ...sim_type import SimTypeFunction, SimTypeInt from ... import sim_options as so from ... import SIM_LIBRARIES from ... import BP_BEFORE, BP_AFTER from ...storage.file import SimFile, SimFileDescriptor from ...state_plugins import SimSystemPosix from ...erro...
askeing/servo
refs/heads/master
tests/wpt/web-platform-tests/mixed-content/generic/expect.py
26
import json, os, urllib, urlparse def redirect(url, response): response.add_required_headers = False response.writer.write_status(301) response.writer.write_header("access-control-allow-origin", "*") response.writer.write_header("location", url) response.writer.end_headers() response.writer.wri...
agry/NGECore2
refs/heads/master
scripts/object/draft_schematic/dance_prop/prop_ribbon_r_s08.py
85615
import sys def setup(core, object): return
agry/NGECore2
refs/heads/master
scripts/object/tangible/ship/components/engine/engine_kuat_f31.py
85615
import sys def setup(core, object): return
ProjectSWGCore/NGECore2
refs/heads/master
scripts/object/tangible/loot/creature_loot/collections/publish_gift_datapad_component_08.py
85615
import sys def setup(core, object): return
ProjectSWGCore/NGECore2
refs/heads/master
scripts/object/draft_schematic/clothing/clothing_backpack_field_05.py
85615
import sys def setup(core, object): return