repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
markslwong/tensorflow
tensorflow/python/debug/cli/base_ui.py
97
6321
# 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...
apache-2.0
ubic135/odoo-design
addons/l10n_es/__openerp__.py
314
2772
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2008-2010 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved. # Jordi Esteve <jesteve@zikzakmedia.com> # Copy...
agpl-3.0
amenonsen/ansible
lib/ansible/modules/cloud/univention/udm_dns_record.py
24
5379
#!/usr/bin/python # -*- coding: UTF-8 -*- # Copyright: (c) 2016, Adfinis SyGroup AG # Tobias Rueetschi <tobias.ruetschi@adfinis-sygroup.ch> # 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...
gpl-3.0
jolevq/odoopub
addons/hr_timesheet_sheet/res_config.py
389
2324
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
marcellodesales/svnedge-console
ext/linux/pkg-toolkit/pkg/vendor-packages/pkg/depot.py
8
31605
#!/usr/bin/python2.4 # # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License (the "License"). # You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://w...
agpl-3.0
jefffohl/nupic
tests/unit/nupic/data/aggregator_test.py
35
2183
#!/usr/bin/env python # ---------------------------------------------------------------------- # 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 ...
gpl-3.0
skevy/django
tests/regressiontests/forms/tests/fields.py
28
59519
# -*- coding: utf-8 -*- """ ########## # Fields # ########## Each Field class does some sort of validation. Each Field has a clean() method, which either raises django.forms.ValidationError or returns the "clean" data -- usually a Unicode object, but, in some rare cases, a list. Each Field's __init__() takes at least...
bsd-3-clause
lvtk/lvtk
waflib/extras/stracedeps.py
55
4102
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2015 (ita) """ Execute tasks through strace to obtain dependencies after the process is run. This scheme is similar to that of the Fabricate script. To use:: def configure(conf): conf.load('strace') WARNING: * This will not work when advanced scanners ar...
isc
chauhanmohit/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/checkout/scm/scm.py
119
9007
# Copyright (c) 2009, Google Inc. All rights reserved. # Copyright (c) 2009 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: # # * Redistributions of source code must retain the abov...
bsd-3-clause
suhussai/youtube-dl
youtube_dl/extractor/yandexmusic.py
45
6355
# coding: utf-8 from __future__ import unicode_literals import re import hashlib from .common import InfoExtractor from ..compat import ( compat_str, compat_urllib_parse, compat_urllib_request, ) from ..utils import ( int_or_none, float_or_none, ) class YandexMusicTrackIE(InfoExtractor): IE_...
unlicense
dennybaa/st2
st2common/st2common/logging/misc.py
7
3738
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
apache-2.0
Jobava/zamboni
lib/template_loader.py
48
1354
# -*- coding: utf-8 -*- from django.conf import settings from jingo import Loader as JingoLoader, Template class Loader(JingoLoader): """Use JINGO_EXCLUDE_PATHS to exclude templates based on their path. jingo.Loader has a JINGO_EXCLUDE_APPS that only allows to provide the "app" part of a template (the p...
bsd-3-clause
charbeljc/pystache
pystache/defaults.py
48
2007
# coding: utf-8 """ This module provides a central location for defining default behavior. Throughout the package, these defaults take effect only when the user does not otherwise specify a value. """ try: # Python 3.2 adds html.escape() and deprecates cgi.escape(). from html import escape except ImportErro...
mit
mpi-sws-rse/datablox
blox/enum_shard__1_0/b_enum_shard.py
1
4344
"""This is a shard that works off a fixed set of values. The shard_field configuration property should be set to an incoming message property that can be used to select a shard. Each node's definition should have a property called shard_field_value. This is used to build a mapping from vlaues of the shard_field to node...
apache-2.0
stefan-jonasson/home-assistant
homeassistant/components/media_player/pioneer.py
13
7051
""" Support for Pioneer Network Receivers. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/media_player.pioneer/ """ import logging import telnetlib import voluptuous as vol from homeassistant.components.media_player import ( SUPPORT_PAUSE, SUPPORT_...
mit
procamora/Wiki-Personal
pelican-plugins/liquid_tags/speakerdeck.py
7
1329
""" Speakerdeck Tag --------------- This implements a Liquid-style speakerdeck tag for Pelican. Syntax ------ {% speakerdeck id %} Example ------- {% speakerdeck 82b209c0f181013106da6eb14261a8ef %} Output ------ <script async class="speakerdeck-embed" data-id="82b209c0f181013106da6eb14261a8ef" data-r...
gpl-3.0
zengenti/ansible
lib/ansible/modules/cloud/openstack/_quantum_floating_ip.py
4
10648
#!/usr/bin/python #coding: utf-8 -*- # (c) 2013, Benno Joy <benno@ansible.com> # # 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 later ...
gpl-3.0
alexryndin/ambari
ambari-server/src/main/resources/stacks/BigInsights/4.0/services/OOZIE/package/scripts/oozie_server.py
1
8565
#!/usr/bin/env python """ 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");...
apache-2.0
CongSmile/tp-qemu
qemu/tests/hello_world.py
16
3700
import logging import time from autotest.client import utils from autotest.client.shared import error # This decorator makes the test function aware of context strings @error.context_aware def run(test, params, env): """ QEMU 'Hello, world!' test 1) Boot the main vm, or just grab it if it's already boote...
gpl-2.0
helfertool/helfertool
src/registration/models/shift.py
1
7529
from django.core.validators import MinValueValidator from django.db import models from django.db.models.signals import pre_delete from django.dispatch import receiver from django.template.defaultfilters import date as date_f from django.utils.timezone import localtime from django.utils.translation import ugettext_lazy ...
agpl-3.0
18padx08/PPTex
PPTexEnv_x86_64/lib/python2.7/site-packages/numpy/distutils/fcompiler/ibm.py
184
3408
from __future__ import division, absolute_import, print_function import os import re import sys from numpy.distutils.fcompiler import FCompiler from numpy.distutils.exec_command import exec_command, find_executable from numpy.distutils.misc_util import make_temp_file from distutils import log compilers = ['IBMFCompi...
mit
olegpshenichniy/Booktype
lib/booki/editor/south_migrations/0014_auto__chg_field_bookcover_cid.py
11
17162
# -*- 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): # Changing field 'BookCover.cid' db.alter_column('editor_bookcover', 'cid', self.gf('django.db.models.field...
agpl-3.0
hkawasaki/kawasaki-aio8-2
common/lib/logsettings.py
29
5212
import os import platform import sys from logging.handlers import SysLogHandler LOG_LEVELS = ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'] def get_logger_config(log_dir, logging_env="no_env", tracking_filename="tracking.log", edx_filename="edx.log...
agpl-3.0
uiri/pxqz
venv/lib/python2.7/site-packages/django/core/files/base.py
78
3910
import os try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from django.utils.encoding import smart_str, smart_unicode from django.core.files.utils import FileProxyMixin class File(FileProxyMixin): DEFAULT_CHUNK_SIZE = 64 * 2**10 def __init__(self, file, name=None)...
gpl-3.0
daliwangi/bitcoin
test/functional/mempool_spendcoinbase.py
35
2286
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test spending coinbase transactions. The coinbase transaction in block N can appear in block N+100... ...
mit
dennybaa/st2
st2reactor/tests/unit/test_tester.py
2
3785
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
apache-2.0
simplegeo/eventlet
examples/twisted/twisted_server.py
8
1427
"""Simple chat demo application. Listen on port 8007 and re-send all the data received to other participants. Demonstrates how to * plug in eventlet into a twisted application (join_reactor) * how to use SpawnFactory to start a new greenlet for each new request. """ from eventlet.twistedutil import join_reactor from...
mit
mugurrus/superdesk-core
superdesk/lock.py
7
2355
import os import re import socket from mongolock import MongoLock from werkzeug.local import LocalProxy from flask import current_app as app from superdesk.logging import logger _lock_resource_settings = { 'internal_resource': True, 'versioning': False, } class SuperdeskMongoLock(MongoLock): """Superd...
agpl-3.0
DefyVentures/edx-platform
lms/djangoapps/notes/tests.py
18
14426
""" Unit tests for the notes app. """ from mock import patch, Mock from opaque_keys.edx.locations import SlashSeparatedCourseKey from django.test import TestCase from django.test.client import Client from django.core.urlresolvers import reverse from django.contrib.auth.models import User from django.core.exceptions i...
agpl-3.0
LarryHillyer/PoolHost
PoolHost/env/Lib/site-packages/django/views/static.py
46
5175
""" Views and functions for serving static files. These are only to be used during development, and SHOULD NOT be used in a production setting. """ from __future__ import unicode_literals import mimetypes import os import posixpath import re import stat from django.http import ( FileResponse, Http404, HttpRespons...
gpl-3.0
mpapierski/hb_balancer
protocol.py
1
6557
#!/usr/bin/env python # -*- coding: utf-8 -*- # # hb_balancer # High performance load balancer between Helbreath World Servers. # # Copyright (C) 2012 Michał Papierski <michal@papierski.net> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public Lic...
agpl-3.0
Pluto-tv/blink-crosswalk
Tools/Scripts/webkitpy/style/checkers/xml.py
187
2044
# 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...
bsd-3-clause
lakshayg/tensorflow
tensorflow/contrib/layers/python/layers/summaries.py
164
5415
# 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...
apache-2.0
mguentner/tomahawk
thirdparty/breakpad/third_party/protobuf/protobuf/examples/add_person.py
432
1656
#! /usr/bin/python # See README.txt for information and build instructions. import addressbook_pb2 import sys # This function fills in a Person message based on user input. def PromptForAddress(person): person.id = int(raw_input("Enter person ID number: ")) person.name = raw_input("Enter name: ") email = raw_...
gpl-3.0
huguesv/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/conda/exceptions.py
3
52487
# -*- coding: utf-8 -*- # Copyright (C) 2012 Anaconda, Inc # SPDX-License-Identifier: BSD-3-Clause from __future__ import absolute_import, division, print_function, unicode_literals from datetime import timedelta from errno import ENOSPC from functools import partial import json from logging import getLogger import os...
apache-2.0
sameersingh/bibere
scripts/first_pages.py
1
1750
#!/usr/bin/python3 import argparse from read_json import * import tempfile import shutil import pypdftk import os def get_pdf(source, dest): shutil.copy(source, dest) def run(idir, bdir, ofile): authors, venues, papers = read_all_info(idir) fpdf_names = [] tmpdirname = tempfile.mkdtemp...
bsd-2-clause
S2R2/viper
viper/modules/verifysigs/asn1/pkcs7.py
22
5383
#!/usr/bin/env python # Copyright 2011 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
bsd-3-clause
0dataloss/pyrax
tests/unit/test_image.py
12
20320
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import random import unittest from mock import patch from mock import MagicMock as Mock from collections import OrderedDict import pyrax from pyrax.manager import BaseManager import pyrax.image from pyrax.image import assure_image from pyrax.image import Image...
apache-2.0
idegtiarov/ceilometer
ceilometer/tests/unit/api/v2/test_wsme_custom_type.py
12
1124
# # Copyright 2013 eNovance <licensing@enovance.com> # # 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 ...
apache-2.0
jaggu303619/asylum-v2.0
openerp/addons/project_gtd/__init__.py
66
1087
# -*- 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...
agpl-3.0
ChristosChristofidis/twitter_nlp
python/twokenize_wrapper.py
8
1647
#!/homes/gws/aritter/local/bin/python ############################################################################### # Tokinizes strings using the 'twokenize' module, but also splits up # contractions, which 'twokenize' fails to do. # ############################################################################### imp...
gpl-3.0
sepehr125/pybrain
pybrain/structure/networks/recurrent.py
31
5103
# -*- coding: utf-8 -*- """Module that contains the RecurrentNetwork class.""" __author__ = 'Justin Bayer, bayer.justin@googlemail.com' from pybrain.structure.networks.network import Network from pybrain.structure.connections.shared import SharedConnection class RecurrentNetworkComponent(object): sequentia...
bsd-3-clause
virginiacc/owning-a-home
test/browser_testing/features/pages/loan_options.py
11
8931
# coding: utf-8 from selenium import webdriver from selenium.common.exceptions import NoSuchElementException from selenium.common.exceptions import TimeoutException from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditi...
cc0-1.0
Belxjander/Kirito
Python-3.5.0-Amiga/Lib/encodings/rot_13.py
155
2428
#!/usr/bin/env python """ Python Character Mapping Codec for ROT13. This codec de/encodes from str to str. Written by Marc-Andre Lemburg (mal@lemburg.com). """ import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self, input, errors='strict'): return (input.translate(rot13_map), len(input...
gpl-3.0
christianurich/VIBe2UrbanSim
3rdparty/opus/src/urbansim/tools/make_indicators.py
2
3396
# Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE import sys, pickle from opus_core.services.run_server.generic_option_group import GenericOptionGroup from opus_gui.main.opus_project import OpusProject from opus_gui.results_manager.results_mana...
gpl-2.0
openstack/yaql
yaql/language/contexts.py
1
9928
# 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...
apache-2.0
joopert/home-assistant
homeassistant/components/rainbird/sensor.py
22
2005
"""Support for Rain Bird Irrigation system LNK WiFi Module.""" import logging from pyrainbird import RainbirdController from homeassistant.helpers.entity import Entity from . import ( DATA_RAINBIRD, RAINBIRD_CONTROLLER, SENSOR_TYPE_RAINDELAY, SENSOR_TYPE_RAINSENSOR, SENSOR_TYPES, ) _LOGGER = log...
apache-2.0
jlegendary/youtube-dl
youtube_dl/extractor/playwire.py
84
2614
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( xpath_text, float_or_none, int_or_none, ) class PlaywireIE(InfoExtractor): _VALID_URL = r'https?://(?:config|cdn)\.playwire\.com(?:/v2)?/(?P<publisher_id>\d+)/(?:videos/v2|embed|config)/(?P<id>\...
unlicense
liorvh/golismero
tools/sqlmap/sqlmapapi.py
8
1534
#!/usr/bin/env python """ Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import logging import optparse from sqlmap import modulePath from lib.core.common import setPaths from lib.core.data import paths from lib.core.data import logger from lib.ut...
gpl-2.0
qnu/gxp
gxpmake/test/gen_random_file.py
3
1593
#!/usr/bin/python import string,sys,random def gen_ramdom_file(wp, sz, word_len_avg, word_len_sigma, space_len_avg, space_len_sigma, seed): random.seed(seed) S = [] l = 0 while l < sz: wp.write(":::BEG::: ") word_len = random.normalvariate(word_len_avg, word_len_sig...
bsd-3-clause
lihui7115/ChromiumGStreamerBackend
tools/perf/benchmarks/service_worker.py
16
8567
# 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. import collections import page_sets import re from core import perf_benchmark from telemetry import benchmark from telemetry.core import util from telemetr...
bsd-3-clause
jonathan-beard/edx-platform
common/lib/xmodule/xmodule/tests/test_word_cloud.py
166
1792
# -*- coding: utf-8 -*- """Test for Word cloud Xmodule functional logic.""" from webob.multidict import MultiDict from xmodule.word_cloud_module import WordCloudDescriptor from . import LogicTest class WordCloudModuleTest(LogicTest): """Logic tests for Word Cloud Xmodule.""" descriptor_class = WordCloudDescr...
agpl-3.0
mgraupe/acq4
acq4/util/generator/GeneratorTemplate.py
3
25519
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file './acq4/util/generator/GeneratorTemplate.ui' # # Created: Sun Jan 4 11:48:53 2015 # by: PyQt4 UI code generator 4.10.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCor...
mit
thumbimigwe/echorizr
lib/python2.7/site-packages/tests/commands/test_debugsqlshell.py
26
1243
from __future__ import absolute_import, unicode_literals import sys from django.contrib.auth.models import User from django.core import management try: from django.db.backends import utils except ImportError: from django.db.backends import util as utils from django.test import TestCase from django.test.utils ...
mit
azureplus/hue
desktop/core/ext-py/Django-1.6.10/tests/lookup/models.py
107
1557
""" 7. The lookup API This demonstrates features of the database API. """ from __future__ import unicode_literals from django.db import models from django.utils import six from django.utils.encoding import python_2_unicode_compatible class Author(models.Model): name = models.CharField(max_length=100) class...
apache-2.0
ProfessionalIT/professionalit-webiste
sdk/google_appengine/google/appengine/tools/devappserver2/request_rewriter_test.py
8
23353
#!/usr/bin/env python # # Copyright 2007 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 o...
lgpl-3.0
JohnS-01/coala
coalib/bearlib/aspects/Metadata.py
18
7125
from coalib.bearlib.aspects import Root, Taste @Root.subaspect class Metadata: """ This describes any aspect that is related to metadata that is not inside your source code. """ @Metadata.subaspect class CommitMessage: """ Your commit message is important documentation associated with your ...
agpl-3.0
40023255/w16b_test
static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_break.py
785
8138
import gc import io import os import sys import signal import weakref import unittest @unittest.skipUnless(hasattr(os, 'kill'), "Test requires os.kill") @unittest.skipIf(sys.platform =="win32", "Test cannot run on Windows") @unittest.skipIf(sys.platform == 'freebsd6', "Test kills regrtest on freebsd6 " "if threa...
agpl-3.0
grap/OpenUpgrade
addons/website/models/ir_actions.py
363
3074
# -*- coding: utf-8 -*- import urlparse from openerp.http import request from openerp.osv import fields, osv class actions_server(osv.Model): """ Add website option in server actions. """ _name = 'ir.actions.server' _inherit = ['ir.actions.server'] def _compute_website_url(self, cr, uid, id, websit...
agpl-3.0
PriyaShitole/MedViger-lib
core/page/todo/todo.py
33
1510
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import webnotes from webnotes.model.doc import Document @webnotes.whitelist() def get(arg=None): """get todo list""" return webnotes.conn.sql("""select name, owner, descript...
mit
SpamapS/openstack-qa-tools
os_performance_tools/counters2statsd.py
2
5190
# 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 # distributed under the...
apache-2.0
scality/cinder
cinder/volume/drivers/nimble.py
4
39319
# Nimble Storage, Inc. (c) 2013-2014 # 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 requi...
apache-2.0
dominik-th/xbmc
tools/EventClients/lib/python/bt/bt.py
181
2535
# -*- coding: utf-8 -*- # Copyright (C) 2008-2013 Team XBMC # # 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. ...
gpl-2.0
ActiveState/code
recipes/Python/59867_crossplatform_import_hook_endofline/recipe-59867.py
1
1504
# Import hook for end-of-line conversion, # by David Goodger (dgoodger@bigfoot.com). # Put in your sitecustomize.py, anywhere on sys.path, and you'll be able to # import Python modules with any of Unix, Mac, or Windows line endings. import ihooks, imp, py_compile class MyHooks(ihooks.Hooks): def load_source(sel...
mit
WhittKinley/aima-python
submissions/Miles/myLogic.py
15
1451
# farmer = { # 'kb': ''' # Farmer(Mac) # Rabbit(Pete) # Mother(MrsMac, Mac) # Mother(MrsRabbit, Pete) # (Rabbit(r) & Farmer(f)) ==> Hates(f, r) # (Mother(m, c)) ==> Loves(m, c) # (Mother(m, r) & Rabbit(r)) ==> Rabbit(m) # (Farmer(f)) ==> Human(f) # (Mother(m, h) & Human(h)) ==> Human(m) # ''', pets = { 'kb': ''...
mit
emersonsoftware/ansiblefork
lib/ansible/modules/network/netvisor/pn_vlag.py
18
10737
#!/usr/bin/python """ PN CLI vlag-create/vlag-delete/vlag-modify """ # # 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...
gpl-3.0
jjinux/party-playlist-picker
third-party/gdata/geo/data.py
132
2385
#!/usr/bin/python # # Copyright (C) 2009 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 ...
apache-2.0
nhippenmeyer/django
django/contrib/admin/sites.py
122
21115
from functools import update_wrapper from django.apps import apps from django.conf import settings from django.contrib.admin import ModelAdmin, actions from django.contrib.auth import REDIRECT_FIELD_NAME from django.core.exceptions import ImproperlyConfigured, PermissionDenied from django.core.urlresolvers import NoRe...
bsd-3-clause
RTHMaK/RPGOne
deep_qa-master/deep_qa/layers/recurrence_modes.py
1
1184
from typing import Any, Dict from collections import OrderedDict from keras import backend as K class FixedRecurrence: ''' This recurrence class simply performs a fixed number of memory network steps and returns the memory representation and representation of the background knowledge generated by the...
apache-2.0
disler/Kontact
App/Server.py
1
3547
from flask import Flask, render_template, current_app, Response, request from server.DBInterface import DBInterface from server.Validator import Validator from server.WebUtil import WebUtil import json import ast app = Flask(__name__) #load database interface db = DBInterface() #load validator validator = Validator....
mit
richardnpaul/FWL-Website
lib/python2.7/site-packages/south/management/commands/convert_to_south.py
129
3725
""" Quick conversion command module. """ from __future__ import print_function from optparse import make_option import sys from django.core.management.base import BaseCommand from django.core.management.color import no_style from django.conf import settings from django.db import models from django.core import manage...
gpl-3.0
ozamiatin/glance
glance/tests/unit/test_artifacts_plugin_loader.py
10
7406
# Copyright (c) 2015 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 writin...
apache-2.0
angryrancor/kivy
kivy/uix/colorpicker.py
13
15495
''' Color Picker ============ .. versionadded:: 1.7.0 .. warning:: This widget is experimental. Its use and API can change at any time until this warning is removed. The ColorPicker widget allows a user to select a color from a chromatic wheel where pinch and zoom can be used to change the wheel's saturati...
mit
drawks/ansible
lib/ansible/modules/network/nxos/nxos_udld_interface.py
52
8998
#!/usr/bin/python # # 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. # # Ansible is distribut...
gpl-3.0
arenadata/ambari
ambari-server/src/test/python/stacks/2.3/MAHOUT/test_mahout_service_check.py
1
7000
#!/usr/bin/env python ''' 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")...
apache-2.0
JMoravec/unkRadnet
fitToCurve/pyeq2/UnitTests/Test_Equations.py
1
5518
# Version info: $Id: Test_Equations.py 1 2012-01-07 22:20:43Z zunzun.com@gmail.com $ import sys, os, unittest, inspect if os.path.join(sys.path[0][:sys.path[0].rfind(os.sep)], '..') not in sys.path: sys.path.append(os.path.join(sys.path[0][:sys.path[0].rfind(os.sep)], '..')) import pyeq2 class Test_BioScien...
bsd-3-clause
EvanK/ansible
lib/ansible/modules/network/f5/bigip_hostname.py
14
9320
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
frew/simpleproto
scons-local-1.1.0/SCons/Scanner/C.py
1
4739
"""SCons.Scanner.C This module implements the depenency scanner for C/C++ code. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Sof...
bsd-2-clause
40223149/2015springfinal
static/Brython3.1.1-20150328-091302/Lib/configparser.py
692
50025
"""Configuration file parser. A configuration file consists of sections, lead by a "[section]" header, and followed by "name: value" entries, with continuations and such in the style of RFC 822. Intrinsic defaults can be specified by passing them into the ConfigParser constructor as a dictionary. class: ConfigParse...
gpl-3.0
saratang/servo
tests/wpt/css-tests/tools/pywebsocket/src/test/testdata/handlers/sub/exception_in_transfer_wsh.py
499
1816
# Copyright 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...
mpl-2.0
bhattmansi/Implementation-of-CARED-in-ns3
src/create-module.py
62
10265
#! /usr/bin/env python from __future__ import print_function import sys from optparse import OptionParser import os WSCRIPT_TEMPLATE = '''# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- # def options(opt): # pass # def configure(conf): # conf.check_nonfatal(header_name='st...
gpl-2.0
uclouvain/osis_louvain
base/models/learning_unit_year.py
1
24536
############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core ...
agpl-3.0
cloudnull/ansible-modules-extras
monitoring/uptimerobot.py
31
3153
#!/usr/bin/python DOCUMENTATION = ''' module: uptimerobot short_description: Pause and start Uptime Robot monitoring description: - This module will let you start and pause Uptime Robot Monitoring author: Nate Kingsley version_added: "1.9" requirements: - Valid Uptime Robot API Key options: state: ...
gpl-3.0
openworm/Blender2NeuroML
src/Entity/Entity.py
1
21651
''' Created on 03.06.2011 @author: Sergey Khayrulin ''' from __future__ import absolute_import from Entity.Vertex import Vertex from Entity.Face import Face from Entity.Slice import Slice, AlternateSlice from Entity.Helper import * import pprint import math class Entity(object): ''' Main Clas...
mit
SuperTango/TangoLogger
Uploader/requests/requests/__init__.py
11
2007
# -*- coding: utf-8 -*- # __ # /__) _ _ _ _ _/ _ # / ( (- (/ (/ (- _) / _) # / """ Requests HTTP library ~~~~~~~~~~~~~~~~~~~~~ Requests is an HTTP library, written in Python, for human beings. Basic GET usage: >>> import requests >>> r = requests.get('https://www.python.org') >>> ...
gpl-3.0
s-hertel/ansible
lib/ansible/playbook/collectionsearch.py
39
2595
# Copyright: (c) 2019, Ansible Project # 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 from ansible.module_utils.six import string_types from ansible.playbook.attribute import FieldAttr...
gpl-3.0
tchellomello/home-assistant
homeassistant/components/swiss_hydrological_data/sensor.py
16
4964
"""Support for hydrological data from the Fed. Office for the Environment.""" from datetime import timedelta import logging from swisshydrodata import SwissHydroData import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ATTR_ATTRIBUTION, CONF_MONITORED_CO...
apache-2.0
damonkohler/sl4a
python/src/Lib/test/pickletester.py
48
32504
import unittest import pickle import cPickle import pickletools import copy_reg from test.test_support import TestFailed, have_unicode, TESTFN, \ run_with_locale # Tests that try a number of pickle protocols should have a # for proto in protocols: # kind of outer loop. assert pickle....
apache-2.0
ds-hwang/chromium-crosswalk
tools/strict_enum_value_checker/strict_enum_value_checker_test.py
113
7925
#!/usr/bin/env python # 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. import difflib import os import re import unittest from strict_enum_value_checker import StrictEnumValueChecker class MockLogging(obj...
bsd-3-clause
kungfulon/pacman-search
eightpuzzle.py
21
8717
# eightpuzzle.py # -------------- # Licensing Information: You are free to use or extend these projects for # educational purposes provided that (1) you do not distribute or publish # solutions, (2) you retain this notice, and (3) you provide clear # attribution to UC Berkeley, including a link to http://ai.berkeley.e...
mit
cansik/pyunicon
pyunicon/Cocoa/CocoaMouse.py
1
2057
from Quartz.CoreGraphics import CGEventCreateMouseEvent from Quartz.CoreGraphics import CGEventPost from Quartz.CoreGraphics import kCGEventMouseMoved from Quartz.CoreGraphics import kCGEventLeftMouseDown from Quartz.CoreGraphics import kCGEventLeftMouseUp from Quartz.CoreGraphics import kCGEventRightMouseDown from Qua...
mit
b0ttl3z/SickRage
lib/dateutil/tz/_common.py
46
11744
from six import PY3 from six.moves import _thread from datetime import datetime, timedelta, tzinfo import copy ZERO = timedelta(0) __all__ = ['tzname_in_python2', 'enfold'] def tzname_in_python2(namefunc): """Change unicode output into bytestrings in Python 2 tzname() API changed in Python 3. It used to r...
gpl-3.0
tommyip/zulip
scripts/lib/hash_reqs.py
2
2112
#!/usr/bin/env python3 import os import sys import argparse import hashlib from typing import Iterable, List, MutableSet def expand_reqs_helper(fpath, visited): # type: (str, MutableSet[str]) -> List[str] if fpath in visited: return [] else: visited.add(fpath) curr_dir = os.path.dirnam...
apache-2.0
partofthething/home-assistant
homeassistant/components/trafikverket_train/sensor.py
19
6918
"""Train information for departures and delays, provided by Trafikverket.""" from datetime import date, datetime, timedelta import logging from pytrafikverket import TrafikverketTrain import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( CONF_API_K...
mit
jonashaag/django-nonrel-nohistory
django/contrib/localflavor/in_/in_states.py
296
1859
""" A mapping of state misspellings/abbreviations to normalized abbreviations, and an alphabetical list of states for use as `choices` in a formfield. This exists in this standalone file so that it's only imported into memory when explicitly needed. """ STATE_CHOICES = ( ('KA', 'Karnataka'), ('AP', 'Andhra Pr...
bsd-3-clause
muahah/elpy
elpy/tests/test_rpc.py
45
6878
"""Tests for elpy.rpc.""" import json import unittest import sys from elpy import rpc from elpy.tests.compat import StringIO class TestFault(unittest.TestCase): def test_should_have_code_and_data(self): fault = rpc.Fault("Hello", code=250, data="Fnord") self.assertEqual(str(fault), "Hello") ...
gpl-3.0
redebian/documentation
django/db/models/sql/where.py
289
13163
""" Code to manage the creation and SQL rendering of 'where' constraints. """ import datetime from itertools import repeat from django.utils import tree from django.db.models.fields import Field from django.db.models.query_utils import QueryWrapper from datastructures import EmptyResultSet, FullResultSet # Connection...
bsd-3-clause
Valloric/ycmd
ycmd/hmac_plugin.py
4
3349
# Copyright (C) 2014-2018 ycmd contributors # # This file is part of ycmd. # # ycmd 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. # #...
gpl-3.0
bitemyapp/zulip
api/integrations/basecamp/zulip_basecamp_config.py
124
2149
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright © 2014 Zulip, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights #...
apache-2.0
nutbunnies/cassandra
pylib/cqlshlib/test/basecase.py
12
2611
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0