repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
cvsuser-chromium/yate
refs/heads/master
share/scripts/libyate.py
10
""" ----------------------------------------------------------------------- libyate.py This file is a contribute of nexlab ( http://www.nexlab.it ) for the YATE Project ( http://YATE.null.ro ). libyate.py is Copyright (C) 2005 Nexlab S.r.l Author: Franco (nextime) Lanza <nextime@nexlab.it> Version: 0.3 Python ...
nhenezi/kuma
refs/heads/master
vendor/packages/translate-toolkit/translate/storage/subtitles.py
6
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2008-2009 Zuza Software Foundation # # This file is part of translate. # # translate 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...
apoorv-kumar/PyThugLife
refs/heads/master
PicDownloader/test_crawler.py
1
import unittest from crawler import Crawler import os import sys class SampleCrawler(Crawler): @staticmethod def get_image_lambda(): return lambda page_url, img_url: "__isvalidpic__" in img_url @staticmethod def get_link_lambda(): return lambda link: "__isvalidlink__" in link @s...
neumerance/cloudloon2
refs/heads/master
horizon/tables/actions.py
7
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Nebula, 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 # # ...
ahmedaljazzar/edx-platform
refs/heads/master
openedx/core/djangoapps/auth_exchange/tests/mixins.py
1
""" Mixins to facilitate testing OAuth connections to Django-OAuth-Toolkit or Django-OAuth2-Provider. """ from unittest import skip, expectedFailure from django.test.client import RequestFactory from openedx.core.djangoapps.oauth_dispatch import adapters from openedx.core.djangoapps.oauth_dispatch.tests.constants imp...
asmithdigital/slack-sounds
refs/heads/master
slackclient/_client.py
9
#!/usr/bin/python # mostly a proxy object to abstract how some of this works import json from slackclient._server import Server class SlackClient(object): def __init__(self, token): self.token = token self.server = Server(self.token, False) def rtm_connect(self): try: sel...
krdlab/ansible-modules-core
refs/heads/devel
network/basics/uri.py
12
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Romeo Theriault <romeot () hawaii.edu> # # 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 th...
espenmn/bda.plone.productshop2
refs/heads/master
src/bda/plone/productshop/config.py
2
"""Common configuration constants """ PROJECTNAME = 'bda.plone.productshop' ADD_PERMISSIONS = { # -*- extra stuff goes here -*- }
breznak/nupic
refs/heads/master
tests/integration/nupic/opf/hotgym_regression_test.py
5
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2015, Numenta, Inc. Unless you have purchased from # Numenta, Inc. a separate commercial license for this software code, the # following terms and conditions apply: # # This pro...
anaqreon/redmatrix
refs/heads/master
util/zotsh/zotsh.py
16
#!/usr/bin/env python2 import sys, os import ConfigParser import requests from requests.auth import HTTPBasicAuth import easywebdav import easywebdav.__version__ as easywebdavversion __version__= "0.0.2" SERVER = None USER = None PASSWD = None VERIFY_SSL=True #########################################...
lupyuen/RaspberryPiImage
refs/heads/master
home/pi/GrovePi/Software/Python/others/temboo/Library/Twitter/FriendsAndFollowers/__init__.py
5
from temboo.Library.Twitter.FriendsAndFollowers.CreateFriendship import CreateFriendship, CreateFriendshipInputSet, CreateFriendshipResultSet, CreateFriendshipChoreographyExecution from temboo.Library.Twitter.FriendsAndFollowers.DeleteFriendship import DeleteFriendship, DeleteFriendshipInputSet, DeleteFriendshipResultS...
bartman/wmii
refs/heads/master
alternative_wmiircs/python/pyxp/fields.py
1
from datetime import datetime import operator class Field(object): idx = 0 def __init__(self): Field.idx += 1 self.id = Field.idx def repr(self): return self.__class__.__name__ def __repr__(self): if hasattr(self, 'name'): return '<Field %s "%s">' % (self....
lyw07/kolibri
refs/heads/develop
kolibri/utils/pskolibri/__init__.py
4
""" This module is heavily based on the psutil module https://github.com/giampaolo/psutil Copyright (c) 2009, Jay Loden, Dave Daeschler, Giampaolo Rodola under BSD License Most of these functions are stripped versions of psutil simplified/adapted integrated with Kolibri. Linux part follows psutil in most of the code...
andriistartsev/kubernetes
refs/heads/master
examples/celery-rabbitmq/celery-app-add/celery_conf.py
471
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 # # Unle...
follow99/django
refs/heads/master
django/db/backends/signals.py
1430
from django.dispatch import Signal connection_created = Signal(providing_args=["connection"])
phenoxim/cinder
refs/heads/master
cinder/tests/unit/volume/drivers/nexenta/test_nexenta5_nfs.py
3
# Copyright 2016 Nexenta 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 req...
camunda/camunda-spin
refs/heads/master
dataformat-xml-dom/src/test/resources/org/camunda/spin/python/xml/dom/XmlDomCreatePythonTest.shouldCreateForString.py
2
import org.camunda.spin.DataFormats.xml as xml; xml1 = S(input, xml()) xml2 = S(input, "application/xml") xml3 = S(input)
mitar/django
refs/heads/master
tests/regressiontests/decorators/tests.py
9
import warnings from functools import wraps from django.contrib.admin.views.decorators import staff_member_required from django.contrib.auth.decorators import login_required, permission_required, user_passes_test from django.http import HttpResponse, HttpRequest, HttpResponseNotAllowed from django.middleware.clickjack...
ibotty/ansible
refs/heads/devel
lib/ansible/plugins/callback/__init__.py
71
# (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...
cpyou/odoo
refs/heads/master
addons/website_hr_recruitment/__openerp__.py
14
{ 'name': 'Online Jobs', 'category': 'Website', 'version': '1.0', 'summary': 'Job Descriptions And Application Forms', 'description': """ OpenERP Contact Form ==================== """, 'author': 'OpenERP SA', 'depends': ['website_partner', 'hr_recruitment', 'website_mail'], 'dat...
mdanielwork/intellij-community
refs/heads/master
python/testData/inspections/__init__.py
473
__author__ = 'user'
muupan/chainer
refs/heads/master
tests/cupy_tests/manipulation_tests/test_split.py
15
import unittest from cupy import testing @testing.gpu class TestSplit(unittest.TestCase): _multiprocess_can_split_ = True @testing.numpy_cupy_array_equal() def test_array_spliti1(self, xp): a = testing.shaped_arange((3, 11), xp) split = xp.array_split(a, 4, 1) return xp.concaten...
Shekharrajak/Django-facebook
refs/heads/master
docs/docs_env/Lib/site-packages/pip-1.0-py2.5.egg/pip/basecommand.py
25
"""Base Command class, and related routines""" import os import socket import sys import traceback import time from pip import commands from pip.log import logger from pip.baseparser import parser, ConfigOptionParser, UpdatingDefaultsHelpFormatter from pip.download import urlopen from pip.exceptions import BadCommand...
ZenHarbinger/snapcraft
refs/heads/master
snaps_tests/demos_tests/test_plainbox_test_tool.py
10
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2016 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the h...
simonwydooghe/ansible
refs/heads/devel
lib/ansible/plugins/doc_fragments/k8s_state_options.py
41
# -*- coding: utf-8 -*- # Copyright: (c) 2018, Red Hat | Ansible # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Options for specifying object state class ModuleDocFragment(object): DOCUMENTATION = r''' options: state: description: - Determines if an obj...
fs714/ialgotest
refs/heads/master
ialgotest/rq_mode/mongo_feed_mod/__init__.py
1
__config__ = { 'mongo_ip': '127.0.0.1', 'mongo_port': 27017, 'mongo_db_name': 'emquant' } def load_mod(): from .mod import MongoFeedMod return MongoFeedMod()
Gerhut/electron
refs/heads/master
script/lib/util.py
21
#!/usr/bin/env python import atexit import contextlib import errno import platform import re import shutil import ssl import subprocess import sys import tarfile import tempfile import urllib2 import os import zipfile from config import is_verbose_mode from env_util import get_vs_env BOTO_DIR = os.path.abspath(os.pa...
quoclieu/codebrew17-starving
refs/heads/master
env/lib/python3.5/site-packages/eventlet/greenpool.py
6
import traceback from eventlet import event from eventlet import greenthread from eventlet import queue from eventlet import semaphore from eventlet.support import greenlets as greenlet from eventlet.support import six __all__ = ['GreenPool', 'GreenPile'] DEBUG = True class GreenPool(object): """The GreenPool ...
sarthfrey/Texty
refs/heads/master
lib/twilio/rest/resources/addresses.py
46
from twilio.exceptions import TwilioException from twilio.rest.resources import InstanceResource, ListResource class DependentPhoneNumber(InstanceResource): """A purchased phone number that depends on a particular :class:`Address`. Attributes are the same as :class:`PhoneNumber`. DependentPhoneNumbe...
JonGal/appengine-ml-demo
refs/heads/master
app/lib/tests/contrib/django_util/settings.py
22
# Copyright 2015 Google 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 required by applicable law or agree...
brianwoo/django-tutorial
refs/heads/master
ENV/lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/introspection.py
539
import sys import cx_Oracle from django.db.backends.oracle.introspection import DatabaseIntrospection from django.utils import six class OracleIntrospection(DatabaseIntrospection): # Associating any OBJECTVAR instances with GeometryField. Of course, # this won't work right on Oracle objects that aren't MDS...
dhluong90/PokemonGo-Bot
refs/heads/master
pokemongo_bot/cell_workers/pokemon_catch_worker.py
1
# -*- coding: utf-8 -*- import os import time import json import logging import time from random import random, randrange from pokemongo_bot import inventory from pokemongo_bot.base_task import BaseTask from pokemongo_bot.human_behaviour import sleep, action_delay from pokemongo_bot.inventory import Pokemon from pokem...
ukanga/SickRage
refs/heads/master
lib/rebulk/pattern.py
18
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Abstract pattern class definition along with various implementations (regexp, string, functional) """ # pylint: disable=super-init-not-called,wrong-import-position from abc import ABCMeta, abstractmethod, abstractproperty import six from . import debug from .loose im...
leafclick/intellij-community
refs/heads/master
python/testData/copyPaste/multiLine/IndentInnerFunction1.src.py
166
<selection>def foo(self): x = 1 y = 2 </selection>
juwi/hbase
refs/heads/master
hbase-examples/src/main/python/thrift2/gen-py/hbase/constants.py
263
# # Autogenerated by Thrift Compiler (0.9.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TException, TApplicationException from ttypes import *
lamblin/pylearn2
refs/heads/master
pylearn2/config/old_config.py
45
import yaml import inspect import types from pylearn2.utils.exc import reraise_as global resolvers def load(json_file_path): """ given a file path to a json file, returns the dictionary definde by the json file """ f = open(json_file_path) lines = f.readlines() f.close() content = ''.join(lines...
styxit/CouchPotatoServer
refs/heads/master
libs/sqlalchemy/orm/interfaces.py
18
# orm/interfaces.py # Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ Contains various base classes used throughout the ORM. Defines the now depreca...
karesansui/karesansui
refs/heads/develop
karesansui/lib/parser/base/null_parser.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of Karesansui Core. # # Copyright (C) 2009-2012 HDE, Inc. # # 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 restric...
fingon/hnet-core
refs/heads/master
util/visualize_log.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # -*- Python -*- # # $Id: visualize_log.py $ # # Author: Markus Stenberg <markus stenberg@iki.fi> # # Copyright (c) 2012 cisco Systems, Inc. # # Created: Sun Nov 4 09:31:52 2012 mstenber # Last modified: Sun Nov 4 10:34:03 2012 mstenber # Edit time: 20 min # """...
tuxfux-hlp-notes/python-batches
refs/heads/master
archieves/batch-57/modules/sheets/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/charsetgroupprober.py
2928
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights ...
epssy/hue
refs/heads/master
desktop/core/ext-py/pysqlite/doc/sphinx/conf.py
40
# -*- coding: utf-8 -*- # # pysqlite documentation build configuration file, created by # sphinx-quickstart.py on Sat Mar 22 02:47:54 2008. # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pic...
mraspaud/dask
refs/heads/master
dask/diagnostics/__init__.py
8
from __future__ import absolute_import, division, print_function from .profile import Profiler, ResourceProfiler, CacheProfiler from .progress import ProgressBar from .profile_visualize import visualize
tysonclugg/django
refs/heads/master
tests/i18n/test_extraction.py
27
import os import re import shutil import time import warnings from io import StringIO from unittest import mock, skipIf, skipUnless from admin_scripts.tests import AdminScriptTestCase from django.core import management from django.core.management import execute_from_command_line from django.core.management.base impor...
mrbox/django
refs/heads/master
tests/generic_views/test_list.py
309
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime from django.core.exceptions import ImproperlyConfigured from django.test import TestCase, override_settings from django.utils.encoding import force_str from django.views.generic.base import View from .models import Artist, Author, Book, ...
100Shapes/100shapes.github.com
refs/heads/src
ohs_site/case_studies/assets.py
1
from django_assets import Bundle, register styles_moo = Bundle( 'css/moo.css', output='gen/moo.%(version)s.css') register('css_moo', styles_moo)
nicholasserra/sentry
refs/heads/master
src/sentry/api/endpoints/__init__.py
2878
from __future__ import absolute_import
pjdelport/django
refs/heads/master
django/utils/unittest/loader.py
353
"""Loading unittests.""" import os import re import sys import traceback import types import unittest from fnmatch import fnmatch from django.utils.unittest import case, suite try: from os.path import relpath except ImportError: from django.utils.unittest.compatibility import relpath __unittest = True de...
taaviteska/django
refs/heads/master
django/contrib/messages/storage/base.py
18
from django.conf import settings from django.contrib.messages import constants, utils from django.utils.encoding import force_text LEVEL_TAGS = utils.get_level_tags() class Message: """ Represent an actual message that can be stored in any of the supported storage classes (typically session- or cookie-ba...
ArcherSys/ArcherSys
refs/heads/master
Lib/site-packages/pkginfo/wheel.py
3
from io import StringIO import os import zipfile from .distribution import Distribution from .distribution import must_decode from .distribution import parse class Wheel(Distribution): def __init__(self, filename, metadata_version=None): self.filename = filename self.metadata_version = metadata...
j-carpentier/nova
refs/heads/master
nova/tests/unit/fake_block_device.py
63
# Copyright 2013 Red Hat Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
mexeniz/django-oscar
refs/heads/master
tests/unit/core/customisation_tests.py
26
import os import tempfile from django.test import TestCase from django.conf import settings from oscar.core import customisation VALID_FOLDER_PATH = 'tests/_site/apps' class TestUtilities(TestCase): def test_subfolder_extraction(self): folders = list(customisation.subfolders('/var/www/eggs')) ...
ahmadiga/min_edx
refs/heads/master
cms/djangoapps/contentstore/course_group_config.py
70
""" Class for manipulating groups configuration on a course object. """ import json import logging from util.db import generate_int_id, MYSQL_MAX_INT from django.utils.translation import ugettext as _ from contentstore.utils import reverse_usage_url from xmodule.partitions.partitions import UserPartition from xmodule...
zhuango/python
refs/heads/master
pythonLearning/dataStructure/array.py
2
import array symbols = '$¢£¥€¤' # The first argument of the array constructor defines the storage type # used for the numbers in the array # not build a list. generate one element at a time. arr = array.array('I', (ord(symbol) for symbol in symbols)) # build a list. arr = array.array('I', [ord(symbol) for symbol in...
Arc-Lightning/FutureStack
refs/heads/master
Calendar/App/worker.py
1
import logging import os import sys import time from multiprocessing import Queue from arame.gateway import ArameConsumer from brightside.connection import Connection from brightside.command_processor import CommandProcessor, Request from brightside.dispatch import ConsumerConfiguration, Dispatcher from brightside.mes...
LarsFronius/ansible
refs/heads/devel
lib/ansible/modules/cloud/azure/azure_rm_resourcegroup.py
29
#!/usr/bin/python # # 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 Soft...
lz1988/django-web2015
refs/heads/master
tests/regressiontests/admin_scripts/models.py
177
from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Article(models.Model): headline = models.CharField(max_length=100, default='Default headline') pub_date = models.DateTimeField() def __str__(self): return self.headline ...
yanchen036/tensorflow
refs/heads/master
tensorflow/python/ops/histogram_ops_test.py
17
# 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...
stasm/stet
refs/heads/master
stet/management/commands/update.py
1
import sys from django.core.management.base import BaseCommand, CommandError from stet.models import Article class Command(BaseCommand): args = 'FILENAME -' help = 'Records the new contents of a file called FILENAME in the ' \ 'database. The contents are read from the STDIN.' def handle(sel...
Changaco/oh-mainline
refs/heads/master
vendor/packages/docutils/docutils/writers/pseudoxml.py
180
# $Id: pseudoxml.py 7320 2012-01-19 22:33:02Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Simple internal document tree Writer, writes indented pseudo-XML. """ __docformat__ = 'reStructuredText' from docutils import writers class Writer(w...
chris-chambers/llvm
refs/heads/sbbm
utils/lit/tests/shtest-encoding.py
131
# RUN: true # Here is a string that cannot be decoded in line mode: Â.
saurabh6790/medsyn-app
refs/heads/master
selling/doctype/referrer_comission/referrer_comission.py
798
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt # For license information, please see license.txt from __future__ import unicode_literals import webnotes class DocType: def __init__(self, d, dl): self.doc, self.doclist = d, dl
babrodtk/equelle
refs/heads/master
tools/runequelle/ebs.py
3
#!/usr/bin/python import argparse import subprocess import os equelleroot = "/home/jse/projects/equelle/" runequelleroot = equelleroot + "tools/runequelle/" eccompiler = [equelleroot + "compiler/ec"] builddir = "build" def genSimulatorName(source): return os.path.basename(os.path.splitext(source)[0]) def genCpp...
Danfocus/Flexget
refs/heads/develop
flexget/plugins/input/generate.py
4
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import logging from flexget import plugin from flexget.event import event from flexget.entry import Entry log = logging.getLogger(__name__.rsplit('.')[-1]) class Genera...
thaim/ansible
refs/heads/fix-broken-link
test/units/modules/network/f5/test_bigip_device_ha_group.py
22
# -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytest import sys if sys.version_info < (2...
jayceyxc/hue
refs/heads/master
desktop/core/ext-py/Babel-0.9.6/babel/messages/tests/catalog.py
61
# -*- coding: utf-8 -*- # # Copyright (C) 2007 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://babel.edgewall.org/wiki/License. # # This software cons...
blindroot/django
refs/heads/master
django/contrib/sitemaps/__init__.py
58
from django.apps import apps as django_apps from django.conf import settings from django.core import paginator from django.core.exceptions import ImproperlyConfigured from django.urls import NoReverseMatch, reverse from django.utils import translation from django.utils.six.moves.urllib.parse import urlencode from djang...
DevinDewitt/pyqt5
refs/heads/master
examples/animation/states/states_rc.py
3
# -*- coding: utf-8 -*- # Resource object code # # Created: Thu May 2 17:13:38 2013 # by: The Resource Compiler for PyQt (Qt v5.0.2) # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore qt_resource_data = b"\ \x00\x00\x15\x14\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x...
yencarnacion/jaikuengine
refs/heads/master
.google_appengine/lib/django-0.96/django/newforms/__init__.py
70
""" Django validation and HTML form handling. TODO: Default value for field Field labels Nestable Forms FatalValidationError -- short-circuits all other validators on a form ValidationWarning "This form field requires foo.js" and form.js_includes() """ from util import ValidationError from wid...
aethaniel/micropython
refs/heads/master
tests/unicode/unicode_index.py
116
print("Привет".find("т")) print("Привет".find("П")) print("Привет".rfind("т")) print("Привет".rfind("П")) print("Привет".index("т")) print("Привет".index("П"))
ryfeus/lambda-packs
refs/heads/master
Pandas_numpy/source/pandas/tools/hashing.py
16
import warnings import sys m = sys.modules['pandas.tools.hashing'] for t in ['hash_pandas_object', 'hash_array']: def outer(t=t): def wrapper(*args, **kwargs): from pandas import util warnings.warn("pandas.tools.hashing is deprecated and will be " "remove...
nadeemat/namebench
refs/heads/master
libnamebench/better_webbrowser.py
175
#!/usr/bin/env python # Copyright 2009 Google 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...
mchristopher/PokemonGo-DesktopMap
refs/heads/master
app/pylibs/shared/pgoapi/protos/POGOProtos/Networking/Platform/Requests/SendEncryptedSignatureRequest_pb2.py
6
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: POGOProtos/Networking/Platform/Requests/SendEncryptedSignatureRequest.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import messag...
pinax/pinax-documents
refs/heads/master
pinax/documents/tests/test.py
1
from django.core.files.uploadedfile import SimpleUploadedFile from test_plus.test import TestCase as PlusTestCase from ..exceptions import DuplicateDocumentNameError, DuplicateFolderNameError from ..models import Document, Folder class BaseTest(PlusTestCase): def setUp(self): self.user = self.make_user...
ryanahall/django
refs/heads/master
tests/admin_scripts/management/commands/custom_startproject.py
378
from django.core.management.commands.startproject import Command as BaseCommand class Command(BaseCommand): def add_arguments(self, parser): super(Command, self).add_arguments(parser) parser.add_argument('--extra', help='An arbitrary extra value passed to the context')
nacc/autotest
refs/heads/master
client/shared/base_barrier.py
5
import socket, errno, logging from time import time, sleep from autotest.client.shared import error # default barrier port _DEFAULT_PORT = 11922 def get_host_from_id(hostid): # Remove any trailing local identifier following a #. # This allows multiple members per host which is particularly # helpful in te...
nealtodd/django
refs/heads/master
django/core/serializers/__init__.py
347
""" Interfaces for serializing Django objects. Usage:: from django.core import serializers json = serializers.serialize("json", some_queryset) objects = list(serializers.deserialize("json", json)) To add your own serializers, use the SERIALIZATION_MODULES setting:: SERIALIZATION_MODULES = { ...
bountysource/www.gittip.com
refs/heads/master
gittip/fake_data.py
1
from faker import Factory from gittip import orm from gittip.models.tip import Tip from gittip.models.participant import Participant from gittip.models.elsewhere import Elsewhere from gittip import AMOUNTS import string import random faker = Factory.create() platforms = ['github', 'twitter', 'bitbucket'] def fake_t...
maartenq/ansible
refs/heads/devel
lib/ansible/modules/cloud/azure/azure_rm_sqlserver_facts.py
12
#!/usr/bin/python # # Copyright (c) 2017 Zim Kalinowski, <zikalino@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', ...
takaakiaoki/PyFoam
refs/heads/master
bin/pyFoamCompareDictionary.py
3
#! /usr/bin/env python from PyFoam.Applications.CompareDictionary import CompareDictionary CompareDictionary()
h4ck3rm1k3/orca-sonar
refs/heads/master
src/orca/scripts/apps/rhythmbox/formatting.py
6
# Orca # # Copyright 2006-2009 Sun Microsystems 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.1 of the License, or (at your option) any later version. # # This...
zodouglass/PBNetworking
refs/heads/master
server/tamarin-source/tamarin-central/build/__init__.py
3
# -*- Mode: Python; indent-tabs-mode: nil -*- # ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1/GPL 2.0/LGPL 2.1 # # The contents of this file are subject to the Mozilla Public License Version # 1.1 (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the Licen...
tkymgr/KTG_kernel2.0
refs/heads/master
arch/ia64/scripts/unwcheck.py
13143
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
bcarroll/authmgr
refs/heads/master
python-3.6.2-Win64/Lib/site-packages/pip/status_codes.py
1002
from __future__ import absolute_import SUCCESS = 0 ERROR = 1 UNKNOWN_ERROR = 2 VIRTUALENV_NOT_FOUND = 3 PREVIOUS_BUILD_DIR_ERROR = 4 NO_MATCHES_FOUND = 23
zaffra/Inquire
refs/heads/master
GAE/django/contrib/markup/tests.py
245
# Quick tests for the markup templatetags (django.contrib.markup) import re from django.template import Template, Context, add_to_builtins from django.utils import unittest from django.utils.html import escape add_to_builtins('django.contrib.markup.templatetags.markup') try: import textile except ImportError: ...
imclab/ckanext-comments
refs/heads/master
ckanext/comments/helpers.py
2
def get_comments_dict(url): import ckan.model as model from ckan.logic import get_action return get_action('thread_show')({'model': model}, {'url': url})
tropp/acq4
refs/heads/develop
acq4/pyqtgraph/flowchart/eq.py
28
# -*- coding: utf-8 -*- from numpy import ndarray, bool_ from ..metaarray import MetaArray def eq(a, b): """The great missing equivalence function: Guaranteed evaluation to a single bool value.""" if a is b: return True try: e = a==b except ValueError: return False ...
rouge8/20questions
refs/heads/master
webinterface.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # ''' webinterface.py Andy Freeland and Dan Levy 5 June 2010 Web interface to the twenty questions game. Each page/url is represented by a class. Uses the web.py library from http://webpy.org. Stores user data in a sesssion. HTML pages are ...
BehavioralInsightsTeam/edx-platform
refs/heads/release-bit
lms/djangoapps/certificates/tests/test_create_fake_cert.py
12
"""Tests for the create_fake_certs management command. """ from django.core.management import call_command from django.core.management.base import CommandError from django.test import TestCase from nose.plugins.attrib import attr from opaque_keys.edx.locator import CourseLocator from six import text_type from lms.dja...
stoimenoff/ultimate-tic-tac-toe
refs/heads/master
ultimatetictactoe/gui/multiplayer/hotseatgame.py
1
from ... import game from ..qboards import QMacroBoard from PyQt5.QtWidgets import QWidget, QVBoxLayout from PyQt5.QtCore import pyqtSignal class HotSeatGame(QWidget): gameEnded = pyqtSignal() def __init__(self): super(HotSeatGame, self).__init__() layout = QVBoxLayout() self.qBoard ...
rlr/kitsune
refs/heads/master
kitsune/notifications/decorators.py
20
notification_handlers = set() def notification_handler(fn): """ Register a function to be called via Celery for every notification. This may be used as a decorator or as a simple function. """ notification_handlers.add(fn) return fn
angdraug/nova
refs/heads/master
nova/db/sqlalchemy/migrate_repo/versions/233_add_stats_in_compute_nodes.py
11
# Copyright (c) 2014 Rackspace Hosting # 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 req...
coolshou/htc_dlxub1_kernel-3.4.10
refs/heads/master
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...
PF2-pasteur-fr/seqan
refs/heads/master
util/bin/skel.py
28
#!/usr/bin/env python """SeqAn Skelleton Creation.""" import os.path import sys def main(): path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'py_lib')) sys.path.insert(0, path) import seqan.skel return seqan.skel.main() if __name__ == '__main__': sys.exit(main())
bertucho/epic-movie-quotes-quiz
refs/heads/master
dialogos/build/Twisted/twisted/names/authority.py
35
# -*- test-case-name: twisted.names.test.test_names -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Authoritative resolvers. """ import os import time from twisted.names import dns, error from twisted.internet import defer from twisted.python import failure from twisted.python.compat ...
darthvish/subtitle_automate
refs/heads/master
basic_functions.py
1
import os CONFIG_FILE = os.path.join(os.getcwd(), "config.txt") def add_folder(dir_name): config_status = file_exists(CONFIG_FILE) dir_status = dir_exists(dir_name) if config_status: if dir_status: fh = open(CONFIG_FILE, "a") fh.write("%s%s" %(dir_name, "\n")) ...
4eek/edx-platform
refs/heads/master
cms/djangoapps/contentstore/views/tests/test_credit_eligibility.py
121
""" Unit tests for credit eligibility UI in Studio. """ import mock from contentstore.tests.utils import CourseTestCase from contentstore.utils import reverse_course_url from xmodule.modulestore.tests.factories import CourseFactory from openedx.core.djangoapps.credit.api import get_credit_requirements from openedx.c...
mhbu50/erpnext
refs/heads/develop
erpnext/patches/v7_0/remove_old_earning_deduction_doctypes.py
54
# 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 def execute(): if frappe.db.exists("DocType", "Salary Component"): for dt in ("Salary Structure Earning", "Salary Structure Deducti...
mlyundin/scikit-learn
refs/heads/master
sklearn/preprocessing/tests/test_imputation.py
213
import numpy as np from scipy import sparse from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_false from sklearn.utils.testing import assert_true from sklearn.preprocessing.imputa...
d40223223/2015cd_midterm
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/test/test_re.py
718
# FIXME: brython: implement test.support #from test.support import verbose, run_unittest, gc_collect, bigmemtest, _2G, \ # cpython_only verbose = True # FIXME: brython: Not used in this module ? #import io import re # FIXME: brython: implement re.Scanner #from re import Scanner import sre_constants import sys...
myFengo2015/volatility
refs/heads/master
volatility/protos.py
58
protos = { 0:"HOPOPT", 1:"ICMP", 2:"IGMP", 3:"GGP", 4:"IPv4", 5:"ST", 6:"TCP", 7:"CBT", 8:"EGP", 9:"IGP", 10:"BBN-RCC-MON", 11:"NVP-II", 12:"PUP", 13:"ARGUS", 14:"EMCON",...