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 |
|---|---|---|---|---|---|
Tithen-Firion/youtube-dl | youtube_dl/extractor/coub.py | 13 | 4712 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
float_or_none,
int_or_none,
parse_iso8601,
qualities,
)
class CoubIE(InfoExtractor):
_VALID_URL = r'(?:coub:|https?://(?:coub\.com/(?:view|embed|coubs)/|c-cdn\.coub\... | unlicense |
heynemann/splitsecond | splitsecond/importer.py | 1 | 2461 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of splitsecond.
# https://github.com/globocom/splitsecond
# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT-license
# Copyright (c) 2015, Bernardo Heynemann <heynemann@gmail.com>
from splitsecond.utils import logger
from funct... | mit |
suncycheng/intellij-community | python/helpers/coveragepy/coverage/results.py | 44 | 9597 | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""Results of coverage measurement."""
import collections
from coverage.backward import iitems
from coverage.misc import format_lines, SimpleRepr
class Analysis... | apache-2.0 |
wangming28/syzygy | third_party/numpy/files/numpy/lib/shape_base.py | 76 | 24380 | __all__ = ['column_stack','row_stack', 'dstack','array_split','split','hsplit',
'vsplit','dsplit','apply_over_axes','expand_dims',
'apply_along_axis', 'kron', 'tile', 'get_array_wrap']
import numpy.core.numeric as _nx
from numpy.core.numeric import asarray, zeros, newaxis, outer, \
concatena... | apache-2.0 |
adoosii/edx-platform | lms/djangoapps/certificates/migrations/0020_certificatehtmlviewconfiguration_data.py | 10 | 11317 | # -*- coding: utf-8 -*-
import json
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"""
Bootstraps the HTML view template with some default configura... | agpl-3.0 |
ryfeus/lambda-packs | Tensorflow_Pandas_Numpy/source3.6/tensorflow/python/estimator/export/export.py | 5 | 12265 | # Copyright 2017 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... | mit |
ThiagoGarciaAlves/intellij-community | python/lib/Lib/site-packages/django/forms/models.py | 73 | 44249 | """
Helper functions for creating Form classes from Django models
and database field objects.
"""
from django.db import connections
from django.utils.encoding import smart_unicode, force_unicode
from django.utils.datastructures import SortedDict
from django.utils.text import get_text_list, capfirst
from django.utils.t... | apache-2.0 |
mzdb/pwiz-mzdb | libraries/freetype-2.4.7/src/tools/docmaker/docbeauty.py | 877 | 2642 | #!/usr/bin/env python
#
# DocBeauty (c) 2003, 2004, 2008 David Turner <david@freetype.org>
#
# This program is used to beautify the documentation comments used
# in the FreeType 2 public headers.
#
from sources import *
from content import *
from utils import *
import utils
import sys, os, time, string, getopt
... | apache-2.0 |
maohongyuan/kbengine | kbe/res/scripts/common/Lib/email/_parseaddr.py | 125 | 17199 | # Copyright (C) 2002-2007 Python Software Foundation
# Contact: email-sig@python.org
"""Email address parsing code.
Lifted directly from rfc822.py. This should eventually be rewritten.
"""
__all__ = [
'mktime_tz',
'parsedate',
'parsedate_tz',
'quote',
]
import time, calendar
SPACE = ' '
EMPTYS... | lgpl-3.0 |
rbian/tp-libvirt | libvirt/tests/src/virtual_network/iface_options.py | 7 | 26385 | import os
import re
import ast
import time
import logging
from autotest.client.shared import error
from autotest.client import utils
from virttest import aexpect
from virttest import remote
from virttest import virt_vm
from virttest import virsh
from virttest import utils_net
from virttest import utils_misc
from virtte... | gpl-2.0 |
yatinag/selfcure | lib/jinja2/ext.py | 357 | 25072 | # -*- coding: utf-8 -*-
"""
jinja2.ext
~~~~~~~~~~
Jinja extensions allow to add custom tags similar to the way django custom
tags work. By default two example extensions exist: an i18n and a cache
extension.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
from jinja2 import nod... | apache-2.0 |
SUSE/ceph-deploy | ceph_deploy/tests/test_install.py | 8 | 4368 | from mock import Mock
from ceph_deploy import install
class TestSanitizeArgs(object):
def setup(self):
self.args = Mock()
# set the default behavior we set in cli.py
self.args.default_release = False
self.args.stable = None
def test_args_release_not_specified(self):
... | mit |
runt18/nupic | src/nupic/frameworks/opf/clamodel_classifier_helper.py | 1 | 20915 | import copy
import numpy
from nupic.support.configuration import Configuration
from nupic.frameworks.opf.exceptions import (CLAModelInvalidRangeError,
CLAModelInvalidArgument)
class _CLAClassificationRecord(object):
"""
A single record to store data associated with a... | agpl-3.0 |
dankolbman/BCIM | src/post.py | 1 | 7125 | import glob
import os
import sys
import re
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import numpy as np
import python.DataIO as DataIO
import python.graphics as graphics
import python.clusters as clusters
import python.counts as counts
# Format settings
from matplotlib i... | mit |
streeter/django-cache-stockpile | stockpile/tests/tests.py | 1 | 2618 | from stockpile import conf
from django.test import TestCase
from .models import Account, DummyInfo
import logging
log = logging.getLogger(__name__)
class StockpileTest(TestCase):
def setUp(self):
# Don't use a fixture for caching reasons
a1 = Account.objects.create(id=1, name='dummy_name_1')... | bsd-3-clause |
ptemplier/ansible | lib/ansible/modules/cloud/amazon/_ec2_vpc.py | 29 | 29766 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['deprecated']... | gpl-3.0 |
galaxyfreak/android_kernel_htc_z4u | tools/perf/scripts/python/netdev-times.py | 11271 | 15048 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... | gpl-2.0 |
DrDos0016/z2 | tools/one-offs/mark_featured.py | 1 | 2437 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django, sys, os
sys.path.append("/var/projects/z2/")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "z2.settings")
django.setup()
from z2_site.models import *
titles = ["4", "Anthropoid", "Blood Oath", "Bloodlines Disc 1", "Blue Moon", "Buck Rus... | mit |
40123248/2015cd_midterm | static/Brython3.1.0-20150301-090019/Lib/atexit.py | 743 | 1049 | """allow programmer to define multiple exit functions to be executedupon normal program termination.
Two public functions, register and unregister, are defined.
"""
class __loader__(object):
pass
def _clear(*args,**kw):
"""_clear() -> None
Clear the list of previously registered exit functions."""
... | gpl-3.0 |
saurabh6790/trufil_app | controllers/stock_controller.py | 29 | 10028 | # 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 webnotes
from webnotes.utils import cint, flt, cstr
from webnotes import msgprint, _
import webnotes.defaults
from controllers.accounts_contr... | agpl-3.0 |
ThePletch/ansible | lib/ansible/modules/cloud/amazon/ec2_lc_find.py | 48 | 7241 | #!/usr/bin/python
# encoding: utf-8
# (c) 2015, Jose Armesto <jose@armesto.net>
#
# This file is part of Ansible
#
# This module 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... | gpl-3.0 |
NYU-CAL/Disco | Python/remapCheckpoint.py | 1 | 1164 | import sys
import numpy as np
import discopy as dp
def remap(d1, d2):
z = d2.Z
r = d2.R
nq = d1.numQ
prim = []
for k in range(d2.numZ):
sheet = []
for j in range(d2.numR):
sheet.append(np.empty((d2.numPhi[k,j], nq),np.float))
prim.append(sheet)
for k in ra... | gpl-3.0 |
xaviercobain88/framework-python | openerp/addons/hr_holidays/report/holidays_summary_report.py | 16 | 10550 | # -*- 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 |
ic-hep/DIRAC | AccountingSystem/private/FileCoding.py | 4 | 2725 | # $HeadURL$
__RCSID__ = "$Id$"
import base64
from DIRAC import S_OK, S_ERROR, gLogger
from DIRAC.Core.Utilities import DEncode
gForceRawEncoding = False
try:
import zlib
gZCompressionEnabled = True
except ImportError, x:
gZCompressionEnabled = False
def codeRequestInFileId( plotRequest, compressIfPossible = T... | gpl-3.0 |
NMGRL/pychron | pychron/pyscripts/tests/hop_editor.py | 2 | 3274 | from __future__ import absolute_import
from pychron.core.ui import set_qt
set_qt()
from pychron.pyscripts.hops_editor import Position, Hop, HopSequence
__author__ = 'ross'
import unittest
class PositionTestCase(unittest.TestCase):
def test_to_string_no_deflection(self):
p = Position(detector='H1', iso... | apache-2.0 |
acshan/odoo | addons/hw_scanner/__openerp__.py | 220 | 1738 | # -*- 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 |
XiaosongWei/chromium-crosswalk | build/android/devil/android/apk_helper.py | 13 | 4085 | # Copyright (c) 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.
"""Module containing utilities for apk packages."""
import re
from devil.android.sdk import aapt
_MANIFEST_ATTRIBUTE_RE = re.compile(
r'\s*A: ([^... | bsd-3-clause |
mixman/djangodev | tests/modeltests/raw_query/tests.py | 43 | 8492 | from __future__ import absolute_import
from datetime import date
from django.db.models.sql.query import InvalidQuery
from django.test import TestCase
from .models import Author, Book, Coffee, Reviewer, FriendlyAuthor
class RawQueryTests(TestCase):
fixtures = ['raw_query_books.json']
def assertSuccessfulRa... | bsd-3-clause |
thaumos/ansible | lib/ansible/modules/cloud/vmware/vmware_host_config_manager.py | 9 | 8562 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata... | gpl-3.0 |
Jajcus/pyxmpp2 | pyxmpp2/cert.py | 1 | 21746 | #
# (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... | lgpl-2.1 |
allanstone/InteligenciaArtificial | Tarea 3/source/_themes/patchlevel.py | 50 | 1942 | # -*- coding: utf-8 -*-
"""
patchlevel.py
~~~~~~~~~~~~~
Extract version info from Include/patchlevel.h.
Adapted from Doc/tools/getversioninfo.
:copyright: 2007-2008 by Georg Brandl.
:license: Python license.
"""
import os
import re
import sys
def get_header_version_info(srcdir):
patchlev... | mit |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/networkx/algorithms/connectivity/kcutsets.py | 5 | 9758 | # -*- coding: utf-8 -*-
"""
Kanevsky all minimum node k cutsets algorithm.
"""
import copy
from collections import defaultdict
from itertools import combinations
from operator import itemgetter
import networkx as nx
from .utils import build_auxiliary_node_connectivity
from networkx.algorithms.flow import (
build_r... | gpl-3.0 |
Intel-Corporation/tensorflow | tensorflow/contrib/eager/python/examples/linear_regression/linear_regression_graph_test.py | 14 | 2674 | # Copyright 2017 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 |
geometalab/Vector-Tiles-Reader-QGIS-Plugin | ext-libs/google/protobuf/duration_pb2.py | 43 | 2746 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/duration.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import ref... | gpl-2.0 |
superarts/JekyllMetro | games/rapt/game/jsparser.py | 6 | 39151 | #!/usr/bin/python2.5
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (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.mozil... | mit |
kontais/EFI-MIPS | ToolKit/cmds/python/Modules/unimplemented/cgen.py | 7 | 15247 | ########################################################################
# Copyright (c) 2000, BeOpen.com.
# Copyright (c) 1995-2000, Corporation for National Research Initiatives.
# Copyright (c) 1990-1995, Stichting Mathematisch Centrum.
# All rights reserved.
#
# See the file "Misc/COPYRIGHT" for information on usag... | bsd-3-clause |
JaneliaSciComp/Neuroptikon | Source/network/arborization.py | 1 | 5522 | # Copyright (c) 2010 Howard Hughes Medical Institute.
# All rights reserved.
# Use is subject to Janelia Farm Research Campus Software Copyright 1.1 license terms.
# http://license.janelia.org/license/jfrc_copyright_1_1.html
import neuroptikon
import osgUtil
import os
from neuro_object import NeuroObject
class A... | bsd-3-clause |
nakagami/reportlab | src/reportlab/pdfbase/_can_cmap_data.py | 14 | 1831 | #
"""
This is a utility to 'can' the widths data for certain CID fonts.
Now we're using Unicode, we don't need 20 CMAP files for each Asian
language, nor the widths of the non-normal characters encoded in each
font. we just want a dictionary of the character widths in a given
font which are NOT 1000 ems wide, keyed on... | bsd-3-clause |
DEKHTIARJonathan/BilletterieUTC | badgingServer/Install/swigwin-3.0.7/Examples/test-suite/python/li_std_pair_extra_runme.py | 6 | 1104 | import li_std_pair_extra
p = (1, 2)
p1 = li_std_pair_extra.p_inout(p)
p2 = li_std_pair_extra.p_inoutd(p1)
d1 = li_std_pair_extra.d_inout(2)
i, d2 = li_std_pair_extra.d_inout2(2)
i, p = li_std_pair_extra.p_inout2(p)
p3, p4 = li_std_pair_extra.p_inout3(p1, p1)
psi = li_std_pair_extra.SIPair("hello", 1)
pci = li_std_... | apache-2.0 |
40123248/2015cd_midterm2 | static/Brython3.1.0-20150301-090019/Lib/stat.py | 765 | 4304 | """Constants/functions for interpreting results of os.stat() and os.lstat().
Suggested usage: from stat import *
"""
# Indices for stat struct members in the tuple returned by os.stat()
ST_MODE = 0
ST_INO = 1
ST_DEV = 2
ST_NLINK = 3
ST_UID = 4
ST_GID = 5
ST_SIZE = 6
ST_ATIME = 7
ST_MTIME = 8
ST_CTIME = 9
... | gpl-3.0 |
bright-sparks/chromium-spacewalk | third_party/cython/src/Cython/Compiler/Tests/TestTreePath.py | 133 | 4274 | import unittest
from Cython.Compiler.Visitor import PrintTree
from Cython.TestUtils import TransformTest
from Cython.Compiler.TreePath import find_first, find_all
from Cython.Compiler import Nodes, ExprNodes
class TestTreePath(TransformTest):
_tree = None
def _build_tree(self):
if self._tree is None:
... | bsd-3-clause |
Curahelper/Cura | plugins/PluginBrowser/PluginBrowser.py | 1 | 10838 | # Copyright (c) 2017 Ultimaker B.V.
# PluginBrowser is released under the terms of the AGPLv3 or higher.
from UM.Extension import Extension
from UM.i18n import i18nCatalog
from UM.Logger import Logger
from UM.Qt.ListModel import ListModel
from UM.PluginRegistry import PluginRegistry
from UM.Application import Applicati... | agpl-3.0 |
minzhang28/docker-py | setup.py | 1 | 1768 | #!/usr/bin/env python
import os
import sys
from setuptools import setup
ROOT_DIR = os.path.dirname(__file__)
SOURCE_DIR = os.path.join(ROOT_DIR)
requirements = [
'requests >= 2.5.2, < 2.11',
'six >= 1.4.0',
'websocket-client >= 0.32.0',
]
if sys.platform == 'win32':
requirements.append('pypiwin32 >... | apache-2.0 |
rosudrag/Freemium-winner | VirtualEnvironment/Lib/site-packages/oauthlib/oauth2/rfc6749/grant_types/resource_owner_password_credentials.py | 35 | 8389 | # -*- coding: utf-8 -*-
"""
oauthlib.oauth2.rfc6749.grant_types
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
from __future__ import unicode_literals, absolute_import
import json
import logging
from .base import GrantTypeBase
from .. import errors
from ..request_validator import RequestValidator
log = logging.getLogger(_... | mit |
darkryder/django | tests/utils_tests/test_timesince.py | 37 | 5880 | from __future__ import unicode_literals
import datetime
import unittest
from django.test.utils import requires_tz_support
from django.utils import timezone
from django.utils.timesince import timesince, timeuntil
class TimesinceTests(unittest.TestCase):
def setUp(self):
self.t = datetime.datetime(2007, ... | bsd-3-clause |
ruzhytskyi/Koans | python3/koans/about_multiple_inheritance.py | 96 | 3944 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Slightly based on AboutModules in the Ruby Koans
#
from runner.koan import *
class AboutMultipleInheritance(Koan):
class Nameable:
def __init__(self):
self._name = None
def set_name(self, new_name):
self._name = new_name
... | mit |
vikingco/gargoyle | tests/tests.py | 6 | 36472 | """
:copyright: (c) 2010 DISQUS.
:license: Apache License 2.0, see LICENSE for more details.
"""
import datetime
import sys
from django.conf import settings
from django.contrib.auth.models import User, AnonymousUser
from django.core.cache import cache
from django.core.management.base import CommandError
from django.c... | apache-2.0 |
kevinlondon/youtube-dl | youtube_dl/extractor/unistra.py | 146 | 2119 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import qualities
class UnistraIE(InfoExtractor):
_VALID_URL = r'http://utv\.unistra\.fr/(?:index|video)\.php\?id_video\=(?P<id>\d+)'
_TESTS = [
{
'url': 'http://utv.unistra.fr/video.php?id_v... | unlicense |
fifengine/fifengine | engine/python/fife/extensions/pychan/internal.py | 1 | 8284 | # -*- coding: utf-8 -*-
# ####################################################################
# Copyright (C) 2005-2019 by the FIFE team
# http://www.fifengine.net
# This file is part of FIFE.
#
# FIFE is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#... | lgpl-2.1 |
kutenai/django | tests/sites_framework/tests.py | 117 | 2693 | from django.conf import settings
from django.contrib.sites.managers import CurrentSiteManager
from django.contrib.sites.models import Site
from django.core import checks
from django.db import models
from django.test import SimpleTestCase, TestCase
from django.test.utils import isolate_apps
from .models import CustomAr... | bsd-3-clause |
foodszhang/cookiecutter | tests/test_more_cookiecutters.py | 25 | 1959 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_more_cookiecutters
-----------------------
Test formerly known from a unittest residing in test_examples.py named
TestGitBranch.test_branch
TestExamplesRepoArg.test_cookiecutter_pypackage_git
"""
from __future__ import unicode_literals
import os
import subproces... | bsd-3-clause |
lduarte1991/edx-platform | openedx/core/djangolib/js_utils.py | 40 | 3506 | """
Utilities for dealing with Javascript and JSON.
"""
import json
from django.utils.html import escapejs
from mako.filters import decode
from xmodule.modulestore import EdxJSONEncoder
def _escape_json_for_js(json_dumps_string):
"""
Escape output of JSON dumps that is safe to be embedded in a <SCRIPT> tag.... | agpl-3.0 |
pjdelport/django | tests/modeltests/unmanaged_models/models.py | 115 | 3688 | """
Models can have a ``managed`` attribute, which specifies whether the SQL code
is generated for the table on various manage.py operations.
"""
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
# All of these models are created in the database by Django.
@python_2_unicode_... | bsd-3-clause |
MobileWebApps/backend-python-rest-gae | lib/rest_framework/compat.py | 1 | 21674 | """
The `compat` module provides support for backwards compatibility with older
versions of django/python, and compatibility wrappers around optional packages.
"""
# flake8: noqa
from __future__ import unicode_literals
import django
import inspect
from django.core.exceptions import ImproperlyConfigured
from django.co... | bsd-3-clause |
RSandK/DCD | 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 |
krkhan/azure-linux-extensions | CustomScript/azure/servicebus/servicebusservice.py | 46 | 41704 | #-------------------------------------------------------------------------
# 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 |
zaxliu/scipy | scipy/sparse/csgraph/tests/test_spanning_tree.py | 153 | 2181 | """Test the minimum spanning tree function"""
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import assert_
import numpy.testing as npt
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import minimum_spanning_tree
def test_minimum_spanning_tree():
... | bsd-3-clause |
doadin/samsung-kernel-msm7x30 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | 5411 | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... | gpl-2.0 |
batermj/algorithm-challenger | code-analysis/programming_anguage/python/source_codes/Python3.8.0/Python-3.8.0/Doc/tools/rstlint.py | 5 | 7590 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Check for stylistic and formal issues in .rst and .py
# files included in the documentation.
#
# 01/2009, Georg Brandl
# TODO: - wrong versions in versionadded/changed
# - wrong markup after versionchanged directive
import os
import re
import sys
import getopt
f... | apache-2.0 |
echodaemon/Empire | lib/modules/powershell/situational_awareness/network/powerview/get_localgroup.py | 6 | 4196 | from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Get-NetLocalGroup',
'Author': ['@harmj0y'],
'Description': ('Returns a list of all current users in a specified local group '
'on ... | bsd-3-clause |
arjclark/cylc | lib/jinja2/_stringdefs.py | 121 | 589381 | # -*- coding: utf-8 -*-
"""
jinja2._stringdefs
~~~~~~~~~~~~~~~~~~
Strings of all Unicode characters of a certain category.
Used for matching in Unicode-aware languages. Run to regenerate.
Inspired by chartypes_create.py from the MoinMoin project, original
implementation from Pygments.
:co... | gpl-3.0 |
aio-libs/aiobotocore | aiobotocore/args.py | 1 | 3209 | import copy
from botocore.args import ClientArgsCreator
import botocore.serialize
import botocore.parsers
from .config import AioConfig
from .endpoint import AioEndpointCreator
from .signers import AioRequestSigner
class AioClientArgsCreator(ClientArgsCreator):
# NOTE: we override this so we can pull out the cu... | apache-2.0 |
ronekko/chainer | chainer/functions/connection/depthwise_convolution_2d.py | 3 | 2905 | import chainer
def depthwise_convolution_2d(x, W, b=None, stride=1, pad=0):
"""Two-dimensional depthwise convolution function.
This is an implementation of two-dimensional depthwise convolution.
It takes two or three variables: the input image ``x``, the filter weight
``W``, and optionally, the bias ... | mit |
xinjiguaike/edx-platform | common/test/acceptance/pages/lms/discussion.py | 36 | 25473 | from contextlib import contextmanager
from bok_choy.javascript import wait_for_js
from bok_choy.page_object import PageObject
from bok_choy.promise import EmptyPromise, Promise
from .course_page import CoursePage
class DiscussionPageMixin(object):
def is_ajax_finished(self):
return self.browser.execute... | agpl-3.0 |
roopali8/keystone | keystone/tests/unit/test_v3.py | 1 | 51689 | # Copyright 2013 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 applicable law or agreed to in... | apache-2.0 |
sunlightlabs/openstates | scrapers/wa/committees.py | 2 | 3148 | from .utils import xpath
from openstates.scrape import Scraper, Organization
import lxml.etree
class WACommitteeScraper(Scraper):
_base_url = "http://wslwebservices.leg.wa.gov/CommitteeService.asmx"
def scrape(self, chamber=None, session=None):
if not session:
session = self.latest_sess... | gpl-3.0 |
hwjworld/xiaodun-platform | common/djangoapps/user_api/migrations/0003_rename_usercoursetags.py | 52 | 4699 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.rename_table('user_api_usercoursetags', 'user_api_usercoursetag')
def backwards(self, orm):
db.rena... | agpl-3.0 |
2014c2g12/c2g12 | c2wp/wsgi/static/Brython2.1.0-20140419-113919/Lib/unittest/test/test_suite.py | 791 | 12066 | import unittest
import sys
from .support import LoggingResult, TestEquality
### Support code for Test_TestSuite
################################################################
class Test(object):
class Foo(unittest.TestCase):
def test_1(self): pass
def test_2(self): pass
def test_3(self... | gpl-2.0 |
eirannejad/pyRevit | pyrevitlib/rpws/__init__.py | 1 | 1361 | """ python wrapper for Autodesk Revit Server
This is a python module for interacting with Autodesk Revit Server using
its RESTful API. This module requires 'requests' module for handling http
requests to the Revit Server.
Module Files:
exceptions.py: Defines module exceptions and custom exceptions for
... | gpl-3.0 |
BladeSmithJohn/nixysa | third_party/ply-3.1/test/yacc_literal.py | 174 | 1566 | # -----------------------------------------------------------------------------
# yacc_literal.py
#
# Grammar with bad literal characters
# -----------------------------------------------------------------------------
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.yacc as yacc
from calclex imp... | apache-2.0 |
styxit/CouchPotatoServer | libs/guessit/matchtree.py | 102 | 9116 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2011 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | gpl-3.0 |
kursitet/edx-platform | common/lib/xmodule/xmodule/tests/test_utils_escape_html_characters.py | 118 | 1632 | """Tests for methods defined in util/misc.py"""
from xmodule.util.misc import escape_html_characters
from unittest import TestCase
class UtilHtmlEscapeTests(TestCase):
"""
Tests for methods exposed in util/misc
"""
final_content = " This is a paragraph. "
def test_escape_html_comments(self):
... | agpl-3.0 |
PythonScanClient/PyScanClient | scan/commands/parallel.py | 1 | 3176 | '''
Parallel Command
@author: Kay Kasemir
'''
from scan.commands import Command
try:
import xml.etree.cElementTree as ET
except:
import xml.etree.ElementTree as ET
class Parallel(Command):
"""Perform multiple commands in parallel.
Each of the commands performed in parallel may await
callback ... | epl-1.0 |
charbeljc/OCB | addons/account/wizard/account_report_central_journal.py | 378 | 1697 | # -*- 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 |
robertoostenveld/eegsynth-matlab | module/outputaudio/outputaudio.py | 2 | 12980 | #!/usr/bin/env python
# This module reads data from a FieldTrip buffer and writes it to an audio device
#
# This software is part of the EEGsynth project, see <https://github.com/eegsynth/eegsynth>.
#
# Copyright (C) 2018-2020 EEGsynth project
#
# This program is free software: you can redistribute it and/or modify
# ... | gpl-2.0 |
jupierce/openshift-tools | ansible/roles/lib_utils/library/oo_ami_copy_to_regions.py | 3 | 4746 | #!/usr/bin/python
"""ansible module for ec2 ami copy to all regions"""
# -*- coding: utf-8 -*-
# vim: expandtab:tabstop=4:shiftwidth=4
DOCUMENTATION = '''
---
module: aos_ami_copy_to_regions
short_description: this module copies an ami out to all regions
description:
- this module accepts an ami id and copies it to al... | apache-2.0 |
hiker/stan | AOR/Select.py | 1 | 4232 | #!/usr/bin/env python
import string
from AOR.BasicStatement import BasicNamedStatement, BasicStatement
from AOR.DoubleList import DoubleList
class Select(BasicNamedStatement):
# Stores a select statement
#
# sLabel -- Label of the select statement (this is NOT the label
# used in t... | gpl-3.0 |
ruibarreira/linuxtrail | usr/lib/python2.7/dist-packages/reportlab/graphics/samples/runall.py | 42 | 1970 | # runs all the GUIedit charts in this directory -
# makes a PDF sample for eaxh existing chart type
import sys
import glob
import inspect
import types
def moduleClasses(mod):
def P(obj, m=mod.__name__, CT=type):
return (type(obj)==CT and obj.__module__==m)
try:
return inspect.getmembers(mod, P)... | gpl-3.0 |
repotvsupertuga/tvsupertuga.repository | script.module.schism.addon/resources/tools/tumitv.py | 62 | 3085 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para tumi.tv
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import re
import urllib
from core import scrapertools
from c... | gpl-2.0 |
junhuac/MQUIC | src/tools/bisect-builds.py | 1 | 51675 | #!/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.
"""Snapshot Build Bisect Tool
This script bisects a snapshot archive using binary search. It starts at
a bad revision (it will try... | mit |
dsqmoore/0install | zeroinstall/0launch-gui/properties.py | 4 | 19112 | # Copyright (C) 2009, Thomas Leonard
# See the README file for details, or visit http://0install.net.
import zeroinstall
import os
from zeroinstall import _
from zeroinstall.support import tasks, unicode
from zeroinstall.injector.model import Interface, Feed, stable, testing, developer, stability_levels
from zeroinsta... | lgpl-2.1 |
beck/django | tests/field_subclassing/fields.py | 170 | 2774 | from __future__ import unicode_literals
import json
import warnings
from django.db import models
from django.utils import six
from django.utils.deconstruct import deconstructible
from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.encoding import force_text, python_2_unicode_compatible
#... | bsd-3-clause |
gdgellatly/OCB1 | addons/l10n_ch/account_wizard.py | 424 | 2192 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi. Copyright Camptocamp SA
# Financial contributors: Hasa SA, Open Net SA,
# Prisme Solutions Informatique SA, Quod SA
#
# Translation contributors: brain-te... | agpl-3.0 |
tobegit3hub/deep_cnn | java_predict_client/src/main/proto/tensorflow/contrib/tensor_forest/hybrid/python/hybrid_layer.py | 45 | 1575 | # 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 |
psdh/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/test/test_memorizingfile.py | 496 | 4252 | #!/usr/bin/env python
#
# Copyright 2011, 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... | mpl-2.0 |
shgandhi/mase | python101/code/TurtleWorld.py | 14 | 8969 | """This module is part of Swampy, a suite of programs available from
allendowney.com/swampy.
Copyright 2010 Allen B. Downey
Distributed under the GNU General Public License at gnu.org/licenses/gpl.html.
"""
from Tkinter import TOP, BOTTOM, LEFT, RIGHT, END, LAST, NONE, SUNKEN
from Gui import Callable
from World impo... | unlicense |
ClovisIRex/Snake-django | env/lib/python3.6/site-packages/django/contrib/messages/storage/session.py | 109 | 1795 | import json
from django.conf import settings
from django.contrib.messages.storage.base import BaseStorage
from django.contrib.messages.storage.cookie import (
MessageDecoder, MessageEncoder,
)
from django.utils import six
class SessionStorage(BaseStorage):
"""
Stores messages in the session (that is, dja... | mit |
Asana/boto | tests/integration/gs/test_basic.py | 107 | 17895 | # -*- coding: utf-8 -*-
# Copyright (c) 2006-2011 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
# Copyright (c) 2011, Nexenta Systems, Inc.
# Copyright (c) 2012, Google, Inc.
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of t... | mit |
sodafree/backend | build/ipython/IPython/lib/backgroundjobs.py | 3 | 17542 | # -*- coding: utf-8 -*-
"""Manage background (threaded) jobs conveniently from an interactive shell.
This module provides a BackgroundJobManager class. This is the main class
meant for public usage, it implements an object which can create and manage
new background jobs.
It also provides the actual job classes manag... | bsd-3-clause |
kinow-io/kinow-python-sdk | kinow_client/models/platform_access_info.py | 1 | 3466 | # coding: utf-8
"""
Server API
Reference for Server API (REST/Json)
OpenAPI spec version: 1.4.41
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class PlatformAccessInfo(object):
"""
NOTE: This class ... | apache-2.0 |
pombredanne/MOG | nova/tests/image/test_glance.py | 7 | 38134 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation
# 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.apach... | apache-2.0 |
chewable/django | django/contrib/gis/db/models/aggregates.py | 1 | 1043 | from django.db.models import Aggregate
from django.contrib.gis.db.backend import SpatialBackend
from django.contrib.gis.db.models.sql import GeomField
class GeoAggregate(Aggregate):
def add_to_query(self, query, alias, col, source, is_summary):
if hasattr(source, '_geom'):
# Doing additional s... | bsd-3-clause |
elventear/ansible | lib/ansible/modules/cloud/amazon/elasticache_snapshot.py | 12 | 8130 | #!/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 distributed... | gpl-3.0 |
wermon/python_koans | python2/koans/about_sets.py | 86 | 1510 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutSets(Koan):
def test_sets_make_keep_lists_unique(self):
highlanders = ['MacLeod', 'Ramirez', 'MacLeod', 'Matunas',
'MacLeod', 'Malcolm', 'MacLeod']
there_can_only_be_only_one = set(highlanders)
... | mit |
nharraud/invenio-demosite | invenio_demosite/testsuite/regression/test_bibrank_selfcites.py | 7 | 12705 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio Demosite.
# Copyright (C) 2011, 2012 CERN.
#
# Invenio Demosite 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 (a... | gpl-2.0 |
nino-c/plerp.org | src/mainsite/settings/base.py | 1 | 4367 | """
Django settings for mainsite project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
from django.core.urlresolvers import reverse_lazy
from os.path import dirn... | mit |
MobinRanjbar/hue | desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/Hash/RIPEMD.py | 124 | 3005 | # -*- coding: utf-8 -*-
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, perpetual, royalty-free,
# non-exclusive license to e... | apache-2.0 |
mrtnrdl/.macdots | scripts/bin/platform-tools/systrace/catapult/dependency_manager/dependency_manager/dependency_manager_unittest.py | 10 | 22469 | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=unused-argument
import mock
from pyfakefs import fake_filesystem_unittest
from py_utils import cloud_storage
import dependency_manager
f... | unlicense |
PatrickKennedy/Sybil | docutils/parsers/rst/directives/html.py | 61 | 3223 | # $Id: html.py 4667 2006-07-12 21:40:56Z wiemann $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Directives for typically HTML-specific constructs.
"""
__docformat__ = 'reStructuredText'
import sys
from docutils import nodes, utils
from docutils.parse... | bsd-2-clause |
wanghongjuan/crosswalk-test-suite | webapi/tct-csp-w3c-tests/csp-py/csp_img-src_none_blocked_ext-manual.py | 30 | 2514 | def main(request, response):
import simplejson as json
f = file('config.json')
source = f.read()
s = json.JSONDecoder().decode(source)
url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1])
url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0])
response.headers.set("Content... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.