repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
lsinfo/odoo | refs/heads/8.0 | addons/multi_company/__init__.py | 886 | # -*- 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... |
smarani/InfraShareMobile | refs/heads/master | InfraShare Online/venv/lib/python2.7/site-packages/pip/_vendor/cachecontrol/adapter.py | 469 | import functools
from pip._vendor.requests.adapters import HTTPAdapter
from .controller import CacheController
from .cache import DictCache
from .filewrapper import CallbackFileWrapper
class CacheControlAdapter(HTTPAdapter):
invalidating_methods = set(['PUT', 'DELETE'])
def __init__(self, cache=None,
... |
a-veitch/grpc | refs/heads/master | tools/run_tests/sanity/check_sources_and_headers.py | 3 | #!/usr/bin/env python2.7
# Copyright 2015, 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 lis... |
SivagnanamCiena/robotframework | refs/heads/master | src/robot/libraries/DateTime.py | 11 | # Copyright 2008-2015 Nokia Solutions and Networks
#
# 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 l... |
smkr/pyclipse | refs/heads/master | plugins/org.python.pydev.refactoring/tests/python/codegenerator/generatedocstring/testGenerateDocstringJump.py | 8 | def function():
'''
Return true.
'''
return True##|
##r
def function():
'''
Return true.##|
'''
return True
|
Azure/azure-sdk-for-python | refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline | sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_10_01/aio/operations/_network_interface_ip_configurations_operations.py | 1 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
leafclick/intellij-community | refs/heads/master | python/testData/quickFixes/PyMakeFunctionFromMethodQuickFixTest/noSelf.py | 83 | __author__ = 'ktisha'
class Child(Base):
def <caret>f():
test = 1 |
lauria/Samba4 | refs/heads/master | lib/dnspython/tests/set.py | 59 | # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... |
bakhtout/odoo-educ | refs/heads/8.0 | openerp/addons/base/ir/ir_ui_menu.py | 316 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2012 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can ... |
nDroidProject/nDroid-kernel | refs/heads/nDroid-1.6 | tools/perf/util/setup.py | 989 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... |
PiRSquared17/stoqs | refs/heads/master | loaders/CANON/toNetCDF/uctdToNetcdf.py | 5 | #!/usr/bin/env python
__author__ = "Mike McCann"
__copyright__ = "Copyright 2012, MBARI"
__license__ = "GPL"
__maintainer__ = "Mike McCann"
__email__ = "mccann at mbari.org"
__doc__ = '''
Script to read data from underway ctd files and write them to netCDF files.
Use the conventions for Trajectory feature type and... |
SaschaMester/Zahlenraten | refs/heads/master | ZahlenratenSmall/zahlenraten_s.py | 1 | #! /usr/bin/env python3
# ~*~ encoding: utf-8 ~*~
from random import randint
eingegeben = False
geraten = False
while not eingegeben:
zahl = input("Bitte gebe eine Zahl > 50 ein: ")
try:
zahlInt = int(zahl)
except ValueError:
print("Nur Ganzzahlen erlaubt!")
continue
if zahlInt <= 50:
continu... |
vladryk/horizon | refs/heads/master | openstack_dashboard/dashboards/project/loadbalancers/tabs.py | 30 | # Copyright 2013, Big Switch Networks, 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 applic... |
hivelocity/python-ubersmith | refs/heads/master | ubersmith/uber.py | 2 | """Uber call functions.
These are light weight call functions that basically just wrap call classes
under ubersmith.calls. If a call function doesn't exist it will be generated
by generate_generic_calls which searches for a call class and if one isn't
found one is created using ubersmith.calls.BaseCall.
"""
from ub... |
IndonesiaX/edx-platform | refs/heads/master | common/djangoapps/student/management/commands/add_to_group.py | 182 | from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User, Group
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--list',
action='store_true',
de... |
flotre/sickbeard-vfvo | refs/heads/master | lib/hachoir_parser/misc/bplist.py | 90 | """
Apple/NeXT Binary Property List (BPLIST) parser.
Also includes a .createXML() function which produces an XML representation of the object.
Note that it will discard unknown objects, nulls and fill values, but should work for most files.
Documents:
- CFBinaryPList.c
http://src.gnu-darwin.org/DarwinSourceArchive/... |
lastcolour/GraphicsDemo | refs/heads/master | scripts/compile.py | 1 | __all__ = ["CompileRunner"]
import sys
import platform
from utils import runCMD
from runner import Runner
from logger import log
_COMPILE_LOG_FILE = "lastCompileRun.log"
class CompileRunner(Runner):
# TODO: Create base class for CmakeRunner and Compiler runner that encapsulate common behaviour
def __in... |
Symmetry-Innovations-Pty-Ltd/Python-2.7-for-QNX6.5.0-x86 | refs/heads/master | usr/pkg/lib/python2.7/_pyio.py | 76 | """
Python implementation of the io module.
"""
from __future__ import (print_function, unicode_literals)
import os
import abc
import codecs
import warnings
# Import thread instead of threading to reduce startup cost
try:
from thread import allocate_lock as Lock
except ImportError:
from dummy_thread import al... |
MiLk/ansible | refs/heads/devel | test/units/parsing/vault/test_vault.py | 13 | # -*- coding: utf-8 -*-
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2016, Toshio Kuratomi <tkuratomi@ansible.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 So... |
modulexcite/wal-e | refs/heads/master | wal_e/worker/worker_util.py | 2 | import tempfile
import time
from wal_e import pipebuf
from wal_e import storage
from wal_e.blobstore import get_blobstore
from wal_e import pipeline
def uri_put_file(creds, uri, fp, content_encoding=None):
blobstore = get_blobstore(storage.StorageLayout(uri))
return blobstore.uri_put_file(creds, uri, fp,
... |
fietew/opti_ssr | refs/heads/master | opti_ssr_demo_headtracker.py | 1 | """
A python module for demonstrating head orientation tracking for binaural
synthesis.
Usage: python opti_ssr_demo.py [SSR_IP] [SSR_port] [optitrack ip] [multicast address] [optitrack port] [end_message]
"""
import sys
import opti_ssr
from time import sleep
def demo(ssr_ip='localhost', ssr_port=4711, opti_unicast_i... |
eneldoserrata/marcos_openerp | refs/heads/master | addons/report_geraldo/lib/geraldo/site/newsite/django_1_0/django/utils/termcolors.py | 73 | """
termcolors.py
"""
color_names = ('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white')
foreground = dict([(color_names[x], '3%s' % x) for x in range(8)])
background = dict([(color_names[x], '4%s' % x) for x in range(8)])
del color_names
RESET = '0'
opt_dict = {'bold': '1', 'underscore': '4', 'bli... |
sgraham/nope | refs/heads/master | build/apply_locales.py | 295 | #!/usr/bin/env python
# Copyright (c) 2009 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.
# TODO: remove this script when GYP has for loops
import sys
import optparse
def main(argv):
parser = optparse.OptionParser()
... |
charlesvdv/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/py/testing/conftest.py | 218 |
pytest_plugins = "pytester",
|
ligerzero459/paycoin | refs/heads/master | contrib/devtools/optimize-pngs.py | 5 | #!/usr/bin/env python
'''
Run this script every time you change one of the png files. Using pngcrush, it will optimize the png files, remove various color profiles, remove ancillary chunks (alla) and text chunks (text).
#pngcrush -brute -ow -rem gAMA -rem cHRM -rem iCCP -rem sRGB -rem alla -rem text
'''
import os
impor... |
legalsylvain/OpenUpgrade | refs/heads/master | addons/hr_holidays/wizard/hr_holidays_summary_department.py | 44 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# $Id: account.py 1005 2005-07-25 08:41:42Z nicoe $
#
# This program is free software: you can redistrib... |
TarasRudnyk/scrapy | refs/heads/master | scrapy/utils/reqser.py | 110 | """
Helper functions for serializing (and deserializing) requests.
"""
import six
from scrapy.http import Request
from scrapy.utils.python import to_unicode, to_native_str
def request_to_dict(request, spider=None):
"""Convert Request object to a dict.
If a spider is given, it will try to find out the name o... |
fga-gpp-mds/2017.2-Receituario-Medico | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
from setuptools import setup, find_packages
from pip.req import parse_requirements
# parse_requirements() returns generator of pip.req.InstallRequirement objects
install_reqs = parse_requirements("requirements.txt", session='hack')
# reqs is a list of requirement
# e.g. ['django==1.5.1', 'mezza... |
mcgoddard/widgetr | refs/heads/master | env/Lib/site-packages/flask/testsuite/test_apps/config_package_app/__init__.py | 1257 | import os
import flask
here = os.path.abspath(os.path.dirname(__file__))
app = flask.Flask(__name__)
|
AWhetter/pacman | refs/heads/master | test/pacman/tests/sync050.py | 28 | self.description = "Install a virtual target (provided by a sync package)"
sp1 = pmpkg("pkg1")
sp1.provides = ["pkg2"]
self.addpkg2db("sync", sp1);
self.args = "-S %s" % sp1.name
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_EXIST=pkg1")
self.addrule("!PKG_EXIST=pkg2")
|
t0mk/ansible | refs/heads/devel | lib/ansible/modules/monitoring/sensu_check.py | 25 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Anders Ingemann <aim@secoya.dk>
#
# 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 Licen... |
dsajkl/123 | refs/heads/master | common/lib/xmodule/xmodule/tests/test_conditional.py | 37 | import json
import unittest
from fs.memoryfs import MemoryFS
from mock import Mock, patch
from xblock.field_data import DictFieldData
from xblock.fields import ScopeIds
from xmodule.error_module import NonStaffErrorDescriptor
from opaque_keys.edx.locations import SlashSeparatedCourseKey, Location
from xmodule.modules... |
pyinvoke/invocations | refs/heads/administrivia | invocations/packaging/release.py | 1 | """
Python package release tasks.
This module assumes:
- you're using semantic versioning for your releases
- you maintain a file called ``$package/_version.py`` containing normal version
conventions (``__version_info__`` tuple and ``__version__`` string).
"""
from __future__ import unicode_literals, print_functio... |
faner-father/tushare | refs/heads/master | tushare/stock/trading.py | 5 | # -*- coding:utf-8 -*-
"""
交易数据接口
Created on 2014/07/31
@author: Jimmy Liu
@group : waditu
@contact: jimmysoa@sina.cn
"""
from __future__ import division
import time
import json
import lxml.html
from lxml import etree
import pandas as pd
import numpy as np
from tushare.stock import cons as ct
import... |
Karaage-Cluster/karaage-debian | refs/heads/master | karaage/legacy/people/south_migrations/0021_remove_old_tables.py | 3 | # -*- coding: utf-8 -*-
from south.db import db
from south.v2 import SchemaMigration
from django.db import connection
class Migration(SchemaMigration):
@staticmethod
def delete_table(name):
cursor = connection.cursor()
if name in connection.introspection.get_table_list(cursor):
db.... |
arank/mxnet | refs/heads/master | example/rcnn/rcnn/symbol/symbol_vgg.py | 15 | import mxnet as mx
import proposal
import proposal_target
from rcnn.config import config
def get_vgg_conv(data):
"""
shared convolutional layers
:param data: Symbol
:return: Symbol
"""
# group 1
conv1_1 = mx.symbol.Convolution(
data=data, kernel=(3, 3), pad=(1, 1), num_filter=64, w... |
wangyang59/tf_models | refs/heads/master | slim/nets/inception_v1_test.py | 54 | # 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 applicable ... |
simonpatrick/bite-project | refs/heads/master | tools/bugs/server/appengine/handlers/bugs/urls.py | 17 | # 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 by applicable law or a... |
kaji-project/shinken | refs/heads/kaji | test/test_passive_pollers.py | 18 | #!/usr/bin/env python
# Copyright (C) 2009-2014:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
#
# This file is part of Shinken.
#
# Shinken 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 F... |
MSeifert04/numpy | refs/heads/master | numpy/distutils/fcompiler/ibm.py | 8 | from __future__ import division, absolute_import, print_function
import os
import re
import sys
import subprocess
from numpy.distutils.fcompiler import FCompiler
from numpy.distutils.exec_command import find_executable
from numpy.distutils.misc_util import make_temp_file
from distutils import log
compilers = ['IBMFC... |
prodromou87/gem5 | refs/heads/master | tests/quick/se/02.insttest/test.py | 56 | # Copyright (c) 2007 The Regents of The University of Michigan
# 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 ... |
charleszheng44/cctools | refs/heads/master | weaver/src/examples/functions.py | 13 | stat = ParseFunction('stat {IN} > {OUT}')
file = stat('/etc/hosts', '{basename}.stat')
stat(file, '{FULL}.stat', collect=True)
Define('MYVAR1', 1)
Export(['MYVAR1', 'MYVAR2'])
env = ParseFunction('env > {OUT}', environment={'MYVAR2': 2})
env(outputs='env0.txt')
env(outputs='env1.txt', environment={'MYVAR3': 3})
|
lategoodbye/linux-lcd6610 | refs/heads/master | scripts/gdb/linux/cpus.py | 997 | #
# gdb helper commands and functions for Linux kernel debugging
#
# per-cpu tools
#
# Copyright (c) Siemens AG, 2011-2013
#
# Authors:
# Jan Kiszka <jan.kiszka@siemens.com>
#
# This work is licensed under the terms of the GNU GPL version 2.
#
import gdb
from linux import tasks, utils
MAX_CPUS = 4096
def get_cu... |
django-nonrel/django-nonrel | refs/heads/develop | django/conf/locale/id/formats.py | 355 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j N Y'
DATETIME_FORMAT = "j N Y, G.i.s"
TIME_FORMAT = 'G.i.s'
YEAR_MONTH_... |
nox/servo | refs/heads/master | components/script/dom/bindings/codegen/parser/runtests.py | 146 | # 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/.
import os, sys
import glob
import optparse
import traceback
import WebIDL
class TestHarness(object):
def __init__(s... |
lailongwei/llbc | refs/heads/master | tools/building_script/lu_postbuild.py | 1 | # -*- coding: utf-8 -*-
"""
lullbc编译后执行脚本
"""
import sys
from os import path as op
import shutil
from c import Cfg
def main():
# 复制llbc.lua到目标目录
target_path = sys.argv[3]
is_debug = sys.argv[2].upper() == 'DEBUG' or False
src = op.join(Cfg.getscriptpath(), 'llbc.lua')
if not is... |
vvuk/servo | refs/heads/master | components/script/dom/bindings/codegen/parser/tests/test_enum_duplicate_values.py | 276 | import WebIDL
def WebIDLTest(parser, harness):
try:
parser.parse("""
enum TestEnumDuplicateValue {
"",
""
};
""")
harness.ok(False, "Should have thrown!")
except:
harness.ok(True, "Enum TestEnumDuplicateValue should throw")
|
heeraj123/oh-mainline | refs/heads/master | vendor/packages/Django/tests/regressiontests/views/generic_urls.py | 44 | # -*- coding:utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.conf.urls import patterns, url
from django.views.generic import RedirectView
from . import views
from .models import Article, DateArticle, UrlArticle
date_based_info_dict = {
'queryset': Article.objects.all(),
'date_... |
franekp/ankidict | refs/heads/master | ankidict/thirdparty/cherrypy/lib/httputil.py | 6 | """HTTP library functions.
This module contains functions for building an HTTP application
framework: any one, not just one whose name starts with "Ch". ;) If you
reference any modules from some popular framework inside *this* module,
FuManChu will personally hang you up by your thumbs and submit you
to a public canin... |
Azulinho/ansible | refs/heads/devel | test/units/modules/network/netscaler/test_netscaler_server.py | 16 |
# Copyright (c) 2017 Citrix Systems
#
# 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.
#
# ... |
AzCiS/autorest | refs/heads/master | src/client/Python/msrestazure/msrestazure/azure_configuration.py | 13 | # --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""),... |
iamkingmaker/trading-with-python | refs/heads/master | cookbook/ib_streamQuotes.py | 77 | '''
Copyright: Jev Kuznetsov
License: BSD
Demonstration of how to stream quotes from IB.
This script will subscribe to SPY and stream quotes to the sreen for 10 seconds.
'''
from time import sleep
from ib.ext.Contract import Contract
from ib.opt import ibConnection, message
def price_tick_handler... |
vbannai/neutron | refs/heads/master | neutron/plugins/cisco/nexus/cisco_nexus_plugin_v2.py | 3 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Cisco 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... |
ismaelliang/GitRebaseDemo | refs/heads/master | file_5.py | 1 | print('file_5')
|
SGenheden/lammps | refs/heads/master | tools/moltemplate/common/amber/amberparm_improper_to_lt.py | 19 | #!/usr/bin/env python
import sys
lines_gaff = sys.stdin.readlines()
improper_style_name = 'cvff'
sys.stdout.write(' write_once("In Settings") {\n')
for i in range(0, len(lines_gaff)):
line = lines_gaff[i]
atypes = line[:11].split('-')
atype1 = atypes[0].strip()
atype2 = atypes[1].strip()
atype3... |
trungnt13/scikit-learn | refs/heads/master | sklearn/linear_model/tests/test_ridge.py | 130 | import numpy as np
import scipy.sparse as sp
from scipy import linalg
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_a... |
interaction-lab/cordial-public | refs/heads/master | cordial_tts/src/cordial_tts/__init__.py | 1 | from cordial_tts import CoRDialTTS |
JaneliaSciComp/hybridizer | refs/heads/master | tests/dispense_volumes_plot.py | 4 | # -*- coding: utf-8 -*-
from __future__ import print_function, division
import matplotlib.pyplot as plot
import numpy
from numpy.polynomial.polynomial import polyfit,polyadd,Polynomial
import argparse
INCHES_PER_ML = 0.078
VOLTS_PER_ADC_UNIT = 0.0049
def load_numpy_data(path):
with open(path,'r') as fid:
... |
arju88nair/projectCulminate | refs/heads/master | venv/lib/python3.5/site-packages/pylint/test/input/func_w0401_package/__init__.py | 20 | """Our big package."""
__revision__ = None
|
cristianocs/DAS | refs/heads/master | texto/lib/python3.4/site-packages/pkg_resources/_vendor/packaging/_compat.py | 901 | # Copyright 2014 Donald Stufft
#
# 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... |
HydrelioxGitHub/home-assistant | refs/heads/dev | homeassistant/components/sensor/worldclock.py | 8 | """
Support for showing the time in a different time zone.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.worldclock/
"""
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.cons... |
netpocket/webui | refs/heads/master | app/bower_components/js-beautify/python/cssbeautifier/tests/test.py | 1 | import unittest
import cssbeautifier
class CSSBeautifierTest(unittest.TestCase):
def resetOptions(self):
self.options = cssbeautifier.default_options()
self.options.indent_size = 1
self.options.indent_char = '\t'
self.options.selector_separator_newline = True
self.options.end_with_n... |
chaffra/sympy | refs/heads/master | examples/beginner/differentiation.py | 106 | #!/usr/bin/env python
"""Differentiation example
Demonstrates some differentiation operations.
"""
import sympy
from sympy import pprint
def main():
a = sympy.Symbol('a')
b = sympy.Symbol('b')
e = (a + 2*b)**5
print("\nExpression : ")
print()
pprint(e)
print("\n\nDifferentiating w.r.t.... |
kchodorow/tensorflow | refs/heads/master | tensorflow/python/debug/wrappers/grpc_wrapper.py | 30 | # 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... |
jnerin/ansible | refs/heads/devel | lib/ansible/plugins/strategy/linear.py | 3 | # (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... |
ApsOps/zulip | refs/heads/master | zerver/test_hooks.py | 103 | # -*- coding: utf-8 -*-
from zerver.lib.test_helpers import AuthedTestCase
from zerver.lib.test_runner import slow
from zerver.models import Message
import ujson
class JiraHookTests(AuthedTestCase):
def send_jira_message(self, action):
email = "hamlet@zulip.com"
api_key = self.get_api_key(email)
... |
jorgeer/brewing | refs/heads/master | tests/factories.py | 1 | # -*- coding: utf-8 -*-
from factory import Sequence, PostGenerationMethodCall
from factory.alchemy import SQLAlchemyModelFactory
from brewing.user.models import User
from brewing.database import db
class BaseFactory(SQLAlchemyModelFactory):
class Meta:
abstract = True
sqlalchemy_session = db.ses... |
dleicht/PSB | refs/heads/master | apiclient/schema.py | 149 | # Copyright (C) 2010 Google 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... |
qiankunshe/sky_engine | refs/heads/master | sky/tools/webkitpy/common/net/buildbot/buildbot_unittest.py | 24 | # Copyright (C) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
russellb/powerline | refs/heads/develop | powerline/lib/debug.py | 35 | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import gc
import sys
from types import FrameType
from itertools import chain
# From http://code.activestate.com/recipes/523004-find-cyclical-references/
def print_cycles(objects, outstream=sys.stdout, ... |
luxnovalabs/enjigo_door | refs/heads/master | web_interface/django/contrib/formtools/tests/urls.py | 195 | """
This is a URLconf to be loaded by tests.py. Add any URLs needed for tests only.
"""
from __future__ import absolute_import
from django.conf.urls import patterns, url
from django.contrib.formtools.tests import TestFormPreview, TestWizardClass
from django.contrib.formtools.tests.forms import (ContactWizard, Page1,... |
cngo-github/nupic | refs/heads/master | examples/opf/clients/hotgym/anomaly/one_gym/nupic_anomaly_output.py | 49 | # ----------------------------------------------------------------------
# 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... |
balanced/PyXB | refs/heads/master | pyxb/namespace/archive.py | 3 | # -*- coding: utf-8 -*-
# Copyright 2009-2013, Peter A. Bigot
#
# 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... |
sudheerchintala/LearnEraPlatForm | refs/heads/master | lms/djangoapps/branding/views.py | 19 | from django.conf import settings
from django.core.urlresolvers import reverse
from django.http import Http404
from django.shortcuts import redirect
from django_future.csrf import ensure_csrf_cookie
from edxmako.shortcuts import render_to_response
import student.views
import courseware.views
from microsite_configurati... |
hazelnusse/sympy-old | refs/heads/master | sympy/core/interval.py | 3 |
from basic import Basic
from sympify import _sympify
class Interval(Basic):
def __new__(cls, start, end, **assumptions):
start = _sympify(start)
end = _sympify(end)
return Basic.__new__(cls, start, end, **assumptions)
@property
def start(self):
return self._args[0]
@... |
taylorschimek/WhatAChore | refs/heads/master | useraccounts/models.py | 1 | from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, PermissionsMixin
from django.db import models
from django.utils.translation import ugettext_lazy as _
class MyUserManager(BaseUserManager):
"""
A custom user manager to deal with emails as unique identifiers for auth instead of username... |
YudinYury/Python_Netology_homework | refs/heads/master | less_3_3_classwork.py | 1 | """lesson_3_3_classwork «Requests Lib and HTTP-requests»
"""
import chardet
import json
import os
import requests
import sys
def translate_it(text, lang='en-ru'):
"""
YANDEX translation plugin
docs: https://tech.yandex.ru/translate/doc/dg/reference/translate-docpage/
https://translate.yandex.net/api... |
cerdmann-pivotal/azure-quickstart-templates | refs/heads/master | bosh-setup/scripts/setup_env.py | 10 | #!/usr/bin/env python
import json
import netaddr
import os
import random
import re
import requests
import sys
import base64
from azure.storage.blob import AppendBlobService
from azure.storage.table import TableService
import azure.mgmt.network
from azure.common.credentials import ServicePrincipalCredentials
from azure... |
v4hn/ecto | refs/heads/master | python/ecto/sphinx/breathe/renderer/rst/doxygen/index.py | 1 |
from ecto.sphinx.breathe.renderer.rst.doxygen.base import Renderer
class DoxygenTypeSubRenderer(Renderer):
def render(self):
nodelist = []
# Process all the compound children
for compound in self.data_object.get_compound():
compound_renderer = self.renderer_factory.create_re... |
ComNets-Bremen/Python-Course | refs/heads/master | examples/09_enumerateExample.py | 1 | #!/usr/bin/env python3
"""
Enumerate an object
Jens Dede, 2019, jd@comnets.uni-bremen.de
"""
objects = ["Apple", "Lemon", "Banana"]
for o in objects:
print(o)
# I know the object but not the position / number...
print(5*"*")
# Enumerate returns the position (i.e. an integer) and the object
for n, o in enu... |
SAM-IT-SA/odoo | refs/heads/8.0 | addons/pad_project/project_task.py | 433 | # -*- coding: utf-8 -*-
from openerp.tools.translate import _
from openerp.osv import fields, osv
class task(osv.osv):
_name = "project.task"
_inherit = ["project.task",'pad.common']
_columns = {
'description_pad': fields.char('Description PAD', pad_content_field='description')
}
|
kidaa/avmplus | refs/heads/master | generate.py | 8 | #!/usr/bin/env python
# -*- Mode: Python; indent-tabs-mode: nil -*-
# vi: set ts=4 sw=4 expandtab:
# 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/.
# generate.py - gener... |
waynenilsen/statsmodels | refs/heads/master | statsmodels/sandbox/tools/mctools.py | 33 | '''Helper class for Monte Carlo Studies for (currently) statistical tests
Most of it should also be usable for Bootstrap, and for MC for estimators.
Takes the sample generator, dgb, and the statistical results, statistic,
as functions in the argument.
Author: Josef Perktold (josef-pktd)
License: BSD-3
TODOs, Desig... |
andim27/magiccamp | refs/heads/master | django/contrib/gis/db/backends/spatialite/introspection.py | 401 | from django.contrib.gis.gdal import OGRGeomType
from django.db.backends.sqlite3.introspection import DatabaseIntrospection, FlexibleFieldLookupDict
class GeoFlexibleFieldLookupDict(FlexibleFieldLookupDict):
"""
Sublcass that includes updates the `base_data_types_reverse` dict
for geometry field types.
... |
mementum/bfpy | refs/heads/master | src/httxlib/httxobject.py | 4 | #!/usr/bin/env python
# -*- coding: latin-1; py-indent-offset:4 -*-
################################################################################
#
# This file is part of HttxLib
#
# HttxLib is an HTTP(s) Python library suited multithreaded/multidomain
# applications
#
# Copyright (C) 2010-2011 Daniel Rodriguez (a... |
t0mk/ansible | refs/heads/devel | lib/ansible/modules/cloud/ovirt/ovirt_quotas.py | 8 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# 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
#... |
kou/zulip | refs/heads/master | zerver/migrations/0125_realm_max_invites.py | 7 | # Generated by Django 1.11.6 on 2017-11-30 04:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('zerver', '0124_stream_enable_notifications'),
]
operations = [
migrations.AddField(
model_name='realm',
name='max_i... |
khagler/boto | refs/heads/develop | tests/integration/cloudsearch2/__init__.py | 645 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
# 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 r... |
everypony/ponyFiction | refs/heads/development | config/local/python/app.py | 1 | # -*- coding: utf-8 -*-
from ponyFiction.settings.base import *
INSTALLED_APPS += ('debug_toolbar',)
JQUERY_URL = ''
# Captcha
RECAPTCHA_PUBLIC_KEY = '6Ld1_QgUAAAAAMh-JiWgux_6CERc4aATQs0iK-J2'
RECAPTCHA_PRIVATE_KEY = '6Ld1_QgUAAAAAAAAmZSDhjvskUNHFsZniIdwkn5S'
# Templates
TEMPLATES[0]['OPTIONS']['loaders'] = [
'... |
liuyang-li/buck | refs/heads/master | third-party/py/twitter-commons/src/python/twitter/common/python/pex_builder.py | 5 | # ==================================================================================================
# Copyright 2011 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... |
MQQiang/kbengine | refs/heads/master | kbe/src/lib/python/Lib/test/test_file.py | 83 | import sys
import os
import unittest
from array import array
from weakref import proxy
import io
import _pyio as pyio
from test.support import TESTFN, run_unittest
from collections import UserList
class AutoFileTests:
# file tests for which a test file is automatically set up
def setUp(self):
self.f... |
gmist/kay-ru | refs/heads/master | kay/management/shell.py | 3 | # -*- coding: utf-8 -*-
"""
Kay remote shell management command.
:Copyright: (c) 2009 Accense Technology, Inc.
Takashi Matsuo <tmatsuo@candit.jp>,
All rights reserved.
:license: BSD, see LICENSE for more details.
"""
import os
import os.path
import sys
import time
import ge... |
sungkim11/mhargadh | refs/heads/master | django/contrib/messages/storage/user_messages.py | 308 | """
Storages used to assist in the deprecation of contrib.auth User messages.
"""
from django.contrib.messages import constants
from django.contrib.messages.storage.base import BaseStorage, Message
from django.contrib.auth.models import User
from django.contrib.messages.storage.fallback import FallbackStorage
class ... |
jillesme/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/test/skip.py | 174 | # Copyright (C) 2010 Apple 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:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
AlexanderSavelyev/rdkit | refs/heads/master | Docs/Book/conf.py | 1 | # -*- coding: utf-8 -*-
#
# RDKit documentation build configuration file, created by
# sphinx-quickstart on Sun Aug 7 18:51:45 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All c... |
pythonprobr/pypratico | refs/heads/master | web/pizza/entrega/models.py | 1 | # coding: utf-8
from django.db import models
DDD_DEFAULT = '11'
class Cliente(models.Model):
ddd = models.CharField(max_length=2, default=DDD_DEFAULT)
fone = models.CharField(max_length=8, db_index=True)
ramal = models.CharField(max_length=4, blank=True, db_index=True)
contato = models.CharField(max_... |
Omegaphora/external_chromium_org | refs/heads/lp5.1 | third_party/tlslite/tlslite/integration/tlssocketservermixin.py | 116 | # Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
"""TLS Lite + SocketServer."""
from tlslite.tlsconnection import TLSConnection
class TLSSocketServerMixIn:
"""
This class can be mixed in with any L{SocketServer.TCPServer} to
add TLS support.
To use thi... |
espadrine/opera | refs/heads/master | chromium/src/tools/grit/grit/node/io_unittest.py | 9 | #!/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.
'''Unit tests for io.FileNode'''
import os
import sys
if __name__ == '__main__':
sys.path.append(os.path.join(os.path.dirname(__... |
gdb/pyseidon | refs/heads/master | pyseidon/__init__.py | 1 | import array
import atexit
import errno
import fcntl
import _multiprocessing
import os
import select
import signal
import socket
import struct
import sys
# Read a line up to a custom delimiter
def _recvline(io, delim=b'\n'):
buf = []
while True:
byte = io.recv(1)
buf.append(byte)
# End... |
nathanbjenx/cairis | refs/heads/master | cairis/gui/SecurityPatternNotebook.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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.