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 |
|---|---|---|---|---|---|
aragos/tichu-tournament | python/reportlab/pdfbase/_fontdata_widths_courierbold.py | 224 | 3664 | widths = {'A': 600,
'AE': 600,
'Aacute': 600,
'Acircumflex': 600,
'Adieresis': 600,
'Agrave': 600,
'Aring': 600,
'Atilde': 600,
'B': 600,
'C': 600,
'Ccedilla': 600,
'D': 600,
'E': 600,
'Eacute': 600,
'Ecircumflex': 600,
'Edieresis': 600,
'Egrave': 600,
'Eth': 600,
'Euro': 600,
'F': 600,
'G': 600,
'... | mit |
alexissmirnov/donomo | donomo_archive/deps/paypal/standard/pdt/tests/test_pdt.py | 9 | 5522 | """
run this with ./manage.py test website
see http://www.djangoproject.com/documentation/testing/ for details
"""
import os
from django.conf import settings
from django.shortcuts import render_to_response
from django.test import TestCase
from paypal.standard.pdt.forms import PayPalPDTForm
from paypal.standard.pdt.mode... | bsd-3-clause |
jayofdoom/cloud-init-debian-pkg | cloudinit/config/cc_byobu.py | 7 | 2886 | # vi: ts=4 expandtab
#
# Copyright (C) 2009-2010 Canonical Ltd.
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
#
# Author: Scott Moser <scott.moser@canonical.com>
# Author: Juerg Haefliger <juerg.haefliger@hp.com>
#
# This program is free software: you can redistribute it and/or modify
# ... | gpl-3.0 |
gregcaporaso/qiime | scripts/conditional_uncovered_probability.py | 15 | 4838 | #!/usr/bin/env python
# File created on 1 April 2012
from __future__ import division
__author__ = "Jens Reeder"
__copyright__ = "Copyright 2011, The QIIME Project"
__credits__ = ["Jens Reeder", "Jose Antonio Navas Molina", "Jai Ram Rideout"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Jens Reeder"
... | gpl-2.0 |
chirilo/mozillians | vendor-local/lib/python/unidecode/x0c5.py | 253 | 4581 | data = (
'sseum', # 0x00
'sseub', # 0x01
'sseubs', # 0x02
'sseus', # 0x03
'sseuss', # 0x04
'sseung', # 0x05
'sseuj', # 0x06
'sseuc', # 0x07
'sseuk', # 0x08
'sseut', # 0x09
'sseup', # 0x0a
'sseuh', # 0x0b
'ssyi', # 0x0c
'ssyig', # 0x0d
'ssyigg', # 0x0e
'ssyigs', # 0x0f
'ss... | bsd-3-clause |
topazproject/topaz | tests/test_celldict.py | 3 | 1141 | from topaz.celldict import CellDict, Cell, GlobalsDict
from .base import BaseTopazTest
class TestCellDict(BaseTopazTest):
def test_single_set(self, space):
c = CellDict()
v = c.version
c.set(space, "a", 2)
assert c.version is not v
assert c._get_cell("a", c.version) == 2
... | bsd-3-clause |
MonicaHsu/truvaluation | venv/lib/python2.7/site-packages/simplejson/tests/test_item_sort_key.py | 140 | 1127 | from unittest import TestCase
import simplejson as json
from operator import itemgetter
class TestItemSortKey(TestCase):
def test_simple_first(self):
a = {'a': 1, 'c': 5, 'jack': 'jill', 'pick': 'axe', 'array': [1, 5, 6, 9], 'tuple': (83, 12, 3), 'crate': 'dog', 'zeak': 'oh'}
self.assertEqual(
... | mit |
EricMuller/mywebmarks-backend | requirements/twisted/Twisted-17.1.0/build/lib.linux-x86_64-3.5/twisted/web/test/test_util.py | 16 | 12590 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.web.util}.
"""
from __future__ import absolute_import, division
import gc
from twisted.python.failure import Failure
from twisted.trial.unittest import SynchronousTestCase, TestCase
from twisted.internet import defer
fro... | mit |
USGSDenverPychron/pychron | pychron/pipeline/tasks/tree_node.py | 1 | 3345 | # ===============================================================================
# Copyright 2015 Jake Ross
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses... | apache-2.0 |
vigilv/scikit-learn | sklearn/gaussian_process/correlation_models.py | 230 | 7630 | # -*- coding: utf-8 -*-
# Author: Vincent Dubourg <vincent.dubourg@gmail.com>
# (mostly translation, see implementation details)
# Licence: BSD 3 clause
"""
The built-in correlation models submodule for the gaussian_process module.
"""
import numpy as np
def absolute_exponential(theta, d):
"""
Abs... | bsd-3-clause |
alexrao/YouCompleteMe | third_party/ycmd/third_party/jedi/test/test_evaluate/test_buildout_detection.py | 13 | 2751 | import os
from textwrap import dedent
from jedi._compatibility import u
from jedi.evaluate.sys_path import (_get_parent_dir_with_file,
_get_buildout_scripts,
sys_path_with_modifications,
_check_module)
from jedi... | gpl-3.0 |
tensorflow/lucid | lucid/scratch/web/observable.py | 1 | 2465 | import json
from lucid.misc.io.showing import _display_html
def renderObservable(url, cells=None, data=None):
"""Display observable notebook cells in iPython.
Args:
url: url fragment to observable notebook. ex: '@observablehq/downloading-and-embedding-notebooks'
cells: an array of strings for the names of... | apache-2.0 |
quixoten/ansible | lib/ansible/cli/doc.py | 17 | 11990 | # (c) 2014, James Tanner <tanner.jc@gmail.com>
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed i... | gpl-3.0 |
dataxu/ansible | lib/ansible/module_utils/facts/other/facter.py | 232 | 2985 | # 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 distributed in the hope that ... | gpl-3.0 |
ict-felix/stack | expedient/src/python/expedient/clearinghouse/commands/management/commands/setup_media.py | 2 | 1035 | '''Command to link static content to settings.STATIC_DOC_ROOT
Created on Aug 24, 2010
@author: jnaous
'''
from django.core.management.base import NoArgsCommand
from django.conf import settings
import pkg_resources
import os
class Command(NoArgsCommand):
help = "Link static content from package to %s" % settings.... | apache-2.0 |
robovm/robovm-studio | plugins/hg4idea/testData/bin/mercurial/pvec.py | 94 | 5989 | # pvec.py - probabilistic vector clocks for Mercurial
#
# Copyright 2012 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
'''
A "pvec" is a changeset property based on the theory of vector clocks
that... | apache-2.0 |
imply/chuu | ppapi/generators/idl_parser.py | 25 | 37745 | #!/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.
""" Parser for PPAPI IDL """
#
# IDL Parser
#
# The parser is uses the PLY yacc library to build a set of parsing rules based
# on... | bsd-3-clause |
RichardLitt/wyrd-django-dev | tests/modeltests/custom_methods/tests.py | 150 | 1196 | from __future__ import absolute_import
from datetime import date
from django.test import TestCase
from .models import Article
class MethodsTests(TestCase):
def test_custom_methods(self):
a = Article.objects.create(
headline="Area man programs in Python", pub_date=date(2005, 7, 27)
)... | bsd-3-clause |
kevintaw/django | django/contrib/gis/db/models/query.py | 16 | 36639 | import warnings
from django.contrib.gis.db.models import aggregates
from django.contrib.gis.db.models.fields import (
GeometryField, LineStringField, PointField, get_srid_info,
)
from django.contrib.gis.db.models.lookups import GISLookup
from django.contrib.gis.db.models.sql import (
AreaField, DistanceField, ... | bsd-3-clause |
paolodedios/tensorflow | tensorflow/python/kernel_tests/embedding_ops_test.py | 6 | 48038 | # 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 |
sergio-incaser/bank-payment | __unported__/account_banking/parsers/__init__.py | 14 | 1053 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>).
# All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Genera... | agpl-3.0 |
trachelr/mne-python | mne/stats/parametric.py | 5 | 12542 | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis Engemann <denis.engemann@gmail.com>
# Eric Larson <larson.eric.d@gmail.com>
#
# License: Simplified BSD
import numpy as np
from functools import reduce
from string import ascii_uppercase
from ..externals.six import strin... | bsd-3-clause |
stainsteelcrown/nonsense-story-generator | venv/lib/python2.7/site-packages/werkzeug/urls.py | 146 | 33150 | # -*- coding: utf-8 -*-
"""
werkzeug.urls
~~~~~~~~~~~~~
This module implements various URL related functions.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import re
from werkzeug._compat import text_type, PY2, to_unicode,... | mit |
techvoltage/capstone | bindings/python/test.py | 33 | 5021 | #!/usr/bin/env python
# Capstone Python bindings, by Nguyen Anh Quynnh <aquynh@gmail.com>
from __future__ import print_function
from capstone import *
import binascii
import sys
from xprint import to_hex, to_x, to_x_32
_python3 = sys.version_info.major == 3
X86_CODE16 = b"\x8d\x4c\x32\x08\x01\xd8\x81\xc6\x34\x12\x... | bsd-3-clause |
transferwise/bootstrap | test-infra/s3_cache.py | 2166 | 5734 | #!/usr/bin/env python2.7
# pylint: disable=C0301
from __future__ import absolute_import, unicode_literals, print_function, division
from sys import argv
from os import environ, stat, chdir, remove as _delete_file
from os.path import dirname, basename, abspath, realpath, expandvars
from hashlib import sha256
from subpr... | mit |
gabrielsaldana/sqmc | sabesqmc/quote/tests/test_forms.py | 1 | 2384 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
from django.test import TestCase
from ..forms import QuoteForm
class TestQuoteForm(TestCase):
def setUp(self):
pass
def test_validate_emtpy_quote(self):
form = QuoteForm({'message': ''})
self.assertFals... | agpl-3.0 |
hbrunn/OCB | addons/payment_authorize/controllers/main.py | 247 | 1261 | # -*- coding: utf-8 -*-
import pprint
import logging
import urlparse
from openerp import http
from openerp.http import request
_logger = logging.getLogger(__name__)
class AuthorizeController(http.Controller):
_return_url = '/payment/authorize/return/'
_cancel_url = '/payment/authorize/cancel/'
@http.ro... | agpl-3.0 |
cjparsons74/kupfer | kupfer/obj/objects.py | 1 | 11035 | # -*- coding: UTF-8 -*-
"""
Copyright 2007--2009 Ulrik Sverdrup <ulrik.sverdrup@gmail.com>
This file is a part of the program kupfer, which is
released under GNU General Public License v3 (or any later version),
see the main program file, and COPYING for details.
"""
import os
from os import path
import gobject
fr... | gpl-3.0 |
klabble/pollution-music | weather.py | 1 | 4565 | #!/usr/bin/env python3
# Copyright 2013 David Walker
#
# This file is part of Pollution Music.
#
# Pollution Music 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 ... | gpl-3.0 |
was4444/chromium.src | third_party/WebKit/Source/devtools/scripts/modular_build.py | 32 | 6644 | #!/usr/bin/env python
#
# 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.
"""
Utilities for the modular DevTools build.
"""
from os import path
import os
try:
import simplejson as json
except ImportErr... | bsd-3-clause |
nevil/edash-packager | packager/third_party/protobuf/python/google/protobuf/descriptor_database.py | 230 | 4411 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | bsd-3-clause |
dyyi/moneybook | venv/Lib/site-packages/pip/_vendor/distlib/manifest.py | 559 | 13598 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2013 Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""
Class representing the list of files in a distribution.
Equivalent to distutils.filelist, but fixes some problems.
"""
import fnmatch
import logging
import os
import re
from . import DistlibEx... | apache-2.0 |
0x46616c6b/ansible | lib/ansible/plugins/action/net_config.py | 137 | 4196 | #
# Copyright 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... | gpl-3.0 |
vCentre/vFRP-6233 | frappe/patches/v4_1/file_manager_fix.py | 29 | 3309 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
import os
from frappe.utils.file_manager import get_content_hash, get_file, get_file_name
from frappe.utils import get_files_path, get_site_path
# The files missed... | mit |
adazey/Muzez | libs/nltk/corpus/reader/timit.py | 4 | 17406 | # Natural Language Toolkit: TIMIT Corpus Reader
#
# Copyright (C) 2001-2007 NLTK Project
# Author: Haejoong Lee <haejoong@ldc.upenn.edu>
# Steven Bird <stevenbird1@gmail.com>
# Jacob Perkins <japerk@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
# [xx] this doc... | gpl-3.0 |
muff1nman/duplicity | duplicity/backends/ncftpbackend.py | 1 | 5129 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2002 Ben Escoto <ben@emerose.org>
# Copyright 2007 Kenneth Loafman <kenneth@loafman.com>
#
# This file is part of duplicity.
#
# Duplicity is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License... | gpl-2.0 |
mkalte666/Markkasse | setup.py | 1 | 3478 | #!/usr/bin/env python
import io
import sys
import os
import sqlite3
import hashlib
import binascii
print "Setting Up Mark System"
print "This will, delete all data but the ones in the backup-folder !"
print "If you are shure you want to continue, type \" YES \". yep, in capslock!\n"
ShouldInstall = unicode(raw_input(... | mit |
cloudcache/zstack-utility | kvmagent/kvmagent/test/test_nfs_primary_storage_create_root_volume.py | 3 | 2034 | '''
@author: Frank
'''
import unittest
import time
import os.path
from kvmagent import kvmagent
from kvmagent.plugins import nfs_primarystorage_plugin
from zstacklib.utils import http
from zstacklib.utils import jsonobject
from zstacklib.utils import log
from zstacklib.utils import uuidhelper
from zstackl... | apache-2.0 |
dmitry-r/incubator-airflow | airflow/ti_deps/deps/not_running_dep.py | 58 | 1332 | # -*- coding: utf-8 -*-
#
# 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
... | apache-2.0 |
obadonke/pythonPlay | scripts/where_dat_ex_go/wheredatexgo.py | 2 | 2822 | import csv
class ExceptionStats:
def __init__(self):
self.status = None
self.owner = None
self.count = 0
self.hash = None
def inc_count(self):
self.count += 1
class ExceptionData:
def __init__(self, ident):
self.ident = ident
self.prev_stats = Exc... | gpl-3.0 |
hannorein/rebound | docs/generate_python_docs.py | 1 | 1054 | import rebound
import inspect
import docstring_to_markdown
def convert_code_blocks(doc):
new_doc = ""
lines = doc.split("\n")
first = True
for line in lines:
if first:
if line[:3]==">>>":
first = False
new_doc += "```python\n"
new_doc +... | gpl-3.0 |
anbangleo/NlsdeWeb | Python-3.6.0/Lib/test/test_float.py | 2 | 62538 | import fractions
import operator
import os
import random
import sys
import struct
import time
import unittest
from test import support
from test.test_grammar import (VALID_UNDERSCORE_LITERALS,
INVALID_UNDERSCORE_LITERALS)
from math import isinf, isnan, copysign, ldexp
INF = float("inf")... | mit |
nuagenetworks/vspk-python | vspk/v5_0/fetchers/nuinfrastructuregatewayprofiles_fetcher.py | 2 | 2247 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# 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 copyrigh... | bsd-3-clause |
gangadhar-kadam/lgnlvefrape | frappe/core/doctype/doctype/doctype.py | 6 | 14843 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import now, cint
from frappe.model import no_value_fields
from frappe.model.document import Document
from frappe.model.db... | mit |
Pakoach/Sick-Beard | cherrypy/lib/jsontools.py | 80 | 1574 | import sys
import cherrypy
if sys.version_info >= (2, 6):
# Python 2.6: simplejson is part of the standard library
import json
else:
try:
import simplejson as json
except ImportError:
json = None
if json is None:
def json_decode(s):
raise ValueError('No JSON library is avai... | gpl-3.0 |
hermantai/sorno-py-scripts | sorno/mathlib.py | 1 | 2471 | """A library for math related things
Copyright 2015 Heung Ming Tai
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 |
iwm911/plaso | plaso/parsers/utmpx.py | 1 | 6216 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual 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 L... | apache-2.0 |
steeve/plugin.video.pulsar | resources/site-packages/bjsonrpc/request.py | 9 | 6728 | """
bjson/request.py
Asynchronous Bidirectional JSON-RPC protocol implementation over TCP/IP
Copyright (c) 2010 David Martinez Marti
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditio... | bsd-3-clause |
david-ragazzi/nupic | nupic/research/TP_shim.py | 6 | 3224 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, 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... | gpl-3.0 |
jordanemedlock/psychtruths | temboo/Library/SendGrid/NewsletterAPI/Recipients/GetAttachedRecipientLists.py | 5 | 4071 | # -*- coding: utf-8 -*-
###############################################################################
#
# GetAttachedRecipientLists
# Retrieve Recipient Lists attached to a specified newsletter.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the ... | apache-2.0 |
kontais/EFI-MIPS | ToolKit/cmds/python/Lib/regex_syntax.py | 17 | 1893 | """Constants for selecting regexp syntaxes for the obsolete regex module.
This module is only for backward compatibility. "regex" has now
been replaced by the new regular expression module, "re".
These bits are passed to regex.set_syntax() to choose among
alternative regexp syntaxes.
"""
# 1 means plain parentheses... | bsd-3-clause |
andrewthetechie/slack_rtmbot | slack_rtmbot.py | 1 | 12598 | #!/usr/bin/env python
import sys
sys.dont_write_bytecode = True
import glob
import yaml
import os
import sys
import time
import logging
import re
from threading import Thread
from logging.handlers import RotatingFileHandler
from slackclient import SlackClient
def dbg(debug_string):
"""
Used to write debuggi... | gpl-3.0 |
cailloumajor/home-web | backend/core/auth/backends.py | 1 | 1129 | # -*- coding: utf-8 -*-
# pylint: skip-file
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.hashers import check_password
class SettingsBackend:
"""
Authenticates against the settings ADMIN_LOGIN and ADMIN_PASSWORD
Use the login name and a hash of ... | gpl-3.0 |
ehashman/oh-mainline | vendor/packages/Django/django/contrib/formtools/tests/wizard/forms.py | 90 | 7721 | from __future__ import unicode_literals
from django import forms, http
from django.conf import settings
from django.db import models
from django.test import TestCase
from django.template.response import TemplateResponse
from django.utils.importlib import import_module
from django.contrib.auth.models import User
from... | agpl-3.0 |
zaragoza-sedeelectronica/hackathon-co.sa | bower_components/lumx/changelog.py | 48 | 3091 | #! /usr/bin/env python
from subprocess import Popen, PIPE
import re
def getTags():
Popen('git fetch --tags'.split(), stdout=PIPE).communicate()
(stdout, _) = Popen('git tag'.split(), stdout=PIPE).communicate()
return sorted(stdout.split(), key=lambda s: [int(x) for x in s.replace('v', '').split('.')])
... | apache-2.0 |
aristanetworks/arista-ovs-quantum | quantum/plugins/nicira/nicira_nvp_plugin/NvpApiClient.py | 4 | 7453 | # Copyright 2012 Nicira, Inc.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | apache-2.0 |
gribozavr/swift | utils/swift_build_support/swift_build_support/host_specific_configuration.py | 1 | 12379 | # swift_build_support/host_configuration_support.py -------------*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2019 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.tx... | apache-2.0 |
openhatch/oh-mainline | vendor/packages/docutils/test/test_parsers/test_rst/test_tables.py | 16 | 37488 | #! /usr/bin/env python
# $Id: test_tables.py 7313 2012-01-11 20:28:57Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Tests for states.py.
"""
import os
from __init__ import DocutilsTestSupport
def suite():
s = DocutilsTestSupport.ParserTe... | agpl-3.0 |
palmerjh/iEBE | EBE-Node/superMC/translate.py | 8 | 3447 | #! /usr/bin/env python
# This script translates a list of arguments into one value specified by a rule file. Usage:
# translate ruleFilename key1 key2 ...
# It prints out the value corresponds to [key1, key2, ...] from a dictionary read from ruleFilename.
# To see how the dictionary is generated, see readRules function... | gpl-3.0 |
amenonsen/ansible | lib/ansible/modules/storage/netapp/na_ontap_igroup_initiator.py | 21 | 6258 | #!/usr/bin/python
''' This is an Ansible module for ONTAP, to manage initiators in an Igroup
(c) 2019, NetApp, Inc
# 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 ... | gpl-3.0 |
efiop/dvc | dvc/repo/reproduce.py | 1 | 8232 | import logging
import typing
from functools import partial
from dvc.exceptions import DvcException, ReproductionError
from dvc.repo.scm_context import scm_context
from . import locked
if typing.TYPE_CHECKING:
from . import Repo
logger = logging.getLogger(__name__)
def _reproduce_stage(stage, **kwargs):
de... | apache-2.0 |
Marketing1by1/petl | petl/test/io/test_csv.py | 3 | 7619 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
from tempfile import NamedTemporaryFile
import gzip
import os
import logging
from petl.compat import PY2
from petl.test.helpers import ieq, eq_
from petl.io.csv import fromcsv, fromtsv, tocsv, appendcsv, totsv, appendtsv
logg... | mit |
dogless/airavata | airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/samples/createExperiment.py | 6 | 2463 | #!/usr/bin/env python
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "L... | apache-2.0 |
eceglov/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/port/xvfbdriver_unittest.py | 118 | 7503 | # Copyright (C) 2012 Zan Dobersek <zandobersek@gmail.com>
#
# 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 t... | bsd-3-clause |
andfoy/margffoy-tuay-server | env/lib/python2.7/site-packages/reportlab-3.2.0-py2.7-linux-x86_64.egg/reportlab/graphics/charts/spider.py | 34 | 16057 | #Copyright ReportLab Europe Ltd. 2000-2004
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/charts/spider.py
# spider chart, also known as radar chart
__version__=''' $Id$ '''
__doc__="""Spider Chart
Normal use shows variation o... | gpl-2.0 |
kartikshah1/Test | venv/lib/python2.7/site-packages/setuptools/command/install_scripts.py | 111 | 2031 | import distutils.command.install_scripts as orig
from pkg_resources import Distribution, PathMetadata, ensure_directory
import os
from distutils import log
class install_scripts(orig.install_scripts):
"""Do normal script install, plus any egg_info wrapper scripts"""
def initialize_options(self):
orig.... | mit |
angr/angr | angr/flirt/build_sig.py | 1 | 10360 | # pylint:disable=consider-using-with
from typing import List, Dict
import json
import subprocess
import argparse
import tempfile
import os
import itertools
from collections import defaultdict
import angr
UNIQUE_STRING_COUNT = 20
# strings longer than MAX_UNIQUE_STRING_LEN will be truncated
MAX_UNIQUE_STRING_LEN = 70... | bsd-2-clause |
CydarLtd/ansible | test/runner/lib/cover.py | 26 | 7465 | """Code coverage utilities."""
from __future__ import absolute_import, print_function
import os
import re
from lib.target import (
walk_module_targets,
walk_compile_targets,
)
from lib.util import (
display,
ApplicationError,
EnvironmentConfig,
run_command,
common_environment,
)
from li... | gpl-3.0 |
EdwardBeckett/fail2ban | fail2ban/client/jailsreader.py | 18 | 3062 | # 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 |
sidsarasvati/googletest | test/gtest_throw_on_failure_test.py | 2917 | 5766 | #!/usr/bin/env python
#
# Copyright 2009, 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... | bsd-3-clause |
thinkopensolutions/geraldo | site/newsite/django_1_0/tests/regressiontests/mail/tests.py | 10 | 1404 | # coding: utf-8
r"""
# Tests for the django.core.mail.
>>> from django.core.mail import EmailMessage
>>> from django.utils.translation import ugettext_lazy
# Test normal ascii character case:
>>> email = EmailMessage('Subject', 'Content', 'from@example.com', ['to@example.com'])
>>> message = email.message()
>>> mess... | lgpl-3.0 |
tudorbarascu/QGIS | python/pyplugin_installer/__init__.py | 45 | 1403 | # -*- coding: utf-8 -*-
"""
***************************************************************************
__init__.py
---------------------
Date : May 2013
Copyright : (C) 2013 by Borys Jurgiel
Email : info at borysjurgiel dot pl
This module is based on ... | gpl-2.0 |
tudorbarascu/QGIS | python/plugins/processing/algs/qgis/Relief.py | 15 | 6936 | # -*- coding: utf-8 -*-
"""
***************************************************************************
Relief.py
---------------------
Date : December 2016
Copyright : (C) 2016 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
*****************... | gpl-2.0 |
drewp/tahoe-lafs | src/allmydata/util/abbreviate.py | 1 | 2005 |
import re
HOUR = 3600
DAY = 24*3600
WEEK = 7*DAY
MONTH = 30*DAY
YEAR = 365*DAY
def abbreviate_time(s):
def _plural(count, unit):
count = int(count)
if count == 1:
return "%d %s" % (count, unit)
return "%d %ss" % (count, unit)
if s is None:
return "unknown"
if s... | gpl-2.0 |
afandria/sky_engine | third_party/ply/yacc.py | 465 | 128492 | # -----------------------------------------------------------------------------
# ply: yacc.py
#
# Copyright (C) 2001-2011,
# David M. Beazley (Dabeaz LLC)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... | bsd-3-clause |
09zwcbupt/undergrad_thesis | ext/poxdesk/qx/tool/pylib/graph/algorithms/heuristics/Euclidean.py | 4 | 3477 | # Copyright (c) 2008-2009 Pedro Matiello <pmatiello@gmail.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,... | gpl-3.0 |
MichaelTong/cassandra-rapid | doc/source/_util/cql.py | 64 | 6877 | # -*- coding: utf-8 -*-
"""
CQL pygments lexer
~~~~~~~~~~~~~~~~~~
Lexer for the Cassandra Query Language (CQL).
This is heavily inspired from the pygments SQL lexer (and the Postgres one in particular) but adapted to CQL
keywords and specificities.
TODO: This has been hacked quickly, but once... | apache-2.0 |
code4futuredotorg/reeborg_tw | src/libraries/brython_old/Lib/unittest/test/testmock/testcallable.py | 739 | 4234 | # Copyright (C) 2007-2012 Michael Foord & the mock team
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# http://www.voidspace.org.uk/python/mock/
import unittest
from unittest.test.testmock.support import is_instance, X, SomeClass
from unittest.mock import (
Mock, MagicMock, NonCallableMagicMock,
NonCallableM... | agpl-3.0 |
zerlgi/zcswebapp | zcswebapp-1.0/lib/scudcloud.py | 1 | 14669 | #!/usr/bin/env python3
import sys, os
from cookiejar import PersistentCookieJar
from leftpane import LeftPane
from notifier import Notifier
from resources import Resources
from systray import Systray
from wrapper import Wrapper
from os.path import expanduser
from PyQt4 import QtCore, QtGui, QtWebKit
from PyQt4.Qt impor... | mit |
onceuponatimeforever/oh-mainline | mysite/search/migrations/0020_remove_project_icon_field.py | 17 | 3867 | # This file is part of OpenHatch.
# Copyright (C) 2009 OpenHatch, Inc.
#
# This program 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 option) any later v... | agpl-3.0 |
Jgarcia-IAS/ReporsitorioVacioOdoo | openerp/addons/base_setup/res_config.py | 261 | 5089 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
GaussDing/django | tests/template_tests/filter_tests/test_autoescape.py | 513 | 1342 | from django.test import SimpleTestCase
from ..utils import SafeClass, UnsafeClass, setup
class AutoescapeStringfilterTests(SimpleTestCase):
"""
Filters decorated with stringfilter still respect is_safe.
"""
@setup({'autoescape-stringfilter01': '{{ unsafe|capfirst }}'})
def test_autoescape_string... | bsd-3-clause |
vipul-sharma20/oh-mainline | vendor/packages/kombu/kombu/transport/redis.py | 15 | 33278 | """
kombu.transport.redis
=====================
Redis transport.
"""
from __future__ import absolute_import
import numbers
import socket
from bisect import bisect
from collections import namedtuple
from contextlib import contextmanager
from time import time
from amqp import promise
from anyjson import loads, dumps... | agpl-3.0 |
ABaldwinHunter/django-clone | tests/forms_tests/tests/test_media.py | 76 | 23851 | # -*- coding: utf-8 -*-
from django.forms import CharField, Form, Media, MultiWidget, TextInput
from django.template import Context, Template
from django.test import SimpleTestCase, override_settings
from django.utils.encoding import force_text
@override_settings(
STATIC_URL='http://media.example.com/static/',
)
... | bsd-3-clause |
EricMuller/mywebmarks-backend | requirements/twisted/Twisted-17.1.0/src/twisted/trial/_dist/test/test_workertrial.py | 12 | 5153 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.trial._dist.workertrial}.
"""
import errno
import sys
import os
from twisted.protocols.amp import AMP
from twisted.python.compat import _PY3, NativeStringIO as StringIO
from twisted.test.proto_helpers import StringTranspo... | mit |
samtx/whatsmyrankine | venv/lib/python2.7/site-packages/flask/views.py | 782 | 5642 | # -*- coding: utf-8 -*-
"""
flask.views
~~~~~~~~~~~
This module provides class-based views inspired by the ones in Django.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from .globals import request
from ._compat import with_metaclass
http_method_funcs =... | mit |
alxgu/ansible | lib/ansible/plugins/lookup/credstash.py | 43 | 4385 | # (c) 2015, Ensighten <infra@ensighten.com>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
lookup: credstash
version_added: "2.0"
... | gpl-3.0 |
jgcaaprom/android_external_chromium_org | third_party/closure_linter/closure_linter/errors.py | 99 | 4184 | #!/usr/bin/env python
# Copyright 2007 The Closure Linter Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | bsd-3-clause |
teltek/edx-platform | common/djangoapps/third_party_auth/migrations/0019_consolidate_slug.py | 14 | 2234 | # -*- coding: utf-8 -*-
"""
Custom migration script to add slug field to all ProviderConfig models.
"""
from __future__ import unicode_literals
from django.db import migrations, models
from django.utils.text import slugify
def fill_slug_field(apps, schema_editor):
"""
Fill in the slug field for each Provider... | agpl-3.0 |
Beauhurst/django | django/db/models/options.py | 6 | 34598 | import copy
import warnings
from bisect import bisect
from collections import OrderedDict, defaultdict
from itertools import chain
from django.apps import apps
from django.conf import settings
from django.core.exceptions import FieldDoesNotExist, ImproperlyConfigured
from django.db import connections
from django.db.mo... | bsd-3-clause |
melonproject/oyente | oyente/batch_run.py | 3 | 1356 | import json
import glob
from tqdm import tqdm
import os
import sys
import urllib2
contract_dir = 'contract_data'
cfiles = glob.glob(contract_dir+'/contract1.json')
cjson = {}
print "Loading contracts..."
for cfile in tqdm(cfiles):
cjson.update(json.loads(open(cfile).read()))
results = {}
missed = []
print "Runn... | gpl-3.0 |
xukunfeng/ardupilot | mk/PX4/Tools/genmsg/src/genmsg/deps.py | 216 | 3993 | # Software License Agreement (BSD License)
#
# Copyright (c) 2011, Willow Garage, 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 ... | gpl-3.0 |
jeasoft/odoo | addons/account_followup/__openerp__.py | 261 | 2938 | # -*- 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 |
xiandiancloud/ji | lms/djangoapps/bulk_email/models.py | 24 | 9630 | """
Models for bulk email
WE'RE USING MIGRATIONS!
If you make changes to this model, be sure to create an appropriate migration
file and check it in at the same time as your model changes. To do that,
1. Go to the edx-platform dir
2. ./manage.py lms schemamigration bulk_email --auto description_of_your_change
3. Add... | agpl-3.0 |
yipenggao/moose | python/chigger/misc/AxisSource.py | 6 | 1994 | #pylint: disable=missing-docstring
#################################################################
# DO NOT MODIFY THIS HEADER #
# MOOSE - Multiphysics Object Oriented Simulation Environment #
# #
# (c) 2010... | lgpl-2.1 |
gfyoung/pandas | pandas/tests/indexes/common.py | 2 | 28221 | import gc
from typing import Type
import numpy as np
import pytest
from pandas._libs import iNaT
from pandas.errors import InvalidIndexError
from pandas.core.dtypes.common import is_datetime64tz_dtype
from pandas.core.dtypes.dtypes import CategoricalDtype
import pandas as pd
from pandas import (
CategoricalInde... | bsd-3-clause |
hyqneuron/pylearn2-maxsom | pylearn2/scripts/papers/maxout/mytests/mytest4.py | 1 | 8009 | from pylearn2.models.mlp import MLP
from pylearn2.models.maxout import Maxout
from pylearn2.training_algorithms.sgd import SGD
import logging
import warnings
import sys
import numpy as np
from theano.compat import six
from theano import config
from theano import function
from theano.gof.op import get_debug_values
impo... | bsd-3-clause |
Xperia-Nicki/android_platform_sony_nicki | external/webkit/Tools/Scripts/webkitpy/common/system/ospath_unittest.py | 15 | 2518 | # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
#
# 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 and... | apache-2.0 |
troya2/pjsip | doc/pjsip-book/conf.py | 61 | 8065 | # -*- coding: utf-8 -*-
#
# The PJSIP Book documentation build configuration file, created by
# sphinx-quickstart on Sat Nov 30 06:36:26 2013.
#
# 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.
... | gpl-2.0 |
ojake/django | django/contrib/gis/db/backends/postgis/models.py | 396 | 2158 | """
The GeometryColumns and SpatialRefSys models for the PostGIS backend.
"""
from django.contrib.gis.db.backends.base.models import SpatialRefSysMixin
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class PostGISGeometryColumns(models.Model):
... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.