repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
karyon/django | refs/heads/master | tests/test_exceptions/__init__.py | 12133432 | |
onshape/jenkins-job-builder | refs/heads/master | tests/wrappers/__init__.py | 12133432 | |
matthiasplappert/motion_classification | refs/heads/master | src/toolkit/__init__.py | 12133432 | |
citrix-openstack-build/sahara | refs/heads/master | sahara/tests/unit/db/migration/__init__.py | 12133432 | |
klausman/scion | refs/heads/master | python/test/lib/packet/pcb_test.py | 1 | # Copyright 2015 ETH Zurich
#
# 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, sof... |
rshkarin/afm-particle-analysis | refs/heads/master | nanoscope/parameter.py | 1 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, unicode_literals
import datetime
import re
import six
__all__ = ['parse_parameter']
class CiaoParameter(object):
"""
Parent class for generic values from the header.
"""
type = 'P'
def __init__(self, parameter, hard_val... |
UdK-VPT/Open_eQuarter | refs/heads/master | mole/stat_corr/rb_present_wall_uvalue_SDH_by_building_age_lookup.py | 1 | # coding: utf8
# OeQ autogenerated lookup function for 'U-Values of Walls in correlation to year of construction, based on the source data of the survey for the "German Building Typology developed by the "Institut für Wohnen und Umwelt", Darmstadt/Germany, 2011-2013'
import math
import numpy as np
import oeqLookuptabl... |
internetmosquito/flask-scheduler | refs/heads/master | project/api/views.py | 1 | __author__ = 'mosquito'
from functools import wraps
from flask import flash, redirect, jsonify, \
session, url_for, Blueprint, make_response
from project import db
from project.models import Appointment
################
#### config ####
################
api_blueprint = Blueprint('api', __name__)
###############... |
Maccimo/intellij-community | refs/heads/master | python/testData/refactoring/rename/renameImportSubModuleAs/before/p1/foo.py | 415 | def f():
pass |
wangli1426/heron | refs/heads/master | heron/pyheron/tests/python/component_unittest.py | 8 | # Copyright 2016 Twitter. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... |
ski7777/fttxpy | refs/heads/master | fttxpy/__init__.py | 1 | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
#
class Debug():
PrintPackageRaw = False
PrintUnknownPackageRaw = True
PrintPackagePing = False
PrintChecksumError = False
PrintPackageSendError = False
PrintPackageJSONRX = False
PrintPackageJSONTX = False
PrintSendRetriesWrongCC = False... |
Metaswitch/calico-nova | refs/heads/calico-readme | nova/tests/functional/v3/test_extension_info.py | 6 | # Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... |
sandeepkbhat/pylearn2 | refs/heads/master | pylearn2/datasets/hdf5_deprecated.py | 30 | """
Objects for datasets serialized in HDF5 format (.h5).
"""
__author__ = "Steven Kearnes"
__copyright__ = "Copyright 2014, Stanford University"
__license__ = "3-clause BSD"
try:
import h5py
except ImportError:
h5py = None
import numpy as np
from theano.compat.six.moves import xrange
import warnings
from py... |
egabancho/invenio | refs/heads/pu | invenio/modules/workflows/tasks/__init__.py | 3 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 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) a... |
unixer/SifBoX | refs/heads/master | packages/multimedia/kodi/defconfig/.kodi/.kodi/addons/script.module.simplejson/lib/simplejson/tool.py | 262 | r"""Command-line tool to validate and pretty-print JSON
Usage::
$ echo '{"json":"obj"}' | python -m simplejson.tool
{
"json": "obj"
}
$ echo '{ 1.2:3.4}' | python -m simplejson.tool
Expecting property name: line 1 column 2 (char 2)
"""
from __future__ import with_statement
import sys
impo... |
dsdinter/learning-spark-examples | refs/heads/master | src/python/BasicMap.py | 42 | """
>>> from pyspark.context import SparkContext
>>> sc = SparkContext('local', 'test')
>>> b = sc.parallelize([1, 2, 3, 4])
>>> sorted(basicSquare(b).collect())
[1, 4, 9, 16]
"""
import sys
from pyspark import SparkContext
def basicSquare(nums):
"""Square the numbers"""
return nums.map(lambda x: x * x)
if... |
bakhtout/odoo-educ | refs/heads/8.0 | setup/win32/win32_setup.py | 363 | # -*- coding: utf-8 -*-
import os
import glob
import py2exe
from distutils.core import setup
execfile(os.path.join(os.path.dirname(__file__), '..', '..', 'openerp', 'release.py'))
def generate_files():
actions = {
'start': ['stop', 'start'],
'stop': ['stop'],
}
files = []
if os.nam... |
evalsocket/tensorflow | refs/heads/master | object_detection/object_detection/builders/box_predictor_builder_test.py | 21 | # Copyright 2017 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... |
ionutbalutoiu/ironic | refs/heads/master | ironic/api/controllers/v1/port.py | 3 | # Copyright 2013 UnitedStack 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... |
v-iam/azure-sdk-for-python | refs/heads/master | azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_request_routing_rule.py | 2 | # 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 ... |
kernsuite-debian/obit | refs/heads/master | python/scriptQuantize.py | 2 | # python/Obit script to quantize a FITS image
# The output image is the input image written as 16 or 32 bit integers
# with a quantization level a given fraction of the minimum RMS in any plane.
# Arguments:
# 1) Name of input FITS image to be quantized
# 2) Name of output FITS image
# 3) The fraction of the RMS for th... |
zhouzhenghui/python-for-android | refs/heads/master | python-modules/twisted/twisted/mail/smtp.py | 49 | # -*- test-case-name: twisted.mail.test.test_smtp -*-
# Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Simple Mail Transfer Protocol implementation.
"""
import time, re, base64, types, socket, os, random, rfc822
import binascii
from email.base64MIME import encode as encode_base64
... |
wilsonkichoi/zipline | refs/heads/master | tests/risk/annotation_utils.py | 50 | #
# Copyright 2013 Quantopian, 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 wr... |
4rado/RepositoryForProject | refs/heads/master | Lib/xmllib.py | 41 | """A parser for XML, using the derived class as static DTD."""
# Author: Sjoerd Mullender.
import re
import string
version = '0.3'
class Error(RuntimeError):
pass
# Regular expressions used for parsing
_S = '[ \t\r\n]+' # white space
_opS = '[ \t\r\n]*' # optional whi... |
doantranhoang/namebench | refs/heads/master | libnamebench/data_sources.py | 173 | #!/usr/bin/env python
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... |
Darkmoth/python-django-4 | refs/heads/master | Thing/env/Lib/encodings/cp857.py | 593 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP857.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_map)
def decode(self,input,errors='strict'):
... |
etuna-SBF-kog/Stadsparken | refs/heads/master | env/lib/python2.7/site-packages/setuptools/command/__init__.py | 210 | __all__ = [
'alias', 'bdist_egg', 'bdist_rpm', 'build_ext', 'build_py', 'develop',
'easy_install', 'egg_info', 'install', 'install_lib', 'rotate', 'saveopts',
'sdist', 'setopt', 'test', 'upload', 'install_egg_info', 'install_scripts',
'register', 'bdist_wininst', 'upload_docs',
]
from setuptools.comman... |
hehongliang/tensorflow | refs/heads/master | tensorflow/contrib/data/python/kernel_tests/slide_dataset_op_test.py | 9 | # Copyright 2018 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... |
menegon/geonode | refs/heads/master | geonode/upload/templatetags/upload_tags.py | 35 | from django import template
register = template.Library()
@register.simple_tag
def upload_js():
return """
<!-- The template to display files available for upload -->
<script id="template-upload" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-upload fade">
<... |
datacats/datacats | refs/heads/master | datacats/cli/main.py | 5 | # Copyright 2014-2015 Boxkite Inc.
# This file is part of the DataCats package and is released under
# the terms of the GNU Affero General Public License version 3.0.
# See LICENSE.txt or http://www.fsf.org/licensing/licenses/agpl-3.0.html
"""datacats command line interface
Usage:
datacats COMMAND [ARGUMENTS...]
... |
livioferrante/my-final-project | refs/heads/master | .mywaflib/waflib/extras/lru_cache.py | 10 | #! /usr/bin/env python
# encoding: utf-8
# Thomas Nagy 2011
import os, shutil, re
from waflib import Options, Build, Logs
"""
Apply a least recently used policy to the Waf cache.
For performance reasons, it is called after the build is complete.
We assume that the the folders are written atomically
Do export WAFCA... |
gilbertw/PTVS | refs/heads/master | Python/Tests/TestData/VirtualEnv/env/Lib/encodings/iso8859_3.py | 93 | """ Python Character Mapping Codec iso8859_3 generated from 'MAPPINGS/ISO8859/8859-3.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,i... |
slightlynybbled/tk_tools | refs/heads/master | tests/test_SmartOptionMenu.py | 1 | import tkinter as tk
import pytest
from tk_tools import SmartOptionMenu
from tests.test_basic import root
@pytest.fixture
def som(root):
som_widget = SmartOptionMenu(root, ['1', '2', '3'])
som_widget.grid()
yield som_widget
def test_creation(root):
SmartOptionMenu(root, ['1', '2', '3'])
def te... |
VitalPet/partner-contact | refs/heads/8.0 | portal_partner_merge/__openerp__.py | 15 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Yannick Vaucher
# Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pub... |
jalexvig/tensorflow | refs/heads/master | tensorflow/python/training/optimizer.py | 3 | # 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... |
ritzk/ansible-modules-extras | refs/heads/devel | cloud/vmware/vmware_vm_facts.py | 75 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Joseph Callen <jcallen () csc.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 Li... |
dev-harsh1998/Phantom-Jalebi | refs/heads/PhantoM-N | tools/perf/tests/attr.py | 3174 | #! /usr/bin/python
import os
import sys
import glob
import optparse
import tempfile
import logging
import shutil
import ConfigParser
class Fail(Exception):
def __init__(self, test, msg):
self.msg = msg
self.test = test
def getMsg(self):
return '\'%s\' - %s' % (self.test.path, self.msg)... |
Kazade/NeHe-Website | refs/heads/master | google_appengine/lib/django-1.4/django/contrib/gis/tests/layermap/models.py | 239 | from django.contrib.gis.db import models
class State(models.Model):
name = models.CharField(max_length=20)
objects = models.GeoManager()
class County(models.Model):
name = models.CharField(max_length=25)
state = models.ForeignKey(State)
mpoly = models.MultiPolygonField(srid=4269) # Multipolygon in... |
HaveF/idapython | refs/heads/master | examples/colours.py | 16 | #---------------------------------------------------------------------
# Colour test
#
# This script demonstrates the usage of background colours.
#
# Author: Gergely Erdelyi <gergely.erdelyi@d-dome.net>
#---------------------------------------------------------------------
# Set the colour of the current segm... |
brinbois/Sick-Beard | refs/heads/development | sickbeard/webserveInit.py | 43 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 t... |
M4sse/chromium.src | refs/heads/nw12 | tools/perf/benchmarks/power.py | 10 | # Copyright 2014 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.
from measurements import power
import page_sets
from telemetry import benchmark
@benchmark.Enabled('android')
class PowerAndroidAcceptance(benchmark.Benchm... |
switowski/invenio | refs/heads/master | invenio/modules/formatter/format_elements/bfe_authority_control_no.py | 13 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2015 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
# Li... |
oinopion/django | refs/heads/master | tests/gis_tests/geoapp/feeds.py | 367 | from __future__ import unicode_literals
from django.contrib.gis import feeds
from .models import City
class TestGeoRSS1(feeds.Feed):
link = '/city/'
title = 'Test GeoDjango Cities'
def items(self):
return City.objects.all()
def item_link(self, item):
return '/city/%s/' % item.pk
... |
nanvel/c2p2 | refs/heads/master | setup.py | 2 | # -*- encoding: utf-8 -*-
"""
Python setup file for the nicedit app.
In order to register your app at pypi.python.org, create an account at
pypi.python.org and login, then register your new app like so:
python setup.py register
If your name is still free, you can now make your first release but first you
should ... |
ravello/ansible | refs/heads/devel | v2/ansible/inventory/host.py | 34 | # (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... |
evax/ansible-modules-core | refs/heads/devel | cloud/openstack/os_volume.py | 131 | #!/usr/bin/python
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# This module 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 late... |
IronLanguages/ironpython3 | refs/heads/master | Tests/interop/net/loadorder/t3b.py | 1 | # Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information.
from iptest.assert_util import *
add_clr_assemblies("loadorder_3")
# namespace First {
# public class ... |
opensourcechipspark/platform_external_chromium_org | refs/heads/master | chrome/common/extensions/docs/server2/caching_rietveld_patcher.py | 25 | # Copyright 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.
from datetime import datetime, timedelta
from file_system import FileNotFoundError, ToUnicode
from future import Future
from patcher import Patcher
_VERSION... |
StenbergSimon/CNV_pipe | refs/heads/master | cnv_caller.py | 1 |
import pysam
import numpy
import sys
import os
import math
import optparse
from subprocess import call
#Set the options that need to be set
prsr = optparse.OptionParser()
prsr.add_option("-w", "--windowSize", dest="winsize", metavar="INT", default=500, help="Windowsize (bp) to be used to calculate log2ratio [Default:... |
Changaco/oh-mainline | refs/heads/master | vendor/packages/PyYaml/lib/yaml/events.py | 986 |
# Abstract classes.
class Event(object):
def __init__(self, start_mark=None, end_mark=None):
self.start_mark = start_mark
self.end_mark = end_mark
def __repr__(self):
attributes = [key for key in ['anchor', 'tag', 'implicit', 'value']
if hasattr(self, key)]
argu... |
sreidy/roboticsclub.org | refs/heads/master | faq/__init__.py | 12133432 | |
Shouqun/node-gn | refs/heads/master | tools/depot_tools/testing_support/__init__.py | 12133432 | |
StuntsPT/Structure_threader | refs/heads/master | structure_threader/colorer/__init__.py | 12133432 | |
monikasulik/django-oscar | refs/heads/master | src/oscar/apps/customer/notifications/__init__.py | 12133432 | |
konrado0/vosqa | refs/heads/master | conf/__init__.py | 12133432 | |
kawamon/hue | refs/heads/master | desktop/core/ext-py/boto-2.46.1/tests/integration/s3/test_mfa.py | 136 | # Copyright (c) 2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
# 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 restrict... |
stynr/diaphora | refs/heads/master | pygments/styles/vim.py | 50 | # -*- coding: utf-8 -*-
"""
pygments.styles.vim
~~~~~~~~~~~~~~~~~~~
A highlighting style for Pygments, inspired by vim.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keywor... |
morganics/BayesPy | refs/heads/master | bayespy/ml.py | 1 | from bayespy.network import NetworkFactory
class Selector:
def __init__(self, target, continuous=[], discrete=[]):
self.target = target
self._continuous = list(continuous)
self._discrete = list(discrete)
self._index = -1
self._all_variables = self._continuous + self._discret... |
digideskio/ajenti | refs/heads/master | ajenti/plugins/recovery/config.py | 17 | from ajenti.api import ModuleConfig
from main import RecoveryPlugin
class GeneralConfig(ModuleConfig):
target = RecoveryPlugin
labels = {
'auto': 'Automatic backup'
}
auto = True
|
pidydx/grr | refs/heads/master | grr/lib/builders/tests.py | 2 | #!/usr/bin/env python
"""Test registry for builders."""
# These need to register plugins so, pylint: disable=unused-import
from grr.lib.builders import signing_test
# pylint: enable=unused-import
|
timsnyder/bokeh | refs/heads/master | bokeh/models/selections.py | 2 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... |
tcwicklund/django | refs/heads/master | django/contrib/admindocs/apps.py | 589 | from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class AdminDocsConfig(AppConfig):
name = 'django.contrib.admindocs'
verbose_name = _("Administrative Documentation")
|
igal/openproposals | refs/heads/master | public/fckeditor/_samples/py/sample01.py | 69 | #!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2008 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")
h... |
JAOSP/aosp_platform_external_chromium_org | refs/heads/master | tools/perf/benchmarks/blink_perf.py | 23 | # 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 os
from telemetry import test
from telemetry.core import util
from measurements import blink_perf
class BlinkPerfAll(test.Test):
test = blin... |
spasmilo/electrum | refs/heads/master | lib/simple_config.py | 2 | import ast
import threading
import os
from util import user_dir, print_error, print_msg
SYSTEM_CONFIG_PATH = "/etc/electrum.conf"
config = None
def get_config():
global config
return config
def set_config(c):
global config
config = c
class SimpleConfig(object):
"""
The SimpleConfig clas... |
djmitche/build-relengapi | refs/heads/master | relengapi/blueprints/tokenauth/types.py | 3 | # 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/.
from __future__ import absolute_import
from datetime import datetime
import wsme.types
from relengapi.lib.api import ... |
rebstar6/servo | refs/heads/master | tests/wpt/web-platform-tests/referrer-policy/generic/subresource/document.py | 227 | import os, json, sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import subresource
def generate_payload(server_data):
return subresource.get_template("document.html.template") % server_data
def main(request, response):
subresource.respond(request,
response,
... |
garg10may/youtube-dl | refs/heads/master | devscripts/make_contributing.py | 137 | #!/usr/bin/env python
from __future__ import unicode_literals
import io
import optparse
import re
def main():
parser = optparse.OptionParser(usage='%prog INFILE OUTFILE')
options, args = parser.parse_args()
if len(args) != 2:
parser.error('Expected an input and an output filename')
infile, o... |
tttthemanCorp/CardmeleonAppEngine | refs/heads/master | django/views/__init__.py | 12133432 | |
luisjuansp/NaoWatsonTutor | refs/heads/master | watson_conversation.py | 1 | from watson_developer_cloud import ConversationV1
import unicodedata
class Watson_Conversation:
def __init__(self, username, password, version, workspace_id):
self.conversation = ConversationV1(
username=username,
password=password,
version=version)
... |
dma-source/EjerciciosPython | refs/heads/master | numeroMayor.py | 1 | print "Introduce 5 numeros:"
vector=[] #definimos una lista
#introducimos 5 numeros
for i in range(0,5):
numero=int(raw_input('introduce no. '+str(i+1)+': '))
vector.append(numero)
print vector
mayor=0
for v in vector:
if mayor<v:
mayor=v
print 'mayor es: ',mayor
#ESTE SCRIPT NO ES MIO LO COPIÉ D... |
kasioumis/invenio | refs/heads/master | invenio/testsuite/test_legacy_webdoc.py | 13 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2008, 2009, 2010, 2011, 2013 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 (a... |
cobbler/cobbler | refs/heads/master | cobbler/actions/reposync.py | 1 | """
Builds out and synchronizes yum repo mirrors.
Initial support for rsync, perhaps reposync coming later.
Copyright 2006-2007, Red Hat, Inc and Others
Michael DeHaan <michael.dehaan AT gmail>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as... |
OpenGenus/cosmos | refs/heads/master | code/greedy_algorithms/src/minimum_coins/minimum_coins.py | 3 | # Part of Cosmos by OpenGenus Foundation
def minimum_coins(value, denominations):
result = []
# Assuming denominations is sorted in descendig order
for cur_denom in denominations:
while cur_denom <= value:
result.append(cur_denom)
value = value - cur_denom
return resul... |
sudosurootdev/external_chromium_org | refs/heads/L5 | tools/telemetry/telemetry/__init__.py | 49 | # Copyright 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.
"""A library for cross-platform browser tests."""
import sys
# Ensure Python >= 2.7.
if sys.version_info < (2, 7):
print >> sys.stderr, 'Need Python 2.7 ... |
Roxling/smegod | refs/heads/master | Smegod/external/assimp-3.1.1-win-binaries/test/regression/run.py | 15 | #!/usr/bin/env python3
# -*- Coding: UTF-8 -*-
# ---------------------------------------------------------------------------
# Open Asset Import Library (ASSIMP)
# ---------------------------------------------------------------------------
#
# Copyright (c) 2006-2010, ASSIMP Development Team
#
# All rights reserved.
#... |
myvoice-nigeria/myvoice | refs/heads/develop | myvoice/clinics/migrations/0006_auto__add_service.py | 1 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as 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 'Service'
db.create_table(u'clinics_service', (
... |
you21979/phantomjs | refs/heads/2.0 | src/breakpad/src/tools/gyp/test/variables/gyptest-commands-repeated.py | 138 | #!/usr/bin/env python
# Copyright (c) 2009 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.
"""
Test variable expansion of '<!()' syntax commands where they are evaluated
more then once..
"""
import os
import TestGyp
test = TestG... |
RickyCook/DockCI | refs/heads/master | dockci/models/base.py | 2 | """ Base model classes, mixins """
class RepoFsMixin(object):
""" Mixin to add ``display_repo`` and ``command_repo`` properties """
@property
def display_repo(self):
""" Repo, redacted for display """
return self.repo_fs.format(
token_key='****',
)
@property
d... |
dednal/chromium.src | refs/heads/nw12 | native_client_sdk/src/tools/lib/elf.py | 100 | # Copyright 2014 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.
"""Helper script for extracting information from ELF files"""
import struct
class Error(Exception):
'''Local Error class for this file.'''
pass
def ... |
frouty/odoo_oph | refs/heads/dev_70 | addons/mail/tests/test_invite.py | 57 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... |
pranavj1001/LearnLanguages | refs/heads/master | python/GraphAlgorithms/BellmanFord/Vertex.py | 2 | import sys
class Vertex(object):
# constructor
# provides the basic structure of the vertex
def __init__(self, name):
self.name = name
self.predecessor = None
self.neighbourList = []
# initially minDistance = the largest positive integer supported by the platform’s Py_ssize... |
schwarz/youtube-dl | refs/heads/master | youtube_dl/extractor/videolecturesnet.py | 64 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
find_xpath_attr,
int_or_none,
parse_duration,
unified_strdate,
)
class VideoLecturesNetIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?videolectures\.net/(?P<id>[^/#?]+)/*(?:[#?].*)?$'
... |
houssine78/vertical-distribution-circuits | refs/heads/9.0 | distribution_circuits_base/models/res_partner.py | 1 | # -*- coding: utf-8 -*-
from openerp import api, fields, models, _
class ResPartner(models.Model):
_inherit = "res.partner"
is_gac = fields.Boolean(string="Est un GAC")
is_raliment_point = fields.Boolean(string="Est un Point de Raliment")
is_delivery_point = fields.Boolean(string="Est ... |
40223151/2014c2g9 | refs/heads/master | wsgi/static/Brython2.1.0-20140419-113919/Lib/_codecs.py | 107 |
def ascii_decode(*args,**kw):
pass
def ascii_encode(*args,**kw):
pass
def charbuffer_encode(*args,**kw):
pass
def charmap_build(*args,**kw):
pass
def charmap_decode(*args,**kw):
pass
def charmap_encode(*args,**kw):
pass
def decode(*args,**kw):
"""decode(obj, [encoding[,errors]]) -> ob... |
Maikflow/django_test | refs/heads/master | lib/python2.7/site-packages/pip/_vendor/html5lib/serializer/__init__.py | 1731 | from __future__ import absolute_import, division, unicode_literals
from .. import treewalkers
from .htmlserializer import HTMLSerializer
def serialize(input, tree="etree", format="html", encoding=None,
**serializer_opts):
# XXX: Should we cache this?
walker = treewalkers.getTreeWalker(tree)
... |
vakaras/Memorize | refs/heads/master | bootstrap.py | 44 | ##############################################################################
#
# Copyright (c) 2006 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SO... |
40123142/finalexam | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/keyword.py | 761 | #! /usr/bin/env python3
"""Keywords (from "graminit.c")
This file is automatically generated; please don't muck it up!
To update the symbols in this file, 'cd' to the top directory of
the python source tree after building the interpreter and run:
./python Lib/keyword.py
"""
__all__ = ["iskeyword", "kwlist"]
k... |
fo0nikens/gr-air-modes | refs/heads/master | docs/doxygen/doxyxml/generated/compoundsuper.py | 348 | #!/usr/bin/env python
#
# Generated Thu Jun 11 18:44:25 2009 by generateDS.py.
#
import sys
import getopt
from string import lower as str_lower
from xml.dom import minidom
from xml.dom import Node
#
# User methods
#
# Calls to the methods in these classes are generated by generateDS.py.
# You can replace these metho... |
shakamunyi/nova | refs/heads/master | nova/tests/unit/api/openstack/compute/__init__.py | 12133432 | |
typemytype/vanilla | refs/heads/master | Lib/vanilla/vanillaProgressSpinner.py | 3 | from AppKit import *
from vanillaBase import VanillaBaseObject, _sizeStyleMap
class ProgressSpinner(VanillaBaseObject):
"""
An animated, spinning progress indicator.::
from vanilla import *
class ProgressSpinnerDemo(object):
def __init__(self):
self.w = Window((... |
llhe/tensorflow | refs/heads/master | tensorflow/contrib/keras/python/keras/utils/data_utils.py | 8 | # 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... |
cirlabs/heroku-buildpack-geodjango | refs/heads/master | vendor/distribute-0.6.36/tests/shlib_test/setup.py | 87 | from setuptools import setup, Extension, Library
setup(
name="shlib_test",
ext_modules = [
Library("hellolib", ["hellolib.c"]),
Extension("hello", ["hello.pyx"], libraries=["hellolib"])
],
test_suite="test_hello.HelloWorldTest",
)
|
Yrthgze/prueba-sourcetree2 | refs/heads/master | renzongxian/0023/mysite/guestbook/views.py | 40 | from django.shortcuts import render
from guestbook.models import Messages
import datetime
def index(request):
if request.method == 'POST':
p = Messages(name=request.POST['name'], pub_date=datetime.datetime.now(), content=request.POST['content'])
p.save()
posted_messages = Messages.objects.orde... |
holmes/intellij-community | refs/heads/master | python/helpers/pydev/pydev_ipython/version.py | 142 | # encoding: utf-8
"""
Utilities for version comparison
It is a bit ridiculous that we need these.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the f... |
Just-D/chromium-1 | refs/heads/master | media/tools/layout_tests/layouttest_analyzer_helpers.py | 120 | # 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.
"""Helper functions for the layout test analyzer."""
from datetime import datetime
from email.mime.multipart import MIMEMultipart
from email.mime.text i... |
marktiu7/demo | refs/heads/master | dbtest/dbtest/urls.py | 1 | """dbtest URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/dev/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-base... |
mvidalgarcia/indico | refs/heads/master | indico/modules/rb/models/room_bookable_hours.py | 2 | # This file is part of Indico.
# Copyright (C) 2002 - 2019 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from datetime import time
from indico.core.db import db
from indico.util.string import return_ascii
cla... |
liangazhou/django-rdp | refs/heads/master | packages/Django-1.8.6/django/db/models/aggregates.py | 26 | """
Classes to represent the definitions of aggregate functions.
"""
from django.core.exceptions import FieldError
from django.db.models.expressions import Func, Star
from django.db.models.fields import FloatField, IntegerField
__all__ = [
'Aggregate', 'Avg', 'Count', 'Max', 'Min', 'StdDev', 'Sum', 'Variance',
]
... |
akhilaananthram/nupic | refs/heads/master | scripts/profiling/enc_profile.py | 35 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.