repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
tntnatbry/tensorflow | tensorflow/contrib/tensorboard/plugins/__init__.py | 148 | 1069 | # 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 |
yeraydiazdiaz/nonrel-blog | django/contrib/admin/static/admin/js/compress.py | 784 | 1896 | #!/usr/bin/env python
import os
import optparse
import subprocess
import sys
here = os.path.dirname(__file__)
def main():
usage = "usage: %prog [file1..fileN]"
description = """With no file paths given this script will automatically
compress all jQuery-based files of the admin app. Requires the Google Closure... | bsd-3-clause |
ptisserand/ansible | lib/ansible/modules/network/avi/avi_httppolicyset.py | 26 | 5399 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses... | gpl-3.0 |
dimkal/mne-python | mne/viz/montage.py | 13 | 1786 | """Functions to plot EEG sensor montages or digitizer montages
"""
import numpy as np
def plot_montage(montage, scale_factor=1.5, show_names=False, show=True):
"""Plot a montage
Parameters
----------
montage : instance of Montage
The montage to visualize.
scale_factor : float
Dete... | bsd-3-clause |
waynew/salmon | tests/salmon_tests/utils_tests.py | 1 | 1064 | from mock import patch
from nose.tools import with_setup
from salmon import utils
from .setup_env import setup_salmon_dirs, teardown_salmon_dirs
def test_make_fake_settings():
settings = utils.make_fake_settings('localhost', 8800)
assert settings
assert settings.receiver
assert settings.relay is Non... | gpl-3.0 |
vrjuggler/maestro | maestro/daemon/plugins/services/launch/LaunchService.py | 2 | 13770 | # Maestro is Copyright (C) 2006-2008 by Infiscape Corporation
#
# Original Author: Aron Bierbaum
#
# 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 ... | gpl-2.0 |
was4444/chromium.src | tools/gyp-explain.py | 153 | 3035 | #!/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.
"""Prints paths between gyp targets.
"""
import json
import os
import sys
import time
from collections import deque
def usage():... | bsd-3-clause |
rajul/mne-python | examples/visualization/plot_evoked_topomap.py | 18 | 1498 | """
========================================
Plotting topographic maps of evoked data
========================================
Load evoked data and plot topomaps for selected time points.
"""
# Authors: Christian Brodbeck <christianbrodbeck@nyu.edu>
# Tal Linzen <linzen@nyu.edu>
# Denis A. Engeman <... | bsd-3-clause |
llhe/tensorflow | tensorflow/python/kernel_tests/parsing_ops_test.py | 75 | 56359 | # 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 |
KaranToor/MA450 | google-cloud-sdk/.install/.backup/platform/ext-runtime/java/test/runtime_test.py | 6 | 21258 | #!/usr/bin/python
# Copyright 2015 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 ap... | apache-2.0 |
yantrabuddhi/FreeCAD | src/Mod/Draft/InitGui.py | 16 | 9429 | #***************************************************************************
#* *
#* Copyright (c) 2009 Yorik van Havre <yorik@uncreated.net> *
#* *
#* This p... | lgpl-2.1 |
cbmoore/statsmodels | statsmodels/examples/ex_sandwich2.py | 33 | 2599 | # -*- coding: utf-8 -*-
"""Cluster robust standard errors for OLS
Created on Fri Dec 16 12:52:13 2011
Author: Josef Perktold
"""
from statsmodels.compat.python import urlretrieve
import numpy as np
from numpy.testing import assert_almost_equal
import statsmodels.api as sm
import statsmodels.stats.sandwich_covariance... | bsd-3-clause |
Spleen64/Sick-Beard | lib/subliminal/api.py | 54 | 5715 | # -*- coding: utf-8 -*-
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
#
# This file is part of subliminal.
#
# subliminal is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 3 of... | gpl-3.0 |
kidburglar/youtube-dl | youtube_dl/extractor/bloomberg.py | 63 | 3323 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class BloombergIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?bloomberg\.com/(?:[^/]+/)*(?P<id>[^/?#]+)'
_TESTS = [{
'url': 'http://www.bloomberg.com/news/videos/b/aaeae121-5949-481e-a1ce-4562d... | unlicense |
snnn/tensorflow | tensorflow/python/kernel_tests/zero_division_test.py | 139 | 2389 | # 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 |
coreos/chromite | scripts/deploy_chrome_unittest.py | 2 | 8629 | #!/usr/bin/python
# Copyright (c) 2012 The Chromium OS 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
import sys
import time
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)),
... | bsd-3-clause |
npo-poms/pyapi | npoapi/pages_backend.py | 1 | 2600 | from typing import Optional
from npoapi.basic_backend import BasicBackend
import json
class PagesBackend(BasicBackend):
__author__ = "Michiel Meeuwissen"
def __init__(self, env=None, email: str = None, debug=False, accept=None):
"""
Instantiates a client to the NPO Pages Publisher API
... | gpl-3.0 |
jaumeg3/WebPractDjango | FilmRevolutionApp/serializers.py | 1 | 1343 | from rest_framework import serializers
from models import Movie, Serie, Actor, Director, Platform, Production
class MovieSerializer(serializers.HyperlinkedModelSerializer):
''' For the API '''
class Meta:
model = Movie
fields = ('title', 'budget', 'genere', 'url', 'popularity', 'country')
... | gpl-3.0 |
jdinuncio/ansible-modules-extras | cloud/misc/virt_net.py | 23 | 19084 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Maciej Delmanowski <drybjed@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 th... | gpl-3.0 |
jwomeara/mapnik | scons/scons-local-2.3.4/SCons/Tool/CVS.py | 9 | 2859 | """SCons.Tool.CVS.py
Tool-specific initialization for CVS.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
# Copyright (c) 2001 - 2014 The SCons Foundation
#
# Permission is hereby granted, free of charge, t... | lgpl-2.1 |
mnr/rubberfish | software/LightVentHeatirq.py | 1 | 3240 | #!/usr/bin/env python3
"""
watches the three switches on the front panel of the boxControls (LIGHT, VENT, HEAT)
sets up the GPIO interrupt
handles the interrupt
runs in background. Started in fish_config.sh
"""
from switch_obj import boxSwitch
from bmbb_fish import BmBB
import logging
import time
from personality imp... | mit |
benjamin-hodgson/asynqp | test/queue_tests.py | 1 | 18859 | import asyncio
from datetime import datetime
from contextlib import suppress
import contexts
import asynqp
from asynqp import message
from asynqp import frames
from asynqp import spec
from asynqp import exceptions
from .base_contexts import OpenChannelContext, QueueContext, ExchangeContext, BoundQueueContext, ConsumerC... | mit |
emilyvon/titanium_mobile | apidoc/odict/bench.py | 33 | 2442 | # Python Software Foundation License
import odict
import time
CREATE_DELETE_ROW = '+----------------+--------------------+'
RELATION_ROW = '+---------------------------+-----------+'
def create(factory, _range):
for i in range(_range):
root[str(i)] = factory()
def delete(_range):
for i in range(_ran... | apache-2.0 |
ravibhure/ansible | lib/ansible/modules/monitoring/monit.py | 22 | 7705 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Darryl Stoflet <stoflet@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
jteehan/cfme_tests | cfme/tests/services/test_orchestration_template.py | 5 | 4741 | # -*- coding: utf-8 -*-
import fauxfactory
import pytest
from cfme.cloud.provider import CloudProvider
from cfme.services.catalogs.orchestration_template import OrchestrationTemplate
from utils import testgen, error
from utils.update import update
from cfme.web_ui import mixins
from cfme import test_requirements
from u... | gpl-2.0 |
robertgraleigh/supreme-journey | node_modules/node-gyp/gyp/tools/pretty_gyp.py | 2618 | 4756 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Pretty-prints the contents of a GYP file."""
import sys
import re
# Regex to remove comments when we're counting braces.
COMMENT_RE = ... | mit |
jmartinezchaine/OpenERP | openerp/addons/mrp_operations/report/mrp_code_barcode.py | 9 | 1517 | # -*- 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 |
nikhilprathapani/python-for-android | python-build/python-libs/gdata/tests/gdata_tests/codesearch_test.py | 133 | 1930 | #!/usr/bin/python
#
# Copyright (C) 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 ... | apache-2.0 |
johnkeepmoving/oss-ftp | python27/win32/Lib/distutils/command/sdist.py | 84 | 18557 | """distutils.command.sdist
Implements the Distutils 'sdist' command (create a source distribution)."""
__revision__ = "$Id$"
import os
import string
import sys
from glob import glob
from warnings import warn
from distutils.core import Command
from distutils import dir_util, dep_util, file_util, archive_util
from di... | mit |
guillaumededrie/flask-todolist | app/utils/filters.py | 2 | 1428 | # -*- coding: utf-8 -*-
from datetime import datetime
import time
from . import utils
# Thanks to Dan Jacob and Sean Vieira for making the following snippet
# available at http://flask.pocoo.org/snippets/33/
@utils.app_template_filter('humanize')
def humanize_time(dt, past_='ago', future_='from now', default='just ... | mit |
VcamX/pywikibot-core | pywikibot/__init__.py | 6 | 27152 | # -*- coding: utf-8 -*-
"""The initialization file for the Pywikibot framework."""
#
# (C) Pywikibot team, 2008-2014
#
# Distributed under the terms of the MIT license.
#
from __future__ import unicode_literals
__release__ = '2.0b3'
__version__ = '$Id$'
import datetime
import math
import re
import sys
import threadi... | mit |
njantrania/osf.io | website/addons/github/views/hooks.py | 36 | 3114 | # -*- coding: utf-8 -*-
import os # noqa
from dateutil.parser import parse as dateparse
from flask import request
from website import models
from website.project.decorators import must_be_valid_project
from website.project.decorators import must_not_be_registration
from website.project.decorators import must_have_a... | apache-2.0 |
elkingtonmcb/nupic | tests/unit/nupic/algorithms/nab_detector_test.py | 31 | 10843 | #! /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... | agpl-3.0 |
t--wagner/pymeasure | loop.py | 1 | 3462 | # -*- coding: utf-8 -*-
import threading
import time
class LoopItem(object):
def __init__(self, sweep):
"""Initialize Loop with a sweep.
"""
self._sweep = sweep
self._pause = threading.Event()
self._pause.set()
self._hold = threading.Event()
self._stop =... | gpl-3.0 |
martynovp/edx-platform | lms/djangoapps/django_comment_client/tests/group_id.py | 56 | 7824 | import json
import re
class GroupIdAssertionMixin(object):
def _data_or_params_cs_request(self, mock_request):
"""
Returns the data or params dict that `mock_request` was called with.
"""
call = [call for call in mock_request.call_args_list if call[0][1].endswith(self.cs_endpoint)]... | agpl-3.0 |
emon10005/scikit-image | skimage/restoration/_denoise.py | 4 | 11418 | # coding: utf-8
import numpy as np
from .. import img_as_float
from ..restoration._denoise_cy import _denoise_bilateral, _denoise_tv_bregman
from .._shared.utils import _mode_deprecations
def denoise_bilateral(image, win_size=5, sigma_range=None, sigma_spatial=1,
bins=10000, mode='constant', cva... | bsd-3-clause |
fevangelista/psi4 | psi4/share/psi4/databases/NBC10.py | 6 | 98454 | #
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2021 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This file is part of Psi4.
#
# Psi4 is free software; you can redistribute it and/or modify
#... | lgpl-3.0 |
RunningLight/machinekit | tests/trajectory-planner/circular-arcs/linuxcnc_control.py | 22 | 5422 | #!/usr/bin/env python
'''Copied from m61-test'''
import linuxcnc
import os
from time import sleep
# this is how long we wait for linuxcnc to do our bidding
class LinuxcncError(Exception):
pass
# def __init__(self, value):
# self.value = value
# def __str__(self):
# return repr(self.value)
c... | lgpl-2.1 |
dmilos/nucleotide | src/nucleotide/component/linux/gcc/atom/module/opencv.py | 1 | 2884 | #!/usr/bin/env python2
# Copyright 2015 Dejan D. M. Milosavljevic
#
# 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
#
# ... | apache-2.0 |
keedio/hue | desktop/core/ext-py/Django-1.6.10/django/core/serializers/base.py | 109 | 5567 | """
Module for abstract serializer/unserializer base classes.
"""
from django.db import models
from django.utils import six
class SerializerDoesNotExist(KeyError):
"""The requested serializer was not found."""
pass
class SerializationError(Exception):
"""Something bad happened during serialization."""
... | apache-2.0 |
sdroege/cerbero | test/test_cerbero_config.py | 27 | 8277 | # cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... | lgpl-2.1 |
waheedahmed/django-sudo | sudo/middleware.py | 2 | 2399 | """
sudo.middleware
~~~~~~~~~~~~~~~
:copyright: (c) 2014 by Matt Robenolt.
:license: BSD, see LICENSE for more details.
"""
from sudo.settings import (
COOKIE_DOMAIN, COOKIE_HTTPONLY,
COOKIE_PATH, COOKIE_SECURE, COOKIE_SALT,
)
from sudo.utils import has_sudo_privileges, cookie_name
class SudoMiddleware(objec... | bsd-3-clause |
groovecoder/django-waffle | waffle/management/commands/waffle_sample.py | 17 | 1862 | from __future__ import print_function
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from waffle.models import Sample
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('-l', '--list',
action='store_true', de... | bsd-3-clause |
joebowen/LogMyRocket_API | LogMyRocket/libraries/sys_packages/botocore/vendored/requests/packages/chardet/langhungarianmodel.py | 2763 | 12536 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | gpl-3.0 |
supracd/pygal | pygal/test/test_bar.py | 6 | 1221 | # -*- coding: utf-8 -*-
# This file is part of pygal
#
# A python svg graph plotting library
# Copyright © 2012-2015 Kozea
#
# This library is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version... | lgpl-3.0 |
raj454raj/eden | modules/test_utils/Web2pyNosePlugin.py | 44 | 3813 |
import nose
import re
from itertools import imap
import unittest
class Web2pyNosePlugin(nose.plugins.base.Plugin):
# see: http://somethingaboutorange.com/mrl/projects/nose/0.11.1/plugins/writing.html
"""This plugin is designed to give the web2py environment to the tests.
"""
score = 0
# alway... | mit |
mission-liao/pyswagger | pyswagger/tests/v1_2/test_spec.py | 1 | 8729 | from pyswagger import App
from ..utils import get_test_data_folder
from pyswagger.spec.v1_2.objects import (
Info,
Authorization,
Scope,
Items,
GrantType,
Implicit,
AuthorizationCode,
LoginEndpoint,
TokenRequestEndpoint,
TokenEndpoint,
Resource,
Operation,
Parameter,
... | mit |
Moriadry/tensorflow | tensorflow/contrib/tensor_forest/hybrid/python/models/stochastic_hard_decisions_to_data_then_nn.py | 190 | 1909 | # 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 |
legmi112123/pycallgraph | pycallgraph/output/output.py | 7 | 3645 | import re
import os
from distutils.spawn import find_executable
from ..exceptions import PyCallGraphException
from ..color import Color
class Output(object):
'''Base class for all outputters.'''
def __init__(self, **kwargs):
self.node_color_func = self.node_color
self.edge_color_func = self.... | gpl-2.0 |
veger/ansible | lib/ansible/plugins/connection/chroot.py | 7 | 7944 | # Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# (c) 2013, Maykel Moya <mmoya@speedyrails.com>
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com>
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__... | gpl-3.0 |
12wang3/python | JiYouMCC/0024/todoList/todoList/views.py | 26 | 1837 | from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response, RequestContext
from todoList.list.models import List, Status
from todoList.list.views import get_first_status, get_last_status,... | mit |
luohongjunnn/jstorm | jstorm-core/src/main/py/storm/Nimbus.py | 4 | 228446 | #
# Autogenerated by Thrift Compiler (0.9.2)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py:utf8strings
#
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
from ttypes import *
from thrift.Thrift import TProcessor
from thrift.transport import... | apache-2.0 |
proxysh/Safejumper-for-Mac | buildlinux/env32/lib/python2.7/site-packages/twisted/words/protocols/jabber/client.py | 13 | 13277 | # -*- test-case-name: twisted.words.test.test_jabberclient -*-
#
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from __future__ import absolute_import, division
from twisted.python.compat import _coercedUnicode, unicode
from twisted.words.protocols.jabber import xmlstream, sasl, error
from tw... | gpl-2.0 |
davizucon/ChatterBot | chatterbot/chatterbot.py | 3 | 6522 | from __future__ import unicode_literals
import logging
from .storage import StorageAdapter
from .input import InputAdapter
from .output import OutputAdapter
from . import utils
class ChatBot(object):
"""
A conversational dialog chat bot.
"""
def __init__(self, name, **kwargs):
from .conversat... | bsd-3-clause |
gem/geonode | geonode/version.py | 16 | 2643 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 3 ... | gpl-3.0 |
echalkpad/t4f-data | structure/protobuf/src/c/protoc-2.5.0/protobuf-2.5.0/gtest/test/gtest_xml_outfiles_test.py | 2526 | 5340 | #!/usr/bin/env python
#
# Copyright 2008, 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... | apache-2.0 |
markneville/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_gtkcairo.py | 69 | 2207 | """
GTK+ Matplotlib interface using cairo (not GDK) drawing operations.
Author: Steve Chaplin
"""
import gtk
if gtk.pygtk_version < (2,7,0):
import cairo.gtk
from matplotlib.backends import backend_cairo
from matplotlib.backends.backend_gtk import *
backend_version = 'PyGTK(%d.%d.%d) ' % gtk.pygtk_version + \
... | agpl-3.0 |
brandond/ansible | docs/bin/dump_config.py | 52 | 2360 | #!/usr/bin/env python
import optparse
import os
import sys
import yaml
from jinja2 import Environment, FileSystemLoader
from ansible.module_utils._text import to_bytes
from ansible.utils._build_helpers import update_file_if_different
DEFAULT_TEMPLATE_FILE = 'config.rst.j2'
def generate_parser():
p = optparse.O... | gpl-3.0 |
sernst/cauldron | cauldron/cli/commands/open/remote.py | 1 | 1119 | import json
import os
from cauldron import cli
from cauldron import environ
from cauldron import runner
from cauldron.cli import sync
from cauldron.cli.commands.open import opener as local_opener
from cauldron.environ.response import Response
def sync_open(
context: cli.CommandContext,
path: str,
... | mit |
girishkalele/test-infra | gubernator/third_party/cloudstorage/api_utils.py | 63 | 11481 | # Copyright 2013 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 ag... | apache-2.0 |
wzyuliyang/scrapy | scrapy/utils/misc.py | 37 | 3350 | """Helper functions which doesn't fit anywhere else"""
import re
import hashlib
from importlib import import_module
from pkgutil import iter_modules
import six
from w3lib.html import replace_entities
from scrapy.utils.python import flatten, to_unicode
from scrapy.item import BaseItem
_ITERABLE_SINGLE_VALUES = dict,... | bsd-3-clause |
sharma-abhi/flaskr-tdd | app.py | 1 | 3430 | # imports
import sqlite3
from flask import Flask, request, session, g, redirect, url_for, \
abort, render_template, flash, jsonify
from flask.ext.sqlalchemy import SQLAlchemy
import os
# grabs the folder where the script runs
basedir = os.path.abspath(os.path.dirname(__file__))
# configuration
DATABASE = 'flaskr.d... | mit |
gorkinovich/DefendersOfMankind | dependencies/luabind/boost-build/test/stage.py | 4 | 5149 | #!/usr/bin/python
# Copyright 2003 Dave Abrahams
# Copyright 2002, 2003, 2004, 2005, 2006 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# Test staging
from BoostBuild import Tester
t = Tester()
t.write... | gpl-3.0 |
hongbincao/azure-quickstart-templates | bosh-setup/setup_devbox.py | 46 | 3392 | #!/usr/bin/env python
import os
import re
import json
import traceback
from subprocess import call
from Utils.WAAgentUtil import waagent
import Utils.HandlerUtil as Util
call("mkdir -p ./bosh", shell=True)
call("chmod +x deploy_bosh.sh", shell=True)
call("cp deploy_bosh.sh ./bosh/", shell=True)
# Get settings from C... | mit |
edublancas/python-ds-tools | src/dstools/FrozenJSON.py | 2 | 2482 | from os import path
from collections import Mapping, MutableSequence
import keyword
import logging
import yaml
class FrozenJSON(object):
"""A facade for navigating a JSON-like object
using attribute notation. Based on FrozenJSON from 'Fluent Python'
"""
@classmethod
def from_yaml(cls, path_to_fil... | mit |
duhzecca/cinder | cinder/volume/drivers/netapp/dataontap/ssc_cmode.py | 9 | 26078 | # Copyright (c) 2012 NetApp, Inc. All rights reserved.
# Copyright (c) 2014 Ben Swartzlander. All rights reserved.
# Copyright (c) 2014 Navneet Singh. All rights reserved.
# Copyright (c) 2014 Clinton Knight. All rights reserved.
# Copyright (c) 2015 Tom Barron. All rights reserved.
# Copyright (c) 2015 Alex Meade... | apache-2.0 |
hamza77500/xhtml2pdf | xhtml2pdf/wsgi.py | 79 | 2857 | # -*- coding: utf-8 -*-
# Copyright 2010 Dirk Holtwick, holtwick.it
#
# 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 ... | apache-2.0 |
tinchoss/Python_Android | python/src/Lib/test/test_zipimport.py | 55 | 17378 | import sys
import os
import marshal
import imp
import struct
import time
import unittest
import zlib # implied prerequisite
from zipfile import ZipFile, ZipInfo, ZIP_STORED, ZIP_DEFLATED
from test import test_support
from test.test_importhooks import ImportHooksBaseTestCase, test_src, test_co
import zipimport
import ... | apache-2.0 |
agold/svgchart | lib/shapes/Square.py | 1 | 1304 | from Coordinate import Coordinate
from Shape import Shape
from Rectangle import Rectangle
class Square(Rectangle):
"""Defines a square as a rectangle with equal height and width.
>>> from Coordinate import Coordinate
>>> square = Square(position=Coordinate(1, 2), size=3.0, id=u'id', classes=u'class')
>>> square.p... | apache-2.0 |
upsuper/servo | etc/ci/performance/test_runner.py | 66 | 14394 | #!/usr/bin/env python3
# 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 runner
import pytest
def test_log_parser():
mock_url = "http://localhost:8000/page_... | mpl-2.0 |
kdrone/crazyflie-python-client | build/lib.linux-i686-2.7/cflib/crazyflie/platformservice.py | 19 | 1861 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... | gpl-2.0 |
frivoal/presto-testo | core/standards/scripts/opjsunit/harness/regression.py | 4 | 7498 | import os
import itertools
try:
import json
except ImportError:
import simplejson as json
class SortedDict(dict):
def __init__(self, base_dict):
self._keys = []
for key, value in base_dict.iteritems():
self._keys.append(key)
self[key] = value
self._keys.sort(... | bsd-3-clause |
mbdriscoll/ctree | examples/TuningSpecializer.py | 2 | 3413 | """
This example demonstrates how to use the tuning subsystem.
We create a function 'get_height' that computes the height of the
surface of a paraboloid centered at a pair of given (x',y') coordinates.
Then, we make successive calls to get_height() where each
computes the height at a location (x,y) prescribed by the a... | bsd-2-clause |
CitizenB/ansible | lib/ansible/plugins/lookup/dig.py | 60 | 8336 | # (c) 2015, Jan-Piet Mens <jpmens(at)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) any later ver... | gpl-3.0 |
saukrIppl/seahub | seahub/group/utils.py | 1 | 2811 | # -*- coding: utf-8 -*-
import re
import logging
import seaserv
from seahub.utils import is_org_context
from seahub.profile.models import Profile
from seahub.base.templatetags.seahub_tags import email2nickname
from seahub.avatar.settings import AVATAR_DEFAULT_SIZE
from seahub.avatar.templatetags.avatar_tags import ap... | apache-2.0 |
ericbaze/continuum_code_2012 | pydata/moin/pythonenv/lib/python2.7/encodings/cp855.py | 593 | 34106 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP855.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'):
... | gpl-2.0 |
majidaldo/ansible | lib/ansible/runner/lookup_plugins/subelements.py | 174 | 2860 | # (c) 2013, Serge van Ginderachter <serge@vanginderachter.be>
#
# 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)... | gpl-3.0 |
HEG-Arc/Appagoo | appagoo/allauth/socialaccount/south_migrations/0011_auto__chg_field_socialtoken_token.py | 77 | 6468 | # -*- 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 'SocialToken.token'
db.alter_column('socialaccount_socialtoken', 'token', self.gf('django.... | bsd-3-clause |
jomo/youtube-dl | youtube_dl/extractor/tvc.py | 113 | 3902 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
clean_html,
int_or_none,
)
class TVCIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?tvc\.ru/video/iframe/id/(?P<id>\d+)'
_TEST = {
'url': 'http://www.tvc.ru/video/ifra... | unlicense |
SickGear/SickGear | lib/cachecontrol/serialize.py | 3 | 6429 | # SPDX-FileCopyrightText: 2015 Eric Larson
#
# SPDX-License-Identifier: Apache-2.0
import base64
import io
import json
import zlib
import msgpack
from requests.structures import CaseInsensitiveDict
from .compat import HTTPResponse, pickle, text_type
def _b64_decode_bytes(b):
return base64.b64decode(b.encode("a... | gpl-3.0 |
lvh/maxims | maxims/test/test_endpoints.py | 1 | 3163 | """
Tests for persisted endpoints.
"""
from twisted.internet import endpoints
from twisted.trial import unittest
from maxims import endpoints as me
class _EndpointTests(object):
"""
Base endpoint tests.
"""
def setUp(self):
self.endpoint = self.endpointClass(description=self.description)
... | isc |
birocorneliu/youtube-dl | youtube_dl/extractor/metacritic.py | 150 | 2051 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
fix_xml_ampersands,
)
class MetacriticIE(InfoExtractor):
_VALID_URL = r'https?://www\.metacritic\.com/.+?/trailers/(?P<id>\d+)'
_TEST = {
'url': 'http://www.metacritic.com/game/playstation-... | unlicense |
Quikling/gpdb | src/test/tinc/tincrepo/mpp/gpdb/tests/package/contrib/pgcrypto/functional/test_functional_pgcrypto.py | 9 | 5913 | """
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the 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
... | apache-2.0 |
pnasrat/yum | yum/mdparser.py | 5 | 6408 | #! /usr/bin/python -tt
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that... | gpl-2.0 |
jmptrader/rethinkdb | test/common/http_support/decorator/decorator.py | 112 | 10639 | ########################## LICENCE ###############################
# Copyright (c) 2005-2012, Michele Simionato
# 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 so... | apache-2.0 |
minhtuancn/odoo | addons/l10n_be_invoice_bba/invoice.py | 141 | 12671 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# i... | agpl-3.0 |
c-o-m-m-a-n-d-e-r/CouchPotatoServer | couchpotato/core/media/_base/providers/userscript/base.py | 15 | 1971 | from urlparse import urlparse
from couchpotato.core.event import addEvent, fireEvent
from couchpotato.core.helpers.encoding import simplifyString
from couchpotato.core.helpers.variable import getImdb, md5
from couchpotato.core.logger import CPLog
from couchpotato.core.media._base.providers.base import Provider
log =... | gpl-3.0 |
if1live/kanako | tests/kanako_tests.py | 1 | 1411 | #-*- coding: utf-8 -*-
from __future__ import unicode_literals
import kanako
import unittest
import os
class to_output_path_test(unittest.TestCase):
def test_windows(self):
input_path = 'd:\\kanako\\foo\\bar.tex'
expected = 'd:\\kanako\\foo\\bar-output.tex'
actual = kanako.to_output_path... | mit |
tykling/bulkvote | src/bulkvote/views.py | 1 | 1808 | from django.shortcuts import render, get_object_or_404
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from .forms import CreateVoteForm, ChoiceForm
from .models import Vote, Item, Choice, UserChoice
def frontpage(request):
form = CreateVoteForm(request.POST or None)
... | bsd-3-clause |
sam-roth/Keypad | keypad/qt/options.py | 1 | 3389 |
import math
import logging
import warnings
import importlib
from PyQt4.Qt import QFont, QFontMetricsF
from ..options import GeneralSettings
from ..core import (Signal,
Color,
Colorscheme,
Config,
Settings,
Field)
fr... | gpl-3.0 |
mikehankey/fireball_camera | astr-stack.py | 1 | 4201 | #!/usr/bin/python3
#import collections
#from collections import deque
from PIL import Image, ImageChops
#from queue import Queue
#import multiprocessing
#import datetime
import cv2
import numpy as np
#import iproc
import time
#import ephem
import sys
#import os
def view(file, show):
out_file = file.replace(".av... | gpl-3.0 |
bbc/kamaelia | Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/Protocol/MimeRequestComponent.py | 3 | 8185 | #!/usr/bin/env python2.3
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache Lice... | apache-2.0 |
lankier/brigantina | unidecode/xce.py | 253 | 4708 | data = (
'cwik', # 0x00
'cwit', # 0x01
'cwip', # 0x02
'cwih', # 0x03
'cyu', # 0x04
'cyug', # 0x05
'cyugg', # 0x06
'cyugs', # 0x07
'cyun', # 0x08
'cyunj', # 0x09
'cyunh', # 0x0a
'cyud', # 0x0b
'cyul', # 0x0c
'cyulg', # 0x0d
'cyulm', # 0x0e
'cyulb', # 0x0f
'cyuls', # 0x1... | gpl-3.0 |
gattazr/cohorte-platforms | build/extra/windows/jpype/_refdaemon.py | 8 | 1075 | #*****************************************************************************
# Copyright 2004-2008 Steve Menard
#
# 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... | apache-2.0 |
v0devil/JMeter-Control-Center | administrator/views.py | 1 | 8412 | import os
import re
import logging
from xml.etree.ElementTree import ElementTree
from django.http import JsonResponse
from django.shortcuts import render
# Create your views here.
from administrator.models import JMeterProfile, SSHKey, User, Configuration
from analyzer.models import Test
logger = logging.getLogger(_... | mit |
maximus0/docker | docs/docs-update.py | 16 | 8086 | #!/usr/bin/env python
#
# Sven's quick hack script to update the documentation
#
# call with:
# ./docs/update.py /usr/bin/docker
#
import datetime
import re
from sys import argv
import subprocess
import os
import os.path
script, docker_cmd = argv
# date "+%B %Y"
date_string = datetime.date.today().strftime('%... | apache-2.0 |
ProtouProject/android_kernel_htc_protou | tools/perf/python/twatch.py | 7370 | 1334 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
craigderington/studentloan5 | studentloan5/Lib/encodings/cp875.py | 272 | 12854 | """ Python Character Mapping Codec cp875 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP875.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input... | bsd-3-clause |
uni-peter-zheng/autotest | autotest-client-tests/cgroup_tests/memory_migrate_test.py | 5 | 6298 | import os
import itertools
import tempfile
import subprocess
import signal
import time
from autotest.client.shared import error, utils_cgroup
class MemoryMigrate(object):
"""
Test memory sub system.
Use it to control file write/read rate.
1. Clear all cgroups and init modules and parent cgroup.
... | gpl-2.0 |
inspyration/odoo | addons/product_visible_discount/__init__.py | 433 | 1054 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.