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 |
|---|---|---|---|---|---|
2014c2g4/2015cda0623 | static/Brython3.1.3-20150514-095342/Lib/collections/abc.py | 739 | 16026 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) for collections, according to PEP 3119.
Unit tests are in test_collections.
"""
from abc import ABCMeta, abstractmethod
import sys
__all__ = ["Hashable", "Iterable", "Iterator",
... | gpl-3.0 |
kiryx/pagmo | PyGMO/core/__init__.py | 3 | 20705 | # -*- coding: utf-8 -*-
from PyGMO.core._core import *
import threading as _threading
import signal as _signal
import os as _os
__doc__ = 'PyGMO core module.'
__all__ = [
'archipelago',
'base_island',
'champion',
'distribution_type',
'individual',
'ipy_island',
'island',
'local_island',... | gpl-3.0 |
alexzatsepin/omim | tools/python/stylesheet/cat_stat.py | 13 | 7182 | #!/usr/bin/env python
import csv
import drules_struct_pb2
import os
import re
import sqlite3
import sys
import xml.etree.ElementTree as etree
def parse_mapcss_row(row):
if len(row) < 2:
# Allow for empty lines and comments that do not contain ';' symbol
return None
if len(row) == 3:
# ... | apache-2.0 |
quasiben/bokeh | bokeh/models/sources.py | 6 | 9916 | from __future__ import absolute_import
from ..core import validation
from ..core.validation.errors import COLUMN_LENGTHS
from ..core.properties import abstract
from ..core.properties import Any, Int, String, Instance, List, Dict, Bool, Enum, JSON
from ..model import Model
from ..util.dependencies import import_optiona... | bsd-3-clause |
tumbl3w33d/ansible | lib/ansible/modules/storage/netapp/na_elementsw_drive.py | 52 | 11043 | #!/usr/bin/python
# (c) 2018, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or
# https://www.gnu.org/licenses/gpl-3.0.txt)
'''
Element Software Node Drives
'''
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
jeremiedecock/tictactoe-py | utils/stats.py | 1 | 2188 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2016 Jérémie DECOCK (http://www.jdhp.org)
# 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 witho... | mit |
SrNetoChan/QGIS | python/plugins/processing/gui/HistoryDialog.py | 5 | 6199 | # -*- coding: utf-8 -*-
"""
***************************************************************************
HistoryDialog.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*************************... | gpl-2.0 |
chyeh727/django | tests/sessions_tests/tests.py | 5 | 28097 | import base64
import os
import shutil
import string
import sys
import tempfile
import unittest
from datetime import timedelta
from django.conf import settings
from django.contrib.sessions.backends.cache import SessionStore as CacheSession
from django.contrib.sessions.backends.cached_db import \
SessionStore as Cac... | bsd-3-clause |
sergmelikyan/murano | murano/packages/mpl_package.py | 3 | 3570 | # 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... | apache-2.0 |
bdh1011/cupeye | venv/lib/python2.7/site-packages/whoosh/lang/snowball/norwegian.py | 96 | 2803 | from .bases import _ScandinavianStemmer
from whoosh.compat import u
class NorwegianStemmer(_ScandinavianStemmer):
"""
The Norwegian Snowball stemmer.
:cvar __vowels: The Norwegian vowels.
:type __vowels: unicode
:cvar __s_ending: Letters that may directly appear before a word final 's'.
:ty... | bsd-3-clause |
ianyh/heroku-buildpack-python-opencv | vendor/.heroku/lib/python2.7/re.py | 153 | 12959 | #
# Secret Labs' Regular Expression Engine
#
# re-compatible interface for the sre matching engine
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# This version of the SRE library can be redistributed under CNRI's
# Python 1.6 license. For any other use, please contact Secret Labs
# AB (info@py... | mit |
awkspace/ansible | test/units/modules/files/test_copy.py | 94 | 7698 | # -*- coding: utf-8 -*-
# Copyright:
# (c) 2018 Ansible Project
# License: 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)
__metaclass__ = type
import pytest
from ansible.modules.files.copy ... | gpl-3.0 |
edisonlz/fruit | web_project/base/site-packages/androguard/decompiler/dad/graph.py | 6 | 13170 | # This file is part of Androguard.
#
# Copyright (c) 2012 Geoffroy Gueguen <geoffroy.gueguen@gmail.com>
# All Rights Reserved.
#
# Androguard 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 versi... | apache-2.0 |
peterlauri/django | tests/gis_tests/rasterapp/test_rasterfield.py | 18 | 14361 | import json
from django.contrib.gis.db.models.functions import Distance
from django.contrib.gis.db.models.lookups import (
DistanceLookupBase, gis_lookups,
)
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geos import GEOSGeometry
from django.contrib.gis.measure import D
from django.contrib.gi... | bsd-3-clause |
abagh0703/RetailTrail | flask/lib/python2.7/site.py | 306 | 27543 | """Append module search paths for third-party packages to sys.path.
****************************************************************
* This module is automatically imported during initialization. *
****************************************************************
In earlier versions of Python (up to 1.5a3), scripts or... | mit |
iivic/BoiseStateX | pavelib/utils/test/suites/nose_suite.py | 36 | 6610 | """
Classes used for defining and running nose test suites
"""
import os
from pavelib.utils.test import utils as test_utils
from pavelib.utils.test.suites.suite import TestSuite
from pavelib.utils.envs import Env
__test__ = False # do not collect
class NoseTestSuite(TestSuite):
"""
A subclass of TestSuite w... | agpl-3.0 |
cjlee112/socraticqs2 | mysite/ct/views.py | 1 | 82457 | import time
import urllib.request, urllib.parse, urllib.error
from datetime import datetime
from collections import OrderedDict
from django.contrib import messages
from django.db.models import Q
from django.conf import settings
from django.utils import timezone
from django.urls import reverse
from django.contrib.auth.... | apache-2.0 |
kurtrwall/wagtail | wagtail/project_template/project_name/settings/base.py | 2 | 3782 | """
Django settings for {{ project_name }} project.
Generated by 'django-admin startproject' using Django {{ django_version }}.
For more information on this file, see
https://docs.djangoproject.com/en/{{ docs_version }}/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.c... | bsd-3-clause |
evancich/apm_motor | modules/waf/waflib/extras/fc_solstudio.py | 10 | 1638 | #! /usr/bin/env python
# encoding: utf-8
# harald at klimachs.de
import re
from waflib import Utils
from waflib.Tools import fc,fc_config,fc_scan
from waflib.Configure import conf
from waflib.Tools.compiler_fc import fc_compiler
fc_compiler['linux'].append('fc_solstudio')
@conf
def find_solstudio(conf):
"""Find the... | gpl-3.0 |
nhicher/ansible | lib/ansible/plugins/action/nxos.py | 20 | 7135 | #
# (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 d... | gpl-3.0 |
bdrung/audacity | lib-src/lv2/lv2/plugins/eg-fifths.lv2/waflib/Tools/c_preproc.py | 181 | 16705 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import re,string,traceback
from waflib import Logs,Utils,Errors
from waflib.Logs import debug,error
class PreprocError(Errors.WafError):
pass
POPFILE='-'
recursion_limit=150
... | gpl-2.0 |
guoxiaolongzte/spark | examples/src/main/python/ml/count_vectorizer_example.py | 122 | 1548 | #
# 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 |
sdarji/lpthw | Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/connection.py | 319 | 1348 | from socket import error as SocketError
try:
from select import poll, POLLIN
except ImportError: # `poll` doesn't exist on OSX and other platforms
poll = False
try:
from select import select
except ImportError: # `select` doesn't exist on AppEngine.
select = False
def is_connection_dr... | unlicense |
jarrodmillman/stat133-fall2014 | _plugins/liquid_tags/youtube.py | 7 | 1511 | """
Youtube Tag
---------
This implements a Liquid-style youtube tag for Pelican,
based on the jekyll / octopress youtube tag [1]_
Syntax
------
{% youtube id [width height] %}
Example
-------
{% youtube dQw4w9WgXcQ 640 480 %}
Output
------
<iframe width="640" height="480" src="http://www.youtube.com/embed/dQw4w9WgX... | bsd-2-clause |
shrimpboyho/git.js | emscript/python/2.7.5.1_32bit/Lib/site-packages/win32/test/test_clipboard.py | 17 | 4233 | # General test module for win32api - please add some :)
import sys, os
import unittest
from win32clipboard import *
import win32gui, win32con
import pywintypes
import array
from pywin32_testutil import str2bytes
custom_format_name = "PythonClipboardTestFormat"
class CrashingTestCase(unittest.TestCase):
def test... | gpl-2.0 |
peiyuwang/pants | tests/python/pants_test/backend/jvm/tasks/test_jar_create.py | 7 | 7362 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from conte... | apache-2.0 |
bbsan2k/nzbToMedia | tests/general.py | 4 | 2098 | #! /usr/bin/env python2
import os
import sys
import datetime
import re
import core
import guessit
import requests
from core.nzbToMediaAutoFork import autoFork
from core import nzbToMediaDB
from core.transcoder import transcoder
from core.nzbToMediaUtil import get_downloadInfo, server_responding
# Initialize the config... | gpl-3.0 |
halfak/mwxml | mwxml/iteration/site_info.py | 2 | 3212 | import jsonable
from mwtypes.util import none_or
from .namespace import Namespace
class SiteInfo(jsonable.Type):
"""
Represents the data from the <siteinfo> in a MediaWiki XML dump.
.. autoattribute:: mwxml.iteration.site_info.SiteInfo.name
:annotation: = The name of the site. : str | None
... | mit |
nickmoline/feedsanitizer | django/views/defaults.py | 291 | 1663 | from django import http
from django.views.decorators.csrf import requires_csrf_token
from django.template import Context, RequestContext, loader
# This can be called when CsrfViewMiddleware.process_view has not run, therefore
# need @requires_csrf_token in case the template needs {% csrf_token %}.
@requires_csrf_toke... | mit |
brainwane/zulip | zerver/lib/error_notify.py | 4 | 5492 | # System documented in https://zulip.readthedocs.io/en/latest/subsystems/logging.html
from collections import defaultdict
from typing import Any, Dict
from django.conf import settings
from django.core.mail import mail_admins
from django.http import HttpResponse
from django.utils.translation import ugettext as _
from ... | apache-2.0 |
cosmoharrigan/pylearn2 | pylearn2/sandbox/cuda_convnet/tests/test_probabilistic_max_pooling.py | 49 | 5330 | import copy
import theano
import numpy as np
import theano.tensor as T
from theano import config
from theano import function
from pylearn2.expr.probabilistic_max_pooling import max_pool_c01b
from pylearn2.sandbox.cuda_convnet.probabilistic_max_pooling import prob_max_pool_c01b
from pylearn2.utils import float32_floatX... | bsd-3-clause |
moto-timo/ironpython3 | Tests/interop/net/loadorder/t4c.py | 3 | 1577 | #####################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# 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.html file at the root of t... | apache-2.0 |
optima-ict/odoo | addons/website_sale/controllers/website_mail.py | 13 | 2244 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import urlparse
from openerp import SUPERUSER_ID
from openerp import http
from openerp.addons.web.http import request
from openerp.addons.website_mail.controllers.main import WebsiteMail
class WebsiteMailController(We... | agpl-3.0 |
cpe/VAMDC-VALD | nodes/umist/node/dictionaries.py | 4 | 7263 | # -*- coding: utf-8 -*-
"""
ExampleNode dictionary definitions.
"""
# The returnable dictionary is used internally by the node and defines
# all the ways the VAMDC standard keywords (left-hand side) maps to
# the internal database representation queryset (right-hand side)
#
# When writing this, it helps to remember t... | gpl-3.0 |
SNOC/rpisigfox | sendsigfox.py | 1 | 3366 | #!/usr/bin/python
## @package rpisigfox
# This script allow the control of the rpisigfox expansion board for Raspberry Pi.
#
# V1.0 allow only to send regular message on the SigFox Network.
# syntax is :
# sendsigfox MESSAGE
# where MESSAGE is a HEXA string encoded. Can be 2 to 24 characters representing 1 to 12... | mit |
kxliugang/edx-platform | cms/djangoapps/contentstore/management/commands/export_all_courses.py | 91 | 2323 | """
Script for exporting all courseware from Mongo to a directory and listing the courses which failed to export
"""
from django.core.management.base import BaseCommand, CommandError
from xmodule.modulestore.xml_exporter import export_course_to_xml
from xmodule.modulestore.django import modulestore
from xmodule.content... | agpl-3.0 |
s40328104/2016fallcp_hw | plugin/liquid_tags/b64img.py | 312 | 3085 | """
Image Tag
---------
This implements a Liquid-style image tag for Pelican,
based on the liquid img tag which is based on the octopress image tag [1]_
Syntax
------
{% b64img [class name(s)] [http[s]:/]/path/to/image [width [height]] [title text | "title text" ["alt text"]] %}
Examples
--------
{% b64img /images/ni... | agpl-3.0 |
Tesi-Luca-Davide/ryu | ryu/contrib/ncclient/operations/session.py | 82 | 1414 | # Copyright 2009 Shikhar Bhushan
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | apache-2.0 |
antb/TPT----My-old-mod | src/python/stdlib/test/test_dictviews.py | 82 | 6513 | import unittest
from test import test_support
class DictSetTest(unittest.TestCase):
def test_constructors_not_callable(self):
kt = type({}.viewkeys())
self.assertRaises(TypeError, kt, {})
self.assertRaises(TypeError, kt)
it = type({}.viewitems())
self.assertRaises(TypeError... | gpl-2.0 |
AOKP/external_chromium_org | tools/find_depot_tools.py | 74 | 1374 | # Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Small utility function to find depot_tools and add it to the python path.
Will throw an ImportError exception if depot_tools can't be found since it
i... | bsd-3-clause |
endlessm/chromium-browser | third_party/grpc/src/examples/python/auth/_credentials.py | 7 | 1172 | # Copyright 2019 The gRPC Authors
#
# 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... | bsd-3-clause |
hieukypc/ERP | openerp/addons/hr_holidays/tests/common.py | 47 | 3457 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp.tests import common
class TestHrHolidaysBase(common.TransactionCase):
def setUp(self):
super(TestHrHolidaysBase, self).setUp()
cr, uid = self.cr, self.uid
# Usefull models
... | gpl-3.0 |
syhost/android_kernel_xiaomi_msm8226-common | 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 |
repotvsupertuga/tvsupertuga.repository | script.module.streamtvsupertuga/lib/resources/lib/sources/en_de/300mbfilms.py | 1 | 5854 | # -*- coding: utf-8 -*-
'''
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... | gpl-2.0 |
SnappleCap/oh-mainline | vendor/packages/twisted/twisted/mail/protocols.py | 19 | 6821 | # -*- test-case-name: twisted.mail.test.test_mail -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""Protocol support for twisted.mail."""
# twisted imports
from twisted.mail import pop3
from twisted.mail import smtp
from twisted.internet import protocol
from twisted.internet import defer... | agpl-3.0 |
sharbison3/python-docs-samples | appengine/standard/mail/send_message.py | 8 | 1638 | # 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 applicable law or a... | apache-2.0 |
TAMU-CPT/galaxy-tools | tools/phantasm/phantasm_data_transformation.py | 1 | 1113 | #!/usr/bin/env python
import argparse
import logging
from phantasm import Utils, Transforms
logging.basicConfig(level=logging.INFO)
if __name__ == "__main__":
transformations = {
"none": "x",
"neg": "-x",
"log": "log(x)",
"ln": "ln(x)",
"inv": "1/x",
"abs": "abs",
... | gpl-3.0 |
smaffulli/libcloud | libcloud/test/compute/test_dreamhost.py | 25 | 10189 | # 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 |
wyc/django | django/views/defaults.py | 339 | 3567 | from django import http
from django.template import Context, Engine, TemplateDoesNotExist, loader
from django.utils import six
from django.utils.encoding import force_text
from django.views.decorators.csrf import requires_csrf_token
# This can be called when CsrfViewMiddleware.process_view has not run,
# therefore ne... | bsd-3-clause |
mikewesner-wf/glasshouse | glasshouse.indigoPlugin/Contents/Server Plugin/plugin.py | 1 | 2000 | import indigo
import rest
import db
import requests
import settings
class Plugin(indigo.PluginBase):
def __init__(self, pluginId, pluginDisplayName, pluginVersion, pluginPrefs):
indigo.PluginBase.__init__(self, pluginId, pluginDisplayName, pluginVersion, pluginPrefs)
self.debug = True
def __de... | apache-2.0 |
Chilledheart/chromium | tools/generate_shim_headers/generate_shim_headers.py | 150 | 3434 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Generates shim headers that mirror the directory structure of bundled headers,
but just forward to the system ones.
This allow... | bsd-3-clause |
studio1247/gertrude | generation/planning_hebdomadaire.py | 1 | 6629 | # -*- coding: utf-8 -*-
# This file is part of Gertrude.
#
# Gertrude 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.
#... | gpl-3.0 |
lucasvo/django-oembepdlugin | oembedplugin/management/commands/update_oembedservices.py | 1 | 1695 | from django.core.management.base import BaseCommand, CommandError
from optparse import make_option
import urllib2
import simplejson as json
import re
from oembedplugin.models import OembedService
from oembedplugin.settings import *
MODEL_KEYS = ('name', 'type', 'displayname', 'domain', 'subdomains', 'favicon', 'rege... | mit |
RuudBurger/CouchPotatoServer | libs/pio/api.py | 12 | 13183 | # -*- coding: utf-8 -*-
# Changed
# Removed iso8601 library requirement
# Added CP logging
import os
import json
import binascii
import webbrowser
try:
from urllib import urlencode
except ImportError:
from urllib.parse import urlencode
from datetime import datetime
import tus
import requests
from requests.a... | gpl-3.0 |
Gabriel439/pip | tests/lib/local_repos.py | 53 | 2625 | from __future__ import absolute_import
import os
import subprocess
from pip._vendor.six.moves.urllib import request as urllib_request
from pip.vcs import subversion, git, bazaar, mercurial
from tests.lib import path_to_url
if hasattr(subprocess, "check_call"):
subprocess_call = subprocess.check_call
else:
... | mit |
mwx1993/TACTIC | src/tactic/ui/table/statistic_wdg.py | 4 | 17297 | ###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... | epl-1.0 |
brianjmiller/TinCanPython | test/statement_test.py | 2 | 21809 | # Copyright 2014 Rustici 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 applicable law or agreed... | apache-2.0 |
michealpwalls/registration-hodgepodge | sendgrid-php/vendor/guzzle/guzzle/docs/conf.py | 2 | 3141 | import sys, os
from sphinx.highlighting import lexers
from pygments.lexers.web import PhpLexer
lexers['php'] = PhpLexer(startinline=True, linenos=1)
lexers['php-annotations'] = PhpLexer(startinline=True, linenos=1)
primary_domain = 'php'
# -- General configuration ---------------------------------------------... | gpl-3.0 |
tsirif/platoon | platoon/tests/unit/test_util.py | 2 | 3038 | from __future__ import absolute_import
import unittest
from six.moves import reload_module as reload
import numpy as np
from ... import util
try:
from mpi4py import MPI
MPI_IMPORTED = True
except:
MPI_IMPORTED = False
class TestOpToMPI(unittest.TestCase):
@unittest.skipUnless(MPI_IMPORTED, "Needs m... | mit |
PaloAltoNetworks-BD/ansible-pan | library/panos_bgp_conditional_advertisement.py | 1 | 6678 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
__metaclass__ = type
# Copyright 2018 Palo Alto Networks, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ... | isc |
jarped/QGIS | python/ext-libs/pygments/lexer.py | 265 | 26921 | # -*- coding: utf-8 -*-
"""
pygments.lexer
~~~~~~~~~~~~~~
Base lexer classes.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re, itertools
from pygments.filter import apply_filters, Filter
from pygments.filters import get_filt... | gpl-2.0 |
hgl888/chromium-crosswalk | chrome/common/extensions/docs/server2/test_data/api_data_source/canned_master_fs.py | 78 | 5828 | # 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.
import json
CANNED_MASTER_FS_DATA = {
'api': {
'_api_features.json': json.dumps({
'add_rules_tester': { 'dependencies': ['permission:add_rules_... | bsd-3-clause |
ojengwa/talk | venv/lib/python2.7/site-packages/django/utils/numberformat.py | 337 | 1775 | from django.conf import settings
from django.utils.safestring import mark_safe
from django.utils import six
def format(number, decimal_sep, decimal_pos=None, grouping=0, thousand_sep='',
force_grouping=False):
"""
Gets a number (as a number or string), and returns it as a string,
using formats ... | mit |
gangadharkadam/stfrappe | frappe/cli.py | 3 | 30809 | #!/usr/bin/env python2.7
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import os
import subprocess
import frappe
from frappe.utils import cint
site_arg_optional = ['serve', 'build', 'watch', 'celery', 'resize_images']
d... | mit |
michaelpacer/networkx | examples/drawing/chess_masters.py | 54 | 5146 | #!/usr/bin/env python
"""
An example of the MultiDiGraph clas
The function chess_pgn_graph reads a collection of chess
matches stored in the specified PGN file
(PGN ="Portable Game Notation")
Here the (compressed) default file ---
chess_masters_WCC.pgn.bz2 ---
contains all 685 World Chess Championship matches
from... | bsd-3-clause |
nikhil/RAS | env/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/__init__.py | 192 | 2648 | """
urllib3 - Thread-safe connection pooling and re-using.
"""
from __future__ import absolute_import
import warnings
from .connectionpool import (
HTTPConnectionPool,
HTTPSConnectionPool,
connection_from_url
)
from . import exceptions
from .filepost import encode_multipart_formdata
from .poolmanager imp... | mit |
bibi21000/RasPy | setup-web.py | 1 | 3089 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Setup file of RasPyWeb
"""
__license__ = """
This file is part of RasPy.
RasPy 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 ... | gpl-2.0 |
dkodnik/Ant | addons/base_report_designer/plugin/openerp_report_designer/bin/script/Fields.py | 384 | 12340 | #########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... | agpl-3.0 |
alexanderjulo/triptan | triptan/ext/redis.py | 1 | 1075 | import os
from redis import StrictRedis
from triptan import BaseStorage
class RedisStorage(BaseStorage):
"""
Stores the current revision in the configured path.
"""
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._redis = None
self.key_name = ... | mit |
gl-sergei/percona-xtrabackup | storage/innobase/xtrabackup/test/python/subunit/tests/__init__.py | 63 | 1546 | #
# subunit: extensions to python unittest to get test results from subprocesses.
# Copyright (C) 2005 Robert Collins <robertc@robertcollins.net>
#
# Licensed under either the Apache License, Version 2.0 or the BSD 3-clause
# license at the users choice. A copy of both licenses are available in the
# project sour... | gpl-2.0 |
jiangzhonghui/viewfinder | backend/www/auth_facebook.py | 13 | 4181 | # Copyright 2011 Viewfinder Inc. All Rights Reserved.
"""Authentication and authorization for Facebook.
The flow via the web application is:
- /register/facebook: redirects to facebook server, which in turn redirect to:
- /register/facebook?code=<code>: sends facebook a request for an access token.
- send a req... | apache-2.0 |
twitchyliquid64/misc-scripts | s3tool/boto-develop/tests/unit/cloudsearch2/test_document.py | 114 | 12068 | #!/usr/bin env python
from boto.cloudsearch2.domain import Domain
from boto.cloudsearch2.layer1 import CloudSearchConnection
from tests.unit import unittest, AWSMockServiceTestCase
from httpretty import HTTPretty
from mock import MagicMock
import json
from boto.cloudsearch2.document import DocumentServiceConnection
... | mit |
photoninger/ansible | lib/ansible/modules/network/nxos/nxos_snmp_traps.py | 30 | 7977 | #!/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 |
mattrobenolt/django | django/core/management/commands/shell.py | 492 | 3951 | import os
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = "Runs a Python interactive interpreter. Tries to use IPython or bpython, if one of them is available."
requires_system_checks = False
shells = ['ipython', 'bpython']
def add_arguments(self, parser):
... | bsd-3-clause |
Bismarrck/tensorflow | tensorflow/python/ops/nccl_ops_test.py | 18 | 7067 | # 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 |
dgoulet/libotr-dev | test_suite/dummy_im/dummy_client.py | 9 | 2789 | #!/usr/bin/python
import sys
import socket
import threading
from struct import *
class kb_thread(threading.Thread):
def __init__(self, socket):
threading.Thread.__init__(self)
self.sock = socket
def run(self):
while True:
msg = getline(sys.stdin)
account_end = msg.find(' ')
if acco... | gpl-2.0 |
johnson1228/pymatgen | pymatgen/analysis/path_finder.py | 4 | 18198 | """
This module finds diffusion paths through a structure based on a given
potential field.
If you use PathFinder algorithm for your research, please consider citing the
following work::
Ziqin Rong, Daniil Kitchaev, Pieremanuele Canepa, Wenxuan Huang, Gerbrand
Ceder, The Journal of Chemical Physics 145 (7), 0... | mit |
tornadozou/tensorflow | tensorflow/contrib/learn/python/learn/models.py | 58 | 15391 | # 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 |
dcosentino/edx-platform | pavelib/utils/test/suites/python_suite.py | 45 | 1475 | """
Classes used for defining and running python test suites
"""
from pavelib.utils.test import utils as test_utils
from pavelib.utils.test.suites import TestSuite, LibTestSuite, SystemTestSuite
from pavelib.utils.envs import Env
__test__ = False # do not collect
class PythonTestSuite(TestSuite):
"""
A subc... | agpl-3.0 |
Omegaphora/external_chromium_org | chrome/common/extensions/docs/server2/servlet.py | 34 | 4476 | # 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 RequestHeaders(object):
'''A custom dictionary impementation for headers which ignores the case
of requests, since different HTTP libraries seem t... | bsd-3-clause |
desaishivam26/android_kernel_motorola_msm8916 | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (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
import sys
sys.path.append(os.envir... | gpl-2.0 |
JuanMatSa/PyFME | examples/example_005.py | 2 | 3361 | # -*- coding: utf-8 -*-
"""
Python Flight Mechanics Engine (PyFME).
Copyright (c) AeroPython Development Team.
Distributed under the terms of the MIT License.
Example
-------
Cessna 310, ISA1976 integrated with Flat Earth (euler angles).
Example with trimmed aircraft: stationary, turn during ascent.
The main purpos... | mit |
Lekensteyn/buildbot | master/buildbot/scripts/checkconfig.py | 11 | 1987 | # This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
mihaip/mail-trends | cache.py | 3 | 2824 | # Based on _FileCache from
# http://python-twitter.googlecode.com/svn/trunk/twitter.py
# Modified to pickle/unpickle data
import md5
import os
import tempfile
import cPickle
class FileCacheError(Exception):
'''Base exception class for FileCache related errors'''
class FileCache(object):
DEPTH = 3
def __ini... | apache-2.0 |
doomsterinc/odoo | addons/crm_helpdesk/__init__.py | 442 | 1081 | # -*- 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 |
kubikusrubikus/mkdocs | mkdocs/config/base.py | 22 | 4969 | from __future__ import unicode_literals
import logging
import os
from mkdocs import exceptions
from mkdocs import utils
log = logging.getLogger('mkdocs.config')
class ValidationError(Exception):
"""Raised during the validation process of the config on errors."""
class Config(utils.UserDict):
"""
MkDo... | bsd-2-clause |
adamlwgriffiths/Pyglet | contrib/toys/primitives.py | 29 | 1073 | import math
import pyglet
from pyglet.gl import *
class SmoothLineGroup(pyglet.graphics.Group):
def set_state(self):
glPushAttrib(GL_ENABLE_BIT)
glEnable(GL_BLEND)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
glEnable(GL_LINE_SMOOTH)
glLineWidth(2)
def unset_state... | bsd-3-clause |
mmnelemane/nova | nova/tests/unit/cells/test_cells_rpcapi.py | 9 | 32567 | # Copyright (c) 2012 Rackspace Hosting
# 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 req... | apache-2.0 |
gvb/odoo | addons/hr_holidays/report/available_holidays.py | 892 | 1046 | # -*- 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 |
gvb/odoo | openerp/addons/base/tests/test_mail.py | 322 | 24683 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This test can be run stand-alone with something like:
# > PYTHONPATH=. python2 openerp/tests/test_misc.py
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP... | agpl-3.0 |
tuenti/Diamond | src/diamond/handler/queue.py | 21 | 1152 | # coding=utf-8
"""
This is a meta handler to act as a shim for the new threading model. Please
do not try to use it as a normal handler
"""
from Handler import Handler
class QueueHandler(Handler):
def __init__(self, config=None, queue=None, log=None):
# Initialize Handler
Handler.__init__(self, ... | mit |
devunt/ika | ika/services/ozinger/commands/unregister.py | 1 | 1512 | from ika.service import Command, Permission
from ika.enums import Flags
class Unregister(Command):
name = '등록해제'
aliases = (
'탈퇴',
'UNREGISTER',
)
syntax = '<YES>'
regex = r'(?P<confirmed>YES)'
permission = Permission.LOGIN_REQUIRED
description = (
'오징어 IRC 네트워크에 등록... | agpl-3.0 |
suqinhuang/virt-test | virttest/propcan_unittest.py | 3 | 9270 | #!/usr/bin/python
import unittest, logging
import propcan
class TestPropCanBase(unittest.TestCase):
def test_empty_init(self):
self.assertRaises(NotImplementedError, propcan.PropCanBase)
def test_empty_params_init(self):
self.assertRaises(NotImplementedError,
propcan... | gpl-2.0 |
argv0/cloudstack | tools/marvin/marvin/cloudstackConnection.py | 2 | 8515 | # 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 |
justintung/scylla | test.py | 23 | 5704 | #!/usr/bin/env python3
#
# Copyright 2015 Cloudius Systems
#
#
# This file is part of Scylla.
#
# Scylla is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your o... | agpl-3.0 |
pleaseproject/python-for-android | python3-alpha/python3-src/Lib/test/test_doctest2.py | 194 | 2359 | """A module to test whether doctest recognizes some 2.2 features,
like static and class methods.
>>> print('yup') # 1
yup
We include some (random) encoded (utf-8) text in the text surrounding
the example. It should be ignored:
ЉЊЈЁЂ
"""
import sys
import unittest
from test import support
if sys.flags.optimize >=... | apache-2.0 |
joram/sickbeard-orange | sickbeard/databases/mainDB.py | 5 | 24652 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 t... | gpl-3.0 |
jiangzhuo/kbengine | kbe/src/lib/python/Lib/encodings/cp864.py | 272 | 33663 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP864.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_map)
def decode(self,input,errors='strict'):
... | lgpl-3.0 |
khchine5/lino | lino/modlib/comments/models.py | 1 | 5651 | # -*- coding: UTF-8 -*-
# Copyright 2013-2018 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
from builtins import object
from django.db import models
from lino.api import dd, rt, _
from lino.mixins import CreatedModified, BabelNamed
from lino.modlib.users.mixins import UserAuthored
from lino.modli... | bsd-2-clause |
wgcv/SWW-Crashphone | lib/python2.7/site-packages/django/conf/locale/__init__.py | 49 | 11624 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
# About name_local: capitalize it as if your language name was appearing
# inside a sentence in your language.
LANG_INFO = {
'af': {
'bidi': False,
'code': 'af',
'name': 'Afrikaans',
'name_local': 'Afrikaans',
},... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.