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 |
|---|---|---|---|---|---|
sznekol/django-cms | cms/tests/nonroot.py | 24 | 3211 | # -*- coding: utf-8 -*-
from __future__ import with_statement
from django.template import Template
from cms.api import create_page
from cms.models import Page
from cms.test_utils.testcases import CMSTestCase
from cms.templatetags.cms_admin import preview_link
from cms.utils.i18n import force_language
from menus.base ... | bsd-3-clause |
gilamsalem/pynfs | nfs4.0/servertests/st_setattr.py | 3 | 20543 | from nfs4_const import *
from environment import check, checklist, get_invalid_utf8strings
from nfs4lib import bitmap2list, dict2fattr
from nfs4_type import nfstime4, settime4
def _set_mode(t, c, file, stateid=None, msg=" using stateid=0",
warnlist=[]):
mode = 0740
dict = {FATTR4_MODE: mode}
... | gpl-2.0 |
hermes-jr/npui | netprofile/netprofile/db/valid.py | 3 | 1270 | #!/usr/bin/env python
# -*- coding: utf-8; tab-width: 4; indent-tabs-mode: t -*-
#
# NetProfile: DB-centric validators
# © Copyright 2013 Alex 'Unik' Unigovsky
#
# This file is part of NetProfile.
# NetProfile is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public
... | agpl-3.0 |
cloudtools/troposphere | troposphere/s3objectlambda.py | 1 | 1143 | # Copyright (c) 2012-2021, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
# Resource specification version: 31.1.0
from . import AWSObject, AWSProperty
from .validators import boolean
class TransformationConfiguration(AW... | bsd-2-clause |
Lujeni/ansible | lib/ansible/modules/storage/purestorage/purefa_ntp.py | 21 | 3627 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2018, Simon Dodsley (simon@purestorage.com)
# 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',... | gpl-3.0 |
Eksmo/calibre | src/calibre/gui2/store/stores/baen_webscription_plugin.py | 2 | 3430 | # -*- coding: utf-8 -*-
from __future__ import (unicode_literals, division, absolute_import, print_function)
__license__ = 'GPL 3'
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
import re
import urllib2
from contextlib import closing
from lxml import html
from Py... | gpl-3.0 |
Tejal011089/Medsyn2_app | setup/doctype/email_settings/email_settings.py | 29 | 2140 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.utils import cint
class DocType:
def __init__(self,doc,doclist):
self.doc,self.doclist = doc,doclist
def valida... | agpl-3.0 |
vivekpabani/projecteuler | python/243/problem_243.py | 1 | 1228 | #!/usr/bin/env python
# coding=utf-8
#--- In Progress. ---#
"""
Problem Definition :
A positive fraction whose numerator is less than its denominator is called a proper fraction.
For any denominator, d, there will be d−1 proper fractions; for example, with d = 12:
1/12 , 2/12 , 3/12 , 4/12 , 5/12 , 6/12 , 7/12 , 8/... | apache-2.0 |
a-b/PopClip-Extensions | source/OneNote/requests/api.py | 206 | 4935 | # -*- coding: utf-8 -*-
"""
requests.api
~~~~~~~~~~~~
This module implements the Requests API.
:copyright: (c) 2012 by Kenneth Reitz.
:license: Apache2, see LICENSE for more details.
"""
from . import sessions
def request(method, url, **kwargs):
"""Constructs and sends a :class:`Request <Request>`.
Retur... | mit |
shoma/mycli | mycli/packages/tabulate.py | 16 | 38129 | # -*- coding: utf-8 -*-
"""Pretty-print tabular data."""
from __future__ import print_function
from __future__ import unicode_literals
from collections import namedtuple
from decimal import Decimal
from platform import python_version_tuple
from wcwidth import wcswidth
import re
if python_version_tuple()[0] < "3":
... | bsd-3-clause |
gVallverdu/pymatgen | pymatgen/symmetry/analyzer.py | 1 | 64034 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
An interface to the excellent spglib library by Atsushi Togo
(http://spglib.sourceforge.net/) for pymatgen.
v1.0 - Now works with both ordered and disordered structure.
v2.0 - Updated for spglib 1.6.
v3.0 ... | mit |
KatPro/nlptools-ru | nlptools2/tagger.py | 4 | 51260 | #!/usr/bin/python
# -*- encoding: utf-8 -*-
"""
Снятие морфологической омонимии русского текста.
Статистический тэггер-лемматизатор для русского языка на основе библиотеки pymorphy2.
Использует статистику совместного употребления окончаний слов в тексте,
а также статистику зависимости падежей от управляющих пре... | mit |
jiangjinjinyxt/vnpy | vnpy/api/ksotp/pyscript/generate_td_functions.py | 25 | 10306 | # encoding: UTF-8
__author__ = 'CHENXY'
from string import join
from ksotp_struct import structDict
def processCallBack(line):
orignalLine = line
line = line.replace('\tvirtual void ', '') # 删除行首的无效内容
line = line.replace('{};\n', '') # 删除行尾的无效内容
content = line.split('(')
cb... | mit |
naturali/tensorflow | tensorflow/python/kernel_tests/random_crop_test.py | 29 | 2638 | # 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 |
evro/CouchPotatoServer | libs/pyutil/test/out_of_shape/test_odict.py | 106 | 16600 | #!/usr/bin/env python
# Copyright (c) 2002-2010 Zooko Wilcox-O'Hearn
# This file is part of pyutil; see README.rst for licensing terms.
import random, unittest
from pyutil.humanreadable import hr
from pyutil import memutil
from pyutil import odict
class Bencher:
def __init__(self, klass, MAXREPS=2**8, MAXTIME... | gpl-3.0 |
si618/pi-time | node_modules/grunt-pylint/tasks/lib/astroid/tests/unittest_scoped_nodes.py | 1 | 46381 | # copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of astroid.
#
# astroid 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
#... | gpl-3.0 |
rec/echomesh | code/python/external/platform/darwin/numpy/oldnumeric/compat.py | 13 | 3182 | # Compatibility module containing deprecated names
__all__ = ['NewAxis',
'UFuncType', 'UfuncType', 'ArrayType', 'arraytype',
'LittleEndian', 'arrayrange', 'matrixmultiply',
'array_constructor', 'pickle_array',
'DumpArray', 'LoadArray', 'multiarray',
# from cPickle... | mit |
WillisXChen/django-oscar | oscar/lib/python2.7/site-packages/requests/packages/chardet/chardetect.py | 1786 | 2504 | #!/usr/bin/env python
"""
Script which takes one or more file paths and reports on their detected
encodings
Example::
% chardetect somefile someotherfile
somefile: windows-1252 with confidence 0.5
someotherfile: ascii with confidence 1.0
If no paths are provided, it takes its input from stdin.
"""
from... | bsd-3-clause |
chenbaihu/grpc | src/python/src/grpc/framework/base/packets/_ends.py | 5 | 17140 | # 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 |
mihaip/NewsBlur | apps/rss_feeds/migrations/0014_count_story_histories.py | 18 | 8822 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
from apps.rss_feeds.models import Feed
for feed in Feed.objects.all():
... | mit |
timothycrosley/thedom | thedom/dom.py | 1 | 31933 | '''
DOM.py
Contains all elements defined in the most recent version of the HTML specification
(currently version 5)
Copyright (C) 2015 Timothy Edmund Crosley
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as publi... | gpl-2.0 |
wdzhou/mantid | Framework/PythonInterface/plugins/algorithms/CalibrateRectangularDetectors.py | 1 | 26300 | #pylint: disable=no-init,invalid-name
from __future__ import (absolute_import, division, print_function)
from mantid.api import *
from mantid.kernel import *
from mantid.simpleapi import *
import os
from time import strftime
from mantid.kernel import Direction
COMPRESS_TOL_TOF = .01
EXTENSIONS_NXS = ["_event.nxs", ".... | gpl-3.0 |
BaladiDogGames/baladidoggames.github.io | mingw/bin/lib/threading.py | 31 | 32474 | """Thread module emulating a subset of Java's threading model."""
import sys as _sys
try:
import thread
except ImportError:
del _sys.modules[__name__]
raise
import warnings
from time import time as _time, sleep as _sleep
from traceback import format_exc as _format_exc
# Note regarding PEP 8 compliant a... | mit |
calico/basenji | tests/train_full/make_targets.py | 1 | 3365 | #!/usr/bin/env python
from optparse import OptionParser
import glob
import os
import subprocess
import sys
import pandas as pd
'''
make_targets.py
Make targets table for generating TF Records.
'''
################################################################################
# main
###############################... | apache-2.0 |
SlimRoms/android_external_chromium_org | tools/perf/measurements/skpicture_printer_unittest.py | 9 | 1311 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import shutil
import tempfile
from measurements import skpicture_printer
from telemetry import test
from telemetry.page import page_measurement_unittest_bas... | bsd-3-clause |
HKuz/Test_Code | exceptions.py | 1 | 1762 | #!/Applications/anaconda/envs/Python3/bin
def main():
'''Examples Using Exceptions in Python'''
# Python exceptions: http://docs.python.org/library/exceptions.html
# Catch exceptions with try
try:
f = open('noFile.txt')
except IOError as e:
print('Oh no, IOError:', e)
except Va... | mit |
BizzCloud/PosBox | addons/auth_signup/__openerp__.py | 62 | 1573 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
mitsuhiko/badideas | implicitself.py | 1 | 3083 | # -*- coding: utf-8 -*-
"""
implicitself
~~~~~~~~~~~~
Implements a bytecode hack and metaclass to make the self
implicit in functions.
:copyright: (c) Copyright 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import opcode
from types import FunctionType, CodeType
HAV... | bsd-3-clause |
naucoin/VTKSlicerWidgets | Examples/Rendering/Python/CSpline.py | 9 | 3210 | #!/usr/bin/env python
# This example demonstrates the use of vtkCardinalSpline.
# It creates random points and connects them with a spline
import vtk
from vtk.util.colors import tomato, banana
# This will be used later to get random numbers.
math = vtk.vtkMath()
# Total number of points.
numberOfInputPoints = 10
#... | bsd-3-clause |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/numpy/f2py/tests/test_return_real.py | 145 | 5403 | from __future__ import division, absolute_import, print_function
from numpy import array
from numpy.compat import long
from numpy.testing import run_module_suite, assert_, assert_raises, dec
import util
class TestReturnReal(util.F2PyTest):
def check_function(self, t):
if t.__doc__.split()[0] in ['t0', '... | gpl-3.0 |
Dm47021/Android_kernel_f6mt_aosp_jb-rebase | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # 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 system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
d3banjan/polyamide | webdev/lib/python2.7/site-packages/django/contrib/humanize/templatetags/humanize.py | 526 | 9442 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import re
from datetime import date, datetime
from decimal import Decimal
from django import template
from django.conf import settings
from django.template import defaultfilters
from django.utils.encoding import force_text
from django.utils.formats imp... | bsd-2-clause |
staticlibs/android-ndk-r9d-arm-linux-androideabi-4.8 | lib/python2.7/test/test_ast.py | 36 | 24760 | import sys, itertools, unittest
from test import test_support
import ast
def to_tuple(t):
if t is None or isinstance(t, (basestring, int, long, complex)):
return t
elif isinstance(t, list):
return [to_tuple(e) for e in t]
result = [t.__class__.__name__]
if hasattr(t, 'lineno') and hasat... | gpl-2.0 |
eSpaceEPFL/marsissharadviewer | test/test_translations.py | 116 | 1741 | # coding=utf-8
"""Safe Translations Test.
.. note:: 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.
"""
from ut... | gpl-2.0 |
cvmfs-testing/cvmfs | add-ons/tools/legacy/downloadCatalogs.py | 12 | 5491 | #!/usr/bin/python
from urllib2 import urlopen, URLError, HTTPError
import sys
import os
import zlib
import shutil
import tempfile
from optparse import OptionParser
foundSqlite = False
foundSqlite3 = False
# figure out which sqlite module to use
# in Python 2.4 an old version is present
# which does not allow proper ... | bsd-3-clause |
phammin1/QaManagement | QaManagement/env/Lib/site-packages/django/contrib/admin/tests.py | 229 | 6464 | import os
from unittest import SkipTest
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.utils.module_loading import import_string
from django.utils.translation import ugettext as _
class AdminSeleniumWebDriverTestCase(StaticLiveServerTestCase):
available_apps = [
'dja... | mit |
TathagataChakraborti/resource-conflicts | PLANROB-2015/seq-sat-lama/py2.5/lib/python2.5/encodings/ascii.py | 858 | 1248 | """ Python 'ascii' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
class Codec(codecs.Codec):
# Note: Binding these as C functions will result in the class not
# converting them to methods. This is intended.
... | mit |
AndyLavr/htc_kernel_oxp | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
asoc/snakewatch | snakewatch/main.py | 1 | 7734 | """
This file is part of snakewatch.
snakewatch 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 later version.
snakewatch is distributed in the hop... | bsd-3-clause |
elpaso/QGIS | tests/src/python/test_qgsshortcutsmanager.py | 43 | 17733 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsActionManager.
.. note:: 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.
"""
... | gpl-2.0 |
tedsunnyday/SE-Server | server/lib/flask_mongoengine/pagination.py | 3 | 5909 | # -*- coding: utf-8 -*-
import math
from flask import abort
from mongoengine.queryset import QuerySet
__all__ = ("Pagination", "ListFieldPagination")
class Pagination(object):
def __init__(self, iterable, page, per_page):
if page < 1:
abort(404)
self.iterable = iterable
s... | apache-2.0 |
itskewpie/tempest | tempest/api/compute/test_quotas.py | 3 | 2639 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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.apach... | apache-2.0 |
ryfeus/lambda-packs | pytorch/source/caffe2/python/regularizer_context.py | 1 | 1179 | # @package regularizer_context
# Module caffe2.python.regularizer_context
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from caffe2.python import context
from caffe2.python.modifier_context import (
ModifierConte... | mit |
romonzaman/newfies-dialer | newfies/appointment/admin_filters.py | 4 | 1594 | #
# 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-2015 Star2Billing S.L.
#
# The primar... | mpl-2.0 |
denfromufa/PTVS | Python/Product/Pyvot/Pyvot/xl/cache.py | 18 | 15811 | # Copyright (c) Microsoft Corporation.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the LICENSE.txt file at the root of this distribution. If
# you cannot locate the Apache License, Version 2.0, please send an email to
# vsp... | apache-2.0 |
Parisson/cartridge | cartridge/project_template/project_name/settings.py | 4 | 14096 |
from __future__ import absolute_import, unicode_literals
import os
from django.utils.translation import ugettext_lazy as _
######################
# CARTRIDGE SETTINGS #
######################
# The following settings are already defined in cartridge.shop.defaults
# with default values, but are common enough to be p... | bsd-2-clause |
ekevoo/hfbr | example_settings.py | 1 | 1360 | # -*- coding: utf-8 -*-
from datetime import timedelta
from sys import stdout
TARGETS = [
{
'target_path': 'db.sqlite',
'backup_dir': '/var/backup/sqlite-db',
'retention_plan': 'default',
'pin': ('20150717-1155.sq3.bz2',),
'prune': False,
},
]
PLANS = {
'default': (... | apache-2.0 |
toastedcornflakes/scikit-learn | doc/tutorial/text_analytics/solutions/exercise_02_sentiment.py | 9 | 3127 | """Build a sentiment analysis / polarity model
Sentiment analysis can be casted as a binary text classification problem,
that is fitting a linear classifier on features extracted from the text
of the user messages so as to guess wether the opinion of the author is
positive or negative.
In this examples we will use a ... | bsd-3-clause |
QGuLL/samba | selftest/selftest.py | 20 | 16381 | #!/usr/bin/python -u
# Bootstrap Samba and run a number of tests against it.
# Copyright (C) 2005-2012 Jelmer Vernooij <jelmer@samba.org>
# Copyright (C) 2007-2009 Stefan Metzmacher <metze@samba.org>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public L... | gpl-3.0 |
dvliman/jaikuengine | .google_appengine/lib/django-1.2/tests/regressiontests/templates/nodelist.py | 50 | 1121 | from unittest import TestCase
from django.template.loader import get_template_from_string
from django.template import VariableNode
class NodelistTest(TestCase):
def test_for(self):
source = '{% for i in 1 %}{{ a }}{% endfor %}'
template = get_template_from_string(source)
vars = template.n... | apache-2.0 |
eysho/BestKnownGame-Coins---Source | contrib/spendfrom/spendfrom.py | 792 | 10053 | #!/usr/bin/env python
#
# Use the raw transactions API to spend bitcoins received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a bitcoind or Bit... | mit |
mundofer/napalm-sros | test/unit/conftest.py | 1 | 1635 | """Test fixtures."""
from builtins import super
import pytest
from napalm_base.test import conftest as parent_conftest
from napalm_base.test.double import BaseTestDouble
from napalm_sros import sros
@pytest.fixture(scope='class')
def set_device_parameters(request):
"""Set up the class."""
def fin():
... | apache-2.0 |
pcm17/tensorflow | tensorflow/contrib/learn/python/learn/utils/input_fn_utils.py | 1 | 4651 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
ClaudioNahmad/Servicio-Social | Parametros/CosmoMC/prerrequisitos/plc-2.0/build/pyfits-3.2.2/lib/pyfits/hdu/compressed.py | 3 | 84222 | import ctypes
import math
import re
import time
import warnings
import numpy as np
from pyfits.card import Card
from pyfits.column import Column, ColDefs, _FormatP, TDEF_RE
from pyfits.column import KEYWORD_NAMES as TABLE_KEYWORD_NAMES
from pyfits.fitsrec import FITS_rec
from pyfits.hdu.base import DELAYED, Extension... | gpl-3.0 |
cculianu/gemuo | src/gemuo/engine/menu.py | 2 | 1975 | #
# GemUO
#
# (c) 2005-2010 Max Kellermann <max@duempel.org>
#
# 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 of the License.
#
# This program is distributed in the hope tha... | gpl-2.0 |
skycucumber/Messaging-Gateway | webapp/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/cp949prober.py | 2801 | 1782 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | gpl-2.0 |
karlnewell/net-virt-platform | sdncon/controller/config.py | 3 | 13234 | #
# Copyright (c) 2013 Big Switch Networks, Inc.
#
# Licensed under the Eclipse Public License, Version 1.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.eclipse.org/legal/epl-v10.html
#
# Unless required by applicable l... | epl-1.0 |
GladeRom/android_external_chromium_org | chrome/test/mini_installer/verifier.py | 85 | 2063 | # 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.
class Verifier:
"""Verifies that the current machine states match the expectation."""
def VerifyInput(self, verifier_input, variable_expander):
"""... | bsd-3-clause |
cogmission/nupic.research | projects/sequence_classification/analyze_union_column_model.py | 11 | 10397 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2016, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
joshka/SoundCloud2.Bundle | Contents/Libraries/Shared/simplejson/tests/test_bigint_as_string.py | 122 | 2238 | from unittest import TestCase
import simplejson as json
class TestBigintAsString(TestCase):
# Python 2.5, at least the one that ships on Mac OS X, calculates
# 2 ** 53 as 0! It manages to calculate 1 << 53 correctly.
values = [(200, 200),
((1 << 53) - 1, 9007199254740991),
((1... | mit |
sbrichards/rockstor-core | src/rockstor/backup/views/plugin.py | 2 | 1165 | """
Copyright (c) 2012-2014 RockStor, Inc. <http://rockstor.com>
This file is part of RockStor.
RockStor 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 la... | gpl-3.0 |
luca3m/urllib3 | docs/conf.py | 17 | 7377 | # -*- coding: utf-8 -*-
#
# urllib3 documentation build configuration file, created by
# sphinx-quickstart on Wed Oct 5 13:15:40 2011.
#
# 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
# autogenerated file.
#
# All... | mit |
angryrancor/kivy | kivy/uix/scatterlayout.py | 26 | 3191 | '''
Scatter Layout
===============
.. versionadded:: 1.6.0
This layout behaves just like a
:class:`~kivy.uix.relativelayout.RelativeLayout`.
When a widget is added with position = (0,0) to a :class:`ScatterLayout`,
the child widget will also move when you change the position of the
:class:`ScatterLayout`. The child w... | mit |
fairbird/OpenPLI-BlackHole | lib/python/Components/Renderer/Listbox.py | 12 | 3100 | from Renderer import Renderer
from enigma import eListbox
# the listbox renderer is the listbox, but no listbox content.
# the content will be provided by the source (or converter).
# the source should emit the 'changed' signal whenever
# it has a new listbox content.
# the source needs to have the 'content' propert... | gpl-2.0 |
i5o/openshot-sugar | ignacio/openshot/uploads/youtube/atom/mock_http_core.py | 102 | 12008 | #!/usr/bin/env python
#
# Copyright (C) 2009 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 ... | gpl-3.0 |
neteler/QGIS | python/plugins/processing/algs/qgis/QGISAlgorithmProvider.py | 1 | 9417 | # -*- coding: utf-8 -*-
"""
***************************************************************************
QGISAlgorithmProvider.py
---------------------
Date : December 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***************... | gpl-2.0 |
dwillmer/blaze | blaze/server/spider.py | 1 | 4659 | #!/usr/bin/env python
from __future__ import absolute_import
import os
import sys
import argparse
import yaml
from odo import resource
from odo.utils import ignoring
from .server import Server, DEFAULT_PORT
__all__ = 'spider', 'from_yaml'
def _spider(resource_path, ignore, followlinks, hidden):
resources =... | bsd-3-clause |
andmos/ansible | lib/ansible/modules/network/avi/avi_ipamdnsproviderprofile.py | 31 | 5896 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
ANSIB... | gpl-3.0 |
jabibi/sale-workflow | sale_order_merge/tests/test_sale_order_merge.py | 9 | 8151 | # -*- coding: utf-8 -*-
# Copyright 2016 Opener B.V. - Stefan Rijnhart
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp.tests.common import TransactionCase
class TestSaleOrderMerge(TransactionCase):
def setUp(self):
super(TestSaleOrderMerge, self).setUp()
self.journal_s... | agpl-3.0 |
tomvansteijn/openradar | openradar/gridtools.py | 1 | 11674 | # -*- coding: utf-8 -*-
# (c) Nelen & Schuurmans. GPL licensed, see LICENSE.rst.
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import division
from osgeo import gdal
from osgeo import gdalconst
from osgeo import ogr
from matplotl... | gpl-3.0 |
DinoCow/airflow | airflow/migrations/versions/8f966b9c467a_set_conn_type_as_non_nullable.py | 10 | 2267 | #
# 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... | apache-2.0 |
cchurch/ansible-modules-core | network/openswitch/ops_config.py | 30 | 10509 | #!/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 |
cortext/crawtextV2 | ~/venvs/crawler/lib/python2.7/site-packages/nltk/cluster/api.py | 17 | 2056 | # Natural Language Toolkit: Clusterer Interfaces
#
# Copyright (C) 2001-2012 NLTK Project
# Author: Trevor Cohn <tacohn@cs.mu.oz.au>
# Porting: Steven Bird <sb@csse.unimelb.edu.au>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
from nltk.probability import DictionaryProbDist
class ClusterI(o... | mit |
mancoast/CPythonPyc_test | fail/340_test_windows_utils.py | 6 | 4535 | """Tests for window_utils"""
import sys
import test.support
import unittest
import unittest.mock
if sys.platform != 'win32':
raise unittest.SkipTest('Windows only')
import _winapi
from asyncio import windows_utils
from asyncio import _overlapped
class WinsocketpairTests(unittest.TestCase):
def test_winso... | gpl-3.0 |
bpshetty/erpnext | erpnext/setup/setup_wizard/default_website.py | 38 | 2533 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import nowdate
class website_maker(object):
def __init__(self, args):
self.args = args
self.... | gpl-3.0 |
MMariscal/AGILEIOS2014 | Leaflet/test-infra/s3_cache.py | 1700 | 3523 | #!/usr/bin/env python2.7
from __future__ import absolute_import, unicode_literals, print_function, division
from sys import argv
from os import environ, stat, remove as _delete_file
from os.path import isfile, dirname, basename, abspath
from hashlib import sha256
from subprocess import check_call as run
from boto.s3.... | gpl-2.0 |
mklew/mmp | pylib/cqlshlib/pylexotron.py | 7 | 16285 | # 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 |
acsone/acsone-addons | asynchronous_batch_mailings/__openerp__.py | 1 | 1887 | # -*- coding: utf-8 -*-
##############################################################################
#
# This file is part of asynchronous_batch_mailings, an Odoo module.
#
# Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>)
#
# asynchronous_batch_mailings is free software:
# you can redistribute i... | agpl-3.0 |
eddiejessup/ciabatta | ciabatta/network.py | 1 | 1267 | """
Functions relating to networking, as in the internet.
"""
from __future__ import (division, unicode_literals, absolute_import,
print_function)
import smtplib
import socket
def email_with_gmail(username, password,
to, subject, body):
"""Send an email from an gmail ... | bsd-3-clause |
2014cdag1/cdag1 | wsgi/static/Brython2.1.0-20140419-113919/Lib/weakref.py | 769 | 11495 | """Weak reference support for Python.
This module is an implementation of PEP 205:
http://www.python.org/dev/peps/pep-0205/
"""
# Naming convention: Variables named "wr" are weak reference objects;
# they are called this instead of "ref" to avoid name collisions with
# the module-global ref() function imported from ... | gpl-2.0 |
glove747/liberty-neutron | neutron/plugins/ml2/drivers/brocade/db/models.py | 63 | 4420 | # Copyright 2014 Brocade Communications System, 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
#
#... | apache-2.0 |
mancoast/CPythonPyc_test | cpython/241_test_dummy_thread.py | 31 | 7139 | """Generic thread tests.
Meant to be used by dummy_thread and thread. To allow for different modules
to be used, test_main() can be called with the module to use as the thread
implementation as its sole argument.
"""
import dummy_thread as _thread
import time
import Queue
import random
import unittest
from test impo... | gpl-3.0 |
louisLouL/pair_trading | capstone_env/lib/python3.6/site-packages/matplotlib/tests/test_tightlayout.py | 2 | 8159 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import warnings
import numpy as np
from matplotlib.testing.decorators import image_comparison
import matplotlib.pyplot as plt
from matplotlib.offsetbox import AnchoredOffsetbox, DrawingArea
from ma... | mit |
xiaogaozi/princess-alist | home/xiaogaozi/Archives/6th_hack_game/big_brother/solution/generator.py | 1 | 1308 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Random IP Address Generator <https://github.com/xiaogaozi/princess-alist>
# Copyright (C) 2010 xiaogaozi <gaochangjian@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publishe... | gpl-3.0 |
aduric/crossfit | nonrel/tests/regressiontests/views/tests/defaults.py | 50 | 3720 | from os import path
from django.conf import settings
from django.test import TestCase
from django.contrib.contenttypes.models import ContentType
from regressiontests.views.models import Author, Article, UrlArticle
class DefaultsTests(TestCase):
"""Test django views in django/views/defaults.py"""
fixtures = [... | bsd-3-clause |
pothosware/gnuradio | gr-vocoder/python/vocoder/qa_g721_vocoder.py | 57 | 1573 | #!/usr/bin/env python
#
# Copyright 2011,2013 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 optio... | gpl-3.0 |
cxmo/project-beta | code/utils/plotting_fmri.py | 4 | 1127 |
from __future__ import division, print_function, absolute_import
import matplotlib.pyplot as plt
""" In this module, we have provided plotting functions to help visulize fMRI data."""
def plot_grayscale(data):
plt.imshow(data, cmap='gray')
def plot_sdevs(sdevs, outliers_sdevs, outlier_interval):
plt.plo... | bsd-3-clause |
vladikoff/fxa-mochitest | tests/mozbase/mozversion/tests/test_sources.py | 4 | 2794 | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import tempfile
import unittest
import mozfile
from mozversion import errors, get_ver... | mpl-2.0 |
psynteract/psynteract-os | plugins/psynteract_wait/psynteract_wait.py | 1 | 2478 | #-*- coding:utf-8 -*-
from libopensesame.py3compat import *
from libopensesame.exceptions import osexception
from libopensesame import item
from libqtopensesame.items.qtautoplugin import qtautoplugin
from libqtopensesame.misc import _
class psynteract_wait(item.item):
"""Wait for other clients."""
initial_view ... | gpl-3.0 |
rbramwell/pulp | server/pulp/server/async/tasks.py | 2 | 25866 | from datetime import datetime
from gettext import gettext as _
import logging
import signal
import time
import traceback
import uuid
from celery import task, Task as CeleryTask, current_task
from celery.app import control, defaults
from celery.result import AsyncResult
from mongoengine.queryset import DoesNotExist
fr... | gpl-2.0 |
pillmuncher/hornet | hornet/examples/queens.py | 1 | 1111 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014 Mick Krippendorf <m.krippendorf@freenet.de>
__version__ = '0.2.3a'
__date__ = '2014-09-27'
__author__ = 'Mick Krippendorf <m.krippendorf@freenet.de>'
__license__ = 'MIT'
from hornet import Database, let, select, _, arithmetic_not_equal
from horne... | mit |
legalsylvain/OpenUpgrade | addons/hr_payroll_account/wizard/hr_payroll_payslips_by_employees.py | 44 | 1739 | # -*- 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 |
Oslandia/vizitown_plugin | zope/interface/common/tests/test_idatetime.py | 79 | 1775 | ##############################################################################
#
# Copyright (c) 2003 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 |
MOA-2011/enigma2.pli4.0 | lib/python/Plugins/SystemPlugins/SatelliteEquipmentControl/plugin.py | 7 | 3459 | from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Plugins.Plugin import PluginDescriptor
from Components.ConfigList import ConfigListScreen
from Components.ActionMap import ActionMap
from Components.config import config
from Components.NimManager import nimmanager as nimmgr
class SecPar... | gpl-2.0 |
seanwestfall/django | django/db/backends/base/schema.py | 339 | 43421 | import hashlib
import logging
from django.db.backends.utils import truncate_name
from django.db.transaction import atomic
from django.utils import six
from django.utils.encoding import force_bytes
logger = logging.getLogger('django.db.backends.schema')
def _related_non_m2m_objects(old_field, new_field):
# Filte... | bsd-3-clause |
meghana1995/sympy | sympy/series/tests/test_kauers.py | 102 | 1032 | from sympy.series.kauers import finite_diff
from sympy.series.kauers import finite_diff_kauers
from sympy.abc import x, y, z, m, n, w
from sympy import sin, cos
from sympy import pi
from sympy import Sum
def test_finite_diff():
assert finite_diff(x**2 + 2*x + 1, x) == 2*x + 3
assert finite_diff(y**3 + 2*y**2 ... | bsd-3-clause |
dsavransky/plandb.sioslab.com | getDataFromIPAC.py | 1 | 15203 | import requests
import pandas
from StringIO import StringIO
import astropy.units as u
import astropy.constants as const
import EXOSIMS.PlanetPhysicalModel.Forecaster
from sqlalchemy import create_engine
import getpass,keyring
import numpy as np
#grab the data
query = """https://exoplanetarchive.ipac.caltech.edu/cgi-b... | mit |
Jc2k/libcloud | libcloud/compute/drivers/bluebox.py | 1 | 7490 | # 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 use ... | apache-2.0 |
jcpowermac/ansible | lib/ansible/modules/network/radware/vdirect_runnable.py | 22 | 13185 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2017 Radware LTD.
#
# 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... | gpl-3.0 |
CLVsol/odoo_addons | clv_insured_mng/clv_tag/clv_tag.py | 1 | 2057 | # -*- encoding: utf-8 -*-
################################################################################
# #
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol #
# ... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.