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 |
|---|---|---|---|---|---|
bufferx/tornado | tornado/test/web_test.py | 1 | 68872 | from __future__ import absolute_import, division, print_function, with_statement
from tornado import gen
from tornado.escape import json_decode, utf8, to_unicode, recursive_unicode, native_str, to_basestring
from tornado.httputil import format_timestamp
from tornado.iostream import IOStream
from tornado.log import app_... | apache-2.0 |
jgraham/servo | tests/wpt/harness/wptrunner/update/base.py | 196 | 2148 | # 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/.
exit_unclean = object()
exit_clean = object()
class Step(object):
provides = []
def __init__(self, logger):
... | mpl-2.0 |
Pal3love/otRebuilder | Package/otRebuilder/Dep/fontTools/misc/xmlReader.py | 1 | 4302 | from __future__ import print_function, division, absolute_import
from fontTools.misc.py23 import *
from fontTools import ttLib
from fontTools.misc.textTools import safeEval
from fontTools.ttLib.tables.DefaultTable import DefaultTable
import sys
import os
import logging
log = logging.getLogger(__name__)
class TTXPars... | mit |
ganeshrn/ansible | test/units/galaxy/test_collection_install.py | 15 | 43234 | # -*- coding: utf-8 -*-
# Copyright: (c) 2019, 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
import copy
import json
import os
import py... | gpl-3.0 |
hnakamur/django | django/contrib/gis/gdal/srs.py | 366 | 12043 | """
The Spatial Reference class, represents OGR Spatial Reference objects.
Example:
>>> from django.contrib.gis.gdal import SpatialReference
>>> srs = SpatialReference('WGS84')
>>> print(srs)
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY... | bsd-3-clause |
pmghalvorsen/gramps_branch | gramps/plugins/gramplet/topsurnamesgramplet.py | 2 | 3999 | # Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2007-2009 Douglas S. Blank <doug.blank@gmail.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 2 of the Lic... | gpl-2.0 |
daoluan/decode-Django | Django-1.5.1/tests/regressiontests/fixtures_regress/models.py | 60 | 5752 | from __future__ import absolute_import, unicode_literals
from django.contrib.auth.models import User
from django.db import models
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Animal(models.Model):
name = models.CharField(max_length=... | gpl-2.0 |
lyapota/m8_sense_lollipop | 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 |
zanderle/django | django/contrib/gis/gdal/envelope.py | 477 | 7009 | """
The GDAL/OGR library uses an Envelope structure to hold the bounding
box information for a geometry. The envelope (bounding box) contains
two pairs of coordinates, one for the lower left coordinate and one
for the upper right coordinate:
+----------o Upper right; (max_x, max_y)
... | bsd-3-clause |
Hellenn/doctors_joomla | templates/doctors/node_modules/node-gyp/gyp/buildbot/buildbot_run.py | 1467 | 4228 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Argument-less script to select what to run on the buildbots."""
import os
import shutil
import subprocess
import sys
BUILDBOT_DIR = os.... | gpl-2.0 |
cloudbase/cinder | cinder/tests/unit/group/test_groups_manager.py | 4 | 31202 | # Copyright (C) 2016 EMC Corporation.
# 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 requ... | apache-2.0 |
CTSRD-SOAAP/chromium-42.0.2311.135 | build/android/pylib/valgrind_tools.py | 40 | 9131 | # 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.
"""
Classes in this file define additional actions that need to be taken to run a
test under some kind of runtime error detection tool.
The interface is... | bsd-3-clause |
globau/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/test/testdata/handlers/blank_wsh.py | 499 | 1557 | # Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | mpl-2.0 |
wbc2010/django1.2.5 | django/core/mail/backends/filebased.py | 394 | 2485 | """Email backend that writes messages to a file."""
import datetime
import os
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.mail.backends.console import EmailBackend as ConsoleEmailBackend
class EmailBackend(ConsoleEmailBackend):
def __init__(self, *arg... | bsd-3-clause |
brainelectronics/towerdefense | _build/lib/pyglet/gl/glu.py | 45 | 25679 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | bsd-3-clause |
analyseuc3m/ANALYSE-v1 | lms/djangoapps/course_api/blocks/transformers/tests/test_block_counts.py | 12 | 2030 | """
Tests for BlockCountsTransformer.
"""
# pylint: disable=protected-access
from openedx.core.lib.block_structure.factory import BlockStructureFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import SampleCourseFactory
from ..block_counts import ... | agpl-3.0 |
pombreda/libforensics | code/lf/win/shell/link/dtypes.py | 13 | 5891 | # Copyright 2010 Michael Murr
#
# This file is part of LibForensics.
#
# LibForensics is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ver... | gpl-3.0 |
lishensan/xbmc | lib/gtest/test/gtest_output_test.py | 184 | 12027 | #!/usr/bin/env python
#
# Copyright 2008, 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... | gpl-2.0 |
atul-bhouraskar/django | tests/model_inheritance_regress/models.py | 243 | 5863 | from __future__ import unicode_literals
import datetime
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Place(models.Model):
name = models.CharField(max_length=50)
address = models.CharField(max_length=80)
class Meta:
... | bsd-3-clause |
Adnn/django | tests/responses/tests.py | 226 | 4171 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.http import HttpResponse
from django.http.response import HttpResponseBase
from django.test import SimpleTestCase
UTF8 = 'utf-8'
ISO88591 = 'iso-8859-1'
class HttpResponseBaseTests(SimpleTestCase):
def ... | bsd-3-clause |
0Chencc/CTFCrackTools | Lib/Lib/distutils/util.py | 6 | 22225 | """distutils.util
Miscellaneous utility functions -- anything that doesn't fit into
one of the other *util.py modules.
"""
__revision__ = "$Id: util.py 83588 2010-08-02 21:35:06Z ezio.melotti $"
import sys, os, string, re
from distutils.errors import DistutilsPlatformError
from distutils.dep_util import newer
from d... | gpl-3.0 |
chrisdev/wagtail-cookiecutter-foundation | {{cookiecutter.project_slug}}/pages/migrations/0014_auto_20170817_1705.py | 2 | 2045 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-08-17 17:05
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
import wagtail.core.fields
class Migration(migrations.Migration):
dependencies = [
('wagta... | mit |
alanlhutchison/empirical-JTK_CYCLE-with-asymmetry | previous_files/jtk7.py | 1 | 19118 | #!/usr/bin/env python
"""
Created on April 20 2014
@author: Alan L. Hutchison, alanlhutchison@uchicago.edu, Aaron R. Dinner Group, University of Chicago
This script is one in a series of scripts for running empirical JTK_CYCLE analysis as described in
Hutchison, Maienschein-Cline, and Chiang et al. Improved statisti... | mit |
blooparksystems/odoo | addons/mass_mailing/controllers/main.py | 18 | 1211 | # -*- coding: utf-8 -*-
import werkzeug
from openerp import http, SUPERUSER_ID
from openerp.http import request
class MassMailController(http.Controller):
@http.route('/mail/track/<int:mail_id>/blank.gif', type='http', auth='none')
def track_mail_open(self, mail_id, **post):
""" Email tracking. """... | gpl-3.0 |
benpatterson/edx-platform | common/djangoapps/track/migrations/0001_initial.py | 189 | 2527 | # -*- 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 model 'TrackingLog'
db.create_table('track_trackinglog', (
('id', self.gf('django.db.mo... | agpl-3.0 |
happyleavesaoc/home-assistant | tests/components/camera/test_init.py | 15 | 3572 | """The tests for the camera component."""
import asyncio
from unittest.mock import patch
import pytest
from homeassistant.setup import setup_component
from homeassistant.const import ATTR_ENTITY_PICTURE
import homeassistant.components.camera as camera
import homeassistant.components.http as http
from homeassistant.ex... | apache-2.0 |
quinot/ansible | lib/ansible/modules/network/cloudengine/ce_switchport.py | 20 | 27667 | #!/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 |
batxes/4Cin | SHH_WT_models/SHH_WT_models_final_output_0.1_-0.1_11000/SHH_WT_models47488.py | 2 | 17589 | import _surface
import chimera
try:
import chimera.runCommand
except:
pass
from VolumePath import markerset as ms
try:
from VolumePath import Marker_Set, Link
new_marker_set=Marker_Set
except:
from VolumePath import volume_path_dialog
d= volume_path_dialog(True)
new_marker_set= d.new_marker_set
marker_set... | gpl-3.0 |
craigderington/studentloan5 | studentloan5/Lib/encodings/cp874.py | 272 | 12595 | """ Python Character Mapping Codec cp874 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP874.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,inpu... | bsd-3-clause |
pchauncey/ansible | lib/ansible/modules/cloud/rackspace/rax_files.py | 33 | 11750 | #!/usr/bin/python
# (c) 2013, Paul Durivage <paul.durivage@rackspace.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_version': '1.1',
... | gpl-3.0 |
wanghao524151/scrapy_joy | open_insurance/models.py | 1 | 2916 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from django.db import models
from django.db.models.signals import pre_delete
from django.dispatch import receiver
from django.db.models.signals import pre_save
from scrapy.contrib.djangoitem import DjangoItem
from dynamic_scraper.models import Scraper, SchedulerRuntime
class... | apache-2.0 |
craftytrickster/servo | tests/wpt/css-tests/tools/pywebsocket/src/test/test_http_header_util.py | 496 | 3372 | #!/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 |
redhat-openstack/nova | nova/db/sqlalchemy/utils.py | 14 | 5568 | # Copyright (c) 2013 Boris Pavlovic (boris@pavlovic.me).
# 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... | apache-2.0 |
krieger-od/nwjs_chromium.src | tools/telemetry/telemetry/timeline/inspector_importer.py | 12 | 2626 | # Copyright 2014 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.
'''Imports event data obtained from the inspector's timeline.'''
import telemetry.timeline.slice as tracing_slice
import telemetry.timeline.thread as timelin... | bsd-3-clause |
avedaee/DIRAC | WorkloadManagementSystem/Service/OptimizationMindHandler.py | 1 | 9803 | import types
from DIRAC import S_OK, S_ERROR
from DIRAC.Core.Utilities import DEncode, ThreadScheduler
from DIRAC.Core.Security import Properties
from DIRAC.Core.Base.ExecutorMindHandler import ExecutorMindHandler
from DIRAC.WorkloadManagementSystem.Client.JobState.JobState import JobState
from DIRAC.WorkloadManagement... | gpl-3.0 |
sunils34/buffer-django-nonrel | django/core/xheaders.py | 518 | 1157 | """
Pages in Django can are served up with custom HTTP headers containing useful
information about those pages -- namely, the content type and object ID.
This module contains utility functions for retrieving and doing interesting
things with these special "X-Headers" (so called because the HTTP spec demands
that custo... | bsd-3-clause |
jannekai/project-euler | 017.py | 1 | 1222 | import time
import math
import sys
start = time.time()
w = dict()
w[1] = "one"
w[2] = "two"
w[3] = "three"
w[4] = "four"
w[5] = "five"
w[6] = "six"
w[7] = "seven"
w[8] = "eight"
w[9] = "nine"
w[10] = "ten"
w[11] = "eleven"
w[12] = "twelve"
w[13] = "thirteen"
w[14] = "fourteen"
w[15] = "fifteen"
... | mit |
dreucifer/chargenstart | product/views.py | 1 | 2302 | """ @todo """
from flask import render_template, request, flash, session, Blueprint, abort
from product.models import Product, Category
from cart.forms import AddToCartForm
from product.utils import get_or_404, first_or_abort, get_for_page, get_by_slug
from cart import ShoppingCart, SessionCart
Products = Blueprint('p... | mit |
2hdddg/pyvidstream | test/vidanalyze.py | 1 | 3170 | from unittest import TestCase
from vidutil.vidstream import Frame
import vidutil.vidanalyze as a
def _num_f(num):
f = Frame(type='P', key_frame=False, width=1, height=1,
coded_picture_number=num)
return f
class TestSplitFramesMissing(TestCase):
def test_no_missing(self):
""" Verifi... | mit |
chafique-delli/OpenUpgrade | addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/actions.py | 382 | 3763 | ##########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gener... | agpl-3.0 |
9corp/9volt | vendor/github.com/ugorji/go/codec/test.py | 1516 | 4019 | #!/usr/bin/env python
# This will create golden files in a directory passed to it.
# A Test calls this internally to create the golden files
# So it can process them (so we don't have to checkin the files).
# Ensure msgpack-python and cbor are installed first, using:
# sudo apt-get install python-dev
# sudo apt-g... | mit |
SjorsVanGelderen/Graduation | python_3/data_structures/heap.py | 1 | 5731 | """Heap data structure example
Copyright 2017, Sjors van Gelderen
"""
import random
"""Heap data structure
The 'max' property determines whether this is a max or min heap
"""
class Heap:
def __init__(self, property):
self.property = property
self.keys = []
def __repr__(self):
ret... | mit |
corburn/scikit-bio | skbio/alignment/__init__.py | 4 | 7301 | r"""
Alignments and Sequence collections (:mod:`skbio.alignment`)
============================================================
.. currentmodule:: skbio.alignment
This module provides functionality for working with biological sequence
collections and alignments. These can be composed of generic sequences,
nucelotide s... | bsd-3-clause |
gameduell/duell | bin/win/python2.7.9/Lib/quopri.py | 424 | 6969 | #! /usr/bin/env python
"""Conversions to/from quoted-printable transport encoding as per RFC 1521."""
# (Dec 1991 version).
__all__ = ["encode", "decode", "encodestring", "decodestring"]
ESCAPE = '='
MAXLINESIZE = 76
HEX = '0123456789ABCDEF'
EMPTYSTRING = ''
try:
from binascii import a2b_qp, b2a_qp
except Impo... | bsd-2-clause |
yamamatsu2/pimouse_ros | scripts/lightsensors.py | 1 | 1258 | #!/usr/bin/env python
#encoding: utf8
import sys, rospy
from pimouse_ros.msg import LightSensorValues
def get_freq():
f = rospy.get_param('lightsensors_freq',10)
try:
if f <= 0.0:
raise Exception()
except:
rospy.logerr("value error: ligtsensors_freq")
sys.exit(1)... | gpl-3.0 |
mchristopher/PokemonGo-DesktopMap | app/pylibs/win32/Cryptodome/Hash/SHA256.py | 2 | 6305 | # -*- 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 licens... | mit |
authman/Python201609 | pairol_alex/Assignments/pylotNinja/controllers/Ninja.py | 1 | 1500 | from system.core.controller import*
import random
import datetime
from time import strftime
class Ninja(Controller):
def __init__(self, action):
super(Ninja, self).__init__(action)
def index(self):
try:
session['gold']
except:
session['gold'] = 0
try:
... | mit |
surhudm/scipy | benchmarks/benchmarks/sparse_linalg_solve.py | 30 | 2163 | """
Check the speed of the conjugate gradient solver.
"""
from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.testing import assert_equal
try:
from scipy import linalg, sparse
from scipy.sparse.linalg import cg, minres, spsolve
except ImportError:
pass
try:
... | bsd-3-clause |
dbrgn/fahrplan | fahrplan/tests/test.py | 1 | 9255 | # -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
import sys
from datetime import datetime
from subprocess import Popen, PIPE
if sys.version_info[0] == 2 and sys.version_info[1] < 7:
import unittest2 as unittest
else:
import unittest
from .. import met... | gpl-3.0 |
EducationForDevelopment/webapp | lib/flask/__init__.py | 345 | 1672 | # -*- coding: utf-8 -*-
"""
flask
~~~~~
A microframework based on Werkzeug. It's extensively documented
and follows best practice patterns.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
__version__ = '0.10'
# utilities we import from Werkzeug and J... | mit |
sshleifer/object_detection_kitti | object_detection/core/matcher_test.py | 21 | 7101 | # 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 |
caidongyun/pylearn2 | pylearn2/datasets/avicenna.py | 37 | 1062 | """
.. todo::
WRITEME
"""
from pylearn2.datasets import utlc
import numpy as N
class Avicenna(object):
"""
.. todo::
WRITEME
Parameters
----------
which_set : WRITEME
standardize : WRITEME
"""
def __init__(self, which_set, standardize):
train, valid, test = utl... | bsd-3-clause |
iem-projects/WILMAmix | WILMA/gui/Translator.py | 1 | 1678 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright © 2013, IOhannes m zmölnig, IEM
# This file is part of WILMix
#
# 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 th... | gpl-2.0 |
dstufft/sqlalchemy | test/dialect/mysql/test_query.py | 12 | 6313 | # coding: utf-8
from sqlalchemy.testing import eq_, is_
from sqlalchemy import *
from sqlalchemy.testing import fixtures, AssertsCompiledSQL
from sqlalchemy import testing
class IdiosyncrasyTest(fixtures.TestBase, AssertsCompiledSQL):
__only_on__ = 'mysql'
__backend__ = True
@testing.emits_warning()
... | mit |
jsilhan/dnf-plugins-core | plugins/copr.py | 1 | 16500 | # supplies the 'copr' command.
#
# Copyright (C) 2014-2015 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is dis... | gpl-2.0 |
jcsirot/kubespray | roles/kubernetes-apps/ansible/library/kube.py | 7 | 8019 | #!/usr/bin/python
# -*- coding: utf-8 -*-
DOCUMENTATION = """
---
module: kube
short_description: Manage Kubernetes Cluster
description:
- Create, replace, remove, and stop resources within a Kubernetes Cluster
version_added: "2.0"
options:
name:
required: false
default: null
description:
- The n... | apache-2.0 |
Kamp9/scipy | scipy/io/tests/test_idl.py | 38 | 19231 | from __future__ import division, print_function, absolute_import
from os import path
from warnings import catch_warnings
DATA_PATH = path.join(path.dirname(__file__), 'data')
import numpy as np
from numpy.testing import (assert_equal, assert_array_equal, run_module_suite,
assert_)
from scipy.io.idl import reads... | bsd-3-clause |
BeegorMif/HTPC-Manager | lib/chardet/jisfreq.py | 3131 | 47315 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | gpl-3.0 |
jkonecki/autorest | ClientRuntimes/Python/msrest/doc/conf.py | 2 | 7620 | # -*- coding: utf-8 -*-
#
# azure-sdk-for-python documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 27 15:42:45 2014.
#
# 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
# autogenerate... | mit |
mapr/hue | desktop/core/ext-py/Django-1.6.10/django/utils/encoding.py | 92 | 9512 | from __future__ import unicode_literals
import codecs
import datetime
from decimal import Decimal
import locale
import warnings
from django.utils.functional import Promise
from django.utils import six
from django.utils.six.moves.urllib.parse import quote
class DjangoUnicodeDecodeError(UnicodeDecodeError):
def __... | apache-2.0 |
CiscoUcs/Ironic-UCS | build/lib.linux-x86_64-2.7/ironic/openstack/common/jsonutils.py | 7 | 6832 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... | apache-2.0 |
sogis/Quantum-GIS | python/plugins/processing/core/ProcessingLog.py | 5 | 9837 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ProcessingLog.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*************************... | gpl-2.0 |
moble/sympy | sympy/polys/domains/tests/test_polynomialring.py | 99 | 3314 | """Tests for the PolynomialRing classes. """
from sympy.polys.domains import QQ, ZZ
from sympy.polys.polyerrors import ExactQuotientFailed, CoercionFailed, NotReversible
from sympy.abc import x, y
from sympy.utilities.pytest import raises
def test_build_order():
R = QQ.old_poly_ring(x, y, order=(("lex", x), ("... | bsd-3-clause |
nwiizo/workspace_2017 | ansible-modules-core/network/eos/eos_eapi.py | 13 | 13144 | #!/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... | mit |
hatwar/Das_erpnext | erpnext/accounts/doctype/journal_entry/test_journal_entry.py | 25 | 7835 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest, frappe
from frappe.utils import flt
from erpnext.accounts.utils import get_actual_expense, BudgetError, get_fiscal_year
class TestJou... | agpl-3.0 |
iaklampanos/dj-vercereg | dj_vercereg/dj_vercereg/settings.py | 1 | 6595 | # Copyright 2014 The University of Edinburgh
#
# 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... | apache-2.0 |
jstammers/EDMSuite | NavPython/IronPython/Lib/pprint.py | 147 | 11932 | # Author: Fred L. Drake, Jr.
# fdrake@acm.org
#
# This is a simple little module I wrote to make life easier. I didn't
# see anything quite like it in the library, though I may have overlooked
# something. I wrote this when I was trying to read some heavily nested
# tuples with fairly non-desc... | mit |
m4nolo/steering-all | src/entities/relativeentity.py | 2 | 1279 | from entity import Entity
class RelativeEntity(Entity):
def __init__(self, width, height):
Entity.__init__(self, width, height)
self.margin = [0, 0, 0, 0]
def below(self, entity):
self.y = entity.y + entity.height + self.margin[1]
def above(self, entity):
self.y = entity.y - self.height - self... | mit |
etkirsch/scikit-learn | examples/svm/plot_custom_kernel.py | 171 | 1546 | """
======================
SVM with custom kernel
======================
Simple usage of Support Vector Machines to classify a sample. It will
plot the decision surface and the support vectors.
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from sklearn import svm, datasets
# import some data... | bsd-3-clause |
petercable/mi-instrument | mi/platform/rsn/simulator/oms_events.py | 5 | 10097 | #!/usr/bin/env python
"""
@package ion.agents.platform.rsn.simulator.oms_events
@file ion/agents/platform/rsn/simulator/oms_events.py
@author Carlos Rueda
@brief OMS simulator event definitions and supporting functions.
Demo program included that allows to run both a listener server and a
notif... | bsd-2-clause |
neurokernel/retina | retina/screen/map/pointmap.py | 1 | 2303 | from abc import ABCMeta, abstractmethod
class PointMap(object):
""" Interface of mapping a point from one surface to another
(hence the 2 parameters)
"""
__metaclass__ = ABCMeta
@abstractmethod
def map(self, p1, p2):
""" map of point (p1, p2) from one surface to another """
... | bsd-3-clause |
initialed85/mac_os_scripts | mac_os_scripts/set_firmware_password.py | 1 | 1788 | """
This script is responsible for setting the firmware password
Commands used:
- expect -d -f /usr/local/zetta/mac_os_scripts/external/set_firmware_password_expect
set password [lindex $argv 0];
spawn firmwarepasswd -setpasswd -setmode command
expect {
"Enter new password:" {
send "$passw... | mit |
KerkhoffTechnologies/django-connectwise | djconnectwise/migrations/0107_auto_20190729_1352.py | 1 | 1172 | # Generated by Django 2.1 on 2019-07-29 13:52
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('djconnectwise', '0106_auto_20190722_1524'),
]
operations = [
migrations.AddField(
model_name='con... | mit |
a11r/grpc | src/python/grpcio_health_checking/grpc_health/v1/health.py | 15 | 2677 | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
MjAbuz/watchdog | vendor/rdflib-2.4.0/rdflib/sparql/bison/SolutionModifier.py | 4 | 1223 | ASCENDING_ORDER = 1
DESCENDING_ORDER = 2
UNSPECIFIED_ORDER = 3
ORDER_VALUE_MAPPING = {
ASCENDING_ORDER : 'Ascending',
DESCENDING_ORDER : 'Descending',
UNSPECIFIED_ORDER : 'Default',
}
class SolutionModifier(object):
def __init__(self,orderClause=None,limitClause=None,offsetClause=None):
... | agpl-3.0 |
h0nIg/ansible-modules-extras | cloud/google/gce_img.py | 23 | 5760 | #!/usr/bin/python
# Copyright 2015 Google Inc. All Rights Reserved.
#
# 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 o... | gpl-3.0 |
dd00/commandergenius | project/jni/python/src/Lib/test/test_richcmp.py | 55 | 11262 | # Tests for rich comparisons
import unittest
from test import test_support
import operator
class Number:
def __init__(self, x):
self.x = x
def __lt__(self, other):
return self.x < other
def __le__(self, other):
return self.x <= other
def __eq__(self, other):
return... | lgpl-2.1 |
madj4ck/ansible | lib/ansible/new_inventory/host.py | 236 | 1551 | # (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 |
google-research/lasertagger | run_lasertagger_test.py | 3 | 1196 | # coding=utf-8
# Copyright 2019 The Google Research 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 applicab... | apache-2.0 |
msdx321/android_kernel_samsung_heroXqltechn | lazy-prebuilt/aarch64-linux-android-4.9/share/gdb/python/gdb/command/explore.py | 126 | 26824 | # GDB 'explore' command.
# Copyright (C) 2012-2014 Free Software Foundation, 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 late... | gpl-2.0 |
broferek/ansible | test/units/modules/network/fortios/test_fortios_system_sdn_connector.py | 21 | 19557 | # 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 |
ztp-at/RKSV | librksv/test/verification_proxy.py | 1 | 2681 | ###########################################################################
# Copyright 2017 ZT Prentner IT GmbH (www.ztp.at)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either ver... | agpl-3.0 |
zmwangx/you-get | src/you_get/extractors/qq_egame.py | 2 | 1652 | import re
import json
from ..common import get_content
from ..extractors import VideoExtractor
from ..util import log
from ..util.strings import unescape_html
__all__ = ['qq_egame_download']
class QQEgame(VideoExtractor):
stream_types = [
{'id': 'original', 'video_profile': '0', 'container': 'flv'},
... | mit |
joefutrelle/domdb | utils.py | 1 | 1859 | def rpad(s,l,pad_string=' '):
return s + (pad_string * (l - len(s)))
def asciitable(dicts,disp_cols=None,none_msg=None,border=True):
"""produce an ASCII formatted columnar table from the dicts"""
dicts = list(dicts)
if not dicts:
if none_msg is not None:
yield none_msg
retur... | mit |
drnextgis/QGIS | python/plugins/processing/algs/grass7/Grass7Utils.py | 1 | 16129 | # -*- coding: utf-8 -*-
"""
***************************************************************************
GrassUtils.py
---------------------
Date : February 2015
Copyright : (C) 2014-2015 by Victor Olaya
Email : volayaf at gmail dot com
*********************... | gpl-2.0 |
leki75/ansible | lib/ansible/modules/cloud/rackspace/rax_cbs_attachments.py | 14 | 6902 | #!/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 |
philotas/enigma2 | lib/python/Components/Converter/ServicePosition.py | 13 | 21710 | from Converter import Converter
from Poll import Poll
from enigma import iPlayableService
from Components.Element import cached, ElementError
from Components.config import config
class ServicePosition(Poll, Converter, object):
TYPE_LENGTH = 0
TYPE_POSITION = 1
TYPE_REMAINING = 2
TYPE_GAUGE = 3
TYPE_SUMMARY = 4
T... | gpl-2.0 |
DARKPOP/external_chromium_org | chrome/tools/webforms_extractor.py | 185 | 10187 | #!/usr/bin/env python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Extracts registration forms from the corresponding HTML files.
Used for extracting forms within HTML files. This script is use... | bsd-3-clause |
pyGrowler/Growler | tests/utils.py | 2 | 1128 | #
# tests/utils
#
"""
Useful functions for all tests
"""
import asyncio
import pytest
from growler.aio.http_protocol import GrowlerHTTPProtocol
import growler
def random_port():
from random import randint
return randint(1024, 2**16)
@asyncio.coroutine
def setup_test_server(unused_tcp_port, event_loop):
... | apache-2.0 |
nirzari18/Query-Analysis-Application-on-Google-App-Engine | lib/simplejson/decoder.py | 132 | 14721 | """Implementation of JSONDecoder
"""
from __future__ import absolute_import
import re
import sys
import struct
from .compat import fromhex, b, u, text_type, binary_type, PY3, unichr
from .scanner import make_scanner, JSONDecodeError
def _import_c_scanstring():
try:
from ._speedups import scanstring
... | apache-2.0 |
classcat/cctf | cctf/layers/normalization.py | 1 | 5969 | # -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import tensorflow as tf
from tensorflow.python.training import moving_averages
# masao
import cctf
#import tflearn
from .. import utils
from .. import variables as vs
def batch_normalization(incoming, beta=0.0, gamma=1.0, epsil... | agpl-3.0 |
sogis/Quantum-GIS | python/ext-libs/jinja2/testsuite/security.py | 415 | 6204 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.security
~~~~~~~~~~~~~~~~~~~~~~~~~
Checks the sandbox and other security features.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import unittest
from jinja2.testsuite import JinjaTestCase
from jinja2 import E... | gpl-2.0 |
shin-/compose | compose/cli/verbose_proxy.py | 22 | 1770 | from __future__ import absolute_import
from __future__ import unicode_literals
import functools
import logging
import pprint
from itertools import chain
import six
def format_call(args, kwargs):
args = (repr(a) for a in args)
kwargs = ("{0!s}={1!r}".format(*item) for item in six.iteritems(kwargs))
retur... | apache-2.0 |
simonwydooghe/ansible | test/units/modules/storage/netapp/test_na_ontap_snapshot.py | 38 | 8659 | # (c) 2018, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' unit tests ONTAP Ansible module: na_ontap_nvme_snapshot'''
from __future__ import print_function
import json
import pytest
from units.compat import unittest
from units.compat.mock import patch
fro... | gpl-3.0 |
ajtowns/bitcoin | test/util/bitcoin-util-test.py | 59 | 6594 | #!/usr/bin/env python3
# Copyright 2014 BitPay Inc.
# Copyright 2016-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test framework for bitcoin utils.
Runs automatically during `make check`.
Ca... | mit |
TemoaProject/temoa | temoa_model/get_comm_tech.py | 1 | 9277 | import sqlite3
import os
import sys
import getopt
import re
from collections import OrderedDict
def get_tperiods(inp_f):
file_ty = re.search(r"(\w+)\.(\w+)\b", inp_f) # Extract the input filename and extension
if not file_ty :
raise "The file type %s is not recognized." % inp_f
elif file_ty.group(2) not in (... | gpl-2.0 |
wonjunetai/pulse | features/main.py | 1 | 11431 | import json
import time
from features.features_helpers import create_paths_for_cell_line
from features.uniprot_transmem import get_transmembrane_region_features
from features.uniprot_ptm import get_postranscriptional_modification_features
from features.uniprot_elm_read import get_uniprot_elm_features
from features.gene... | mit |
glaubitz/fs-uae-debian | arcade/OpenGL/GL/VERSION/GL_1_2_images.py | 9 | 1587 | """Version 1.2 Image-handling functions
Almost all of the 1.2 enhancements are image-handling-related,
so this is, most of the 1.2 wrapper code...
Note that the functions that manually wrap certain operations are
guarded by if simple.functionName checks, so that you can use
if functionName to see if the function is a... | gpl-2.0 |
jaimahajan1997/sympy | sympy/printing/jscode.py | 17 | 10902 | """
Javascript code printer
The JavascriptCodePrinter converts single sympy expressions into single
Javascript expressions, using the functions defined in the Javascript
Math object where possible.
"""
from __future__ import print_function, division
from sympy.core import S
from sympy.codegen.ast import Assignment
... | bsd-3-clause |
divio/django | tests/template_tests/syntax_tests/test_extends.py | 86 | 15503 | from django.test import SimpleTestCase
from ..utils import setup
inheritance_templates = {
'inheritance01': "1{% block first %}&{% endblock %}3{% block second %}_{% endblock %}",
'inheritance02': "{% extends 'inheritance01' %}"
"{% block first %}2{% endblock %}{% block second %}4{% endblo... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.