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
mysteryemotionz/v20j-geeb
tools/perf/util/setup.py
4998
1330
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
gpl-2.0
h-mayorquin/camp_india_2016
tutorials/chemical switches/moose/neuroml/LIF/FvsI_LIF.py
3
2004
#!/usr/bin/python # -*- coding: utf-8 -*- ## all SI units ######################################################################################## ## Plot the firing rate vs current injection curve for a leaky integrate and fire neuron ## Author: Aditya Gilra ## Creation Date: 2012-06-08 ## Modification Date: 2012-06-0...
mit
vhaupert/mitmproxy
pathod/language/generators.py
7
2469
import os import string import random import mmap import sys DATATYPES = dict( ascii_letters=string.ascii_letters.encode(), ascii_lowercase=string.ascii_lowercase.encode(), ascii_uppercase=string.ascii_uppercase.encode(), digits=string.digits.encode(), hexdigits=string.hexdigits.encode(), octdi...
mit
RockySteveJobs/python-for-android
python-modules/twisted/twisted/manhole/telnet.py
81
3504
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """Telnet-based shell.""" # twisted imports from twisted.protocols import telnet from twisted.internet import protocol from twisted.python import log, failure # system imports import string, copy, sys from cStringIO import StringIO ...
apache-2.0
leiferikb/bitpop
depot_tools/third_party/logilab/common/daemon.py
15
3335
# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of logilab-common. # # logilab-common is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as publ...
gpl-3.0
tdubuffet/odysseus
vendor/doctrine/orm/docs/en/_exts/configurationblock.py
2577
3506
#Copyright (c) 2010 Fabien Potencier # #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, distrib...
gpl-2.0
alexcrichton/gyp
pylib/gyp/generator/gypsh.py
2779
1665
# Copyright (c) 2011 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. """gypsh output module gypsh is a GYP shell. It's not really a generator per se. All it does is fire up an interactive Python session with a few local variables...
bsd-3-clause
TeamJB/android_kernel_lge_hammerhead
tools/perf/scripts/python/sctop.py
11180
1924
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
cparawhore/ProyectoSubastas
site-packages/django/contrib/gis/tests/relatedapp/models.py
75
1786
from django.contrib.gis.db import models from django.utils.encoding import python_2_unicode_compatible class SimpleModel(models.Model): objects = models.GeoManager() class Meta: abstract = True app_label = 'relatedapp' @python_2_unicode_compatible class Location(SimpleModel): point = m...
mit
josherick/bokeh
bokeh/server/services.py
29
2719
from __future__ import absolute_import import json import os import signal import subprocess import sys class ManagedProcess(object): def __init__(self, args, name, pidfilename, stdout=None, stdin=None, stderr=None, kill_old=True): self.name = name self.pidfilenam...
bsd-3-clause
fbradyirl/home-assistant
homeassistant/components/mochad/light.py
1
4739
"""Support for X10 dimmer over Mochad.""" import logging import voluptuous as vol from homeassistant.components.light import ( ATTR_BRIGHTNESS, SUPPORT_BRIGHTNESS, Light, PLATFORM_SCHEMA, ) from homeassistant.components import mochad from homeassistant.const import CONF_NAME, CONF_PLATFORM, CONF_DEVIC...
apache-2.0
NickWoodhams/flask-admin
flask_admin/tests/sqla/test_multi_pk.py
46
5501
from nose.tools import eq_, ok_ from . import setup from .test_basic import CustomModelView from flask_sqlalchemy import Model from sqlalchemy.ext.declarative import declarative_base def test_multiple_pk(): # Test multiple primary keys - mix int and string together app, db, admin = setup() class Model(...
bsd-3-clause
keerts/home-assistant
homeassistant/components/envisalink.py
4
7683
""" Support for Envisalink devices. For more details about this component, please refer to the documentation at https://home-assistant.io/components/envisalink/ """ import logging import time import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.const import EVENT_HOMEASSISTA...
apache-2.0
JoErNanO/brianmodel
brianmodel/neuron/neuron.py
1
5023
#!/usr/bin/python # coding: utf-8 # ################################################################################# # Copyright (C) 2014 Francesco Giovannini, Neurosys - INRIA CR Nancy - Grand Est # Authors: Francesco Giovannini # email: francesco.giovannini@inria.fr # website: http://neurosys.loria.fr/ # Permission...
gpl-3.0
ronnyandersson/zignal
examples/ex_chunks.py
1
2576
''' Created on 12 Apr 2020 @author: Ronny Andersson (ronny@andersson.tk) @copyright: (c) 2020 Ronny Andersson @license: MIT Demo of how to iterate over an instance of the Audio class, for chunk-based processing. Typically the chunks have a size that is a power of two, for example 256, 1024 or 4096. In this example th...
mit
hnakamur/django-admin2
example/blog/tests/test_permissions.py
2
11225
from django.contrib.auth.models import User, Permission from django.core.urlresolvers import reverse from django.template import Template, Context from django.test import TestCase from django.test.client import RequestFactory import djadmin2 from djadmin2 import ModelAdmin2 from djadmin2.permissions import TemplatePer...
bsd-3-clause
meredith-digops/ansible
lib/ansible/modules/network/ovs/openvswitch_db.py
11
6161
#!/usr/bin/python # coding: utf-8 -*- # pylint: disable=C0111 # # (c) 2015, Mark Hamilton <mhamilton@vmware.com> # # Portions copyright @ 2015 VMware, Inc. # # This file is part of Ansible # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as...
gpl-3.0
modesttree/Projeny
Source/mtm/log/LogStreamConsole.py
1
4086
import os import re import sys from mtm.ioc.Inject import Inject import mtm.util.Util as Util from mtm.log.Logger import LogType import shutil from mtm.util.Assert import * import mtm.log.ColorConsole as ColorConsole class AnsiiCodes: BLACK = "\033[1;30m" DARKBLACK = "\033[0;30m" RED = "\033[1;31m" D...
mit
snewell/wlint
lib/wlint/wordcounter.py
2
1837
#!/usr/bin/python3 """Functions to count words.""" import re _RIGHT_SINGLE_QUOTE = "’" _PATTERN = re.compile(r"\b([\w\-\'{}]+)\b".format(_RIGHT_SINGLE_QUOTE)) def count_line(text): """ Count the number of words in a line. A word is defined as anything any combination of word characters (defined by...
bsd-2-clause
ofir123/CouchPotatoServer
libs/suds/store.py
204
18425
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will ...
gpl-3.0
j4/horizon
openstack_dashboard/dashboards/project/access_and_security/floating_ips/views.py
65
2958
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # Copyright (c) 2012 X.commerce, a business unit of eBay Inc. # # Licensed under the Apache License, Version 2.0 (the "License")...
apache-2.0
xrg/django-static-gitified
tests/regressiontests/templates/unicode.py
84
1290
# -*- coding: utf-8 -*- from django.template import Template, TemplateEncodingError, Context from django.utils.safestring import SafeData from django.utils.unittest import TestCase class UnicodeTests(TestCase): def test_template(self): # Templates can be created from unicode strings. t1 = Template...
bsd-3-clause
midma101/AndIWasJustGoingToBed
.venv/lib/python2.7/site-packages/Crypto/Random/__init__.py
126
1669
# -*- coding: utf-8 -*- # # Random/__init__.py : PyCrypto random number generation # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to ...
mit
TRESCLOUD/odoopub
extra-addons/sale_journal_sequence/sale.py
4
1720
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 Cubic ERP - Teradata SAC (<http://cubicerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the ...
agpl-3.0
HopeFOAM/HopeFOAM
ThirdParty-0.1/ParaView-5.0.1/VTK/Filters/Sources/Testing/Python/TestButtonSource.py
20
2447
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # Test the button source # The image to map on the button r = vtk.vtkJPEGReader() r.SetFileName(VTK_DATA_ROOT + "/Data/beach.jpg") r.Update() t = vtk.vtkTexture() t.SetInputConnectio...
gpl-3.0
MinimalOS/external_skia
tools/git_utils.py
68
5453
# Copyright 2014 Google Inc. # # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Module to host the ChangeGitBranch class and test_git_executable function. """ import os import subprocess import misc_utils class ChangeGitBranch(object): """Class to manage ...
bsd-3-clause
51reboot/actual_09_homework
10/jinderui/cmdb/user/dbutils.py
1
1788
# encoding: utf-8 import os,sys reload(sys) sys.setdefaultencoding( "utf-8" ) import gconf import MySQLdb # encoding: utf-8 import os,sys reload(sys) sys.setdefaultencoding( "utf-8" ) import gconf import MySQLdb class MySQLConnection(object): """docstring for MySQLConnection""" def __init__(self, host,port,user,pas...
mit
JohnGeorgiadis/x-formation-test-sample
node_modules/lite-server/node_modules/browser-sync/node_modules/socket.io/node_modules/engine.io/node_modules/engine.io-parser/node_modules/utf8/tests/generate-test-data.py
1788
1435
#!/usr/bin/env python import re import json # https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae # http://stackoverflow.com/a/13436167/96656 def unisymbol(codePoint): if codePoint >= 0x0000 and codePoint <= 0xFFFF: return unichr(codePoint) elif codePoint >= 0x010000 and codePoint <= 0x10FFFF: ...
mit
pjryan126/solid-start-careers
store/api/glassdoor/venv/lib/python2.7/site-packages/pip/_vendor/html5lib/tokenizer.py
1710
76929
from __future__ import absolute_import, division, unicode_literals try: chr = unichr # flake8: noqa except NameError: pass from collections import deque from .constants import spaceCharacters from .constants import entities from .constants import asciiLetters, asciiUpper2Lower from .constants import digits, ...
gpl-2.0
abomyi/django
tests/lookup/tests.py
20
37757
from __future__ import unicode_literals import collections from datetime import datetime from operator import attrgetter from unittest import skipUnless from django.core.exceptions import FieldError from django.db import connection from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature from .mode...
bsd-3-clause
bioinformatics-ua/catalogue
emif/population_characteristics/conf_aggregations.py
2
9739
# -*- coding: utf-8 -*- # Copyright (C) 2014 Universidade de Aveiro, DETI/IEETA, Bioinformatics Group - http://bioinformatics.ua.pt/ # # 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 vers...
gpl-3.0
mcgachey/edx-platform
common/djangoapps/geoinfo/tests/test_middleware.py
137
5217
""" Tests for CountryMiddleware. """ from mock import patch import pygeoip from django.contrib.sessions.middleware import SessionMiddleware from django.test import TestCase from django.test.client import RequestFactory from geoinfo.middleware import CountryMiddleware from student.tests.factories import UserFactory, A...
agpl-3.0
Vudentz/zephyr
scripts/west_commands/tests/test_stm32flash.py
2
3707
# Copyright (c) 2019 Thomas Kupper # # SPDX-License-Identifier: Apache-2.0 import argparse import os import platform from unittest.mock import patch, call import pytest from runners.stm32flash import Stm32flashBinaryRunner from conftest import RC_KERNEL_BIN TEST_CMD = 'stm32flash' TEST_DEVICE = '/dev/ttyUSB0' if p...
apache-2.0
googleapis/googleapis-gen
google/cloud/tasks/v2beta3/tasks-v2beta3-py/scripts/fixup_tasks_v2beta3_keywords.py
2
6744
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
apache-2.0
WebSpider/headphones
lib/bs4/builder/_htmlparser.py
71
9102
"""Use the HTMLParser library to parse HTML files that aren't too bad.""" __all__ = [ 'HTMLParserTreeBuilder', ] from HTMLParser import HTMLParser try: from HTMLParser import HTMLParseError except ImportError, e: # HTMLParseError is removed in Python 3.5. Since it can never be # thrown in 3.5, we...
gpl-3.0
heracek/django-nonrel
tests/regressiontests/i18n/commands/extraction.py
1
6442
import os import re import shutil from django.test import TestCase from django.core import management LOCALE='de' class ExtractorTests(TestCase): PO_FILE='locale/%s/LC_MESSAGES/django.po' % LOCALE def setUp(self): self._cwd = os.getcwd() self.test_dir = os.path.abspath(os.path.dirname(__file...
bsd-3-clause
arnavd96/Cinemiezer
myvenv/lib/python3.4/site-packages/pip/cmdoptions.py
361
9507
""" shared options and groups The principle here is to define options once, but *not* instantiate them globally. One reason being that options with action='append' can carry state between parses. pip parse's general options twice internally, and shouldn't pass on state. To be consistent, all options will follow this d...
mit
40223113/0623-w17
static/Brython3.1.1-20150328-091302/Lib/_abcoll.py
688
5155
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Abstract Base Classes (ABCs) for collections, according to PEP 3119. DON'T USE THIS MODULE DIRECTLY! The classes here should be imported via collections; they are defined here only to alleviate certain bootstrappin...
gpl-3.0
crewrktablets/rk29_kernel_2.6
arch/ia64/scripts/unwcheck.py
916
1718
#!/usr/bin/env python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthe...
gpl-2.0
Itxaka/st2
st2api/st2api/controllers/v1/executionviews.py
1
3355
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
apache-2.0
Comunitea/alimentacion
stock_block_prodlots/wizard/wizard_block_prodlots.py
5
4542
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2011 Pexego (<www.pexego.es>). All Rights Reserved # $Omar Castiñeira Saavedra$ # # This program is free software: you can redistribute it ...
agpl-3.0
liavkoren/djangoDev
django/core/management/commands/shell.py
67
4163
from optparse import make_option import os from django.core.management.base import NoArgsCommand class Command(NoArgsCommand): shells = ['ipython', 'bpython'] option_list = NoArgsCommand.option_list + ( make_option('--plain', action='store_true', dest='plain', help='Tells Django to use p...
bsd-3-clause
alexcoman/labs
python/solutii/micu_matei/paranteze/paranteze.py
5
1751
#!/usr/bin/env python # *-* coding: UTF-8 *-* """Tuxy scrie în fiecare zi foarte multe formule matematice. Pentru că formulele sunt din ce în ce mai complicate trebuie să folosească o serie de paranteze și a descoperit că cea mai frecventă problemă a lui este că nu toate parantezele sunt folosite cum trebuie. Pentru...
mit
Piasy/proxy-searcher
site-packages/django/contrib/admin/actions.py
98
3205
""" Built-in, globally-available admin actions. """ from django.core.exceptions import PermissionDenied from django.contrib.admin import helpers from django.contrib.admin.util import get_deleted_objects, model_ngettext from django.db import router from django.template.response import TemplateResponse from django.utils...
mit
teeple/pns_server
work/install/Python-2.7.4/Demo/tkinter/guido/dialog.py
47
3202
#! /usr/bin/env python # A Python function that generates dialog boxes with a text message, # optional bitmap, and any number of buttons. # Cf. Ousterhout, Tcl and the Tk Toolkit, Figs. 27.2-3, pp. 269-270. from Tkinter import * import sys def dialog(master, title, text, bitmap, default, *args): # 1. Create th...
gpl-2.0
40223234/2015cdb_g1_0134
static/Brython3.1.1-20150328-091302/Lib/fnmatch.py
894
3163
"""Filename matching with shell patterns. fnmatch(FILENAME, PATTERN) matches according to the local convention. fnmatchcase(FILENAME, PATTERN) always takes case in account. The functions operate by translating the pattern into a regular expression. They cache the compiled regular expressions for speed. The function...
gpl-3.0
jyotikamboj/container
django/contrib/auth/management/__init__.py
9
6413
""" Creates permissions for all installed apps that need permissions. """ from __future__ import unicode_literals import getpass import unicodedata from django.apps import apps from django.contrib.auth import get_permission_codename from django.core import exceptions from django.core.management.base import CommandErr...
mit
JDRomano2/VenomKB
venomkb/archive/scripts/add_go_data.py
1
1105
import json from tqdm import tqdm from venomkb_builder import VenomKB VKB = VenomKB() VKB.load_database() go_annotations_out = {} for x in tqdm(VKB.proteins): try: toxprot = VKB.get_record_from_toxprot(x.venomkb_id, 'dbReference', json=False) except: continue go_annotations = [y for y in...
gpl-2.0
tesb/flask-crystal
venv/Lib/ntpath.py
127
18457
# Module 'ntpath' -- common operations on WinNT/Win95 pathnames """Common pathname manipulations, WindowsNT/95 version. Instead of importing this module directly, import os and refer to this module as os.path. """ import os import sys import stat import genericpath import warnings from genericpath import * __all__ ...
apache-2.0
aecepoglu/twitchy-streamer-python
test/steps/all.py
1
4759
from behave import * from unittest.mock import patch, mock_open, MagicMock from src import arg_parser as myArgParser, server_utils as myServerUtils, errors as myErrors import io import requests import requests_mock def setup_debug_on_error(userdata): global BEHAVE_DEBUG_ON_ERROR BEHAVE_DEBUG_ON_ERROR = userdata.getb...
mit
evanson/yowsup
yowsup/layers/protocol_contacts/protocolentities/notification_contact_update.py
68
1295
from yowsup.structs import ProtocolTreeNode from .notification_contact import ContactNotificationProtocolEntity class UpdateContactNotificationProtocolEntity(ContactNotificationProtocolEntity): ''' <notification offline="0" id="{{NOTIFICATION_ID}}" notify="{{NOTIFY_NAME}}" type="contacts" t="{{TIME...
gpl-3.0
TarasRudnyk/scrapy
scrapy/linkextractors/htmlparser.py
90
2883
""" HTMLParser-based link extractor """ import warnings from six.moves.html_parser import HTMLParser from six.moves.urllib.parse import urljoin from w3lib.url import safe_url_string from scrapy.link import Link from scrapy.utils.python import unique as unique_list from scrapy.exceptions import ScrapyDeprecationWarni...
bsd-3-clause
amisrs/angular-flask
angular_flask/lib/python2.7/site-packages/flask/helpers.py
776
33793
# -*- coding: utf-8 -*- """ flask.helpers ~~~~~~~~~~~~~ Implements various helpers. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os import sys import pkgutil import posixpath import mimetypes from time import time from zlib import adler32 from th...
mit
arthurprs/aerospike-client-python
examples/admin/grant_roles.py
2
3922
# -*- coding: utf-8 -*- ################################################################################ # Copyright 2013-2015 Aerospike, 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 ...
apache-2.0
walteryang47/ovirt-engine
packaging/setup/plugins/ovirt-engine-common/base/core/postinstall.py
8
3048
# # ovirt-engine-setup -- ovirt engine setup # Copyright (C) 2013-2015 Red Hat, 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 # # Unl...
apache-2.0
minhnd/youtube-subtitle-downloader
youtubesub.py
1
5521
# -*- coding: utf-8 -*- """ Youtube Subtitle Downloader downloads subtitles from Youtube videos (if those are present) and convert them to SRT format. Usage: youtubesub.py [-h] [-l] [--language LANGUAGE] [--filename FILENAME] [--filetype {srt,xml}] url ...
bsd-2-clause
xclxxl414/rqalpha
rqalpha/mod/rqalpha_mod_sys_risk/price_validator.py
3
1892
# -*- coding: utf-8 -*- # # Copyright 2017 Ricequant, 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 ...
apache-2.0
tcharding/kubernetes
hack/verify-flags-underscore.py
205
4659
#!/usr/bin/env python # Copyright 2015 The Kubernetes Authors. # # 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
scollis/iris
lib/iris/tests/unit/plot/test_points.py
1
1395
# (C) British Crown Copyright 2014, Met Office # # This file is part of Iris. # # Iris 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 the License, or # (at your option) any later ve...
gpl-3.0
SteveHNH/ansible
lib/ansible/modules/cloud/ovirt/ovirt_tags.py
75
7807
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat, Inc. # # 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 #...
gpl-3.0
benjaminjkraft/django
tests/middleware/test_security.py
291
7781
from django.http import HttpResponse from django.test import RequestFactory, SimpleTestCase from django.test.utils import override_settings class SecurityMiddlewareTest(SimpleTestCase): @property def middleware(self): from django.middleware.security import SecurityMiddleware return SecurityMid...
bsd-3-clause
mjg2203/edx-platform-seas
lms/djangoapps/courseware/management/commands/tests/test_dump_course.py
16
7249
"""Tests for Django management commands""" import json import shutil from StringIO import StringIO import tarfile from tempfile import mkdtemp from path import path from django.core.management import call_command from django.test.utils import override_settings from django.test.testcases import TestCase from coursew...
agpl-3.0
JackPrice/ansible-modules-extras
cloud/amazon/cloudtrail.py
8
8416
#!/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 distributed...
gpl-3.0
thomasorb/orb
orb/utils/io.py
1
33933
#!/usr/bin/python # *-* coding: utf-8 *-* # Author: Thomas Martin <thomas.martin.1@ulaval.ca> # File: io.py ## Copyright (c) 2010-2020 Thomas Martin <thomas.martin.1@ulaval.ca> ## ## This file is part of ORB ## ## ORB is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Pub...
gpl-3.0
TeslaProject/external_chromium_org
tools/perf/page_sets/polymer.py
29
8930
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module class PolymerPage(page_module.Page): def __init__(se...
bsd-3-clause
GalenMa/kolla
kolla/tests/test_hacking.py
8
1714
# Copyright 2016 GohighSec # # 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
kvar/ansible
lib/ansible/modules/network/f5/bigip_wait.py
38
11246
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
resmo/ansible
lib/ansible/plugins/terminal/frr.py
47
2237
# # (c) 2018 Red Hat Inc. # # 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 d...
gpl-3.0
gfyoung/elasticsearch
dev-tools/get-bwc-version.py
100
3106
# Licensed to Elasticsearch under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use this file except...
apache-2.0
FlorianLudwig/odoo
addons/account_bank_statement_extensions/report/__init__.py
415
1128
# -*- 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
wyom/sympy
sympy/physics/quantum/innerproduct.py
116
4261
"""Symbolic inner product.""" from __future__ import print_function, division from sympy import Expr, conjugate from sympy.printing.pretty.stringpict import prettyForm from sympy.physics.quantum.dagger import Dagger from sympy.physics.quantum.state import KetBase, BraBase __all__ = [ 'InnerProduct' ] # InnerPr...
bsd-3-clause
bhcopeland/ansible-modules-extras
cloud/vmware/vmware_dvs_host.py
71
8335
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Joseph Callen <jcallen () csc.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Li...
gpl-3.0
quarckster/cfme_tests
cfme/test_framework/appliance_police.py
1
2826
import attr import pytest import requests from cfme.utils import ports from cfme.utils.net import net_check from cfme.utils.wait import TimedOutError from cfme.utils.conf import rdb from fixtures.pytest_store import store from cfme.fixtures.rdb import Rdb @attr.s class AppliancePoliceException(Exception): me...
gpl-2.0
alheinecke/tensorflow-xsmm
tensorflow/contrib/tensor_forest/python/ops/data_ops.py
36
6976
# 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
auferack08/edx-platform
common/djangoapps/microsite_configuration/middleware.py
56
1212
""" This file implements the Middleware support for the Open edX platform. A microsite enables the following features: 1) Mapping of sub-domain name to a 'brand', e.g. foo-university.edx.org 2) Present a landing page with a listing of courses that are specific to the 'brand' 3) Ability to swap out some branding elemen...
agpl-3.0
ErasRasmuson/LA
LogAna/Taxi_LongRides_old.py
1
2578
# -*- coding: cp1252 -*- """ ############################################################################### HEADER: Taxi_LongRides.py AUTHOR: Esa Heikkinen DATE: 26.06.2018 DOCUMENT: - VERSION: "$Id$" REFERENCES: - PURPOSE: CHANGES: "$Log$" #######################################################...
gpl-3.0
edlabh/SickRage
lib/requests/packages/chardet/mbcharsetprober.py
2924
3268
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
gpl-3.0
FEniCS/ufl
test/test_apply_function_pullbacks.py
1
12156
#!/usr/bin/env py.test # -*- coding: utf-8 -*- from pytest import raises from ufl import * from ufl.algorithms.apply_function_pullbacks import apply_function_pullbacks, apply_single_function_pullbacks from ufl.algorithms.renumbering import renumber_indices from ufl.classes import Jacobian, JacobianInverse, JacobianDet...
lgpl-3.0
ovnicraft/odoo
addons/portal_project/tests/__init__.py
260
1086
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
fbradyirl/home-assistant
homeassistant/components/spc/alarm_control_panel.py
2
3187
"""Support for Vanderbilt (formerly Siemens) SPC alarm systems.""" import logging import homeassistant.components.alarm_control_panel as alarm from homeassistant.const import ( STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_NIGHT, STATE_ALARM_DISARMED, STATE_ALARM_TRIGGERED, ) fr...
apache-2.0
bubenkoff/Arkestra
vacancies_and_studentships/tests.py
1
22863
from datetime import datetime, timedelta from django.test import TestCase from django.test.client import Client from django.test.utils import override_settings from django.conf import settings from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.http import HttpRequest,...
bsd-2-clause
t794104/ansible
lib/ansible/modules/network/fortios/fortios_firewall_local_in_policy6.py
24
11300
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # 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 Lic...
gpl-3.0
jayceyxc/hue
desktop/core/ext-py/pysaml2-2.4.0/src/saml2/extension/dri.py
37
13082
#!/usr/bin/env python # # Generated Mon Oct 25 16:19:28 2010 by parse_xsd.py version 0.4. # import saml2 from saml2 import SamlBase from saml2 import md NAMESPACE = 'urn:oasis:names:tc:SAML:2.0:metadata:dri' class CreationInstant(SamlBase): """The urn:oasis:names:tc:SAML:2.0:metadata:dri:CreationInstant eleme...
apache-2.0
aspidites/django
tests/save_delete_hooks/models.py
409
1030
""" Adding hooks before/after saving and deleting To execute arbitrary code around ``save()`` and ``delete()``, just subclass the methods. """ from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Person(...
bsd-3-clause
nrejack/research-subject-mapper
bin/utils/emailsender.py
2
2560
import smtplib, os, logging from email.MIMEMultipart import MIMEMultipart from email.MIMEBase import MIMEBase from email.MIMEText import MIMEText from email.Utils import COMMASPACE, formatdate from email import Encoders class EmailProps(): """ Plain Old Data Storage class used for passing email properties ...
bsd-3-clause
1orwell/yrs2013
fake.py
1
3440
'''Generate necessary dump files''' #options size = 100 regenerate_graph = False days = 1 force_layout = False default = str(size)+'.dat' ### import igraph, pickle, random, os import math from collections import OrderedDict def process(fout): output = os.path.join('data',fout) try: #load graph if...
mit
frankk00/realtor
common/display.py
34
7057
# Copyright 2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
bsd-3-clause
iulian787/spack
var/spack/repos/builtin/packages/swftools/package.py
5
1166
# 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 Swftools(AutotoolsPackage): """SWFTools is a collection of utilities for working with Ado...
lgpl-2.1
xin3liang/platform_external_chromium-trace
trace-viewer/third_party/closure_linter/closure_linter/requireprovidesorter_test.py
135
2357
#!/usr/bin/env python # # Copyright 2012 The Closure Linter 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 #...
bsd-3-clause
Ms2ger/servo
tests/wpt/css-tests/tools/html5lib/html5lib/tests/test_encoding.py
445
2228
from __future__ import absolute_import, division, unicode_literals import os import unittest try: unittest.TestCase.assertEqual except AttributeError: unittest.TestCase.assertEqual = unittest.TestCase.assertEquals from .support import get_data_files, TestData, test_dir, errorMessage from html5lib import HTML...
mpl-2.0
shtouff/django
django/conf/locale/id/formats.py
504
2135
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j N Y' DATETIME_FORMAT = "j N Y, ...
bsd-3-clause
wangyum/spark
python/pyspark/resource/profile.py
22
7113
# # 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 us...
apache-2.0
abenzbiria/clients_odoo
openerp/tools/float_utils.py
151
9267
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
agpl-3.0
leiferikb/bitpop
build/third_party/twisted_10_2/twisted/words/test/test_basesupport.py
55
3066
# Copyright (c) 2001-2006 Twisted Matrix Laboratories. # See LICENSE for details. from twisted.trial import unittest from twisted.words.im import basesupport from twisted.internet import error, defer class DummyAccount(basesupport.AbstractAccount): """ An account object that will do nothing when asked to star...
gpl-3.0
scwhitehouse/rose
lib/python/rose/scheme_handler.py
2
5011
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # (C) British Crown Copyright 2012-7 Met Office. # # This file is part of Rose, a framework for meteorological suites. # # Rose is free software: you can redistribute it and/or modify # it under the terms of the GNU ...
gpl-3.0
pamfilos/invenio
modules/bibrank/lib/bibrank_tag_based_indexer.py
13
20833
# -*- coding: utf-8 -*- ## Ranking of records using different parameters and methods. ## This file is part of Invenio. ## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010, 2011, 2012 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as #...
gpl-2.0
DNESS/cocos2d-js
templates/js-template-default/frameworks/runtime-src/proj.android/build_native.py
43
5988
#!/usr/bin/python ''' build_native.py This script will copy resources to assets and build native code with NDK. ''' import sys import os, os.path import shutil from optparse import OptionParser def get_num_of_cpu(): ''' The build process can be accelerated by running multiple concurrent job processes using the -...
mit
sparkslabs/kamaelia_
Sketches/TG/old_shard/cshard/cshardtest.py
3
3556
# -*- 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 License, Version 2.0 (the "Lic...
apache-2.0
gaqzi/ansible-modules-extras
web_infrastructure/jira.py
8
10111
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Steve Smith <ssmith@atlassian.com> # Atlassian open-source approval reference OSR-76. # # 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 ...
gpl-3.0
bertucho/moviestalk
venv/Lib/site-packages/gunicorn/app/djangoapp.py
24
5026
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. import os import sys from gunicorn.app.base import Application from gunicorn import util def is_setting_mod(path): return (os.path.isfile(os.path.join(path, "settings.py")) or ...
mit