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 |
|---|---|---|---|---|---|
duyetdev/islab-portfolio-by-ghost | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/formatters/img.py | 268 | 18059 | # -*- coding: utf-8 -*-
"""
pygments.formatters.img
~~~~~~~~~~~~~~~~~~~~~~~
Formatter for Pixmap output.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys
from pygments.formatter import Formatter
from pygments.util import ge... | mit |
SeleniumHQ/buck | third-party/py/unittest2/unittest2/test/test_skipping.py | 111 | 4936 | from unittest2.test.support import LoggingResult
import unittest2
class Test_TestSkipping(unittest2.TestCase):
def test_skipping(self):
class Foo(unittest2.TestCase):
def test_skip_me(self):
self.skipTest("skip")
events = []
result = LoggingResult(events)
... | apache-2.0 |
oberlin/django | django/contrib/gis/measure.py | 344 | 12272 | # Copyright (c) 2007, Robert Coup <robert.coup@onetrackmind.co.nz>
# 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,
#... | bsd-3-clause |
SciTools/iris | lib/iris/tests/unit/plot/__init__.py | 3 | 3875 | # Copyright Iris contributors
#
# This file is part of Iris and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
"""Unit tests for the :mod:`iris.plot` module."""
# Import iris.tests first so that some things can be initialised before
# im... | lgpl-3.0 |
cvegaj/ElectriCERT | venv3/lib/python3.6/site-packages/werkzeug/debug/repr.py | 107 | 9340 | # -*- coding: utf-8 -*-
"""
werkzeug.debug.repr
~~~~~~~~~~~~~~~~~~~
This module implements object representations for debugging purposes.
Unlike the default repr these reprs expose a lot more information and
produce HTML instead of ASCII.
Together with the CSS and JavaScript files of the debug... | gpl-3.0 |
ch3ll0v3k/scikit-learn | examples/semi_supervised/plot_label_propagation_digits_active_learning.py | 294 | 3417 | """
========================================
Label Propagation digits active learning
========================================
Demonstrates an active learning technique to learn handwritten digits
using label propagation.
We start by training a label propagation model with only 10 labeled points,
then we select the t... | bsd-3-clause |
scue/vim-ycm_win7 | third_party/requests-futures/requests_futures/sessions.py | 19 | 2540 | # -*- coding: utf-8 -*-
"""
requests_futures
~~~~~~~~~~~~~~~~
This module provides a small add-on for the requests http library. It makes use
of python 3.3's concurrent.futures or the futures backport for previous
releases of python.
from requests_futures import FuturesSession
session = FuturesSession()
... | gpl-3.0 |
mxOBS/deb-pkg_trusty_chromium-browser | build/android/pylib/utils/zip_utils.py | 69 | 1212 | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
import zipfile
def WriteToZipFile(zip_file, path, arc_path):
"""Recursively write |path| to |zip_file| as |arc_path|.
zip_fil... | bsd-3-clause |
Fantu/Xen | tools/python/xen/migration/libxc.py | 11 | 14641 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Libxc Migration v2 streams
Record structures as per docs/specs/libxc-migration-stream.pandoc, and
verification routines.
"""
import sys
from struct import calcsize, unpack
from xen.migration.verify import StreamError, RecordError, VerifyBase
# Image Header
IHDR_FO... | gpl-2.0 |
bright-sparks/chromium-spacewalk | ppapi/native_client/tools/browser_tester/browsertester/rpclistener.py | 170 | 2297 | #!/usr/bin/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.
import sys
import time
class RPCListener(object):
def __init__(self, shutdown_callback):
self.shutdown_callback = shutdown_ca... | bsd-3-clause |
guorendong/iridium-browser-ubuntu | third_party/trace-viewer/third_party/tvcm/tvcm/fake_fs.py | 2 | 3677 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import codecs
import os
import sys
import collections
import StringIO
class WithableStringIO(StringIO.StringIO):
def __enter__(self, *args):
return sel... | bsd-3-clause |
aigeano/pympler | test/muppy/test_tracker.py | 4 | 6265 | import gc
import sys
import unittest
from pympler import summary, tracker
from pympler.util import compat
from testutils import disable
class TrackerTest(unittest.TestCase):
def setUp(self):
gc.collect()
# simplify object type representation used for summaries
# for these tests it is no... | apache-2.0 |
kacchan822/vmailadmin | application.py | 1 | 5310 | # -*- coding: utf-8 -*-
## python3 standerd modules
from crypt import crypt, mksalt, METHOD_MD5, METHOD_SHA256, METHOD_SHA512
from hmac import compare_digest
import sqlite3
import smtplib
from email.mime.text import MIMEText
import json
import re
import os
## bottle modules
import bottle
import bottle_sqlite
from col... | mit |
DebrahR/memory | server/lib/werkzeug/contrib/testtools.py | 319 | 2449 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.testtools
~~~~~~~~~~~~~~~~~~~~~~~~~~
This module implements extended wrappers for simplified testing.
`TestResponse`
A response wrapper which adds various cached attributes for
simplified assertions on various content types.
:copyright:... | apache-2.0 |
Xprima-ERP/odoo_addons | xpr_sale_process/controllers.py | 1 | 1043 | # -*- coding: utf-8 -*-
from openerp import http
# class XprPreQuoteCreationActions(http.Controller):
# @http.route('/xpr_pre_quote_creation_actions/xpr_pre_quote_creation_actions/', auth='public')
# def index(self, **kw):
# return "Hello, world"
# @http.route('/xpr_pre_quote_creation_actions/xpr_... | gpl-3.0 |
sjlehtin/django | django/template/exceptions.py | 129 | 1340 | """
This module contains generic exceptions used by template backends. Although,
due to historical reasons, the Django template language also internally uses
these exceptions, other exceptions specific to the DTL should not be added
here.
"""
class TemplateDoesNotExist(Exception):
"""
The exception used when ... | bsd-3-clause |
fritaly/httpie | tests/test_cli.py | 46 | 11737 | """CLI argument parsing related tests."""
import json
# noinspection PyCompatibility
import argparse
import pytest
from requests.exceptions import InvalidSchema
from httpie import input
from httpie.input import KeyValue, KeyValueArgType, DataDict
from httpie import ExitStatus
from httpie.cli import parser
from utils ... | bsd-3-clause |
joswr1ght/plistsubtractor | plistsubtractor.py | 1 | 2003 | #!/usr/bin/env python
# Copyright (c) Joshua Wright 2015'ish
import sys
import os
try:
import biplist
except ImportError:
sys.stdout.write("You must install the biplist module: pip install biplist\n")
sys.exit(1)
def extplist(plistfile):
#print "Processing " + plistfile
try:
plistelements=... | bsd-2-clause |
shahbaz17/zamboni | scripts/serve_packaged_apps.py | 26 | 5866 | #!/usr/bin/env python
"""
Script to serve packaged app mini-manifest and zip files to ease development.
Change directory to the root of your packaged app directory and execute this
script. For example:
$ cd ~/myapp
$ python ~/serve_packaged_apps.py
"""
import json
import logging
import optparse
import os
import re
i... | bsd-3-clause |
lucperkins/heron | heron/shell/src/python/handlers/jstackhandler.py | 1 | 1145 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright 2016 Twitter. 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... | apache-2.0 |
gaddman/ansible | lib/ansible/modules/messaging/rabbitmq/rabbitmq_vhost.py | 63 | 3952 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2013, Chatham Financial <oss@chathamfinancial.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metada... | gpl-3.0 |
jiangwei1221/django-virtualenv-demo | env/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 ... | unlicense |
lkash/test | dpkt/radiotap.py | 6 | 14631 | # -*- coding: utf-8 -*-
"""Radiotap"""
import dpkt
import ieee80211
import socket
from decorators import deprecated
# Ref: http://www.radiotap.org
# Fields Ref: http://www.radiotap.org/defined-fields/all
# Present flags
_TSFT_MASK = 0x1000000
_FLAGS_MASK = 0x2000000
_RATE_MASK = 0x4000000
_CHANNEL_MASK = 0x8000000
_... | bsd-3-clause |
drxaero/calibre | src/calibre/ebooks/metadata/sources/test.py | 14 | 9942 | #!/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__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os, te... | gpl-3.0 |
msimacek/freeipa | ipa-client/ipaclient/ipa_certupdate.py | 3 | 7113 | # Authors: Jan Cholasta <jcholast@redhat.com>
#
# Copyright (C) 2014 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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 versi... | gpl-3.0 |
switch-model/switch-hawaii-studies | models/oahu_2007_dr/electricityDoubleCES.py | 2 | 7548 | import numpy as np
######################################################################
# A DOUBLE CES DEMAND FUNCTION FOR ELECTRICITY
######################################################################
#
# This code includes three functions:
# 1. ces(p, Theta): standard CES demand system.
# ... | apache-2.0 |
JT5D/scikit-learn | sklearn/utils/validation.py | 2 | 11101 | """Utilities for input validation"""
# Authors: Olivier Grisel
# Gael Varoquaux
# Andreas Mueller
# Lars Buitinck
# Alexandre Gramfort
# Nicolas Tresegnie
# License: BSD 3 clause
import warnings
import numbers
import numpy as np
from scipy import sparse
from ..externals i... | bsd-3-clause |
miselin/grpc | src/python/grpcio/grpc/framework/interfaces/base/__init__.py | 1496 | 1530 | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
alexex/wiki | wiki/web/forms.py | 2 | 1703 | """
Forms
~~~~~
"""
from flask_wtf import FlaskForm
from wtforms import BooleanField
try:
from wtforms import StringField as StringField
except ImportError:
from wtforms import TextField as StringField
from wtforms import TextAreaField
from wtforms import PasswordField
from wtforms.validators import Inp... | bsd-3-clause |
manassolanki/frappe | frappe/utils/redis_wrapper.py | 4 | 5259 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import redis, frappe, re
from six.moves import cPickle as pickle
from frappe.utils import cstr
from six import iteritems
class RedisWrapper(redis.Redis):
"""Redis client that w... | mit |
sephii/django-cms | cms/tests/fixture_loading.py | 58 | 1763 | # -*- coding: utf-8 -*-
import tempfile
import codecs
try:
from cStringIO import StringIO
except:
from io import StringIO
from django.core.management import call_command
from cms.test_utils.fixtures.navextenders import NavextendersFixture
from cms.test_utils.testcases import CMSTestCase
from cms.models impor... | bsd-3-clause |
f3r/scikit-learn | sklearn/neighbors/approximate.py | 30 | 22370 | """Approximate nearest neighbor search"""
# Author: Maheshakya Wijewardena <maheshakya.10@cse.mrt.ac.lk>
# Joel Nothman <joel.nothman@gmail.com>
import numpy as np
import warnings
from scipy import sparse
from .base import KNeighborsMixin, RadiusNeighborsMixin
from ..base import BaseEstimator
from ..utils.va... | bsd-3-clause |
diagramsoftware/odoo | addons/note/tests/test_note.py | 427 | 1686 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
jcpeterson/Dallinger | setup.py | 1 | 1637 | """Install Dallinger as a command line utility."""
import os
from setuptools import setup
setup_args = dict(
name='dallinger',
packages=['dallinger'],
version="4.0.0",
description='Laboratory automation for the behavioral and social sciences',
url='http://github.com/Dallinger/Dallinger',
maint... | mit |
marcy-terui/lamvery | lamvery/clients/events.py | 1 | 3131 | # -*- coding: utf-8 -*-
import botocore
from lamvery.clients.base import BaseClient
class EventsClient(BaseClient):
def __init__(self, *args, **kwargs):
super(EventsClient, self).__init__(*args, **kwargs)
self._events = self._session.client('events')
def get_rules_by_target(self, arn):
... | mit |
haveal/googleads-python-lib | examples/dfp/v201411/creative_template_service/get_creative_templates_by_statement.py | 4 | 2258 | #!/usr/bin/python
#
# Copyright 2014 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 b... | apache-2.0 |
jeffmahoney/supybot | plugins/Status/__init__.py | 15 | 2299 | ###
# Copyright (c) 2004, Jeremiah Fincher
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditi... | bsd-3-clause |
gorjuce/odoo | addons/report/models/abstract_report.py | 249 | 2981 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
woodem/woo | py/tests/io.py | 1 | 6334 | '''
Test loading and saving woo objects in various formats
'''
import woo
import unittest
from woo.core import *
from woo.dem import *
from woo.pre import *
from minieigen import *
from woo import utils
class TestFormatsAndDetection(unittest.TestCase):
def setUp(self):
woo.master.scene=S=Scene(fields=[DemF... | gpl-2.0 |
dwfreed/mitmproxy | test/mitmproxy/addons/test_proxyauth.py | 1 | 5031 | import binascii
from mitmproxy import exceptions
from mitmproxy.test import taddons
from mitmproxy.test import tflow
from mitmproxy.test import tutils
from mitmproxy.addons import proxyauth
def test_parse_http_basic_auth():
assert proxyauth.parse_http_basic_auth(
proxyauth.mkauth("test", "test")
) ==... | mit |
zuck/prometeo-erp | documents/migrations/0001_initial.py | 3 | 20532 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Document'
db.create_table('documents_document', (
('id', self.gf('django.db.mo... | lgpl-3.0 |
mcalmer/spacewalk | client/rhel/rhn-client-tools/test/testRpmUtils.py | 36 | 3719 | #!/usr/bin/python
import sys
import settestpath
import unittest
#Import the modules you need to test...
from up2date_client import pkgUtils
def write(blip):
sys.stdout.write("\n|%s|\n" % blip)
class TestVerifyPackages(unittest.TestCase):
def setUp(self):
self.__setupData()
def __setupData(se... | gpl-2.0 |
artisanofcode/flask-generic-views | examples/notepad/app.py | 1 | 2057 | from datetime import datetime
from flask import Flask
from flask.ext.generic_views import RedirectView, TemplateView
from flask.ext.generic_views.sqlalchemy import (CreateView, DeleteView,
DetailView, ListView,
UpdateView)
... | mit |
laumann/servo | components/script/dom/bindings/codegen/parser/tests/test_duplicate_qualifiers.py | 241 | 1893 | def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
interface DuplicateQualifiers1 {
getter getter byte foo(unsigned long index);
};
""")
results = parser.finish()
except:
threw = True
harness.ok(threw, "Should have... | mpl-2.0 |
The-Covenant/android_kernel_samsung_i317 | 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 |
edwards-lab/libGWAS | documentation/gh-pages/conf.py | 3 | 9987 | # -*- coding: utf-8 -*-
#
# MV-Test documentation build configuration file, created by
# sphinx-quickstart on Fri Aug 21 14:11:20 2015.
#
# 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.
#
# A... | gpl-3.0 |
dzbarsky/servo | tests/wpt/web-platform-tests/cors/resources/cors-makeheader.py | 79 | 2139 | import json
def main(request, response):
origin = request.GET.first("origin", request.headers.get('origin'))
if "check" in request.GET:
token = request.GET.first("token")
value = request.server.stash.take(token)
if value is not None:
if request.GET.first("check", None) == "... | mpl-2.0 |
heli522/scikit-learn | sklearn/decomposition/kernel_pca.py | 207 | 9120 | """Kernel Principal Components Analysis"""
# Author: Mathieu Blondel <mathieu@mblondel.org>
# License: BSD 3 clause
import numpy as np
from scipy import linalg
from ..utils.arpack import eigsh
from ..utils.validation import check_is_fitted, NotFittedError
from ..base import BaseEstimator, TransformerMixin
from ..pre... | bsd-3-clause |
mmazanec22/too-windy | env/lib/python3.5/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.py | 353 | 14161 | """Module for supporting the lxml.etree library. The idea here is to use as much
of the native library as possible, without using fragile hacks like custom element
names that break between releases. The downside of this is that we cannot represent
all possible trees; specifically the following are known to cause proble... | gpl-3.0 |
Radagast-red/golem | tests/golem/environments/test_temp_files.py | 3 | 1191 | import os.path
import subprocess
import tempfile
from golem.tools.testdirfixture import TestDirFixture
class TestTempFiles(TestDirFixture):
def test_running_script_from_temp_file(self):
"""Creates a temporary file, writes a python code into it and runs it"""
test_dir = os.path.join(self.path, "t... | gpl-3.0 |
chenshiyang/jieba | test/parallel/test.py | 65 | 4821 | #encoding=utf-8
from __future__ import print_function
import sys
sys.path.append("../../")
import jieba
jieba.enable_parallel(4)
def cuttest(test_sent):
result = jieba.cut(test_sent)
for word in result:
print(word, "/", end=' ')
print("")
if __name__ == "__main__":
cuttest("这是一个伸手不见五指的黑夜。我叫孙... | mit |
MauHernandez/cyclope | cyclope/apps/custom_comments/tests.py | 1 | 3344 | from django.conf import settings
from django.core import mail
from django.test import TestCase
from django.db import IntegrityError
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
from django.contrib.sites.models import ... | gpl-3.0 |
mkoistinen/aldryn-newsblog | aldryn_newsblog/south_migrations/0013_auto__add_field_latestentriesplugin_namespace.py | 1 | 17597 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'LatestEntriesPlugin.namespace'
db.add_column(u'aldryn_new... | bsd-3-clause |
andrewsmedina/django | django/contrib/formtools/wizard/views.py | 7 | 28344 | import re
from django import forms
from django.shortcuts import redirect
from django.core.urlresolvers import reverse
from django.forms import formsets, ValidationError
from django.views.generic import TemplateView
from django.utils.datastructures import SortedDict
from django.utils.decorators import classonlymethod
f... | bsd-3-clause |
mindoool/chat | lib/werkzeug/contrib/wrappers.py | 318 | 10331 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.wrappers
~~~~~~~~~~~~~~~~~~~~~~~~~
Extra wrappers or mixins contributed by the community. These wrappers can
be mixed in into request objects to add extra functionality.
Example::
from werkzeug.wrappers import Request as RequestBase
fr... | apache-2.0 |
ggyeh/TVML-Kodi-Addons | scripts/kodi/xbmcplugin.py | 1 | 8593 | # coding: utf-8
"""
Functions for Kodi plugins
"""
import xbmc as _xbmc
import sys, logging
logger = logging.getLogger('TVMLServer')
SORT_METHOD_ALBUM = 13
SORT_METHOD_ALBUM_IGNORE_THE = 14
SORT_METHOD_ARTIST = 11
SORT_METHOD_ARTIST_IGNORE_THE = 12
SORT_METHOD_BITRATE = 40
SORT_METHOD_CHANNEL = 38
SORT_METHOD_COUNTRY... | apache-2.0 |
Anaethelion/django-mapentity | mapentity/serializers/commasv.py | 1 | 2022 | import csv
from functools import partial
from django.core.serializers.base import Serializer
from django.utils.encoding import smart_str
from django.utils.translation import ugettext_lazy as _
from django.db.models.fields.related import ForeignKey, ManyToManyField, FieldDoesNotExist
from .helpers import smart_plain_t... | bsd-3-clause |
Azure/azure-sdk-for-python | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/aio/_web_site_management_client.py | 1 | 8997 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | mit |
Ragnis/subdl | gui.py | 1 | 1342 | import locale
import tkinter as tk
from tkinter import ttk
import translations
def _lang(key):
lang = locale.getdefaultlocale()[0][:2]
if lang not in translations.strings:
lang = "en"
if key in translations.strings[lang]:
return translations.strings[lang][key]
return key
def _save_l... | mit |
proxysh/Safejumper-for-Desktop | buildmac/Resources/env/lib/python2.7/site-packages/twisted/conch/insults/text.py | 13 | 5424 | # -*- test-case-name: twisted.conch.test.test_text -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Character attribute manipulation API.
This module provides a domain-specific language (using Python syntax)
for the creation of text with additional display attributes associated
with it.... | gpl-2.0 |
kapilt/ansible | lib/ansible/plugins/__init__.py | 24 | 15677 | # (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com>
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> and others
#
# 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 Foun... | gpl-3.0 |
MaDKaTZe/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/newcommitbot_unittest.py | 122 | 6147 | # Copyright (C) 2013 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the fo... | bsd-3-clause |
fabioticconi/scikit-learn | sklearn/linear_model/tests/test_perceptron.py | 378 | 1815 | import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_raises
from sklearn.utils import check_random_state
from sklearn.datasets import load_iris
from sklearn.linear_model import Pe... | bsd-3-clause |
PhiInnovations/mdp28-linux-bsp | bitbake/lib/bb/fetch2/sftp.py | 2 | 4304 | # ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake SFTP Fetch implementation
Class for fetching files via SFTP. It tries to adhere to the (now
expired) IETF Internet Draft for "Uniform Resource Identifier (URI)
Scheme for Secure File Transfer Protocol (SFTP) and Secure... | mit |
pattisdr/osf.io | api/actions/permissions.py | 6 | 2521 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from rest_framework import permissions as drf_permissions
from api.base.utils import get_user_auth
from osf.models.action import ReviewAction
from osf.models.mixins import ReviewableMixin, ReviewProviderMixin
from osf.utils.workflows import ReviewTrigger... | apache-2.0 |
uniteddiversity/mediadrop | mediadrop/lib/test/__init__.py | 10 | 2287 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is a part of MediaDrop (http://www.mediadrop.net),
# Copyright 2009-2015 MediaDrop contributors
# For the exact contribution history, see the git revision log.
# The source code contained in this file is licensed under the GPLv3 or
# (at your option) any later v... | gpl-3.0 |
v-iam/azure-sdk-for-python | azure-mgmt-billing/azure_bdist_wheel.py | 241 | 21096 | """
"wheel" copyright (c) 2012-2017 Daniel Holth <dholth@fastmail.fm> and
contributors.
The MIT License
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 limi... | mit |
luminescence/PolyLibScan | helpers/to_pqr.py | 1 | 3221 | """This module creates a pqr file from a single simulation run object
of an analysis project.
"""
import os as _os
import numpy as np
import jinja2 as ji
import PolyLibScan.helpers.numpy_helpers as np_help
def _get_pdb_template(name):
with open('%s/%s' % (_os.path.dirname(__file__),name)) as f:
template ... | mit |
ychaim/dark-test-v2 | share/qt/make_spinner.py | 4415 | 1035 | #!/usr/bin/env python
# W.J. van der Laan, 2011
# Make spinning .mng animation from a .png
# Requires imagemagick 6.7+
from __future__ import division
from os import path
from PIL import Image
from subprocess import Popen
SRC='img/reload_scaled.png'
DST='../../src/qt/res/movies/update_spinner.mng'
TMPDIR='/tmp'
TMPNAM... | mit |
Dziolas/invenio | modules/bibcirculation/lib/bibcirculation_web_tests.py | 24 | 10988 | # -*- coding: utf-8 -*-
## This file is part of Invenio.
## Copyright (C) 2011, 2013 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your optio... | gpl-2.0 |
khushboo9293/mailman3 | src/mailman/interfaces/messages.py | 3 | 4039 | # Copyright (C) 2007-2015 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
# GNU Mailman 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 you... | gpl-2.0 |
sparkslabs/kamaelia_ | Sketches/TG/soc2007/shard_final/InitShard.py | 15 | 2624 | # -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Version 2.0 (the "Lic... | apache-2.0 |
Neetuj/softlayer-python | SoftLayer/CLI/subnet/list.py | 2 | 2077 | """List subnets."""
# :license: MIT, see LICENSE for more details.
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import formatting
from SoftLayer import utils
@click.command()
@click.option('--sortby',
help='Column to sort by',
type=click.Choice([... | mit |
UOMx/edx-platform | lms/djangoapps/badges/tests/factories.py | 30 | 2157 | """
Factories for Badge tests
"""
from random import random
import factory
from django.core.files.base import ContentFile
from factory import DjangoModelFactory
from factory.django import ImageField
from badges.models import BadgeAssertion, CourseCompleteImageConfiguration, BadgeClass, CourseEventBadgesConfiguration
... | agpl-3.0 |
xyuanmu/XX-Net | python3.8.2/Lib/optparse.py | 27 | 60369 | """A powerful, extensible, and easy-to-use option parser.
By Greg Ward <gward@python.net>
Originally distributed as Optik.
For support, use the optik-users@lists.sourceforge.net mailing list
(http://lists.sourceforge.net/lists/listinfo/optik-users).
Simple usage example:
from optparse import OptionParser
pa... | bsd-2-clause |
redebian/documentation | django/http/utils.py | 200 | 3268 | """
Functions that modify an HTTP request or response in some way.
"""
# This group of functions are run as part of the response handling, after
# everything else, including all response middleware. Think of them as
# "compulsory response middleware". Be careful about what goes here, because
# it's a little fiddly to ... | bsd-3-clause |
CredoReference/edx-platform | scripts/xsslint/tests/test_main.py | 11 | 7176 | # -*- coding: utf-8 -*-
"""
Tests for main.py
"""
import re
import textwrap
from StringIO import StringIO
from unittest import TestCase
import mock
from xsslint.linters import JavaScriptLinter, MakoTemplateLinter, PythonLinter, UnderscoreTemplateLinter
from xsslint.main import _lint, _build_ruleset
from xsslint.repor... | agpl-3.0 |
ernstbaslerpartner/send2geoadmin | env/Lib/encodings/iso8859_16.py | 593 | 13813 | """ Python Character Mapping Codec iso8859_16 generated from 'MAPPINGS/ISO8859/8859-16.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... | apache-2.0 |
mfherbst/spack | var/spack/repos/builtin/packages/tk/package.py | 5 | 2693 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
puuu/micropython | tests/float/float1.py | 14 | 1914 | # test basic float capabilities
# literals
print(.12)
print(1.)
print(1.2)
print(0e0)
print(0e+0)
print(0e-0)
# float construction
print(float(1.2))
print(float("1.2"))
print(float("+1"))
print(float("1e1"))
print(float("1e+1"))
print(float("1e-1"))
print(float("inf"))
print(float("-inf"))
print(float("INF"))
print(f... | mit |
Henry/TrackHand | tools/arm-none-eabi/arm-none-eabi/lib/thumb2/libstdc++.a-gdb.py | 3 | 2340 | # -*- python -*-
# Copyright (C) 2009, 2010 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 later versi... | gpl-3.0 |
ninotoshi/tensorflow | tensorflow/contrib/linear_optimizer/python/kernel_tests/sdca_ops_test.py | 8 | 30879 | # 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 |
repotvsupertuga/repo | script.module.urlresolver/lib/urlresolver/plugins/mp4stream.py | 4 | 2002 | """
urlresolver XBMC Addon
Copyright (C) 2011 t0mm0
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.
... | gpl-2.0 |
mortentoo/maya | scripts/fileIO/export_fbx_to_unity/exportfbxtounity.py | 1 | 42438 | """
## Description
Customized bake process and fbx settings suited for use with Unity and possibly other game engines as well.
## Features
- Simplified export process
- Split animation into clips
- Maintain step tangent for keys (useful for stop-motion style animation)
## Installation
Save script in Maya's scripts ... | gpl-3.0 |
matthiasdiener/spack | var/spack/repos/builtin/packages/xcb-demo/package.py | 5 | 1800 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
jayceyxc/hue | desktop/core/ext-py/Django-1.6.10/tests/validators/tests.py | 38 | 9616 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
import types
from datetime import datetime, timedelta
from django.core.exceptions import ValidationError
from django.core.validators import *
from django.test.utils import str_prefix
from django.utils.unittest import TestCase
NOW = datetime.n... | apache-2.0 |
gauravbose/digital-menu | digimenu2/tests/admin_docs/tests.py | 13 | 17684 | import sys
import unittest
from django.conf import settings
from django.contrib.admindocs import utils
from django.contrib.admindocs.views import get_return_data_type
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse
from django.test i... | bsd-3-clause |
ladybug-analysis-tools/ladybug-core | ladybug/cli/translate.py | 1 | 4634 | """ladybug file translation commands."""
import click
import sys
import logging
from ladybug.wea import Wea
from ladybug.ddy import DDY
from ladybug.epw import EPW
from ._helper import _load_analysis_period_str
_logger = logging.getLogger(__name__)
@click.group(help='Commands for translating between various file t... | gpl-3.0 |
quinot/ansible | lib/ansible/plugins/terminal/dellos10.py | 125 | 2767 | #
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Copyright (c) 2017 Dell Inc.
#
# 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) an... | gpl-3.0 |
mikalstill/nova | nova/policies/used_limits.py | 6 | 1391 | # Copyright 2016 Cloudbase Solutions Srl
# 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 r... | apache-2.0 |
chaffra/sympy | sympy/external/tests/test_numpy.py | 92 | 9441 | # This testfile tests SymPy <-> NumPy compatibility
# Don't test any SymPy features here. Just pure interaction with NumPy.
# Always write regular SymPy tests for anything, that can be tested in pure
# Python (without numpy). Here we test everything, that a user may need when
# using SymPy with NumPy
from __future__ ... | bsd-3-clause |
click-contrib/sphinx-click | sphinx_click/ext.py | 1 | 14866 | import re
import traceback
import warnings
import click
from docutils import nodes
from docutils.parsers import rst
from docutils.parsers.rst import directives
from docutils import statemachine
from sphinx.util import logging
from sphinx.util import nodes as sphinx_nodes
LOG = logging.getLogger(__name__)
NESTED_FULL... | mit |
F4r3n/FarenMediaLibrary | extlib/assimp/contrib/gtest/test/gtest_break_on_failure_unittest.py | 2140 | 7339 | #!/usr/bin/env python
#
# Copyright 2006, 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... | apache-2.0 |
doganov/edx-platform | common/lib/xmodule/xmodule/tests/test_error_module.py | 146 | 5893 | """
Tests for ErrorModule and NonStaffErrorModule
"""
import unittest
from xmodule.tests import get_test_system
from xmodule.error_module import ErrorDescriptor, ErrorModule, NonStaffErrorDescriptor
from xmodule.modulestore.xml import CourseLocationManager
from opaque_keys.edx.locations import SlashSeparatedCourseKey, ... | agpl-3.0 |
z0by/django | tests/model_formsets/models.py | 143 | 7751 | from __future__ import unicode_literals
import datetime
import uuid
from django.db import models
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Author(models.Model):
name = models.CharField(max_length=100)
class Meta:
or... | bsd-3-clause |
bobbymckinney/seebeck_measurement | old versions/Seebeck_HighTemp_CMDLine.py | 1 | 34381 | #! /usr/bin/python
# -*- coding: utf-8 -*-
"""
Created: 2016-02-09
@author: Bobby McKinney (bobbymckinney@gmail.com)
"""
import os
import numpy as np
import matplotlib.pyplot as plt
import minimalmodbus as modbus # For communicating with the cn7500s
import omegacn7500 # Driver for cn7500s under minimalmodbus, adds a fe... | gpl-3.0 |
uglyboxer/linear_neuron | net-p3/lib/python3.5/site-packages/scipy/stats/_tukeylambda_stats.py | 128 | 6930 | from __future__ import division, print_function, absolute_import
import numpy as np
from numpy import poly1d
from scipy.special import beta
# The following code was used to generate the Pade coefficients for the
# Tukey Lambda variance function. Version 0.17 of mpmath was used.
#------------------------------------... | mit |
basicthinker/ThyNVM | ext/ply/ply/cpp.py | 128 | 33042 | # -----------------------------------------------------------------------------
# cpp.py
#
# Author: David Beazley (http://www.dabeaz.com)
# Copyright (C) 2007
# All rights reserved
#
# This module implements an ANSI-C style lexical preprocessor for PLY.
# -------------------------------------------------------------... | bsd-3-clause |
nanomolina/JP | src/odontology/register/migrations/0025_auto_20160402_0350.py | 1 | 2521 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-04-02 06:50
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('register', '0024_radiography'),
]
operations = [
migrations.RenameField(
... | apache-2.0 |
gangadhar-kadam/powapp | accounts/doctype/budget_distribution/test_budget_distribution.py | 30 | 2071 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
test_records = [
[{
"doctype": "Budget Distribution",
"distribution_id": "_Test Distribution",
"fiscal_year": "_Test Fiscal Year 2013",
}, {
"doctype": "Budget Distribution Detail... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.