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 |
|---|---|---|---|---|---|
gurneyalex/odoo | addons/hr_holidays/models/mail_channel.py | 7 | 1538 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class Channel(models.Model):
_inherit = 'mail.channel'
def partner_info(self, all_partners, direct_partners):
partner_infos = super(Channel, self).partner_info(all_... | agpl-3.0 |
RayMick/scikit-learn | sklearn/covariance/outlier_detection.py | 208 | 6917 | """
Class for outlier detection.
This class provides a framework for outlier detection. It consists in
several methods that can be added to a covariance estimator in order to
assess the outlying-ness of the observations of a data set.
Such a "outlier detector" object is proposed constructed from a robust
covariance es... | bsd-3-clause |
kordless/zoto-server | aztk/plugins/Paypal.py | 1 | 7615 | """
plugins/Paypal.py
Author: Trey Stout
Date Added: Mon Jul 24 15:29:48 CDT 2006
New interface to the same old shit...
"""
## STD LIBS
from md5 import md5
from datetime import date, datetime
from xml.dom import minidom
from pprint import pprint, pformat
from math import floor
import time
## OUR LIBS
from AZTKAPI i... | bsd-3-clause |
mammique/django | django/contrib/auth/tests/decorators.py | 102 | 1600 | from django.contrib.auth.decorators import login_required
from django.contrib.auth.tests.views import AuthViewsTestCase
from django.contrib.auth.tests.utils import skipIfCustomUser
@skipIfCustomUser
class LoginRequiredTestCase(AuthViewsTestCase):
"""
Tests the login_required decorators
"""
urls = 'dja... | bsd-3-clause |
vveerava/Openstack | neutron/extensions/lbaas_agentscheduler.py | 24 | 4402 | # Copyright (c) 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... | apache-2.0 |
emory-libraries/readux | readux/books/tests/views.py | 1 | 42006 | from datetime import datetime, timedelta
from django.contrib.auth import get_user_model
from django.core.paginator import Paginator
from django.core.urlresolvers import reverse
from django.http import HttpResponse
from django.template.defaultfilters import filesizeformat
from django.test import TestCase
import json
fro... | apache-2.0 |
shw700/latrace-plus | frontend/la2html.py | 1 | 15468 | #!/usr/bin/python
import sys
import re
color_map = [ "silver", "aquamarine", "tan", "skyblue", "plum", "yellowgreen", "moccasin" ]
def get_color_level(n):
return color_map[n % len(color_map)]
def enstyle_parameters(s):
result = ""
if s == "" or s == "void":
return "<b>void</b>"
nexti = s.find("=")
while... | gpl-3.0 |
bhermansyah/DRR-datacenter | geonode/upload/upload.py | 9 | 21107 | #########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# 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
#... | gpl-3.0 |
adobecs5/urp2015 | lib/python3.4/site-packages/pkg_resources/_vendor/packaging/_structures.py | 906 | 1809 | # Copyright 2014 Donald Stufft
#
# 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, so... | apache-2.0 |
i5o/openshot-sugar | ignacio/openshot/windows/AddToTimeline.py | 3 | 13528 | # OpenShot Video Editor is a program that creates, modifies, and edits video files.
# Copyright (C) 2010 Jonathan Thomas
#
# This file is part of OpenShot Video Editor (http://launchpad.net/openshot/).
#
# OpenShot Video Editor is free software: you can redistribute it and/or modify
# it under the terms of the GNU G... | gpl-3.0 |
jrrembert/django | tests/template_tests/test_context.py | 166 | 5389 | # -*- coding: utf-8 -*-
from django.http import HttpRequest
from django.template import (
Context, Engine, RequestContext, Template, Variable, VariableDoesNotExist,
)
from django.template.context import RenderContext
from django.test import RequestFactory, SimpleTestCase
class ContextTests(SimpleTestCase):
... | bsd-3-clause |
veim/dpdk-16.11 | examples/ip_pipeline/config/diagram-generator.py | 4 | 12114 | #!/usr/bin/env python
# BSD LICENSE
#
# Copyright(c) 2016 Intel Corporation. All rights reserved.
# 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... | gpl-2.0 |
michellab/SireUnitTests | unittests/SireIO/test_amberterms.py | 1 | 5571 | from Sire.IO import *
from Sire.MM import *
from Sire.Mol import *
from Sire.CAS import *
from Sire.Maths import *
from nose.tools import assert_almost_equal
rangen = RanGenerator()
mol = MoleculeParser.read("../io/ose.top","../io/ose.crd") \
[MolWithResID(ResName("OSE"))].molecule()
def _assert_expressions... | gpl-3.0 |
sszlm/MissionPlanner | Lib/shelve.py | 59 | 8317 | """Manage shelves of pickled objects.
A "shelf" is a persistent, dictionary-like object. The difference
with dbm databases is that the values (not the keys!) in a shelf can
be essentially arbitrary Python objects -- anything that the "pickle"
module can handle. This includes most class instances, recursive data... | gpl-3.0 |
pwplus/securedrop | securedrop/journalist.py | 2 | 21258 | # -*- coding: utf-8 -*-
import sys
import os
from datetime import datetime
import functools
from flask import (Flask, request, render_template, send_file, redirect, flash,
url_for, g, abort, session)
from flask_wtf.csrf import CsrfProtect
from flask.ext.assets import Environment
from sqlalchemy.orm.... | agpl-3.0 |
pahaz/fabtools | fabtools/openvz/operations.py | 1 | 3962 | """
OpenVZ containers
=================
"""
from __future__ import with_statement
from fabric.api import *
def create(ctid, ostemplate=None, config=None, private=None,
root=None, ipadd=None, hostname=None, **kwargs):
"""
Create an OpenVZ container.
"""
return _vzctl('create', ctid, ostempl... | bsd-2-clause |
mapr/hue | desktop/core/ext-py/lxml/setup.py | 28 | 4043 | import sys, os
extra_options = {}
try:
import Cython
# may need to work around setuptools bug by providing a fake Pyrex
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "fake_pyrex"))
except ImportError:
pass
try:
import pkg_resources
try:
pkg_resources.require("setuptools>=... | apache-2.0 |
poiati/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 |
britco/django-oscar-amazon-payments | sandbox/apps/basket/migrations/0003_auto__add_field_line_price_excl_tax.py | 18 | 21828 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from oscar.core.compat import AUTH_USER_MODEL, AUTH_USER_MODEL_NAME
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Line.price_excl_tax'
d... | mit |
alianmohammad/pd-gem5 | util/drampower_trace.py | 23 | 4348 | #!/usr/bin/env python
# Copyright (c) 2014 ARM Limited
# All rights reserved
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation... | bsd-3-clause |
Asana/mypipe | avro/lang/py/test/test_protocol.py | 58 | 12340 | # 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 u... | apache-2.0 |
bathepawan/workload-automation | wlauto/commands/run.py | 7 | 6157 | # Copyright 2014-2015 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 w... | apache-2.0 |
MiltosD/CEFELRC | lib/python2.7/site-packages/analytical/templatetags/reinvigorate.py | 3 | 2592 | """
Reinvigorate template tags and filters.
"""
from __future__ import absolute_import
import re
from django.template import Library, Node, TemplateSyntaxError
from django.utils import simplejson
from analytical.utils import get_identity, is_internal_ip, disable_html, \
get_required_setting
TRACKING_ID_RE... | bsd-3-clause |
nubark/odoo | addons/website_sale/controllers/main.py | 3 | 47925 | # -*- coding: utf-8 -*-
import logging
import werkzeug
from openerp import SUPERUSER_ID
from openerp import http
from openerp import tools
from openerp.http import request
from openerp.tools.translate import _
from openerp.addons.website.models.website import slug
PPG = 20 # Products Per Page
PPR = 4 # Products Per ... | gpl-3.0 |
pasqualguerrero/django | django/db/backends/utils.py | 430 | 6689 | from __future__ import unicode_literals
import datetime
import decimal
import hashlib
import logging
from time import time
from django.conf import settings
from django.utils.encoding import force_bytes
from django.utils.timezone import utc
logger = logging.getLogger('django.db.backends')
class CursorWrapper(object... | bsd-3-clause |
Boyang--Li/mavlink | pymavlink/generator/mavgen_c.py | 20 | 21028 | #!/usr/bin/env python
'''
parse a MAVLink protocol XML file and generate a C implementation
Copyright Andrew Tridgell 2011
Released under GNU GPL version 3 or later
'''
import sys, textwrap, os, time
from . import mavparse, mavtemplate
t = mavtemplate.MAVTemplate()
def generate_version_h(directory, xml):
'''gen... | lgpl-3.0 |
shaufi10/odoo | openerp/addons/base/res/res_currency.py | 96 | 16006 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
pombredanne/discodb | python/discodb/query.py | 3 | 8881 | """
:mod:`discodb.query` -- Supporting objects for the DiscoDB query interface
==========================================================================
>>> from discodb import Q
>>> Q.parse('~(B | C)') == Q.parse('~B & ~C')
True
>>> Q.parse('(A & B) | C') == Q.parse('(A | C) & (B | C)')
True
>>> Q.parse('A & (B | (D ... | bsd-3-clause |
thanatos/lets-encrypt-preview | letsencrypt-nginx/setup.py | 1 | 2062 | import sys
from setuptools import setup
from setuptools import find_packages
version = '0.5.0.dev0'
# Please update tox.ini when modifying dependency version requirements
install_requires = [
'acme=={0}'.format(version),
'letsencrypt=={0}'.format(version),
'PyOpenSSL',
'pyparsing>=1.5.5', # Python3... | apache-2.0 |
orwa1902/code-exemples | TicTacToe.py | 1 | 4091 | board = []
for i in range(3):
board.append(["*"] * 3)
#a function that creats the board
def print_board(board):
for row in board:
print (" ".join(row))
print("Let\'s play Tic Tac Toe! the rules are simple. you, the players, is given two choices: the row and column of your symbol. note that the numbers are between 0... | apache-2.0 |
kai5263499/networkx | examples/graph/unix_email.py | 62 | 2683 | #!/usr/bin/env python
"""
Create a directed graph, allowing multiple edges and self loops, from
a unix mailbox. The nodes are email addresses with links
that point from the sender to the recievers. The edge data
is a Python email.Message object which contains all of
the email message data.
This example shows the po... | bsd-3-clause |
40223139/39g7test | static/Brython3.1.0-20150301-090019/Lib/platform.py | 620 | 51006 | #!/usr/bin/env python3
""" This module tries to retrieve as much platform-identifying data as
possible. It makes this information available via function APIs.
If called from the command line, it prints the platform
information concatenated as single string to stdout. The output
format is useable as pa... | gpl-3.0 |
sos22/minios-hacks | tools/xm-test/lib/XmTestLib/XenDomain.py | 10 | 11555 | #!/usr/bin/python
"""
Copyright (C) International Business Machines Corp., 2005
Author: Dan Smith <danms@us.ibm.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; under version 2 of the Licens... | gpl-2.0 |
malmiron/incubator-airflow | airflow/ti_deps/deps/dag_ti_slots_available_dep.py | 20 | 1422 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
xfournet/intellij-community | python/helpers/pydev/_pydevd_bundle/pydevd_trace_dispatch.py | 10 | 3878 | # Defines which version of the trace_dispatch we'll use.
# Should give warning only here if cython is not available but supported.
import os
import sys
from _pydevd_bundle.pydevd_constants import CYTHON_SUPPORTED, IS_PYCHARM
use_cython = os.getenv('PYDEVD_USE_CYTHON', None)
dirname = os.path.dirname(os.path.dirname(... | apache-2.0 |
adngdb/socorro | socorro/unittest/submitter/test_submitter_app.py | 2 | 16936 | # 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 mock
import time
import json
from nose.tools import eq_, ok_, assert_raises
from socorro.submitter.submitter_ap... | mpl-2.0 |
matthiasplappert/pibot | src/robot/base.py | 1 | 4268 | import logging
import select
import Pyro4
import Pyro4.core
import Pyro4.naming
import Pyro4.socketutil
class Robot(object):
def __init__(self):
self._sensors = []
self._actuators = []
self.n_steps = 0
@property
def actuators(self):
return self._actuators
@actuators.... | mit |
daya-shankar/foursquared.eclair | util/gen_class.py | 262 | 3173 | #!/usr/bin/python
import datetime
import sys
import textwrap
import common
from xml.dom import pulldom
HEADER = """\
/**
* Copyright 2009 Joe LaPenna
*/
package com.joelapenna.foursquare.types;
%(imports)s
/**
* Auto-generated: %(timestamp)s
*
* @author Joe LaPenna (joe@joelapenna.com)
*/
public class %(type... | apache-2.0 |
kerr-huang/SL4A | python/src/Tools/scripts/nm2def.py | 94 | 2444 | #! /usr/bin/env python
"""nm2def.py
Helpers to extract symbols from Unix libs and auto-generate
Windows definition files from them. Depends on nm(1). Tested
on Linux and Solaris only (-p option to nm is for Solaris only).
By Marc-Andre Lemburg, Aug 1998.
Additional notes: the output of nm is supposed to look like th... | apache-2.0 |
reinarduswindy/rojak | rojak-pantau/rojak_pantau/spiders/merdekacom.py | 5 | 3466 | # -*- coding: utf-8 -*-
import json
from scrapy import Request
from scrapy.exceptions import CloseSpider
from scrapy.loader import ItemLoader
from datetime import datetime
from rojak_pantau.items import News
from rojak_pantau.util.wib_to_utc import wib_to_utc
from rojak_pantau.i18n import _
from rojak_pantau.spiders... | bsd-3-clause |
proxysh/Safejumper-for-Mac | buildmac/Resources/env/lib/python2.7/site-packages/twisted/protocols/pcp.py | 15 | 7088 | # -*- test-case-name: twisted.test.test_pcp -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Producer-Consumer Proxy.
"""
from zope.interface import implementer
from twisted.internet import interfaces
@implementer(interfaces.IProducer, interfaces.IConsumer)
class BasicProducerConsume... | gpl-2.0 |
zhaodelong/django | tests/one_to_one/models.py | 203 | 3343 | """
One-to-one relationships
To define a one-to-one relationship, use ``OneToOneField()``.
In this example, a ``Place`` optionally can be a ``Restaurant``.
"""
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compat... | bsd-3-clause |
schoolie/bokeh | examples/plotting/file/markers.py | 13 | 1606 | from numpy.random import random
from bokeh.plotting import figure, show, output_file
def mscatter(p, x, y, marker):
p.scatter(x, y, marker=marker, size=15,
line_color="navy", fill_color="orange", alpha=0.5)
def mtext(p, x, y, text):
p.text(x, y, text=[text],
text_color="firebrick", t... | bsd-3-clause |
tlatzko/spmcluster | .tox/clean/lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/pulldom.py | 1729 | 2302 | from __future__ import absolute_import, division, unicode_literals
from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, \
COMMENT, IGNORABLE_WHITESPACE, CHARACTERS
from . import _base
from ..constants import voidElements
class TreeWalker(_base.TreeWalker):
def __iter__(self):
ignore_until = None... | bsd-2-clause |
boompieman/iim_project | project_python2/lib/python2.7/site-packages/nltk/corpus/reader/nombank.py | 3 | 16738 | # Natural Language Toolkit: NomBank Corpus Reader
#
# Copyright (C) 2001-2015 NLTK Project
# Authors: Paul Bedaride <paul.bedaride@gmail.com>
# Edward Loper <edloper@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
from __future__ import unicode_literals
from nltk.tre... | gpl-3.0 |
jazkarta/edx-platform | openedx/core/lib/api/plugins.py | 154 | 1517 | """
Adds support for first class features that can be added to the edX platform.
"""
from stevedore.extension import ExtensionManager
class PluginError(Exception):
"""
Base Exception for when an error was found regarding features.
"""
pass
class PluginManager(object):
"""
Base class that ma... | agpl-3.0 |
githubutilities/LeetCode | Python/validate-binary-search-tree.py | 3 | 2085 | # Time: O(n)
# Space: O(1)
#
# Given a binary tree, determine if it is a valid binary search tree (BST).
#
# Assume a BST is defined as follows:
#
# The left subtree of a node contains only nodes with keys less than the node's key.
# The right subtree of a node contains only nodes with keys greater than the node's ... | mit |
splunk/splunk-app-twitter | twitter2/bin/requests/packages/urllib3/packages/six.py | 2375 | 11628 | """Utilities for writing code that runs on Python 2 and 3"""
#Copyright (c) 2010-2011 Benjamin Peterson
#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 l... | apache-2.0 |
karthik-sethuraman/Snowmass-ONFOpenTransport | RI/flask_server/tapi_server/models/tapi_common_service_interface_point_ref.py | 4 | 2307 | # coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from tapi_server.models.base_model_ import Model
from tapi_server import util
class TapiCommonServiceInterfacePointRef(Model):
"""NOTE: This class is auto generat... | apache-2.0 |
dfalt974/SickRage | lib/unidecode/util.py | 51 | 1790 | # vim:ts=4 sw=4 expandtab softtabstop=4
from __future__ import print_function
import optparse
import locale
import os
import sys
import warnings
from unidecode import unidecode
PY3 = sys.version_info[0] >= 3
def fatal(msg):
sys.stderr.write(msg + "\n")
sys.exit(1)
def main():
default_encoding = locale.g... | gpl-3.0 |
MuffinMedic/CloudBot | plugins/metars.py | 4 | 1295 | import requests
from cloudbot import hook
api_url_metar = "http://api.av-wx.com/metar/"
api_url_taf = "http://api.av-wx.com/taf/"
@hook.command()
def metar(text):
"""[ICAO station code] - returns the metars information for the specified station. A list of station codes can be found here: http://weather.rap.ucar... | gpl-3.0 |
bashu/django-easy-seo | seo/south_migrations/0004_auto__del_url__del_unique_url_url_site.py | 1 | 2904 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'Url', fields ['url', 'site']
db.delete_unique('seo_url', ['url', 'site_id']... | gpl-3.0 |
HopeFOAM/HopeFOAM | ThirdParty-0.1/ParaView-5.0.1/VTK/IO/Geometry/Testing/Python/TestPolygonWriters.py | 20 | 4259 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# Create the RenderWindow, Renderer and both Actors
#
ren1 = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren1)
iren = vtk.vtkRenderWindowInteractor()
iren.SetR... | gpl-3.0 |
chudaol/edx-platform | common/djangoapps/cache_toolbox/middleware.py | 211 | 4009 | """
Cache-backed ``AuthenticationMiddleware``
-----------------------------------------
``CacheBackedAuthenticationMiddleware`` is an
``django.contrib.auth.middleware.AuthenticationMiddleware`` replacement to
avoid querying the database for a ``User`` instance in each request.
Whilst the built-in ``AuthenticationMidd... | agpl-3.0 |
paulocastro31/android_kernel_motorola_msm8226 | 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 |
cc272309126/panda3d | direct/src/tkwidgets/MemoryExplorer.py | 11 | 11923 | from direct.showbase.DirectObject import DirectObject
from direct.showbase.TkGlobal import *
from Tkinter import *
from Tree import *
import Pmw
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
DEFAULT_BT_WIDTH = 50.... | bsd-3-clause |
sschiau/swift | utils/gyb_syntax_support/Traits.py | 39 | 1558 | from Child import Child
class Trait(object):
def __init__(self, trait_name, description=None, children=None):
self.trait_name = trait_name
self.children = children
self.description = description
TRAITS = [
Trait('DeclGroup',
children=[
Child('Attributes', kind... | apache-2.0 |
Asquera/bigcouch | couchjs/scons/scons-local-2.0.1/SCons/Platform/posix.py | 61 | 8697 | """SCons.Platform.posix
Platform-specific initialization for POSIX (Linux, UNIX, etc.) systems.
There normally shouldn't be any need to import this module directly. It
will usually be imported through the generic SCons.Platform.Platform()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2... | apache-2.0 |
morsdatum/ArangoDB | 3rdParty/V8/tools/testrunner/local/statusfile.py | 16 | 4705 | # Copyright 2012 the V8 project authors. 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 conditi... | apache-2.0 |
opencloudinfra/orchestrator | venv/Lib/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... | gpl-3.0 |
jclc/discus-inferno | flaskenv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/cp949prober.py | 2801 | 1782 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mit |
Jaidan/jaidan-hab-home-assistant | tests/test_component_group.py | 3 | 8147 | """
tests.test_component_group
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests the group compoments.
"""
# pylint: disable=protected-access,too-many-public-methods
import unittest
import logging
import homeassistant as ha
from homeassistant.const import STATE_ON, STATE_OFF, STATE_HOME, STATE_UNKNOWN
import homeassistant.component... | mit |
clarkperkins/stackdio | stackdio/api/cloud/migrations/0002_0_8_initial.py | 2 | 3061 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('stacks', '0001_0_8_initial'),
('cloud', '0001_0_8_initial'),
]
replaces = [
('cloud', '0001_init... | apache-2.0 |
Yen-Chung-En/w16b_test | static/Brython3.1.1-20150328-091302/Lib/browser/indexed_db.py | 632 | 3008 | class EventListener:
def __init__(self, events=[]):
self._events=events
def append(self, event):
self._events.append(event)
def fire(self, e):
for _event in self._events:
_event(e)
class IndexedDB:
def __init__(self):
if not __BRYTHON__.has_indexedDB:
raise NotImple... | agpl-3.0 |
kpdyer/marionette | marionette_tg/dsl_tests.py | 10 | 23296 | import sys
import unittest
sys.path.append('.')
import marionette_tg.dsl
class Tests(unittest.TestCase):
def test1(self):
mar_format = """connection(tcp, 80):
start downstream NULL 1.0
downstream upstream http_get 1.0
upstream end http_ok 1.0
... | apache-2.0 |
ThePixelBro22/willienelsoncoin | contrib/pyminer/pyminer.py | 766 | 6434 | #!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... | mit |
israeleriston/scientific-week | backend/venv/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py | 360 | 11622 | from __future__ import absolute_import
import errno
import warnings
import hmac
from binascii import hexlify, unhexlify
from hashlib import md5, sha1, sha256
from ..exceptions import SSLError, InsecurePlatformWarning, SNIMissingWarning
SSLContext = None
HAS_SNI = False
create_default_context = None
IS_PYOPENSSL = F... | mit |
UltrosBot/Ultros-examples | example_clj/plugins/example_clj/__init__.py | 1 | 1893 | """
This is an example plugin to give you an idea of how to use Clojure in your
plugins, should you wish to.
We don't really expect anyone to use this, but we've included it to show that
it's actually possible. If you like Lisps, take a look at Clojure and also
ClojurePy, which is what we're using here.
"""
__author_... | artistic-2.0 |
spmjc/plugin.video.freplay | resources/lib/channels/tf12.py | 1 | 4906 | #-*- coding: utf-8 -*-
from resources.lib import utils
import base64
import hashlib
import json
import urllib
import urllib2
import urlparse
from resources.lib import globalvar
title=['TF1','NT1','HD1','TMC','XTRA']
img=['tf1','nt1','hd1','tmc','xtra']
readyForUse=True
#urlCatalog='http://api.mytf1.tf1.... | gpl-2.0 |
provaleks/o8 | addons/payment_ogone/controllers/main.py | 389 | 1179 | # -*- coding: utf-8 -*-
import logging
import pprint
import werkzeug
from openerp import http, SUPERUSER_ID
from openerp.http import request
_logger = logging.getLogger(__name__)
class OgoneController(http.Controller):
_accept_url = '/payment/ogone/test/accept'
_decline_url = '/payment/ogone/test/decline'
... | agpl-3.0 |
nielsvanoch/django | django/conf/locale/sv/formats.py | 197 | 1569 | # -*- 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 F Y'
TIME_FORMAT = 'H:i'
DATETI... | bsd-3-clause |
ehudmagal/robotqcapp | boto/ec2/autoscale/policy.py | 24 | 5549 | # Copyright (c) 2009-2010 Reza Lotun http://reza.lotun.name/
# Copyright (c) 2011 Jann Kleen
#
# 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 limitat... | bsd-3-clause |
saurabh6790/medsynaptic-lib | conf/conf.py | 33 | 1034 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
# app configuration
# database config
db_name = '%(db_name)s'
db_password = '%(db_password)s'
# user attachments stored in
files_path = 'public/files'
public_path = 'public'
... | mit |
xifle/home-assistant | homeassistant/components/binary_sensor/envisalink.py | 12 | 2697 | """
Support for Envisalink zone states- represented as binary sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.envisalink/
"""
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.co... | mit |
40423106/2016fallcadp_ag4 | local_publishconf.py | 188 | 1674 | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
# This file is only used if you use `make publish` or
# explicitly specify it as your config file.
import os
import sys
sys.path.append(os.curdir)
from pelicanconf import *
# 因為 publishconf.py 在 pelicanconf.py 之後, 因此若兩處有相同變數的設定, ... | agpl-3.0 |
jobbrIO/docs | conf.py | 1 | 10123 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Jobbr documentation build configuration file, created by
# sphinx-quickstart on Fri Nov 4 19:20:28 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# auto... | mit |
sambev/ircbot | scrapers/cafescraper.py | 1 | 1407 | def scrapeCafe():
"""
Scrape the EastBay Cafe's site for the current lunch menu
"""
from bs4 import BeautifulSoup
import requests
# Get the page contents and make a soup object from it
page = requests.get('http://www.eastbaycafe.com/menu.php')
the_html = BeautifulSoup(page.text)
mapping = {
'Steam \'n T... | mit |
ellipsis14/dolfin | test/unit/python/nls/test_PETScSNES_solver.py | 2 | 4907 | #!/usr/bin/env py.test
"""Unit test for the SNES nonlinear solver"""
# Copyright (C) 2012 Patrick E. Farrell
#
# This file is part of DOLFIN.
#
# DOLFIN 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,... | gpl-3.0 |
luogangyi/Ceilometer-oVirt | build/lib/ceilometer/dispatcher/redis_database.py | 2 | 8223 | #
# Copyright 2013 IBM Corp
#
# Author: Tong Li <litong01@us.ibm.com>
#
# 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 |
amolkahat/pandas | pandas/util/_validators.py | 4 | 13052 | """
Module that contains many useful utilities
for validating data or function arguments
"""
import warnings
from pandas.core.dtypes.common import is_bool
def _check_arg_length(fname, args, max_fname_arg_count, compat_args):
"""
Checks whether 'args' has length of at most 'compat_args'. Raises
a TypeErro... | bsd-3-clause |
tersmitten/ansible | test/units/modules/network/f5/test_bigip_device_group_member.py | 16 | 2967 | # -*- 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
import os
import json
import pytest
import sys
if sys.version_info < (2, ... | gpl-3.0 |
CallaJun/hackprince | indico/matplotlib/gridspec.py | 10 | 15668 | """
:mod:`~matplotlib.gridspec` is a module which specifies the location
of the subplot in the figure.
``GridSpec``
specifies the geometry of the grid that a subplot will be
placed. The number of rows and number of columns of the grid
need to be set. Optionally, the subplot layout parameter... | lgpl-3.0 |
heeraj123/oh-mainline | vendor/packages/django-assets/django_assets/filter/jspacker/jspacker.py | 19 | 22540 | ## ParseMaster, version 1.0 (pre-release) (2005/05/12) x6
## Copyright 2005, Dean Edwards
## Web: http://dean.edwards.name/
##
## This software is licensed under the CC-GNU LGPL
## Web: http://creativecommons.org/licenses/LGPL/2.1/
##
## Ported to Python by Florian Schulze
import os, re
# a multi-pattern parser... | agpl-3.0 |
soycode/pattern | pattern/server/cherrypy/cherrypy/__init__.py | 37 | 21634 | """CherryPy is a pythonic, object-oriented HTTP framework.
CherryPy consists of not one, but four separate API layers.
The APPLICATION LAYER is the simplest. CherryPy applications are written as
a tree of classes and methods, where each branch in the tree corresponds to
a branch in the URL path. Each method is a 'pa... | bsd-3-clause |
matthappens/taskqueue | taskqueue/venv_tq/lib/python2.7/site-packages/boto/ec2/regioninfo.py | 3 | 1529 | # Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
# 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 without res... | mit |
wikimedia/operations-debs-linux | tools/perf/scripts/python/export-to-postgresql.py | 617 | 16128 | # export-to-postgresql.py: export perf data to a postgresql database
# Copyright (c) 2014, 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.
#
# Thi... | gpl-2.0 |
chillbu/cblib | thirdparty/protobuf-2.5.0/gtest/test/gtest_uninitialized_test.py | 2901 | 2480 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | apache-2.0 |
sethportman/xhtml2pdf | xhtml2pdf/wsgi.py | 56 | 3006 | # -*- coding: utf-8 -*-
# Copyright 2010 Dirk Holtwick, holtwick.it
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | apache-2.0 |
unseenlaser/python-for-android | python-modules/zope/zope/interface/interfaces.py | 50 | 24669 | ##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | apache-2.0 |
shaufi10/odoo | addons/lunch/wizard/lunch_order.py | 440 | 1299 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2012 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | agpl-3.0 |
pmateusz/browser-automation | source/Python/GetChromiumUrl.py | 4 | 1541 | import sys
import re
import requests
import xml.etree.ElementTree as element_tree
MAX_ATTEMTPS = 10
def get_last_change():
r = requests.get('http://commondatastorage.googleapis.com/chromium-browser-continuous/Win/LAST_CHANGE')
r.raise_for_status()
return int(r.text)
def remove_default_namespace(xml):
return re.s... | mit |
mendersoftware/integration | testutils/api/proto_shell.py | 1 | 2637 | # Copyright 2021 Northern.tech AS
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | apache-2.0 |
schalkneethling/bedrock | bedrock/wordpress/tests/test_views.py | 15 | 2306 | from django.test import override_settings, RequestFactory
import pytest
import responses
from bedrock.wordpress.models import BlogPost
from bedrock.wordpress.tests.test_models import setup_responses, TEST_WP_BLOGS
from bedrock.wordpress.views import BlogPostsView
@responses.activate
@override_settings(WP_BLOGS=TEST... | mpl-2.0 |
openstack/python-cloudkittyclient | cloudkittyclient/tests/unit/v1/test_storage.py | 2 | 1337 | # -*- coding: utf-8 -*-
# Copyright 2018 Objectif Libre
#
# 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 ... | apache-2.0 |
hackathon-3d/ice-cream-manwich-repo | server/src/BooksWithFriends/libs/django/utils/jslex.py | 329 | 8041 | """JsLex: a lexer for Javascript"""
# Originally from https://bitbucket.org/ned/jslex
import re
class Tok(object):
"""
A specification for a token class.
"""
num = 0
def __init__(self, name, regex, next=None):
self.id = Tok.num
Tok.num += 1
self.name = name
self.reg... | gpl-2.0 |
guozanhua/mobile-chrome-apps | chrome-cordova/gcmServer/xmpp/jep0106.py | 202 | 1488 |
# JID Escaping XEP-0106 for the xmpppy based transports written by Norman Rasmussen
"""This file is the XEP-0106 commands.
Implemented commands as follows:
4.2 Encode : Encoding Transformation
4.3 Decode : Decoding Transformation
"""
xep0106mapping = [
[' ' ,'20'],
['"' ,'22'],
['&' ,'26'],
['\'','27'],
['/... | bsd-3-clause |
shelvenzhou/BTCGPU | test/functional/disablewallet.py | 33 | 1536 | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test a node with the -disablewallet option.
- Test that validateaddress RPC works when running with -d... | mit |
epitron/youtube-dl | youtube_dl/extractor/rtl2.py | 12 | 7153 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..aes import aes_cbc_decrypt
from ..compat import (
compat_b64decode,
compat_ord,
compat_str,
)
from ..utils import (
bytes_to_intlist,
ExtractorError,
intlist_to_bytes,
int_or_none,
... | unlicense |
ossdemura/django-miniblog | src/Lib/site-packages/django/conf/locale/pl/formats.py | 504 | 1147 | # -*- 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 E Y'
TIME_FORMAT = 'H:i'
DATETI... | mit |
fllodrab/Practica1 | venv/lib/python2.7/site-packages/pip/vendor/html5lib/utils.py | 250 | 2413 | from __future__ import absolute_import, division, unicode_literals
from types import ModuleType
try:
import xml.etree.cElementTree as default_etree
except ImportError:
import xml.etree.ElementTree as default_etree
class MethodDispatcher(dict):
"""Dict with 2 special properties:
On initiation, keys ... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.