repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
Tesora-Release/tesora-trove | trove/guestagent/strategies/backup/couchdb_impl.py | 1 | 1340 | # Copyright 2016 IBM 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 require... | apache-2.0 |
fbreuer/mathblogging | startpage.py | 2 | 5028 | from main import *
class StartPage(CachedPage):
cacheName = "StartPage"
def generatePage(self):
output = []
output.append( '''<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv=... | agpl-3.0 |
moreati/revelation | epiphany/test/test_opcode_factory.py | 1 | 12799 | from opcode_factory import *
import pytest
def test_arith32_immediate():
# 0bdddnnnxxiiiiiiiidddnnniii0011011 ADD
instr = 0b00000000010101010010000100011011
assert add32_immediate(rd=1, rn=0, imm=0b01010101010) == instr
# 0bdddnnnxxiiiiiiiidddnnniii0111011 SUB
instr = 0b000000000101010... | bsd-3-clause |
nilp0inter/data-is-fun | dataisfun/util/table_maker.py | 1 | 7772 | #!/usr/bin/env python
#
# Copyright (C) 2011 Roberto A. Martinez Perez
#
# This file is part of data-is-fun.
#
# data-is-fun 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 t... | gpl-3.0 |
joccing/geoguru | classes/country.py | 1 | 2531 |
"""
This is a system to query statistics for a country by approximate name match.
Author: Tay Joc Cing
Date: 10 Mar 2015
Version: 0.1
"""
class Country:
"""
This is a class to capture statistics for a country
>>> from country import Country
>>> c = Country("Singapore", {"Population":5000000, "Den... | mit |
ol-loginov/intellij-community | python/lib/Lib/site-packages/django/contrib/localflavor/au/forms.py | 309 | 1629 | """
Australian-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
import re
PHONE_DIGITS_RE ... | apache-2.0 |
haowu4682/gem5 | src/mem/ruby/network/simple/SimpleNetwork.py | 42 | 2281 | # Copyright (c) 2009 Advanced Micro Devices, 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... | bsd-3-clause |
conan-io/conan | conans/client/conf/config_installer.py | 1 | 12799 | import json
import os
import shutil
from datetime import datetime
from dateutil.tz import gettz
from contextlib import contextmanager
from six.moves.urllib.parse import urlparse
from conans import load
from conans.client import tools
from conans.client.cache.remote_registry import load_registry_txt, migrate_registry... | mit |
VanirAOSP/external_chromium_org | tools/deep_memory_profiler/subcommands/stacktrace.py | 59 | 1156 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
from lib.bucket import BUCKET_ID
from lib.subcommand import SubCommand
class StacktraceCommand(SubCommand):
def __init__(self):
super(Sta... | bsd-3-clause |
moyogo/fontbakery | tests/profiles/gdef_test.py | 3 | 3518 | from fontTools.ttLib import TTFont, newTable
from fontTools.ttLib.tables import otTables
from fontbakery.checkrunner import WARN
from fontbakery.codetesting import (assert_PASS,
assert_SKIP,
assert_results_contain,
... | apache-2.0 |
PurpleBooth/python-vm | venv/lib/python2.7/site-packages/pip/_vendor/cachecontrol/heuristics.py | 69 | 2285 | import calendar
from email.utils import formatdate, parsedate
from datetime import datetime, timedelta
def expire_after(delta, date=None):
date = date or datetime.now()
return date + delta
def datetime_to_header(dt):
return formatdate(calendar.timegm(dt.timetuple()))
class BaseHeuristic(object):
... | mit |
AmrThabet/CouchPotatoServer | libs/suds/metrics.py | 211 | 2004 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser 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 hope that it will ... | gpl-3.0 |
emergebtc/forknote | external/gtest/test/gtest_filter_unittest.py | 2826 | 21261 | #!/usr/bin/env python
#
# Copyright 2005 Google Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of... | lgpl-3.0 |
devalbo/mm_anywhere | google/protobuf/service.py | 590 | 9131 | # 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... | agpl-3.0 |
keeeener/nicki | platform/external/webkit/Tools/Scripts/webkitpy/common/net/failuremap.py | 15 | 3927 | # Copyright (C) 2010 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 ... | gpl-2.0 |
Geroxan810/UI-library | node_modules/grunt-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/generator/ninja.py | 84 | 99254 | # Copyright (c) 2013 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.
import collections
import copy
import hashlib
import json
import multiprocessing
import os.path
import re
import signal
import subprocess
import sys
import gyp
imp... | gpl-3.0 |
musicrighter/CIS422-P2 | env/lib/python3.4/site-packages/pip/_vendor/distlib/_backport/tarfile.py | 1005 | 92627 | #-------------------------------------------------------------------
# tarfile.py
#-------------------------------------------------------------------
# Copyright (C) 2002 Lars Gustaebel <lars@gustaebel.de>
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy ... | artistic-2.0 |
rdipietro/tensorflow | tensorflow/contrib/tensor_forest/python/kernel_tests/grow_tree_op_test.py | 12 | 4164 | # 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 |
TheIoTLearningInitiative/CodeLabs | Hochob/Audio/stream2chromecast/stream2chromecast.py | 2 | 24427 | #!/usr/bin/env python
"""
stream2chromecast.py: Chromecast media streamer for Linux
author: Pat Carter - https://github.com/Pat-Carter/stream2chromecast
version: 0.6.3
"""
# Copyright (C) 2014-2016 Pat Carter
#
# This file is part of Stream2chromecast.
#
# Stream2chromecast is free software: you can redistribute i... | apache-2.0 |
craigcitro/gsutil | gslib/tests/test_cat.py | 16 | 4976 | # -*- coding: utf-8 -*-
# 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 require... | apache-2.0 |
EmmanuelJohnson/ssquiz | flask/lib/python2.7/site-packages/jinja2/_stringdefs.py | 990 | 404291 | # -*- 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... | bsd-3-clause |
stephane-martin/salt-debian-packaging | salt-2016.3.3/salt/modules/chef.py | 2 | 5099 | # -*- coding: utf-8 -*-
'''
Execute chef in server or solo mode
'''
# Import Python libs
from __future__ import absolute_import
import logging
import os
import tempfile
# Import Salt libs
import salt.utils
import salt.utils.decorators as decorators
# Import 3rd-party libs
import salt.ext.six as six
log = logging.ge... | apache-2.0 |
funkring/fdoo | addons-funkring/util_test/models/util_test.py | 1 | 2062 | # -*- coding: utf-8 -*-
#############################################################################
#
# Copyright (c) 2007 Martin Reisenhofer <martin.reisenhofer@funkring.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pu... | agpl-3.0 |
ak2703/edx-platform | lms/djangoapps/student_profile/views.py | 11 | 4214 | """ Views for a student's profile information. """
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django_countries import countries
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import login_required
from django.http import Http404
from d... | agpl-3.0 |
ssuarez6/lyra | single_variable_eq/python/multiple_root.py | 1 | 1385 | from astropy.table import Table
import parser, decimal, plot
c = raw_input("Absolute(a) or Relative(r) error?\n>")
abs_error = False
if c is 'a':
abs_error = True
fn = raw_input("\nType the function:\n>f(x) = ")
fn_p = raw_input("\nType the differential of the function:\n>f'(x) = ")
fn_p_p = raw_input("\nType the ... | gpl-2.0 |
openelisglobal/openelisglobal-sandbox | installerTemplate/linux/fixes/collapseTests/testReconfiguration_Linux.py | 7 | 19653 | #! /usr/bin/python
from optparse import OptionParser
from pyPgSQL import PgSQL
from decimal import *
__author__ = "paulsc"
__date__ = "$Apr 20, 2011 1:29:05 PM$"
conn = ""
cursor = ""
test_fields = "id, method_id, uom_id, description, loinc, reporting_description, sticker_req_flag, is_active, active_begin, active_en... | mpl-2.0 |
fedora-infra/python-fedora | fedora/urlutils.py | 1 | 3429 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2009 Red Hat, Inc.
# This file is part of python-fedora
#
# python-fedora is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, ... | lgpl-2.1 |
mgaitan/scipy | scipy/io/harwell_boeing/_fortran_format_parser.py | 127 | 9092 | """
Preliminary module to handle fortran formats for IO. Does not use this outside
scipy.sparse io for now, until the API is deemed reasonable.
The *Format classes handle conversion between fortran and python format, and
FortranFormatParser can create *Format instances from raw fortran format
strings (e.g. '(3I4)', '(... | bsd-3-clause |
saguziel/incubator-airflow | airflow/contrib/example_dags/example_qubole_operator.py | 6 | 5686 | # -*- coding: utf-8 -*-
#
# 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
... | apache-2.0 |
GyrosOfWar/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/constants.py | 963 | 87346 | from __future__ import absolute_import, division, unicode_literals
import string
import gettext
_ = gettext.gettext
EOF = None
E = {
"null-character":
_("Null character in input stream, replaced with U+FFFD."),
"invalid-codepoint":
_("Invalid codepoint in stream."),
"incorrectly-placed-so... | mpl-2.0 |
40223119/w16b_test | static/Brython3.1.3-20150514-095342/Lib/optparse.py | 728 | 60616 | """A powerful, extensible, and easy-to-use option parser.
By Greg Ward <gward@python.net>
Originally distributed as Optik.
For support, use the optik-users@lists.sourceforge.net mailing list
(http://lists.sourceforge.net/lists/listinfo/optik-users).
Simple usage example:
from optparse import OptionParser
pa... | gpl-3.0 |
redapple/js2xml | tests/test_syntax.py | 1 | 6887 | import js2xml
from nose.tools import *
def test_syntax():
jscode_snippets = [
# strings
r"""
"test";
""",
r"""
"test\
multiline";
""",
# numbers
"3.14;",
"-12;",
"3.45e2;",
"0377;",
"0xFF;"
#... | mit |
caleblogemann/MyProjects | TeX/texmf/tex/latex/sagetex/makestatic.py | 1 | 2565 | #!/usr/bin/env python
##
## This is file `makestatic.py',
## generated with the docstrip utility.
##
## The original source files were:
##
## scripts.dtx (with options: `staticscript')
##
## This is a generated file. It is part of the SageTeX package.
##
## Copyright (C) 2008--2015 by Dan Drake <dr.dan.drake@gmail.c... | mit |
yamila-moreno/django | tests/auth_tests/test_management.py | 7 | 22156 | from __future__ import unicode_literals
import locale
import sys
from datetime import date
from django.apps import apps
from django.contrib.auth import management, models
from django.contrib.auth.checks import check_user_model
from django.contrib.auth.management import create_permissions
from django.contrib.auth.mana... | bsd-3-clause |
shujaatak/UAV_MissionPlanner | Lib/site-packages/numpy/distutils/tests/test_misc_util.py | 51 | 2430 | #!"C:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\bin\Debug\ipy.exe"
from numpy.testing import *
from numpy.distutils.misc_util import appendpath, minrelpath, gpaths, rel_path
from os.path import join, sep, dirname
ajoin = lambda *paths: join(*((sep,)+paths))
class TestAppendpath(Test... | gpl-2.0 |
Sylrob434/CouchPotatoServer | libs/enzyme/core.py | 180 | 15208 | # -*- coding: utf-8 -*-
# enzyme - Video metadata parser
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
# Copyright 2003-2006 Thomas Schueppel <stain@acm.org>
# Copyright 2003-2006 Dirk Meyer <dischi@freevo.org>
#
# This file is part of enzyme.
#
# enzyme is free software; you can redistribute it and/or mod... | gpl-3.0 |
Tampy/CS585 | src/ext/gtest-1.7.0/test/gtest_test_utils.py | 1100 | 10812 | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | gpl-2.0 |
suutari-ai/shoop | shuup_tests/core/test_shops.py | 3 | 2463 | # This file is part of Shuup.
#
# Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
import parler.appsettings
import pytest
from filer.models import Folder, Image
from shuup... | agpl-3.0 |
myarjunar/inasafe | safe/utilities/keyword_io.py | 1 | 22390 | # coding=utf-8
"""Keyword IO implementation."""
import logging
from ast import literal_eval
from datetime import datetime
from PyQt4.QtCore import QObject
from PyQt4.QtCore import QUrl, QDateTime
from qgis.core import QgsMapLayer
from safe.definitions.utilities import definition
from safe import messaging as m
fro... | gpl-3.0 |
popazerty/SDG-gui | lib/python/Components/SelectionList.py | 49 | 2073 | from MenuList import MenuList
from Tools.Directories import resolveFilename, SCOPE_CURRENT_SKIN
from enigma import eListboxPythonMultiContent, eListbox, gFont, RT_HALIGN_LEFT
from Tools.LoadPixmap import LoadPixmap
import skin
selectionpng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_defaul... | gpl-2.0 |
lukeiwanski/tensorflow | tensorflow/python/layers/base_test.py | 6 | 21660 | # 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 |
llloret/supercollider | tools/clang-format.py | 2 | 27928 | #!/usr/bin/env python
from __future__ import print_function, absolute_import, unicode_literals
import difflib
import glob
import os
import re
import string
import subprocess
import sys
import threading
from argparse import ArgumentParser
# Whichcraft backported shutil.which implementation
# Taken from https://github.... | gpl-3.0 |
trungnt13/scikit-learn | examples/feature_selection/plot_rfe_with_cross_validation.py | 226 | 1384 | """
===================================================
Recursive feature elimination with cross-validation
===================================================
A recursive feature elimination example with automatic tuning of the
number of features selected with cross-validation.
"""
print(__doc__)
import matplotlib.p... | bsd-3-clause |
sethportman/xhtml2pdf | xhtml2pdf/reportlab_paragraph.py | 60 | 68840 | # -*- coding: utf-8 -*-
# Copyright ReportLab Europe Ltd. 2000-2008
# see license.txt for license details
# history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/platypus/paragraph.py
# Modifications by Dirk Holtwick, 2008
from string import join, whitespace
from operator import truth
... | apache-2.0 |
BackupGGCode/python-for-android | python-modules/twisted/twisted/words/test/test_jabberxmlstream.py | 49 | 42183 | # Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.words.protocols.jabber.xmlstream}.
"""
from twisted.trial import unittest
from zope.interface.verify import verifyObject
from twisted.internet import defer, task
from twisted.internet.error import ConnectionLos... | apache-2.0 |
ThinkOpen-Solutions/odoo | addons/purchase/edi/__init__.py | 448 | 1069 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | agpl-3.0 |
ejpbruel/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/_stream_base.py | 652 | 5978 | # 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 of conditions and the f... | mpl-2.0 |
mrkarthik07/libforensics | code/lf/win/shell/link/ctypes.py | 13 | 2667 | # 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 |
bellettif/MultimodePIF | PythonWksp/multiPIF/OSM/native/network_tools.py | 1 | 6544 | '''
Created on Jan 5, 2015
@author: Francois Belletti
'''
import numpy as np
from OSM.misc.geoTools import computeDist
#
# Need to change that distance
#
def l2_dist(node_1, node_2):
lat_1 = float(node_1.get('lat'))
lon_1 = float(node_1.get('lon'))
lat_2 = float(node_2.get('lat'))
lon_2 = float(n... | gpl-2.0 |
jvantuyl/exim_ses_transport | setup.py | 1 | 1915 | """
setuptools installer for exim_ses_transport
"""
# Copyright 2011, Jayson Vantuyl <jvantuyl@gmail.com>
#
# This file is part of exim_ses_transport.
#
# exim_ses_transport 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 S... | lgpl-3.0 |
SteerSuite/steersuite-rutgers | steerstats/tests/parse-test.py | 8 | 2156 | import psycopg2
from steersuite import LogParser
from steersuitedb import Composite1Benchmark
# import steersuitedb.Composite1Benchmark
logfile = open('ppr/test.log', 'r')
lparser = LogParser.LogParser()
out = lparser.parseLog(logfile)
con = psycopg2.connect(database='steersuitedb', user='steeruser', password='ste... | gpl-3.0 |
atsuyim/readthedocs.org | readthedocs/restapi/permissions.py | 18 | 2215 | from rest_framework import permissions
from readthedocs.privacy.backend import AdminPermission
class IsOwner(permissions.BasePermission):
"""
Custom permission to only allow owners of an object to edit it.
"""
def has_object_permission(self, request, view, obj):
# Write permissions are only a... | mit |
phil-lopreiato/the-blue-alliance | tests/models_tests/notifications/test_awards.py | 2 | 6181 | import unittest2
from google.appengine.ext import ndb
from google.appengine.ext import testbed
from consts.award_type import AwardType
from consts.event_type import EventType
from consts.notification_type import NotificationType
from models.award import Award
from models.event import Event
from models.team import Tea... | mit |
celibertojr/Kbsim | Bots/Renderbot.py | 2 | 10513 |
"""
Renderbot
Renderbot is an advanced bot used in conjunction with the
designer module. It demonstrates arbitrary pattern formation.
Based on the Abot, see it for some details.
NOTE: The next position is defined by two existing reference
points in the pattern. Bots bumping into each other is an
issue... | gpl-3.0 |
Oslandia/vizitown_plugin | twisted/lore/lint.py | 32 | 8849 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Checker for common errors in Lore documents.
"""
from xml.dom import minidom as dom
import parser
import urlparse
import os.path
from twisted.lore import tree, process
from twisted.web import domhelpers
from twisted.python import reflect
fro... | gpl-2.0 |
fujunwei/chromium-crosswalk | tools/git/git-diff-ide.py | 197 | 2668 | #!/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.
"""
Invokes git diff [args...] and inserts file:line in front of each line of diff
output where possible.
This is useful fro... | bsd-3-clause |
apollo13/ansible | lib/ansible/galaxy/token.py | 25 | 5736 | ########################################################################
#
# (C) 2015, Chris Houseknecht <chouse@ansible.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 Fo... | gpl-3.0 |
baylee/django | tests/model_package/tests.py | 380 | 2668 | from __future__ import unicode_literals
from django.db import connection, models
from django.db.backends.utils import truncate_name
from django.test import TestCase
from .models.article import Article, Site
from .models.publication import Publication
class Advertisement(models.Model):
customer = models.CharFiel... | bsd-3-clause |
leture/sorl-thumbnail | sorl/thumbnail/engines/convert_engine.py | 1 | 5931 | from __future__ import unicode_literals, with_statement
import re
import os
import subprocess
from django.utils.encoding import smart_str
from django.core.files.temp import NamedTemporaryFile
from sorl.thumbnail.base import EXTENSIONS
from sorl.thumbnail.compat import b
from sorl.thumbnail.conf import settings
from s... | bsd-3-clause |
JosephCastro/selenium | py/test/selenium/common/utils.py | 65 | 2074 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
twobraids/socorro | socorro/processor/general_transform_rules.py | 9 | 2533 | # 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/.
from socorro.lib.transform_rules import Rule
#========================================================================... | mpl-2.0 |
boehlke/OpenSlides | openslides/core/migrations/0008_changed_logo_fields.py | 9 | 1996 | # -*- coding: utf-8 -*-
# Generated by Finn Stutzenstein on 2018-07-13 12:43 :)
from __future__ import unicode_literals
from django.db import migrations
from openslides.core.config import config
def logos_available_default_to_database(apps, schema_editor):
"""
Writes the new default value of the 'logos_avai... | mit |
nwchandler/ansible | lib/ansible/module_utils/facts/virtual/base.py | 199 | 2298 | # base classes for virtualization facts
# -*- coding: utf-8 -*-
#
# 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 optio... | gpl-3.0 |
c0710204/edx-platform | lms/djangoapps/verify_student/ssencrypt.py | 55 | 7001 | """
NOTE: Anytime a `key` is passed into a function here, we assume it's a raw byte
string. It should *not* be a string representation of a hex value. In other
words, passing the `str` value of
`"32fe72aaf2abb44de9e161131b5435c8d37cbdb6f5df242ae860b283115f2dae"` is bad.
You want to pass in the result of calling .decode... | agpl-3.0 |
michelp/pywt | util/refguide_check.py | 2 | 27051 | #!/usr/bin/env python
"""
refguide_check.py [OPTIONS] [-- ARGS]
Check for a PyWavelets submodule whether the objects in its __all__ dict
correspond to the objects included in the reference guide.
Example of usage::
$ python refguide_check.py optimize
Note that this is a helper script to be able to check if thin... | mit |
blaggacao/odoo | addons/product_visible_discount/product_visible_discount.py | 12 | 4423 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
ArthurChiao/code-snippets | python/command-line-chess/Piece.py | 1 | 1991 | from Coordinate import Coordinate as C
from Move import Move
WHITE = True
BLACK = False
X = 0
Y = 1
class Piece:
def __init__(self, board, side, position, movesMade=0):
self.board = board
self.side = side
self.position = position
self.movesMade = 0
def __str__(self):
... | mit |
bitcity/django | tests/many_to_many/tests.py | 204 | 21896 | from __future__ import unicode_literals
from django.db import transaction
from django.test import TestCase
from django.utils import six
from .models import Article, InheritedArticleA, InheritedArticleB, Publication
class ManyToManyTests(TestCase):
def setUp(self):
# Create a couple of Publications.
... | bsd-3-clause |
aerickson/ansible | lib/ansible/modules/files/blockinfile.py | 49 | 10650 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, 2015 YAEGASHI Takeshi <yaegashi@debian.org>
#
# 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 ... | gpl-3.0 |
pierreg/tensorflow | tensorflow/python/kernel_tests/bitcast_op_test.py | 29 | 2317 | # 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 |
dsiddharth/access-keys | keystone/common/sql/migrate_repo/versions/001_add_initial_tables.py | 8 | 5811 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... | apache-2.0 |
jsirois/commons | tests/python/twitter/common/zookeeper/serverset/test_endpoint.py | 8 | 2960 | # ==================================================================================================
# Copyright 2013 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | apache-2.0 |
cnh/docker-registry | tests/mock_s3.py | 35 | 1940 | # -*- coding: utf-8 -*-
'''Monkeypatch s3 Storage preventing parallel key stream read in unittesting.
It is called from lib/storage/s3'''
import six
from docker_registry.core import exceptions
import docker_registry.drivers.s3 as s3
from docker_registry.testing import utils
@six.add_metaclass(utils.monkeypatch_... | apache-2.0 |
ritchyteam/odoo | addons/account/wizard/account_report_aged_partner_balance.py | 378 | 4012 | # -*- 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 |
DrMeers/django | django/contrib/gis/tests/layermap/models.py | 75 | 2275 | from django.contrib.gis.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class NamedModel(models.Model):
name = models.CharField(max_length=25)
objects = models.GeoManager()
class Meta:
abstract = True
app_label = 'layermap'
... | bsd-3-clause |
jmchilton/lwr | lwr/managers/queued_cli.py | 1 | 2771 | """
LWR job manager that uses a CLI interface to a job queue (e.g. Torque's qsub,
qstat, etc...).
"""
from .base.external import ExternalBaseManager
from .util.external import parse_external_id
from .util.cli import CliInterface, split_params
from .util.job_script import job_script
from logging import getLogger
log =... | apache-2.0 |
Sakaki/pyniconico | nico_tools/nicovideo_dl.py | 1 | 8551 | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
from urllib import parse
import os
from nico_tools import nico_xml_parser
from nico_tools.nicowalker import NicoWalker
from nico_tools.mylist_items import GetMyListItems
from nico_tools.mylist import MyList
from progressbar import ProgressBar, Percentage, Bar, ETA
import s... | lgpl-3.0 |
GehenHe/Recognize-Face-on-Android | tensorflow/contrib/session_bundle/constants.py | 121 | 1311 | # 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 |
manisandro/qgis-cloud-plugin | qgiscloud/resources_rc.py | 1 | 33300 | # -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt (Qt v4.8.6)
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore
qt_resource_data = "\
\x00\x00\x1c\x5f\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\xc8\x00\... | gpl-2.0 |
public-ink/public-ink | server/appengine/lib/matplotlib/_color_data.py | 12 | 34896 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
from collections import OrderedDict
import six
BASE_COLORS = {
'b': (0, 0, 1),
'g': (0, 0.5, 0),
'r': (1, 0, 0),
'c': (0, 0.75, 0.75),
'm': (0.75, 0, 0.75),
'y': (0.75, 0.75, 0),
'k... | gpl-3.0 |
jonathanverner/brython | www/speed/benchmarks/util.py | 17 | 1778 | """Utility code for benchmark scripts."""
__author__ = "collinwinter@google.com (Collin Winter)"
import math
import operator
def run_benchmark(options, num_runs, bench_func, *args):
"""Run the given benchmark, print results to stdout.
Args:
options: optparse.Values instance.
num_runs: numbe... | bsd-3-clause |
darribas/pysal | pysal/__init__.py | 5 | 3399 | """
Python Spatial Analysis Library
===============================
Documentation
-------------
PySAL documentation is available in two forms: python docstrings and an html \
webpage at http://pysal.org/
Available sub-packages
----------------------
cg
Basic data structures and tools for Computational G... | bsd-3-clause |
Pulgama/supriya | etc/pending_ugens/TGrains.py | 1 | 8796 | import collections
from supriya.enums import CalculationRate
from supriya.ugens.MultiOutUGen import MultiOutUGen
class TGrains(MultiOutUGen):
"""
::
>>> tgrains = supriya.ugens.TGrains.ar(
... amp=0.1,
... buffer_id=0,
... center_pos=0,
... channel_cou... | mit |
jankoslavic/numpy | numpy/f2py/capi_maps.py | 17 | 29404 | #!/usr/bin/env python
"""
Copyright 1999,2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
$Date: 2005/05/06 10:57:33 $
Pearu Peterson... | bsd-3-clause |
eval1749/elang | build/android/gyp/package_resources.py | 3 | 11007 | #!/usr/bin/env python
#
# 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.
# pylint: disable=C0301
"""Package resources into an apk.
See https://android.googlesource.com/platform/tools/base/+/master/legacy/a... | apache-2.0 |
goir/virtualenv-creator | virtualenv.py | 6 | 99413 | #!/usr/bin/env python
"""Create a "virtual" Python installation
"""
__version__ = "13.1.0"
virtualenv_version = __version__ # legacy
import base64
import sys
import os
import codecs
import optparse
import re
import shutil
import logging
import tempfile
import zlib
import errno
import glob
import distutils.sysconfig
... | gpl-2.0 |
damdam-s/OpenUpgrade | addons/mrp/wizard/mrp_workcenter_load.py | 381 | 2222 | # -*- 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 |
bossino/tq210-kernel | tools/perf/scripts/python/syscall-counts-by-pid.py | 944 | 1744 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(... | gpl-2.0 |
jimporter/bfg9000 | test/unit/platforms/test_target.py | 1 | 4657 | from unittest import mock
from .. import *
from bfg9000.platforms import platform_name, target, posix
class TestTargetPlatform(TestCase):
def setUp(self):
platform_name._reset()
def tearDown(self):
platform_name._reset()
def test_default(self):
with mock.patch('platform.system'... | bsd-3-clause |
meabsence/python-for-android | python3-alpha/python3-src/Lib/tkinter/constants.py | 375 | 1493 | # Symbolic constants for Tk
# Booleans
NO=FALSE=OFF=0
YES=TRUE=ON=1
# -anchor and -sticky
N='n'
S='s'
W='w'
E='e'
NW='nw'
SW='sw'
NE='ne'
SE='se'
NS='ns'
EW='ew'
NSEW='nsew'
CENTER='center'
# -fill
NONE='none'
X='x'
Y='y'
BOTH='both'
# -side
LEFT='left'
TOP='top'
RIGHT='right'
BOTTOM='bottom'
# -relief
RAISED='rai... | apache-2.0 |
CiscoSystems/quantum | neutron/plugins/cisco/extensions/_credential_view.py | 24 | 1905 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2011 Cisco Systems, 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... | apache-2.0 |
anandbhoraskar/Diamond | src/diamond/handler/mqtt.py | 31 | 5740 | # coding=utf-8
"""
Send metrics to an MQTT broker.
### Dependencies
* [mosquitto](http://mosquitto.org/documentation/python/)
* Python `ssl` module (and Python >= 2.7)
In order for this to do something useful, you'll need an
MQTT broker (e.g. [mosquitto](http://mosquitto.org) and
a `diamond.conf` containing somethi... | mit |
adviti/melange | app/soc/views/helper/url.py | 1 | 1660 | #!/usr/bin/env python2.5
#
# Copyright 2011 the Melange 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 applic... | apache-2.0 |
seann1/portfolio5 | .meteor/dev_bundle/python/Lib/copy_reg.py | 442 | 6800 | """Helper to provide extensibility for pickle/cPickle.
This is only useful to add pickle support for extension types defined in
C, not for instances of user-defined classes.
"""
from types import ClassType as _ClassType
__all__ = ["pickle", "constructor",
"add_extension", "remove_extension", "clear_extens... | gpl-2.0 |
probablytom/tomwallis.net | venv/lib/python2.7/site-packages/django/contrib/staticfiles/utils.py | 114 | 1976 | import os
import fnmatch
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
def matches_patterns(path, patterns=None):
"""
Return True or False depending on whether the ``path`` should be
ignored (if it matches any pattern in ``ignore_patterns``).
"""
if patte... | artistic-2.0 |
geminy/aidear | oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/net/data/verify_certificate_chain_unittest/generate-expired-target.py | 5 | 1324 | #!/usr/bin/python
# Copyright (c) 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.
"""Certificate chain with 1 intermediate, where the target is expired (violates
validity.notAfter). Verification is expected to fail.""... | gpl-3.0 |
LokiCoder/Sick-Beard | lib/pythontwitter/__init__.py | 23 | 150067 | #!/usr/bin/env python
#
# vim: sw=2 ts=2 sts=2
#
# Copyright 2007 The Python-Twitter Developers
#
# 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-... | gpl-3.0 |
ebattenberg/Lasagne | lasagne/layers/embedding.py | 2 | 1857 | import numpy as np
import theano.tensor as T
from .. import init
from .base import Layer
__all__ = [
"EmbeddingLayer"
]
class EmbeddingLayer(Layer):
"""
A layer for word embeddings. The input should be an integer type
Tensor variable.
Parameters
----------
incoming : a :class:`Layer` i... | mit |
ondra-novak/chromium.src | chrome/common/extensions/docs/server2/mock_file_system.py | 7 | 4312 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import posixpath
from file_system import FileSystem, FileNotFoundError
from future import Future
from test_file_system import _List, _StatTracker, TestFileS... | bsd-3-clause |
annarev/tensorflow | tensorflow/python/kernel_tests/bitcast_op_test.py | 12 | 3137 | # 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.