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 |
|---|---|---|---|---|---|
toshywoshy/ansible | lib/ansible/modules/network/onyx/onyx_snmp.py | 9 | 19773 | #!/usr/bin/python
#
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
alexryndin/ambari | ambari-agent/src/main/python/ambari_agent/ClusterConfiguration.py | 3 | 5925 | #!/usr/bin/env python
"""
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")... | apache-2.0 |
atopuzov/nitro-python | nssrc/com/citrix/netscaler/nitro/resource/config/network/vridparam.py | 3 | 4003 | #
# Copyright (c) 2008-2015 Citrix Systems, 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 l... | apache-2.0 |
paolodedios/tensorflow | tensorflow/python/keras/tests/convert_to_constants_test.py | 6 | 6291 | # Copyright 2019 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 |
tiagoantao/tools-iuc | tools/cwpair2/cwpair2.py | 6 | 3371 | """
cwpair2.py
Takes a list of called peaks on both strands and produces a list of matched pairs and a list
of unmatched orphans using a specified method for finding matched pairs. Methods for finding
matched pairs are mode, closest, largest or all, where the analysis is run for each method
Input: list of one or mor... | mit |
CloudWareChile/OpenChile | openerp/addons/import_google/__init__.py | 9 | 1074 | # -*- 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 |
percyfal/bokeh | bokeh/util/datatypes.py | 13 | 1831 | '''
'''
class MultiValuedDict(object):
''' Store a mapping from keys to multiple values with minimal overhead.
Avoids storing empty collecctions.
'''
def __init__(self):
'''
'''
self._dict = dict()
def add_value(self, key, value):
'''
'''
if ke... | bsd-3-clause |
demon-ru/iml-crm | addons/auth_openid/res_users.py | 163 | 3778 | ##############################################################################
#
# 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 |
borovsky/libqmi | utils/qmidb/qmidb.py | 6 | 1448 | #!/usr/bin/env python
# -*- Mode: python; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
#
# 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, version 2.
#
# This program is distributed ... | gpl-2.0 |
AkademieOlympia/sympy | sympy/strategies/tools.py | 95 | 1313 | from __future__ import print_function, division
from . import rl
from .core import do_one, exhaust, switch
from .traverse import top_down
def subs(d, **kwargs):
""" Full simultaneous exact substitution
Examples
========
>>> from sympy.strategies.tools import subs
>>> from sympy import Basic
... | bsd-3-clause |
SnappleCap/oh-mainline | vendor/packages/gdata/tests/gdata_tests/docs/service_test.py | 39 | 17399 | #!/usr/bin/python
#
# Copyright 2009 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... | agpl-3.0 |
ThePletch/ansible | lib/ansible/modules/windows/win_environment.py | 23 | 3001 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Jon Hawkesworth (@jhawkesworth) <figs@unity.demon.co.uk>
#
# 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, eith... | gpl-3.0 |
juanchopanza/pyhistuples | pyhistuples/tests/test_axis.py | 1 | 1802 | '''
Test suite for histogram.axis class.
'''
__author__ = "Juan PALACIOS juan.palacios@nikhef.nl"
from nose import tools as nt
from pyhistuples.pyhistogram.histogram import Axis
def test_instantiate_axis() :
ax = Axis(100, -50, 50, "My first axis")
nt.assert_true(ax is not None)
def test_axis_parameters()... | gpl-3.0 |
morrisonlevi/FrameworkBenchmarks | go/setup.py | 1 | 1362 | import subprocess
import sys
import os
import setup_util
def start(args, logfile, errfile):
setup_util.replace_text("go/src/hello/hello.go", "tcp\(.*:3306\)", "tcp(" + args.database_host + ":3306)")
if os.name == 'nt':
#subprocess.call("rmdir /s /q pkg\\windows_amd64", shell=True, cwd="go")
#subprocess.cal... | bsd-3-clause |
drewandersonnz/openshift-tools | openshift/installer/vendored/openshift-ansible-3.9.14-1/roles/openshift_health_checker/test/openshift_check_test.py | 49 | 4070 | import pytest
from openshift_checks import OpenShiftCheck, OpenShiftCheckException
from openshift_checks import load_checks
# Fixtures
@pytest.fixture()
def task_vars():
return dict(foo=42, bar=dict(baz="openshift"))
@pytest.fixture(params=[
("notfound",),
("multiple", "keys", "not", "in", "task_vars... | apache-2.0 |
petemounce/ansible | lib/ansible/modules/network/nxos/nxos_vrf_interface.py | 46 | 9455 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
spanner888/madparts | export/detect.py | 2 | 1146 | # (c) 2013 Joost Yervante Damad <joost@damad.be>
# License: GPL
import eagle, kicad, madparts, kicad_old
MADPARTS = "madparts"
EAGLE = "eagle"
KICAD = "kicad"
KICAD_OLD = "kicad-old"
def detect(fn):
v = madparts.detect(fn)
if v is not None:
return (MADPARTS, v)
v = eagle.detect(fn)
if v is not None:
... | gpl-3.0 |
SUSE/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/load_balancer.py | 2 | 5896 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
telwertowski/QGIS | python/plugins/processing/core/outputs.py | 15 | 4537 | # -*- coding: utf-8 -*-
"""
***************************************************************************
Output.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
********************************... | gpl-2.0 |
jonathan-beard/edx-platform | cms/djangoapps/contentstore/migrations/0002_auto__del_field_videouploadconfig_status_whitelist.py | 108 | 4442 | # -*- 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):
# Deleting field 'VideoUploadConfig.status_whitelist'
db.delete_column('contentstore_videouploadconfig', 'st... | agpl-3.0 |
weilu/Hadoop-Resource-Aware-Scheduler | common/contrib/hod/support/logcondense.py | 8 | 8108 | #!/bin/sh
#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 ... | apache-2.0 |
doomsterinc/odoo | addons/mrp/product.py | 180 | 4590 | # -*- 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 |
tamihiro/grpc | src/python/grpcio/tests/interop/server.py | 7 | 2855 | # Copyright 2015, 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 |
b1-systems/kiwi | kiwi/bootloader/config/grub2.py | 1 | 32822 | # Copyright (c) 2015 SUSE Linux GmbH. All rights reserved.
#
# This file is part of kiwi.
#
# kiwi 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 la... | gpl-3.0 |
kidaa/pixie | pixie/vm/reader.py | 5 | 25507 | py_object = object
import pixie.vm.object as object
from pixie.vm.object import affirm, runtime_error
import pixie.vm.code as code
from pixie.vm.code import as_var
from pixie.vm.primitives import nil, true, false
import pixie.vm.numbers as numbers
from pixie.vm.cons import cons
from pixie.vm.symbol import symbol, Symbo... | lgpl-3.0 |
takinbo/rapidsms-borno | apps/ajax/app.py | 5 | 8308 | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import rapidsms
import cgi, urlparse, traceback
from threading import Thread
from SocketServer import ThreadingMixIn
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from django.utils.simplejson import JSONEncoder
from django.db.models.query import Quer... | lgpl-3.0 |
clebergnu/avocado-vt | virttest/installer.py | 7 | 6686 | """
Installer classes are responsible for building and installing virtualization
specific software components. This is the main entry point for tests that
wish to install virtualization software components.
The most common use case is to simply call make_installer() inside your tests.
"""
from avocado.core import exc... | gpl-2.0 |
sharmaeklavya2/zulip | zerver/migrations/0001_initial.py | 13 | 23623 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import bitfield.models
import django.db.models.deletion
import django.utils.timezone
from django.conf import settings
import zerver.models
class Migration(migrations.Migration):
dependencies = [
('au... | apache-2.0 |
thethythy/Mnemopwd | mnemopwd/test/test_certificat/client.py | 1 | 2847 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2016, Thierry Lemeunier <thierry at lemeunier dot net>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions ... | bsd-2-clause |
buqing2009/MissionPlanner | Lib/encodings/utf_16_le.py | 103 | 1079 | """ Python 'utf-16-le' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
encode = codecs.utf_16_le_encode
def decode(input, errors='strict'):
return codecs.utf_16_le_decode(input, errors, True)
class... | gpl-3.0 |
eamigo86/graphene-django-extras | tests/conftest.py | 1 | 3393 | import os
import sys
import django
from django.core import management
def pytest_addoption(parser):
parser.addoption(
"--no-pkgroot",
action="store_true",
default=False,
help="Remove package root directory from sys.path, ensuring that "
"graphene_django_extras is imported ... | mit |
viaict/viaduct | app/views/contact.py | 1 | 2562 | from flask import Blueprint, flash, redirect, render_template, url_for
from flask_babel import lazy_gettext as _
from flask_login import current_user
from app import db
from app.decorators import require_role
from app.forms import init_form
from app.forms.contact import ContactForm
from app.models.contact import Conta... | mit |
chengdh/openerp-ktv | openerp/addons/sale/company.py | 10 | 1399 | # -*- 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 |
nwalters512/the-blue-alliance | tests/test_event_team_status_helper.py | 3 | 55040 | import json
import unittest2
from appengine_fixture_loader.loader import load_fixture
from google.appengine.ext import testbed
from google.appengine.ext import ndb
from helpers.event_simulator import EventSimulator
from helpers.event_team_status_helper import EventTeamStatusHelper
from models.event import Event
from ... | mit |
n37r06u3/webpymail | imaplib2/__init__.py | 7 | 1490 | # -*- coding: utf-8 -*-
# imaplib2 python module, meant to be a replacement to the python default
# imaplib module
# Copyright (C) 2008 Helder Guerreiro
## This file is part of imaplib2.
##
## imaplib2 is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as p... | gpl-3.0 |
GabrielCebrianM/hm-tools | bd.py | 1 | 3191 | #!/usr/bin/python
#
# Copyright 2017 Gabriel Cebrian
#
# 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 appl... | apache-2.0 |
openstack/neutron-lib | neutron_lib/plugins/ml2/api.py | 1 | 47478 | # All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | apache-2.0 |
y12uc231/edx-platform | lms/djangoapps/bulk_email/migrations/0004_migrate_optout_user.py | 182 | 6009 | # -*- coding: utf-8 -*-
from south.db import db
from south.v2 import DataMigration
from django.core.exceptions import ObjectDoesNotExist
class Migration(DataMigration):
def forwards(self, orm):
# forwards data migration to copy over existing emails to associated ids
if not db.dry_run:
... | agpl-3.0 |
xingwu1/autorest | AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/StorageManagementClient/storagemanagementclient/storage_management_client.py | 2 | 5986 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
lbjay/cds-invenio | modules/elmsubmit/lib/elmsubmit_field_validation.py | 4 | 2925 | # -*- coding: utf-8 -*-
##
## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN.
##
## CDS 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 versio... | gpl-2.0 |
goblinhack/MundusMeus | python/things/snow_mound.py | 1 | 1029 | import tp
import mm
def thing_init(t):
return
total_snow_mound = 0
def snow_mound1_init(d1000_roll, tiles=[]):
global total_snow_mound
name = "snow_mound" + str(total_snow_mound + 1)
total_snow_mound = total_snow_mound + 1
x = tp.Tp(name=name,
is_snow_mound=True,
... | lgpl-3.0 |
tjsavage/full_nonrel_starter | django/core/management/commands/syncdb.py | 161 | 8141 | from optparse import make_option
import sys
from django.conf import settings
from django.core.management.base import NoArgsCommand
from django.core.management.color import no_style
from django.core.management.sql import custom_sql_for_model, emit_post_sync_signal
from django.db import connections, router, transaction,... | bsd-3-clause |
fangxingli/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/gis/db/backends/spatialite/operations.py | 47 | 15372 | import re
import sys
from decimal import Decimal
from django.contrib.gis.db.backends.base import BaseSpatialOperations
from django.contrib.gis.db.backends.util import SpatialOperation, SpatialFunction
from django.contrib.gis.db.backends.spatialite.adapter import SpatiaLiteAdapter
from django.contrib.gis.geometry.backe... | apache-2.0 |
konrad/kufpybio | kufpybio/genelistmerger.py | 1 | 5536 | import os
import sys
import kufpybio.helpers as helpers
import sqlite3
from kufpybio.gene import Gene
class GeneListMerger(object):
def __init__(self, min_overlap_percentage=None, perform_gene_merging=True):
# This flag influeces the general behavior. It it is set to
# True gene will be merged i.e... | isc |
Omegaphora/external_chromium_org | chrome/tools/history-viz.py | 176 | 8039 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Process a History database and dump a .dot file suitable for GraphViz.
This is useful for debugging history redirect flows.
An... | bsd-3-clause |
mozilla/django-session-csrf | setup.py | 3 | 1072 | import os
from setuptools import setup, find_packages
ROOT = os.path.abspath(os.path.dirname(__file__))
setup(
name='django-session-csrf',
version='0.7.1',
description='CSRF protection for Django without cookies.',
long_description=open(os.path.join(ROOT, 'README.rst')).read(),
author='Jeff Balog... | bsd-3-clause |
yohanko88/gem5-DC | configs/common/Options.py | 1 | 20572 | # Copyright (c) 2013 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 |
nhomar/odoo | addons/hw_scale/controllers/main.py | 106 | 6929 | # -*- coding: utf-8 -*-
import logging
import os
import time
from os import listdir
from os.path import join
from threading import Thread, Lock
from select import select
from Queue import Queue, Empty
import openerp
import openerp.addons.hw_proxy.controllers.main as hw_proxy
from openerp import http
from openerp.http ... | agpl-3.0 |
adblockplus/gyp | test/lib/TestMac.py | 151 | 2472 | # Copyright (c) 2014 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.
"""
TestMac.py: a collection of helper function shared between test on Mac OS X.
"""
import re
import subprocess
__all__ = ['Xcode', 'CheckFileType']
def Chec... | bsd-3-clause |
vigor/vigor_aosp_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 |
davidhax0r/Rocket | flask/lib/python2.7/site-packages/setuptools/site-patch.py | 358 | 2418 | def __boot():
import sys, os, os.path
PYTHONPATH = os.environ.get('PYTHONPATH')
if PYTHONPATH is None or (sys.platform=='win32' and not PYTHONPATH):
PYTHONPATH = []
else:
PYTHONPATH = PYTHONPATH.split(os.pathsep)
pic = getattr(sys,'path_importer_cache',{})
stdpath = sys.path[len... | mit |
levkar/odoo | addons/sale_order_dates/models/sale_order.py | 17 | 4154 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import timedelta
from odoo import api, fields, models, _
class SaleOrder(models.Model):
"""Add several date fields to Sale Orders, computed or user-entered"""
_inherit = 'sale.order'
commitme... | agpl-3.0 |
pombredanne/Rusthon | regtests/bench/richards.py | 2 | 8357 | '''
Richards
'''
# based on a Java version:
# Based on original version written in BCPL by Dr Martin Richards
# in 1981 at Cambridge University Computer Laboratory, England
# and a C++ version derived from a Smalltalk version written by
# L Peter Deutsch.
# Java version: Copyright (C) 1995 Sun Microsystems, Inc.... | bsd-3-clause |
jiangzhuo/kbengine | kbe/src/lib/python/Lib/test/test_keywordonlyarg.py | 84 | 7311 | """Unit tests for the keyword only argument specified in PEP 3102."""
__author__ = "Jiwon Seo"
__email__ = "seojiwon at gmail dot com"
import unittest
from test.support import run_unittest
def posonly_sum(pos_arg1, *arg, **kwarg):
return pos_arg1 + sum(arg) + sum(kwarg.values())
def keywordonly_sum(*, k1=0, k2):... | lgpl-3.0 |
EricCline/CEM_inc | env/lib/python2.7/site-packages/django/core/management/commands/startproject.py | 201 | 1323 | from django.core.management.base import CommandError
from django.core.management.templates import TemplateCommand
from django.utils.crypto import get_random_string
from django.utils.importlib import import_module
class Command(TemplateCommand):
help = ("Creates a Django project directory structure for the given "... | mit |
setten/pymatgen | pymatgen/io/abinit/abiobjects.py | 1 | 50073 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
Low-level objects providing an abstraction for the objects involved in the calculation.
"""
from __future__ import unicode_literals, division, print_function
import collections
import abc
import six
import ... | mit |
FireWRT/OpenWrt-Firefly-Libraries | staging_dir/host/lib/python2.7/lib-tk/Tkconstants.py | 375 | 1493 | # Symbolic constants for Tk
# Booleans
NO=FALSE=OFF=0
YES=TRUE=ON=1
# -anchor and -sticky
N='n'
S='s'
W='w'
E='e'
NW='nw'
SW='sw'
NE='ne'
SE='se'
NS='ns'
EW='ew'
NSEW='nsew'
CENTER='center'
# -fill
NONE='none'
X='x'
Y='y'
BOTH='both'
# -side
LEFT='left'
TOP='top'
RIGHT='right'
BOTTOM='bottom'
# -relief
RAISED='rai... | gpl-2.0 |
tyagiarpit/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/tests/test_parser.py | 451 | 3612 | from __future__ import absolute_import, division, unicode_literals
import os
import sys
import traceback
import warnings
import re
warnings.simplefilter("error")
from .support import get_data_files
from .support import TestData, convert, convertExpected, treeTypes
from html5lib import html5parser, constants
# Run t... | mpl-2.0 |
walterst/qiime | scripts/multiple_rarefactions.py | 15 | 5671 | #!/usr/bin/env python
# File created on 09 Feb 2010
from __future__ import division
__author__ = "Justin Kuczynski"
__copyright__ = "Copyright 2011, The QIIME Project"
__credits__ = ["Justin Kuczynski", "Greg Caporaso", "Jai Ram Rideout"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Justin Kuczynski... | gpl-2.0 |
nchammas/asyncssh | examples/local_forwarding_server.py | 2 | 1619 | #!/usr/bin/env python3.4
#
# Copyright (c) 2013-2015 by Ron Frederick <ronf@timeheart.net>.
# All rights reserved.
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License v1.0 which accompanies this
# distribution and is available at:
#
# http://www.eclipse... | epl-1.0 |
stevepeak/tornwrap | tornwrap/ratelimited.py | 1 | 2242 | import functools
def ratelimited(user=None, guest=None, redis_key_format="ratelimited.%s"):
"""Rate limit decorator
### Headers
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 567
X-RateLimit-Reset: 1242711173
### Status when rate limited
Status: 403 Forbidden
"""
if user:
... | apache-2.0 |
foligny/browsershots-psycopg2 | shotserver/shotserver04/accounts/views.py | 1 | 15999 | # browsershots.org - Test your web design in different browsers
# Copyright (C) 2007 Johann C. Rocholl <johann@browsershots.org>
#
# Browsershots 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 ... | gpl-3.0 |
Teamxrtc/webrtc-streaming-node | third_party/webrtc/src/chromium/src/tools/grit/grit/format/resource_map.py | 27 | 4029 | #!/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.
'''This file contains item formatters for resource_map_header and
resource_map_source files. A resource map is a mapping between r... | mit |
Eyepea/fail2ban | fail2ban/server/filtersystemd.py | 15 | 7968 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*-
# vi: set ft=python sts=4 ts=4 sw=4 noet :
# This file is part of Fail2Ban.
#
# Fail2Ban 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;... | gpl-2.0 |
jmartinm/invenio-master | modules/bibcheck/lib/plugins/texkey.py | 15 | 1977 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2013 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 option) a... | gpl-2.0 |
AMOboxTV/AMOBox.LegoBuild | script.navi-x/init/skin.py | 7 | 5396 | #############################################################################
#
# Navi-X Playlist browser
#
#############################################################################
#############################################################################
#
# skin.py:
# This file loads the GUI elements on the ... | gpl-2.0 |
alxmrtnz/portfolio2015 | .bundle/gems/pygments.rb-0.6.1/vendor/simplejson/setup.py | 34 | 2959 | #!/usr/bin/env python
import sys
from distutils.core import setup, Extension, Command
from distutils.command.build_ext import build_ext
from distutils.errors import CCompilerError, DistutilsExecError, \
DistutilsPlatformError
IS_PYPY = hasattr(sys, 'pypy_translation_info')
VERSION = '2.6.0'
DESCRIPTION = "Simple,... | mit |
Lujeni/ansible | lib/ansible/modules/monitoring/logicmonitor.py | 21 | 73790 | #!/usr/bin/python
# LogicMonitor Ansible module for managing Collectors, Hosts and Hostgroups
# Copyright (C) 2015 LogicMonitor
# 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
RETURN =... | gpl-3.0 |
blueboxgroup/neutron | neutron/plugins/vmware/extensions/vnicindex.py | 22 | 1594 | # Copyright 2015 VMware, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | apache-2.0 |
shangwuhencc/shogun | examples/undocumented/python_modular/features_sparse_modular.py | 26 | 1227 | #!/usr/bin/env python
import numpy
# create dense matrix A
A=numpy.array([[1,2,3],[4,0,0],[0,0,0],[0,5,0],[0,0,6],[9,9,9]], dtype=numpy.float64)
parameter_list=[[A]]
def features_sparse_modular (A):
from scipy.sparse import csc_matrix
from modshogun import SparseRealFeatures
from numpy import array, float64, all
... | gpl-3.0 |
anjos/rrbob | bootstrap-buildout.py | 172 | 6501 | ##############################################################################
#
# Copyright (c) 2006 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... | bsd-3-clause |
AkiraKito/fivalid | tests/validator_tests.py | 1 | 11335 | # -*- coding: utf-8 -*-
import sys, os
import unittest
sys.path.insert(0, os.path.join('..', 'fivalid'))
from validators import (
ValidationError, InvalidTypeError, InvalidValueError,
All, Any,
ValueAdapter,
Not,
Failure, Pass,
Number, FreeText, Equal, Regex,
AllowType, Prefix, Type, Length... | bsd-2-clause |
kingdave1000/davecoin | contrib/pyminer/pyminer.py | 1257 | 6438 | #!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file license.txt 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
im... | mit |
40223231/Final-Exam-with-classmate | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/__init__.py | 603 | 6082 | ## pygame - Python Game Library
## Copyright (C) 2000-2001 Pete Shinners
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; either
## version 2 of the License, or (... | gpl-3.0 |
BaconPancakes/valor | lib/youtube_dl/extractor/tonline.py | 71 | 2093 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import int_or_none
class TOnlineIE(InfoExtractor):
IE_NAME = 't-online.de'
_VALID_URL = r'https?://(?:www\.)?t-online\.de/tv/(?:[^/]+/)*id_(?P<id>\d+)'
_TEST = {
'url': 'http://www.t-online.de/t... | gpl-3.0 |
marklescroart/bvp | bvp/Classes/background.py | 1 | 11453 | # Imports
import os
import six
from bvp.utils.blender import add_group, grab_only, apply_material
from .constraint import ObConstraint, CamConstraint
from .mapped_class import MappedClass
from .object import Object
# Should be moved, along with test below
#from .Camera import Camera
#from .Scene import Scene
#from .Sk... | bsd-2-clause |
zzzombat/lucid-python-django | django/contrib/gis/geos/tests/test_io.py | 321 | 4159 | import binascii, ctypes, unittest
from django.contrib.gis.geos import GEOSGeometry, WKTReader, WKTWriter, WKBReader, WKBWriter, geos_version_info
class GEOSIOTest(unittest.TestCase):
def test01_wktreader(self):
# Creating a WKTReader instance
wkt_r = WKTReader()
wkt = 'POINT (5 23)'
... | bsd-3-clause |
gitlabhq/pygments.rb | vendor/pygments-main/pygments/styles/default.py | 364 | 2532 | # -*- coding: utf-8 -*-
"""
pygments.styles.default
~~~~~~~~~~~~~~~~~~~~~~~
The default highlighting style.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, Name, Com... | mit |
racker/python-raxcli | raxcli/apps/registry/commands/configuration/get.py | 1 | 1315 | # Copyright 2013 Rackspace
#
# 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 |
MosheBerman/brisket-mashup | source/libraries/simplejson-3.3.1/simplejson/tests/test_decimal.py | 147 | 2544 | import decimal
from decimal import Decimal
from unittest import TestCase
from simplejson.compat import StringIO, reload_module
import simplejson as json
class TestDecimal(TestCase):
NUMS = "1.0", "10.00", "1.1", "1234567890.1234567890", "500"
def dumps(self, obj, **kw):
sio = StringIO()
json.d... | mit |
crmccreary/openerp_server | openerp/addons/import_base/__init__.py | 9 | 1089 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Openerp sa (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... | agpl-3.0 |
legendtang/mitmproxy | libmproxy/contrib/jsbeautifier/unpackers/myobfuscate.py | 45 | 2811 | #
# deobfuscator for scripts messed up with myobfuscate.com
# by Einar Lielmanis <einar@jsbeautifier.org>
#
# written by Stefano Sanfilippo <a.little.coder@gmail.com>
#
# usage:
#
# if detect(some_string):
# unpacked = unpack(some_string)
#
# CAVEAT by Einar Lielmanis
#
# You really don't want to obfuscate yo... | mit |
lobiCode/VoterChat | models.py | 1 | 5261 | """
Copyright 2014 VoterChat
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distr... | apache-2.0 |
stormpath/stormpath-django | testproject/testproject/wsgi.py | 3 | 1444 | """
WSGI config for django_stormpath project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLI... | apache-2.0 |
scalingdata/Impala | tests/query_test/test_insert.py | 1 | 7872 | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Targeted Impala insert tests
#
import logging
import os
import pytest
from testdata.common import widetable
from tests.beeswax.impala_beeswax import ImpalaBeeswaxException
from tests.common.test_vector import *
from tests.common.impala_tes... | apache-2.0 |
unindented/streamcode | client/static/jsrepl/extern/python/closured/lib/python2.7/lib2to3/pgen2/conv.py | 325 | 9627 | # Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Convert graminit.[ch] spit out by pgen to Python code.
Pgen is the Python parser generator. It is useful to quickly create a
parser from a grammar file in Python's grammar notation. But I don't
wa... | mit |
cortedeltimo/SickRage | lib/concurrent/futures/thread.py | 14 | 5643 | # Copyright 2009 Brian Quinlan. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Implements ThreadPoolExecutor."""
import atexit
from concurrent.futures import _base
import itertools
import Queue as queue
import threading
import weakref
import sys
try:
from multiprocessing import cpu_coun... | gpl-3.0 |
PredictiveScienceLab/py-mcmc | demos/demo4.py | 2 | 4183 | """
This demo demonstrates how to use a mean function in a GP and allow the model
to discover the most important basis functions.
This model is equivalent to a Relevance Vector Machine.
Author:
Ilias Bilionis
Date:
3/20/2014
"""
import numpy as np
import GPy
import pymcmc as pm
import matplotlib.pyplot as ... | lgpl-3.0 |
transientlunatic/otter | otter/_version.py | 1 | 18447 |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... | isc |
varunagrawal/azure-services | varunagrawal/VarunWeb/env/Lib/site-packages/setuptools/command/test.py | 285 | 5932 | from setuptools import Command
from distutils.errors import DistutilsOptionError
import sys
from pkg_resources import *
from pkg_resources import _namespace_packages
from unittest import TestLoader, main
class ScanningLoader(TestLoader):
def loadTestsFromModule(self, module):
"""Return a suite of all test... | gpl-2.0 |
sallaire/Sick-Beard | sickbeard/notifiers/nma.py | 45 | 2072 | import sickbeard
from sickbeard import logger, common
from lib.pynma import pynma
class NMA_Notifier:
def test_notify(self, nma_api, nma_priority):
return self._sendNMA(nma_api, nma_priority, event="Test", message="Testing NMA settings from Sick Beard", force=True)
def notify_snatch(self, ep_nam... | gpl-3.0 |
genova/rapidsms-senegal | lib/rapidsms/tests/test_i18n.py | 3 | 1697 | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
import unittest, threading, time, datetime
#from django.test.client import Client
from rapidsms.i18n import ugettext_from_locale as _t
from rapidsms.i18n import ugettext_noop as _
from rapidsms.i18n import init
class TestI18n(unittest.TestCase):
d... | bsd-3-clause |
valkyriesavage/invenio | modules/websubmit/lib/functions/Move_to_Pending.py | 35 | 1983 | ## 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 |
jswope00/griffinx | common/djangoapps/terrain/stubs/lti.py | 13 | 12432 | """
Stub implementation of LTI Provider.
What is supported:
------------------
1.) This LTI Provider can service only one Tool Consumer at the same time. It is
not possible to have this LTI multiple times on a single page in LMS.
"""
from uuid import uuid4
import textwrap
import urllib
import re
from oauthlib.oauth... | agpl-3.0 |
huahbo/src | book/Recipes/rweutil.py | 5 | 3249 | from rsf.proj import *
# ------------------------------------------------------------
def C2Rdat(mapRC, mapCC,cos,par):
Flow( mapRC,[mapCC,cos],
'''
window |
spray axis=2 n=1 o=%(oz)g d=%(dz)g |
pad beg2=10 n2out=20 |
c2r adj=n linear=n nsz=3 nsx=3
rays=${SOU... | gpl-2.0 |
snopt/snopt-python | examples/snmainb.py | 1 | 7041 | """
An example SNOPTB problem.
"""
import numpy as np
from snopt import snoptb, SNOPT_options
def hexCon(mode,x,fCon,gCon,nState):
two = 2.0
fCon[ 0] = x[0]**2 + x[5]**2
fCon[ 1] = (x[1] - x[0])**2 + (x[6] - x[5])**2
fCon[ 2] = (x[2] - x[0])**2 + x[5]**2
fCon[ 3] = (x[0]... | mit |
haum/pelican-flickrtag | pelican_flickrtag/flickr.py | 1 | 51012 | """
flickr.py
Copyright 2004-2006 James Clarke <james@jamesclarke.info>
Portions Copyright 2007-2008 Joshua Henderson <joshhendo@gmail.com>
THIS SOFTWARE IS SUPPLIED WITHOUT WARRANTY OF ANY KIND, AND MAY BE
COPIED, MODIFIED OR DISTRIBUTED IN ANY WAY, AS LONG AS THIS NOTICE
AND ACKNOWLEDGEMENT OF AUTHORSHIP... | mit |
fintech-circle/edx-platform | openedx/core/djangoapps/cors_csrf/views.py | 24 | 2497 | """Views for enabling cross-domain requests. """
import json
import logging
from django.conf import settings
from django.http import HttpResponseNotFound
from django.views.decorators.cache import cache_page
from edxmako.shortcuts import render_to_response
from .models import XDomainProxyConfiguration
log = logging.... | agpl-3.0 |
Wikia/sparrow | apps/tasks/models.py | 1 | 2950 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
import django.dispatch
from django.utils.translation import ugettext as _
from django.core.urlresolvers import reverse
from django_enumfield import enum
import celery.states
from common.utils import build_absolute_uri
from te... | mit |
CforED/Machine-Learning | sklearn/externals/joblib/pool.py | 237 | 23894 | """Custom implementation of multiprocessing.Pool with custom pickler
This module provides efficient ways of working with data stored in
shared memory with numpy.memmap arrays without inducing any memory
copy between the parent and child processes.
This module should not be imported if multiprocessing is not
available... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.