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 |
|---|---|---|---|---|---|
lalinsky/flask | tests/conftest.py | 149 | 3888 | # -*- coding: utf-8 -*-
"""
tests.conftest
~~~~~~~~~~~~~~
:copyright: (c) 2015 by the Flask Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import flask
import os
import sys
import pkgutil
import pytest
import textwrap
@pytest.fixture
def test_apps(monkeypatch):
... | bsd-3-clause |
vmanoria/bluemix-hue-filebrowser | hue-3.8.1-bluemix/desktop/core/src/desktop/management/commands/create_desktop_app.py | 35 | 3504 |
# adapted from django-extensions (http://code.google.com/p/django-command-extensions/)
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to y... | gpl-2.0 |
dive-tv/pyelasticache_client | pymemcache/pool.py | 9 | 3730 | # Copyright 2015 Yahoo.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 by applicable law or agreed to in writing, sof... | apache-2.0 |
ChristosChristofidis/bokeh | bokeh/server/app.py | 29 | 1288 | from __future__ import absolute_import
import flask
from os import walk
from os.path import join
from bokeh.settings import settings
class BokehBlueprint(flask.Blueprint):
def __init__(self, *args, **kwargs):
super(BokehBlueprint, self).__init__(*args, **kwargs)
self.debugjs = None
def setu... | bsd-3-clause |
lightness/EmploymentAgency | app/forms.py | 1 | 3108 | #coding: utf-8
from django.contrib.auth.forms import UserCreationForm
from django import forms
from app.models import *
from app.widgets import *
from django.template.defaultfilters import filesizeformat
from app.form_mixins import *
class ChooseRoleForm(forms.Form):
role = forms.CharField()
class TagForm(forms.... | unlicense |
KellyChan/Python | javascript/backbone/backbone-templates/backbone-fileupload/venvs/lib/python2.7/site-packages/django/contrib/markup/templatetags/markup.py | 12 | 4271 | """
Set of "markup" template filters for Django. These filters transform plain text
markup syntaxes to HTML; currently there is support for:
* Textile, which requires the PyTextile library available at
http://loopcore.com/python-textile/
* Markdown, which requires the Python-markdown library from
... | mit |
pgavin/carpe | site_scons/site_tools/cross_gnu.py | 1 | 9496 | # -*- python -*-
import SCons.Action
import SCons.Scanner
import SCons.Util
import SCons.Script
CrossCFileSuffix = '.c'
CrossCSuffixes = ['.c', '.h', '.S']
CrossASSuffixes = ['.s']
CrossObjSuffix = '.${CROSS_TARGET}.o'
CrossProgSuffix = '.$CROSS_TARGET'
CrossSRECSuffix = '.${CROSS_TARGET}.srec'
CrossCAction = SCons.A... | apache-2.0 |
pipermerriam/django | django/contrib/auth/checks.py | 374 | 2098 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import apps
from django.conf import settings
from django.core import checks
def check_user_model(**kwargs):
errors = []
cls = apps.get_model(settings.AUTH_USER_MODEL)
# Check that REQUIRED_FIELDS is a list
if not isins... | bsd-3-clause |
shuishoudage/CloudappCLI | env/lib/python2.7/site-packages/pip/_vendor/distlib/database.py | 129 | 49671 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2016 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""PEP 376 implementation."""
from __future__ import unicode_literals
import base64
import codecs
import contextlib
import hashlib
import logging
import os
import posixpath
import sys
import z... | gpl-3.0 |
dhenrygithub/QGIS | python/plugins/processing/algs/qgis/AutoincrementalField.py | 2 | 2825 | # -*- coding: utf-8 -*-
"""
***************************************************************************
AutoincrementalField.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
******************... | gpl-2.0 |
xuewei4d/scikit-learn | sklearn/ensemble/_hist_gradient_boosting/grower.py | 10 | 26830 | """
This module contains the TreeGrower class.
TreeGrower builds a regression tree fitting a Newton-Raphson step, based on
the gradients and hessians of the training data.
"""
# Author: Nicolas Hug
from heapq import heappush, heappop
import numpy as np
from timeit import default_timer as time
import numbers
from .sp... | bsd-3-clause |
miek/libsigrokdecode | decoders/mxc6225xu/__init__.py | 13 | 1106 | ##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2012 Uwe Hermann <uwe@hermann-uwe.de>
##
## 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 Li... | gpl-3.0 |
dya2/python-for-android | python3-alpha/extra_modules/gdata/youtube/__init__.py | 297 | 25623 | #!/usr/bin/python
#
# Copyright (C) 2008 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 ... | apache-2.0 |
andresguisado/andresguisado.github.io | node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/lexers/shell.py | 287 | 15340 | # -*- coding: utf-8 -*-
"""
pygments.lexers.shell
~~~~~~~~~~~~~~~~~~~~~
Lexers for various shells.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, do_insertions, bygroups, inclu... | mit |
petrutlucian94/nova_dev | nova/tests/api/openstack/compute/contrib/test_flavor_manage.py | 6 | 18258 | # Copyright 2011 Andrew Bogott for the Wikimedia 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-... | apache-2.0 |
digimarc/django | tests/validation/test_picklable.py | 576 | 2010 | import pickle
from unittest import TestCase
from django.core.exceptions import ValidationError
class PickableValidationErrorTestCase(TestCase):
def test_validationerror_is_picklable(self):
original = ValidationError('a', code='something')
unpickled = pickle.loads(pickle.dumps(original))
... | bsd-3-clause |
mindnervestech/mnrp | addons/project_issue_sheet/__init__.py | 442 | 1105 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
AlpineNow/python-alpine-api | future/datasource.py | 1 | 12125 | import json
from alpine.exception import *
from alpine.alpineobject import AlpineObject
class DataSource(AlpineObject):
def __init__(self, base_url=None, session=None, token = None):
super(DataSource, self).__init__(base_url, session, token)
###--- DB Data Source Functions ---###
def get_db_data... | mit |
gateway4labs/labmanager | labmanager/tests/deprecated/unit/fake_rlms.py | 5 | 1824 | """
This module provides a Fake RLMS for performing unit tests.
It is not registered by default. Call register_fake() to register it.
"""
import sys
import json
from labmanager.forms import AddForm, RetrospectiveForm, GenericPermissionForm
from labmanager.rlms import register, Laboratory
from labmanager.rlms.base im... | bsd-2-clause |
ChrisTruncer/Egress-Assess | protocols/servers/dns_resolved.py | 3 | 2007 | '''
This is a DNS Listening/server module that listens for requests, and
writes out data within A record requests to a file
'''
import base64
import time
from common import helpers
from scapy.all import *
class Server:
def __init__(self, cli_object):
self.protocol = "dns_resolved"
self.last_... | gpl-3.0 |
huiren/ece511 | src/arch/arm/kvm/BaseArmKvmCPU.py | 38 | 2283 | # Copyright (c) 2015 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 of the functionality ... | bsd-3-clause |
cloudbase/maas | src/maasserver/tests/test_api_pxeconfig.py | 1 | 13886 | # Copyright 2013 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Tests for PXE configuration retrieval from the API."""
from __future__ import (
absolute_import,
print_function,
unicode_literals,
)
str = None
__metaclass__ ... | agpl-3.0 |
murder77/electrum | lib/i18n.py | 21 | 1896 | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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-3.0 |
castelao/AutoQC | tests/Argo_gradient_test_validation.py | 4 | 4378 | import qctests.Argo_gradient_test
import util.testingProfile
import numpy
##### Argo_gradient_test ---------------------------------------------------
from util import obs_utils
def test_Argo_gradient_test_temperature_shallow():
'''
Make sure AGT is flagging postive and negative temperature spikes at shallow... | mit |
amboxer21/scrapy | scrapy/core/downloader/__init__.py | 24 | 6479 | import random
import warnings
from time import time
from collections import deque
from twisted.internet import reactor, defer, task
from scrapy.utils.defer import mustbe_deferred
from scrapy.utils.httpobj import urlparse_cached
from scrapy.resolver import dnscache
from scrapy.exceptions import ScrapyDeprecationWarnin... | bsd-3-clause |
Xaxetrov/OSCAR | oscar/agent/scripted/micro_manager.py | 1 | 3189 | from oscar.agent.custom_agent import CustomAgent
from oscar.util.micro_management import *
class MicroManager(CustomAgent):
# states
_IDLE = 0
_MOVING_CAMERA = 1
_MICRO_CONTROL = 2
def __init__(self, message="I hate you"):
self._message = message
self._state = MicroManager._IDLE
... | apache-2.0 |
icucinema/madcow | madcow/include/twitter.py | 5 | 98382 | #!/usr/bin/python2.4
#
# Copyright 2007 The Python-Twitter Developers
#
# 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... | gpl-3.0 |
skorokithakis/pythess-files | 044 - Πάλι DEVit/Markov/some_of_django.py | 1 | 74505 | from unittest import mock
from django.core.checks import Error, Warning as DjangoWarning
from django.db import connection, models
from django.db.models.fields.related import ForeignObject
from django.test.testcases import SimpleTestCase
from django.test.utils import isolate_apps, override_settings
@isolate_apps('inv... | mit |
NexusIS/tempest | tempest/api/compute/floating_ips/test_floating_ips_actions.py | 9 | 5803 | # Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
glotaran/glotaran | glotaran/builtin/models/doas/doas_result.py | 1 | 2581 | import typing
import numpy as np
import xarray as xr
from scipy import fftpack
import glotaran
from glotaran.parameter import ParameterGroup
from glotaran.builtin.models.kinetic_spectrum.kinetic_spectrum_result import \
finalize_kinetic_spectrum_result
def finalize_doas_data(
model: 'glotaran.models.doas.Doa... | gpl-3.0 |
dbbhattacharya/kitsune | vendor/packages/logilab-astng/test/data/SSL1/Connection1.py | 9 | 1238 | # copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
# copyright 2003-2010 Sylvain Thenault, all rights reserved.
# contact mailto:thenault@gmail.com
#
# This file is part of logilab-astng.
#
# logilab-astng is free software: you can redi... | bsd-3-clause |
shuttl-io/shuttl | shuttl/Models/FileTree/FileObjects/JsFile.py | 1 | 1404 | from .FileObject import FileObject
from flask import send_from_directory
from shuttl import db
class JsFile(FileObject):
##Id of the javascript. Because of the way inheritance is set up in sqlalchemy, this is a foreignKey
id = db.Column(db.Integer, db.ForeignKey('file_object.id'), primary_key=True)
## The... | mit |
honnibal/spaCy | spacy/cli/train.py | 1 | 27617 | # coding: utf8
from __future__ import unicode_literals, division, print_function
import plac
import os
from pathlib import Path
from thinc.neural._classes.model import Model
from timeit import default_timer as timer
import shutil
import srsly
from wasabi import msg
import contextlib
import random
from .._ml import cr... | mit |
0k/OpenUpgrade | addons/hr_evaluation/report/__init__.py | 441 | 1076 | # -*- encoding: 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 G... | agpl-3.0 |
andybalaam/qutebrowser | qutebrowser/browser/network/proxy.py | 10 | 2073 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2015 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | gpl-3.0 |
lilydjwg/nvchecker | tests/conftest.py | 1 | 2712 | # MIT licensed
# Copyright (c) 2020 lilydjwg <lilydjwg@gmail.com>, et al.
import asyncio
import structlog
import os
from pathlib import Path
import toml
import pytest
from nvchecker import core
from nvchecker import __main__ as main
from nvchecker.util import Entries, VersData, RawResult
use_keyfile = False
async ... | mit |
guylamar2006/android_kernel_samsung_smdk4412 | Documentation/target/tcm_mod_builder.py | 3119 | 42754 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
halvertoluke/edx-platform | openedx/core/djangoapps/content/course_structures/tasks.py | 78 | 3779 | """
Asynchronous tasks related to the Course Structure sub-application
"""
import json
import logging
from celery.task import task
from opaque_keys.edx.keys import CourseKey
from xmodule.modulestore.django import modulestore
log = logging.getLogger('edx.celery.task')
def _generate_course_structure(course_key):
... | agpl-3.0 |
waynedkim/sgs3-kernel | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
grap/OpenUpgrade | openerp-wsgi.py | 363 | 1811 | # WSGI Handler sample configuration file.
#
# Change the appropriate settings below, in order to provide the parameters
# that would normally be passed in the command-line.
# (at least conf['addons_path'])
#
# For generic wsgi handlers a global application is defined.
# For uwsgi this should work:
# $ uwsgi_python --... | agpl-3.0 |
gfetterman/bark | tests/test_datsegment.py | 2 | 2772 | import numpy as np
from bark.tools import datsegment
def test_first_pass1():
amp_stream = [(0, 0), (1, 1), (2, 1), (3, 1), (4, 0), (5, 0), (6, 11),
(7, 0)]
thresh = 0.5
starts, stops = datsegment.first_pass(amp_stream, thresh)
assert starts == [1, 6]
assert stops == [4, 7]
def ... | gpl-2.0 |
TalShafir/ansible | test/units/executor/test_playbook_executor.py | 16 | 6504 | # (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 |
mscdex/node-gyp | legacy/tools/gyp/tools/pretty_sln.py | 42 | 5099 | #!/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.
"""Prints the information in a sln file in a diffable way.
It first outputs each projects in alphabetical order with their
dependenci... | mit |
funkring/fdoo | addons/product/wizard/__init__.py | 452 | 1076 | # -*- 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... | agpl-3.0 |
hackedhead/shelves-proto | shelves/settings.py | 1 | 2265 | """
Django settings for shelves project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
im... | mit |
lidiamcfreitas/FenixScheduleMaker | ScheduleMaker/brython/www/tests/test_generators.py | 12 | 8834 | # examples from http://linuxgazette.net/100/pramode.html
def foo():
yield 1
yield 2
g = foo()
assert next(g)==1
assert next(g)==2
def foo():
return
yield 1
assert [x for x in foo()]==[]
def foo(n):
for i in range(2):
if (n < 3):
yield 1
else:
return
... | bsd-2-clause |
sidmitra/django_nonrel_testapp | django/contrib/databrowse/plugins/calendars.py | 247 | 4317 | from django import http
from django.db import models
from django.contrib.databrowse.datastructures import EasyModel
from django.contrib.databrowse.sites import DatabrowsePlugin
from django.shortcuts import render_to_response
from django.utils.text import capfirst
from django.utils.encoding import force_unicode
from dja... | bsd-3-clause |
krisys/django | tests/custom_columns/models.py | 282 | 1716 | """
Custom column/table names
If your database column name is different than your model attribute, use the
``db_column`` parameter. Note that you'll use the field's name, not its column
name, in API usage.
If your database table name is different than your model name, use the
``db_table`` Meta attribute. This has no ... | bsd-3-clause |
qenter/vlc-android | toolchains/arm/lib/python2.7/mailcap.py | 351 | 7427 | """Mailcap file handling. See RFC 1524."""
import os
__all__ = ["getcaps","findmatch"]
# Part 1: top-level interface.
def getcaps():
"""Return a dictionary containing the mailcap database.
The dictionary maps a MIME type (in all lowercase, e.g. 'text/plain')
to a list of dictionaries corresponding to ... | gpl-2.0 |
polimediaupv/edx-platform | cms/djangoapps/course_creators/admin.py | 232 | 4470 | """
django admin page for the course creators table
"""
from course_creators.models import CourseCreator, update_creator_state, send_user_notification, send_admin_notification
from course_creators.views import update_course_creator_group
from ratelimitbackend import admin
from django.conf import settings
from django.... | agpl-3.0 |
matmutant/sl4a | python/src/Lib/whichdb.py | 240 | 3353 | # !/usr/bin/env python
"""Guess which db package to use to open a db file."""
import os
import struct
import sys
try:
import dbm
_dbmerror = dbm.error
except ImportError:
dbm = None
# just some sort of valid exception which might be raised in the
# dbm test
_dbmerror = IOError
def whichdb(fil... | apache-2.0 |
cedi4155476/QGIS | python/plugins/db_manager/db_plugins/oracle/sql_dictionary.py | 15 | 14850 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS (Oracle)
Date : Aug 27, 2014
copyright : (C) 2014 by Médéric RIBREUX
email : meder... | gpl-2.0 |
fw1121/Pandoras-Toolbox-for-Bioinformatics | src/SPAdes/ext/src/python_libs/pyyaml3/composer.py | 273 | 4881 |
__all__ = ['Composer', 'ComposerError']
from .error import MarkedYAMLError
from .events import *
from .nodes import *
class ComposerError(MarkedYAMLError):
pass
class Composer:
def __init__(self):
self.anchors = {}
def check_node(self):
# Drop the STREAM-START event.
if self.ch... | gpl-3.0 |
Juniper/contrail-dev-controller | src/config/svc-monitor/svc_monitor/instance_manager.py | 1 | 29016 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2014 Cloudwatt
# 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/l... | apache-2.0 |
abhishekgahlot/youtube-dl | youtube_dl/extractor/ign.py | 107 | 5415 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
class IGNIE(InfoExtractor):
"""
Extractor for some of the IGN sites, like www.ign.com, es.ign.com de.ign.com.
Some videos of it.ign.com are also supported
"""
_VALID_URL = r'https?://.+?\.ign\.com/(?P<type>video... | unlicense |
AOSPU/external_chromium_org_tools_grit | grit/tool/build_unittest.py | 2 | 2136 | #!/usr/bin/env python
# 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.
'''Unit tests for the 'grit build' tool.
'''
import os
import sys
import tempfile
if __name__ == '__main__':
sys.path.append(os.... | bsd-2-clause |
vikas1885/test1 | lms/djangoapps/shoppingcart/migrations/0017_auto__add_field_courseregistrationcode_order__chg_field_registrationco.py | 114 | 15384 | # -*- 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):
# Adding field 'CourseRegistrationCode.order'
db.add_column('shoppingcart_courseregistrationcode', 'order',
... | agpl-3.0 |
wamonite/keepuppy | keepuppy/tests/test_files.py | 1 | 6901 | # -*- coding: utf-8 -*-
from keepuppy.files import FileLocal, FileSFTP
from keepuppy.exceptions import FileException
import os
import tempfile
from nose.tools import eq_, assert_true, assert_false, raises
from datetime import datetime
from sftp_server import SFTPAuth, SFTPServer
import logging
log = logging.getLogger... | mit |
kntem/webdeposit | modules/bibdocfile/lib/file.py | 39 | 1297 | ## This file is part of Invenio.
## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010, 2011 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 the
## License, or (at your ... | gpl-2.0 |
kikokubo/Sick-Beard-TPB | lib/unidecode/x0fb.py | 252 | 3838 | data = (
'ff', # 0x00
'fi', # 0x01
'fl', # 0x02
'ffi', # 0x03
'ffl', # 0x04
'st', # 0x05
'st', # 0x06
'[?]', # 0x07
'[?]', # 0x08
'[?]', # 0x09
'[?]', # 0x0a
'[?]', # 0x0b
'[?]', # 0x0c
'[?]', # 0x0d
'[?]', # 0x0e
'[?]', # 0x0f
'[?]', # 0x10
'[?]', # 0x11
'[?]', ... | gpl-3.0 |
storeys/django-storeys | examples/apps/app/settings.py | 1 | 4580 | """
Django settings for app project.
Generated by 'django-admin startproject' using Django 1.9.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
# Bui... | bsd-2-clause |
swc2124/skysurvey | setup.py | 1 | 3955 | """
-------------------------------------------------------------------------------
Author : Sol W. Courtney
Location : Columbia U Dept. of Astronomy & Astrophysics NYC, Ny
Email : swc2124@Columbia.edu
Date : June 2017
Title : skysurvey/setup.py
-----------------------------------------------... | mit |
edum1978/eduengage | boilerplate/external/wtforms/ext/appengine/fields.py | 55 | 4307 | from __future__ import unicode_literals
import decimal
import operator
import warnings
from wtforms import fields, widgets
from wtforms.compat import text_type, string_types
class ReferencePropertyField(fields.SelectFieldBase):
"""
A field for ``db.ReferenceProperty``. The list items are rendered in a
se... | lgpl-3.0 |
seanli9jan/tensorflow | tensorflow/python/kernel_tests/softsign_op_test.py | 3 | 2755 | # 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 |
gugahoi/maraschino | lib/werkzeug/testsuite/urls.py | 74 | 6868 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.urls
~~~~~~~~~~~~~~~~~~~~~~~
URL helper tests.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
from StringIO import StringIO
from werkzeug.testsuite import WerkzeugTestCase
from werkzeug.data... | mit |
rhattersley/iris | lib/iris/tests/test_concatenate.py | 7 | 34052 | # (C) British Crown Copyright 2013 - 2016, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | lgpl-3.0 |
rmfitzpatrick/ansible | contrib/inventory/stacki.py | 78 | 6285 | #!/usr/bin/env python
# Copyright (c) 2016, Hugh Ma <hugh.ma@flextronics.com>
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later v... | gpl-3.0 |
ar45/django | django/views/i18n.py | 264 | 12156 | import gettext as gettext_module
import importlib
import json
import os
from django import http
from django.apps import apps
from django.conf import settings
from django.core.urlresolvers import translate_url
from django.template import Context, Engine
from django.utils import six
from django.utils._os import upath
fr... | bsd-3-clause |
germn/python-for-android | tests/recipes/test_python3.py | 3 | 7800 | import unittest
from os.path import join
from unittest import mock
from pythonforandroid.recipes.python3 import (
NDK_API_LOWER_THAN_SUPPORTED_MESSAGE,
)
from pythonforandroid.util import BuildInterruptingException
from tests.recipes.recipe_lib_test import RecipeCtx
class TestPython3Recipe(RecipeCtx, unittest.T... | mit |
cameronmaske/skipper | skipper/aws/host.py | 1 | 14364 | from skipper.hosts import BaseHost
from skipper.instances import InstanceNotFound
from skipper.logger import log
from skipper.ssh import ssh_tunnel
from skipper.fleet import Fleet
from skipper.ports import parse_ports_list
from skipper.exceptions import NoSuchService
from ec2 import EC2, authorize_group, revoke_group
... | bsd-2-clause |
patrickm/chromium.src | native_client_sdk/src/doc/doxygen/generate_docs.py | 45 | 8799 | #!/usr/bin/python
# Copyright (c) 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 collections
import json
import optparse
import os
import shutil
import subprocess
import sys
import tempfile
import urllib2
S... | bsd-3-clause |
lpsinger/astropy | astropy/units/format/ogip.py | 5 | 14109 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICNSE.rst
# This module includes files automatically generated from ply (these end in
# _lextab.py and _parsetab.py). To generate these files, remove them from this
# folder, then build astropy and run the tests in-place:
#
# python setup.p... | bsd-3-clause |
fuhongliang/odoo | addons/delivery/stock.py | 119 | 10695 | # -*- 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 |
DR08/mxnet | example/ssd/dataset/iterator.py | 12 | 11832 | # 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 |
DG-i/openshift-ansible | roles/lib_openshift/src/lib/pvc.py | 4 | 4949 | # pylint: skip-file
# flake8: noqa
# pylint: disable=too-many-instance-attributes
class PersistentVolumeClaimConfig(object):
''' Handle pvc options '''
# pylint: disable=too-many-arguments
def __init__(self,
sname,
namespace,
kubeconfig,
... | apache-2.0 |
BT-ojossen/odoo | addons/auth_openid/res_users.py | 175 | 3602 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General P... | agpl-3.0 |
Ziemin/telepathy-gabble | tests/twisted/presence/initial-presence.py | 4 | 1354 | """
Tests setting your own presence before calling Connect(), allowing the user to
sign in as Busy/Invisible/whatever rather than available.
"""
from twisted.words.xish import domish
from gabbletest import exec_test
from servicetest import EventPattern, assertEquals, assertNotEquals
import ns
import constants as cs
f... | lgpl-2.1 |
agrista/odoo-saas | openerp/addons/base/res/__init__.py | 384 | 1261 | # -*- 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 |
liusashmily/three.js | utils/converters/ctm/join_ctm.py | 399 | 2521 | """Join multiple binary files into single file and generate JSON snippet with offsets
-------------------------------------
How to use
-------------------------------------
python join_ctm.py -i "part_*.ctm" -o joined.ctm [-j offsets.js]
Will read multiple files following wildcard pattern (ordered lexicographically)... | mit |
nttks/jenkins-test | lms/djangoapps/courseware/migrations/0005_auto__add_offlinecomputedgrade__add_unique_offlinecomputedgrade_user_c.py | 194 | 8410 | # -*- 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):
# Adding model 'OfflineComputedGrade'
db.create_table('courseware_offlinecomputedgrade', (
('id'... | agpl-3.0 |
gardner/youtube-dl | youtube_dl/jsinterp.py | 105 | 8846 | from __future__ import unicode_literals
import json
import operator
import re
from .utils import (
ExtractorError,
)
_OPERATORS = [
('|', operator.or_),
('^', operator.xor),
('&', operator.and_),
('>>', operator.rshift),
('<<', operator.lshift),
('-', operator.sub),
('+', operator.add... | unlicense |
Lucifer-Kim/scrapy | scrapy/spiders/__init__.py | 134 | 3606 | """
Base class for Scrapy spiders
See documentation in docs/topics/spiders.rst
"""
import logging
import warnings
from scrapy import signals
from scrapy.http import Request
from scrapy.utils.trackref import object_ref
from scrapy.utils.url import url_is_from_spider
from scrapy.utils.deprecate import create_deprecated... | bsd-3-clause |
Curso-OpenShift/Formulario | OverFlow/ProjectFormulario/env/lib/python2.7/site-packages/django/db/backends/postgresql/introspection.py | 51 | 10204 | from __future__ import unicode_literals
from collections import namedtuple
from django.db.backends.base.introspection import (
BaseDatabaseIntrospection, FieldInfo, TableInfo,
)
from django.utils.encoding import force_text
FieldInfo = namedtuple('FieldInfo', FieldInfo._fields + ('default',))
class DatabaseIntr... | gpl-3.0 |
andmarios/ansible-modules-core | web_infrastructure/django_manage.py | 55 | 11331 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Scott Anderson <scottanderson42@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 o... | gpl-3.0 |
choppsv1/iTerm2 | tests/esctest/escargs.py | 31 | 2509 | import argparse
# To enable this option, add the following line to ~/.Xresources:
# xterm*disallowedWindowOps:
# Then run "xrdb -merge ~/.Xresources" and restart xterm.
XTERM_WINOPS_ENABLED = "xtermWinopsEnabled"
DISABLE_WIDE_CHARS = "disableWideChars"
ACTION_RUN="run"
ACTION_LIST_KNOWN_BUGS="list-known-bugs"
parser... | gpl-2.0 |
ChristianVance/litecoin-master-0.8 | contrib/bitrpc/bitrpc.py | 239 | 7836 | 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:9332")
else:
access = Ser... | mit |
tst-ppenev/earthenterprise | earth_enterprise/src/scons/khEnvironment.py | 1 | 21875 | #
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | apache-2.0 |
sgerhart/ansible | lib/ansible/plugins/action/dellos6.py | 21 | 4051 | #
# (c) 2016 Red Hat Inc.
#
# (c) 2017 Dell EMC.
#
# 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 ve... | mit |
blueprintmrk/graphy | graphy/formatters.py | 254 | 6836 | #!/usr/bin/python2.4
#
# Copyright 2008 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... | apache-2.0 |
0k/odoo | addons/account/wizard/account_tax_chart.py | 385 | 3247 | # -*- 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 |
willthames/ansible | lib/ansible/plugins/terminal/dellos6.py | 48 | 2790 | # 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distri... | gpl-3.0 |
TheCoSMoCompany/biopredyn | Prototype/src/libsbml-5.10.0/src/bindings/python/test/sbml/TestGetMultipleObjects.py | 1 | 11709 | #
# @file TestGetMultipleObjects.py
# @brief GetMultipleObjects unit tests
#
# @author Akiya Jouraku (Python conversion)
# @author Sarah Keating
#
# ====== WARNING ===== WARNING ===== WARNING ===== WARNING ===== WARNING ======
#
# DO NOT EDIT THIS FILE.
#
# This file was generated automatically by converting ... | bsd-3-clause |
jayceyxc/hue | desktop/core/ext-py/boto-2.42.0/boto/cloudsearch/search.py | 153 | 13775 | # Copyright (c) 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 without... | apache-2.0 |
ppizarror/Hero-of-Antair | lib/pop.py | 1 | 60745 | # coding=utf-8
"""
POP
Ventanas emergentes de HOA.
Autor: PABLO PIZARRO @ ppizarror
Fecha: 2013-2015, 2017
Licencia: GPLv2
"""
# Importación de librerias
from lib import *
# Constantes del programa
if isWindows():
DEFAULT_FONT_TITLE = "Arial", 10
elif isOSX():
DEFAULT_FONT_TITLE = "Arial", 15
elif isLinux():... | gpl-2.0 |
boundarydevices/android_external_chromium_org | chrome/test/ispy/client/boto_bucket.py | 74 | 2729 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Implementation of CloudBucket using Google Cloud Storage as the backend."""
import os
import sys
# boto requires depot_tools/third_party be in the path. ... | bsd-3-clause |
caioserra/apiAdwords | examples/adspygoogle/dfp/v201311/creative_set_service/associate_creative_set_to_line_item.py | 2 | 2099 | #!/usr/bin/python
#
# Copyright 2013 Google 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 b... | apache-2.0 |
BudgieInWA/notebook-gen | notebook-gen.py | 1 | 6501 | #!/usr/bin/env python
from __future__ import print_function
import os
import sys
import argparse
import markdown
import pygments
from pygments.lexers import CppLexer, JavaLexer, CLexer, PythonLexer
from pygments.formatters import HtmlFormatter, TerminalFormatter, NullFormatter
start_delimiter = "/* START SOLUTION *... | mit |
jeanlinux/calibre | src/calibre/gui2/dialogs/choose_format_device.py | 15 | 2044 | __license__ = 'GPL v3'
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
from PyQt5.Qt import QDialog, QTreeWidgetItem, QIcon, QModelIndex
from calibre.gui2 import file_icon_provider
from calibre.gui2.dialogs.choose_format_device_ui import Ui_ChooseFormatDeviceDialog
class ChooseFormatDeviceDialog(QDial... | gpl-3.0 |
qtumproject/qtum | test/functional/qtum_assign_mpos_fees_to_gas_refund.py | 1 | 3586 | #!/usr/bin/env python3
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framework.script import *
from test_framework.mininode import *
from test_framework.address import *
from test_framework.qtum import *
import sys
import random
import time
import io
class ... | mit |
Anaphory/libpgm | libpgm/oldtablecpdfactorization.py | 1 | 19822 | # Copyright (c) 2012, CyberPoint International, LLC
# 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 lis... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.