repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
gangadhar-kadam/helpdesk-frappe
refs/heads/develop
frappe/core/doctype/file/test_file.py
13
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe import unittest from frappe.utils.file_manager import save_file, get_files_path from frappe import _ from frappe.core.doctype.file.file import move_file #...
alanwells/donkey
refs/heads/master
donkeycar/parts/actuators/actuators.py
1
""" actuators.py Classes to control the motors and servos. These classes are wrapped in a mixer class before being used in the drive loop. """ import time from ... import utils class PCA9685: ''' PWM motor controler using PCA9685 boards. This is used for most RC Cars ''' def __init__(...
stu9arkin/PSSSSTTTT
refs/heads/master
client.py
1
from socket import * from tkinter import * import threading def sendMessage(): #two send message functions because return type requires (event) parameters message = e.get() # -which is not compatible with the first sendMessage call in send button s.send(message.encode()) def sendMessageEnter(event): ...
netzkolchose/django-cms
refs/heads/develop
cms/urls.py
7
# -*- coding: utf-8 -*- from django.conf import settings from django.conf.urls import include, url from cms.apphook_pool import apphook_pool from cms.appresolver import get_app_patterns from cms.constants import SLUG_REGEXP from cms.views import details if settings.APPEND_SLASH: regexp = r'^(?P<slug>%s)/$' % SLU...
rueycheng/wp-download
refs/heads/master
setup.py
1
# -*- coding: UTF-8 -*- #!/usr/bin/env python import os from distutils.core import setup from glob import glob setup(name='wp-download', version='0.1.2b', description='Wikipedia database dump downloader', author='Wolodja Wentland', author_email='wentland@cl.uni-heidelberg.de', url='http...
tgcmteam/tgcmlinux
refs/heads/master
test/many_top_windows.py
1
#!/usr/bin/python # -*- coding: utf-8 -*- # # Authors : David Castellanos <dcastellanos@indra.es> # # Copyright (c) 2012, Telefonica Móviles España S.A.U. # # This library 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 F...
jfinkels/networkx
refs/heads/master
networkx/algorithms/approximation/clique.py
11
# -*- coding: utf-8 -*- """ Cliques. """ # Copyright (C) 2011-2012 by # Nicholas Mancuso <nick.mancuso@gmail.com> # All rights reserved. # BSD license. import networkx as nx from networkx.algorithms.approximation import ramsey __author__ = """Nicholas Mancuso (nick.mancuso@gmail.com)""" __all__ = ["clique_remov...
apocquet/django
refs/heads/master
tests/model_validation/tests.py
292
from django.core import management from django.core.checks import Error, run_checks from django.db.models.signals import post_init from django.test import SimpleTestCase from django.test.utils import override_settings from django.utils import six class OnPostInit(object): def __call__(self, **kwargs): pas...
w1z2g3/crossbar
refs/heads/master
crossbar/worker/test/examples/goodclass.py
4
##################################################################################### # # Copyright (C) Tavendo GmbH # # Unless a separate license agreement exists between you and Tavendo GmbH (e.g. you # have purchased a commercial license), the license terms below apply. # # Should you enter into a separate licen...
alanthai/django-guardian
refs/heads/master
guardian/migrations/0002_auto__add_field_groupobjectpermission_object_pk__add_field_userobjectp.py
85
# encoding: utf-8 from south.db import db from south.v2 import SchemaMigration from guardian.compat import user_model_label class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'GroupObjectPermission.object_pk' db.add_column('guardian_groupobjectpermission', 'object_pk', se...
Az107/advancedapt-get
refs/heads/master
apt-getGUI/data/aa-g.py
1
#!/usr/bin/python import easygui as gui import os import sys #start here title = " advanced apt-get" if os.geteuid() != 0: print 'error dont have root acces.' sys.exit(1) task = gui.buttonbox(title=title, msg="choice a task", choices=("install", "remove", "upgrade")) if task == "upgrade": ...
sunlianqiang/kbengine
refs/heads/master
kbe/src/lib/python/Lib/_weakrefset.py
169
# Access WeakSet through the weakref module. # This code is separated-out because it is needed # by abc.py to load everything else at startup. from _weakref import ref __all__ = ['WeakSet'] class _IterationGuard: # This context manager registers itself in the current iterators of the # weak container, such ...
dotcloud/zerorpc-python
refs/heads/master
zerorpc/__init__.py
20
# -*- coding: utf-8 -*- # Open Source Initiative OSI - The MIT License (MIT):Licensing # # The MIT License (MIT) # Copyright (c) 2015 François-Xavier Bourlet (bombela+zerorpc@gmail.com) # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files...
vincepandolfo/django
refs/heads/master
tests/files/tests.py
20
# -*- coding: utf-8 -*- from __future__ import unicode_literals import gzip import os import struct import tempfile import unittest from io import BytesIO, StringIO from django.core.files import File from django.core.files.base import ContentFile from django.core.files.move import file_move_safe from django.core.file...
Sorsly/subtle
refs/heads/master
google-cloud-sdk/lib/googlecloudsdk/third_party/apis/cloudresourcemanager/v2alpha1/__init__.py
415
"""Package marker file.""" import pkgutil __path__ = pkgutil.extend_path(__path__, __name__)
ossdemura/django-miniblog
refs/heads/dev
Lib/site-packages/django/core/cache/__init__.py
51
""" Caching framework. This package defines set of cache backends that all conform to a simple API. In a nutshell, a cache is a set of values -- which can be any object that may be pickled -- identified by string keys. For the complete API, see the abstract BaseCache class in django.core.cache.backends.base. Client ...
fredericlepied/ansible
refs/heads/devel
test/integration/targets/module_utils/library/test_env_override.py
170
#!/usr/bin/python # Most of these names are only available via PluginLoader so pylint doesn't # know they exist # pylint: disable=no-name-in-module from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.json_utils import data from ansible.module_utils.mork import data as mork_data results = {"j...
WarrenWeckesser/scipy
refs/heads/master
scipy/fft/_backend.py
12
import scipy._lib.uarray as ua from . import _pocketfft class _ScipyBackend: """The default backend for fft calculations Notes ----- We use the domain ``numpy.scipy`` rather than ``scipy`` because in the future, ``uarray`` will treat the domain as a hierarchy. This means the user can install ...
eneldoserrata/marcos_openerp
refs/heads/master
addons/base_report/__init__.py
7
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com). # # WARNING: This program as such is intended to be used by professional # programmers who take t...
owlabs/incubator-airflow
refs/heads/master
tests/contrib/hooks/test_azure_fileshare_hook.py
1
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
School-of-Innovation-Experiment/InnovationManagement
refs/heads/master
facultyStaff/views.py
6027
# Create your views here.
zzw922cn/Automatic_Speech_Recognition
refs/heads/master
speechvalley/feature/madarian/preprocess.py
1
# encoding: utf-8 # ****************************************************** # Author : zzw922cn # Last modified: 2017-12-09 11:00 # Email : zzw922cn@gmail.com # Filename : madarian_preprocess.py # Description : Feature preprocessing for some Madarian dataset # ******************************************...
cynapse/cynin
refs/heads/master
src/ubify.coretypes/ubify/coretypes/content/contentspace.py
5
############################################################################### #cyn.in is an open source Collaborative Knowledge Management Appliance that #enables teams to seamlessly work together on files, documents and content in #a secure central environment. # #cyn.in v2 an open source appliance is distrib...
marctc/django
refs/heads/master
tests/admin_inlines/test_templates.py
285
from __future__ import unicode_literals from django.template.loader import render_to_string from django.test import SimpleTestCase class TestTemplates(SimpleTestCase): def test_javascript_escaping(self): context = { 'inline_admin_formset': { 'formset': {'prefix': 'my-prefix'},...
clebergnu/autotest
refs/heads/master
client/tests/kvm/tests/stepmaker.py
2
#!/usr/bin/python """ Step file creator/editor. @copyright: Red Hat Inc 2009 @author: mgoldish@redhat.com (Michael Goldish) @version: "20090401" """ import pygtk, gtk, gobject, time, os, commands, logging import common from autotest_lib.client.common_lib import error from autotest_lib.client.virt import virt_utils, p...
Tilo15/PhotoFiddle2
refs/heads/master
PF2/Sounds.py
1
import subprocess import threading class SystemSounds: @staticmethod def play_sound(id): threading.Thread(target=SystemSounds.play_sound_blocking, args=(id,)).start() @staticmethod def play_sound_blocking(id): subprocess.call(['/usr/bin/canberra-gtk-play','--id',id]) @sta...
demarle/VTK
refs/heads/master
ThirdParty/Twisted/twisted/news/news.py
57
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Maintainer: Jp Calderone """ from twisted.news import nntp from twisted.internet import protocol, reactor import time class NNTPFactory(protocol.ServerFactory): """A factory for NNTP server protocols.""" protocol = nntp.NNTPSe...
elbermu/cerux_kernel-touchwiz
refs/heads/master
tools/perf/scripts/python/sctop.py
11180
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
blueskycoco/sq-linux
refs/heads/master
tools/perf/scripts/python/sctop.py
11180
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
ezralanglois/arachnid
refs/heads/master
arachnid/snippets/image/interpolate_volume.py
1
''' Interporate a volume Download to edit and run: :download:`interpolate_volume.py <../../arachnid/snippets/image/interpolate_volume.py>` To run: .. sourcecode:: sh $ python interpolate_volume.py .. literalinclude:: ../../arachnid/snippets/image/interpolate_volume.py :language: python :lines: 16- ...
kenohori/IfcOpenShell_CGAL
refs/heads/cgal
src/ifcexpressparser/nodes.py
7
############################################################################### # # # This file is part of IfcOpenShell. # # # ...
bigswitch/nova
refs/heads/master
nova/api/openstack/versioned_method.py
97
# Copyright 2014 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
RealImpactAnalytics/airflow
refs/heads/master
tests/task/__init__.py
23
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
natanielruiz/android-yolo
refs/heads/master
jni-build/jni/include/tensorflow/contrib/distributions/python/ops/distribution_util.py
3
# 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...
AOSP-SGS2/android_kernel_samsung_galaxynote
refs/heads/ics
tools/perf/scripts/python/syscall-counts-by-pid.py
944
# system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(...
40223104/w16b_test
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/multiprocessing/util.py
696
# # Module providing various facilities to other parts of the package # # multiprocessing/util.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # import sys import functools import os import itertools import weakref import atexit import threading # we want threading to ...
Tatsh/youtube-dl
refs/heads/master
youtube_dl/extractor/azmedien.py
4
# coding: utf-8 from __future__ import unicode_literals import json import re from .common import InfoExtractor from .kaltura import KalturaIE class AZMedienIE(InfoExtractor): IE_DESC = 'AZ Medien videos' _VALID_URL = r'''(?x) https?:// (?:www\.)? ...
jonathanunderwood/outsider
refs/heads/master
setup.py
1
# This file is part of Outsider. # # Outsider 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. # # Outsider is distributed in the hope t...
whix/python
refs/heads/master
renzongxian/0007/0007.py
40
# Source:https://github.com/Show-Me-the-Code/show-me-the-code # Author:renzongxian # Date:2014-12-10 # Python 3.4 """ 第 0007 题:有个目录,里面是你自己写过的程序,统计一下你写过多少行代码。包括空行和注释,但是要分别列出来。 """ import os import sys def code_lines(target_file): # Declare returned values total_lines = 0 empty_lines = 0 comment_lin...
nuxleus/cherokee-webserver
refs/heads/master
qa/131-PHP-zero-len-post+Redir.py
8
import os from base import * DIR1 = "131_post_zero_php_len1" DIR2 = "131_post_zero_php_len2" MAGIC = 'alvaro=alobbs.com' FORBIDDEN = "Cherokee: The Open Source web server" CONF = """ vserver!1!rule!1310!match = directory vserver!1!rule!1310!match!directory = /%s vserver!1!rule!1310!handler = redir vser...
ajaxsys/dict-admin
refs/heads/master
pygments/styles/emacs.py
75
# -*- coding: utf-8 -*- """ pygments.styles.emacs ~~~~~~~~~~~~~~~~~~~~~ A highlighting style for Pygments, inspired by Emacs. :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import ...
yury-s/v8-inspector
refs/heads/master
Source/chrome/build/android/pylib/gtest/__init__.py
998
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file.
alrifqi/django
refs/heads/master
tests/order_with_respect_to/models.py
165
""" Tests for the order_with_respect_to Meta attribute. """ from django.db import models from django.utils import six from django.utils.encoding import python_2_unicode_compatible class Question(models.Model): text = models.CharField(max_length=200) @python_2_unicode_compatible class Answer(models.Model): ...
auduny/home-assistant
refs/heads/dev
homeassistant/components/yale_smart_alarm/alarm_control_panel.py
7
"""Component for interacting with the Yale Smart Alarm System API.""" import logging import voluptuous as vol from homeassistant.components.alarm_control_panel import ( AlarmControlPanel, PLATFORM_SCHEMA) from homeassistant.const import ( CONF_PASSWORD, CONF_USERNAME, CONF_NAME, STATE_ALARM_ARMED_AWAY, ST...
vikt0rs/oslo.db
refs/heads/master
tests/sqlalchemy/test_migrations.py
3
# Copyright 2010-2011 OpenStack Foundation # Copyright 2012-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/li...
flyfei/python-for-android
refs/heads/master
python-modules/twisted/twisted/conch/test/test_window.py
78
""" Tests for the insults windowing module, L{twisted.conch.insults.window}. """ from twisted.trial.unittest import TestCase from twisted.conch.insults.window import TopWindow class TopWindowTests(TestCase): """ Tests for L{TopWindow}, the root window container class. """ def test_paintScheduling(...
roselleebarle04/django
refs/heads/master
tests/model_validation/tests.py
292
from django.core import management from django.core.checks import Error, run_checks from django.db.models.signals import post_init from django.test import SimpleTestCase from django.test.utils import override_settings from django.utils import six class OnPostInit(object): def __call__(self, **kwargs): pas...
cyberspace-kris/dnd5e
refs/heads/master
hitpoints.py
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """HTML checkboxes for monster hit points.""" import argparse import json import numpy as np import random import sys def roll(n, d): """Roll n d-sided dice.""" r = 0 for i in range(n): r += random.randint(1, d) return r def parse(hitdice): ...
marsop/machikoro
refs/heads/master
code/Player.py
1
from card import CardName import abc class Player(object): __metaclass__ = abc.ABCMeta def __init__(self, name): self.name = name self.playing_area = [] self.coins = 0 def buy_card(self, card): self.coins -= card.cost self.playing_area.append(card) #print "player " + self.name + " has bought card "...
veger/ansible
refs/heads/devel
lib/ansible/modules/cloud/digital_ocean/digital_ocean_floating_ip_facts.py
81
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (C) 2017-18, 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 = { 'status': ['preview'], 's...
maaruiz/Nominas2015ES
refs/heads/master
Procesos/Nomina/Editar/actualizar.py
1
""" Created on 04/10/2015 @author: miguelangel """ import locale import time from Funciones.funs import select_sql from Funciones.Datos.nomina_dat import Nomina_Devengo from Procesos.Nomina.Calcular.costes import CostesSegSocial class Actualizar: ''' classdocs ''' def __init__(self, nomina = 0): ...
Shraddha512/servo
refs/heads/master
components/script/dom/bindings/codegen/parser/tests/test_union.py
134
import WebIDL import itertools import string # We'd like to use itertools.chain but it's 2.6 or higher. def chain(*iterables): # chain('ABC', 'DEF') --> A B C D E F for it in iterables: for element in it: yield element # We'd like to use itertools.combinations but it's 2.6 or higher. def c...
eroicaleo/LearningPython
refs/heads/master
ch31/bound.py
1
#!/usr/bin/env python class Spam: def doit(self, message): print(message) object1 = Spam() object1.doit('hello world!') x = object1.doit x('hello world!') t = Spam.doit t(object1, 'howdy!') class Eggs: def m1(self, n): print(n) def m2(self): x = self.m1 x(42) Eggs().m2() ...
hmoco/osf.io
refs/heads/develop
api_tests/search/serializers/test_serializers.py
6
from modularodm import Q from nose.tools import * # flake8: noqa from api.search.serializers import SearchSerializer from api_tests import utils from tests.base import DbTestCase from osf_tests.factories import ( AuthUserFactory, NodeFactory, ProjectFactory, ) from tests.utils import make_drf_request_wit...
mfm24/ChordViz
refs/heads/master
ChordViz.py
1
# -*- coding: utf-8 -*- """ Created on Fri May 3 21:09:10 2013 @author: matt # based on MyPlayer3_Callback (which is newer than MyPlayer3.py) """ from __future__ import division import time, math, logging import numpy as np from threading import Lock, Thread import itertools # not sure I've added correct path in la...
sontek/rethinkdb
refs/heads/next
external/re2_20140111/re2/make_unicode_groups.py
121
#!/usr/bin/python # Copyright 2008 The RE2 Authors. All Rights Reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. """Generate C++ tables for Unicode Script and Category groups.""" import sys import unicode _header = """ // GENERATED BY make_unicode_groups...
runt18/mojo
refs/heads/master
third_party/cython/src/Cython/Compiler/Future.py
101
def _get_feature(name): import __future__ # fall back to a unique fake object for earlier Python versions or Python 3 return getattr(__future__, name, object()) unicode_literals = _get_feature("unicode_literals") with_statement = _get_feature("with_statement") division = _get_feature("division") print_func...
moritzschaefer/luigi
refs/heads/master
test/import_test.py
46
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
nrupatunga/PY-GOTURN
refs/heads/goturn-dev
goturn/loader/loader_imagenet.py
1
# Date: Nrupatunga: Tuesday 04 July 2017 # Email: nrupatunga@whodat.com # Name: Nrupatunga # Description: loading Imagenet dataset from __future__ import print_function import os import cv2 import glob from annotation import annotation import xml.etree.ElementTree as ET from ..logger.logger import setup_logger from .....
tomasreimers/tensorflow-emscripten
refs/heads/master
tensorflow/python/training/moving_averages.py
16
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
pluskid/mxnet
refs/heads/master
example/image-classification/symbols/resnet.py
13
''' Adapted from https://github.com/tornadomeet/ResNet/blob/master/symbol_resnet.py Original author Wei Wu Implemented the following paper: Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun. "Identity Mappings in Deep Residual Networks" ''' import mxnet as mx def residual_unit(data, num_filter, stride, dim_match, na...
virtualopensystems/neutron
refs/heads/master
neutron/plugins/bigswitch/servermanager.py
1
# Copyright 2014 Big Switch Networks, 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...
shahar-stratoscale/nova
refs/heads/master
nova/api/openstack/compute/contrib/cloudpipe_update.py
13
# Copyright 2012 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
Rentier/setlx2py
refs/heads/master
setlx2py/builtin/setlx_functions.py
1
#------------------------------------------------------------------------------ # setlx2py: setlx_list.py # # Predefined functions of SetlX # # Copyright (C) 2014, Jan-Christoph Klie # License: Apache v2 #------------------------------------------------------------------------------ import math import functools import...
molotof/infernal-twin
refs/heads/master
build/pillow/PIL/PcfFontFile.py
72
# # THIS IS WORK IN PROGRESS # # The Python Imaging Library # $Id$ # # portable compiled font file parser # # history: # 1997-08-19 fl created # 2003-09-13 fl fixed loading of unicode fonts # # Copyright (c) 1997-2003 by Secret Labs AB. # Copyright (c) 1997-2003 by Fredrik Lundh. # # See the README file for informa...
xhat/micropython
refs/heads/master
tests/basics/string_rpartition.py
61
print("asdf".rpartition('g')) print("asdf".rpartition('a')) print("asdf".rpartition('s')) print("asdf".rpartition('f')) print("asdf".rpartition('d')) print("asdf".rpartition('asd')) print("asdf".rpartition('sdf')) print("asdf".rpartition('as')) print("asdf".rpartition('df')) print("asdf".rpartition('asdf')) print("asdf...
mandeepdhami/nova
refs/heads/master
nova/tests/unit/db/test_sqlalchemy_migration.py
11
# Copyright 2014 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
lichengshuang/createvhost
refs/heads/master
python/asher/idrac/bin/idrac.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- import re import sys import os import IPy import pexpect from multiprocessing import Pool import ConfigParser #version 1.3 #更新返回st号有wrong的问题 #解决返回main(bios)AssertionError问题 #解决返回值为NONE的情况 #NONE为无返回值 ## 20170921 加处理日志的东西 ## 20171010 添加了升级bios idrac版本的功能 ## 20171011 添加了升...
mttr/django
refs/heads/master
tests/test_client/auth_backends.py
315
from django.contrib.auth.backends import ModelBackend class TestClientBackend(ModelBackend): pass
unioslo/cerebrum
refs/heads/master
Cerebrum/modules/no/hiof/mod_sap_codes.py
1
# -*- coding: utf-8 -*- # # Copyright 2007-2019 University of Oslo, Norway # # This file is part of Cerebrum. # # Cerebrum is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # ...
minsoopark/starbucks-py
refs/heads/master
setup.py
1
from setuptools import setup, find_packages setup( name='Starbucks', packages=find_packages(), version='0.5.3', description='Unoffical Starbucks API.', long_description=open('README.rst').read(), license='BSD License', author='Minsoo Park', author_email='minsoo1003@gmail.com', url='...
Frodox/buildbot
refs/heads/master
master/buildbot/test/fake/libvirt.py
10
# 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 WARRANTY; without eve...
lensacom/satyr
refs/heads/master
mentor/tests/test_framework.py
1
from __future__ import absolute_import, division, print_function import pytest from mentor.messages import PythonTask from mentor.proxies.messages import (CommandInfo, ContainerInfo, Cpus, Disk, DockerInfo, Mem, TaskID, TaskInfo) from mentor.scheduler import QueueScheduler, Running ...
DESHRAJ/fjord
refs/heads/master
vendor/packages/chardet/chardet/hebrewprober.py
2928
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Shy Shalom # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved. #...
wanderine/nipype
refs/heads/master
nipype/interfaces/camino/odf.py
1
""" Change directory to provide relative paths for doctests >>> import os >>> filepath = os.path.dirname( os.path.realpath( __file__ ) ) >>> datadir = os.path.realpath(os.path.join(filepath, '../../testing/data')) >>> os.chdir(datadir) """ import os from nipype.interfaces.base import (CommandLineI...
mancoast/CPythonPyc_test
refs/heads/master
cpython/252_test_applesingle.py
24
# Copyright (C) 2003 Python Software Foundation import unittest import macostools import Carbon.File import MacOS import os import sys from test import test_support import struct import applesingle AS_MAGIC=0x00051600 AS_VERSION=0x00020000 dataforkdata = 'hello\r\0world\n' resourceforkdata = 'goodbye\ncruel\0world\r'...
impredicative/nodeforge
refs/heads/master
src/nodeforge/gui/SmartInput.py
1
""" Smart Input Box A heavily featured entry widget for processing user input. It sends multilined text with a linefeed appended to the end. Input is received by a blocking function created by raw_input() Additional features include selection of the entire block when focused on. The box is also selected when ...
benediktschmitt/sqlalchemy-materialized-paths
refs/heads/master
sqlalchemy_materialized_paths.py
1
#!/usr/bin/env python3 # MIT License # # Copyright (c) 2017 Benedikt Schmitt <benedikt@benediktschmitt.de> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including wi...
SerialShadow/SickRage
refs/heads/master
lib/github/MainClass.py
35
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2013 AKFish <akfish@gmail.com> # # Copyright 2013 Ed Jackson <ed.jackson@gmail.com> ...
gyoto/Gyoto
refs/heads/master
python/gyoto/metric.py
1
'''Gyoto::Metric namespace In order to emulate the C++ Gyoto::Metric namespace, this module will load gyoto.std and gyoto.lorene (if available) and expose all Metrics in here. ''' import gyoto._namespaces as _namespaces from gyoto.core import Metric as Generic __all__ = _namespaces.make_namespace(Generic, globals())...
bdrung/audacity
refs/heads/master
lib-src/lv2/suil/waflib/Tools/c_tests.py
330
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file from waflib import Task from waflib.Configure import conf from waflib.TaskGen import feature,before_method,after_method import sys LIB_CODE=''' #ifdef _MSC_VER #define testEXP...
eneldoserrata/marcos_openerp
refs/heads/master
addons/web/__init__.py
66
import http import controllers import cli wsgi_postload = http.wsgi_postload
daviddoria/PointGraphsPhase1
refs/heads/PointGraphsPhase1
Examples/GUI/Python/TransformWithBoxWidget.py
15
#!/usr/bin/env python # Demonstrate how to use the vtkBoxWidget to translate, scale, and # rotate actors. The basic idea is that the box widget controls an # actor's transform. A callback which modifies the transform is # invoked as the box widget is manipulated. import vtk # Start by creating some simple geometry;...
EduPepperPDTesting/pepper2013-testing
refs/heads/www0
lms/djangoapps/administration/migrations/0008_auto__chg_field_pepregtraining_date_create__chg_field_pepregtraining_d.py
1
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'PepRegTraining.date_create' db.alter_column('pepreg_training', 'date_create', self.gf('dj...
ernesto-g/micropython
refs/heads/master
tests/micropython/heapalloc.py
52
# check that we can do certain things without allocating heap memory import gc def f1(a): print(a) def f2(a, b=2): print(a, b) def f3(a, b, c, d): x1 = x2 = a x3 = x4 = b x5 = x6 = c x7 = x8 = d print(x1, x3, x5, x7, x2 + x4 + x6 + x8) global_var = 1 def test(): global global_var ...
sergiocorato/bank-payment
refs/heads/8.0
account_banking/__openerp__.py
10
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>). # (C) 2011 Therp BV (<http://therp.nl>). # (C) 2011 Smile (<http://smile.fr>). # # All other contributions are (C) by thei...
PokemonGoF/PokemonGo-Bot-Desktop
refs/heads/development
build/pywin/Lib/urllib.py
8
"""Open an arbitrary URL. See the following document for more info on URLs: "Names and Addresses, URIs, URLs, URNs, URCs", at http://www.w3.org/pub/WWW/Addressing/Overview.html See also the HTTP spec (from which the error codes are derived): "HTTP - Hypertext Transfer Protocol", at http://www.w3.org/pub/WWW/Protocols...
ByteInternet/libcloud
refs/heads/byte
libcloud/compute/drivers/ikoula.py
64
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
alanswanson/webserver
refs/heads/master
qa/069-PathInfo3.py
8
from base import * PATH_INFO = "/param1/param2/param3" CONF = """ vserver!1!rule!690!match = directory vserver!1!rule!690!match!directory = /pathinfo3 vserver!1!rule!690!handler = cgi """ class Test (TestBase): def __init__ (self): TestBase.__init__ (self, __file__) self.name = "PathInfo, cgi" ...
darshanapdas/staging-next
refs/heads/master
tools/perf/util/setup.py
989
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
CSC-ORG/Dynamic-Dashboard-2015
refs/heads/master
engine/lib/python2.7/site-packages/rest_framework/utils/encoders.py
5
""" Helper classes for parsers. """ from __future__ import unicode_literals from django.db.models.query import QuerySet from django.utils import six, timezone from django.utils.encoding import force_text from django.utils.functional import Promise from rest_framework.compat import OrderedDict, total_seconds from rest_f...
Rosy-S/twilio-python
refs/heads/master
twilio/rest/resources/applications.py
48
from . import InstanceResource, ListResource class Application(InstanceResource): """ An application resource """ def update(self, **kwargs): """ Update this application """ return self.parent.update(self.name, **kwargs) def delete(self): """ Delete this a...
tafaRU/odoo
refs/heads/8.0
addons/l10n_fr_hr_payroll/l10n_fr_hr_payroll.py
340
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
gangadhar-kadam/verve-erp
refs/heads/v5.0
erpnext/accounts/report/gross_profit/gross_profit.py
3
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _, scrub from frappe.utils import flt, cstr, cint def execute(filters=None): if not filters: filters = {} gross_p...
devopshq/vspheretools
refs/heads/master
pysphere/version.py
2
# Do not edit. Auto generated version = (0, 1, 8)
ldengjie/myzsh
refs/heads/master
plugins/git-prompt/gitstatus.py
343
#!/usr/bin/env python # -*- coding: UTF-8 -*- from subprocess import Popen, PIPE import re # change those symbols to whatever you prefer symbols = { 'ahead of': '↑', 'behind': '↓', 'staged': '♦', 'changed': '‣', 'untracked': '…', 'clean': '⚡', 'unmerged': '≠', 'sha1': ':' } output, err...
cristian99garcia/devtutor-activity
refs/heads/master
modules.py
1
# Copyright (C) 2010 Kandarp Kaushik # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed i...
hrishioa/Aviato
refs/heads/master
kartograph/kartograph/simplify/mpoint.py
4
class MPoint: """ Point class used for polygon simplification """ def __init__(self, x, y): self.x = x self.y = y self.simplified = False self.deleted = False self.keep = False self.features = set() def isDeletable(self): if self.keep or sel...
msarahan/bokeh
refs/heads/master
bokeh/server/protocol/messages/tests/test_patch_doc.py
6
from __future__ import absolute_import, print_function import unittest import bokeh.document as document from bokeh.model import Model from bokeh.core.properties import Int, Instance from bokeh.server.protocol import Protocol class AnotherModelInTestPatchDoc(Model): bar = Int(1) class SomeModelInTestPatchDoc(Mo...
MortimerGoro/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/py/testing/process/test_forkedfunc.py
162
import pytest import py, sys, os pytestmark = py.test.mark.skipif("not hasattr(os, 'fork')") def test_waitfinish_removes_tempdir(): ff = py.process.ForkedFunc(boxf1) assert ff.tempdir.check() ff.waitfinish() assert not ff.tempdir.check() def test_tempdir_gets_gc_collected(monkeypatch): monkeypat...