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 |
|---|---|---|---|---|---|
nipunbatra/bayespy | bayespy/inference/vmp/nodes/tests/test_dirichlet.py | 2 | 3106 | ######################################################################
# Copyright (C) 2014 Jaakko Luttinen
#
# This file is licensed under Version 3.0 of the GNU General Public
# License. See LICENSE for a text of the license.
######################################################################
####################... | gpl-3.0 |
jonathan-beard/edx-platform | lms/djangoapps/instructor/tests/test_tools.py | 38 | 11896 | """
Tests for views/tools.py.
"""
import datetime
import mock
import json
import unittest
from django.utils.timezone import utc
from django.test.utils import override_settings
from nose.plugins.attrib import attr
from courseware.field_overrides import OverrideFieldData # pylint: disable=import-error
from student.te... | agpl-3.0 |
biblepay/biblepay | qa/rpc-tests/rpcbind_test.py | 2 | 4452 | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test running bitcoind with the -rpcbind and -rpcallowip options."""
from test_framework.test_framework... | mit |
ericpinet/MarkupEasy | api/models.py | 1 | 2259 | from __future__ import unicode_literals
import os
import time
from django.contrib.auth.models import User
from django.utils.datetime_safe import datetime
from django.core.files.storage import FileSystemStorage
from django.db import models
def user_project_directory_path(instance):
"""
File will be uploaded ... | mit |
mozilla/stoneridge | python/src/Mac/Modules/drag/dragscan.py | 34 | 2510 | # Scan <Drag.h>, generating draggen.py.
import sys
from bgenlocations import TOOLBOXDIR, BGENDIR, INCLUDEDIR
sys.path.append(BGENDIR)
from scantools import Scanner
MISSING_DEFINES="""
kDragHasLeftSenderWindow = (1 << 0)
kDragInsideSenderApplication = (1 << 1)
kDragInsideSenderWindow = (1 << 2)
kDragReg... | mpl-2.0 |
nzavagli/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Lib/encodings/iso8859_3.py | 593 | 13345 | """ Python Character Mapping Codec iso8859_3 generated from 'MAPPINGS/ISO8859/8859-3.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='... | mit |
mwrightevent38/MissionPlanner | Lib/site-packages/numpy/testing/numpytest.py | 54 | 1509 | import os
import sys
import traceback
__all__ = ['IgnoreException', 'importall',]
DEBUG=0
if sys.platform == 'cli':
get_frame = None
else:
get_frame = sys._getframe
class IgnoreException(Exception):
"Ignoring this exception due to disabled feature"
def output_exception(printstream = sys.stdout):
tr... | gpl-3.0 |
jose36/jmdl7 | commonresolvers.py | 186 | 31372 | # -*- coding: utf-8 -*-
'''
Genesis Add-on
Copyright (C) 2014 lambda
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 ... | gpl-2.0 |
ChristineLaMuse/mozillians | vendor-local/lib/python/rest_framework/negotiation.py | 18 | 3805 | """
Content negotiation deals with selecting an appropriate renderer given the
incoming request. Typically this will be based on the request's Accept header.
"""
from __future__ import unicode_literals
from django.http import Http404
from rest_framework import exceptions
from rest_framework.settings import api_setting... | bsd-3-clause |
ltilve/ChromiumGStreamerBackend | chrome/common/extensions/docs/examples/apps/hello-python/oauth2/__init__.py | 257 | 25629 | """
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
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 ... | bsd-3-clause |
Sweetgrassbuffalo/ReactionSweeGrass-v2 | .meteor/local/dev_bundle/python/Lib/test/test_pep352.py | 135 | 9047 | import unittest
import __builtin__
import exceptions
import warnings
from test.test_support import run_unittest, check_warnings
import os
import sys
from platform import system as platform_system
DEPRECATION_WARNINGS = ["BaseException.message has been deprecated"]
if sys.py3kwarning:
DEPRECATION_WARNINGS.extend(
... | gpl-3.0 |
romain-li/edx-platform | cms/djangoapps/contentstore/features/pages.py | 1 | 5025 | # pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
# pylint: disable=unused-argument
from lettuce import world, step
from nose.tools import assert_equal, assert_in
CSS_FOR_TAB_ELEMENT = "li[data-tab-id='{0}'] input.toggle-checkbox"
@step(u'I go to the pages page$')
def go_to_static(step):
... | agpl-3.0 |
deandunbar/bitwave | hackathon_version/venv/lib/python2.7/site-packages/django/forms/models.py | 34 | 54961 | """
Helper functions for creating Form classes from Django models
and database field objects.
"""
from __future__ import unicode_literals
from collections import OrderedDict
import warnings
from django.core.exceptions import (
ValidationError, NON_FIELD_ERRORS, FieldError)
from django.forms.fields import Field, ... | mit |
chenxiaoxing1992/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 |
lucidmotifs/auto-aoc | .venv/lib/python3.5/site-packages/pylint/test/extensions/test_overlapping_exceptions.py | 6 | 2764 | # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://github.com/PyCQA/pylint/blob/master/COPYING
"""Tests for the pylint checker in :mod:`pylint.extensions.overlapping_exceptions
"""
from sys import version_info
from os.path import join, dirname
from pylint.extensio... | mit |
Erotemic/hotspotter | _scripts/build_tpl.py | 2 | 12535 | # TODO: Let pyinstaller take care of this
#os.chdir(hotspotter_root)
import os, sys
from hotspotter.helpers import check_path, ensure_path, vd, copy_all, copy
from os.path import join
import types
import textwrap
__HOME__ = os.path.expanduser("~")
__CODE__ = os.path.expanduser("~")+'/code'
hotspotter_r... | apache-2.0 |
wenbinf/ndkale | kale/message.py | 1 | 5157 | """Custom message type for SQS messages."""
import pickle
from boto.sqs import message
from kale import crypt
from kale import exceptions
from kale import settings
from kale import utils
_compressor = settings.COMPRESSOR
_decompressor = settings.DECOMPRESSOR
_task_size_limit = settings.SQS_TASK_SIZE_LIMIT
_get_curr... | bsd-2-clause |
whr20120503/wy | node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/generator/ninja_test.py | 610 | 1611 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Unit tests for the ninja.py file. """
import gyp.generator.ninja as ninja
import unittest
import StringIO
import sys
import TestCommon
... | mit |
crlang/sublime-text---front-end-config | Data/Packages/wakatime/packages/wakatime/packages/pygments/lexers/_mapping.py | 7 | 54806 | # -*- coding: utf-8 -*-
"""
pygments.lexers._mapping
~~~~~~~~~~~~~~~~~~~~~~~~
Lexer mapping definitions. This file is generated by itself. Everytime
you change something on a builtin lexer definition, run this script from
the lexers folder to update it.
Do not alter the LEXERS dictionary by ha... | mit |
LaMi-/pmatic | ccu_pkg/python/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/six.py | 2375 | 11628 | """Utilities for writing code that runs on Python 2 and 3"""
#Copyright (c) 2010-2011 Benjamin Peterson
#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 l... | gpl-2.0 |
eg-zhang/scikit-learn | sklearn/externals/six.py | 547 | 20588 | """Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2013 Benjamin Peterson
#
# 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 with... | bsd-3-clause |
SlimLP-Y300/chil360-kernel | Documentation/target/tcm_mod_builder.py | 4981 | 41422 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
mgadi/naemonbox | sources/psdash/Flask-0.10.1/flask/testsuite/helpers.py | 405 | 21973 | # -*- coding: utf-8 -*-
"""
flask.testsuite.helpers
~~~~~~~~~~~~~~~~~~~~~~~
Various helpers.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import flask
import unittest
from logging import StreamHandler
from flask.testsuite import FlaskTestCase,... | gpl-2.0 |
Samsung/TizenRT | external/iotivity/iotivity_1.2-rel/build_common/iotivityconfig/compiler/gcc_configuration.py | 64 | 4297 | # ------------------------------------------------------------------------
# Copyright 2015 Intel Corporation
#
# 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/li... | apache-2.0 |
ehashman/oh-mainline | vendor/packages/whoosh/src/whoosh/support/unicode.py | 21 | 26609 | import re
from bisect import bisect_right
from whoosh.compat import text_type, u
# http://unicode.org/Public/UNIDATA/Blocks.txt
_blockdata = '''
# Blocks-5.1.0.txt
# Date: 2008-03-20, 17:41:00 PDT [KW]
#
# Unicode Character Database
# Copyright (c) 1991-2008 Unicode, Inc.
# For terms of use, see http://www.unicode.o... | agpl-3.0 |
decvalts/iris | lib/iris/tests/unit/fileformats/pp/test__LBProc.py | 11 | 9948 | # (C) British Crown Copyright 2014 - 2015, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | gpl-3.0 |
pquentin/libcloud | libcloud/test/common/test_openstack.py | 9 | 1830 | # 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 |
cosmiclattes/TPBviz | torrent/lib/python2.7/site-packages/django/template/loaders/app_directories.py | 105 | 2354 | """
Wrapper for loading templates from "templates" directories in INSTALLED_APPS
packages.
"""
import os
import sys
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.template.base import TemplateDoesNotExist
from django.template.loader import BaseLoader
from django.u... | gpl-3.0 |
eduNEXT/edunext-platform | openedx/core/djangoapps/header_control/decorators.py | 9 | 1972 | """
Middleware decorator for removing headers.
"""
from functools import wraps
from openedx.core.djangoapps.header_control import force_header_for_response, remove_headers_from_response
def remove_headers(*headers):
"""
Decorator that removes specific headers from the response.
Usage:
@remove_h... | agpl-3.0 |
Simran-B/arangodb | 3rdParty/V8-4.3.61/test/webkit/testcfg.py | 24 | 6502 | # Copyright 2013 the V8 project authors. 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... | apache-2.0 |
Tatsh-ansible/ansible | lib/ansible/utils/module_docs_fragments/azure_tags.py | 138 | 1470 | # Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.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, eit... | gpl-3.0 |
BeiLuoShiMen/nupic | tests/unit/nupic/research/spatial_pooler_boost_test.py | 35 | 13856 | #! /usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions... | agpl-3.0 |
kdubois/gpull | utils/config.py | 1 | 3772 | import os
import yaml
CONFIG_FILE = 'settings.yaml'
class Config(object):
def __init__(self):
# get settings from settings.yaml
config_file_path = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, CONFIG_FILE))
with open(config_file_path, 'r') as yml:
self.co... | gpl-3.0 |
lkwg82/h2o | deps/brotli/python/bro.py | 11 | 4953 | #! /usr/bin/env python
"""Compression/decompression utility using the Brotli algorithm."""
from __future__ import print_function
import argparse
import sys
import os
import platform
import brotli
# default values of encoder parameters
DEFAULT_PARAMS = {
'mode': brotli.MODE_GENERIC,
'quality': 11,
'lgwin'... | mit |
jbarriosc/ACSUFRO | LGPL/CommonSoftware/acspy/test/test_Acspy_Servants_ContainerServices.py | 4 | 10584 | #! /usr/bin/env python
#*******************************************************************************
# ALMA - Atacama Large Millimiter Array
# (c) National Research Council of Canada, 2007
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public... | lgpl-2.1 |
saimn/glue | glue/core/tests/test_link_helpers.py | 4 | 3363 | # pylint: disable=I0011,W0613,W0201,W0212,E1101,E1103
from __future__ import absolute_import, division, print_function
import pytest
import numpy as np
from glue.core import ComponentID, Data, Component, DataCollection
from .. import link_helpers as lh
from ..link_helpers import (LinkTwoWay, multi_link,
... | bsd-3-clause |
linjoahow/W16_test1 | static/Brython3.1.0-20150301-090019/Lib/unittest/util.py | 794 | 4157 | """Various utility functions."""
from collections import namedtuple, OrderedDict
__unittest = True
_MAX_LENGTH = 80
def safe_repr(obj, short=False):
try:
result = repr(obj)
except Exception:
result = object.__repr__(obj)
if not short or len(result) < _MAX_LENGTH:
return result
... | gpl-3.0 |
gangadharkadam/tailorerp | erpnext/utilities/repost_stock.py | 6 | 7318 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import flt, cstr, nowdate, nowtime
from erpnext.stock.utils import update_bin
from erpnext.stock.stock_ledger import... | agpl-3.0 |
robertjoosten/rjSkinningTools | scripts/skinningTools/paintSmoothWeightsCtx/__init__.py | 1 | 1077 | """
Paint smooth weights tool in Maya using the weights of neighbouring vertices.
Installation
============
* Extract the content of the .rar file anywhere on disk.
* Drag the skinningTools.mel file in Maya to permanently install the script.
Note
====
The paint tool calls a script that find the surrounding vertice... | gpl-3.0 |
mengxn/tensorflow | tensorflow/tensorboard/backend/event_processing/plugin_asset_util_test.py | 17 | 3943 | # 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 |
bcornwellmott/erpnext | erpnext/hr/doctype/appraisal/appraisal.py | 43 | 2397 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import flt, getdate
from frappe import _
from frappe.model.mapper import get_mapped_doc
from frappe.model.document imp... | gpl-3.0 |
openmicroscopy/snoopycrimecop | test/unit/test_filters.py | 2 | 11225 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2013 University of Dundee & Open Microscopy Environment
# All Rights Reserved.
#
# 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 Foundat... | gpl-2.0 |
aman-iitj/scipy | scipy/weave/examples/md5_speed.py | 100 | 2595 | """
Storing actual strings instead of their md5 value appears to
be about 10 times faster.
>>> md5_speed.run(200,50000)
md5 build(len,sec): 50000 0.870999932289
md5 retrv(len,sec): 50000 0.680999994278
std build(len,sec): 50000 0.259999990463
std retrv(len,sec): 50000 0.0599999427795
This test actually takes several ... | bsd-3-clause |
hkawasaki/kawasaki-aio8-0 | common/lib/xmodule/xmodule/modulestore/xml.py | 10 | 34625 | import hashlib
import itertools
import json
import logging
import os
import re
import sys
import glob
from collections import defaultdict
from cStringIO import StringIO
from fs.osfs import OSFS
from importlib import import_module
from lxml import etree
from path import path
from xmodule.error_module import ErrorDescr... | agpl-3.0 |
davidyezsetz/kuma | vendor/packages/translate-toolkit/translate/convert/xliff2odf.py | 6 | 5767 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2004-2006 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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 ... | mpl-2.0 |
Suwmlee/XX-Net | Python3/lib/typing.py | 6 | 53772 | # TODO nits:
# Get rid of asserts that are the caller's fault.
# Docstrings (e.g. ABCs).
import abc
from abc import abstractmethod, abstractproperty
import collections
import functools
import re as stdlib_re # Avoid confusion with the re we export.
import sys
import types
try:
import collections.abc as collection... | bsd-2-clause |
ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/lib/django-1.4/django/utils/unittest/runner.py | 571 | 6761 | """Running tests"""
import sys
import time
import unittest
from django.utils.unittest import result
try:
from django.utils.unittest.signals import registerResult
except ImportError:
def registerResult(_):
pass
__unittest = True
class _WritelnDecorator(object):
"""Used to decorate file-like obj... | bsd-3-clause |
ppokah0111/userinfuser | fantasm/exceptions.py | 28 | 22392 | """ Fantasm: A taskqueue-based Finite State Machine for App Engine Python
Docs and examples: http://code.google.com/p/fantasm/
Copyright 2010 VendAsta Technologies 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 ob... | gpl-3.0 |
sbellem/django | tests/generic_views/test_base.py | 269 | 19854 | from __future__ import unicode_literals
import time
import unittest
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import resolve
from django.http import HttpResponse
from django.test import RequestFactory, SimpleTestCase, override_settings
from django.test.utils import require_... | bsd-3-clause |
hcsturix74/django | tests/ordering/tests.py | 301 | 10033 | from __future__ import unicode_literals
from datetime import datetime
from operator import attrgetter
from django.db.models import F
from django.test import TestCase
from .models import Article, Author, Reference
class OrderingTests(TestCase):
def setUp(self):
self.a1 = Article.objects.create(
... | bsd-3-clause |
bankonme/cjdns | node_build/dependencies/libuv/build/gyp/pylib/gyp/xml_fix.py | 2767 | 2174 | # Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Applies a fix to CR LF TAB handling in xml.dom.
Fixes this: http://code.google.com/p/chromium/issues/detail?id=76293
Working around this: http://bugs.python.or... | gpl-3.0 |
amitsela/incubator-beam | sdks/python/apache_beam/runners/runner.py | 3 | 14562 | #
# 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 |
lnielsen/invenio | invenio/modules/apikeys/__init__.py | 2 | 5437 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2010, 2011, 2013, 2014 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 t... | gpl-2.0 |
MatthewWilkes/reportlab | docs/userguide/ch2a_fonts.py | 1 | 19913 | #Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/docs/userguide/ch2a_fonts.py
from tools.docco.rl_doc_utils import *
from reportlab.lib.codecharts import SingleByteEncodingChart
from reportlab.platypu... | bsd-3-clause |
gangadhar-kadam/hrfrappe | frappe/utils/sel.py | 2 | 4035 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
from selenium.webdriver.common.keys import Keys
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverW... | mit |
NL66278/odoo | addons/hr/__openerp__.py | 47 | 2550 | # -*- 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 |
mitocw/edx-platform | common/lib/xmodule/xmodule/tabs.py | 3 | 23293 | """
Implement CourseTab
"""
import logging
from abc import ABCMeta
import six
from django.core.files.storage import get_storage_class
from six import text_type
from xblock.fields import List
from openedx.core.lib.plugins import PluginError
log = logging.getLogger("edx.courseware")
# Make '_' a no-op so we can scr... | agpl-3.0 |
xzturn/tensorflow | tensorflow/python/ops/candidate_sampling_ops.py | 22 | 18640 | # 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 |
jmhenriques/faunus | src/playground/jmhenriques/scripts/mkinput.py | 1 | 5612 | #!/usr/bin/env python
#
import sys, math, operator, json, ast
#
"""
Masses are correct for the 'free' aminoacids.
Protonated forms should have +1 in mass, but that is irrelevant.
All pKa's taken from Evers_2012_Langmuir_28_11843.
Except the pKa for O-phospho-L-serine (pSE), taken from Zachariou_1996_JPC_100_12680.
"""... | gpl-2.0 |
bnoordhuis/gyp | test/builddir/gyptest-all.py | 50 | 2684 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verify the settings that cause a set of programs to be created in
a specific build directory, and that no intermediate built files
get c... | bsd-3-clause |
andreabedini/PyTables | tables/leaf.py | 5 | 27185 | # -*- coding: utf-8 -*-
########################################################################
#
# License: BSD
# Created: October 14, 2002
# Author: Francesc Alted - faltet@pytables.com
#
# $Id$
#
########################################################################
"""Here is defined the Leaf class."""
from __... | bsd-3-clause |
indashnet/InDashNet.Open.UN2000 | android/external/chromium_org/native_client_sdk/src/tools/tests/fix_deps_test.py | 104 | 2807 | #!/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.
import os
import sys
import tempfile
import unittest
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARENT_DIR = os.path.d... | apache-2.0 |
gsehub/edx-platform | openedx/features/course_experience/tests/views/test_course_home.py | 9 | 24645 | # coding=utf-8
"""
Tests for the course home page.
"""
from datetime import datetime, timedelta
import ddt
import mock
from django.conf import settings
from django.urls import reverse
from django.http import QueryDict
from django.utils.http import urlquote_plus
from django.utils.timezone import now
from pytz import UT... | agpl-3.0 |
sikmir/QGIS | tests/src/python/test_db_manager_spatialite.py | 15 | 26779 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for the DBManager SPATIALITE plugin
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later... | gpl-2.0 |
ds-hwang/chromium-crosswalk | chrome/test/chromedriver/server/server.py | 121 | 2131 | # 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 atexit
import os
import socket
import subprocess
import time
import urllib2
class Server(object):
"""A running ChromeDriver server."""
def __in... | bsd-3-clause |
zfrenchee/pandas | pandas/io/json/normalize.py | 1 | 9164 | # ---------------------------------------------------------------------
# JSON normalization routines
import copy
from collections import defaultdict
import numpy as np
from pandas._libs.lib import convert_json_to_lines
from pandas import compat, DataFrame
def _convert_to_line_delimits(s):
"""Helper function th... | bsd-3-clause |
mastizada/kuma | kuma/demos/feeds.py | 1 | 7456 | import datetime
import json
import validate_jsonp
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.syndication.views import Feed
from django.shortcuts import get_object_or_404
from django.utils.feedgenerator import (Atom1Feed, SyndicationFeed,
... | mpl-2.0 |
soulmachine/scikit-learn | sklearn/manifold/tests/test_locally_linear.py | 41 | 4827 | from itertools import product
from nose.tools import assert_true
import numpy as np
from numpy.testing import assert_almost_equal, assert_array_almost_equal
from scipy import linalg
from sklearn import neighbors, manifold
from sklearn.manifold.locally_linear import barycenter_kneighbors_graph
from sklearn.utils.testi... | bsd-3-clause |
apple/llvm-project | llvm/utils/benchmark/tools/gbench/report.py | 43 | 8300 | """report.py - Utilities for reporting statistics about benchmark results
"""
import os
import re
import copy
class BenchmarkColor(object):
def __init__(self, name, code):
self.name = name
self.code = code
def __repr__(self):
return '%s%r' % (self.__class__.__name__,
... | apache-2.0 |
pshen/ansible | lib/ansible/modules/cloud/amazon/ec2_ami_find.py | 43 | 14185 | #!/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 |
daniel-brettschneider/SiENA | ns-3.26/src/bridge/bindings/modulegen__gcc_LP64.py | 38 | 201909 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-3.0 |
rethinkdb/rethinkdb | test/common/http_support/werkzeug/contrib/iterio.py | 147 | 10718 | # -*- coding: utf-8 -*-
r"""
werkzeug.contrib.iterio
~~~~~~~~~~~~~~~~~~~~~~~
This module implements a :class:`IterIO` that converts an iterator into
a stream object and the other way round. Converting streams into
iterators requires the `greenlet`_ module.
To convert an iterator into a stream... | apache-2.0 |
JoshLabs/django-allauth | allauth/socialaccount/providers/facebook/views.py | 4 | 3604 | import logging
import requests
from django.utils.cache import patch_response_headers
from django.shortcuts import render
from allauth.socialaccount.models import (SocialLogin,
SocialToken)
from allauth.socialaccount.helpers import complete_social_login
from allauth.socialacc... | mit |
javiercantero/streamlink | src/streamlink/packages/flashmedia/box.py | 12 | 31946 | from ctypes import BigEndianStructure, Union, c_uint8, c_uint16, c_uint32
from io import BytesIO
from .compat import *
from .error import *
from .packet import *
from .types import *
from .util import *
class Box(Packet):
exception = F4VError
def __init__(self, type, payload, extended_size=False):
s... | bsd-2-clause |
rrampage/rethinkdb | test/rql_test/connections/http_support/werkzeug/testsuite/routing.py | 145 | 29435 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.routing
~~~~~~~~~~~~~~~~~~~~~~~~~~
Routing tests.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
from werkzeug.testsuite import WerkzeugTestCase
from werkzeug import routing as r
from werkzeu... | agpl-3.0 |
mudbungie/NetExplorer | env/lib/python3.4/site-packages/networkx/classes/tests/test_digraph_historical.py | 75 | 4393 | #!/usr/bin/env python
"""Original NetworkX graph tests"""
from nose.tools import *
import networkx
import networkx as nx
from historical_tests import HistoricalTests
class TestDiGraphHistorical(HistoricalTests):
def setUp(self):
HistoricalTests.setUp(self)
self.G=nx.DiGraph
def test_in_degr... | mit |
thundernet8/WRGameVideos-API | venv/lib/python2.7/site-packages/sqlalchemy/testing/replay_fixture.py | 156 | 5429 | from . import fixtures
from . import profiling
from .. import util
import types
from collections import deque
import contextlib
from . import config
from sqlalchemy import MetaData
from sqlalchemy import create_engine
from sqlalchemy.orm import Session
class ReplayFixtureTest(fixtures.TestBase):
@contextlib.cont... | gpl-2.0 |
GabrielBrascher/cloudstack | tools/marvin/marvin/misc/build/restartMgmt.py | 7 | 1894 | # 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 |
ganugapav/pipe | pipe2py/modules/pipefilter.py | 5 | 4957 | # -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
pipe2py.modules.pipefilter
~~~~~~~~~~~~~~~~~~~~~~~~~~
Provides methods for filtering (including or excluding) items from a feed.
http://pipes.yahoo.com/pipes/docs?doc=operators#Filter
"""
import re
from datetime import datetime as dt
from decima... | gpl-2.0 |
nicoboss/Floatmotion | OpenGL/GL/ARB/tessellation_shader.py | 9 | 5185 | '''OpenGL extension ARB.tessellation_shader
This module customises the behaviour of the
OpenGL.raw.GL.ARB.tessellation_shader to provide a more
Python-friendly API
Overview (from the spec)
This extension introduces new tessellation stages and two new shader types
to the OpenGL primitive processing pipeline. Th... | agpl-3.0 |
r-icarus/openstack_microserver | openstack_dashboard/dashboards/project/network_topology/panel.py | 12 | 1152 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2013 NTT MCL, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# n... | apache-2.0 |
jay3sh/vispy | vispy/visuals/surface_plot.py | 20 | 5503 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
from __future__ import division
import numpy as np
from .mesh import MeshVisual
from ..geometry import MeshData
class SurfacePlotVisual(MeshVisual):
"""Displays a surf... | bsd-3-clause |
kawamuray/ganeti | test/py/ganeti.utils.text_unittest.py | 3 | 23207 | #!/usr/bin/python
#
# Copyright (C) 2011 Google 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 2 of the License, or
# (at your option) any later version.
#
# This program... | gpl-2.0 |
zhaodelong/django | django/contrib/auth/backends.py | 468 | 6114 | from __future__ import unicode_literals
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission
class ModelBackend(object):
"""
Authenticates against settings.AUTH_USER_MODEL.
"""
def authenticate(self, username=None, password=None, **kwargs):
UserMod... | bsd-3-clause |
dslomov/intellij-community | python/helpers/pydev/pydevd_attach_to_process/winappdbg/process.py | 100 | 183637 | #!~/.wine/drive_c/Python25/python.exe
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2014, Mario Vilas
# 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 ... | apache-2.0 |
Captain-Coder/tribler | Tribler/Test/Core/test_sqlitecachedbhandler_votecasts.py | 1 | 3154 | from twisted.internet.defer import inlineCallbacks
from Tribler.Core.CacheDB.SqliteCacheDBHandler import VoteCastDBHandler, ChannelCastDBHandler
from Tribler.Test.Core.test_sqlitecachedbhandler import AbstractDB
class TestVotecastDBHandler(AbstractDB):
@inlineCallbacks
def setUp(self):
yield super(T... | lgpl-3.0 |
mpc-hc/mpc-hc | src/mpc-hc/mpcresources/UpdatePO.py | 21 | 1229 | # (C) 2013, 2015 see Authors.txt
#
# This file is part of MPC-HC.
#
# MPC-HC 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.
#
# MPC-HC... | gpl-3.0 |
yencarnacion/jaikuengine | .google_appengine/lib/django-1.3/tests/regressiontests/forms/localflavor/utils.py | 50 | 2190 | from django.core.exceptions import ValidationError
from django.core.validators import EMPTY_VALUES
from django.test.utils import get_warnings_state, restore_warnings_state
from django.utils.unittest import TestCase
class LocalFlavorTestCase(TestCase):
# NOTE: These are copied from the TestCase Django uses for tes... | apache-2.0 |
fujunwei/chromium-crosswalk | tools/telemetry/third_party/pyserial/serial/win32.py | 155 | 10120 | from ctypes import *
from ctypes.wintypes import HANDLE
from ctypes.wintypes import BOOL
from ctypes.wintypes import LPCWSTR
_stdcall_libraries = {}
_stdcall_libraries['kernel32'] = WinDLL('kernel32')
from ctypes.wintypes import DWORD
from ctypes.wintypes import WORD
from ctypes.wintypes import BYTE
INVALID_HANDLE_VAL... | bsd-3-clause |
PXke/invenio | invenio/legacy/websubmit/web/yourapprovals.py | 4 | 4595 | ## This file is part of Invenio.
## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 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, ... | gpl-2.0 |
aslihandincer/ibis | ibis/compat.py | 6 | 1557 | # Copyright 2015 Cloudera Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | apache-2.0 |
nanuxbe/django | members/admin.py | 1 | 1696 | from datetime import date, timedelta
from django.contrib import admin
from django.utils.formats import localize
from django.utils.html import format_html
from members.models import CorporateMember, DeveloperMember, Invoice
@admin.register(DeveloperMember)
class DeveloperMemberAdmin(admin.ModelAdmin):
list_displ... | bsd-3-clause |
jhd/spunout | venv/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.py | 190 | 36815 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""Implementation of the Metadata for Python packages PEPs.
Supports all metadata formats (1.0, 1.1, 1.2, and 2.0 experimental).
"""
from __future__ import unicode_literals
import codecs
from email... | gpl-3.0 |
wilsoncampusano/gae-boilerplate | bp_includes/lib/facebook.py | 48 | 21573 | #!/usr/bin/env python
#
# Copyright 2010 Facebook
#
# 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... | lgpl-3.0 |
saddingtonbaynes/rez | src/rez/suite.py | 2 | 27304 | from rez.util import create_forwarding_script
from rez.exceptions import SuiteError, ResolvedContextError
from rez.resolved_context import ResolvedContext
from rez.utils.data_utils import cached_property
from rez.utils.formatting import columnise, PackageRequest
from rez.utils.colorize import warning, critical, Printer... | gpl-3.0 |
JGulbronson/rmc | models/course_alert.py | 8 | 5092 | import datetime
import json
import mongoengine as me
import requests
import course
import rmc.shared.secrets as s
import section
from rmc.shared import util
class BaseCourseAlert(me.Document):
"""An abstract base class for notifying when a seat opens in a course.
Subclasses must define the behaviour for se... | mit |
BobCromwell/gyp | test/mac/gyptest-sourceless-module.py | 200 | 2485 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that bundles that have no 'sources' (pure resource containers) work.
"""
import TestGyp
import sys
if sys.platform == 'darwi... | bsd-3-clause |
arangodb/arangodb | 3rdParty/V8/v7.9.317/test/message/testcfg.py | 4 | 3638 | # Copyright 2008 the V8 project authors. 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... | apache-2.0 |
nightscout/process-controls | source/conf.py | 1 | 8556 | # -*- coding: utf-8 -*-
#
# Nightscout process documentation build configuration file, created by
# sphinx-quickstart on Sun Jan 11 17:45:10 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 ... | agpl-3.0 |
wkoathp/glance | doc/source/conf.py | 13 | 8643 | # -*- coding: utf-8 -*-
# Copyright (c) 2010 OpenStack Foundation.
#
# 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 app... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.