repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
philanthropy-u/edx-platform | refs/heads/master | cms/djangoapps/contentstore/views/tests/test_organizations.py | 13 | """Tests covering the Organizations listing on the Studio home."""
import json
from django.urls import reverse
from django.test import TestCase
from mock import patch
from student.tests.factories import UserFactory
from util.organizations_helpers import add_organization
@patch.dict('django.conf.settings.FEATURES', ... |
gdementen/numba | refs/heads/master | numba/tests/test_datamodel.py | 6 | from __future__ import print_function, absolute_import
from llvmlite import ir, binding as ll
from numba import types
from numba import unittest_support as unittest
from numba import datamodel
from numba.datamodel.testing import test_factory
class TestBool(test_factory()):
fe_type = types.boolean
class TestPy... |
joshka/SoundCloud2.Bundle | refs/heads/master | Contents/Libraries/Shared/requests/packages/chardet/constants.py | 3007 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... |
tesidroni/mp | refs/heads/master | Lib/site-packages/numpy/oldnumeric/alter_code1.py | 101 | """
This module converts code written for Numeric to run with numpy
Makes the following changes:
* Changes import statements (warns of use of from Numeric import *)
* Changes import statements (using numerix) ...
* Makes search and replace changes to:
- .typecode()
- .iscontiguous()
- .byteswapped()
- .... |
chuan9/chromium-crosswalk | refs/heads/master | tools/cygprofile/check_orderfile.py | 30 | #!/usr/bin/python
# Copyright 2015 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.
"""Check that symbols are ordered into a binary as they appear in the orderfile.
"""
import logging
import optparse
import sys
import cyg... |
poljeff/odoo | refs/heads/8.0 | addons/base_report_designer/plugin/openerp_report_designer/bin/script/compile_all.py | 384 | #########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... |
gnuhub/intellij-community | refs/heads/master | python/lib/Lib/string.py | 92 | """A collection of string operations (most are no longer used).
Warning: most of the code you see here isn't normally used nowadays.
Beginning with Python 1.6, many of these functions are implemented as
methods on the standard string object. They used to be implemented by
a built-in module called strop, but strop is n... |
jeffery9/mixprint_addons | refs/heads/master | share/wizard/share_wizard.py | 5 | # -*- 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... |
carvalhomb/tsmells | refs/heads/master | guess/src/Lib/encodings/cp856.py | 2 | """ Python Character Mapping Codec generated from 'CP856.TXT' with gencodec.py.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
(c) Copyright 2000 Guido van Rossum.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(s... |
SamiHiltunen/invenio-deposit | refs/heads/master | invenio_deposit/__init__.py | 22 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2013, 2014 CERN.
#
# Invenio 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 (at your option) any... |
rbarlow/pulp | refs/heads/master | nodes/extensions/admin/pulp_node/extensions/admin/__init__.py | 187 | # Copyright (c) 2013 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or implied,
# including the impl... |
Work4Labs/lettuce | refs/heads/master | tests/integration/lib/Django-1.3/django/utils/dateformat.py | 234 | """
PHP date() style date formatting
See http://www.php.net/date for format strings
Usage:
>>> import datetime
>>> d = datetime.datetime.now()
>>> df = DateFormat(d)
>>> print df.format('jS F Y H:i')
7th October 2003 11:39
>>>
"""
import re
import time
import calendar
from django.utils.dates import MONTHS, MONTHS_3, ... |
chriskmanx/qmole | refs/heads/master | QMOLEDEV/node/tools/scons/scons-local-1.2.0/SCons/Tool/cc.py | 12 | """SCons.Tool.cc
Tool-specific initialization for generic Posix C compilers.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundati... |
xxxVxxx/troposphere | refs/heads/master | troposphere/ecs.py | 20 | from . import AWSObject, AWSProperty, Ref
from .validators import boolean, network_port, positive_integer
class Cluster(AWSObject):
resource_type = "AWS::ECS::Cluster"
props = {}
class LoadBalancer(AWSProperty):
props = {
'ContainerName': (basestring, False),
'ContainerPort': (network_p... |
nemesisdesign/django | refs/heads/master | tests/generic_relations/models.py | 90 | """
Generic relations
Generic relations let an object have a foreign key to any object through a
content-type/object-id field. A ``GenericForeignKey`` field can point to any
object, be it animal, vegetable, or mineral.
The canonical example is tags (although this example implementation is *far*
from complete).
"""
f... |
willdecker/suds | refs/heads/master | suds/xsd/doctor.py | 205 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... |
codycuellar/bill_tracker | refs/heads/master | billtracker/notify.py | 1 | #! /usr/bin/env python
import core
import logging
import config as cfg
import argparse
logger = logging.getLogger()
def startup():
parser = argparse.ArgumentParser()
parser.add_argument('-d', '--debug', action='store_true', default=False,
help='Enable debug mode.')
args = parser.parse_args()
if args.debu... |
guettli/django | refs/heads/master | django/contrib/gis/gdal/libgdal.py | 64 | from __future__ import unicode_literals
import logging
import os
import re
from ctypes import CDLL, CFUNCTYPE, c_char_p, c_int
from ctypes.util import find_library
from django.contrib.gis.gdal.error import GDALException
from django.core.exceptions import ImproperlyConfigured
logger = logging.getLogger('django.contri... |
Jimmyhua94/MyoFlie | refs/heads/master | lib/cfclient/utils/zmq_led_driver.py | 5 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... |
JeffAbrahamson/gtd | refs/heads/master | find_similar.py | 1 | #!/usr/bin/env python
"""Generate a plot of my recent time usage at my computer.
If a first and numeric argument is present, it is the number of days of
history to show. The default is ten.
"""
from __future__ import print_function
import argparse
from lib_gtd import gtd_load
from operator import itemgetter
from s... |
jmcarp/osf.io | refs/heads/develop | scripts/dataverse/connect_external_accounts.py | 44 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import logging
from modularodm import Q
from website.app import init_app
from scripts import utils as script_utils
from framework.transactions.context import TokuTransaction
from website.addons.dataverse.model import AddonDataverseNodeSettings
logger = logging... |
evansd/django | refs/heads/master | tests/i18n/test_management.py | 48 | import os
from django.core.management.commands.makemessages import TranslatableFile
from django.test import SimpleTestCase
class TranslatableFileTests(SimpleTestCase):
def test_repr(self):
dirpath = 'dir'
file_name = 'example'
trans_file = TranslatableFile(dirpath=dirpath, file_name=file... |
thinkopensolutions/l10n-brazil | refs/heads/10.0 | sped_nfe/wizards/wizard_nfe_motivo_cancelamento.py | 2 | from __future__ import division, print_function, unicode_literals
from odoo import api, fields, models, _
from odoo.exceptions import Warning as UserError
class NfeCancelamentoWizard(models.TransientModel):
_name = b'nfe.cancelamento.wizard'
motivo_cancelamento = fields.Char(
string='Justificativa p... |
FHannes/intellij-community | refs/heads/master | python/lib/Lib/SocketServer.py | 70 | """Generic socket server classes.
This module tries to capture the various aspects of defining a server:
For socket-based servers:
- address family:
- AF_INET{,6}: IP (Internet Protocol) sockets (default)
- AF_UNIX: Unix domain sockets
- others, e.g. AF_DECNET are conceivable (see <socket.h>
... |
Zhongqilong/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/distutils/tests/test_util.py | 94 | """Tests for distutils.util."""
import os
import sys
import unittest
from copy import copy
from test.support import run_unittest
from distutils.errors import DistutilsPlatformError, DistutilsByteCompileError
from distutils.util import (get_platform, convert_path, change_root,
check_environ,... |
edwardzhou1980/bite-project | refs/heads/master | deps/gdata-python-client/samples/apps/provisioning_oauth2_example.py | 23 | #!/usr/bin/python
#
# Copyright 2011 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 b... |
blackye/luscan-devel | refs/heads/master | golismero/libs/bind_sql_inject/__init__.py | 4 | #!/usr/bin/env/python
#-*- coding:utf-8 -*-
__author__ = 'BlackYe.'
|
akretion/project-service | refs/heads/8.0 | service_desk_issue/__openerp__.py | 8 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2012-2013 Daniel Reis
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Sof... |
NL66278/OCB | refs/heads/8.0 | addons/gamification/__openerp__.py | 299 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
bloyl/mne-python | refs/heads/placeholder | examples/preprocessing/define_target_events.py | 29 | """
============================================================
Define target events based on time lag, plot evoked response
============================================================
This script shows how to define higher order events based on
time lag between reference and target events. For
illustration, we will... |
gelahcem/ATF | refs/heads/master | Test/FunctionalTests/CommonTestScripts/FsmUtil.py | 10 | #Copyright (c) 2014 Sony Computer Entertainment America LLC. See License.txt.
import Test
def AddNewStateAndVerify(editingContext, xPos, yPos, label, size=64):
newState = editingContext.InsertState(xPos, yPos, label, size)
Test.Equal(label, newState.Name, "Verify label")
Test.Equal(xPos, newState.Position.X, "Veri... |
jamesliu/mxnet | refs/heads/master | example/image-classification/fine-tune.py | 5 | # 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 u... |
blrm/robottelo | refs/heads/master | tests/foreman/cli/test_capsule.py | 3 | # -*- encoding: utf-8 -*-
"""Test class for the capsule CLI."""
import random
import re
from fauxfactory import gen_alphanumeric, gen_string
from robottelo.cli.base import CLIReturnCodeError
from robottelo.cli.factory import CLIFactoryError, make_proxy
from robottelo.cli.proxy import Proxy, default_url_on_new_port
fro... |
ronbeltran/webapp2-bedrock | refs/heads/master | bedrock/app/utils/jinja.py | 1 | import os
import webapp2
import jinja2
import config
from app.utils.compressor import WEBASSETS_ENV
JINJA_ENV = jinja2.Environment(
autoescape=lambda x: True,
extensions=['jinja2.ext.autoescape',
'webassets.ext.jinja2.AssetsExtension'],
loader=jinja2.FileSystemLoader(
os.path.joi... |
mozman/ezdxf | refs/heads/master | examples/render/show_all_std_line_types.py | 1 | # Copyright (c) 2019 Manfred Moitzi
# License: MIT License
import ezdxf
from ezdxf.math import Vec3
from ezdxf.tools.standards import linetypes
doc = ezdxf.new('R2007', setup=True)
msp = doc.modelspace()
# How to change the global linetype scaling:
doc.header['$LTSCALE'] = .5
p1 = Vec3(0, 0)
p2 = Vec3(9, 0)
delta =... |
tkurnosova/selenium | refs/heads/master | py/test/selenium/webdriver/common/executing_async_javascript_tests.py | 63 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
zsiciarz/django | refs/heads/master | django/db/backends/base/client.py | 98 | class BaseDatabaseClient:
"""Encapsulate backend-specific methods for opening a client shell."""
# This should be a string representing the name of the executable
# (e.g., "psql"). Subclasses must override this.
executable_name = None
def __init__(self, connection):
# connection is an insta... |
oliverlee/sympy | refs/heads/master | sympy/diffgeom/tests/test_diffgeom.py | 79 | from sympy.diffgeom.rn import R2, R2_p, R2_r, R3_r, R3_c, R3_s
from sympy.diffgeom import (Commutator, Differential, TensorProduct,
WedgeProduct, BaseCovarDerivativeOp, CovarDerivativeOp, LieDerivative,
covariant_order, contravariant_order, twoform_to_matrix, metric_to_Christoffel_1st,
metric_to... |
ycaihua/kbengine | refs/heads/master | kbe/tools/server/install/installer.py | 22 | #!/usr/bin/python
# -*- coding:utf-8 -*-
import urllib, socket
import tarfile, zipfile, tempfile
import os, sys, re, platform, getopt, getpass, random, time, subprocess, shutil, string
from xml.etree import ElementTree as ET
from subprocess import check_call
if platform.system() == 'Windows':
pass
else:
import ... |
thecodinghub/news-for-good | refs/heads/master | news/Lib/site-packages/pip/_vendor/html5lib/filters/lint.py | 328 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from . import base
from ..constants import namespaces, voidElements
from ..constants import spaceCharacters
spaceCharacters = "".join(spaceCharacters)
class Filter(base.Filter):
def __init__(self, source, r... |
mindbender-studio/core | refs/heads/master | avalon/tools/views.py | 2 | from ..vendor.Qt import QtWidgets, QtCore
class DeselectableTreeView(QtWidgets.QTreeView):
"""A tree view that deselects on clicking on an empty area in the view"""
def mousePressEvent(self, event):
index = self.indexAt(event.pos())
if not index.isValid():
# clear the selection
... |
atsiaras/transit_simulator | refs/heads/master | setup.py | 1 | from setuptools import setup
import codecs
import os
import glob
name = 'transit_simulator'
description = 'Graphic interface for transit visualisation'
url = 'https://github.com/atsiaras/transit_simulator'
install_requires = ['matplotlib', 'numpy', 'pylightcurve']
os.chdir(os.path.abspath(os.path.dirname(__file__)))
... |
drammock/expyfun | refs/heads/fix-install-docs | expyfun/_sound_controllers/_rtmixer.py | 2 | """python-rtmixer interface for sound output."""
# Authors: Eric Larson <larsoner@uw.edu>
#
# License: BSD (3-clause)
import atexit
import sys
import numpy as np
from rtmixer import Mixer, RingBuffer
import sounddevice
from .._utils import logger, get_config
_PRIORITY = 100
_DEFAULT_NAME = None
# only initialize ... |
zeyuanxy/leet-code | refs/heads/master | vol7/coin-change/coin-change.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: Zeyuan Shang
# @Date: 2015-12-29 18:41:13
# @Last Modified by: Zeyuan Shang
# @Last Modified time: 2015-12-29 18:41:24
class Solution(object):
def coinChange(self, coins, amount):
"""
:type coins: List[int]
:type amount: int
... |
khaleeque-ansari/Online-Coding- | refs/heads/master | Hackerrank/Graph Theory/Snakes & Ladders.py | 1 | # Enter your code here. Read input from STDIN. Print output to STDOUT
#T = input()
T = 1
from collections import namedtuple
from pprint import pprint as pp
inf = float('inf')
Edge = namedtuple('Edge', 'start, end, cost')
class Graph():
def __init__(self, edges):
self.edges = edges2 = [... |
0be1/ansible | refs/heads/devel | v2/ansible/plugins/shell/__init__.py | 7690 | # (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... |
jteehan/cfme_tests | refs/heads/master | sprout/sprout/irc_bot.py | 15 | # -*- coding: utf-8 -*-
from sprout import settings
import json
import pika
REQUIRED = {'PIKA_USER', 'PIKA_PASS', 'PIKA_HOST', 'PIKA_CHANNEL', 'PIKA_ROUTING_KEY'}
def send_message(message):
if not any(hasattr(settings, item) for item in REQUIRED):
return
url = "amqp://" + settings.PIKA_USER + ":" +... |
concurrence/concurrence | refs/heads/master | scripts/httpperf.py | 2 | #!/usr/bin/env stackless
from concurrence import dispatch, quit, Tasklet, Channel
from concurrence.http.client import HTTPConnection
from concurrence.statistic import gamma_filter
from concurrence.containers.deque import Deque
from optparse import OptionParser
import urlparse
import logging
import time
import sys
de... |
wakatime/wakatime | refs/heads/master | tests/test_languages.py | 1 | # -*- coding: utf-8 -*-
from wakatime.main import execute
from wakatime.packages import requests
import os
import time
from wakatime.compat import u
from wakatime.constants import SUCCESS
from wakatime.stats import guess_lexer
from . import utils
from .utils import ANY, CustomResponse
class LanguagesTestCase(utils... |
meteorcloudy/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/clip_ops_test.py | 13 | # 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... |
projectcalico/calico-neutron | refs/heads/calico-readme | neutron/plugins/cisco/extensions/n1kv.py | 37 | # Copyright 2013 Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
kustodian/ansible | refs/heads/devel | lib/ansible/modules/network/vyos/vyos_system.py | 21 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
... |
tanglu-org/merge-o-matic | refs/heads/master | deb/controlfile.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# deb/controlfile.py - parse debian control files
#
# Copyright © 2008 Canonical Ltd.
# Author: Scott James Remnant <scott@ubuntu.com>.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of version 3 of the GNU General Public Licen... |
underbluewaters/marinemap | refs/heads/master | lingcod/straightline_spacing/tests.py | 1940 | """
This file demonstrates two different styles of tests (one doctest and one
unittest). These will both pass when you run "manage.py test".
Replace these with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
... |
jnnk/pyethereum | refs/heads/master | tests/remoteblocksdata.py | 4 | data_poc5v23_1 = "f987d1f8b5f8b1a0b13262b2076a5c570c69324b09fe7b47dae0cb153871b763565176d18574a8c5a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d4934794a39c2067eb45bc878818946d0f05a836b3da44faa0bb690805d24882bc7ccae6fc0f80ac146274d5b81c6a6e9c882cd9b0a649c9c7808340c0db208609184e72a000830ecab9808453bb008980... |
huongttlan/statsmodels | refs/heads/master | tools/cythonize.py | 28 | #!/usr/bin/env python
""" cythonize
Cythonize pyx files into C files as needed.
Usage: cythonize [root_dir]
Default [root_dir] is 'statsmodels'.
Checks pyx files to see if they have been changed relative to their
corresponding C files. If they have, then runs cython on these files to
recreate the C files.
The scr... |
dohoangkhiem/uwsgi | refs/heads/master | examples/staticfilesnmp.py | 17 | import uwsgi
from os import path
uwsgi.snmp_set_counter64(1, 0) # Number of requests
uwsgi.snmp_set_counter64(2, 0) # Number of bytes
def application(environ, start_response):
size = path.getsize('logo_uWSGI.png')
start_response('200 OK', [('Content-Type', 'image/png'), ('Content-Length', str(size))])
... |
LinkHS/incubator-mxnet | refs/heads/master | example/neural-style/end_to_end/model_vgg19.py | 43 | # 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 u... |
Amsoft-Systems/testlink-1.9.5 | refs/heads/master | third_party/fckeditor/editor/filemanager/connectors/py/fckcommands.py | 48 | #!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http://www.gnu.or... |
markflyhigh/incubator-beam | refs/heads/master | sdks/python/apache_beam/options/pipeline_options_validator_test.py | 1 | #
# 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 us... |
wreckJ/intellij-community | refs/heads/master | python/testData/mover/theSameLevelMultiple_afterDown.py | 83 | try:
a = 1
except ImportError as A:
print xrange
import <caret>tmp2; import tmp1
|
saurabh6790/pow-app | refs/heads/master | setup/doctype/company/charts/import_from_openerp.py | 30 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
"""
Import chart of accounts from OpenERP sources
"""
from __future__ import unicode_literals
import os, json
from xml.etree import ElementTree as ET
from webnotes.utils.datautils import r... |
leeyingmu/melee | refs/heads/master | melee/core/tasklet.py | 1 | # -*- coding: utf-8 -*-
"""
Common backgroup process execution framework.
You can define a .py file and run it by using the ``tasklet`` framework which will
handle the process's life cycle automatically。
Example Code:
"""
import os, sys, pkgutil, time, signal
from subprocess import Popen
from .env import config, logg... |
samfoo/servo | refs/heads/master | tests/wpt/harness/wptrunner/wptmanifest/node.py | 190 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
class NodeVisitor(object):
def visit(self, node):
# This is ugly as hell, but we don't have multimethods and... |
ChrisTruncer/Egress-Assess | refs/heads/master | datatypes/socials.py | 3 | '''
This module generates social security numbers
'''
from common import helpers
class Datatype:
def __init__(self, cli_object):
self.cli = "ssn"
self.description = "Social Security Numbers"
self.filetype = "text"
self.datasize = int(cli_object.data_size)
def create_ssn(se... |
midnightradio/comment-miner | refs/heads/master | strscan.py | 1 | import re
class StringScanner(object):
def __init__(self, string=None):
if string is not None and type(string) is not type(''): raise TypeError('Scanner works only on string')
else:
self.__string = string
self.__pos = 0
def __iadd__(self, string):
if string is n... |
pleaseproject/python-for-android | refs/heads/master | python-modules/twisted/twisted/__init__.py | 56 | # -*- test-case-name: twisted -*-
# Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Twisted: The Framework Of Your Internet.
"""
# Ensure the user is running the version of python we require.
import sys
if not hasattr(sys, "version_info") or sys.version_info < (2, 4):
raise R... |
15Dkatz/pants | refs/heads/master | tests/python/pants_test/engine/test_graph.py | 11 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import functools
imp... |
OptiPop/external_chromium_org | refs/heads/opti-5.1 | third_party/cython/src/Cython/Tests/__init__.py | 1472 | # empty file
|
ESSS/numpy | refs/heads/master | tools/win32build/misc/x86analysis.py | 29 | #! /usr/bin/env python
# Last Change: Sat Mar 28 02:00 AM 2009 J
# Try to identify instruction set used in binary (x86 only). This works by
# checking the assembly for instructions specific to sse, etc... Obviously,
# this won't work all the times (for example, if some instructions are used
# only after proper detecti... |
YYWen0o0/python-frame-django | refs/heads/master | django/core/management/commands/runfcgi.py | 120 | import argparse
import warnings
from django.core.management.base import BaseCommand
from django.utils.deprecation import RemovedInDjango19Warning
class Command(BaseCommand):
help = "Runs this project as a FastCGI application. Requires flup."
def add_arguments(self, parser):
parser.add_argument('args... |
kansanmuisti/datavaalit | refs/heads/master | web/stats/migrations/0001_initial.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):
# Adding model 'Statistic'
db.create_table('stats_statistic', (
('id', self.gf('django.db.models... |
OpenUpgrade/OpenUpgrade | refs/heads/8.0 | addons/l10n_ca/__openerp__.py | 260 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... |
accepton/accepton-python | refs/heads/master | accepton/promo_code.py | 1 | from datetime import datetime
from .base import Base
__all__ = ["PromoCode"]
class PromoCode(Base):
def __init__(self, attrs={}):
super(PromoCode, self).__init__(attrs)
self.initialize_attr("created_at", datetime)
self.initialize_attr("name", str)
self.initialize_attr("promo_type... |
mirrax/OpenBazaar | refs/heads/develop | dht/util.py | 13 | """
Collection of utility functions not bound to a particular class.
"""
import random
import time
from dht import constants
class BadGUIDError(Exception):
"""Exception raised on detecting a bad guid."""
pass
def now():
"""
Return whole seconds passed since Epoch.
"""
return int(time.tim... |
formiano/enigma2 | refs/heads/master | lib/python/Components/Converter/StaticMultiList.py | 132 | from enigma import eListboxPythonMultiContent
from Components.Converter.StringList import StringList
class StaticMultiList(StringList):
"""Turns a python list in 'multi list format' into a list which can be used in a listbox."""
def changed(self, what):
if not self.content:
self.content = eListboxPythonMultiCon... |
ee08b397/panda3d | refs/heads/master | direct/src/leveleditor/LevelLoaderBase.py | 11 | import imp
class LevelLoaderBase:
"""
Base calss for LevelLoader
which you will use to load level editor data in your game.
Refer LevelLoader.py for example.
"""
def __init__(self):
self.defaultPath = None # this should be set in your LevelLoader.py
self.initLoader()
def i... |
teslaji/homebase | refs/heads/master | venv/HomeBase/lib/python3.5/site-packages/django/contrib/gis/maps/google/overlays.py | 117 | from __future__ import unicode_literals
from functools import total_ordering
from django.contrib.gis.geos import (
LinearRing, LineString, Point, Polygon, fromstr,
)
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
from django.utils.html import html_safe
@html_safe
@pyt... |
gmr/tinman | refs/heads/master | tinman/config.py | 3 | """
Configuration Constants
"""
APPLICATION = 'Application'
DAEMON = 'Daemon'
HTTP_SERVER = 'HTTPServer'
LOGGING = 'Logging'
ROUTES = 'Routes'
ADAPTER = 'adapter'
AUTOMATIC = 'automatic'
BASE = 'base'
BASE_VARIABLE = '{{base}}'
CERT_REQS = 'cert_reqs'
DEBUG = 'debug'
DEFAULT_LOCALE = 'default_locale'
DB = 'db'
DIRECT... |
bsmrstu-warriors/Moytri--The-Drone-Aider | refs/heads/master | Lib/encodings/utf_8_sig.py | 412 | """ Python 'utf-8-sig' Codec
This work similar to UTF-8 with the following changes:
* On encoding/writing a UTF-8 encoded BOM will be prepended/written as the
first three bytes.
* On decoding/reading if the first three bytes are a UTF-8 encoded BOM, these
bytes will be skipped.
"""
import codecs
### Codec APIs
... |
PearsonIOKI/compose-forum | refs/heads/master | askbot/deps/django_authopenid/ldap_auth.py | 14 | import logging
from django.conf import settings as django_settings
from django.contrib.auth.models import User
from django.forms import EmailField, ValidationError
from askbot.conf import settings as askbot_settings
from askbot.deps.django_authopenid.models import UserAssociation
from askbot.models.signals import user_... |
Airphrame/ardupilot | refs/heads/master | Tools/LogAnalyzer/tests/TestEmpty.py | 346 | from LogAnalyzer import Test,TestResult
import DataflashLog
class TestEmpty(Test):
'''test for empty or near-empty logs'''
def __init__(self):
Test.__init__(self)
self.name = "Empty"
def run(self, logdata, verbose):
self.result = TestResult()
self.result.status = TestResult.StatusType.GOOD
# all the... |
rex-xxx/mt6572_x201 | refs/heads/master | docs/source.android.com/scripts/micro-httpd.py | 1 | #!/usr/bin/env python
# Copyright (C) 2010 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
drmrd/ansible | refs/heads/devel | lib/ansible/modules/net_tools/ipify_facts.py | 94 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
# 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',
... |
geekaia/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/html_module.py | 37 | import copy
from fs.errors import ResourceNotFoundError
import logging
import os
import sys
from lxml import etree
from path import path
from pkg_resources import resource_string
from xblock.fields import Scope, String, Boolean, List
from xmodule.editing_module import EditingDescriptor
from xmodule.html_checker import... |
apophys/freeipa | refs/heads/master | ipaclient/remote_plugins/2_164/idviews.py | 10 | #
# Copyright (C) 2016 FreeIPA Contributors see COPYING for license
#
# pylint: disable=unused-import
import six
from . import Command, Method, Object
from ipalib import api, parameters, output
from ipalib.parameters import DefaultFrom
from ipalib.plugable import Registry
from ipalib.text import _
from ipapython.dn ... |
wildjan/Flask | refs/heads/master | Work/Trivia - Module 5/env/Lib/site-packages/pip/_vendor/html5lib/treewalkers/__init__.py | 1229 | """A collection of modules for iterating through different kinds of
tree, generating tokens identical to those produced by the tokenizer
module.
To create a tree walker for a new type of tree, you need to do
implement a tree walker object (called TreeWalker by convention) that
implements a 'serialize' method taking a ... |
sanyaade-mobiledev/clusto | refs/heads/master | src/clusto/drivers/devices/common/portmixin.py | 3 | """
PortMixin is a basic mixin to be used with devices that have ports
"""
import re
import clusto
from clusto.exceptions import ConnectionException
class PortMixin:
"""Provide port capabilities to devices
The ports are defined in the Driver's _portmeta dictionary:
_portmeta = { '<porttype>' : {'... |
alistairlow/tensorflow | refs/heads/master | tensorflow/contrib/rnn/python/kernel_tests/gru_ops_test.py | 46 | # 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... |
MatthewWilkes/django | refs/heads/master | tests/gis_tests/utils.py | 327 | from unittest import skip
from django.conf import settings
from django.db import DEFAULT_DB_ALIAS
def no_backend(test_func, backend):
"Use this decorator to disable test on specified backend."
if settings.DATABASES[DEFAULT_DB_ALIAS]['ENGINE'].rsplit('.')[-1] == backend:
@skip("This test is skipped on... |
epequeno/ThinkPy-Solutions | refs/heads/master | ch03/3.03.py | 1 | # Exercise 3.3 Python provides a built-in function called len that returns
# the length of a string, so the value of len('allen') is 5.
# Write a function named right_justify that takes a string named s as a
# parameter and prints the string with enough leading spaces so that the last
# letter of the string is in col... |
greyhwndz/rethinkdb | refs/heads/next | external/v8_3.30.33.16/build/gyp/test/mac/gyptest-objc-gc.py | 90 | #!/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.
"""
Verifies that GC objc settings are handled correctly.
"""
import TestGyp
import sys
if sys.platform == 'darwin':
# set |match| to i... |
vinhqdang/project_euler | refs/heads/master | problem_29_fool.py | 1 | res = list ()
for i in range (2, 101):
for j in range (2, 101):
a = i ** j
if a not in res:
res.append (a)
print len(res) |
smilusingjavascript/blink | refs/heads/master | LayoutTests/http/tests/websocket/deflate-frame-invalid-parameter_wsh.py | 4 | # Copyright 2012, 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 fo... |
yigitguler/django | refs/heads/master | tests/syndication_tests/tests.py | 25 | from __future__ import unicode_literals
import datetime
from xml.dom import minidom
try:
import pytz
except ImportError:
pytz = None
from django.contrib.syndication import views
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase, override_settings
from django.test.utils ... |
edcast-inc/edx-platform-edcast | refs/heads/master | lms/djangoapps/psychometrics/models.py | 150 | #
# db model for psychometrics data
#
# this data is collected in real time
#
from django.db import models
from courseware.models import StudentModule
class PsychometricData(models.Model):
"""
This data is a table linking student, module, and module performance,
including number of attempts, grade, max g... |
cyrusd/retrying | refs/heads/master | retrying.py | 1 | ## Copyright 2013-2014 Ray Holder
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in ... |
orneryhippo/saturdays | refs/heads/master | rabbit/receive.py | 1 | #!/usr/bin/env python
import pika
mq="ec2-52-11-222-159.us-west-2.compute.amazonaws.com"
connection = pika.BlockingConnection(pika.ConnectionParameters(
host=mq))
channel = connection.channel()
channel.queue_declare(queue='hello')
def callback(ch, method, properties, body):
print(" [x] Received %r" % body... |
noironetworks/heat | refs/heads/master | heat/tests/test_exception.py | 1 | #
# Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... |
TangHao1987/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/views/decorators/vary.py | 307 | try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps # Python 2.4 fallback.
from django.utils.cache import patch_vary_headers
from django.utils.decorators import available_attrs
def vary_on_headers(*headers):
"""
A view decorator that adds the specified heade... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.