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 |
|---|---|---|---|---|---|
arnavd96/Cinemiezer | myvenv/lib/python3.4/site-packages/future/utils/surrogateescape.py | 59 | 6084 | """
This is Victor Stinner's pure-Python implementation of PEP 383: the "surrogateescape" error
handler of Python 3.
Source: misc/python/surrogateescape.py in https://bitbucket.org/haypo/misc
"""
# This code is released under the Python license and the BSD 2-clause license
import codecs
import sys
from future impor... | mit |
peterbe/grymt | grymt.py | 1 | 13942 | #!/usr/bin/env python
import codecs
import datetime
import hashlib
import os
import re
import shutil
import subprocess
import cssmin
import jsmin
build_inline_regex = re.compile(
'(<\!--\s*build:(include)\s+([\w\$\-\./]*)\s*-->)',
re.MULTILINE | re.DOTALL
)
build_regex = re.compile(
'(<\!--\s*build:(\w+... | mpl-2.0 |
carnell69/kuma | vendor/packages/pyflakes/messages.py | 34 | 3741 | """
Provide the class Message and its subclasses.
"""
class Message(object):
message = ''
message_args = ()
def __init__(self, filename, loc):
self.filename = filename
self.lineno = loc.lineno
self.col = getattr(loc, 'col_offset', 0)
def __str__(self):
return '%s:%s: ... | mpl-2.0 |
NeovaHealth/odoo | openerp/service/wsgi_server.py | 335 | 9490 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011-2012 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 |
arista-eosplus/ansible-modules-extras | cloud/amazon/ec2_win_password.py | 62 | 4838 | #!/usr/bin/python
DOCUMENTATION = '''
---
module: ec2_win_password
short_description: gets the default administrator password for ec2 windows instances
description:
- Gets the default administrator password from any EC2 Windows instance. The instance is referenced by its id (e.g. i-XXXXXXX). This module has a dep... | gpl-3.0 |
pratapvardhan/pandas | asv_bench/benchmarks/reshape.py | 3 | 3829 | from itertools import product
import numpy as np
from pandas import DataFrame, MultiIndex, date_range, melt, wide_to_long
from .pandas_vb_common import setup # noqa
class Melt(object):
goal_time = 0.2
def setup(self):
self.df = DataFrame(np.random.randn(10000, 3), columns=['A', 'B', 'C'])
... | bsd-3-clause |
carmine/open-kilda | services/topology-engine/queue-engine/tests/smoke-tests/deploy-flow-rules.py | 2 | 1675 | #!/usr/bin/env python
# Copyright 2017 Telstra Open Source
#
# 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 ... | apache-2.0 |
scripnichenko/nova | nova/tests/unit/keymgr/test_not_implemented_key_mgr.py | 79 | 1697 | # Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory
# 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/... | apache-2.0 |
anthonyfok/frescobaldi | frescobaldi_app/toplevel.py | 5 | 1156 | # This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2008 - 2014 by Wilbert Berendsen
#
# 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
... | gpl-2.0 |
currychou/1 | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/SDL.py | 603 | 1813 | from browser import document
SDL_INIT_VIDEO=0
SDL_GL_DOUBLEBUFFER=1
SDL_GL_DEPTH_SIZE=2
SDL_DOUBLEBUF=3
SDL_ANYFORMAT=4
SDL_ACTIVEEVENT=5
SDL_ALLEVENTS=5
SDL_KEYDOWN=6
SDL_KEYUP=7
SDL_MOUSEMOTION=8
SDL_MOUSEBUTTONDOWN=9
SDL_MOUSEBUTTONUP=10
SDL_JOYAXISMOTION=11
SDL_JOYBALLMOTION=12
SDL_JOYHATMOTION=13
SDL_JOYBUTTON... | gpl-3.0 |
CubicERP/odoo | addons/fleet/fleet.py | 266 | 46376 | # -*- 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 |
jehutting/kivy | examples/widgets/carousel_buttons.py | 40 | 1031 | '''
Carousel example with button inside.
This is a tiny test for testing the scroll distance/timeout
And ensure the down/up are dispatched if no gesture is done.
'''
from kivy.uix.carousel import Carousel
from kivy.uix.gridlayout import GridLayout
from kivy.app import App
from kivy.lang import Builder
Builder.load_str... | mit |
tivek/conan | conans/test/integration/install_selected_packages_test.py | 3 | 4982 | import unittest
from conans.test.utils.tools import TestClient, TestServer
import os
from conans.test.utils.cpp_test_files import cpp_hello_conan_files
from conans.paths import CONANFILE
from conans.model.ref import ConanFileReference, PackageReference
from conans.util.files import load
class InstallSelectedPackagesT... | mit |
h-hirokawa/ansible | lib/ansible/plugins/connection/lxc.py | 12 | 7870 | # (c) 2015, Joerg Thalheim <joerg@higgsboson.tk>
#
# 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 ve... | gpl-3.0 |
passiweinberger/nupic | examples/opf/experiments/multistep/hotgym_best_tp_5step/description.py | 32 | 3186 | # ----------------------------------------------------------------------
# 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 |
shashank971/edx-platform | common/lib/capa/capa/tests/test_hint_functionality.py | 41 | 34139 | # -*- coding: utf-8 -*-
"""
Tests of extended hints
"""
import unittest
from ddt import ddt, data, unpack
# With the use of ddt, some of the data expected_string cases below are naturally long stretches
# of text text without whitespace. I think it's best to leave such lines intact
# in the test code. Therefore:
# ... | agpl-3.0 |
felixma/nova | nova/tests/unit/api/openstack/compute/test_plugin_framework.py | 17 | 1307 | # Copyright 2014 IBM Corp.
#
# 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 t... | apache-2.0 |
eatbyte/Swift | test/probe/test_object_metadata_replication.py | 3 | 9649 | #!/usr/bin/python -u
# Copyright (c) 2010-2012 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 ap... | apache-2.0 |
ArcherSys/ArcherSys | Lib/lib2to3/fixes/fix_itertools.py | 1 | 4784 | <<<<<<< HEAD
<<<<<<< HEAD
""" Fixer for itertools.(imap|ifilter|izip) --> (map|filter|zip) and
itertools.ifilterfalse --> itertools.filterfalse (bugs 2360-2363)
imports from itertools are fixed in fix_itertools_import.py
If itertools is imported as something else (ie: import itertools as it;
it.izip(s... | mit |
kmoocdev2/edx-platform | openedx/features/course_experience/__init__.py | 1 | 3584 | """
Unified course experience settings and helper methods.
"""
from django.utils.translation import ugettext as _
from openedx.core.djangoapps.util.user_messages import UserMessageCollection
from openedx.core.djangoapps.waffle_utils import CourseWaffleFlag, WaffleFlagNamespace
# Namespace for course experience waffl... | agpl-3.0 |
megawidget/ebb | vendor/gtest-1.7.0/test/gtest_filter_unittest.py | 2826 | 21261 | #!/usr/bin/env python
#
# Copyright 2005 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... | mit |
ltilve/chromium | third_party/tlslite/tlslite/utils/openssl_tripledes.py | 202 | 1788 | # Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
"""OpenSSL/M2Crypto 3DES implementation."""
from .cryptomath import *
from .tripledes import *
if m2cryptoLoaded:
def new(key, mode, IV):
return OpenSSL_TripleDES(key, mode, IV)
class OpenSSL_TripleDES(... | bsd-3-clause |
i5o/openshot-sugar | openshot/openshot/blender/scripts/earth.py | 3 | 13247 | # OpenShot Video Editor is a program that creates, modifies, and edits video files.
# Copyright (C) 2009 Jonathan Thomas
#
# This file is part of OpenShot Video Editor (http://launchpad.net/openshot/).
#
# OpenShot Video Editor is free software: you can redistribute it and/or modify
# it under the terms of the GNU G... | gpl-3.0 |
batra-mlp-lab/DIGITS | tools/download_data/downloader.py | 19 | 2242 | # Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved.
import os
import shutil
import urllib
class DataDownloader(object):
"""Base class for downloading data and setting it up for DIGITS"""
def __init__(self, outdir, clean=False, file_extension='png'):
"""
Arguments:
outdir -... | bsd-3-clause |
AMOboxTV/AMOBox.LegoBuild | script.module.unidecode/lib/unidecode/x060.py | 250 | 4642 | data = (
'Huai ', # 0x00
'Tai ', # 0x01
'Song ', # 0x02
'Wu ', # 0x03
'Ou ', # 0x04
'Chang ', # 0x05
'Chuang ', # 0x06
'Ju ', # 0x07
'Yi ', # 0x08
'Bao ', # 0x09
'Chao ', # 0x0a
'Min ', # 0x0b
'Pei ', # 0x0c
'Zuo ', # 0x0d
'Zen ', # 0x0e
'Yang ', # 0x0f
'Kou ', # 0x10
... | gpl-2.0 |
IAmTheOneTheyCallNeo/vigor_aosp_kernel | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
paulnovo/ITK | Utilities/Doxygen/mcdoc.py | 6 | 5562 | #!/usr/bin/env python
import sys, os, re, glob, cStringIO
def usage():
print >> sys.stderr, """usage: mdoc.py set group file [files...]
Add the tag "\\ingroup group" to all the doxygen comment with a \\class
tag in it.
usage: mdoc.py check group file [files...]
Check that the tag "\\ingroup group" is in all... | apache-2.0 |
mihirkelkar/BuildingMachineLearningSystemsWithPython | ch02/figure4_5_sklearn.py | 22 | 2475 | # This code is supporting material for the book
# Building Machine Learning Systems with Python
# by Willi Richert and Luis Pedro Coelho
# published by PACKT Publishing
#
# It is made available under the MIT License
COLOUR_FIGURE = False
from matplotlib import pyplot as plt
from matplotlib.colors import ListedColorma... | mit |
kohnle-lernmodule/exeLearningPlus1_04 | twisted/web/html.py | 14 | 1101 |
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""I hold HTML generation helpers.
"""
#t.w imports
from twisted.web import resource
import traceback, string
from cStringIO import StringIO
from microdom import escape
def PRE(text):
"Wrap <pre> tags around some text and HTML-... | gpl-2.0 |
mitar/django | django/contrib/messages/storage/__init__.py | 116 | 1185 | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
def get_storage(import_path):
"""
Imports the message storage class described by import_path, where
import_path is the full Python path to the class.
"""
try:
... | bsd-3-clause |
cocoloco69/pynet | ANSIBLE/library/eos_vxlan_vtep.py | 5 | 13989 | #!/usr/bin/python
#
# Copyright (c) 2015, Arista Networks, 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,
# t... | apache-2.0 |
littledogboy/zulip | zerver/worker/queue_processors.py | 115 | 13794 | from __future__ import absolute_import
from django.conf import settings
from django.core.handlers.wsgi import WSGIRequest
from django.core.handlers.base import BaseHandler
from zerver.models import get_user_profile_by_email, \
get_user_profile_by_id, get_prereg_user_by_email, get_client
from zerver.lib.context_man... | apache-2.0 |
saurabh6790/pow-lib | webnotes/utils/nestedset.py | 24 | 7568 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# Tree (Hierarchical) Nested Set Model (nsm)
#
# To use the nested set model,
# use the following pattern
# 1. name your parent field as "parent_item_group" if not have a property nsm_parent_field as your field nam... | mit |
40223119/2015cda | static/Brython3.1.3-20150514-095342/Lib/unittest/signals.py | 1016 | 2403 | import signal
import weakref
from functools import wraps
__unittest = True
class _InterruptHandler(object):
def __init__(self, default_handler):
self.called = False
self.original_handler = default_handler
if isinstance(default_handler, int):
if default_handler == signal.SIG_D... | gpl-3.0 |
piqoni/onadata | onadata/apps/api/viewsets/team_viewset.py | 3 | 4075 | from django.contrib.auth.models import User
from django.utils.translation import ugettext as _
from rest_framework import filters
from rest_framework import status
from rest_framework.decorators import action
from rest_framework.response import Response
from rest_framework.viewsets import ModelViewSet
from rest_framew... | bsd-2-clause |
pierrelb/RMG-Py | scripts/standardizeModelSpeciesNames.py | 8 | 3903 | #!/usr/bin/env python
# encoding: utf-8
"""
This script enables the automatic renaming of species names of of two or more Chemkin files (and
associated species dictionaries) so that they use consistent, matching names. Simply
pass the paths of the Chemkin files and species dictionaries on the
command-line, e.g.
... | mit |
aprefontaine/TMScheduler | django/contrib/comments/moderation.py | 23 | 13333 | """
A generic comment-moderation system which allows configuration of
moderation options on a per-model basis.
To use, do two things:
1. Create or import a subclass of ``CommentModerator`` defining the
options you want.
2. Import ``moderator`` from this module and register one or more
models, passing the model... | bsd-3-clause |
polaris/boids | lib/googletest-82b11b8/googletest/test/gtest_xml_test_utils.py | 1815 | 8876 | #!/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... | mit |
Donkyhotay/MoonPy | zope/index/topic/interfaces.py | 1 | 1798 | ##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SO... | gpl-3.0 |
neudesk/neucloud | openstack_dashboard/dashboards/project/stacks/sro.py | 2 | 1640 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 |
albmarvil/The-Eternal-Sorrow | dependencies/luabind/boost-build/test/conditionals.py | 4 | 1328 | #!/usr/bin/python
# Copyright 2003 Dave Abrahams
# Copyright 2002, 2003, 2004 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# Test conditional properties
from BoostBuild import Tester, List
import os
fr... | apache-2.0 |
swarna-k/MyDiary | flask/lib/python2.7/site-packages/sqlalchemy/orm/path_registry.py | 60 | 8370 | # orm/path_registry.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Path tracking utilities, representing mapper graph traversals.
"""
from .. ... | bsd-3-clause |
sogis/Quantum-GIS | tests/src/python/test_qgspallabeling_tests.py | 12 | 10817 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsPalLabeling: base suite of render check tests
Class is meant to be inherited by classes that test different labeling outputs
See <qgis-src-dir>/tests/testdata/labeling/README.rst for description.
.. note:: This program is free software; you can redistribute it and/or... | gpl-2.0 |
abdullah2891/remo | vendor-local/lib/python/unidecode/x0fa.py | 252 | 4406 | data = (
'Chey ', # 0x00
'Thak ', # 0x01
'Thak ', # 0x02
'Thang ', # 0x03
'Thayk ', # 0x04
'Thong ', # 0x05
'Pho ', # 0x06
'Phok ', # 0x07
'Hang ', # 0x08
'Hang ', # 0x09
'Hyen ', # 0x0a
'Hwak ', # 0x0b
'Wu ', # 0x0c
'Huo ', # 0x0d
'[?] ', # 0x0e
'[?] ', # 0x0f
'Zhong ', ... | bsd-3-clause |
google/grr | grr/core/grr_response_core/lib/type_info.py | 1 | 14909 | #!/usr/bin/env python
"""Typing information for flow arguments.
This contains objects that are used to provide type annotations for flow
parameters. These annotations are used to assist in rendering the UI for
starting flows and for validating arguments.
"""
import logging
from typing import Optional
from typing impo... | apache-2.0 |
weylin/CloudBot | plugins/wikipedia.py | 2 | 1810 | """Searches wikipedia and returns first sentence of article
Scaevolus 2009"""
import re
import requests
from lxml import etree
from cloudbot import hook
from cloudbot.util import formatting
# security
parser = etree.XMLParser(resolve_entities=False, no_network=True)
api_prefix = "http://en.wikipedia.org/w/api.php"... | gpl-3.0 |
mikoim/funstuff | system simulation/2015/cell automaton/forest/bmp.py | 2 | 1356 | __author__ = 'Eshin Kunishima'
__license__ = 'MIT'
from PIL import Image
from forest import Forest
wood = Image.open('tile/wood.png')
bamboo = Image.open('tile/bamboo.png')
fire = Image.open('tile/fire.png')
soil = Image.open('tile/soil.png')
pool = Image.open('tile/pool.png')
road = Image.open('tile/road.png')
moun... | mit |
dfunckt/django | tests/servers/test_liveserverthread.py | 96 | 1123 | from django.db import DEFAULT_DB_ALIAS, connections
from django.test import LiveServerTestCase, TestCase
class LiveServerThreadTest(TestCase):
def run_live_server_thread(self, connections_override=None):
thread = LiveServerTestCase._create_server_thread(connections_override)
thread.daemon = True
... | bsd-3-clause |
bhargav2408/python-for-android | python-build/python-libs/gdata/tests/gdata_tests/books/service_test.py | 127 | 2096 | #!/usr/bin/python
__author__ = "James Sams <sams.james@gmail.com>"
import unittest
import getpass
import atom
import gdata.books
import gdata.books.service
from gdata import test_data
username = ""
password = ""
class BookCRUDTests(unittest.TestCase):
def setUp(self):
self.service = gdata.books.s... | apache-2.0 |
mtagle/airflow | tests/providers/google/cloud/hooks/test_compute.py | 4 | 40568 | #
# 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... | apache-2.0 |
mhogg/scipy | scipy/sparse/bsr.py | 66 | 20937 | """Compressed Block Sparse Row matrix format"""
from __future__ import division, print_function, absolute_import
__docformat__ = "restructuredtext en"
__all__ = ['bsr_matrix', 'isspmatrix_bsr']
from warnings import warn
import numpy as np
from .data import _data_matrix, _minmax_mixin
from .compressed import _cs_m... | bsd-3-clause |
techaddict/spark | examples/src/main/python/ml/imputer_example.py | 79 | 1513 | #
# 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 |
pinterest/pinball | tests/pinball/workflow/job_executor_test.py | 1 | 13681 | # Copyright 2015, Pinterest, 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 |
milokim/linux | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 1891 | 3300 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... | gpl-2.0 |
lthall/Leonard_ardupilot | Tools/LogAnalyzer/tests/TestCompass.py | 66 | 6392 | from LogAnalyzer import Test,TestResult
import DataflashLog
from functools import reduce
import math
class TestCompass(Test):
'''test for compass offsets and throttle interference'''
def __init__(self):
Test.__init__(self)
self.name = "Compass"
def run(self, logdata, verbose):
s... | gpl-3.0 |
kelseyoo14/Wander | venv_2_7/lib/python2.7/site-packages/numpy/distutils/command/install_clib.py | 258 | 1315 | from __future__ import division, absolute_import, print_function
import os
from distutils.core import Command
from distutils.ccompiler import new_compiler
from numpy.distutils.misc_util import get_cmd
class install_clib(Command):
description = "Command to install installable C libraries"
user_options = []
... | artistic-2.0 |
maxking/hamper | hamper/plugins/bitly.py | 2 | 3641 | import re
import urllib
import urllib2
import json
from hamper.interfaces import ChatPlugin
class Bitly(ChatPlugin):
name = 'bitly'
priority = 2
# Regex is taken from:
# http://daringfireball.net/2010/07/improved_regex_for_matching_urls
regex = ur"""
( # Capture 1: enti... | mit |
nrsimha/cookiecutter-django-jingo | {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/jingo_paginator/helpers.py | 2 | 1063 | # import re
from jingo import register
from jinja2 import Markup
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
# from django.shortcuts import render
from django.template.loader import render_to_string
@register.function
def paginate_list(request, object_list, items_per_page=8):
'''
... | mit |
teltek/edx-platform | openedx/features/course_experience/tests/views/test_welcome_message.py | 13 | 4546 | """
Tests for course welcome messages.
"""
import ddt
from django.urls import reverse
from student.models import CourseEnrollment
from student.tests.factories import UserFactory
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulesto... | agpl-3.0 |
Deepali-AddWeb/chomchom | gulp/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py | 1382 | 30567 | # Copyright (c) 2014 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.
"""
This script is intended for use as a GYP_GENERATOR. It takes as input (by way of
the generator flag config_path) the path of a json file that dictates the file... | gpl-2.0 |
edmorley/treeherder | treeherder/auth/backends.py | 2 | 7662 | import json
import logging
import time
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from jose import jwt
from rest_framework.exceptions import AuthenticationFailed
from treeherder.config.settings import (AUTH0_CLIENTID,
AUTH0... | mpl-2.0 |
hesseltuinhof/mxnet | example/rcnn/rcnn/io/rpn.py | 14 | 9509 | """
RPN:
data =
{'data': [num_images, c, h, w],
'im_info': [num_images, 4] (optional)}
label =
{'gt_boxes': [num_boxes, 5] (optional),
'label': [batch_size, 1] <- [batch_size, num_anchors, feat_height, feat_width],
'bbox_target': [batch_size, num_anchors, feat_height, feat_width],
'bbox_weig... | apache-2.0 |
thinkerou/grpc | examples/python/interceptors/headers/greeter_server.py | 13 | 1638 | # Copyright 2017 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | apache-2.0 |
rvalyi/OpenUpgrade | addons/mail/wizard/mail_compose_message.py | 32 | 19668 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
nervenXC/topical_word_embeddings | TWE-2/gensim/models/lsimodel.py | 12 | 34640 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Module for Latent Semantic Analysis (aka Latent Semantic Indexing) in Python.
Implements scalable truncated Singular Value Decompo... | mit |
resmo/ansible | test/units/modules/network/fortios/test_fortios_system_geoip_override.py | 21 | 8183 | # Copyright 2019 Fortinet, 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 version.
#
# This program is distributed in the... | gpl-3.0 |
qrkourier/ansible | lib/ansible/modules/network/dellos9/dellos9_command.py | 27 | 7356 | #!/usr/bin/python
#
# (c) 2015 Peter Sprygada, <psprygada@ansible.com>
# Copyright (c) 2016 Dell Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_versio... | gpl-3.0 |
signalfx/Diamond | src/collectors/xen_collector/test/testxen.py | 29 | 2970 | #!/usr/bin/python
# coding=utf-8
###############################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from test import run_only
from mock import Mock
from mock import patch
from diamond.collector import Colle... | mit |
dean/deliveru | deliveru/settings.py | 1 | 2173 | """
Django settings for deliveru project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
i... | mit |
allenlavoie/tensorflow | tensorflow/python/kernel_tests/summary_tensor_op_test.py | 43 | 5972 | # 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 |
rkokkelk/CouchPotatoServer | libs/dateutil/relativedelta.py | 216 | 17224 | """
Copyright (c) 2003-2010 Gustavo Niemeyer <gustavo@niemeyer.net>
This module offers extensions to the standard Python
datetime module.
"""
__license__ = "Simplified BSD"
import datetime
import calendar
from six import integer_types
__all__ = ["relativedelta", "MO", "TU", "WE", "TH", "FR", "SA", "SU"]
class wee... | gpl-3.0 |
vladikoff/fxa-mochitest | tests/venv/lib/python2.7/site-packages/setuptools/tests/test_sandbox.py | 342 | 2170 | """develop tests
"""
import sys
import os
import shutil
import unittest
import tempfile
import types
import pkg_resources
import setuptools.sandbox
from setuptools.sandbox import DirectorySandbox, SandboxViolation
def has_win32com():
"""
Run this to determine if the local machine has win32com, and if it
d... | mpl-2.0 |
alfonsokim/nupic | examples/opf/experiments/anomaly/spatial/10field_few_skewed/description.py | 20 | 16550 | # ----------------------------------------------------------------------
# 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 |
ZenithDK/mopidy | tests/mpd/protocol/test_regression.py | 4 | 7958 | from __future__ import absolute_import, unicode_literals
import random
import mock
from mopidy.models import Playlist, Ref, Track
from mopidy.mpd.protocol import stored_playlists
from tests.mpd import protocol
class IssueGH17RegressionTest(protocol.BaseTestCase):
"""
The issue: http://github.com/mopidy/m... | apache-2.0 |
sadaf2605/django | django/db/backends/mysql/client.py | 94 | 1524 | import subprocess
from django.db.backends.base.client import BaseDatabaseClient
class DatabaseClient(BaseDatabaseClient):
executable_name = 'mysql'
@classmethod
def settings_to_cmd_args(cls, settings_dict):
args = [cls.executable_name]
db = settings_dict['OPTIONS'].get('db', settings_dic... | bsd-3-clause |
indautgrp/erpnext | erpnext/accounts/doctype/tax_rule/tax_rule.py | 7 | 5732 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import cstr, cint
class IncorrectCustom... | gpl-3.0 |
markjenny/my_ucore_os_lab | related_info/lab7/semaphore_condition/thr-ex1.py | 48 | 1026 | #!/bin/env python
# -*- coding: utf-8 -*-
#filename: peartest.py
import threading, signal
is_exit = False
def doStress(i, cc):
global is_exit
idx = i
while not is_exit:
if (idx < 10000000):
print "thread[%d]: idx=%d"%(i, idx)
idx = idx + cc
else:
brea... | gpl-2.0 |
jsirois/commons | src/python/twitter/common/app/modules/http.py | 14 | 3856 | # ==================================================================================================
# Copyright 2011 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | apache-2.0 |
fitzgen/servo | components/script/dom/bindings/codegen/parser/tests/test_identifier_conflict.py | 53 | 1193 | # Import the WebIDL module, so we can do isinstance checks and whatnot
import WebIDL
def WebIDLTest(parser, harness):
try:
parser.parse("""
enum Foo { "a" };
interface Foo;
""")
results = parser.finish()
harness.ok(False, "Should fail to parse")
except Ex... | mpl-2.0 |
pgjones/jinja | tests/test_core_tags.py | 23 | 12981 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.core_tags
~~~~~~~~~~~~~~~~~~~~~~~~~~
Test the core tags like for and if.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import pytest
from jinja2 import Environment, TemplateSyntaxError, UndefinedError, \
D... | bsd-3-clause |
fengbaicanhe/intellij-community | python/helpers/profiler/thrift/transport/TTwisted.py | 97 | 10563 | #
# 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 |
LUTAN/tensorflow | tensorflow/contrib/slim/python/slim/nets/inception_v2_test.py | 111 | 11157 | # 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 |
japeto/Vigtech-Services | env/lib/python2.7/site-packages/pip/_vendor/requests/models.py | 410 | 29176 | # -*- coding: utf-8 -*-
"""
requests.models
~~~~~~~~~~~~~~~
This module contains the primary objects that power Requests.
"""
import collections
import datetime
from io import BytesIO, UnsupportedOperation
from .hooks import default_hooks
from .structures import CaseInsensitiveDict
from .auth import HTTPBasicAuth
... | lgpl-3.0 |
hnakamur/django-admin2 | djadmin2/tests/test_core.py | 2 | 2454 | from django.db import models
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
from django.contrib.auth.models import Group, User
from django.contrib.sites.models import Site
import djadmin2
from ..types import ModelAdmin2
from ..core import Admin2
class SmallThing(models.Model... | bsd-3-clause |
fvpolpeta/devide | modules/writers/pngWRT.py | 7 | 3025 | # $Id$
from module_base import ModuleBase
from module_mixins import ScriptedConfigModuleMixin
import module_utils
import vtk
import wx # needs this for wx.OPEN, we need to make this constant available
# elsewhere
class pngWRT(ScriptedConfigModuleMixin, ModuleBase):
def __init__(self, module_manager):
... | bsd-3-clause |
askulkarni2/ansible | test/units/playbook/test_taggable.py | 293 | 4452 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
Universal-Model-Converter/UMC3.0a | data/Python/x86/Lib/site-packages/OpenGL/GL/NV/occlusion_query.py | 4 | 3576 | '''OpenGL extension NV.occlusion_query
This module customises the behaviour of the
OpenGL.raw.GL.NV.occlusion_query to provide a more
Python-friendly API
Overview (from the spec)
The HP_occlusion_test extension defines a mechanism whereby an
application can query the visibility of an object, where "visible"
me... | mit |
Universal-Model-Converter/UMC3.0a | dev tests and files/tests/font_test.py | 1 | 4937 | """
font.py -- Displays FPS in OpenGL using TrueType fonts.
Copyright (c) 2002. Nelson Rush. All rights reserved.
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 restr... | mit |
jack51706/viper | modules/pehash/pehasher.py | 3 | 4059 | #!/usr/bin/python
from __future__ import division
import sys
import bz2
import string
import hashlib
try:
import pefile
HAVE_PEFILE = True
except ImportError:
HAVE_PEFILE = False
try:
import bitstring
HAVE_BITSTRING = True
except ImportError:
HAVE_BITSTRING = False
from viper.common.out impo... | bsd-3-clause |
Perferom/android_external_chromium_org | tools/checkperms/checkperms.py | 27 | 15170 | #!/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.
"""Makes sure files have the right permissions.
Some developers have broken SCM configurations that flip the svn:executable
permis... | bsd-3-clause |
gaddman/ansible | lib/ansible/modules/windows/win_command.py | 28 | 3934 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Ansible, inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'core'}
DOCUMENTATIO... | gpl-3.0 |
gokuale/weblate | weblate/trans/tests/test_dictionary.py | 11 | 7785 | # -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# 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, eithe... | gpl-3.0 |
tomkun/stem | stem/util/term.py | 7 | 3027 | # Copyright 2011-2013, Damian Johnson
# See LICENSE for licensing information
"""
Utilities for working with the terminal.
**Module Overview:**
::
format - wrap text with ANSI for the given colors or attributes
.. data:: Color (enum)
.. data:: BgColor (enum)
Enumerations for foreground or background terminal ... | lgpl-3.0 |
GiovanniConserva/TestDeploy | venv/Lib/encodings/utf_16_le.py | 860 | 1037 | """ Python 'utf-16-le' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
encode = codecs.utf_16_le_encode
def decode(input, errors='strict'):
return codecs.utf_16_le_decode(input, errors, True)
class IncrementalEncod... | bsd-3-clause |
google/hyou | test/worksheet_test.py | 1 | 2592 | # Copyright 2015 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 |
Nuclearfossil/ATF | Test/FunctionalTests/CircuitEditorTestScripts/EditSaveCloseAndReopen.py | 10 | 3356 | #Copyright (c) 2014 Sony Computer Entertainment America LLC. See License.txt.
import sys
sys.path.append("./CommonTestScripts")
import System
import Test
import CircuitEditorUtil
doc = atfDocService.OpenNewDocument(editor)
CircuitEditorUtil.SetGlobals(schemaLoader, Schema)
modules = []
annotations = []
connections =... | apache-2.0 |
nealtodd/wagtail | wagtail/embeds/finders/embedly.py | 16 | 2010 | from wagtail.embeds.exceptions import EmbedException, EmbedNotFoundException
from .base import EmbedFinder
class EmbedlyException(EmbedException):
pass
class AccessDeniedEmbedlyException(EmbedlyException):
pass
class EmbedlyFinder(EmbedFinder):
key = None
def __init__(self, key=None):
if... | bsd-3-clause |
BeATz-UnKNoWN/python-for-android | python-modules/twisted/twisted/test/proto_helpers.py | 56 | 15308 | # -*- test-case-name: twisted.test.test_stringtransport -*-
# Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Assorted functionality which is commonly useful when writing unit tests.
"""
from StringIO import StringIO
from zope.interface import implements
from twisted.internet.int... | apache-2.0 |
S01780/python-social-auth | social/tests/backends/test_foursquare.py | 92 | 4108 | import json
from social.tests.backends.oauth import OAuth2Test
class FoursquareOAuth2Test(OAuth2Test):
backend_path = 'social.backends.foursquare.FoursquareOAuth2'
user_data_url = 'https://api.foursquare.com/v2/users/self'
expected_username = 'FooBar'
access_token_body = json.dumps({
'access_... | bsd-3-clause |
adamginsburg/APEX_CMZ_H2CO | reduction/individual_cube_making.py | 2 | 2041 | import socket
import inspect, os
dirpath = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
if 'eso-macbook' in socket.gethostname():
execfile(os.path.join(dirpath,'run_pipeline_cyg.py'))
elif 'cleese' in socket.gethostname():
execfile(os.path.join(dirpath,'run_pipeline_cleese.py'))
... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.