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 |
|---|---|---|---|---|---|
azaghal/ansible | test/integration/targets/no_log/library/module.py | 61 | 1216 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.basic import AnsibleModule
def m... | gpl-3.0 |
gregdek/ansible | test/units/module_utils/common/collections.py | 27 | 4881 | # -*- coding: utf-8 -*-
# Copyright (c), Sviatoslav Sydorenko <ssydoren@redhat.com> 2018
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
"""Test low-level utility functions from ``module_utils.common.collections``."""
from __future__ import absolute_import, di... | gpl-3.0 |
Lohamon/gmail-backup-com | svc/scripting/extractors.py | 26 | 11415 | # -*- coding: utf-8 -*-
# Copyright (C) 2008 Jan Svec and Filip Jurcicek
#
# YOU USE THIS TOOL ON YOUR OWN RISK!
#
# email: info@gmail-backup.com
#
#
# Disclaimer of Warranty
# ----------------------
#
# Unless required by applicable law or agreed to in writing, licensor provides
# this tool (and each contributor ... | gpl-3.0 |
tvalacarta/tvalacarta | python/main-classic/lib/youtube_dl/extractor/drtv.py | 6 | 13802 | # coding: utf-8
from __future__ import unicode_literals
import binascii
import hashlib
import re
from .common import InfoExtractor
from ..aes import aes_cbc_decrypt
from ..compat import compat_urllib_parse_unquote
from ..utils import (
bytes_to_intlist,
ExtractorError,
int_or_none,
intlist_to_bytes,
... | gpl-3.0 |
cydenix/OpenGLCffi | OpenGLCffi/EGL/EXT/EXT/output_base.py | 1 | 1086 | from OpenGLCffi.EGL import params
@params(api='egl', prms=['dpy', 'attrib_list', 'layers', 'max_layers', 'num_layers'])
def eglGetOutputLayersEXT(dpy, attrib_list, layers, max_layers, num_layers):
pass
@params(api='egl', prms=['dpy', 'attrib_list', 'ports', 'max_ports', 'num_ports'])
def eglGetOutputPortsEXT(dpy, at... | mit |
adam111316/SickGear | lib/html5lib/sanitizer.py | 805 | 16428 | from __future__ import absolute_import, division, unicode_literals
import re
from xml.sax.saxutils import escape, unescape
from .tokenizer import HTMLTokenizer
from .constants import tokenTypes
class HTMLSanitizerMixin(object):
""" sanitization of XHTML+MathML+SVG and of inline style attributes."""
accepta... | gpl-3.0 |
Edraak/circleci-edx-platform | common/djangoapps/edraak_i18n/management/commands/i18n_edraak_theme_push.py | 1 | 2382 | # * Handling merge/forks of UserProfile.meta
from django.core.management.base import BaseCommand
from django.conf import settings
import os
from subprocess import call
import polib
class Command(BaseCommand):
help = '''Run theme's ./scripts/edraak_i18n_theme_push.sh'''
@staticmethod
def remove_ignored_me... | agpl-3.0 |
johnkeepmoving/oss-ftp | python27/win32/Lib/test/test_imageop.py | 34 | 6854 | """Test script for the imageop module. This has the side
effect of partially testing the imgfile module as well.
Roger E. Masse
"""
from test.test_support import verbose, unlink, import_module, run_unittest
imageop = import_module('imageop', deprecated=True)
import uu, os, unittest
SIZES = (1, 2, 3, 4)
_VALU... | mit |
gisprogrammer/wsp.geo.pl | external/OpenLayers-2.13.1/tests/selenium/remotecontrol/selenium.py | 254 | 69389 |
"""
Copyright 2006 ThoughtWorks, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... | mit |
richard-willowit/odoo | addons/stock/__manifest__.py | 2 | 2878 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Inventory Management',
'version': '1.1',
'summary': 'Inventory, Logistics, Warehousing',
'description': "",
'website': 'https://www.odoo.com/page/warehouse',
'depends': ['product', 'bar... | gpl-3.0 |
seshin/namebench | libnamebench/tk.py | 173 | 13586 | # 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 by applicable law or ... | apache-2.0 |
dpnova/cyclone | appskel/signup/modname/views.py | 2 | 11674 | # coding: utf-8
#
$license
import OpenSSL
import cyclone.escape
import cyclone.locale
import cyclone.mail
import cyclone.web
import hashlib
import random
import string
from datetime import datetime
from twisted.internet import defer
from twisted.python import log
from $modname import storage
from $modname.utils imp... | apache-2.0 |
mgamer/gyp | test/win/gyptest-cl-optimizations.py | 247 | 3416 | #!/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.
"""
Make sure optimization settings are extracted properly.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = TestGyp.Te... | bsd-3-clause |
erijo/py-svndump | svndump/record.py | 1 | 5100 | # Copyright (c) 2012 Erik Johansson <erik@ejohansson.se>
#
# 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 of the
# License, or (at your option) any later version.
#
# This pro... | gpl-3.0 |
Aaron1992/shadowsocks-final | shadowsocks/local.py | 1015 | 2248 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 clowwindy
#
# 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 r... | apache-2.0 |
miguelinux/vbox | src/VBox/Additions/common/crOpenGL/getprocaddress.py | 10 | 3625 | # Copyright (c) 2001, Stanford University
# All rights reserved.
#
# See the file LICENSE.txt for information on redistributing this software.
import sys
import apiutil
apiutil.CopyrightC()
print """
/* DO NOT EDIT - THIS FILE GENERATED BY THE getprocaddress.py SCRIPT */
#include "chromium.h"
#include "cr_error.h"... | gpl-2.0 |
taaviteska/django | django/core/checks/model_checks.py | 72 | 6183 | import inspect
import types
from itertools import chain
from django.apps import apps
from django.core.checks import Error, Tags, register
@register(Tags.models)
def check_all_models(app_configs=None, **kwargs):
errors = []
if app_configs is None:
models = apps.get_models()
else:
models = ... | bsd-3-clause |
izapolsk/integration_tests | cfme/utils/appliance/services.py | 1 | 3411 | import attr
from cfme.utils.appliance.plugin import AppliancePlugin
from cfme.utils.appliance.plugin import AppliancePluginException
from cfme.utils.log import logger_wrap
from cfme.utils.quote import quote
from cfme.utils.wait import wait_for
class SystemdException(AppliancePluginException):
pass
@attr.s
clas... | gpl-2.0 |
vmthunder/nova | nova/debugger.py | 18 | 3021 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... | apache-2.0 |
mukulsoni/android_kernel_samsung_ms013g-G4SWA | 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 |
aoom/pattern | examples/01-web/03-bing.py | 21 | 1714 | import os, sys; sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
from pattern.web import Bing, asynchronous, plaintext
from pattern.web import SEARCH, IMAGE, NEWS
import time
# This example retrieves results from Bing based on a given query.
# The Bing search engine can retrieve up to a 1000 r... | bsd-3-clause |
Changaco/oh-mainline | vendor/packages/Django/tests/modeltests/empty/tests.py | 51 | 1232 | from __future__ import absolute_import
from django.core.exceptions import ImproperlyConfigured
from django.db.models.loading import get_app
from django.test import TestCase
from django.test.utils import override_settings
from django.utils import six
from .models import Empty
class EmptyModelTests(TestCase):
def... | agpl-3.0 |
SAM-IT-SA/odoo | addons/l10n_be_hr_payroll_account/__openerp__.py | 298 | 1626 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | agpl-3.0 |
liorvh/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/lint_test_expectations.py | 119 | 4344 | # Copyright (C) 2012 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 ... | bsd-3-clause |
anryko/ansible | lib/ansible/modules/cloud/centurylink/clc_publicip.py | 47 | 12152 | #!/usr/bin/python
#
# Copyright (c) 2015 CenturyLink
# 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',
'status': ['previe... | gpl-3.0 |
ttrifonov/horizon | horizon/horizon/dashboards/syspanel/users/tables.py | 1 | 4566 | import logging
from django import shortcuts
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _
from horizon import api
from horizon import tables
LOG = logging.getLogger(__name__)
class CreateUserLink(tables.LinkAction):
name = "... | apache-2.0 |
OliverWalter/amdtk | amdtk/models/mixture.py | 1 | 3497 |
"""Mixture of distributions/densities."""
import numpy as np
from scipy.misc import logsumexp
from .discrete_latent_model import DiscreteLatentModel
from .dirichlet import Dirichlet
class MixtureStats(object):
"""Sufficient statistics for :class:BayesianMixture`.
Methods
-------
__getitem__(key)
... | bsd-2-clause |
robinro/ansible | lib/ansible/module_utils/six/__init__.py | 59 | 4353 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
javivi001/OctoPrint | src/octoprint/plugins/softwareupdate/version_checks/github_commit.py | 32 | 1842 | # coding=utf-8
from __future__ import absolute_import
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
import requests
import loggi... | agpl-3.0 |
YongseopKim/crosswalk-test-suite | webapi/tct-download-tizen-tests/inst.xpk.py | 357 | 6759 | #!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
import string
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PKG_NAME = os.path.basename(SCRIPT_DIR)
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=... | bsd-3-clause |
wwj718/ANALYSE | cms/djangoapps/contentstore/features/course-team.py | 46 | 4242 | # pylint: disable=C0111
# pylint: disable=W0621
from lettuce import world, step
from nose.tools import assert_in # pylint: disable=E0611
@step(u'(I am viewing|s?he views) the course team settings$')
def view_grading_settings(_step, whom):
world.click_course_settings()
link_css = 'li.nav-course-settings-team... | agpl-3.0 |
clobrano/personfinder | app/pytz/zoneinfo/Asia/Amman.py | 7 | 5275 | '''tzinfo timezone information for Asia/Amman.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Amman(DstTzInfo):
'''Asia/Amman timezone definition. See datetime.tzinfo for details'''
zone = 'Asia/Amman'
_utc_transiti... | apache-2.0 |
CamelBackNotation/CarnotKE | jyhton/lib-python/2.7/plat-mac/lib-scriptpackages/StdSuites/Table_Suite.py | 81 | 2036 | """Suite Table Suite: Classes for manipulating tables
Level 1, version 1
Generated from /Volumes/Sap/System Folder/Extensions/AppleScript
AETE/AEUT resource version 1/0, language 0, script 0
"""
import aetools
import MacOS
_code = 'tbls'
class Table_Suite_Events:
pass
class cell(aetools.ComponentItem):
"... | apache-2.0 |
2014c2g6/c2g6 | wsgi/static/Brython2.1.0-20140419-113919/Lib/_codecs.py | 107 | 3745 |
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... | gpl-2.0 |
michaelhowden/eden | modules/tests/inv/send_item.py | 25 | 3148 | """ Sahana Eden Module Automated Tests - INV001 Send Items
@copyright: 2011-2012 (c) Sahana Software Foundation
@license: MIT
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 w... | mit |
google-code/android-scripting | python/gdata/src/gdata/photos/__init__.py | 225 | 39076 | # -*-*- encoding: utf-8 -*-*-
#
# This is the base file for the PicasaWeb python client.
# It is used for lower level operations.
#
# $Id: __init__.py 148 2007-10-28 15:09:19Z havard.gulldahl $
#
# Copyright 2007 Håvard Gulldahl
# Portions (C) 2006 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "L... | apache-2.0 |
Zsailer/epistasis | epistasis/__init__.py | 2 | 1202 | """\
A Python API for modeling statistical, high-order epistasis in genotype-phenotype maps.
This library provides methods for:
1. Decomposing genotype-phenotype maps into high-order epistatic interactions
2. Finding nonlinear scales in the genotype-phenotype map
3. Calculating the contributions of differe... | unlicense |
NoobieDog/nexmon | buildtools/b43/fwcutter/mklist.py | 7 | 3309 | #!/usr/bin/env python
#
# Script for creating a "struct extract" list for fwcutter_list.h
#
# Copyright (c) 2008 Michael Buesch <m@bues.ch>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistribu... | gpl-3.0 |
savoirfairelinux/influxdb-python | influxdb/tests/server_tests/base.py | 7 | 2031 | # -*- coding: utf-8 -*-
import sys
from influxdb.tests import using_pypy
from influxdb.tests.server_tests.influxdb_instance import InfluxDbInstance
from influxdb.client import InfluxDBClient
if not using_pypy:
from influxdb.dataframe_client import DataFrameClient
def _setup_influxdb_server(inst):
inst.inf... | mit |
divio/askbot-devel | askbot/conf/leading_sidebar.py | 16 | 1135 | """
Sidebar settings
"""
from askbot.conf.settings_wrapper import settings
from askbot.deps.livesettings import ConfigurationGroup
from askbot.deps.livesettings import values
from django.utils.translation import ugettext_lazy as _
from askbot.conf.super_groups import CONTENT_AND_UI
LEADING_SIDEBAR = ConfigurationGroup... | gpl-3.0 |
CMSS-BCRDB/RDSV1.0 | trove/network/neutron.py | 5 | 6185 | # Copyright 2014 Hewlett-Packard Development Company, L.P.
# 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... | apache-2.0 |
jdelight/django | tests/model_package/tests.py | 380 | 2668 | from __future__ import unicode_literals
from django.db import connection, models
from django.db.backends.utils import truncate_name
from django.test import TestCase
from .models.article import Article, Site
from .models.publication import Publication
class Advertisement(models.Model):
customer = models.CharFiel... | bsd-3-clause |
breathe/ansible | test/units/template/test_safe_eval.py | 205 | 1956 | # (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... | gpl-3.0 |
lonewolf07/coala | coalib/results/TextRange.py | 10 | 4188 | import copy
from coalib.misc.Decorators import (
enforce_signature, generate_ordering, generate_repr)
from coalib.results.TextPosition import TextPosition
@generate_repr("start", "end")
@generate_ordering("start", "end")
class TextRange:
@enforce_signature
def __init__(self, start: TextPosition, end: (T... | agpl-3.0 |
davidbgk/udata | udata/search/commands.py | 1 | 8335 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
import sys
import signal
from contextlib import contextmanager
from datetime import datetime
from flask import current_app
from flask_script import prompt_bool
from udata.commands import submanager, IS_INTERACTIVE
from udata.search impor... | agpl-3.0 |
electrolinux/weblate | weblate/trans/tests/test_check_views.py | 9 | 4303 | # -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# 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, eithe... | gpl-3.0 |
dgarage/bc2 | test/functional/test_framework/blockstore.py | 63 | 5483 | #!/usr/bin/env python3
# Copyright (c) 2015-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.
"""BlockStore and TxStore helper classes."""
from .mininode import *
from io import BytesIO
import dbm.du... | mit |
bitmazk/django-development-fabfile | development_fabfile/fabfile/remote.py | 2 | 8508 | """Fab tasks that execute things on a remote server."""
import sys
import django
from django.conf import settings
from distutils.version import StrictVersion
from fabric.api import cd, env, local, run
from .local import drop_db, create_db, import_db, import_media, reset_passwords
from .utils import require_server, r... | mit |
cnvogelg/fs-uae-gles | launcher/fs_uae_launcher/netplay/oyoyo/examplebot.py | 2 | 1024 | #!/usr/bin/python
"""Example bot for oyoyo that responds to !say"""
import logging
import re
from fs_uae_launcher.oyoyo.client import IRCClient
from fs_uae_launcher.oyoyo.cmdhandler import DefaultCommandHandler
from fs_uae_launcher.oyoyo import helpers
HOST = 'irc.freenode.net'
PORT = 6667
NICK = 'oyoyo-example'
CH... | gpl-2.0 |
DISBi/django-disbi | disbi/disbimodels.py | 1 | 7146 | """
Normal Django models with a few custom options for configuration.
If you have custom model classes that need these options, add them here and
create a child class of the appropriate options class and your custom model class.
"""
# Django
from django.db import models
class Options():
def __init__(self, di_sh... | mit |
DMLoy/ECommerceBasic | lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/operations.py | 98 | 12894 | """
This module contains the spatial lookup types, and the `get_geo_where_clause`
routine for Oracle Spatial.
Please note that WKT support is broken on the XE version, and thus
this backend will not work on such platforms. Specifically, XE lacks
support for an internal JVM, and Java libraries are required to use... | mit |
openhumanoids/oh-distro | software/ihmc/ihmc_step/translator_ihmc.py | 1 | 14123 | import lcm
import drc
import atlas
import bot_core
import time
import numpy as np
import py_drake_utils as ut
from bdi_step.footsteps import decode_footstep_plan, decode_deprecated_footstep_plan, encode_footstep_plan, FootGoal
from bdi_step.plotting import draw_swing
from bdi_step.utils import Behavior, gl, now_utime
... | bsd-3-clause |
ruslanloman/nova | nova/tests/unit/api/openstack/compute/contrib/test_server_groups.py | 33 | 15330 | # Copyright (c) 2014 Cisco Systems, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | apache-2.0 |
paplorinc/intellij-community | python/helpers/python-skeletons/os/__init__.py | 19 | 23905 | """Skeleton for 'os' stdlib module."""
from __future__ import unicode_literals
import io
import os
import subprocess
import sys
error = OSError
def ctermid():
"""Return the filename corresponding to the controlling terminal of the
process.
:rtype: string
"""
return ''
def getegid():
"""... | apache-2.0 |
davepmer/test-kernel | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
albert12132/templar | templar/api/rules/core.py | 1 | 4373 | """
The public API for Templar pre/post-processor rules.
Users can use this module with the following import statement:
from templar.api.rules import core
"""
from templar.exceptions import TemplarError
import re
class Rule:
"""Represents a preprocessor or postprocessor rule. Rules are applied in the orde... | mit |
ddki/my_study_project | language/python/frameworks/flask/venv/lib/python2.7/site-packages/werkzeug/debug/repr.py | 107 | 9340 | # -*- coding: utf-8 -*-
"""
werkzeug.debug.repr
~~~~~~~~~~~~~~~~~~~
This module implements object representations for debugging purposes.
Unlike the default repr these reprs expose a lot more information and
produce HTML instead of ASCII.
Together with the CSS and JavaScript files of the debug... | mit |
apporc/neutron | neutron/tests/tempest/services/botoclients.py | 38 | 9286 | # Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
hsteinhaus/ardupilot | mk/VRBRAIN/Tools/genmsg/src/genmsg/msgs.py | 51 | 12602 | # Software License Agreement (BSD License)
#
# Copyright (c) 2008, Willow Garage, 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 ... | gpl-3.0 |
e-gob/plataforma-kioscos-autoatencion | scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_bgp_neighbor_af.py | 22 | 26540 | #!/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... | bsd-3-clause |
rajexp/stepMuzic | allauth/socialaccount/providers/openid/south_migrations/0003_auto__del_openidaccount.py | 82 | 1958 | # encoding: utf-8
from south.db import db
from south.v2 import SchemaMigration
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting model 'OpenIDAccount'
db.delete_table('openid_openidaccount')
def backwards(self, orm):
# Adding model 'OpenIDAccount... | unlicense |
RafaelTorrealba/odoo | openerp/osv/osv.py | 337 | 1384 | # -*- coding: utf-8 -*-
##############################################################################
#
# 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... | agpl-3.0 |
bonitadecker77/python-for-android | python-modules/twisted/twisted/conch/client/direct.py | 60 | 3234 | # Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.internet import defer, protocol, reactor
from twisted.conch import error
from twisted.conch.ssh import transport
from twisted.python import log
class SSHClientFactory(protocol.ClientFactory):
def __init__(self, d, o... | apache-2.0 |
tanglei528/horizon | openstack_dashboard/api/network.py | 7 | 5048 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 NEC Corporation
#
# 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 |
FlorianLudwig/odoo | addons/account/project/report/cost_ledger.py | 358 | 5399 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
amosshapira/troposphere | tests/test_ecs.py | 23 | 1415 | import unittest
from troposphere import Ref
import troposphere.ecs as ecs
class TestECS(unittest.TestCase):
def test_allow_string_cluster(self):
task_definition = ecs.TaskDefinition(
"mytaskdef",
ContainerDefinitions=[
ecs.ContainerDefinition(
I... | bsd-2-clause |
crossbario/autobahn-python | examples/twisted/websocket/wrapping/server_endpoint.py | 3 | 2044 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | mit |
ZLLab-Mooc/edx-platform | lms/djangoapps/verify_student/ssencrypt.py | 183 | 7000 | """
NOTE: Anytime a `key` is passed into a function here, we assume it's a raw byte
string. It should *not* be a string representation of a hex value. In other
words, passing the `str` value of
`"32fe72aaf2abb44de9e161131b5435c8d37cbdb6f5df242ae860b283115f2dae"` is bad.
You want to pass in the result of calling .decode... | agpl-3.0 |
WebSpider/SickRage | lib/hachoir_parser/archive/rar.py | 84 | 13364 | """
RAR parser
Status: can only read higher-level attructures
Author: Christophe Gisquet
"""
from hachoir_parser import Parser
from hachoir_core.field import (StaticFieldSet, FieldSet,
Bit, Bits, Enum,
UInt8, UInt16, UInt32, UInt64,
String, TimeDateMSDOS32,
NullBytes, NullBits, RawBytes)
from hachoir_... | gpl-3.0 |
nopjmp/SickRage | lib/unidecode/x062.py | 252 | 4620 | data = (
'Lian ', # 0x00
'Nan ', # 0x01
'Mi ', # 0x02
'Tang ', # 0x03
'Jue ', # 0x04
'Gang ', # 0x05
'Gang ', # 0x06
'Gang ', # 0x07
'Ge ', # 0x08
'Yue ', # 0x09
'Wu ', # 0x0a
'Jian ', # 0x0b
'Xu ', # 0x0c
'Shu ', # 0x0d
'Rong ', # 0x0e
'Xi ', # 0x0f
'Cheng ', # 0x10
'... | gpl-3.0 |
SrNetoChan/Quantum-GIS | python/plugins/processing/algs/qgis/VectorLayerScatterplot.py | 30 | 4236 | # -*- coding: utf-8 -*-
"""
***************************************************************************
EquivalentNumField.py
---------------------
Date : January 2013
Copyright : (C) 2013 by Victor Olaya
Email : volayaf at gmail dot com
*******************... | gpl-2.0 |
scifiswapnil/Project-LoCatr | lib/python2.7/site-packages/django/contrib/auth/mixins.py | 115 | 4085 | from django.conf import settings
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.views import redirect_to_login
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
from django.utils import six
from django.utils.encoding import force_text
class AccessMixin(object):
... | mit |
Xekyo/bitcoin | test/functional/decodescript.py | 22 | 13449 | #!/usr/bin/env python3
# Copyright (c) 2015-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 decoding scripts via decodescript RPC command."""
from test_framework.test_framework import Bitco... | mit |
yewang15215/django | tests/fixtures_regress/models.py | 281 | 8611 | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Animal(models.Model):
name = models.CharField(max_length=150)
latin_na... | bsd-3-clause |
jlspyaozhongkai/Uter | third_party_backup/Python-2.7.9/Lib/ctypes/test/test_simplesubclasses.py | 117 | 1355 | import unittest
from ctypes import *
class MyInt(c_int):
def __cmp__(self, other):
if type(other) != MyInt:
return -1
return cmp(self.value, other.value)
def __hash__(self): # Silence Py3k warning
return hash(self.value)
class Test(unittest.TestCase):
def test_compare(... | gpl-3.0 |
waltervh/BornAgain | Examples/python/simulation/ex03_InterferenceFunctions/ApproximationLMA.py | 2 | 2597 | """
Cylinders of two different sizes in Local Monodisperse Approximation
"""
import bornagain as ba
from bornagain import deg, angstrom, nm
def get_sample():
"""
Returns a sample with cylinders of two different sizes on a substrate.
The cylinder positions are modelled in Local Monodisperse Approximation.
... | gpl-3.0 |
qenter/vlc-android | toolchains/arm/lib/python2.7/idlelib/EditorWindow.py | 35 | 64809 | import sys
import os
import re
import imp
from Tkinter import *
import tkSimpleDialog
import tkMessageBox
import webbrowser
from idlelib.MultiCall import MultiCallCreator
from idlelib import idlever
from idlelib import WindowList
from idlelib import SearchDialog
from idlelib import GrepDialog
from idlelib import Repla... | gpl-2.0 |
lovasb/django-ajaxtables | ajaxtables/views/__init__.py | 2 | 3679 | from django.http import Http404
from django.core.exceptions import ImproperlyConfigured
from vanilla import ListView
class AjaxListView(ListView):
template_names = ['ajaxtables/object_list.html', 'ajaxtables/object_list_data.html']
filter_form_class = None
page_size = 10
page_kwarg = 'page'
def ... | gpl-3.0 |
JVillella/tensorflow | tensorflow/examples/tutorials/mnist/mnist_with_summaries.py | 39 | 8550 | # 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 |
katakumpo/niceredis | niceredis/client/server.py | 1 | 6771 | # -*- coding: utf-8 *-*
import warnings
from redis.connection import Token
from redis.exceptions import ConnectionError, RedisError
from .base import RedisBase
class ServerCommands(RedisBase):
# SERVER INFORMATION
def bgrewriteaof(self):
"Tell the Redis server to rewrite the AOF file from data in m... | mit |
chenjun0210/tensorflow | tensorflow/contrib/learn/python/learn/estimators/metric_key.py | 89 | 1569 | # 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 |
tbombach/autorest | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDateTime/autorestdatetimetestservice/operations/datetime_model_operations.py | 5 | 30734 | # 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 ... | mit |
cchurch/ansible | lib/ansible/module_utils/facts/network/freebsd.py | 232 | 1190 | # 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 distributed in the hope that ... | gpl-3.0 |
Tatsh-ansible/ansible | lib/ansible/modules/cloud/vmware/vca_nat.py | 19 | 6959 | #!/usr/bin/python
# Copyright (c) 2015 VMware, Inc. All Rights Reserved.
#
# 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 ... | gpl-3.0 |
steedos/odoo7 | openerp/addons/account/edi/invoice.py | 59 | 13975 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011-2012 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
shashank971/edx-platform | docs/en_us/enrollment_api/source/conf.py | 39 | 2910 | # -*- coding: utf-8 -*-
# pylint: disable=invalid-name
# pylint: disable=redefined-builtin
# pylint: disable=protected-access
# pylint: disable=unused-argument
import os
from path import Path as path
import sys
import mock
MOCK_MODULES = [
'ipware',
'ip',
'ipware.ip',
'get_ip',
'pygeoip',
'ipa... | agpl-3.0 |
eXistenZNL/SickRage | lib/hachoir_parser/network/ouid.py | 186 | 385658 | # -*- coding: utf-8 -*-
"""
List of registered IEEE 24-bit Organizationally Unique IDentifiers.
Original data file:
http://standards.ieee.org/regauth/oui/oui.txt
"""
REGISTERED_OUID = {
0x000000: u'XEROX CORPORATION',
0x000001: u'XEROX CORPORATION',
0x000002: u'XEROX CORPORATION',
0x000003: u'XEROX CORPOR... | gpl-3.0 |
hugs/django | tests/regressiontests/templates/unicode.py | 33 | 1131 | # -*- coding: utf-8 -*-
unicode_tests = ur"""
Templates can be created from unicode strings.
>>> from django.template import *
>>> from django.utils.safestring import SafeData
>>> t1 = Template(u'ŠĐĆŽćžšđ {{ var }}')
Templates can also be created from bytestrings. These are assumed by encoded
using UTF-8.
>>> s = '\... | bsd-3-clause |
asdil12/pywikibase | things.py | 1 | 4025 | #!/usr/bin/python2
import re
class BaseValue(object):
def __init__(self, value):
self.value = value
def __str__(self):
return value
def __repr__(self):
return "<%s object: %s>" % (self.__class__.__name__, self.__str__())
def to_value(self):
return self.__str__()
# Note:
# to_value: generates value as ... | gpl-3.0 |
shtrom/gtg | GTG/core/config.py | 3 | 7452 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Getting Things GNOME! - a personal organizer for the GNOME desktop
# Copyright (c) 2008-2015 - Lionel Dricot & Bertrand Rousseau
#
# This program is free software: you can redistribute it and/or modify it under
# t... | gpl-3.0 |
mikekestemont/keras | keras/preprocessing/sequence.py | 76 | 4441 | from __future__ import absolute_import
# -*- coding: utf-8 -*-
import numpy as np
import random
from six.moves import range
def pad_sequences(sequences, maxlen=None, dtype='int32', padding='pre', truncating='pre', value=0.):
"""
Pad each sequence to the same length:
the length of the longuest sequ... | mit |
adrgerez/ardublockly | package/build_pyinstaller.py | 1 | 9203 | #!/usr/bin/env python2
# -*- coding: utf-8 -*- #
#
# Builds the Ardublockly Python portion of the app for Linux or OS X.
#
# Copyright (c) 2015 carlosperate https://github.com/carlosperate/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... | apache-2.0 |
qewerty/moto.old | tools/scons/engine/SCons/Variables/PathVariable.py | 5 | 5658 | """SCons.Variables.PathVariable
This file defines an option type for SCons implementing path settings.
To be used whenever a a user-specified path override should be allowed.
Arguments to PathVariable are:
option-name = name of this option on the command line (e.g. "prefix")
option-help = help string for optio... | gpl-2.0 |
tedelhourani/ansible | lib/ansible/modules/cloud/google/gcp_url_map.py | 99 | 17159 | #!/usr/bin/python
# Copyright 2017 Google 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',
'status': ['preview'],
... | gpl-3.0 |
iulian787/spack | var/spack/repos/builtin/packages/cctools/package.py | 2 | 4409 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Cctools(AutotoolsPackage):
"""The Cooperative Computing Tools (cctools) enable large scale... | lgpl-2.1 |
mkudlej/usmqe-tests | usmqe/web/grafana/hosts/models.py | 2 | 1367 | """
Common page model for Grafana volumes page
"""
from usmqe.web.grafana.auxiliary.models import GenericChartModel, \
SingleStatModel, GenericDropDownListModel
class ClusterListModel(GenericDropDownListModel):
"""
DropDown list of clusters
"""
_title = "Cluster Id"
class HostListModel(Generic... | gpl-3.0 |
marcusmueller/measurement_toolbox | gr-mtb/python/qa_task_frontend.py | 2 | 2935 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Marcus Müller.
#
# This 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, or (at your option)
# any later version.
#
# This s... | gpl-3.0 |
ted-gould/nova | nova/api/openstack/compute/legacy_v2/contrib/rescue.py | 59 | 3896 | # Copyright 2011 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
RafaelTorrealba/odoo | addons/crm/wizard/crm_lead_to_opportunity.py | 146 | 13701 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
autotest/virt-test | virttest/rss_client.py | 21 | 19481 | #!/usr/bin/python
"""
Client for file transfer services offered by RSS (Remote Shell Server).
:author: Michael Goldish (mgoldish@redhat.com)
:copyright: 2008-2010 Red Hat Inc.
"""
import socket
import struct
import time
import sys
import os
import glob
# Globals
CHUNKSIZE = 65536
# Protocol message constants
RSS_MA... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.