repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
bgxavier/nova | nova/tests/unit/virt/hyperv/test_base.py | 24 | 1073 | # Copyright 2014 Cloudbase Solutions Srl
#
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | apache-2.0 |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.5.0/Lib/pipes.py | 172 | 8916 | """Conversion pipeline templates.
The problem:
------------
Suppose you have some data that you want to convert to another format,
such as from GIF image format to PPM image format. Maybe the
conversion involves several steps (e.g. piping it through compress or
uuencode). Some of the conversion steps may require th... | mit |
koniiiik/django | django/shortcuts.py | 117 | 5429 | """
This module collects helper functions and classes that "span" multiple levels
of MVC. In other words, these functions/classes introduce controlled coupling
for convenience's sake.
"""
from django.http import (
Http404, HttpResponse, HttpResponsePermanentRedirect, HttpResponseRedirect,
)
from django.template imp... | bsd-3-clause |
klmitch/neutron | neutron/agent/linux/dibbler.py | 8 | 6893 | # Copyright 2015 Cisco Systems
# 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... | apache-2.0 |
HyperBaton/ansible | lib/ansible/modules/network/avi/avi_microservicegroup.py | 28 | 3952 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
ANSIB... | gpl-3.0 |
gcode-mirror/audacity | lib-src/lv2/lv2/plugins/eg01-amp.lv2/waflib/extras/doxygen.py | 105 | 4815 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
from fnmatch import fnmatchcase
import os,os.path,re,stat
from waflib import Task,Utils,Node,Logs
from waflib.TaskGen import feature
DOXY_STR='${DOXYGEN} - '
DOXY_FMTS='html l... | gpl-2.0 |
stinebuu/nest-simulator | pynest/examples/clopath_synapse_spike_pairing.py | 12 | 5804 | # -*- coding: utf-8 -*-
#
# clopath_synapse_spike_pairing.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 |
theseyi/WhereHows | wherehows-etl/src/main/resources/jython/requests/packages/urllib3/util/connection.py | 353 | 3380 | from __future__ import absolute_import
import socket
try:
from select import poll, POLLIN
except ImportError: # `poll` doesn't exist on OSX and other platforms
poll = False
try:
from select import select
except ImportError: # `select` doesn't exist on AppEngine.
select = False
def is... | apache-2.0 |
CTSRD-SOAAP/chromium-42.0.2311.135 | breakpad/src/tools/python/filter_syms.py | 76 | 8032 | #!/usr/bin/env python
# Copyright (c) 2012 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 lis... | bsd-3-clause |
tmuelle2/phantomjs | src/qt/qtbase/src/3rdparty/freetype/src/tools/docmaker/utils.py | 515 | 3063 | # Utils (c) 2002, 2004, 2007, 2008 David Turner <david@freetype.org>
#
import string, sys, os, glob
# current output directory
#
output_dir = None
# This function is used to sort the index. It is a simple lexicographical
# sort, except that it places capital letters before lowercase ones.
#
def index_sort( s1, ... | bsd-3-clause |
ravindrapanda/tensorflow | tensorflow/python/estimator/canned/head_test.py | 4 | 151483 | # 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 |
postlund/home-assistant | homeassistant/components/bitcoin/sensor.py | 1 | 6392 | """Bitcoin information service that uses blockchain.com."""
from datetime import timedelta
import logging
from blockchain import exchangerates, statistics
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import ATTR_ATTRIBUTION, CONF_CURRENCY, CONF_DISPLAY_... | apache-2.0 |
Elite-Kernels/HTC-10 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py | 4653 | 3596 | # EventClass.py
#
# This is a library defining some events types classes, which could
# be used by other scripts to analyzing the perf samples.
#
# Currently there are just a few classes defined for examples,
# PerfEvent is the base class for all perf event sample, PebsEvent
# is a HW base Intel x86 PEBS event, and use... | gpl-2.0 |
theflofly/tensorflow | tensorflow/python/debug/lib/common.py | 79 | 3077 | # 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 |
robcore/machinex_kernelv2 | scripts/gcc-wrapper.py | 234 | 4095 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2012, The Linux Foundation. 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 th... | gpl-2.0 |
naphthalene/fabric-bolt | fabric_bolt/projects/migrations/0005_auto__add_field_stage_project.py | 18 | 3869 | # -*- 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):
# Adding field 'Stage.project'
db.add_column(u'projects_stage', 'project',
self.gf('dj... | mit |
habibun/craft | web/assets/jquery-file-upload/server/gae-python/main.py | 223 | 5173 | # -*- coding: utf-8 -*-
#
# jQuery File Upload Plugin GAE Python Example 2.0
# https://github.com/blueimp/jQuery-File-Upload
#
# Copyright 2011, Sebastian Tschan
# https://blueimp.net
#
# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT
#
from __future__ import with_statement
from google.appeng... | mit |
sbidoul/odoo | openerp/report/render/html2html/__init__.py | 381 | 1091 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
jenalgit/django | django/db/models/__init__.py | 239 | 1679 | from functools import wraps
from django.core.exceptions import ObjectDoesNotExist # NOQA
from django.db.models import signals # NOQA
from django.db.models.aggregates import * # NOQA
from django.db.models.deletion import ( # NOQA
CASCADE, DO_NOTHING, PROTECT, SET, SET_DEFAULT, SET_NULL, ProtectedError,
)
from d... | bsd-3-clause |
chauhanhardik/populo_2 | common/lib/xmodule/xmodule/library_content_module.py | 46 | 24808 | # -*- coding: utf-8 -*-
"""
LibraryContent: The XBlock used to include blocks from a library in a course.
"""
import json
from lxml import etree
from copy import copy
from capa.responsetypes import registry
from gettext import ngettext
from lazy import lazy
from .mako_module import MakoModuleDescriptor
from opaque_key... | agpl-3.0 |
taxpon/sverchok | nodes/object_nodes/scene_raycast2.py | 3 | 2516 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | gpl-3.0 |
2014c2g9/c2g9 | wsgi/static/Brython2.1.0-20140419-113919/Lib/test/regrtest.py | 718 | 65317 | #! /usr/bin/python3.3
"""
Usage:
python -m test [options] [test_name1 [test_name2 ...]]
python path/to/Lib/test/regrtest.py [options] [test_name1 [test_name2 ...]]
If no arguments or options are provided, finds all files matching
the pattern "test_*" in the Lib/test subdirectory and runs
them in alphabetical order ... | gpl-2.0 |
orgito/ansible | lib/ansible/modules/network/vyos/vyos_command.py | 41 | 7417 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
ryfeus/lambda-packs | Tensorflow/source/tensorflow/contrib/keras/api/keras/initializers/__init__.py | 74 | 2387 | # 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... | mit |
xxd3vin/spp-sdk | opt/Python27/Lib/site-packages/numpy/core/memmap.py | 22 | 9611 | __all__ = ['memmap']
import warnings
from numeric import uint8, ndarray, dtype
import sys
from numpy.compat import asbytes
dtypedescr = dtype
valid_filemodes = ["r", "c", "r+", "w+"]
writeable_filemodes = ["r+","w+"]
mode_equivalents = {
"readonly":"r",
"copyonwrite":"c",
"readwrite":"r+",
"write":"... | mit |
malkavi/Flexget | flexget/tests/api_tests/test_variables_api.py | 3 | 1727 | from flexget.components.variables.variables import Variables
from flexget.manager import Session
from flexget.utils import json
class TestVariablesAPI:
config = 'tasks: {}'
variables_dict = {'test_variable_db': True}
def test_variables_get(self, api_client):
with Session() as session:
... | mit |
chouseknecht/ansible | test/units/modules/network/f5/test_bigip_profile_oneconnect.py | 22 | 3675 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks 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
import os
import json
import pytest
import sys
if sys.version_info < (2... | gpl-3.0 |
meteorcloudy/bazel | src/create_embedded_tools.py | 1 | 5999 | # pylint: disable=g-direct-third-party-import
# pylint: disable=g-bad-file-header
# Copyright 2017 The Bazel 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
#
# ... | apache-2.0 |
klickagent/phantomjs | src/breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/internal/containers.py | 261 | 9573 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | bsd-3-clause |
daafgo/CourseBuilder-Xapi | modules/dashboard/messages.py | 3 | 5528 | # Copyright 2013 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 ... | apache-2.0 |
ahh2131/mchisel | test/extended_id_test.py | 3 | 1208 | from pymclevel import BoundingBox
from pymclevel.schematic import MCSchematic
from pymclevel import MCInfdevOldLevel
from templevel import TempLevel
__author__ = 'Rio'
def test_schematic_extended_ids():
s = MCSchematic(shape=(1, 1, 5))
s.Blocks[0,0,0] = 2048
temp = TempLevel("schematic", createFunc=s.save... | isc |
CHT5/program-y | src/test/parser/template/nodes/test_condtype1.py | 3 | 4310 | import xml.etree.ElementTree as ET
from programy.parser.template.nodes.base import TemplateNode
from programy.parser.template.nodes.word import TemplateWordNode
from programy.parser.template.nodes.condtype1 import TemplateType1ConditionNode
from programy.dialog import Question
from test.parser.template.base import Te... | mit |
zimmerst/phoshare | appledata/applexml.py | 7 | 5245 | '''Reads iPhoto or iTunes XML data files'''
# Copyright 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
#
# Unle... | apache-2.0 |
quamilek/django | django/contrib/messages/storage/session.py | 478 | 1714 | import json
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, django.contrib.sessions).
"""
... | bsd-3-clause |
levenlabs/ansible | lib/ansible/executor/task_result.py | 12 | 2757 | # (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 |
NiHab/py-jr | src/dictionaries/lookup.py | 1 | 2512 | #@PydevCodeAnalysisIgnore
from lxml import etree as ET
import dictionaries.jmdict
import dictionaries.freq
import dictionaries.deinflecter
from librepo import Result
from copy import deepcopy
class Lookup(object):
'''
Combines and abstracts dict, freq and deinflecter
'''
def __init__(self):
s... | gpl-2.0 |
beni55/txZMQ | txzmq/test/test_router_dealer.py | 1 | 2395 | """
Tests for L{txzmq.router_dealer}.
"""
from twisted.internet import defer, reactor
from twisted.trial import unittest
from txzmq.connection import ZmqEndpoint, ZmqEndpointType
from txzmq.factory import ZmqFactory
from txzmq.router_dealer import ZmqRouterConnection, ZmqDealerConnection
class ZmqTestRouterConnectio... | gpl-2.0 |
scorphus/scrapy | scrapy/link.py | 56 | 1253 | """
This module defines the Link object used in Link extractors.
For actual link extractors implementation see scrapy.linkextractors, or
its documentation in: docs/topics/link-extractors.rst
"""
import six
class Link(object):
"""Link objects represent an extracted link by the LinkExtractor."""
__slots__ = [... | bsd-3-clause |
natj/bender | runs/out/reds.py | 1 | 3348 | import numpy as np
import matplotlib as mpl
from pylab import *
from matplotlib import cm
from matplotlib.colors import LogNorm
mpl.rcParams['image.cmap'] = 'inferno'
mpl.rc('font', family='serif')
mpl.rc('xtick', labelsize='small')
mpl.rc('ytick', labelsize='small')
gs = GridSpec(1, 3)
gs.update(hspace = 0.3)
... | mit |
IndonesiaX/edx-platform | common/djangoapps/cors_csrf/tests/test_views.py | 150 | 2397 | """Tests for cross-domain request views. """
import json
from django.test import TestCase
from django.core.urlresolvers import reverse, NoReverseMatch
import ddt
from config_models.models import cache
from cors_csrf.models import XDomainProxyConfiguration
@ddt.ddt
class XDomainProxyTest(TestCase):
"""Tests for... | agpl-3.0 |
bottompawn/kbengine | kbe/src/lib/python/Lib/test/test_pkg.py | 84 | 9759 | # Test packages (dotted-name import)
import sys
import os
import tempfile
import textwrap
import unittest
from test import support
# Helpers to create and destroy hierarchies.
def cleanout(root):
names = os.listdir(root)
for name in names:
fullname = os.path.join(root, name)
if os.path.isdir... | lgpl-3.0 |
duramato/CouchPotatoServer | libs/xmpp/auth.py | 196 | 15633 | ## auth.py
##
## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov
##
## 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, or (at your option)
## any later version.
##... | gpl-3.0 |
robmcmullen/peppy | peppy/vfs/itools/datatypes.py | 1 | 9299 | # -*- coding: UTF-8 -*-
# Copyright (C) 2004-2007 Juan David Ibáñez Palomar <jdavid@itaapy.com>
#
# 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 o... | gpl-2.0 |
staslev/incubator-beam | sdks/python/apache_beam/runners/direct/watermark_manager.py | 5 | 10299 | #
# 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 |
cgar/servo | tests/wpt/web-platform-tests/conformance-checkers/tools/ins-del-datetime.py | 107 | 8420 | # -*- coding: utf-8 -*-
import os
ccdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
template = """<!DOCTYPE html>
<meta charset=utf-8>
"""
errors = {
"date-year-0000": "0000-12-09",
"date-month-00": "2002-00-15",
"date-month-13": "2002-13-15",
"date-0005-02-29": "0005-02-29",
"date... | mpl-2.0 |
Altair3/Tanks | docs/conf.py | 20 | 6455 | # -*- coding: utf-8 -*-
#
# BZRobots documentation build configuration file, created by
# sphinx-quickstart on Tue Nov 24 12:37:33 2009.
#
# 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.
#
# Al... | gpl-3.0 |
tapanagupta/mi-instrument | mi/idk/result_set.py | 2 | 15901 | #!/usr/bin/env python
"""
@file coi-services/mi/idk/result_set.py
@author Bill French
@brief Read a result set file and use the data to verify
data particles.
Usage:
from mi.core.log import log
rs = ResultSet(result_set_file_path)
if not rs.verify(particles):
log.info("Particle verified")
else:
log.error("P... | bsd-2-clause |
HesselTjeerdsma/Cyber-Physical-Pacman-Game | test programs/test/test/lib/python2.7/site-packages/wheel/paths.py | 70 | 1129 | """
Installation paths.
Map the .data/ subdirectory names to install paths.
"""
import distutils.command.install as install
import distutils.dist as dist
import os.path
import sys
def get_install_command(name):
# late binding due to potential monkeypatching
d = dist.Distribution({'name': name})
i = inst... | apache-2.0 |
weolar/miniblink49 | v8_5_1/tools/release/test_search_related_commits.py | 45 | 8270 | #!/usr/bin/env python
# Copyright 2015 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from collections import namedtuple
from os import path
import search_related_commits
import shutil
from subprocess import Popen, PIPE... | apache-2.0 |
beppec56/xbmc | tools/EventClients/Clients/PS3 BD Remote/ps3_remote.py | 138 | 6987 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2013 Team XBMC
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) ... | gpl-2.0 |
neurodata/NeuroDataViz | python/examples/example.py | 2 | 1114 | from __future__ import print_function
import numpy as np
import ndviz
a = np.zeros((3, 100, 100, 100), dtype=np.uint8)
ix, iy, iz = np.meshgrid(* [np.linspace(0, 1, n) for n in a.shape[1:]], indexing='ij')
a[0, :, :, :] = np.abs(np.sin(4 * (ix + iy))) * 255
a[1, :, :, :] = np.abs(np.sin(4 * (iy + iz))) * 255
a[2, :,... | apache-2.0 |
djhaskin987/git-cola | cola/i18n.py | 11 | 2812 | """i18n and l10n support for git-cola"""
from __future__ import division, absolute_import, unicode_literals
import gettext as _gettext
import os
import sys
from cola import compat
from cola import core
from cola import resources
_null_translation = _gettext.NullTranslations()
# Python 3 compat
if not hasattr(_null_t... | gpl-2.0 |
hzlf/openbroadcast | website/apps/spf/util/match.py | 1 | 6519 | import os
import time
import re
import pprint
import json
import datetime
from django.conf import settings
import musicbrainzngs
from obp_legacy.models import *
from spf.models import Match, Request
import logging
log = logging.getLogger(__name__)
class MediaMatch(object):
def __init__(self):
log = ... | gpl-3.0 |
joshim5/TALE_Toolbox | TALE_Toolbox/public/views.py | 1 | 1320 | # -*- coding: utf-8 -*-
"""Public section, including homepage and signup."""
from flask import (Blueprint, request, render_template, flash, url_for,
redirect, session, make_response)
from TALE_Toolbox.utils import flash_errors
from TALE_Toolbox.computations import ReferenceSequenceGenerator
#from T... | apache-2.0 |
Thraxis/pymedusa | lib/imdb/parser/http/bsouplxml/html.py | 143 | 1175 | """
parser.http.bsouplxml.html module (imdb.parser.http package).
This module adapts the beautifulsoup interface to lxml.html module.
Copyright 2008 H. Turgut Uyar <uyar@tekir.org>
2008 Davide Alberani <da@erlug.linux.it>
This program is free software; you can redistribute it and/or modify
it under the ter... | gpl-3.0 |
ewandor/home-assistant | homeassistant/components/binary_sensor/android_ip_webcam.py | 20 | 1894 | """
Support for IP Webcam binary sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.android_ip_webcam/
"""
import asyncio
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.android_ip_w... | apache-2.0 |
markhice/ghost-casper | node_modules_bak/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/styles/perldoc.py | 364 | 2175 | # -*- coding: utf-8 -*-
"""
pygments.styles.perldoc
~~~~~~~~~~~~~~~~~~~~~~~
Style similar to the style used in the `perldoc`_ code blocks.
.. _perldoc: http://perldoc.perl.org/
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from... | mit |
noxora/flask-base | flask/lib/python3.4/site-packages/werkzeug/debug/repr.py | 254 | 9354 | # -*- coding: utf-8 -*-
"""
werkzeug.debug.repr
~~~~~~~~~~~~~~~~~~~
This module implements object representations for debugging purposes.
Unlike the default repr these reprs expose a lot more information and
produce HTML instead of ASCII.
Together with the CSS and JavaScript files of the debug... | mit |
agry/NGECore2 | scripts/mobiles/talus/lost_aqualish_marksman.py | 2 | 1662 | import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate... | lgpl-3.0 |
pcabido/socorro | socorro/processor/breakpad_pipe_to_json.py | 10 | 9304 | # 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/.
"""This module provides a function that will transate Minidump Stackwalk pipe
dump into a json format.
{
# "status": ... | mpl-2.0 |
ssteo/moviepy | moviepy/video/io/ImageSequenceClip.py | 1 | 4955 | import os
import numpy as np
from ..VideoClip import VideoClip
from imageio import imread
class ImageSequenceClip(VideoClip):
"""
A VideoClip made from a series of images.
Parameters
-----------
sequence
Can be one of these:
- The name of a folder (containing only pictures... | mit |
geekzoo/linux | linux-3.14.31/tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
mascot6699/Hackapi-Demo | src/accounts/forms.py | 69 | 3356 | from __future__ import unicode_literals
from django.contrib.auth.forms import AuthenticationForm
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Div, Submit, HTML, Button, Row, Field
from crispy_forms.bootstrap import AppendedText, PrependedText, FormActions
f... | mit |
bdaroz/the-blue-alliance | tests/test_fms_api_event_list_parser.py | 4 | 20655 | import datetime
import json
import unittest2
from datafeeds.parsers.fms_api.fms_api_event_list_parser import FMSAPIEventListParser
from google.appengine.ext import ndb
from google.appengine.ext import testbed
from consts.event_type import EventType
from models.sitevar import Sitevar
class TestFMSAPIEventListParser... | mit |
sjperkins/tensorflow | tensorflow/contrib/distributions/python/kernel_tests/bijectors/affine_test.py | 20 | 31328 | # 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 |
kobejean/tensorflow | tensorflow/python/kernel_tests/stack_op_test.py | 6 | 13529 | # 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 |
jeffmahoney/supybot | plugins/Topic/config.py | 9 | 3866 | ###
# Copyright (c) 2005, Jeremiah Fincher
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditi... | bsd-3-clause |
j717273419/ibus | ibus/keysyms.py | 15 | 30522 | # -*- Mode: Python; py-indent-offset: 4 -*-
# pygtk - Python bindings for the GTK toolkit.
# Copyright (C) 1998-2003 James Henstridge
#
# gtk/keysyms.py: list of keysyms.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as publis... | lgpl-2.1 |
bistaray/odoo-8.0-public | l10n_us_administrative/__openerp__.py | 2 | 1462 | # -*- coding: utf-8 -*-
######################################################################
#
# Note: Program metadata is available in /__init__.py
#
######################################################################
{
"name" : "United States - States & Counties",
"version" : "1.7",
"author" : "U... | agpl-3.0 |
belmiromoreira/nova | nova/tests/unit/api/openstack/compute/test_microversions.py | 42 | 15815 | # 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 |
synopat/pyload | module/plugins/hoster/WrzucTo.py | 8 | 2068 | # -*- coding: utf-8 -*-
import re
import pycurl
from ..internal.SimpleHoster import SimpleHoster
class WrzucTo(SimpleHoster):
__name__ = "WrzucTo"
__type__ = "hoster"
__version__ = "0.09"
__status__ = "testing"
__pattern__ = r'http://(?:www\.)?wrzuc\.to/(\w+(\.wt|\.html)|(\w+/?linki/\w+))'
... | gpl-3.0 |
googleapis/googleapis-gen | google/cloud/videointelligence/v1p3beta1/videointelligence-v1p3beta1-py/google/cloud/videointelligence_v1p3beta1/types/video_intelligence.py | 1 | 66604 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... | apache-2.0 |
zhuzhezhe/weibobash | env/lib/python3.4/site-packages/setuptools/package_index.py | 301 | 38760 | """PyPI and direct package downloading"""
import sys
import os
import re
import shutil
import socket
import base64
import hashlib
from functools import wraps
from pkg_resources import (
CHECKOUT_DIST, Distribution, BINARY_DIST, normalize_path, SOURCE_DIST,
require, Environment, find_distributions, safe_name, s... | mit |
Orav/kbengine | kbe/src/lib/python/Lib/py_compile.py | 3 | 7279 | """Routine to "compile" a .py file to a .pyc (or .pyo) file.
This module has intimate knowledge of the format of .pyc files.
"""
import importlib._bootstrap
import importlib.machinery
import importlib.util
import os
import os.path
import sys
import traceback
__all__ = ["compile", "main", "PyCompileError... | lgpl-3.0 |
TsinghuaX/edx-platform | lms/djangoapps/open_ended_grading/tests.py | 1 | 17560 | """
Tests for open ended grading interfaces
./manage.py lms --settings test test lms/djangoapps/open_ended_grading
"""
import json
import logging
from django.conf import settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
f... | agpl-3.0 |
mrquim/mrquimrepo | plugin.video.salts/js2py/host/jsfunctions.py | 26 | 2310 | from ..base import *
RADIX_CHARS = {'1': 1, '0': 0, '3': 3, '2': 2, '5': 5, '4': 4, '7': 7, '6': 6, '9': 9, '8': 8, 'a': 10, 'c': 12,
'b': 11, 'e': 14, 'd': 13, 'g': 16, 'f': 15, 'i': 18, 'h': 17, 'k': 20, 'j': 19, 'm': 22, 'l': 21,
'o': 24, 'n': 23, 'q': 26, 'p': 25, 's': 28, 'r': 27, 'u... | gpl-2.0 |
pmghalvorsen/gramps_branch | gramps/plugins/textreport/textplugins.gpr.py | 1 | 13748 | # encoding:utf-8
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2009 Benny Malengier
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# ... | gpl-2.0 |
tangfeixiong/nova | nova/tests/functional/db/test_cell_mapping.py | 23 | 3083 | # 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
# d... | apache-2.0 |
richardcs/ansible | lib/ansible/modules/network/eos/eos_facts.py | 42 | 10981 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
AlexRobson/scikit-learn | sklearn/cluster/tests/test_k_means.py | 132 | 25860 | """Testing for K-means"""
import sys
import numpy as np
from scipy import sparse as sp
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import SkipTest
from sklearn.utils.testing i... | bsd-3-clause |
andotrue/k_proj_dev | vendor/doctrine/orm/docs/en/_exts/configurationblock.py | 2577 | 3506 | #Copyright (c) 2010 Fabien Potencier
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, distrib... | mit |
ojengwa/odoo | addons/sale_mrp/__init__.py | 445 | 1062 | # -*- 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 |
o5k/openerp-oemedical-v0.1 | openerp/addons/base/tests/test_ir_attachment.py | 68 | 3224 | import hashlib
import os
import unittest2
import openerp
import openerp.tests.common
class test_ir_attachment(openerp.tests.common.TransactionCase):
def test_00_attachment_flow(self):
registry, cr, uid = self.registry, self.cr, self.uid
root_path = openerp.tools.config['root_path']
ira =... | agpl-3.0 |
SSSD/sssd | src/tests/intg/ent_test.py | 4 | 16139 | #
# ent.py module tests
#
# Copyright (c) 2015 Red Hat, Inc.
# Author: Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com>
#
# 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 th... | gpl-3.0 |
kwailamchan/programming-languages | javascript/backbone/backbone-templates/backbone-fileupload/venvs/lib/python2.7/site-packages/django/contrib/databrowse/tests.py | 95 | 1906 | from django.contrib import databrowse
from django.db import models
from django.test import TestCase
class SomeModel(models.Model):
some_field = models.CharField(max_length=50)
def __unicode__(self):
return self.some_field
class SomeOtherModel(models.Model):
some_other_field = models.CharField(m... | mit |
FinalsClub/karmaworld | karmaworld/apps/users/migrations/0004_auto__add_field_generickarmaevent_event_type.py | 1 | 14051 | # -*- 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):
# Adding field 'GenericKarmaEvent.event_type'
db.add_column(u'users_generickarmaevent', 'event_type',
... | agpl-3.0 |
Drizzt12/Jane | Jane-Old/Calorie_Tracker.py | 1 | 1885 | import shelve
c = shelve.open("Calories")
from datetime import datetime
now = datetime.now()
month = now.month
year = now.year
day = now.day
date = str(month) + "/" + str(day) + "/" + str(year)
yesterday = str(month) + "/" + str(day-1) + "/" + str(year)
print "In the month/day/year format, today is: ", date
print "Welc... | mit |
santoshkumarsingh/Data-Wrangling-with-MongoDB | Lesson_6_Case_Study/03-Iterative_parsing/iterative_parsing.py | 2 | 1123 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Your task is to use the iterative parsing to process the map file and
find out not only what tags are there, but also how many, to get the
feeling on how much of which data you can expect to have in the map.
The output should be a dictionary with the tag name as the key... | agpl-3.0 |
infobloxopen/infoblox-netmri | infoblox_netmri/api/broker/v2_9_0/device_object_broker.py | 14 | 52439 | from ..broker import Broker
class DeviceObjectBroker(Broker):
controller = "device_objects"
def show(self, **kwargs):
"""Shows the details for the specified device object.
**Inputs**
| ``api version min:`` None
| ``api version max:`` None
| ``requi... | apache-2.0 |
Dhivyap/ansible | test/units/modules/network/onyx/test_onyx_mlag_vip.py | 52 | 3272 | #
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from units.compat.mock import patch
from ansible.modules.network.onyx impor... | gpl-3.0 |
AladdinSonni/phantomjs | src/breakpad/src/tools/gyp/test/rules/gyptest-all.py | 137 | 1073 | #!/usr/bin/env python
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies simple rules when using an explicit build target of 'all'.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('actions... | bsd-3-clause |
guh/linux-imx6-3.14-tune | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # 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 |
mollstam/UnrealPy | UnrealPyEmbed/Source/Python/Lib/python27/user.py | 313 | 1627 | """Hook to allow user-specified customization code to run.
As a policy, Python doesn't run user-specified code on startup of
Python programs (interactive sessions execute the script specified in
the PYTHONSTARTUP environment variable if it exists).
However, some programs or sites may find it convenient to allow users... | mit |
meejah/cuvner | cuv/watch.py | 1 | 3461 | # great kurt-idea: make "lessopen" shit work with this, so "if less a
# file, and a .coverae 'up there somewhere' then highlight it"
# prints out annotated coverage to the terminal, with a
# banner-per-file showing coverage, and a total at the end.
from __future__ import print_function, absolute_import
import sys
im... | mit |
kiyoto/statsmodels | statsmodels/tools/linalg.py | 25 | 8038 | '''local, adjusted version from scipy.linalg.basic.py
changes:
The only changes are that additional results are returned
'''
from __future__ import print_function
from statsmodels.compat.python import lmap, range
import numpy as np
from scipy.linalg import svd as decomp_svd
from scipy.linalg.lapack import get_lapack... | bsd-3-clause |
cbmoore/statsmodels | statsmodels/sandbox/stats/tests/__init__.py | 219 | 6354 | '''
Econometrics for a Datarich Environment
=======================================
Introduction
------------
In many cases we are performing statistical analysis when many observed variables are
available, when we are in a data rich environment. Machine learning has a wide variety
of tools for dimension reduction an... | bsd-3-clause |
ram8647/gcb-mobilecsp | common/caching.py | 3 | 19255 | # 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 by applicable law or ... | apache-2.0 |
GustavoHennig/ansible | lib/ansible/modules/cloud/cloudstack/cs_loadbalancer_rule_member.py | 5 | 10188 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, Darren Worrall <darren@iweb.co.uk>
# (c) 2015, René Moser <mail@renemoser.net>
#
# 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 So... | gpl-3.0 |
Thoshh/wapad | lib/python2.7/site-packages/django/db/migrations/migration.py | 326 | 8023 | from __future__ import unicode_literals
from django.db.transaction import atomic
from django.utils.encoding import python_2_unicode_compatible
from .exceptions import IrreversibleError
@python_2_unicode_compatible
class Migration(object):
"""
The base class for all migrations.
Migration files will impo... | mit |
woltage/ansible | lib/ansible/utils/module_docs_fragments/openstack.py | 97 | 4021 | # Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# 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... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.