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 |
|---|---|---|---|---|---|
awkspace/ansible | lib/ansible/modules/storage/purestorage/purefb_network.py | 14 | 5908 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Simon Dodsley (simon@purestorage.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 |
dominikl/openmicroscopy | build.py | 10 | 4021 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# $Id$
#
# Copyright 2009 Glencoe Software, Inc. All rights reserved.
# Use is subject to license terms supplied in LICENSE.txt
#
# General build scripts.
import os
import sys
import subprocess
BUILD_PY = "-Dbuild.py=true"
def popen(args, stdin=None, stdout=subprocess... | gpl-2.0 |
newrocknj/horizon | openstack_dashboard/test/test_data/keystone_data.py | 30 | 16443 | # Copyright 2012 Nebula, 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 agree... | apache-2.0 |
waltervh/BornAgain | dev-tools/analyze/baloc/history_collector.py | 3 | 4186 | """
Process gitlog and create a file with number of lines of code.
"""
from datetime import datetime
from .file_types import FileTypes, filetype
import re
from email.utils import parsedate
import subprocess
def gitlog():
"""
Execute gitlog command and make generator over lines in the log
"""
p = subpr... | gpl-3.0 |
ikcalB/linuxcnc-mirror | lib/python/gladevcp/hal_actions.py | 6 | 22004 | #!/usr/bin/env python
# vim: sts=4 sw=4 et
# GladeVcp actions
#
# Copyright (c) 2010 Pavel Shramov <shramov@mexmat.net>
#
# 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... | lgpl-2.1 |
marissazhou/django | django/utils/archive.py | 562 | 7070 | """
Based on "python-archive" -- http://pypi.python.org/pypi/python-archive/
Copyright (c) 2010 Gary Wilson Jr. <gary.wilson@gmail.com> and contributors.
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 So... | bsd-3-clause |
APM602/APM602 | Tools/LogAnalyzer/tests/TestIMUMatch.py | 61 | 3781 | from LogAnalyzer import Test,TestResult
import DataflashLog
from math import sqrt
class TestIMUMatch(Test):
'''test for empty or near-empty logs'''
def __init__(self):
Test.__init__(self)
self.name = "IMU Mismatch"
def run(self, logdata, verbose):
#tuning parameters:
war... | gpl-3.0 |
Nexenta/cinder | cinder/tests/unit/backup/drivers/test_backup_ceph.py | 1 | 50666 | # Copyright 2013 Canonical Ltd.
# 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 b... | apache-2.0 |
signed/intellij-community | python/lib/Lib/CGIHTTPServer.py | 86 | 12466 | """CGI-savvy HTTP Server.
This module builds on SimpleHTTPServer by implementing GET and POST
requests to cgi-bin scripts.
If the os.fork() function is not present (e.g. on Windows),
os.popen2() is used as a fallback, with slightly altered semantics; if
that function is not present either (e.g. on Macintosh), only Py... | apache-2.0 |
DrOctogon/Satchmo | satchmo/apps/payment/modules/google/notifications.py | 6 | 3767 | '''
Created on 3 Mar 2009
@author: dalore
'''
from django.utils.translation import ugettext as _
from livesettings import config_get_group, config_value
from payment.utils import get_processor_by_key
from satchmo_store.shop.models import Cart, Order, OrderPayment
import re
def find_order(data):
"""
Helper fun... | bsd-3-clause |
ujenmr/ansible | test/units/modules/storage/netapp/test_na_ontap_interface.py | 23 | 10173 | # (c) 2018, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' unit test template for ONTAP Ansible module '''
from __future__ import print_function
import json
import pytest
from units.compat import unittest
from units.compat.mock import patch, Mock
from ans... | gpl-3.0 |
sdcooke/django | tests/admin_changelist/models.py | 276 | 2890 | from django.db import models
from django.utils.encoding import python_2_unicode_compatible
class Event(models.Model):
# Oracle can have problems with a column named "date"
date = models.DateField(db_column="event_date")
class Parent(models.Model):
name = models.CharField(max_length=128)
class Child(mo... | bsd-3-clause |
CHT5/program-y | src/programy/parser/template/nodes/sr.py | 3 | 1984 | """
Copyright (c) 2016 Keith Sterling
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 to use, copy, modify, merge, publish, distribute,... | mit |
lewiskan/heron | integration-test/src/python/integration_test/topology/fields_grouping/fields_grouping.py | 8 | 1311 | # copyright 2016 twitter. all rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 |
silentfuzzle/calibre | src/calibre/ebooks/oeb/polish/container.py | 2 | 55024 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
... | gpl-3.0 |
2013Commons/HUE-SHARK | desktop/core/ext-py/Django-1.2.3/build/lib.linux-i686-2.7/django/utils/tree.py | 310 | 5778 | """
A class for storing a tree graph. Primarily used for filter constructs in the
ORM.
"""
from django.utils.copycompat import deepcopy
class Node(object):
"""
A single internal node in the tree graph. A Node should be viewed as a
connection (the root) with the children being either leaf nodes or other
... | apache-2.0 |
patrickcurl/ztruck | dj/lib/python2.7/site-packages/django/http/request.py | 86 | 21287 | from __future__ import unicode_literals
import copy
import os
import re
import sys
from io import BytesIO
from itertools import chain
from pprint import pformat
from django.conf import settings
from django.core import signing
from django.core.exceptions import DisallowedHost, ImproperlyConfigured
from django.core.fil... | apache-2.0 |
romain-li/edx-platform | lms/djangoapps/course_api/permissions.py | 85 | 1125 | """
Course API Authorization functions
"""
from student.roles import GlobalStaff
def can_view_courses_for_username(requesting_user, target_username):
"""
Determine whether `requesting_user` has permission to view courses available
to the user identified by `target_username`.
Arguments:
reque... | agpl-3.0 |
alexpap/exareme | exareme-tools/madis/src/lib/vtoutgtable.py | 5 | 4965 | from gtable import gtablefileFull , gjsonfileFull ,gjsonFull
from iterutils import peekable
from sqlitetypes import typestoSqliteTypes
import types
def vtoutpugtformat(out,diter,simplejson=True): #### TODO Work on types patttern
"""
Reads diter stream of tuples(row,types) and formats row values to
the goo... | mit |
jeroenh/OpenNSA | test/test_topology.py | 1 | 1847 | import StringIO
from twisted.trial import unittest
from opennsa import nsa
from opennsa.topology import gole
from . import topology as testtopology
TEST_PATH_1 = {
'source_stp' : nsa.STP('Aruba', 'A2'),
'dest_stp' : nsa.STP('Curacao', 'C3'),
'paths' : [ [ nsa.Link('Aruba', 'A2', 'A4'), nsa.Link... | bsd-3-clause |
rven/odoo | addons/pad/models/pad.py | 1 | 5592 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
import random
import re
import string
import requests
from odoo import api, models, _
from odoo.exceptions import UserError
from ..py_etherpad import EtherpadLiteClient
_logger = logging.getLogger(__na... | agpl-3.0 |
Cnfc19932/scrapy | tests/test_item.py | 129 | 7291 | import unittest
from scrapy.item import Item, Field
import six
class ItemTest(unittest.TestCase):
def assertSortedEqual(self, first, second, msg=None):
return self.assertEqual(sorted(first), sorted(second), msg)
def test_simple(self):
class TestItem(Item):
name = Field()
... | bsd-3-clause |
Jon-ICS/upm | examples/python/grovetemp.py | 7 | 1892 | from __future__ import print_function
# Author: Brendan Le Foll <brendan.le.foll@intel.com>
# Contributions: Sarah Knepper <sarah.knepper@intel.com>
# Copyright (c) 2014 Intel Corporation.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation fi... | mit |
Azure/azure-sdk-for-python | sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_generated/v2016_10_01/aio/operations/_key_vault_client_operations.py | 1 | 230715 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | mit |
scorphus/scrapy | scrapy/core/downloader/handlers/s3.py | 31 | 2328 | from urlparse import unquote
from scrapy import optional_features
from scrapy.exceptions import NotConfigured
from scrapy.utils.httpobj import urlparse_cached
from .http import HTTPDownloadHandler
try:
from boto.s3.connection import S3Connection
except ImportError:
S3Connection = object
class _v19_S3Connecti... | bsd-3-clause |
TheTypoMaster/chromium-crosswalk | tools/memory_inspector/memory_inspector/backends/adb_client.py | 41 | 10480 | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A pure python library to interface with the Android Debug Bridge daemon.
This a lightweight implementation of the adb socket protocol, the same as the
on... | bsd-3-clause |
platformio/platformio-core | platformio/debug/helpers.py | 1 | 6497 | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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 appli... | apache-2.0 |
sam-tsai/django-old | django/conf/locale/en/formats.py | 105 | 1357 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'N j, Y'
TIME_FORMAT = 'P'
DATETIME_FORMAT = 'N j, Y, P'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'F j'
SHORT_DATE_FORMAT = 'm/d/Y'
SHORT_DATETIME_FORMAT = 'm/d/Y P'
FIRST_DAY_OF_WEEK = 0 # Sunday
DAT... | bsd-3-clause |
petecummings/django-blog-zinnia | zinnia/admin/category.py | 4 | 1223 | """CategoryAdmin for Zinnia"""
from django.contrib import admin
from django.utils.html import format_html
from django.core.urlresolvers import NoReverseMatch
from django.utils.translation import ugettext_lazy as _
from zinnia.admin.forms import CategoryAdminForm
class CategoryAdmin(admin.ModelAdmin):
"""
Adm... | bsd-3-clause |
shakamunyi/neutron-vrrp | neutron/plugins/brocade/nos/fake_nosdriver.py | 8 | 3548 | # Copyright 2013 Brocade Communications System, 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
#
#... | apache-2.0 |
yugang/crosswalk-test-suite | wrt/wrt-sharemode-android-tests/inst.apk.py | 2 | 6335 | #!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PKG_NAME = os.path.basename(SCRIPT_DIR)
TEST_PREFIX = os.environ['HOME']
PARAMETERS = None
ADB_CMD = "adb"
def do... | bsd-3-clause |
javaarchive/idle | systools.py | 2 | 1768 | import pickle as p
class sysfile:
def __init__(self,name="program.log",ftype="r+"):
self.f=open(name,ftype)
try:
#self.rr=self.f.read()
self.prop={"name":name,"opentype":ftype,"data":self.f.readlines(),"datastr":self.f.read()}
except:
print("erro... | mit |
jmchilton/galaxy-central | galaxy/tools/parameters.py | 1 | 19896 | """
Classes encapsulating tool parameters
"""
import logging, string, sys
from galaxy import config, datatypes, util, form_builder
import validation
from elementtree.ElementTree import XML, Element
log = logging.getLogger(__name__)
class ToolParameter( object ):
"""
Describes a parameter accepted by a tool.... | mit |
casualuser/ajenti | plugins/webserver_common/api.py | 17 | 8267 | from ajenti.com import *
from ajenti.apis import API
from ajenti.api import CategoryPlugin, event
from ajenti.ui import UI
from ajenti import apis
class Webserver(API):
class VirtualHost:
def __init__(self):
self.name = ''
self.config = ''
class Module:
... | lgpl-3.0 |
EmreAtes/spack | var/spack/repos/builtin/packages/gnutls/package.py | 5 | 3543 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
fhahn/django-guardian | setup.py | 32 | 1607 | import os
import sys
from setuptools import setup, find_packages
from extras import RunFlakesCommand
guardian = __import__('guardian')
readme_file = os.path.join(os.path.dirname(__file__), 'README.rst')
try:
long_description = open(readme_file).read()
except IOError as err:
sys.stderr.write("[ERROR] Cannot fin... | bsd-2-clause |
carljm/django | tests/logging_tests/tests.py | 7 | 19482 | # -*- coding:utf-8 -*-
from __future__ import unicode_literals
import logging
import warnings
from contextlib import contextmanager
from admin_scripts.tests import AdminScriptTestCase
from django.conf import settings
from django.core import mail
from django.core.files.temp import NamedTemporaryFile
from django.core.... | bsd-3-clause |
HailStorm32/Q.bo_stacks | qbo_webi/src/teleoperation/sip2rtmp/rtmplite/siprtmp.py | 4 | 91053 | # Copyright (c) 2007-2009, Mamta Singh. All rights reserved. See LICENSING for details.
# Copyright (c) 2010-2011, Kundan Singh.
'''
Introduction
------------
The goal of this project is to allow multimedia calls from Flash Player to SIP network and vice-versa. This allows either a
web browser or a standalone A... | lgpl-2.1 |
LaoZhongGu/kbengine | kbe/src/lib/python/Lib/turtledemo/wikipedia.py | 150 | 1347 | """ turtle-example-suite:
tdemo_wikipedia3.py
This example is
inspired by the Wikipedia article on turtle
graphics. (See example wikipedia1 for URLs)
First we create (ne-1) (i.e. 35 in this
example) copies of our first turtle p.
Then we let them perform their steps in
parallel.
Followed by a complete... | lgpl-3.0 |
puttarajubr/commcare-hq | corehq/ex-submodules/couchforms/tests/test_dbaccessors.py | 1 | 2772 | import datetime
from django.test import TestCase
from couchforms.dbaccessors import get_forms_by_type, clear_forms_in_domain, \
get_number_of_forms_by_type, get_number_of_forms_of_all_types, \
get_form_ids_by_type, get_number_of_forms_all_domains_in_couch
from couchforms.models import XFormInstance, XFormError
... | bsd-3-clause |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/sklearn/lda.py | 3 | 9301 | """
The :mod:`sklearn.lda` module implements Linear Discriminant Analysis (LDA).
"""
# Authors: Matthieu Perrot
# Mathieu Blondel
import warnings
import numpy as np
from scipy import linalg
from .base import BaseEstimator, ClassifierMixin, TransformerMixin
from .utils.extmath import logsumexp
from .utils.fi... | agpl-3.0 |
moijes12/oh-mainline | vendor/packages/mechanize/mechanize/_auth.py | 137 | 2576 | """HTTP Authentication and Proxy support.
Copyright 2006 John J. Lee <jjl@pobox.com>
This code is free software; you can redistribute it and/or modify it under
the terms of the BSD or ZPL 2.1 licenses (see the file COPYING.txt
included with the distribution).
"""
from _urllib2_fork import HTTPPasswordMgr
# TODO:... | agpl-3.0 |
ashmastaflash/don-bot | app/donlib/halo.py | 1 | 11070 | import cloudpassage
import os
import requests
from formatter import Formatter
from urlparse import urljoin
from utility import Utility as util
from halocelery.apputils import Utility as hc_util
class Halo(object):
"""This contains all Halo interaction logic
Attrubites:
session (cloudpassage.HaloSessi... | bsd-3-clause |
Lab603/PicEncyclopedias | jni-build/jni-build/jni/include/tensorflow/contrib/distributions/python/kernel_tests/normal_test.py | 4 | 12117 | # 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... | mit |
dmeulen/home-assistant | homeassistant/components/automation/template.py | 16 | 1846 | """
Offer template automation rules.
For more details about this automation rule, please refer to the documentation
at https://home-assistant.io/components/automation/#template-trigger
"""
import logging
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.const import CONF_VALUE_TEMPL... | mit |
HyShai/youtube-dl | youtube_dl/extractor/spiegeltv.py | 33 | 2762 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import float_or_none
class SpiegeltvIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?spiegel\.tv/(?:#/)?filme/(?P<id>[\-a-z0-9]+)'
_TESTS = [{
'url': 'http://www.spiegel.tv/filme/flug-mh370/',
... | unlicense |
grimfang/panda3d | samples/carousel/main.py | 25 | 9571 | #!/usr/bin/env python
# Author: Shao Zhang, Phil Saltzman, and Eddie Canaan
# Last Updated: 2015-03-13
#
# This tutorial will demonstrate some uses for intervals in Panda
# to move objects in your panda world.
# Intervals are tools that change a value of something, like position,
# rotation or anything else, linearly,... | bsd-3-clause |
bfrgoncalves/Online-PhyloViZ | node_modules/l/node_modules/hook.io/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/scons.py | 231 | 35679 | # 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.
import gyp
import gyp.common
import gyp.SCons as SCons
import os.path
import pprint
import re
import subprocess
# TODO: remove when we delete the last WriteList... | gpl-3.0 |
HPPTECH/hpp_IOSTressTest | Resources/ssh/pexpect-3.2/tests/sleep_for.py | 22 | 1402 | #!/usr/bin/env python
'''
PEXPECT LICENSE
This license is approved by the OSI and FSF as GPL-compatible.
http://opensource.org/licenses/isc-license.txt
Copyright (c) 2012, Noah Spurrier <noah@noah.org>
PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY
PURPOSE WITH OR WIT... | mit |
toobaz/pandas | ci/print_skipped.py | 1 | 1409 | #!/usr/bin/env python
import os
import sys
import math
import xml.etree.ElementTree as et
def parse_results(filename):
tree = et.parse(filename)
root = tree.getroot()
skipped = []
current_class = ""
i = 1
assert i - 1 == len(skipped)
for el in root.findall("testcase"):
cn = el.at... | bsd-3-clause |
sogis/Quantum-GIS | python/plugins/fTools/tools/doMeanCoords.py | 11 | 8882 | # -*- coding: utf-8 -*-
#-----------------------------------------------------------
#
# fTools
# Copyright (C) 2008-2011 Carson Farmer
# EMAIL: carson.farmer (at) gmail.com
# WEB : http://www.ftools.ca/fTools.html
#
# A collection of data management and analysis tools for vector data
#
#-----------------------------... | gpl-2.0 |
javaos74/neutron | neutron/tests/api/admin/test_quotas.py | 26 | 3842 | # Copyright 2013 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 |
dirn/readthedocs.org | readthedocs/projects/tasks.py | 2 | 36420 | """Tasks related to projects, including fetching repository code, cleaning
``conf.py`` files, and rebuilding documentation.
"""
import fnmatch
import os
import shutil
import json
import logging
import socket
import requests
import datetime
from celery import task
from django.conf import settings
from django.core.urlre... | mit |
ujenmr/ansible | test/units/modules/network/eos/test_eos_user.py | 68 | 4171 | # 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 |
codeaurora-unoffical/linux-msm | tools/perf/scripts/python/intel-pt-events.py | 233 | 3961 | # intel-pt-events.py: Print Intel PT Power Events and PTWRITE
# Copyright (c) 2017, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
#
# This progr... | gpl-2.0 |
sourcepole/kadas-albireo | python/ext-libs/jinja2/utils.py | 598 | 16165 | # -*- coding: utf-8 -*-
"""
jinja2.utils
~~~~~~~~~~~~
Utility functions.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
import errno
from collections import deque
from jinja2._compat import text_type, string_types, implements_iterator, \
all... | gpl-2.0 |
Sweet-Peas/mbed | workspace_tools/host_tests/tcpecho_client.py | 52 | 1874 | """
mbed SDK
Copyright (c) 2011-2013 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wr... | apache-2.0 |
TsinghuaX/edx-platform | cms/djangoapps/contentstore/views/helpers.py | 11 | 1043 | from django.http import HttpResponse
from django.shortcuts import redirect
from mitxmako.shortcuts import render_to_string, render_to_response
__all__ = ['edge', 'event', 'landing']
# points to the temporary course landing page with log in and sign up
def landing(request, org, course, coursename):
return render_... | agpl-3.0 |
openstack-infra/shade | shade/tests/unit/test_floating_ip_neutron.py | 1 | 41101 | # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# 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... | apache-2.0 |
kjw0106/GCM_app_server | venv/lib/python2.7/site-packages/werkzeug/contrib/testtools.py | 365 | 2453 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.testtools
~~~~~~~~~~~~~~~~~~~~~~~~~~
This module implements extended wrappers for simplified testing.
`TestResponse`
A response wrapper which adds various cached attributes for
simplified assertions on various content types.
:copyright:... | mit |
bblais/plasticity | setup.py | 1 | 2798 | # this is from https://github.com/cython/cython/wiki/PackageHierarchy
import sys, os, stat, subprocess
from distutils.core import setup
from Cython.Distutils import build_ext
from distutils.extension import Extension
# we'd better have Cython installed, or it's a no-go
try:
from Cython.Distutils import build_ex... | mit |
dslackw/sbo-templates | sbo_templates/__metadata__.py | 1 | 1203 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# __metadata__.py file is part of sbo-templates.
# Copyright 2015-2021 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved.
# SBo tool for managing templates.
# https://gitlab.com/dslackw/sbo-templates
# sbo-templates is free software: you can redistribute ... | gpl-3.0 |
lowitty/sendtrap | lib/pysnmp/entity/rfc3413/context.py | 6 | 2373 | # SNMP entity context
from pyasn1.type import univ
from pyasn1.compat.octets import null
from pysnmp import error
from pysnmp import debug
class SnmpContext:
def __init__(self, snmpEngine, contextEngineId=None):
snmpEngineId,= snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FR... | mit |
smaiLee/smarthome | tests/test_plugin.py | 2 | 7133 |
import common
import unittest
import lib.plugin
import lib.item
from lib.model.smartplugin import SmartPlugin
import threading
class TestConfig(unittest.TestCase):
def props(self,cls):
return [i for i in cls.__dict__.keys() if i[:1] != '_']
def test_plugins(self):
plugins = lib.plugin.Plugi... | gpl-3.0 |
shabab12/edx-platform | common/djangoapps/track/views/tests/test_views.py | 81 | 10225 | # pylint: disable=missing-docstring,maybe-no-member
from mock import patch, sentinel
from django.contrib.auth.models import User
from django.test.client import RequestFactory
from django.test.utils import override_settings
from track import views
from track.middleware import TrackMiddleware
from track.tests import E... | agpl-3.0 |
ericbaze/continuum_code_2012 | pydata/moin/pythonenv/local/lib/python2.7/re.py | 113 | 12984 | #
# Secret Labs' Regular Expression Engine
#
# re-compatible interface for the sre matching engine
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# This version of the SRE library can be redistributed under CNRI's
# Python 1.6 license. For any other use, please contact Secret Labs
# AB (info@py... | gpl-2.0 |
aayush2911/Fibonaccio | web2py/gluon/contrib/taskbar_widget.py | 43 | 8262 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# # Creates a taskbar icon for web2py
# # Author: Mark Larsen, mostly stolen from Mark Hammond's
# # C:\Python25\Lib\site-packages\win32\Demos\win32gui_taskbar.py
# # 11/7/08
# dual licensed under the web2py license (LGPL) and the Python license.
import os
import sys
imp... | gpl-2.0 |
snf/servo | python/mach/mach/mixin/logging.py | 131 | 1994 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import, unicode_literals
import logging
class LoggingMixin(object):
"""Provides f... | mpl-2.0 |
tidyjiang8/esp-idf-zh | tools/esp_app_trace/pylibelf/__init__.py | 13 | 5711 | from types import *
from constants import *
from ctypes import *
lelf=CDLL("libelf.so.1")
__all__ = []
all_objs = []
class ElfError(Exception):
def __init__(self, msg):
self.msg = msg
self.errno = elf_errno()
self.elfmsg = elf_errmsg(self.errno)
def __str__(self):
return "ElfError(%d, %s): %s" ... | apache-2.0 |
mudbungie/NetExplorer | env/lib/python3.4/site-packages/networkx/algorithms/approximation/independent_set.py | 85 | 1997 | # -*- coding: utf-8 -*-
"""
Independent Set
Independent set or stable set is a set of vertices in a graph, no two of
which are adjacent. That is, it is a set I of vertices such that for every
two vertices in I, there is no edge connecting the two. Equivalently, each
edge in the graph has at most one endpoint in I. The... | mit |
niktre/espressopp | contrib/mpi4py/mpi4py-2.0.0/test/test_status.py | 8 | 3107 | from mpi4py import MPI
import mpiunittest as unittest
class TestStatus(unittest.TestCase):
def setUp(self):
self.STATUS = MPI.Status()
def tearDown(self):
self.STATUS = None
def testDefaultFieldValues(self):
self.assertEqual(self.STATUS.Get_source(), MPI.ANY_SOURCE)
self.... | gpl-3.0 |
TeslaProject/external_chromium_org | tools/clang/scripts/test_tool.py | 27 | 4732 | #!/usr/bin/env python
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Test harness for chromium clang tools."""
import difflib
import glob
import json
import os
import os.path
import subprocess
imp... | bsd-3-clause |
chinmaygarde/CoreLib | Test/GoogleTest/scripts/fuse_gtest_files.py | 2577 | 8813 | #!/usr/bin/env python
#
# 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... | mit |
mozilla/pto | pto/apps/autocomplete/views.py | 1 | 1912 | # 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 logging
from django import http
from pto.apps.dates.decorators import json_view
from pto.apps.users.models import... | mpl-2.0 |
cchurch/ansible | lib/ansible/plugins/doc_fragments/shell_common.py | 79 | 1833 | # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
# common shelldocumentation fragment
DOCUMENTATION = """
options:
remote_tmp:
description:
- Temporary directory to use on targets whe... | gpl-3.0 |
MiLk/ansible | lib/ansible/modules/web_infrastructure/ansible_tower/tower_group.py | 36 | 8114 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2017, Wayne Witzel III <wayne@riotousliving.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 opti... | gpl-3.0 |
fahhem/zerorpc-python | tests/test_middleware_client.py | 102 | 12192 | # -*- coding: utf-8 -*-
# Open Source Initiative OSI - The MIT License (MIT):Licensing
#
# The MIT License (MIT)
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Softwa... | mit |
amenonsen/ansible | lib/ansible/modules/windows/win_defrag.py | 52 | 2718 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: 2017, Dag Wieers (@dagwieers) <dag@wieers.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by... | gpl-3.0 |
ajylee/gpaw-rtxs | gpaw/test/diamond_gllb.py | 1 | 2143 | from ase.structure import bulk
from sys import argv
from ase.dft.kpoints import ibz_points, get_bandpath
from gpaw import *
from ase import *
from gpaw.test import gen
from gpaw import setup_paths
import os
"""This calculation has the following structure.
1) Calculate the ground state of Diamond.
2) Calculate the ban... | gpl-3.0 |
marcosmodesto/django-testapp | django/django/contrib/admin/filters.py | 52 | 16279 | """
This encapsulates the logic for displaying filters in the Django admin.
Filters are specified in models with the "list_filter" option.
Each filter subclass knows how to display a filter for a field that passes a
certain test -- e.g. being a DateField or ForeignKey.
"""
import datetime
from django.db import models... | bsd-3-clause |
retomerz/intellij-community | python/lib/Lib/site-packages/django/templatetags/l10n.py | 247 | 1845 | from django.conf import settings
from django.template import Node
from django.template import TemplateSyntaxError, Library
from django.utils import formats
from django.utils.encoding import force_unicode
register = Library()
def localize(value):
"""
Forces a value to be rendered as a localized value,
reg... | apache-2.0 |
mvaled/OpenUpgrade | openerp/addons/base/ir/ir_model.py | 3 | 62576 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2014 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
HyperBaton/ansible | lib/ansible/modules/network/junos/junos_system.py | 52 | 6186 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, 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 |
discoapi/discotech | discotech/discoAPI/keywordManager.py | 1 | 3203 | __package__ = 'discotech.discoAPI'
from discotech import discotechError
class KeywordManager(object):
"""
Simple object to store and queue keyword to search in social media providers
"""
def __init__(self,keywords = [],convertToSearchPhrases = False):
"""
@type keywords: list
@param keywords:... | gpl-2.0 |
pramasoul/micropython | tests/extmod/ure1.py | 11 | 2723 | try:
import ure as re
except ImportError:
try:
import re
except ImportError:
print("SKIP")
raise SystemExit
r = re.compile(".+")
m = r.match("abc")
print(m.group(0))
try:
m.group(1)
except IndexError:
print("IndexError")
# conversion of re and match to string
str(r)
str(m)
... | mit |
jmztaylor/android_kernel_htc_a3ul_old | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
appleseedhq/gaffer | python/GafferUITest/NoduleLayoutTest.py | 11 | 6511 | ##########################################################################
#
# Copyright (c) 2016, Image Engine Design 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:
#
# * Redistrib... | bsd-3-clause |
treefrogframework/FrameworkBenchmarks | toolset/utils/docker_helper.py | 7 | 15102 | import os
import socket
import json
import docker
import time
import re
import traceback
from threading import Thread
from colorama import Fore, Style
from toolset.utils.output_helper import log
from toolset.databases import databases
from psutil import virtual_memory
# total memory limit allocated for the test cont... | bsd-3-clause |
DhashS/scala_comp_robo_sign_detection | src/main/venv/lib/python3.5/site-packages/setuptools/command/py36compat.py | 130 | 4968 | import os
from glob import glob
from distutils.util import convert_path
from distutils.command import sdist
from six.moves import filter
class sdist_add_defaults:
"""
Mix-in providing forward-compatibility for functionality as found in
distutils on Python 3.7.
Do not edit the code in this class exce... | gpl-3.0 |
makinacorpus/libkml | examples/python/hellowalk.py | 25 | 3057 | #!/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:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list ... | bsd-3-clause |
rcbops/python-django-buildpackage | django/contrib/admindocs/views.py | 296 | 15504 | from django import template, templatetags
from django.template import RequestContext
from django.conf import settings
from django.contrib.admin.views.decorators import staff_member_required
from django.db import models
from django.shortcuts import render_to_response
from django.core.exceptions import ImproperlyConfigur... | bsd-3-clause |
atplanet/ansible-modules-extras | notification/mail.py | 44 | 10185 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2012 Dag Wieers <dag@wieers.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 Lice... | gpl-3.0 |
cchurch/ansible | lib/ansible/modules/cloud/azure/azure_rm_containerregistry.py | 8 | 14258 | #!/usr/bin/python
#
# Copyright (c) 2017 Yawei Wang, <yaweiw@microsoft.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 |
prutseltje/ansible | test/units/modules/network/onyx/test_onyx_protocols.py | 50 | 4685 | #
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.compat.tests.mock import patch
from ansible.modules.network.on... | gpl-3.0 |
xiaolvmu/villec2-kernel | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
Acehaidrey/incubator-airflow | airflow/api/common/experimental/trigger_dag.py | 8 | 4451 | #
# 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... | apache-2.0 |
webrecorder/warcio | test/test_capture_http_proxy.py | 1 | 7458 | from warcio.capture_http import capture_http
import threading
from wsgiref.simple_server import make_server, WSGIServer
import time
import requests
from warcio.archiveiterator import ArchiveIterator
from pytest import raises
# ==================================================================
class TestCaptureHttp... | apache-2.0 |
mwhooker/fleet | Documentation/examples/api.py | 27 | 2250 | #
# This file provides an example of a very simple client library written in Python.
# The client builds an interface for interacting with the fleet API, then retrieves
# a list of Units currently loaded into fleet.
#
# Warning: the code below is a significally simplified version of a typical client
# library. It is an... | apache-2.0 |
fedora-infra/anitya | anitya/tests/lib/backends/test_freshmeat.py | 1 | 4187 | # -*- coding: utf-8 -*-
#
# Copyright © 2014 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
# of the GNU General Public License v.2, or (at your option) any later
# version. This program is distributed in t... | gpl-2.0 |
endorphinl/horizon | openstack_dashboard/dashboards/project/vpn/workflows.py | 36 | 21869 | # Copyright 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 or agre... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.