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 |
|---|---|---|---|---|---|
jkbradley/spark | python/pyspark/ml/tuning.py | 2 | 33935 | #
# 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 |
abdhaleegit/avocado-misc-tests | cpu/numactl.py | 4 | 2477 | #!/usr/bin/env python
#
# 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 distributed in the hope that... | gpl-2.0 |
dulems/hue | desktop/core/ext-py/kazoo-2.0/kazoo/tests/test_gevent_handler.py | 36 | 4326 | import unittest
from nose import SkipTest
from nose.tools import eq_
from nose.tools import raises
from kazoo.client import KazooClient
from kazoo.exceptions import NoNodeError
from kazoo.protocol.states import Callback
from kazoo.testing import KazooTestCase
from kazoo.tests import test_client
class TestGeventHand... | apache-2.0 |
xme1226/sahara | sahara/db/migration/alembic_migrations/versions/010_auto_security_groups.py | 5 | 1565 | # Copyright 2014 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | apache-2.0 |
UTNkar/moore | src/home/migrations/0008_auto_20170712_1146.py | 1 | 15456 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-12 09:46
from __future__ import unicode_literals
from django.db import migrations
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.images.blocks
class Migration(migrations.Migration):
dependencies = [
('home', '0007_auto... | agpl-3.0 |
eschleicher/flask_shopping_list | venv/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/retry.py | 699 | 9924 | import time
import logging
from ..exceptions import (
ConnectTimeoutError,
MaxRetryError,
ProtocolError,
ReadTimeoutError,
ResponseError,
)
from ..packages import six
log = logging.getLogger(__name__)
class Retry(object):
""" Retry configuration.
Each retry attempt will create a new Re... | mit |
350dotorg/Django | django/db/backends/sqlite3/creation.py | 63 | 3259 | import os
import sys
from django.db.backends.creation import BaseDatabaseCreation
class DatabaseCreation(BaseDatabaseCreation):
# SQLite doesn't actually support most of these types, but it "does the right
# thing" given more verbose field definitions, so leave them as is so that
# schema inspection is mor... | bsd-3-clause |
nibrahim/PlasTeX | plasTeX/Base/LaTeX/pyuca.py | 9 | 4317 | # pyuca - Unicode Collation Algorithm
# Version: 2006-02-13
#
# James Tauber
# http://jtauber.com/
# Copyright (c) 2006 James Tauber
#
# 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 withou... | mit |
sharad/calibre | src/calibre/devices/cybook/t2b.py | 24 | 13852 | __license__ = 'GPL v3'
__copyright__ = '2009, John Schember <john at nachtimwald.com>'
'''
Write a t2b file to disk.
'''
import StringIO
DEFAULT_T2B_DATA = '\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf... | gpl-3.0 |
psiwczak/openstack | nova/compute/__init__.py | 11 | 1075 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | apache-2.0 |
CARocha/plataforma_fadcanic | actividades/contraparte/migrations/0001_initial.py | 3 | 9990 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import smart_selects.db_fields
import actividades.thumbs
from django.conf import settings
import actividades.utils
class Migration(migrations.Migration):
dependencies = [
('fadcanic', '__first__'),
... | mit |
markllama/openshift-ansible | roles/openshift_health_checker/openshift_checks/logging/kibana.py | 39 | 9211 | """
Module for performing checks on a Kibana logging deployment
"""
import json
import ssl
# pylint can't find the package when its installed in virtualenv
# pylint: disable=import-error,no-name-in-module
from ansible.module_utils.six.moves.urllib import request
# pylint: disable=import-error,no-name-in-module
from a... | apache-2.0 |
acsone/odoo-autodiscover | odoo_autodiscover/post_import_hook.py | 1 | 1842 | # -*- coding: utf-8 -*-
# © 2017 ACSONE SA/NV
# License LGPLv3 (http://www.gnu.org/licenses/lgpl-3.0-standalone.html)
import os
import sys
def hook_odoo(package):
""" work around Odoo 10 issue
https://github.com/acsone/setuptools-odoo/issues/10
# This hook should runs after all *-nspkg.pth files because... | lgpl-3.0 |
barnsnake351/neutron | neutron/tests/tempest/common/service_client.py | 47 | 3320 | # Copyright 2015 NEC 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 required ... | apache-2.0 |
richardkiss/apple_iic_xfer | xferdos33.py | 1 | 3651 | #!/usr/bin/env python
# about the Apple //c serial port:
# http://support.apple.com/kb/TA38851?viewlocale=en_US
# http://support.apple.com/kb/TA29788?viewlocale=en_US
import binascii
import io
import re
import sys
import time
import serial
SERIAL_PORT_DEVICE = "/dev/ttyUSB0"
APPLE_BIN = """8000:A9 0F 85 01 18 ... | mit |
breadley/learning_machine | utils.py | 2 | 7703 | from __future__ import division,print_function
# Credit for utils.py: https://github.com/fastai/courses
import math, os, json, sys, re
import cPickle as pickle
from glob import glob
import numpy as np
from matplotlib import pyplot as plt
from operator import itemgetter, attrgetter, methodcaller
from collections impor... | apache-2.0 |
johncsnyder/SwiftKitten | pycparser/pycparser/plyparser.py | 79 | 1594 | #-----------------------------------------------------------------
# plyparser.py
#
# PLYParser class and other utilites for simplifying programming
# parsers with PLY
#
# Copyright (C) 2008-2015, Eli Bendersky
# License: BSD
#-----------------------------------------------------------------
class Coord(object):
... | mit |
toofar/qutebrowser | qutebrowser/commands/__init__.py | 5 | 1420 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | gpl-3.0 |
Bharath-J/Mezzanine | mezzanine/core/defaults.py | 1 | 22885 | """
Default settings for the ``mezzanine.core`` app. Each of these can be
overridden in your project's settings module, just like regular
Django settings. The ``editable`` argument for each controls whether
the setting is editable via Django's admin.
Thought should be given to how a setting is actually used before
mak... | bsd-2-clause |
jmlopez-rod/excentury | excentury/lang/mathematica/m_writer.py | 1 | 3997 | """MATHEMATICA M FILE
Writes the mathematica package.
"""
import re
from excentury.command import trace, date
from excentury.lang import write_file
# pylint: disable=W0142
def _replacer(*key_val):
"""Helper function for replace.
Source: <http://stackoverflow.com/a/15221068/788553>
"""
replace_dict... | bsd-2-clause |
jgmanzanas/CMNT_004_15 | project-addons/geoengine_partner/__openerp__.py | 1 | 1344 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi
# Copyright 2011-2012 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# ... | agpl-3.0 |
zombi-x/that1_kernel_asus_tf700t | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
numenta/nupic.research | nupic/research/frameworks/vernon/mixins/rezero_weights.py | 3 | 2835 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2020, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
coherence-project/UPnP-Inspector | upnp_inspector/mediarenderer.py | 2 | 27259 | # -*- coding: utf-8 -*-
# Licensed under the MIT license
# http://opensource.org/licenses/mit-license.php
# Copyright 2009 - Frank Scholz <coherence@beebits.net>
# Copyright 2014 - Hartmut Goebel <h.goebel@crazy-compilers.com>
import pygtk
pygtk.require("2.0")
import gtk
if __name__ == '__main__':
from twisted.... | mit |
sofianehaddad/ot-svn | python/test/t_TriangularComplexMatrix_std.py | 2 | 4189 | #! /usr/bin/env python
from openturns import *
from math import *
TESTPREAMBLE()
try:
# DEFAULT CONSTRUCTOR AND STRING CONVERTER
print "test : default constructor and string converter"
# Default constructor
triangularMatrix0 = TriangularComplexMatrix()
# String converter
print "triangularMa... | mit |
kamawanu/pydbgr | trepan/processor/subcmd.py | 2 | 5621 | # -*- coding: utf-8 -*-
# Copyright (C) 2006-2010, 2013 Rocky Bernstein
#
# 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 v... | gpl-3.0 |
gwsu2008/automation | python/sample-class.py | 1 | 1185 | import telnetlib
class Emulator:
def __init__(self, port, debug=False):
self.__connect(port, debug)
def __connect(self, port, debug=False):
if debug:
print("Initiating connection to port {}...".format(port))
self.conn = telnetlib.Telnet("localhost", port)
self.co... | gpl-2.0 |
RedHatInsights/insights-core | insights/combiners/tests/test_sys_vmbus_devices.py | 1 | 2443 | import doctest
from insights.combiners import sys_vmbus_devices
from insights.parsers.sys_vmbus import SysVmbusDeviceID, SysVmbusClassID
from insights.tests import context_wrap
DEVICE_ID_1 = """
{47505500-0001-0000-3130-444531444234}
""".strip()
CLASS_ID_1 = """
{44c4f61d-4444-4400-9d52-802e27ede19f}
""".strip()
D... | apache-2.0 |
educreations/celery-queued-once | queued_once/tests.py | 1 | 5849 | from celery import current_app
from celery.task import current, task
from django.conf import settings
from django.core.cache import get_cache
from django.test import SimpleTestCase
from django.test.utils import override_settings
from queued_once import CouldNotObtainLock, QueuedOnceTask
@task(base=QueuedOnceTask)
de... | mit |
fnaum/rez | src/rez/vendor/yaml/lib3/nodes.py | 985 | 1440 |
class Node(object):
def __init__(self, tag, value, start_mark, end_mark):
self.tag = tag
self.value = value
self.start_mark = start_mark
self.end_mark = end_mark
def __repr__(self):
value = self.value
#if isinstance(value, list):
# if len(value) == 0:
... | lgpl-3.0 |
brownian/frescobaldi | frescobaldi_app/quickremove.py | 3 | 7575 | # This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2013 - 2014 by Wilbert Berendsen
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
... | gpl-2.0 |
wxgeo/geophar | wxgeometrie/sympy/codegen/algorithms.py | 3 | 4989 | from __future__ import (absolute_import, division, print_function)
from sympy import And, Gt, Lt, Abs, Dummy, oo, Tuple, Symbol, Function, Pow
from sympy.codegen.ast import (
Assignment, AddAugmentedAssignment, CodeBlock, Declaration, FunctionDefinition,
Print, Return, Scope, While, Variable, Pointer, real
)
... | gpl-2.0 |
pfhayes/boto | boto/ec2/ec2object.py | 150 | 5554 | # Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
#
# 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
# w... | mit |
PopCap/GameIdea | Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/Lib/bsddb/test/test_pickle.py | 113 | 1978 |
import os
import pickle
import sys
if sys.version_info[0] < 3 :
try:
import cPickle
except ImportError:
cPickle = None
else :
cPickle = None
import unittest
from test_all import db, test_support, get_new_environment_path, get_new_database_path
#------------------------------------------... | bsd-2-clause |
chunywang/crosswalk-test-suite | cordova/cordova-sampleapp-android-tests/sampleapp/privateNotes_close.py | 15 | 2239 | #!/usr/bin/env python
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... | bsd-3-clause |
unapiedra/BBChop | analysis/analysisRanges.py | 1 | 1145 | # Copyright 2008 Ealdwulf Wuffinga
# This file is part of BBChop.
#
# BBChop 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 ... | gpl-2.0 |
thresholdsoftware/asylum-v2.0 | openerp/addons/l10n_at/__init__.py | 438 | 1050 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) conexus.at
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public ... | agpl-3.0 |
OSSESAC/odoopubarquiluz | addons/document_page/web/widgets/wiki.py | 52 | 8430 | ###############################################################################
#
# Copyright (C) 2007-TODAY Tiny ERP Pvt Ltd. All Rights Reserved.
#
# $Id$
#
# Developed by Tiny (http://openerp.com) and Axelor (http://axelor.com).
#
# The OpenERP web client is distributed under the "OpenERP Public License".
# It's bas... | agpl-3.0 |
ahmadia/bokeh | bokeh/charts/builder/tests/test_timeseries_builder.py | 33 | 2825 | """ This is the Bokeh charts testing interface.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with thi... | bsd-3-clause |
pyecs/servo | tests/wpt/css-tests/tools/wptserve/wptserve/stash.py | 67 | 2732 | import uuid
#TODO: Consider expiring values after some fixed time for long-running
#servers
class Stash(object):
"""Key-value store for persisting data across HTTP requests.
This data store specifically designed for persisting data across
HTTP requests. It is entirely in-memory so data will not be
p... | mpl-2.0 |
abimannans/scikit-learn | sklearn/manifold/spectral_embedding_.py | 128 | 19845 | """Spectral Embedding"""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Wei LI <kuantkid@gmail.com>
# License: BSD 3 clause
import warnings
import numpy as np
from scipy import sparse
from scipy.linalg import eigh
from scipy.sparse.linalg import lobpcg
from ..base import BaseEstimator
from ..ext... | bsd-3-clause |
p-l-/ivre | ivre/analyzer/ike.py | 1 | 16431 | #! /usr/bin/env python
# This file is part of IVRE.
# Copyright 2011 - 2021 Pierre LALET <pierre@droids-corp.org>
#
# IVRE 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
#... | gpl-3.0 |
kawasaki2013/python-for-android-x86 | python-modules/twisted/twisted/internet/task.py | 56 | 23511 | # -*- test-case-name: twisted.test.test_task,twisted.test.test_cooperator -*-
# Copyright (c) 2001-2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Scheduling utility methods and classes.
@author: Jp Calderone
"""
__metaclass__ = type
import time
from zope.interface import implements
from twisted.... | apache-2.0 |
bbenko/shinkicker | django/template/loaders/cached.py | 229 | 2469 | """
Wrapper class that takes a list of template loaders as an argument and attempts
to load templates from them in order, caching the result.
"""
from django.core.exceptions import ImproperlyConfigured
from django.template.base import TemplateDoesNotExist
from django.template.loader import BaseLoader, get_template_fro... | bsd-3-clause |
fkolacek/FIT-VUT | bp-revok/python/lib/python2.7/test/test_defaultdict.py | 20 | 5740 | """Unit tests for collections.defaultdict."""
import os
import copy
import tempfile
import unittest
from test import test_support
from collections import defaultdict
def foobar():
return list
class TestDefaultDict(unittest.TestCase):
def test_basic(self):
d1 = defaultdict()
self.assertEqual... | apache-2.0 |
jamesturk/tot | api/urls.py | 1 | 1074 | from . import views
from django.conf.urls import url
urlpatterns = [
url(r'^jurisdictions/$', views.JurisdictionList.as_view()),
url(r'^(?P<pk>ocd-jurisdiction/.+)/$',
views.JurisdictionDetail.as_view(), name='jurisdiction-detail'),
url(r'^people/$', views.PersonList.as_view()),
url(r'^(?P<pk>... | mit |
hunter007/django | tests/delete_regress/tests.py | 182 | 13415 | from __future__ import unicode_literals
import datetime
from django.conf import settings
from django.db import DEFAULT_DB_ALIAS, models, transaction
from django.db.utils import ConnectionHandler
from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature
from .models import (
Award, AwardNote, Boo... | bsd-3-clause |
iegor/kdeutils | superkaramba/examples/change_interval/interval.py | 4 | 1292 | #
# Written by Luke Kenneth Casson Leighton <lkcl@lkcl.net>
# This theme is demonstrates the interval timer changing.
#this import statement allows access to the karamba functions
import karamba
seq = 0
text = None
#this is called when you widget is initialized
def initWidget(widget):
karamba.redrawWidget(widget... | gpl-2.0 |
openhomity/homity-hub | Hub/v1/Common/User.py | 1 | 1289 | """DB Class For User."""
from couchdb.mapping import TextField
from Hub.v1.Common.base import HomityObject
from uuid import uuid4
from hashlib import sha256
class User(HomityObject):
"""DB Class For User."""
password = TextField()
def __init__(self, username=None, password="", **values):
HomityObj... | apache-2.0 |
dandygithub/kodi | addons/plugin.video.tivix.net/resources/lib/decoder.py | 1 | 4243 | # -*- coding: utf-8 -*-
import os
def decoder(w,i,s,e):
A1=0
A2=0
A3=0
L1=[]
L2=[]
while True:
if A1<5: L2.append(w[A1])
elif A1<len(w): L1.append(w[A1])
A1+=1
if A2<5: L2.append(i[A2])
elif A2<len(i): L1.append(i[A2])
A2+=1
if A3<5: L2.append(s[A3])
elif A3<len(s): L1.append(s[A3])
A3+=... | gpl-3.0 |
abhishek-ch/hue | desktop/core/ext-py/pyopenssl/OpenSSL/test/test_crypto.py | 70 | 101757 | # Copyright (c) Jean-Paul Calderone
# See LICENSE file for details.
"""
Unit tests for L{OpenSSL.crypto}.
"""
from unittest import main
import os, re
from subprocess import PIPE, Popen
from datetime import datetime, timedelta
from OpenSSL.crypto import TYPE_RSA, TYPE_DSA, Error, PKey, PKeyType
from OpenSSL.crypto i... | apache-2.0 |
helixyte/TheLMA | thelma/repositories/rdb/schema/tables/plannedworklist.py | 1 | 1484 | """
This file is part of the TheLMA (THe Laboratory Management Application) project.
See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information.
Planned worklist table.
"""
from sqlalchemy import Column
from sqlalchemy import Integer
from sqlalchemy import String
from sqlalchemy import Table
from sqla... | mit |
mmalecki/node-gyp | gyp/test/sibling/gyptest-relocate.py | 104 | 1161 | #!/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.
"""
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('build/all.gyp', chdir='src')
test.relocate('src', 'relocate/src')
test.bu... | mit |
PeterBeard/netalarm | testclient.py | 1 | 6184 | import Commands
import ConfigParser
import Log
import signal
import socket
import subprocess
import sys
import time
import thread
CLIENT_NAME = 'uglyclient'
BUFFER_SIZE = 1024
CONF_FILE = 'clientsettings.conf'
# Handle SIGINT
def handle_sigint(signal, frame):
Log.debug('Caught SIGINT, cleaning up...')
Log.debug('... | gpl-2.0 |
bmanojlovic/ansible | test/units/plugins/cache/test_cache.py | 91 | 4078 | # (c) 2012-2015, 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 |
glove747/liberty-neutron | neutron/tests/unit/extensions/test_address_scope.py | 26 | 17910 | # Copyright (c) 2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
ioannis-e/mpc-hc | src/mpc-hc/mpcresources/UpdateRC.py | 21 | 1255 | # (C) 2013, 2015 see Authors.txt
#
# This file is part of MPC-HC.
#
# MPC-HC 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.
#
# MPC-HC... | gpl-3.0 |
DiptoDas8/Biponi | lib/python2.7/site-packages/PIL/ImageFont.py | 26 | 20133 | #
# The Python Imaging Library.
# $Id$
#
# PIL raster font management
#
# History:
# 1996-08-07 fl created (experimental)
# 1997-08-25 fl minor adjustments to handle fonts from pilfont 0.3
# 1999-02-06 fl rewrote most font management stuff in C
# 1999-03-17 fl take pth files into account in load_path (from Rich... | mit |
mgaleae/android_kernel_samsung_smdk4412_utouch | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed 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 failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
vadimtk/chrome4sdp | components/policy/resources/PRESUBMIT.py | 51 | 5366 | # 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.
# If this presubmit check fails or misbehaves, please complain to
# mnissler@chromium.org, bartfab@chromium.org or atwilson@chromium.org.
import itertoo... | bsd-3-clause |
wheeler-microfluidics/pygtkhelpers | pygtkhelpers/proxy.py | 1 | 10691 | # -*- coding: utf-8 -*-
"""
pygtkhelpers.proxy
~~~~~~~~~~~~~~~~~~
Controllers for managing data display widgets.
:copyright: 2005-2008 by pygtkhelpers Authors
:license: LGPL 2 or later (see README/COPYING/LICENSE)
An example session of using a proxy::
>>> import gtk
>>> from... | lgpl-3.0 |
yeming233/rally | rally/common/objects/credential.py | 1 | 1030 | # Copyright 2014: Mirantis 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 b... | apache-2.0 |
rvykydal/blivet | tests/formats_test/luks_test.py | 1 | 3175 | import test_compat # pylint: disable=unused-import
from six.moves.mock import patch # pylint: disable=no-name-in-module,import-error
import unittest
from blivet.formats.luks import LUKS
from blivet.size import Size
from tests import loopbackedtestcase
class LUKSTestCase(loopbackedtestcase.LoopBackedTestCase):
... | lgpl-2.1 |
guardicore/monkey | monkey/infection_monkey/exploit/tools/smb_tools.py | 1 | 9941 | import logging
import ntpath
import pprint
from impacket.dcerpc.v5 import srvs, transport
from impacket.smb3structs import SMB2_DIALECT_002, SMB2_DIALECT_21
from impacket.smbconnection import SMB_DIALECT, SMBConnection
import infection_monkey.config
import infection_monkey.monkeyfs as monkeyfs
from common.utils.attac... | gpl-3.0 |
ClovisIRex/Snake-django | env/lib/python3.6/site-packages/django/contrib/auth/admin.py | 50 | 8989 | from django.conf import settings
from django.conf.urls import url
from django.contrib import admin, messages
from django.contrib.admin.options import IS_POPUP_VAR
from django.contrib.admin.utils import unquote
from django.contrib.auth import update_session_auth_hash
from django.contrib.auth.forms import (
AdminPass... | mit |
AWhetter/gyp | test/win/generator-output-different-drive/gyptest-generator-output-different-drive.py | 242 | 1463 | #!/usr/bin/env python
# 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.
"""
Test that the generator output can be written to a different drive on Windows.
"""
import os
import TestGyp
import string
import subpro... | bsd-3-clause |
henrykironde/scikit-learn | sklearn/metrics/tests/test_ranking.py | 127 | 40813 | from __future__ import division, print_function
import numpy as np
from itertools import product
import warnings
from scipy.sparse import csr_matrix
from sklearn import datasets
from sklearn import svm
from sklearn import ensemble
from sklearn.datasets import make_multilabel_classification
from sklearn.random_projec... | bsd-3-clause |
aleida/django | django/contrib/auth/hashers.py | 8 | 13232 | from __future__ import unicode_literals
import hashlib
from django.dispatch import receiver
from django.conf import settings
from django.test.signals import setting_changed
from django.utils import importlib
from django.utils.datastructures import SortedDict
from django.utils.encoding import smart_str
from django.cor... | bsd-3-clause |
sushantgoel/Flask | Work/Trivia - Module 5/env/Lib/site-packages/werkzeug/serving.py | 145 | 27668 | # -*- coding: utf-8 -*-
"""
werkzeug.serving
~~~~~~~~~~~~~~~~
There are many ways to serve a WSGI application. While you're developing
it you usually don't want a full blown webserver like Apache but a simple
standalone one. From Python 2.5 onwards there is the `wsgiref`_ server in
the standa... | apache-2.0 |
dotKom/onlineweb4 | apps/authentication/models.py | 1 | 14089 | # -*- coding: utf-8 -*-
import datetime
import hashlib
import urllib
from functools import reduce
from django.conf import settings
from django.contrib.auth.models import AbstractUser, Group
from django.db import models
from django.urls import reverse
from django.utils import timezone
from django.utils.html import str... | mit |
elainenaomi/sciwonc-dataflow-examples | dissertation2017/Experiment 1B/instances/9_2_workflow_full_10files_secondary_with_cons_nosh_nors_noannot_with_proj_3s/calculateratio_0/CalculateRatioCpuMemory_0.py | 13 | 4778 | #!/usr/bin/env python
"""
This activity will calculate the ratio between CPU request and Memory request by (job ID, task index, event type).
These fields are optional and could be null.
"""
# It will connect to DataStoreClient
from sciwonc.dataflow.DataStoreClient import DataStoreClient
import math
import sys
#######... | gpl-3.0 |
telminov/sw-django-division-perm | division_perm/migrations/0001_initial.py | 1 | 5599 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-05-11 19:37
from __future__ import unicode_literals
import division_perm.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
depend... | mit |
LLNL/spack | var/spack/repos/builtin/packages/grass/package.py | 5 | 10428 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Grass(AutotoolsPackage):
"""GRASS GIS (Geographic Resources Analysis Support System), is a... | lgpl-2.1 |
mlongob/Linux-Kernel-Hack | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
spacetelescope/asv | test/test_machine.py | 4 | 1033 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from os.path import join
import six
from asv import machine
def test_machine(tmpdir):
tmpdir = six.text_type(tmpd... | bsd-3-clause |
tejasnikumbh/AllSAT | lib/python2.7/site-packages/numpy/core/records.py | 31 | 26912 | """
Record Arrays
=============
Record arrays expose the fields of structured arrays as properties.
Most commonly, ndarrays contain elements of a single type, e.g. floats, integers,
bools etc. However, it is possible for elements to be combinations of these,
such as::
>>> a = np.array([(1, 2.0), (1, 2.0)], dtype=[... | mit |
xujun10110/Responder | poisoners/MDNS.py | 11 | 2241 | #!/usr/bin/env python
# This file is part of Responder
# Original work by Laurent Gaffie - Trustwave Holdings
#
# 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, o... | gpl-3.0 |
willprice/arduino-sphere-project | scripts/example_direction_finder/temboo/Library/Parse/GeoPoints/GeoPoint.py | 5 | 3871 | # -*- coding: utf-8 -*-
###############################################################################
#
# GeoPoint
# Associates a Geo point with an existing object.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use ... | gpl-2.0 |
hcsturix74/django | tests/prefetch_related/test_uuid.py | 291 | 4347 | from __future__ import unicode_literals
from django.test import TestCase
from .models import Flea, House, Person, Pet, Room
class UUIDPrefetchRelated(TestCase):
def test_prefetch_related_from_uuid_model(self):
Pet.objects.create(name='Fifi').people.add(
Person.objects.create(name='Ellen'),
... | bsd-3-clause |
axbaretto/beam | sdks/python/.tox/lint/lib/python2.7/site-packages/pyasn1/codec/ber/decoder.py | 20 | 40205 | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com>
# License: http://pyasn1.sf.net/license.html
#
from pyasn1.type import base, tag, univ, char, useful, tagmap
from pyasn1.codec.ber import eoo
from pyasn1.compat.octets import oct2int, octs2ints, isOctetsType
from pya... | apache-2.0 |
avicizhu/Load-balancer | src/lte/test/examples-to-run.py | 6 | 1255 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
# buildable and runnable over time. Each tuple in the list contains
#
# (example_name, do_run, do_valgrind_run).
#
... | gpl-2.0 |
shingonoide/odoo | addons/website_sale/models/product.py | 262 | 10108 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
AndreyPopovNew/asuswrt-merlin-rt-n | release/src/router/samba36/source4/torture/libnet/python/samr-test.py | 67 | 1895 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Unix SMB/CIFS implementation.
# Copyright (C) Kamen Mazdrashki <kamen.mazdrashki@postpath.com> 2009
#
# 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 Founda... | gpl-2.0 |
ahmadiga/min_edx | common/test/acceptance/pages/lms/tab_nav.py | 112 | 3053 | """
High-level tab navigation.
"""
from bok_choy.page_object import PageObject
from bok_choy.promise import Promise, EmptyPromise
class TabNavPage(PageObject):
"""
High-level tab navigation.
"""
url = None
def is_browser_on_page(self):
return self.q(css='ol.course-tabs').present
de... | agpl-3.0 |
deepsrijit1105/edx-platform | lms/djangoapps/email_marketing/signals.py | 7 | 7814 | """
This module contains signals needed for email integration
"""
import logging
import datetime
import crum
from django.dispatch import receiver
from django.core.urlresolvers import reverse
from django.conf import settings
from student.models import ENROLL_STATUS_CHANGE
from student.cookies import CREATE_LOGON_COOKI... | agpl-3.0 |
Endika/bank-statement-reconcile | account_statement_transactionid_import/statement.py | 18 | 1429 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Joel Grand-Guillaume
# Copyright 2011-2012 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License a... | agpl-3.0 |
farhaadila/django-cms | cms/south_migrations/0071_mptt_to_mp.py | 51 | 23931 | # -*- coding: utf-8 -*-
from django.db.models import F
from django.middleware import transaction
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
from treebeard.numconv import NumConv
STEPLEN = 4
ALPHABET = '0123456789ABCDEFGHIJ... | bsd-3-clause |
addotson/barcode-scanner | barcode_attendance_AWWMA.py | 1 | 8291 | #!/usr/bin/python
import csv
import sys
import time
import os
now=time.localtime(time.time())
currentmonth=now.tm_mon
currentday=now.tm_mday
currentyear=now.tm_year
#input barcode of attendee
os.system('clear')
print '** Conference Barcode Attendance Tracker **'
print '\nEnter session barcode: '
session = sys.stdin.... | mit |
damiansoriano/odoo | addons/auth_openid/utils.py | 428 | 1589 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General P... | agpl-3.0 |
abhishek-ch/hue | apps/sqoop/src/sqoop/client/connector.py | 33 | 2640 | # Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file ex... | apache-2.0 |
tchernomax/ansible | lib/ansible/module_utils/facts/other/ohai.py | 232 | 2307 | # 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 in the hope that ... | gpl-3.0 |
Srisai85/scikit-learn | examples/cluster/plot_dict_face_patches.py | 337 | 2747 | """
Online learning of a dictionary of parts of faces
==================================================
This example uses a large dataset of faces to learn a set of 20 x 20
images patches that constitute faces.
From the programming standpoint, it is interesting because it shows how
to use the online API of the sciki... | bsd-3-clause |
Microvellum/Fluid-Designer | win64-vc/2.78/scripts/addons/io_scene_fbx/cycles_shader_compat.py | 10 | 19901 | # ##### 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 |
pllim/stginga | stginga/plugins/DQInspect.py | 1 | 24553 | """
Data quality (DQ) inspection on an image.
**Plugin Type: Local**
``DQInspect`` is a local plugin, which means it is associated with a
channel. An instance can be opened for each channel.
**Usage**
This plugin is used to visualize the associated DQ array stored
as a FITS HDU within an image. It shows the differ... | bsd-3-clause |
panpan0000/RackHD | test/tests/rackhd20/test_rackhd20_api_nodes.py | 13 | 7676 | '''
Copyright 2016, EMC, Inc.
Author(s):
George Paulos
'''
import fit_path # NOQA: unused import
import os
import sys
import subprocess
import fit_common
# Local methods
NODECATALOG = fit_common.node_select()
# Select test group here using @attr
from nose.plugins.attrib import attr
@attr(all=True, regression=Tru... | apache-2.0 |
kubeflow/pipelines | components/aws/sagemaker/delete_simulation_app/src/robomaker_delete_simulation_app_component.py | 2 | 4549 | """RoboMaker component for deleting a simulation application."""
# 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... | apache-2.0 |
aaronorosen/nox | src/nox/netapps/tests/pyunittests/dns_parse_test.py | 10 | 5817 | # Copyright 2008 (C) Nicira, Inc.
#
# This file is part of NOX.
#
# NOX 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.
#
# NOX is d... | gpl-3.0 |
jaantollander/Pointwise-Convergence | src_legacy/fourier_series/input/base.py | 4 | 3756 | # coding=utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import json
import numpy as np
import sympy
from sortedcontainers import sortedset
from sympy import sympify, Rational
from src_legacy.io.path import dat... | mit |
profcturner/WAM | loads/decorators.py | 1 | 1825 | # Custom decorators for this project
from django.core.exceptions import PermissionDenied
from .models import Staff
def staff_only(function):
"""Checks the logged in User has a valid related Staff object"""
def wrapper(request, *args, **kwargs):
try:
staff = Staff.objects.get(user=request.u... | agpl-3.0 |
btat/Booktype | lib/booktype/convert/utils/epub.py | 3 | 2139 | # This file is part of Booktype.
# Copyright (c) 2013 Borko Jandras <borko.jandras@sourcefabric.org>
#
# Booktype 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 version 3 of the License, or
# (a... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.