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 |
|---|---|---|---|---|---|
jeanlinux/calibre | src/calibre/ebooks/oeb/display/webview.py | 13 | 2192 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import re
fr... | gpl-3.0 |
mathemage/h2o-3 | h2o-py/tests/testdir_algos/gbm/pyunit_cv_cars_gbm.py | 4 | 7071 | from __future__ import print_function
from builtins import range
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
import random
from h2o.estimators.gbm import H2OGradientBoostingEstimator
def cv_cars_gbm():
# read in the dataset and construct training set (and validation set)
ca... | apache-2.0 |
yatinag/selfcure | lib/werkzeug/contrib/cache.py | 252 | 27983 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.cache
~~~~~~~~~~~~~~~~~~~~~~
The main problem with dynamic Web sites is, well, they're dynamic. Each
time a user requests a page, the webserver executes a lot of code, queries
the database, renders templates until the visitor gets the page he sees.
... | apache-2.0 |
sdispater/cleo | tests/io/inputs/test_argument.py | 1 | 1695 | import pytest
from cleo.exceptions import LogicException
from cleo.io.inputs.argument import Argument
def test_optional_non_list_argument():
argument = Argument(
"foo",
required=False,
is_list=False,
description="Foo description",
default="bar",
)
assert argument.... | mit |
lmyrefelt/CouchPotatoServer | libs/requests/utils.py | 58 | 16299 | # -*- coding: utf-8 -*-
"""
requests.utils
~~~~~~~~~~~~~~
This module provides utility functions that are used within Requests
that are also useful for external consumption.
"""
import cgi
import codecs
import collections
import os
import platform
import re
import sys
from netrc import netrc, NetrcParseError
from ... | gpl-3.0 |
jpopelka/fabric8-analytics-worker | f8a_worker/workers/victims.py | 1 | 8076 | """Task to analyze vulnerable packages and mark them in graph as such."""
import os
import requests
from f8a_worker.base import BaseTask
from f8a_worker.models import Ecosystem
from f8a_worker.victims import VictimsDB, FilteredVictimsDB
from f8a_worker.graphutils import update_properties, create_nodes
from selinon im... | gpl-3.0 |
bilke/OpenSG-1.8 | SConsLocal/scons-local-0.96.1/SCons/Tool/hpc++.py | 2 | 2432 | """SCons.Tool.hpc++
Tool-specific initialization for c++ on HP/UX.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004 The SCons Foundation
#
# Permission is hereby grant... | lgpl-2.1 |
Sbalbp/DIRAC | ResourceStatusSystem/Client/Oldtest/Test_Clients.py | 10 | 11312 | #import unittest
#
#from DIRAC.Core.Base import Script
#Script.parseCommandLine()
#
#from DIRAC.ResourceStatusSystem.Utilities.mock import Mock
#from DIRAC.ResourceStatusSystem.Client.JobsClient import JobsClient
#from DIRAC.ResourceStatusSystem.Client.PilotsClient import Pilo... | gpl-3.0 |
maxbeth/fail2ban | fail2ban/tests/sockettestcase.py | 18 | 2925 | # 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 |
chanceraine/nupic | nupic/datafiles/extra/firstOrder/raw/makeDataset.py | 34 | 3485 | #! /usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions... | agpl-3.0 |
codevog/cv-qrcode | QRCodeCodevogViewController/QRCodeCodevogViewController/Libs/zbarSDK/test/barcodetest.py | 28 | 11751 | #!/usr/bin/env python
import sys, re, unittest as UT, xml.etree.ElementTree as ET
from os import path, getcwd
from errno import EISDIR, EINVAL, EACCES
from StringIO import StringIO
from subprocess import Popen, PIPE
from urllib2 import urlopen, HTTPError
from urlparse import urljoin, urlunparse
from traceback import f... | lgpl-2.1 |
andyzsf/edx | lms/djangoapps/verify_student/tests/test_views.py | 3 | 31400 | # encoding: utf-8
"""
verify_student/start?course_id=MITx/6.002x/2013_Spring # create
/upload_face?course_id=MITx/6.002x/2013_Spring
/upload_photo_id
/confirm # mark_ready()
---> To Payment
"""
import json
import mock
import urllib
import decimal
from mock import patch, Mo... | agpl-3.0 |
geekboxzone/mmallow_external_parameter-framework | test/functional-tests/PfwTestCase/Domains/tDomain_Configuration.py | 10 | 28508 | # -*-coding:utf-8 -*
# Copyright (c) 2011-2015, Intel Corporation
# 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 of source code must retain the above copyright notice, thi... | bsd-3-clause |
prembasumatary/osrm-backend | cmake/cmake_options_script.py | 80 | 1514 | # Based on @berenm's pull request https://github.com/quarnster/SublimeClang/pull/135
# Create the database with cmake with for example: cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
# or you could have set(CMAKE_EXPORT_COMPILE_COMMANDS ON) in your CMakeLists.txt
# Usage within SublimeClang:
# "sublimeclang_options_scri... | bsd-2-clause |
rhdedgar/openshift-tools | openshift/installer/vendored/openshift-ansible-3.0.88/filter_plugins/oo_filters.py | 18 | 39909 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# vim: expandtab:tabstop=4:shiftwidth=4
"""
Custom filters for use in openshift-ansible
"""
from ansible import errors
from collections import Mapping
from operator import itemgetter
import OpenSSL.crypto
import os
import pdb
import re
import json
import yaml
from ansible.util... | apache-2.0 |
taiwanlennon/flask-master | flask/testsuite/reqctx.py | 557 | 5960 | # -*- coding: utf-8 -*-
"""
flask.testsuite.reqctx
~~~~~~~~~~~~~~~~~~~~~~
Tests the request context.
:copyright: (c) 2012 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import flask
import unittest
try:
from greenlet import greenlet
except ImportError:
greenlet = None... | bsd-3-clause |
orgito/ansible | lib/ansible/modules/network/a10/a10_service_group.py | 18 | 13223 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Mischa Peters <mpeters@a10networks.com>,
# Eric Chou <ericc@a10networks.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__ = t... | gpl-3.0 |
googlei18n/glyphsLib | tests/writer_test.py | 1 | 34927 | # coding=UTF-8
#
# Copyright 2016 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 by ap... | apache-2.0 |
sujeet4github/MyLangUtils | LangPython/oreilly-intro-to-flask-video/venv/lib/python3.6/site-packages/sqlalchemy/orm/query.py | 22 | 154548 | # orm/query.py
# Copyright (C) 2005-2017 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
"""The Query class and support.
Defines the :class:`.Query` class, the central
constru... | gpl-3.0 |
patrickstocklin/chattR | lib/python2.7/site-packages/requests/packages/chardet/langthaimodel.py | 2930 | 11275 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 R... | gpl-2.0 |
cnsoft/kbengine-cocos2dx | kbe/src/lib/python/Lib/nturl2path.py | 56 | 2396 | """Convert a NT pathname to a file URL and vice versa."""
def url2pathname(url):
"""OS-specific conversion from a relative URL of the 'file' scheme
to a file system path; not recommended for general use."""
# e.g.
# ///C|/foo/bar/spam.foo
# becomes
# C:\foo\bar\spam.foo
import string, urlli... | lgpl-3.0 |
alxgu/ansible | test/units/modules/network/fortimanager/test_fmgr_fwobj_vip.py | 39 | 24644 | # Copyright 2018 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... | gpl-3.0 |
waltervh/BornAgain-tutorial | talks/day_2/python_api_G/pyapi04_lamellar_vertical_solution2.py | 3 | 2390 | import bornagain as ba
from bornagain import deg, nm
def get_vertical_lamellar():
mat_a = ba.HomogeneousMaterial("PTFE", 5.20508729E-6, 1.96944292E-8)
mat_b = ba.HomogeneousMaterial("HMDSO", 2.0888308E-6, 1.32605651E-8)
length = 30*nm
width_a = 4*nm
width_b = 8*nm
height = 30*nm
nstack = 5... | gpl-3.0 |
tumbl3w33d/ansible | lib/ansible/modules/network/opx/opx_cps.py | 38 | 12542 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2018 Dell Inc. or its subsidiaries. All Rights Reserved.
#
# This file is part of Ansible by Red Hat
#
# 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,... | gpl-3.0 |
nttks/edx-platform | lms/djangoapps/bulk_email/tests/test_err_handling.py | 30 | 16895 | # -*- coding: utf-8 -*-
"""
Unit tests for handling email sending errors
"""
from itertools import cycle
from celery.states import SUCCESS, RETRY # pylint: disable=no-name-in-module, import-error
from django.conf import settings
from django.core.management import call_command
from django.core.urlresolvers import reve... | agpl-3.0 |
julietbravo/microhh | cases/rcemip/rcemip_coarse_input.py | 5 | 5604 | import numpy as np
import netCDF4 as nc
float_type = "f8"
#T_0 = 295.
#q_0 = 0.01200 # for 295 K SST.
T_0 = 300.
q_0 = 0.01864 # for 300 K SST.
#T_0 = 305.
#q_0 = 0.02400 # for 305 K SST.
def q_sat(T, p):
Tc = T - 273.15
# Arden-Buck equation.
e_sat = 611.21 * np.exp(17.502 * Tc / (240.97 + Tc))
R... | gpl-3.0 |
mapr/sahara | sahara/tests/unit/service/test_ops.py | 2 | 4622 | # Copyright (c) 2014 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | apache-2.0 |
dims/python-k8sclient | k8sclient/client/models/v1_resource_quota_list.py | 5 | 5429 | # coding: utf-8
"""
Copyright 2015 SmartBear Software
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 |
blindroot/django | django/db/migrations/optimizer.py | 127 | 2872 | from __future__ import unicode_literals
class MigrationOptimizer(object):
"""
Powers the optimization process, where you provide a list of Operations
and you are returned a list of equal or shorter length - operations
are merged into one if possible.
For example, a CreateModel and an AddField can... | bsd-3-clause |
benjamindeleener/odoo | addons/crm_partner_assign/wizard/crm_forward_to_partner.py | 46 | 9295 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp.osv import fields, osv
from openerp.tools.translate import _
from openerp.exceptions import UserError
class crm_lead_forward_to_partner(osv.TransientModel):
""" Forward info history to partners. """
... | gpl-3.0 |
gabrielfalcao/lettuce | tests/integration/lib/Django-1.3/tests/regressiontests/m2m_through_regress/models.py | 86 | 2347 | from datetime import datetime
from django.contrib.auth.models import User
from django.core import management
from django.db import models
# Forward declared intermediate model
class Membership(models.Model):
person = models.ForeignKey('Person')
group = models.ForeignKey('Group')
price = models.IntegerFie... | gpl-3.0 |
zifeo/nest-simulator | testsuite/manualtests/test_tsodyks_depr_fac.py | 13 | 1136 | # -*- coding: utf-8 -*-
#
# test_tsodyks_depr_fac.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 L... | gpl-2.0 |
WebSpider/headphones | lib/unidecode/x075.py | 253 | 4675 | data = (
'Zhui ', # 0x00
'Ping ', # 0x01
'Bian ', # 0x02
'Zhou ', # 0x03
'Zhen ', # 0x04
'Senchigura ', # 0x05
'Ci ', # 0x06
'Ying ', # 0x07
'Qi ', # 0x08
'Xian ', # 0x09
'Lou ', # 0x0a
'Di ', # 0x0b
'Ou ', # 0x0c
'Meng ', # 0x0d
'Zhuan ', # 0x0e
'Peng ', # 0x0f
'Lin ', ... | gpl-3.0 |
flt/FitFinder | lib/jinja2/constants.py | 1169 | 1626 | # -*- coding: utf-8 -*-
"""
jinja.constants
~~~~~~~~~~~~~~~
Various constants.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
#: list of lorem ipsum words used by the lipsum() helper function
LOREM_IPSUM_WORDS = u'''\
a ac accumsan ad adipiscing aenean a... | apache-2.0 |
fbradyirl/home-assistant | tests/components/tplink/test_common.py | 7 | 2372 | """Common code tests."""
from datetime import timedelta
from unittest.mock import MagicMock
from pyHS100 import SmartDeviceException
from homeassistant.components.tplink.common import async_add_entities_retry
from homeassistant.helpers.typing import HomeAssistantType
async def test_async_add_entities_retry(hass: Ho... | apache-2.0 |
sejros/PyInference | examples/infer.py | 1 | 26060 | # -*- coding: UTF-8 -*-
"""Модуль для работы с механизмом нечеткого вывода.
Позволяет строить простейшие нечеткие экспертные системы (FES) путем построения
нечетких подмножеств на деревьях особого типа.
Синтаксис:
>>> from FuzzySet import *
>>> # создаем классификаторы:
>>> C1=std_5_Classificator(name='C... | gpl-3.0 |
ennoborg/gramps | gramps/gen/filters/rules/_hassourceofbase.py | 5 | 2736 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
# Copyright (C) 2011 Tim G L Lyons
#
# 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; eith... | gpl-2.0 |
kmonsoor/python-for-android | python-build/python-libs/gdata/build/lib/atom/token_store.py | 280 | 4048 | #!/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 |
IRSO/irsosav | node-v4/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input_test.py | 1841 | 3207 | #!/usr/bin/env python
# Copyright 2013 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.
"""Unit tests for the input.py file."""
import gyp.input
import unittest
import sys
class TestFindCycles(unittest.TestCase):
def setUp(self... | gpl-3.0 |
urda/mrbutler-bot | tests/unit/mrb_common/commanding/test_command.py | 1 | 1391 | """
Copyright 2017 Peter Urda
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
dis... | apache-2.0 |
adeepkit01/networks | .waf-1.8.13-4da49748f68a49832130c7ef124357f6/waflib/Tools/flex.py | 21 | 1036 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
import waflib.TaskGen,os,re
def decide_ext(self,node):
if'cxx'in self.features:
return['.lex.cc']
return['.lex.c']
def flexfun(tsk):
env=tsk.env
bld=tsk.generator.bld
wd=bld.variant_dir
def t... | gpl-2.0 |
jakew02/android_kernel_lge_msm8992 | tools/perf/tests/attr.py | 3174 | 9441 | #! /usr/bin/python
import os
import sys
import glob
import optparse
import tempfile
import logging
import shutil
import ConfigParser
class Fail(Exception):
def __init__(self, test, msg):
self.msg = msg
self.test = test
def getMsg(self):
return '\'%s\' - %s' % (self.test.path, self.msg)... | gpl-2.0 |
jorik041/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/style/filter.py | 196 | 11782 | # Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions... | bsd-3-clause |
Syncano/syncano-cli | syncano_cli/base/formatters.py | 1 | 3355 | # -*- coding: utf-8 -*-
import click
import six
from syncano_cli.base.options import BottomSpacedOpt, ColorSchema, DefaultOpt, OptionsBase, WarningOpt
class Formatter(object):
indent = ' '
not_set = '-- not set --'
def write(self, single_line, *options):
option = self.get_options(options)
... | mit |
DeepRNN/visual_question_answering | episodic_memory.py | 1 | 3592 | import tensorflow as tf
from utils.nn import NN
class AttnGRU(object):
""" Attention-based GRU (used by the Episodic Memory Module). """
def __init__(self, config):
self.nn = NN(config)
self.num_units = config.num_gru_units
def __call__(self, inputs, state, attention):
with tf.vari... | mit |
marcore/pok-eco | xapi/patterns/video.py | 1 | 1417 | import json
from tincan import (
Activity,
ActivityDefinition,
LanguageMap
)
from xapi.patterns.base import BasePattern
from xapi.patterns.eco_verbs import (
LoadVideoVerb,
PlayVideoVerb
)
from xapi.utils import get_usage_key
class BaseVideoRule(BasePattern): # pylint: disable=abstract-method
... | agpl-3.0 |
dhermes/gcloud-python | videointelligence/google/cloud/videointelligence_v1p2beta1/types.py | 2 | 1763 | # -*- coding: utf-8 -*-
#
# Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 |
lucafavatella/intellij-community | python/testData/inspections/PyPropertyDefinitionInspection26/src/prop_test.py | 44 | 1129 | class A(object):
def __init__(self):
self._x = 1
@property
def foo(self):
return self._x
@foo.setter
def foo(self, x):
self._x = x
@foo.deleter
def foo(self):
pass
@property
def boo(self):
return self._x
@boo.setter # name mismatch
def boo1(self, x):
self._x = x
@bo... | apache-2.0 |
mykonosbiennale/mykonosbiennale.github.io | festival/management/commands/rename_images.py | 1 | 32746 | # -*- coding: utf-8 -*-
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
import time, traceback
import collections
import re
import os
import sys
import csv
import pprint
import optparse
from django.core.files.base import ContentFile
from nameparser import HumanName
from django.core.management.base import BaseCom... | apache-2.0 |
autvincere/bureau-veritas-food | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/common.py | 1292 | 20063 | # 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.
from __future__ import with_statement
import collections
import errno
import filecmp
import os.path
import re
import tempfile
import sys
# A minimal memoizing d... | mit |
mrjaydee82/SinLessKerne1-m8-GPE | toolchains/a8483/share/gdb/python/gdb/command/explore.py | 137 | 26824 | # GDB 'explore' command.
# Copyright (C) 2012-2013 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any late... | gpl-2.0 |
attakei/readthedocs-oauth | readthedocs/vcs_support/backends/git.py | 29 | 6852 | import re
import logging
import csv
import os
from StringIO import StringIO
from readthedocs.projects.exceptions import ProjectImportError
from readthedocs.vcs_support.base import BaseVCS, VCSVersion
log = logging.getLogger(__name__)
class Backend(BaseVCS):
supports_tags = True
supports_branches = True
... | mit |
jrversteegh/flexx | flexxamples/testers/mouse_and_touch.py | 2 | 2009 | """
This example is intended to test mouse/touch events.
"""
from time import time
from flexx import flx
class Test(flx.Widget):
def init(self):
self.t = time()
with flx.HFix():
self.label1 = flx.Label(flex=2, style='overflow-y:scroll; font-size:60%;')
flx.Widget(flex=1... | bsd-2-clause |
bloyl/mne-python | mne/datasets/sleep_physionet/_utils.py | 7 | 8646 | # -*- coding: utf-8 -*-
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Joan Massich <mailsik@gmail.com>
#
# License: BSD Style.
import os
import os.path as op
import numpy as np
from distutils.version import LooseVersion
from ...utils import (_fetch_file, verbose, _TempDir, _check_pandas_insta... | bsd-3-clause |
mspark93/VTK | ThirdParty/Twisted/twisted/python/test/pullpipe.py | 41 | 1238 | #!/usr/bin/python
# -*- test-case-name: twisted.python.test.test_sendmsg -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
import sys, os
from struct import unpack
# This makes me sad. Why aren't things nice?
sys.path.insert(0, __file__.rsplit('/', 4)[0])
from twisted.python.sendmsg import... | bsd-3-clause |
danielgoncalves/PyNFe | pynfe/entidades/base.py | 1 | 1483 | # -*- coding: utf-8 -*-
#
# PyNFe/pynfe/entidades/base.py
#
# Projeto PyNFe
# Copyright (C) 2010 Marinho Brandão et al
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3... | lgpl-3.0 |
lucaceresoli/linux | 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 |
flyfei/python-for-android | python3-alpha/python3-src/Lib/distutils/file_util.py | 54 | 7810 | """distutils.file_util
Utility functions for operating on single files.
"""
import os
from distutils.errors import DistutilsFileError
from distutils import log
# for generating verbose output in 'copy_file()'
_copy_action = { None: 'copying',
'hard': 'hard linking',
'sym': 'symbo... | apache-2.0 |
paour/weblate | weblate/trans/decorators.py | 2 | 1236 | # -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2014 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.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, eithe... | gpl-3.0 |
garethsaxby/python_koans | python3/koans/about_tuples.py | 1 | 2290 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutTuples(Koan):
def test_creating_a_tuple(self):
count_of_three = (1, 2, 5)
self.assertEqual(5, count_of_three[2])
def test_tuples_are_immutable_so_item_assignment_is_not_possible(self):
count_of_three ... | mit |
Buggaboo/gimp-plugin-export-layers | export_layers/pygimplib/tee.py | 1 | 5139 | #-------------------------------------------------------------------------------
#
# This file is part of pygimplib.
#
# Copyright (C) 2014, 2015 khalim19 <khalim19@gmail.com>
#
# pygimplib is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# t... | gpl-3.0 |
enitihas/SAC-Website | venv/bin/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/hebrewprober.py | 2929 | 13359 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Shy Shalom
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#... | apache-2.0 |
pyfisch/servo | tests/wpt/web-platform-tests/tools/third_party/h2/test/test_invalid_headers.py | 25 | 34188 | # -*- coding: utf-8 -*-
"""
test_invalid_headers.py
~~~~~~~~~~~~~~~~~~~~~~~
This module contains tests that use invalid header blocks, and validates that
they fail appropriately.
"""
import itertools
import pytest
import h2.config
import h2.connection
import h2.errors
import h2.events
import h2.exceptions
import h2.... | mpl-2.0 |
Trois-Six/ansible-modules-core | cloud/openstack/_quantum_network.py | 37 | 10270 | #!/usr/bin/python
#coding: utf-8 -*-
# (c) 2013, Benno Joy <benno@ansible.com>
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ... | gpl-3.0 |
EmbodiedCognition/pagoda | setup.py | 1 | 1082 | import os
import setuptools
README = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'README.rst')
setuptools.setup(
name='pagoda',
version='0.1.0',
packages=setuptools.find_packages(),
package_data={'': ['*.peg']},
author='UT Vision, Cognition, and Action Lab',
author_email='leif@cs.... | mit |
kmoocdev2/edx-platform | lms/envs/test.py | 1 | 20878 | # -*- coding: utf-8 -*-
"""
This config file runs the simplest dev environment using sqlite, and db-based
sessions. Assumes structure:
/envroot/
/db # This is where it'll write the database file
/edx-platform # The location of this repo
/log # Where we're going to write log files
"""
# We ... | agpl-3.0 |
xombiemp/CouchPotatoServer | libs/rtorrent/compat.py | 180 | 1258 | # Copyright (c) 2013 Chris Lucas, <chris@chrisjlucas.com>
# 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 restriction, including
# without limitation the rights to use, copy, modify, ... | gpl-3.0 |
renzon/appengineepython | backend/apps/curso_app/curso_facade.py | 1 | 1664 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from gaegraph.business_base import NodeSearch, DeleteNode
from curso_app.curso_commands import ListCursoCommand, SaveCursoCommand, UpdateCursoCommand, CursoForm,\
GetCursoCommand, DeleteCursoCommand
def save_curso_cmd(**curso_propert... | mit |
abilian/abilian-core | src/abilian/services/viewtracker/models.py | 1 | 1611 | from datetime import datetime
from sqlalchemy.orm import relationship
from sqlalchemy.schema import Column, ForeignKey
from sqlalchemy.types import DateTime, Integer
from abilian.core.entities import Entity, db
from abilian.core.models.subjects import User
# TODO: remove duplicate
def _default_from(column):
"""... | lgpl-2.1 |
grlee77/nipype | nipype/workflows/dmri/fsl/artifacts.py | 9 | 39638 | # coding: utf-8
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import os
import nipype.pipeline.engine as pe
from nipype.interfaces.io import JSONFileGrabber
from nipype.interfaces import utility as niu
from nipype.interfaces import freesurfer as fs
fr... | bsd-3-clause |
Electrex/Electroactive-N6 | 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 |
fuentesdt/InsightToolkit-dev | Wrapping/Generators/Python/Tests/notYetUsable/ImageRegistration4.py | 4 | 3959 | #==========================================================================
#
# Copyright Insight Software Consortium
#
# 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... | apache-2.0 |
cfenoy/easybuild-easyblocks | easybuild/easyblocks/t/tbb.py | 5 | 4276 | ##
# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (htt... | gpl-2.0 |
gkotton/neutron | neutron/services/firewall/agents/firewall_agent_api.py | 10 | 2533 | # Copyright (c) 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 |
atul-bhouraskar/django | django/core/checks/messages.py | 319 | 2383 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.utils.encoding import force_str, python_2_unicode_compatible
# Levels
DEBUG = 10
INFO = 20
WARNING = 30
ERROR = 40
CRITICAL = 50
@python_2_unicode_compatible
class CheckMessage(object):
def __init__(self, level, msg, hint=None, obj=Non... | bsd-3-clause |
s40523242/2016fallcp_hw | course/week2.py | 19 | 12340 | # 開始透過 ggame 程式庫進行網際繪圖
# ggame 手冊
# http://brythonserver.github.io/ggame/
'''
from ggame import App, Color, LineStyle, Sprite
from ggame import RectangleAsset, CircleAsset, EllipseAsset, PolygonAsset
# Three primary colors with no transparency (alpha = 1.0)
red = Color(0xff0000, 1.0)
green = Color(0x00ff00, 1.0)
blue ... | agpl-3.0 |
calfonso/ansible | lib/ansible/parsing/dataloader.py | 11 | 18574 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import c... | gpl-3.0 |
robinro/ansible | lib/ansible/utils/module_docs_fragments/ios.py | 101 | 4360 | #
# (c) 2015, Peter Sprygada <psprygada@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any late... | gpl-3.0 |
JVenberg/PokemonGo-Bot-Desktop | pywin/Lib/encodings/koi8_u.py | 593 | 14018 | """ Python Character Mapping Codec koi8_u generated from 'python-mappings/KOI8-U.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors='stri... | mit |
rue89-tech/edx-platform | lms/djangoapps/survey/tests/test_models.py | 63 | 7761 | """
Python tests for the Survey models
"""
from collections import OrderedDict
from django.test import TestCase
from django.test.client import Client
from django.contrib.auth.models import User
from survey.exceptions import SurveyFormNotFound, SurveyFormNameAlreadyExists
from django.core.exceptions import Validation... | agpl-3.0 |
tom-slick/pygooglevoice | googlevoice/util.py | 40 | 8838 | import re
from sys import stdout
from xml.parsers.expat import ParserCreate
from time import gmtime
from datetime import datetime
from pprint import pprint
try:
from urllib2 import build_opener,install_opener, \
HTTPCookieProcessor,Request,urlopen
from urllib import urlencode,quote
except ImportError:
... | bsd-3-clause |
friedrich420/N910G-AEL-Kernel-Lollipop-Sources | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py | 4653 | 3596 | # EventClass.py
#
# This is a library defining some events types classes, which could
# be used by other scripts to analyzing the perf samples.
#
# Currently there are just a few classes defined for examples,
# PerfEvent is the base class for all perf event sample, PebsEvent
# is a HW base Intel x86 PEBS event, and use... | gpl-2.0 |
AlexanderDolgan/sputnik | wp-content/themes/node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py | 395 | 12634 | #!/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.
"""Utility functions for Windows builds.
These functions are executed via gyp-win-tool when using the ninja generator.
"""
import os
impor... | gpl-2.0 |
lumig242/Hue-Integration-with-CDAP | desktop/core/ext-py/tablib-0.10.0/tablib/packages/yaml3/composer.py | 273 | 4881 |
__all__ = ['Composer', 'ComposerError']
from .error import MarkedYAMLError
from .events import *
from .nodes import *
class ComposerError(MarkedYAMLError):
pass
class Composer:
def __init__(self):
self.anchors = {}
def check_node(self):
# Drop the STREAM-START event.
if self.ch... | apache-2.0 |
centrofermi/e3pipe | tasks/e3dqm.py | 1 | 1620 | #!/usr/bin/env python
# *********************************************************************
# * Copyright (C) 2014 Luca Baldini (luca.baldini@pi.infn.it) *
# * *
# * For the license terms see the file LICENSE, distributed *
# * along ... | gpl-3.0 |
openego/dingo | tests/core/test_core.py | 1 | 1146 | import pytest
from egoio.tools import db
from sqlalchemy.orm import sessionmaker
import oedialect
from ding0.core import NetworkDing0
class TestNetworkDing0(object):
@pytest.fixture
def emptyNetworkDing0(self):
"""
Returns an empty NetworkDing0 object for testing
"""
return ... | agpl-3.0 |
hxddh/youtube-dl | youtube_dl/extractor/vbox7.py | 92 | 2298 | # encoding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urllib_request,
compat_urlparse,
)
from ..utils import (
ExtractorError,
)
class Vbox7IE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?vbox7\.com/play:(... | unlicense |
compulab/trimslice-android-kernel | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.2/Lib/idlelib/MultiCall.py | 54 | 17510 | """
MultiCall - a class which inherits its methods from a Tkinter widget (Text, for
example), but enables multiple calls of functions per virtual event - all
matching events will be called, not only the most specific one. This is done
by wrapping the event functions - event_add, event_delete and event_info.
MultiCall r... | mit |
alisidd/tensorflow | tensorflow/python/framework/dtypes.py | 30 | 19314 | # 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 |
vijayanandnandam/youtube-dl | youtube_dl/extractor/nobelprize.py | 68 | 2123 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
js_to_json,
mimetype2ext,
determine_ext,
update_url_query,
get_element_by_attribute,
int_or_none,
)
class NobelPrizeIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?nobelpri... | unlicense |
takeshineshiro/neutron | neutron/tests/unit/notifiers/test_batch_notifier.py | 56 | 2032 | # Copyright (c) 2014 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | apache-2.0 |
chouseknecht/ansible-modules-core | network/vyos/vyos_command.py | 6 | 7539 | #!/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 |
PredictiveScienceLab/GPy | GPy/inference/latent_function_inference/fitc.py | 15 | 3137 | # Copyright (c) 2012, James Hensman
# Licensed under the BSD 3-clause license (see LICENSE.txt)
from .posterior import Posterior
from ...util.linalg import jitchol, tdot, dtrtrs, dpotri, pdinv
from ...util import diag
import numpy as np
from . import LatentFunctionInference
log_2_pi = np.log(2*np.pi)
class FITC(Laten... | bsd-3-clause |
ProjectSWGCore/NGECore2 | scripts/mobiles/endor/panshee_elder_warrior.py | 2 | 3145 | import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate... | lgpl-3.0 |
ksrajkumar/openerp-6.1 | openerp/workflow/instance.py | 14 | 3542 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
garyjyao1/ansible | contrib/inventory/ec2.py | 20 | 54413 | #!/usr/bin/env python
'''
EC2 external inventory script
=================================
Generates inventory that Ansible can understand by making API request to
AWS EC2 using the Boto library.
NOTE: This script assumes Ansible is being executed where the environment
variables needed for Boto have already been set:... | gpl-3.0 |
maxamillion/anitya | tests/test_backend_pagure.py | 4 | 3605 | # -*- coding: utf-8 -*-
#
# Copyright © 2015 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
# of the GNU General Public License v.2, or (at your option) any later
# version. This program is distributed in t... | gpl-2.0 |
qqzwc/XX-Net | code/default/python27/1.0/lib/noarch/hyper/packages/rfc3986/parseresult.py | 45 | 11142 | # -*- coding: utf-8 -*-
# Copyright (c) 2015 Ian Cordasco
# 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... | bsd-2-clause |
plediii/coord_util | test_sql_table.py | 1 | 16745 |
import unittest
from sql_table import *
class SQLTableTestCase(unittest.TestCase):
def test_no_empty_table(self):
class EmptyTable(SQLTable):
pass
self.assertRaises(SQLDeclarationError, EmptyTable)
def test_no_primary_keys_a(self):
class TestTable(SQLTable):... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.