repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
tchernomax/ansible | refs/heads/devel | lib/ansible/modules/cloud/vmware/vmware_vm_vss_dvs_migrate.py | 56 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Joseph Callen <jcallen () csc.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'... |
sherlockcoin/Electrum-NavCoin | refs/heads/master | gui/qt/transaction_dialog.py | 1 | #!/usr/bin/env python
#
# Electrum - lightweight NavCoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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 witho... |
VanirAOSP/external_chromium_org | refs/heads/kk44 | chrome/test/functional/chromoting/auth.py | 68 | #!/usr/bin/env python
# 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.
"""Chromoting authentication related test cases."""
import chromoting_base
import pyauto
class ChromotingAuth(chromoting_base.Ch... |
kustodian/ansible | refs/heads/devel | lib/ansible/plugins/doc_fragments/enos.py | 44 | # -*- coding: utf-8 -*-
# Copyright: (c) 2017, Red Hat Inc.
# Copyright: (c) 2017, Lenovo.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
# Standard files documentation fragment
DOCUMENTATION = r'''
options:
authorize:
desc... |
jonnary/keystone | refs/heads/master | keystone/tests/unit/test_v3_identity.py | 2 | # Copyright 2012 OpenStack Foundation
#
# 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... |
openstack/neutron | refs/heads/master | neutron/tests/unit/notifiers/test_batch_notifier.py | 2 | # Copyright (c) 2014 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... |
obi-two/Rebelion | refs/heads/master | data/scripts/templates/object/tangible/lair/base/shared_poi_all_lair_leaf_small_fog_green.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/lair/base/shared_poi_all_lair_leaf_small_fog_green.iff"
result.attr... |
eunchong/build | refs/heads/master | third_party/site-packages/google/protobuf/descriptor_pb2.py | 2 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/descriptor.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
# @@protoc_insertion_point(imports)
DESCRIPTOR = _descrip... |
bottompawn/kbengine | refs/heads/master | kbe/src/lib/python/Lib/encodings/cp500.py | 266 | """ Python Character Mapping Codec cp500 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP500.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input... |
EdwinMoq/android_kernel_lge_omap4-common | refs/heads/cm-14.1 | Documentation/networking/cxacru-cf.py | 14668 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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 2 of the License, or (at your option)
# any later version.
#
# This program i... |
ruslanloman/nova | refs/heads/master | nova/virt/disk/vfs/localfs.py | 65 | # Copyright 2012 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... |
saltduck/OpenBazaar-Server | refs/heads/master | net/sslcontext.py | 7 | __author__ = 'chris'
from OpenSSL import SSL
from twisted.internet import ssl
class ChainedOpenSSLContextFactory(ssl.DefaultOpenSSLContextFactory):
def __init__(self, privateKeyFileName, certificateChainFileName,
sslmethod=SSL.SSLv23_METHOD):
"""
@param privateKeyFileName: Name o... |
Mike-J-W/Settlers | refs/heads/master | Make_Hexes.py | 1 | from pieces import *
import random
import pygame
import math
import time
import sys
def main():
# Initialize all the game pieces
# initalizes pygame
pygame.init()
# sets the size of the window that is opened
size = width, height = 900, 750
oceanBlue = 0, 0, 120
# opens the window with the... |
shubhamdhama/zulip | refs/heads/master | zerver/tornado/ioloop_logging.py | 7 | import logging
import select
import time
from typing import Any, Dict, List, Tuple
from django.conf import settings
from tornado.ioloop import IOLoop, PollIOLoop
# There isn't a good way to get at what the underlying poll implementation
# will be without actually constructing an IOLoop, so we just assume it will
# be... |
turbokongen/home-assistant | refs/heads/dev | homeassistant/components/nexia/binary_sensor.py | 21 | """Support for Nexia / Trane XL Thermostats."""
from homeassistant.components.binary_sensor import BinarySensorEntity
from .const import DOMAIN, NEXIA_DEVICE, UPDATE_COORDINATOR
from .entity import NexiaThermostatEntity
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up sensors for a... |
nortikin/sverchok | refs/heads/master | nodes/solid/face_area.py | 2 | # This file is part of project Sverchok. It's copyrighted by the contributors
# recorded in the version control history of the file, available from
# its original location https://github.com/nortikin/sverchok/commit/master
#
# SPDX-License-Identifier: GPL3
# License-Filename: LICENSE
import bpy
from bpy.props import B... |
darktears/chromium-crosswalk | refs/heads/master | remoting/tools/verify_resources.py | 47 | #!/usr/bin/env python
# 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.
"""Verifies that GRD resource files define all the strings used by a given
set of source files. For file formats where it is not po... |
knowsWhereHisTowelIs/pi-pyth-serv-socketio | refs/heads/master | lib/python3.5/site-packages/pip/_vendor/html5lib/serializer.py | 328 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
import re
from codecs import register_error, xmlcharrefreplace_errors
from .constants import voidElements, booleanAttributes, spaceCharacters
from .constants import rcdataElements, entities, xmlEntities
from . im... |
andrewklau/openshift-tools | refs/heads/prod | openshift/installer/vendored/openshift-ansible-3.3.46/roles/openshift_facts/library/openshift_facts.py | 9 | #!/usr/bin/python
# pylint: disable=too-many-lines
# -*- coding: utf-8 -*-
# vim: expandtab:tabstop=4:shiftwidth=4
# Reason: Disable pylint too-many-lines because we don't want to split up this file.
# Status: Permanently disabled to keep this module as self-contained as possible.
"""Ansible module for retrieving and ... |
WikiWatershed/tr-55 | refs/heads/develop | test/test_water_quality.py | 1 | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
import unittest
from tr55.water_quality import get_volume_of_runoff, get_pollutant_load
from tr55.tables import POLLUTION_LOADS
class TestWaterQuality(unittest.TestCase):
def tes... |
keedio/sahara | refs/heads/openbus | sahara/tests/integration/tests/cluster_configs.py | 3 | # Copyright (c) 2013 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
Dandandan/wikiprogramming | refs/heads/master | jsrepl/extern/python/reloop-closured/lib/python2.7/StringIO.py | 120 | r"""File-like objects that read from or write to a string buffer.
This implements (nearly) all stdio methods.
f = StringIO() # ready for writing
f = StringIO(buf) # ready for reading
f.close() # explicitly release resources held
flag = f.isatty() # always false
pos = f.tell() # get current pos... |
Widiot/simpleblog | refs/heads/master | venv/lib/python3.5/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py | 1 | # postgresql/psycopg2.py
# Copyright (C) 2005-2017 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
r"""
.. dialect:: postgresql+psycopg2
:name: psycopg2
:dbapi: psycopg... |
pieleric/odemis | refs/heads/master | src/odemis/util/peak.py | 2 | # -*- coding: utf-8 -*-
'''
Created on 20 Oct 2015
@author: Kimon Tsitsikas
Copyright © 2015-2016 Kimon Tsitsikas and Éric Piel, Delmic
This file is part of Odemis.
Odemis is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free ... |
arista-eosplus/ansible | refs/heads/devel | contrib/inventory/openstack.py | 64 | #!/usr/bin/env python
# Copyright (c) 2012, Marco Vito Moscaritolo <marco@agavee.com>
# Copyright (c) 2013, Jesse Keating <jesse.keating@rackspace.com>
# Copyright (c) 2015, Hewlett-Packard Development Company, L.P.
# Copyright (c) 2016, Rackspace Australia
#
# This module is free software: you can redistribute it and... |
OddEssay/ansible | refs/heads/devel | test/units/playbook/test_role.py | 160 | # (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... |
laurajchang/NPTFit | refs/heads/master | NPTFit/nptf_scan.py | 1 | ###############################################################################
# nptf_scan.py
###############################################################################
#
# Setup and perform the (non-)Poissonian template fit with MultiNest.
# Alternatively configuring the scan defines the log prior cube and the
#... |
jackzhao-mj/ok | refs/heads/master | server/tests/unittests/test_assignment.py | 1 | #!/usr/bin/env python
# encoding: utf-8
"""
Tests for the permissions system
"""
import os
os.environ['FLASK_CONF'] = 'TEST'
import unittest
from test_permissions import PermissionsUnitTest
from ddt import ddt, data
PTest = PermissionsUnitTest.PTest
PERMISSIONS_TESTS = [
PTest("student_get_assignment",
... |
cdsgroup/qcdb | refs/heads/master | databases/ACHC.py | 2 | #
# @BEGIN LICENSE
#
# QCDB: quantum chemistry common driver and databases
#
# Copyright (c) 2011-2017 The QCDB Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This file is part of QCDB.
#
# QCDB is free software; you can redistribute it and/or modify
# it ... |
hyperized/ansible | refs/heads/devel | test/integration/targets/module_utils/module_utils/spam2/ham/eggs/__init__.py | 298 | data = 'spam2'
|
oxfordinternetinstitute/scriptingcourse | refs/heads/master | Lecture 1/EX_w1p1_stringManipulation.py | 1 | """
Week 1: Example 1: String Manipulation
Strings are ordered collections of characters.
By default, they only include ascii characters
(the basic set of English letters, punctuation, numbers and whitespace)
"""
__author__ = 'Bernie Hogan'
__version__= '1.0'
import string
# Example string manipulation
# Pr... |
seanli9jan/tensorflow | refs/heads/master | tensorflow/python/debug/cli/tensor_format.py | 44 | # 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... |
gpetretto/pymatgen | refs/heads/master | pymatgen/core/tests/test_molecular_orbitals.py | 6 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
import unittest
from pymatgen.util.testing import PymatgenTest
from pymatgen.core.molecular_orbitals import MolecularOrbitals
test_case = MolecularOrbitals('... |
ghandiosm/Test | refs/heads/master | addons/link_tracker/models/__init__.py | 70 | # -*- coding: utf-8 -*-
import link_tracker
|
sarthakmeh03/django | refs/heads/master | tests/forms_tests/widget_tests/test_passwordinput.py | 247 | from django.forms import PasswordInput
from .base import WidgetTest
class PasswordInputTest(WidgetTest):
widget = PasswordInput()
def test_render(self):
self.check_html(self.widget, 'password', '', html='<input type="password" name="password" />')
def test_render_ignore_value(self):
sel... |
apple/swift-lldb | refs/heads/stable | packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py | 5 | """
Test lldb data formatter subsystem.
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class LibcxxVectorDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
def c... |
keuv-grvl/bioconda-recipes | refs/heads/master | recipes/biopet-seattleseqkit/biopet-seattleseqkit.py | 80 | #!/usr/bin/env python
#
# Wrapper script for starting the biopet-seattleseqkit JAR package
#
# This script is written for use with the Conda package manager and is copied
# from the peptide-shaker wrapper. Only the parameters are changed.
# (https://github.com/bioconda/bioconda-recipes/blob/master/recipes/peptide-shake... |
HybridF5/tempest_debug | refs/heads/master | tempest/api/compute/test_live_block_migration_negative.py | 6 | # 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 requ... |
deandunbar/html2bwml | refs/heads/master | venv/lib/python2.7/site-packages/pycparser/lextab.py | 22 | # pycparser.lextab.py. This file automatically created by PLY (version 3.4). Don't edit!
_tabversion = '3.4'
_lextokens = {'VOID': 1, 'LBRACKET': 1, 'WCHAR_CONST': 1, 'FLOAT_CONST': 1, 'MINUS': 1, 'RPAREN': 1, 'LONG': 1, 'PLUS': 1, 'ELLIPSIS': 1, 'GT': 1, 'GOTO': 1, 'ENUM': 1, 'PERIOD': 1, 'GE': 1, 'INT_CONST_DEC'... |
saltastro/timDIMM | refs/heads/master | timdimm_auto.py | 1 | #!/usr/bin/env python
import logging
import ephem
import numpy as np
import weather as wx
import timdimm
import ox_wagon
from time import sleep
def check_wx(log):
salt_wx = wx.salt()
wasp_wx = wx.wasp()
grav_wx = wx.grav()
rh = []
wind = []
for w in salt_wx, wasp_wx, grav_wx:
if w:
... |
arsfeld/conduit | refs/heads/master | tools/eog-plugin/conduit.py | 1 | import os
import eog
import gtk, gtk.glade
import dbus, dbus.glib
#if this code is a bit convoluted and jumps around a lot
#it is because I lazy initialize everything to minimise
#the work that occurs at startup time
APPLICATION_DBUS_IFACE="org.conduit.Application"
CONDUIT_DBUS_IFACE="org.conduit.Conduit"
EXPORTER_D... |
uezo/minette-python | refs/heads/master | examples/dice.py | 1 | """
Dicebot
This example shows how to implement your logic
and build the reply message using the result of logic
Sample conversation
$ python dice.py
user> dice
minette> Dice1:1 / Dice2:2
user> more
minette> Dice1:4 / Dice2:5
user>
minette> Dice1:6 / Dice2:6
"""
import random
from mine... |
godmar/problemtools | refs/heads/master | problemtools/ProblemPlasTeX/graphicx.py | 6 | import plasTeX.Packages.graphics as graphics
from ProblemsetMacros import _graphics_command, clean_width
# Reimplementation of graphicx package because plasTeX is broken and
# annoying.
class includegraphics(_graphics_command):
args = '* [ options:dict ] file:str'
packageName = 'graphicx'
captionable = Tr... |
sanghinitin/golismero | refs/heads/master | tools/sqlmap/plugins/dbms/postgresql/syntax.py | 8 | #!/usr/bin/env python
"""
Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
from plugins.generic.syntax import Syntax as GenericSyntax
class Syntax(GenericSyntax):
def __init__(self):
GenericSyntax.__init__(self)
@staticmethod
de... |
amyshi188/osf.io | refs/heads/develop | framework/analytics/piwik.py | 3 | # -*- coding: utf-8 -*-
import json
import uuid
from hashlib import md5
from urllib import urlencode
import requests
from framework.mongo import database as db
from website import settings
class PiwikException(Exception):
pass
def _create_user(user):
""" Given an OSF user, creates a Piwik user.
"""
... |
eliza411/pygments | refs/heads/master | external/rst-directive.py | 6 | # -*- coding: utf-8 -*-
"""
The Pygments reStructuredText directive
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This fragment is a Docutils_ 0.5 directive that renders source code
(to HTML only, currently) via Pygments.
To use it, adjust the options below and copy the code into a module
that you i... |
izonder/intellij-community | refs/heads/master | python/testData/refactoring/unwrap/ifUnwrapMultipleStatements_after.py | 166 | #comment
x = 1
y = 2
|
smmribeiro/intellij-community | refs/heads/master | python/testData/inspections/PyPep8NamingInspection/className.py | 83 |
class <weak_warning descr="Class names should use CamelCase convention">A_B</weak_warning>:
def foo(self):
pass |
pwoodworth/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/utils/simplejson/tool.py | 409 | r"""Using simplejson from the shell to validate and
pretty-print::
$ echo '{"json":"obj"}' | python -msimplejson.tool
{
"json": "obj"
}
$ echo '{ 1.2:3.4}' | python -msimplejson.tool
Expecting property name: line 1 column 2 (char 2)
"""
from django.utils import simplejson
def main():
i... |
jkthompson/nupic | refs/heads/master | py/nupic/support/exceptions.py | 1 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
heracek/django-nonrel | refs/heads/master | tests/modeltests/aggregation/tests.py | 46 | import datetime
from decimal import Decimal
from django.db.models import Avg, Sum, Count, Max, Min
from django.test import TestCase, Approximate
from models import Author, Publisher, Book, Store
class BaseAggregateTestCase(TestCase):
fixtures = ["initial_data.json"]
def test_empty_aggregate(self):
... |
minhthuanit/selenium | refs/heads/master | py/selenium/webdriver/blackberry/webdriver.py | 71 | # 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... |
glennw/servo | refs/heads/master | tests/wpt/mozilla/tests/mozilla/resources/no_mime_type.py | 149 | # 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/.
def main(request, response):
headers = []
if 'Content-Type' in request.GET:
headers += [('Content-Type'... |
zerc/django | refs/heads/master | tests/serializers/test_yaml.py | 58 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import importlib
import unittest
from django.core import management, serializers
from django.core.serializers.base import DeserializationError
from django.test import SimpleTestCase, TestCase, TransactionTestCase
from django.utils import six
from django.... |
lmazuel/azure-sdk-for-python | refs/heads/master | azure-mgmt-sql/azure/mgmt/__init__.py | 592 | __import__('pkg_resources').declare_namespace(__name__)
|
gxxjjj/QuantEcon.py | refs/heads/master | quantecon/models/lucastree.py | 7 | r"""
Filename: lucastree.py
Authors: Thomas Sargent, John Stachurski, Spencer Lyon
Solves the price function for the Lucas tree in a continuous state
setting, using piecewise linear approximation for the sequence of
candidate price functions. The consumption endownment follows the log
linear AR(1) process
.. math::... |
kool79/intellij-community | refs/heads/master | python/testData/refactoring/extractsuperclass/moveAndMakeAbstract/source_module.py | 80 | class MyClass(object):
def foo_method(self):
"""
Foo
"""
spam = "eggs" |
mitchrule/Miscellaneous | refs/heads/master | Django_Project/django/Lib/site-packages/pip/_vendor/distlib/database.py | 203 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2014 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""PEP 376 implementation."""
from __future__ import unicode_literals
import base64
import codecs
import contextlib
import hashlib
import logging
import os
import posixpath
import sys
import z... |
hsiaoyi0504/scikit-learn | refs/heads/master | sklearn/externals/six.py | 547 | """Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2013 Benjamin Peterson
#
# 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 with... |
MiroK/DolfinSurface | refs/heads/master | site-packages/dolfin/common/math.py | 4 | """Convenience functions that are useful in subdomains and expressions. Matches
some of the functions in dolfin/math/basic.h."""
__all__ = ["sqr"]
from constants import DOLFIN_EPS
# The cpp version of these functions are about 3 times faster
#def between(x0, x, x1):
# """Returns true if x0-epsilon < x < x1+epsilo... |
bva24/smart | refs/heads/master | cartridge/shop/tests.py | 6 |
from __future__ import division, unicode_literals
from future.builtins import range, zip
from datetime import timedelta
from decimal import Decimal
from operator import mul
from functools import reduce
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.client import Reques... |
MyAOSP/external_chromium_org | refs/heads/kk-4.4 | tools/telemetry/telemetry/core/platform/profiler/__init__.py | 27 | # Copyright (c) 2013 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.
import collections
class Profiler(object):
"""A sampling profiler provided by the platform.
A profiler is started on its constructor, and should
... |
elba7r/lite-system | refs/heads/master | erpnext/accounts/doctype/purchase_taxes_and_charges/__init__.py | 37694 | from __future__ import unicode_literals
|
JamesShaeffer/QGIS | refs/heads/master | tests/src/python/test_qgslegendrenderer.py | 30 | # coding=utf-8
""""Test QgsLegendRenderer JSON export
.. note:: 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 2 of the License, or
(at your option) any later version.
Ru... |
freedesktop-unofficial-mirror/gstreamer__cerbero | refs/heads/master | cerbero/tools/depstracker.py | 25 | # cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2013 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... |
xjsender/haoide | refs/heads/master | salesforce/lib/jsontoapex.py | 1 | import re
import json
mappings = {
"bool": "Boolean",
"date": "Date",
"datetime": "DateTime",
"str": "String",
"float": "Decimal",
"int": "Integer",
"NoneType": "Object"
}
class JSONConverter():
""" Example:
from .salesforce.lib.jsontoapex import JSONConverter
snippet ... |
akretion/account-invoicing | refs/heads/8.0 | setup/account_invoice_period_usability/odoo_addons/__init__.py | 13048 | __import__('pkg_resources').declare_namespace(__name__)
|
midnightradio/gensim | refs/heads/develop | gensim/scripts/make_wiki_online_lemma.py | 21 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Copyright (C) 2012 Lars Buitinck <larsmans@gmail.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
USAGE: %(program)s WIKI_XML_DUMP OUTPUT_PREFIX [VOCABULARY_SIZE]
Convert a... |
jroesch/rust | refs/heads/master | src/etc/generate-keyword-tests.py | 53 | #!/usr/bin/env python
#
# Copyright 2013 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
#... |
saydulk/django | refs/heads/master | tests/mail/custombackend.py | 428 | """A custom backend for testing."""
from django.core.mail.backends.base import BaseEmailBackend
class EmailBackend(BaseEmailBackend):
def __init__(self, *args, **kwargs):
super(EmailBackend, self).__init__(*args, **kwargs)
self.test_outbox = []
def send_messages(self, email_messages):
... |
benoitc/bigcouch | refs/heads/master | couchjs/scons/scons-local-2.0.1/SCons/compat/_scons_hashlib.py | 61 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# 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
# without li... |
diogocs1/comps | refs/heads/master | web/addons/account_budget/__init__.py | 444 | # -*- 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... |
lessc0de/neuroelectro_org | refs/heads/master | extract_article_metadata.py | 1 | """
Solution concentration textmining driver script
Created by: Dmitrii Tebaikin
Updated by: Michael Gottlieb
Run in python shell: execfile('test_meta.py')
"""
import neuroelectro.models as m
import article_text_mining.assign_metadata as meta
import article_text_mining.full_text_pipeline as pipe
import db_functions.c... |
cato-/django-feedjack | refs/heads/master | feedjack/migrations/0002_auto__add_feedjackuser__del_field_subscriber_shortname__add_field_subs.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 'FeedjackUser'
db.create_table(u'feedjack_feedjackuser', (
(u'user_ptr', self.gf(... |
JFriel/honours_project | refs/heads/master | networkx/networkx/algorithms/bipartite/tests/test_cluster.py | 85 | import networkx as nx
from nose.tools import *
from networkx.algorithms.bipartite.cluster import cc_dot,cc_min,cc_max
import networkx.algorithms.bipartite as bipartite
def test_pairwise_bipartite_cc_functions():
# Test functions for different kinds of bipartite clustering coefficients
# between pairs of nodes ... |
nwjs/chromium.src | refs/heads/nw45-log | third_party/blink/web_tests/external/wpt/tools/third_party/h2/test/conftest.py | 38 | # -*- coding: utf-8 -*-
from hypothesis import settings, HealthCheck
import pytest
import helpers
# Set up a CI profile that allows slow example generation.
settings.register_profile(
"travis",
settings(suppress_health_check=[HealthCheck.too_slow])
)
@pytest.fixture
def frame_factory():
return helpers.F... |
chaluemwut/fbserver | refs/heads/master | venv/lib/python2.7/site-packages/scipy/stats/kde.py | 9 | #-------------------------------------------------------------------------------
#
# Define classes for (uni/multi)-variate kernel density estimation.
#
# Currently, only Gaussian kernels are implemented.
#
# Written by: Robert Kern
#
# Date: 2004-08-09
#
# Modified: 2005-02-10 by Robert Kern.
# Contr... |
uwgraphics/Ubiqu-Ity | refs/heads/master | Ity/Tools/TokenTransform.py | 1 | __author__ = 'wintere'
import abc
from Ity import BaseClass
import string
import csv
import codecs
import os
import pandas as pd
def end_reason(token):
if token[0].isalpha():
return 'c'
elif (token[0] == u'\n') or (token[0] == '\n'):
i = 0
r = ''
while i < (len(token)):
... |
ergoithz/browsepy | refs/heads/master | browsepy/tests/test_plugins.py | 1 |
import unittest
import flask
import browsepy
import browsepy.manager
import browsepy.tests.utils as test_utils
from browsepy.plugin.player.tests import * # noqa
class FileMock(object):
def __init__(self, **kwargs):
self.__dict__.update(kwargs)
class TestMimetypePluginManager(unittest.TestCase):
... |
fhaoquan/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/test/test_http_cookiejar.py | 84 | """Tests for http/cookiejar.py."""
import os
import re
import test.support
import time
import unittest
import urllib.request
from http.cookiejar import (time2isoz, http2time, iso2time, time2netscape,
parse_ns_headers, join_header_words, split_header_words, Cookie,
CookieJar, DefaultCookiePolicy, LWPCookieJa... |
siddhika1889/Pydev-Editor | refs/heads/master | pysrc/third_party/pep8/lib2to3/lib2to3/fixes/fix_idioms.py | 327 | """Adjust some old Python 2 idioms to their modern counterparts.
* Change some type comparisons to isinstance() calls:
type(x) == T -> isinstance(x, T)
type(x) is T -> isinstance(x, T)
type(x) != T -> not isinstance(x, T)
type(x) is not T -> not isinstance(x, T)
* Change "while 1:" into "while True:".... |
newerthcom/savagerebirth | refs/heads/master | libs/python-2.72/Lib/encodings/cp949.py | 816 | #
# cp949.py: Python Unicode Codec for CP949
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_kr, codecs
import _multibytecodec as mbc
codec = _codecs_kr.getcodec('cp949')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(mbc.MultibyteIncrement... |
40223119/2015cd_0505 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/multiprocessing/dummy/connection.py | 707 | #
# Analogue of `multiprocessing.connection` which uses queues instead of sockets
#
# multiprocessing/dummy/connection.py
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditi... |
DimensionDataCBUSydney/libcloud | refs/heads/trunk | libcloud/utils/iso8601.py | 58 | """
Copyright (c) 2007 Michael Twomey
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
without limitation the rights to use, copy, modify, merge, publish,
distribute,... |
nekulin/arangodb | refs/heads/devel | 3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/win32/test/test_win32crypt.py | 17 | # Test module for win32timezone
import unittest
import win32crypt
class Crypt(unittest.TestCase):
def testSimple(self):
data = "My test data"
entropy = None
desc = "My description"
flags = 0
ps = None
blob = win32crypt.CryptProtectData(data, desc, entropy, None, ps,... |
agry/NGECore2 | refs/heads/master | scripts/object/mobile/beast_master/bm_langlatch.py | 85615 | import sys
def setup(core, object):
return |
gonzolino/heat | refs/heads/master | heat/engine/resources/openstack/cinder/volume_type.py | 2 | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... |
loco-odoo/localizacion_co | refs/heads/master | openerp/addons/base/report/__init__.py | 462 | import preview_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
Sunhick/ThinkStats2 | refs/heads/master | code/chap12soln.py | 68 | """This file contains code for use with "Think Stats",
by Allen B. Downey, available from greenteapress.com
Copyright 2014 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from __future__ import print_function
import pandas
import numpy as np
import statsmodels.formula.api as smf
import t... |
darrencheng0817/AlgorithmLearning | refs/heads/master | Python/leetcode/WordPatternIi.py | 1 | '''
Created on 1.12.2016
@author: Darren
'''
'''
Given a pattern and a string str, find if str follows the same pattern.
Here follow means a full match, such that there is a bijection between a letter in pattern and a non-empty substring in str.
Examples:
pattern = "abab", str = "redblueredblue" should return true.
... |
dizuane/deified-bot | refs/heads/master | main.py | 1 | import os
import discord
from discord.ext import commands
import logging
from logging.handlers import TimedRotatingFileHandler
from Moods import Moods
import json
# --------------------
# Configuration
# --------------------
try:
config = json.load(open('config.json', 'r'))
except json.JSONDecodeError as e:
pr... |
dllsf/odootest | refs/heads/master | addons/product/_common.py | 111 | # -*- 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... |
derDavidT/sympy | refs/heads/master | sympy/core/evalf.py | 33 | """
Adaptive numerical evaluation of SymPy expressions, using mpmath
for mathematical functions.
"""
from __future__ import print_function, division
import math
import mpmath.libmp as libmp
from mpmath import (
make_mpc, make_mpf, mp, mpc, mpf, nsum, quadts, quadosc, workprec)
from mpmath import inf as mpmath_inf... |
da1z/intellij-community | refs/heads/master | python/testData/inspections/PyOldStyleClassesInspection/Super30.py | 83 | class A:
def __init__(self):
super()
class B(object):
def __init__(self):
super()
def super():
pass
class C:
def __init__(self):
super() |
hdidx/hdidx | refs/heads/master | tests/test_cext.py | 1 | #!/usr/bin/env python
# coding: utf-8
#########################################################################
#########################################################################
"""
File Name: test_cext.py
Author: Wan Ji
E-mail: wanji@live.com
Created on: Wed Nov 5 16:41:24 2014 CST
"""
DESC... |
apllicationCOM/youtube-dl-api-server | refs/heads/master | youtube_dl_server/youtube_dl/extractor/pladform.py | 103 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
xpath_text,
qualities,
)
class PladformIE(InfoExtractor):
_VALID_URL = r'''(?x)
https?://
(?:
... |
vileopratama/vitech | refs/heads/master | src/addons/vitech_backend_theme/__openerp__.py | 1 | {
'name' : 'Vitech Backend Theme for Odoo 9c',
'version' : '0.3',
'author' : 'Vileo Pratama Teknologi',
'category' : 'Website',
'summary': 'Clean Theme for Odoo 9c',
'website' : 'http://www.vileo.co.id',
'description': """
Clean Theme Odoo 9c for Vitech ERP, based on new Bootstrap United tem... |
JetBrains/kotlin-web-site | refs/heads/master | src/encoder.py | 7 | import json
import datetime
class DateAwareEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, datetime.date):
return obj.strftime("%Y-%m-%d")
return json.JSONEncoder.default(self, obj)
|
cvfish/python_koans | refs/heads/master | python2/runner/mountain.py | 106 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import sys
import path_to_enlightenment
from sensei import Sensei
from writeln_decorator import WritelnDecorator
class Mountain:
def __init__(self):
self.stream = WritelnDecorator(sys.stdout)
self.tests = path_to_enlightenment.koans()
... |
semonte/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/contrib/flatpages/tests/views.py | 94 | import os
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.flatpages.models import FlatPage
from django.test import TestCase
class FlatpageViewTests(TestCase):
fixtures = ['sample_flatpages']
urls = 'django.contrib.flatpages.tests.urls'
def setUp(self):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.