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 |
|---|---|---|---|---|---|
ecederstrand/django | django/utils/feedgenerator.py | 155 | 17772 | """
Syndication feed generation library -- used for generating RSS, etc.
Sample usage:
>>> from django.utils import feedgenerator
>>> feed = feedgenerator.Rss201rev2Feed(
... title="Poynter E-Media Tidbits",
... link="http://www.poynter.org/column.asp?id=31",
... description="A group Weblog by the sharpes... | bsd-3-clause |
ol-loginov/intellij-community | plugins/hg4idea/testData/bin/hgext/largefiles/proto.py | 92 | 6820 | # Copyright 2011 Fog Creek Software
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import os
import urllib2
from mercurial import error, httppeer, util, wireproto
from mercurial.wireproto import batchable, future
from mercurial.... | apache-2.0 |
amyvmiwei/kbengine | kbe/res/scripts/common/Lib/tkinter/test/test_tkinter/test_text.py | 12 | 1479 | import unittest
import tkinter
from test.support import requires, run_unittest
from tkinter.ttk import setup_master
requires('gui')
class TextTest(unittest.TestCase):
def setUp(self):
self.root = setup_master()
self.text = tkinter.Text(self.root)
def tearDown(self):
self.text.destroy... | lgpl-3.0 |
illfelder/libcloud | libcloud/test/common/test_cloudstack.py | 8 | 7292 | # 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 use ... | apache-2.0 |
sergafts/django-registration | registration/models.py | 2 | 23968 | from __future__ import unicode_literals
import datetime
import hashlib
import random
import re
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.exceptions import ImproperlyConfigured
from django.core.exceptions import ObjectDoesNotExist
from django.core.mail import EmailM... | bsd-3-clause |
yongtang/tensorflow | tensorflow/python/ops/ragged/ragged_getitem_test.py | 6 | 26711 | # Copyright 2018 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 |
tejesh95/Zubio.in | zubio/allauth/socialaccount/providers/twitter/views.py | 64 | 1493 | import json
from allauth.socialaccount.providers.oauth.client import OAuth
from allauth.socialaccount.providers.oauth.views import (OAuthAdapter,
OAuthLoginView,
OAuthCallbackView)
from .provider import T... | mit |
Unode/ete | ete3/test/test_treeview/item_faces.py | 3 | 4163 | # To play with random colors
import colorsys
import random
from ... import Tree, faces, TreeStyle, NodeStyle, Face
# We will need to create Qt4 items
from ...treeview.qt import QtCore, Qt
from ...treeview.qt import QGraphicsRectItem, QGraphicsSimpleTextItem, \
QGraphicsEllipseItem, QColor, QPen, QBrush
class Int... | gpl-3.0 |
hitdong/pyvision | src/pyvision/other/distance.py | 4 | 3623 | # PyVision License
#
# Copyright (c) 2006-2008 David S. Bolme
# 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, thi... | bsd-3-clause |
poljeff/odoo | addons/base_action_rule/test_models.py | 333 | 1131 | from openerp.osv import fields, osv
from openerp import api
AVAILABLE_STATES = [
('draft', 'New'),
('cancel', 'Cancelled'),
('open', 'In Progress'),
('pending', 'Pending'),
('done', 'Closed')
]
class lead_test(osv.Model):
_name = "base.action.rule.lead.test"
_columns = {
'name': f... | agpl-3.0 |
RenderBroken/SHAMU-kernel | 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 |
yencarnacion/jaikuengine | .google_appengine/lib/django-1.4/django/contrib/localflavor/uy/forms.py | 87 | 2143 | # -*- coding: utf-8 -*-
"""
UY-specific form helpers.
"""
from __future__ import absolute_import
from django.core.validators import EMPTY_VALUES
from django.forms.fields import Select, RegexField
from django.forms import ValidationError
from django.utils.translation import ugettext_lazy as _
from django.contrib.local... | apache-2.0 |
havard024/prego | venv/lib/python2.7/site-packages/south/tests/inspector.py | 142 | 3896 |
from south.tests import Monkeypatcher, skipUnless
from south.modelsinspector import (convert_on_delete_handler, get_value,
IsDefault, models, value_clean)
from fakeapp.models import HorribleModel, get_sentinel_object
on_delete_is_available = hasattr(models, "PROTECT") # models here is django.db.models
skipUnles... | mit |
zangruizhe/YouCompleteMe_install_for_centos_6.6 | python/ycm/client/completion_request.py | 11 | 3219 | #!/usr/bin/env python
#
# Copyright (C) 2013 Google Inc.
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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 you... | gpl-3.0 |
dkamotsky/program-y | src/programy/brain.py | 1 | 12686 | """
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 |
Inmersa/Utilities | crontab/inmersa/scheduler/__init__.py | 1 | 25463 | __author__="tite"
__date__ ="$Jul 18, 2014 7:48:18 AM$"
import os
import sys
import string
import datetime
import traceback
from types import *
import ConfigParser
import smtplib
import logging
import logging.config
import extractors
import formatters
from email.MIMEMultipart import MIMEMultipart
from email.MIMETex... | gpl-2.0 |
hellais/nemesys-qos | nemesys/ipcalc_test.py | 9 | 2782 | '''
Created on 26/05/2014
@author: Elin Wedlund
Unit test of ipcalc
'''
import unittest
import ipcalc
class IpcalcTests(unittest.TestCase):
def test_happycase(self):
ipaddress = "192.168.112.12"
netmask = 24
ips = ipcalc.Network('%s/%d' % (ipaddress, netmask))
net = ips.net... | gpl-3.0 |
wbyne/QGIS | python/plugins/processing/modeler/RasterLayerBoundsAlgorithm.py | 3 | 3067 | # -*- coding: utf-8 -*-
"""
***************************************************************************
RasterLayerBoundsAlgorithm.py
---------------------
Date : January 2013
Copyright : (C) 2013 by Victor Olaya
Email : volayaf at gmail dot com
***********... | gpl-2.0 |
kreatorkodi/repository.torrentbr | script.module.urlresolver/lib/urlresolver/plugins/novamov.py | 10 | 2240 | """
urlresolver XBMC Addon
Copyright (C) 2011 t0mm0
Updated by alifrezser (c) 2016
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 ... | gpl-2.0 |
small-yellow-rice/qt | quokka_themes/__init__.py | 1 | 18620 | # -*- coding: utf-8 -*-
"""
Quokka-Themes
=============
This provides infrastructure for theming support in your Quokka applications.
It takes care of:
- Loading themes
- Rendering their templates
- Serving their static media
- Letting themes reference their templates and static media
:based in: 2013 Christopher Car... | mit |
sushantgoel/Flask | Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/setuptools/sandbox.py | 221 | 9994 | import os
import sys
import tempfile
import operator
import functools
import itertools
import re
import pkg_resources
if os.name == "java":
import org.python.modules.posix.PosixModule as _os
else:
_os = sys.modules[os.name]
try:
_file = file
except NameError:
_file = None
_open = open
from distutils.e... | apache-2.0 |
lckung/spark-ec2 | launch-script/lib/boto-2.34.0/boto/ec2/cloudwatch/metric.py | 94 | 7491 | # Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# 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 wi... | apache-2.0 |
Disguisenberg/Metastasis-Framework | template/template.py | 1 | 2293 | import ctypes
# ctypes makes it very simple to interact with the Windows API in a python script,so it will be a required import for this script. It provides C compatible data types and allows calling functions in DLLs or shared libraries
shellcode = (
);
# Shellcode - This is the shellcode that will be injected into me... | mit |
JudoWill/glue | glue/core/tree.py | 1 | 9288 | from __future__ import absolute_import, division, print_function
import numpy as np
__all__ = ['Tree', 'NewickTree', 'DendroMerge']
class Tree(object):
"""
Base class for hierarchical segmentations of data sets.
The tree is represented by its root node, which contains reference
to 0 or more childre... | bsd-3-clause |
lemieuxl/pyGenClean | pyGenClean/__init__.py | 1 | 1723 |
# This file is part of pyGenClean.
#
# pyGenClean 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.
#
# pyGenClean is distributed in the... | gpl-3.0 |
pwong-mapr/private-hue | desktop/core/ext-py/Pygments-1.3.1/pygments/lexers/templates.py | 56 | 45116 | # -*- coding: utf-8 -*-
"""
pygments.lexers.templates
~~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for various template engines' markup.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexers.web import \
PhpLexer, H... | apache-2.0 |
trevor/calendarserver | calendarserver/tools/shell/cmd.py | 1 | 21936 | ##
# Copyright (c) 2011-2014 Apple 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 l... | apache-2.0 |
robclark/chromium | media/tools/constrained_network_server/traffic_control.py | 186 | 12569 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Traffic control library for constraining the network configuration on a port.
The traffic controller sets up a constrained network configuration on a... | bsd-3-clause |
sckasturi/saltlake | commands/creffett.py | 1 | 1622 | # Copyright (C) 2013-2014 Fox Wilson, Peter Foley, Srijay Kasturi, Samuel Damashek, James Forcier and Reed Koser
#
# 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 Licen... | gpl-2.0 |
SebasSBM/django | django/conf/locale/lv/formats.py | 504 | 1906 | # -*- 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 = r'Y. \g\a\d\a j. F'
TIME_FORMAT = ... | bsd-3-clause |
ZHAW-INES/rioxo-uClinux-dist | user/python/python-2.4.4/Tools/scripts/byteyears.py | 100 | 1638 | #! /usr/bin/env python
# Print the product of age and size of each file, in suitable units.
#
# Usage: byteyears [ -a | -m | -c ] file ...
#
# Options -[amc] select atime, mtime (default) or ctime as age.
import sys, os, time
from stat import *
def main():
# Use lstat() to stat files if it exists, else stat()
... | gpl-2.0 |
CG-F16-16-Rutgers/steersuite-rutgers | steerstats/unit_tests/ORCATester.py | 8 | 2519 | import random
import unittest
import sys
sys.path.append("../")
from steerstats.SteerStats import SteerStats
from steersuite.SteerStatsOptions import getOptions
class ORCATester(unittest.TestCase):
def setUp(self):
self.seq = list(range(10))
@unittest.skip("demonstrating skipping")
def test_skip... | gpl-3.0 |
thomasrogers03/phantomjs | src/qt/qtwebkit/Tools/TestResultServer/model/jsonresults.py | 121 | 14752 | # Copyright (C) 2010 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 |
IntegratedAlarmSystem-Group/ias | CompElement/src/main/python/IasTransferFunction/TransferFunction.py | 1 | 4513 | import logging
class TransferFunction(object):
'''
Base (and abstract) class to provide TFs in python programming language.
Usage: python TF implementations must extend this class and provide, as a minimum,
the implementation of the transfer method.
It is the python equivalent of the JavaTransfer... | lgpl-3.0 |
bamueh/dark-matter | dark/fasta.py | 2 | 18300 | from six import PY3
from hashlib import md5
import sqlite3
import os
from Bio import SeqIO, bgzf
from pyfaidx import Fasta
from dark.reads import Reads, DNARead
from dark.utils import asHandle
def fastaToList(fastaFilename):
return list(SeqIO.parse(fastaFilename, 'fasta'))
def dedupFasta(reads):
"""
R... | mit |
ewindisch/nova | nova/virt/hyperv/hostops.py | 16 | 6175 | # Copyright 2012 Cloudbase Solutions Srl
# 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 |
jdemon519/cfme_tests | cfme/cloud/provider/azure.py | 2 | 1995 | from . import CloudProvider
from utils.version import pick
from mgmtsystem.azure import AzureSystem
class AzureProvider(CloudProvider):
type_name = "azure"
mgmt_class = AzureSystem
db_types = ["Azure::CloudManager"]
def __init__(self, name=None, credentials=None, zone=None, key=None, region=None,
... | gpl-2.0 |
MphasisWyde/eWamSublimeAdaptor | POC/v0_4_POC_with_generic_cmd_and_swagger/third-party/jsonschema/tests/test_validators.py | 21 | 33210 | from collections import deque
from contextlib import contextmanager
import json
from jsonschema import FormatChecker, ValidationError
from jsonschema.tests.compat import mock, unittest
from jsonschema.validators import (
RefResolutionError, UnknownType, Draft3Validator,
Draft4Validator, RefResolver, create, ex... | mit |
ajportier/djauction | models.py | 1 | 3333 | from django.db import models
STATE_CHOICES = (
('pa', 'Pennsylvania'),
('nj', 'New Jersey'),
)
ITEM_CHOICES = (
('event','Event'),
('food','Food'),
('goods','Goods'),
('service','Service'),
('other','Other'),
)
PAYMENT_CHOICES = (
('none','None'),
('cash','Cash'),
('check','Ch... | gpl-3.0 |
heprom/pymicro | pymicro/external/YappsStarParser_2_0.py | 1 | 21486 | # To maximize python3/python2 compatibility
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from .StarFile import StarBlock,StarFile,StarList,StarDict
from io import StringIO
# An alternative specification for the Cif ... | mit |
applidget/zxing-ios | cpp/scons/scons-local-2.0.0.final.0/SCons/Tool/ilink.py | 34 | 2132 | """SCons.Tool.ilink
Tool-specific initialization for the OS/2 ilink linker.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SC... | apache-2.0 |
mollstam/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/PyChart-1.39/pychart/pngcanvas.py | 12 | 1826 | #
# Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com)
#
# Jockey 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, or (at your option) any
# later version.
#
# Jockey is distr... | mit |
pgmillon/ansible | lib/ansible/modules/web_infrastructure/ansible_tower/tower_organization.py | 38 | 2768 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2017, Wayne Witzel III <wayne@riotousliving.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 |
midma101/AndIWasJustGoingToBed | .venv/lib/python2.7/site-packages/Crypto/PublicKey/DSA.py | 123 | 13695 | # -*- coding: utf-8 -*-
#
# PublicKey/DSA.py : DSA signature primitive
#
# 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 the public d... | mit |
dafrito/trac-mirror | trac/wiki/tests/wikisyntax.py | 1 | 35299 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2013 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#
# This software consi... | bsd-3-clause |
organocoin/organocoin | contrib/bitrpc/bitrpc.py | 22 | 7838 | from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:8638")
else:
access = Ser... | mit |
jexhson/rbx | rbx/parser/component.py | 1 | 4537 | from .base import RbxBaseParser
class RbxComponentParser(RbxBaseParser):
def build_parser(self):
parser = self.subparsers.add_parser('component',
help='Manage Run in the Box components')
parser.add_argument('name',
help='Component\'s name to work on')
self.componen... | gpl-2.0 |
songjs1993/DeepLearning | 5Project/facenet/src/download_vgg_face_dataset.py | 4 | 4996 | """Download the VGG face dataset from URLs given by http://www.robots.ox.ac.uk/~vgg/data/vgg_face/vgg_face_dataset.tar.gz
"""
# MIT License
#
# Copyright (c) 2016 David Sandberg
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ... | apache-2.0 |
kevinr/750book-web | 750book-web-env/lib/python2.7/site-packages/django/contrib/localflavor/it/util.py | 436 | 1807 | from django.utils.encoding import smart_str, smart_unicode
def ssn_check_digit(value):
"Calculate Italian social security number check digit."
ssn_even_chars = {
'0': 0, '1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8,
'9': 9, 'A': 0, 'B': 1, 'C': 2, 'D': 3, 'E': 4, 'F': 5, 'G': ... | mit |
andre-richter/pcie-lat | all_in_one.py | 1 | 6054 | #!/usr/bin/python
import sys
import os
import numpy as np
import matplotlib
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
import subprocess
import traceback
pci_dev ={
"name" : "",
"loc" : "",
"class" : "",
"vender" : "",
"device" : "",
"vd" : "",
... | gpl-2.0 |
michaelBenin/sqlalchemy | lib/sqlalchemy/engine/interfaces.py | 1 | 30297 | # engine/interfaces.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Define core interfaces used by the engine system."""
from .. import util, eve... | mit |
amenonsen/ansible-modules-core | cloud/google/gc_storage.py | 21 | 16954 | #!/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 |
Jmainguy/ansible-modules-core | network/nxos/nxos_install_os.py | 19 | 13585 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
CongLi/avocado-vt | selftests/unit/test_virsh.py | 4 | 12806 | #!/usr/bin/python
import unittest
import logging
import os
import sys
from avocado.utils import process
# simple magic for using scripts within a source tree
basedir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if os.path.isdir(os.path.join(basedir, 'virttest')):
sys.path.append(basedir)
def ... | gpl-2.0 |
oyisre/discordbottery | cogs/tasks.py | 1 | 2963 | from discord.ext import commands
from cogs import queries
import aiohttp
import asyncio
import random
import time
# global vars
session = aiohttp.ClientSession()
class Tasks:
"""auto"""
def __init__(self, bot: commands.Bot):
self.bot = bot
async def zooboys(self):
""" sends a message to ... | unlicense |
h3llrais3r/Auto-Subliminal | lib/unidecode/x01e.py | 246 | 3853 | data = (
'A', # 0x00
'a', # 0x01
'B', # 0x02
'b', # 0x03
'B', # 0x04
'b', # 0x05
'B', # 0x06
'b', # 0x07
'C', # 0x08
'c', # 0x09
'D', # 0x0a
'd', # 0x0b
'D', # 0x0c
'd', # 0x0d
'D', # 0x0e
'd', # 0x0f
'D', # 0x10
'd', # 0x11
'D', # 0x12
'd', # 0x13
'E', # 0... | gpl-3.0 |
flakey-bit/plugin.audio.spotify | resources/libs/cherrypy/_cptools.py | 2 | 19426 | """CherryPy tools. A "tool" is any helper, adapted to CP.
Tools are usually designed to be used in a variety of ways (although some
may only offer one if they choose):
Library calls
All tools are callables that can be used wherever needed.
The arguments are straightforward and should be detailed w... | gpl-3.0 |
sadaf2605/django | django/views/decorators/csrf.py | 586 | 2202 | from functools import wraps
from django.middleware.csrf import CsrfViewMiddleware, get_token
from django.utils.decorators import available_attrs, decorator_from_middleware
csrf_protect = decorator_from_middleware(CsrfViewMiddleware)
csrf_protect.__name__ = "csrf_protect"
csrf_protect.__doc__ = """
This decorator adds... | bsd-3-clause |
cboling/SDNdbg | docs/old-stuff/pydzcvr/doc/neutron/services/firewall/agents/varmour/varmour_router.py | 7 | 13202 | # Copyright 2013 vArmour Networks 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 req... | apache-2.0 |
2014c2g6/c2g6 | wsgi/programs/c2g8/__init__.py | 2 | 27931 | import cherrypy
# 這是 C2G8 類別的定義
class C2G8(object):
# 各組利用 index 引導隨後的程式執行
@cherrypy.expose
def index(self, *args, **kwargs):
outstring = '''
這是 2014C2 協同專案下的 c2g8分組程式開發網頁, 以下為 W12 的任務執行內容.<br />
<!-- 這裡採用相對連結, 而非網址的絕對連結 (這一段為 html 註解) -->
<a href="fillpoly">c2g8 fillpoly 繪圖</a><br />
<a href="draw... | gpl-2.0 |
CoRfr/linux | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (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
import sys
sys.path.append(os.envir... | gpl-2.0 |
happya/LintCode | Matrix Zigzag Traversal.py | 4 | 1386 | """
Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in ZigZag-order
Example
Given a matrix:
[
[1, 2, 3, 4],
[5, 6, 7, 8],
[9,10, 11, 12]
]
return [1, 2, 5, 9, 6, 3, 4, 7, 10, 11, 8, 12]
"""
__author__ = 'Daniel'
class Solution:
def printZMatrix(self, matrix):
... | apache-2.0 |
webmedic/booker | src/gdata/projecthosting/data.py | 120 | 3309 | #!/usr/bin/env python
#
# 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 ... | mit |
iamjakob/nbviewer | nbviewer/providers/base.py | 3 | 19107 | #-----------------------------------------------------------------------------
# Copyright (C) 2013 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#-----------------------------------------------------... | bsd-3-clause |
anl-polaris/polaris | bin/postprocess/Affected_Links_Analysis/trajectory_extract.py | 2 | 7955 |
import pprint
import sys
import urllib2
import urllib
import json
import csv
import time
import random
import math
input_trajectory_file_name = "vehicle_trajectory_test.csv"
GENERATE_TRACKING_LIST = False # set to true if outputing trajectories based on traffic incident impact, otherwise false if using a tracking li... | bsd-3-clause |
swprojects/Advanced-Action-Scheduler | advancedactionscheduler/schedulemanager.py | 1 | 12301 | # -*- coding: utf-8 -*
"""
@author Simon Wu <swprojects@runbox.com>
Copyright (c) 2018 by Simon Wu <Advanced Action Scheduler>
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... | gpl-2.0 |
MissionCriticalCloud/marvin | marvin/deployDataCenter.py | 2 | 39662 | """
@Desc :
class DeployDataCenters: Deploys DeleteDataCenters according to a json
configuration file.
class DeleteDataCenters: Deletes a DataCenter based upon the dc cfg
settings provided.
This settings file is the exported
... | apache-2.0 |
birryree/servo | tests/wpt/web-platform-tests/service-workers/tools/blink-import.py | 88 | 6816 | import os
import re
import shutil
import glob
import tempfile
import sys
from collections import defaultdict
here = os.path.abspath(os.path.split(__file__)[0])
def get_extra_files(chromium_root):
return [(os.path.join(chromium_root, "LayoutTests", "http", "tests", "resources", "testharness-helpers.js"),
... | mpl-2.0 |
Oregon-Public-Broadcasting/lunchbox | fabfile/flat.py | 17 | 3311 | #!/usr/bin/env python
import copy
from cStringIO import StringIO
from fnmatch import fnmatch
import gzip
import hashlib
import mimetypes
import os
from boto.s3.key import Key
import app_config
import utils
GZIP_FILE_TYPES = ['.html', '.js', '.json', '.css', '.xml']
class FakeTime:
def time(self):
retur... | mit |
damiencalloway/djtut | mysite/env/lib/python2.7/site-packages/django/core/management/commands/test.py | 103 | 3710 | import logging
import sys
import os
from optparse import make_option, OptionParser
from django.conf import settings
from django.core.management.base import BaseCommand
from django.test.utils import get_runner
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--noinput',
... | mit |
reddymeghraj/showroom | erpnext/accounts/doctype/payment_tool/test_payment_tool.py | 29 | 6827 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest, frappe, json
from frappe.utils import flt
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
from erpnex... | agpl-3.0 |
Datera/cinder | cinder/volume/drivers/dell_emc/vnx/const.py | 7 | 1435 | # Copyright (c) 2016 EMC Corporation.
# 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 |
Karandash8/CLAUDE | framework/message.py | 1 | 8861 | '''
Created on May 4, 2017
@author: andrei
'''
import logging
import abc
from framework.misc import exception
class PRTCL_SIGNATURE:
CLAUDE_SYS_PRTCL = 'CLAUDE-SYS-PRTCL'
CLAUDE_DSCVRY_PRTCL = 'CLAUDE-DSCVRY-PRTCL'
CLI_TO_JM_PRTCL = 'CLI-TO-JM-PRTCL'
JM_TO_JS_PRTCL = 'JM-TO-JS-PRTCL'
JS_TO_RD_... | gpl-3.0 |
elimelec/pjproject | pjsip-apps/src/pygui/account.py | 27 | 6912 | # $Id$
#
# pjsua Python GUI Demo
#
# Copyright (C)2013 Teluu Inc. (http://www.teluu.com)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) ... | gpl-2.0 |
ibelem/crosswalk-test-suite | webapi/tct-csp-w3c-tests/csp-py/csp_child-src_self-manual.py | 30 | 2312 | def main(request, response):
response.headers.set("Content-Security-Policy", "child-src 'self'")
response.headers.set("X-Content-Security-Policy", "child-src 'self'")
response.headers.set("X-WebKit-CSP", "child-src 'self'")
return """<!DOCTYPE html>
<!--
Copyright (c) 2013 Intel Corporation.
Redistribu... | bsd-3-clause |
mitmedialab/MediaCloud-Web-Tools | server/__init__.py | 1 | 9337 | import json
import logging.config
import os
import sys
import tempfile
from flask import Flask, render_template
from flask_webpack import Webpack
from flask_mail import Mail
import flask_login
from raven.conf import setup_logging
from raven.contrib.flask import Sentry
from raven.handlers.logging import SentryHandler
im... | apache-2.0 |
mparus/android_kernel_huawei_msm8916_g760 | scripts/build-all.py | 236 | 11419 | #! /usr/bin/env python
# Copyright (c) 2009-2014, The Linux Foundation. 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
# ... | gpl-2.0 |
phenomx4/android_kernel_zte_warplte | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
Snesha/azure-linux-extensions | Common/libpsutil/py2.6-glibc-2.12-pre/psutil/_pslinux.py | 19 | 40720 | #!/usr/bin/env python
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Linux platform implementation."""
from __future__ import division
import base64
import errno
import functools
import os
import ... | apache-2.0 |
wavelets/pandashells | pandashells/test/module_checker_lib_tests.py | 7 | 1443 | #! /usr/bin/env python
from unittest import TestCase
from pandashells.lib.module_checker_lib import check_for_modules
from pandashells.lib import module_checker_lib
from mock import patch
class ModuleCheckerTests(TestCase):
def setUp(self):
module_checker_lib.CMD_DICT['fakemodule1'] = 'pip install fakemod... | bsd-2-clause |
hehongliang/tensorflow | tensorflow/contrib/training/python/training/bucket_ops.py | 48 | 18717 | # 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 |
pombredanne/MOG | nova/scheduler/weights/ram.py | 25 | 1599 | # Copyright (c) 2011 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 ... | apache-2.0 |
helldorado/ansible | lib/ansible/plugins/lookup/__init__.py | 89 | 4408 | # (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 |
weiting-chen/manila | manila/scheduler/manager.py | 2 | 4689 | # Copyright (c) 2010 OpenStack, LLC.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wit... | apache-2.0 |
denis-vilyuzhanin/selenium-fastview | py/selenium/webdriver/remote/errorhandler.py | 5 | 7933 | #!/usr/bin/python
#
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "Li... | apache-2.0 |
synconics/odoo | addons/hr_payroll_account/hr_payroll_account.py | 52 | 10905 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it ... | agpl-3.0 |
ideanotion/infoneigeapi | api/serializers.py | 1 | 3425 | from __future__ import unicode_literals
from api.models import *
from rest_framework_mongoengine.serializers import MongoEngineModelSerializer
import warnings
from django.core.exceptions import ValidationError
from mongoengine.errors import ValidationError
from rest_framework import serializers
from rest_framework impo... | gpl-2.0 |
hthiery/python-lacrosse | pylacrosse/lacrosse.py | 1 | 8422 | # Copyright (c) 2017 Heiko Thiery
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distrib... | lgpl-2.1 |
mvaled/OpenUpgrade | addons/account/tests/test_account_move_closed_period.py | 127 | 1623 | from datetime import date
from openerp.tests.common import TransactionCase
from openerp.osv.orm import except_orm
class TestPeriodState(TransactionCase):
"""
Forbid creation of Journal Entries for a closed period.
"""
def setUp(self):
super(TestPeriodState, self).setUp()
cr, uid = sel... | agpl-3.0 |
easytaxibr/airflow | airflow/plugins_manager.py | 28 | 3726 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | apache-2.0 |
open-synergy/opnsynid-account-payment | account_payment_import_no_move_line/tests/base.py | 1 | 2437 | # -*- coding: utf-8 -*-
# Copyright 2017 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp.tests.common import TransactionCase
from datetime import datetime
class BaseTest(TransactionCase):
def setUp(self, *args, **kwargs):
super(BaseTest, self).setUp(*arg... | agpl-3.0 |
grypyrg/mha-helper | mha_helper/vip_metal_helper.py | 1 | 4494 | # (c) 2015, Ovais Tariq <me@ovaistariq.net>
#
# This file is part of mha_helper
#
# 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... | gpl-3.0 |
jrowan/zulip | zerver/webhooks/trello/view/__init__.py | 2 | 1794 | # Webhooks for external integrations.
from __future__ import absolute_import
import ujson
from typing import Mapping, Any, Tuple, Text
from django.utils.translation import ugettext as _
from django.http import HttpRequest, HttpResponse
from zerver.lib.actions import check_send_message
from zerver.decorator import retur... | apache-2.0 |
leonardowolf/bookfree | flask/lib/python3.5/site-packages/setuptools/command/bdist_rpm.py | 1049 | 1508 | import distutils.command.bdist_rpm as orig
class bdist_rpm(orig.bdist_rpm):
"""
Override the default bdist_rpm behavior to do the following:
1. Run egg_info to ensure the name and version are properly calculated.
2. Always run 'install' using --single-version-externally-managed to
disable eggs... | mit |
def-/commandergenius | project/jni/python/src/Demo/sockets/throughput.py | 47 | 2085 | #! /usr/bin/env python
# Test network throughput.
#
# Usage:
# 1) on host_A: throughput -s [port] # start a server
# 2) on host_B: throughput -c count host_A [port] # start a client
#
# The server will service multiple clients until it is killed.
#
# The client performs one transfer of count*B... | lgpl-2.1 |
dcneeme/droidcontroller | cchannels.py | 1 | 20840 | # to be imported to access modbus registers as counters
# 04.04.2014 OOP
# 05.04.2014 OOP
# 06.04.2014 counter grousp with sequential regadd range, optimized read done
# 15.04.2014 added ask_counters()
from sqlgeneral import * # SQLgeneral / vaja ka time,mb, conn jne
s=SQLgeneral() # init sisse?
from counter2power im... | gpl-3.0 |
ramusus/django-facebook-ads | facebook_ads/migrations/0014_auto__add_field_adstatistic_reach__add_field_adstatistic_frequency__ad.py | 1 | 14442 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'AdStatistic.reach'
db.add_column('facebook_ads_adstatistic', 'reach', self.gf('django.db.m... | bsd-3-clause |
paulblake/py-flask-signup-docker | application.py | 14 | 3004 | # Copyright 2015. Amazon Web Services, 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 a... | apache-2.0 |
abimannans/scikit-learn | sklearn/externals/joblib/__init__.py | 86 | 4795 | """ Joblib is a set of tools to provide **lightweight pipelining in
Python**. In particular, joblib offers:
1. transparent disk-caching of the output values and lazy re-evaluation
(memoize pattern)
2. easy simple parallel computing
3. logging and tracing of the execution
Joblib is optimized to be **fast*... | bsd-3-clause |
sunlianqiang/kbengine | kbe/res/scripts/common/Lib/test/test_sort.py | 169 | 9164 | from test import support
import random
import sys
import unittest
from functools import cmp_to_key
verbose = support.verbose
nerrors = 0
def check(tag, expected, raw, compare=None):
global nerrors
if verbose:
print(" checking", tag)
orig = raw[:] # save input in case of error
if compar... | lgpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.