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 |
|---|---|---|---|---|---|
yqm/sl4a | python/src/Lib/plat-sunos5/SUNAUDIODEV.py | 66 | 1578 | # Symbolic constants for use with sunaudiodev module
# The names are the same as in audioio.h with the leading AUDIO_
# removed.
from warnings import warnpy3k
warnpy3k("the SUNAUDIODEV module has been removed in Python 3.0", stacklevel=2)
del warnpy3k
# Not all values are supported on all releases of SunOS.
# Encodin... | apache-2.0 |
ericgarrigues/ansible-modules-extras | system/locale_gen.py | 20 | 6736 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import os.path
from subprocess import Popen, PIPE, call
import re
DOCUMENTATION = '''
---
module: locale_gen
short_description: Creates or removes locales.
description:
- Manages locales by editing /etc/locale.gen and invoking locale-gen.
version_added: "1.6"
a... | gpl-3.0 |
jegger/kivy | kivy/uix/bubble.py | 16 | 12684 | '''
Bubble
======
.. versionadded:: 1.1.0
.. image:: images/bubble.jpg
:align: right
The Bubble widget is a form of menu or a small popup where the menu options
are stacked either vertically or horizontally.
The :class:`Bubble` contains an arrow pointing in the direction you
choose.
Simple example
------------... | mit |
wfxiang08/django185 | django/contrib/auth/middleware.py | 172 | 5116 | from django.contrib import auth
from django.contrib.auth import load_backend
from django.contrib.auth.backends import RemoteUserBackend
from django.core.exceptions import ImproperlyConfigured
from django.utils.functional import SimpleLazyObject
def get_user(request):
if not hasattr(request, '_cached_user'):
... | bsd-3-clause |
ojengwa/talk | venv/lib/python2.7/site-packages/django/utils/translation/trans_null.py | 84 | 1536 | # These are versions of the functions in django.utils.translation.trans_real
# that don't actually do anything. This is purely for performance, so that
# settings.USE_I18N = False can use this module rather than trans_real.py.
from django.conf import settings
from django.utils.encoding import force_text
from django.ut... | mit |
camptocamp/QGIS | python/plugins/processing/lidar/lastools/lassplit.py | 1 | 2355 | # -*- coding: utf-8 -*-
"""
***************************************************************************
lassplit.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
---------------------
... | gpl-2.0 |
sunyihuan326/DeltaLab | shuwei_fengge/practice_two/load_data/knn_outline.py | 1 | 1415 | # coding:utf-8
'''
Created on 2017/12/29.
@author: chk01
'''
from practice_one.Company.load_material.utils import *
from practice_one.model.utils import *
from imblearn.over_sampling import RandomOverSampler
def preprocessing(trX, teX, trY, teY):
res = RandomOverSampler(ratio={0: 700, 1: 700, 2: 700})
m, w, ... | mit |
Constellation/linux-3.13-rc2 | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
oandrew/home-assistant | tests/components/device_tracker/test_owntracks.py | 10 | 28145 | """The tests for the Owntracks device tracker."""
import json
import os
import unittest
from collections import defaultdict
from unittest.mock import patch
from tests.common import (assert_setup_component, fire_mqtt_message,
get_test_home_assistant, mock_mqtt_component)
import homeassistant.... | mit |
beni55/june | june/utils/mail.py | 11 | 1651 | # coding: utf-8
from flask import current_app, url_for, render_template
from flask.ext.babel import gettext as _
from flask_mail import Message
from .user import create_auth_token
def send_mail(app, msg):
mail = app.extensions['mail']
if not mail.default_sender:
return
mail.send(msg)
def signup... | bsd-3-clause |
Rafiot/PyCIRCLean | filecheck/filecheck.py | 1 | 35947 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import mimetypes
import shlex
import subprocess
import zipfile
import argparse
import random
import shutil
import time
import hashlib
import oletools.oleid
import olefile
import officedissector
import warnings
import exifread
from PIL import Image
from pdfid imp... | bsd-3-clause |
xingjian-f/Leetcode-solution | 304. Range Sum Query 2D - Immutable.py | 1 | 1592 | class NumMatrix(object):
def __init__(self, matrix):
"""
initialize your data structure here.
:type matrix: List[List[int]]
"""
self.dp = [range(len(matrix[0])) for i in range(len(matrix))]
for i in range(len(matrix)):
for j in range(len(matrix[i])):
... | mit |
gavinelliott/patsi | node_modules/grunt-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py | 148 | 44560 | # 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.
"""cmake output module
This module is under development and should be considered experimental.
This module produces cmake (2.8.8+) input as its output. One CMake... | mit |
ronuchit/GroundHog | groundhog/layers/ff_layers.py | 16 | 18887 | """
Feedforward layers.
TODO: write more documentation
"""
__docformat__ = 'restructedtext en'
__authors__ = ("Razvan Pascanu "
"KyungHyun Cho "
"Caglar Gulcehre ")
__contact__ = "Razvan Pascanu <r.pascanu@gmail>"
import numpy
import copy
import theano
import theano.tensor as TT
from th... | bsd-3-clause |
megies/numpy | numpy/ma/timer_comparison.py | 76 | 17500 | from __future__ import division, absolute_import, print_function
import timeit
from functools import reduce
import numpy as np
from numpy import float_
import np.core.fromnumeric as fromnumeric
from np.testing.utils import build_err_msg
# Fixme: this does not look right.
np.seterr(all='ignore')
pi = np.pi
class ... | bsd-3-clause |
capturePointer/vigra | vigranumpy/examples/grid_graph_shortestpath.py | 8 | 3978 | import vigra
import vigra.graphs as vigraph
import pylab
import numpy
np=numpy
import sys
import matplotlib
import pylab as plt
import math
from matplotlib.widgets import Slider, Button, RadioButtons
def makeWeights(gamma):
global hessian,gradmag,gridGraph
print "hessian",hessian.min(),hessian.max()
print ... | mit |
chiefspace/udemy-rest-api | udemy_rest_flask1/env/lib/python3.4/site-packages/markupsafe/_constants.py | 1535 | 4795 | # -*- coding: utf-8 -*-
"""
markupsafe._constants
~~~~~~~~~~~~~~~~~~~~~
Highlevel implementation of the Markup string.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
HTML_ENTITIES = {
'AElig': 198,
'Aacute': 193,
'Acirc': 194,
'Agrave': 1... | gpl-2.0 |
azlanismail/prismgames | examples/games/car/networkx/tests/test.py | 1 | 1289 | #!/usr/bin/env python
import sys
from os import path,getcwd
def run(verbosity=1,doctest=False,numpy=True):
"""Run NetworkX tests.
Parameters
----------
verbosity: integer, optional
Level of detail in test reports. Higher numbers provide more detail.
doctest: bool, optional
... | gpl-2.0 |
xiandiancloud/ji | common/lib/xmodule/xmodule/tests/xml/test_policy.py | 248 | 1262 | """
Tests that policy json files import correctly when loading XML
"""
from nose.tools import assert_equals, assert_raises # pylint: disable=no-name-in-module
from xmodule.tests.xml.factories import CourseFactory
from xmodule.tests.xml import XModuleXmlImportTest
class TestPolicy(XModuleXmlImportTest):
"""
... | agpl-3.0 |
tersmitten/ansible | lib/ansible/modules/packaging/os/homebrew_tap.py | 87 | 6806 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Daniel Jaouen <dcj24@cornell.edu>
# (c) 2016, Indrajit Raychaudhuri <irc+code@indrajit.com>
#
# Based on homebrew (Andrew Dunham <andrew@du.nham.ca>)
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ imp... | gpl-3.0 |
baidu/Paddle | python/paddle/fluid/tests/unittests/test_sequence_expand.py | 1 | 4061 | # Copyright (c) 2018 PaddlePaddle 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 app... | apache-2.0 |
invisiblek/python-for-android | python-modules/twisted/twisted/protocols/gps/nmea.py | 59 | 7970 | # -*- test-case-name: twisted.test.test_nmea -*-
# Copyright (c) 2001-2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""NMEA 0183 implementation
Maintainer: Bob Ippolito
The following NMEA 0183 sentences are currently understood::
GPGGA (fix)
GPGLL (position)
GPRMC (position and time)
G... | apache-2.0 |
cav71/osc | tests/test_setlinkrev.py | 14 | 4652 | import osc.core
import osc.oscerr
import os
from common import GET, PUT, OscTestCase
FIXTURES_DIR = os.path.join(os.getcwd(), 'setlinkrev_fixtures')
def suite():
import unittest
return unittest.makeSuite(TestSetLinkRev)
class TestSetLinkRev(OscTestCase):
def setUp(self):
OscTestCase.setUp(self, co... | gpl-2.0 |
twlizer/plugin.video.Pseudonymous | chardet/gb2312prober.py | 231 | 1722 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Reserved.
... | gpl-2.0 |
gfreed/android_external_chromium-org | third_party/jinja2/compiler.py | 121 | 61899 | # -*- coding: utf-8 -*-
"""
jinja2.compiler
~~~~~~~~~~~~~~~
Compiles nodes into python code.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from cStringIO import StringIO
from itertools import chain
from copy import deepcopy
from jinja2 import nodes
from j... | bsd-3-clause |
0k/OpenUpgrade | addons/l10n_ar/__init__.py | 2120 | 1456 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com).
#
# WARNING: This program as such is intended to be used by professional
# programmers who take t... | agpl-3.0 |
Nick-OpusVL/odoo | openerp/tools/translate.py | 62 | 44976 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
aniruddhkanojia/qtile | test/test_bar.py | 14 | 11959 | # Copyright (c) 2011 Florian Mounier
# Copyright (c) 2012-2013 Craig Barnes
# Copyright (c) 2012 roger
# Copyright (c) 2012, 2014-2015 Tycho Andersen
# Copyright (c) 2014 Sean Vig
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ... | mit |
vebin/Wox | PythonHome/Lib/site-packages/setuptools/command/test.py | 55 | 6481 | from distutils.errors import DistutilsOptionError
from unittest import TestLoader
import unittest
import sys
from pkg_resources import (resource_listdir, resource_exists, normalize_path,
working_set, _namespace_packages,
add_activation_listener, require, EntryPoint... | mit |
kbdick/RecycleTracker | recyclecollector/scrap/gdata-2.0.18/src/gdata/contacts/__init__.py | 119 | 28208 | #!/usr/bin/env python
#
# Copyright 2009 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 requir... | gpl-3.0 |
doot/CouchPotatoServer | libs/tornado/util.py | 102 | 12256 | """Miscellaneous utility functions and classes.
This module is used internally by Tornado. It is not necessarily expected
that the functions and classes defined here will be useful to other
applications, but they are documented here in case they are.
The one public-facing part of this module is the `Configurable` cl... | gpl-3.0 |
aidan-fitz/instant-press | languages/hi-hi.py | 6 | 10092 | # coding: utf8
{
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN',
'%Y-%m-%d': '%Y-%m-%d',
'%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S',
'%s r... | gpl-2.0 |
proversity-org/edx-platform | common/lib/xmodule/xmodule/modulestore/xml_exporter.py | 12 | 18035 | """
Methods for exporting course data to XML
"""
import logging
from abc import abstractmethod
from six import text_type
import lxml.etree
from xblock.fields import Scope, Reference, ReferenceList, ReferenceValueDict
from xmodule.contentstore.content import StaticContent
from xmodule.exceptions import NotFoundError
fr... | agpl-3.0 |
jptomo/rpython-lang-scheme | rpython/rtyper/callparse.py | 1 | 4745 | from rpython.annotator.argument import ArgumentsForTranslation, ArgErr
from rpython.annotator import model as annmodel
from rpython.rtyper import rtuple
from rpython.rtyper.error import TyperError
from rpython.rtyper.lltypesystem import lltype
class ArgumentsForRtype(ArgumentsForTranslation):
def newtuple(self, it... | mit |
smi96/django-blog_website | lib/python2.7/site-packages/django/db/backends/postgresql/schema.py | 202 | 4100 | import psycopg2
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
sql_alter_column_type = "ALTER COLUMN %(column)s TYPE %(type)s USING %(column)s::%(type)s"
sql_create_sequence = "CREATE SEQUENCE %(sequence)s"
sql_delete_sequence =... | mit |
laslabs/vertical-medical | medical_medicament_us/tests/test_medical_medicament.py | 1 | 2603 | # -*- coding: utf-8 -*-
# Copyright 2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp.tests.common import TransactionCase
class TestMedicalMedicament(TransactionCase):
def setUp(self):
super(TestMedicalMedicament, self).setUp()
self.test_gcn = s... | agpl-3.0 |
palladius/gcloud | packages/gsutil/boto/boto/plugin.py | 111 | 2695 | # Copyright 2010 Google 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
# without limitation the rights to use, copy, modify, merge, publish, dis-
# trib... | gpl-3.0 |
rosswhitfield/mantid | qt/python/mantidqt/dialogs/errorreports/report.py | 3 | 5965 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
fro... | gpl-3.0 |
zerotired/kotori | kotori/vendor/luftdaten/application.py | 2 | 4013 | # -*- coding: utf-8 -*-
# (c) 2017 Andreas Motl <andreas@getkotori.org>
import json
from pkg_resources import resource_filename
from jinja2 import Template
from twisted.logger import Logger
from grafana_api_client import GrafanaPreconditionFailedError, GrafanaClientError
from kotori.daq.services.mig import MqttInfluxG... | agpl-3.0 |
leopittelli/Django-on-App-Engine-Example | django/contrib/gis/feeds.py | 225 | 5932 | from __future__ import unicode_literals
from django.contrib.syndication.views import Feed as BaseFeed
from django.utils.feedgenerator import Atom1Feed, Rss201rev2Feed
class GeoFeedMixin(object):
"""
This mixin provides the necessary routines for SyndicationFeed subclasses
to produce simple GeoRSS or W3C G... | mit |
jokajak/itweb | data/env/lib/python2.6/site-packages/Mako-0.3.4-py2.6.egg/mako/runtime.py | 21 | 17576 | # runtime.py
# Copyright (C) 2006, 2007, 2008, 2009, 2010 Michael Bayer mike_mp@zzzcomputing.com
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""provides runtime services for templates, including Context, Namespace, and various helper funct... | gpl-3.0 |
dkubiak789/odoo | addons/product/report/__init__.py | 452 | 1080 | # -*- 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... | agpl-3.0 |
LagunaJS/Midori | django_comments/south_migrations/0001_initial.py | 11 | 7979 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from django.contrib.auth import get_user_model
User = get_user_model()
user_orm_label = '%s.%s' % (User._meta.app_label, User._meta.object_name)
user_mod... | mit |
40223250/2015cd_midterm- | static/Brython3.1.1-20150328-091302/Lib/types.py | 756 | 3167 | """
Define names for built-in types that aren't directly accessible as a builtin.
"""
import sys
# Iterators in Python aren't a matter of type but of protocol. A large
# and changing number of builtin types implement *some* flavor of
# iterator. Don't check the type! Use hasattr to check for both
# "__iter__" and "... | gpl-3.0 |
ClearCorp/odoo-clearcorp | TODO-9.0/project_event/resource.py | 3 | 2336 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Addons modules by CLEARCORP S.A.
# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
#
# This program is free software: you can redistribute... | agpl-3.0 |
lgandx/Responder | tools/MultiRelay.py | 1 | 39626 | #!/usr/bin/env python
# -*- coding: latin-1 -*-
# This file is part of Responder, a network take-over set of tools
# created and maintained by Laurent Gaffie.
# email: laurent.gaffie@gmail.com
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License a... | gpl-3.0 |
martingms/django-globalshorturls | globalshorturls/admin/contrib.py | 1 | 2513 | # encoding: utf-8
from django.contrib.admin import site, ModelAdmin
from globalshorturls.models import Shorturl
from django.forms import ModelForm
from django.contrib.admin.filterspecs import FilterSpec, ChoicesFilterSpec
from django.utils.translation import ugettext as _
from django.utils.encoding import smart_unicode... | mit |
dominicelse/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 |
40223101/2015final2 | static/Brython3.1.3-20150514-095342/Lib/pydoc_data/topics.py | 694 | 385454 | # -*- coding: utf-8 -*-
# Autogenerated by Sphinx on Sat Mar 23 15:42:31 2013
topics = {'assert': '\nThe ``assert`` statement\n************************\n\nAssert statements are a convenient way to insert debugging assertions\ninto a program:\n\n assert_stmt ::= "assert" expression ["," expression]\n\nThe simple form,... | gpl-3.0 |
dencee/AWG | AWG_App_py3.py | 1 | 19683 | # Title: AWG - Akemi's Word Game
# Author: Daniel Commins
# Date: June 13, 2015
# Files: AWG_App_py2.py; SINGLE.TXT (dictionary words file)
# Tested: python 2.61
# Info: Akemi's Word Game: The game where you try and guess the computer's randomly
# selected word! Each letter appears only once.
import sys... | mit |
jevgen/namebench | nb_third_party/graphy/backends/google_chart_api/encoders.py | 230 | 14800 | #!/usr/bin/python2.4
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 |
vatsalgit/Deep-Learning- | assignment1/data/deep/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/filepost.py | 713 | 2320 | from __future__ import absolute_import
import codecs
from uuid import uuid4
from io import BytesIO
from .packages import six
from .packages.six import b
from .fields import RequestField
writer = codecs.lookup('utf-8')[3]
def choose_boundary():
"""
Our embarassingly-simple replacement for mimetools.choose_b... | gpl-3.0 |
Dreizan/csci1200OnlineCourse | tests/functional/controllers_review.py | 5 | 29623 | # 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 required by ap... | apache-2.0 |
MBoustani/GeoParser | geoparser_app/urls.py | 3 | 2166 | from django.conf.urls import patterns, url
from . import views
urlpatterns = patterns('geoparser_app.views',
url(r'^$', views.index, name='index'),
url(r'^extract_text/(?P<file_name>\S+)$', views.extract_text, name='extract_text'),
url(r'^find_location/(?P<file_name>\S+)', views.find_location, name='find... | apache-2.0 |
RaoUmer/django | tests/regressiontests/utils/datastructures.py | 7 | 10672 | """
Tests for stuff in django.utils.datastructures.
"""
import copy
import pickle
import warnings
from django.test import SimpleTestCase
from django.utils.datastructures import (DictWrapper, ImmutableList,
MultiValueDict, MultiValueDictKeyError, MergeDict, SortedDict)
from django.utils import six
class SortedDi... | bsd-3-clause |
willharris/django | tests/sites_framework/migrations/0001_initial.py | 99 | 1649 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sites', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='CustomArticle',
fields=[
... | bsd-3-clause |
colinligertwood/odoo | addons/account_sequence/account_sequence_installer.py | 39 | 3904 | # -*- 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 |
sudosurootdev/external_chromium_org | tools/auto_bisect/PRESUBMIT.py | 25 | 3243 | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Top-level presubmit script for auto-bisect.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
details on the presubmit ... | bsd-3-clause |
cnsoft/kbengine-cocos2dx | kbe/res/scripts/common/Lib/test/test_pipes.py | 54 | 7175 | import pipes
import os
import string
import unittest
from test.support import TESTFN, run_unittest, unlink, reap_children
if os.name != 'posix':
raise unittest.SkipTest('pipes module only works on posix')
TESTFN2 = TESTFN + "2"
# tr a-z A-Z is not portable, so make the ranges explicit
s_command = 'tr %s %s' % (s... | lgpl-3.0 |
schleichdi2/openpli-e2 | lib/python/Components/Converter/ServiceName.py | 24 | 1939 | # -*- coding: utf-8 -*-
from Components.Converter.Converter import Converter
from enigma import iServiceInformation, iPlayableService, iPlayableServicePtr, eServiceReference
from ServiceReference import resolveAlternate
from Components.Element import cached
class ServiceName(Converter, object):
NAME = 0
PROVIDER = 1... | gpl-2.0 |
sYnfo/samba | selftest/target/samba.py | 1 | 4169 | #!/usr/bin/perl
# Bootstrap Samba and run a number of tests against it.
# Copyright (C) 2005-2012 Jelmer Vernooij <jelmer@samba.org>
# Published under the GNU GPL, v3 or later.
from __future__ import absolute_import
import os
import sys
def bindir_path(bindir, path):
"""Find the executable to use.
:param b... | gpl-3.0 |
isabernardes/Heriga | Herigaenv/lib/python2.7/site-packages/django/contrib/gis/geos/base.py | 437 | 1280 | from ctypes import c_void_p
from django.contrib.gis.geos.error import GEOSException
class GEOSBase(object):
"""
Base object for GEOS objects that has a pointer access property
that controls access to the underlying C pointer.
"""
# Initially the pointer is NULL.
_ptr = None
# Default all... | mit |
whatsthehubbub/playpilots | ebi/actstream/tests.py | 2 | 4691 | import unittest
from django.db import models
from django.test.client import Client
from django.contrib.auth.models import User, Group
from django.contrib.comments.models import Comment
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from actstream.signals import ... | mit |
ryfeus/lambda-packs | Tensorflow/source/tensorflow/contrib/boosted_trees/python/ops/stats_accumulator_ops.py | 62 | 9211 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | mit |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/rest_framework/compat.py | 29 | 7549 | """
The `compat` module provides support for backwards compatibility with older
versions of Django/Python, and compatibility wrappers around optional packages.
"""
# flake8: noqa
from __future__ import unicode_literals
import django
from django.conf import settings
from django.db import connection, transaction
from d... | agpl-3.0 |
MichaelNedzelsky/intellij-community | python/testData/refactoring/pullup/pyPullUpInfoModel.py | 80 | 1827 | class EmptyParent:pass
class SomeParent:
PARENT_CLASS_FIELD = 42
def __init__(self):
self.parent_instance_field = "egg"
def parent_func(self):
pass
class ChildWithDependencies(SomeParent, EmptyParent):
CLASS_FIELD_FOO = 42
CLASS_FIELD_DEPENDS_ON_CLASS_FIELD_FOO = CLASS_FIELD_FOO... | apache-2.0 |
MaximLich/oppia | core/jobs_test.py | 13 | 34314 | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | apache-2.0 |
mushtaqak/edx-platform | common/djangoapps/student/tests/test_reset_password.py | 54 | 10790 | """
Test the various password reset flows
"""
import json
import re
import unittest
from django.core.cache import cache
from django.conf import settings
from django.test import TestCase
from django.test.client import RequestFactory
from django.contrib.auth.models import User
from django.contrib.auth.hashers import UNU... | agpl-3.0 |
lihui7115/ChromiumGStreamerBackend | tools/perf/benchmarks/skpicture_printer.py | 13 | 1709 | # 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.
from core import perf_benchmark
from telemetry import benchmark
from telemetry.core import discover
from telemetry import story
from measurements import sk... | bsd-3-clause |
sebrandon1/neutron | neutron/notifiers/batch_notifier.py | 56 | 2337 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
pwittrock/reference-docs | vendor/k8s.io/kubernetes/cluster/juju/layers/kubernetes-master/reactive/kubernetes_master.py | 21 | 37137 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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 appli... | apache-2.0 |
Codeusa/Steam-Grid-View-Image-Dumper | griddumper.py | 1 | 1594 | import sys
import os.path
from urllib2 import urlopen, HTTPError
import time
import re
def get_app_ids(appstring):
index = '"appid":'
substring = 0
while True:
substring = appstring.find(index, substring)
if substring == -1:
return
pattern = re.compile('(\"appid":)([0-9... | gpl-3.0 |
omnirom/android_kernel_samsung_tuna | 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 |
jmwright/cadquery-freecad-module | Libs/urllib3/packages/ordered_dict.py | 2040 | 8935 | # Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy.
# Passes Python2.7's test suite and incorporates all the latest updates.
# Copyright 2009 Raymond Hettinger, released under the MIT License.
# http://code.activestate.com/recipes/576693/
try:
from thread import get_ident as _get_iden... | lgpl-3.0 |
jyi/ITSP | prophet-gpl/crawler/python-github3-master/setup.py | 6 | 1203 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from os.path import join
from setuptools import setup, find_packages
import pygithub3
# Odd hack to get 'python setup.py test' working on py2.7
try:
import multiprocessing
import logging
except ImportError:
pass
setup(
name=pygithub3.__name__,
vers... | mit |
xianggong/m2c_unit_test | test/integer/rhadd_ulong2ulong2/compile.py | 1861 | 4430 | #!/usr/bin/python
import os
import subprocess
import re
def runCommand(command):
p = subprocess.Popen(command,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
p.wait()
return iter(p.stdout.readline, b'')
def dumpRunCommand(command,... | gpl-2.0 |
carsongee/edx-platform | common/djangoapps/config_models/__init__.py | 220 | 2002 | """
Model-Based Configuration
=========================
This app allows other apps to easily define a configuration model
that can be hooked into the admin site to allow configuration management
with auditing.
Installation
------------
Add ``config_models`` to your ``INSTALLED_APPS`` list.
Usage
-----
Create a sub... | agpl-3.0 |
sjsucohort6/openstack | python/venv/lib/python2.7/site-packages/wheel/test/test_signatures.py | 565 | 1120 | from wheel import signatures
from wheel.signatures import djbec, ed25519py
from wheel.util import binary
def test_getlib():
signatures.get_ed25519ll()
def test_djbec():
djbec.dsa_test()
djbec.dh_test()
def test_ed25519py():
kp0 = ed25519py.crypto_sign_keypair(binary(' '*32))
kp = ed25519p... | mit |
JoeGlancy/linux | tools/perf/scripts/python/futex-contention.py | 1997 | 1508 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
VishvajitP/django-tastypie | tests/namespaced/tests.py | 11 | 1284 | from django.conf import settings
from django.core.urlresolvers import reverse, NoReverseMatch
from django.http import HttpRequest
from django.test import TestCase
from django.utils import simplejson as json
class NamespacedViewsTestCase(TestCase):
urls = 'namespaced.api.urls'
def test_urls(self):
... | bsd-3-clause |
ric2b/Vivaldi-browser | chromium/chrome/common/extensions/docs/examples/apps/hello-python/oauth2/clients/smtp.py | 884 | 1680 | """
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the ... | bsd-3-clause |
edushifts/book-voyage | bookvoyage-backend/core/mail/__init__.py | 1 | 3852 | """
Tools for sending email.
"""
# Import utilities
from django.template.loader import render_to_string
from django.utils.encoding import force_bytes, force_text
from django.contrib.auth.tokens import default_token_generator
from django.core.mail import send_mail
from django.utils.http import urlsafe_base64_encode
# I... | gpl-3.0 |
spacecowboy/article-annriskgroups-source | stats.py | 1 | 3897 | # -*- coding: utf-8 -*-
import numpy as np
def surv_area(durations, events=None, absolute=False):
'''
Parameters:
durations - array of event times (must be greater than zero)
events - array of event indicators (1/True for event, 0/False for censored)
absolute - if True, returns the actual area. Ot... | gpl-3.0 |
trungnt13/scikit-learn | examples/linear_model/plot_ols.py | 220 | 1940 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Linear Regression Example
=========================================================
This example uses the only the first feature of the `diabetes` dataset, in
order to illustrate a two-dimensional plot of this regre... | bsd-3-clause |
trianglefraternitymtu/slack-bridge | server/settings.py | 1 | 4877 | """
Django settings for slack announcement approval project, on Heroku. For more info, see:
https://github.com/heroku/heroku-django-template
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/... | mit |
mdanielwork/intellij-community | python/lib/Lib/site-packages/django/contrib/gis/db/backends/util.py | 377 | 1749 | """
A collection of utility routines and classes used by the spatial
backends.
"""
def gqn(val):
"""
The geographic quote name function; used for quoting tables and
geometries (they use single rather than the double quotes of the
backend quotename function).
"""
if isinstance(val, basestring):
... | apache-2.0 |
vongochung/buiquocviet | home/views.py | 1 | 11342 | # -*- coding: utf-8 -*-
from datetime import datetime, timedelta
from django.http import Http404
from django.views.decorators.csrf import ensure_csrf_cookie
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response, redirect, HttpResponse, get_object_or_404
from django.template import... | bsd-3-clause |
adieu/django-nonrel | django/contrib/comments/admin.py | 361 | 3299 | from django.contrib import admin
from django.contrib.comments.models import Comment
from django.utils.translation import ugettext_lazy as _, ungettext
from django.contrib.comments import get_model
from django.contrib.comments.views.moderation import perform_flag, perform_approve, perform_delete
class CommentsAdmin(adm... | bsd-3-clause |
bverdu/Pyanocktail | pyanocktail/pyanalysis.py | 1 | 31981 | # -*- coding: utf-8 -*-
# This software is free software; you can redistribute it and/or modify it under
# the terms of version 2 of GNU General Public License as published by the
# Free Software Foundation (see License.txt).
from __future__ import division
import numpy as np
# Note FJ :
# format des fic... | lgpl-2.1 |
stone5495/NewsBlur | vendor/typogrify/smartypants.py | 37 | 29160 | #!/usr/bin/python
r"""
==============
smartypants.py
==============
----------------------------
SmartyPants ported to Python
----------------------------
Ported by `Chad Miller`_
Copyright (c) 2004, 2007 Chad Miller
original `SmartyPants`_ by `John Gruber`_
Copyright (c) 2003 John Gruber
Synopsis
========
A sma... | mit |
resmo/ansible | lib/ansible/module_utils/network/checkpoint/checkpoint.py | 8 | 19463 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
jbuchbinder/youtube-dl | youtube_dl/extractor/steam.py | 61 | 4662 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
unescapeHTML,
)
class SteamIE(InfoExtractor):
_VALID_URL = r"""(?x)
https?://store\.steampowered\.com/
(agecheck/)?
(?P<urltype>video|app)/ #If the pa... | unlicense |
kizniche/Mycodo | mycodo/mycodo_flask/api/output.py | 1 | 9541 | # coding=utf-8
import logging
import traceback
import flask_login
from flask_accept import accept
from flask_restx import Resource
from flask_restx import abort
from flask_restx import fields
from mycodo.databases.models import Output
from mycodo.databases.models import OutputChannel
from mycodo.databases.models.outp... | gpl-3.0 |
DepthDeluxe/ansible | lib/ansible/module_utils/facts/hardware/sunos.py | 64 | 9586 | # 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 |
AlexandreDecan/sismic | sismic/model/events.py | 1 | 2623 | import warnings
from typing import Any
__all__ = ['Event', 'InternalEvent', 'MetaEvent']
class Event:
"""
An event with a name and (optionally) some data passed as named parameters.
The list of parameters can be obtained using *dir(event)*. Notice that
*name* and *data* are reserved names. If a *del... | lgpl-3.0 |
Bootz/shiny-robot | plug-ins/pygimp/plug-ins/whirlpinch.py | 16 | 9500 | #!/usr/bin/env python
# Gimp-Python - allows the writing of Gimp plugins in Python.
# Copyright (C) 1997 James Henstridge <james@daa.com.au>
#
# 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 Fou... | gpl-3.0 |
tgoodlet/pytest | testing/test_pdb.py | 5 | 11401 | import sys
import platform
import _pytest._code
import pytest
def runpdb_and_get_report(testdir, source):
p = testdir.makepyfile(source)
result = testdir.runpytest_inprocess("--pdb", p)
reports = result.reprec.getreports("pytest_runtest_logreport")
assert len(reports) == 3, reports # setup/call/teard... | mit |
anirudhjayaraman/scikit-learn | sklearn/utils/tests/test_extmath.py | 70 | 16531 | # Authors: Olivier Grisel <olivier.grisel@ensta.org>
# Mathieu Blondel <mathieu@mblondel.org>
# Denis Engemann <d.engemann@fz-juelich.de>
#
# License: BSD 3 clause
import numpy as np
from scipy import sparse
from scipy import linalg
from scipy import stats
from sklearn.utils.testing import assert_eq... | bsd-3-clause |
cisco-openstack/tempest | tempest/lib/services/volume/v3/groups_client.py | 2 | 5170 | # Copyright (C) 2017 Dell Inc. or its subsidiaries.
# 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 |
r-mibu/ceilometer | ceilometer/tests/network/statistics/opendaylight/test_driver.py | 12 | 66291 | #
# Copyright 2013 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 by applicable... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.