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 |
|---|---|---|---|---|---|
marcstreeter/ChatterBlog | app/shared/error.py | 1 | 1203 |
class Errors(Exception):
__status_code = 400
__error_cat = "General Error"
__default_message = "System Error Occurred"
def __init__(self, message=None, status_code=None, payload=None):
Exception.__init__(self)
self.category = self.__error_cat
self.message = message or self.__d... | apache-2.0 |
xaviercobain88/framework-python | build/lib.linux-i686-2.7/openerp/addons/account/project/wizard/account_analytic_cost_ledger_report.py | 56 | 2042 | # -*- 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 |
HireAnEsquire/django-rest-framework | rest_framework/versioning.py | 81 | 6651 | # coding: utf-8
from __future__ import unicode_literals
import re
from django.utils.translation import ugettext_lazy as _
from rest_framework import exceptions
from rest_framework.compat import unicode_http_header
from rest_framework.reverse import _reverse
from rest_framework.settings import api_settings
from rest_... | bsd-2-clause |
MattsFleaMarket/python-for-android | python-modules/twisted/twisted/test/test_adbapi.py | 49 | 26501 | # Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for twisted.enterprise.adbapi.
"""
from twisted.trial import unittest
import os, stat, new
from twisted.enterprise.adbapi import ConnectionPool, ConnectionLost, safe
from twisted.enterprise.adbapi import Connection, Transac... | apache-2.0 |
p4datasystems/CarnotKE | jyhton/lib-python/2.7/test/test_generators.py | 72 | 50768 | tutorial_tests = """
Let's try a simple generator:
>>> def f():
... yield 1
... yield 2
>>> for i in f():
... print i
1
2
>>> g = f()
>>> g.next()
1
>>> g.next()
2
"Falling off the end" stops the generator:
>>> g.next()
Traceback (most recent call la... | apache-2.0 |
lokeshjindal15/gem5_transform | tests/configs/pc-simple-timing.py | 52 | 2346 | # Copyright (c) 2012 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | bsd-3-clause |
ruibarreira/linuxtrail | usr/lib/python2.7/encodings/cp500.py | 593 | 13377 | """ Python Character Mapping Codec cp500 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP500.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... | gpl-3.0 |
Senseg/Py4A | python3-alpha/extra_modules/pyxmpp2/mainloop/glib.py | 46 | 12001 | #
# (C) Copyright 2011 Jacek Konieczny <jajcus@jajcus.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License Version
# 2.1 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful... | apache-2.0 |
easycoin-core/Easycoin | qa/rpc-tests/p2p-segwit.py | 9 | 92403 | #!/usr/bin/env python3
# Copyright (c) 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.
from test_framework.mininode import *
from test_framework.test_framework import BitcoinTestFramework
from test... | mit |
FrancescAlted/blaze | blaze/io/server/crossdomain.py | 6 | 1834 | from __future__ import absolute_import, division, print_function
from datetime import timedelta
from flask import make_response, request, current_app
from functools import update_wrapper
from ... import py2help
def crossdomain(origin=None, methods=None, headers=None,
automatic_headers=True,
... | bsd-3-clause |
eduNEXT/edx-platform | cms/djangoapps/contentstore/management/commands/sync_courses.py | 3 | 2362 | """
Sync courses from catalog service. This is used to setup a master's
integration environment.
"""
import logging
from textwrap import dedent
from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user
from django.core.management.base import BaseCommand, CommandError
from opaque_... | agpl-3.0 |
doordash/realms-wiki | realms/modules/github/views.py | 1 | 1935 | from flask import (
current_app, render_template, redirect, Blueprint, flash, url_for, g
)
from flask.ext.github import GitHubError
from flask.ext.login import login_user, logout_user
from realms import github
from realms.modules.github.models import User
blueprint = Blueprint('github', __name__)
@blueprint.rout... | gpl-2.0 |
gsehub/edx-platform | lms/djangoapps/discussion_api/tests/test_permissions.py | 9 | 5119 | """
Tests for discussion API permission logic
"""
import itertools
import ddt
from nose.plugins.attrib import attr
from discussion_api.permissions import (
can_delete,
get_editable_fields,
get_initializable_comment_fields,
get_initializable_thread_fields
)
from lms.lib.comment_client.comment import Co... | agpl-3.0 |
jsoref/django | tests/template_backends/test_jinja2.py | 315 | 3048 | # Since this package contains a "jinja2" directory, this is required to
# silence an ImportWarning warning on Python 2.
from __future__ import absolute_import
from unittest import skipIf
from django.template import TemplateSyntaxError
from .test_dummy import TemplateStringsTests
try:
import jinja2
except Import... | bsd-3-clause |
juharris/tensorflow | tensorflow/contrib/metrics/python/ops/confusion_matrix_ops.py | 5 | 4520 | # 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 |
simonmikkelsen/facebook-downloader | fbdownload/groupdownloader.py | 1 | 2371 | from fbdownload.downloader import FacebookDownloader
class FacebookGroupDownloader(FacebookDownloader):
'''
Downloads data from a Facebook group, including events.
Images are not downloaded.
In this package of classes, that is done by the
FacebookHtmlExporter, even though a stand alone download
function wo... | mit |
mpeuster/estate | experiments/scaleability-fixed/pox/pox/info/switch_info.py | 46 | 2469 | # Copyright 2013 James McCauley
#
# 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 writi... | apache-2.0 |
samtx/whatsmyrankine | venv/lib/python2.7/site-packages/setuptools/command/bdist_egg.py | 286 | 18718 | """setuptools.command.bdist_egg
Build .egg distributions"""
# This module should be kept compatible with Python 2.3
import sys, os, marshal
from setuptools import Command
from distutils.dir_util import remove_tree, mkpath
try:
# Python 2.7 or >=3.2
from sysconfig import get_path, get_python_version
def _g... | mit |
liu602348184/django | docs/conf.py | 188 | 11919 | # -*- coding: utf-8 -*-
#
# Django documentation build configuration file, created by
# sphinx-quickstart on Thu Mar 27 09:06:53 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleab... | bsd-3-clause |
EclecticIQ/OpenTAXII | opentaxii/taxii/services/collection_management.py | 2 | 2914 | from libtaxii.constants import (
SVC_COLLECTION_MANAGEMENT,
MSG_COLLECTION_INFORMATION_REQUEST, MSG_FEED_INFORMATION_REQUEST,
MSG_MANAGE_COLLECTION_SUBSCRIPTION_REQUEST,
MSG_MANAGE_FEED_SUBSCRIPTION_REQUEST,
)
from .abstract import TAXIIService
from .handlers import (
CollectionInformationRequestHa... | bsd-3-clause |
bmanojlovic/ansible | lib/ansible/modules/cloud/vmware/vmware_dvs_portgroup.py | 32 | 6998 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Joseph Callen <jcallen () csc.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 Li... | gpl-3.0 |
chand3040/cloud_that | lms/djangoapps/shoppingcart/models.py | 16 | 89388 | """ Models for the shopping cart and assorted purchase types """
from collections import namedtuple
from datetime import datetime
from datetime import timedelta
from decimal import Decimal
import json
import analytics
from io import BytesIO
from django.db.models import Q
import pytz
import logging
import smtplib
impor... | agpl-3.0 |
djeo94/CouchPotatoServer | couchpotato/core/notifications/nmj.py | 75 | 4379 | import re
import telnetlib
from couchpotato.api import addApiView
from couchpotato.core.event import addEvent
from couchpotato.core.helpers.encoding import tryUrlencode
from couchpotato.core.logger import CPLog
from couchpotato.core.notifications.base import Notification
try:
import xml.etree.cElementTree as etr... | gpl-3.0 |
42cc/p2psafety | p2psafety_django/events/jabber/clients.py | 1 | 9829 | import logging
import traceback
import threading
from contextlib import contextmanager
from django.conf import settings
from django.contrib.auth.models import User
from django.core.exceptions import ImproperlyConfigured
from sleekxmpp import ClientXMPP
from sleekxmpp.exceptions import IqError, IqTimeout
from sleekxmp... | apache-2.0 |
maruen/yowsup.jlguardi | yowsup/layers/axolotl/store/sqlite/liteaxolotlstore.py | 17 | 3414 | from axolotl.state.axolotlstore import AxolotlStore
from .liteidentitykeystore import LiteIdentityKeyStore
from .liteprekeystore import LitePreKeyStore
from .litesessionstore import LiteSessionStore
from .litesignedprekeystore import LiteSignedPreKeyStore
from .litesenderkeystore import LiteSenderKeyStore
import sqlite... | gpl-3.0 |
keakon/gunicorn | setup.py | 12 | 2916 | # -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
import os
import sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
from gunicorn import __version__
CLASSIFIERS = [
'Development S... | mit |
QianBIG/odoo | addons/account_analytic_plans/account_analytic_plans.py | 143 | 23352 | # -*- 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 |
plaes/pelican-toc | test_toc.py | 1 | 3458 | from io import open
import unittest
import re
import toc
from pelican.readers import MarkdownReader
from pelican.contents import Article
from pelican.tests.support import get_settings
class TestToCGeneration(unittest.TestCase):
@classmethod
def setUpClass(cls):
toc.init_default_config(None)
... | gpl-2.0 |
tastynoodle/django | tests/utils_tests/test_html.py | 5 | 8266 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import datetime
import os
from unittest import TestCase
from django.utils import html
from django.utils._os import upath
from django.utils.encoding import force_text
class TestUtilsHtml(TestCase):
def check_output(self, function, val... | bsd-3-clause |
ramitsurana/boto | tests/unit/cloudtrail/test_layer1.py | 91 | 2731 | #!/usr/bin/env python
import json
from boto.cloudtrail.layer1 import CloudTrailConnection
from tests.unit import AWSMockServiceTestCase
class TestDescribeTrails(AWSMockServiceTestCase):
connection_class = CloudTrailConnection
def default_body(self):
return b'''
{"trailList":
... | mit |
Scarygami/mirror-api-examples | colours-of-the-world/lib/oauth2client/tools.py | 46 | 6819 | # Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | apache-2.0 |
Johnetordoff/osf.io | api_tests/registrations/views/test_registration_linked_nodes.py | 11 | 15618 | import pytest
from api.base.settings.defaults import API_BASE
from framework.auth.core import Auth
from api_tests.utils import disconnected_from_listeners
from website.project.signals import contributor_removed
from osf_tests.factories import (
NodeFactory,
AuthUserFactory,
RegistrationFactory
)
@pytest.... | apache-2.0 |
rameshthoomu/fabric | bddtests/peer/peer_pb2_grpc.py | 17 | 1504 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from grpc.framework.common import cardinality
from grpc.framework.interfaces.face import utilities as face_utilities
import peer.proposal_pb2 as peer_dot_proposal__pb2
import peer.proposal_response_pb2 as peer_dot_proposal__response__pb2... | apache-2.0 |
yuezh/azure-linux-extensions | OSPatching/azure/servicemanagement/__init__.py | 46 | 65202 | #-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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.apac... | apache-2.0 |
GeographicaGS/Medinageoportal | data_tools/config.py | 1 | 34005 | # -*- coding: utf-8 -*-
import os
dataPath = "/Users/alasarr/dev/Medinageoportal/data_tools/data/nador"
config = {
"path_input": os.path.join(dataPath,"input"),
"path_output": os.path.join(dataPath,"output"),
"shapepath" : "data/nador",
"mapfile_output_prefix":"nador_",
"date":"01/01/2006",
"layers":
[
{
"... | gpl-3.0 |
home-assistant/home-assistant | tests/helpers/test_discovery.py | 6 | 6983 | """Test discovery helpers."""
from unittest.mock import patch
from homeassistant import setup
from homeassistant.core import callback
from homeassistant.helpers import discovery
from homeassistant.helpers.dispatcher import dispatcher_send
from homeassistant.util.async_ import run_callback_threadsafe
from tests.common... | apache-2.0 |
joergdietrich/astropy | astropy/vo/client/async.py | 3 | 2515 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Asynchronous VO service requests."""
from __future__ import absolute_import, division, print_function, unicode_literals
# LOCAL
from ...utils.compat.futures import ThreadPoolExecutor
from ...utils.decorators import deprecated
__all__ = ['AsyncBase']
... | bsd-3-clause |
fangxingli/hue | desktop/core/ext-py/cryptography-1.3.1/src/_cffi_src/openssl/bio.py | 7 | 5009 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
INCLUDES = """
#include <openssl/bio.h>
"""
TYPES = """
typedef struct b... | apache-2.0 |
Bernardo-MG/CWR-WebClient | cwr_webclient/report/mera.py | 2 | 8673 | # -*- encoding: utf-8 -*-
import StringIO
import xlsxwriter
"""
Web app module.
"""
__author__ = 'Bernardo Martínez Garrido'
__license__ = 'MIT'
__status__ = 'Development'
def generate_match_report_excel(matches, filename):
output = StringIO.StringIO()
workbook = xlsxwriter.Workbook(output, {'in_memory': ... | mit |
Jorge-Rodriguez/ansible | lib/ansible/module_utils/facts/virtual/freebsd.py | 31 | 2052 | # 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 |
proxysh/Safejumper-for-Desktop | buildmac/Resources/env/lib/python2.7/site-packages/twisted/trial/test/test_keyboard.py | 16 | 4036 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for interrupting tests with Control-C.
"""
from __future__ import absolute_import, division
from twisted.python.compat import NativeStringIO
from twisted.trial import unittest
from twisted.trial import reporter, runner
class TrialTe... | gpl-2.0 |
gengliangwang/spark | python/pyspark/tests/test_serializers.py | 15 | 9192 | #
# 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 |
grlee77/numpy | setup.py | 1 | 18343 | #!/usr/bin/env python3
""" NumPy is the fundamental package for array computing with Python.
It provides:
- a powerful N-dimensional array object
- sophisticated (broadcasting) functions
- tools for integrating C/C++ and Fortran code
- useful linear algebra, Fourier transform, and random number capabilities
- and muc... | bsd-3-clause |
anbasile/flask_sample | flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/langhungarianmodel.py | 2763 | 12536 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | mit |
witgo/spark | python/pyspark/mllib/random.py | 22 | 19517 | #
# 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 |
WillieMaddox/numpy | numpy/distutils/command/build_src.py | 141 | 32258 | """ Build swig, f2py, pyrex sources.
"""
from __future__ import division, absolute_import, print_function
import os
import re
import sys
import shlex
import copy
from distutils.command import build_ext
from distutils.dep_util import newer_group, newer
from distutils.util import get_platform
from distutils.errors impo... | bsd-3-clause |
BonexGu/Blik2D-SDK | Blik2D/addon/opencv-3.1.0_for_blik/samples/python/color_histogram.py | 5 | 1373 | #!/usr/bin/env python
'''
Video histogram sample to show live histogram of video
Keys:
ESC - exit
'''
import numpy as np
import cv2
# built-in modules
import sys
# local modules
import video
if __name__ == '__main__':
hsv_map = np.zeros((180, 256, 3), np.uint8)
h, s = np.indices(hsv_map.shape[:2]... | mit |
github-borat/cinder | cinder/volume/rpcapi.py | 4 | 7290 | # Copyright 2012, Intel, 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 agree... | apache-2.0 |
tengyifei/grpc | examples/python/helloworld/run_codegen.py | 10 | 1765 | # 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 |
coxmediagroup/googleads-python-lib | examples/dfp/v201411/company_service/get_all_companies.py | 4 | 2020 | #!/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 |
businesstep/blogger | vendor/doctrine/orm/docs/en/conf.py | 2448 | 6497 | # -*- coding: utf-8 -*-
#
# Doctrine 2 ORM documentation build configuration file, created by
# sphinx-quickstart on Fri Dec 3 18:10:24 2010.
#
# 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.
... | mit |
mruffalo/sysv_ipc | tests/test_message_queues.py | 1 | 14661 | # Python imports
# Don't add any from __future__ imports here. This code should execute
# against standard Python.
import unittest
import time
import os
# Project imports
import sysv_ipc
# Hack -- add tests directory to sys.path so Python 3 can find base.py.
import sys
sys.path.insert(0, os.path.join(os.getcwd(), 'tes... | bsd-3-clause |
jamilatta/scielo-manager | scielomanager/journalmanager/context_processors.py | 2 | 2205 | # coding: utf-8
from django.conf import settings
from journalmanager import models
from maintenancewindow import models as maintenance_models
def dynamic_template_inheritance(request):
"""
Changes between base_lv0.html e base_lv1.html
"""
if request.GET.get('popup', None):
return {'dynamic_tpl... | bsd-2-clause |
tadebayo/myedge | myvenv/Lib/encodings/cp863.py | 272 | 34252 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP863.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors='strict'):
... | mit |
throwable-one/lettuce | tests/integration/lib/Django-1.3/django/contrib/localflavor/pe/forms.py | 309 | 2272 | # -*- coding: utf-8 -*-
"""
PE-specific Form helpers.
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import RegexField, CharField, Select
from django.utils.translation import ugettext_lazy as _
class PERegionSelect(Select):
"""
A Select wi... | gpl-3.0 |
inspyration/odoo | addons/website_forum/tests/test_forum.py | 87 | 7632 | # -*- coding: utf-8 -*-
from openerp.addons.website_forum.tests.common import KARMA, TestForumCommon
from openerp.addons.website_forum.models.forum import KarmaError
from openerp.exceptions import Warning, AccessError
from openerp.tools import mute_logger
class TestForum(TestForumCommon):
@mute_logger('openerp.... | agpl-3.0 |
mvaled/OpenUpgrade | addons/product_margin/wizard/product_margin.py | 338 | 3457 | # -*- 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 |
nypl-spacetime/oldnyc | viewer/simplejson/tests/test_pass1.py | 259 | 1903 | from unittest import TestCase
import simplejson as json
# from http://json.org/JSON_checker/test/pass1.json
JSON = r'''
[
"JSON Test Pattern pass1",
{"object with 1 member":["array with 1 element"]},
{},
[],
-42,
true,
false,
null,
{
"integer": 1234567890,
"real": -... | apache-2.0 |
newsteinking/docker | tests/lib/test_lib.py | 48 | 1899 | """Test the test support."""
from __future__ import absolute_import
import filecmp
import re
from os.path import join, isdir
from tests.lib import SRC_DIR
def test_tmp_dir_exists_in_env(script):
"""
Test that $TMPDIR == env.temp_path and path exists and env.assert_no_temp()
passes (in fast env)
"""
... | mit |
onceuponatimeforever/oh-mainline | vendor/packages/django-tastypie/tastypie/fields.py | 20 | 32548 | from __future__ import unicode_literals
import datetime
from dateutil.parser import parse
from decimal import Decimal
import re
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
from django.utils import datetime_safe, importlib
from django.utils import six
from tastypie.bundle import Bundle... | agpl-3.0 |
dodger487/MIST | data/baselines.py | 1 | 1444 | # Chris Riederer
# Google, Inc
# 2014-08-15
"""Record baselines and show improvements for working on magnet"""
import test_detect as t
import glob
cleanedList = t.GetRunDataFromArgs(glob.glob('cleaned/*.json'))
snipList = t.GetRunDataFromArgs(glob.glob('snips/*.json'))
decalCleanedList = t.GetRunDataFromArgs(glob.... | apache-2.0 |
aioue/ansible | lib/ansible/modules/packaging/language/pear.py | 70 | 7380 | #!/usr/bin/python -tt
# -*- coding: utf-8 -*-
# (c) 2012, Afterburn <http://github.com/afterburn>
# (c) 2013, Aaron Bull Schaefer <aaron@elasticdog.com>
# (c) 2015, Jonathan Lestrelin <jonathan.lestrelin@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# i... | gpl-3.0 |
cloudfoundry/php-buildpack-legacy | builds/runtimes/python-2.7.6/lib/python2.7/lib2to3/patcomp.py | 304 | 7091 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Pattern compiler.
The grammer is taken from PatternGrammar.txt.
The compiler compiles a pattern to a pytree.*Pattern instance.
"""
__author__ = "Guido van Rossum <guido@python.org>"
# Python imports
import os
imp... | mit |
marcuskelly/recover | Lib/site-packages/werkzeug/contrib/limiter.py | 365 | 1334 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.limiter
~~~~~~~~~~~~~~~~~~~~~~~~
A middleware that limits incoming data. This works around problems with
Trac_ or Django_ because those directly stream into the memory.
.. _Trac: http://trac.edgewall.org/
.. _Django: http://www.djangoproject.com/
... | bsd-2-clause |
sasukeh/neutron | neutron/tests/unit/agent/linux/test_keepalived.py | 15 | 11362 | # Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# 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 applicabl... | apache-2.0 |
bollu/vispy | examples/demo/gloo/shadertoy.py | 18 | 11859 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vispy: gallery 2, testskip
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Shadertoy demo. You can copy-paste shader code from an example on
www.shadertoy.com and get the demo.
TODO: support cub... | bsd-3-clause |
eternalthinker/flask-server-rq-example | venv/lib/python2.7/site-packages/pip/_vendor/requests/auth.py | 120 | 6669 | # -*- coding: utf-8 -*-
"""
requests.auth
~~~~~~~~~~~~~
This module contains the authentication handlers for Requests.
"""
import os
import re
import time
import hashlib
from base64 import b64encode
from .compat import urlparse, str
from .cookies import extract_cookies_to_jar
from .utils import parse_dict_header, ... | apache-2.0 |
argivaitv/argivaitv | plugin.video.salts/scrapers/furk_scraper.py | 1 | 10706 | """
SALTS XBMC Addon
Copyright (C) 2014 tknorris
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.
T... | gpl-2.0 |
cgwalters/gnome-ostree | src/ostbuild/pyostbuild/builtin_deploy_qemu.py | 3 | 2370 | # Copyright (C) 2012 Colin Walters <walters@verbum.org>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# Thi... | lgpl-2.1 |
KrzysztofStachanczyk/Sensors-WWW-website | www/env/lib/python2.7/site-packages/django/conf/urls/__init__.py | 133 | 3546 | import warnings
from importlib import import_module
from django.core.exceptions import ImproperlyConfigured
from django.urls import (
LocaleRegexURLResolver, RegexURLPattern, RegexURLResolver,
)
from django.utils import six
from django.utils.deprecation import RemovedInDjango20Warning
__all__ = ['handler400', 'ha... | gpl-3.0 |
gylian/sickbeard | bs4/__init__.py | 82 | 12936 | """Beautiful Soup
Elixir and Tonic
"The Screen-Scraper's Friend"
http://www.crummy.com/software/BeautifulSoup/
Beautiful Soup uses a pluggable XML or HTML parser to parse a
(possibly invalid) document into a tree representation. Beautiful Soup
provides provides methods and Pythonic idioms that make it easy to
navigate... | gpl-3.0 |
alfonsokim/nupic | tests/external/testfixture_test.py | 15 | 1744 | # ----------------------------------------------------------------------
# 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 apply:
#
# This progra... | agpl-3.0 |
thefinn93/CouchPotatoServer | libs/requests/packages/chardet/mbcharsetprober.py | 215 | 3182 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | gpl-3.0 |
BeyondTheClouds/nova | nova/tests/unit/virt/vmwareapi/test_vif.py | 6 | 14654 | # Copyright 2013 Canonical Corp.
# 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 ... | apache-2.0 |
ff94315/hiwifi-openwrt-HC5661-HC5761 | staging_dir/host/lib/scons-2.1.0/SCons/Tool/javac.py | 21 | 8571 | """SCons.Tool.javac
Tool-specific initialization for javac.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Founda... | gpl-2.0 |
Codefans-fan/odoo | addons/marketing_campaign/marketing_campaign.py | 286 | 41776 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2013 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... | agpl-3.0 |
nickmain/pyswip | pyswip/core.py | 8 | 32565 | # -*- coding: utf-8 -*-
# pyswip -- Python SWI-Prolog bridge
# Copyright (c) 2007-2012 Yüce Tekol
#
# 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 ... | mit |
cod3monk/kerncraft | kerncraft/prefixedunit.py | 2 | 6289 | #!/usr/bin/env python3
import re
from ruamel import yaml
class PrefixedUnit(yaml.YAMLObject):
PREFIXES = {'k': 1e3, 'M': 1e6, 'G': 1e9, 'T': 1e13, 'P': 1e16, 'E': 1e19, 'Z': 1e21, 'Y': 1e24,
'': 1}
yaml_loader = yaml.Loader
yaml_dumper = yaml.Dumper
yaml_tag = u'!prefixed'
yaml_... | agpl-3.0 |
yupasik/AT | Tests/NPKT/manual_upd2.py | 1 | 1536 | import os
import sys
modeules_path = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
sys.path.append(modeules_path)
from Devices.application import Application
test = os.path.split(os.path.dirname(os.path.abspath(__file__)))[-1]
print(test)
testintex = 2
testscript = os.path.basename(os.path.abspath(__fil... | apache-2.0 |
blockstack/packaging | imported/future/src/future/backports/xmlrpc/server.py | 82 | 37285 | r"""
Ported using Python-Future from the Python 3.3 standard library.
XML-RPC Servers.
This module can be used to create simple XML-RPC servers
by creating a server and either installing functions, a
class instance, or by extending the SimpleXMLRPCServer
class.
It can also be used to handle XML-RPC requests in a CGI... | gpl-3.0 |
40223201/40223201 | static/Brython3.1.1-20150328-091302/Lib/_random.py | 518 | 2451 | from browser import window
def _randint(a, b):
return int(window.Math.random()*(b-a+1)+a)
def _urandom(n):
"""urandom(n) -> str
Return n random bytes suitable for cryptographic use."""
randbytes= [_randint(0,255) for i in range(n)]
return bytes(randbytes)
class Random:
"""Random n... | gpl-3.0 |
Johnzero/erp | openerp/addons/hr_payroll/wizard/hr_payroll_contribution_register_report.py | 9 | 2115 | # -*- 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 |
maxlit/pyEdgeworthBox | pyEdgeworthBox/pyEdgeworthBox.py | 1 | 10602 | import numpy as np
import matplotlib.pyplot as plt
from math import sqrt, copysign
from scipy.optimize import brenth
from scipy.optimize import fsolve,fmin_l_bfgs_b,fmin_cg,fminbound
"""
sign of the number
"""
def sign(x):
if x==0:
return 0
else:
return copysign(1,x)
"""
if function f can't b... | mit |
salilab/rmf | tools/dev_tools/test/test_cpp_format.py | 3 | 9735 | import unittest
import os
import sys
import utils
TOPDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.insert(0, TOPDIR)
try:
from python_tools import cpp_format
finally:
del sys.path[0]
from pygments import token
# Tokens we'd expect to see in an OK header
ok_header_tokens = [
... | apache-2.0 |
lmprice/ansible | lib/ansible/modules/remote_management/ucs/ucs_wwn_pool.py | 49 | 8651 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
dmccloskey/SBaaS_LIMS | SBaaS_LIMS/lims_msMethod_query.py | 1 | 27469 | # sbaas
from .lims_msMethod_postgresql_models import *
from SBaaS_base.postgresql_dataType_converter import postgresql_dataType_converter
from SBaaS_base.sbaas_base_query_update import sbaas_base_query_update
from SBaaS_base.sbaas_base_query_drop import sbaas_base_query_drop
from SBaaS_base.sbaas_base_query_initialize... | mit |
flh/odoo | addons/website_sale/models/sale_order.py | 8 | 10376 | # -*- coding: utf-8 -*-
import random
from openerp import SUPERUSER_ID
from openerp.osv import osv, orm, fields
from openerp.addons.web.http import request
class payment_transaction(orm.Model):
_inherit = 'payment.transaction'
_columns = {
# link with the sale order
'sale_order_id': fields.m... | agpl-3.0 |
errx/django | tests/m2m_and_m2o/tests.py | 61 | 2463 | from django.db.models import Q
from django.test import TestCase
from .models import Issue, User, UnicodeReferenceModel
class RelatedObjectTests(TestCase):
def test_m2m_and_m2o(self):
r = User.objects.create(username="russell")
g = User.objects.create(username="gustav")
i1 = Issue(num=1)
... | bsd-3-clause |
vrv/tensorflow | tensorflow/python/saved_model/constants.py | 114 | 1994 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
steveklabnik/servo | tests/jquery/run_jquery.py | 215 | 9582 | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import re
import subprocess
import sys
import BaseHTTPServer
import SimpleHTTPServer
im... | mpl-2.0 |
Almad/sneakylang | sneakylang/test/test_register.py | 2 | 5586 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Test context-sensitive Parser registry.
"""
from unittest import TestCase
#logging.basicConfig(level=logging.DEBUG)
from sneakylang.register import *
from sneakylang.macro import Macro
from sneakylang.parser import Parser
from sneakylang.treebuilder import TreeBuil... | bsd-3-clause |
openstack/sahara | sahara/cli/image_pack/api.py | 1 | 4206 | # Copyright 2015 Red Hat, 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, s... | apache-2.0 |
rit-sse/openbci | openbci_2015/scripts/udp_server.py | 6 | 2039 | """A server that handles a connection with an OpenBCI board and serves that
data over both a UDP socket server and a WebSocket server.
Requires:
- pyserial
- asyncio
- websockets
"""
import argparse
import cPickle as pickle
import json
import sys; sys.path.append('..') # help python find open_bci_v3.py relative... | mit |
js0701/chromium-crosswalk | tools/metrics/histograms/extract_histograms.py | 40 | 16108 | # 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.
"""Extract histogram names from the description XML file.
For more information on the format of the XML file, which is self-documenting,
see histograms.xml;... | bsd-3-clause |
arborh/tensorflow | tensorflow/python/eager/remote_benchmarks_test.py | 4 | 6795 | # Copyright 2019 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 |
FusionSP/android_external_chromium_org | tools/python/google/platform_utils_mac.py | 183 | 5676 | # Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Platform-specific utility methods shared by several scripts."""
import os
import subprocess
import google.path_utils
class PlatformUtility(object)... | bsd-3-clause |
plesiv/hac | hac/util_data.py | 1 | 10044 | # -*- coding: utf-8 -*-
"""Utilities for application plugin-system.
NOTE: for simplicity, language and runner templates are referred to as plug-ins
in this file (along with site plug-ins).
"""
import imp
import os
import sys
import re
import requests
from string import Template
from difflib import SequenceMatche... | gpl-2.0 |
tarthy6/dozer-thesis | py/tests/shapepack.py | 3 | 4138 | # encoding: utf-8
# 2013 © Václav Šmilauer <eu@doxos.eu>
import unittest
from minieigen import *
import woo._customConverters
import woo.core
import woo.dem
import woo.utils
import math
from woo.dem import *
class TestShapePack(unittest.TestCase):
# def setUp(self):
def testLoadSampleTxt(self):
'ShapePack: load s... | gpl-2.0 |
echanna/EdxNotAFork | lms/djangoapps/django_comment_client/tests.py | 69 | 2053 | import string # pylint: disable=W0402
import random
from django.contrib.auth.models import User
from django.test import TestCase
from student.models import CourseEnrollment
from django_comment_client.permissions import has_permission
from django_comment_common.models import Role
class PermissionsTestCase(Test... | agpl-3.0 |
defance/edx-platform | lms/djangoapps/class_dashboard/tests/test_dashboard_data.py | 88 | 13672 | """
Tests for class dashboard (Metrics tab in instructor dashboard)
"""
import json
from django.core.urlresolvers import reverse
from django.test.client import RequestFactory
from mock import patch
from nose.plugins.attrib import attr
from capa.tests.response_xml_factory import StringResponseXMLFactory
from coursewa... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.