repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
xiangel/hue | desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/SelfTest/Util/test_asn1.py | 113 | 10239 | # -*- coding: utf-8 -*-
#
# SelfTest/Util/test_asn.py: Self-test for the Crypto.Util.asn1 module
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is ... | apache-2.0 |
lhellebr/spacewalk | backend/server/rhnSQL/sql_table.py | 10 | 9292 | #
# Copyright (c) 2008--2016 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... | gpl-2.0 |
ChugR/qpid-dispatch | tools/scraper/router.py | 5 | 8270 | #!/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
# ... | apache-2.0 |
fidomason/kbengine | kbe/res/scripts/common/Lib/random.py | 91 | 26084 | """Random variable generators.
integers
--------
uniform within range
sequences
---------
pick random element
pick random sample
generate random permutation
distributions on the real line:
------------------------------
uniform
... | lgpl-3.0 |
PlushBeaver/FanFicFare | fanficfare/geturls.py | 1 | 9487 | # -*- coding: utf-8 -*-
# Copyright 2015 Fanficdownloader team, 2015 FanFicFare team
#
# 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
#
# Un... | gpl-3.0 |
lmazuel/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/virtual_network_gateways_operations.py | 1 | 66868 | # 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 |
StriveForBest/django-postman | postman/fields.py | 1 | 6320 | """
Custom fields.
"""
from __future__ import unicode_literals
import operator
from django.conf import settings
try:
from django.contrib.auth import get_user_model # Django 1.5
except ImportError:
from postman.future_1_5 import get_user_model
from django.core.exceptions import ValidationError
from django.core... | bsd-3-clause |
emon10005/scikit-image | setup.py | 11 | 4995 | #! /usr/bin/env python
descr = """Image Processing SciKit
Image processing algorithms for SciPy, including IO, morphology, filtering,
warping, color manipulation, object detection, etc.
Please refer to the online documentation at
http://scikit-image.org/
"""
DISTNAME = 'scikit-image'
DESCRIPTION = 'Image processing... | bsd-3-clause |
zdict/zdict | zdict/tests/dictionaries/test_spanish.py | 1 | 1920 | from pytest import raises
from unittest.mock import patch
from zdict.dictionaries.spanish import SpanishDict
from zdict.exceptions import NotFoundError
from zdict.zdict import get_args
class TestSpanishDict:
@classmethod
def setup_class(cls):
cls.dict = SpanishDict(get_args())
cls.en_word = '... | gpl-3.0 |
highfei2011/spark | examples/src/main/python/mllib/binary_classification_metrics_example.py | 106 | 2121 | #
# 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 us... | apache-2.0 |
tovrstra/sympy | sympy/thirdparty/pyglet/pyglet/window/win32/__init__.py | 5 | 43678 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | bsd-3-clause |
beblount/Steer-Clear-Backend-Web | env/Lib/site-packages/sqlalchemy/orm/exc.py | 81 | 5439 | # orm/exc.py
# Copyright (C) 2005-2015 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
"""SQLAlchemy ORM exceptions."""
from .. import exc as sa_exc, util
NO_STATE = (Attribut... | mit |
stvstnfrd/edx-platform | cms/djangoapps/contentstore/management/commands/backfill_orgs_and_org_courses.py | 5 | 11448 | """
A backfill command to migrate Open edX instances to the new world of
"organizations are enabled everywhere".
For full context, see:
https://github.com/edx/edx-organizations/blob/master/docs/decisions/0001-phase-in-db-backed-organizations-to-all.rst
"""
from typing import Dict, List, Set, Tuple
from django.core.ma... | agpl-3.0 |
napalm-automation/napalm-yang | napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/bgp/neighbors/neighbor/afi_safis/afi_safi/l3vpn_ipv4_multicast/prefix_limit/config/__init__.py | 1 | 38705 | # -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | apache-2.0 |
jralls/gramps | gramps/plugins/view/geoevents.py | 3 | 16552 | # -*- python -*-
# -*- coding: utf-8 -*-
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2011-2016 Serge Noiraud
#
# 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 ver... | gpl-2.0 |
Dimoks/ArxLibertatis_fork | plugins/blender/arx_addon/dataLlf.py | 2 | 3860 | # Copyright 2014-2021 Arx Libertatis Team (see the AUTHORS file)
#
# This file is part of Arx Libertatis.
#
# Arx Libertatis is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
... | gpl-3.0 |
azhurb/deep-learning | image-classification/problem_unittests.py | 91 | 7319 | import os
import numpy as np
import tensorflow as tf
import random
from unittest.mock import MagicMock
def _print_success_message():
print('Tests Passed')
def test_folder_path(cifar10_dataset_folder_path):
assert cifar10_dataset_folder_path is not None,\
'Cifar-10 data folder not set.'
assert ci... | mit |
rananda/report-engine | modules/clients/python-client/reclient.py | 4 | 12648 | """ ReportEngineClient
"""
import traceback,logging,os,re
import requests,json,StringIO
import jprops
import datetime,pytz
HEADERS = {'Content-Type':'application/json','accept':'application/json'}
TEST_STATUSES = ['Passed', 'Failed', 'Skipped', 'Running', 'NoStatus']
LOG_LEVELS=['ALL','DEBUG', 'INFO', 'WARNING', 'ERRO... | gpl-3.0 |
Lunabit/Gridback-Server | docs/conf.py | 1 | 5361 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Gridlight documentation build configuration file, created by
# sphinx-quickstart on Wed Jul 12 21:48:25 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# ... | agpl-3.0 |
wujuguang/sentry | tests/sentry/search/django/tests.py | 25 | 6409 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from datetime import datetime, timedelta
from sentry.models import GroupBookmark, GroupStatus, GroupTagValue
from sentry.search.django.backend import DjangoSearchBackend
from sentry.testutils import TestCase
class DjangoSearchBackendTest(TestCase):
... | bsd-3-clause |
elkingtonmcb/rethinkdb | external/v8_3.30.33.16/build/gyp/tools/pretty_gyp.py | 2618 | 4756 | #!/usr/bin/env python
# Copyright (c) 2012 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.
"""Pretty-prints the contents of a GYP file."""
import sys
import re
# Regex to remove comments when we're counting braces.
COMMENT_RE = ... | agpl-3.0 |
largeriver/twrp | qcom_msm8916_64_android5.0/sources/qcom/bootable/recovery/tools/ota/convert-to-bmp.py | 32 | 2607 | #!/usr/bin/python2.4
"""A simple script to convert asset images to BMP files, that supports
RGBA image."""
import struct
import Image
import sys
infile = sys.argv[1]
outfile = sys.argv[2]
if not outfile.endswith(".bmp"):
print >> sys.stderr, "Warning: I'm expecting to write BMP files."
im = Image.open(infile)
if... | mit |
popazerty/bh1 | lib/python/Screens/Menu.py | 3 | 9020 | from Screen import Screen
from Components.Sources.List import List
from Components.ActionMap import NumberActionMap
from Components.Sources.StaticText import StaticText
from Components.config import configfile
from Components.PluginComponent import plugins
from Components.config import config
from Components.SystemInfo... | gpl-2.0 |
yzl0083/orange | Orange/testing/testing.py | 6 | 21024 | """\
Orange unit testing
===================
This module contains some classes in common use by Orange unit testing
framework. In particular its most useful feature is the BaseTestOnData
(along with ``test_on_data`` function and ``datasets_driven`` class decorators)
class for automating data driven tests.
... | gpl-3.0 |
natetrue/ReplicatorG | skein_engines/skeinforge-0006/skeinforge_tools/unpause.py | 2 | 9756 | """
Unpause is a script to speed up a line segment to compensate for the delay of the microprocessor.
The default 'Activate Unpause' checkbox is on. When it is on, the functions described below will work, when it is off, the functions
will not be called.
The unpause script is based on the Shane Hathaway's patch to s... | gpl-2.0 |
kvar/ansible | lib/ansible/modules/source_control/gitlab_hook.py | 1 | 13800 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Guillaume Martinez (lunik@tiwabbit.fr)
# Copyright: (c) 2018, Marcus Watkins <marwatk@marcuswatkins.net>
# Based on code:
# Copyright: (c) 2013, Phillip Gentry <phillip@cx.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licens... | gpl-3.0 |
GinnyN/Team-Fortress-RPG-Generators | django/contrib/localflavor/mk/forms.py | 89 | 3582 | from __future__ import absolute_import
import datetime
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import RegexField, Select
from django.utils.translation import ugettext_lazy as _
from django.contrib.localflavor.mk.mk_choices import MK_MUNICIPALI... | bsd-3-clause |
appsoma/kafka | dev-utils/test-patch.py | 73 | 17007 | #!/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
# "... | apache-2.0 |
JenSte/libsigrokdecode | decoders/i2cfilter/__init__.py | 5 | 1451 | ##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2012 Bert Vermeulen <bert@biot.com>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the Lice... | gpl-3.0 |
ta2-1/pootle | pootle/apps/pootle_project/views.py | 1 | 11296 | # -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
from django.contrib import messages
from dja... | gpl-3.0 |
kbidarkar/automation-tools | automation_tools/beaker.py | 12 | 4121 | """Tools to work with Beaker (https://beaker-project.org/).
The ``bkr`` command-line utility must be available and configured. (Available
via the ``beaker-client`` package on Fedora.) See the `Installing and
configuring the client`_ section of the Beaker documentation.
.. _Installing and configuring the client:
h... | gpl-3.0 |
backtou/longlab | gnuradio-core/src/python/gnuradio/gr/prefs.py | 13 | 3739 | #
# Copyright 2006,2009 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later version... | gpl-3.0 |
vFense/vFenseAgent-nix | agent/deps/mac/Python-2.7.5/lib/python2.7/hotshot/__init__.py | 215 | 2670 | """High-perfomance logging profiler, mostly written in C."""
import _hotshot
from _hotshot import ProfilerError
from warnings import warnpy3k as _warnpy3k
_warnpy3k("The 'hotshot' module is not supported in 3.x, "
"use the 'profile' module instead.", stacklevel=2)
class Profile:
def __init__(self, logf... | lgpl-3.0 |
flyingSprite/spinelle | task_inventory/order_1_to_30/order_30_crawl_all_cainiao_stations.py | 1 | 5779 |
"""Order 30: Crawl all cainiao stations
from url 'https://cart.taobao.com/cart.htm?spm=875.7931836%2FB.a2226mz.11.67fc5d461PCKtS&from=btop'
"""
import time
from faker import Faker
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from scrapy import Selector
from scrapy.http ... | mit |
roberthorlings/chromecast-web | pychromecast/controllers/__init__.py | 1 | 3552 | """
Provides controllers to handle specific namespaces in Chromecast communication.
"""
import logging
from ..error import UnsupportedNamespace, ControllerNotRegistered
class BaseController(object):
""" ABC for namespace controllers. """
def __init__(self, namespace, supporting_app_id=None,
... | mit |
newrocknj/horizon | openstack_dashboard/dashboards/admin/volumes/volume_types/views.py | 33 | 9790 | # 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
# distributed under the ... | apache-2.0 |
james-antill/yum | yum/yumRepo.py | 2 | 85328 | #! /usr/bin/python -tt
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that ... | gpl-2.0 |
danakj/chromium | tools/perf/page_sets/indexeddb_endure_page.py | 22 | 1599 | # Copyright 2015 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.
from telemetry.page import page as page_module
from telemetry import story
class IndexedDBEndurePage(page_module.Page):
def __init__(self, subtest, page_... | bsd-3-clause |
RoyalTS/econ-project-templates | .mywaflib/waflib/Tools/dmd.py | 9 | 2138 | #!/usr/bin/env python
# encoding: utf-8
# Carlos Rafael Giani, 2007 (dv)
# Thomas Nagy, 2008-2010 (ita)
import sys
from waflib.Tools import ar, d
from waflib.Configure import conf
@conf
def find_dmd(conf):
"""
Find the program *dmd*, *dmd2*, or *ldc* and set the variable *D*
"""
conf.find_program(['dmd', 'dmd2', ... | bsd-3-clause |
figarocorso/mss | modules/libvirt/__init__.py | 2 | 2694 | # -*- coding: UTF-8 -*-
#
# (c) 2014 Mandriva, http://www.mandriva.com/
#
# This file is part of Mandriva Server Setup
#
# MSS 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, o... | gpl-3.0 |
eliasdorneles/scrapy | tests/test_commands.py | 105 | 8613 | import os
import sys
import subprocess
import tempfile
from time import sleep
from os.path import exists, join, abspath
from shutil import rmtree
from tempfile import mkdtemp
from twisted.trial import unittest
from twisted.internet import defer
from scrapy.utils.python import retry_on_eintr
from scrapy.utils.test imp... | bsd-3-clause |
jlettvin/record | record.py | 1 | 4309 | #!/usr/bin/env python
"""\
record.py
Copyright(c) 2015 Jonathan D. Lettvin, All Rights Reserved.
License: GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
Use record.py to acquire short sound samples in the style of a tape recorder.
For each phrase, a prompt is given to acquaint the speaker with the phrase.
After h... | gpl-3.0 |
staticlibs/android-ndk-r9d-arm-linux-androideabi-4.8 | lib/python2.7/xml/sax/handler.py | 230 | 13921 | """
This module contains the core classes of version 2.0 of SAX for Python.
This file provides only default classes with absolutely minimum
functionality, from which drivers and applications can be subclassed.
Many of these classes are empty and are included only as documentation
of the interfaces.
$Id$
"""
version ... | gpl-2.0 |
chewable/django | tests/regressiontests/model_fields/models.py | 2 | 2235 |
from django.db import models
try:
import decimal
except ImportError:
from django.utils import _decimal as decimal # Python 2.3 fallback
class Foo(models.Model):
a = models.CharField(max_length=10)
d = models.DecimalField(max_digits=5, decimal_places=3)
def get_foo():
return Foo.objects.get(id... | bsd-3-clause |
cmichal/python-social-auth | social/tests/backends/test_broken.py | 80 | 1072 | import unittest2 as unittest
from social.backends.base import BaseAuth
class BrokenBackendAuth(BaseAuth):
name = 'broken'
class BrokenBackendTest(unittest.TestCase):
def setUp(self):
self.backend = BrokenBackendAuth()
def tearDown(self):
self.backend = None
def test_auth_url(self)... | bsd-3-clause |
tungvx/deploy | .google_appengine/lib/django_0_96/django/conf/global_settings.py | 30 | 11682 | # Default Django settings. Override these with settings in the module
# pointed-to by the DJANGO_SETTINGS_MODULE environment variable.
# This is defined here as a do-nothing function because we can't import
# django.utils.translation -- that module depends on the settings.
gettext_noop = lambda s: s
#################... | apache-2.0 |
bigswitch/neutron | neutron/tests/unit/api/rpc/callbacks/producer/test_registry.py | 37 | 2800 | # 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
# d... | apache-2.0 |
UManPychron/pychron | pychron/pipeline/plot/point_move_tool.py | 2 | 4661 | # ===============================================================================
# Copyright 2012 Jake Ross
#
# 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/licens... | apache-2.0 |
Gitlab11/odoo | addons/website_blog/controllers/main.py | 132 | 16323 | # -*- coding: utf-8 -*-
import datetime
import werkzeug
from openerp import tools
from openerp.addons.web import http
from openerp.addons.web.controllers.main import login_redirect
from openerp.addons.web.http import request
from openerp.addons.website.models.website import slug
from openerp.osv.orm import browse_rec... | agpl-3.0 |
endlessm/chromium-browser | third_party/webgl/src/sdk/tests/closure-library/closure/bin/build/closurebuilder.py | 134 | 9626 | #!/usr/bin/env python
#
# Copyright 2009 The Closure Library 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
... | bsd-3-clause |
fomy/simd | injector.py | 2 | 3739 | #!/usr/bin/python
import getopt
from system import *
from statistics import *
from simd import *
def inject(eventfile, model):
total_iterations = 0L
systems_with_raid_failure = 0
systems_with_lse = 0
systems_with_data_loss = 0
lse_count = 0
raid_count = 0
raid_failure_samples = Samples()... | apache-2.0 |
gsutil-mirrors/pyasn1 | tests/type/test_namedtype.py | 6 | 4301 | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
import sys
try:
import unittest2 as unittest
except ImportError:
import unittest
from tests.base import BaseTestCase
from pyasn1.type import namedtype
... | bsd-2-clause |
foreverfaint/scrapy | scrapy/contrib/djangoitem.py | 33 | 2335 | from scrapy.item import Field, Item, ItemMeta
from scrapy import optional_features
if 'django' in optional_features:
from django.core.exceptions import ValidationError
class DjangoItemMeta(ItemMeta):
def __new__(mcs, class_name, bases, attrs):
cls = super(DjangoItemMeta, mcs).__new__(mcs, class_name... | bsd-3-clause |
proxysh/Safejumper-for-Mac | buildlinux/env64/lib/python2.7/site-packages/zope/interface/tests/test_ro.py | 31 | 3305 | ##############################################################################
#
# Copyright (c) 2014 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... | gpl-2.0 |
usc-isi/extra-specs | nova/tests/api/openstack/compute/contrib/test_server_diagnostics.py | 8 | 2698 | # Copyright 2011 Eldar Nugaev
# 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 ... | apache-2.0 |
Medigate/cutiuta-server | cutiuta-server/env/lib/python3.4/site-packages/django/contrib/gis/sitemaps/views.py | 144 | 2365 | from __future__ import unicode_literals
from django.apps import apps
from django.contrib.gis.db.models.fields import GeometryField
from django.contrib.gis.db.models.functions import AsKML, Transform
from django.contrib.gis.shortcuts import render_to_kml, render_to_kmz
from django.core.exceptions import FieldDoesNotExi... | gpl-3.0 |
zainabg/NOX | src/nox/lib/packet/ethernet.py | 10 | 3831 | # Copyright 2008 (C) Nicira, Inc.
#
# This file is part of NOX.
#
# NOX 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.
#
# NOX is d... | gpl-3.0 |
yangqun/lily2-gem5 | src/arch/x86/isa/insts/simd64/integer/arithmetic/__init__.py | 91 | 2461 | # 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 |
shakamunyi/ansible | v2/ansible/cli/doc.py | 13 | 10391 | # (c) 2014, James Tanner <tanner.jc@gmail.com>
#
# 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 i... | gpl-3.0 |
OpenCanada/website | jobs/models.py | 1 | 1776 | from django.db import models
from wagtail.admin.edit_handlers import (FieldPanel, ObjectList,
RichTextFieldPanel,
TabbedInterface)
from wagtail.core.fields import RichTextField
from wagtail.core.models import Page
from core... | mit |
geekboxzone/mmallow_external_skia | tools/test_pdfs.py | 231 | 1801 | '''
Compares the rendererings of serialized SkPictures to expected images.
Launch with --help to see more information.
Copyright 2012 Google Inc.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
'''
# common Python modules
import os
import optparse
import sys
import ... | bsd-3-clause |
diagramsoftware/odoo | addons/account_analytic_analysis/res_config.py | 426 | 1408 | # -*- 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 |
SUSE-Cloud/nova | contrib/boto_v6/__init__.py | 52 | 1693 | # Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without res... | apache-2.0 |
40223226/2015cd_midterm2 | static/Brython3.1.1-20150328-091302/Lib/textwrap.py | 745 | 16488 | """Text wrapping and filling.
"""
# Copyright (C) 1999-2001 Gregory P. Ward.
# Copyright (C) 2002, 2003 Python Software Foundation.
# Written by Greg Ward <gward@python.net>
import re
__all__ = ['TextWrapper', 'wrap', 'fill', 'dedent', 'indent']
# Hardcode the recognized whitespace characters to the US-ASCII
# whit... | gpl-3.0 |
biocore/qiime | scripts/beta_significance.py | 15 | 8722 | #!/usr/bin/env python
# File created on 4 June 2010
from __future__ import division
__author__ = "Justin Kuczynski"
__copyright__ = "Copyright 2011, The QIIME Project"
__credits__ = ["Justin Kuczynski", "Jose Antonio Navas", "Greg Caporaso"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Justin Kuczyn... | gpl-2.0 |
valkyriesavage/invenio | modules/bibconvert/lib/bibconvert_tests.py | 2 | 10073 | # -*- coding: utf-8 -*-
## Invenio bibconvert unit tests.
## This file is part of Invenio.
## Copyright (C) 2005, 2006, 2007, 2008, 2009, 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 F... | gpl-2.0 |
francis-liberty/kaggle | Titanic/Benchmarks/myfirstforest.py | 3 | 3926 | """ Writing my first randomforest code.
Author : AstroDave
Date : 23rd September, 2012
please see packages.python.org/milk/randomforests.html for more
"""
import numpy as np
import csv as csv
from sklearn.ensemble import RandomForestClassifier
csv_file_object = csv.reader(open('train.csv', 'rb')) #Load in the train... | gpl-2.0 |
szopu/git-jira-worklog | jira_worklog/git.py | 1 | 2841 | from __future__ import unicode_literals
import os.path
import subprocess
from .exceptions import GitError
def get_git_dir(repo_path):
return os.path.join(repo_path, '.git')
def get_git_command_data(command_name, repo_path=None):
cmd = ['git']
if repo_path:
cmd.append('--git-dir={}'.format(get_g... | mit |
chenke91/LearnFlask | tests/test_client.py | 1 | 2076 | import unittest, re
from flask import url_for
from app import create_app, db
from app.models import User, Role
class FlaskClientTestCase(unittest.TestCase):
def setUp(self):
self.app = create_app('testing')
self.app_context = self.app.app_context()
self.app_context.push()
db.create_... | mit |
igemsoftware/SYSU-Software2013 | project/Python27/Lib/site-packages/win32/Demos/win32clipboardDemo.py | 17 | 4642 | # win32clipboardDemo.py
#
# Demo/test of the win32clipboard module.
from win32clipboard import *
from pywin32_testutil import str2bytes # py3k-friendly helper
import win32con
import types
if not __debug__:
print "WARNING: The test code in this module uses assert"
print "This instance of Python has asserts disa... | mit |
aspidites/django | tests/custom_lookups/tests.py | 177 | 22547 | from __future__ import unicode_literals
import contextlib
import time
import unittest
from datetime import date, datetime
from django.core.exceptions import FieldError
from django.db import connection, models
from django.test import TestCase, override_settings
from django.utils import timezone
from .models import Au... | bsd-3-clause |
dkillick/iris | lib/iris/tests/unit/coord_systems/test_Orthographic.py | 17 | 3166 | # (C) British Crown Copyright 2014 - 2015, 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 |
allofhercats/whiskey | web/gen/model.py | 1 | 15506 | import os
import pathlib
import token
import error
import lexing
import ast
import parsing
import config
def text_to_html(text):
rtn = ""
nlcount = 0
for i in text:
if i == '\n':
nlcount += 1
if nlcount == 2:
rtn += "<p />\n\n"
elif i == '\r':
pass
elif i == "<":
rtn += "<"
elif i == ">... | mit |
googleapis/googleapis-gen | google/cloud/speech/v1/speech-v1-py/google/cloud/speech_v1/services/speech/transports/__init__.py | 2 | 1122 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... | apache-2.0 |
openiitbombayx/edx-platform | common/djangoapps/edxmako/makoloader.py | 100 | 3107 | import logging
from django.conf import settings
from django.template.base import TemplateDoesNotExist
from django.template.loader import make_origin, get_template_from_string
from django.template.loaders.filesystem import Loader as FilesystemLoader
from django.template.loaders.app_directories import Loader as AppDirec... | agpl-3.0 |
goksie/newfies-dialer | newfies/appointment/admin.py | 4 | 3514 | #
# Newfies-Dialer License
# http://www.newfies-dialer.org
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (C) 2011-2014 Star2Billing S.L.
#
# The Initia... | mpl-2.0 |
laiqiqi886/kbengine | kbe/src/lib/python/Lib/plat-linux/TYPES.py | 171 | 3416 | # Generated by h2py from /usr/include/sys/types.h
_SYS_TYPES_H = 1
# Included from features.h
_FEATURES_H = 1
__USE_ANSI = 1
__FAVOR_BSD = 1
_ISOC99_SOURCE = 1
_POSIX_SOURCE = 1
_POSIX_C_SOURCE = 199506
_XOPEN_SOURCE = 600
_XOPEN_SOURCE_EXTENDED = 1
_LARGEFILE64_SOURCE = 1
_BSD_SOURCE = 1
_SVID_SOURCE = 1
_BSD_SOURCE ... | lgpl-3.0 |
kjc88/sl4a | python/src/Lib/plat-atheos/TYPES.py | 74 | 2682 | # Generated by h2py from /include/sys/types.h
_SYS_TYPES_H = 1
# Included from features.h
_FEATURES_H = 1
__USE_ANSI = 1
__FAVOR_BSD = 1
_ISOC9X_SOURCE = 1
_POSIX_SOURCE = 1
_POSIX_C_SOURCE = 199506L
_XOPEN_SOURCE = 500
_XOPEN_SOURCE_EXTENDED = 1
_LARGEFILE64_SOURCE = 1
_BSD_SOURCE = 1
_SVID_SOURCE = 1
_BSD_SOURCE = 1... | apache-2.0 |
paulcon/active_subspaces | tutorials/test_functions/robot/robot_functions.py | 1 | 2721 | import numpy as np
import active_subspaces as ac
def robot(xx):
#each row of xx should be [t1, t2, t3, t4, L1, L2, L3, L4] in the normalized input space
#returns a column vector of the piston function at each row of inputs
x = xx.copy()
x = np.atleast_2d(x)
M = x.shape[0]
#Unnorm... | mit |
sander76/home-assistant | homeassistant/components/iaqualink/binary_sensor.py | 12 | 1262 | """Support for Aqualink temperature sensors."""
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_COLD,
DOMAIN,
BinarySensorEntity,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.helpers.typing import HomeAssistantType
from . import AqualinkEntity
from .const impo... | apache-2.0 |
GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/docutils/parsers/rst/directives/admonitions.py | 126 | 2413 | # $Id: admonitions.py 7681 2013-07-12 07:52:27Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Admonition directives.
"""
__docformat__ = 'reStructuredText'
from docutils.parsers.rst import Directive
from docutils.parsers.rst import states, di... | agpl-3.0 |
jeffmarcom/checkbox | checkbox/lib/usb.py | 3 | 1951 | #
# This file is part of Checkbox.
#
# Copyright 2008 Canonical Ltd.
#
# Checkbox 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.
#
# C... | gpl-3.0 |
jceipek/Mind-Rush | engine/altInput.py | 1 | 1108 | #
# altInput.py
#
# Copyright (C)2011 Julian Ceipek and Patrick Varin
#
# Redistribution is permitted under the BSD license. See LICENSE for details.
#
import pygame
class AltInput:
"""
This is a class template for using alternative input devices with engine.
Most of these functions need to be present an... | bsd-3-clause |
CCLab/sezam | djcelery/tests/test_schedulers.py | 3 | 10389 | from __future__ import absolute_import
from datetime import datetime, timedelta
from itertools import count
from time import time
from celery.schedules import schedule, crontab
from celery.utils.timeutils import timedelta_seconds
from djcelery import schedulers
from djcelery import celery
from djcelery.models import... | bsd-3-clause |
photoninger/ansible | test/units/modules/network/aireos/test_aireos_command.py | 57 | 4300 | # (c) 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 dis... | gpl-3.0 |
davidcaste/fabtools | setup.py | 4 | 2084 | import os
import sys
try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
def read(filename):
path = os.path.join(os.path.dirna... | bsd-2-clause |
tuxfux-hlp-notes/python-batches | archieves/batch-56/modules/sheets/lib/python2.7/site-packages/setuptools/command/egg_info.py | 215 | 14320 | """setuptools.command.egg_info
Create a distribution's .egg-info directory and contents"""
import os
import re
import sys
from setuptools import Command
import distutils.errors
from distutils import log
from setuptools.command.sdist import sdist
from setuptools.compat import basestring
from setuptools import svn_uti... | gpl-3.0 |
rimbalinux/MSISDNArea | docutils/__init__.py | 2 | 7287 | # $Id: __init__.py 6164 2009-10-11 11:00:11Z grubert $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
This is the Docutils (Python Documentation Utilities) package.
Package Structure
=================
Modules:
- __init__.py: Contains compo... | bsd-3-clause |
alanjds/python-for-android | src/buildlib/jinja2.egg/jinja2/debug.py | 212 | 9931 | # -*- coding: utf-8 -*-
"""
jinja2.debug
~~~~~~~~~~~~
Implements the debug interface for Jinja. This module does some pretty
ugly stuff with the Python traceback system in order to achieve tracebacks
with correct line numbers, locals and contents.
:copyright: (c) 2010 by the Jinja Team.
:... | lgpl-2.1 |
citrix-openstack-build/glance | glance/tests/unit/test_context.py | 5 | 9126 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010-2011 OpenStack, LLC
# 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... | apache-2.0 |
mispencer/ycmd | build.py | 1 | 18179 | #!/usr/bin/env python
# Passing an environment variable containing unicode literals to a subprocess
# on Windows and Python2 raises a TypeError. Since there is no unicode
# string in this script, we don't import unicode_literals to avoid the issue.
from __future__ import print_function
from __future__ import division
... | gpl-3.0 |
cnvogelg/fs-uae-gles | launcher/fs_uae_launcher/ui/LaunchDialog.py | 2 | 2926 | from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import threading
import traceback
import fs_uae_launcher.fsui as fsui
from ..Config import Config
from ..I18N import _, ngettext
class LaunchDialog(fsui.Dialog):
de... | gpl-2.0 |
frodrigo/osmose-backend | analysers/analyser_osmosis_polygon_overlaps.py | 4 | 3676 | #!/usr/bin/env python
#-*- coding: utf-8 -*-
###########################################################################
## ##
## Copyrights Frédéric Rodrigo 2014 ##
## ... | gpl-3.0 |
camradal/ansible | lib/ansible/modules/network/iosxr/iosxr_system.py | 8 | 9141 | #!/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 |
impowski/servo | tests/wpt/css-tests/tools/wptserve/tests/functional/test_request.py | 299 | 2987 | import os
import unittest
import urllib2
import json
import time
import wptserve
from base import TestUsingServer, doc_root
class TestInputFile(TestUsingServer):
def test_seek(self):
@wptserve.handlers.handler
def handler(request, response):
rv = []
f = request.raw_input
... | mpl-2.0 |
tomachalek/kontext | lib/plugins/abstract/token_connect.py | 1 | 7487 | # Copyright (c) 2017 Charles University, Faculty of Arts,
# Institute of the Czech National Corpus
# Copyright (c) 2017 Tomas Machalek <tomas.machalek@gmail.com>
# Copyright (c) 2017 Petr Duda <petrduda@seznam.cz>
#
# This program is free software; you can redistribute it and/or
# modify it under the... | gpl-2.0 |
Brightmd/smokesignal | setup.py | 1 | 1467 | from setuptools import setup, find_packages
version = '0.7.0+brightmd.4'
setup(name='smokesignal',
version=version,
description=("Simple python event signaling"),
long_description=open('README.md').read(),
classifiers=['Development Status :: 4 - Beta',
'License :: OSI Approv... | mit |
barbarubra/Don-t-know-What-i-m-doing. | python/gdata/tests/atom_tests/token_store_test.py | 128 | 2896 | #!/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 |
bratsche/Neutron-Drive | google_appengine/google/appengine/_internal/django/utils/functional.py | 23 | 14245 | # License for code in this file that was taken from Python 2.5.
# PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
# --------------------------------------------
#
# 1. This LICENSE AGREEMENT is between the Python Software Foundation
# ("PSF"), and the Individual or Organization ("Licensee") accessing and
# otherwise usin... | bsd-3-clause |
emileaben/django-openipmap | models.py | 1 | 27148 | #from django.db import models
from django.contrib.gis.db import models
import re
import urllib2
import json
import time
from django.contrib.gis.measure import D
from datetime import datetime, timedelta
import dns.resolver
from publicsuffix import PublicSuffixList
from django.contrib.auth.models import User
from netfiel... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.