repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
abdullah2891/remo | vendor-local/lib/python/docutils/parsers/rst/languages/ca.py | 6 | 4377 | # $Id: ca.py 6460 2010-10-29 22:18:44Z milde $
# Author: Ivan Vilata i Balaguer <ivan@selidor.net>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be
# trans... | bsd-3-clause |
David-Gil/marble-dev | tools/gen-sat-catalog/lib/ObjectCatalog.py | 9 | 2752 | #
# This file is part of the Marble Virtual Globe.
#
# This program is free software licensed under the GNU LGPL. You can
# find a copy of this license in LICENSE.txt in the top directory of
# the source code.
#
# Copyright 2012 Rene Kuettner <rene@bitkanal.net>
#
from __future__ import print_function
from lxml imp... | lgpl-2.1 |
sysadmin75/ansible | test/lib/ansible_test/_data/sanity/pylint/plugins/blacklist.py | 5 | 8733 | """A plugin for pylint to identify imports and functions which should not be used."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import astroid
from pylint.checkers import BaseChecker
from pylint.interfaces import IAstroidChecker
ANSIBLE_TEST_MODULES_PATH = os... | gpl-3.0 |
ConnorGBrewster/servo | tests/wpt/web-platform-tests/tools/third_party/py/py/_code/code.py | 60 | 27492 | import py
import sys
from inspect import CO_VARARGS, CO_VARKEYWORDS, isclass
builtin_repr = repr
reprlib = py.builtin._tryimport('repr', 'reprlib')
if sys.version_info[0] >= 3:
from traceback import format_exception_only
else:
from py._code._py2traceback import format_exception_only
import traceback
class... | mpl-2.0 |
guerrerocarlos/odoo | addons/mass_mailing/models/mass_mailing_report.py | 364 | 2244 | # -*- coding: utf-8 -*-
from openerp.osv import fields, osv
from openerp import tools
class MassMailingReport(osv.Model):
_name = 'mail.statistics.report'
_auto = False
_description = 'Mass Mailing Statistics'
_columns = {
'scheduled_date': fields.datetime('Scheduled Date', readonly=True),
... | agpl-3.0 |
marknv/szuboard2feed | szuboard2feed/fetchurl.py | 1 | 1291 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import requests
from lxml.html import fromstring
from lxml import etree
import times
def get_res(url, encoding=None, session=None):
"""
return a etree of html text using given encoding type
"""
session = session or requests.Session()
res = session.get... | mit |
HridayHS/Lightning-Kernel | 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 |
wagtail/wagtail | wagtail/core/migrations/0039_collectionviewrestriction.py | 24 | 1601 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-19 15:32
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0038_make_first_published_at_editable'),
]
operations = [
migrations... | bsd-3-clause |
lodemo/CATANA | src/face_recognition/youtube_dl/extractor/ebaumsworld.py | 87 | 1086 | from __future__ import unicode_literals
from .common import InfoExtractor
class EbaumsWorldIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?ebaumsworld\.com/videos/[^/]+/(?P<id>\d+)'
_TEST = {
'url': 'http://www.ebaumsworld.com/videos/a-giant-python-opens-the-door/83367677/',
'info_dict'... | mit |
mdietrichc2c/OCB | addons/product_expiry/product_expiry.py | 205 | 5460 | ##############################################################################
#
# 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 Affero General Publ... | agpl-3.0 |
tensorflow/addons | tensorflow_addons/layers/tests/sparsemax_test.py | 1 | 2107 | # 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 |
michael-donat/ansible | lib/ansible/plugins/action/package.py | 50 | 2340 | # (c) 2015, Ansible 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 di... | gpl-3.0 |
lokik/sfepy | tests/test_term_call_modes.py | 1 | 11429 | from __future__ import absolute_import
from copy import copy
import numpy as nm
from sfepy.base.testing import TestCommon
from sfepy.base.base import ordered_iteritems
from sfepy import data_dir
filename_meshes = [data_dir + '/meshes/elements/%s_2.mesh' % geom
for geom in ['1_2', '2_3', '2_4', '3_... | bsd-3-clause |
MFoster/breeze | django/contrib/localflavor/generic/forms.py | 514 | 2160 | from django import forms
DEFAULT_DATE_INPUT_FORMATS = (
'%Y-%m-%d', '%d/%m/%Y', '%d/%m/%y', # '2006-10-25', '25/10/2006', '25/10/06'
'%b %d %Y', '%b %d, %Y', # 'Oct 25 2006', 'Oct 25, 2006'
'%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006'
'%B %d %Y', '%B %d, %Y', ... | bsd-3-clause |
NEONInc/NEON-Data-Skills | code/Python/uncertainty/lidar-uncertainty.py | 1 | 10417 | # -*- coding: utf-8 -*-
"""
Created on Sun May 14 18:54:29 2017
@author: tgoulden
"""
import h5py
import numpy as np
from math import floor
import os
import gdal
import matplotlib.pyplot as plt
import sys
def plot_band_array(band_array,image_extent,title,cmap_title,colormap,colormap_limits):
plt.... | gpl-2.0 |
petrjasek/superdesk-core | superdesk/publish/formatters/nitf_formatter.py | 2 | 15326 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
import super... | agpl-3.0 |
golden1232004/vnpy | vn.lts_old/pyscript/lts_data_type.py | 167 | 86932 | # encoding: UTF-8
defineDict = {}
typedefDict = {}
#//////////////////////////////////////////////////////////////////////
#@company shanghai liber information Technology Co.,Ltd
#@file SecurityFtdcUserApiDataType.h
#@brief 定义业务数据类型
#//////////////////////////////////////////////////////////////////////
#/////////... | mit |
martinbarnard/beebRecipeParser | languages/sk.py | 161 | 6877 | # coding: utf8
{
'!langcode!': 'sk',
'!langname!': 'Slovenský',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" je voliteľný výraz ako "field1=\'newvalue\'". Nemôžete upravovať alebo zmazať výsledky JOINu',
'%s %%{row} deleted': '%s zmazaných... | gpl-3.0 |
fllodrab/Practica1 | venv/lib/python2.7/site-packages/pip/commands/show.py | 147 | 2749 | import os
import pkg_resources
from pip.basecommand import Command
from pip.log import logger
class ShowCommand(Command):
"""Show information about one or more installed packages."""
name = 'show'
usage = """
%prog [options] <package> ..."""
summary = 'Show information about installed packages.'... | gpl-3.0 |
ecoal95/servo | tests/wpt/web-platform-tests/tools/third_party/html5lib/html5lib/treebuilders/etree.py | 64 | 12752 | from __future__ import absolute_import, division, unicode_literals
# pylint:disable=protected-access
from six import text_type
import re
from . import base
from .. import _ihatexml
from .. import constants
from ..constants import namespaces
from .._utils import moduleFactoryFactory
tag_regexp = re.compile("{([^}]*)... | mpl-2.0 |
jhg/django | django/forms/forms.py | 26 | 27993 | """
Form classes
"""
from __future__ import unicode_literals
import copy
import datetime
from collections import OrderedDict
from django.core.exceptions import NON_FIELD_ERRORS, ValidationError
from django.forms.fields import Field, FileField
from django.forms.utils import ErrorDict, ErrorList, flatatt
from django.f... | bsd-3-clause |
Martoni/periphondemand | periphondemand/bin/core/library.py | 2 | 6356 | #! /usr/bin/python3
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# Name: library.py
# Purpose:
# Author: Fabien Marteau <fabien.marteau@armadeus.com>
# Created: 28/04/2009
# ----------------------------------------------------------------------------
# C... | lgpl-2.1 |
sbesson/openmicroscopy | components/tools/OmeroWeb/test/integration/test_login.py | 3 | 4352 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2016 University of Dundee & Open Microscopy Environment.
# All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Founda... | gpl-2.0 |
inveniosoftware/invenio-classifier | invenio_classifier/extractor.py | 1 | 9228 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2008, 2009, 2010, 2011, 2013, 2014, 2015, 2016 CERN.
#
# Invenio 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 th... | gpl-2.0 |
adlius/osf.io | api/guids/serializers.py | 7 | 2876 | from future.moves.urllib.parse import urljoin
from django.urls import resolve, reverse
from api.base.serializers import (JSONAPISerializer, IDField, TypeField, RelationshipField, LinksField)
from api.base.utils import absolute_reverse
from osf.models import OSFUser, AbstractNode, Registration, Guid, BaseFileNode
from... | apache-2.0 |
KodiColdkeys/coldkeys-addons | repository/plugin.video.white.devil/resources/lib/sources/onlinedizi_tv.py | 6 | 5099 | # -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 Exodus
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 l... | gpl-2.0 |
sergmelikyan/murano | murano/packages/exceptions.py | 3 | 1561 | # Copyright (c) 2014 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | apache-2.0 |
Sjord/django-oidc-provider | oidc_provider/tests/test_userinfo_endpoint.py | 2 | 2719 | from datetime import timedelta
from django.core.urlresolvers import reverse
from django.test import RequestFactory
from django.test import TestCase
from django.utils import timezone
from oidc_provider.lib.utils.token import *
from oidc_provider.models import *
from oidc_provider.tests.utils import *
from oidc_provide... | mit |
stefanseibert/DataMining | experiment01/01_finance/b102_stockMarketPrediction.py | 2 | 3650 | # -*- coding:utf8 -*-
# author: Stefan Seibert
# File for task 3.1.2
import pandas as pd
from matplotlib import pyplot as plt
from sklearn import svm
pd.set_option('display.max_columns', None)
pd.set_option('display.max_rows', None)
def getmae(actual, predicted):
return sum(abs(actual - predicted))/len(actual)
... | mit |
AmatanHead/collective-blog | user/views.py | 1 | 7600 | """Profile views
Note that for auth process, default views are used. See `urls.py`.
"""
from django.core.urlresolvers import reverse
from django.contrib import messages
from django.contrib.auth import get_user_model
from django.contrib.auth.decorators import login_required
from django.db.models import Q, Count
from ... | mit |
bzennn/blog_flask | python/lib/python3.5/site-packages/alembic/config.py | 9 | 17098 | from argparse import ArgumentParser
from .util.compat import SafeConfigParser
import inspect
import os
import sys
from . import command
from . import util
from . import package_dir
from .util import compat
class Config(object):
"""Represent an Alembic configuration.
Within an ``env.py`` script, this is ava... | gpl-3.0 |
huchoi/edx-platform | cms/djangoapps/contentstore/features/subsection.py | 13 | 5109 | # pylint: disable=C0111
# pylint: disable=W0621
from lettuce import world, step
from common import *
from nose.tools import assert_equal # pylint: disable=E0611
############### ACTIONS ####################
@step('I have opened a new course section in Studio$')
def i_have_opened_a_new_course_section(step):
open... | agpl-3.0 |
Pexego/odoo | addons/point_of_sale/report/pos_details.py | 99 | 9296 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
saurabh6790/medapp | controllers/trends.py | 30 | 10370 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.utils import add_days, add_months, cstr, getdate
from webnotes import _
def get_columns(filters, trans):
validate_fil... | agpl-3.0 |
Maximilian-Reuter/SickRage-1 | lib/sqlalchemy/dialects/mysql/zxjdbc.py | 78 | 3777 | # mysql/zxjdbc.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
"""
.. dialect:: mysql+zxjdbc
:name: zxjdbc for Jython
:dbapi: zxjdbc
:co... | gpl-3.0 |
petemounce/ansible | lib/ansible/modules/cloud/google/gcp_healthcheck.py | 37 | 16066 | #!/usr/bin/python
# Copyright 2017 Google 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 vers... | gpl-3.0 |
mathandy/svgpathtools | examples/compute-many-points-quickly-using-numpy-arrays.py | 1 | 1825 | """The goal of this gist is to show how to compute many points on a path
quickly using NumPy arrays. I.e. there's a much faster way than using, say
[some_path.point(t) for t in many_tvals]. The example below assumes the
`Path` object is composed entirely of `CubicBezier` objects, but this can
easily be generalized ... | mit |
mancoast/CPythonPyc_test | fail/300_test_memoryview.py | 2 | 7866 | """Unit tests for the memoryview
XXX We need more tests! Some tests are in test_bytes
"""
import unittest
import test.support
import sys
import gc
import weakref
class CommonMemoryTests:
#
# Tests common to direct memoryviews and sliced memoryviews
#
base_object = b"abcdef"
def check_getitem_w... | gpl-3.0 |
larsmans/numpy | numpy/distutils/cpuinfo.py | 173 | 22970 | #!/usr/bin/env python
"""
cpuinfo
Copyright 2002 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@cens.ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy (BSD style) license. See LICENSE.txt that came with
this distribution for specifics.
NO WARRANTY IS EXP... | bsd-3-clause |
jjmiranda/edx-platform | lms/djangoapps/course_api/blocks/tests/test_api.py | 16 | 4282 | """
Tests for Blocks api.py
"""
from django.test.client import RequestFactory
from student.tests.factories import UserFactory
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import SampleCourseFactory... | agpl-3.0 |
Oslandia/vizitown_plugin | twisted/python/usage.py | 42 | 34058 | # -*- test-case-name: twisted.test.test_usage -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
twisted.python.usage is a module for parsing/handling the
command line of your program.
For information on how to use it, see
U{http://twistedmatrix.com/projects/core/documentation/howto/opti... | gpl-2.0 |
Axilent/talkback | talkback/core.py | 1 | 7737 | """
Core Talkback classes.
"""
from UserDict import DictMixin
from talkback.utils import gf
from textblob.classifiers import NaiveBayesClassifier as Classifier # TODO is this the right choice?
import yaml
from types import TupleType, StringType
from threading import local as threadlocal
class Session(object):
"""... | mit |
toddberreth/gensim | gensim/test/svd_error.py | 71 | 7330 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Radim Rehurek <radimrehurek@seznam.cz>
"""USAGE: %(program)s MATRIX.mm [CLIP_DOCS] [CLIP_TERMS]
Check truncated SVD error for the algo in gensim, using a given corpus. This script
runs the decomposition with several internal parameters (number of r... | gpl-3.0 |
kostimarko/portfolio-v2 | node_modules/pygmentize-bundled/vendor/pygments/pygments/formatters/_mapping.py | 263 | 5508 | # -*- coding: utf-8 -*-
"""
pygments.formatters._mapping
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Formatter mapping defintions. This file is generated by itself. Everytime
you change something on a builtin formatter defintion, run this script from
the formatters folder to update it.
Do not alter the FORMA... | mit |
HyperBaton/ansible | lib/ansible/module_utils/remote_management/dellemc/dellemc_idrac.py | 37 | 2134 | # -*- coding: utf-8 -*-
#
# Dell EMC OpenManage Ansible Modules
# Version 1.0
# Copyright (C) 2018 Dell Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# All rights reserved. Dell, EMC, and other trademarks are trademarks of Dell Inc. or its subsidiaries.
# Other trad... | gpl-3.0 |
throwable-one/lettuce | tests/functional/test_file_system.py | 21 | 3189 | #!/usr/bin/env python
# -*- coding: utf-8; -*-
#
# Copyright (C) 2009 Gabriel Falcão <gabriel@nacaolivre.org>
# Copyright (C) 2009 Bernardo Heynemann <heynemann@gmail.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 th... | gpl-3.0 |
Juniper/tempest | tempest/api/identity/v2/test_api_discovery.py | 4 | 2391 | # Copyright 2015 OpenStack Foundation.
# Copyright 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
#
# U... | apache-2.0 |
mdavid/horizon | horizon/middleware.py | 46 | 9937 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | apache-2.0 |
BIT-SYS/gem5-spm-module | src/arch/x86/isa/insts/simd128/integer/shift/right_arithmetic_shift.py | 91 | 3243 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# 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 implemen... | bsd-3-clause |
appknox/xysec_adb | xysec_adb/pylib/symbols/elf_symbolizer_unittest.py | 108 | 5692 | #!/usr/bin/env python
# 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.
import functools
import logging
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(__file__))
import elf_symboliz... | apache-2.0 |
tvtsoft/odoo8 | openerp/addons/base/module/report/ir_module_reference_print.py | 46 | 1845 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp import models, api
class IrModelReferenceReport(models.AbstractModel):
_name = 'report.base.report_irmodulereference'
@api.model
def _object_find(self, module):
model_data_obj = self.en... | agpl-3.0 |
qedi-r/home-assistant | homeassistant/components/clicksend_tts/notify.py | 3 | 3260 | """clicksend_tts platform for notify component."""
import json
import logging
from aiohttp.hdrs import CONTENT_TYPE
import requests
import voluptuous as vol
from homeassistant.const import (
CONF_API_KEY,
CONF_RECIPIENT,
CONF_USERNAME,
CONTENT_TYPE_JSON,
)
import homeassistant.helpers.config_validatio... | apache-2.0 |
stevekuznetsov/ansible | lib/ansible/plugins/action/nxos_config.py | 79 | 4194 | #
# Copyright 2015 Peter Sprygada <psprygada@ansible.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) any... | gpl-3.0 |
radio-helsinki-graz/pv | pv/settings.py | 2 | 2515 | # -*- coding: utf-8 -*-
# Django settings for pv project.
import os.path
PROJECT_DIR = os.path.dirname(__file__)
DEBUG = True
ADMINS = ()
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(PROJECT_DIR, 'dev_data.sqlite'),
},
'nop'... | agpl-3.0 |
kjw0106/GCM_app_server | venv/lib/python2.7/site-packages/sqlalchemy/sql/visitors.py | 55 | 10271 | # sql/visitors.py
# Copyright (C) 2005-2016 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
"""Visitor/traversal interface and library functions.
SQLAlchemy schema and express... | mit |
alilotfi/django | tests/admin_registration/tests.py | 266 | 4640 | from __future__ import unicode_literals
from django.contrib import admin
from django.contrib.admin.decorators import register
from django.contrib.admin.sites import site
from django.core.exceptions import ImproperlyConfigured
from django.test import SimpleTestCase
from .models import Location, Person, Place, Traveler... | bsd-3-clause |
1ns/project-r2 | web/themes/contrib/bootstrap_sass_starterkit/node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py | 2354 | 10366 | # Unmodified from http://code.activestate.com/recipes/576693/
# other than to add MIT license header (as specified on page, but not in code).
# Linked from Python documentation here:
# http://docs.python.org/2/library/collections.html#collections.OrderedDict
#
# This should be deleted once Py2.7 is available on all bot... | gpl-2.0 |
Anwesh43/numpy | numpy/f2py/cb_rules.py | 153 | 22230 | #!/usr/bin/env python
"""
Build call-back mechanism for f2py2e.
Copyright 2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
$Date: 20... | bsd-3-clause |
sebastien/easyhg | src/urwid/font.py | 8 | 21318 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Urwid BigText fonts
# Copyright (C) 2004-2006 Ian Ward
#
# 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... | gpl-2.0 |
joshisa/taiga-back | taiga/projects/migrations/0019_auto_20150311_0821.py | 26 | 1481 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import djorm_pgarray.fields
class Migration(migrations.Migration):
dependencies = [
('projects', '0018_auto_20150219_1606'),
]
operations = [
migrations.AlterField(
model... | agpl-3.0 |
mkret2/root | interpreter/llvm/src/utils/lit/lit/run.py | 55 | 8990 | import os
import threading
import time
import traceback
try:
import Queue as queue
except ImportError:
import queue
try:
import win32api
except ImportError:
win32api = None
try:
import multiprocessing
except ImportError:
multiprocessing = None
import lit.Test
###
# Test Execution Implementat... | lgpl-2.1 |
gsmartway/odoo | addons/hr_attendance/res_config.py | 434 | 1406 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
xguse/spartan | src/spartan/utils/spreadsheets.py | 1 | 3132 | # spreadsheets.py is part of the 'spartan' package.
# It was written by Gus Dunn and was created on 6/19/14.
#
# Please see the license info in the root folder of this package.
"""
=================================================
spreadsheets.py
=================================================
Purpose:
Helper functi... | mit |
qsnake/git | git_remote_helpers/git/exporter.py | 17 | 1629 | import os
import subprocess
import sys
class GitExporter(object):
"""An exporter for testgit repositories.
The exporter simply delegates to git fast-export.
"""
def __init__(self, repo):
"""Creates a new exporter for the specified repo.
"""
self.repo = repo
def export_r... | gpl-2.0 |
40223137/cdag7test37 | static/Brython3.1.3-20150514-095342/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 |
biodrone/plex-desk | desk/flask/lib/python3.4/site-packages/pip/_vendor/lockfile/symlinklockfile.py | 487 | 2613 | from __future__ import absolute_import
import time
import os
from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout,
AlreadyLocked)
class SymlinkLockFile(LockBase):
"""Lock access to a file using symlink(2)."""
def __init__(self, path, threaded=True, timeout=None):
# s... | mit |
calfonso/ansible | lib/ansible/utils/module_docs_fragments/ce.py | 58 | 2821 | #
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope t... | gpl-3.0 |
katiecheng/Bombolone | env/lib/python2.7/site-packages/bson/errors.py | 17 | 1154 | # Copyright 2009-2012 10gen, 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 |
jobovy/galpy | galpy/df/isotropicHernquistdf.py | 1 | 2571 | # Class that implements isotropic spherical Hernquist DF
# computed using the Eddington formula
import numpy
from ..util import conversion
from ..potential import evaluatePotentials,HernquistPotential
from .sphericaldf import isotropicsphericaldf
class isotropicHernquistdf(isotropicsphericaldf):
"""Class that impl... | bsd-3-clause |
mbudiu-bfn/bcc | examples/networking/tunnel_monitor/monitor.py | 9 | 2896 | #!/usr/bin/env python
# Copyright (c) PLUMgrid, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
from bcc import BPF
from ctypes import c_uint, c_int, c_ulonglong, Structure
import json
from netaddr import IPAddress
from os import rename
from pyroute2 import IPRoute, NetNS, IPDB, NSPopen
import sy... | apache-2.0 |
jorik041/phantomjs | src/breakpad/src/tools/gyp/test/generator-output/gyptest-rules.py | 151 | 1702 | #!/usr/bin/env python
# Copyright (c) 2009 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.
"""
Verifies --generator-output= behavior when using rules.
"""
import TestGyp
test = TestGyp.TestGyp()
test.writable(test.workpath('rule... | bsd-3-clause |
zrhans/pythonanywhere | .virtualenvs/django19/lib/python3.4/site-packages/numpy/distutils/command/config_compiler.py | 250 | 4379 | from __future__ import division, absolute_import, print_function
from distutils.core import Command
from numpy.distutils import log
#XXX: Linker flags
def show_fortran_compilers(_cache=[]):
# Using cache to prevent infinite recursion
if _cache: return
_cache.append(1)
from numpy.distutils.fcompiler i... | apache-2.0 |
QinerTech/QinerApps | openerp/addons/auth_crypt/__openerp__.py | 23 | 1309 | # -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Password Encryption',
'version': '2.0',
'author': ['Odoo SA', 'FS3'],
'maintainer': 'OpenERP SA',
'category': 'Tools',
'description': """
Encrypted passwords
===================
Repla... | gpl-3.0 |
winndows/cinder | cinder/db/sqlalchemy/migrate_repo/versions/039_add_parent_id_to_backups.py | 20 | 1224 | # Copyright 2014 TrilioData, Inc
# Copyright (c) 2015 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/license... | apache-2.0 |
proxysh/Safejumper-for-Desktop | buildlinux/env32/local/lib/python2.7/types.py | 304 | 2040 | """Define names for all type symbols known in the standard interpreter.
Types that are part of optional modules (e.g. array) are not listed.
"""
import sys
# Iterators in Python aren't a matter of type but of protocol. A large
# and changing number of builtin types implement *some* flavor of
# iterator. Don't check... | gpl-2.0 |
rameshvs/nipype | nipype/interfaces/mrtrix/tests/test_auto_MRTransform.py | 5 | 1597 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.mrtrix.preprocess import MRTransform
def test_MRTransform_inputs():
input_map = dict(args=dict(argstr='%s',
),
debug=dict(argstr='-debug',
position=1,
),
environ=dict(nohash=True... | bsd-3-clause |
shakedel/tensorboard | tensorboard/plugins/profile/profile_demo.py | 2 | 2632 | # Copyright 2017 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 |
10171121/project-config-ci-name | tools/check_valid_gerrit_projects.py | 1 | 5147 | #!/usr/bin/env python
#
# Check that gerrit/projects.yaml contains valid entries.
#
# 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 |
DonBeo/statsmodels | statsmodels/miscmodels/tests/test_tarma.py | 37 | 4301 | # -*- coding: utf-8 -*-
"""
Created on Thu Jul 04 23:44:33 2013
Author: Josef Perktold
"""
import numpy as np
from numpy.testing import assert_allclose
from statsmodels.tsa.arima_process import arma_generate_sample
from statsmodels.miscmodels.tmodel import TArma
from statsmodels.tsa.arma_mle import Arma
#from stats... | bsd-3-clause |
donce/django-cms | cms/utils/permissions.py | 1 | 11839 | # -*- coding: utf-8 -*-
from threading import local
from django.contrib.auth import get_permission_codename, get_user_model
from django.contrib.auth.models import Group
from django.contrib.sites.models import Site
from django.db.models import Q
from cms.exceptions import NoPermissionsException
from cms.models import ... | bsd-3-clause |
PongPi/isl-odoo | addons/account/account_invoice.py | 93 | 79585 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
eceglov/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla_mock.py | 122 | 14927 | # Copyright (C) 2011 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 f... | bsd-3-clause |
undoware/neutron-drive | google_appengine/lib/protorpc/protorpc/wsgi/util.py | 5 | 5679 | #!/usr/bin/env python
#
# Copyright 2011 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 o... | bsd-3-clause |
gpitel/pyjs | examples/misc/flaskexamples/flaskcelery/public/services/jsonrpc/socketserver.py | 24 | 2774 | """
Copyright (c) 2006 Jan-Klaas Kollhof
This file is part of jsonrpc.
jsonrpc 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 ... | apache-2.0 |
korealerts1/sentry | tests/sentry/rules/test_processor.py | 29 | 1223 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from sentry.models import Rule
from sentry.plugins import plugins
from sentry.testutils import TestCase
from sentry.rules.processor import RuleProcessor
class RuleProcessorTest(TestCase):
# this test relies on a few other tests passing
def test_... | bsd-3-clause |
crosswalk-project/crosswalk-android-extensions | build/idl-generator/third_party/WebKit/Tools/Scripts/webkitpy/common/system/zipfileset_mock.py | 167 | 2166 | # Copyright (C) 2011 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 f... | bsd-3-clause |
yaroslavvb/tensorflow | tensorflow/python/ops/clip_ops.py | 11 | 10177 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
bgxavier/nova | nova/tests/functional/v3/test_floating_ips.py | 33 | 4658 | # Copyright 2014 IBM Corp.
#
# 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 t... | apache-2.0 |
akshmakov/Dolfin-Fijee-Fork | demo/documented/singular-poisson/python/demo_singular-poisson.py | 2 | 2531 | """
This demo program illustrates how to solve Poisson's equation
- div grad u(x, y) = f(x, y)
on the unit square with pure Neumann boundary conditions:
du/dn(x, y) = -sin(5*x)
and source f given by
f(x, y) = 10*exp(-((x - 0.5)^2 + (y - 0.5)^2) / 0.02)
Since only Neumann conditions are applied, u is o... | gpl-3.0 |
SoftwareKing/zstack-woodpecker | integrationtest/vm/virtualrouter/volume/test_crt_dup_data_volume_tmpt.py | 4 | 2116 | '''
Create Duplicated Volume Template from Same Data Volume
This case is from a bug, that duplicated volume template will share same file.
@author: Youyk
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
import ... | apache-2.0 |
kyvinh/home-assistant | tests/components/test_logger.py | 16 | 1989 | """The tests for the Logger component."""
from collections import namedtuple
import logging
import unittest
from homeassistant.bootstrap import setup_component
from homeassistant.components import logger
from tests.common import get_test_home_assistant
RECORD = namedtuple('record', ('name', 'levelno'))
class TestU... | apache-2.0 |
sbg/sevenbridges-python | sevenbridges/api.py | 1 | 4223 | from concurrent.futures import ThreadPoolExecutor
from requests.adapters import DEFAULT_POOLSIZE
from sevenbridges.errors import SbgError
from sevenbridges.http.client import HttpClient
from sevenbridges.models.app import App
from sevenbridges.models.file import File
from sevenbridges.models.task import Task
from se... | apache-2.0 |
RCMRD/FloodMapsWorkshop | python/eo1_ali_ndvi.py | 3 | 2444 | #!/usr/bin/env python
#
# Created on 07/11/2014 Pat Cappelaere - Vightel Corporation
#
# Input: EO1 GeoTiff L1T
# Output: NDVI
#
import os, inspect, sys
import argparse
import numpy
import math, time
import scipy
import scipy.cluster.vq as vq
from scipy import ndimage
from osgeo import gdal
from osgeo import osr
fr... | apache-2.0 |
morphis/home-assistant | homeassistant/__main__.py | 10 | 12156 | """Starts home assistant."""
from __future__ import print_function
import argparse
import os
import platform
import subprocess
import sys
import threading
from typing import Optional, List
from homeassistant.const import (
__version__,
EVENT_HOMEASSISTANT_START,
REQUIRED_PYTHON_VER,
REQUIRED_PYTHON_V... | apache-2.0 |
popazerty/obh-sh4 | lib/python/Components/Sources/FrontendInfo.py | 130 | 2058 | from enigma import iPlayableService
from Source import Source
from Components.PerServiceDisplay import PerServiceBase
from enigma import eDVBResourceManager
class FrontendInfo(Source, PerServiceBase):
def __init__(self, service_source = None, frontend_source = None, navcore = None):
self.navcore = None
Source.__i... | gpl-2.0 |
lessaworld/SQLpie | sqlpie/services/searcher.py | 1 | 16977 | # -*- coding: utf-8 -*-
"""
SQLpie License (MIT License)
Copyright (c) 2011-2016 André Lessa, http://sqlpie.com
See LICENSE file.
"""
from flask import g
import sqlpie
import json
from collections import defaultdict
import re
class Searcher(object):
QUERY_OPERATOR = "q"
NUM_RESULTS = "num"
START_RESULT... | mit |
gcp/leela-zero | training/minigo/convert_minigo.py | 1 | 8384 | #!/usr/bin/env python3
import gzip
import re
import os
import sys
import numpy as np
import tensorflow as tf
# Hide boring TF log statements
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '1' # or any {'0', '1', '2'}
def matches(name, parts):
return all(part in name for part in parts)
def deduped(names):
names = [r... | gpl-3.0 |
seem-sky/kbengine | kbe/res/scripts/common/Lib/test/test_unicode_file.py | 120 | 5939 | # Test some Unicode file name semantics
# We dont test many operations on files other than
# that their names can be used with Unicode characters.
import os, glob, time, shutil
import unicodedata
import unittest
from test.support import (run_unittest, rmtree,
TESTFN_ENCODING, TESTFN_UNICODE, TESTFN_UNENCODABLE, cr... | lgpl-3.0 |
ygol/odoo | addons/base_setup/__openerp__.py | 259 | 1750 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
vsajip/django | django/contrib/localflavor/fi/fi_municipalities.py | 109 | 10522 | # -*- coding: utf-8 -*-
"""
An alphabetical list of Finnish municipalities for use as `choices` in a
formfield.
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
from __future__ import unicode_literals
MUNICIPALITY_CHOICES = (
('akaa', "Akaa"),
('alajarvi'... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.